PageSourceSearch

https://www.bvp.com/_next/static/chunks/1m6dvzx4jqb96.js

js bvp.com collected 2026-10-01 08:28:25 UTC 74,322 bytes, 3 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2863,e=>{"use strict";let t,n,s,r;var i,o=e.i(60830);let a={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function u(e){return e||t?{lang:e?.lang??t?.lang,message:e?.message,abortEarly:e?.abortEarly??t?.abortEarly,abortPipeEarly:e?.abortPipeEarly??t?.abortPipeEarly}:a}function c(e,t,i,o,a){var u,c,l,p;let f,d=a&&"input"in a?a.input:i.value,h=a?.expected??e.expects??null,y=a?.received??("string"==(f=typeof d)?`"${d}"`:"number"===f||"bigint"===f||"boolean"===f?`${d}`:"object"===f||"function"===f?(d&&Object.getPrototypeOf(d)?.constructor?.name)??"null":f),g={kind:e.kind,type:e.type,input:d,expected:h,received:y,message:`Invalid ${t}: ${h?`Expected ${h} but r`:"R"}eceived ${y}`,requirement:e.requirement,path:a?.path,issues:a?.issues,lang:o.lang,abortEarly:o.abortEarly,abortPipeEarly:o.abortPipeEarly},m="schema"===e.kind,v=a?.message??e.message??(u=e.reference,c=g.lang,r?.get(u)?.get(c))??(m?(l=g.lang,s?.get(l)):null)??o.message??(p=g.lang,n?.get(p));void 0!==v&&(g.message="function"==typeof v?v(g):v),m&&(i.typed=!1),i.issues?i.issues.push(g):i.issues=[g]}function l(e){return e["~standard"]={version:1,vendor:"valibot",validate:t=>e["~run"]({value:t},u())},e}var p=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};function f(e,t){return{kind:"validation",type:"min_length",reference:f,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length<this.requirement&&c(this,"length",e,t,{received:`${e.value.length}`}),e}}}let d={abortEarly:!0};function h(e,t,n){return"function"==typeof e.fallback?e.fallback(t,n):e.fallback}function y(e,t,n){return"function"==typeof e.default?e.default(t,n):e.default}function g(e,t){return l({kind:"schema",type:"object",reference:g,expects:"Object",async:!1,entries:e,message:t,"~run"(e,t){let n=e.value;if(n&&"object"==typeof n)for(let s in e.typed=!0,e.value={},this.entries){let r=this.entries[s];if(s in n||("exact_optional"===r.type||"optional"===r.type||"nullish"===r.type)&&void 0!==r.default){let i=s in n?n[s]:y(r),o=r["~run"]({value:i},t);if(o.issues){let r={type:"object",origin:"value",input:n,key:s,value:i};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[s]=o.value}else if(void 0!==r.fallback)e.value[s]=h(r);else if("exact_optional"!==r.type&&"optional"!==r.type&&"nullish"!==r.type&&(c(this,"key",e,t,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:n,key:s,value:n[s]}]}),t.abortEarly))break}else c(this,"type",e,t);return e}})}function m(e,t){return l({kind:"schema",type:"optional",reference:m,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,"~run"(e,t){return void 0===e.value&&(void 0!==this.default&&(e.value=y(this,e,t)),void 0===e.value)?(e.typed=!0,e):this.wrapped["~run"](e,t)}})}function v(e){return l({kind:"schema",type:"string",reference:v,expects:"string",async:!1,message:e,"~run"(e,t){return"string"==typeof e.value?e.typed=!0:c(this,"type",e,t),e}})}function b(...e){return l({...e[0],pipe:e,"~run"(t,n){for(let s of e)if("metadata"!==s.kind){if(t.issues&&("schema"===s.kind||"transformation"===s.kind)){t.typed=!1;break}t.issues&&(n.abortEarly||n.abortPipeEarly)||(t=s["~run"](t,n))}return t}})}function _(e,t,n){let s=e["~run"]({value:t},u(n));return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}let k=b(v(),f(1)),x=m(k),S=g({baseUrl:k,dataset:x,id:k,path:k,projectId:x,tool:x,type:x,workspace:x,perspective:(i=v(),l({...i,fallback:"drafts","~run"(e,t){let n=i["~run"](e,t);return n.issues?{typed:!0,value:h(this,n,t)}:n}}))});function w(e){return!S["~run"]({value:e},d).issues}function E(e){let t="";for(let n of e){if("string"==typeof n){t&&(t+="."),t+=n;continue}if("number"==typeof n){t&&(t+=":"),t+=`${n}`;continue}if(null!==n&&Array.isArray(n)){t&&(t+=":"),t+=`${n.join(",")}}`;continue}if(n._key){t&&(t+=":"),t+=`${n._key}`;continue}}return t}let I=/^([\w-]+):(0|[1-9][0-9]{0,8})$/,$=/^([\w-]+):([0-9]+),([0-9]+)$/,O=/^([\w-]+):([\w-]+)$/,j=b(v(),f(1)),T=g({origin:j,href:j,data:m(function e(t,n,s){return l({kind:"schema",type:"record",reference:e,expects:"Object",async:!1,key:t,value:n,message:s,"~run"(e,t){let n=e.value;if(n&&"object"==typeof n){for(let s in e.typed=!0,e.value={},n)if(Object.prototype.hasOwnProperty.call(n,s)&&"__proto__"!==s&&"prototype"!==s&&"constructor"!==s){let r=n[s],i=this.key["~run"]({value:s},t);
1if(i.issues){let o={type:"object",origin:"key",input:n,key:s,value:r};for(let t of i.issues)t.path=[o],e.issues?.push(t);if(e.issues||(e.issues=i.issues),t.abortEarly){e.typed=!1;break}}let o=this.value["~run"]({value:r},t);if(o.issues){let i={type:"object",origin:"value",input:n,key:s,value:r};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}i.typed&&o.typed||(e.typed=!1),i.typed&&(e.value[i.value]=o.value)}}else c(this,"type",e,t);return e}})}(v(),function e(){return l({kind:"schema",type:"unknown",reference:e,expects:"unknown",async:!1,"~run":e=>(e.typed=!0,e)})}()))});function A(e){let t=e.indexOf("/intent/edit/");if(-1!==t)try{let n=e.slice(t+13),s=n.indexOf("?"),r=-1===s?n:n.slice(0,s),i={};for(let e of r.split(";")){let t=e.indexOf("=");if(-1===t)continue;let n=e.slice(0,t);("id"===n||"type"===n||"path"===n||"tool"===n)&&(i[n]=decodeURIComponent(e.slice(t+1)))}-1!==s&&Object.assign(i,Object.fromEntries(new URLSearchParams(n.slice(s+1)))),i.baseUrl??=e.slice(0,t)||"/";let o=_(S,i);return o.success?o.output:void 0}catch{return}}function M(e){let t=_(S,e);if(t.success)return t.output;let n=_(T,e);if(n.success){let{href:e}=n.output;try{let t=new URL(e,typeof document>"u"?"https://example.com":location.origin);return t.searchParams.size>0?function(e,t){let n=e["~run"]({value:t},u(void 0));if(n.issues)throw new p(n.issues);return n.value}(S,Object.fromEntries(t.searchParams.entries())):A(e)??n.output}catch(t){return A(e)||(console.error("Failed to parse sanity node",t),n.output)}}}e.s(["createDataAttribute",0,function e(t){function n(e){return e?"string"==typeof e?o.studioPath.fromString(e):e:[]}function s(e){if(!e.id)throw Error("`id` is required to create a data attribute");if(!e.type)throw Error("`type` is required to create a data attribute");if(!e.path||!e.path.length)throw Error("`path` is required to create a data attribute");return function(e){let{id:t,path:n,baseUrl:s,tool:r,workspace:i,type:a}=e;if(w(e))return[["id",(0,o.getPublishedId)(t)],["type",a],["path",E(o.studioPath.fromString(n))],["base",encodeURIComponent(s)],["workspace",i],["tool",r]].filter(([,e])=>!!e).map(e=>e.join("=")).join(";")}({baseUrl:e.baseUrl||"/",workspace:e.workspace,tool:e.tool,type:e.type,id:e.id,path:"string"==typeof e.path?e.path:o.studioPath.toString(e.path),perspective:e.perspective})}let r=e=>s({...t,path:[...n(t.path),...n(e)]});return r.toString=function(){return s(t)},r.combine=function(n){return e({...t,...n})},r.scope=function(s){return e({...t,path:[...n(t.path),...n(s)]})},r},"decodeSanityNodeData",0,function(e){if("object"==typeof e&&e)return M(e);try{return M(JSON.parse(e))}catch{let t=e.split(";").reduce((e,t)=>{let[n,s]=t.split("=");if(!n||t.includes("=")&&!s)return e;switch(n){case"id":e.id=s;break;case"type":e.type=s;break;case"path":e.path=o.studioPath.toString(function(e){let t=[];for(let n of e.split(".")){let e=I.exec(n);if(e){t.push(e[1],Number(e[2]));continue}let s=$.exec(n);if(s){t.push(s[1],[Number(s[2]),Number(s[3])]);continue}let r=O.exec(n);if(r){t.push(r[1],{_key:r[2]});continue}t.push(n)}return t}(s));break;case"base":e.baseUrl=decodeURIComponent(s);break;case"perspective":e.perspective=s;break;case"tool":e.tool=s;break;case"workspace":e.workspace=s;break;case"projectId":e.projectId=s;break;case"dataset":e.dataset=s}return e},{});if(w(t))return t;return}},"pathToUrlString",0,E],2863)},97728,15886,98859,63826,76955,98299,94276,92826,74304,38876,2906,13200,52122,88764,33747,87295,30975,79426,e=>{"use strict";let t;class n{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 s="xstate.init",r="xstate.error",i="xstate.stop";function o(e,t){return{type:`xstate.done.state.${e}`,output:t}}function a(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function u(e){return{type:s,input:e}}function c(e){setTimeout(()=>{throw e})}let l="function"==typeof Symbol&&Symbol.observable||"@@observable";function p(e){if(g(e))return e;let t=[],n="";for(let s=0;s<e.length;s++){switch(e.charCodeAt(s)){case 92:n+=e[s+1],s++;continue;case 46:t.push(n),n="";continue}n+=e[s]}return t.push(n),t}function f(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={},n=t;for(let t=0;t<e.length-1;t++)if(t===e.length-2)n[e[t]]=e[t+1];else{let s=n;n={},s[e[t]]=n}return t}(p(e))}function d(e,t){let n={},s=Object.keys(e);for(let r=0;r<s.length;r++){let i=s[r];n[i]=t(e[i],i,e,r)}return n}function h(e){var t;return void 0===e?[]:g(t=e)?t:[t]}function y(e,t,n,s){return"function"==typeof e?e({context:t,event:n,self:s}):e}function g(e){return Array.isArray(e)}function m(e){var t;return(g(t=e)?t:[t]).map(e=>void 0===e||"string"==typeof e?{target:e}:e)}function v(e){if(void 0!==e&&""!==e)return h(e)}function b(e,t,n){let s="object"==typeof e,r=s?e:void 0;return{next:(s?e.next:e)?.bind(r),error:(s?e.error:t)?.bind(r),complete:(s?e.complete:n)?.bind(r)}}function _(e,t){return`${t}.${e}`}function k(e,t){let n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];let[,s,r]=n,i=e.getStateNodeById(r).config.invoke;return(Array.isArray(i)?i[s]:i).src}function x(e,t){if(t===e||"*"===t)return!0;
1if(!t.endsWith(".*"))return!1;let n=t.split("."),s=e.split(".");for(let e=0;e<n.length;e++){let t=n[e],r=s[e];if("*"===t)return e===n.length-1;if(t!==r)return!1}return!0}function S(e,t){return`${e.sessionId}.${t}`}let w=0;function E(e,t){let n=new Map,s=new Map,r=new WeakMap,i=new Set,o={},{clock:a,logger:u}=t,c={schedule:(e,t,n,s,r=Math.random().toString(36).slice(2))=>{let i={source:e,target:t,event:n,delay:s,id:r,startedAt:Date.now()},u=S(e,r);l._snapshot._scheduledEvents[u]=i;let c=a.setTimeout(()=>{delete o[u],delete l._snapshot._scheduledEvents[u],l._relay(e,t,n)},s);o[u]=c},cancel:(e,t)=>{let n=S(e,t),s=o[n];delete o[n],delete l._snapshot._scheduledEvents[n],void 0!==s&&a.clearTimeout(s)},cancelAll:e=>{for(let t in l._snapshot._scheduledEvents){let n=l._snapshot._scheduledEvents[t];n.source===e&&c.cancel(e,n.id)}}},l={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${w++}`,_register:(e,t)=>(n.set(e,t),e),_unregister:e=>{n.delete(e.sessionId);let t=r.get(e);void 0!==t&&(s.delete(t),r.delete(e))},get:e=>s.get(e),getAll:()=>Object.fromEntries(s.entries()),_set:(e,t)=>{let n=s.get(e);if(n&&n!==t)throw Error(`Actor with system ID '${e}' already exists.`);s.set(e,t),r.set(t,e)},inspect:e=>{let t=b(e);return i.add(t),{unsubscribe(){i.delete(t)}}},_sendInspectionEvent:t=>{if(!i.size)return;let n={...t,rootId:e.sessionId};i.forEach(e=>e.next?.(n))},_relay:(e,t,n)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:e,actorRef:t,event:n}),t._send(n)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{let e=l._snapshot._scheduledEvents;for(let t in l._snapshot._scheduledEvents={},e){let{source:n,target:s,event:r,delay:i,id:o}=e[t];c.schedule(n,s,r,i,o)}},_clock:a,_logger:u};return l}let I=!1,$=((eH={})[eH.NotStarted=0]="NotStarted",eH[eH.Running=1]="Running",eH[eH.Stopped=2]="Stopped",eH),O={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};
1class j{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 n(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=$.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={...O,...t},{clock:r,logger:i,parent:o,syncSnapshot:a,id:u,systemId:l,inspect:p}=s;this.system=o?o.system:E(this,{clock:r,logger:i}),p&&!o&&this.system.inspect(b(p)),this.sessionId=this.system._bookId(),this.id=u??this.sessionId,this.logger=t?.logger??this.system._logger,this.clock=t?.clock??this.system._clock,this._parent=o,this._syncSnapshot=a,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),n=this.eventListeners.get("*");if(t||n)for(let s of[...t?t.values():[],...n?n.values():[]])try{s(e)}catch(e){c(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=I;try{I=!0,e.exec(e.info,e.params)}finally{I=t}};this._processingStatus===$.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(t?.snapshot??t?.state),l&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(e){try{this._snapshot=e?this.logic.restoreSnapshot?this.logic.restoreSnapshot(e,this._actorScope):e:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(e){this._snapshot={status:"error",output:void 0,error:e}}}update(e,t){let n;for(this._snapshot=e;n=this._deferred.shift();)try{n()}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{t.next?.(e)}catch(e){c(e)}break;case"done":var s;for(let t of this.observers)try{t.next?.(e)}catch(e){c(e)}this._stopProcedure(),this._complete(),this._doneEvent=(s=this.id,{type:`xstate.done.actor.${s}`,output:this._snapshot.output,actorId:s}),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,n){let s=b(e,t,n);if(this._processingStatus!==$.Stopped)this.observers.add(s);else switch(this._snapshot.status){case"done":try{s.complete?.()}catch(e){c(e)}break;case"error":{let e=this._snapshot.error;if(s.error)try{s.error(e)}catch(e){c(e)}else c(e)}}return{unsubscribe:()=>{this.observers.delete(s)}}}on(e,t){let n=this.eventListeners.get(e);n||(n=new Set,this.eventListeners.set(e,n));let s=t.bind(void 0);return n.add(s),{unsubscribe:()=>{n.delete(s)}}}select(e,t=Object.is){return{subscribe:n=>{let s=b(n),r=e(this.getSnapshot());return this.subscribe(n=>{let i=e(n);t(r,i)||(r=i,s.next?.(i))})},get:()=>e(this.getSnapshot())}}start(){if(this._processingStatus===$.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=$.Running;let e=u(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,n;try{t=this.logic.transition(this._snapshot,e,this._actorScope)}catch(e){n={err:e}}if(n){let{err:e}=n;this._snapshot={...this._snapshot,status:"error",error:e},this._error(e);return}this.update(t,e),e.type===i&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===$.Stopped||((this.mailbox.clear(),this._processingStatus===$.NotStarted)?this._processingStatus=$.Stopped:this.mailbox.enqueue({type:i})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let e of this.observers)try{e.complete?.()}catch(e){c(e)}this.observers.clear(),this.eventListeners.clear()}_reportError(e){if(!this.observers.size){this._parent||c(e),this.eventListeners.clear();return}let t=!1;for(let n of this.observers){let s=n.error;t||=!s;try{s?.(e)}catch(e){c(e)}}this.observers.clear(),this.eventListeners.clear(),t&&c(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,a(this.id,e))}_stopProcedure(){return this._processingStatus!==$.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new n(this._process.bind(this)),this._processingStatus=$.Stopped,this.system._unregister(this)),this}_send(e){this._processingStatus!==$.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 n=function(){let t="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:e.g;if(t.__xstate__)return t.__xstate__}();n&&n.register(t)})(this)}toJSON(){return{xstate$$type:1,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[l](){return this}getSnapshot(){return this._snapshot}}function T(e,...[t]){return new j(e,t)}function A(e,t,n,s,{sendId:r}){return[t,{sendId:"function"==typeof r?r(n,s):r},void 0]}function M(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=A,t.execute=M,t}function R(e,t,n,s,{id:r,systemId:i,src:o,input:a,syncSnapshot:u}){let c,l,p="string"==typeof o?k(t.machine,o):o,f="function"==typeof r?r(n):r;return p&&(l="function"==typeof a?a({context:t.context,event:n.event,self:e.self}):a,c=T(p,{id:f,src:o,parent:e.self,syncSnapshot:u,systemId:i,input:l})),[eT(t,{children:{...t.children,[f]:c}}),{id:r,systemId:i,actorRef:c,src:o,input:l},void 0]}function q(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==$.Stopped&&t.start()})}function N(...[e,{id:t,systemId:n,input:s,syncSnapshot:r=!1}={}]){function i(e,t){}return i.type="xstate.spawnChild",i.id=t,i.systemId=n,i.src=e,i.input=s,i.syncSnapshot=r,i.resolve=R,i.execute=q,i}function C(e,t,n,s,{actorRef:r}){let i="function"==typeof r?r(n,s):r,o="string"==typeof i?t.children[i]:i,a=t.children;return o&&(a={...a},delete a[o.id]),[eT(t,{children:a}),o,void 0]}function D(e,t){if(t){if(!function e(t,n){let s=n.getSnapshot();if(s&&"children"in s)for(let n of Object.values(s.children))e(t,n);t.system._unregister(n)}(e,t),t._processingStatus!==$.Running)return void e.stopChild(t);e.defer(()=>{e.stopChild(t)})}}function U(e){function t(e,t){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=C,t.execute=D,t}
1function L(e,{context:t,event:n},{guards:s}){return s.every(s=>B(s,t,n,e))}function B(e,t,n,s){let{machine:r}=s,i="function"==typeof e,o=i?e:r.implementations.guards["string"==typeof e?e:e.type];if(!i&&!o)throw Error(`Guard '${"string"==typeof e?e:e.type}' is not implemented.'.`);if("function"!=typeof o)return B(o,t,n,s);let a={context:t,event:n},u=i||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:t,event:n}):e.params:void 0;return"check"in o?o.check(s,a,o):o(a,u)}function V(e){return"atomic"===e.type||"final"===e.type}function W(e){return Object.values(e.states).filter(e=>"history"!==e.type)}function J(e,t){let n=[];if(t===e)return n;let s=e.parent;for(;s&&s!==t;)n.push(s),s=s.parent;return n}function z(e){let t=new Set(e),n=F(t);for(let e of t)if("compound"!==e.type||n.get(e)&&n.get(e).length){if("parallel"===e.type){for(let n of W(e))if("history"!==n.type&&!t.has(n))for(let e of er(n))t.add(e)}}else er(e).forEach(e=>t.add(e));for(let e of t){let n=e.parent;for(;n;)t.add(n),n=n.parent}return t}function F(e){let t=new Map;for(let n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function K(e,t){return function e(t,n){let s=n.get(t);if(!s)return{};if("compound"===t.type){let e=s[0];if(!e)return{};if(V(e))return e.key}let r={};for(let t of s)r[t.key]=e(t,n);return r}(e,F(z(t)))}function G(e,t){return"compound"===t.type?W(t).some(t=>"final"===t.type&&e.has(t)):"parallel"===t.type?W(t).every(t=>G(e,t)):"final"===t.type}let H=e=>"#"===e[0];function Y(e,t){let n=e.transitions.get(t),s=[...e.transitions.keys()].filter(e=>e!==t&&x(t,e)).sort((e,t)=>t.length-e.length).flatMap(t=>e.transitions.get(t));return n?[...n,...s]:s}function Q(e){let t=e.config.after;return t?Object.keys(t).flatMap(n=>{var s;let r,i,o=t[n],a=Number.isNaN(+n)?n:+n,u=(s=e.id,i=(r={type:`xstate.after.${a}.${s}`}).type,e.entry.push(eR(r,{id:i,delay:a})),e.exit.push(P(i)),i);return h("string"==typeof o?{target:o}:o).map(e=>({...e,event:u,delay:a}))}).map(t=>{let{delay:n}=t;return{...X(e,t.event,t),delay:n}}):[]}function X(e,t,n){let s=v(n.target),r=n.reenter??!1,i=function(e,t){if(void 0!==t)return t.map(t=>{if("string"!=typeof t)return t;if(H(t))return e.machine.getStateNodeById(t);let n="."===t[0];if(n&&!e.parent)return ea(e,t.slice(1));let s=n?e.key+t:t;if(e.parent)try{return ea(e.parent,s)}catch(t){throw Error(`Invalid transition definition for state node '${e.id}':
2${t.message}`)}throw Error(`Invalid target: "${t}" is not a valid target from the root node. Did you mean ".${t}"?`)})}(e,s),o={...n,actions:h(n.actions),guard:n.guard,target:i,source:e,reenter
2:r,eventType:t,toJSON:()=>({...o,source:`#${e.id}`,target:i?i.map(e=>`#${e.id}`):void 0})};return o}function Z(e){let t=new Map;if(e.config.on)for(let n of Object.keys(e.config.on)){if(""===n)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let s=e.config.on[n];t.set(n,m(s).map(t=>X(e,n,t)))}if(e.config.onDone){let n=`xstate.done.state.${e.id}`;t.set(n,m(e.config.onDone).map(t=>X(e,n,t)))}for(let n of e.invoke){if(n.onDone){let s=`xstate.done.actor.${n.id}`;t.set(s,m(n.onDone).map(t=>X(e,s,t)))}if(n.onError){let s=`xstate.error.actor.${n.id}`;t.set(s,m(n.onError).map(t=>X(e,s,t)))}if(n.onSnapshot){let s=`xstate.snapshot.${n.id}`;t.set(s,m(n.onSnapshot).map(t=>X(e,s,t)))}}for(let n of e.after){let e=t.get(n.eventType);e||(e=[],t.set(n.eventType,e)),e.push(n)}return t}function ee(e){let t=[],n=s=>{Object.values(s).forEach(s=>{if(s.config.route&&s.config.id){let n=s.config.id,r=s.config.route.guard,i=({event:e})=>e.to===`#${n}`,o={...s.config.route,guard:r?function(e){function t(e,t){return!1}return t.check=L,t.guards=e,t}([i,r]):i,target:`#${n}`};t.push(X(e,"xstate.route",o))}s.states&&n(s.states)})};n(e.states),t.length>0&&e.transitions.set("xstate.route",t)}function et(e,t){let n="string"==typeof t?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let s={source:e,actions:t&&"string"!=typeof t?h(t.actions):[],eventType:null,reenter:!1,target:n?[n]:[],meta:"object"==typeof t?t.meta:void 0,description:"object"==typeof t?t.description:void 0,toJSON:()=>({...s,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return s}function en(e){let t=v(e.config.target);return t?{target:t.map(t=>"string"==typeof t?ea(e.parent,t):t)}:"parallel"===e.parent.type?{target:[e.parent]}:e.parent.initial}function es(e){return"history"===e.type}function er(e){let t=ei(e);for(let n of t)for(let s of J(n,e))t.add(s);return t}function ei(e){let t=new Set;return!function e(n){if(!t.has(n)){if(t.add(n),"compound"===n.type)e(n.initial.target[0]);else if("parallel"===n.type)for(let t of W(n))e(t)}}(e),t}function eo(e,t){if(H(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 n=e.states[t];if(!n)throw Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function ea(e,t){if("string"==typeof t&&H(t))try{return e.machine.getStateNodeById(t)}catch{}let n=p(t).slice(),s=e;for(;n.length;){let e=n.shift();if(!e.length)break;s=eo(s,e)}return s}function eu(e,t){if("string"==typeof t){let n=e.states[t];if(!n)throw Error(`State '${t}' does not exist on '${e.id}'`);return[e,n]}let n=Object.keys(t),s=n.map(t=>eo(e,t)).filter(Boolean);return[e.machine.root,e].concat(s,n.reduce((n,s)=>{let r=eo(e,s);if(!r)return n;let i=eu(r,t[s]);return n.concat(i)},[]))}function ec(e,t,n,s){if("string"==typeof t){let r;return(r=eo(e,t).next(n,s))&&r.length?r:e.next(n,s)}if(1===Object.keys(t).length){let r,i;return(i=ec(eo(e,(r=Object.keys(t))[0]),t[r[0]],n,s))&&i.length?i:e.next(n,s)}let r=[];for(let i of Object.keys(t)){let o=t[i];if(!o)continue;let a=ec(eo(e,i),o,n,s);a&&r.push(...a)}return r.length?r:e.next(n,s)}function el(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function ep(e,t,n){let s=new Set;for(let r of e){let e=!1,i=new Set;for(let o of s)if(function(e,t){let n=new Set(e),s=new Set(t);for(let e of n)if(s.has(e))return!0;for(let e of s)if(n.has(e))return!0;return!1}(eh([r],t,n),eh([o],t,n)))if(el(r.source,o.source))i.add(o);else{e=!0;break}if(!e){for(let e of i)s.delete(e);s.add(r)}}return Array.from(s)}function ef(e,t){if(!e.target)return[];let n=new Set;for(let s of e.target)if(es(s))if(t[s.id])for(let e of t[s.id])n.add(e);else for(let e of ef(en(s),t))n.add(e);else n.add(s);return[...n]}function ed(e,t){let n=ef(e,t);if(!n)return;if(!e.reenter&&n.every(t=>t===e.source||el(t,e.source)))return e.source;let s=function(e){let[t,...n]=e;for(let e of J(t,void 0))if(n.every(t=>el(t,e)))return e}(n.concat(e.source));return s||(e.reenter?void 0:e.source.machine.root)}function eh(e,t,n){let s=new Set;for(let r of e)if(r.target?.length){let e=ed(r,n);for(let n of(r.reenter&&r.source===e&&s.add(e),t))el(n,e)&&s.add(n)}return[...s]}function ey(e,t,n,s,r){return eg([{target:[...ei(e)],source:e,reenter
2:!0,actions:[],eventType:null,toJSON:null}],t,n,s,!0,r)}function eg(e,t,n,s,r,i){let a=[];if(!e.length)return[t,a];let u=n.actionExecutor;n.actionExecutor=e=>{a.push(e),u(e)};try{let u=new Set(t._nodes),c=t.historyValue,l=ep(e,u,c),p=t;r||([p,c]=function(e,t,n,s,r,i,o,a){let u,c=e,l=eh(s,r,i);for(let e of(l.sort((e,t)=>t.order-e.order),l))for(let t of function(e){return Object.keys(e.states).map(t=>e.states[t]).filter(e=>"history"===e.type)}(e)){let n;n="deep"===t.history?t=>V(t)&&el(t,e):t=>t.parent===e,(u??={...i})[t.id]=Array.from(r).filter(n)}for(let e of l)c=eb(c,t,n,[...e.exit,...e.invoke.map(e=>U(e.id))],o,void 0),r.delete(e);return[c,u||i]}(p,s,n,l,u,c,i,n.actionExecutor)),p=eb(p,s,n,l.flatMap(e=>e.actions),i,void 0),p=function(e,t,n,s,r,i,a,u){let c=e,l=new Set,p=new Set;(function(e,t,n,s){for(let r of e){let e=ed(r,t);for(let i of r.target||[])!es(i)&&(r.source!==i||r.source!==e||r.reenter)&&(s.add(i),n.add(i)),em(i,t,n,s);for(let i of ef(r,t)){let o=J(i,e);e?.type==="parallel"&&o.push(e),ev(s,t,n,o,!r.source.parent&&r.reenter?void 0:e)}}})(s,a,p,l),u&&p.add(e.machine.root);let f=new Set;for(let e of[...l].sort((e,t)=>e.order-t.order)){r.add(e);let s=[];for(let t of(s.push(...e.entry),e.invoke))s.push(N(t.src,{...t,syncSnapshot:!!t.onSnapshot}));if(p.has(e)){let t=e.initial.actions;s.push(...t)}if(c=eb(c,t,n,s,i,e.invoke.map(e=>e.id)),"final"===e.type){let s=e.parent,a=s?.type==="parallel"?s:s?.parent,u=a||e;for(s?.type==="compound"&&i.push(o(s.id,void 0!==e.output?y(e.output,c.context,t,n.self):void 0));a?.type==="parallel"&&!f.has(a)&&G(r,a);)f.add(a),i.push(o(a.id)),u=a,a=a.parent;if(a)continue;c=eT(c,{status:"done",output:function(e,t,n,s,r){if(void 0===s.output)return;let i=o(r.id,void 0!==r.output&&r.parent?y(r.output,e.context,t,n.self):void 0);return y(s.output,e.context,i,n.self)}(c,t,n,c.machine.root,u)})}}return c}(p,s,n,l,u,i,c,r);let f=[...u];"done"===p.status&&(p=eb(p,s,n,f.sort((e,t)=>t.order-e.order).flatMap(e=>e.exit),i,void 0));try{if(c===t.historyValue&&function(e,t){if(e.length!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}(t._nodes,u))return[p,a];return[eT(p,{_nodes:f,historyValue:c}),a]}catch(e){throw e}}finally{n.actionExecutor=u}}function em(e,t,n,s){var r,i,o,a;if(es(e))if(t[e.id]){let o=t[e.id];for(let e of o)s.add(e),em(e,t,n,s);for(let a of o){r=a,i=e.parent,ev(s,t,n,J(r,i))}}else{let r=en(e);for(let i of r.target)s.add(i),r===e.parent?.initial&&n.add(e.parent),em(i,t,n,s);for(let i of r.target){o=i,a=e.parent,ev(s,t,n,J(o,a))}}else if("compound"===e.type){let[r]=e.initial.target;es(r)||(s.add(r),n.add(r)),em(r,t,n,s),ev(s,t,n,J(r,e))}else if("parallel"===e.type)for(let r of W(e).filter(e=>!es(e)))[...s].some(e=>el(e,r))||(es(r)||(s.add(r),n.add(r)),em(r,t,n,s))}function ev(e,t,n,s,r){for(let i of s)if((!r||el(i,r))&&e.add(i),"parallel"===i.type)for(let s of W(i).filter(e=>!es(e)))[...e].some(e=>el(e,s))||(e.add(s),em(s,t,n,e))}function eb(e,t,n,s,r,i){let o=i?[]:void 0,a=function e(t,n,s,r,i,o){let{machine:a}=t,u=t;for(let t of r){var c;let r="function"==typeof t,l=r?t:(c="string"==typeof t?t:t.type,a.implementations.actions[c]),p={context:u.context,event:n,self:s.self,system:s.system},f=r||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:u.context,event:n}):t.params:void 0;if(!l||!("resolve"in l)){s.actionExecutor({type:"string"==typeof t?t:"object"==typeof t?t.type:t.name||"(anonymous)",info:p,params:f,exec:l});continue}let[d,h,y]=l.resolve(s,u,p,f,l,i);u=d,"retryResolve"in l&&o?.push([l,h]),"execute"in l&&s.actionExecutor({type:l.type,info:p,params:h,exec:l.execute.bind(null,s,h)}),y&&(u=e(u,n,s,y,i,o))}return u}(e,t,n,s,{internalQueue:r,deferredActorIds:i},o);return o?.forEach(([e,t])=>{e.retryResolve(n,a,t)}),a}function e_(e,t,n,r){let o=e,a=[];function u(e,t,s){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:t,snapshot:e[0],_transitions:s}),a.push(e)}if(t.type===i)return u([o=eT(ek(o,t,n),{status:"stopped"}),[]],t,[]),{snapshot:o,microsteps:a};let c=t;if(c.type!==s){let t=c,s=t.type.startsWith("xstate.error.actor"),i=ex(t,o);if(s&&!i.length)return u([o=eT(e,{status:"error",error:t.error}),[]],t,[]),{snapshot:o,microsteps:a};let l=eg(i,e,n,c,!1,r);o=l[0],u(l,t,i)}let l=!0,p=e.machine.options?.maxIterations??1/0,f=0;for(;"active"===o.status;){if(++f>p)throw Error(`Infinite loop detected: the machine has processed more than ${p} microsteps without reaching a stable state. This usually happens when there's a cycle of transitions (e.g., eventless transitions or raised events causing state A -> B -> C -> A).`);let e=l?function(e,t){let n=new Set;for(let s of e._nodes.filter(V))e:for(let r of[s].concat(J(s,void 0)))if(r.always){for(let s of r.always)if(void 0===s.guard||B(s.guard,e.context,t,e)){n.add(s);break e}}return ep(Array.from(n),new Set(e._nodes),e.historyValue)}(o,c):[],t=e.length?o:void 0;if(!e.length){if(!r.length)break;e=ex(c=r.shift(),o)}let s=eg(e,o,n,c,!1,r);l=(o=s[0])!==t,u(s,c,e)}return"active"!==o.status&&ek(o,c,n),{snapshot:o,microsteps:a}}function ek(e,t,n){return eb(e,t,n,Object.values(e.children).map(e=>U(e)),[],void 0)}function ex(e,t){return t.machine.getTransitionData(t,e)}function eS(e,t){let n=z(eu(e,t));return K(e,[...n])}let ew=function(e){return function e(t,n){let s=f(t),r=f(n);return"string"==typeof r?"string"==typeof s&&r===s:"string"==typeof s?s in r:Object.keys(s).every(t=>t in r&&e(s[t],r[t]))}(e,this.value)},eE=function(e){return this.tags.has(e)},eI=function(e){let t=this.machine.getTransitionData(this,e);return!!t?.length&&t.some(e=>void 0!==e.target||e.actions.length)},e$=function(){let{_nodes:e,tags:t,machine:n,getMeta:s,toJSON:r,can:i,hasTag:o,matches:a,...u}=this;return{...u,tags:Array.from(t)}},eO=function(){return this._nodes.reduce((e,t)=>
2(void 0!==t.meta&&(e[t.id]=t.meta),e),{})};function ej(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:K(t.root,e._nodes),tags:new Set(e._nodes.flatMap(e=>e.tags)),children:e.children,historyValue:e.historyValue||{},matches:ew,hasTag:eE,can:eI,getMeta:eO,toJSON:e$}}function eT(e,t={}){return ej({...e,...t},e.machine)}function eA(e,t){let{_nodes:n,tags:s,machine:r,children:i,context:o,can:a,hasTag:u,matches:c,getMeta:l,toJSON:p,...f}=e,d={};for(let e in i){let n=i[e];d[e]={snapshot:n.getPersistedSnapshot(t),src:n.src,systemId:n.systemId,syncSnapshot:n._syncSnapshot}}return{...f,context:function e(t){let n;for(let s in t){let r=t[s];if(r&&"object"==typeof r)if("sessionId"in r&&"send"in r&&"ref"in r)(n??=Array.isArray(t)?t.slice():{...t})[s]={xstate$$type:1,id:r.id};else{let i=e(r);i!==r&&((n??=Array.isArray(t)?t.slice():{...t})[s]=i)}}return n??t}(o),children:d,historyValue:function(e){if("object"!=typeof e||null===e)return{};let t={};for(let n in e){let s=e[n];Array.isArray(s)&&(t[n]=s.map(e=>({id:e.id})))}return t}(f.historyValue)}}function eM(e,t,n,s,{event:r,id:i,delay:o},{internalQueue:a}){let u,c=t.machine.implementations.delays;if("string"==typeof r)throw Error(`Only event objects may be used with raise; use raise({ type: "${r}" }) instead`);let l="function"==typeof r?r(n,s):r;if("string"==typeof o){let e=c&&c[o];u="function"==typeof e?e(n,s):e}else u="function"==typeof o?o(n,s):o;return"number"!=typeof u&&a.push(l),[t,{event:l,id:i,delay:u},void 0]}function eP(e,t){let{event:n,delay:s,id:r}=t;if("number"==typeof s)return void e.defer(()=>{let t=e.self;e.system.scheduler.schedule(t,t,n,s,r)})}function eR(e,t){function n(e,t){}return n.type="xstate.raise",n.event=e,n.id=t?.id,n.delay=t?.delay,n.resolve=eM,n.execute=eP,n}e.s(["$",0,1,"B",0,Z,"C",0,m,"D",0,X,"E",0,B,"F",0,_,"G",0,Q,"H",0,et,"I",0,Y,"J",0,ee,"K",0,eS,"L",0,z,"M",0,ej,"N",0,"","O",0,G,"P",0,ec,"Q",0,eb,"R",0,eT,"S",0,".","T",0,p,"U",0,H,"V",0,ea,"W",0,eA,"X",0,i,"Y",0,k,"Z",0,r,"_",0,a,"a",0,E,"a0",0,$,"b",0,P,"c",0,T,"d",0,N,"e",0,e_,"f",0,u,"g",0,ey,"h",0,J,"i",0,V,"m",0,x,"q",0,eu,"r",0,eR,"s",0,U,"t",0,h,"z",0,d],15886);let eq=new WeakMap;function eN(e){return{config:e,start:(t,n)=>{let{self:s,system:r,emit:i}=n,o={receivers:void 0,dispose:void 0};eq.set(s,o),o.dispose=e({input:t.input,system:r,self:s,sendBack:e=>{"stopped"!==s.getSnapshot().status&&s._parent&&r._relay(s,s._parent,e)},receive:e=>{o.receivers??=new Set,o.receivers.add(e)},emit:i})},transition:(e,t,n)=>{let s=eq.get(n.self);return t.type===i?(e={...e,status:"stopped",error:void 0},eq.delete(n.self),s.receivers?.clear(),s.dispose?.()):s.receivers?.forEach(e=>e(t)),e},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,input:t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}let eC="xstate.observable.error",eD="xstate.observable.complete";function eU(e){return{config:e,transition:(e,t)=>{if("active"!==e.status)return e;switch(t.type){case eC:return{...e,status:"error",error:t.data,input:void 0,_subscription:void 0};case eD:return{...e,status:"done",input:void 0,_subscription:void 0};case i: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:n,system:s,emit:r})=>{"done"!==t.status&&(t._subscription=e({input:t.input,system:s,self:n,emit:r}).subscribe({next:e=>{n._parent&&s._relay(n,n._parent,e)},error:e=>{s._relay(n,n,{type:eC,data:e})},complete:()=>{s._relay(n,n,{type:eD})}}))},getPersistedSnapshot:({_subscription:e,...t})=>t,restoreSnapshot:e=>({...e,_subscription:void 0})}}let eL="xstate.promise.resolve",eB="xstate.promise.reject",eV=new WeakMap,eW=(eQ=void 0,{config:eY=e=>void 0,transition:(e,t,n)=>({...e,context:eY(e.context)}),getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof eQ?eQ({input:t}):eQ}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e});function eJ(){return T(eW)}e.s(["createEmptyActor",0,eJ,"fromCallback",0,eN,"fromEventObservable",0,eU,"fromPromise",0,function(e){return{config:e,transition:(e,t,n)=>{if("active"!==e.status)return e;switch(t.type){case eL:{let n=t.data;return{...e,status:"done",output:n,input:void 0}}case eB:return{...e,status:"error",error:t.data,input:void 0};case i:return eV.get(n.self)?.abort(),eV.delete(n.self),{...e,status:"stopped",input:void 0};default:return e}},start:(t,{self:n,system:s,emit:r})=>{if("active"!==t.status)return;let i=new AbortController;eV.set(n,i),Promise.resolve(e({input:t.input,system:s,self:n,signal:i.signal,emit:r})).then(e=>
2{"active"===n.getSnapshot().status&&(eV.delete(n),s._relay(n,n,{type:eL,data:e}))},e=>{"active"===n.getSnapshot().status&&(eV.delete(n),s._relay(n,n,{type:eB,data:e}))})},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,input:t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}],98859);let ez=eJ(),eF=ez,eK=new Set;function eG(e){return e===ez}e.s(["a",0,function(e){for(let t of(eF=e,eK))t()},"i",0,eK,"n",0,ez,"r",0,eG,"t",()=>eF],63826);var eH,eY,eQ,eX,eZ=e.i(2789),e0=e.i(60830),e1=e.i(78524);function e2(e){return e.split(/[[.\]]/g).filter(Boolean).map(e=>{var t;return e.includes("==")?function(e){let[t,n]=e.split("==");if("_key"!==t)throw Error(`Currently only "_key" is supported as path segment. Found ${t}`);if(typeof n>"u")throw Error('Invalid path segment, expected `key=="value"`');return{_key:n.replace(/^['"]/,"").replace(/['"]$/,"")}}(e):e6.test(t=e)?Number(t):t})}let e6=/^-?\d+$/;function e8(e){return"string"==typeof e?._key}function e9(e){return"object"==typeof e&&"_key"in e&&"string"==typeof e._key}let e3=/^[a-z_$]+/;function e7(e){return e.map((e,t)=>{var n;return n=0===t,Array.isArray(e)?`[${e[0]}:${e[1]||""}]`:"number"==typeof e?`[${e}]`:e9(e)?`[_key==${JSON.stringify(e._key)}]`:"string"==typeof e&&e3.test(e)?n?e:`.${e}`:`['${e}']`}).join("")}function e5(e){return Array.isArray(e)?e:[e]}function e4(e){if("createIfNotExists"in e)return{type:"createIfNotExists",document:e.createIfNotExists};if("createOrReplace"in e)return{type:"createOrReplace",document:e.createOrReplace};if("create"in e)return{type:"create",document:e.create};if("delete"in e)return{id:e.delete.id,type:"delete"};if("patch"in e){var t,n,s,r,i,o,a;return{type:"patch",id:e.patch.id,patches:[..."set"in(n=t=e.patch)?Object.keys(n.set).map(e=>({path:e2(e),op:{type:"set",value:n.set[e]}})):[],..."setIfMissing"in(s=t)?Object.keys(s.setIfMissing).map(e=>({path:e2(e),op:{type:"setIfMissing",value:s.setIfMissing[e]}})):[],..."unset"in(r=t)?r.unset.map(e=>({path:e2(e),op:{type:"unset"}})):[],..."inc"in(i=t)?Object.keys(i.inc).map(e=>({path:e2(e),op:{type:"inc",amount:i.inc[e]}})):[],..."inc"in(o=t)?Object.keys(o.dec).map(e=>({path:e2(e),op:{type:"dec",amount:o.dec[e]}})):[],...function(e){if(!("insert"in e))return[];let t=function(e){let t=te.filter(t=>t in e);if(t.length>1)throw Error(`Insert patch is ambiguous. Should only contain one of: ${te.join(", ")}, instead found ${t.join(", ")}`);return t[0]}(e.insert);if(!t)throw Error("Insert patch missing position");let n=e2(e.insert[t]),s=n.pop();return[{path:n,op:{type:"insert",position:t,referenceItem:s,items:e.insert.items}}]}(t),..."diffMatchPatch"in(a=t)?Object.keys(a.diffMatchPatch).map(e=>({path:e2(e),op:{type:"diffMatchPatch",value:a.diffMatchPatch[e]}})):[]]}}throw Error(`Unknown mutation: ${JSON.stringify(e)}`)}e.s(["isArrayElement",0,function(e){return"number"==typeof e||e9(e)},"isKeyedElement",0,e9,"isPropertyElement",0,function(e){return"string"==typeof e},"startsWith",0,function(e,t){return e.length<=t.length&&e.every((e,n)=>{var s,r;return s=e,r=function(e,t){if(t<0||t>=e.length)throw Error("Index out of bounds");return e[t]}(t,n),e8(s)&&e8(r)?s._key===r._key:"number"==typeof s?Number(s)===Number(r):s===r})},"stringify",0,e7],76955);let te=["before","replace","after"];function tt(e){return tr(e)}function tn(e){return e.flatMap(tt)}function ts(e){return{transactionId:e.id,mutations:tn(e.mutations)}}function tr(e){switch(e.type){case"create":case"createIfNotExists":case"createOrReplace":return{[e.type]:e.document};case"delete":return{delete:{id:e.id}};case"patch":{let t=e.options?.ifRevision;return e.patches.map(n=>({patch:{id:e.id,...t&&{ifRevisionID:t},...ti(n)}}))}}}function ti(e){let{path:t,op:n}=e;if("unset"===n.type)return{unset:[e7(t)]};if("insert"===n.type)return{insert:{[n.position]:e7([...t,n.referenceItem]),items:n.items}};if("diffMatchPatch"===n.type)return{diffMatchPatch:{[e7(t)]:n.value}};if("inc"===n.type)return{inc:{[e7(t)]:n.amount}};if("dec"===n.type)return{dec:{[e7(t)]:n.amount}};if("set"===n.type||"setIfMissing"===n.type)return{[n.type]:{[e7(t)]:n.value}};if("truncate"===n.type){let e=[n.startIndex,"number"==typeof n.endIndex?n.endIndex:""].join(":");return{unset:[`${e7(t)}[${e}]`]}}if("upsert"===n.type)return{unset:n.items.map(e=>
2e7([...t,{_key:e._key}])),insert:{[n.position]:e7([...t,n.referenceItem]),items:n.items}};if("assign"===n.type)return{set:Object.fromEntries(Object.keys(n.value).map(e=>[e7(t.concat(e)),n.value[e]]))};if("unassign"===n.type)return{unset:n.keys.map(e=>e7(t.concat(e)))};if("replace"===n.type)return{insert:{replace:e7(t.concat(n.referenceItem)),items:n.items}};if("remove"===n.type)return{unset:[e7(t.concat(n.referenceItem))]};throw"insertIfMissing"===n.type?Error("Patch type insertIfMissing is not supported by Sanity"):Error(`Unknown operation type ${n.type}`)}e.s(["encode",0,tt,"encodeAll",0,tn,"encodeMutation",0,tr,"encodePatch",0,ti,"encodeTransaction",0,ts],98299),e.s(["isObject",0,function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}],94276);function to(e,t,n){return{type:"patch",id:e,patches:e5(t),...n?{options:n}:{}}}function ta(e,t){return{path:"string"==typeof e?e2(e):e,op:t}}function tu(e){return{type:"createIfNotExists",document:e}}function tc(e,t,n){return{type:"insert",referenceItem:n,position:t,items:e5(e)}}function tl(e,t){return{type:"truncate",startIndex:e,endIndex:t}}var tp=Object.freeze({__proto__:null,decode:function(e){return e4(e)},decodeAll:function(e){return e.map(e4)},encode:tt,encodeAll:tn,encodeMutation:tr,encodePatch:ti,encodeTransaction:ts});e.s(["SanityEncoder",0,tp,"at",0,ta,"createIfNotExists",0,tu,"insert",0,tc,"patch",0,to,"remove",0,function(e){return{type:"remove",referenceItem:e}},"truncate",0,tl],92826);let tf=new Uint8Array(16),td=[];for(let e=0;e<256;++e)td.push((e+256).toString(16).slice(1));let th=function(e,t,n){return t||e||!crypto.randomUUID?function(e,t,n){let s=(e=e||{}).random??e.rng?.()??crypto.getRandomValues(tf);if(s.length<16)throw Error("Random bytes length must be >= 16");if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){if((n=n||0)<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=s[e];return t}return function(e,t=0){return(td[e[t+0]]+td[e[t+1]]+td[e[t+2]]+td[e[t+3]]+"-"+td[e[t+4]]+td[e[t+5]]+"-"+td[e[t+6]]+td[e[t+7]]+"-"+td[e[t+8]]+td[e[t+9]]+"-"+td[e[t+10]]+td[e[t+11]]+td[e[t+12]]+td[e[t+13]]+td[e[t+14]]+td[e[t+15]]).toLowerCase()}(s)}(e,t,n):crypto.randomUUID()};function ty(e,t,n,s,{assignment:r}){if(!t.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let i={},o={context:t.context,event:n.event,spawn:function(e,{machine:t,context:n},s,r){return(i,o)=>{let a=((i,o)=>{if("string"!=typeof i)return T(i,{id:o?.id,parent:e.self,syncSnapshot:o?.syncSnapshot,input:o?.input,src:i,systemId:o?.systemId});{let a=k(t,i);if(!a)throw Error(`Actor logic '${i}' not implemented in machine '${t.id}'`);let u=T(a,{id:o?.id,parent:e.self,syncSnapshot:o?.syncSnapshot,input:"function"==typeof o?.input?o.input({context:n,event:s,self:e.self}):o?.input,src:i,systemId:o?.systemId});return r[u.id]=u,u}})(i,o);return r[a.id]=a,e.defer(()=>{a._processingStatus!==$.Stopped&&a.start()}),a}}(e,t,n.event,i),self:e.self,system:e.system},a={};if("function"==typeof r)a=r(o,s);else for(let e of Object.keys(r)){let t=r[e];a[e]="function"==typeof t?t(o,s):t}let u=Object.assign({},t.context,a);return[eT(t,{context:u,children:Object.keys(i).length?{...t.children,...i}:t.children}),void 0,void 0]}function tg(e){function t(e,t){}return t.type="xstate.assign",t.assignment=e,t.resolve=ty,t}let tm=new WeakMap;function tv(e,t,n){let s=tm.get(e);return s?t in s||(s[t]=n()):(s={[t]:n()},tm.set(e,s)),s[t]}let tb={},t_=e=>"string"==typeof e?{type:e}:"function"==typeof e?"resolve"in e?{type:e.type}:{type:e.name}:e;class tk{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?d(this.config.states,(e,t)=>new tk(e,{_parent:this,_key:t,_machine:this.machine})):tb,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for c
2ompound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=!0===this.config.history?"shallow":this.config.history||!1,this.entry=h(this.config.entry).slice(),this.exit=h(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=h(e.tags).slice()}_initialize(){this.transitions=Z(this),this.config.always&&(this.always=m(this.config.always).map(e=>X(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.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(t_),eventType:null,reenter:!1,meta:this.initial.meta,description:this.initial.description,toJSON:()=>({target:this.initial.target.map(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map(t_),eventType:null,meta:this.initial.meta,description:this.initial.description})}:void 0,history:this.history,states:d(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.actions.map(t_)})),entry:this.entry.map(t_),exit:this.exit.map(t_),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 tv(this,"invoke",()=>h(this.config.invoke).map((e,t)=>{let{src:n,systemId:s}=e,r=e.id??_(this.id,t),i="string"==typeof n?n:`xstate.invoke.${_(this.id,t)}`;return{...e,src:i,id:r,systemId:s,toJSON(){let{onDone:t,onError:n,...s}=e;return{...s,type:"xstate.invoke",src:i,id:r}}}}))}get on(){return tv(this,"on",()=>[...this.transitions].flatMap(([e,t])=>t.map(t=>[e,t])).reduce((e,[t,n])=>(e[t]=e[t]||[],e[t].push(n),e),{}))}get after(){return tv(this,"delayedTransitions",()=>Q(this))}get initial(){return tv(this,"initial",()=>et(this,this.config.initial))}next(e,t){let n,s=t.type,r=[];for(let i of tv(this,`candidates-${s}`,()=>Y(this,s))){let{guard:o}=i,a=e.context,u=!1;try{u=!o||B(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 '${s}' in state node '${this.id}':
3${t.message}`)}if(u){r.push(...i.actions),n=i;break}}return n?[n]:void 0}get events(){return tv(this,"events",()=>{let{states:e}=this,t=new Set(this.ownEvents);if(e)for(let n of Object.keys(e)){let s=e[n];if(s.states)for(let e of s.events)t.add(`${e}`)}return Array.from(t)})}get ownEvents(){return Array.from(new Set(Object.keys(Object.fromEntries(this.transitions)).filter(e=>this.transitions.get(e).some(e=>!(!e.target&&!e.actions.length&&!e.reenter)))))}}class tx{constructor(e,t){this.config=e,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.options=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=e.id||"(machine)",this.implementations={actors:t?.actors??{},actions:t?.actions??{},delays:t?.delays??{},guards:t?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.options={maxIterations:1/0,...this.config.options},this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new tk(e,{_key:this.id,_machine:this}),this.root._initialize(),ee(this.root),this.states=this.root.states,this.events=this.root.events}provide(e){let{actions:t,guards:n,actors:s,delays:r}=this.implementations;return new tx(this.config,{actions:{...t,...e.actions},guards:{...n,...e.guards},actors:{...s,...e.actors},delays:{...r,...e.delays}})}resolveState(e){let t=eS(this.root,e.value),n=z(eu(this.root,t));return ej({_nodes:[...n],context:e.context||{},children:{},status:G(n,this.root)?"done":e.status||"active",output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,t,n){return e_(e,t,n,[]).snapshot}microstep(e,t,n){return e_(e,t,n,[]).microsteps.map(([e])=>e)}getTransitionData(e,t){return ec(this.root,e.value,e,t)||[]}_getPreInitialState(e,t,n){let{context:s}=this.config,r=ej({context:"function"!=typeof s&&s?s:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof s?eb(r,t,e,[tg(({spawn:e,event:t,self:n})=>s({spawn:e,input:t.input,self:n}))],n,void 0):r}getInitialSnapshot(e,t){let n=u(t),s=[],r=ej({context:"function"!=typeof this.config.context&&this.config.context?this.config.context:{},_nodes:[this.root],children:{},status:"active"},this);try{r=this._getPreInitialState(e,n,s);let[t]=ey(this.root,r,e,n,s),{snapshot:i}=e_(t,n,e,s);return i}catch(e){return eT(r,{status:"error",error:e})}}
3start(e){Object.values(e.children).forEach(e=>{"active"===e.getSnapshot().status&&e.start()})}getStateNodeById(e){let t=p(e),n=t.slice(1),s=H(t[0])?t[0].slice(1):t[0],r=this.idMap.get(s);if(!r)throw Error(`Child state node '#${s}' does not exist on machine '${this.id}'`);return ea(r,n)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,t){return eA(e,t)}restoreSnapshot(e,t){let n={},s=e.children;Object.keys(s).forEach(e=>{let r=s[e],i=r.snapshot,o=r.src,a="string"==typeof o?k(this,o):o;if(!a)return;let u=T(a,{id:e,parent:t.self,syncSnapshot:r.syncSnapshot,snapshot:i,src:o,systemId:r.systemId});n[e]=u});let r=function(e,t){if(!t||"object"!=typeof t)return{};let n={};for(let s in t)for(let r of t[s]){let t=function(e,t){if(t instanceof tk)return t;try{return e.machine.getStateNodeById(t.id)}catch{}}(e,r);t&&(n[s]??=[],n[s].push(t))}return n}(this.root,e.historyValue),i=ej({...e,children:n,_nodes:Array.from(z(eu(this.root,e.value))),historyValue:r},this),o=new Set;return!function e(t,n){if(!o.has(t))for(let s in o.add(t),t){let r=t[s];if(r&&"object"==typeof r){if("xstate$$type"in r&&1===r.xstate$$type){t[s]=n[r.id];continue}e(r,n)}}}(i.context,n),i}}function tS(e,t,n,s,{event:r}){return[t,{event:"function"==typeof r?r(n,s):r},void 0]}function tw(e,{event:t}){e.defer(()=>e.emit(t))}function tE(e){function t(e,t){}return t.type="xstate.emit",t.event=e,t.resolve=tS,t.execute=tw,t}let tI=((eX={}).Parent="#_parent",eX.Internal="#_internal",eX);function t$(e,t,n,s,{to:r,event:i,id:o,delay:a},u){let c,l,p=t.machine.implementations.delays;if("string"==typeof i)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);let f="function"==typeof i?i(n,s):i;if("string"==typeof a){let e=p&&p[a];c="function"==typeof e?e(n,s):e}else c="function"==typeof a?a(n,s):a;let d="function"==typeof r?r(n,s):r;if("string"==typeof d){if(!(l=d===tI.Parent?e.self._parent:d===tI.Internal?e.self:d.startsWith("#_")?t.children[d.slice(2)]:u.deferredActorIds?.includes(d)?d:t.children[d]))throw Error(`Unable to send event to actor '${d}' from machine '${t.machine.id}'.`)}else l=d||e.self;return[t,{to:l,targetId:"string"==typeof d?d:void 0,event:f,id:o,delay:c},void 0]}function tO(e,t,n){"string"==typeof n.to&&(n.to=t.children[n.to])}function tj(e,t){e.defer(()=>{let{to:n,event:s,delay:i,id:o}=t;"number"==typeof i?e.system.scheduler.schedule(e.self,n,s,i,o):e.system._relay(e.self,n,s.type===r?a(e.self.id,s.data):s)})}function tT(e,t,n){function s(e,t){}return s.type="xstate.sendTo",s.to=e,s.event=t,s.id=n?.id,s.delay=n?.delay,s.resolve=t$,s.retryResolve=tO,s.execute=tj,s}function tA(e,t){return tT(tI.Parent,e,t)}function tM(e,t,n,s,{collect:r}){let i=[],o=function(e){i.push(e)};return o.assign=(...e)=>{i.push(tg(...e))},o.cancel=(...e)=>{i.push(P(...e))},o.raise=(...e)=>{i.push(eR(...e))},o.sendTo=(...e)=>{i.push(tT(...e))},o.sendParent=(...e)=>{i.push(tA(...e))},o.spawnChild=(...e)=>{i.push(N(...e))},o.stopChild=(...e)=>{i.push(U(...e))},o.emit=(...e)=>{i.push(tE(...e))},r({context:n.context,event:n.event,enqueue:o,check:e=>B(e,t.context,n.event,t),self:e.self,system:e.system},s),[t,void 0,i]}function tP(e){function t(e,t){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=tM,t}function tR(e,t,n,s,{value:r,label:i}){return[t,{value:"function"==typeof r?r(n,s):r,label:i},void 0]}function tq({logger:e},{value:t,label:n}){n?e(n,t):e(t)}function tN(e=({context:e,event:t})=>({context:e,event:t}),t){function n(e,t){}return n.type="xstate.log",n.value=e,n.label=t,n.resolve=tR,n.execute=tq,n}function tC(e,t){let n=h(t);if(!n.some(t=>x(e.type,t))){let t=1===n.length?`type matching "${n[0]}"`:`one of types matching "${n.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(e)} to have ${t}`)}}function tD({schemas:e,actors:t,actions:n,guards:s,delays:r}){return{assign:tg,sendTo:tT,raise:eR,log:tN,cancel:P,stopChild:U,enqueueActions:tP,emit:tE,spawnChild:N,createStateConfig:e=>e,createAction:e=>e,createMachine:i=>new tx({...i,schemas:e},{actors:t,actions:n,guards:s,delays:r}),extend:i=>tD({schemas:e,actors:t,actions:{...n,...i.actions},guards:{...s,...i.guards},delays:{...r,...i.delays}})}}e.s(["a",0,tE,"b",0,tA,"e",0,tP,"l",0,tN,"s",0,tT],74304),e.s(["assertEvent",0,tC,"setup",0,tD],38876),e.s(["assign",0,tg],2906),e.s(["createActor",0,T],13200),e.s(["emit",0,tE],52122),e.s(["enqueueActions",0,tP],88764),e.s(["raise",0,eR],33747),e.s(["stopChild",0,U],87295);var tU=e.i(82100),tL=e.i(24627),tB=e.i(66312),tV=e.i(7560),tW=e.i(7844),tJ=e.i(62940),tz=e.i(59862),tF=e.i(80205),tK=e.i(33482),tG=e.i(16165),tH=e.i(6298),tY=e.i(2435),tQ=e.i(27540),tX=e.i(91607),tZ=["addListener","removeListener"],t0=["addEventListener","removeEventListener"],t1=["on","off"];function t2(e,t,n,s){if((0,tQ.isFunction)(n)&&(s=n,n=void 0),s)return t2(e,t,n).pipe((0,tX.mapOneOrManyArgs)(s));var r,i,o,a=(0,tL.__read)((r=e,(0,tQ.isFunction)(r.addEventListener)&&(0,tQ.isFunction)(r.removeEventListener))?t0.map(function(s){return function(r){return e[s](t,r,n)}}):(i=e,(0,tQ.isFunction)(i.addListener)&&(0,tQ.isFunction)(i.removeListener))?tZ.map(t6(e,t)):(o=e,(0,tQ.isFunction)(o.on)&&(0,tQ.isFunction)(o.off))?t1.map(t6(e,t)):[],2),u=a[0],c=a[1];
3if(!u&&(0,tY.isArrayLike)(e))return(0,tH.mergeMap)(function(e){return t2(e,t,n)})((0,tK.innerFrom)(e));if(!u)throw TypeError("Invalid event target");return new tG.Observable(function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return u(t),function(){return c(t)}})}function t6(e,t){return function(n){return function(s){return e[n](t,s)}}}var t8=e.i(13186),t9=e.i(13072);function t3(e){return e<=0?function(){return tU.EMPTY}:(0,tB.operate)(function(t,n){var s=0;t.subscribe((0,tV.createOperatorSubscriber)(n,function(t){++s<=e&&(n.next(t),e<=s&&n.complete())}))})}var t7=e.i(50363);let t5=e=>({context:t})=>{let{count:n,include:s,exclude:r,responseType:i="message.received"}=e;return{count:n,domain:t.domain,from:t.connectTo,include:s?Array.isArray(s)?s:[s]:[],exclude:r?Array.isArray(r)?r:[r]:[],responseType:i,target:t.target,to:t.name}},t4=(0,tz.defer)(()=>t2(window,"message")),ne=e=>eU(({input:t})=>{var n,s;let r;return t4.pipe(e?(0,t8.map)(e):(0,t9.pipe)(),(0,tF.filter)(e=>{let{data:n}=e;return(!t.include.length||t.include.includes(n.type))&&(!t.exclude.length||!t.exclude.includes(n.type))&&n.domain===t.domain&&n.from===t.from&&n.to===t.to&&(!t.target||e.source===t.target)}),(0,t8.map)((r=t.responseType,e=>({type:r,message:e}))),t.count?(0,t9.pipe)((n=t.count,void 0===s&&(s=null),s=null!=s?s:n,(0,tB.operate)(function(e,t){var r=[],i=0;e.subscribe((0,tV.createOperatorSubscriber)(t,function(e){var o,a,u,c,l=null;i++%s==0&&r.push([]);try{for(var p=(0,tL.__values)(r),f=p.next();!f.done;f=p.next()){var d=f.value;d.push(e),n<=d.length&&(l=null!=l?l:[]).push(d)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}if(l)try{for(var h=(0,tL.__values)(l),y=h.next();!y.done;y=h.next()){var d=y.value;(0,tW.arrRemove)(r,d),t.next(d)}}catch(e){u={error:e}}finally{try{y&&!y.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}},function(){var e,n;try{for(var s=(0,tL.__values)(r),i=s.next();!i.done;i=s.next()){var o=i.value;t.next(o)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}t.complete()},void 0,function(){r=null}))})),(0,tJ.concatMap)(e=>e),t3(t.count)):(0,t9.pipe)())}),nt="sanity/comlink",nn="comlink/response",ns="comlink/heartbeat",nr="comlink/disconnect",ni="comlink/handshake/syn",no="comlink/handshake/syn-ack",na="comlink/handshake/ack",nu=()=>tD({types:{},actors:{listen:eU(({input:e})=>{let t,n=e.signal?t2(e.signal,"abort").pipe((t=`Request ${e.requestId} aborted`,e=>e.pipe(t3(1),(0,t8.map)(()=>{throw Error(t)})))):tU.EMPTY;return t2(window,"message").pipe((0,tF.filter)(t=>t.data?.type==="comlink/response"&&t.data?.responseTo===e.requestId&&!!t.source&&e.sources.has(t.source)),t3(e.sources.size),(0,tB.operate)(function(e,t){(0,tK.innerFrom)(n).subscribe((0,tV.createOperatorSubscriber)(t,function(){return t.complete()},t7.noop)),t.closed||e.subscribe(t)}))})},actions:{"send message":({context:e},t)=>{let{sources:n,targetOrigin:s}=e,{message:r}=t;
3n.forEach(e=>{e.postMessage(r,{targetOrigin:s})})},"on success":tT(({context:e})=>e.parentRef,({context:e,self:t})=>(e.response&&e.resolvable?.resolve(e.response),{type:"request.success",requestId:t.id,response:e.response,responseTo:e.responseTo})),"on fail":tT(({context:e})=>e.parentRef,({context:e,self:t})=>(e.suppressWarnings||console.warn(`[@sanity/comlink] Received no response to message '${e.type}' on client '${e.from}' (ID: '${e.id}').`),e.resolvable?.reject(Error("No response received")),{type:"request.failed",requestId:t.id})),"on abort":tT(({context:e})=>e.parentRef,({context:e,self:t})=>(e.resolvable?.reject(Error("Request aborted")),{type:"request.aborted",requestId:t.id}))},guards:{expectsResponse:({context:e})=>e.expectResponse},delays:{initialTimeout:0,responseTimeout:({context:e})=>e.responseTimeout??3e3}}).createMachine({context:({input:e})=>({channelId:e.channelId,data:e.data,domain:e.domain,expectResponse:e.expectResponse??!1,from:e.from,id:`msg-${th()}`,parentRef:e.parentRef,resolvable:e.resolvable,response:null,responseTimeout:e.responseTimeout,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{channelId:t,data:n,domain:s,from:r,id:i,responseTo:o,to:a,type:u}=e;return{message:{channelId:t,data:n,domain:s,from:r,id:i,to:a,type:u,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:tg({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})});eN(({sendBack:e,input:t})=>{let n=()=>{e(t.event)};t.immediate&&n();let s=setInterval(n,t.interval);return()=>{clearInterval(s)}});let nc=()=>tD({types:{},actors:{requestMachine:nu(),listen:ne()},actions:{"buffer handshake":tg({handshakeBuffer:({event:e,context:t})=>(tC(e,"message.received"),[...t.handshakeBuffer,e])}),"buffer message":tP(({enqueue:e})=>{e.assign({buffer:({event:e,context:t})=>(tC(e,"post"),[...t.buffer,{data:e.data,resolvable:e.resolvable,options:e.options}])}),e.emit(({event:e})=>(tC(e,"post"),{type:"buffer.added",message:e.data}))}),"create request":tg({requests:({context:e,event:t,self:n,spawn:s})=>{tC(t,"request");let r=(Array.isArray(t.data)?t.data:[t.data]).map(t=>s("requestMachine",{id:`req-${th()}`,input:{channelId:e.channelId,data:t.data,domain:e.domain,expectResponse:t.expectResponse,from:e.name,parentRef:n,resolvable:t.resolvable,responseTimeout:t.options?.responseTimeout,responseTo:t.responseTo,signal:t.options?.signal,sources:e.target,suppressWarnings:t.options?.suppressWarnings,targetOrigin:e.targetOrigin,to:e.connectTo,type:t.type}}));return[...e.requests,...r]}}),"emit heartbeat":tE(()=>({type:"heartbeat"})),"emit received message":tP(({enqueue:e})=>{e.emit(({event:e})=>(tC(e,"message.received"),{type:"message",message:e.message.data}))}),"emit status":tE((e,t)=>({type:"status",status:t.status})),"post message":eR(({event:e})=>(tC(e,"post"),{type:"request",data:{data:e.data.data,expectResponse:!!e.resolvable,type:e.data.type,resolvable:e.resolvable,options:e.options}})),"process pending handshakes":tP(({context:e,enqueue:t})=>{e.handshakeBuffer.forEach(e=>t.raise(e)),t.assign({handshakeBuffer:[]})}),"remove request":tP(({context:e,enqueue:t,event:n})=>{tC(n,["request.success","request.failed","request.aborted"]),U(n.requestId),t.assign({requests:e.requests.filter(({id:e})=>e!==n.requestId)})}),"send response":eR(({event:e})=>(tC(e,["message.received","heartbeat.received"]),{type:"request",data:{type:nn,responseTo:e.message.data.id,data:void 0}})),"send handshake syn ack":eR({type:"request",data:{type:no}}),"send pending messages":tP(({enqueue:e})=>{e.raise(({context:e})=>({type:"request",data:e.buffer.map(({data:e,resolvable:t,options:n})=>({data:e.data,type:e.type,expectResponse:!!t,resolvable:t,options:n}))})),e.emit(({context:e})=>({type:"buffer.flushed",messages:e.buffer.map(({data:e})=>e)}
3)),e.assign({buffer:[]})}),"set connection config":tg({channelId:({event:e})=>(tC(e,"handshake.syn"),e.message.data.channelId),target:({event:e})=>(tC(e,"handshake.syn"),e.message.source||void 0),targetOrigin:({event:e})=>(tC(e,"handshake.syn"),e.message.origin)})},guards:{hasSource:({context:e})=>null!==e.target}}).createMachine({id:"node",context:({input:e})=>({buffer:[],channelId:null,connectTo:e.connectTo,domain:e.domain??"sanity/comlink",handshakeBuffer:[],name:e.name,requests:[],target:void 0,targetOrigin:null}),invoke:{id:"listen for handshake syn",src:"listen",input:t5({include:ni,responseType:"handshake.syn"})},on:{"request.success":{actions:"remove request"},"request.failed":{actions:"remove request"},"request.aborted":{actions:"remove request"},"handshake.syn":{actions:"set connection config",target:".handshaking"}},initial:"idle",states:{idle:{entry:[{type:"emit status",params:{status:"idle"}}],on:{post:{actions:"buffer message"}}},handshaking:{guard:"hasSource",entry:["send handshake syn ack",{type:"emit status",params:{status:"handshaking"}}],invoke:[{id:"listen for handshake ack",src:"listen",input:t5({include:na,count:1,responseType:"handshake.complete"}),onDone:"connected"},{id:"listen for disconnect",src:"listen",input:t5({include:nr,count:1,responseType:"disconnect"})},{id:"listen for messages",src:"listen",input:t5({exclude:[nr,ni,na,ns,nn]})}],on:{request:{actions:"create request"},post:{actions:"buffer message"},"message.received":{actions:"buffer handshake"},disconnect:{target:"idle"}}},connected:{entry:["process pending handshakes","send pending messages",{type:"emit status",params:{status:"connected"}}],invoke:[{id:"listen for messages",src:"listen",input:t5({exclude:[nr,ni,na,ns,nn]})},{id:"listen for heartbeat",src:"listen",input:t5({include:ns,responseType:"heartbeat.received"})},{id:"listen for disconnect",src:"listen",input:t5({include:nr,count:1,responseType:"disconnect"})}],on:{request:{actions:"create request"},post:{actions:"post message"},disconnect:{target:"idle"},"message.received":{actions:["send response","emit received message"]},"heartbeat.received":{actions:["send response","emit heartbeat"]}}}}});e.s(["DOMAIN",0,nt,"MSG_DISCONNECT",0,nr,"MSG_HANDSHAKE_ACK",0,na,"MSG_HANDSHAKE_SYN",0,ni,"MSG_HANDSHAKE_SYN_ACK",0,no,"MSG_HEARTBEAT",0,ns,"MSG_RESPONSE",0,nn,"createListenLogic",0,ne,"createNode",0,(e,t=nc())=>{let n=T(t,{input:e}),s=new Map,r=new Map,i;n.on("message",({message:e})=>{let t=s.get(e.type);if(t)return void t.forEach(t=>t(e.data));let n=r.get(e.type);n?n.add(e):r.set(e.type,new Set([e]))});let o=()=>{n.stop()};return{actor:n,fetch:(e,t,s)=>{let r,i,{responseTimeout:o=1e4,signal:a,suppressWarnings:u}=s||{},c="function"==typeof Promise.withResolvers?Promise.withResolvers():{promise:new Promise((e,t)=>{r=e,i=t}),resolve:r,reject:i};return n.send({type:"post",data:{type:e,data:t},resolvable:c,options:{responseTimeout:o,signal:a,suppressWarnings:u}}),c.promise},machine:t,on:(e,t,n)=>{let i=s.get(e)||new Set;s.has(e)||s.set(e,i),i.add(t);let o=r.get(e);if(o){let s=n?.replay??1;Array.from(o).slice(-s).forEach(({data:e})=>t(e)),r.delete(e)}return()=>{i.delete(t)}},onStatus:(e,t)=>{let s=n.on("status",n=>{i=n.status,t&&n.status!==t||e(n.status)});return i&&e(i),()=>s.unsubscribe()},post:(e,t)=>{n.send({type:"post",data:{type:e,data:t}})},start:()=>(n.start(),o),stop:o}},"createNodeMachine",0,nc,"createRequestMachine",0,nu],30975);let nl={"handshake/syn":ni,"handshake/syn-ack":no,"handshake/ack":na,"channel/response":nn,"channel/heartbeat":ns,"channel/disconnect":nr,"overlay/focus":"visual-editing/focus","overlay/navigate":"visual-editing/navigate","overlay/toggle":"visual-editing/toggle","presentation/toggleOverlay":"presentation/toggle-overlay"}
3,np={[ni]:"handshake/syn",[no]:"handshake/syn-ack",[na]:"handshake/ack",[nn]:"channel/response",[ns]:"channel/heartbeat",[nr]:"channel/disconnect","visual-editing/focus":"overlay/focus","visual-editing/navigate":"overlay/navigate","visual-editing/toggle":"overlay/toggle","presentation/toggle-overlay":"presentation/toggleOverlay"},nf=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=nt),"overlays"===t.to&&(t.to="visual-editing"),"overlays"===t.from&&(t.from="visual-editing"),t.channelId=t.connectionId,delete t.connectionId,t.type=nl[t.type]??t.type),e},nd=({context:e},t)=>{let{sources:n,targetOrigin:s}=e,r=(e=>{let{channelId:t,...n}=e,s={...n,connectionId:t};return s.domain===nt&&(s.domain="sanity/channels"),"visual-editing"===s.to&&(s.to="overlays"),"visual-editing"===s.from&&(s.from="overlays"),s.type=np[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})(t.message);n.forEach(e=>{e.postMessage(r,{targetOrigin:s})})};function nh(){return window.self!==window.top}function ny(){return!!window.opener}e.s(["createCompatibilityActors",0,()=>({listen:ne(nf),requestMachine:nu().provide({actions:{"send message":nd}})}),"isMaybePreviewIframe",0,nh,"isMaybePreviewWindow",0,ny],79426);let ng=/_key\s*==\s*['"](.*)['"]/,nm=/^\d*:\d*$/;function nv(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function nb(e){return"string"==typeof e?ng.test(e.trim()):"object"==typeof e&&"_key"in e}var n_=e.i(2904);let nk=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nx=/_key\s*==\s*['"](.*)['"]/;function nS(e,t,n){let s="string"==typeof t?function(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(nk);if(!t)throw Error("Invalid path string");return t.map(nw)}(t):t;if(!Array.isArray(s))throw Error("Path must be an array or a string");let r=e;for(let e=0;e<s.length;e++){let t=s[e];if(nv(t)){if(!Array.isArray(r))return n;r=r[t]}if(nb(t)){if(!Array.isArray(r))return n;r=r.find(e=>e._key===t._key)}if("string"==typeof t&&(r="object"==typeof r&&r?r[t]:void 0),void 0===r)return n}return r}function nw(e){return nv(e)?Number(e.replace(/[^\d]/g,"")):nb(e)?{_key:e.match(nx)[1]}:!function(e){if("string"==typeof e&&nm.test(e))return!0;if(!Array.isArray(e)||2!==e.length)return!1;let[t,n]=e;return("number"==typeof t||""===t)&&("number"==typeof n||""===n)}(e)?e:function(e){let[t,n]=e.split(":").map(e=>""===e?e:Number(e));return[t,n]}(e)}function nE(){return(0,n_.useSyncExternalStore)(nO,n$,nI)}function nI(){return ez}function n$(){return eF}function nO(e){return eK.add(e),()=>eK.delete(e)}function nj(e,t){let n;return(...s)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(e,s)},t)}}function nT(e,t){let n=nh(),s=ny();if(eG(t)||!n&&!s)throw Error("The `useDocuments` hook cannot be used in this context");let r=(0,e0.getDraftId)(e),i=(0,e0.getPublishedId)(e),o=t.getSnapshot().context?.documents,a=o?.[r],u=o?.[i],c=a||u;if(!c)throw Error(`Document "${e}" not found`);let l=a.getSnapshot().context?.local||u.getSnapshot().context?.local,p=new Promise(e=>{if(l)e(l);else{let t=c.on("ready",n=>{let{snapshot:s}=n;e(s||null),t.unsubscribe()})}});return{draftDoc:a,draftId:r,getSnapshot:()=>p,publishedDoc:u,publishedId:i,get snapshot(){if(!l)throw Error(`Snapshot for document "${e}" not found`);return l}}}function nA(e){let n=(()=>{if(t)return t;t=[];for(let e=0;e<256;++e)t[e]=(e+256).toString(16).slice(1);return t})();return(function(e=16){let t=new Uint8Array(e);return crypto.getRandomValues(t),t})(e).reduce((e,t)=>e+n[t],"").slice(0,e)}function nM(e){let t="string"==typeof e?e:e.path,n=t.lastIndexOf("."),s=t.substring(n+1,t.length);if(!s.indexOf("["))throw Error("Invalid path: not an array");let r=t.lastIndexOf("["),i=t.substring(0,r),o,a;if(s.includes("_key")){let e=s.indexOf('"')+1,t=s.indexOf('"',e);o=s.substring(e,t),a=!0}else{let e=s.indexOf("[")+1,t=s.indexOf("]",e);o=s.substring(e,t),a=!1}if(!i||!o)throw Error("Invalid path");return{path:i,key:o,hasExplicitKey:a}}async function nP(e,t,n){if(!e.type)throw Error("Node type is missing");let{path:s,key:r}=nM(e),i=await t.getSnapshot(),o=nS(i,s),a=nS(i,e.path),u=o.findIndex(e=>e._key===r),c=-1,l="before";if("first"===n){if(0===u)return[];c=0,l="before"}else if("last"===n){if(u===o.length-1)return[];c=-1,l="after"}else if("next"===n){if(u===o.length-1)return[];c=u,l="after"}else if("previous"===n){if(0===u)return[];c=u-1,l="before"}return[ta(s,tl(u,u+1)),ta(s,tc(a,l,c))]}e.s(["a",0,function(e,t){let{path:n,key:s}=nM(e),r=nS(t,n).findIndex(e=>e._key===s);return[ta(n,tl(r,r+1))]},"c",0,function(){let e=(0,eZ.c)(2),t=nE(),n;return e[0]===t?n=e[1]:(n=eG(t),e[0]=t,e[1]=n),!n},"i",0,nP,"l",0,nS,"n",0,function(e,t,n){let{path:s,key:r}=nM(e);return[ta(s,tc([{_type:t,_key:nA()}],n,{_key:r}))]},"o",0,function(){let e=(0,eZ.c)(7),t=nE(),n;e[0]===t?n=e[1]:(n=e=>({id:e,commit:()=>{let{draftDoc:n}=nT(e,t);n.send({type:"submit"})},get:n=>{let{snapshot:s}=nT(e,t);return n?nS(s,n):s},getSnapshot:function(e,t){let{getSnapshot:n}=nT(e,t);return n}(e,t),patch:async(n,s)=>{let r=nT(e,t),{draftDoc:i,draftId:o,getSnapshot:a,publishedId:u}=r,{commit:c=!0}=s||{},l=await ("function"==typeof n?n({draftId:o,publishedId:u,get snapshot(){return r.snapshot},getSnapshot:a}):n),p=await a();if(!p)throw Error(`Snapshot for document "${e}" not found`);i.send({type:"mutate",mutations:[tu({...p,_id:o}),to(o,l)]}),c&&("object"==typeof c&&"debounce"in c?nj(()=>i.send({type:"submit"}),c.debounce)():i.send({type:"submit"}))}}),e[0]=t,e[1]=n);let s=n,r;e[2]===t?r=e[3]:(r=(e,n,s)=>{let{draftDoc:r}=nT(e,t),{commit:i}=s||{},o=void 0===i||i;r.send({type:"mutate",mutations:n}),o&&("object"==typeof o&&"debounce"in o?nj(()=>r.send({type:"submit"}),o.debounce)():r.send({type:"submit"}))},e[2]=t,e[3]=r);let i=r,o;return e[4]!==s||e[5]!==i?(o={getDocument:s,mutateDocument:i},e[4]=s,e[5]=i,e[6]=o):o=e[6],o},"r",0,nM,"s",0,nE,"t",0,function(e,t,n="after"){let{path:s,key:r}=nM(e);return[ta(s,tc({...nS(t,e.path),_key:nA()},n,{_key:r}))]}],97728)},78524,(e,t,n)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}]);

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.