2024-01-31 07:59:56 -05:00
|
|
|
/******/ (() => { // webpackBootstrap
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ "use strict";
|
|
|
|
/******/ var __webpack_modules__ = ({
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
/***/ 6910:
|
2024-01-31 07:59:56 -05:00
|
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
2021-05-20 08:20:04 -04:00
|
|
|
|
|
|
|
|
2021-11-08 09:29:21 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
|
|
value: true
|
|
|
|
}));
|
|
|
|
exports.race = exports.join = exports.fork = exports.promise = undefined;
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _is = __webpack_require__(6921);
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var _is2 = _interopRequireDefault(_is);
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _helpers = __webpack_require__(3524);
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _dispatcher = __webpack_require__(5136);
|
2021-11-08 09:29:21 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var _dispatcher2 = _interopRequireDefault(_dispatcher);
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var promise = exports.promise = function promise(value, next, rungen, yieldNext, raiseNext) {
|
|
|
|
if (!_is2.default.promise(value)) return false;
|
|
|
|
value.then(next, raiseNext);
|
|
|
|
return true;
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var forkedTasks = new Map();
|
|
|
|
var fork = exports.fork = function fork(value, next, rungen) {
|
|
|
|
if (!_is2.default.fork(value)) return false;
|
|
|
|
var task = Symbol('fork');
|
|
|
|
var dispatcher = (0, _dispatcher2.default)();
|
|
|
|
forkedTasks.set(task, dispatcher);
|
|
|
|
rungen(value.iterator.apply(null, value.args), function (result) {
|
|
|
|
return dispatcher.dispatch(result);
|
|
|
|
}, function (err) {
|
|
|
|
return dispatcher.dispatch((0, _helpers.error)(err));
|
|
|
|
});
|
|
|
|
var unsubscribe = dispatcher.subscribe(function () {
|
|
|
|
unsubscribe();
|
|
|
|
forkedTasks.delete(task);
|
|
|
|
});
|
|
|
|
next(task);
|
|
|
|
return true;
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var join = exports.join = function join(value, next, rungen, yieldNext, raiseNext) {
|
|
|
|
if (!_is2.default.join(value)) return false;
|
|
|
|
var dispatcher = forkedTasks.get(value.task);
|
|
|
|
if (!dispatcher) {
|
|
|
|
raiseNext('join error : task not found');
|
|
|
|
} else {
|
|
|
|
(function () {
|
|
|
|
var unsubscribe = dispatcher.subscribe(function (result) {
|
|
|
|
unsubscribe();
|
|
|
|
next(result);
|
|
|
|
});
|
|
|
|
})();
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var race = exports.race = function race(value, next, rungen, yieldNext, raiseNext) {
|
|
|
|
if (!_is2.default.race(value)) return false;
|
|
|
|
var finished = false;
|
|
|
|
var success = function success(result, k, v) {
|
|
|
|
if (finished) return;
|
|
|
|
finished = true;
|
|
|
|
result[k] = v;
|
|
|
|
next(result);
|
|
|
|
};
|
2021-11-08 09:29:21 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var fail = function fail(err) {
|
|
|
|
if (finished) return;
|
|
|
|
raiseNext(err);
|
|
|
|
};
|
|
|
|
if (_is2.default.array(value.competitors)) {
|
|
|
|
(function () {
|
|
|
|
var result = value.competitors.map(function () {
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
value.competitors.forEach(function (competitor, index) {
|
|
|
|
rungen(competitor, function (output) {
|
|
|
|
return success(result, index, output);
|
|
|
|
}, fail);
|
|
|
|
});
|
|
|
|
})();
|
|
|
|
} else {
|
|
|
|
(function () {
|
|
|
|
var result = Object.keys(value.competitors).reduce(function (p, c) {
|
|
|
|
p[c] = false;
|
|
|
|
return p;
|
|
|
|
}, {});
|
|
|
|
Object.keys(value.competitors).forEach(function (index) {
|
|
|
|
rungen(value.competitors[index], function (output) {
|
|
|
|
return success(result, index, output);
|
|
|
|
}, fail);
|
|
|
|
});
|
|
|
|
})();
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var subscribe = function subscribe(value, next) {
|
|
|
|
if (!_is2.default.subscribe(value)) return false;
|
|
|
|
if (!_is2.default.channel(value.channel)) {
|
|
|
|
throw new Error('the first argument of "subscribe" must be a valid channel');
|
|
|
|
}
|
|
|
|
var unsubscribe = value.channel.subscribe(function (ret) {
|
|
|
|
unsubscribe && unsubscribe();
|
|
|
|
next(ret);
|
|
|
|
});
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
return true;
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
exports["default"] = [promise, fork, join, race, subscribe];
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/***/ }),
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
/***/ 5357:
|
2024-01-31 07:59:56 -05:00
|
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
2021-05-20 08:20:04 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
|
|
value: true
|
|
|
|
}));
|
|
|
|
exports.iterator = exports.array = exports.object = exports.error = exports.any = undefined;
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _is = __webpack_require__(6921);
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var _is2 = _interopRequireDefault(_is);
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var any = exports.any = function any(value, next, rungen, yieldNext) {
|
|
|
|
yieldNext(value);
|
|
|
|
return true;
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var error = exports.error = function error(value, next, rungen, yieldNext, raiseNext) {
|
|
|
|
if (!_is2.default.error(value)) return false;
|
|
|
|
raiseNext(value.error);
|
|
|
|
return true;
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var object = exports.object = function object(value, next, rungen, yieldNext, raiseNext) {
|
|
|
|
if (!_is2.default.all(value) || !_is2.default.obj(value.value)) return false;
|
|
|
|
var result = {};
|
|
|
|
var keys = Object.keys(value.value);
|
|
|
|
var count = 0;
|
|
|
|
var hasError = false;
|
|
|
|
var gotResultSuccess = function gotResultSuccess(key, ret) {
|
|
|
|
if (hasError) return;
|
|
|
|
result[key] = ret;
|
|
|
|
count++;
|
|
|
|
if (count === keys.length) {
|
|
|
|
yieldNext(result);
|
|
|
|
}
|
2021-05-20 08:20:04 -04:00
|
|
|
};
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var gotResultError = function gotResultError(key, error) {
|
|
|
|
if (hasError) return;
|
|
|
|
hasError = true;
|
|
|
|
raiseNext(error);
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
keys.map(function (key) {
|
|
|
|
rungen(value.value[key], function (ret) {
|
|
|
|
return gotResultSuccess(key, ret);
|
|
|
|
}, function (err) {
|
|
|
|
return gotResultError(key, err);
|
|
|
|
});
|
|
|
|
});
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
return true;
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var array = exports.array = function array(value, next, rungen, yieldNext, raiseNext) {
|
|
|
|
if (!_is2.default.all(value) || !_is2.default.array(value.value)) return false;
|
|
|
|
var result = [];
|
|
|
|
var count = 0;
|
|
|
|
var hasError = false;
|
|
|
|
var gotResultSuccess = function gotResultSuccess(key, ret) {
|
|
|
|
if (hasError) return;
|
|
|
|
result[key] = ret;
|
|
|
|
count++;
|
|
|
|
if (count === value.value.length) {
|
|
|
|
yieldNext(result);
|
2021-05-20 08:20:04 -04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var gotResultError = function gotResultError(key, error) {
|
|
|
|
if (hasError) return;
|
|
|
|
hasError = true;
|
|
|
|
raiseNext(error);
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
value.value.map(function (v, key) {
|
|
|
|
rungen(v, function (ret) {
|
|
|
|
return gotResultSuccess(key, ret);
|
|
|
|
}, function (err) {
|
|
|
|
return gotResultError(key, err);
|
|
|
|
});
|
|
|
|
});
|
2020-10-13 09:10:30 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
return true;
|
|
|
|
};
|
2020-10-13 09:10:30 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var iterator = exports.iterator = function iterator(value, next, rungen, yieldNext, raiseNext) {
|
|
|
|
if (!_is2.default.iterator(value)) return false;
|
|
|
|
rungen(value, next, raiseNext);
|
|
|
|
return true;
|
|
|
|
};
|
2020-10-13 09:10:30 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
exports["default"] = [error, iterator, array, object, any];
|
2020-10-13 09:10:30 -04:00
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
/***/ 3304:
|
2024-01-31 07:59:56 -05:00
|
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
2019-03-21 08:48:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
2019-03-21 08:48:00 -04:00
|
|
|
value: true
|
2022-04-11 08:04:30 -04:00
|
|
|
}));
|
2021-05-20 08:20:04 -04:00
|
|
|
exports.cps = exports.call = undefined;
|
2019-03-21 08:48:00 -04:00
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _is = __webpack_require__(6921);
|
2019-03-21 08:48:00 -04:00
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
var _is2 = _interopRequireDefault(_is);
|
2019-03-21 08:48:00 -04:00
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
|
|
|
|
|
|
var call = exports.call = function call(value, next, rungen, yieldNext, raiseNext) {
|
|
|
|
if (!_is2.default.call(value)) return false;
|
|
|
|
try {
|
|
|
|
next(value.func.apply(value.context, value.args));
|
|
|
|
} catch (err) {
|
|
|
|
raiseNext(err);
|
2019-03-21 08:48:00 -04:00
|
|
|
}
|
2021-05-20 08:20:04 -04:00
|
|
|
return true;
|
2019-03-21 08:48:00 -04:00
|
|
|
};
|
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
var cps = exports.cps = function cps(value, next, rungen, yieldNext, raiseNext) {
|
|
|
|
var _value$func;
|
|
|
|
|
|
|
|
if (!_is2.default.cps(value)) return false;
|
|
|
|
(_value$func = value.func).call.apply(_value$func, [null].concat(_toConsumableArray(value.args), [function (err, result) {
|
|
|
|
if (err) raiseNext(err);else next(result);
|
|
|
|
}]));
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
exports["default"] = [call, cps];
|
2019-10-15 12:17:12 -04:00
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
/***/ 1508:
|
2024-01-31 07:59:56 -05:00
|
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
2018-12-17 22:14:52 -05:00
|
|
|
value: true
|
2022-04-11 08:04:30 -04:00
|
|
|
}));
|
2018-12-17 22:14:52 -05:00
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _builtin = __webpack_require__(5357);
|
2018-12-17 22:14:52 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var _builtin2 = _interopRequireDefault(_builtin);
|
2018-12-17 22:14:52 -05:00
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _is = __webpack_require__(6921);
|
2018-12-17 22:14:52 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var _is2 = _interopRequireDefault(_is);
|
2018-12-17 22:14:52 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2018-12-17 22:14:52 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var create = function create() {
|
|
|
|
var userControls = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var controls = [].concat(_toConsumableArray(userControls), _toConsumableArray(_builtin2.default));
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var runtime = function runtime(input) {
|
|
|
|
var success = arguments.length <= 1 || arguments[1] === undefined ? function () {} : arguments[1];
|
|
|
|
var error = arguments.length <= 2 || arguments[2] === undefined ? function () {} : arguments[2];
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var iterate = function iterate(gen) {
|
|
|
|
var yieldValue = function yieldValue(isError) {
|
|
|
|
return function (ret) {
|
|
|
|
try {
|
|
|
|
var _ref = isError ? gen.throw(ret) : gen.next(ret);
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var value = _ref.value;
|
|
|
|
var done = _ref.done;
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
if (done) return success(value);
|
|
|
|
next(value);
|
|
|
|
} catch (e) {
|
|
|
|
return error(e);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var next = function next(ret) {
|
|
|
|
controls.some(function (control) {
|
|
|
|
return control(ret, next, runtime, yieldValue(false), yieldValue(true));
|
|
|
|
});
|
|
|
|
};
|
2018-12-17 22:14:52 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
yieldValue(false)();
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var iterator = _is2.default.iterator(input) ? input : regeneratorRuntime.mark(function _callee() {
|
|
|
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
|
|
while (1) {
|
|
|
|
switch (_context.prev = _context.next) {
|
|
|
|
case 0:
|
|
|
|
_context.next = 2;
|
|
|
|
return input;
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
case 2:
|
|
|
|
return _context.abrupt('return', _context.sent);
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
case 3:
|
|
|
|
case 'end':
|
|
|
|
return _context.stop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, _callee, this);
|
2021-05-20 08:20:04 -04:00
|
|
|
})();
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
iterate(iterator, success, error);
|
|
|
|
};
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
return runtime;
|
2021-05-20 08:20:04 -04:00
|
|
|
};
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
exports["default"] = create;
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
/***/ 8975:
|
2024-01-31 07:59:56 -05:00
|
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
2018-12-17 22:14:52 -05:00
|
|
|
value: true
|
2022-04-11 08:04:30 -04:00
|
|
|
}));
|
2018-12-17 22:14:52 -05:00
|
|
|
exports.wrapControls = exports.asyncControls = exports.create = undefined;
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _helpers = __webpack_require__(3524);
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
|
|
Object.keys(_helpers).forEach(function (key) {
|
|
|
|
if (key === "default") return;
|
|
|
|
Object.defineProperty(exports, key, {
|
|
|
|
enumerable: true,
|
|
|
|
get: function get() {
|
|
|
|
return _helpers[key];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _create = __webpack_require__(1508);
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
|
|
var _create2 = _interopRequireDefault(_create);
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _async = __webpack_require__(6910);
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
|
|
var _async2 = _interopRequireDefault(_async);
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _wrap = __webpack_require__(3304);
|
2018-12-17 22:14:52 -05:00
|
|
|
|
|
|
|
var _wrap2 = _interopRequireDefault(_wrap);
|
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
|
|
|
exports.create = _create2.default;
|
|
|
|
exports.asyncControls = _async2.default;
|
|
|
|
exports.wrapControls = _wrap2.default;
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
/***/ 5136:
|
2024-01-31 07:59:56 -05:00
|
|
|
/***/ ((__unused_webpack_module, exports) => {
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
2018-12-17 22:14:52 -05:00
|
|
|
value: true
|
2022-04-11 08:04:30 -04:00
|
|
|
}));
|
|
|
|
var createDispatcher = function createDispatcher() {
|
|
|
|
var listeners = [];
|
|
|
|
|
|
|
|
return {
|
|
|
|
subscribe: function subscribe(listener) {
|
|
|
|
listeners.push(listener);
|
|
|
|
return function () {
|
|
|
|
listeners = listeners.filter(function (l) {
|
|
|
|
return l !== listener;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
},
|
|
|
|
dispatch: function dispatch(action) {
|
|
|
|
listeners.slice().forEach(function (listener) {
|
|
|
|
return listener(action);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
exports["default"] = createDispatcher;
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/***/ }),
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
/***/ 3524:
|
2024-01-31 07:59:56 -05:00
|
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
2022-04-11 08:04:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
|
|
value: true
|
|
|
|
}));
|
|
|
|
exports.createChannel = exports.subscribe = exports.cps = exports.apply = exports.call = exports.invoke = exports.delay = exports.race = exports.join = exports.fork = exports.error = exports.all = undefined;
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _keys = __webpack_require__(4137);
|
2022-04-11 08:04:30 -04:00
|
|
|
|
|
|
|
var _keys2 = _interopRequireDefault(_keys);
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2018-12-13 23:53:54 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var all = exports.all = function all(value) {
|
|
|
|
return {
|
|
|
|
type: _keys2.default.all,
|
|
|
|
value: value
|
|
|
|
};
|
2018-12-17 22:14:52 -05:00
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var error = exports.error = function error(err) {
|
|
|
|
return {
|
|
|
|
type: _keys2.default.error,
|
|
|
|
error: err
|
|
|
|
};
|
2018-12-17 22:14:52 -05:00
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var fork = exports.fork = function fork(iterator) {
|
|
|
|
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
|
|
args[_key - 1] = arguments[_key];
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: _keys2.default.fork,
|
|
|
|
iterator: iterator,
|
|
|
|
args: args
|
2018-12-17 22:14:52 -05:00
|
|
|
};
|
2022-04-11 08:04:30 -04:00
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var join = exports.join = function join(task) {
|
|
|
|
return {
|
|
|
|
type: _keys2.default.join,
|
|
|
|
task: task
|
2018-12-17 22:14:52 -05:00
|
|
|
};
|
2022-04-11 08:04:30 -04:00
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var race = exports.race = function race(competitors) {
|
|
|
|
return {
|
|
|
|
type: _keys2.default.race,
|
|
|
|
competitors: competitors
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
var delay = exports.delay = function delay(timeout) {
|
|
|
|
return new Promise(function (resolve) {
|
|
|
|
setTimeout(function () {
|
|
|
|
return resolve(true);
|
|
|
|
}, timeout);
|
2018-12-13 23:41:57 -05:00
|
|
|
});
|
2022-04-11 08:04:30 -04:00
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var invoke = exports.invoke = function invoke(func) {
|
|
|
|
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
|
|
args[_key2 - 1] = arguments[_key2];
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: _keys2.default.call,
|
|
|
|
func: func,
|
|
|
|
context: null,
|
|
|
|
args: args
|
|
|
|
};
|
2018-12-17 22:14:52 -05:00
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var call = exports.call = function call(func, context) {
|
|
|
|
for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
|
|
|
args[_key3 - 2] = arguments[_key3];
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: _keys2.default.call,
|
|
|
|
func: func,
|
|
|
|
context: context,
|
|
|
|
args: args
|
2018-12-13 23:41:57 -05:00
|
|
|
};
|
2022-04-11 08:04:30 -04:00
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var apply = exports.apply = function apply(func, context, args) {
|
|
|
|
return {
|
|
|
|
type: _keys2.default.call,
|
|
|
|
func: func,
|
|
|
|
context: context,
|
|
|
|
args: args
|
2018-12-13 23:41:57 -05:00
|
|
|
};
|
2022-04-11 08:04:30 -04:00
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var cps = exports.cps = function cps(func) {
|
|
|
|
for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
|
|
args[_key4 - 1] = arguments[_key4];
|
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
return {
|
|
|
|
type: _keys2.default.cps,
|
|
|
|
func: func,
|
|
|
|
args: args
|
|
|
|
};
|
2018-12-17 22:14:52 -05:00
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var subscribe = exports.subscribe = function subscribe(channel) {
|
|
|
|
return {
|
|
|
|
type: _keys2.default.subscribe,
|
|
|
|
channel: channel
|
|
|
|
};
|
2018-12-17 22:14:52 -05:00
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
var createChannel = exports.createChannel = function createChannel(callback) {
|
|
|
|
var listeners = [];
|
|
|
|
var subscribe = function subscribe(l) {
|
|
|
|
listeners.push(l);
|
|
|
|
return function () {
|
|
|
|
return listeners.splice(listeners.indexOf(l), 1);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var next = function next(val) {
|
|
|
|
return listeners.forEach(function (l) {
|
|
|
|
return l(val);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
callback(next);
|
|
|
|
|
|
|
|
return {
|
|
|
|
subscribe: subscribe
|
|
|
|
};
|
|
|
|
};
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
/***/ 6921:
|
2024-01-31 07:59:56 -05:00
|
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
2018-12-13 23:41:57 -05:00
|
|
|
value: true
|
2022-04-11 08:04:30 -04:00
|
|
|
}));
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
var _keys = __webpack_require__(4137);
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
var _keys2 = _interopRequireDefault(_keys);
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
var is = {
|
|
|
|
obj: function obj(value) {
|
|
|
|
return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !!value;
|
|
|
|
},
|
|
|
|
all: function all(value) {
|
|
|
|
return is.obj(value) && value.type === _keys2.default.all;
|
|
|
|
},
|
|
|
|
error: function error(value) {
|
|
|
|
return is.obj(value) && value.type === _keys2.default.error;
|
|
|
|
},
|
|
|
|
array: Array.isArray,
|
|
|
|
func: function func(value) {
|
|
|
|
return typeof value === 'function';
|
|
|
|
},
|
|
|
|
promise: function promise(value) {
|
|
|
|
return value && is.func(value.then);
|
|
|
|
},
|
|
|
|
iterator: function iterator(value) {
|
|
|
|
return value && is.func(value.next) && is.func(value.throw);
|
|
|
|
},
|
|
|
|
fork: function fork(value) {
|
|
|
|
return is.obj(value) && value.type === _keys2.default.fork;
|
|
|
|
},
|
|
|
|
join: function join(value) {
|
|
|
|
return is.obj(value) && value.type === _keys2.default.join;
|
|
|
|
},
|
|
|
|
race: function race(value) {
|
|
|
|
return is.obj(value) && value.type === _keys2.default.race;
|
|
|
|
},
|
|
|
|
call: function call(value) {
|
|
|
|
return is.obj(value) && value.type === _keys2.default.call;
|
|
|
|
},
|
|
|
|
cps: function cps(value) {
|
|
|
|
return is.obj(value) && value.type === _keys2.default.cps;
|
|
|
|
},
|
|
|
|
subscribe: function subscribe(value) {
|
|
|
|
return is.obj(value) && value.type === _keys2.default.subscribe;
|
|
|
|
},
|
|
|
|
channel: function channel(value) {
|
|
|
|
return is.obj(value) && is.func(value.subscribe);
|
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
};
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
exports["default"] = is;
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
2024-02-15 11:53:15 -05:00
|
|
|
/***/ 4137:
|
2024-01-31 07:59:56 -05:00
|
|
|
/***/ ((__unused_webpack_module, exports) => {
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
2018-12-13 23:41:57 -05:00
|
|
|
value: true
|
2022-04-11 08:04:30 -04:00
|
|
|
}));
|
2021-05-20 08:20:04 -04:00
|
|
|
var keys = {
|
|
|
|
all: Symbol('all'),
|
|
|
|
error: Symbol('error'),
|
|
|
|
fork: Symbol('fork'),
|
|
|
|
join: Symbol('join'),
|
|
|
|
race: Symbol('race'),
|
|
|
|
call: Symbol('call'),
|
|
|
|
cps: Symbol('cps'),
|
|
|
|
subscribe: Symbol('subscribe')
|
2018-12-13 23:41:57 -05:00
|
|
|
};
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
exports["default"] = keys;
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/***/ })
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ });
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ // The module cache
|
|
|
|
/******/ var __webpack_module_cache__ = {};
|
|
|
|
/******/
|
|
|
|
/******/ // The require function
|
|
|
|
/******/ function __webpack_require__(moduleId) {
|
|
|
|
/******/ // Check if module is in cache
|
|
|
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
|
|
/******/ if (cachedModule !== undefined) {
|
|
|
|
/******/ return cachedModule.exports;
|
|
|
|
/******/ }
|
|
|
|
/******/ // Create a new module (and put it into the cache)
|
|
|
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
|
|
/******/ // no module.id needed
|
|
|
|
/******/ // no module.loaded needed
|
|
|
|
/******/ exports: {}
|
|
|
|
/******/ };
|
|
|
|
/******/
|
|
|
|
/******/ // Execute the module function
|
|
|
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
|
|
/******/
|
|
|
|
/******/ // Return the exports of the module
|
|
|
|
/******/ return module.exports;
|
|
|
|
/******/ }
|
|
|
|
/******/
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ /* webpack/runtime/define property getters */
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ (() => {
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ // define getter functions for harmony exports
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ __webpack_require__.d = (exports, definition) => {
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ for(var key in definition) {
|
|
|
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
|
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
|
|
/******/ }
|
|
|
|
/******/ }
|
|
|
|
/******/ };
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ })();
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/
|
|
|
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ (() => {
|
|
|
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
|
|
/******/ })();
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/
|
|
|
|
/************************************************************************/
|
|
|
|
var __webpack_exports__ = {};
|
|
|
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
2024-01-31 07:59:56 -05:00
|
|
|
(() => {
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
// EXPORTS
|
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
2024-01-31 07:59:56 -05:00
|
|
|
"default": () => (/* binding */ createMiddleware)
|
2022-04-11 08:04:30 -04:00
|
|
|
});
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/is-generator.js
|
|
|
|
/* eslint-disable jsdoc/valid-types */
|
|
|
|
/**
|
|
|
|
* Returns true if the given object is a generator, or false otherwise.
|
|
|
|
*
|
|
|
|
* @see https://www.ecma-international.org/ecma-262/6.0/#sec-generator-objects
|
|
|
|
*
|
|
|
|
* @param {any} object Object to test.
|
|
|
|
*
|
|
|
|
* @return {object is Generator} Whether object is a generator.
|
|
|
|
*/
|
|
|
|
function isGenerator(object) {
|
|
|
|
/* eslint-enable jsdoc/valid-types */
|
|
|
|
// Check that iterator (next) and iterable (Symbol.iterator) interfaces are satisfied.
|
|
|
|
// These checks seem to be compatible with several generator helpers as well as the native implementation.
|
|
|
|
return !!object && typeof object[Symbol.iterator] === 'function' && typeof object.next === 'function';
|
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
// EXTERNAL MODULE: ./node_modules/rungen/dist/index.js
|
2024-02-15 11:53:15 -05:00
|
|
|
var dist = __webpack_require__(8975);
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: ./node_modules/is-promise/index.mjs
|
|
|
|
function isPromise(obj) {
|
|
|
|
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
|
|
|
}
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2023-06-27 10:24:19 -04:00
|
|
|
;// CONCATENATED MODULE: ./node_modules/is-plain-object/dist/is-plain-object.mjs
|
2022-09-20 11:43:29 -04:00
|
|
|
/*!
|
|
|
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
|
|
*
|
|
|
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
|
|
* Released under the MIT License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
function isObject(o) {
|
|
|
|
return Object.prototype.toString.call(o) === '[object Object]';
|
|
|
|
}
|
|
|
|
|
|
|
|
function isPlainObject(o) {
|
|
|
|
var ctor,prot;
|
|
|
|
|
|
|
|
if (isObject(o) === false) return false;
|
|
|
|
|
|
|
|
// If has modified constructor
|
|
|
|
ctor = o.constructor;
|
|
|
|
if (ctor === undefined) return true;
|
|
|
|
|
|
|
|
// If has modified prototype
|
|
|
|
prot = ctor.prototype;
|
|
|
|
if (isObject(prot) === false) return false;
|
|
|
|
|
|
|
|
// If constructor does not have an Object-specific method
|
|
|
|
if (prot.hasOwnProperty('isPrototypeOf') === false) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Most likely a plain Object
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/is-action.js
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2021-05-20 08:20:04 -04:00
|
|
|
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
/* eslint-disable jsdoc/valid-types */
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* Returns true if the given object quacks like an action.
|
|
|
|
*
|
|
|
|
* @param {any} object Object to test
|
|
|
|
*
|
|
|
|
* @return {object is import('redux').AnyAction} Whether object is an action.
|
|
|
|
*/
|
|
|
|
function isAction(object) {
|
2022-09-20 11:43:29 -04:00
|
|
|
return isPlainObject(object) && typeof object.type === 'string';
|
2022-04-11 08:04:30 -04:00
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* Returns true if the given object quacks like an action and has a specific
|
|
|
|
* action type
|
|
|
|
*
|
|
|
|
* @param {unknown} object Object to test
|
|
|
|
* @param {string} expectedType The expected type for the action.
|
|
|
|
*
|
|
|
|
* @return {object is import('redux').AnyAction} Whether object is an action and is of specific type.
|
|
|
|
*/
|
|
|
|
function isActionOfType(object, expectedType) {
|
|
|
|
/* eslint-enable jsdoc/valid-types */
|
|
|
|
return isAction(object) && object.type === expectedType;
|
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/runtime.js
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* Create a co-routine runtime.
|
|
|
|
*
|
2023-06-27 10:24:19 -04:00
|
|
|
* @param controls Object of control handlers.
|
|
|
|
* @param dispatch Unhandled action dispatch.
|
2022-04-11 08:04:30 -04:00
|
|
|
*/
|
2023-06-27 10:24:19 -04:00
|
|
|
function createRuntime(controls = {}, dispatch) {
|
|
|
|
const rungenControls = Object.entries(controls).map(([actionType, control]) => (value, next, iterate, yieldNext, yieldError) => {
|
|
|
|
if (!isActionOfType(value, actionType)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const routine = control(value);
|
|
|
|
if (isPromise(routine)) {
|
|
|
|
// Async control routine awaits resolution.
|
|
|
|
routine.then(yieldNext, yieldError);
|
|
|
|
} else {
|
|
|
|
yieldNext(routine);
|
|
|
|
}
|
|
|
|
return true;
|
2022-04-11 08:04:30 -04:00
|
|
|
});
|
|
|
|
const unhandledActionControl = (value, next) => {
|
|
|
|
if (!isAction(value)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
dispatch(value);
|
|
|
|
next();
|
|
|
|
return true;
|
2018-12-13 23:41:57 -05:00
|
|
|
};
|
2022-04-11 08:04:30 -04:00
|
|
|
rungenControls.push(unhandledActionControl);
|
|
|
|
const rungenRuntime = (0,dist.create)(rungenControls);
|
|
|
|
return action => new Promise((resolve, reject) => rungenRuntime(action, result => {
|
|
|
|
if (isAction(result)) {
|
|
|
|
dispatch(result);
|
|
|
|
}
|
|
|
|
resolve(result);
|
|
|
|
}, reject));
|
|
|
|
}
|
|
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/index.js
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-12-13 23:41:57 -05:00
|
|
|
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* Creates a Redux middleware, given an object of controls where each key is an
|
|
|
|
* action type for which to act upon, the value a function which returns either
|
|
|
|
* a promise which is to resolve when evaluation of the action should continue,
|
|
|
|
* or a value. The value or resolved promise value is assigned on the return
|
|
|
|
* value of the yield assignment. If the control handler returns undefined, the
|
|
|
|
* execution is not continued.
|
|
|
|
*
|
|
|
|
* @param {Record<string, (value: import('redux').AnyAction) => Promise<boolean> | boolean>} controls Object of control handlers.
|
|
|
|
*
|
|
|
|
* @return {import('redux').Middleware} Co-routine runtime
|
|
|
|
*/
|
2023-06-27 10:24:19 -04:00
|
|
|
function createMiddleware(controls = {}) {
|
2022-04-11 08:04:30 -04:00
|
|
|
return store => {
|
|
|
|
const runtime = createRuntime(controls, store.dispatch);
|
|
|
|
return next => action => {
|
|
|
|
if (!isGenerator(action)) {
|
|
|
|
return next(action);
|
|
|
|
}
|
|
|
|
return runtime(action);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2024-01-31 07:59:56 -05:00
|
|
|
})();
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
(window.wp = window.wp || {}).reduxRoutine = __webpack_exports__["default"];
|
|
|
|
/******/ })()
|
|
|
|
;
|