PageSourceSearch

https://toolsift.net/_next/static/chunks/2458-18ef723b80d29514.js

js toolsift.net collected 2026-10-07 01:09:17 UTC 41,785 bytes, 3 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2458],{86518:function(t,e,n){n.d(e,{P:function(){return r}});var i=n(3372),s=n(57637);function r(t){return new i.y(function(e){(0,s.Xf)(t()).subscribe(e)})}},75926:function(t,e,n){n.d(e,{E:function(){return s},c:function(){return r}});var i=n(3372),s=new i.y(function(t){return t.complete()});function r(t){return t?new i.y(function(e){return t.schedule(function(){return e.complete()})}):s}},33151:function(t,e,n){n.d(e,{R:function(){return function t(e,n,p,y){if((0,u.m)(p)&&(y=p,p=void 0),y)return t(e,n,p).pipe((0,c.Z)(y));var v=(0,i.CR)((0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)?f.map(function(t){return function(i){return e[t](n,i,p)}}):(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)?h.map(d(e,n)):(0,u.m)(e.on)&&(0,u.m)(e.off)?l.map(d(e,n)):[],2),g=v[0],m=v[1];if(!g&&(0,a.z)(e))return(0,o.z)(function(e){return t(e,n,p)})((0,s.Xf)(e));if(!g)throw TypeError("Invalid event target");return new r.y(function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return g(e),function(){return m(e)}})}}});var i=n(90390),s=n(57637),r=n(3372),o=n(95344),a=n(93163),u=n(95182),c=n(84182),h=["addListener","removeListener"],f=["addEventListener","removeEventListener"],l=["on","off"];function d(t,e){return function(n){return function(i){return t[n](e,i)}}}},44540:function(t,e,n){n.d(e,{b:function(){return r}});var i=n(95344),s=n(95182);function r(t,e){return(0,s.m)(e)?(0,i.z)(t,e,1):(0,i.z)(t,1)}},95344:function(t,e,n){n.d(e,{z:function(){return function t(e,n,u){return(void 0===u&&(u=1/0),(0,a.m)(n))?t(function(t,r){return(0,i.U)(function(e,i){return n(t,e,r,i)})((0,s.Xf)(e(t,r)))},u):("number"==typeof n&&(u=n),(0,r.e)(function(t,n){var i,r,a,c,h,f,l,d,p;return i=u,a=[],c=0,h=0,f=!1,l=function(){!f||a.length||c||n.complete()},d=function(t){return c<i?p(t):a.push(t)},p=function(t){c++;var u=!1;(0,s.Xf)(e(t,h++)).subscribe((0,o.x)(n,function(t){r?d(t):n.next(t)},function(){u=!0},void 0,function(){if(u)try{for(c--;a.length&&c<i;)!function(){var t=a.shift();p(t)}();l()}catch(t){n.error(t)}}))},t.subscribe((0,o.x)(n,d,function(){f=!0,l()})),function(){}}))}}});var i=n(31097),s=n(57637),r=n(83839),o=(n(28181),n(40323)),a=n(95182)},72130:function(t,e,n){n.d(e,{q:function(){return o}});var i=n(75926),s=n(83839),r=n(40323);function o(t){return t<=0?function(){return i.E}:(0,s.e)(function(e,n){var i=0;e.subscribe((0,r.x)(n,function(e){++i<=t&&(n.next(e),t<=i&&n.complete())}))})}},1656:function(t,e,n){n.d(e,{R:function(){return a}});var i=n(83839),s=n(40323),r=n(57637),o=n(92917);function a(t){return(0,i.e)(function(e,n){(0,r.Xf)(t).subscribe((0,s.x)(n,function(){return n.complete()},o.Z)),n.closed||e.subscribe(n)})}},92896:function(t,e,n){n.d(e,{E9:function(){return a},Y$:function(){return h},ah:function(){return v},p4:function(){return p}});var i,s,r=n(65936);let o=new WeakMap;function a(t){return{config:t,start:(e,n)=>{let{self:i,system:s,emit:r}=n,a={receivers:void 0,dispose:void 0};o.set(i,a),a.dispose=t({input:e.input,system:s,self:i,sendBack:t=>{"stopped"!==i.getSnapshot().status&&i._parent&&s._relay(i,i._parent,t)},receive:t=>{a.receivers??=new Set,a.receivers.add(t)},emit:r})},transition:(t,e,n)=>{let i=o.get(n.self);return e.type===r.X?(t={...t,status:"stopped",error:void 0},i.dispose?.()):i.receivers?.forEach(t=>t(e)),t},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}let u="xstate.observable.error",c="xstate.observable.complete";function h(t){return{config:t,transition:(t,e)=>{if("active"!==t.status)return t;switch(e.type){case u:return{...t,status:"error",error:e.data,input:void 0,_subscription:void 0};case c:return{...t,status:"done",input:void 0,_subscription:void 0};case r.X:return t._subscription.unsubscribe(),{...t,status:"stopped",input:void 0,_subscription:void 0};default:return t}},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:void 0,input:e,_subscription:void 0}),start:(e,{self:n,system:i,emit:s})=>{"done"!==e.status&&(e._subscription=t({input:e.input,system:i,self:n,emit:s}).subscribe({next:t=>{n._parent&&i._relay(n,n._parent,t)},error:t=>{i._relay(n,n,{type:u,data:t})},complete:()=>{i._relay(n,n,{type:c})}}))},getPersistedSnapshot:({_subscription:t,...e})=>e,restoreSnapshot:t=>({...t,_subscription:void 0})}}let f="xstate.promise.resolve",l="xstate.promise.reject",d=new WeakMap;function p(t){return{config:t,transition:(t,e,n)=>{if("active"!==t.status)return t;switch(e.type){case f:{let n=e.data;return{...t,status:"done",output:n,input:void 0}}case l:return{...t,status:"error",error:e.data,input:void 0};case r.X:return d.get(n.self)?.abort(),{...t,status:"stopped",input:void 0};default:return t}},start:(e,{self:n,system:i,emit:s})=>{if("active"!==e.status)return;let r=new AbortController;d.set(n,r),Promise.resolve(t({input:e.input,system:i,self:n,signal:r.signal,emit:s})).then(t=>
1{"active"===n.getSnapshot().status&&(d.delete(n),i._relay(n,n,{type:f,data:t}))},t=>{"active"===n.getSnapshot().status&&(d.delete(n),i._relay(n,n,{type:l,data:t}))})},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}let y=(s=void 0,{config:i=t=>void 0,transition:(t,e,n)=>({...t,context:i(t.context,e,n)}),getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof s?s({input:e}):s}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t});function v(){return(0,r.A)(y)}},77931:function(t,e,n){n.d(e,{a:function(){return o},b:function(){return g},c:function(){return p},e:function(){return c},s:function(){return y}});var i,s=n(65936);function r(t,e,n,i,{assignment:r}){if(!e.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let o={},a={context:e.context,event:n.event,spawn:function(t,{machine:e,context:n},i,r){let o=(o,a={})=>{let{systemId:u,input:c}=a;if("string"!=typeof o)return(0,s.A)(o,{id:a.id,parent:t.self,syncSnapshot:a.syncSnapshot,input:a.input,src:o,systemId:u});{let h=(0,s.z)(e,o);if(!h)throw Error(`Actor logic '${o}' not implemented in machine '${e.id}'`);let f=(0,s.A)(h,{id:a.id,parent:t.self,syncSnapshot:a.syncSnapshot,input:"function"==typeof c?c({context:n,event:i,self:t.self}):c,src:o,systemId:u});return r[f.id]=f,f}};return(e,n)=>{let i=o(e,n);return r[i.id]=i,t.defer(()=>{i._processingStatus!==s.T.Stopped&&i.start()}),i}}(t,e,n.event,o),self:t.self,system:t.system},u={};if("function"==typeof r)u=r(a,i);else for(let t of Object.keys(r)){let e=r[t];u[t]="function"==typeof e?e(a,i):e}let c=Object.assign({},e.context,u);return[(0,s.U)(e,{context:c,children:Object.keys(o).length?{...e.children,...o}:e.children})]}function o(t){function e(t,e){}return e.type="xstate.assign",e.assignment=t,e.resolve=r,e}function a(t,e,n,i,{event:s}){return[e,{event:"function"==typeof s?s(n,i):s}]}function u(t,{event:e}){t.defer(()=>t.emit(e))}function c(t){function e(t,e){}return e.type="xstate.emit",e.event=t,e.resolve=a,e.execute=u,e}let h=((i={}).Parent="#_parent",i.Internal="#_internal",i);function f(t,e,n,i,{to:s,event:r,id:o,delay:a},u){let c,f;let l=e.machine.implementations.delays;if("string"==typeof r)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${r}" }) instead`);let d="function"==typeof r?r(n,i):r;if("string"==typeof a){let t=l&&l[a];c="function"==typeof t?t(n,i):t}else c="function"==typeof a?a(n,i):a;let p="function"==typeof s?s(n,i):s;if("string"==typeof p){if(!(f=p===h.Parent?t.self._parent:p===h.Internal?t.self:p.startsWith("#_")?e.children[p.slice(2)]:u.deferredActorIds?.includes(p)?p:e.children[p]))throw Error(`Unable to send event to actor '${p}' from machine '${e.machine.id}'.`)}else f=p||t.self;return[e,{to:f,event:d,id:o,delay:c}]}function l(t,e,n){"string"==typeof n.to&&(n.to=e.children[n.to])}function d(t,e){t.defer(()=>{let{to:n,event:i,delay:r,id:o}=e;if("number"==typeof r){t.system.scheduler.schedule(t.self,n,i,r,o);return}t.system._relay(t.self,n,i.type===s.V?(0,s.W)(t.self.id,i.data):i)})}function p(t,e,n){function i(t,e){}return i.type="xsnapshot.sendTo",i.to=t,i.event=e,i.id=n?.id,i.delay=n?.delay,i.resolve=f,i.retryResolve=l,i.execute=d,i}function y(t,e){return p(h.Parent,t,e)}function v(t,e,n,i,{collect:r}){let a=[],u=function(t){a.push(t)};return u.assign=(...t)=>{a.push(o(...t))},u.cancel=(...t)=>{a.push((0,s.M)(...t))},u.raise=(...t)=>{a.push((0,s.O)(...t))},u.sendTo=(...t)=>{a.push(p(...t))},u.sendParent=(...t)=>{a.push(y(...t))},u.spawnChild=(...t)=>{a.push((0,s.P)(...t))},u.stopChild=(...t)=>{a.push((0,s.R)(...t))},u.emit=(...t)=>{a.push(c(...t))},r({context:n.context,event:n.event,enqueue:u,check:t=>(0,s.e)(t,e.context,n.event,e),self:t.self,system:t.system},i),[e,void 0,a]}function g(t){function e(t,e){}return e.type="xstate.enqueueActions",e.collect=t,e.resolve=v,e}},65936:function(t,e,n){var i;n.d(e,{$:function(){return O},A:function(){return M},M:function(){return C},N:function(){return a},O:function(){return tM},P:function(){return L},R:function(){return W},S:function(){return o},T:function(){return T},U:function(){return tO},V:function(){return c},W:function(){return l},X:function(){return h},a:function(){return x},b:function(){return tt},c:function(){return $},d:function(){return tn},e:function(){return X},f:function(){return te},g:function(){return Q},h:function(){return K},i:function(){return Z},j:function(){return tc},k:function(){return tj},l:function(){return F},m:function(){return m},n:function(){return t_},o:function(){return function t(e,n,i,s){return"string"==typeof n?function(t,e,n,i){let s=ta(t,e).next(n,i);return s&&s.length?s:t.next(n,i)}(e,n,i,s):1===Object.keys(n).length?function(e,n,i,s){let r=Object.keys(n),o=t(ta(e,r[0]),n[r[0]],i,s);return o&&o.length?o:e.next(i,s)}(e,n,i,s):function(e,n,i,s){let r=[];for(let o of Object.keys(n)){let a=n[o];if(!a)continue;let u=t(ta(e,o),a,i,s);u&&r.push(...u)}return r.length?r:e.next(i,s)}(e,n,i,s)}},p:function(){return tm},q:function(){return d},r:function(){return tx},s:function(){return ty},t:function(){return _},u:function(){return to},v:function(){return v},w:function(){return H},x:function(){return tu},y:function(){return tT},z:function(){return E}});let s=t=>{if("undefined"==typeof window)return;let e=function(){let t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void 0;if(t.__xstate__)return t.__xstate__}();e&&e.register(t)};
1class r{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){let e={value:t,next:null};if(this._current){this._last.next=e,this._last=e;return}this._current=e,this._last=e,this._active&&this.flush()}flush(){for(;this._current;){let t=this._current;this._process(t.value),this._current=t.next}this._last=null}}let o=".",a="",u="xstate.init",c="xstate.error",h="xstate.stop";function f(t,e){return{type:`xstate.done.state.${t}`,output:e}}function l(t,e){return{type:`xstate.error.actor.${t}`,error:e,actorId:t}}function d(t){return{type:u,input:t}}function p(t){setTimeout(()=>{throw t})}let y="function"==typeof Symbol&&Symbol.observable||"@@observable";function v(t){if(S(t))return t;let e=[],n="";for(let i=0;i<t.length;i++){switch(t.charCodeAt(i)){case 92:n+=t[i+1],i++;continue;case 46:e.push(n),n="";continue}n+=t[i]}return e.push(n),e}function g(t){return t&&"object"==typeof t&&"machine"in t&&"value"in t?t.value:"string"!=typeof t?t:function(t){if(1===t.length)return t[0];let e={},n=e;for(let e=0;e<t.length-1;e++)if(e===t.length-2)n[t[e]]=t[e+1];else{let i=n;n={},i[t[e]]=n}return e}(v(t))}function m(t,e){let n={},i=Object.keys(t);for(let s=0;s<i.length;s++){let r=i[s];n[r]=e(t[r],r,t,s)}return n}function _(t){return void 0===t?[]:S(t)?t:[t]}function b(t,e,n,i){return"function"==typeof t?t({context:e,event:n,self:i}):t}function S(t){return Array.isArray(t)}function x(t){return(S(t)?t:[t]).map(t=>void 0===t||"string"==typeof t?{target:t}:t)}function w(t){if(void 0!==t&&""!==t)return _(t)}function k(t,e,n){let i="object"==typeof t,s=i?t:void 0;return{next:(i?t.next:t)?.bind(s),error:(i?t.error:e)?.bind(s),complete:(i?t.complete:n)?.bind(s)}}function $(t,e){return`${e}.${t}`}function E(t,e){let n=e.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return t.implementations.actors[e];let[,i,s]=n,r=t.getStateNodeById(s).config.invoke;return(Array.isArray(r)?r[i]:r).src}function I(t,e){return`${t.sessionId}.${e}`}let j=0,O=1,T=((i={})[i.NotStarted=0]="NotStarted",i[i.Running=1]="Running",i[i.Stopped=2]="Stopped",i),A={clock:{setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},logger:console.log.bind(console),devTools:!1};class N{constructor(t,e){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new r(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=T.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this._systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];let n={...A,...e},{clock:i,logger:s,parent:o,syncSnapshot:a,id:u,systemId:c,inspect:h}=n;this.system=o?o.system:function(t,e){let n=new Map,i=new Map,s=new WeakMap,r=new Set,o={},{clock:a,logger:u}=e,c={schedule:(t,e,n,i,s=Math.random().toString(36).slice(2))=>{let r={source:t,target:e,event:n,delay:i,id:s,startedAt:Date.now()},u=I(t,s);h._snapshot._scheduledEvents[u]=r;let c=a.setTimeout(()=>{delete o[u],delete h._snapshot._scheduledEvents[u],h._relay(t,e,n)},i);o[u]=c},cancel:(t,e)=>{let n=I(t,e),i=o[n];delete o[n],delete h._snapshot._scheduledEvents[n],void 0!==i&&a.clearTimeout(i)},cancelAll:t=>{for(let e in h._snapshot._scheduledEvents){let n=h._snapshot._scheduledEvents[e];n.source===t&&c.cancel(t,n.id)}}},h={_snapshot:{_scheduledEvents:(e?.snapshot&&e.snapshot.scheduler)??{}},_bookId:()=>`x:${j++}`,_register:(t,e)=>(n.set(t,e),t),_unregister:t=>{n.delete(t.sessionId);let e=s.get(t);void 0!==e&&(i.delete(e),s.delete(t))},get:t=>i.get(t),_set:(t,e)=>{let n=i.get(t);if(n&&n!==e)throw Error(`Actor with system ID '${t}' already exists.`);i.set(t,e),s.set(e,t)},inspect:t=>{let e=k(t);return r.add(e),{unsubscribe(){r.delete(e)}}},_sendInspectionEvent:e=>{if(!r.size)return;let n={...e,rootId:t.sessionId};r.forEach(t=>t.next?.(n))},_relay:(t,e,n)=>{h._sendInspectionEvent({type:"@xstate.event",sourceRef:t,actorRef:e,event:n}),e._send(n)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...h._snapshot._scheduledEvents}}),start:()=>{let t=h._snapshot._scheduledEvents;for(let e in h._snapshot._scheduledEvents={},t){let{source:n,target:i,event:s,delay:r,id:o}=t[e];c.schedule(n,i,s,r,o)}},_clock:a,_logger:u};return h}(this,{clock:i,logger:s}
1),h&&!o&&this.system.inspect(k(h)),this.sessionId=this.system._bookId(),this.id=u??this.sessionId,this.logger=e?.logger??this.system._logger,this.clock=e?.clock??this.system._clock,this._parent=o,this._syncSnapshot=a,this.options=n,this.src=n.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:t=>{this._deferred.push(t)},system:this.system,stopChild:t=>{if(t._parent!==this)throw Error(`Cannot stop child actor ${t.id} of ${this.id} because it is not a child`);t._stop()},emit:t=>{let e=this.eventListeners.get(t.type),n=this.eventListeners.get("*");if(e||n)for(let i of Array.from(new Set([...e?e.values():[],...n?n.values():[]])))i(t)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),c&&(this._systemId=c,this.system._set(c,this)),this._initState(e?.snapshot??e?.state),c&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(t){try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(t){this._snapshot={status:"error",output:void 0,error:t}}}update(t,e){let n;for(this._snapshot=t;n=this._deferred.shift();)try{n()}catch(e){this._deferred.length=0,this._snapshot={...t,status:"error",error:e}}switch(this._snapshot.status){case"active":for(let e of this.observers)try{e.next?.(t)}catch(t){p(t)}break;case"done":var i;for(let e of this.observers)try{e.next?.(t)}catch(t){p(t)}this._stopProcedure(),this._complete(),this._doneEvent=(i=this.id,{type:`xstate.done.actor.${i}`,output:this._snapshot.output,actorId:i}),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error)}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:e,snapshot:t})}subscribe(t,e,n){let i=k(t,e,n);if(this._processingStatus!==T.Stopped)this.observers.add(i);else switch(this._snapshot.status){case"done":try{i.complete?.()}catch(t){p(t)}break;case"error":{let t=this._snapshot.error;if(i.error)try{i.error(t)}catch(t){p(t)}else p(t)}}return{unsubscribe:()=>{this.observers.delete(i)}}}on(t,e){let n=this.eventListeners.get(t);n||(n=new Set,this.eventListeners.set(t,n));let i=e.bind(void 0);return n.add(i),{unsubscribe:()=>{n.delete(i)}}}start(){if(this._processingStatus===T.Running)return this;this._syncSnapshot&&this.subscribe({next:t=>{"active"===t.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:t})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=T.Running;let t=d(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(t){return this._snapshot={...this._snapshot,status:"error",error:t},this._error(t),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let e,n;try{e=this.logic.transition(this._snapshot,t,this._actorScope)}catch(t){n={err:t}}if(n){let{err:t}=n;this._snapshot={...this._snapshot,status:"error",error:t},this._error(t);return}this.update(e,t),t.type===h&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===T.Stopped||((this.mailbox.clear(),this._processingStatus===T.NotStarted)?this._processingStatus=T.Stopped:this.mailbox.enqueue({type:h})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let t of this.observers)try{t.complete?.()}catch(t){p(t)}this.observers.clear()}_reportError(t){if(!this.observers.size){this._parent||p(t);return}let e=!1;for(let n of this.observers){let i=n.error;e||=!i;try{i?.(t)}catch(t){p(t)}}this.observers.clear(),e&&p(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,l(this.id,t))}_stopProcedure(){return this._processingStatus!==T.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new r(this._process.bind(this)),this._processingStatus=T.Stopped,this.system._unregister(this)),this}_send(t){this._processingStatus!==T.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){let{devTools:t}=this.options;t&&("function"==typeof t?t:s)(this)}toJSON(){return{xstate$$type:O,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[y](){return this}getSnapshot(){return this._snapshot}}function M(t,...[e]){return new N(t,e)}function R(t,e,n,i,{sendId:s}){return[e,"function"==typeof s?s(n,i):s]}function P(t,e){t.defer(()=>{t.system.scheduler.cancel(t.self,e)})}function C(t){function e(t,e){}return e.type="xstate.cancel",e.sendId=t,e.resolve=R,e.execute=P,e}function z(t,e,n,i,{id:s,systemId:r,src:o,input:a,syncSnapshot:u}){let c;
1let h="string"==typeof o?E(e.machine,o):o,f="function"==typeof s?s(n):s;return h&&(c=M(h,{id:f,src:o,parent:t.self,syncSnapshot:u,systemId:r,input:"function"==typeof a?a({context:e.context,event:n.event,self:t.self}):a})),[tO(e,{children:{...e.children,[f]:c}}),{id:s,actorRef:c}]}function D(t,{id:e,actorRef:n}){n&&t.defer(()=>{n._processingStatus!==T.Stopped&&n.start()})}function L(...[t,{id:e,systemId:n,input:i,syncSnapshot:s=!1}={}]){function r(t,e){}return r.type="snapshot.spawnChild",r.id=e,r.systemId=n,r.src=t,r.input=i,r.syncSnapshot=s,r.resolve=z,r.execute=D,r}function J(t,e,n,i,{actorRef:s}){let r="function"==typeof s?s(n,i):s,o="string"==typeof r?e.children[r]:r,a=e.children;return o&&(a={...a},delete a[o.id]),[tO(e,{children:a}),o]}function V(t,e){if(e){if(t.system._unregister(e),e._processingStatus!==T.Running){t.stopChild(e);return}t.defer(()=>{t.stopChild(e)})}}function W(t){function e(t,e){}return e.type="xstate.stopChild",e.actorRef=t,e.resolve=J,e.execute=V,e}function X(t,e,n,i){let{machine:s}=i,r="function"==typeof t,o=r?t:s.implementations.guards["string"==typeof t?t:t.type];if(!r&&!o)throw Error(`Guard '${"string"==typeof t?t:t.type}' is not implemented.'.`);if("function"!=typeof o)return X(o,e,n,i);let a={context:e,event:n},u=r||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:e,event:n}):t.params:void 0;return"check"in o?o.check(i,a,o):o(a,u)}let q=t=>"atomic"===t.type||"final"===t.type;function B(t){return Object.values(t.states).filter(t=>"history"!==t.type)}function U(t,e){let n=[];if(e===t)return n;let i=t.parent;for(;i&&i!==e;)n.push(i),i=i.parent;return n}function Z(t){let e=new Set(t),n=Y(e);for(let t of e)if("compound"!==t.type||n.get(t)&&n.get(t).length){if("parallel"===t.type){for(let n of B(t))if("history"!==n.type&&!e.has(n))for(let t of tr(n))e.add(t)}}else tr(t).forEach(t=>e.add(t));for(let t of e){let n=t.parent;for(;n;)e.add(n),n=n.parent}return e}function Y(t){let e=new Map;for(let n of t)e.has(n)||e.set(n,[]),n.parent&&(e.has(n.parent)||e.set(n.parent,[]),e.get(n.parent).push(n));return e}function G(t,e){return function t(e,n){let i=n.get(e);if(!i)return{};if("compound"===e.type){let t=i[0];if(!t)return{};if(q(t))return t.key}let s={};for(let e of i)s[e.key]=t(e,n);return s}(t,Y(Z(e)))}function F(t,e){return"compound"===e.type?B(e).some(e=>"final"===e.type&&t.has(e)):"parallel"===e.type?B(e).every(e=>F(t,e)):"final"===e.type}let H=t=>"#"===t[0];function K(t,e){return t.transitions.get(e)||[...t.transitions.keys()].filter(t=>{if("*"===t)return!0;if(!t.endsWith(".*"))return!1;let n=t.split("."),i=e.split(".");for(let t=0;t<n.length;t++){let e=n[t],s=i[t];if("*"===e)return t===n.length-1;if(e!==s)return!1}return!0}).sort((t,e)=>e.length-t.length).flatMap(e=>t.transitions.get(e))}function Q(t){let e=t.config.after;if(!e)return[];let n=(e,n)=>{var i;let s=(i=t.id,{type:`xstate.after.${e}.${i}`}),r=s.type;return t.entry.push(tM(s,{id:r,delay:e})),t.exit.push(C(r)),r};return Object.keys(e).flatMap((t,i)=>{let s=e[t],r=Number.isNaN(+t)?t:+t,o=n(r);return _("string"==typeof s?{target:s}:s).map(t=>({...t,event:o,delay:r}))}).map(e=>{let{delay:n}=e;return{...tt(t,e.event,e),delay:n}})}function tt(t,e,n){let i=w(n.target),s=n.reenter??!1,r=function(t,e){if(void 0!==e)return e.map(e=>{if("string"!=typeof e)return e;if(H(e))return t.machine.getStateNodeById(e);let n=e[0]===o;if(n&&!t.parent)return tu(t,e.slice(1));let i=n?t.key+e:e;if(t.parent)try{return tu(t.parent,i)}catch(e){throw Error(`Invalid transition definition for state node '${t.id}':
2${e.message}`)}else throw Error(`Invalid target: "${e}" is not a valid target from the root node. Did you mean ".${e}"?`)})}(t,i),a={...n,actions:_(n.actions),guard:n.guard,target:r,source:t,reenter:s,eventType:e,toJSON:()=>({...a,source:`#${t.id}`,target:r?r.map(t=>`#${t.id}`):void 0})};return a}function te(t){let e=new Map;if(t.config.on)for(let n of Object.keys(t.config.on)){if(n===a)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let i=t.config.on[n];e.set(n,x(i).map(e=>tt(t,n,e)))}if(t.config.onDone){let n=`xstate.done.state.${t.id}`;e.set(n,x(t.config.onDone).map(e=>tt(t,n,e)))}for(let n of t.invoke){if(n.onDone){let i=`xstate.done.actor.${n.id}`;e.set(i,x(n.onDone).map(e=>tt(t,i,e)))}if(n.onError){let i=`xstate.error.actor.${n.id}`;e.set(i,x(n.onError).map(e=>tt(t,i,e)))}if(n.onSnapshot){let i=`xstate.snapshot.${n.id}`;e.set(i,x(n.onSnapshot).map(e=>tt(t,i,e)))}}for(let n of t.after){let t=e.get(n.eventType);t||(t=[],e.set(n.eventType,t)),t.push(n)}return e}function tn(t,e){let n="string"==typeof e?t.states[e]:e?t.states[e.target]:void 0;if(!n&&e)throw Error(`Initial state node "${e}" not found on parent state node #${t.id}`);let i={source:t,actions:e&&"string"!=typeof e?_(e.actions):[],eventType:null,reenter
2:!1,target:n?[n]:[],toJSON:()=>({...i,source:`#${t.id}`,target:n?[`#${n.id}`]:[]})};return i}function ti(t){let e=w(t.config.target);return e?{target:e.map(e=>"string"==typeof e?tu(t.parent,e):e)}:t.parent.initial}function ts(t){return"history"===t.type}function tr(t){let e=to(t);for(let n of e)for(let i of U(n,t))e.add(i);return e}function to(t){let e=new Set;return!function t(n){if(!e.has(n)){if(e.add(n),"compound"===n.type)t(n.initial.target[0]);else if("parallel"===n.type)for(let e of B(n))t(e)}}(t),e}function ta(t,e){if(H(e))return t.machine.getStateNodeById(e);if(!t.states)throw Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);let n=t.states[e];if(!n)throw Error(`Child state '${e}' does not exist on '${t.id}'`);return n}function tu(t,e){if("string"==typeof e&&H(e))try{return t.machine.getStateNodeById(e)}catch(t){}let n=v(e).slice(),i=t;for(;n.length;){let t=n.shift();if(!t.length)break;i=ta(i,t)}return i}function tc(t,e){if("string"==typeof e){let n=t.states[e];if(!n)throw Error(`State '${e}' does not exist on '${t.id}'`);return[t,n]}let n=Object.keys(e),i=n.map(e=>ta(t,e)).filter(Boolean);return[t.machine.root,t].concat(i,n.reduce((n,i)=>{let s=ta(t,i);if(!s)return n;let r=tc(s,e[i]);return n.concat(r)},[]))}function th(t,e){let n=t;for(;n.parent&&n.parent!==e;)n=n.parent;return n.parent===e}function tf(t,e,n){let i=new Set;for(let s of t){let t=!1,r=new Set;for(let o of i)if(function(t,e){let n=new Set(t),i=new Set(e);for(let t of n)if(i.has(t))return!0;for(let t of i)if(n.has(t))return!0;return!1}(tp([s],e,n),tp([o],e,n))){if(th(s.source,o.source))r.add(o);else{t=!0;break}}if(!t){for(let t of r)i.delete(t);i.add(s)}}return Array.from(i)}function tl(t,e){if(!t.target)return[];let n=new Set;for(let i of t.target)if(ts(i)){if(e[i.id])for(let t of e[i.id])n.add(t);else for(let t of tl(ti(i),e))n.add(t)}else n.add(i);return[...n]}function td(t,e){let n=tl(t,e);if(!n)return;if(!t.reenter&&n.every(e=>e===t.source||th(e,t.source)))return t.source;let i=function(t){let[e,...n]=t;for(let t of U(e,void 0))if(n.every(e=>th(e,t)))return t}(n.concat(t.source));return i||(t.reenter?void 0:t.source.machine.root)}function tp(t,e,n){let i=new Set;for(let s of t)if(s.target?.length){let t=td(s,n);for(let n of(s.reenter&&s.source===t&&i.add(t),e))th(n,t)&&i.add(n)}return[...i]}function ty(t,e,n,i,s,r){if(!t.length)return e;let o=new Set(e._nodes),a=e.historyValue,u=tf(t,o,a),c=e;s||([c,a]=function(t,e,n,i,s,r,o){let a,u=t,c=tp(i,s,r);for(let t of(c.sort((t,e)=>e.order-t.order),c))for(let e of function(t){return Object.keys(t.states).map(e=>t.states[e]).filter(t=>"history"===t.type)}(t)){let n;n="deep"===e.history?e=>q(e)&&th(e,t):e=>e.parent===t,(a??={...r})[e.id]=Array.from(s).filter(n)}for(let t of c)u=tm(u,e,n,[...t.exit,...t.invoke.map(t=>W(t.id))],o),s.delete(t);return[u,a||r]}(c,i,n,u,o,a,r)),c=function(t,e,n,i,s,r,o,a){let u=t,c=new Set,h=new Set;(function(t,e,n,i){for(let s of t){let t=td(s,e);for(let r of s.target||[])!ts(r)&&(s.source!==r||s.source!==t||s.reenter)&&(i.add(r),n.add(r)),tv(r,e,n,i);for(let r of tl(s,e)){let o=U(r,t);t?.type==="parallel"&&o.push(t),tg(i,e,n,o,!s.source.parent&&s.reenter?void 0:t)}}})(i,o,h,c),a&&h.add(t.machine.root);let l=new Set;for(let t of[...c].sort((t,e)=>t.order-e.order)){s.add(t);let i=[];for(let e of(i.push(...t.entry),t.invoke))i.push(L(e.src,{...e,syncSnapshot:!!e.onSnapshot}));if(h.has(t)){let e=t.initial.actions;i.push(...e)}if(u=tm(u,e,n,i,r,t.invoke.map(t=>t.id)),"final"===t.type){let i=t.parent,o=i?.type==="parallel"?i:i?.parent,a=o||t;for(i?.type==="compound"&&r.push(f(i.id,void 0!==t.output?b(t.output,u.context,e,n.self):void 0));o?.type==="parallel"&&!l.has(o)&&F(s,o);)l.add(o),r.push(f(o.id)),a=o,o=o.parent;if(o)continue;u=tO(u,{status:"done",output:function(t,e,n,i,s){if(void 0===i.output)return;let r=f(s.id,void 0!==s.output&&s.parent?b(s.output,t.context,e,n.self):void 0);return b(i.output,t.context,r,n.self)}(u,e,n,u.machine.root,a)})}}return u}(c=tm(c,i,n,u.flatMap(t=>t.actions),r),i,n,u,o,r,a,s);let h=[...o];"done"===c.status&&(c=tm(c,i,n,h.sort((t,e)=>e.order-t.order).flatMap(t=>t.exit),r));try{if(a===e.historyValue&&function(t,e){if(t.length!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}(e._nodes,o))return c;return tO(c,{_nodes:h,historyValue:a})}catch(t){throw t}}function tv(t,e,n,i){if(ts(t)){if(e[t.id]){let s=e[t.id];for(let t of s)i.add(t),tv(t,e,n,i);for(let r of s)tg(i,e,n,U(r,t.parent))}else{let s=ti(t);for(let r of s.target)i.add(r),s===t.parent?.initial&&n.add(t.parent),tv(r,e,n,i);for(let r of s.target)tg(i,e,n,U(r,t.parent))}}else if("compound"===t.type){let[s]=t.initial.target;ts(s)||(i.add(s),n.add(s)),tv(s,e,n,i),tg(i,e,n,U(s,t))}else if("parallel"===t.type)for(let s of B(t).filter(t=>!ts(t)))[...i].some(t=>th(t,s))||(ts(s)||(i.add(s),n.add(s)),tv(s,e,n,i))}function tg(t,e,n,i,s){for(let r of i)if((!s||th(r,s))&&t.add(r),"parallel"===r.type)for(let i of B(r).filter(t=>!ts(t)))[...t].some(t=>
2th(t,i))||(t.add(i),tv(i,e,n,t))}function tm(t,e,n,i,s,r){let o=r?[]:void 0,a=function t(e,n,i,s,r,o){let{machine:a}=e,u=e;for(let e of s){let s="function"==typeof e,h=s?e:a.implementations.actions["string"==typeof e?e:e.type];if(!h)continue;let f={context:u.context,event:n,self:i.self,system:i.system},l=s||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:u.context,event:n}):e.params:void 0;function c(){i.system._sendInspectionEvent({type:"@xstate.action",actorRef:i.self,action:{type:"string"==typeof e?e:"object"==typeof e?e.type:e.name||"(anonymous)",params:l}}),h(f,l)}if(!("resolve"in h)){i.self._processingStatus===T.Running?c():i.defer(()=>{c()});continue}let[d,p,y]=h.resolve(i,u,f,l,h,r);u=d,"retryResolve"in h&&o?.push([h,p]),"execute"in h&&(i.self._processingStatus===T.Running?h.execute(i,p):i.defer(h.execute.bind(null,i,p))),y&&(u=t(u,n,i,y,r,o))}return u}(t,e,n,i,{internalQueue:s,deferredActorIds:r},o);return o?.forEach(([t,e])=>{t.retryResolve(n,a,e)}),a}function t_(t,e,n,i=[]){let s=t,r=[];function o(t,e,i){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:e,snapshot:t,_transitions:i}),r.push(t)}if(e.type===h)return o(s=tO(tb(s,e,n),{status:"stopped"}),e,[]),{snapshot:s,microstates:r};let a=e;if(a.type!==u){let e=a,u=e.type.startsWith("xstate.error.actor"),c=tS(e,s);if(u&&!c.length)return o(s=tO(t,{status:"error",error:e.error}),e,[]),{snapshot:s,microstates:r};o(s=ty(c,t,n,a,!1,i),e,c)}let c=!0;for(;"active"===s.status;){let t=c?function(t,e){let n=new Set;for(let i of t._nodes.filter(q))t:for(let s of[i].concat(U(i,void 0)))if(s.always){for(let i of s.always)if(void 0===i.guard||X(i.guard,t.context,e,t)){n.add(i);break t}}return tf(Array.from(n),new Set(t._nodes),t.historyValue)}(s,a):[],e=t.length?s:void 0;if(!t.length){if(!i.length)break;t=tS(a=i.shift(),s)}c=(s=ty(t,s,n,a,!1,i))!==e,o(s,a,t)}return"active"!==s.status&&tb(s,a,n),{snapshot:s,microstates:r}}function tb(t,e,n){return tm(t,e,n,Object.values(t.children).map(t=>W(t)),[])}function tS(t,e){return e.machine.getTransitionData(e,t)}function tx(t,e){let n=Z(tc(t,e));return G(t,[...n])}let tw=function(t){return function t(e,n){let i=g(e),s=g(n);return"string"==typeof s?"string"==typeof i&&s===i:"string"==typeof i?i in s:Object.keys(i).every(e=>e in s&&t(i[e],s[e]))}(t,this.value)},tk=function(t){return this.tags.has(t)},t$=function(t){let e=this.machine.getTransitionData(this,t);return!!e?.length&&e.some(t=>void 0!==t.target||t.actions.length)},tE=function(){let{_nodes:t,tags:e,machine:n,getMeta:i,toJSON:s,can:r,hasTag:o,matches:a,...u}=this;return{...u,tags:Array.from(e)}},tI=function(){return this._nodes.reduce((t,e)=>(void 0!==e.meta&&(t[e.id]=e.meta),t),{})};function tj(t,e){return{status:t.status,output:t.output,error:t.error,machine:e,context:t.context,_nodes:t._nodes,value:G(e.root,t._nodes),tags:new Set(t._nodes.flatMap(t=>t.tags)),children:t.children,historyValue:t.historyValue||{},matches:tw,hasTag:tk,can:t$,getMeta:tI,toJSON:tE}}function tO(t,e={}){return tj({...t,...e},t.machine)}function tT(t,e){let{_nodes:n,tags:i,machine:s,children:r,context:o,can:a,hasTag:u,matches:c,getMeta:h,toJSON:f,...l}=t,d={};for(let t in r){let n=r[t];d[t]={snapshot:n.getPersistedSnapshot(e),src:n.src,systemId:n._systemId,syncSnapshot:n._syncSnapshot}}return{...l,context:function t(e){let n;for(let i in e){let s=e[i];if(s&&"object"==typeof s){if("sessionId"in s&&"send"in s&&"ref"in s)(n??=Array.isArray(e)?e.slice():{...e})[i]={xstate$$type:O,id:s.id};else{let r=t(s);r!==s&&((n??=Array.isArray(e)?e.slice():{...e})[i]=r)}}}return n??e}(o),children:d}}function tA(t,e,n,i,{event:s,id:r,delay:o},{internalQueue:a}){let u;let c=e.machine.implementations.delays;if("string"==typeof s)throw Error(`Only event objects may be used with raise; use raise({ type: "${s}" }) instead`);let h="function"==typeof s?s(n,i):s;if("string"==typeof o){let t=c&&c[o];u="function"==typeof t?t(n,i):t}else u="function"==typeof o?o(n,i):o;return"number"!=typeof u&&a.push(h),[e,{event:h,id:r,delay:u}]}function tN(t,e){let{event:n,delay:i,id:s}=e;if("number"==typeof i){t.defer(()=>{let e=t.self;t.system.scheduler.schedule(e,e,n,i,s)});return}}function tM(t,e){function n(t,e){}return n.type="xstate.raise",n.event=t,n.id=e?.id,n.delay=e?.delay,n.resolve=tA,n.execute=tN,n}},50958:function(t,e,n){n.d(e,{ZD:function(){return r},cY:function(){return l}}),n(92896);var i=n(65936),s=n(77931);function r(t,e){let n=(0,i.t)(e);if(!n.includes(t.type)){let e=1===n.length?`type "${n[0]}"`:`one of types "${n.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(t)} to have ${e}`)}}let o=new WeakMap;function a(t,e,n){let i=o.get(t);return i?e in i||(i[e]=n()):(i={[e]:n()},o.set(t,i)),i[e]}let u={},c=t=>"string"==typeof t?{type:t}:"function"==typeof t?"resolve"in t?{type:t.type}:{type:t.name}:t;class h{constructor(t,e){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=e._parent,this.key=e._key,this.machine=e._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(i.S),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?(0,i.m)(this.config.states,(t,e)=>new h(t,{_parent:this,_key:e,_machine:this.machine})):u,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for c
2ompound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=!0===this.config.history?"shallow":this.config.history||!1,this.entry=(0,i.t)(this.config.entry).slice(),this.exit=(0,i.t)(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=(0,i.t)(t.tags).slice()}_initialize(){this.transitions=(0,i.f)(this),this.config.always&&(this.always=(0,i.a)(this.config.always).map(t=>(0,i.b)(this,i.N,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(c),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(c),eventType:null})}:void 0,history:this.history,states:(0,i.m)(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(c)})),entry:this.entry.map(c),exit:this.exit.map(c),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return a(this,"invoke",()=>(0,i.t)(this.config.invoke).map((t,e)=>{let{src:n,systemId:s}=t,r=t.id??(0,i.c)(this.id,e),o="string"==typeof n?n:`xstate.invoke.${(0,i.c)(this.id,e)}`;return{...t,src:o,id:r,systemId:s,toJSON(){let{onDone:e,onError:n,...i}=t;return{...i,type:"xstate.invoke",src:o,id:r}}}}))}get on(){return a(this,"on",()=>[...this.transitions].flatMap(([t,e])=>e.map(e=>[t,e])).reduce((t,[e,n])=>(t[e]=t[e]||[],t[e].push(n),t),{}))}get after(){return a(this,"delayedTransitions",()=>(0,i.g)(this))}get initial(){return a(this,"initial",()=>(0,i.d)(this,this.config.initial))}next(t,e){let n;let s=e.type,r=[];for(let o of a(this,`candidates-${s}`,()=>(0,i.h)(this,s))){let{guard:a}=o,u=t.context,c=!1;try{c=!a||(0,i.e)(a,u,e,t)}catch(e){let t="string"==typeof a?a:"object"==typeof a?a.type:void 0;throw Error(`Unable to evaluate guard ${t?`'${t}' `:""}in transition for event '${s}' in state node '${this.id}':
3${e.message}`)}if(c){r.push(...o.actions),n=o;break}}return n?[n]:void 0}get events(){return a(this,"events",()=>{let{states:t}=this,e=new Set(this.ownEvents);if(t)for(let n of Object.keys(t)){let i=t[n];if(i.states)for(let t of i.events)e.add(`${t}`)}return Array.from(e)})}get ownEvents(){return Array.from(new Set([...this.transitions.keys()].filter(t=>this.transitions.get(t).some(t=>!(!t.target&&!t.actions.length&&!t.reenter)))))}}class f{constructor(t,e){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:e?.actors??{},actions:e?.actions??{},delays:e?.delays??{},guards:e?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new h(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(t){let{actions:e,guards:n,actors:i,delays:s}=this.implementations;return new f(this.config,{actions:{...e,...t.actions},guards:{...n,...t.guards},actors:{...i,...t.actors},delays:{...s,...t.delays}})}resolveState(t){let e=(0,i.r)(this.root,t.value),n=(0,i.i)((0,i.j)(this.root,e));return(0,i.k)({_nodes:[...n],context:t.context||{},children:{},status:(0,i.l)(n,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,e,n){return(0,i.n)(t,e,n).snapshot}microstep(t,e,n){return(0,i.n)(t,e,n).microstates}getTransitionData(t,e){return(0,i.o)(this.root,t.value,t,e)||[]}getPreInitialState(t,e,n){let{context:r}=this.config,o=(0,i.k)({context:"function"!=typeof r&&r?r:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof r?(0,i.p)(o,e,t,[(0,s.a)(({spawn:t,event:e,self:n})=>r({spawn:t,input:e.input,self:n}))],n):o}getInitialSnapshot(t,e){let n=(0,i.q)(e),s=[],r=this.getPreInitialState(t,n,s),o=(0,i.s)([{target:[...(0,i.u)(this.root)],source:this.root,reenter
3:!0,actions:[],eventType:null,toJSON:null}],r,t,n,!0,s),{snapshot:a}=(0,i.n)(o,n,t,s);return a}start(t){Object.values(t.children).forEach(t=>{"active"===t.getSnapshot().status&&t.start()})}getStateNodeById(t){let e=(0,i.v)(t),n=e.slice(1),s=(0,i.w)(e[0])?e[0].slice(1):e[0],r=this.idMap.get(s);if(!r)throw Error(`Child state node '#${s}' does not exist on machine '${this.id}'`);return(0,i.x)(r,n)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,e){return(0,i.y)(t,e)}restoreSnapshot(t,e){let n={},s=t.children;Object.keys(s).forEach(t=>{let r=s[t],o=r.snapshot,a=r.src,u="string"==typeof a?(0,i.z)(this,a):a;if(!u)return;let c=(0,i.A)(u,{id:t,parent:e.self,syncSnapshot:r.syncSnapshot,snapshot:o,src:a,systemId:r.systemId});n[t]=c});let r=(0,i.k)({...t,children:n,_nodes:Array.from((0,i.i)((0,i.j)(this.root,t.value)))},this),o=new Set;return!function t(e,n){if(!o.has(e))for(let s in o.add(e),e){let r=e[s];if(r&&"object"==typeof r){if("xstate$$type"in r&&r.xstate$$type===i.$){e[s]=n[r.id];continue}t(r,n)}}}(r.context,n),r}}function l({schemas:t,actors:e,actions:n,guards:i,delays:s}){return{createMachine:r=>new f({...r,schemas:t},{actors:e,actions:n,guards:i,delays:s})}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.