PageSourceSearch

https://pricespy.nl/_next/static/chunks/3kg8_0re-_ugp.js?dpl=nl_2e510cf7

js pricespy.nl collected 2026-10-08 19:47:37 UTC 53,378 bytes, 6 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="b945b4ec-874a-b456-3598-5da3d2199399")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,793959,264343,e=>{"use strict";let t="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);for(var s,n,i,r,o=new Uint8Array(16),a=[],l=0;l<256;++l)a.push((l+256).toString(16).slice(1));let u=function(e,n,i){if(t&&!n&&!e)return t();var r=(e=e||{}).random||(e.rng||function(){if(!s&&!(s="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return s(o)})();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){i=i||0;for(var l=0;l<16;++l)n[i+l]=r[l];return n}return function(e,t=0){return(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase()}(r)};class c{constructor(e){this._process=e,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(e){let t={value:e,next:null};if(this._current){this._last.next=t,this._last=t;return}this._current=t,this._last=t,this._active&&this.flush()}flush(){for(;this._current;){let e=this._current;this._process(e.value),this._current=e.next}this._last=null}}let d="xstate.init",h="xstate.stop";function f(e,t){return{type:`xstate.done.state.${e}`,output:t}}function p(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function y(e){return{type:d,input:e}}function v(e){setTimeout(()=>{throw e})}let g="function"==typeof Symbol&&Symbol.observable||"@@observable";function m(e){if(w(e))return e;let t=[],s="";for(let n=0;n<e.length;n++){switch(e.charCodeAt(n)){case 92:s+=e[n+1],n++;continue;case 46:t.push(s),s="";continue}s+=e[n]}return t.push(s),t}function _(e){var t;return(t=e)&&"object"==typeof t&&"machine"in t&&"value"in t?e.value:"string"!=typeof e?e:function(e){if(1===e.length)return e[0];let t={},s=t;for(let t=0;t<e.length-1;t++)if(t===e.length-2)s[e[t]]=e[t+1];else{let n=s;s={},n[e[t]]=s}return t}(m(e))}function b(e,t){let s={},n=Object.keys(e);for(let i=0;i<n.length;i++){let r=n[i];s[r]=t(e[r],r,e,i)}return s}function x(e){var t;return void 0===e?[]:w(t=e)?t:[t]}function S(e,t,s,n){return"function"==typeof e?e({context:t,event:s,self:n}):e}function w(e){return Array.isArray(e)}function k(e){var t;return(w(t=e)?t:[t]).map(e=>void 0===e||"string"==typeof e?{target:e}:e)}function E(e){if(void 0!==e&&""!==e)return x(e)}function I(e,t,s){var n,i,r;let o="object"==typeof e,a=o?e:void 0;return{next:null==(n=o?e.next:e)?void 0:n.bind(a),error:null==(i=o?e.error:t)?void 0:i.bind(a),complete:null==(r=o?e.complete:s)?void 0:r.bind(a)}}function $(e,t){let s=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!s)return e.implementations.actors[t];let[,n,i]=s,r=e.getStateNodeById(i).config.invoke;return(Array.isArray(r)?r[n]:r).src}function T(e,t){return`${e.sessionId}.${t}`}let O=0,q=!1,R=((n={})[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped",n),j={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class A{constructor(e,t){this.logic=e,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new c(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=R.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=[];const s={...j,...t},{clock:n,logger:i,parent:r,syncSnapshot:o,id:a,systemId:l,inspect:u}=s;this.system=r?r.system:function(e,t){let s=new Map,n=new Map,i=new WeakMap,r=new Set,o={},{clock:a,logger:l}=t,u={schedule:(e,t,s,n,i=Math.random().toString(36).slice(2))=>{let r={source:e,target:t,event:s,delay:n,id:i,startedAt:Date.now()},l=T(e,i);c._snapshot._scheduledEvents[l]=r;let u=a.setTimeout(()=>{delete o[l],delete c._snapshot._scheduledEvents[l],c._relay(e,t,s)},n);o[l]=u},cancel:(e,t)=>
2{let s=T(e,t),n=o[s];delete o[s],delete c._snapshot._scheduledEvents[s],void 0!==n&&a.clearTimeout(n)},cancelAll:e=>{for(let t in c._snapshot._scheduledEvents){let s=c._snapshot._scheduledEvents[t];s.source===e&&u.cancel(e,s.id)}}},c={_snapshot:{_scheduledEvents:((null==t?void 0:t.snapshot)&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${O++}`,_register:(e,t)=>(s.set(e,t),e),_unregister:e=>{s.delete(e.sessionId);let t=i.get(e);void 0!==t&&(n.delete(t),i.delete(e))},get:e=>n.get(e),_set:(e,t)=>{let s=n.get(e);if(s&&s!==t)throw Error(`Actor with system ID '${e}' already exists.`);n.set(e,t),i.set(t,e)},inspect:e=>{let t=I(e);return r.add(t),{unsubscribe(){r.delete(t)}}},_sendInspectionEvent:t=>{if(!r.size)return;let s={...t,rootId:e.sessionId};r.forEach(e=>{var t;return null==(t=e.next)?void 0:t.call(e,s)})},_relay:(e,t,s)=>{c._sendInspectionEvent({type:"@xstate.event",sourceRef:e,actorRef:t,event:s}),t._send(s)},scheduler:u,getSnapshot:()=>({_scheduledEvents:{...c._snapshot._scheduledEvents}}),start:()=>{let e=c._snapshot._scheduledEvents;for(let t in c._snapshot._scheduledEvents={},e){let{source:s,target:n,event:i,delay:r,id:o}=e[t];u.schedule(s,n,i,r,o)}},_clock:a,_logger:l};return c}(this,{clock:n,logger:i}),u&&!r&&this.system.inspect(I(u)),this.sessionId=this.system._bookId(),this.id=a??this.sessionId,this.logger=(null==t?void 0:t.logger)??this.system._logger,this.clock=(null==t?void 0:t.clock)??this.system._clock,this._parent=r,this._syncSnapshot=o,this.options=s,this.src=s.src??e,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:e=>{this._deferred.push(e)},system:this.system,stopChild:e=>{if(e._parent!==this)throw Error(`Cannot stop child actor ${e.id} of ${this.id} because it is not a child`);e._stop()},emit:e=>{let t=this.eventListeners.get(e.type),s=this.eventListeners.get("*");if(t||s)for(let n of[...t?t.values():[],...s?s.values():[]])try{n(e)}catch(e){v(e)}},actionExecutor:e=>{let t=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:e.type,params:e.params}}),!e.exec)return;let t=q;try{q=!0,e.exec(e.info,e.params)}finally{q=t}};this._processingStatus===R.Running?t():this._deferred.push(t)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),l&&(this._systemId=l,this.system._set(l,this)),this._initState((null==t?void 0:t.snapshot)??(null==t?void 0:t.state)),l&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(e){try{var t;this._snapshot=e?this.logic.restoreSnapshot?this.logic.restoreSnapshot(e,this._actorScope):e:this.logic.getInitialSnapshot(this._actorScope,null==(t=this.options)?void 0:t.input)}catch(e){this._snapshot={status:"error",output:void 0,error:e}}}update(e,t){var s,n,i;let r;for(this._snapshot=e;r=this._deferred.shift();)try{r()}catch(t){this._deferred.length=0,this._snapshot={...e,status:"error",error:t}}switch(this._snapshot.status){case"active":for(let t of this.observers)try{null==(s=t.next)||s.call(t,e)}catch(e){v(e)}break;case"done":for(let t of this.observers)try{null==(n=t.next)||n.call(t,e)}catch(e){v(e)}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:t,snapshot:e})}subscribe(e,t,s){let n=I(e,t,s);if(this._processingStatus!==R.Stopped)this.observers.add(n);else switch(this._snapshot.status){case"done":try{var i;null==(i=n.complete)||i.call(n)}catch(e){v(e)}break;case"error":{let e=this._snapshot.error;if(n.error)try{n.error(e)}catch(e){v(e)}else v(e)}}return{unsubscribe:()=>{this.observers.delete(n)}}}on(e,t){let s=this.eventListeners.get(e);s||(s=new Set,this.eventListeners.set(e,s));let n=t.bind(void 0);return s.add(n),{unsubscribe:()=>{s.delete(n)}}}start(){if(this._processingStatus===R.Running)return this;this._syncSnapshot&&this.subscribe({next:e=>{"active"===e.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:e})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=R.Running;let e=y(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:e}),this._snapshot.status){case"done":return this.update(this._snapshot,e),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(e){return this._snapshot={...this._snapshot,status:"error",error:e},this._error(e),this}return this.update(this._snapshot,e),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(e){let t,s;try{t=this.logic.transition(this._snapshot,e,this._actorScope)}catch(e){s={err:e}}if(s){let{err:e}=s;this._snapshot={...this._snapshot,status:"error",error:e},this._error(e);return}this.update(t,e),e.type===h&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===R.Stopped||((this.mailbox.clear(),this._processingStatus===R.NotStarted)?this._processingStatus=R.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{var e;null==(e=t.complete)||e.call(t)}catch(e){v(e)}this.observers.clear()}_reportError(e){if(!this.observers.size){this._parent||v(e);return}let t=!1;for(let s of this.observers){let n=s.error;t||=!n;try{null==n||n(e)}catch(e){v(e)}}this.observers.clear(),t&&v(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,p(this.id,e))}_stopProcedure(){return this._processingStatus!==R.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new c(this._process.bind(this)),this._processingStatus=R.Stopped,this.system._unregister(this)),this}_send(e){this._processingStatus!==R.Stopped&&this.mailbox.enqueue(e)}send(e){this.system._relay(void 0,this,e)}attachDevTools(){let{devTools:t}=this.options;t&&("function"==typeof t?t:t=>{if("u"<typeof window)return;let s=function(){let t="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:e.g;if(t.__xstate__)return t.__xstate__}();s&&s.register(t)})(this)}toJSON(){return{xstate$$type:1,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[g](){return this}getSnapshot(){return this._snapshot}}function M(e,...[t]){return new A(e,t)}function N(e,t,s,n,{sendId:i}){return[t,{sendId:"function"==typeof i?i(s,n):i},void 0]}function L(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId)})}function P(e){function t(e,t){}return t.type="xstate.cancel",t.sendId=e,t.resolve=N,t.execute=L,t}function D(e,t,s,n,{id:i,systemId:r,src:o,input:a,syncSnapshot:l}){let u,c,d="string"==typeof o?$(t.machine,o):o,h="function"==typeof i?i(s):i;return d&&(c="function"==typeof a?a({context:t.context,event:s.event,self:e.self}):a,u=M(d,{id:h,src:o,parent:e.self,syncSnapshot:l,systemId:r,input:c})),[eE(t,{children:{...t.children,[h]:u}}),{id:i,systemId:r,actorRef:u,src:o,input:c},void 0]}function C(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==R.Stopped&&t.start()})}function B(...[e,{id:t,systemId:s,input:n,syncSnapshot:i=!1}={}]){function r(e,t){}return r.type="xstate.spawnChild",r.id=t,r.systemId=s,r.src=e,r.input=n,r.syncSnapshot=i,r.resolve=D,r.execute=C,r}function F(e,t,s,n,{actorRef:i}){let r="function"==typeof i?i(s,n):i,o="string"==typeof r?t.children[r]:r,a=t.children;return o&&(a={...a},delete a[o.id]),[eE(t,{children:a}),o,void 0]}function V(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==R.Running)return void e.stopChild(t);e.defer(()=>{e.stopChild(t)})}}function J(e){function t(e,t){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=F,t.execute=V,t}function U(e,t,s,n){let{machine:i}=n,r="function"==typeof e,o=r?e:i.implementations.guards["string"==typeof e?e:e.type];if(!r&&!o)throw Error(`Guard '${"string"==typeof e?e:e.type}' is not implemented.'.`);if("function"!=typeof o)return U(o,t,s,n);let a={context:t,event:s},l=r||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:t,event:s}):e.params:void 0;return"check"in o?o.check(n,a,o):o(a,l)}let W=e=>"atomic"===e.type||"final"===e.type;function z(e){return Object.values(e.states).filter(e=>"history"!==e.type)}function K(e,t){let s=[];if(t===e)return s;let n=e.parent;for(;n&&n!==t;)s.push(n),n=n.parent;return s}function G(e){let t=new Set(e),s=Q(t);for(let e of t)if("compound"!==e.type||s.get(e)&&s.get(e).length){if("parallel"===e.type){for(let s of z(e))if("history"!==s.type&&!t.has(s))for(let e of es(s))t.add(e)}}
2else es(e).forEach(e=>t.add(e));for(let e of t){let s=e.parent;for(;s;)t.add(s),s=s.parent}return t}function Q(e){let t=new Map;for(let s of e)t.has(s)||t.set(s,[]),s.parent&&(t.has(s.parent)||t.set(s.parent,[]),t.get(s.parent).push(s));return t}function H(e,t){return function e(t,s){let n=s.get(t);if(!n)return{};if("compound"===t.type){let e=n[0];if(!e)return{};if(W(e))return e.key}let i={};for(let t of n)i[t.key]=e(t,s);return i}(e,Q(G(t)))}function X(e,t){return"compound"===t.type?z(t).some(t=>"final"===t.type&&e.has(t)):"parallel"===t.type?z(t).every(t=>X(e,t)):"final"===t.type}let Y=e=>"#"===e[0];function Z(e,t,s){let n=E(s.target),i=s.reenter??!1,r=function(e,t){if(void 0!==t)return t.map(t=>{if("string"!=typeof t)return t;if(Y(t))return e.machine.getStateNodeById(t);let s="."===t[0];if(s&&!e.parent)return er(e,t.slice(1));let n=s?e.key+t:t;if(e.parent)try{return er(e.parent,n)}catch(t){throw Error(`Invalid transition definition for state node '${e.id}':
3${t.message}`)}throw Error(`Invalid target: "${t}" is not a valid target from the root node. Did you mean ".${t}"?`)})}(e,n),o={...s,actions:x(s.actions),guard:s.guard,target:r,source:e,reenter
3:i,eventType:t,toJSON:()=>({...o,source:`#${e.id}`,target:r?r.map(e=>`#${e.id}`):void 0})};return o}function ee(e){let t=E(e.config.target);return t?{target:t.map(t=>"string"==typeof t?er(e.parent,t):t)}:e.parent.initial}function et(e){return"history"===e.type}function es(e){let t=en(e);for(let s of t)for(let n of K(s,e))t.add(n);return t}function en(e){let t=new Set;return!function e(s){if(!t.has(s)){if(t.add(s),"compound"===s.type)e(s.initial.target[0]);else if("parallel"===s.type)for(let t of z(s))e(t)}}(e),t}function ei(e,t){if(Y(t))return e.machine.getStateNodeById(t);if(!e.states)throw Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);let s=e.states[t];if(!s)throw Error(`Child state '${t}' does not exist on '${e.id}'`);return s}function er(e,t){if("string"==typeof t&&Y(t))try{return e.machine.getStateNodeById(t)}catch{}let s=m(t).slice(),n=e;for(;s.length;){let e=s.shift();if(!e.length)break;n=ei(n,e)}return n}function eo(e,t){if("string"==typeof t){let s=e.states[t];if(!s)throw Error(`State '${t}' does not exist on '${e.id}'`);return[e,s]}let s=Object.keys(t),n=s.map(t=>ei(e,t)).filter(Boolean);return[e.machine.root,e].concat(n,s.reduce((s,n)=>{let i=ei(e,n);if(!i)return s;let r=eo(i,t[n]);return s.concat(r)},[]))}function ea(e,t){let s=e;for(;s.parent&&s.parent!==t;)s=s.parent;return s.parent===t}function el(e,t,s){let n=new Set;for(let i of e){let e=!1,r=new Set;for(let o of n)if(function(e,t){let s=new Set(e),n=new Set(t);for(let e of s)if(n.has(e))return!0;for(let e of n)if(s.has(e))return!0;return!1}(ed([i],t,s),ed([o],t,s)))if(ea(i.source,o.source))r.add(o);else{e=!0;break}if(!e){for(let e of r)n.delete(e);n.add(i)}}return Array.from(n)}function eu(e,t){if(!e.target)return[];let s=new Set;for(let n of e.target)if(et(n))if(t[n.id])for(let e of t[n.id])s.add(e);else for(let e of eu(ee(n),t))s.add(e);else s.add(n);return[...s]}function ec(e,t){let s=eu(e,t);if(!s)return;if(!e.reenter&&s.every(t=>t===e.source||ea(t,e.source)))return e.source;let n=function(e){let[t,...s]=e;for(let e of K(t,void 0))if(s.every(t=>ea(t,e)))return e}(s.concat(e.source));return n||(e.reenter?void 0:e.source.machine.root)}function ed(e,t,s){let n=new Set;for(let r of e){var i;if(null==(i=r.target)?void 0:i.length){let e=ec(r,s);for(let s of(r.reenter&&r.source===e&&n.add(e),t))ea(s,e)&&n.add(s)}}return[...n]}function eh(e,t,s,n,i,r){if(!e.length)return t;let o=new Set(t._nodes),a=t.historyValue,l=el(e,o,a),u=t;i||([u,a]=function(e,t,s,n,i,r,o,a){let l,u=e,c=ed(n,i,r);for(let e of(c.sort((e,t)=>t.order-e.order),c))for(let t of function(e){return Object.keys(e.states).map(t=>e.states[t]).filter(e=>"history"===e.type)}(e)){let s;s="deep"===t.history?t=>W(t)&&ea(t,e):t=>t.parent===e,(l??={...r})[t.id]=Array.from(i).filter(s)}for(let e of c)u=ey(u,t,s,[...e.exit,...e.invoke.map(e=>J(e.id))],o,void 0),i.delete(e);return[u,l||r]}(u,n,s,l,o,a,r,s.actionExecutor)),u=function(e,t,s,n,i,r,o,a){let l=e,u=new Set,c=new Set;(function(e,t,s,n){for(let i of e){let e=ec(i,t);for(let r of i.target||[])!et(r)&&(i.source!==r||i.source!==e||i.reenter)&&(n.add(r),s.add(r)),ef(r,t,s,n);for(let r of eu(i,t)){let o=K(r,e);(null==e?void 0:e.type)==="parallel"&&o.push(e),ep(n,t,s,o,!i.source.parent&&i.reenter?void 0:e)}}})(n,o,c,u),a&&c.add(e.machine.root);let d=new Set;for(let e of[...u].sort((e,t)=>e.order-t.order)){i.add(e);let n=[];for(let t of(n.push(...e.entry),e.invoke))n.push(B(t.src,{...t,syncSnapshot:!!t.onSnapshot}));if(c.has(e)){let t=e.initial.actions;n.push(...t)}if(l=ey(l,t,s,n,r,e.invoke.map(e=>e.id)),"final"===e.type){let n=e.parent,o=(null==n?void 0:n.type)==="parallel"?n:null==n?void 0:n.parent,a=o||e;for((null==n?void 0:n.type)==="compound"&&r.push(f(n.id,void 0!==e.output?S(e.output,l.context,t,s.self):void 0));(null==o?void 0:o.type)==="parallel"&&!d.has(o)&&X(i,o);)d.add(o),r.push(f(o.id)),a=o,o=o.parent;if(o)continue;l=eE(l,{status:"done",output:function(e,t,s,n,i){if(void 0===n.output)return;let r=f(i.id,void 0!==i.output&&i.parent?S(i.output,e.context,t,s.self):void 0);return S(n.output,e.context,r,s.self)}(l,t,s,l.machine.root,a)})}}return l}(u=ey(u,n,s,l.flatMap(e=>e.actions),r,void 0),n,s,l,o,r,a,i);let c=[...o];"done"===u.status&&(u=ey(u,n,s,c.sort((e,t)=>
3t.order-e.order).flatMap(e=>e.exit),r,void 0));try{if(a===t.historyValue&&function(e,t){if(e.length!==t.size)return!1;for(let s of e)if(!t.has(s))return!1;return!0}(t._nodes,o))return u;return eE(u,{_nodes:c,historyValue:a})}catch(e){throw e}}function ef(e,t,s,n){var i,r,o,a,l;if(et(e))if(t[e.id]){let o=t[e.id];for(let e of o)n.add(e),ef(e,t,s,n);for(let a of o){i=a,r=e.parent,ep(n,t,s,K(i,r))}}else{let i=ee(e);for(let r of i.target){n.add(r),i===(null==(o=e.parent)?void 0:o.initial)&&s.add(e.parent),ef(r,t,s,n)}for(let r of i.target){a=r,l=e.parent,ep(n,t,s,K(a,l))}}else if("compound"===e.type){let[i]=e.initial.target;et(i)||(n.add(i),s.add(i)),ef(i,t,s,n),ep(n,t,s,K(i,e))}else if("parallel"===e.type)for(let i of z(e).filter(e=>!et(e)))[...n].some(e=>ea(e,i))||(et(i)||(n.add(i),s.add(i)),ef(i,t,s,n))}function ep(e,t,s,n,i){for(let r of n)if((!i||ea(r,i))&&e.add(r),"parallel"===r.type)for(let n of z(r).filter(e=>!et(e)))[...e].some(e=>ea(e,n))||(e.add(n),ef(n,t,s,e))}function ey(e,t,s,n,i,r){let o=r?[]:void 0,a=function e(t,s,n,i,r,o){let{machine:a}=t,l=t;for(let t of i){var u;let i="function"==typeof t,c=i?t:(u="string"==typeof t?t:t.type,a.implementations.actions[u]),d={context:l.context,event:s,self:n.self,system:n.system},h=i||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:l.context,event:s}):t.params:void 0;if(!c||!("resolve"in c)){n.actionExecutor({type:"string"==typeof t?t:"object"==typeof t?t.type:t.name||"(anonymous)",info:d,params:h,exec:c}
3);continue}let[f,p,y]=c.resolve(n,l,d,h,c,r);l=f,"retryResolve"in c&&(null==o||o.push([c,p])),"execute"in c&&n.actionExecutor({type:c.type,info:d,params:p,exec:c.execute.bind(null,n,p)}),y&&(l=e(l,s,n,y,r,o))}return l}(e,t,s,n,{internalQueue:i,deferredActorIds:r},o);return null==o||o.forEach(([e,t])=>{e.retryResolve(s,a,t)}),a}function ev(e,t,s,n){let i=e,r=[];function o(e,t,n){s.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:s.self,event:t,snapshot:e,_transitions:n}),r.push(e)}if(t.type===h)return o(i=eE(eg(i,t,s),{status:"stopped"}),t,[]),{snapshot:i,microstates:r};let a=t;if(a.type!==d){let t=a,l=t.type.startsWith("xstate.error.actor"),u=em(t,i);if(l&&!u.length)return o(i=eE(e,{status:"error",error:t.error}),t,[]),{snapshot:i,microstates:r};o(i=eh(u,e,s,a,!1,n),t,u)}let l=!0;for(;"active"===i.status;){let e=l?function(e,t){let s=new Set;for(let n of e._nodes.filter(W))e:for(let i of[n].concat(K(n,void 0)))if(i.always){for(let n of i.always)if(void 0===n.guard||U(n.guard,e.context,t,e)){s.add(n);break e}}return el(Array.from(s),new Set(e._nodes),e.historyValue)}(i,a):[],t=e.length?i:void 0;if(!e.length){if(!n.length)break;e=em(a=n.shift(),i)}l=(i=eh(e,i,s,a,!1,n))!==t,o(i,a,e)}return"active"!==i.status&&eg(i,a,s),{snapshot:i,microstates:r}}function eg(e,t,s){return ey(e,t,s,Object.values(e.children).map(e=>J(e)),[],void 0)}function em(e,t){return t.machine.getTransitionData(t,e)}let e_=function(e){return function e(t,s){let n=_(t),i=_(s);return"string"==typeof i?"string"==typeof n&&i===n:"string"==typeof n?n in i:Object.keys(n).every(t=>t in i&&e(n[t],i[t]))}(e,this.value)},eb=function(e){return this.tags.has(e)},ex=function(e){let t=this.machine.getTransitionData(this,e);return!!(null==t?void 0:t.length)&&t.some(e=>void 0!==e.target||e.actions.length)},eS=function(){let{_nodes:e,tags:t,machine:s,getMeta:n,toJSON:i,can:r,hasTag:o,matches:a,...l}=this;return{...l,tags:Array.from(t)}},ew=function(){return this._nodes.reduce((e,t)=>(void 0!==t.meta&&(e[t.id]=t.meta),e),{})};function ek(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:H(t.root,e._nodes),tags:new Set(e._nodes.flatMap(e=>e.tags)),children:e.children,historyValue:e.historyValue||{},matches:e_,hasTag:eb,can:ex,getMeta:ew,toJSON:eS}}function eE(e,t={}){return ek({...e,...t},e.machine)}function eI(e,t,s,n,{event:i,id:r,delay:o},{internalQueue:a}){let l,u=t.machine.implementations.delays;if("string"==typeof i)throw Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);let c="function"==typeof i?i(s,n):i;if("string"==typeof o){let e=u&&u[o];l="function"==typeof e?e(s,n):e}else l="function"==typeof o?o(s,n):o;return"number"!=typeof l&&a.push(c),[t,{event:c,id:r,delay:l},void 0]}function e$(e,t){let{event:s,delay:n,id:i}=t;if("number"==typeof n)return void e.defer(()=>{let t=e.self;e.system.scheduler.schedule(t,t,s,n,i)})}function eT(e,t){function s(e,t){}return s.type="xstate.raise",s.event=e,s.id=null==t?void 0:t.id,s.delay=null==t?void 0:t.delay,s.resolve=eI,s.execute=e$,s}let eO="xstate.observable.error",eq="xstate.observable.complete";function eR(e){return{config:e,transition:(e,t)=>{if("active"!==e.status)return e;switch(t.type){case eO:return{...e,status:"error",error:t.data,input:void 0,_subscription:void 0};case eq:return{...e,status:"done",input:void 0,_subscription:void 0};case h:return e._subscription.unsubscribe(),{...e,status:"stopped",input:void 0,_subscription:void 0};default:return e}},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,context:void 0,input:t,_subscription:void 0}),start:(t,{self:s,system:n,emit:i})=>{"done"!==t.status&&(t._subscription=e({input:t.input,system:n,self:s,emit:i}).subscribe({next:e=>{s._parent&&n._relay(s,s._parent,e)},error:e=>{n._relay(s,s,{type:eO,data:e})},complete:()=>{n._relay(s,s,{type:eq})}}))},getPersistedSnapshot:({_subscription:e,...t})=>t,restoreSnapshot:e=>({...e,_subscription:void 0})}}function ej(e,t,s,n,{assignment:i}){if(!t.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let r={},o={context:t.context,event:s.event,spawn:function(e,{machine:t,context:s},n,i){return(r,o)=>{let a=((r,o)=>{if("string"!=typeof r)return M(r,{id:null==o?void 0:o.id,parent:e.self,syncSnapshot:null==o?void 0:o.syncSnapshot,input:null==o?void 0:o.input,src:r,systemId:null==o?void 0:o.systemId});{let a=$(t,r);
3if(!a)throw Error(`Actor logic '${r}' not implemented in machine '${t.id}'`);let l=M(a,{id:null==o?void 0:o.id,parent:e.self,syncSnapshot:null==o?void 0:o.syncSnapshot,input:"function"==typeof(null==o?void 0:o.input)?o.input({context:s,event:n,self:e.self}):null==o?void 0:o.input,src:r,systemId:null==o?void 0:o.systemId});return i[l.id]=l,l}})(r,o);return i[a.id]=a,e.defer(()=>{a._processingStatus!==R.Stopped&&a.start()}),a}}(e,t,s.event,r),self:e.self,system:e.system},a={};if("function"==typeof i)a=i(o,n);else for(let e of Object.keys(i)){let t=i[e];a[e]="function"==typeof t?t(o,n):t}let l=Object.assign({},t.context,a);return[eE(t,{context:l,children:Object.keys(r).length?{...t.children,...r}:t.children}),void 0,void 0]}function eA(e){function t(e,t){}return t.type="xstate.assign",t.assignment=e,t.resolve=ej,t}new WeakMap;let eM=new WeakMap;function eN(e,t,s){let n=eM.get(e);return n?t in n||(n[t]=s()):(n={[t]:s()},eM.set(e,n)),n[t]}let eL={},eP=e=>"string"==typeof e?{type:e}:"function"==typeof e?"resolve"in e?{type:e.type}:{type:e.name}:e;class eD{constructor(e,t){if(this.config=e,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=t._parent,this.key=t._key,this.machine=t._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join("."),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?b(this.config.states,(e,t)=>new eD(e,{_parent:this,_key:t,_machine:this.machine})):eL,"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=x(this.config.entry).slice(),this.exit=x(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=x(e.tags).slice()}_initialize(){this.transitions=function(e){let t=new Map;if(e.config.on)for(let s of Object.keys(e.config.on)){if(""===s)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let n=e.config.on[s];t.set(s,k(n).map(t=>Z(e,s,t)))}if(e.config.onDone){let s=`xstate.done.state.${e.id}`;t.set(s,k(e.config.onDone).map(t=>Z(e,s,t)))}for(let s of e.invoke){if(s.onDone){let n=`xstate.done.actor.${s.id}`;t.set(n,k(s.onDone).map(t=>Z(e,n,t)))}if(s.onError){let n=`xstate.error.actor.${s.id}`;t.set(n,k(s.onError).map(t=>Z(e,n,t)))}if(s.onSnapshot){let n=`xstate.snapshot.${s.id}`;t.set(n,k(s.onSnapshot).map(t=>Z(e,n,t)))}}for(let s of e.after){let e=t.get(s.eventType);e||(e=[],t.set(s.eventType,e)),e.push(s)}return t}(this),this.config.always&&(this.always=k(this.config.always).map(e=>Z(this,"",e))),Object.keys(this.states).forEach(e=>{this.states[e]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.t
3ype,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(eP),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map(eP),eventType:null})}:void 0,history:this.history,states:b(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.actions.map(eP)})),entry:this.entry.map(eP),exit:this.exit.map(eP),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 eN(this,"invoke",()=>x(this.config.invoke).map((e,t)=>{var s,n;let{src:i,systemId:r}=e,o=e.id??(s=this.id,`${t}.${s}`),a="string"==typeof i?i:`xstate.invoke.${n=this.id,`${t}.${n}`}`;return{...e,src:a,id:o,systemId:r,toJSON(){let{onDone:t,onError:s,...n}=e;return{...n,type:"xstate.invoke",src:a,id:o}}}}))}get on(){return eN(this,"on",()=>[...this.transitions].flatMap(([e,t])=>t.map(t=>[e,t])).reduce((e,[t,s])=>(e[t]=e[t]||[],e[t].push(s),e),{}))}get after(){return eN(this,"delayedTransitions",()=>{var e;let t;return e=this,(t=e.config.after)?Object.keys(t).flatMap(s=>{var n;let i,r,o=t[s],a=Number.isNaN(+s)?s:+s,l=(n=e.id,r=(i={type:`xstate.after.${a}.${n}`}).type,e.entry.push(eT(i,{id:r,delay:a})),e.exit.push(P(r)),r);return x("string"==typeof o?{target:o}:o).map(e=>({...e,event:l,delay:a}))}).map(t=>{let{delay:s}=t;return{...Z(e,t.event,t),delay:s}}):[]})}get initial(){return eN(this,"initial",()=>(function(e,t){let s="string"==typeof t?e.states[t]:t?e.states[t.target]:void 0;if(!s&&t)throw Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let n={source:e,actions:t&&"string"!=typeof t?x(t.actions):[],eventType:null,reenter:!1,target:s?[s]:[],toJSON:()=>({...n,source:`#${e.id}`,target:s?[`#${s.id}`]:[]})};return n})(this,this.config.initial))}next(e,t){let s,n=t.type,i=[];for(let r of eN(this,`candidates-${n}`,()=>{var e;return e=this,e.transitions.get(n)||[...e.transitions.keys()].filter(e=>{if("*"===e)return!0;if(!e.endsWith(".*"))return!1;let t=e.split("."),s=n.split(".");for(let e=0;e<t.length;e++){let n=t[e],i=s[e];if("*"===n)return e===t.length-1;if(n!==i)return!1}return!0}).sort((e,t)=>t.length-e.length).flatMap(t=>e.transitions.get(t))})){let{guard:o}=r,a=e.context,l=!1;try{l=!o||U(o,a,t,e)}catch(t){let e="string"==typeof o?o:"object"==typeof o?o.type:void 0;throw Error(`Unable to evaluate guard ${e?`'${e}' `:""}in transition for event '${n}' in state node '${this.id}':
4${t.message}`)}if(l){i.push(...r.actions),s=r;break}}return s?[s]:void 0}get events(){return eN(this,"events",()=>{let{states:e}=this,t=new Set(this.ownEvents);if(e)for(let s of Object.keys(e)){let n=e[s];if(n.states)for(let e of n.events)t.add(`${e}`)}return Array.from(t)})}get ownEvents(){return Array.from(new Set([...this.transitions.keys()].filter(e=>this.transitions.get(e).some(e=>!(!e.target&&!e.actions.length&&!e.reenter)))))}}class eC{constructor(e,t){this.config=e,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=e.id||"(machine)",this.implementations={actors:(null==t?void 0:t.actors)??{},actions:(null==t?void 0:t.actions)??{},delays:(null==t?void 0:t.delays)??{},guards:(null==t?void 0:t.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 eD(e,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(e){let{actions:t,guards:s,actors:n,delays:i}=this.implementations;return new eC(this.config,{actions:{...t,...e.actions},guards:{...s,...e.guards},actors:{...n,...e.actors},delays:{...i,...e.delays}})}resolveState(e){var t;let s,n=(s=G(eo(t=this.root,e.value)),H(t,[...s])),i=G(eo(this.root,n));return ek({_nodes:[...i],context:e.context||{},children:{},status:X(i,this.root)?"done":e.status||"active",output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,t,s){return ev(e,t,s,[]).snapshot}microstep(e,t,s){return ev(e,t,s,[]).microstates}getTransitionData(e,t){return function e(t,s,n,i){if("string"==typeof s){let e;return(e=ei(t,s).next(n,i))&&e.length?e:t.next(n,i)}if(1===Object.keys(s).length){let r,o;return(o=e(ei(t,(r=Object.keys(s))[0]),s[r[0]],n,i))&&o.length?o:t.next(n,i)}let r=[];for(let o of Object.keys(s)){let a=s[o];if(!a)continue;let l=e(ei(t,o),a,n,i);l&&r.push(...l)}return r.length?r:t.next(n,i)}(this.root,e.value,e,t)||[]}
4getPreInitialState(e,t,s){let{context:n}=this.config,i=ek({context:"function"!=typeof n&&n?n:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof n?ey(i,t,e,[eA(({spawn:e,event:t,self:s})=>n({spawn:e,input:t.input,self:s}))],s,void 0):i}getInitialSnapshot(e,t){let s=y(t),n=[],i=this.getPreInitialState(e,s,n),{snapshot:r}=ev(eh([{target:[...en(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],i,e,s,!0,n),s,e,n);return r}start(e){Object.values(e.children).forEach(e=>{"active"===e.getSnapshot().status&&e.start()})}getStateNodeById(e){let t=m(e),s=t.slice(1),n=Y(t[0])?t[0].slice(1):t[0],i=this.idMap.get(n);if(!i)throw Error(`Child state node '#${n}' does not exist on machine '${this.id}'`);return er(i,s)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,t){return function(e,t){let{_nodes:s,tags:n,machine:i,children:r,context:o,can:a,hasTag:l,matches:u,getMeta:c,toJSON:d,...h}=e,f={};for(let e in r){let s=r[e];f[e]={snapshot:s.getPersistedSnapshot(t),src:s.src,systemId:s._systemId,syncSnapshot:s._syncSnapshot}}return{...h,context:function e(t){let s;for(let n in t){let i=t[n];if(i&&"object"==typeof i)if("sessionId"in i&&"send"in i&&"ref"in i)(s??=Array.isArray(t)?t.slice():{...t})[n]={xstate$$type:1,id:i.id};else{let r=e(i);r!==i&&((s??=Array.isArray(t)?t.slice():{...t})[n]=r)}}return s??t}(o),children:f,historyValue:function(e){if("object"!=typeof e||null===e)return{};let t={};for(let s in e){let n=e[s];Array.isArray(n)&&(t[s]=n.map(e=>({id:e.id})))}return t}(h.historyValue)}}(e,t)}restoreSnapshot(e,t){let s={},n=e.children;Object.keys(n).forEach(e=>{let i=n[e],r=i.snapshot,o=i.src,a="string"==typeof o?$(this,o):o;if(!a)return;let l=M(a,{id:e,parent:t.self,syncSnapshot:i.syncSnapshot,snapshot:r,src:o,systemId:i.systemId});s[e]=l});let i=function(e,t){if(!t||"object"!=typeof t)return{};let s={};for(let n in t)for(let i of t[n]){let t=function(e,t){if(t instanceof eD)return t;try{return e.machine.getStateNodeById(t.id)}catch{}}(e,i);t&&(s[n]??=[],s[n].push(t))}return s}(this.root,e.historyValue),r=ek({...e,children:s,_nodes:Array.from(G(eo(this.root,e.value))),historyValue:i},this),o=new Set;return!function e(t,s){if(!o.has(t))for(let n in o.add(t),t){let i=t[n];if(i&&"object"==typeof i){if("xstate$$type"in i&&1===i.xstate$$type){t[n]=s[i.id];continue}e(i,s)}}}(r.context,s),r}}function eB(e,t){let s=x(t);if(!s.includes(e.type)){let t=1===s.length?`type "${s[0]}"`:`one of types "${s.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(e)} to have ${t}`)}}function eF({schemas:e,actors:t,actions:s,guards:n,delays:i}){return{createMachine:r=>new eC({...r,schemas:e},{actors:t,actions:s,guards:n,delays:i})}}function eV(e,t,s,n,{event:i}){return[t,{event:"function"==typeof i?i(s,n):i},void 0]}function eJ(e,{event:t}){e.defer(()=>e.emit(t))}function eU(e){function t(e,t){}return t.type="xstate.emit",t.event=e,t.resolve=eV,t.execute=eJ,t}let eW=((i={}).Parent="#_parent",i.Internal="#_internal",i);function ez(e,t,s,n,{to:i,event:r,id:o,delay:a},l){let u,c,d=t.machine.implementations.delays;if("string"==typeof r)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${r}" }) instead`);let h="function"==typeof r?r(s,n):r;if("string"==typeof a){let e=d&&d[a];u="function"==typeof e?e(s,n):e}else u="function"==typeof a?a(s,n):a;let f="function"==typeof i?i(s,n):i;if("string"==typeof f){if(f===eW.Parent)c=e.self._parent;else if(f===eW.Internal)c=e.self;else if(f.startsWith("#_"))c=t.children[f.slice(2)];else{var p;c=(null==(p=l.deferredActorIds)?void 0:p.includes(f))?f:t.children[f]}if(!c)throw Error(`Unable to send event to actor '${f}' from machine '${t.machine.id}'.`)}else c=f||e.self;return[t,{to:c,targetId:"string"==typeof f?f:void 0,event:h,id:o,delay:u},void 0]}function eK(e,t,s){"string"==typeof s.to&&(s.to=t.children[s.to])}function eG(e,t){e.defer(()=>{let{to:s,event:n,delay:i,id:r}=t;"number"==typeof i?e.system.scheduler.schedule(e.self,s,n,i,r):e.system._relay(e.self,s,"xstate.error"===n.type?p(e.self.id,n.data):n)})}function eQ(e,t,s){function n(e,t){}return n.type="xstate.sendTo",n.to=e,n.event=t,n.id=null==s?void 0:s.id,n.delay=null==s?void 0:s.delay,n.resolve=ez,n.retryResolve=eK,n.execute=eG,n}function eH(e,t,s,n,{collect:i}){let r=[],o=function(e){r.push(e)};return o.assign=(...e)=>{r.push(eA(...e))},o.cancel=(...e)=>{r.push(P(...e))},o.raise=(...e)=>{r.push(eT(...e))},o.sendTo=(...e)=>{r.push(eQ(...e))},o.sendParent=(...e)=>{r.push(function(e,t){return eQ(eW.Parent,e,t)}(...e))},o.spawnChild=(...e)=>{r.push(B(...e))},o.stopChild=(...e)=>{r.push(J(...e))},o.emit=(...e)=>{r.push(eU(...e))},i({context:s.context,event:s.event,enqueue:o,check:e=>U(e,t.context,s.event,t),self:e.self,system:e.system},n),[t,void 0,r]}function eX(e){function t(e,t){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=eH,t}var eY=e.i(516165),eZ=e.i(633482),e0=e.i(824627),e1=e.i(913186),e6=e.i(866312),e2=(e.i(168),e.i(7560)),e3=e.i(827540);function e4(e,t,s){return(void 0===s&&(s=1/0),(0,e3.isFunction)(t))?e4(function(s,n){return(0,e1.map)(function(e,i){return t(s,e,n,i)})((0,eZ.innerFrom)(e(s,n)))},s):("number"==typeof t&&(s=t),(0,e6.operate)(function(t,n){var i,r,o,a,l,u,c,d;return i=s,r=[],o=0,a=0,l=!1,u=function(){!l||r.length||o||n.complete()},c=function(e){return o<i?d(e):r.push(e)},d=function(t){o++;var s=!1;(0,eZ.innerFrom)(e(t,a++)).subscribe((0,e2.createOperatorSubscriber)(n,function(e){n.next(e)},function(){s=!0},void 0,function(){if(s)try{for(o--;r.length&&o<i;)!function(){var e=r.shift();d(e)}();u()}catch(e){n.error(e)}}))},t.subscribe((0,e2.createOperatorSubscriber)(n,c,function(){l=!0,u()})),function(){}}))}var e5=e.i(602435),e9=e.i(591607),e8=["addListener","removeListener"],e7=["addEventListener","removeEventListener"],te=["on","off"];function tt(e,t,s,n){if((0,e3.isFunction)(s)&&(n=s,s=void 0),n)return tt(e,t,s).pipe((0,e9.mapOneOrManyArgs)(n));var i,r,o,a=(0,e0.__read)((i=e,(0,e3.isFunction)(i.addEventListener)&&(0,e3.isFunction)(i.removeEventListener))?e7.map(function(n){return function(i){return e[n](t,i,s)}}):(r=e,(0,e3.isFunction)(r.addListener)&&(0,e3.isFunction)(r.removeListener))?e8.map(ts(e,t)):(o=e,(0,e3.isFunction)(o.on)&&(0,e3.isFunction)(o.off))?te.map(ts(e,t)):[],2),l=a[0],u=a[1];if(!l&&(0,e5.isArrayLike)(e))return e4(function(e){return tt(e,t,s)})((0,eZ.innerFrom)(e));if(!l)throw TypeError("Invalid event target");return new eY.Observable(function(e){var t=function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];return e.next(1<t.length?t:t[0])};return l(t),function(){return u(t)}})}function ts(e,t){return function(s){return function(n){return e[s](t,n)}}}var tn=e.i(913072),ti=e.i(80205),tr=e.i(907844),to=new eY.Observable(function(e){return e.complete()});function ta(e){return e<=0?function(){return to}:(0,e6.operate)(function(t,s){var n=0;t.subscribe((0,e2.createOperatorSubscriber)(s,function(t){++n<=e&&(s.next(t),e<=n&&s.complete())}))})}var tl=e.i(450363);let tu=e=>({context:t})=>{let{count:s,include:n,exclude:i,responseType:r="message.received"}=e;return{count:s,domain:t.domain,from:t.connectTo,include:n?Array.isArray(n)?n:[n]:[],exclude:i?Array.isArray(i)?i:[i]:[],responseType:r,target:t.target,to:t.name}},tc=(r=()=>tt(window,"message"),new eY.Observable(function(e){(0,eZ.innerFrom)(r()).subscribe(e)})),td=e=>eR(({input:t})=>{var s,n,i;let r;return tc.pipe(e?(0,e1.map)(e):(0,tn.pipe)(),(0,ti.filter)(e=>{let{data:s}=e;return(!t.include.length||t.include.includes(s.type))&&(!t.exclude.length||!t.exclude.includes(s.type))&&s.domain===t.domain&&s.from===t.from&&s.to===t.to&&(!t.target||e.source===t.target)}),(0,e1.map)((r=t.responseType,e=>({type:r,message:e}))),t.count?(0,tn.pipe)((s=t.count,void 0===n&&(n=null),n=null!=n?n:s,(0,e6.operate)(function(e,t){var i=[],r=0;e.subscribe((0,e2.createOperatorSubscriber)(t,function(e){var o,a,l,u,c=null;r++%n==0&&i.push([]);try{for(var d=(0,e0.__values)(i),h=d.next();!h.done;h=d.next()){var f=h.value;f.push(e),s<=f.length&&(c=null!=c?c:[]).push(f)}}catch(e){o={error:e}}
4finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}if(c)try{for(var p=(0,e0.__values)(c),y=p.next();!y.done;y=p.next()){var f=y.value;(0,tr.arrRemove)(i,f),t.next(f)}}catch(e){l={error:e}}finally{try{y&&!y.done&&(u=p.return)&&u.call(p)}finally{if(l)throw l.error}}},function(){var e,s;try{for(var n=(0,e0.__values)(i),r=n.next();!r.done;r=n.next()){var o=r.value;t.next(o)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(e)throw e.error}}t.complete()},void 0,function(){i=null}))})),(i=e=>e,(0,e3.isFunction)(void 0)?e4(i,void 0,1):e4(i,1)),ta(t.count)):(0,tn.pipe)())}),th="sanity/comlink",tf="comlink/response",tp="comlink/heartbeat",ty="comlink/disconnect",tv="comlink/handshake/syn",tg="comlink/handshake/syn-ack",tm="comlink/handshake/ack",t_=()=>eF({types:{},actors:{listen:eR(({input:e})=>{let t,s=e.signal?tt(e.signal,"abort").pipe((t=`Request ${e.requestId} aborted`,e=>e.pipe(ta(1),(0,e1.map)(()=>{throw Error(t)})))):to;return tt(window,"message").pipe((0,ti.filter)(t=>{var s,n;return(null==(s=t.data)?void 0:s.type)===tf&&(null==(n=t.data)?void 0:n.responseTo)===e.requestId&&!!t.source&&e.sources.has(t.source)}),ta(e.sources.size),(0,e6.operate)(function(e,t){(0,eZ.innerFrom)(s).subscribe((0,e2.createOperatorSubscriber)(t,function(){return t.complete()},tl.noop)),t.closed||e.subscribe(t)}))})},actions:{"send message":({context:e},t)=>{let{sources:s,targetOrigin:n}=e,{message:i}=t;s.forEach(e=>{e.postMessage(i,{targetOrigin:n})})},"on success":eQ(({context:e})=>e.parentRef,({context:e,self:t})=>{var s;return e.response&&(null==(s=e.resolvable)||s.resolve(e.response)),{type:"request.success",requestId:t.id,response:e.response,responseTo:e.responseTo}}),"on fail":eQ(({context:e})=>e.parentRef,({context:e,self:t})=>{var s;return e.suppressWarnings||console.warn(`[@sanity/comlink] Received no response to message '${e.type}' on client '${e.from}' (ID: '${e.id}').`),null==(s=e.resolvable)||s.reject(Error("No response received")),{type:"request.failed",requestId:t.id}}),"on abort":eQ(({context:e})=>e.parentRef,({context:e,self:t})=>{var s;return null==(s=e.resolvable)||s.reject(Error("Request aborted")),{type:"request.aborted",requestId:t.id}})},guards:{expectsResponse:({context:e})=>e.expectResponse},delays:{initialTimeout:0,responseTimeout:1e4}}).createMachine({context:({input:e})=>({connectionId:e.connectionId,data:e.data,domain:e.domain,expectResponse:e.expectResponse??!1,from:e.from,id:`msg-${u()}`,parentRef:e.parentRef,resolvable:e.resolvable,response:null,responseTo:e.responseTo,signal:e.signal,sources:e.sources instanceof Set?e.sources:new Set([e.sources]),suppressWarnings:e.suppressWarnings,targetOrigin:e.targetOrigin,to:e.to,type:e.type}),initial:"idle",on:{abort:".aborted"},states:{idle:{after:{initialTimeout:[{target:"sending"}]}},sending:{entry:{type:"send message",params:({context:e})=>{let{connectionId:t,data:s,domain:n,from:i,id:r,responseTo:o,to:a,type:l}=e;return{message:{connectionId:t,data:s,domain:n,from:i,id:r,to:a,type:l,responseTo:o}}}},always:[{guard:"expectsResponse",target:"awaiting"},"success"]},awaiting:{invoke:{id:"listen for response",src:"listen",input:({context:e})=>({requestId:e.id,sources:e.sources,signal:e.signal}),onError:"aborted"},after:{responseTimeout:"failed"},on:{message:{actions:eA({response:({event:e})=>e.data.data,responseTo:({event:e})=>e.data.responseTo}),target:"success"}}},failed:{type:"final",entry:"on fail"},success:{type:"final",entry:"on success"},aborted:{type:"final",entry:"on abort"}},output:({context:e,self:t})=>({requestId:t.id,response:e.response,responseTo:e.responseTo})}),tb=(({sendBack:e,input:t})=>{let s=()=>{e(t.event)};t.immediate&&s();let n=setInterval(s,t.interval);return()=>{clearInterval(n)}},()=>eF({types:{},actors:{requestMachine:t_(),listen:td()},actions:{"buffer incoming message":eA({handshakeBuffer:({event:e,context:t})=>(eB(e,"message.received"),[...t.handshakeBuffer,e])}),"buffer message":eX(({enqueue:e})=>{e.assign({buffer:({event:e,context:t})=>(eB(e,"post"),[...t.buffer,{data:e.data,resolvable:e.resolvable,options:e.options}])}),e.emit(({event:e})=>(eB(e,"post"),{type:"_buffer.added",message:e.data}))}),"create request":eA({requests:({context:e,event:t,self:s,spawn:n})=>{eB(t,"request");let i=(Array.isArray(t.data)?t.data:[t.data]).map(t=>{var i,r;return n("requestMachine",{id:`req-${u()}`,input:{connectionId:e.connectionId,data:t.data,domain:e.domain,expectResponse:t.expectResponse,from:e.name,parentRef:s,resolvable:t.resolvable,responseTo:t.responseTo,signal:null==(i=t.options)?void 0:i.signal,sources:e.target,suppressWarnings:null==(r=t.options)?void 0:r.suppressWarnings,targetOrigin:e.targetOrigin,to:e.connectTo,type:t.type}})});return[...e.requests,...i]}}),"emit heartbeat":eU(()=>({type:"_heartbeat"})),"emit received message":eX(({enqueue:e})=>{e.emit(({event:e})=>(eB(e,"message.received"),{type:"_message",message:e.message.data})),e.emit(({event:e})=>(eB(e,"message.received"),{type:e.message.data.type,message:e.message.data}))}),"flush buffer":eX(({enqueue:e})=>{e.raise(({context:e})=>({type:"request",data:e.buffer.map(({data:e,resolvable:t,options:s})=>({data:e.data,type:e.type,expectResponse:!!t,resolvable:t,options:s}))})),e.emit(({context:e})=>({type:"_buffer.flushed",messages:e.buffer.map(({data:e})=>e)}
4)),e.assign({buffer:[]})}),"flush handshake buffer":eX(({context:e,enqueue:t})=>{e.handshakeBuffer.forEach(e=>t.raise(e)),t.assign({handshakeBuffer:[]})}),post:eT(({event:e})=>(eB(e,"post"),{type:"request",data:{data:e.data.data,expectResponse:!!e.resolvable,type:e.data.type,resolvable:e.resolvable,options:e.options}})),"remove request":eX(({context:e,enqueue:t,event:s})=>{eB(s,["request.success","request.failed","request.aborted"]),J(s.requestId),t.assign({requests:e.requests.filter(({id:e})=>e!==s.requestId)})}),"send response":eT(({event:e})=>(eB(e,["message.received","heartbeat.received"]),{type:"request",data:{type:tf,responseTo:e.message.data.id,data:void 0}})),"send handshake syn ack":eT({type:"request",data:{type:tg}}),"set connection config":eA({connectionId:({event:e})=>(eB(e,"message.received"),e.message.data.connectionId),target:({event:e})=>(eB(e,"message.received"),e.message.source||void 0),targetOrigin:({event:e})=>(eB(e,"message.received"),e.message.origin)})},guards:{hasSource:({context:e})=>null!==e.target}}).createMachine({id:"node",context:({input:e})=>({buffer:[],connectionId:null,connectTo:e.connectTo,domain:e.domain??th,handshakeBuffer:[],name:e.name,requests:[],target:void 0,targetOrigin:null}),on:{"request.success":{actions:"remove request"},"request.failed":{actions:"remove request"},"request.aborted":{actions:"remove request"}},initial:"idle",states:{idle:{invoke:{id:"listen for handshake syn",src:"listen",input:tu({include:tv,count:1}),onDone:{target:"handshaking",guard:"hasSource"}},on:{"message.received":{actions:"set connection config"},post:{actions:"buffer message"}}},handshaking:{entry:"send handshake syn ack",invoke:[{id:"listen for handshake ack",src:"listen",input:tu({include:tm,count:1,responseType:"handshake.complete"}),onDone:"connected"},{id:"listen for disconnect",src:"listen",input:tu({include:ty,count:1,responseType:"disconnect"})},{id:"listen for messages",src:"listen",input:tu({exclude:[ty,tm,tp,tf]})}],on:{request:{actions:"create request"},post:{actions:"buffer message"},"message.received":{actions:"buffer incoming message"},disconnect:{target:"idle"}}},connected:{entry:["flush handshake buffer","flush buffer"],invoke:[{id:"listen for messages",src:"listen",input:tu({exclude:[tf,tp]})},{id:"listen for heartbeat",src:"listen",input:tu({include:tp,responseType:"heartbeat.received"})},{id:"listen for disconnect",src:"listen",input:tu({include:ty,count:1,responseType:"disconnect"})}],on:{request:{actions:"create request"},post:{actions:"post"},disconnect:{target:"idle"},"message.received":{actions:["send response","emit received message"]},"heartbeat.received":{actions:["send response","emit heartbeat"]}}}}}));var tx=e.i(291911);let tS={"handshake/syn":tv,"handshake/syn-ack":tg,"handshake/ack":tm,"channel/response":tf,"channel/heartbeat":tp,"channel/disconnect":ty,"overlay/focus":"visual-editing/focus","overlay/navigate":"visual-editing/navigate","overlay/toggle":"visual-editing/toggle","presentation/toggleOverlay":"presentation/toggle-overlay"},tw={[tv]:"handshake/syn",[tg]:"handshake/syn-ack",[tm]:"handshake/ack",[tf]:"channel/response",[tp]:"channel/heartbeat",[ty]:"channel/disconnect","visual-editing/focus":"overlay/focus","visual-editing/navigate":"overlay/navigate","visual-editing/toggle":"overlay/toggle","presentation/toggle-overlay":"presentation/toggleOverlay"},tk=e=>{let{data:t}=e;return t&&"object"==typeof t&&"domain"in t&&"type"in t&&"from"in t&&"to"in t&&("sanity/channels"===t.domain&&(t.domain=th),"overlays"===t.to&&(t.to="visual-editing"),"overlays"===t.from&&(t.from="visual-editing"),t.type=tS[t.type]??t.type),e},tE=({context:e},t)=>{let s,{sources:n,targetOrigin:i}=e,r=((s=t.message).domain===th&&(s.domain="sanity/channels"),"visual-editing"===s.to&&(s.to="overlays"),"visual-editing"===s.from&&(s.from="overlays"),s.type=tw[s.type]??s.type,"channel/response"===s.type&&s.responseTo&&!s.data&&(s.data={responseTo:s.responseTo}),("handshake/syn"===s.type||"handshake/syn-ack"===s.type||"handshake/ack"===s.type)&&(s.data={id:s.connectionId}),s);n.forEach(e=>{e.postMessage(r,{targetOrigin:i})})};function tI(e){return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)}
4e.s(["useDocumentsInUse",0,function(e,t,s){let[n,i]=(0,tx.useState)(null),[r,o]=(0,tx.useState)(!1);(0,tx.useEffect)(()=>{if(window.self===window.top&&!window.opener)return;let e=((e,t=tb())=>{let s=M(t,{input:e}),n=()=>{s.stop()};return{actor:s,fetch:(e,t)=>{let n=Promise.withResolvers();return s.send({type:"post",data:e,resolvable:n,options:t}),n.promise},machine:t,on:(e,t)=>{let{unsubscribe:n}=s.on(e,e=>{t(e.message.data)});return n},onStatus:e=>{let t=s.getSnapshot(),n="string"==typeof t.value?t.value:Object.keys(t.value)[0],{unsubscribe:i}=s.subscribe(t=>{let s="string"==typeof t.value?t.value:Object.keys(t.value)[0];n!==s&&(n=s,e(s))});return i},post:e=>{s.send({type:"post",data:e})},start:()=>(s.start(),n),stop:n}})({name:"preview-kit",connectTo:"presentation"},tb().provide({actors:{listen:td(tk),requestMachine:t_().provide({actions:{"send message":tE}})}}));e.onStatus(e=>{"connected"===e?o(!0):"disconnected"===e&&o(!1)});let t=setTimeout(()=>i(e),0),s=e.start();return()=>{s(),i(null),clearTimeout(t)}},[s,t]);let a=JSON.stringify(Array.from(e.keys()));(0,tx.useEffect)(()=>{"[]"!==a&&n&&r&&n.post({type:"preview-kit/documents",data:{projectId:t,dataset:s,perspective:"previewDrafts",documents:Array.from(e.values())}})},[a,n,r,s,e,t])},"useQueryParams",0,function(e){let t=(0,tx.useMemo)(()=>JSON.stringify(e||{}),[e]);return(0,tx.useMemo)(()=>JSON.parse(t),[t])},"useRevalidate",0,function(e){let{refreshInterval:t}=e,s=function(){let[e,t]=(0,tx.useState)(!1);(0,tx.useEffect)(()=>{t(navigator.onLine);let e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e),window.addEventListener("offline",s),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}},[]);let s=(0,tx.useSyncExternalStore)(tI,()=>document.visibilityState,()=>"hidden");return!e||"hidden"===s}(),[n,i]=(0,tx.useState)("hit"),r=(0,tx.useCallback)(()=>(i("inflight"),()=>i("hit")),[]);return(0,tx.useEffect)(()=>{if(!t||"hit"!==n)return;let e=setTimeout(()=>i("stale"),t);return()=>clearTimeout(e)},[t,n]),(0,tx.useEffect)(()=>{if("hit"!==n)return;let e=()=>i("stale");return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[t,n]),(0,tx.useEffect)(()=>{s&&"hit"===n&&i("stale"),s||"stale"!==n||i("refresh")},[s,n]),[n,r]}],793959);let t$=(0,tx.createContext)(null);e.s(["defineStoreContext",0,t$],264343)}]);
5
6//# debugId=b945b4ec-874a-b456-3598-5da3d2199399

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.