(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[11],{
/***/"+lMt":
/***/function(r,t,e){"use strict";
// EXPORTS
e.d(t,"a",(function(){/* binding */return i}));
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
var n=e("sRHE"),o=e("XcBm");
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
var u=e("d8ec");
// CONCATENATED MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@babel/runtime/helpers/esm/construct.js
function c(r,t,e){return(c=Object(u.a)()?Reflect.construct:function(r,t,e){var n=[null];n.push.apply(n,t);var u=new(Function.bind.apply(r,n));return e&&Object(o.a)(u,e.prototype),u}).apply(null,arguments)}
// CONCATENATED MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
function i(r){var t="function"===typeof Map?new Map:void 0;return(i=function(r){if(null===r||(e=r,-1===Function.toString.call(e).indexOf("[native code]")))return r;
// CONCATENATED MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
var e;if("function"!==typeof r)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(r))return t.get(r);t.set(r,u)}function u(){return c(r,arguments,Object(n.a)(this).constructor)}return u.prototype=Object.create(r.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),Object(o.a)(u,r)})(r)}
/***/},
/***/"8K1b":
/***/function(r,t,e){"use strict";
/* harmony export (binding) */e.d(t,"a",(function(){return o}));
/* harmony import */var n=e("XcBm");function o(r,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),t&&Object(n.a)(r,t)}
/***/},
/***/AqVP:
/***/function(r,t,e){"use strict";
// EXPORTS
e.d(t,"a",(function(){/* binding */return f}));
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
var n=e("sRHE"),o=e("d8ec"),u=e("T0aG"),c=e.n(u),i=e("pWxA");
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
// CONCATENATED MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
function a(r,t){return!t||"object"!==c()(t)&&"function"!==typeof t?Object(i.a)(r):t}
// CONCATENATED MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@babel/runtime/helpers/esm/createSuper.js
function f(r){var t=Object(o.a)();return function(){var e,o=Object(n.a)(r);if(t){var u=Object(n.a)(this).constructor;e=Reflect.construct(o,arguments,u)}else e=o.apply(this,arguments);return a(this,e)}}
/***/},
/***/Sb9N:
/***/function(r,t,e){"use strict";var n=Symbol.for("effection/iterable");function o(){return(o=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r}).apply(this,arguments)}function u(){var r=[],t=[],e=function(e){var n=r.pop();n?n({value:e,done:!0}):t.push({value:e,done:!0})},n=function(){return{perform:function(e){if(!t.length)return r.push(e),function(){var t=r.indexOf(e);t>-1&&r.splice(t,1)};e(t.shift())}}},u={next:n,close:function(){return e(arguments.length<=0?void 0:arguments[0])},closeWith:e,first:function(){
return regeneratorRuntime.mark((function r(){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,n();case 2:return t=r.sent,r.abrupt("return",t.done?void 0:t.value);case 4:case"end":return r.stop()}}),r)}))},expect:function(){
return regeneratorRuntime.mark((function r(){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,n();case 2:if(!(t=r.sent).done){r.next=5;break}throw new Error("expected to contain a value");case 5:return r.abrupt("return",t.value);case 6:case"end":return r.stop()}}),r)}))},forEach:function(r){
return regeneratorRuntime.mark((function t(){var e,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:if(!(e=t.sent).done){t.next=5;break}return t.abrupt("return",e.value);case 5:if(o=r(e.value),t.t0=o,!t.t0){t.next=10;break}return t.next=10,o;case 10:t.next=0;break;case 12:case"end":return t.stop()}}),t)}))},join:function(){return u.forEach((function(){}))},collect:function(){
return regeneratorRuntime.mark((function r(){var t,e;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=[],r.next=3,u.forEach((function(r){
return regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.push(r);case 1:case"end":return e.stop()}}),e)}))}));case 3:return e=r.sent,r.abrupt("return",regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.delegateYield(t,"t0",1);case 1:return r.abrupt("return",e);case 2:case"end":return r.stop()}}),r)}))());case 5:case"end":return r.stop()}}),r)}))},toArray:function(){
return regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=Array,r.next=3,u.collect();case 3:return r.t1=r.sent,r.abrupt("return",r.t0.from.call(r.t0,r.t1));case 5:case"end":return r.stop()}}),r)}))}};return o({send:function(e){var n=r.pop();n?n({value:e,done:!1}):t.push({value:e,done:!1})},subscription:u},u)}t.SymbolOperationIterable=n,t.createQueue=u,t.createStream=function r(t){var e,c,i=function(r){var e=u();return r.spawn(regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t(e.send);case 2:n=r.sent,e.closeWith(n);case 4:case"end":return r.stop()}}),r)}))),e.subscription},a=(e={subscribe:i,filter:function(t){return r((function(r){return a.forEach((function(e){
return regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t(e)&&r(e);case 1:case"end":return n.stop()}}),n)}))}))}))},init:regeneratorRuntime.mark((function r(t){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",i(t));case 1:case"end":return r.stop()}}),r)})),match:function(r){return a.filter(function r(t){return function(e){if("object"==typeof e&&"object"==typeof t){var n=e;return Object.entries(t).every((function(t){var e=t[0];return r(t[1])(n[e])}))}return e===t}}(r))},map:function(t){return r((function(r){return a.forEach((function(e){
return regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r(t(e));case 1:case"end":return n.stop()}}),n)}))}))}))},first:function(){
return regeneratorRuntime.mark((function r(t){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,i(t).first();case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r)}))},expect:function(){
return regeneratorRuntime.mark((function r(t){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,i(t).expect();case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r)}))},forEach:function(r){
return regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i(e).forEach(r);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)}))},join:function(){
return regeneratorRuntime.mark((function r(t){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,i(t).join();case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r)}))},collect:function(){
return regeneratorRuntime.mark((function r(t){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,i(t).collect();case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r)}))},toArray:function(){
return regeneratorRuntime.mark((function r(t){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,i(t).toArray();case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r)}))},buffer:function(t){var e=[];return t.spawn(a.forEach((function(r){e.push(r)}))),r((function(r){
return regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.forEach(r),t.next=3,a.forEach(r);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)}))}))},stringBuffer:function(t){var e="";return t.spawn(a.forEach((function(r){e+=""+r}))),o({},r((function(r){
return regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r(n=e),t.next=4,a.forEach((function(t){r(n+=""+t)}));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)}))})),{get value(){return e}})}},(c={})[n]=c[n]||{},c[n].get=function(){return i},function(r,t){for(var e in t)(u=t[e]).configurable=u.enumerable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,e,u);if(Object.getOwnPropertySymbols)for(var n=Object.getOwnPropertySymbols(t),o=0;o<n.length;o++){var u,c=n[o];(u=t[c]).configurable=u.enumerable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,c,u)}}(e,c),e);return a}},
/***/Segr:
/***/function(r,t,e){"use strict";e.r(t),
/* harmony export (binding) */e.d(t,"on",(function(){return s})),
/* harmony export (binding) */e.d(t,"onEmit",(function(){return p})),
/* harmony export (binding) */e.d(t,"once",(function(){return a})),
/* harmony export (binding) */e.d(t,"onceEmit",(function(){return f})),
/* harmony export (binding) */e.d(t,"throwOnErrorEvent",(function(){return l}));
/* harmony import */var n=e("Tpve"),o=regeneratorRuntime.mark(l);
/* harmony import */function u(r){return"function"===typeof r.addEventListener}function c(r,t,e){u(r)?r.addEventListener(t,e):r.on(t,e)}function i(r,t,e){u(r)?r.removeEventListener(t,e):r.off(t,e)}
/**
 * Takes an event source and event name and returns an
 * {@link effection:Operation} that produces the value emitted by that
 * event. Both {@link EventTarget} and {@link EventEmitter} are
 * supported.
 *
 * ### Example
 *
 * ``` javascript
 * let start = yield once(document, 'dragstart');
 * console.log(`drag started at (${start.pageX}, ${start.pageY})`);
 *
 * let end = yield once(document, 'dragend');
 * console.log(`drag ended at (${end.pageX}, ${end.pageY})`);
 * ```
 *
 * ### Example
 *
 * ``` javascript
 * let src = yield once(stream, 'pipe');
 * ```
 */function a(r,t){
return regeneratorRuntime.mark((function e(){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(r,t);case 2:return n=e.sent,o=n[0],e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)}))}
/**
 * Exactly like {@link once | once()} except the value produced is an
 * {@link Array} of all the arguments passed when the event was
 * dispatched.
 *
 * In very rare cases, some event emitters pass multiple arguments to
 * their event handlers. For example the {@link ChildProcess} in
 * NodeJS emits both a status code _and_ a signal to the 'exit'
 * event. It would not be possible to read the signal from the `exit`
 * event using just the `once()` operation, so you would need to use
 * the `onceEmit()` operation to get all the arguments sent to the
 * event handler as an array.
 *
 * While it is supported, you should never need to use `onceEmit()` on
 * an {@link EventTarget} since only a single argument is ever passed
 * to its event handler. In those cases, always use {@link once | once()}
 *
 * ### Example
 *
 * ```javascript
 * let [exitCode, signal] = yield onEmit(childProcess, 'exit');
 * ```
 */function f(r,t){return{perform:function(e){var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];e(t)};return c(r,t,n),function(){return i(r,t,n)}}}}
