1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[507],{10507:(t,e,i)=>{i.d(e,{mj:()=>function t({schemas:e,actors:i,actions:o,guards:r,delays:a}){return{assign:n.a,sendTo:l.s,raise:s.r,log:l.l,cancel:s.b,stopChild:s.s,enqueueActions:l.e,emit:l.a,spawnChild:s.d,createStateConfig:t=>t,createAction:t=>t,createMachine:t=>new d({...t,schemas:e},{actors:i,actions:o,guards:r,delays:a}),extend:s=>t({schemas:e,actors:i,actions:{...o,...s.actions},guards:{...r,...s.guards},delays:{...a,...s.delays}})}}});var s=i(76428),n=i(64074);let o=new WeakMap;function r(t,e,i){let s=o.get(t);return s?e in s||(s[e]=i()):(s={[e]:i()},o.set(t,s)),s[e]}let a={},h=t=>"string"==typeof t?{type:t}:"function"==typeof t?"resolve"in t?{type:t.type}:{type:t.name}:t;class c{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(s.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,s.z)(this.config.states,(t,e)=>new c(t,{_parent:this,_key:e,_machine:this.machine})):a,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for compound 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,s.t)(this.config.entry).slice(),this.exit=(0,s.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,s.t)(t.tags).slice()}_initialize(){this.transitions=(0,s.B)(this),this.config.always&&(this.always=(0,s.C)(this.config.always).map(t=>(0,s.D)(this,s.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.t
1ype,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(h),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(h),eventType:null})}:void 0,history:this.history,states:(0,s.z)(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(h)})),entry:this.entry.map(h),exit:this.exit.map(h),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 r(this,"invoke",()=>(0,s.t)(this.config.invoke).map((t,e)=>{let{src:i,systemId:n}=t,o=t.id??(0,s.F)(this.id,e),r="string"==typeof i?i:`xstate.invoke.${(0,s.F)(this.id,e)}`;return{...t,src:r,id:o,systemId:n,toJSON(){let{onDone:e,onError:i,...s}=t;return{...s,type:"xstate.invoke",src:r,id:o}}}}))}get on(){return r(this,"on",()=>[...this.transitions].flatMap(([t,e])=>e.map(e=>[t,e])).reduce((t,[e,i])=>(t[e]=t[e]||[],t[e].push(i),t),{}))}get after(){return r(this,"delayedTransitions",()=>(0,s.G)(this))}get initial(){return r(this,"initial",()=>(0,s.H)(this,this.config.initial))}next(t,e){let i,n=e.type,o=[];for(let a of r(this,`candidates-${n}`,()=>(0,s.I)(this,n))){let{guard:r}=a,h=t.context,c=!1;try{c=!r||(0,s.E)(r,h,e,t)}catch(e){let t="string"==typeof r?r:"object"==typeof r?r.type:void 0;throw Error(`Unable to evaluate guard ${t?`'${t}' `:""}in transition for event '${n}' in state node '${this.id}': 2${e.message}`)}if(c){o.push(...a.actions),i=a;break}}return i?[i]:void 0}get events(){return r(this,"events",()=>{let{states:t}=this,e=new Set(this.ownEvents);if(t)for(let i of Object.keys(t)){let s=t[i];if(s.states)for(let t of s.events)e.add(`${t}`)}return Array.from(e)})}get ownEvents(){return Array.from(new Set(Object.keys(Object.fromEntries(this.transitions)).filter(t=>this.transitions.get(t).some(t=>!(!t.target&&!t.actions.length&&!t.reenter)))))}}class d{constructor(t,e){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.options=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.options={maxIterations:1/0,...this.config.options},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 c(t,{_key:this.id,_machine:this}),this.root._initialize(),(0,s.J)(this.root),this.states=this.root.states,this.events=this.root.events}provide(t){let{actions:e,guards:i,actors:s,delays:n}=this.implementations;return new d(this.config,{actions:{...e,...t.actions},guards:{...i,...t.guards},actors:{...s,...t.actors},delays:{...n,...t.delays}})}resolveState(t){let e=(0,s.K)(this.root,t.value),i=(0,s.L)((0,s.q)(this.root,e));return(0,s.M)({_nodes:[...i],context:t.context||{},children:{},status:(0,s.O)(i,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,e,i){return(0,s.e)(t,e,i,[]).snapshot}microstep(t,e,i){return(0,s.e)(t,e,i,[]).microsteps.map(([t])=>t)}getTransitionData(t,e){return(0,s.P)(this.root,t.value,t,e)||[]}_getPreInitialState(t,e,i){let{context:o}=this.config,r=(0,s.M)({context:"function"!=typeof o&&o?o:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof o?(0,s.Q)(r,e,t,[(0,n.a)(({spawn:t,event:e,self:i})=>o({spawn:t,input:e.input,self:i}))],i,void 0):r}getInitialSnapshot(t,e){let i=(0,s.f)(e),n=[],o=(0,s.M)({context:"function"!=typeof this.config.context&&this.config.context?this.config.context:{},_nodes:[this.root],children:{},status:"active"},this);try{o=this._getPreInitialState(t,i,n);let[e]=(0,s.g)(this.root,o,t,i,n),{snapshot:r}=(0,s.e)(e,i,t,n);return r}catch(t){return(0,s.R)(o,{status:"error",error:t})}}
2start(t){Object.values(t.children).forEach(t=>{"active"===t.getSnapshot().status&&t.start()})}getStateNodeById(t){let e=(0,s.T)(t),i=e.slice(1),n=(0,s.U)(e[0])?e[0].slice(1):e[0],o=this.idMap.get(n);if(!o)throw Error(`Child state node '#${n}' does not exist on machine '${this.id}'`);return(0,s.V)(o,i)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,e){return(0,s.W)(t,e)}restoreSnapshot(t,e){let i={},n=t.children;Object.keys(n).forEach(t=>{let o=n[t],r=o.snapshot,a=o.src,h="string"==typeof a?(0,s.Y)(this,a):a;if(!h)return;let c=(0,s.c)(h,{id:t,parent:e.self,syncSnapshot:o.syncSnapshot,snapshot:r,src:a,systemId:o.systemId});i[t]=c});let o=function(t,e){if(!e||"object"!=typeof e)return{};let i={};for(let s in e)for(let n of e[s]){let e=function(t,e){if(e instanceof c)return e;try{return t.machine.getStateNodeById(e.id)}catch{}}(t,n);e&&(i[s]??=[],i[s].push(e))}return i}(this.root,t.historyValue),r=(0,s.M)({...t,children:i,_nodes:Array.from((0,s.L)((0,s.q)(this.root,t.value))),historyValue:o},this),a=new Set;return!function t(e,i){if(!a.has(e))for(let n in a.add(e),e){let o=e[n];if(o&&"object"==typeof o){if("xstate$$type"in o&&o.xstate$$type===s.$){e[n]=i[o.id];continue}t(o,i)}}}(r.context,i),r}}var l=i(19106)},19106:(t,e,i)=>{i.d(e,{a:()=>a,e:()=>p,l:()=>v,s:()=>u});var s=i(76428),n=i(64074);function o(t,e,i,s,{event:n}){return[e,{event:"function"==typeof n?n(i,s):n},void 0]}function r(t,{event:e}){t.defer(()=>t.emit(e))}function a(t){function e(t,e){}return e.type="xstate.emit",e.event=t,e.resolve=o,e.execute=r,e}let h=function(t){return t.Parent="#_parent",t.Internal="#_internal",t}({});function c(t,e,i,s,{to:n,event:o,id:r,delay:a},c){let d,l,u=e.machine.implementations.delays;if("string"==typeof o)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${o}" }) instead`);let f="function"==typeof o?o(i,s):o;if("string"==typeof a){let t=u&&u[a];d="function"==typeof t?t(i,s):t}else d="function"==typeof a?a(i,s):a;let p="function"==typeof n?n(i,s):n;if("string"==typeof p){if(!(l=p===h.Parent?t.self._parent:p===h.Internal?t.self:p.startsWith("#_")?e.children[p.slice(2)]:c.deferredActorIds?.includes(p)?p:e.children[p]))throw Error(`Unable to send event to actor '${p}' from machine '${e.machine.id}'.`)}else l=p||t.self;return[e,{to:l,targetId:"string"==typeof p?p:void 0,event:f,id:r,delay:d},void 0]}function d(t,e,i){"string"==typeof i.to&&(i.to=e.children[i.to])}function l(t,e){t.defer(()=>{let{to:i,event:n,delay:o,id:r}=e;if("number"==typeof o)return void t.system.scheduler.schedule(t.self,i,n,o,r);t.system._relay(t.self,i,n.type===s.Z?(0,s._)(t.self.id,n.data):n)})}function u(t,e,i){function s(t,e){}return s.type="xstate.sendTo",s.to=t,s.event=e,s.id=i?.id,s.delay=i?.delay,s.resolve=c,s.retryResolve=d,s.execute=l,s}function f(t,e,i,o,{collect:r}){let c=[],d=function(t){c.push(t)};return d.assign=(...t)=>{c.push((0,n.a)(...t))},d.cancel=(...t)=>{c.push((0,s.b)(...t))},d.raise=(...t)=>{c.push((0,s.r)(...t))},d.sendTo=(...t)=>{c.push(u(...t))},d.sendParent=(...t)=>{c.push(function(t,e){return u(h.Parent,t,e)}(...t))},d.spawnChild=(...t)=>{c.push((0,s.d)(...t))},d.stopChild=(...t)=>{c.push((0,s.s)(...t))},d.emit=(...t)=>{c.push(a(...t))},r({context:i.context,event:i.event,enqueue:d,check:t=>(0,s.E)(t,e.context,i.event,e),self:t.self,system:t.system},o),[e,void 0,c]}function p(t){function e(t,e){}return e.type="xstate.enqueueActions",e.collect=t,e.resolve=f,e}function y(t,e,i,s,{value:n,label:o}){return[e,{value:"function"==typeof n?n(i,s):n,label:o},void 0]}function g({logger:t},{value:e,label:i}){i?t(i,e):t(e)}function v(t=({context:t,event:e})=>({context:t,event:e}),e){function i(t,e){}return i.type="xstate.log",i.value=t,i.label=e,i.resolve=y,i.execute=g,i}},64074:(t,e,i)=>{i.d(e,{a:()=>o});var s=i(76428);function n(t,e,i,n,{assignment:o}){if(!e.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let r={},a={context:e.context,event:i.event,spawn:function(t,{machine:e,context:i},n,o){return(r,a)=>{let h=((r,a)=>{if("string"!=typeof r)return(0,s.c)(r,{id:a?.id,parent:t.self,syncSnapshot:a?.syncSnapshot,input:a?.input,src:r,systemId:a?.systemId});{let h=(0,s.Y)(e,r);if(!h)throw Error(`Actor logic '${r}' not implemented in machine '${e.id}'`);let c=(0,s.c)(h,{id:a?.id,parent:t.self,syncSnapshot:a?.syncSnapshot,input:"function"==typeof a?.input?a.input({context:i,event:n,self:t.self}):a?.input,src:r,systemId:a?.systemId});return o[c.id]=c,c}})(r,a);return o[h.id]=h,t.defer(()=>{h._processingStatus!==s.a0.Stopped&&h.start()}),h}}(t,e,i.event,r),self:t.self,system:t.system},h={};if("function"==typeof o)h=o(a,n);else for(let t of Object.keys(o)){let e=o[t];h[t]="function"==typeof e?e(a,n):e}let c=Object.assign({},e.context,h);return[(0,s.R)(e,{context:c,children:Object.keys(r).length?{...e.children,...r}:e.children}),void 0,void 0]}function o(t){function e(t,e){}return e.type="xstate.assign",e.assignment=t,e.resolve=n,e}}}]);
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.