1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[183],{40183:function(t,e,n){n.r(e),n.d(e,{DotLottieStateMachineManager:function(){return tX}});var i,r=n(62857);n(20914),n(52338),n(49391);var o=n(81489);n(73186);var a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function s(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>e.indexOf(i)&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)0>e.indexOf(i[r])&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function c(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function h(t,e,n){if(n||2==arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}(tP=tI||(tI={})).Start="xstate.start",tP.Stop="xstate.stop",tP.Raise="xstate.raise",tP.Send="xstate.send",tP.Cancel="xstate.cancel",tP.NullEvent="",tP.Assign="xstate.assign",tP.After="xstate.after",tP.DoneState="done.state",tP.DoneInvoke="done.invoke",tP.Log="xstate.log",tP.Init="xstate.init",tP.Invoke="xstate.invoke",tP.ErrorExecution="error.execution",tP.ErrorCommunication="error.communication",tP.ErrorPlatform="error.platform",tP.ErrorCustom="xstate.error",tP.Update="xstate.update",tP.Pure="xstate.pure",tP.Choose="xstate.choose",(tL=tC||(tC={})).Parent="#_parent",tL.Internal="#_internal";var l=tI.Start,f=tI.Stop,d=tI.Raise,p=tI.Send,v=tI.Cancel,y=tI.NullEvent,g=tI.Assign;tI.After,tI.DoneState;var m=tI.Log,_=tI.Init,b=tI.Invoke;tI.ErrorExecution;var x=tI.ErrorPlatform,S=tI.ErrorCustom,w=tI.Update,E=tI.Choose,O=tI.Pure,k={},N="xstate.guard";function T(t,e,n){void 0===n&&(n=".");var i=P(t,n),r=P(e,n);return $(r)?!!$(i)&&r===i:$(i)?i in r:Object.keys(i).every(function(t){return t in r&&T(i[t],r[t])})}function j(t){try{return $(t)||"number"==typeof t?"".concat(t):t.type}catch{throw Error("Events must be strings or objects with a string event.type property.")}}function A(t,e){try{return U(t)?t:t.toString().split(e)}catch{throw Error("'".concat(t,"' is not a valid state path."))}}function P(t,e){return"object"==typeof t&&"value"in t&&"context"in t&&"event"in t&&"_event"in t?t.value:U(t)?L(t):"string"!=typeof t?t:L(A(t,e))}function L(t){if(1===t.length)return t[0];for(var e={},n=e,i=0;i<t.length-1;i++)i===t.length-2?n[t[i]]=t[i+1]:(n[t[i]]={},n=n[t[i]]);return e}function I(t,e){for(var n={},i=Object.keys(t),r=0;r<i.length;r++){var o=i[r];n[o]=e(t[o],o,t,r)}return n}function C(t,e,n){var i,r,o={};try{for(var a=c(Object.keys(t)),s=a.next();!s.done;s=a.next()){var u=s.value,h=t[u];n(h)&&(o[u]=e(h,u,t))}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}var V=function(t){return function(e){var n,i,r=e;try{for(var o=c(t),a=o.next();!a.done;a=o.next())r=r[a.value]}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}};function D(t){return t?$(t)?[[t]]:M(Object.keys(t).map(function(e){var n=t[e];return"string"==typeof n||n&&Object.keys(n).length?D(t[e]).map(function(t){return[e].concat(t)}):[[e]]})):[[]]}function M(t){var e;return(e=[]).concat.apply(e,h([],u(t),!1))}function R(t){return void 0===t?[]:U(t)?t:[t]}function z(t,e,n){if(F(t))return t(e,n.data);var i,r,o={};try{for(var a=c(Object.keys(t)),s=a.next();!s.done;s=a.next()){var u=s.value,h=t[u];
1F(h)?o[u]=h(e,n.data):o[u]=h}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function q(t){return!!(t instanceof Promise||null!==t&&(F(t)||"object"==typeof t)&&F(t.then))}function B(t,e,n,i){return t&&n.reduce(function(t,n){var r,o,a=n.assignment,s={state:i,action:n,_event:e},u={};if(F(a))u=a(t,e.data,s);else try{for(var h=c(Object.keys(a)),l=h.next();!l.done;l=h.next()){var f=l.value,d=a[f];u[f]=F(d)?d(t,e.data,s):d}}catch(t){r={error:t}}finally{try{l&&!l.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}return Object.assign({},t,u)},t)}var J=function(){};function U(t){return Array.isArray(t)}function F(t){return"function"==typeof t}function $(t){return"string"==typeof t}function X(t,e){if(t)return $(t)?{type:N,name:t,predicate:e?e[t]:void 0}:F(t)?{type:N,name:t.name,predicate:t}:t}var Q="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(t){return!!t&&"__xstatenode"in t}function G(t,e){return $(t)||"number"==typeof t?a({type:t},e):t}function W(t,e){if(!$(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var n=G(t);return a({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function K(t,e){return(U(e)?e:[e]).map(function(e){return typeof e>"u"||"string"==typeof e||H(e)?{target:e,event:t}:a(a({},e),{event:t})})}function Y(t,e,n,i,r){var o=t.options.guards,a={state:r,cond:e,_event:i};if(e.type===N)return((null==o?void 0:o[e.name])||e.predicate)(n,i.data,a);var s=null==o?void 0:o[e.type];if(!s)throw Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return s(n,i.data,a)}function Z(t){return"string"==typeof t?{type:t}:t}function tt(t,e,n){var i=function(){},r="object"==typeof t,o=r?t:null;return{next:((r?t.next:t)||i).bind(o),error:((r?t.error:e)||i).bind(o),complete:((r?t.complete:n)||i).bind(o)}}function te(t,e){return"".concat(t,":invocation[").concat(e,"]")}function tn(t){return(t.type===d||t.type===p&&t.to===tC.Internal)&&"number"!=typeof t.delay}(tV={})[Q]=function(){return this},tV[Symbol.observable]=function(){return this};var ti=W({type:_});function tr(t,e){return e&&e[t]||void 0}function to(t,e){var n;if($(t)||"number"==typeof t){var i=tr(t,e);n=F(i)?{type:t,exec:i}:i||{type:t,exec:void 0}}else if(F(t))n={type:t.name||t.toString(),exec:t};else{var i=tr(t.type,e);if(F(i))n=a(a({},t),{exec:i});else if(i){var r=i.type||t.type;n=a(a(a({},i),t),{type:r})}else n=t}return n}var ta=function(t,e){return t?(U(t)?t:[t]).map(function(t){return to(t,e)}):[]};function ts(t){var e=to(t);return a(a({id:$(t)?t:e.id},e),{type:e.type})}function tc(t,e){var n="".concat(tI.DoneState,".").concat(t),i={type:n,data:e};return i.toString=function(){return n},i}function tu(t,e){var n="".concat(tI.DoneInvoke,".").concat(t),i={type:n,data:e};return i.toString=function(){return n},i}function th(t,e){var n="".concat(tI.ErrorPlatform,".").concat(t),i={type:n,data:e};return i.toString=function(){return n},i}var tl=function(t){var e,n,i=[];try{for(var r=c(t),o=r.next();!o.done;o=r.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===g){i.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return i};function tf(t,e,n,i,r,o,s){void 0===s&&(s=!1);var l=s?[]:tl(r),v=l.length?B(n,i,l,e):n,y=s?[n]:void 0,_=[];return[M(r.map(function(r){var l,b,x=[];try{for(var S=c(r.actions),w=S.next();!w.done;w=S.next()){var k=w.value,N=function(r,c){var l;switch(c.type){case d:var b=function(t,e,n,i){var r,o={_event:n},s=W(F(t.event)?t.event(e,n.data,o):t.event);if($(t.delay)){var c=i&&i[t.delay];r=F(c)?c(e,n.data,o):c}else r=F(t.delay)?t.delay(e,n.data,o):t.delay;return a(a({},t),{type:d,_event:s,delay:r})}(c,v,i,t.options.delays);return o&&"number"==typeof b.delay&&o(b,v,i),b;case p:var x=function(t,e,n,i){var r,o={_event:n},s=W(F(t.event)?t.event(e,n.data,o):t.event);if($(t.delay)){var c=i&&i[t.delay];r=F(c)?c(e,n.data,o):c}else r=F(t.delay)?t.delay(e,n.data,o):t.delay;var u=F(t.to)?t.to(e,n.data,o):t.to;return a(a({},t),{to:u,_event:s,event:s.data,delay:r})}(c,v,i,t.options.delays);return o&&x.to!==tC.Internal&&("entry"===r?_.push(x):o(x,v,i)),x;case m:var S,w=(S=v,a(a({},c),{value:$(c.expr)?c.expr:c.expr(S,i.data,{_event:i})}
1));return null==o||o(w,v,i),w;case E:var k=null===(l=c.conds.find(function(n){var r=X(n.cond,t.options.guards);return!r||Y(t,r,v,i,o?void 0:e)}))||void 0===l?void 0:l.actions;if(!k)return[];var N=u(tf(t,e,v,i,[{type:r,actions:ta(R(k),t.options.actions)}],o,s),2),T=N[0];return v=N[1],null==y||y.push(v),T;case O:var k=c.get(v,i.data);if(!k)return[];var j=u(tf(t,e,v,i,[{type:r,actions:ta(R(k),t.options.actions)}],o,s),2),A=j[0];return v=j[1],null==y||y.push(v),A;case f:var P,L,w=(P=v,L=F(c.activity)?c.activity(P,i.data):c.activity,{type:tI.Stop,activity:"string"==typeof L?{id:L}:L});return null==o||o(w,n,i),w;case g:v=B(v,i,[c],o?void 0:e),null==y||y.push(v);break;default:var I=to(c,t.options.actions),C=I.exec;if(o)o(I,v,i);else if(C&&y){var V=y.length-1;I=a(a({},I),{exec:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];C.apply(void 0,h([y[V]],u(e),!1))}})}return I}}(r.type,k);N&&(x=x.concat(N))}}catch(t){l={error:t}}finally{try{w&&!w.done&&(b=S.return)&&b.call(S)}finally{if(l)throw l.error}}return _.forEach(function(t){o(t,v,i)}),_.length=0,x})),v]}var td=function(t,e){return e(t)};function tp(t){var e;return(e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}})[Q]=function(){return this},e}function tv(t,e,n){var i=tp(e);if(i.deferred=!0,H(t)){var r=i.state=td(void 0,function(){return(n?t.withContext(n):t).initialState});i.getSnapshot=function(){return r}}return i}var ty=function(t){return"atomic"===t.type||"final"===t.type};function tg(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function tm(t){return tg(t).filter(function(t){return"history"!==t.type})}function t_(t,e){var n,i,r,o,a,s,u,h,l=tb(new Set(t)),f=new Set(e);try{for(var d=c(f),p=d.next();!p.done;p=d.next())for(var v=p.value,y=v.parent;y&&!f.has(y);)f.add(y),y=y.parent}catch(t){n={error:t}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var g=tb(f);try{for(var m=c(f),_=m.next();!_.done;_=m.next()){var v=_.value;if("compound"!==v.type||g.get(v)&&g.get(v).length){if("parallel"===v.type)try{for(var b=(a=void 0,c(tm(v))),x=b.next();!x.done;x=b.next()){var S=x.value;f.has(S)||(f.add(S),l.get(S)?l.get(S).forEach(function(t){return f.add(t)}):S.initialStateNodes.forEach(function(t){return f.add(t)}))}}catch(t){a={error:t}}finally{try{x&&!x.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}}else l.get(v)?l.get(v).forEach(function(t){return f.add(t)}):v.initialStateNodes.forEach(function(t){return f.add(t)})}}catch(t){r={error:t}}finally{try{_&&!_.done&&(o=m.return)&&o.call(m)}finally{if(r)throw r.error}}try{for(var w=c(f),E=w.next();!E.done;E=w.next())for(var v=E.value,y=v.parent;y&&!f.has(y);)f.add(y),y=y.parent}catch(t){u={error:t}}finally{try{E&&!E.done&&(h=w.return)&&h.call(w)}finally{if(u)throw u.error}}return f}function tb(t){var e,n,i=new Map;try{for(var r=c(t),o=r.next();!o.done;o=r.next()){var a=o.value;i.has(a)||i.set(a,[]),a.parent&&(i.has(a.parent)||i.set(a.parent,[]),i.get(a.parent).push(a))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return i}function tx(t,e){return Array.isArray(t)?t.some(function(t){return t===e}):t instanceof Set&&t.has(e)}function tS(t,e){return"compound"===e.type?tm(e).some(function(e){return"final"===e.type&&tx(t,e)}):"parallel"===e.type&&tm(e).every(function(e){return tS(t,e)})}function tw(t){return new Set(M(t.map(function(t){return t.tags})))}var tE=function(){function t(t){var e,n,i=this;this.actions=[],this.activities=k,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||k,this.meta=(void 0===(e=t.configuration)&&(e=[]),e.reduce(function(t,e){return void 0!==e.meta&&(t[e.id]=e.meta),t},{})),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!==(n=Array.isArray(t.tags)?new Set(t.tags):t.tags)&&void 0!==n?n:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return h([],u(new Set(M(h([],u(i.configuration.map(function(t){return t.ownEvents})),!1)))),!1)}})}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:ti,_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){return e instanceof t?e.actions.length?new t({value:e.value,context:n,_event:ti,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}}):e:t.from(e,n)},t.prototype.toStrings=function(t,e){var n=this;if(void 0===t&&(t=this.value),void 0===e&&(e="."),$(t))return[t];var i=Object.keys(t);return i.concat.apply(i,h([],u(i.map(function(i){return n.toStrings(t[i],e).map(function(t){return i+e+t})})),!1))},t.prototype.toJSON=function(){this.configuration,this.transitions;var t=this.tags;this.machine;var e=s(this,["configuration","transitions","tags","machine"]);return a(a({},e),{tags:Array.from(t)})},t.prototype.matches=function(t){return T(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t.prototype.can=function(t){J(!!this.machine);var e,n=null===(e=this.machine)||void 0===e?void 0:e.getTransitionData(this,t);return!!(null!=n&&n.transitions.length)&&n.transitions.some(function(t){return void 0!==t.target||t.actions.length})},t}(),tO={deferEvents:!1},tk=function(){function t(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=a(a({},tO),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}(),tN=new Map,tT=0,tj={bookId:function(){return"x:".concat(tT++)},register:function(t,e){return tN.set(t,e),t},get:function(t){return tN.get(t)},free:function(t){tN.delete(t)}};function tA(){return"u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:void 0}var tP,tL,tI,tC,tV,tD,tM={sync:!1,autoForward:!1};(i=tD||(tD={}))[i.NotStarted=0]="NotStarted",i[i.Running=1]="Running",i[i.Stopped=2]="Stopped";var tR=function(){function t(e,n){void 0===n&&(n=t.defaultOptions);var i=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=tD.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(t,e){if(U(t))return i.batch(t),i.state;var n=W(G(t,e));if(i.status===tD.Stopped)return i.state;if(i.status!==tD.Running&&!i.options.deferEvents)throw Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(i.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options. 2Event: `).concat(JSON.stringify(n.data)));return i.scheduler.schedule(function(){i.forward(n);var t=i._nextState(n);i.update(t,n)}),i._state},this.sendTo=function(t,e,n){var r=i.parent&&(e===tC.Parent||i.parent.id===e),o=r?i.parent:$(e)?e===tC.Internal?i:i.children.get(e)||tj.get(e):e&&"function"==typeof e.send?e:void 0;if(!o){if(!r)throw Error("Unable to send event to child '".concat(e,"' from service '").concat(i.id,"'."));return}if("machine"in o){if(i.status!==tD.Stopped||i.parent!==o||i.state.done){var s=a(a({},t),{name:t.name===S?"".concat(th(i.id)):t.name,origin:i.sessionId});!n&&i.machine.config.predictableActionArguments?i._outgoingQueue.push([o,s]):o.send(s)}}else!n&&i.machine.config.predictableActionArguments?i._outgoingQueue.push([o,t.data]):o.send(t.data)},this._exec=function(t,e,n,r){void 0===r&&(r=i.machine.options.actions);var o=t.exec||tr(t.type,r),a=F(o)?o:o?o.exec:t.exec;if(a)try{return a(e,n.data,i.machine.config.predictableActionArguments?{action:t,_event:n}:{action:t,state:i.state,_event:n})}catch(t){throw i.parent&&i.parent.send({type:"xstate.error",data:t}),t}switch(t.type){case d:i.defer(t);break;case p:if("number"==typeof t.delay){i.defer(t);return}t.to?i.sendTo(t._event,t.to,n===ti):i.send(t._event);break;case v:i.cancel(t.sendId);break;case l:if(i.status!==tD.Running)return;var s=t.activity;if(!i.machine.config.predictableActionArguments&&!i.state.activities[s.id||s.type])break;if(s.type===tI.Invoke){var c=Z(s.src),u=i.machine.options.services?i.machine.options.services[c.type]:void 0,h=s.id,y=s.data,g="autoForward"in s?s.autoForward:!!s.forward;if(!u)return;var _=y?z(y,e,n):void 0;if("string"==typeof u)return;var b=F(u)?u(e,n.data,{data:_,src:c,meta:s.meta}):u;if(!b)return;var x=void 0;H(b)&&(b=_?b.withContext(_):b,x={autoForward:g}),i.spawn(b,h,x)}else i.spawnActivity(s);break;case f:i.stopChild(t.activity.id);break;case m:var S=t.label,w=t.value;S?i.logger(S,w):i.logger(w)}};var r=a(a({},t.defaultOptions),n),o=r.clock,s=r.logger,c=r.parent,u=r.id,h=void 0!==u?u:e.id;this.id=h,this.logger=s,this.clock=o,this.parent=c,this.options=r,this.scheduler
2=new tk({deferEvents:this.options.deferEvents}),this.sessionId=tj.bookId()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:td(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,e){var n,i;try{for(var r=c(t.actions),o=r.next();!o.done;o=r.next()){var a=o.value;this.exec(a,t,e)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},t.prototype.update=function(t,e){var n,i,r,o,a,s,u,h,l=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||e===ti)&&this.options.execute)this.execute(this.state);else for(var f=void 0;f=this._outgoingQueue.shift();)f[0].send(f[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 d=c(this.eventListeners),p=d.next();!p.done;p=d.next()){var v=p.value;v(t.event)}}catch(t){n={error:t}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}try{for(var y=c(this.listeners),g=y.next();!g.done;g=y.next()){var v=g.value;v(t,t.event)}}catch(t){r={error:t}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}try{for(var m=c(this.contextListeners),_=m.next();!_.done;_=m.next())(0,_.value)(this.state.context,this.state.history?this.state.history.context:void 0)}catch(t){a={error:t}}finally{try{_&&!_.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(this.state.done){var b=t.configuration.find(function(t){return"final"===t.type&&t.parent===l.machine}),x=b&&b.doneData?z(b.doneData,t.context,e):void 0;this._doneEvent=tu(this.id,x);try{for(var S=c(this.doneListeners),w=S.next();!w.done;w=S.next()){var v=w.value;v(this._doneEvent)}}catch(t){u={error:t}}finally{try{w&&!w.done&&(h=S.return)&&h.call(S)}finally{if(u)throw u.error}}this._stop(),this._stopChildren(),tj.free(this.sessionId)}},t.prototype.onTransition=function(t){return this.listeners.add(t),this.status===tD.Running&&t(this.state,this.state.event),this},t.prototype.subscribe=function(t,e,n){var i=this,r=tt(t,e,n);this.listeners.add(r.next),this.status!==tD.NotStarted&&r.next(this.state);var o=function(){i.doneListeners.delete(o),i.stopListeners.delete(o),r.complete()};return this.status===tD.Stopped?r.complete():(this.onDone(o),this.onStop(o)),{unsubscribe:function(){i.listeners.delete(r.next),i.doneListeners.delete(o),i.stopListeners.delete(o)}}},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===tD.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===tD.Running)return this;this.machine._init(),tj.register(this.sessionId,this),this.initialized=!0,this.status=tD.Running;var n=void 0===t?this.initialState:td(this,function(){return"object"==typeof t&&null!==t&&"value"in t&&"_event"in t?e.machine.resolveState(t):e.machine.resolveState(tE.from(t,e.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){e.update(n,ti)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(t){F(t.stop)&&t.stop()}),this.children.clear()},t.prototype._stop=function(){var t,e,n,i,r,o,a,s,u,h;try{for(var l=c(this.listeners),f=l.next();!f.done;f=l.next()){var d=f.value;this.listeners.delete(d)}}catch(e){t={error:e}}finally{try{f&&!f.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}try{for(var p=c(this.stopListeners),v=p.next();!v.done;v=p.next()){var d=v.value;
2d(),this.stopListeners.delete(d)}}catch(t){n={error:t}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}try{for(var y=c(this.contextListeners),g=y.next();!g.done;g=y.next()){var d=g.value;this.contextListeners.delete(d)}}catch(t){r={error:t}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}try{for(var m=c(this.doneListeners),_=m.next();!_.done;_=m.next()){var d=_.value;this.doneListeners.delete(d)}}catch(t){a={error:t}}finally{try{_&&!_.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=tD.Stopped,this._initialState=void 0;try{for(var b=c(Object.keys(this.delayedEventsMap)),x=b.next();!x.done;x=b.next()){var S=x.value;this.clock.clearTimeout(this.delayedEventsMap[S])}}catch(t){u={error:t}}finally{try{x&&!x.done&&(h=b.return)&&h.call(b)}finally{if(u)throw u.error}}this.scheduler.clear(),this.scheduler=new tk({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var t=this,e=this.scheduler;return this._stop(),e.schedule(function(){var e=W({type:"xstate.stop"}),n=td(t,function(){var n=M(h([],u(t.state.configuration),!1).sort(function(t,e){return e.order-t.order}).map(function(e){return ta(e.onExit,t.machine.options.actions)})),i=u(tf(t.machine,t.state,t.state.context,e,[{type:"exit",actions:n}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),r=i[0],o=i[1],a=new tE({value:t.state.value,context:o,_event:e,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:r.filter(function(t){return!tn(t)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return a.changed=!0,a});t.update(n,e),t._stopChildren(),tj.free(t.sessionId)}),this},t.prototype.batch=function(t){var e=this;if(this.status===tD.NotStarted&&this.options.deferEvents);else if(this.status!==tD.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 i,r,o=e.state,s=!1,l=[];try{for(var f=c(t),d=f.next();!d.done;d=f.next()){var p=d.value;(function(t){var i=W(t);e.forward(i),o=td(e,function(){return e.machine.transition(o,i,void 0,n||void 0)}),l.push.apply(l,h([],u(e.machine.config.predictableActionArguments?o.actions:o.actions.map(function(t){var e,n;return e=o,n=t.exec,a(a({},t),{exec:void 0!==n?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0})})),!1)),s=s||!!o.changed})(p)}}catch(t){i={error:t}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(i)throw i.error}}o.changed=s,o.actions=l,e.update(o,W(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 i=W(t);if(0===i.name.indexOf(x)&&!this.state.nextEvents.some(function(t){return 0===t.indexOf(x)}))throw i.data.data;return td(this,function(){return n.machine.transition(n.state,i,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 i=c(this.forwardTo),r=i.next();!r.done;r=i.next()){var o=r.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{r&&!r.done&&(n=i.return)&&n.call(i)}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),F(e.stop)&&e.stop())},t.prototype.spawn=function(t,e,n){if(this.status!==tD.Running)return tv(t,e);
2if(q(t))return this.spawnPromise(Promise.resolve(t),e);if(F(t))return this.spawnCallback(t,e);if(function(t){try{return"function"==typeof t.send}catch{return!1}}(t)&&"id"in t)return this.spawnActor(t,e);if(function(t){try{return"subscribe"in t&&F(t.subscribe)}catch{return!1}}(t))return this.spawnObservable(t,e);if(H(t))return this.spawnMachine(t,a(a({},n),{id:e}));if(null!==t&&"object"==typeof t&&"transition"in t&&"function"==typeof t.transition)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 i=this;void 0===n&&(n={});var r=new t(e,a(a({},this.options),{parent:this,id:n.id||e.id})),o=a(a({},tM),n);return o.sync&&r.onTransition(function(t){i.send(w,{state:t,id:r.id})}),this.children.set(r.id,r),o.autoForward&&this.forwardTo.add(r.id),r.onDone(function(t){i.removeChild(r.id),i.send(W(t,{origin:r.id}))}).start(),r},t.prototype.spawnBehavior=function(t,e){var n,i,r,o,s,c,u,h,l,f,d=(n={id:e,parent:this},o=t.initialState,s=new Set,c=[],u=!1,h=function(){if(!u){for(u=!0;c.length>0;){var e=c.shift();o=t.transition(o,e,f),s.forEach(function(t){return t.next(o)})}u=!1}},i={id:n.id,send:function(t){c.push(t),h()},getSnapshot:function(){return o},subscribe:function(t,e,n){var i=tt(t,e,n);return s.add(i),i.next(o),{unsubscribe:function(){s.delete(i)}}}},l=a(((r={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[Q]=function(){return this},r),i),f={parent:n.parent,self:l,id:n.id||"anonymous",observers:s},o=t.start?t.start(f):o,l);return this.children.set(e,d),d},t.prototype.spawnPromise=function(t,e){var n,i,r=this,o=!1;t.then(function(t){o||(i=t,r.removeChild(e),r.send(W(tu(e,t),{origin:e})))},function(t){if(!o){r.removeChild(e);var n=th(e,t);try{r.send(W(n,{origin:e}))}catch(t){r.devTools&&r.devTools.send(n,r.state),r.machine.strict&&r.stop()}}});var a=((n={id:e,send:function(){},subscribe:function(e,n,i){var r=tt(e,n,i),o=!1;return t.then(function(t){o||(r.next(t),o||r.complete())},function(t){o||r.error(t)}),{unsubscribe:function(){return o=!0}}},stop:function(){o=!0},toJSON:function(){return{id:e}},getSnapshot:function(){return i}})[Q]=function(){return this},n);return this.children.set(e,a),a},t.prototype.spawnCallback=function(t,e){var n,i,r,o=this,a=!1,s=new Set,c=new Set;try{r=t(function(t){i=t,c.forEach(function(e){return e(t)}),a||o.send(W(t,{origin:e}))},function(t){s.add(t)})}catch(t){this.send(th(e,t))}if(q(r))return this.spawnPromise(r,e);var u=((n={id:e,send:function(t){return s.forEach(function(e){return e(t)})},subscribe:function(t){var e=tt(t);return c.add(e.next),{unsubscribe:function(){c.delete(e.next)}}},stop:function(){a=!0,F(r)&&r()},toJSON:function(){return{id:e}},getSnapshot:function(){return i}})[Q]=function(){return this},n);return this.children.set(e,u),u},t.prototype.spawnObservable=function(t,e){var n,i,r=this,o=t.subscribe(function(t){i=t,r.send(W(t,{origin:e}))},function(t){r.removeChild(e),r.send(W(th(e,t),{origin:e}))},function(){r.removeChild(e),r.send(W(tu(e),{origin:e}))}),a=((n={id:e,send:function(){},subscribe:function(e,n,i){return t.subscribe(e,n,i)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return i},toJSON:function(){return{id:e}}})[Q]=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){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}}})[Q]=function(){return this},n))},t.prototype.attachDev=function(){var t=tA();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(a(a({name:this.id,autoPause:!0,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},e),{features:a({jump:!1,skip:!1},e?e.features:void 0)}),this.machine),this.devTools.init(this.state)}(function(t){if(tA()){var e=function(){var t=tA();if(t&&"__xstate__"in t)return t.__xstate__}();e&&e.register(t)}})(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[Q]=function(){return this},t.prototype.getSnapshot=function(){return this.status===tD.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=tz,t}();function tz(t,e){return new tR(t,e)}function tq(t){return a(a({type:b},t),{toJSON:function(){t.onDone,t.onError;var e=s(t,["onDone","onError"]);return a(a({},e),{type:b,src:function(t){if("string"==typeof t){var e={type:t};return e.toString=function(){return t},e}return t}(t.src)})}})}var tB={},tJ=function(t){return"#"===t[0]},tU=function(){function t(e,n,i,r){void 0===i&&(i="context"in e?e.context:void 0);var o,s=this;this.config=e,this._context=i,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==r?void 0:r.parent,this.key=this.config.key||(null==r?void 0:r.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:"."),this.id=this.config.id||h([this.machine.key],u(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!==(o=this.config.schema)&&void 0!==o?o:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?I(this.config.states,function(e,n){var i,r=new t(e,{},void 0,{parent:s,key:n});return Object.assign(s.idMap,a(((i={})[r.id]=r,i),r.idMap)),r}):tB;var l=0;(function t(e){var n,i;e.order=l++;try{for(var r=c(tg(e)),o=r.next();!o.done;o=r.next()){var a=o.value;t(a)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}})(this),this.history=!0===this.config.history?"shallow":this.config.history||
2!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=R(this.config.entry||this.config.onEntry).map(function(t){return to(t)}),this.onExit=R(this.config.exit||this.config.onExit).map(function(t){return to(t)}),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=R(this.config.invoke).map(function(t,e){if(H(t)){var n,i,r=te(s.id,e);return s.machine.options.services=a(((n={})[r]=t,n),s.machine.options.services),tq({src:r,id:r})}if($(t.src)){var r=t.id||te(s.id,e);return tq(a(a({},t),{id:r,src:t.src}))}if(H(t.src)||F(t.src)){var r=t.id||te(s.id,e);return s.machine.options.services=a(((i={})[r]=t.src,i),s.machine.options.services),tq(a(a({id:r},t),{src:r}))}var o=t.src;return tq(a(a({id:te(s.id,e)},t),{src:o}))}),this.activities=R(this.config.activities).concat(this.invoke).map(function(t){return ts(t)}),this.transition=this.transition.bind(this),this.tags=R(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||(function t(e){var n=[e];return ty(e)?n:n.concat(M(tm(e).map(t)))})(this).forEach(function(t){return t.on})},t.prototype.withConfig=function(e,n){var i=this.options,r=i.actions,o=i.activities,s=i.guards,c=i.services,u=i.delays;return new t(this.config,{actions:a(a({},r),e.actions),activities:a(a({},o),e.activities),guards:a(a({},s),e.guards),services:a(a({},c),e.services),delays:a(a({},u),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 F(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:I(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 i=n.eventType===t;return e?i:i||"*"===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 i,r,o,a=(i=F(e)?"".concat(t.id,":delay[").concat(n,"]"):e,r=t.id,"".concat(tI.After,"(").concat(i,")").concat(r?"#".concat(r):""));return t.onEntry.push({to:(o={delay:e}).to,type:p,event:F(a)?a:G(a),delay:o?o.delay:void 0,id:o&&void 0!==o.id?o.id:F(a)?a.name:j(a)}),t.onExit.push({type:v,sendId:a}),a};return(U(e)?e.map(function(t,e){var i=n(t.delay,e);return a(a({},t),{event:i})}):M(Object.keys(e).map(function(t,i){var r=e[t],o=$(r)?{target:r}:r,s=isNaN(+t)?t:+t,c=n(s,i);return R(o).map(function(t){return a(a({},t),{event:c,delay:s})})}))).map(function(e){var n=e.delay;return a(a({},t.formatTransition(e)),{delay:n})})},t.prototype.getStateNodes=function(t){var e,n=this;if(!t)return[];var i=t instanceof tE?t.value:P(t,this.delimiter);if($(i)){var r=this.getStateNode(i).initial;
2return void 0!==r?this.getStateNodes(((e={})[i]=r,e)):[this,this.states[i]]}var o=Object.keys(i),a=[this];return a.push.apply(a,h([],u(M(o.map(function(t){return n.getStateNode(t).getStateNodes(i[t])}))),!1)),a},t.prototype.handles=function(t){var e=j(t);return this.events.includes(e)},t.prototype.resolveState=function(t){var e=t instanceof tE?t:tE.create(t),n=Array.from(t_([],this.getStateNodes(e.value)));return new tE(a(a({},e),{value:this.resolve(e.value),configuration:n,done:tS(n,this),tags:tw(n),machine:this.machine}))},t.prototype.transitionLeafNode=function(t,e,n){var i=this.getStateNode(t).next(e,n);return i&&i.transitions.length?i:this.next(e,n)},t.prototype.transitionCompoundNode=function(t,e,n){var i=Object.keys(t),r=this.getStateNode(i[0])._transition(t[i[0]],e,n);return r&&r.transitions.length?r:this.next(e,n)},t.prototype.transitionParallelNode=function(t,e,n){var i,r,o={};try{for(var a=c(Object.keys(t)),s=a.next();!s.done;s=a.next()){var u=s.value,h=t[u];if(h){var l=this.getStateNode(u)._transition(h,e,n);l&&(o[u]=l)}}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}var f=Object.keys(o).map(function(t){return o[t]}),d=M(f.map(function(t){return t.transitions}));if(!f.some(function(t){return t.transitions.length>0}))return this.next(e,n);var p=M(Object.keys(o).map(function(t){return o[t].configuration}));return{transitions:d,exitSet:M(f.map(function(t){return t.exitSet})),configuration:p,source:e,actions:M(Object.keys(o).map(function(t){return o[t].actions}))}},t.prototype._transition=function(t,e,n){return $(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,W(e))},t.prototype.next=function(t,e){var n,i,r,o=this,a=e.name,s=[],l=[];try{for(var f=c(this.getCandidates(a)),d=f.next();!d.done;d=f.next()){var p=d.value,v=p.cond,y=p.in,g=t.context,m=!y||($(y)&&tJ(y)?t.matches(P(this.getStateNodeById(y).path,this.delimiter)):T(P(y,this.delimiter),V(this.path.slice(0,-2))(t.value))),_=!1;try{_=!v||Y(this.machine,v,g,e,t)}catch(t){throw Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`': 3`).concat(t.message))}if(_&&m){void 0!==p.target&&(l=p.target),s.push.apply(s,h([],u(p.actions),!1)),r=p;break}}}catch(t){n={error:t}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}if(r){if(!l.length)return{transitions:[r],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var b=M(l.map(function(e){return o.getRelativeStateNodes(e,t.historyValue)})),x=!!r.internal;return{transitions:[r],exitSet:x?[]:M(l.map(function(t){return o.getPotentiallyReenteringNodes(t)})),configuration:b,source:t,actions:s}}},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,i,r,o,a){var s,l,f,p,v=this,y=o?t_([],this.getStateNodes(o.value)):[],g=new Set;try{for(var m=c(Array.from(t).sort(function(t,e){return t.order-e.order})),_=m.next();!_.done;_=m.next()){var b=_.value;(!tx(y,b)||tx(n.exitSet,b)||b.parent&&g.has(b.parent))&&g.add(b)}}catch(t){s={error:t}}finally{try{_&&!_.done&&(l=m.return)&&l.call(m)}finally{if(s)throw s.error}}try{for(var x=c(y),S=x.next();!S.done;S=x.next()){var b=S.value;(!tx(t,b)||tx(n.exitSet,b.parent))&&n.exitSet.push(b)}}catch(t){f={error:t}}finally{try{S&&!S.done&&(p=x.return)&&p.call(x)}finally{if(f)throw f.error}}n.exitSet.sort(function(t,e){return e.order-t.order});var w=Array.from(g).sort(function(t,e){return t.order-e.order}),E=new Set(n.exitSet),O=M(w.map(function(t){var e=[];if("final"!==t.type)return e;var o=t.parent;if(!o.parent)return e;e.push(tc(t.id,t.doneData),tc(o.id,t.doneData?z(t.doneData,i,r):void 0));var a=o.parent;return"parallel"===a.type&&tm(a).every(function(t){return tS(n.configuration,t)})&&e.push(tc(a.id)),e})),k=w.map(function(t){var e=t.onEntry,n=t.activities.map(function(t){var e;return e=ts(t),{type:tI.Start,activity:e,exec:void 0}});return{type:"entry",actions:ta(a?h(h([],u(e),!1),u(n),!1):h(h([],u(n),!1),u(e),!1),v.machine.options.actions)}}).concat({type:"state_done",actions:O.map(function(t){var e;return{type:d,event:"function"==typeof t?t:G(t),delay:void 0,id:null==e?void 0:e.id}})}),N=Array.from(E).map(function(t){return{type:"exit",actions:ta(h(h([],u(t.onExit),!1),u(t.activities.map(function(t){var e;return e=F(t)?t:ts(t),{type:tI.Stop,activity:e,exec:void 0}})),!1),v.machine.options.actions)}}).concat({type:"transition",actions:ta(n.actions,this.machine.options.actions)}).concat(k);if(e){var T=ta(M(h([],u(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!tn(t)});return N.concat({type:"stop",actions:T})}return N},t.prototype.transition=function(t,e,n,i){void 0===t&&(t=this.initialState);var r,o,a=W(e);if(t instanceof tE)o=void 0===n?t:this.resolveState(tE.from(t,n));else{var s=$(t)?this.resolve(L(this.getResolvedPath(t))):this.resolve(t),c=null!=n?n:this.machine.context;
3o=this.resolveState(tE.from(s,c))}if(this.strict&&!this.events.includes(a.name)&&(r=a.name,!/^(done|error)\./.test(r)))throw Error("Machine '".concat(this.id,"' does not accept event '").concat(a.name,"'"));var l=this._transition(o.value,o,a)||{transitions:[],configuration:[],exitSet:[],source:o,actions:[]},f=t_([],this.getStateNodes(o.value)),d=l.configuration.length?t_(f,l.configuration):f;return l.configuration=h([],u(d),!1),this.resolveTransition(l,o,o.context,i,a)},t.prototype.resolveRaisedTransition=function(t,e,n,i){var r,o=t.actions;return(t=this.transition(t,e,void 0,i))._event=n,t.event=n.data,(r=t.actions).unshift.apply(r,h([],u(o),!1)),t},t.prototype.resolveTransition=function(t,e,n,i,r){var o,s,h,d,p,v,g=this;void 0===r&&(r=ti);var m=t.configuration,_=!e||t.transitions.length>0,x=_?t.configuration:e?e.configuration:[],S=tS(x,this),E=_?(s=t_([o=this.machine],m),function t(e,n){var i=n.get(e);if(!i)return{};if("compound"===e.type){var r=i[0];if(!r)return{};if(ty(r))return r.key}var o={};return i.forEach(function(e){o[e.key]=t(e,n)}),o}(o,tb(s))):void 0,O=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):void 0:void 0,k=this.getActions(new Set(x),S,t,n,r,e,i),N=e?a({},e.activities):{};try{for(var T=c(k),j=T.next();!j.done;j=T.next()){var A=j.value;try{for(var P=(p=void 0,c(A.actions)),L=P.next();!L.done;L=P.next()){var C=L.value;C.type===l?N[C.activity.id||C.activity.type]=C:C.type===f&&(N[C.activity.id||C.activity.type]=!1)}}catch(t){p={error:t}}finally{try{L&&!L.done&&(v=P.return)&&v.call(P)}
3finally{if(p)throw p.error}}}}catch(t){h={error:t}}finally{try{j&&!j.done&&(d=T.return)&&d.call(T)}finally{if(h)throw h.error}}var V=u(tf(this,e,n,r,k,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),D=V[0],M=V[1],R=u(function(t,e){var n,i,r=u([[],[]],2),o=r[0],a=r[1];try{for(var s=c(t),h=s.next();!h.done;h=s.next()){var l=h.value;e(l)?o.push(l):a.push(l)}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return[o,a]}(D,tn),2),q=R[0],B=R[1],J=D.filter(function(t){var e;return t.type===l&&(null===(e=t.activity)||void 0===e?void 0:e.type)===b}).reduce(function(t,e){var n,i,o,a,s,c,u,h;return t[e.activity.id]=(n=e.activity,i=g.machine,o=r,s=Z(n.src),c=null===(a=null==i?void 0:i.options.services)||void 0===a?void 0:a[s.type],u=n.data?z(n.data,M,o):void 0,(h=c?tv(c,n.id,u):tp(n.id)).meta=n,h),t},e?a({},e.children):{}),U=new tE({value:E||e.value,context:M,_event:r,_sessionid:e?e._sessionid:null,historyValue:E?O?{current:E,states:function t(e,n){return I(e.states,function(e,i){if(e){var r=($(n)?void 0:n[i])||(e?e.current:void 0);if(r)return{current:r,states:t(e,r)}}})}(O,E)}:void 0:e?e.historyValue:void 0,history:!E||t.source?e:void 0,actions:E?B:[],activities:E?N:e?e.activities:{},events:[],configuration:x,transitions:t.transitions,children:J,done:S,tags:tw(x),machine:this}),F=n!==M;U.changed=r.name===w||F;var X=U.history;X&&delete X.history;var Q=!S&&(this._transient||m.some(function(t){return t._transient}));if(!_&&(!Q||""===r.name))return U;var H=U;
3if(!S)for(Q&&(H=this.resolveRaisedTransition(H,{type:y},r,i));q.length;){var G=q.shift();H=this.resolveRaisedTransition(H,G._event,r,i)}var W=H.changed||(X?!!H.actions.length||F||typeof X.value!=typeof H.value||!function t(e,n){if(e===n)return!0;if(void 0===e||void 0===n)return!1;if($(e)||$(n))return e===n;var i=Object.keys(e),r=Object.keys(n);return i.length===r.length&&i.every(function(i){return t(e[i],n[i])})}(H.value,X.value):void 0);return H.changed=W,H.history=X,H},t.prototype.getStateNode=function(t){if(tJ(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=tJ(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&&tJ(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var e=A(t,this.delimiter).slice(),n=this;e.length;){var i=e.shift();if(!i.length)break;n=n.getStateNode(i)}return n},t.prototype.resolve=function(t){var e,n=this;if(!t)return this.initialStateValue||tB;switch(this.type){case"parallel":return I(this.initialStateValue,function(e,i){return e?n.getStateNode(i).resolve(t[i]||e):tB});case"compound":if($(t)){var i=this.getStateNode(t);return"parallel"===i.type||"compound"===i.type?((e={})[t]=i.initialStateValue,e):t}return Object.keys(t).length?I(t,function(t,e){return t?n.getStateNode(e).resolve(t):tB}):this.initialStateValue||{};default:return t||tB}},t.prototype.getResolvedPath=function(t){if(tJ(t)){var e=this.machine.idMap[t.slice(1)];if(!e)throw Error("Unable to find state node '".concat(t,"'"));return e.path}return A(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=C(this.states,function(t){return t.initialStateValue||tB},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=ty(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=$(e.target)&&tJ(e.target)?L(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;return ty(this)||"compound"===this.type&&!this.initial?[this]:M(D(this.initialStateValue).map(function(e){return t.getFromRelativePath(e)}))},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var e=u(t),n=e[0],i=e.slice(1);if(!this.states)throw Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var r=this.getStateNode(n);if("history"===r.type)return r.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:C(this.states,function(e,n){if(!t)return e.historyValue();var i=$(t)?void 0:t[n];return e.historyValue(i||e.initialStateValue)},function(t){return!t.history})}},t.prototype.resolveHistory=function(t){var e,n=this;if("history"!==this.type)return[this];var i=this.parent;if(!t){var r=this.target;return r?M(D(r).map(function(t){return i.getFromRelativePath(t)})):i.initialStateNodes}var o=(e=i.path,function(t){var n,i,r=t;try{for(var o=c(e),a=o.next();!a.done;a=o.next()){var s=a.value;r=r.states[s]}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r})(t).current;return $(o)?[i.getStateNode(o)]:M(D(o).map(function(t){return"deep"===n.history?i.getFromRelativePath(t):[i.states[t[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var t=this,e=M(Object.keys(this.states).map(function(e){return t.states[e].stateIds}));return[this.id].concat(e)}
3,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){if(this.__cache.events)return this.__cache.events;var t,e,n,i,r=this.states,o=new Set(this.ownEvents);if(r)try{for(var a=c(Object.keys(r)),s=a.next();!s.done;s=a.next()){var u=r[s.value];if(u.states)try{for(var h=(n=void 0,c(u.events)),l=h.next();!l.done;l=h.next()){var f=l.value;o.add("".concat(f))}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(o)},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(!$(t))return t;var n=t[0]===e.delimiter;if(n&&!e.parent)return e.getStateNodeByPath(t.slice(1));var i=n?e.key+t:t;if(!e.parent)return e.getStateNodeByPath(i);try{return e.parent.getStateNodeByPath(i)}catch(t){throw Error("Invalid transition definition for state node '".concat(e.id,`': 4`).concat(t.message))}})},t.prototype.formatTransition=function(t){var e=this,n=function(t){if(!(void 0===t||""===t))return R(t)}(t.target),i="internal"in t?t.internal:!n||n.some(function(t){return $(t)&&t[0]===e.delimiter}),r=this.machine.options.guards,o=this.resolveTarget(n),s=a(a({},t),{actions:ta(R(t.actions)),cond:X(t.cond,r),target:o,source:this,internal:i,eventType:t.event,toJSON:function(){return a(a({},s),{target:s.target?s.target.map(function(t){return"#".concat(t.id)}):void 0,source:"#".concat(e.id)})}});return s},t.prototype.formatTransitions=function(){var t,e,n,i=this;if(this.config.on){if(Array.isArray(this.config.on))n=this.config.on;else{var r=this.config.on,o=r["*"],a=s(r,["*"]);n=M(Object.keys(a).map(function(t){return K(t,a[t])}).concat(K("*",void 0===o?[]:o)))}}else n=[];var l=this.config.always?K("",this.config.always):[],f=this.config.onDone?K(String(tc(this.id)),this.config.onDone):[],d=M(this.invoke.map(function(t){var e=[];return t.onDone&&e.push.apply(e,h([],u(K(String(tu(t.id)),t.onDone)),!1)),t.onError&&e.push.apply(e,h([],u(K(String(th(t.id)),t.onError)),!1)),e})),p=this.after,v=M(h(h(h(h([],u(f),!1),u(d),!1),u(n),!1),u(l),!1).map(function(t){return R(t).map(function(t){return i.formatTransition(t)})}));try{for(var y=c(p),g=y.next();!g.done;g=y.next()){var m=g.value;v.push(m)}}catch(e){t={error:e}}finally{try{g&&!g.done&&(e=y.return)&&e.call(y)}finally{if(t)throw t.error}}return v},t}(),tF={click:"onClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",complete:"onComplete",after:"onAfter",enter:"onEnter",show:"onShow"};Object.values(tF);var t$=Object.keys(tF),tX=class{activeStateId="";_service;_domListeners=new Map;_domElement;_playerListeners=new Map;_player;_machineSchemas=new Map;_onShowPrevValue=0;constructor(t,e){this._player=e,this._machineSchemas=this._transformToXStateSchema(t),this._domElement=e.container}start(t){this.stop();let e=this._machineSchemas.get(t);if(typeof e>"u")throw(0,o.h)(`invalid state machine id ${t}`);this._service=tz(new tU(e,void 0)),this._addEventListeners(),this._service.start()}stop(){var t;this._removeEventListeners(),null==(t=this._service)||t.stop(),this._player.stop()}_removeEventListeners(){var t;for(let[e,n]of(this._requiresDomElement(),this._domListeners))"visibilityChange"===e&&this._player.stopPlayOnShow(),null==(t=this._domElement)||t.removeEventListener(e,n),this._domListeners.delete(e);for(let[t,e]of this._playerListeners)this._player.removeEventListener(t,e),this._playerListeners.delete(t)}_addEventListeners(){this._requiresDomElement();let t=t=>{this._service.send({type:t})},e=e=>function(){t(e)};this._service.subscribe(t=>{var n;if(typeof t.changed>"u"||t.changed){for(let i of(this._removeEventListeners(),t.nextEvents))if(t$.filter(t=>"complete"!==t&&"show"!==t).includes(i)){let t=e(i);this._domListeners.set(i,t),null==(n=this._domElement)||n.addEventListener(i,t,{once:!0})}else if("complete"===i){let t=e(i);this._player.addEventListener(i,t),this._playerListeners.set(i,t)}else if("show"===i){let t=e(i);this._player.addIntersectionObserver({callbackOnIntersect:e=>{e>0&&(100!==e&&this._onShowPrevValue!==e&&t(),this._onShowPrevValue=e)},threshold:[]}),this._domListeners.set("visibilityChange",t)}}})}subscribe(t){throw(0,o.h)(t.toString())}_transformToXStateSchema(t){var e,n,i;let a=new Map;for(let s of t){let t={},c={};if(c.id=s.descriptor.id,"u">typeof s.descriptor.initial&&(c.initial=s.descriptor.initial),"u">typeof s){let a=s.states;for(let s in a)if("u">typeof a[s]&&a[s]){let c=a[s],u=c.playbackSettings,h=Object.keys(c).filter(t=>t.startsWith("on")),l={},f={};for(let t of h)if("u">typeof c[t]){let r=c[t];t===tF.after?f[r.ms]={target:null!=(e=null==r?void 0:r.state)?e:""}:t===tF.enter?l[(0,o.o)(tF,t)]={target:null!=(n=null==r?void 0:r.state)?n:""}:l[(0,o.o)(tF,t)]={target:null!=(i=null==r?void 0:r.state)?i:""}}t[s]={entry:()=>{!this._player.getAnimationInstance()||c.animationId&&c.animationId!==this._player.currentAnimationId?this._player.play(c.animationId,()=>({...r.d,...u})).then(()=>{this._updatePlaybackSettings(u)}).catch(t=>{(0,o.i)(`State machine error: ${t.message}`)}):this._updatePlaybackSettings(u)},exit:()=>{"u">typeof u.segments&&this._player.resetSegments(!1),"u">typeof u.playOnScroll&&this._player.stopPlayOnScroll()},on:l,after:f,meta:u}}}c.states=t,a.set(c.id,c)}return a}_handlePlaySegments(t){if("string"==typeof t.segments)this._player.goToAndPlay(t.segments,!0);else{let[e,n]=t.segments,i=e;0!==e&&e===n&&(i=e-1),0===e&&e===n?this._player.goToAndPlay(e,!0):this._player.playSegments([i,n],!0)}}_handlePlayOnScroll(t){let e=t.playOnScroll;if(t.segments&&"string"!=typeof t.segments){let n=t.segments;this._player.playOnScroll({threshold:e,segments:n})}else this._player.playOnScroll({threshold:e})}_updatePlaybackSettings(t){if(!this._player.getAnimationInstance())throw Error("Unable to update playbackSettings. Animations is not rendered yet.");"u">typeof t.autoplay&&(this._player.setAutoplay(t.autoplay),t.autoplay?this._player.play():this._player.pause()),"u">typeof t.direction&&this._player.setDirection(t.direction),"u">typeof t.intermission&&this._player.setIntermission(t.intermission),"u">typeof t.loop&&this._player.setLoop(t.loop),"u">typeof t.playMode&&this._player.setMode(t.playMode),"u">typeof t.speed&&this._player.setSpeed(t.speed),"u">typeof t.defaultTheme&&this._player.setDefaultTheme(t.defaultTheme),"u">typeof t.playOnScroll&&this._handlePlayOnScroll(t),t.segments&&this._handlePlaySegments(t),t.autoplay||this._player.pause()}_requiresDomElement(){if(!this._domElement)throw(0,o.h)("Requires a DOM element to attach events.")}}}}]);
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.