/**
 * Creates a {@link Stream} from an event source and event name that
 * produces the event as its next value every time that the source
 * raises it. Streams created in this way are infinite.
 *
 * Both {@link EventTarget} and {@link EventEmitter}
 * are supported.
 *
 * ### Example
 *
 * log every click in a web page:
 *
 * ```javascript
 * task.spawn(on(document, 'click').forEach(event => {
 *   console.log(`click at (${event.pageX}, ${event.pageY})`);
 * }));
 * ```
 *
 * ### Example
 *
 * buffer a node process's stdin into a single string:
 *
 * ```javascript
 * let buffer = '';
 * task.spawn(on(process.stdin, 'data').forEach(data => {
 *   buffer += data;
 * }));
 */function s(r,t){return p(r,t).map((function(r){return r[0]}))}
/**
 * Exactly like {@link on | on()} except each value produced by the
 * stream is an {@link Array} of all the arguments passed when the event was
 * dispatched.
 *
 * This should rarely be needed, and never with {@link EventTarget}s
 * which always invoke their event listeners with a single argument.
 *
 * ### Example
 *
 * stream an odd-ball event emitter that passes multiple arguments to
 * its handers. Most event emitters do not act this way:
 *
 * ```javascript
 * let emitter = new EventEmitter();
 *
 * task.spawn(onEmit(emitter, 'multiplication').forEach(([left, right]) => {
 *   console.log(`${left} times ${right} = ${left * right}!`);
 * }));
 *
 * yield sleep(10);
 *
 * emitter.emit('multiplication', 7, 6);
 * //=> 7 times 6 = 42!
 * ```
 *
 */function p(r,t){return Object(n.createStream)((function(e){
return regeneratorRuntime.mark((function n(){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e(t)},n.prev=1,c(r,t,o),void(n.next=5);case 5:return n.prev=5,i(r,t,o),n.finish(5);case 8:case"end":return n.stop()}}),n,null,[[1,,5,8]])}))}))}function l(r){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a(r,"error");case 2:throw t.sent;case 4:case"end":return t.stop()}}),o)}
/***/},
/***/T0aG:
/***/function(r,t){function e(t){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?(r.exports=e=function(r){return typeof r},r.exports.default=r.exports,r.exports.__esModule=!0):(r.exports=e=function(r){return r&&"function"===typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},r.exports.default=r.exports,r.exports.__esModule=!0),e(t)}r.exports=e,r.exports.default=r.exports,r.exports.__esModule=!0},
/***/Tpve:
/***/function(r,t,e){"use strict";r.exports=e("Sb9N")},
/***/WFte:
/***/function(r,t,e){"use strict";var n=regeneratorRuntime.mark(F),o=e("r2q8");function u(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function c(r,t,e){return t&&u(r.prototype,t),e&&u(r,e),r}function i(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,f(r,t)}function a(r){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}function f(r,t){return(f=Object.setPrototypeOf||function(r,t){return r.__proto__=t,r})(r,t)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(o){return!1}}function p(r,t,e){return(p=s()?Reflect.construct:function(r,t,e){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(r,n));return e&&f(o,e.prototype),o}).apply(null,arguments)}function l(r){var t="function"==typeof Map?new Map:void 0;return(l=function(r){if(null===r||-1===Function.toString.call(r).indexOf("[native code]"))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(r))return t.get(r);t.set(r,e)}function e(){return p(r,arguments,a(this).constructor)}return e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),f(e,r)})(r)}function v(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function h(r,t){var e;if("undefined"==typeof Symbol||null==r[Symbol.iterator]){if(Array.isArray(r)||(e=function(r,t){if(r){if("string"==typeof r)return v(r,void 0);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?v(r,void 0):void 0}}(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(e=r[Symbol.iterator]()).next.bind(e)}function m(){var r=function(){},t=function(){},e=new Promise((function(e,n){r=e,t=n}));return{resolve:r,reject:t,promise:e}}var d=Symbol("halt"),y=Symbol.for("effection/v2/iterator-controller/claimed");function b(r,t,e){void 0===e&&(e={});var n,o=!1,u=!1,c=k(r),i=[];function a(r){if(i.push(r),!u){var t;for(u=!0;t=i.shift();)f(t);u=!1}}function f(t){var u;try{u=t()}catch(r){return void c.reject(r)}u.done?o?c.halted():c.resolve(u.value):(n=E(u.value,{resourceScope:e.resourceScope||r,ignoreError:!0}),k(r).link(n),k(n).addTrapper(s),k(n).start())}function s(r){n=void 0,"completed"===r.state&&a((function(){return t.next(k(r).result)})),"errored"===r.state&&a((function(){return t.throw(k(r).error)})),"halted"===r.state&&a((function(){return t.return(void 0)}))}return{start:function(){if(t[y]){var r=new Error("An operation iterator can only be run once in a single task, but it looks like has been either yielded to, or run multiple times");r.name="DoubleEvalError",c.reject(r)}else t[y]=!0,a((function(){return t.next()}))},halt:function(){o||(o=!0,n?n.halt():a((function(){return t.return(void 0)})))}}}var g=function(r){function t(){return r.call(this,"halted")||this}return i(t,r),c(t,[{key:"__isEffectionHaltError",get:function(){return!0}}]),t}(l(Error));function w(r){var t;if(!(t=r)||!t.__isEffectionHaltError)throw r}function x(r){return JSON.stringify(r)}var O=function(){function r(r){this.emitter=r,this.current="pending"}var t=r.prototype;return t.transition=function(r,t){var e=this.current,n=t[e];if(!n){var o=Object.keys(t).map(x).join(", ");throw new Error("INTERNAL ERROR: state transition "+x(r)+" is not valid in current state "+x(e)+", should be one of "+o)}this.current=n,this.emitter.emit("state",{from:e,to:n})},t.start=function(){this.transition("start",{pending:"running"})},t.resolve=function(){this.transition("resolve",{running:"completing",completing:"completing",erroring:"erroring",halting:"halting"})},t.reject=function(){this.transition("reject",{running:"erroring",completing:"erroring",halting:"erroring",erroring:"erroring"})},t.halt=function(){this.transition("halt",{running:"halting",completing:"halting",halting:"halting",erroring:"erroring",halted:"halted",completed:"completed",errored:"errored"})},t.finish=function(){this.transition("finish",{completing:"completed",erroring:"errored",halting:"halted"})},c(r,[{key:"isFinishing",get:function(){return["completing","halting","erroring"].includes(this.current)}}]),r}(),R=0,j=Symbol.for("effection/v2/controls");function E(r,t){var e;void 0===t&&(t={});var n=++R,u=new Set,c=new Set,i=new Set,a=new o.EventEmitter,f=new O(a),s=m();function p(){f.isFinishing&&0===u.size&&(f.finish(),i.forEach((function(r){return r()})),c.forEach((function(r){return r(x)})),i.clear(),c.clear(),"completed"===f.current?s.resolve(y.result):"halted"===f.current?s.reject(new g):"errored"===f.current&&s.reject(y.error))}function l(r){for(var t,e=h(Array.from(u).reverse());!(t=e()).done;){var n=t.value,o=k(n);if(r||!o.options.blockParent)return o.addTrapper((function(){return l(r)})),void n.halt()}}s.promise.catch((function(){}));var v,y={options:t,children:u,start:function(){f.start(),v.start()},resolve:function(r){f.resolve(),y.result=r,l(!1),p()},reject:function(r){f.reject(),y.result=void 0,y.error=r,l(!0),p()},ensure:function(r){i.add(r)},halted:function(){f.halt(),l(!0),p()},link:function(r){u.has(r)||(k(r).addTrapper(y.trap),u.add(r),a.emit("link",r))},unlink:function(r){u.has(r)&&(k(r).removeTrapper(y.trap),u.delete(r),a.emit("unlink",r))},trap:function(r){u.has(r)&&("errored"!==r.state||k(r).options.ignoreError||t.ignoreChildErrors||y.reject(k(r).error),y.unlink(r)),p()},addTrapper:function(r){c.add(r)},removeTrapper:function(r){c.delete(r)},on:function(r,t){a.on(r,t)},off:function(r,t){a.off(r,t)}},x=((e={id:n,get state(){return f.current},catchHalt:function(){return s.promise.catch(w)},spawn:function(r,t){if(void 0===t&&(t={}),"running"!==f.current)throw new Error("cannot spawn a child on a task which is not running");t.resourceScope||(t.resourceScope=x);var e=E(r,t);return y.link(e),k(e).start(),e},halt:function(){try{return v.halt(),Promise.resolve(s.promise.catch((function(){}))).then((function(){}))}catch(o){return Promise.reject(o)}},then:function(){var r;return(r=s.promise).then.apply(r,arguments)},catch:function(){var r;return(r=s.promise).catch.apply(r,arguments)},finally:function(){var r;return(r=s.promise).finally.apply(r,arguments)}})[Symbol.toStringTag]="[Task "+n+"]",e[j]=y,e);return v=function r(t,e){if("function"==typeof e)return function(r,t){var e,n=k(r);return{start:function(){try{e=t()}catch(r){return void n.reject(r)}e.start()},halt:function(){if(!e)throw new Error("EFFECTION INTERNAL ERROR halt() called before start()");e.halt()}}}(t,(function(){return r(t,e(t))}));if(!e)return function(r){var t=k(r);return{start:function(){},halt:function(){t.halted()}}}(t);if("object"==typeof(n=e)&&"function"==typeof n.init)return function(r,t){var e,n=k(r),o=n.options.resourceScope;return{start:function(){if(!o)throw new Error("cannot spawn resource in task which has no resource scope");var u;try{u=t.init(o,r)}catch(r){return void n.reject(r)}(e=b(r,u,{resourceScope:o})).start()},halt:function(){e.halt()}}}(t,e);if(function(r){return r&&"function"==typeof r.perform}(e))return function(r,t){var e=k(r);return{start:function(){try{var r=t.perform(e.resolve,e.reject);r&&e.ensure(r)}catch(r){e.reject(r)}},halt:function(){e.halted()}}}(t,e);if(function(r){return r&&"function"==typeof r.then}(e))return function(r,t){var e=k(r),n=m();return{start:function(){Promise.race([t,n.promise]).then((function(r){r!==d&&e.resolve(r)}),(function(r){e.reject(r)}))},halt:function(){n.resolve(d),e.halted()}}}(t,e);if(function(r){return r&&"function"==typeof r.next}(e))return b(t,e);var n;throw new Error("unkown type of operation: "+e)}(x,r),x}function k(r){var t=r[j];if(!t)throw new Error("EFFECTION INTERNAL ERROR unable to retrieve controls for task "+r);return t}var S="__effectionV"+"2.0.0-preview.10".split(".")[0];function _(){var r=E(void 0,{ignoreChildErrors:!0});return k(r).start(),r}function P(){return globalThis[S]||(globalThis[S]={root:_()}),globalThis[S]}var T={get root(){return P().root},set root(r){P().root=r},reset:function(){try{return Promise.resolve(T.root.halt()).then((function(){T.root=_()}))}catch(o){return Promise.reject(o)}},halt:function(){try{return Promise.resolve(T.root.halt()).then((function(){}))}catch(o){return Promise.reject(o)}}};function A(r){if(r)return{perform:function(t){var e=setTimeout(t,r);return function(){return clearTimeout(e)}}}}var L=function(r){function t(){var t;return(t=r.apply(this,arguments)||this).name="TimeoutError",t}return i(t,r),t}(l(Error));function F(r){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,A(r);case 2:throw new L("timed out after "+r+"ms");case 3:case"end":return t.stop()}}),n)}t.Deferred=m,t.Effection=T,t.all=function(r){
return regeneratorRuntime.mark((function t(e){var n,o,u,c,i,a,f;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o=[],u=[],c=h(r);!(n=c()).done;)"running"===e.state&&o.push(e.spawn(n.value));i=0,a=o;case 2:if(!(i<a.length)){t.next=12;break}return f=a[i],t.t0=u,t.next=7,f;case 7:t.t1=t.sent,t.t0.push.call(t.t0,t.t1);case 9:i++,t.next=2;break;case 12:return t.abrupt("return",u);case 13:case"end":return t.stop()}}),t)}))},t.createTask=E,t.deprecated=function(r,t){return function(){try{throw new Error("trace")}catch(t){var e=t.stack.split("\n").slice(3,4),n=e[0];console.warn(r,"\n"+n)}for(var o=arguments.length,u=new Array(o),c=0;c<o;c++)u[c]=arguments[c];return t.call.apply(t,[this].concat(u))}},t.ensure=function(r){return{init:regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.spawn(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,void(t.next=3);case 3:if(t.prev=3,e=r(),t.t0=e,!t.t0){t.next=9;break}return t.next=9,e;case 9:return t.finish(3);case 10:case"end":return t.stop()}}),t,null,[[0,,3,10]])})));case 1:case"end":return t.stop()}}),t)}))}},t.getControls=k,t.race=function(r){return function(t){return{perform:function(e,n){for(var o,u=function(){var r=o.value;"running"===t.state&&t.spawn(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=e,t.next=4,r;case 4:t.t1=t.sent,(0,t.t0)(t.t1),t.next=11;break;case 8:t.prev=8,t.t2=t.catch(0),n(t.t2);case 11:case"end":return t.stop()}}),t,null,[[0,8]])})))},c=h(r);!(o=c()).done;)u()}}}},t.run=function(r,t){return T.root.spawn(r,t)},t.sleep=A,t.spawn=function(r){var t=regeneratorRuntime.mark(e);function e(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.spawn(r));case 1:case"end":return t.stop()}}),t)}return{init:e,within:function(r){return{init:function(){return e(r)}}}}},t.timeout=F,t.withTimeout=function(r,t){
return regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.spawn(F(r)),e.next=3,t;case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))}},
/***/d8ec:
/***/function(r,t,e){"use strict";
/* harmony export (binding) */function n(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}
/***/e.d(t,"a",(function(){return n}))},
/***/eklX:
/***/function(r,t,e){"use strict";
// EXPORTS
e.d(t,"a",(function(){/* binding */return y})),e.d(t,"b",(function(){/* binding */return b}));
// UNUSED EXPORTS: asEffect, asLayoutEffect
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/react/index.js
var n,o=e("ERkP"),u=e("C+hi");
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/xstate/es/State.js
!function(r){r[r.Effect=1]="Effect",r[r.LayoutEffect=2]="LayoutEffect"}(n||(n={}));
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js
var c=e("zcFU"),i=e("wMhT");
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/xstate/es/interpreter.js
// CONCATENATED MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@xstate/react/es/useConstant.js
function a(r){var t=o.useRef();return t.current||(t.current={v:r()}),t.current.v}
// CONCATENATED MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@xstate/react/es/utils.js
var f=function(r,t){var e="function"===typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,u=e.call(r),c=[];try{for(;(void 0===t||t-- >0)&&!(n=u.next()).done;)c.push(n.value)}catch(i){o={error:i}}finally{try{n&&!n.done&&(e=u.return)&&e.call(u)}finally{if(o)throw o.error}}return c},s=function(r){var t="function"===typeof Symbol&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&"number"===typeof r.length)return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};
// CONCATENATED MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@xstate/react/es/useReactEffectActions.js
var p=function(r,t){var e="function"===typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,u=e.call(r),c=[];try{for(;(void 0===t||t-- >0)&&!(n=u.next()).done;)c.push(n.value)}catch(i){o={error:i}}finally{try{n&&!n.done&&(e=u.return)&&e.call(u)}finally{if(o)throw o.error}}return c},l=function(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(p(arguments[t]));return r};function v(r){var t=Object(o.useRef)([]),e=Object(o.useRef)([]);Object(c.a)((function(){var o=r.subscribe((function(r){var o,u;if(r.actions.length){var c=r.actions.filter((function(r){return"function"===typeof r.exec&&"__effect"in r.exec})),i=p(function(r,t){var e,n,o=f([[],[]],2),u=o[0],c=o[1];try{for(var i=s(r),a=i.next();!a.done;a=i.next()){var p=a.value;t(p)?u.push(p):c.push(p)}}catch(l){e={error:l}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return[u,c]}(c,(function(r){return r.exec.__effect===n.Effect})),2),a=i[0],v=i[1];(o=t.current).push.apply(o,l(a.map((function(t){return[t,r]})))),(u=e.current).push.apply(u,l(v.map((function(t){return[t,r]}))))}}));return function(){o.unsubscribe()}}),[]),// this is somewhat weird - this should always be flushed within useLayoutEffect
// but we don't want to receive warnings about useLayoutEffect being used on the server
// so we have to use `useIsomorphicLayoutEffect` to silence those warnings
Object(c.a)((function(){for(;e.current.length;){var r=p(e.current.shift(),2);y(r[0],r[1])}})),// https://github.com/davidkpiano/xstate/pull/1202#discussion_r429677773
Object(o.useEffect)((function(){for(;t.current.length;){var r=p(t.current.shift(),2);y(r[0],r[1])}}))}
// CONCATENATED MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@xstate/react/es/useInterpret.js
var h=function(){return(h=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r}).apply(this,arguments)},m=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e};
// CONCATENATED MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/@xstate/react/es/useMachine.js
var d=function(r,t){var e="function"===typeof Symbol&&r[Symbol.iterator];if(!e)return r;var n,o,u=e.call(r),c=[];try{for(;(void 0===t||t-- >0)&&!(n=u.next()).done;)c.push(n.value)}catch(i){o={error:i}}finally{try{n&&!n.done&&(e=u.return)&&e.call(u)}finally{if(o)throw o.error}}return c};function y(r,t){(0,r.exec)(t.context,t._event.data,{action:r,state:t,_event:t._event})()}function b(r,t){void 0===t&&(t={});var e=Object(o.useCallback)((function(r){
// Only change the current state if:
// - the incoming state is the "live" initial state (since it might have new actors)
// - OR the incoming state actually changed.
// The "live" initial state will have .changed === undefined.
var t=void 0===r.changed&&Object.keys(r.children).length;(r.changed||t)&&p(r)}),[]),n=function(r,t,e){void 0===t&&(t={});var n=a((function(){return"function"===typeof r?r():r})),o=t.context,f=t.guards,s=t.actions,p=t.activities,l=t.services,d=t.delays,y=t.state,b=m(t,["context","guards","actions","activities","services","delays","state"]),g=a((function(){var r={context:o,guards:f,actions:s,activities:p,services:l,delays:d},t=n.withConfig(r,h(h({},n.context),o));return Object(i.a)(t,h({deferEvents:!0},b))}));return Object(c.a)((function(){var r;return e&&(r=g.subscribe(
// copied from core/src/utils.ts
// it avoids a breaking change between this package and XState which is its peer dep
function(r,t,e){if("object"===typeof r)return r;var n=function(){};return{next:r,error:void 0||n,complete:void 0||n}}(e))),function(){null===r||void 0===r||r.unsubscribe()}}),[e]),Object(c.a)((function(){return g.start(y?u.a.create(y):void 0),function(){g.stop()}}),[]),// Make sure actions and services are kept updated when they change.
// This mutation assignment is safe because the service instance is only used
// in one place -- this hook's caller.
Object(c.a)((function(){Object.assign(g.machine.options.actions,s)}),[s]),Object(c.a)((function(){Object.assign(g.machine.options.services,l)}),[l]),v(g),g}(r,t,e),f=d(Object(o.useState)((function(){var r=n.machine.initialState;return t.state?u.a.create(t.state):r})),2),s=f[0],p=f[1];return[s,n.send,n]}
/***/},
/***/iO0r:
/***/function(r,t,e){"use strict";r.exports=e("WFte")},
/***/"lP+p":
/***/function(r,t,e){"use strict";r.exports=e("yxcJ")},
/***/sRHE:
/***/function(r,t,e){"use strict";
/* harmony export (binding) */function n(r){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}
/***/e.d(t,"a",(function(){return n}))},
/***/yxcJ:
/***/function(r,t,e){"use strict";var n=e("Tpve"),o=e("Segr"),u=e("r2q8");function c(){return(c=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r}).apply(this,arguments)}t.createChannel=function(r){void 0===r&&(r={});var t=new u.EventEmitter;t.setMaxListeners(r.maxSubscribers?r.maxSubscribers:1e5);var e=n.createStream((function(r){
return regeneratorRuntime.mark((function e(n){var u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u=o.on(t,"event").subscribe(n);case 1:return e.next=3,u.next();case 3:if(!(c=e.sent.value).done){e.next=6;break}return e.abrupt("return",c.value);case 6:r(c.value);case 7:e.next=1;break;case 9:case"end":return e.stop()}}),e)}))}));return c({send:function(r){t.emit("event",{done:!1,value:r})},close:function(){t.emit("event",{done:!0,value:arguments.length<=0?void 0:arguments[0]})},stream:e},e)}}}]);
//# sourceMappingURL=7c2fe9ca71d2d4c839914525b72b580d6be96835-9722bd1d.b5fa0ea0.chunk.js.map