Files
owncast/static/web/_next/static/chunks/5888-e12013a9212a9962.js
2024-12-16 13:07:51 +00:00

1 line
91 KiB
JavaScript
Vendored

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5888],{99717:function(t,e,n){"use strict";n.d(e,{e:function(){return j}});var r,i,o=n(67294),a=n(52798),s=n(63056),u=n(59043),c=n(54911),f=n(3884),h=n(30375),l=n(14066),p=n(89823),d={deferEvents:!1},v=function(){function t(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=(0,s.pi)((0,s.pi)({},d),t)}return t.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},t.prototype.schedule=function(t){if(!this.initialized||this.processingEvent){this.queue.push(t);return}if(0!==this.queue.length)throw Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},t.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(t){throw this.clear(),t}finally{this.processingEvent=!1}},t}(),y=n(98933),g=new Map,m=0,b={bookId:function(){return"x:".concat(m++)},register:function(t,e){return g.set(t,e),t},get:function(t){return g.get(t)},free:function(t){g.delete(t)}};function w(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void(l.M||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}var x=n(10797),S={sync:!1,autoForward:!1};(r=i||(i={}))[r.NotStarted=0]="NotStarted",r[r.Running=1]="Running",r[r.Stopped=2]="Stopped";var E=function(){function t(e,n){void 0===n&&(n=t.defaultOptions);var r=this;this.machine=e,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=i.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(t,e){if((0,p.kJ)(t))return r.batch(t),r.state;var n=(0,p.g5)((0,p._v)(t,e));if(r.status===i.Stopped)return l.M||(0,p.ZK)(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(r.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),r.state;if(r.status!==i.Running&&!r.options.deferEvents)throw Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(r.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return r.scheduler.schedule(function(){r.forward(n);var t=r._nextState(n);r.update(t,n)}),r._state},this.sendTo=function(t,e,n){var o=r.parent&&(e===u.K.Parent||r.parent.id===e),a=o?r.parent:(0,p.HD)(e)?e===u.K.Internal?r:r.children.get(e)||b.get(e):(0,p.Bc)(e)?e:void 0;if(!a){if(!o)throw Error("Unable to send event to child '".concat(e,"' from service '").concat(r.id,"'."));l.M||(0,p.ZK)(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(t.type));return}if("machine"in a){if(r.status!==i.Stopped||r.parent!==a||r.state.done){var c=(0,s.pi)((0,s.pi)({},t),{name:t.name===f.vU?"".concat((0,h.vU)(r.id)):t.name,origin:r.sessionId});!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,c]):a.send(c)}}else!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,t.data]):a.send(t.data)},this._exec=function(t,e,n,o){void 0===o&&(o=r.machine.options.actions);var a=t.exec||(0,h.o$)(t.type,o),s=(0,p.mf)(a)?a:a?a.exec:t.exec;if(s)try{return s(e,n.data,r.machine.config.predictableActionArguments?{action:t,_event:n}:{action:t,state:r.state,_event:n})}catch(t){throw r.parent&&r.parent.send({type:"xstate.error",data:t}),t}switch(t.type){case f.OU:r.defer(t);break;case f.lW:if("number"==typeof t.delay){r.defer(t);return}t.to?r.sendTo(t._event,t.to,n===h.bf):r.send(t._event);break;case f.al:r.cancel(t.sendId);break;case f.BL:if(r.status!==i.Running)return;var c=t.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[c.id||c.type])break;if(c.type===u.M.Invoke){var d=(0,p.j)(c.src),v=r.machine.options.services?r.machine.options.services[d.type]:void 0,y=c.id,g=c.data;l.M||(0,p.ZK)(!("forward"in c),"`forward` property is deprecated (found in invocation of '".concat(c.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var m="autoForward"in c?c.autoForward:!!c.forward;if(!v){l.M||(0,p.ZK)(!1,"No service found for invocation '".concat(c.src,"' in machine '").concat(r.machine.id,"'."));return}var b=g?(0,p.QX)(g,e,n):void 0;if("string"==typeof v)return;var w=(0,p.mf)(v)?v(e,n.data,{data:b,src:d,meta:c.meta}):v;if(!w)return;var x=void 0;(0,p.O4)(w)&&(w=b?w.withContext(b):w,x={autoForward:m}),r.spawn(w,y,x)}else r.spawnActivity(c);break;case f.sT:r.stopChild(t.activity.id);break;case f.cM:var S=t.label,E=t.value;S?r.logger(S,E):r.logger(E);break;default:l.M||(0,p.ZK)(!1,"No implementation found for action type '".concat(t.type,"'"))}};var o=(0,s.pi)((0,s.pi)({},t.defaultOptions),n),a=o.clock,c=o.logger,d=o.parent,y=o.id,g=void 0!==y?y:e.id;this.id=g,this.logger=c,this.clock=a,this.parent=d,this.options=o,this.scheduler=new v({deferEvents:this.options.deferEvents}),this.sessionId=b.bookId()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:(0,x.J)(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return l.M||(0,p.ZK)(this.status!==i.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,e){var n,r;try{for(var i=(0,s.XA)(t.actions),o=i.next();!o.done;o=i.next()){var a=o.value;this.exec(a,t,e)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},t.prototype.update=function(t,e){var n,r,i,o,a,u,c,f,l=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||e===h.bf)&&this.options.execute)this.execute(this.state);else for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);if(this.children.forEach(function(t){l.state.children[t.id]=t}),this.devTools&&this.devTools.send(e.data,t),t.event)try{for(var v=(0,s.XA)(this.eventListeners),y=v.next();!y.done;y=v.next()){var g=y.value;g(t.event)}}catch(t){n={error:t}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}try{for(var m=(0,s.XA)(this.listeners),w=m.next();!w.done;w=m.next()){var g=w.value;g(t,t.event)}}catch(t){i={error:t}}finally{try{w&&!w.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var x=(0,s.XA)(this.contextListeners),S=x.next();!S.done;S=x.next())(0,S.value)(this.state.context,this.state.history?this.state.history.context:void 0)}catch(t){a={error:t}}finally{try{S&&!S.done&&(u=x.return)&&u.call(x)}finally{if(a)throw a.error}}if(this.state.done){var E=t.configuration.find(function(t){return"final"===t.type&&t.parent===l.machine}),A=E&&E.doneData?(0,p.QX)(E.doneData,t.context,e):void 0;this._doneEvent=(0,h.Sl)(this.id,A);try{for(var _=(0,s.XA)(this.doneListeners),O=_.next();!O.done;O=_.next()){var g=O.value;g(this._doneEvent)}}catch(t){c={error:t}}finally{try{O&&!O.done&&(f=_.return)&&f.call(_)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),b.free(this.sessionId)}},t.prototype.onTransition=function(t){return this.listeners.add(t),this.status===i.Running&&t(this.state,this.state.event),this},t.prototype.subscribe=function(t,e,n){var r=this,o=(0,p.zM)(t,e,n);this.listeners.add(o.next),this.status!==i.NotStarted&&o.next(this.state);var a=function(){r.doneListeners.delete(a),r.stopListeners.delete(a),o.complete()};return this.status===i.Stopped?o.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){r.listeners.delete(o.next),r.doneListeners.delete(a),r.stopListeners.delete(a)}}},t.prototype.onEvent=function(t){return this.eventListeners.add(t),this},t.prototype.onSend=function(t){return this.sendListeners.add(t),this},t.prototype.onChange=function(t){return this.contextListeners.add(t),this},t.prototype.onStop=function(t){return this.stopListeners.add(t),this},t.prototype.onDone=function(t){return this.status===i.Stopped&&this._doneEvent?t(this._doneEvent):this.doneListeners.add(t),this},t.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},t.prototype.start=function(t){var e=this;if(this.status===i.Running)return this;this.machine._init(),b.register(this.sessionId,this),this.initialized=!0,this.status=i.Running;var n=void 0===t?this.initialState:(0,x.J)(this,function(){return(0,c.TL)(t)?e.machine.resolveState(t):e.machine.resolveState(c.ZM.from(t,e.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){e.update(n,h.bf)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(t){(0,p.mf)(t.stop)&&t.stop()}),this.children.clear()},t.prototype._stop=function(){var t,e,n,r,o,a,u,c,f,h;try{for(var l=(0,s.XA)(this.listeners),p=l.next();!p.done;p=l.next()){var d=p.value;this.listeners.delete(d)}}catch(e){t={error:e}}finally{try{p&&!p.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}try{for(var y=(0,s.XA)(this.stopListeners),g=y.next();!g.done;g=y.next()){var d=g.value;d(),this.stopListeners.delete(d)}}catch(t){n={error:t}}finally{try{g&&!g.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}try{for(var m=(0,s.XA)(this.contextListeners),b=m.next();!b.done;b=m.next()){var d=b.value;this.contextListeners.delete(d)}}catch(t){o={error:t}}finally{try{b&&!b.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}try{for(var w=(0,s.XA)(this.doneListeners),x=w.next();!x.done;x=w.next()){var d=x.value;this.doneListeners.delete(d)}}catch(t){u={error:t}}finally{try{x&&!x.done&&(c=w.return)&&c.call(w)}finally{if(u)throw u.error}}if(!this.initialized)return this;this.initialized=!1,this.status=i.Stopped,this._initialState=void 0;try{for(var S=(0,s.XA)(Object.keys(this.delayedEventsMap)),E=S.next();!E.done;E=S.next()){var A=E.value;this.clock.clearTimeout(this.delayedEventsMap[A])}}catch(t){f={error:t}}finally{try{E&&!E.done&&(h=S.return)&&h.call(S)}finally{if(f)throw f.error}}this.scheduler.clear(),this.scheduler=new v({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var t=this,e=this.scheduler;return this._stop(),e.schedule(function(){if(null===(e=t._state)||void 0===e||!e.done){var e,n=(0,p.g5)({type:"xstate.stop"}),r=(0,x.J)(t,function(){var e=(0,p.xH)((0,s.ev)([],(0,s.CR)(t.state.configuration),!1).sort(function(t,e){return e.order-t.order}).map(function(e){return(0,h.AE)(e.onExit,t.machine.options.actions)})),r=(0,s.CR)((0,h.yC)(t.machine,t.state,t.state.context,n,[{type:"exit",actions:e}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),i=r[0],o=r[1],a=new c.ZM({value:t.state.value,context:o,_event:n,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:i.filter(function(t){return!(0,p.vK)(t)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return a.changed=!0,a});t.update(r,n),t._stopChildren(),b.free(t.sessionId)}}),this},t.prototype.batch=function(t){var e=this;if(this.status===i.NotStarted&&this.options.deferEvents)l.M||(0,p.ZK)(!1,"".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==i.Running)throw Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(t.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var r,i,o=e.state,a=!1,u=[];try{for(var f=(0,s.XA)(t),h=f.next();!h.done;h=f.next()){var l=h.value;!function(t){var r=(0,p.g5)(t);e.forward(r),o=(0,x.J)(e,function(){return e.machine.transition(o,r,void 0,n||void 0)}),u.push.apply(u,(0,s.ev)([],(0,s.CR)(e.machine.config.predictableActionArguments?o.actions:o.actions.map(function(t){return(0,c.j1)(t,o)})),!1)),a=a||!!o.changed}(l)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}o.changed=a,o.actions=u,e.update(o,(0,p.g5)(t[t.length-1]))})}},t.prototype.sender=function(t){return this.send.bind(this,t)},t.prototype._nextState=function(t,e){var n=this;void 0===e&&(e=!!this.machine.config.predictableActionArguments&&this._exec);var r=(0,p.g5)(t);if(0===r.name.indexOf(f.Mg)&&!this.state.nextEvents.some(function(t){return 0===t.indexOf(f.Mg)}))throw r.data.data;return(0,x.J)(this,function(){return n.machine.transition(n.state,r,void 0,e||void 0)})},t.prototype.nextState=function(t){return this._nextState(t,!1)},t.prototype.forward=function(t){var e,n;try{for(var r=(0,s.XA)(this.forwardTo),i=r.next();!i.done;i=r.next()){var o=i.value,a=this.children.get(o);if(!a)throw Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(o,"'."));a.send(t)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.defer=function(t){var e=this,n=this.clock.setTimeout(function(){"to"in t&&t.to?e.sendTo(t._event,t.to,!0):e.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=n)},t.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},t.prototype.exec=function(t,e,n){void 0===n&&(n=this.machine.options.actions),this._exec(t,e.context,e._event,n)},t.prototype.removeChild=function(t){var e;this.children.delete(t),this.forwardTo.delete(t),null===(e=this.state)||void 0===e||delete e.children[t]},t.prototype.stopChild=function(t){var e=this.children.get(t);e&&(this.removeChild(t),(0,p.mf)(e.stop)&&e.stop())},t.prototype.spawn=function(t,e,n){if(this.status!==i.Running)return(0,y.Xg)(t,e);if((0,p.y8)(t))return this.spawnPromise(Promise.resolve(t),e);if((0,p.mf)(t))return this.spawnCallback(t,e);if((0,y.f3)(t))return this.spawnActor(t,e);if((0,p.bi)(t))return this.spawnObservable(t,e);if((0,p.O4)(t))return this.spawnMachine(t,(0,s.pi)((0,s.pi)({},n),{id:e}));if((0,p.HV)(t))return this.spawnBehavior(t,e);throw Error('Unable to spawn entity "'.concat(e,'" of type "').concat(typeof t,'".'))},t.prototype.spawnMachine=function(e,n){var r=this;void 0===n&&(n={});var i=new t(e,(0,s.pi)((0,s.pi)({},this.options),{parent:this,id:n.id||e.id})),o=(0,s.pi)((0,s.pi)({},S),n);return o.sync&&i.onTransition(function(t){r.send(f.Vx,{state:t,id:i.id})}),this.children.set(i.id,i),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(t){r.removeChild(i.id),r.send((0,p.g5)(t,{origin:i.id}))}).start(),i},t.prototype.spawnBehavior=function(t,e){var n,r,i,o,a,s,u,c,f=(n={id:e,parent:this},r=t.initialState,i=new Set,o=[],a=!1,s=function(){if(!a){for(a=!0;o.length>0;){var e=o.shift();r=t.transition(r,e,c),i.forEach(function(t){return t.next(r)})}a=!1}},u=(0,y.vk)({id:n.id,send:function(t){o.push(t),s()},getSnapshot:function(){return r},subscribe:function(t,e,n){var o=(0,p.zM)(t,e,n);return i.add(o),o.next(r),{unsubscribe:function(){i.delete(o)}}}}),c={parent:n.parent,self:u,id:n.id||"anonymous",observers:i},r=t.start?t.start(c):r,u);return this.children.set(e,f),f},t.prototype.spawnPromise=function(t,e){var n,r,i=this,o=!1;t.then(function(t){o||(r=t,i.removeChild(e),i.send((0,p.g5)((0,h.Sl)(e,t),{origin:e})))},function(t){if(!o){i.removeChild(e);var n=(0,h.vU)(e,t);try{i.send((0,p.g5)(n,{origin:e}))}catch(r){(0,p.v4)(t,r,e),i.devTools&&i.devTools.send(n,i.state),i.machine.strict&&i.stop()}}});var a=((n={id:e,send:function(){},subscribe:function(e,n,r){var i=(0,p.zM)(e,n,r),o=!1;return t.then(function(t){!o&&(i.next(t),o||i.complete())},function(t){o||i.error(t)}),{unsubscribe:function(){return o=!0}}},stop:function(){o=!0},toJSON:function(){return{id:e}},getSnapshot:function(){return r}})[p.L$]=function(){return this},n);return this.children.set(e,a),a},t.prototype.spawnCallback=function(t,e){var n,r,i,o=this,a=!1,s=new Set,u=new Set;try{i=t(function(t){r=t,u.forEach(function(e){return e(t)}),a||o.send((0,p.g5)(t,{origin:e}))},function(t){s.add(t)})}catch(t){this.send((0,h.vU)(e,t))}if((0,p.y8)(i))return this.spawnPromise(i,e);var c=((n={id:e,send:function(t){return s.forEach(function(e){return e(t)})},subscribe:function(t){var e=(0,p.zM)(t);return u.add(e.next),{unsubscribe:function(){u.delete(e.next)}}},stop:function(){a=!0,(0,p.mf)(i)&&i()},toJSON:function(){return{id:e}},getSnapshot:function(){return r}})[p.L$]=function(){return this},n);return this.children.set(e,c),c},t.prototype.spawnObservable=function(t,e){var n,r,i=this,o=t.subscribe(function(t){r=t,i.send((0,p.g5)(t,{origin:e}))},function(t){i.removeChild(e),i.send((0,p.g5)((0,h.vU)(e,t),{origin:e}))},function(){i.removeChild(e),i.send((0,p.g5)((0,h.Sl)(e),{origin:e}))}),a=((n={id:e,send:function(){},subscribe:function(e,n,r){return t.subscribe(e,n,r)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:e}}})[p.L$]=function(){return this},n);return this.children.set(e,a),a},t.prototype.spawnActor=function(t,e){return this.children.set(e,t),t},t.prototype.spawnActivity=function(t){var e=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(!e){l.M||(0,p.ZK)(!1,"No implementation found for activity '".concat(t.type,"'"));return}var n=e(this.state.context,t);this.spawnEffect(t.id,n)},t.prototype.spawnEffect=function(t,e){var n;this.children.set(t,((n={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:e||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}})[p.L$]=function(){return this},n))},t.prototype.attachDev=function(){var t=w();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var e="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect((0,s.pi)((0,s.pi)({name:this.id,autoPause:!0,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},e),{features:(0,s.pi)({jump:!1,skip:!1},e?e.features:void 0)}),this.machine),this.devTools.init(this.state)}!function(t){if(w()){var e=function(){var t=w();if(t&&"__xstate__"in t)return t.__xstate__}();e&&e.register(t)}}(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[p.L$]=function(){return this},t.prototype.getSnapshot=function(){return this.status===i.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,e){return setTimeout(t,e)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},t.interpret=A,t}();function A(t,e){return new E(t,e)}var _=o.useLayoutEffect;function O(t){var e=o.useRef();return e.current||(e.current={v:t()}),e.current.v}var M=function(){return(M=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},T=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},k=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function C(t){return t}function j(t){for(var e,n,r,s,u,f,h,l,p,d=[],v=1;v<arguments.length;v++)d[v-1]=arguments[v];var y=k(d,1)[0],g=void 0===y?{}:y,m=(e=O(function(){return"function"==typeof t?t():t}),n=g.context,r=g.guards,s=g.actions,u=g.activities,f=g.services,h=g.delays,g.state,l=T(g,["context","guards","actions","activities","services","delays","state"]),p=O(function(){return A(e.withConfig({context:n,guards:r,actions:s,activities:u,services:f,delays:h},function(){return M(M({},e.context),n)}),l)}),_(function(){Object.assign(p.machine.options.actions,s),Object.assign(p.machine.options.guards,r),Object.assign(p.machine.options.activities,u),Object.assign(p.machine.options.services,f),Object.assign(p.machine.options.delays,h)},[s,r,u,f,h]),p),b=(0,o.useCallback)(function(){return m.status===i.NotStarted?g.state?c.ZM.create(g.state):m.machine.initialState:m.getSnapshot()},[m]),w=(0,o.useCallback)(function(t,e){return function(t,e,n){if(t.status===i.NotStarted)return!0;var r=void 0===n.changed&&(Object.keys(n.children).length>0||"boolean"==typeof e.changed);return!(n.changed||r)}(m,t,e)},[m]),x=(0,o.useCallback)(function(t){return m.subscribe(t).unsubscribe},[m]),S=(0,a.useSyncExternalStoreWithSelector)(x,b,b,C,w);return(0,o.useEffect)(function(){var t=g.state;return m.start(t?c.ZM.create(t):void 0),function(){m.stop(),m.status=i.NotStarted}},[]),[S,m.send,m]}},79742:function(t,e){"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return(n+r)*3/4-r},e.toByteArray=function(t){var e,n,o=u(t),a=o[0],s=o[1],c=new i((a+s)*3/4-s),f=0,h=s>0?a-4:a;for(n=0;n<h;n+=4)e=r[t.charCodeAt(n)]<<18|r[t.charCodeAt(n+1)]<<12|r[t.charCodeAt(n+2)]<<6|r[t.charCodeAt(n+3)],c[f++]=e>>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===s&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,c[f++]=255&e),1===s&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(function(t,e,r){for(var i,o=[],a=e;a<r;a+=3)o.push(n[(i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]))>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}(t,a,a+16383>s?s:a+16383));return 1===i?o.push(n[(e=t[r-1])>>2]+n[e<<4&63]+"=="):2===i&&o.push(n[(e=(t[r-2]<<8)+t[r-1])>>10]+n[e>>4&63]+n[e<<2&63]+"="),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)n[a]=o[a],r[o.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");-1===n&&(n=e);var r=n===e?0:4-n%4;return[n,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},48764:function(t,e,n){"use strict";var r=n(79742),i=n(80645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>2147483647)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,n){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!s.isEncoding(e))throw TypeError("Unknown encoding: "+e);var n=0|d(t,e),r=a(n),i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(k(t,Uint8Array)){var e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(k(t,ArrayBuffer)||t&&k(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(k(t,SharedArrayBuffer)||t&&k(t.buffer,SharedArrayBuffer)))return l(t,e,n);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return s.from(r,e,n);var i=function(t){if(s.isBuffer(t)){var e,n=0|p(t.length),r=a(n);return 0===r.length||t.copy(r,0,0,n),r}return void 0!==t.length?"number"!=typeof t.length||(e=t.length)!=e?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return c(t),a(t<0?0:0|p(t))}function h(t){for(var e=t.length<0?0:0|p(t.length),n=a(e),r=0;r<e;r+=1)n[r]=255&t[r];return n}function l(t,e,n){var r;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),s.prototype),r}function p(t){if(t>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||k(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return M(t).length;default:if(i)return r?-1:O(t).length;e=(""+e).toLowerCase(),i=!0}}function v(t,e,n){var i,o,a=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=C[t[o]];return i}(this,e,n);case"utf8":case"utf-8":return b(this,e,n);case"ascii":return function(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}(this,e,n);case"latin1":case"binary":return function(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}(this,e,n);case"base64":return i=e,o=n,0===i&&o===this.length?r.fromByteArray(this):r.fromByteArray(this.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length-1;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}(this,e,n);default:if(a)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),a=!0}}function y(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,i){var o;if(0===t.length)return -1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),(o=n=+n)!=o&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return -1;n=t.length-1}else if(n<0){if(!i)return -1;n=0}if("string"==typeof e&&(e=s.from(e,r)),s.isBuffer(e))return 0===e.length?-1:m(t,e,n,r,i);if("number"==typeof e)return(e&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):m(t,[e],n,r,i);throw TypeError("val must be string, number or Buffer")}function m(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return -1;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*a}else -1!==f&&(o-=o-f),f=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var h=!0,l=0;l<u;l++)if(c(t,o+l)!==c(e,l)){h=!1;break}if(h)return o}return -1}function b(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,u,c=t[i],f=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(f=c);break;case 2:(192&(o=t[i+1]))==128&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],a=t[i+2],(192&o)==128&&(192&a)==128&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,h=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}function w(t,e,n){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>n)throw RangeError("Trying to access beyond buffer length")}function x(t,e,n,r,i,o){if(!s.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw RangeError('"value" argument is out of bounds');if(n+r>t.length)throw RangeError("Index out of range")}function S(t,e,n,r,i,o){if(n+r>t.length||n<0)throw RangeError("Index out of range")}function E(t,e,n,r,o){return e=+e,n>>>=0,o||S(t,e,n,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,n,r,23,4),n+4}function A(t,e,n,r,o){return e=+e,n>>>=0,o||S(t,e,n,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,n,r,52,8),n+8}e.lW=s,e.h2=50,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,n){return u(t,e,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,n){return(c(t),t<=0)?a(t):void 0!==e?"string"==typeof n?a(t).fill(e,n):a(t).fill(e):a(t)},s.allocUnsafe=function(t){return f(t)},s.allocUnsafeSlow=function(t){return f(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(k(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),k(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);if(void 0===e)for(n=0,e=0;n<t.length;++n)e+=t[n].length;var n,r=s.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(k(o,Uint8Array))i+o.length>r.length?s.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else if(s.isBuffer(o))o.copy(r,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return r},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):v.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",n=e.h2;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(t,e,n,r,i){if(k(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return -1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,a=n-e,u=Math.min(o,a),c=this.slice(r,i),f=t.slice(e,n),h=0;h<u;++h)if(c[h]!==f[h]){o=c[h],a=f[h];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(t,e,n){return -1!==this.indexOf(t,e,n)},s.prototype.indexOf=function(t,e,n){return g(this,t,e,n,!0)},s.prototype.lastIndexOf=function(t,e,n){return g(this,t,e,n,!1)},s.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,a,s,u,c,f,h,l=this.length-e;if((void 0===n||n>l)&&(n=l),t.length>0&&(n<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var p=!1;;)switch(r){case"hex":return function(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(s!=s)break;t[n+a]=s}return a}(this,t,e,n);case"utf8":case"utf-8":return i=e,o=n,T(O(t,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return a=e,s=n,T(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(t),this,a,s);case"base64":return u=e,c=n,T(M(t),this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f=e,h=n,T(function(t,e){for(var n,r,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=(n=t.charCodeAt(o))>>8,i.push(n%256),i.push(r);return i}(t,this.length-f),this,f,h);default:if(p)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),p=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r=this.subarray(t,e);return Object.setPrototypeOf(r,s.prototype),r},s.prototype.readUintLE=s.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||w(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||w(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||w(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},s.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||w(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return(t>>>=0,e||w(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;x(this,t,e,n,i,0)}var o=1,a=0;for(this[e]=255&t;++a<n&&(o*=256);)this[e+a]=t/o&255;return e+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;x(this,t,e,n,i,0)}var o=n-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);x(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},s.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);x(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||x(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,n){return E(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return E(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return A(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return A(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,r){if(!s.isBuffer(t))throw TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},s.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!s.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===t.length){var i,o=t.charCodeAt(0);("utf8"===r&&o<128||"latin1"===r)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw RangeError("Out of range index");if(n<=e)return this;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var a=s.isBuffer(t)?t:s.from(t,r),u=a.length;if(0===u)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=a[i%u]}return this};var _=/[^+/0-9A-Za-z-_]/g;function O(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319||a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return o}function M(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(_,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function T(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length)&&!(i>=t.length);++i)e[i+n]=t[i];return i}function k(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var C=function(){for(var t="0123456789abcdef",e=Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)e[r+i]=t[n]+t[i];return e}()},80645:function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,f=-7,h=n?i-1:0,l=n?-1:1,p=t[e+h];for(h+=l,o=p&(1<<-f)-1,p>>=-f,f+=s;f>0;o=256*o+t[e+h],h+=l,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[e+h],h+=l,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,h=f>>1,l=23===i?5960464477539062e-23:0,p=r?0:o-1,d=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+h>=1?e+=l/u:e+=l*Math.pow(2,1-h),e*u>=2&&(a++,u/=2),a+h>=f?(s=0,a=f):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*v}},4511:function(t,e,n){"use strict";n.d(e,{SV:function(){return a}});var r=n(67294);let i=(0,r.createContext)(null),o={didCatch:!1,error:null};class a extends r.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=o}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){let{error:t}=this.state;if(null!==t){for(var e,n,r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];null===(e=(n=this.props).onReset)||void 0===e||e.call(n,{args:i,reason:"imperative-api"}),this.setState(o)}}componentDidCatch(t,e){var n,r;null===(n=(r=this.props).onError)||void 0===n||n.call(r,t,e)}componentDidUpdate(t,e){let{didCatch:n}=this.state,{resetKeys:r}=this.props;if(n&&null!==e.error&&function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length!==e.length||t.some((t,n)=>!Object.is(t,e[n]))}(t.resetKeys,r)){var i,a;null===(i=(a=this.props).onReset)||void 0===i||i.call(a,{next:r,prev:t.resetKeys,reason:"keys"}),this.setState(o)}}render(){let{children:t,fallbackRender:e,FallbackComponent:n,fallback:o}=this.props,{didCatch:a,error:s}=this.state,u=t;if(a){let t={error:s,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof e)u=e(t);else if(n)u=(0,r.createElement)(n,t);else if(void 0!==o)u=o;else throw s}return(0,r.createElement)(i.Provider,{value:{didCatch:a,error:s,resetErrorBoundary:this.resetErrorBoundary}},u)}}},83:function(t,e,n){"use strict";var r=n(67294),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=r.useState,a=r.useEffect,s=r.useLayoutEffect,u=r.useDebugValue;function c(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}}var f="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=o({inst:{value:n,getSnapshot:e}}),i=r[0].inst,f=r[1];return s(function(){i.value=n,i.getSnapshot=e,c(i)&&f({inst:i})},[t,n,e]),a(function(){return c(i)&&f({inst:i}),t(function(){c(i)&&f({inst:i})})},[t]),u(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:f},26251:function(t,e,n){"use strict";var r=n(67294),i=n(61688),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=i.useSyncExternalStore,s=r.useRef,u=r.useEffect,c=r.useMemo,f=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var h=s(null);if(null===h.current){var l={hasValue:!1,value:null};h.current=l}else l=h.current;var p=a(t,(h=c(function(){function t(t){if(!u){if(u=!0,a=t,t=r(t),void 0!==i&&l.hasValue){var e=l.value;if(i(e,t))return s=e}return s=t}if(e=s,o(a,t))return e;var n=r(t);return void 0!==i&&i(e,n)?(a=t,e):(a=t,s=n)}var a,s,u=!1,c=void 0===n?null:n;return[function(){return t(e())},null===c?void 0:function(){return t(c())}]},[e,n,r,i]))[0],h[1]);return u(function(){l.hasValue=!0,l.value=p},[p]),f(p),p}},61688:function(t,e,n){"use strict";t.exports=n(83)},52798:function(t,e,n){"use strict";t.exports=n(26251)},98933:function(t,e,n){"use strict";n.d(e,{Xg:function(){return u},f3:function(){return c},mu:function(){return s},vk:function(){return f}});var r=n(63056),i=n(89823),o=n(10797);function a(t){var e;return(e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}})[i.L$]=function(){return this},e}function s(t,e,n,r){var o,s=(0,i.j)(t.src),c=null===(o=null==e?void 0:e.options.services)||void 0===o?void 0:o[s.type],f=t.data?(0,i.QX)(t.data,n,r):void 0,h=c?u(c,t.id,f):a(t.id);return h.meta=t,h}function u(t,e,n){var r=a(e);if(r.deferred=!0,(0,i.O4)(t)){var s=r.state=(0,o.J)(void 0,function(){return(n?t.withContext(n):t).initialState});r.getSnapshot=function(){return s}}return r}function c(t){return function(t){try{return"function"==typeof t.send}catch(t){return!1}}(t)&&"id"in t}function f(t){var e;return(0,r.pi)(((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[i.L$]=function(){return this},e),t)}},4723:function(t,e,n){"use strict";n.d(e,{C:function(){return m}});var r=n(63056),i=n(89823),o=n(54911),a=n(3884),s=n(30375),u=n(14066),c=n(87353),f=n(56115),h=n(98933);function l(t){return(0,r.pi)((0,r.pi)({type:a.dw},t),{toJSON:function(){t.onDone,t.onError;var e=(0,r._T)(t,["onDone","onError"]);return(0,r.pi)((0,r.pi)({},e),{type:a.dw,src:function(t){if("string"==typeof t){var e={type:t};return e.toString=function(){return t},e}return t}(t.src)})}})}var p={},d=function(t){return"#"===t[0]},v=function(t,e,n){var r=n.slice(0,-1).some(function(t){return!("cond"in t)&&!("in"in t)&&((0,i.HD)(t.target)||(0,i.O4)(t.target))});(0,i.ZK)(!r,"One or more transitions for ".concat(""===e?"the transient event":"event '".concat(e,"'")," on state '").concat(t.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},y=function(){function t(e,n,o,a){void 0===o&&(o="context"in e?e.context:void 0);var h,d=this;this.config=e,this._context=o,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==a?void 0:a.parent,this.key=this.config.key||(null==a?void 0:a.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:c.iS),this.id=this.config.id||(0,r.ev)([this.machine.key],(0,r.CR)(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(h=this.config.schema)&&void 0!==h?h:{},this.description=this.config.description,u.M||(0,i.ZK)(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?(0,i.Q8)(this.config.states,function(e,n){var i,o=new t(e,{},void 0,{parent:d,key:n});return Object.assign(d.idMap,(0,r.pi)(((i={})[o.id]=o,i),o.idMap)),o}):p;var v=0;!function t(e){var n,i;e.order=v++;try{for(var o=(0,r.XA)((0,f.nI)(e)),a=o.next();!a.done;a=o.next()){var s=a.value;t(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some(function(t){return""===t.event}):""in this.config.on),this.strict=!!this.config.strict,this.onEntry=(0,i.qo)(this.config.entry||this.config.onEntry).map(function(t){return(0,s.Q8)(t)}),this.onExit=(0,i.qo)(this.config.exit||this.config.onExit).map(function(t){return(0,s.Q8)(t)}),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=(0,i.qo)(this.config.invoke).map(function(t,e){if((0,i.O4)(t)){var n,o,a=(0,i.bx)(d.id,e);return d.machine.options.services=(0,r.pi)(((n={})[a]=t,n),d.machine.options.services),l({src:a,id:a})}if((0,i.HD)(t.src)){var a=t.id||(0,i.bx)(d.id,e);return l((0,r.pi)((0,r.pi)({},t),{id:a,src:t.src}))}if((0,i.O4)(t.src)||(0,i.mf)(t.src)){var a=t.id||(0,i.bx)(d.id,e);return d.machine.options.services=(0,r.pi)(((o={})[a]=t.src,o),d.machine.options.services),l((0,r.pi)((0,r.pi)({id:a},t),{src:a}))}var s=t.src;return l((0,r.pi)((0,r.pi)({id:(0,i.bx)(d.id,e)},t),{src:s}))}),this.activities=(0,i.qo)(this.config.activities).concat(this.invoke).map(function(t){return(0,s.XA)(t)}),this.transition=this.transition.bind(this),this.tags=(0,i.qo)(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||(0,f.ac)(this).forEach(function(t){return t.on})},t.prototype.withConfig=function(e,n){var i=this.options,o=i.actions,a=i.activities,s=i.guards,u=i.services,c=i.delays;return new t(this.config,{actions:(0,r.pi)((0,r.pi)({},o),e.actions),activities:(0,r.pi)((0,r.pi)({},a),e.activities),guards:(0,r.pi)((0,r.pi)({},s),e.guards),services:(0,r.pi)((0,r.pi)({},u),e.services),delays:(0,r.pi)((0,r.pi)({},c),e.delays)},null!=n?n:this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return(0,i.mf)(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:(0,i.Q8)(this.states,function(t){return t.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(t,e){return t[e.eventType]=t[e.eventType]||[],t[e.eventType].push(e),t},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var e=""===t,n=this.transitions.filter(function(n){var r=n.eventType===t;return e?r:r||"*"===n.eventType});return this.__cache.candidates[t]=n,n},t.prototype.getDelayedTransitions=function(){var t=this,e=this.config.after;if(!e)return[];var n=function(e,n){var r=(0,i.mf)(e)?"".concat(t.id,":delay[").concat(n,"]"):e,o=(0,s.e4)(r,t.id);return t.onEntry.push((0,s.lW)(o,{delay:e})),t.onExit.push((0,s.al)(o)),o};return((0,i.kJ)(e)?e.map(function(t,e){var i=n(t.delay,e);return(0,r.pi)((0,r.pi)({},t),{event:i})}):(0,i.xH)(Object.keys(e).map(function(t,o){var a=e[t],s=(0,i.HD)(a)?{target:a}:a,u=isNaN(+t)?t:+t,c=n(u,o);return(0,i.qo)(s).map(function(t){return(0,r.pi)((0,r.pi)({},t),{event:c,delay:u})})}))).map(function(e){var n=e.delay;return(0,r.pi)((0,r.pi)({},t.formatTransition(e)),{delay:n})})},t.prototype.getStateNodes=function(t){var e,n=this;if(!t)return[];var a=t instanceof o.ZM?t.value:(0,i.WM)(t,this.delimiter);if((0,i.HD)(a)){var s=this.getStateNode(a).initial;return void 0!==s?this.getStateNodes(((e={})[a]=s,e)):[this,this.states[a]]}var u=Object.keys(a),c=[this];return c.push.apply(c,(0,r.ev)([],(0,r.CR)((0,i.xH)(u.map(function(t){return n.getStateNode(t).getStateNodes(a[t])}))),!1)),c},t.prototype.handles=function(t){var e=(0,i.x6)(t);return this.events.includes(e)},t.prototype.resolveState=function(t){var e=t instanceof o.ZM?t:o.ZM.create(t),n=Array.from((0,f.P_)([],this.getStateNodes(e.value)));return new o.ZM((0,r.pi)((0,r.pi)({},e),{value:this.resolve(e.value),configuration:n,done:(0,f.Ij)(n,this),tags:(0,f.Oe)(n),machine:this.machine}))},t.prototype.transitionLeafNode=function(t,e,n){var r=this.getStateNode(t).next(e,n);return r&&r.transitions.length?r:this.next(e,n)},t.prototype.transitionCompoundNode=function(t,e,n){var r=Object.keys(t),i=this.getStateNode(r[0])._transition(t[r[0]],e,n);return i&&i.transitions.length?i:this.next(e,n)},t.prototype.transitionParallelNode=function(t,e,n){var o,a,s={};try{for(var u=(0,r.XA)(Object.keys(t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=t[f];if(h){var l=this.getStateNode(f)._transition(h,e,n);l&&(s[f]=l)}}}catch(t){o={error:t}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}var p=Object.keys(s).map(function(t){return s[t]}),d=(0,i.xH)(p.map(function(t){return t.transitions}));if(!p.some(function(t){return t.transitions.length>0}))return this.next(e,n);var v=(0,i.xH)(Object.keys(s).map(function(t){return s[t].configuration}));return{transitions:d,exitSet:(0,i.xH)(p.map(function(t){return t.exitSet})),configuration:v,source:e,actions:(0,i.xH)(Object.keys(s).map(function(t){return s[t].actions}))}},t.prototype._transition=function(t,e,n){return(0,i.HD)(t)?this.transitionLeafNode(t,e,n):1===Object.keys(t).length?this.transitionCompoundNode(t,e,n):this.transitionParallelNode(t,e,n)},t.prototype.getTransitionData=function(t,e){return this._transition(t.value,t,(0,i.g5)(e))},t.prototype.next=function(t,e){var n,o,a,s=this,u=e.name,c=[],f=[];try{for(var h=(0,r.XA)(this.getCandidates(u)),l=h.next();!l.done;l=h.next()){var p=l.value,v=p.cond,y=p.in,g=t.context,m=!y||((0,i.HD)(y)&&d(y)?t.matches((0,i.WM)(this.getStateNodeById(y).path,this.delimiter)):(0,i.W)((0,i.WM)(y,this.delimiter),(0,i.ET)(this.path.slice(0,-2))(t.value))),b=!1;try{b=!v||(0,i.vx)(this.machine,v,g,e,t)}catch(t){throw Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(u,"' in state node '").concat(this.id,"':\n").concat(t.message))}if(b&&m){void 0!==p.target&&(f=p.target),c.push.apply(c,(0,r.ev)([],(0,r.CR)(p.actions),!1)),a=p;break}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}if(a){if(!f.length)return{transitions:[a],exitSet:[],configuration:t.value?[this]:[],source:t,actions:c};var w=(0,i.xH)(f.map(function(e){return s.getRelativeStateNodes(e,t.historyValue)})),x=!!a.internal;return{transitions:[a],exitSet:x?[]:(0,i.xH)(f.map(function(t){return s.getPotentiallyReenteringNodes(t)})),configuration:w,source:t,actions:c}}},t.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var e=[],n=this;n&&n!==t;)e.push(n),n=n.parent;return n!==t?[]:(e.push(t),e)},t.prototype.getActions=function(t,e,n,o,a,u,c){var h,l,p,d,v=this,y=u?(0,f.P_)([],this.getStateNodes(u.value)):[],g=new Set;try{for(var m=(0,r.XA)(Array.from(t).sort(function(t,e){return t.order-e.order})),b=m.next();!b.done;b=m.next()){var w=b.value;(!(0,f.e$)(y,w)||(0,f.e$)(n.exitSet,w)||w.parent&&g.has(w.parent))&&g.add(w)}}catch(t){h={error:t}}finally{try{b&&!b.done&&(l=m.return)&&l.call(m)}finally{if(h)throw h.error}}try{for(var x=(0,r.XA)(y),S=x.next();!S.done;S=x.next()){var w=S.value;(!(0,f.e$)(t,w)||(0,f.e$)(n.exitSet,w.parent))&&n.exitSet.push(w)}}catch(t){p={error:t}}finally{try{S&&!S.done&&(d=x.return)&&d.call(x)}finally{if(p)throw p.error}}n.exitSet.sort(function(t,e){return e.order-t.order});var E=Array.from(g).sort(function(t,e){return t.order-e.order}),A=new Set(n.exitSet),_=(0,i.xH)(E.map(function(t){var e=[];if("final"!==t.type)return e;var r=t.parent;if(!r.parent)return e;e.push((0,s.aT)(t.id,t.doneData),(0,s.aT)(r.id,t.doneData?(0,i.QX)(t.doneData,o,a):void 0));var u=r.parent;return"parallel"===u.type&&(0,f.G)(u).every(function(t){return(0,f.Ij)(n.configuration,t)})&&e.push((0,s.aT)(u.id)),e})),O=E.map(function(t){var e=t.onEntry,n=t.activities.map(function(t){return(0,s.BL)(t)});return{type:"entry",actions:(0,s.AE)(c?(0,r.ev)((0,r.ev)([],(0,r.CR)(e),!1),(0,r.CR)(n),!1):(0,r.ev)((0,r.ev)([],(0,r.CR)(n),!1),(0,r.CR)(e),!1),v.machine.options.actions)}}).concat({type:"state_done",actions:_.map(function(t){return(0,s.OU)(t)})}),M=Array.from(A).map(function(t){return{type:"exit",actions:(0,s.AE)((0,r.ev)((0,r.ev)([],(0,r.CR)(t.onExit),!1),(0,r.CR)(t.activities.map(function(t){return(0,s.sT)(t)})),!1),v.machine.options.actions)}}).concat({type:"transition",actions:(0,s.AE)(n.actions,this.machine.options.actions)}).concat(O);if(e){var T=(0,s.AE)((0,i.xH)((0,r.ev)([],(0,r.CR)(t),!1).sort(function(t,e){return e.order-t.order}).map(function(t){return t.onExit})),this.machine.options.actions).filter(function(t){return!(0,i.vK)(t)});return M.concat({type:"stop",actions:T})}return M},t.prototype.transition=function(t,e,n,a){void 0===t&&(t=this.initialState);var s,c=(0,i.g5)(e);if(t instanceof o.ZM)s=void 0===n?t:this.resolveState(o.ZM.from(t,n));else{var h=(0,i.HD)(t)?this.resolve((0,i.on)(this.getResolvedPath(t))):this.resolve(t),l=null!=n?n:this.machine.context;s=this.resolveState(o.ZM.from(h,l))}if(!u.M&&"*"===c.name)throw Error("An event cannot have the wildcard type ('".concat("*","')"));if(this.strict&&!this.events.includes(c.name)&&!(0,i.JQ)(c.name))throw Error("Machine '".concat(this.id,"' does not accept event '").concat(c.name,"'"));var p=this._transition(s.value,s,c)||{transitions:[],configuration:[],exitSet:[],source:s,actions:[]},d=(0,f.P_)([],this.getStateNodes(s.value)),v=p.configuration.length?(0,f.P_)(d,p.configuration):d;return p.configuration=(0,r.ev)([],(0,r.CR)(v),!1),this.resolveTransition(p,s,s.context,a,c)},t.prototype.resolveRaisedTransition=function(t,e,n,i){var o,a=t.actions;return(t=this.transition(t,e,void 0,i))._event=n,t.event=n.data,(o=t.actions).unshift.apply(o,(0,r.ev)([],(0,r.CR)(a),!1)),t},t.prototype.resolveTransition=function(t,e,n,u,c){var l,p,d,v,y=this;void 0===c&&(c=s.bf);var g=t.configuration,m=!e||t.transitions.length>0,b=m?t.configuration:e?e.configuration:[],w=(0,f.Ij)(b,this),x=m?(0,f.NA)(this.machine,g):void 0,S=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):void 0:void 0,E=this.getActions(new Set(b),w,t,n,c,e,u),A=e?(0,r.pi)({},e.activities):{};try{for(var _=(0,r.XA)(E),O=_.next();!O.done;O=_.next()){var M=O.value;try{for(var T=(d=void 0,(0,r.XA)(M.actions)),k=T.next();!k.done;k=T.next()){var C=k.value;C.type===a.BL?A[C.activity.id||C.activity.type]=C:C.type===a.sT&&(A[C.activity.id||C.activity.type]=!1)}}catch(t){d={error:t}}finally{try{k&&!k.done&&(v=T.return)&&v.call(T)}finally{if(d)throw d.error}}}}catch(t){l={error:t}}finally{try{O&&!O.done&&(p=_.return)&&p.call(_)}finally{if(l)throw l.error}}var j=(0,r.CR)((0,s.yC)(this,e,n,c,E,u,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),B=j[0],R=j[1],N=(0,r.CR)((0,i.uK)(B,i.vK),2),L=N[0],U=N[1],I=B.filter(function(t){var e;return t.type===a.BL&&(null===(e=t.activity)||void 0===e?void 0:e.type)===a.dw}).reduce(function(t,e){return t[e.activity.id]=(0,h.mu)(e.activity,y.machine,R,c),t},e?(0,r.pi)({},e.children):{}),P=new o.ZM({value:x||e.value,context:R,_event:c,_sessionid:e?e._sessionid:null,historyValue:x?S?(0,i.yv)(S,x):void 0:e?e.historyValue:void 0,history:!x||t.source?e:void 0,actions:x?U:[],activities:x?A:e?e.activities:{},events:[],configuration:b,transitions:t.transitions,children:I,done:w,tags:(0,f.Oe)(b),machine:this}),D=n!==R;P.changed=c.name===a.Vx||D;var V=P.history;V&&delete V.history;var H=!w&&(this._transient||g.some(function(t){return t._transient}));if(!m&&(!H||""===c.name))return P;var X=P;if(!w)for(H&&(X=this.resolveRaisedTransition(X,{type:a.IA},c,u));L.length;){var Z=L.shift();X=this.resolveRaisedTransition(X,Z._event,c,u)}var J=X.changed||(V?!!X.actions.length||D||typeof V.value!=typeof X.value||!(0,o.j_)(X.value,V.value):void 0);return X.changed=J,X.history=V,X},t.prototype.getStateNode=function(t){if(d(t))return this.machine.getStateNodeById(t);if(!this.states)throw Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var e=this.states[t];if(!e)throw Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return e},t.prototype.getStateNodeById=function(t){var e=d(t)?t.slice(1):t;if(e===this.id)return this;var n=this.machine.idMap[e];if(!n)throw Error("Child state node '#".concat(e,"' does not exist on machine '").concat(this.id,"'"));return n},t.prototype.getStateNodeByPath=function(t){if("string"==typeof t&&d(t))try{return this.getStateNodeById(t.slice(1))}catch(t){}for(var e=(0,i.Q9)(t,this.delimiter).slice(),n=this;e.length;){var r=e.shift();if(!r.length)break;n=n.getStateNode(r)}return n},t.prototype.resolve=function(t){var e,n=this;if(!t)return this.initialStateValue||p;switch(this.type){case"parallel":return(0,i.Q8)(this.initialStateValue,function(e,r){return e?n.getStateNode(r).resolve(t[r]||e):p});case"compound":if((0,i.HD)(t)){var r=this.getStateNode(t);if("parallel"===r.type||"compound"===r.type)return(e={})[t]=r.initialStateValue,e;return t}if(!Object.keys(t).length)return this.initialStateValue||{};return(0,i.Q8)(t,function(t,e){return t?n.getStateNode(e).resolve(t):p});default:return t||p}},t.prototype.getResolvedPath=function(t){if(d(t)){var e=this.machine.idMap[t.slice(1)];if(!e)throw Error("Unable to find state node '".concat(t,"'"));return e.path}return(0,i.Q9)(t,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var t,e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)e=(0,i.ib)(this.states,function(t){return t.initialStateValue||p},function(t){return"history"!==t.type});else if(void 0!==this.initial){if(!this.states[this.initial])throw Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));e=(0,f.N9)(this.states[this.initial])?this.initial:((t={})[this.initial]=this.states[this.initial].initialStateValue,t)}else e={};return this.__cache.initialStateValue=e,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(t,e){this._init();var n=this.getStateNodes(t);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=e?e:this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var t;if("history"===this.type){var e=this.config;t=(0,i.HD)(e.target)&&d(e.target)?(0,i.on)(this.machine.getStateNodeById(e.target).path.slice(this.path.length-1)):e.target}return t},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(t,e,n){return void 0===n&&(n=!0),n?"history"===t.type?t.resolveHistory(e):t.initialStateNodes:[t]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var t=this;if((0,f.N9)(this))return[this];if("compound"===this.type&&!this.initial)return u.M||(0,i.ZK)(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var e=(0,i.SA)(this.initialStateValue);return(0,i.xH)(e.map(function(e){return t.getFromRelativePath(e)}))},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var e=(0,r.CR)(t),n=e[0],i=e.slice(1);if(!this.states)throw Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var o=this.getStateNode(n);if("history"===o.type)return o.resolveHistory();if(!this.states[n])throw Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(i)},t.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:(0,i.ib)(this.states,function(e,n){if(!t)return e.historyValue();var r=(0,i.HD)(t)?void 0:t[n];return e.historyValue(r||e.initialStateValue)},function(t){return!t.history})}},t.prototype.resolveHistory=function(t){var e=this;if("history"!==this.type)return[this];var n=this.parent;if(!t){var r=this.target;return r?(0,i.xH)((0,i.SA)(r).map(function(t){return n.getFromRelativePath(t)})):n.initialStateNodes}var o=(0,i.gk)(n.path,"states")(t).current;return(0,i.HD)(o)?[n.getStateNode(o)]:(0,i.xH)((0,i.SA)(o).map(function(t){return"deep"===e.history?n.getFromRelativePath(t):[n.states[t[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var t=this,e=(0,i.xH)(Object.keys(this.states).map(function(e){return t.states[e].stateIds}));return[this.id].concat(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){if(this.__cache.events)return this.__cache.events;var t,e,n,i,o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=(0,r.XA)(Object.keys(o)),u=s.next();!u.done;u=s.next()){var c=o[u.value];if(c.states)try{for(var f=(n=void 0,(0,r.XA)(c.events)),h=f.next();!h.done;h=f.next()){var l=h.value;a.add("".concat(l))}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){return Array.from(new Set(this.transitions.filter(function(t){return!(!t.target&&!t.actions.length&&t.internal)}).map(function(t){return t.eventType})))},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(t){var e=this;if(void 0!==t)return t.map(function(t){if(!(0,i.HD)(t))return t;var n=t[0]===e.delimiter;if(n&&!e.parent)return e.getStateNodeByPath(t.slice(1));var r=n?e.key+t:t;if(!e.parent)return e.getStateNodeByPath(r);try{return e.parent.getStateNodeByPath(r)}catch(t){throw Error("Invalid transition definition for state node '".concat(e.id,"':\n").concat(t.message))}})},t.prototype.formatTransition=function(t){var e=this,n=(0,i.rg)(t.target),o="internal"in t?t.internal:!n||n.some(function(t){return(0,i.HD)(t)&&t[0]===e.delimiter}),a=this.machine.options.guards,u=this.resolveTarget(n),c=(0,r.pi)((0,r.pi)({},t),{actions:(0,s.AE)((0,i.qo)(t.actions)),cond:(0,i.Qi)(t.cond,a),target:u,source:this,internal:o,eventType:t.event,toJSON:function(){return(0,r.pi)((0,r.pi)({},c),{target:c.target?c.target.map(function(t){return"#".concat(t.id)}):void 0,source:"#".concat(e.id)})}});return c},t.prototype.formatTransitions=function(){var t,e,n,o=this;if(this.config.on){if(Array.isArray(this.config.on))n=this.config.on;else{var a=this.config.on,c=a["*"],f=(0,r._T)(a,["*"]);n=(0,i.xH)(Object.keys(f).map(function(t){u.M||""!==t||(0,i.ZK)(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(o.id,'".'));var e=(0,i.jh)(t,f[t]);return u.M||v(o,t,e),e}).concat((0,i.jh)("*",void 0===c?[]:c)))}}else n=[];var h=this.config.always?(0,i.jh)("",this.config.always):[],l=this.config.onDone?(0,i.jh)(String((0,s.aT)(this.id)),this.config.onDone):[];u.M||(0,i.ZK)(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var p=(0,i.xH)(this.invoke.map(function(t){var e=[];return t.onDone&&e.push.apply(e,(0,r.ev)([],(0,r.CR)((0,i.jh)(String((0,s.Sl)(t.id)),t.onDone)),!1)),t.onError&&e.push.apply(e,(0,r.ev)([],(0,r.CR)((0,i.jh)(String((0,s.vU)(t.id)),t.onError)),!1)),e})),d=this.after,y=(0,i.xH)((0,r.ev)((0,r.ev)((0,r.ev)((0,r.ev)([],(0,r.CR)(l),!1),(0,r.CR)(p),!1),(0,r.CR)(n),!1),(0,r.CR)(h),!1).map(function(t){return(0,i.qo)(t).map(function(t){return o.formatTransition(t)})}));try{for(var g=(0,r.XA)(d),m=g.next();!m.done;m=g.next()){var b=m.value;y.push(b)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(e=g.return)&&e.call(g)}finally{if(t)throw t.error}}return y},t}(),g=!1;function m(t,e){return u.M||"predictableActionArguments"in t||g||(g=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new y(t,e)}},54911:function(t,e,n){"use strict";n.d(e,{TL:function(){return c},ZM:function(){return h},j1:function(){return f},j_:function(){return function t(e,n){if(e===n)return!0;if(void 0===e||void 0===n)return!1;if((0,o.HD)(e)||(0,o.HD)(n))return e===n;var r=Object.keys(e),i=Object.keys(n);return r.length===i.length&&r.every(function(r){return t(e[r],n[r])})}}});var r=n(63056),i=n(87353),o=n(89823),a=n(56115),s=n(30375),u=n(14066);function c(t){return"object"==typeof t&&null!==t&&"value"in t&&"_event"in t}function f(t,e){var n=t.exec;return(0,r.pi)((0,r.pi)({},t),{exec:void 0!==n?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0})}var h=function(){function t(t){var e,n=this;this.actions=[],this.activities=i.qP,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||i.qP,this.meta=(0,a.xZ)(t.configuration),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=null!==(e=Array.isArray(t.tags)?new Set(t.tags):t.tags)&&void 0!==e?e:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return(0,a.nJ)(n.configuration)}})}return t.from=function(e,n){return e instanceof t?e.context!==n?new t({value:e.value,context:n,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):e:new t({value:e,context:n,_event:s.bf,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(e){return new t(e)},t.inert=function(e,n){if(e instanceof t){if(!e.actions.length)return e;var r=s.bf;return new t({value:e.value,context:n,_event:r,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,n)},t.prototype.toStrings=function(t,e){var n=this;if(void 0===t&&(t=this.value),void 0===e&&(e="."),(0,o.HD)(t))return[t];var i=Object.keys(t);return i.concat.apply(i,(0,r.ev)([],(0,r.CR)(i.map(function(r){return n.toStrings(t[r],e).map(function(t){return r+e+t})})),!1))},t.prototype.toJSON=function(){this.configuration,this.transitions;var t=this.tags;this.machine;var e=(0,r._T)(this,["configuration","transitions","tags","machine"]);return(0,r.pi)((0,r.pi)({},e),{tags:Array.from(t)})},t.prototype.matches=function(t){return(0,o.W)(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t.prototype.can=function(t){u.M&&(0,o.ZK)(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var e,n=null===(e=this.machine)||void 0===e?void 0:e.getTransitionData(this,t);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some(function(t){return void 0!==t.target||t.actions.length})},t}()},63056:function(t,e,n){"use strict";n.d(e,{CR:function(){return a},XA:function(){return o},_T:function(){return i},ev:function(){return s},pi:function(){return r}});var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function i(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function o(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(t,e,n){if(n||2==arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}},3884:function(t,e,n){"use strict";n.d(e,{BL:function(){return i},IA:function(){return c},Le:function(){return m},Mg:function(){return d},OU:function(){return a},RN:function(){return g},S1:function(){return l},Vx:function(){return y},al:function(){return u},cM:function(){return h},dw:function(){return p},f0:function(){return f},lW:function(){return s},sT:function(){return o},vU:function(){return v}});var r=n(59043),i=r.M.Start,o=r.M.Stop,a=r.M.Raise,s=r.M.Send,u=r.M.Cancel,c=r.M.NullEvent,f=r.M.Assign;r.M.After,r.M.DoneState;var h=r.M.Log,l=r.M.Init,p=r.M.Invoke;r.M.ErrorExecution;var d=r.M.ErrorPlatform,v=r.M.ErrorCustom,y=r.M.Update,g=r.M.Choose,m=r.M.Pure},30375:function(t,e,n){"use strict";n.d(e,{AE:function(){return h},BL:function(){return y},OU:function(){return p},Q8:function(){return f},Sl:function(){return w},XA:function(){return l},aT:function(){return b},al:function(){return v},bf:function(){return u},e4:function(){return m},lW:function(){return d},o$:function(){return c},sT:function(){return g},vU:function(){return x},yC:function(){return function t(e,n,u,c,l,p,d){void 0===d&&(d=!1);var v=d?[]:S(l),y=v.length?(0,a.dt)(u,c,v,n):u,g=d?[u]:void 0,m=[];return[(0,a.xH)(l.map(function(l){var v,b,w=[];try{for(var x=(0,r.XA)(l.actions),S=x.next();!S.done;S=x.next()){var E=S.value,A=function(l,v){var b;switch(v.type){case o.OU:var w=function(t,e,n,i){var s,u={_event:n},c=(0,a.g5)((0,a.mf)(t.event)?t.event(e,n.data,u):t.event);if((0,a.HD)(t.delay)){var f=i&&i[t.delay];s=(0,a.mf)(f)?f(e,n.data,u):f}else s=(0,a.mf)(t.delay)?t.delay(e,n.data,u):t.delay;return(0,r.pi)((0,r.pi)({},t),{type:o.OU,_event:c,delay:s})}(v,y,c,e.options.delays);return p&&"number"==typeof w.delay&&p(w,y,c),w;case o.lW:var x=function(t,e,n,i){var o,s={_event:n},u=(0,a.g5)((0,a.mf)(t.event)?t.event(e,n.data,s):t.event);if((0,a.HD)(t.delay)){var c=i&&i[t.delay];o=(0,a.mf)(c)?c(e,n.data,s):c}else o=(0,a.mf)(t.delay)?t.delay(e,n.data,s):t.delay;var f=(0,a.mf)(t.to)?t.to(e,n.data,s):t.to;return(0,r.pi)((0,r.pi)({},t),{to:f,_event:u,event:u.data,delay:o})}(v,y,c,e.options.delays);if(!s.M){var S=v.delay;(0,a.ZK)(!(0,a.HD)(S)||"number"==typeof x.delay,"No delay reference for delay expression '".concat(S,"' was found on machine '").concat(e.id,"'"))}return p&&x.to!==i.K.Internal&&("entry"===l?m.push(x):p(x,y,c)),x;case o.cM:var E,A=(E=y,(0,r.pi)((0,r.pi)({},v),{value:(0,a.HD)(v.expr)?v.expr:v.expr(E,c.data,{_event:c})}));return null==p||p(A,y,c),A;case o.RN:var _=null===(b=v.conds.find(function(t){var r=(0,a.Qi)(t.cond,e.options.guards);return!r||(0,a.vx)(e,r,y,c,p?void 0:n)}))||void 0===b?void 0:b.actions;if(!_)return[];var O=(0,r.CR)(t(e,n,y,c,[{type:l,actions:h((0,a.qo)(_),e.options.actions)}],p,d),2),M=O[0];return y=O[1],null==g||g.push(y),M;case o.Le:var _=v.get(y,c.data);if(!_)return[];var T=(0,r.CR)(t(e,n,y,c,[{type:l,actions:h((0,a.qo)(_),e.options.actions)}],p,d),2),k=T[0];return y=T[1],null==g||g.push(y),k;case o.sT:var C,j,A=(C=y,j=(0,a.mf)(v.activity)?v.activity(C,c.data):v.activity,{type:i.M.Stop,activity:"string"==typeof j?{id:j}:j});return null==p||p(A,u,c),A;case o.f0:y=(0,a.dt)(y,c,[v],p?void 0:n),null==g||g.push(y);break;default:var B=f(v,e.options.actions),R=B.exec;if(p)p(B,y,c);else if(R&&g){var N=g.length-1;B=(0,r.pi)((0,r.pi)({},B),{exec:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];R.apply(void 0,(0,r.ev)([g[N]],(0,r.CR)(e),!1))}})}return B}}(l.type,E);A&&(w=w.concat(A))}}catch(t){v={error:t}}finally{try{S&&!S.done&&(b=x.return)&&b.call(x)}finally{if(v)throw v.error}}return m.forEach(function(t){p(t,y,c)}),m.length=0,w})),y]}}});var r=n(63056),i=n(59043),o=n(3884),a=n(89823),s=n(14066),u=(0,a.g5)({type:o.S1});function c(t,e){return e&&e[t]||void 0}function f(t,e){var n;if((0,a.HD)(t)||"number"==typeof t){var i=c(t,e);n=(0,a.mf)(i)?{type:t,exec:i}:i||{type:t,exec:void 0}}else if((0,a.mf)(t))n={type:t.name||t.toString(),exec:t};else{var i=c(t.type,e);if((0,a.mf)(i))n=(0,r.pi)((0,r.pi)({},t),{exec:i});else if(i){var o=i.type||t.type;n=(0,r.pi)((0,r.pi)((0,r.pi)({},i),t),{type:o})}else n=t}return n}var h=function(t,e){return t?((0,a.kJ)(t)?t:[t]).map(function(t){return f(t,e)}):[]};function l(t){var e=f(t);return(0,r.pi)((0,r.pi)({id:(0,a.HD)(t)?t:e.id},e),{type:e.type})}function p(t,e){return{type:o.OU,event:"function"==typeof t?t:(0,a._v)(t),delay:e?e.delay:void 0,id:null==e?void 0:e.id}}function d(t,e){return{to:e?e.to:void 0,type:o.lW,event:(0,a.mf)(t)?t:(0,a._v)(t),delay:e?e.delay:void 0,id:e&&void 0!==e.id?e.id:(0,a.mf)(t)?t.name:(0,a.x6)(t)}}var v=function(t){return{type:o.al,sendId:t}};function y(t){var e=l(t);return{type:i.M.Start,activity:e,exec:void 0}}function g(t){var e=(0,a.mf)(t)?t:l(t);return{type:i.M.Stop,activity:e,exec:void 0}}function m(t,e){return"".concat(i.M.After,"(").concat(t,")").concat(e?"#".concat(e):"")}function b(t,e){var n="".concat(i.M.DoneState,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function w(t,e){var n="".concat(i.M.DoneInvoke,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function x(t,e){var n="".concat(i.M.ErrorPlatform,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}var S=function(t){var e,n,i=[];try{for(var a=(0,r.XA)(t),s=a.next();!s.done;s=a.next())for(var u=s.value,c=0;c<u.actions.length;){if(u.actions[c].type===o.f0){i.push(u.actions[c]),u.actions.splice(c,1);continue}c++}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i}},87353:function(t,e,n){"use strict";n.d(e,{TV:function(){return o},iS:function(){return r},qP:function(){return i},rt:function(){return a}});var r=".",i={},o="xstate.guard",a=""},14066:function(t,e,n){"use strict";n.d(e,{M:function(){return r}});var r=!0},10797:function(t,e,n){"use strict";n.d(e,{J:function(){return i}});var r=[],i=function(t,e){r.push(t);var n=e(t);return r.pop(),n}},56115:function(t,e,n){"use strict";n.d(e,{G:function(){return s},Ij:function(){return function t(e,n){return"compound"===n.type?s(n).some(function(t){return"final"===t.type&&l(e,t)}):"parallel"===n.type&&s(n).every(function(n){return t(e,n)})}},N9:function(){return o},NA:function(){return h},Oe:function(){return v},P_:function(){return c},ac:function(){return u},e$:function(){return l},nI:function(){return a},nJ:function(){return p},xZ:function(){return d}});var r=n(63056),i=n(89823),o=function(t){return"atomic"===t.type||"final"===t.type};function a(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function s(t){return a(t).filter(function(t){return"history"!==t.type})}function u(t){var e=[t];return o(t)?e:e.concat((0,i.xH)(s(t).map(u)))}function c(t,e){var n,i,o,a,u,c,h,l,p=f(new Set(t)),d=new Set(e);try{for(var v=(0,r.XA)(d),y=v.next();!y.done;y=v.next())for(var g=y.value,m=g.parent;m&&!d.has(m);)d.add(m),m=m.parent}catch(t){n={error:t}}finally{try{y&&!y.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}var b=f(d);try{for(var w=(0,r.XA)(d),x=w.next();!x.done;x=w.next()){var g=x.value;if("compound"!==g.type||b.get(g)&&b.get(g).length){if("parallel"===g.type)try{for(var S=(u=void 0,(0,r.XA)(s(g))),E=S.next();!E.done;E=S.next()){var A=E.value;d.has(A)||(d.add(A),p.get(A)?p.get(A).forEach(function(t){return d.add(t)}):A.initialStateNodes.forEach(function(t){return d.add(t)}))}}catch(t){u={error:t}}finally{try{E&&!E.done&&(c=S.return)&&c.call(S)}finally{if(u)throw u.error}}}else p.get(g)?p.get(g).forEach(function(t){return d.add(t)}):g.initialStateNodes.forEach(function(t){return d.add(t)})}}catch(t){o={error:t}}finally{try{x&&!x.done&&(a=w.return)&&a.call(w)}finally{if(o)throw o.error}}try{for(var _=(0,r.XA)(d),O=_.next();!O.done;O=_.next())for(var g=O.value,m=g.parent;m&&!d.has(m);)d.add(m),m=m.parent}catch(t){h={error:t}}finally{try{O&&!O.done&&(l=_.return)&&l.call(_)}finally{if(h)throw h.error}}return d}function f(t){var e,n,i=new Map;try{for(var o=(0,r.XA)(t),a=o.next();!a.done;a=o.next()){var s=a.value;i.has(s)||i.set(s,[]),s.parent&&(i.has(s.parent)||i.set(s.parent,[]),i.get(s.parent).push(s))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}function h(t,e){var n=c([t],e);return function t(e,n){var r=n.get(e);if(!r)return{};if("compound"===e.type){var i=r[0];if(!i)return{};if(o(i))return i.key}var a={};return r.forEach(function(e){a[e.key]=t(e,n)}),a}(t,f(n))}function l(t,e){return Array.isArray(t)?t.some(function(t){return t===e}):t instanceof Set&&t.has(e)}function p(t){return(0,r.ev)([],(0,r.CR)(new Set((0,i.xH)((0,r.ev)([],(0,r.CR)(t.map(function(t){return t.ownEvents})),!1)))),!1)}function d(t){return void 0===t&&(t=[]),t.reduce(function(t,e){return void 0!==e.meta&&(t[e.id]=e.meta),t},{})}function v(t){return new Set((0,i.xH)(t.map(function(t){return t.tags})))}},59043:function(t,e,n){"use strict";var r,i,o,a;n.d(e,{K:function(){return i},M:function(){return r}}),(o=r||(r={})).Start="xstate.start",o.Stop="xstate.stop",o.Raise="xstate.raise",o.Send="xstate.send",o.Cancel="xstate.cancel",o.NullEvent="",o.Assign="xstate.assign",o.After="xstate.after",o.DoneState="done.state",o.DoneInvoke="done.invoke",o.Log="xstate.log",o.Init="xstate.init",o.Invoke="xstate.invoke",o.ErrorExecution="error.execution",o.ErrorCommunication="error.communication",o.ErrorPlatform="error.platform",o.ErrorCustom="xstate.error",o.Update="xstate.update",o.Pure="xstate.pure",o.Choose="xstate.choose",(a=i||(i={})).Parent="#_parent",a.Internal="#_internal"},89823:function(t,e,n){"use strict";n.d(e,{Bc:function(){return N},ET:function(){return v},HD:function(){return k},HV:function(){return S},JQ:function(){return w},L$:function(){return B},O4:function(){return R},Q8:function(){return p},Q9:function(){return f},QX:function(){return b},Qi:function(){return C},SA:function(){return function t(e){return e?k(e)?[[e]]:g(Object.keys(e).map(function(n){var r=e[n];return"string"==typeof r||r&&Object.keys(r).length?t(e[n]).map(function(t){return[n].concat(t)}):[[n]]})):[[]]}},W:function(){return function t(e,n,r){void 0===r&&(r=s.iS);var i=h(e,r),o=h(n,r);return k(o)?!!k(i)&&o===i:k(i)?i in o:Object.keys(i).every(function(e){return e in o&&t(i[e],o[e])})}},WM:function(){return h},ZK:function(){return O},_v:function(){return L},bi:function(){return j},bx:function(){return Z},dt:function(){return _},g5:function(){return U},gk:function(){return y},ib:function(){return d},j:function(){return H},jh:function(){return I},kJ:function(){return M},mf:function(){return T},on:function(){return l},qo:function(){return m},rg:function(){return P},uK:function(){return E},v4:function(){return D},vK:function(){return J},vx:function(){return V},x6:function(){return c},xH:function(){return g},y8:function(){return x},yv:function(){return A},zM:function(){return X}});var r,i=n(63056),o=n(59043),a=n(3884),s=n(87353),u=n(14066);function c(t){try{return k(t)||"number"==typeof t?"".concat(t):t.type}catch(t){throw Error("Events must be strings or objects with a string event.type property.")}}function f(t,e){try{if(M(t))return t;return t.toString().split(e)}catch(e){throw Error("'".concat(t,"' is not a valid state path."))}}function h(t,e){return"object"==typeof t&&"value"in t&&"context"in t&&"event"in t&&"_event"in t?t.value:M(t)?l(t):"string"!=typeof t?t:l(f(t,e))}function l(t){if(1===t.length)return t[0];for(var e={},n=e,r=0;r<t.length-1;r++)r===t.length-2?n[t[r]]=t[r+1]:(n[t[r]]={},n=n[t[r]]);return e}function p(t,e){for(var n={},r=Object.keys(t),i=0;i<r.length;i++){var o=r[i];n[o]=e(t[o],o,t,i)}return n}function d(t,e,n){var r,o,a={};try{for(var s=(0,i.XA)(Object.keys(t)),u=s.next();!u.done;u=s.next()){var c=u.value,f=t[c];n(f)&&(a[c]=e(f,c,t))}}catch(t){r={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}var v=function(t){return function(e){var n,r,o=e;try{for(var a=(0,i.XA)(t),s=a.next();!s.done;s=a.next())o=o[s.value]}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}};function y(t,e){return function(n){var r,o,a=n;try{for(var s=(0,i.XA)(t),u=s.next();!u.done;u=s.next()){var c=u.value;a=a[e][c]}}catch(t){r={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}}function g(t){var e;return(e=[]).concat.apply(e,(0,i.ev)([],(0,i.CR)(t),!1))}function m(t){return void 0===t?[]:M(t)?t:[t]}function b(t,e,n){if(T(t))return t(e,n.data);var r,o,a={};try{for(var s=(0,i.XA)(Object.keys(t)),u=s.next();!u.done;u=s.next()){var c=u.value,f=t[c];T(f)?a[c]=f(e,n.data):a[c]=f}}catch(t){r={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}function w(t){return/^(done|error)\./.test(t)}function x(t){return!!(t instanceof Promise||null!==t&&(T(t)||"object"==typeof t)&&T(t.then))}function S(t){return null!==t&&"object"==typeof t&&"transition"in t&&"function"==typeof t.transition}function E(t,e){var n,r,o=(0,i.CR)([[],[]],2),a=o[0],s=o[1];try{for(var u=(0,i.XA)(t),c=u.next();!c.done;c=u.next()){var f=c.value;e(f)?a.push(f):s.push(f)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return[a,s]}function A(t,e){return{current:e,states:function t(e,n){return p(e.states,function(e,r){if(e){var i=(k(n)?void 0:n[r])||(e?e.current:void 0);if(i)return{current:i,states:t(e,i)}}})}(t,e)}}function _(t,e,n,r){return u.M||O(!!t,"Attempting to update undefined context"),t?n.reduce(function(t,n){var o,a,s=n.assignment,u={state:r,action:n,_event:e},c={};if(T(s))c=s(t,e.data,u);else try{for(var f=(0,i.XA)(Object.keys(s)),h=f.next();!h.done;h=f.next()){var l=h.value,p=s[l];c[l]=T(p)?p(t,e.data,u):p}}catch(t){o={error:t}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return Object.assign({},t,c)},t):t}var O=function(){};function M(t){return Array.isArray(t)}function T(t){return"function"==typeof t}function k(t){return"string"==typeof t}function C(t,e){return t?k(t)?{type:s.TV,name:t,predicate:e?e[t]:void 0}:T(t)?{type:s.TV,name:t.name,predicate:t}:t:void 0}function j(t){try{return"subscribe"in t&&T(t.subscribe)}catch(t){return!1}}u.M||(O=function(t,e){var n=t instanceof Error?t:void 0;if((n||!t)&&void 0!==console){var r=["Warning: ".concat(e)];n&&r.push(n),console.warn.apply(console,r)}});var B="function"==typeof Symbol&&Symbol.observable||"@@observable";function R(t){return!!t&&"__xstatenode"in t}function N(t){return!!t&&"function"==typeof t.send}function L(t,e){return k(t)||"number"==typeof t?(0,i.pi)({type:t},e):t}function U(t,e){if(!k(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var n=L(t);return(0,i.pi)({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function I(t,e){return(M(e)?e:[e]).map(function(e){return void 0===e||"string"==typeof e||R(e)?{target:e,event:t}:(0,i.pi)((0,i.pi)({},e),{event:t})})}function P(t){if(void 0!==t&&t!==s.rt)return m(t)}function D(t,e,n){if(!u.M){var r=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";if(t===e)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(t,"'.").concat(r));else{var i=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(t,"'. ").concat(r," Current error is '").concat(e,"'.").concat(i))}}}function V(t,e,n,r,i){var o=t.options.guards,a={state:i,cond:e,_event:r};if(e.type===s.TV)return((null==o?void 0:o[e.name])||e.predicate)(n,r.data,a);var u=null==o?void 0:o[e.type];if(!u)throw Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return u(n,r.data,a)}function H(t){return"string"==typeof t?{type:t}:t}function X(t,e,n){var r=function(){},i="object"==typeof t,o=i?t:null;return{next:((i?t.next:t)||r).bind(o),error:((i?t.error:e)||r).bind(o),complete:((i?t.complete:n)||r).bind(o)}}function Z(t,e){return"".concat(t,":invocation[").concat(e,"]")}function J(t){return(t.type===a.OU||t.type===a.lW&&t.to===o.K.Internal)&&"number"!=typeof t.delay}(r={})[B]=function(){return this},r[Symbol.observable]=function(){return this}}}]);