1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="58599529-1c88-4d9d-9cf3-c55d0e9154a6",e._sentryDebugIdIdentifier="sentry-dbid-58599529-1c88-4d9d-9cf3-c55d0e9154a6")}()}catch(e){}!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];if(null!=r)for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:frontend-applovin":!0})}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8059],{175:(e,t,r)=>{r.d(t,{w:()=>n});var n=new(r(72465)).c(function(e){return e.complete()})},623:(e,t,r)=>{r.d(t,{$:()=>k,B:()=>Q,C:()=>e_,D:()=>B,E:()=>eC,F:()=>X,G:()=>em,H:()=>function e(t,r,n,i){if("string"==typeof r){let e=eo(t,r).next(n,i);return e&&e.length?e:t.next(n,i)}if(1===Object.keys(r).length){let s=Object.keys(r),o=e(eo(t,s[0]),r[s[0]],n,i);return o&&o.length?o:t.next(n,i)}let s=[];for(let o of Object.keys(r)){let a=r[o];if(!a)continue;let c=e(eo(t,o),a,n,i);c&&s.push(...c)}return s.length?s:t.next(n,i)},I:()=>eg,J:()=>d,K:()=>ep,L:()=>es,M:()=>p,N:()=>s,O:()=>Y,P:()=>ea,Q:()=>ej,R:()=>S,S:()=>i,T:()=>a,U:()=>l,V:()=>j,W:()=>ek,X:()=>c,a:()=>q,b:()=>N,c:()=>M,g:()=>ec,l:()=>v,q:()=>ee,r:()=>eM,s:()=>L,t:()=>g,u:()=>w,v:()=>Z,w:()=>W,x:()=>E,y:()=>K,z:()=>et});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 i=".",s="",o="xstate.init",a="xstate.error",c="xstate.stop";function u(e,t){return{type:`xstate.done.state.${e}`,output:t}}function l(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function d(e){return{type:o,input:e}}function h(e){setTimeout(()=>{throw e})}let f="function"==typeof Symbol&&Symbol.observable||"@@observable";function p(e){if(b(e))return e;let t=[],r="";for(let n=0;n<e.length;n++){switch(e.charCodeAt(n)){case 92:r+=e[n+1],n++;continue;case 46:t.push(r),r="";
1continue}r+=e[n]}return t.push(r),t}function y(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={},r=t;for(let t=0;t<e.length-1;t++)if(t===e.length-2)r[e[t]]=e[t+1];else{let n=r;r={},n[e[t]]=r}return t}(p(e))}function v(e,t){let r={},n=Object.keys(e);for(let i=0;i<n.length;i++){let s=n[i];r[s]=t(e[s],s,e,i)}return r}function g(e){var t;return void 0===e?[]:b(t=e)?t:[t]}function m(e,t,r,n){return"function"==typeof e?e({context:t,event:r,self:n}):e}function b(e){return Array.isArray(e)}function w(e){var t;return(b(t=e)?t:[t]).map(e=>void 0===e||"string"==typeof e?{target:e}:e)}function _(e){if(void 0!==e&&""!==e)return g(e)}function x(e,t,r){let n="object"==typeof e,i=n?e:void 0;return{next:(n?e.next:e)?.bind(i),error:(n?e.error:t)?.bind(i),complete:(n?e.complete:r)?.bind(i)}}function E(e,t){return`${t}.${e}`}function S(e,t){let r=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!r)return e.implementations.actors[t];let[,n,i]=r,s=e.getStateNodeById(i).config.invoke;return(Array.isArray(s)?s[n]:s).src}function T(e,t){return`${e.sessionId}.${t}`}let I=0,C=!1,k=1,j=function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e}({}),O={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 n(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=j.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];let r={...O,...t},{clock:i,logger:s,parent:o,syncSnapshot:a,id:c,systemId:u,inspect:l}=r;this.system=o?o.system:function(e,t){let r=new Map,n=new Map,i=new WeakMap,s=new Set,o={},{clock:a,logger:c}=t,u={schedule:(e,t,r,n,i=Math.random().toString(36).slice(2))=>{let s={source:e,target:t,event:r,delay:n,id:i,startedAt:Date.now()},c=T(e,i);l._snapshot._scheduledEvents[c]=s;let u=a.setTimeout(()=>{delete o[c],delete l._snapshot._scheduledEvents[c],l._relay(e,t,r)},n);o[c]=u},cancel:(e,t)=>{let r=T(e,t),n=o[r];delete o[r],delete l._snapshot._scheduledEvents[r],void 0!==n&&a.clearTimeout(n)},cancelAll:e=>{for(let t in l._snapshot._scheduledEvents){let r=l._snapshot._scheduledEvents[t];r.source===e&&u.cancel(e,r.id)}}},l={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${I++}`,_register:(e,t)=>(r.set(e,t),e),_unregister:e=>{r.delete(e.sessionId);let t=i.get(e);void 0!==t&&(n.delete(t),i.delete(e))},get:e=>n.get(e),getAll:()=>Object.fromEntries(n.entries()),_set:(e,t)=>{let r=n.get(e);if(r&&r!==t)throw Error(`Actor with system ID '${e}' already exists.`);n.set(e,t),i.set(t,e)},inspect:e=>{let t=x(e);return s.add(t),{unsubscribe(){s.delete(t)}}},_sendInspectionEvent:t=>{if(!s.size)return;let r={...t,rootId:e.sessionId};s.forEach(e=>e.next?.(r))},_relay:(e,t,r)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:e,actorRef:t,event:r}),t._send(r)},scheduler:u,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{let e=l._snapshot._scheduledEvents;for(let t in l._snapshot._scheduledEvents={},e){let{source:r,target:n,event:i,delay:s,id:o}=e[t];u.schedule(r,n,i,s,o)}},_clock:a,_logger:c};return l}(this,{clock:i,logger:s}),l&&!o&&this.system.inspect(x(l)),this.sessionId=this.system._bookId(),this.id=c??this.sessionId,this.logger=t?.logger??this.system._logger,this.clock=t?.clock??this.system._clock,this._parent=o,this._syncSnapshot=a,this.options=r,this.src=r.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),r=this.eventListeners.get("*");if(t||r)for(let n of[...t?t.values():[],...r?r.values():[]])try{n(e)}catch(e){h(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=C;try{C=!0,e.exec(e.info,e.params)}finally{C=t}};this._processingStatus===j.Running?t():this._deferred.push(t)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),u&&(this.systemId=u,this.system._set(u,this)),this._initState(t?.snapshot??t?.state),u&&"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 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{t.next?.(e)}catch(e){h(e)}break;case"done":var n;for(let t of this.observers)try{t.next?.(e)}catch(e){h(e)}this._stopProcedure(),this._complete(),this._doneEvent=(n=this.id,{type:`xstate.done.actor.${n}`,output:this._snapshot.output,actorId:n}
1),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,r){let n=x(e,t,r);if(this._processingStatus!==j.Stopped)this.observers.add(n);else switch(this._snapshot.status){case"done":try{n.complete?.()}catch(e){h(e)}break;case"error":{let e=this._snapshot.error;if(n.error)try{n.error(e)}catch(e){h(e)}else h(e)}}return{unsubscribe:()=>{this.observers.delete(n)}}}on(e,t){let r=this.eventListeners.get(e);r||(r=new Set,this.eventListeners.set(e,r));let n=t.bind(void 0);return r.add(n),{unsubscribe:()=>{r.delete(n)}}}start(){if(this._processingStatus===j.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=j.Running;let e=d(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,r;try{t=this.logic.transition(this._snapshot,e,this._actorScope)}catch(e){r={err:e}}if(r){let{err:e}=r;this._snapshot={...this._snapshot,status:"error",error:e},this._error(e);return}this.update(t,e),e.type===c&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===j.Stopped||((this.mailbox.clear(),this._processingStatus===j.NotStarted)?this._processingStatus=j.Stopped:this.mailbox.enqueue({type:c})),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){h(e)}this.observers.clear()}_reportError(e){if(!this.observers.size){this._parent||h(e);return}let t=!1;for(let r of this.observers){let n=r.error;t||=!n;try{n?.(e)}catch(e){h(e)}}this.observers.clear(),t&&h(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,l(this.id,e))}_stopProcedure(){return this._processingStatus!==j.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new n(this._process.bind(this)),this._processingStatus=j.Stopped,this.system._unregister(this)),this}_send(e){this._processingStatus!==j.Stopped&&this.mailbox.enqueue(e)}send(e){this.system._relay(void 0,this,e)}attachDevTools(){let{devTools:e}=this.options;e&&("function"==typeof e?e:e=>{if("undefined"==typeof window)return;let t=function(){let e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:void 0;if(e.__xstate__)return e.__xstate__}();t&&t.register(e)})(this)}toJSON(){return{xstate$$type:k,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[f](){return this}getSnapshot(){return this._snapshot}}function M(e,...[t]){return new A(e,t)}function R(e,t,r,n,{sendId:i}){return[t,{sendId:"function"==typeof i?i(r,n):i},void 0]}function P(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId)})}function q(e){function t(e,t){}return t.type="xstate.cancel",t.sendId=e,t.resolve=R,t.execute=P,t}function D(e,t,r,n,{id:i,systemId:s,src:o,input:a,syncSnapshot:c}){let u,l,d="string"==typeof o?S(t.machine,o):o,h="function"==typeof i?i(r):i;return d&&(l="function"==typeof a?a({context:t.context,event:r.event,self:e.self}):a,u=M(d,{id:h,src:o,parent:e.self,syncSnapshot:c,systemId:s,input:l})),[ek(t,{children:{...t.children,[h]:u}}),{id:i,systemId:s,actorRef:u,src:o,input:l},void 0]}function $(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==j.Stopped&&t.start()})}function N(...[e,{id:t,systemId:r,input:n,syncSnapshot:i=!1}={}]){function s(e,t){}return s.type="xstate.spawnChild",s.id=t,s.systemId=r,s.src=e,s.input=n,s.syncSnapshot=i,s.resolve=D,s.execute=$,s}function F(e,t,r,n,{actorRef:i}){let s="function"==typeof i?i(r,n):i,o="string"==typeof s?t.children[s]:s,a=t.children;return o&&(a={...a},delete a[o.id]),[ek(t,{children:a}),o,void 0]}function U(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==j.Running)return void e.stopChild(t);e.defer(()=>{e.stopChild(t)})}}function L(e){function t(e,t){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=F,t.execute=U,t}function W(e,t,r,n){let{machine:i}=n,s="function"==typeof e,o=s?e:i.implementations.guards["string"==typeof e?e:e.type];if(!s&&!o)throw Error(`Guard '${"string"==typeof e?e:e.type}' is not implemented.'.`);if("function"!=typeof o)return W(o,t,r,n);let a={context:t,event:r},c=s||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:t,event:r}):e.params:void 0;return"check"in o?o.check(n,a,o):o(a,c)}let z=e=>"atomic"===e.type||"final"===e.type;function V(e){return Object.values(e.states).filter(e=>"history"!==e.type)}function H(e,t){let r=[];if(t===e)return r;let n=e.parent;for(;n&&n!==t;)r.push(n),n=n.parent;return r}function B(e){let t=new Set(e),r=J(t);for(let e of t)if("compound"!==e.type||r.get(e)&&r.get(e).length){if("parallel"===e.type){for(let r of V(e))if("history"!==r.type&&!t.has(r))for(let e of ei(r))t.add(e)}}
1else ei(e).forEach(e=>t.add(e));for(let e of t){let r=e.parent;for(;r;)t.add(r),r=r.parent}return t}function J(e){let t=new Map;for(let r of e)t.has(r)||t.set(r,[]),r.parent&&(t.has(r.parent)||t.set(r.parent,[]),t.get(r.parent).push(r));return t}function G(e,t){return function e(t,r){let n=r.get(t);if(!n)return{};if("compound"===t.type){let e=n[0];if(!e)return{};if(z(e))return e.key}let i={};for(let t of n)i[t.key]=e(t,r);return i}(e,J(B(t)))}function X(e,t){return"compound"===t.type?V(t).some(t=>"final"===t.type&&e.has(t)):"parallel"===t.type?V(t).every(t=>X(e,t)):"final"===t.type}let Y=e=>"#"===e[0];function Q(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(e=>{if("*"===e)return!0;if(!e.endsWith(".*"))return!1;let r=e.split("."),n=t.split(".");for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if("*"===t)return e===r.length-1;if(t!==i)return!1}return!0}).sort((e,t)=>t.length-e.length).flatMap(t=>e.transitions.get(t))}function K(e){let t=e.config.after;return t?Object.keys(t).flatMap(r=>{let n=t[r],i=Number.isNaN(+r)?r:+r,s=(t=>{var r;let n=(r=e.id,{type:`xstate.after.${t}.${r}`}),i=n.type;return e.entry.push(eM(n,{id:i,delay:t})),e.exit.push(q(i)),i})(i);return g("string"==typeof n?{target:n}:n).map(e=>({...e,event:s,delay:i}))}).map(t=>{let{delay:r}=t;return{...Z(e,t.event,t),delay:r}}):[]}function Z(e,t,r){let n=_(r.target),s=r.reenter??!1,o=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 r=t[0]===i;if(r&&!e.parent)return ea(e,t.slice(1));let n=r?e.key+t:t;if(e.parent)try{return ea(e.parent,n)}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,n),a={...r,actions:g(r.actions),guard:r.guard,target:o,source:e,reenter
2:s,eventType:t,toJSON:()=>({...a,source:`#${e.id}`,target:o?o.map(e=>`#${e.id}`):void 0})};return a}function ee(e){let t=new Map;if(e.config.on)for(let r of Object.keys(e.config.on)){if(r===s)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let n=e.config.on[r];t.set(r,w(n).map(t=>Z(e,r,t)))}if(e.config.onDone){let r=`xstate.done.state.${e.id}`;t.set(r,w(e.config.onDone).map(t=>Z(e,r,t)))}for(let r of e.invoke){if(r.onDone){let n=`xstate.done.actor.${r.id}`;t.set(n,w(r.onDone).map(t=>Z(e,n,t)))}if(r.onError){let n=`xstate.error.actor.${r.id}`;t.set(n,w(r.onError).map(t=>Z(e,n,t)))}if(r.onSnapshot){let n=`xstate.snapshot.${r.id}`;t.set(n,w(r.onSnapshot).map(t=>Z(e,n,t)))}}for(let r of e.after){let e=t.get(r.eventType);e||(e=[],t.set(r.eventType,e)),e.push(r)}return t}function et(e,t){let r="string"==typeof t?e.states[t]:t?e.states[t.target]:void 0;if(!r&&t)throw Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let n={source:e,actions:t&&"string"!=typeof t?g(t.actions):[],eventType:null,reenter:!1,target:r?[r]:[],toJSON:()=>({...n,source:`#${e.id}`,target:r?[`#${r.id}`]:[]})};return n}function er(e){let t=_(e.config.target);return t?{target:t.map(t=>"string"==typeof t?ea(e.parent,t):t)}:e.parent.initial}function en(e){return"history"===e.type}function ei(e){let t=es(e);for(let r of t)for(let n of H(r,e))t.add(n);return t}function es(e){let t=new Set;return!function e(r){if(!t.has(r)){if(t.add(r),"compound"===r.type)e(r.initial.target[0]);else if("parallel"===r.type)for(let t of V(r))e(t)}}(e),t}function eo(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 r=e.states[t];if(!r)throw Error(`Child state '${t}' does not exist on '${e.id}'`);return r}function ea(e,t){if("string"==typeof t&&Y(t))try{return e.machine.getStateNodeById(t)}catch{}let r=p(t).slice(),n=e;for(;r.length;){let e=r.shift();if(!e.length)break;n=eo(n,e)}return n}function ec(e,t){if("string"==typeof t){let r=e.states[t];if(!r)throw Error(`State '${t}' does not exist on '${e.id}'`);return[e,r]}let r=Object.keys(t),n=r.map(t=>eo(e,t)).filter(Boolean);return[e.machine.root,e].concat(n,r.reduce((r,n)=>{let i=eo(e,n);if(!i)return r;let s=ec(i,t[n]);return r.concat(s)},[]))}function eu(e,t){let r=e;for(;r.parent&&r.parent!==t;)r=r.parent;return r.parent===t}function el(e,t,r){let n=new Set;for(let i of e){let e=!1,s=new Set;for(let o of n)if(function(e,t){let r=new Set(e),n=new Set(t);for(let e of r)if(n.has(e))return!0;for(let e of n)if(r.has(e))return!0;return!1}(ef([i],t,r),ef([o],t,r)))if(eu(i.source,o.source))s.add(o);else{e=!0;break}if(!e){for(let e of s)n.delete(e);n.add(i)}}return Array.from(n)}function ed(e,t){if(!e.target)return[];let r=new Set;for(let n of e.target)if(en(n))if(t[n.id])for(let e of t[n.id])r.add(e);else for(let e of ed(er(n),t))r.add(e);else r.add(n);return[...r]}function eh(e,t){let r=ed(e,t);if(!r)return;if(!e.reenter&&r.every(t=>t===e.source||eu(t,e.source)))return e.source;let n=function(e){let[t,...r]=e;for(let e of H(t,void 0))if(r.every(t=>eu(t,e)))return e}(r.concat(e.source));return n||(e.reenter?void 0:e.source.machine.root)}function ef(e,t,r){let n=new Set;for(let i of e)if(i.target?.length){let e=eh(i,r);for(let r of(i.reenter&&i.source===e&&n.add(e),t))eu(r,e)&&n.add(r)}return[...n]}function ep(e,t,r,n,i,s){if(!e.length)return t;let o=new Set(t._nodes),a=t.historyValue,c=el(e,o,a),l=t;i||([l,a]=function(e,t,r,n,i,s,o,a){let c,u=e,l=ef(n,i,s);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 r;r="deep"===t.history?t=>z(t)&&eu(t,e):t=>t.parent===e,(c??={...s})[t.id]=Array.from(i).filter(r)}for(let e of l)u=eg(u,t,r,[...e.exit,...e.invoke.map(e=>L(e.id))],o,void 0),i.delete(e);return[u,c||s]}(l,n,r,c,o,a,s,r.actionExecutor)),l=function(e,t,r,n,i,s,o,a){let c=e,l=new Set,d=new Set;(function(e,t,r,n){for(let i of e){let e=eh(i,t);for(let s of i.target||[])!en(s)&&(i.source!==s||i.source!==e||i.reenter)&&(n.add(s),r.add(s)),ey(s,t,r,n);for(let s of ed(i,t)){let o=H(s,e);e?.type==="parallel"&&o.push(e),ev(n,t,r,o,!i.source.parent&&i.reenter?void 0:e)}}})(n,o,d,l),a&&d.add(e.machine.root);let h=new Set;for(let e of[...l].sort((e,t)=>
2e.order-t.order)){i.add(e);let n=[];for(let t of(n.push(...e.entry),e.invoke))n.push(N(t.src,{...t,syncSnapshot:!!t.onSnapshot}));if(d.has(e)){let t=e.initial.actions;n.push(...t)}if(c=eg(c,t,r,n,s,e.invoke.map(e=>e.id)),"final"===e.type){let n=e.parent,o=n?.type==="parallel"?n:n?.parent,a=o||e;for(n?.type==="compound"&&s.push(u(n.id,void 0!==e.output?m(e.output,c.context,t,r.self):void 0));o?.type==="parallel"&&!h.has(o)&&X(i,o);)h.add(o),s.push(u(o.id)),a=o,o=o.parent;if(o)continue;c=ek(c,{status:"done",output:function(e,t,r,n,i){if(void 0===n.output)return;let s=u(i.id,void 0!==i.output&&i.parent?m(i.output,e.context,t,r.self):void 0);return m(n.output,e.context,s,r.self)}(c,t,r,c.machine.root,a)})}}return c}(l=eg(l,n,r,c.flatMap(e=>e.actions),s,void 0),n,r,c,o,s,a,i);let d=[...o];"done"===l.status&&(l=eg(l,n,r,d.sort((e,t)=>t.order-e.order).flatMap(e=>e.exit),s,void 0));try{if(a===t.historyValue&&function(e,t){if(e.length!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}(t._nodes,o))return l;return ek(l,{_nodes:d,historyValue:a})}catch(e){throw e}}function ey(e,t,r,n){var i,s,o,a;if(en(e))if(t[e.id]){let o=t[e.id];for(let e of o)n.add(e),ey(e,t,r,n);for(let a of o){i=a,s=e.parent,ev(n,t,r,H(i,s))}}else{let i=er(e);for(let s of i.target)n.add(s),i===e.parent?.initial&&r.add(e.parent),ey(s,t,r,n);for(let s of i.target){o=s,a=e.parent,ev(n,t,r,H(o,a))}}else if("compound"===e.type){let[i]=e.initial.target;en(i)||(n.add(i),r.add(i)),ey(i,t,r,n),ev(n,t,r,H(i,e))}else if("parallel"===e.type)for(let i of V(e).filter(e=>!en(e)))[...n].some(e=>eu(e,i))||(en(i)||(n.add(i),r.add(i)),ey(i,t,r,n))}function ev(e,t,r,n,i){for(let s of n)if((!i||eu(s,i))&&e.add(s),"parallel"===s.type)for(let n of V(s).filter(e=>!en(e)))[...e].some(e=>eu(e,n))||(e.add(n),ey(n,t,r,e))}function eg(e,t,r,n,i,s){let o=s?[]:void 0,a=function e(t,r,n,i,s,o){let{machine:a}=t,c=t;for(let t of i){var u;let i="function"==typeof t,l=i?t:(u="string"==typeof t?t:t.type,a.implementations.actions[u]),d={context:c.context,event:r,self:n.self,system:n.system},h=i||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:c.context,event:r}):t.params:void 0;if(!l||!("resolve"in l)){n.actionExecutor({type:"string"==typeof t?t:"object"==typeof t?t.type:t.name||"(anonymous)",info:d,params:h,exec:l});continue}let[f,p,y]=l.resolve(n,c,d,h,l,s);c=f,"retryResolve"in l&&o?.push([l,p]),"execute"in l&&n.actionExecutor({type:l.type,info:d,params:p,exec:l.execute.bind(null,n,p)}),y&&(c=e(c,r,n,y,s,o))}return c}(e,t,r,n,{internalQueue:i,deferredActorIds:s},o);return o?.forEach(([e,t])=>{e.retryResolve(r,a,t)}),a}function em(e,t,r,n){let i=e,s=[];function a(e,t,n){r.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:r.self,event:t,snapshot:e,_transitions:n}),s.push(e)}if(t.type===c)return a(i=ek(eb(i,t,r),{status:"stopped"}),t,[]),{snapshot:i,microstates:s};let u=t;if(u.type!==o){let t=u,o=t.type.startsWith("xstate.error.actor"),c=ew(t,i);if(o&&!c.length)return a(i=ek(e,{status:"error",error:t.error}),t,[]),{snapshot:i,microstates:s};a(i=ep(c,e,r,u,!1,n),t,c)}let l=!0;for(;"active"===i.status;){let e=l?function(e,t){let r=new Set;for(let n of e._nodes.filter(z))e:for(let i of[n].concat(H(n,void 0)))if(i.always){for(let n of i.always)if(void 0===n.guard||W(n.guard,e.context,t,e)){r.add(n);break e}}return el(Array.from(r),new Set(e._nodes),e.historyValue)}(i,u):[],t=e.length?i:void 0;if(!e.length){if(!n.length)break;e=ew(u=n.shift(),i)}l=(i=ep(e,i,r,u,!1,n))!==t,a(i,u,e)}return"active"!==i.status&&eb(i,u,r),{snapshot:i,microstates:s}}function eb(e,t,r){return eg(e,t,r,Object.values(e.children).map(e=>L(e)),[],void 0)}function ew(e,t){return t.machine.getTransitionData(t,e)}function e_(e,t){let r=B(ec(e,t));return G(e,[...r])}let ex=function(e){return function e(t,r){let n=y(t),i=y(r);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)},eE=function(e){return this.tags.has(e)},eS=function(e){let t=this.machine.getTransitionData(this,e);return!!t?.length&&t.some(e=>void 0!==e.target||e.actions.length)},eT=function(){let{_nodes:e,tags:t,machine:r,getMeta:n,toJSON:i,can:s,hasTag:o,matches:a,...c}=this;return{...c,tags:Array.from(t)}},eI=function(){return this._nodes.reduce((e,t)=>
2(void 0!==t.meta&&(e[t.id]=t.meta),e),{})};function eC(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:G(t.root,e._nodes),tags:new Set(e._nodes.flatMap(e=>e.tags)),children:e.children,historyValue:e.historyValue||{},matches:ex,hasTag:eE,can:eS,getMeta:eI,toJSON:eT}}function ek(e,t={}){return eC({...e,...t},e.machine)}function ej(e,t){let{_nodes:r,tags:n,machine:i,children:s,context:o,can:a,hasTag:c,matches:u,getMeta:l,toJSON:d,...h}=e,f={};for(let e in s){let r=s[e];f[e]={snapshot:r.getPersistedSnapshot(t),src:r.src,systemId:r.systemId,syncSnapshot:r._syncSnapshot}}return{...h,context:function e(t){let r;for(let n in t){let i=t[n];if(i&&"object"==typeof i)if("sessionId"in i&&"send"in i&&"ref"in i)(r??=Array.isArray(t)?t.slice():{...t})[n]={xstate$$type:k,id:i.id};else{let s=e(i);s!==i&&((r??=Array.isArray(t)?t.slice():{...t})[n]=s)}}return r??t}(o),children:f,historyValue:function(e){if("object"!=typeof e||null===e)return{};let t={};for(let r in e){let n=e[r];Array.isArray(n)&&(t[r]=n.map(e=>({id:e.id})))}return t}(h.historyValue)}}function eO(e,t,r,n,{event:i,id:s,delay:o},{internalQueue:a}){let c,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 l="function"==typeof i?i(r,n):i;if("string"==typeof o){let e=u&&u[o];c="function"==typeof e?e(r,n):e}else c="function"==typeof o?o(r,n):o;return"number"!=typeof c&&a.push(l),[t,{event:l,id:s,delay:c},void 0]}function eA(e,t){let{event:r,delay:n,id:i}=t;if("number"==typeof n)return void e.defer(()=>{let t=e.self;e.system.scheduler.schedule(t,t,r,n,i)})}function eM(e,t){function r(e,t){}return r.type="xstate.raise",r.event=e,r.id=t?.id,r.delay=t?.delay,r.resolve=eO,r.execute=eA,r}},5479:(e,t,r)=>{r.d(t,{Fk:()=>u,jF:()=>c,v$:()=>l,vY:()=>d});var n=r(50319);let i={"handshake/syn":n.Tx,"handshake/syn-ack":n.Rr,"handshake/ack":n.IM,"channel/response":n._K,"channel/heartbeat":n.vd,"channel/disconnect":n.FS,"overlay/focus":"visual-editing/focus","overlay/navigate":"visual-editing/navigate","overlay/toggle":"visual-editing/toggle","presentation/toggleOverlay":"presentation/toggle-overlay"},s={[n.Tx]:"handshake/syn",[n.Rr]:"handshake/syn-ack",[n.IM]:"handshake/ack",[n._K]:"channel/response",[n.vd]:"channel/heartbeat",[n.FS]:"channel/disconnect","visual-editing/focus":"overlay/focus","visual-editing/navigate":"overlay/navigate","visual-editing/toggle":"overlay/toggle","presentation/toggle-overlay":"presentation/toggleOverlay"},o=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=n.V2),"overlays"===t.to&&(t.to="visual-editing"),"overlays"===t.from&&(t.from="visual-editing"),t.channelId=t.connectionId,delete t.connectionId,t.type=i[t.type]??t.type),e},a=({context:e},t)=>{let{sources:r,targetOrigin:i}=e,o=(e=>{let{channelId:t,...r}=e,i={...r,connectionId:t};return i.domain===n.V2&&(i.domain="sanity/channels"),"visual-editing"===i.to&&(i.to="overlays"),"visual-editing"===i.from&&(i.from="overlays"),i.type=s[i.type]??i.type,"channel/response"===i.type&&i.responseTo&&!i.data&&(i.data={responseTo:i.responseTo}),("handshake/syn"===i.type||"handshake/syn-ack"===i.type||"handshake/ack"===i.type)&&(i.data={id:i.connectionId}),i})(t.message);r.forEach(e=>{e.postMessage(o,{targetOrigin:i})})},c=()=>({listen:(0,n.CC)(o),requestMachine:(0,n.tP)().provide({actions:{"send message":a}})});function u(){return window.self!==window.top}function l(){return!!window.opener}function d(){return u()||l()}},9227:(e,t,r)=>{r.d(t,{Ms:()=>g,vU:()=>f});var n=r(47097),i=r(82765),s=r(24495),o=r(89250),a=r(63744),c=r(21253),u=l("C",void 0,void 0);function l(e,t,r){return{kind:e,value:t,error:r}}var d=r(31876),h=r(45020),f=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,(0,s.Uv)(t)&&t.add(r)):r.destination=w,r}return(0,n.C6)(t,e),t.create=function(e,t,r){return new g(e,t,r)},t.prototype.next=function(e){this.isStopped?b(l("N",e,void 0),this):this._next(e)},t.prototype.error=function(e){this.isStopped?b(l("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?b(u,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(s.yU),p=Function.prototype.bind;function y(e,t){return p.call(e,t)}var v=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){m(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){m(e)}else m(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){m(e)}},e}(),g=function(e){function t(t,r,n){var s,a,c=e.call(this)||this;return(0,i.T)(t)||!t?s={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}
2:c&&o.$.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return c.unsubscribe()},s={next:t.next&&y(t.next,a),error:t.error&&y(t.error,a),complete:t.complete&&y(t.complete,a)}):s=t,c.destination=new v(s),c}return(0,n.C6)(t,e),t}(f);function m(e){o.$.useDeprecatedSynchronousErrorHandling?(0,h.l)(e):(0,a.m)(e)}function b(e,t){var r=o.$.onStoppedNotification;r&&d.f.setTimeout(function(){return r(e,t)})}var w={closed:!0,next:c.l,error:function(e){throw e},complete:c.l}},11173:(e,t,r)=>{r.d(t,{F:()=>i,m:()=>s});var n=r(59927);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)}function s(e){return 0===e.length?n.D:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}},11610:(e,t,r)=>{r.d(t,{Tg:()=>y});var n=r(47097),i=r(26973),s=r(86978),o=r(72465),a=r(68611),c=r(41229),u=r(84841),l=r(80119),d=r(64770),h=r(82765),f=r(63744),p=r(41172);function y(e){if(e instanceof o.c)return e;if(null!=e){var t,r,y,g,m;if((0,a.l)(e)){return t=e,new o.c(function(e){var r=t[p.s]();if((0,h.T)(r.subscribe))return r.subscribe(e);throw TypeError("Provided object does not correctly implement Symbol.observable")})}if((0,i.X)(e)){return r=e,new o.c(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}if((0,s.y)(e)){return y=e,new o.c(function(e){y.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,f.m)})}if((0,c.T)(e))return v(e);if((0,l.x)(e)){return g=e,new o.c(function(e){var t,r;try{for(var i=(0,n.Ju)(g),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}e.complete()})}if((0,d.U)(e)){return m=e,v((0,d.C)(m))}}throw(0,u.L)(e)}function v(e){return new o.c(function(t){(function(e,t){var r,i,s,o;return(0,n.sH)(this,void 0,void 0,function(){var a;return(0,n.YH)(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=(0,n.xN)(e),c.label=1;case 1:return[4,r.next()];case 2:if((i=c.sent()).done)return[3,4];if(a=i.value,t.next(a),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s={error:c.sent()},[3,11];
2case 6:if(c.trys.push([6,,9,10]),!(i&&!i.done&&(o=r.return)))return[3,8];return[4,o.call(r)];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}},12848:(e,t,r)=>{r.d(t,{o:()=>n});function n(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},12877:(e,t,r)=>{r.d(t,{u:()=>c});var n=r(47097),i=r(11610),s=r(66312),o=r(9227),a=r(48160);function c(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new s.B}:t,n=e.resetOnError,c=void 0===n||n,l=e.resetOnComplete,d=void 0===l||l,h=e.resetOnRefCountZero,f=void 0===h||h;return function(e){var t,n,s,l=0,h=!1,p=!1,y=function(){null==n||n.unsubscribe(),n=void 0},v=function(){y(),t=s=void 0,h=p=!1},g=function(){var e=t;v(),null==e||e.unsubscribe()};return(0,a.N)(function(e,a){l++,p||h||y();var m=s=null!=s?s:r();a.add(function(){0!=--l||p||h||(n=u(g,f))}),m.subscribe(a),!t&&l>0&&(t=new o.Ms({next:function(e){return m.next(e)},error:function(e){p=!0,y(),n=u(v,c,e),m.error(e)},complete:function(){h=!0,y(),n=u(v,d),m.complete()}}),(0,i.Tg)(e).subscribe(t))})(e)}}function u(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(!0===t)return void e();if(!1!==t){var a=new o.Ms({next:function(){a.unsubscribe(),e()}});return(0,i.Tg)(t.apply(void 0,(0,n.fX)([],(0,n.zs)(r)))).subscribe(a)}}},13038:(e,t,r)=>{function n(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}r.d(t,{Q:()=>c,u4:()=>n});var i={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},s={0:8203,1:8204,2:8205,3:65279};[,,,,].fill(String.fromCodePoint(s[0])).join(""),Object.fromEntries(Object.entries(s).map(e=>e.reverse())),Object.fromEntries(Object.entries(i).map(e=>e.reverse()));var o="".concat(Object.values(i).map(e=>"\\u{".concat(e.toString(16),"}")).join("")),a=RegExp("[".concat(o,"]{4,}"),"gu");function c(e){var t,r;return e&&JSON.parse({cleaned:(t=JSON.stringify(e)).replace(a,""),encoded:(null==(r=t.match(a))?void 0:r[0])||""}.cleaned)}},13562:(e,t,r)=>{r.d(t,{default:()=>o});var n=r(40166),i=r(38438);let s=(0,i.lazy)(()=>Promise.all([r.e(3036),r.e(7208),r.e(1534),r.e(4062),r.e(6549),r.e(5377)]).then(r.bind(r,50399)));function o(e){return(0,n.jsx)(i.Suspense,{fallback:null,children:(0,n.jsx)(s,{...e})})}},14896:(e,t,r)=>{r.d(t,{Z:()=>function e(t,r,c){return(void 0===c&&(c=1/0),(0,a.T)(r))?e(function(e,s){return(0,n.T)(function(t,n){return r(e,t,s,n)})((0,i.Tg)(t(e,s)))},c):("number"==typeof r&&(c=r),(0,s.N)(function(e,r){var n,s,a,u,l,d,h,f,p;return n=c,a=[],u=0,l=0,d=!1,h=function(){!d||a.length||u||r.complete()},f=function(e){return u<n?p(e):a.push(e)},p=function(e){u++;var c=!1;(0,i.Tg)(t(e,l++)).subscribe((0,o._)(r,function(e){s?f(e):r.next(e)},function(){c=!0},void 0,function(){if(c)try{for(u--;a.length&&u<n;)!function(){var e=a.shift();p(e)}();h()}catch(e){r.error(e)}}))},e.subscribe((0,o._)(r,f,function(){d=!0,h()})),function(){}}))}});var n=r(35164),i=r(11610),s=r(48160),o=(r(85681),r(22372)),a=r(82765)},15151:(e,t,r)=>{r.d(t,{a:()=>a,b:()=>f,e:()=>y,l:()=>m,s:()=>h});var n=r(623),i=r(50688);function s(e,t,r,n,{event:i}){return[t,{event:"function"==typeof i?i(r,n):i},void 0]}function o(e,{event:t}){e.defer(()=>e.emit(t))}function a(e){function t(e,t){}return t.type="xstate.emit",t.event=e,t.resolve=s,t.execute=o,t}let c=function(e){return e.Parent="#_parent",e.Internal="#_internal",e}({});function u(e,t,r,n,{to:i,event:s,id:o,delay:a},u){let l,d,h=t.machine.implementations.delays;if("string"==typeof s)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${s}" }) instead`);let f="function"==typeof s?s(r,n):s;if("string"==typeof a){let e=h&&h[a];l="function"==typeof e?e(r,n):e}else l="function"==typeof a?a(r,n):a;let p="function"==typeof i?i(r,n):i;if("string"==typeof p){if(!(d=p===c.Parent?e.self._parent:p===c.Internal?e.self:p.startsWith("#_")?t.children[p.slice(2)]:u.deferredActorIds?.includes(p)?p:t.children[p]))throw Error(`Unable to send event to actor '${p}' from machine '${t.machine.id}'.`)}else d=p||e.self;return[t,{to:d,targetId:"string"==typeof p?p:void 0,event:f,id:o,delay:l},void 0]}function l(e,t,r){"string"==typeof r.to&&(r.to=t.children[r.to])}function d(e,t){e.defer(()=>{let{to:r,event:i,delay:s,id:o}=t;if("number"==typeof s)return void e.system.scheduler.schedule(e.self,r,i,s,o);e.system._relay(e.self,r,i.type===n.T?(0,n.U)(e.self.id,i.data):i)})}function h(e,t,r){function n(e,t){}return n.type="xstate.sendTo",n.to=e,n.event=t,n.id=r?.id,n.delay=r?.delay,n.resolve=u,n.retryResolve=l,n.execute=d,n}function f(e,t){return h(c.Parent,e,t)}function p(e,t,r,s,{collect:o}){let c=[],u=function(e){c.push(e)};return u.assign=(...e)=>{c.push((0,i.a)(...e))},u.cancel=(...e)=>{c.push((0,n.a)(...e))},u.raise=(...e)=>{c.push((0,n.r)(...e))},u.sendTo=(...e)=>{c.push(h(...e))},u.sendParent=(...e)=>{c.push(f(...e))},u.spawnChild=(...e)=>{c.push((0,n.b)(...e))},u.stopChild=(...e)=>{c.push((0,n.s)(...e))},u.emit=(...e)=>{c.push(a(...e))},o({context:r.context,event:r.event,enqueue:u,check:e=>(0,n.w)(e,t.context,r.event,t),self:e.self,system:e.system},s),[t,void 0,c]}function y(e){function t(e,t){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=p,t}function v(e,t,r,n,{value:i,label:s}){return[t,{value:"function"==typeof i?i(r,n):i,label:s},void 0]}function g({logger:e},{value:t,label:r}){r?e(r,t):e(t)}function m(e=({context:e,event:t})=>({context:e,event:t}),t){function r(e,t){}return r.type="xstate.log",r.value=e,r.label=t,r.resolve=v,r.execute=g,r}},17958:(e,t,r)=>{r.d(t,{t:()=>s});var n=r(40133),i=r(12877);function s(e,t,r){var s,o,a,c,u=!1;return e&&"object"==typeof e?(c=void 0===(s=e.bufferSize)?1/0:s,t=void 0===(o=e.windowTime)?1/0:o,u=void 0!==(a=e.refCount)&&a,r=e.scheduler):c=null!=e?e:1/0,(0,i.u)({connector:function(){return new n.m(c,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},18550:(e,t,r)=>{r.d(t,{H:()=>b});var n=r(11610),i=r(59867),s=r(48160);function o(e,t){return void 0===t&&(t=0),(0,s.N)(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}var a=r(72465),c=r(77007),u=r(82765),l=r(85681);function d(e,t){if(!e)throw Error("Iterable cannot be null");return new a.c(function(r){(0,l.N)(r,t,function(){var n=e[Symbol.asyncIterator]();(0,l.N)(r,t,function(){n.next().then(function(e){e.done?r.complete():r.next(e.value)})},0,!0)})})}var h=r(68611),f=r(86978),p=r(26973),y=r(80119),v=r(41229),g=r(84841),m=r(64770);function b(e,t){return t?function(e,t){if(null!=e){if((0,h.l)(e))return(0,n.Tg)(e).pipe(o(t),(0,i.Q)(t));if((0,p.X)(e))return new a.c(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[
2n++]),r.closed||this.schedule())})});if((0,f.y)(e))return(0,n.Tg)(e).pipe(o(t),(0,i.Q)(t));if((0,v.T)(e))return d(e,t);if((0,y.x)(e))return new a.c(function(r){var n;return(0,l.N)(r,t,function(){n=e[c.l](),(0,l.N)(r,t,function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){r.error(e);return}i?r.complete():r.next(t)},0,!0)}),function(){return(0,u.T)(null==n?void 0:n.return)&&n.return()}});if((0,m.U)(e))return d((0,m.C)(e),t)}throw(0,g.L)(e)}(e,t):(0,n.Tg)(e)}},18946:(e,t,r)=>{r.d(t,{H6:()=>p,OX:()=>c,SP:()=>s,Sx:()=>h});var n=r(623);let i=new WeakMap;function s(e){return{config:e,start:(t,r)=>{let{self:n,system:s,emit:o}=r,a={receivers:void 0,dispose:void 0};i.set(n,a),a.dispose=e({input:t.input,system:s,self:n,sendBack:e=>{"stopped"!==n.getSnapshot().status&&n._parent&&s._relay(n,n._parent,e)},receive:e=>{a.receivers??=new Set,a.receivers.add(e)},emit:o})},transition:(e,t,r)=>{let s=i.get(r.self);return t.type===n.X?(e={...e,status:"stopped",error:void 0},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 o="xstate.observable.error",a="xstate.observable.complete";function c(e){return{config:e,transition:(e,t)=>{if("active"!==e.status)return e;switch(t.type){case o:return{...e,status:"error",error:t.data,input:void 0,_subscription:void 0};case a:return{...e,status:"done",input:void 0,_subscription:void 0};case n.X: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:r,system:n,emit:i})=>{"done"!==t.status&&(t._subscription=e({input:t.input,system:n,self:r,emit:i}).subscribe({next:e=>{r._parent&&n._relay(r,r._parent,e)},error:e=>{n._relay(r,r,{type:o,data:e})},complete:()=>{n._relay(r,r,{type:a})}}))},getPersistedSnapshot:({_subscription:e,...t})=>t,restoreSnapshot:e=>({...e,_subscription:void 0})}}let u="xstate.promise.resolve",l="xstate.promise.reject",d=new WeakMap;function h(e){return{config:e,transition:(e,t,r)=>{if("active"!==e.status)return e;switch(t.type){case u:{let r=t.data;return{...e,status:"done",output:r,input:void 0}}case l:return{...e,status:"error",error:t.data,input:void 0};case n.X:return d.get(r.self)?.abort(),{...e,status:"stopped",input:void 0};default:return e}},start:(t,{self:r,system:n,emit:i})=>{if("active"!==t.status)return;let s=new AbortController;d.set(r,s),Promise.resolve(e({input:t.input,system:n,self:r,signal:s.signal,emit:i})).then(e=>{"active"===r.getSnapshot().status&&(d.delete(r),n._relay(r,r,{type:u,data:e}))},e=>{"active"===r.getSnapshot().status&&(d.delete(r),n._relay(r,r,{type:l,data:e}))})},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,input:t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}let f=function(e,t){return{config:e,transition:(t,r,n)=>({...t,context:e(t.context,r,n)}),getInitialSnapshot:(e,r)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof t?t({input:r}):t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}(e=>void 0,void 0);function p(){return(0,n.c)(f)}},19295:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(70914)._(r(26807));function i(e,t){var r;let i={};"function"==typeof e&&(i.loader=e);let s={...i,...t};return(0,n.default)({...s,modules:null==(r=s.loadableGenerated)?void 0:r.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},21253:(e,t,r)=>{r.d(t,{l:()=>n});function n(){}},22029:(e,t,r)=>{r.d(t,{default:()=>s});var n=r(40166);let i=(0,r(58418).default)(()=>r.e(7524).then(r.bind(r,7524)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/SanityLiveStream.js")]},ssr:!1});function s(e){return(0,n.jsx)(i,{...e})}},22372:(e,t,r)=>{r.d(t,{_:()=>i});var n=r(47097);function i(e,t,r,n,i){return new s(e,t,r,n,i)}var s=function(e){function t(t,r,n,i,s,o){var a=e.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=o,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return(0,n.C6)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),r||null==(t=this.onFinalize)||t.call(this)}},t}(r(9227).vU)},24495:(e,t,r)=>{r.d(t,{Kn:()=>c,yU:()=>a,Uv:()=>u});var n=r(47097),i=r(82765),s=(0,r(26743).L)(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}),o=r(12848),a=function(){var e;function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,r,o,a,c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var u=(0,n.Ju)(c),d=u.next();!d.done;d=u.next())d.value.remove(this)}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else c.remove(this);var h=this.initialTeardown;
2if((0,i.T)(h))try{h()}catch(e){a=e instanceof s?e.errors:[e]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var p=(0,n.Ju)(f),y=p.next();!y.done;y=p.next()){var v=y.value;try{l(v)}catch(e){a=null!=a?a:[],e instanceof s?a=(0,n.fX)((0,n.fX)([],(0,n.zs)(a)),(0,n.zs)(e.errors)):a.push(e)}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}}if(a)throw new s(a)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)l(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(r=this._finalizers)?r:[]).push(e)}},t.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},t.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},t.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.o)(t,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&(0,o.o)(r,e),e instanceof t&&e._removeParent(this)},(e=new t).closed=!0,t.EMPTY=e,t}(),c=a.EMPTY;function u(e){return e instanceof a||e&&"closed"in e&&(0,i.T)(e.remove)&&(0,i.T)(e.add)&&(0,i.T)(e.unsubscribe)}function l(e){(0,i.T)(e)?e():e.unsubscribe()}},25473:(e,t,r)=>{function n(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return n}}),r(40166),r(4723),r(34090),r(44415)},26743:(e,t,r)=>{r.d(t,{L:()=>n});function n(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},26807:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let n=r(40166),i=r(38438),s=r(78252);function o(e){return{default:e&&"default"in e?e.default:e}}r(25473);let a={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},c=function(e){let t={...a,...e},r=(0,i.lazy)(()=>t.loader().then(o)),c=t.loading;function u(e){let o=c?(0,n.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,a=!t.ssr||!!t.loading,u=a?i.Suspense:i.Fragment,l=t.ssr?(0,n.jsxs)(n.Fragment,{children:[null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(u,{...a?{fallback:o}:{},children:l})}return u.displayName="LoadableComponent",u}},26973:(e,t,r)=>{r.d(t,{X:()=>n});var n=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},31876:(e,t,r)=>{r.d(t,{f:()=>i});var n=r(47097),i={setTimeout:function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];var o=i.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,n.fX)([e,t],(0,n.zs)(r))):setTimeout.apply(void 0,(0,n.fX)([e,t],(0,n.zs)(r)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},32407:(e,t,r)=>{function n(e,t,r){if(!t.has(e))throw TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function i(e,t){var r=n(e,t,"get");return r.get?r.get.call(e):r.value}function s(e,t,r){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,r)}function o(e,t,r){var i=n(e,t,"set");if(i.set)i.set.call(e,r);else{if(!i.writable)throw TypeError("attempted to set read only private field");i.value=r}return r}r.d(t,{u_:()=>eA,UU:()=>rG});let a=!(typeof navigator>"u")&&"ReactNative"===navigator.product,c={timeout:a?6e4:12e4},u=function(e){let t={...c,..."string"==typeof e?{url:e}:e};if(t.timeout=function e(t){if(!1===t||0===t)return!1;if(t.connect||t.socket)return t;let r=Number(t);return isNaN(r)?e(c.timeout):{connect:r,socket:r}}(t.timeout),t.query){let{url:e,searchParams:r}=function(e){let t=e.indexOf("?");if(-1===t)return{url:e,searchParams:new URLSearchParams};let r=e.slice(0,t),n=e.slice(t+1);if(!a)return{url:r,searchParams:new URLSearchParams(n)};if("function"!=typeof decodeURIComponent)throw Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");let i=new URLSearchParams;for(let e of n.split("&")){let[t,r]=e.split("=");t&&i.append(l(t),l(r||""))}return{url:r,searchParams:i}}(t.url);for(let[n,i]of Object.entries(t.query)){if(void 0!==i)if(Array.isArray(i))for(let e of i)r.append(n,e);else r.append(n,i);let s=r.toString();s&&(t.url=`${e}?${s}`)}}return t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t};function l(e){return decodeURIComponent(e.replace(/\+/g," "))}let d=/^https?:\/\//i,h=function(e){if(!d.test(e.url))throw Error(`"${e.url}" is not a valid URL`)},f=["request","response","progress","error","abort"],p=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];
2var y,v,g=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(){if(v)return y;v=1;var e=function(e){return e.replace(/^\s+|\s+$/g,"")};return y=function(t){if(!t)return{};for(var r=Object.create(null),n=e(t).split("\n"),i=0;i<n.length;i++){var s,o=n[i],a=o.indexOf(":"),c=e(o.slice(0,a)).toLowerCase(),u=e(o.slice(a+1));typeof r[c]>"u"?r[c]=u:(s=r[c],"[object Array]"===Object.prototype.toString.call(s))?r[c].push(u):r[c]=[r[c],u]}return r}}());class m{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#e;#t;#r;#n={};#i;#s={};#o;open(e,t,r){this.#e=e,this.#t=t,this.#r="",this.readyState=1,this.onreadystatechange?.(),this.#i=void 0}abort(){this.#i&&this.#i.abort()}getAllResponseHeaders(){return this.#r}setRequestHeader(e,t){this.#n[e]=t}setInit(e,t=!0){this.#s=e,this.#o=t}send(e){let t="arraybuffer"!==this.responseType,r={...this.#s,method:this.#e,headers:this.#n,body:e};"function"==typeof AbortController&&this.#o&&(this.#i=new AbortController,"u">typeof EventTarget&&this.#i.signal instanceof EventTarget&&(r.signal=this.#i.signal)),"u">typeof document&&(r.credentials=this.withCredentials?"include":"omit"),fetch(this.#t,r).then(e=>(e.headers.forEach((e,t)=>{this.#r+=`${t}: ${e}\r 3`}),this.status=e.status,this.statusText=e.statusText,this.readyState=3,this.onreadystatechange?.(),t?e.text():e.arrayBuffer())).then(e=>{"string"==typeof e?this.responseText=e:this.response=e,this.readyState=4,this.onreadystatechange?.()}).catch(e=>{"AbortError"!==e.name?this.onerror?.(e):this.onabort?.()})}}let b="function"==typeof XMLHttpRequest?"xhr":"fetch",w="xhr"===b?XMLHttpRequest:m,_=(e,t)=>{let r=e.options,n=e.applyMiddleware("finalizeOptions",r),i={},s=e.applyMiddleware("interceptRequest",void 0,{adapter:b,context:e});if(s){let e=setTimeout(t,0,null,s);return{abort:()=>clearTimeout(e)}}let o=new w;o instanceof m&&"object"==typeof n.fetch&&o.setInit(n.fetch,n.useAbortSignal??!0);let a=n.headers,c=n.timeout,u=!1,l=!1,d=!1;if(o.onerror=e=>{p(o instanceof m?e instanceof Error?e:Error(`Request error while attempting to reach is ${n.url}`,{cause:e}):Error(`Request error while attempting to reach is ${n.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},o.ontimeout=e=>{p(Error(`Request timeout while attempting to reach ${n.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},o.onabort=()=>{f(!0),u=!0},o.onreadystatechange=function(){c&&(f(),i.socket=setTimeout(()=>h("ESOCKETTIMEDOUT"),c.socket)),!u&&o&&4===o.readyState&&0!==o.status&&function(){if(!(u||l||d)){if(0===o.status)return p(Error("Unknown XHR error"));f(),l=!0,t(null,{body:o.response||(""===o.responseType||"text"===o.responseType?o.responseText:""),url:n.url,method:n.method,headers:g(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}}()},o.open(n.method,n.url,!0),o.withCredentials=!!n.withCredentials,a&&o.setRequestHeader)for(let e in a)a.hasOwnProperty(e)&&o.setRequestHeader(e,a[e]);return n.rawBody&&(o.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:n,adapter:b,request:o,context:e}),o.send(n.body||null),c&&(i.connect=setTimeout(()=>h("ETIMEDOUT"),c.connect)),{abort:function(){u=!0,o&&o.abort()}};function h(t){d=!0,o.abort();let r=Error("ESOCKETTIMEDOUT"===t?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);r.code=t,e.channels.error.publish(r)}function f(e){(e||u||o&&o.readyState>=2&&i.connect)&&clearTimeout(i.connect),i.socket&&clearTimeout(i.socket)}function p(e){if(l)return;f(!0),l=!0,o=null;let r=e||Error(`Network error while attempting to reach ${n.url}`);r.isNetworkError=!0,r.request=n,t(r)}};var x,E,S,T,I,C=r(40074),k=r(89414).hp,j={exports:{}};I||(I=1,function(e,t){let r;t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch{}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!e&&"u">typeof C&&"env"in C&&(e=C.env.DEBUG),e},t.useColors=function(){let e;return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&
3("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch{}}(),r=!1,t.destroy=()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=(T?S:(T=1,S=function(e){function t(e){let n,i,s,o=null;function a(...e){if(!a.enabled)return;let r=Number(new Date);a.diff=r-(n||r),a.prev=n,a.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return"%";i++;let s=t.formatters[n];if("function"==typeof s){let t=e[i];r=s.call(a,t),e.splice(i,1),i--}return r}),t.formatArgs.call(a,e),(a.log||t.log).apply(a,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,i=-1,s=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(i=n,s=r):r++,n++;else{if(-1===i)return!1;n=i+1,r=++s}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){for(let r of(t.save(e),t.namespaces=e,t.names=[],t.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(let r of t.skips)if(n(e,r))return!1;for(let r of t.names)if(n(e,r))return!0;return!1},t.humanize=function(){if(E)return x;E=1;function e(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}return x=function(t,r){r=r||{};var n,i,s=typeof t;if("string"===s&&t.length>0){var o=t;if(!((o=String(o)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(a){var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return 6048e5*c;case"days":case"day":case"d":return 864e5*c;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*c;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*c;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c}}}return}if("number"===s&&isFinite(t))return r.long?(i=Math.abs(t))>=864e5?e(t,i,864e5,"day"):i>=36e5?e(t,i,36e5,"hour"):i>=6e4?e(t,i,6e4,"minute"):i>=1e3?e(t,i,1e3,"second"):t+" ms":(n=Math.abs(t))>=864e5?Math.round(t/864e5)+"d":n>=36e5?Math.round(t/36e5)+"h":n>=6e4?Math.round(t/6e4)+"m":n>=1e3?Math.round(t/1e3)+"s":t+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}))(t);let{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}
3(j,j.exports)),j.exports,Object.prototype.hasOwnProperty;let O=typeof k>"u"?()=>!1:e=>k.isBuffer(e);function A(e){return"[object Object]"===Object.prototype.toString.call(e)}let M=["boolean","string","number"],R={};"u">typeof globalThis?R=globalThis:"u">typeof window?R=window:"u">typeof global?R=global:"u">typeof self&&(R=self);var P=R;let q=(e={})=>{let t=e.implementation||Promise;if(!t)throw Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:(r,n)=>new t((t,i)=>{let s=n.options.cancelToken;s&&s.promise.then(e=>{r.abort.publish(e),i(e)}),r.error.subscribe(i),r.response.subscribe(r=>{t(e.onlyBody?r.body:r)}),setTimeout(()=>{try{r.request.publish(n)}catch(e){i(e)}},0)})}};class D{__CANCEL__=!0;message;constructor(e){this.message=e}toString(){return"Cancel"+(this.message?`: ${this.message}`:"")}}class ${promise;reason;constructor(e){if("function"!=typeof e)throw TypeError("executor must be a function.");let t=null;this.promise=new Promise(e=>{t=e}),e(e=>{this.reason||(this.reason=new D(e),t(this.reason))})}static source=()=>{let e;return{token:new $(t=>{e=t}),cancel:e}}}q.Cancel=D,q.CancelToken=$,q.isCancel=e=>!(!e||!e?.__CANCEL__);var N=(e,t,r)=>("GET"===r.method||"HEAD"===r.method)&&(e.isNetworkError||!1);function F(e){return 100*Math.pow(2,e)+100*Math.random()}let U=(e={})=>(e=>{let t=e.maxRetries||5,r=e.retryDelay||F,n=e.shouldRetry;return{onError:(e,i)=>{var s;let o=i.options,a=o.maxRetries||t,c=o.retryDelay||r,u=o.shouldRetry||n,l=o.attemptNumber||0;if(null!==(s=o.body)&&"object"==typeof s&&"function"==typeof s.pipe||!u(e,l,o)||l>=a)return e;let d=Object.assign({},i,{options:Object.assign({},o,{attemptNumber:l+1})});return setTimeout(()=>i.channels.request.publish(d),c(l)),null}}})({shouldRetry:N,...e});U.shouldRetry=N;var L=r(72465),W=r(61486),z=r(82765),V=r(79752),H=r(18550);function B(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,V.lI)(e);return(0,H.H)(e,r)}var J=r(14896),G=(0,r(26743).L)(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function X(e,t){var r="object"==typeof t;return new Promise(function(n,i){var s,o=!1;e.subscribe({next:function(e){s=e,o=!0},error:i,complete:function(){o?n(s):r?n(t.defaultValue):i(new G)}})})}var Y=r(17958),Q=r(11610),K=r(22372),Z=r(48160);function ee(e){return(0,Z.N)(function(t,r){var n,i=null,s=!1;i=t.subscribe((0,K._)(r,void 0,void 0,function(o){n=(0,Q.Tg)(e(o,ee(e)(t))),i?(i.unsubscribe(),i=null,n.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,n.subscribe(r))})}var et=r(74993),er=r(72564),en=new(r(90700)).q(er.R);function ei(e,t){var r=(0,z.T)(e)?e:function(){return e},n=function(e){return e.error(r())};return new L.c(t?function(e){return t.schedule(n,0,e)}:n)}r(73418);var es=r(59927);function eo(e){return(0,Z.N)(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}var ea=r(12877),ec=r(88206),eu=r(35164),el=r(9227);function ed(e,t){var r="object"==typeof t;return new Promise(function(n,i){var s=new el.Ms({next:function(e){n(e),s.unsubscribe()},error:i,complete:function(){r?n(t.defaultValue):i(new G)}});e.subscribe(s)})}var eh=r(13038),ef=r(47097),ep=r(85681);function ey(e,t,r){e?(0,ep.N)(r,e,t):t()}var ev=Array.isArray,eg=r(91076),em=r(11173);function eb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,V.ms)(e);return r?(0,em.F)(eb.apply(void 0,(0,ef.fX)([],(0,ef.zs)(e))),(0,eg.I)(r)):(0,Z.N)(function(t,r){var n,i,s;(n=(0,ef.fX)([t],(0,ef.zs)(1===e.length&&ev(e[0])?e[0]:e)),void 0===s&&(s=es.D),function(e){ey(void 0,function(){for(var t=n.length,r=Array(t),o=t,a=t,c=function(t){ey(i,function(){var c=(0,H.H)(n[t],i),u=!1;c.subscribe((0,K._)(e,function(n){r[t]=n,!u&&(u=!0,a--),a||e.next(s(r.slice()))},function(){--o||e.complete()}))},e)},u=0;u<t;u++)c(u)},e)})(r)})}var ew=r(63872),e_=r(58079);let ex=e=>crypto.getRandomValues(new Uint8Array(e)),eE=/\r\n|[\n\r\u2028\u2029]/;function eS(e,t){var r,n;let i=0;for(let r=0;r<t.length;r++){let n=t[r].length+1;if(i+n>e)return{line:r+1,column:e-i};i+=n}return{line:t.length,column:null!=(n=null==(r=t[t.length-1])?void 0:r.length)?n:0}}
3class eT extends Error{constructor(e,t){let r=eC(e,t);super(r.message),this.statusCode=400,Object.assign(this,r)}}class eI extends Error{constructor(e){let t=eC(e);super(t.message),this.statusCode=500,Object.assign(this,t)}}function eC(e,t){var r,n,i,s,o;let a=e.body,c={response:e,statusCode:e.statusCode,responseBody:(r=a,-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(r,null,2):r),message:"",details:void 0};if(!(0,eh.u4)(a))return c.message=eO(e,a),c;let u=a.error;if("string"==typeof u&&"string"==typeof a.message)return c.message="".concat(u," - ").concat(a.message),c;if("object"!=typeof u||null===u)return"string"==typeof u?c.message=u:"string"==typeof a.message?c.message=a.message:c.message=eO(e,a),c;if("type"in(n=u)&&"mutationError"===n.type&&"description"in n&&"string"==typeof n.description||"type"in(i=u)&&"actionError"===i.type&&"description"in i&&"string"==typeof i.description){let e=u.items||[],t=e.slice(0,5).map(e=>{var t;return null==(t=e.error)?void 0:t.description}).filter(Boolean),r=t.length?":\n- ".concat(t.join("\n- ")):"";return e.length>5&&(r+="\n...and ".concat(e.length-5," more")),c.message="".concat(u.description).concat(r),c.details=a.error,c}if(ek(u)){return c.message=ej(u,null==t||null==(o=t.options)||null==(s=o.query)?void 0:s.tag),c.details=a.error,c}return"description"in u&&"string"==typeof u.description?(c.message=u.description,c.details=u):c.message=eO(e,a),c}function ek(e){return(0,eh.u4)(e)&&"queryParseError"===e.type&&"string"==typeof e.query&&"number"==typeof e.start&&"number"==typeof e.end}function ej(e,t){let{query:r,start:n,end:i,description:s}=e;return!r||typeof n>"u"?"GROQ query parse error: ".concat(s):"GROQ query parse error:\n".concat(function(e,t,r){let n=e.split(eE),{start:i,end:s,markerLines:o}=function(e,t){var r,n;let i={...e.start},s={...i,...e.end},o=null!=(r=i.line)?r:-1,a=null!=(n=i.column)?n:0,c=s.line,u=s.column,l=Math.max(o-3,0),d=Math.min(t.length,c+3);-1===o&&(l=0),-1===c&&(d=t.length);let h=c-o,f={};if(h)for(let e=0;e<=h;e++){let r=e+o;if(a)if(0===e){let e=t[r-1].length;f[r]=[a,e-a+1]}else if(e===h)f[r]=[0,u];else{let n=t[r-e].length;f[r]=[0,n]}else f[r]=!0}else a===u?a?f[o]=[a,0]:f[o]=!0:f[o]=[a,u-a];return{start:l,end:d,markerLines:f}}({start:eS(t.start,n),end:t.end?eS(t.end,n):void 0},n),a="".concat(s).length;return e.split(eE,s).slice(i,s).map((e,t)=>{let n=i+1+t,s=" ".concat(" ".concat(n).slice(-a)," |"),c=o[n],u=!o[n+1];if(!c)return" ".concat(s).concat(e.length>0?" ".concat(e):"");let l="";if(Array.isArray(c)){let t=e.slice(0,Math.max(c[0]-1,0)).replace(/[^\t]/g," "),n=c[1]||1;l="\n "+s.replace(/\d/g," ")+" "+t+"^".repeat(n),u&&r&&(l+=" "+r)}return">"+s+(e.length>0?" ".concat(e):"")+l}).join("\n")}(r,{start:n,end:i},s)).concat(t?"\n\nTag: ".concat(t):"")}function eO(e,t){var r,n;let i="string"==typeof t?" (".concat((n=100,(r=t).length>100?"".concat(r.slice(0,n),"…"):r),")"):"",s=e.statusMessage?" ".concat(e.statusMessage):"";return"".concat(e.method,"-request to ").concat(e.url," resulted in HTTP ").concat(e.statusCode).concat(s).concat(i)}class eA extends Error{constructor({projectId:e}){super("CorsOriginError"),this.name="CorsOriginError",this.projectId=e;let t=new URL("https://sanity.io/manage/project/".concat(e,"/api"));if("u">typeof location){let{origin:e}=location;t.searchParams.set("cors","add"),t.searchParams.set("origin",e),this.addOriginUrl=t,this.message="The current origin is not allowed to connect to the Live Content API. Add it here: ".concat(t)}else this.message="The current origin is not allowed to connect to the Live Content API. Change your configuration here: ".concat(t)}}let eM={onResponse:(e,t)=>{if(e.statusCode>=500)throw new eI(e);if(e.statusCode>=400)throw new eT(e,t);return e}};function eR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return((e=[],t=_)=>(function e(t,r){let n=[],i=p.reduce((e,t)=>(e[t]=e[t]||[],e),{processOptions:[u],validateOptions:[h]});function s(e){let t,n=f.reduce((e,t)=>(e[t]=function(){let e=Object.create(null),t=0;return{publish:function(t){for(let r in e)e[r](t)},subscribe:function(r){let n=t++;return e[n]=r,function(){delete e[n]}}}}(),e),{}),s=function(e,t,...r){let n="onError"===e,s=t;
3for(let t=0;t<i[e].length&&(s=(0,i[e][t])(s,...r),!n||s);t++);return s},o=s("processOptions",e);s("validateOptions",o);let a={options:o,channels:n,applyMiddleware:s},c=n.request.subscribe(e=>{t=r(e,(t,r)=>((e,t,r)=>{let i=e,o=t;if(!i)try{o=s("onResponse",t,r)}catch(e){o=null,i=e}(i=i&&s("onError",i,r))?n.error.publish(i):o&&n.response.publish(o)})(t,r,e))});n.abort.subscribe(()=>{c(),t&&t.abort()});let u=s("onReturn",n,a);return u===n&&n.request.publish(a),u}return s.use=function(e){if(!e)throw Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&i.onReturn.length>0)throw Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return p.forEach(t=>{e[t]&&i[t].push(e[t])}),n.push(e),s},s.clone=()=>e(n,r),t.forEach(s.use),s})(e,t))([U({shouldRetry:eP}),...e,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},r=t=>void 0!==e.ignoreWarnings&&(Array.isArray(e.ignoreWarnings)?e.ignoreWarnings:[e.ignoreWarnings]).some(e=>"string"==typeof e?t.includes(e):e instanceof RegExp&&e.test(t));return{onResponse:e=>{let n=e.headers["x-sanity-warning"];for(let e of Array.isArray(n)?n:[n])!e||t[e]||r(e)||(t[e]=!0,console.warn(e));return e}}}(t),{processOptions:e=>{let t=e.body;return!t||"function"==typeof t.pipe||O(t)||-1===M.indexOf(typeof t)&&!Array.isArray(t)&&!function(e){if(!1===A(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!1!==A(r)&&!1!==r.hasOwnProperty("isPrototypeOf")}(t)?e:Object.assign({},e,{body:JSON.stringify(e.body),headers:Object.assign({},e.headers,{"Content-Type":"application/json"})})}},{onResponse:e=>{let t=e.headers["content-type"]||"",r=-1!==t.indexOf("application/json");return e.body&&t&&r?Object.assign({},e,{body:function(e){try{return JSON.parse(e)}catch(e){throw e.message=`Failed to parsed response body as JSON: ${e.message}`,e}}(e.body)}):e},processOptions:e=>Object.assign({},e,{headers:Object.assign({Accept:"application/json"},e.headers)})},{onRequest:e=>{if("xhr"!==e.adapter)return;let t=e.request,r=e.context;function n(e){return t=>{let n=t.lengthComputable?t.loaded/t.total*100:-1;r.channels.progress.publish({stage:e,percent:n,total:t.total,loaded:t.loaded,lengthComputable:t.lengthComputable})}}"upload"in t&&"onprogress"in t.upload&&(t.upload.onprogress=n("upload")),"onprogress"in t&&(t.onprogress=n("download"))}},eM,function(e={}){let t=e.implementation||P.Observable;if(!t)throw Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:(e,r)=>new t(t=>(e.error.subscribe(e=>t.error(e)),e.progress.subscribe(e=>t.next(Object.assign({type:"progress"},e))),e.response.subscribe(e=>{t.next(Object.assign({type:"response"},e)),t.complete()}),e.request.publish(r),()=>e.abort.publish()))}}({implementation:L.c})])}function eP(e,t,r){if(0===r.maxRetries)return!1;let n="GET"===r.method||"HEAD"===r.method,i=(r.uri||r.url).startsWith("/data/query"),s=e.response&&(429===e.response.statusCode||502===e.response.statusCode||503===e.response.statusCode);return(!!n||!!i)&&!!s||U.shouldRetry(e,t,r)}function eq(e){return"https://www.sanity.io/help/"+e}let eD=["image","file"],e$=["before","after","replace"],eN=e=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(e))throw Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},eF=(e,t)=>{if(null===t||"object"!=typeof t||Array.isArray(t))throw Error("".concat(e,"() takes an object of properties"))},eU=(e,t)=>{if("string"!=typeof t||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(t)||t.includes(".."))throw Error("".concat(e,'(): "').concat(t,'" is not a valid document ID'))},eL=(e,t)=>{if(!t._id)throw Error("".concat(e,'() requires that the document contains an ID ("_id" property)'));eU(e,t._id)},eW=(e,t)=>{if(!t._type)throw Error("`".concat(e,"()` requires that the document contains a type (`_type` property)"));((e,t)=>
3{if("string"!=typeof t)throw Error("`".concat(e,"()`: `").concat(t,"` is not a valid document type"))})(e,t._type)},ez=e=>{if(!e.dataset)throw Error("`dataset` must be provided to perform queries");return e.dataset||""},eV=e=>{if("string"!=typeof e||!/^[a-z0-9._-]{1,75}$/i.test(e))throw Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return e},eH=e=>{if(!e["~experimental_resource"])throw Error("`resource` must be provided to perform resource queries");let{type:t,id:r}=e["~experimental_resource"];switch(t){case"dataset":if(2!==r.split(".").length)throw Error('Dataset resource ID must be in the format "project.dataset"');return;case"dashboard":case"media-library":case"canvas":return;default:throw Error("Unsupported resource type: ".concat(t.toString()))}},eB=(e,t)=>{if(t["~experimental_resource"])throw Error("`".concat(e,"` does not support resource-based operations"))},eJ=e=>(function(e){let t=!1,r;return function(){for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];return t||(r=e(...i),t=!0),r}})(function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return console.warn(e.join(" "),...r)}),eG=eJ(["Because you set `withCredentials` to true, we will override your `useCdn`","setting to be false since (cookie-based) credentials are never set on the CDN"]),eX=eJ(["Since you haven't set a value for `useCdn`, we will deliver content using our","global, edge-cached API-CDN. If you wish to have content delivered faster, set","`useCdn: false` to use the Live API. Note: You may incur higher costs using the live API."]),eY=eJ(["The Sanity client is configured with the `perspective` set to `drafts` or `previewDrafts`, which doesn't support the API-CDN.","The Live API will be used instead. Set `useCdn: false` in your configuration to hide this warning."]),eQ=eJ(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),eK=eJ(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.","See ".concat(eq("js-client-browser-token")," for more information and how to hide this warning.")]),eZ=eJ(["You have configured Sanity client to use a token, but also provided `withCredentials: true`.","This is no longer supported - only token will be used - remove `withCredentials: true`."]),e0=eJ(["Using the Sanity client without specifying an API version is deprecated.","See ".concat(eq("js-client-api-version"))]),e1=(eJ(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),eJ(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."])),e3={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},e2=["localhost","127.0.0.1","0.0.0.0"];function e6(e){if(Array.isArray(e)&&e.length>1&&e.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}let e4=(e,t)=>{let r,n={...t,...e,stega:{..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||e3.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};n.apiVersion||e0();let i={...e3,...n},s=i.useProjectHostname&&!i["~experimental_resource"];if(typeof Promise>"u"){let e=eq("js-client-promise-polyfill");throw Error("No native Promise-implementation found, polyfill needed - see ".concat(e))}if(s&&!i.projectId)throw Error("Configuration must contain `projectId`");if(i["~experimental_resource"]&&eH(i),"u">typeof i.perspective&&e6(i.perspective),"encodeSourceMap"in i)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in i)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?");
3if("boolean"!=typeof i.stega.enabled)throw Error("stega.enabled must be a boolean, received ".concat(i.stega.enabled));if(i.stega.enabled&&void 0===i.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(i.stega.enabled&&"string"!=typeof i.stega.studioUrl&&"function"!=typeof i.stega.studioUrl)throw Error("stega.studioUrl must be a string or a function, received ".concat(i.stega.studioUrl));let o="u">typeof window&&window.location&&window.location.hostname,a=o&&(r=window.location.hostname,-1!==e2.indexOf(r)),c=!!i.token;i.withCredentials&&c&&(eZ(),i.withCredentials=!1),o&&a&&c&&!0!==i.ignoreBrowserTokenWarning?eK():typeof i.useCdn>"u"&&eX(),s&&(e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")})(i.projectId),i.dataset&&eN(i.dataset),"requestTagPrefix"in i&&(i.requestTagPrefix=i.requestTagPrefix?eV(i.requestTagPrefix).replace(/\.+$/,""):void 0),i.apiVersion="".concat(i.apiVersion).replace(/^v/,""),i.isDefaultApi=i.apiHost===e3.apiHost,!0===i.useCdn&&i.withCredentials&&eG(),i.useCdn=!1!==i.useCdn&&!i.withCredentials,function(e){if("1"===e||"X"===e)return;let t=new Date(e);if(!(/^\d{4}-\d{2}-\d{2}$/.test(e)&&t instanceof Date&&t.getTime()>0))throw Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}(i.apiVersion);let u=i.apiHost.split("://",2),l=u[0],d=u[1],h=i.isDefaultApi?"apicdn.sanity.io":d;return s?(i.url="".concat(l,"://").concat(i.projectId,".").concat(d,"/v").concat(i.apiVersion),i.cdnUrl="".concat(l,"://").concat(i.projectId,".").concat(h,"/v").concat(i.apiVersion)):(i.url="".concat(i.apiHost,"/v").concat(i.apiVersion),i.cdnUrl=i.url),i};class e8 extends Error{constructor(...e){super(...e),this.name="ConnectionFailedError"}}class e7 extends Error{constructor(e,t,r={}){super(e,r),this.name="DisconnectError",this.reason=t}}class e5 extends Error{constructor(e,t){super(e),this.name="ChannelError",this.data=t}}class e9 extends Error{constructor(e,t,r={}){super(e,r),this.name="MessageError",this.data=t}}class te extends Error{constructor(...e){super(...e),this.name="MessageParseError"}}let tt=["channelError","disconnect"];function tr(e,t){return(0,W.v)(()=>{let t=e();return t&&(t instanceof L.c||(0,z.T)(t.lift)&&(0,z.T)(t.subscribe))?t:B(t)}).pipe((0,J.Z)(e=>{var r,n;return r=e,n=t,new L.c(e=>{let t=n.includes("open"),i=n.includes("reconnect");function s(t){if("data"in t){let[r,n]=tn(t);e.error(r?new te("Unable to parse EventSource error message",{cause:n}):new e9((null==n?void 0:n.data).message,n));return}r.readyState===r.CLOSED?e.error(new e8("EventSource connection failed")):i&&e.next({type:"reconnect"})}function o(){e.next({type:"open"})}function a(t){let[n,i]=tn(t);if(n)return void e.error(new te("Unable to parse EventSource message",{cause:n}));if("channelError"===t.type){let t=new URL(r.url).searchParams.get("tag");e.error(new e5(function(e,t){let r=e.error;return r?ek(r)?ej(r,t):r.description?r.description:"string"==typeof r?r:JSON.stringify(r,null,2):e.message||"Unknown listener error"}(null==i?void 0:i.data,t),i.data));return}if("disconnect"===t.type){var s;e.error(new e7("Server disconnected client: ".concat((null==(s=i.data)?void 0:s.reason)||"unknown error")));return}e.next({type:t.type,id:t.lastEventId,...i.data?{data:i.data}:{}})}r.addEventListener("error",s),t&&r.addEventListener("open",o);let c=[...new Set([...tt,...n])].filter(e=>"error"!==e&&"open"!==e&&"reconnect"!==e);return c.forEach(e=>r.addEventListener(e,a)),()=>{r.removeEventListener("error",s),t&&r.removeEventListener("open",o),c.forEach(e=>r.removeEventListener(e,a)),r.close()}})}))}function tn(e){try{let t="string"==typeof e.data&&JSON.parse(e.data);return[null,{type:e.type,id:e.lastEventId,...!function(e){for(let t in e)return!1;return!0}(t)?{data:t}:{}}]}catch(e){return[e,null]}}function ti(e){if("string"==typeof e)return{id:e};if(Array.isArray(e))return{query:"*[_id in $ids]",params:{ids:e}};if("object"==typeof e&&null!==e&&"query"in e&&"string"==typeof e.query)return"params"in e&&"object"==typeof e.params&&null!==e.params?{query:e.query,params:e.params}:{query:e.query};throw Error("Unknown selection - must be one of:\n\n".concat("* Document ID (<docId>)\n* Array of document IDs\n* Object containing `query`"))}class ts{set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return eF("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,t,r){return((e,t,r)=>{let n="insert(at, selector, items)";if(-1===e$.indexOf(e)){let e=e$.map(e=>'"'.concat(e,'"')).join(", ");throw Error("".concat(n,' takes an "at"-argument which is one of: ').concat(e))}if("string"!=typeof t)throw Error("".concat(n,' takes a "selector"-argument which must be a string'));if(!Array.isArray(r))throw Error("".concat(n,' takes an "items"-argument which must be an array'))})(e,t,r),this._assign("insert",{[e]:t,items:r})}append(e,t){return this.insert("after","".concat(e,"[-1]"),t)}prepend(e,t){return this.insert("before","".concat(e,"[0]"),t)}splice(e,t,r,n){let i=t<0?t-1:t,s=typeof r>"u"||-1===r?-1:Math.max(0,t+r),o="".concat(e,"[").concat(i,":").concat(i<0&&s>=0?"":s,"]");return this.insert("replace",o,n||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...ti(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return eF(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},r&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}constructor(e,t={}){this.selection=e,this.operations=t}}var to=new WeakMap;class ta extends ts{clone(){return new ta(this.selection,{...this.operations},i(this,to))}commit(e){if(!i(this,to))throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return i(this,to).mutate({patch:this.serialize()},t)}constructor(e,t,r){super(e,t),s(this,to,{writable:!0,value:void 0}),o(this,to,r)}}var tc=new WeakMap;class tu extends ts{clone(){return new tu(this.selection,{...this.operations},i(this,tc))}commit(e){if(!i(this,tc))throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return i(this,tc).mutate({patch:this.serialize()},t)}constructor(e,t,r){super(e,t),s(this,tc,{writable:!0,value:void 0}),o(this,tc,r)}}let tl={returnDocuments:!1};class td{create(e){return eF("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return eF(t,e),eL(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return eF(t,e),eL(t,e),this._add({[t]:e})}delete(e){return eU("delete",e),this._add({delete:{id:e}})}transactionId(e){return e?(this.trxId=e,this):this.trxId}serialize(){return[...this.operations]}toJSON(){return this.serialize()}reset(){return this.operations=[],this}_add(e){return this.operations.push(e),this}constructor(e=[],t){this.operations=e,this.trxId=t}}var th=new WeakMap;class tf extends td{clone(){return new tf([...this.operations],i(this,th),this.trxId)}commit(e){if(!i(this,th))throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return i(this,th).mutate(this.serialize(),Object.assign({transactionId:this.trxId},tl,e||{}))}patch(e,t){let r="function"==typeof t,n="string"!=typeof e&&e instanceof tu,s="object"==typeof e&&("query"in e||"id"in e);if(n)return this._add({patch:e.serialize()});if(r){let r=t(new tu(e,{},i(this,th)));if(!(r instanceof tu))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(s){let r=new tu(e,t||{},i(this,th));return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}constructor(e,t,r){super(e,r),s(this,th,{writable:!0,value:void 0}),o(this,th,t)}}var tp=new WeakMap;class ty extends td{clone(){return new ty([...this.operations],i(this,tp),this.trxId)}commit(e){if(!i(this,tp))throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return i(this,tp).mutate(this.serialize(),Object.assign({transactionId:this.trxId},tl,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof ta)return this._add({patch:e.serialize()});if(r){let r=t(new ta(e,{},i(this,tp)));if(!(r instanceof ta))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}constructor(e,t,r){super(e,r),s(this,tp,{writable:!0,value:void 0}),o(this,tp,t)}}let tv=e=>{let{query:t,params:r={},options:n={}}=e,i=new URLSearchParams,{tag:s,includeMutations:o,returnQuery:a,...c}=n;for(let[e,n]of(s&&i.append("tag",s),i.append("query",t),Object.entries(r)))void 0!==n&&i.append("$".concat(e),JSON.stringify(n));for(let[e,t]of Object.entries(c))t&&i.append(e,"".concat(t));return!1===a&&i.append("returnQuery","false"),!1===o&&i.append("includeMutations","fal
3se"),"?".concat(i)},tg=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{dryRun:t.dryRun,returnIds:!0,returnDocuments:(e=t.returnDocuments,!1===e?void 0:!!(typeof e>"u")||e),visibility:t.visibility||"sync",autoGenerateArrayKeys:t.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:t.skipCrossDatasetReferenceValidation}},tm=e=>"response"===e.type,tb=e=>e.body;function tw(e,t,n,i){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a="stega"in o?{...n||{},..."boolean"==typeof o.stega?{enabled:o.stega}:o.stega||{}}:n,c=a.enabled?(0,eh.Q)(s):s,u=!1===o.filterResponse?e=>e:e=>e.result,{cache:l,next:d,...h}={useAbortSignal:"u">typeof o.signal,resultSourceMap:a.enabled?"withKeyArraySelector":o.resultSourceMap,...o,returnQuery:!1===o.filterResponse&&!1!==o.returnQuery},f=tP(e,t,"query",{query:i,params:c},"u">typeof l||"u">typeof d?{...h,fetch:{cache:l,next:d}}:h);return a.enabled?f.pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return eb.apply(void 0,(0,ef.fX)([],(0,ef.zs)(e)))}((0,H.H)(r.e(7596).then(r.bind(r,97596)).then(function(e){return e.stegaEncodeSourceMap$1}).then(e=>{let{stegaEncodeSourceMap:t}=e;return t}))),(0,eu.T)(e=>{let[t,r]=e,n=r(t.result,t.resultSourceMap,a);return u({...t,result:n})})):f.pipe((0,eu.T)(u))}function t_(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={uri:tU(e,"doc",(()=>{if(!n.releaseId)return r;let e=(0,e_._S)(r);if(!e){if((0,e_.R8)(r))throw Error("The document ID (`".concat(r,"`) is a draft, but `options.releaseId` is set as `").concat(n.releaseId,"`"));return(0,e_.ct)(r,n.releaseId)}if(e!==n.releaseId)throw Error("The document ID (`".concat(r,"`) is already a version of `").concat(e,"` release, but this does not match the provided `options.releaseId` (`").concat(n.releaseId,"`)"));return r})()),json:!0,tag:n.tag,signal:n.signal,query:void 0!==n.includeAllVersions?{includeAllVersions:n.includeAllVersions}:void 0};return tN(e,t,i).pipe((0,ew.p)(tm),(0,eu.T)(e=>{let t=e.body.documents;return t?n.includeAllVersions?t:t[0]:n.includeAllVersions?[]:void 0}))}function tx(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={uri:tU(e,"doc",r.join(",")),json:!0,tag:n.tag,signal:n.signal};return tN(e,t,i).pipe((0,ew.p)(tm),(0,eu.T)(e=>{let t,n,i=(t=e.body.documents||[],n=e=>e._id,t.reduce((e,t)=>(e[n(t)]=t,e),Object.create(null)));return r.map(e=>i[e]||null)}))}function tE(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return tP(e,t,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},n)}function tS(e,t,r,n){return eL("createIfNotExists",r),tq(e,t,r,"createIfNotExists",n)}function tT(e,t,r,n){return eL("createOrReplace",r),tq(e,t,r,"createOrReplace",n)}function tI(e,t,r,n,i){return eL("createVersion",r),eW("createVersion",r),e1(),tR(e,t,{actionType:"sanity.action.document.version.create",publishedId:n,document:r},i)}function tC(e,t,r,n,i,s,o){if(!n)throw Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw Error("`createVersion()` requires `publishedId` when `baseId` is provided");return eU("createVersion",n),eU("createVersion",r),tR(e,t,{actionType:"sanity.action.document.version.create",publishedId:r,baseId:n,versionId:i?(0,e_.ct)(r,i):(0,e_.T4)(r),ifBaseRevisionId:s},o)}function tk(e,t,r,n){return tP(e,t,"mutate",{mutations:[{delete:ti(r)}]},n)}function tj(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;return tR(e,t,{actionType:"sanity.action.document.version.discard",versionId:r,purge:n},i)}function tO(e,t,r,n){return eL("replaceVersion",r),eW("replaceVersion",r),tR(e,t,{actionType:"sanity.action.document.version.replace",document:r},n)}function tA(e,t,r,n,i){return tR(e,t,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:n},i)}function tM(e,t,r,n){let i;return tP(e,t,"mutate",{mutations:Array.isArray(i=r instanceof tu||r instanceof ta?{patch:r.serialize()}:r instanceof tf||r instanceof ty?r.serialize():r)?i:[i],transactionId:n&&n.transactionId||void 0},n)}function tR(e,t,r,n){let i=Array.isArray(r)?r:[r],s=n&&n.transactionId||void 0;return tP(e,t,"actions",{actions:i,transactionId:s,skipCrossDatasetReferenceValidation:n&&n.skipCrossDatasetReferenceValidation||void 0,dryRun:n&&n.dryRun||void 0},n)}function tP(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s="mutate"===r,o="actions"===r,a=s||o?"":tv(n),c=!s&&!o&&a.length<11264,u=c?a:"",l=i.returnFirst,{timeout:d,token:h,tag:f,headers:p,returnQuery:y,lastLiveEventId:v,cac
3heMode:g}=i,m={method:c?"GET":"POST",uri:tU(e,r,u),json:!0,body:c?void 0:n,query:s&&tg(i),timeout:d,headers:p,token:h,tag:f,returnQuery:y,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(v)?v[0]:v,cacheMode:g,canUseCdn:"query"===r,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn};return tN(e,t,m).pipe((0,ew.p)(tm),(0,eu.T)(tb),(0,eu.T)(e=>{if(!s)return e;let t=e.results||[];if(i.returnDocuments)return l?t[0]&&t[0].document:t.map(e=>e.document);let r=l?t[0]&&t[0].id:t.map(e=>e.id);return{transactionId:e.transactionId,results:t,[l?"documentId":"documentIds"]:r}}))}function tq(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return tP(e,t,"mutate",{mutations:[{[n]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},i))}let tD=e=>void 0!==e.config().dataset&&void 0!==e.config().projectId||void 0!==e.config()["~experimental_resource"],t$=(e,t)=>tD(e)&&t.startsWith(tU(e,"query"));function tN(e,t,r){var n,i,s;let o=r.url||r.uri,a=e.config(),c=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&(o.startsWith("/data/")||t$(e,o)||tD(e)&&o.startsWith(tU(e,"mutate"))||tD(e)&&o.startsWith(tU(e,"doc",""))||tD(e)&&o.startsWith(tU(e,"listen"))||tD(e)&&o.startsWith(tU(e,"history",""))):r.canUseCdn,u=(null!=(n=r.useCdn)?n:a.useCdn)&&c,l=r.tag&&a.requestTagPrefix?[a.requestTagPrefix,r.tag].join("."):r.tag||a.requestTagPrefix;if(l&&null!==r.tag&&(r.query={tag:eV(l),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&t$(e,o)){let e=null!=(i=r.resultSourceMap)?i:a.resultSourceMap;void 0!==e&&!1!==e&&(r.query={resultSourceMap:e,...r.query});let t=r.perspective||a.perspective;"u">typeof t&&("previewDrafts"===t&&eQ(),e6(t),r.query={perspective:Array.isArray(t)?t.join(","):t,...r.query},(Array.isArray(t)&&t.length>0||"previewDrafts"===t||"drafts"===t)&&u&&(u=!1,eY())),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),!1===r.returnQuery&&(r.query={returnQuery:"false",...r.query}),u&&"noStale"==r.cacheMode&&(r.query={cacheMode:"noStale",...r.query})}let d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};e.headers&&Object.assign(r,e.headers);let n=t.token||e.token;n&&(r.Authorization="Bearer ".concat(n)),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let i=!!(typeof t.withCredentials>"u"?e.withCredentials:t.withCredentials),s=typeof t.timeout>"u"?e.timeout:t.timeout;return Object.assign({},t,{headers:Object.assign({},r,t.headers||{}),timeout:typeof s>"u"?3e5:s,proxy:t.proxy||e.proxy,json:!0,withCredentials:i,fetch:"object"==typeof t.fetch&&"object"==typeof e.fetch?{...e.fetch,...t.fetch}:t.fetch||e.fetch})}(a,Object.assign({},r,{url:tL(e,o,u)})),h=new L.c(e=>t(d,a.requester).subscribe(e));return r.signal?h.pipe((s=r.signal,e=>new L.c(t=>{let r=()=>t.error(function(e){var t,r;if(tW)return new DOMException(null!=(t=null==e?void 0:e.reason)?t:"The operation was aborted.","AbortError");let n=Error(null!=(r=null==e?void 0:e.reason)?r:"The operation was aborted.");return n.name="AbortError",n}(s));if(s&&s.aborted)return void r();let n=e.subscribe(t);return s.addEventListener("abort",r),()=>{s.removeEventListener("abort",r),n.unsubscribe()}}))):h}function tF(e,t,r){return tN(e,t,r).pipe((0,ew.p)(e=>"response"===e.type),(0,eu.T)(e=>e.body))}function tU(e,t,r){let n=e.config();if(n["~experimental_resource"]){eH(n);let e=tz(n),i=void 0!==r?"".concat(t,"/").concat(r):t;return"".concat(e,"/").concat(i).replace(/\/($|\?)/,"$1")}let i=ez(n),s="/".concat(t,"/").concat(i);return"/data".concat(void 0!==r?"".concat(s,"/").concat(r):s).replace(/\/($|\?)/,"$1")}function tL(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{url:n,cdnUrl:i}=e.config();return"".concat(r?i:n,"/").concat(t.replace(/^\//,""))}let tW=!!globalThis.DOMException,tz=e=>{if(!e["~experimental_resource"])throw Error("`resource` must be provided to perform resource queries");let{type:t,id:r}=e["~experimental_resource"];switch(t){case"dataset":{let e=r.split(".");if(2!==e.length)throw Error('Dataset ID must be in the format "project.dataset"');return"/projects/".concat(e[0],"/datasets/").concat(e[1])}case"canvas":return"/canvases/".concat(r);case"media-library":return"/media-libraries/".concat(r);case"dashboard":return"/dashboards/".concat(r);default:throw Error("Unsupported resource type: ".concat(t.toString()))}};function tV(e,t,r){let n=ez(e.config());return tF(e,t,{method:"POST",uri:"/agent/action/generate/".concat(n),body:r})}function tH(e,t,r){let n=ez(e.config());return tF(e,t,{method:"POST",uri:"/agent/action/transform/".concat(n),body:r})}function tB(e,t,r){let n=ez(e.config());return tF(e,t,{method:"POST",uri:"/agent/action/translate/".concat(n),body:r})}var tJ=new WeakMap,tG=new WeakMap;class tX{generate(e){return tV(i(this,tJ),i(this,tG),e)}transform(e){return tH(i(this,tJ),i(this,tG),e)}translate(e){return tB(i(this,tJ),i(this,tG),e)}constructor(e,t){s(this,tJ,{writable:!0,value:void 0}),s(this,tG,{writable:!0,value:void 0}),o(this,tJ,e),o(this,tG,t)}}var tY=new WeakMap,tQ=new WeakMap;class tK{generate(e){return X(tV(i(this,tY),i(this,tQ),e))}transform(e){return X(tH(i(this,tY),i(this,tQ),e))}translate(e){return X(tB(i(this,tY),i(this,tQ),e))}prompt(e){return X(function(e,t,r){let n=ez(e.config());return tF(e,t,{method:"POST",uri:"/agent/action/prompt/".concat(n),body:r})}(i(this,tY),i(this,tQ),e))}patch(e){return X(function(e,t,r){let n=ez(e.config());return tF(e,t,{method:"POST",uri:"/agent/action/patch/".concat(n),body:r})}(i(this,tY),i(this,tQ),e))}constructor(e,t){s(this,tY,{writable:!0,value:void 0}),s(this,tQ,{writable:!0,value:void 0}),o(this,tY,e),o(this,tQ,t)}}var tZ=new WeakMap,t0=new WeakMap;class t1{upload(e,t,r){return t4(i(this,tZ),i(this,t0),e,t,r)}constructor(e,t){s(this,tZ,{writable:!0,value:void 0}),s(this,t0,{writable:!0,value:void 0}),o(this,tZ,e),o(this,t0,t)}}var t3=new WeakMap,t2=new WeakMap;class t6{upload(e,t,r){return X(t4(i(this,t3),i(this,t2),e,t,r).pipe((0,ew.p)(e=>"response"===e.type),(0,eu.T)(e=>e.body.document)))}constructor(e,t){s(this,t3,{writable:!0,value:void 0}),s(this,t2,{writable:!0,value:void 0}),o(this,t3,e),o(this,t2,t)}}function t4(e,t,r,n){var i,s;let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(-1===eD.indexOf(r))throw Error("Invalid asset type: ".concat(r,". Must be one of ").concat(eD.join(", ")));let a=o.extract||void 0;a&&!a.length&&(a=["none"]);let c=e.config(),u=(i=o,s=n,!(typeof File>"u")&&s instanceof File?Object.assign({filename:!1===i.preserveFilename?void 0:s.name,contentType:s.type},i):i),{tag:l,label:d,title:h,description:f,creditLine:p,filename:y,source:v}=u,g={label:d,title:h,description:f,filename:y,meta:a,creditLine:p};return v&&(g.sourceId=v.id,g.sourceName=v.name,g.sourceUrl=v.url),tN(e,t,{tag:l,method:"POST",timeout:u.timeout||0,uri:function(e,t){let r="image"===t?"images":"files";if(e["~experimental_resource"]){let{type:t,id:n}=e["~experimental_resource"];switch(t){case"dataset":throw Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return"/canvases/".concat(n,"/assets/").concat(r);case"media-library":return"/media-libraries/".concat(n,"/upload");case"dashboard":return"/dashboards/".concat(n,"/assets/").concat(r);default:throw Error("Unsupported resource type: ".concat(t.toString()))}}let n=ez(e);return"assets/".concat(r,"/").concat(n)}(c,r),headers:u.contentType?{"Content-Type":u.contentType}:{},query:g,body:n})}let t8=(0,W.v)(()=>r.e(2238).then(r.t.bind(r,32238,19))).pipe((0,eu.T)(e=>{let{default:t}=e;return t}),(0,Y.t)(1));function t7(){return function(e){return e.pipe(ee((e,t)=>{var r;return e instanceof e8?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];
3return(0,et.U)(1)((0,H.H)(e,(0,V.lI)(e)))}(B({type:"reconnect"}),(void 0===r&&(r=en),new L.c(function(e){var t=1e3;t<0&&(t=0);var n=0;return r.schedule(function(){e.closed||(e.next(n++),e.complete())},t)})).pipe((0,J.Z)(()=>t))):ei(()=>e)}))}}let t5=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","tag"],t9={includeResult:!0};function re(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{url:n,token:i,withCredentials:s,requestTagPrefix:o,headers:a}=this.config(),c=r.tag&&o?[o,r.tag].join("."):r.tag,u={...Object.keys(t9).concat(Object.keys(r)).reduce((e,t)=>(e[t]=typeof r[t]>"u"?t9[t]:r[t],e),{}),tag:c},l=tv({query:e,params:t,options:{tag:c,...t5.reduce((e,t)=>(typeof u[t]>"u"||(e[t]=u[t]),e),{})}}),d="".concat(n).concat(tU(this,"listen",l));if(d.length>14800)return ei(()=>Error("Query too large for listener"));let h=u.events?u.events:["mutation"],f={};return s&&(f.withCredentials=!0),(i||a)&&(f.headers={},i&&(f.headers.Authorization="Bearer ".concat(i)),a&&Object.assign(f.headers,a)),tr(()=>(typeof EventSource>"u"||f.headers?t8:B(EventSource)).pipe((0,eu.T)(e=>new e(d,f))),h).pipe(t7(),(0,ew.p)(e=>h.includes(e.type)),(0,eu.T)(e=>({type:e.type,..."data"in e?e.data:{}})))}let rt="2021-03-25";var rr=new WeakMap;class rn{events(){var e,t,r,n;let{includeDrafts:s=!1,tag:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eB("live",i(this,rr).config());let{projectId:a,apiVersion:c,token:u,withCredentials:l,requestTagPrefix:d,headers:h}=i(this,rr).config(),f=c.replace(/^v/,"");if("X"!==f&&f<rt)throw Error("The live events API requires API version ".concat(rt," or later. The current API version is ").concat(f,". Please update your API version to use this feature."));if(s&&!u&&!l)throw Error("The live events API requires a token or withCredentials when 'includeDrafts: true'. Please update your client configuration. The token should have the lowest possible access role.");let p=tU(i(this,rr),"live/events"),y=new URL(i(this,rr).getUrl(p,!1)),v=o&&d?[d,o].join("."):o;v&&y.searchParams.set("tag",v),s&&y.searchParams.set("includeDrafts","true");let g={};s&&l&&(g.withCredentials=!0),(s&&u||h)&&(g.headers={},s&&u&&(g.headers.Authorization="Bearer ".concat(u)),h&&Object.assign(g.headers,h));let m="".concat(y.href,"::").concat(JSON.stringify(g)),b=ri.get(m);if(b)return b;let w=tr(()=>(typeof EventSource>"u"||g.headers?t8:B(EventSource)).pipe((0,eu.T)(e=>new e(y.href,g))),["message","restart","welcome","reconnect","goaway"]),_=(t=y,r={method:"OPTIONS",mode:"cors",credentials:g.withCredentials?"include":"omit",headers:g.headers},new L.c(e=>{let n=new AbortController,i=n.signal;return fetch(t,{...r,signal:n.signal}).then(t=>{e.next(t),e.complete()},t=>{i.aborted||e.error(t)}),()=>n.abort()})).pipe(ee(()=>{throw new eA({projectId:a})})),x=w.pipe(t7(),(0,J.Z)(e=>"reconnect"===e.type?_.pipe((0,J.Z)(()=>B(e))):B(e)),ee(e=>_.pipe((0,J.Z)(()=>{throw e}))),(0,eu.T)(e=>{if("message"===e.type){let{data:t,...r}=e;return{...r,tags:t.tags}}return e})).pipe(eo(()=>ri.delete(m)),(n="function"==typeof(e={predicate:e=>"welcome"===e.type})?{predicate:e,...void 0}:e,e=>{var t,r,i,s;let o,a=!1,{predicate:c,...u}=n,l=e.pipe((t=e=>{n.predicate(e)&&(a=!0,o=e)},(s=(0,z.T)(t)?{next:t,error:r,complete:i}:t)?(0,Z.N)(function(e,t){null==(r=s.subscribe)||r.call(s);var r,n=!0;e.subscribe((0,K._)(t,function(e){var r;null==(r=s.next)||r.call(s,e),t.next(e)},function(){var e;n=!1,null==(e=s.complete)||e.call(s),t.complete()},function(e){var r;n=!1,null==(r=s.error)||r.call(s,e),t.error(e)},function(){var e,t;n&&(null==(e=s.unsubscribe)||e.call(s)),null==(t=s.finalize)||t.call(s)}))}):es.D),eo(()=>{a=!1,o=void 0}),(0,ea.u)(u)),d=new L.c(e=>{a&&e.next(o),e.complete()});return(0,ec.h)(l,d)}));return ri.set(m,x),x}constructor(e){s(this,rr,{writable:!0,value:void 0}),o(this,rr,e)}}let ri=new Map;var rs=new WeakMap,ro=new WeakMap;class ra{create(e,t){return rd(i(this,rs),i(this,ro),"PUT",e,t)}edit(e,t){return rd(i(this,rs),i(this,ro),"PATCH",e,t)}
3delete(e){return rd(i(this,rs),i(this,ro),"DELETE",e)}list(){eB("dataset",i(this,rs).config());let e=i(this,rs).config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r="/projects/".concat(t,"/datasets")),tF(i(this,rs),i(this,ro),{uri:r,tag:null})}constructor(e,t){s(this,rs,{writable:!0,value:void 0}),s(this,ro,{writable:!0,value:void 0}),o(this,rs,e),o(this,ro,t)}}var rc=new WeakMap,ru=new WeakMap;class rl{create(e,t){return eB("dataset",i(this,rc).config()),X(rd(i(this,rc),i(this,ru),"PUT",e,t))}edit(e,t){return eB("dataset",i(this,rc).config()),X(rd(i(this,rc),i(this,ru),"PATCH",e,t))}delete(e){return eB("dataset",i(this,rc).config()),X(rd(i(this,rc),i(this,ru),"DELETE",e))}list(){eB("dataset",i(this,rc).config());let e=i(this,rc).config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r="/projects/".concat(t,"/datasets")),X(tF(i(this,rc),i(this,ru),{uri:r,tag:null}))}constructor(e,t){s(this,rc,{writable:!0,value:void 0}),s(this,ru,{writable:!0,value:void 0}),o(this,rc,e),o(this,ru,t)}}function rd(e,t,r,n,i){return eB("dataset",e.config()),eN(n),tF(e,t,{method:r,uri:"/datasets/".concat(n),body:i,tag:null})}var rh=new WeakMap,rf=new WeakMap;class rp{getPlaybackInfo(e){var t,r,n;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null==(t=i(this,rh).config()["~experimental_resource"])?void 0:t.id,{instanceId:a,libraryId:c}=function(e){let t="object"==typeof e&&"_ref"in e?e._ref:e,r=rm.exec(t);if(r){let[,e,t]=r;return{libraryId:e,instanceId:t}}if("string"==typeof e&&e.startsWith("video-"))return{instanceId:e};throw Error('Invalid video asset instance identifier "'.concat(t,'": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library'))}(e),u=c||o;if(!u)throw Error("Could not determine Media Library ID - you need to provide a valid Media Library ID in the client config or a Media Library GDR");let l=(r=a,n=u,"/media-libraries/".concat(n,"/video/").concat(r,"/playback-info")),d=function(e){let t={};if(e.transformations){let{thumbnail:r,animated:n,storyboard:i}=e.transformations;r&&(r.width&&(t.thumbnailWidth=r.width),r.height&&(t.thumbnailHeight=r.height),void 0!==r.time&&(t.thumbnailTime=r.time),r.fit&&(t.thumbnailFit=r.fit),r.format&&(t.thumbnailFormat=r.format)),n&&(n.width&&(t.animatedWidth=n.width),n.height&&(t.animatedHeight=n.height),void 0!==n.start&&(t.animatedStart=n.start),void 0!==n.end&&(t.animatedEnd=n.end),n.fps&&(t.animatedFps=n.fps),n.format&&(t.animatedFormat=n.format)),i&&i.format&&(t.storyboardFormat=i.format)}return e.expiration&&(t.expiration=e.expiration),t}(s);return tF(i(this,rh),i(this,rf),{method:"GET",uri:l,query:d})}constructor(e,t){s(this,rh,{writable:!0,value:void 0}),s(this,rf,{writable:!0,value:void 0}),o(this,rh,e),o(this,rf,t)}}var ry=new WeakMap,rv=new WeakMap;class rg{getPlaybackInfo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return X(new rp(i(this,ry).observable,i(this,rv)).getPlaybackInfo(e,t))}constructor(e,t){s(this,ry,{writable:!0,value:void 0}),s(this,rv,{writable:!0,value:void 0}),o(this,ry,e),o(this,rv,t)}}let rm=/^media-library:(ml[^:]+):([^:]+)$/;var rb=new WeakMap,rw=new WeakMap;class r_{list(e){let t={};return(null==e?void 0:e.includeMembers)===!1&&(t.includeMembers="false"),(null==e?void 0:e.organizationId)&&(t.organizationId=e.organizationId),tF(i(this,rb),i(this,rw),{uri:"/projects",query:t})}getById(e){return tF(i(this,rb),i(this,rw),{uri:"/projects/".concat(e)})}constructor(e,t){s(this,rb,{writable:!0,value:void 0}),s(this,rw,{writable:!0,value:void 0}),o(this,rb,e),o(this,rw,t)}}var rx=new WeakMap,rE=new WeakMap;class rS{list(e){let t={};return(null==e?void 0:e.includeMembers)===!1&&(t.includeMembers="false"),(null==e?void 0:e.organizationId)&&(t.organizationId=e.organizationId),X(tF(i(this,rx),i(this,rE),{uri:"/projects",query:t}))}getById(e){return X(tF(i(this,rx),i(this,rE),{uri:"/projects/".concat(e)}))}constructor(e,t){s(this,rx,{writable:!0,value:void 0}),s(this,rE,{writable:!0,value:void 0}),o(this,rx,e),o(this,rE,t)}}let rT=((e,t=21)=>((e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return (s=t)=>{let o="";for(;;){let t=r(i),a=0|i;for(;a--;)if((o+=e[t[a]&n]||"").length===s)return o}}})(e,t,ex))("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),rI=(e,t)=>t?(0,e_.ct)(e,t):(0,e_.T4)(e);function rC(e,t){let{releaseId:r,publishedId:n,document:i}=t;if(n&&i._id){let e=rI(n,r);return((e,t)=>{if(t._id&&t._id!==e)throw Error("The provided document ID (`".concat(t._id,"`) does not match the generated ver
3sion ID (`").concat(e,"`)"))})(e,i),e}if(i._id){let t=(0,e_.R8)(i._id),n=(0,e_.A_)(i._id);if(!t&&!n)throw Error("`".concat(e,"()` requires a document with an `_id` that is a version or draft ID"));if(r){if(t)throw Error("`".concat(e,"()` was called with a document ID (`").concat(i._id,"`) that is a draft ID, but a release ID (`").concat(r,"`) was also provided."));let n=(0,e_._S)(i._id);if(n!==r)throw Error("`".concat(e,"()` was called with a document ID (`").concat(i._id,"`) that is a version ID, but the release ID (`").concat(r,"`) does not match the document's version ID (`").concat(n,"`)."))}return i._id}if(n)return rI(n,r);throw Error("`".concat(e,"()` requires either a publishedId or a document with an `_id`"))}let rk=(e,t)=>{let[r,n,i]=((e,t)=>{if("object"==typeof e&&null!==e&&("releaseId"in e||"metadata"in e)){let{releaseId:r=rT(),metadata:n={}}=e;return[r,n,t]}return[rT(),{},e]})(e,t);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...n,releaseType:n.releaseType||"undecided"}},options:i}};var rj=new WeakMap,rO=new WeakMap;class rA{get(e,t){let{releaseId:r}=e;return t_(i(this,rj),i(this,rO),"_.releases.".concat(r),t)}create(e,t){let{action:r,options:n}=rk(e,t),{releaseId:s,metadata:o}=r;return tR(i(this,rj),i(this,rO),r,n).pipe((0,eu.T)(e=>({...e,releaseId:s,metadata:o})))}edit(e,t){let{releaseId:r,patch:n}=e;return tR(i(this,rj),i(this,rO),{actionType:"sanity.action.release.edit",releaseId:r,patch:n},t)}publish(e,t){let{releaseId:r}=e;return tR(i(this,rj),i(this,rO),{actionType:"sanity.action.release.publish",releaseId:r},t)}archive(e,t){let{releaseId:r}=e;return tR(i(this,rj),i(this,rO),{actionType:"sanity.action.release.archive",releaseId:r},t)}unarchive(e,t){let{releaseId:r}=e;return tR(i(this,rj),i(this,rO),{actionType:"sanity.action.release.unarchive",releaseId:r},t)}schedule(e,t){let{releaseId:r,publishAt:n}=e;return tR(i(this,rj),i(this,rO),{actionType:"sanity.action.release.schedule",releaseId:r,publishAt:n},t)}unschedule(e,t){let{releaseId:r}=e;return tR(i(this,rj),i(this,rO),{actionType:"sanity.action.release.unschedule",releaseId:r},t)}delete(e,t){let{releaseId:r}=e;return tR(i(this,rj),i(this,rO),{actionType:"sanity.action.release.delete",releaseId:r},t)}fetchDocuments(e,t){let{releaseId:r}=e;return tE(i(this,rj),i(this,rO),r,t)}constructor(e,t){s(this,rj,{writable:!0,value:void 0}),s(this,rO,{writable:!0,value:void 0}),o(this,rj,e),o(this,rO,t)}}var rM=new WeakMap,rR=new WeakMap;class rP{get(e,t){let{releaseId:r}=e;return X(t_(i(this,rM),i(this,rR),"_.releases.".concat(r),t))}async create(e,t){let{action:r,options:n}=rk(e,t),{releaseId:s,metadata:o}=r;return{...await X(tR(i(this,rM),i(this,rR),r,n)),releaseId:s,metadata:o}}edit(e,t){let{releaseId:r,patch:n}=e;return X(tR(i(this,rM),i(this,rR),{actionType:"sanity.action.release.edit",releaseId:r,patch:n},t))}publish(e,t){let{releaseId:r}=e;return X(tR(i(this,rM),i(this,rR),{actionType:"sanity.action.release.publish",releaseId:r},t))}archive(e,t){let{releaseId:r}=e;return X(tR(i(this,rM),i(this,rR),{actionType:"sanity.action.release.archive",releaseId:r},t))}unarchive(e,t){let{releaseId:r}=e;return X(tR(i(this,rM),i(this,rR),{actionType:"sanity.action.release.unarchive",releaseId:r},t))}schedule(e,t){let{releaseId:r,publishAt:n}=e;return X(tR(i(this,rM),i(this,rR),{actionType:"sanity.action.release.schedule",releaseId:r,publishAt:n},t))}unschedule(e,t){let{releaseId:r}=e;return X(tR(i(this,rM),i(this,rR),{actionType:"sanity.action.release.unschedule",releaseId:r},t))}delete(e,t){let{releaseId:r}=e;return X(tR(i(this,rM),i(this,rR),{actionType:"sanity.action.release.delete",releaseId:r},t))}fetchDocuments(e,t){let{releaseId:r}=e;return X(tE(i(this,rM),i(this,rR),r,t))}constructor(e,t){s(this,rM,{writable:!0,value:void 0}),s(this,rR,{writable:!0,value:void 0}),o(this,rM,e),o(this,rR,t)}}var rq=new WeakMap,rD=new WeakMap;class r${getById(e){return tF(i(this,rq),i(this,rD),{uri:"/users/".concat(e)})}constructor(e,t){s(this,rq,{writable:!0,value:void 0}),s(this,rD,{writable:!0,value:void 0}),o(this,rq,e),o(this,rD,t)}}var rN=new WeakMap,rF=new WeakMap;class rU{getById(e){return X(tF(i(this,rN),i(this,rF),{uri:"/users/".concat(e)}))}constructor(e,t){s(this,rN,{writable:!0,value:void 0}),s(this,rF,{writable:!0,value:void 0}),o(this,rN,e),o(this,rF,t)}}var rL=new WeakMap,rW=new WeakMap;class rz{clone(){return new rz(i(this,rW),this.config())}config(e){if(void 0===e)return{...i(this,rL)};if(i(this,rL)&&!1===i(this,rL).allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return o(this,rL,e4(e,i(this,rL)||{})),this}withConfig(e){let t=this.config();return new rz(i(this,rW),{...t,...e,stega:{...t.stega||{},..."boolean"==typeof(null==e?void 0:e.stega)?{enabled:e.stega}:(null==e?void 0:e.stega)||{}}})}fetch(e,t,r){return tw(this,i(this,rW),i(this,rL).stega,e,t,r)}getDocument(e,t){if((null==t?void 0:t.includeAllVersions)===!0)return t_(this,i(this,rW),e,{...t,includeAllVersions:!0});let r={signal:null==t?void 0:t.signal,tag:null==t?void 0:t.tag,releaseId:null==t?void 0:t.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return t_(this,i(this,rW),e,r)}getDocuments(e,t){return tx(this,i(this,rW),e,t)}create(e,t){return tq(this,i(this,rW),e,"create",t)}createIfNotExists(e,t){return tS(this,i(this,rW),e,t)}createOrReplace(e,t){return tT(this,i(this,rW),e,t)}createVersion(e,t){let{document:r,publishedId:n,releaseId:s,baseId:o,ifBaseRevisionId:a}=e;if(!r)return tC(this,i(this,rW),n,o,s,a,t);let c=rC("createVersion",{document:r,publishedId:n,releaseId:s}),u={...r,_id:c},l=n||(0,e_.IM)(r._id);return tI(this,i(this,rW),u,l,t)}delete(e,t){return tk(this,i(this,rW),e,t)}discardVersion(e,t,r){let{releaseId:n,publishedId:s}=e,o=rI(s,n);return tj(this,i(this,rW),o,t,r)}replaceVersion(e,t){let{document:r,publishedId:n,releaseId:s}=e,o=rC("replaceVersion",{document:r,publishedId:n,releaseId:s}),a={...r,_id:o};return tO(this,i(this,rW),a,t)}unpublishVersion(e,t){let{releaseId:r,publishedId:n}=e,s=(0,e_.ct)(n,r);return tA(this,i(this,rW),s,n,t)}mutate(e,t){return tM(this,i(this,rW),e,t)}patch(e,t){return new ta(e,t,this)}transaction(e){return new ty(e,this)}action(e,t){return tR(this,i(this,rW),e,t)}request(e){return tF(this,i(this,rW),e)}getUrl(e,t){return tL(this,e,t)}getDataUrl(e,t){return tU(this,e,t)}constructor(e,t=e3){s(this,rL,{writable:!0,value:void 0}),s(this,rW,{writable:!0,value:void 0}),this.listen=re,this.config(t),o(this,rW,e),this.assets=new t1(this,i(this,rW)),this.datasets=new ra(this,i(this,rW)),this.live=new rn(this),this.mediaLibrary={video:new rp(this,i(this,rW))},this.projects=new r_(this,i(this,rW)),this.users=new r$(this,i(this,rW)),this.agent={action:new tX(this,i(this,rW))},this.releases=new rA(this,i(this,rW))}}var rV=new WeakMap,rH=new WeakMap;class rB{clone(){return new rB(i(this,rH),this.config())}config(e){if(void 0===e)return{...i(this,rV)};if(i(this,rV)&&!1===i(this,rV).allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),o(this,rV,e4(e,i(this,rV)||{})),this}withConfig(e){let t=this.config();return new rB(i(this,rH),{...t,...e,stega:{...t.stega||{},..."boolean"==typeof(null==e?void 0:e.stega)?{enabled:e.stega}:(null==e?void 0:e.stega)||{}}})}fetch(e,t,r){return X(tw(this,i(this,rH),i(this,rV).stega,e,t,r))}getDocument(e,t){if((null==t?void 0:t.includeAllVersions)===!0)return X(t_(this,i(this,rH),e,{...t,includeAllVersions:!0}));let r={signal:null==t?void 0:t.signal,tag:null==t?void 0:t.tag,releaseId:null==t?void 0:t.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return X(t_(this,i(this,rH),e,r))}getDocuments(e,t){return X(tx(this,i(this,rH),e,t))}create(e,t){return X(tq(this,i(this,rH),e,"create",t))}createIfNotExists(e,t){return X(tS(this,i(this,rH),e,t))}createOrReplace(e,t){return X(tT(this,i(this,rH),e,t))}createVersion(e,t){let{document:r,publishedId:n,releaseId:s,baseId:o,ifBaseRevisionId:a}=e;if(!r)return ed(tC(this,i(this,rH),n,o,s,a,t));let c=rC("createVersion",{document:r,publishedId:n,releaseId:s}),u={...r,_id:c},l=n||(0,e_.IM)(r._id);return ed(tI(this,i(this,rH),u,l,t))}delete(e,t){return X(tk(this,i(this,rH),e,t))}discardVersion(e,t,r){let{releaseId:n,publishedId:s}=e,o=rI(s,n);return X(tj(this,i(this,rH),o,t,r))}replaceVersion(e,t){let{document:r,publishedId:n,releaseId:s}=e,o=rC("replaceVersion",{document:r,publishedId:n,releaseId:s}),a={...r,_id:o};return ed(tO(this,i(this,rH),a,t))}unpublishVersion(e,t){let{releaseId:r,publishedId:n}=e,s=(0,e_.ct)(n,r);return X(tA(this,i(this,rH),s,n,t))}mutate(e,t){return X(tM(this,i(this,rH),e,t))}patch(e,t){return new tu(e,t,this)}transaction(e){return new tf(e,this)}action(e,t){return X(tR(this,i(this,rH),e,t))}request(e){return X(tF(this,i(this,rH),e))}dataRequest(e,t,r){return X(tP(this,i(this,rH),e,t,r))}getUrl(e,t){return tL(this,e,t)}getDataUrl(e,t){return tU(this,e,t)}constructor(e,t=e3){s(this,rV,{writable:!0,value:void 0}),s(this,rH,{writable:!0,value:void 0}),this.listen=re,this.config(t),o(this,rH,e),this.assets=new t6(this,i(this,rH)),this.datasets=new rl(this,i(this,rH)),this.live=new rn(this),this.mediaLibrary={video:new rg(this,i(this,rH))},this.projects=new rS(this,i(this,rH)),this.users=new rU(this,i(this,rH)),this.agent={action:new tK(this,i(this,rH))},this.releases=new rP(this,i(this,rH)),this.observable=new rz(e,t)}}let rJ=function(e,t){return{requester:eR(e),createClient:r=>{let n=eR(e,{ignoreWarnings:r.ignoreWarnings});return new t((e,t)=>
3(t||n)({maxRedirects:0,maxRetries:r.maxRetries,retryDelay:r.retryDelay,lineage:r.lineage,...e}),r)}}}([],rB),rG=(rJ.requester,rJ.createClient)},33287:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return o},createAsyncLocalStorage:function(){return s},createSnapshot:function(){return a}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let i="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function s(){return i?new i:new n}function o(e){return i?i.bind(e):n.bind(e)}function a(){return i?i.snapshot():function(e,...t){return e(...t)}}},34090:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=r(66825)},35164:(e,t,r)=>{r.d(t,{T:()=>s});var n=r(48160),i=r(22372);function s(e,t){return(0,n.N)(function(r,n){var s=0;r.subscribe((0,i._)(n,function(r){n.next(e.call(t,r,s++))}))})}},40133:(e,t,r)=>{r.d(t,{m:()=>o});var n=r(47097),i=r(66312),s=r(75131),o=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=s.U);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return(0,n.C6)(t,e),t.prototype.next=function(t){var r=this.isStopped,n=this._buffer,i=this._infiniteTimeWindow,s=this._timestampProvider,o=this._windowTime;!r&&(n.push(t),i||n.push(s.now()+o)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,i=(n?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!n){for(var s=t.now(),o=0,a=1;a<r.length&&r[a]<=s;a+=2)o=a;o&&r.splice(0,o+1)}},t}(i.B)},41172:(e,t,r)=>{r.d(t,{s:()=>n});var n="function"==typeof Symbol&&Symbol.observable||"@@observable"},41229:(e,t,r)=>{r.d(t,{T:()=>i});var n=r(82765);function i(e){return Symbol.asyncIterator&&(0,n.T)(null==e?void 0:e[Symbol.asyncIterator])}},45020:(e,t,r)=>{r.d(t,{Y:()=>s,l:()=>o});var n=r(89250),i=null;function s(e){if(n.$.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,s=r.errorThrown,o=r.error;if(i=null,s)throw o}}else e()}function o(e){n.$.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},48160:(e,t,r)=>{r.d(t,{N:()=>i});var n=r(82765);function i(e){return function(t){if((0,n.T)(null==t?void 0:t.lift))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}},50319:(e,t,r)=>{let n;r.d(t,{V2:()=>N,FS:()=>L,IM:()=>V,Tx:()=>W,Rr:()=>z,vd:()=>U,_K:()=>F,CC:()=>$,RM:()=>J,Uc:()=>B,tP:()=>H});let i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},s=new Uint8Array(16),o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));let a=function(e,t,r){if(i.randomUUID&&!t&&!e)return i.randomUUID();let a=(e=e||{}).random??e.rng?.()??function(){if(!n){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");n=crypto.getRandomValues.bind(crypto)}return n(s)}();if(a.length<16)throw Error("Random bytes length must be >= 16");if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){if((r=r||0)<0||r+16>t.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=a[e];return t}
3return function(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}(a)};var c=r(18946),u=r(57554),l=r(15151),d=r(50688),h=r(623),f=r(61486),p=r(47097),y=r(11610),v=r(72465),g=r(14896),m=r(26973),b=r(82765),w=r(91076),_=["addListener","removeListener"],x=["addEventListener","removeEventListener"],E=["on","off"];function S(e,t,r,n){if((0,b.T)(r)&&(n=r,r=void 0),n)return S(e,t,r).pipe((0,w.I)(n));var i,s,o,a=(0,p.zs)((i=e,(0,b.T)(i.addEventListener)&&(0,b.T)(i.removeEventListener))?x.map(function(n){return function(i){return e[n](t,i,r)}}):(s=e,(0,b.T)(s.addListener)&&(0,b.T)(s.removeListener))?_.map(T(e,t)):(o=e,(0,b.T)(o.on)&&(0,b.T)(o.off))?E.map(T(e,t)):[],2),c=a[0],u=a[1];if(!c&&(0,m.X)(e))return(0,g.Z)(function(e){return S(e,t,r)})((0,y.Tg)(e));if(!c)throw TypeError("Invalid event target");return new v.c(function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return c(t),function(){return u(t)}})}function T(e,t){return function(r){return function(n){return e[r](t,n)}}}var I=r(35164),C=r(11173),k=r(63872),j=r(48160),O=r(22372),A=r(12848),M=r(175);function R(e){return e<=0?function(){return M.w}:(0,j.N)(function(t,r){var n=0;t.subscribe((0,O._)(r,function(t){++n<=e&&(r.next(t),e<=n&&r.complete())}))})}var P=r(21253);let q=e=>({context:t})=>{let{count:r,include:n,exclude:i,responseType:s="message.received"}=e;return{count:r,domain:t.domain,from:t.connectTo,include:n?Array.isArray(n)?n:[n]:[],exclude:i?Array.isArray(i)?i:[i]:[],responseType:s,target:t.target,to:t.name}},D=(0,f.v)(()=>S(window,"message")),$=e=>(0,c.OX)(({input:t})=>{let r;return D.pipe(e?(0,I.T)(e):(0,C.F)(),(0,k.p)((e=>t=>{let{data:r}=t;return(!e.include.length||e.include.includes(r.type))&&(!e.exclude.length||!e.exclude.includes(r.type))&&r.domain===e.domain&&r.from===e.from&&r.to===e.to&&(!e.target||t.source===e.target)})(t)),(0,I.T)((r=t.responseType,e=>({type:r,message:e}))),t.count?(0,C.F)(function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,(0,j.N)(function(r,n){var i=[],s=0;r.subscribe((0,O._)(n,function(r){var o,a,c,u,l=null;s++%t==0&&i.push([]);try{for(var d=(0,p.Ju)(i),h=d.next();!h.done;h=d.next()){var f=h.value;f.push(r),e<=f.length&&(l=null!=l?l:[]).push(f)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}if(l)try{for(var y=(0,p.Ju)(l),v=y.next();!v.done;v=y.next()){var f=v.value;(0,A.o)(i,f),n.next(f)}}catch(e){c={error:e}}finally{try{v&&!v.done&&(u=y.return)&&u.call(y)}finally{if(c)throw c.error}}},function(){var e,t;try{for(var r=(0,p.Ju)(i),s=r.next();!s.done;s=r.next()){var o=s.value;n.next(o)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}n.complete()},void 0,function(){i=null}))})}(t.count),function(e,t){return(0,b.T)(void 0)?(0,g.Z)(e,void 0,1):(0,g.Z)(e,1)}(e=>e),R(t.count)):(0,C.F)())}),N="sanity/comlink",F="comlink/response",U="comlink/heartbeat",L="comlink/disconnect",W="comlink/handshake/syn",z="comlink/handshake/syn-ack",V="comlink/handshake/ack",H=()=>(0,u.mj)({types:{},actors:{listen:(0,c.OX)(({input:e})=>{let t,r=e.signal?S(e.signal,"abort").pipe((t=`Request ${e.requestId} aborted`,e=>e.pipe(R(1),(0,I.T)(()=>{throw Error(t)})))):M.w;return S(window,"message").pipe((0,k.p)(t=>t.data?.type===F&&t.data?.responseTo===e.requestId&&!!t.source&&e.sources.has(t.source)),R(e.sources.size),(0,j.N)(function(e,t){(0,y.Tg)(r).subscribe((0,O._)(t,function(){return t.complete()},P.l)),t.closed||e.subscribe(t)}))})},actions:{"send message":({context:e},t)=>{let{sources:r,targetOrigin:n}=e,{message:i}=t;r.forEach(e=>{e.postMessage(i,{targetOrigin:n})})},"on success":(0,l.s)(({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":(0,l.s)(({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":(0,l.s)(({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-${a()}`,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:r,domain:n,from:i,id:s,responseTo:o,to:a,type:c}=e;return{message:{channelId:t,data:r,domain:n,from:i,id:s,to:a,type:c,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:(0,d.a)({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})});(0,c.SP)(({sendBack:e,input:t})=>{let r=()=>{e(t.event)};t.immediate&&r();let n=setInterval(r,t.interval);return()=>{clearInterval(n)}});let B=()=>(0,u.mj)({types:{},actors:{requestMachine:H(),listen:$()},actions:{"buffer handshake":(0,d.a)({handshakeBuffer:({event:e,context:t})=>((0,u.DT)(e,"message.received"),[...t.handshakeBuffer,e])}),"buffer message":(0,l.e)(({enqueue:e})=>{e.assign({buffer:({event:e,context:t})=>((0,u.DT)(e,"post"),[...t.buffer,{data:e.data,resolvable:e.resolvable,options:e.options}])}),e.emit(({event:e})=>((0,u.DT)(e,"post"),{type:"buffer.added",message:e.data}))}),"create request":(0,d.a)({requests:({context:e,event:t,self:r,spawn:n})=>{(0,u.DT)(t,"request");let i=(Array.isArray(t.data)?t.data:[t.data]).map(t=>n("requestMachine",{id:`req-${a()}`,input:{channelId:e.channelId,data:t.data,domain:e.domain,expectResponse:t.expectResponse,from:e.name,parentRef:r,resolvable:t.resolvable,responseTimeout:t.options?.responseTimeout,responseTo:t.responseTo,signal:t.options?.signal,sources:e.target,suppressWarnings:t.o
3ptions?.suppressWarnings,targetOrigin:e.targetOrigin,to:e.connectTo,type:t.type}}));return[...e.requests,...i]}}),"emit heartbeat":(0,l.a)(()=>({type:"heartbeat"})),"emit received message":(0,l.e)(({enqueue:e})=>{e.emit(({event:e})=>((0,u.DT)(e,"message.received"),{type:"message",message:e.message.data}))}),"emit status":(0,l.a)((e,t)=>({type:"status",status:t.status})),"post message":(0,h.r)(({event:e})=>((0,u.DT)(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":(0,l.e)(({context:e,enqueue:t})=>{e.handshakeBuffer.forEach(e=>t.raise(e)),t.assign({handshakeBuffer:[]})}),"remove request":(0,l.e)(({context:e,enqueue:t,event:r})=>{(0,u.DT)(r,["request.success","request.failed","request.aborted"]),(0,h.s)(r.requestId),t.assign({requests:e.requests.filter(({id:e})=>e!==r.requestId)})}),"send response":(0,h.r)(({event:e})=>((0,u.DT)(e,["message.received","heartbeat.received"]),{type:"request",data:{type:F,responseTo:e.message.data.id,data:void 0}})),"send handshake syn ack":(0,h.r)({type:"request",data:{type:z}}),"send pending messages":(0,l.e)(({enqueue:e})=>{e.raise(({context:e})=>({type:"request",data:e.buffer.map(({data:e,resolvable:t,options:r})=>({data:e.data,type:e.type,expectResponse:!!t,resolvable:t,options:r}))})),e.emit(({context:e})=>({type:"buffer.flushed",messages:e.buffer.map(({data:e})=>e)})),e.assign({buffer:[]})}),"set connection config":(0,d.a)({channelId:({event:e})=>((0,u.DT)(e,"handshake.syn"),e.message.data.channelId),target:({event:e})=>((0,u.DT)(e,"handshake.syn"),e.message.source||void 0),targetOrigin:({event:e})=>((0,u.DT)(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??N,handshakeBuffer:[],name:e.name,requests:[],target:void 0,targetOrigin:null}),invoke:{id:"listen for handshake syn",src:"listen",input:q({include:W,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:q({include:V,count:1,responseType:"handshake.complete"}),onDone:"connected"},{id:"listen for disconnect",src:"listen",input:q({include:L,count:1,responseType:"disconnect"})},{id:"listen for messages",src:"listen",input:q({exclude:[L,W,V,U,F]})}],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:q({exclude:[L,W,V,U,F]})},{id:"listen for heartbeat",src:"listen",input:q({include:U,responseType:"heartbeat.received"})},{id:"listen for disconnect",src:"listen",input:q({include:L,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"]}}}}}),J=(e,t=B())=>{let r,n=(0,h.c)(t,{input:e}),i=new Map,s=new Map;n.on("message",({message:e})=>{let t=i.get(e.type);if(t)return void t.forEach(t=>t(e.data));let r=s.get(e.type);r?r.add(e):s.set(e.type,new Set([e]))});let o=()=>{n.stop()};return{actor:n,fetch:(e,t,r)=>{let{responseTimeout:i=1e4,signal:s,suppressWarnings:o}=r||{},a=function(){let e,t;return"function"==typeof Promise.withResolvers?Promise.withResolvers():{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}}();return n.send({type:"post",data:{type:e,data:t},resolvable:a,options:{responseTimeout:i,signal:s,suppressWarnings:o}}),a.promise},machine:t,on:(e,t,r)=>{let n=i.get(e)||new Set;i.has(e)||i.set(e,n),n.add(t);let o=s.get(e);if(o){let n=r?.replay??1;
3Array.from(o).slice(-n).forEach(({data:e})=>t(e)),s.delete(e)}return()=>{n.delete(t)}},onStatus:(e,t)=>{let i=n.on("status",n=>{r=n.status,t&&n.status!==t||e(n.status)});return r&&e(r),()=>i.unsubscribe()},post:(e,t)=>{n.send({type:"post",data:{type:e,data:t}})},start:()=>(n.start(),o),stop:o}}},50688:(e,t,r)=>{r.d(t,{a:()=>s});var n=r(623);function i(e,t,r,i,{assignment:s}){if(!t.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let o={},a={context:t.context,event:r.event,spawn:function(e,{machine:t,context:r},i,s){return(o,a)=>{let c=((o,a)=>{if("string"!=typeof o)return(0,n.c)(o,{id:a?.id,parent:e.self,syncSnapshot:a?.syncSnapshot,input:a?.input,src:o,systemId:a?.systemId});{let c=(0,n.R)(t,o);if(!c)throw Error(`Actor logic '${o}' not implemented in machine '${t.id}'`);let u=(0,n.c)(c,{id:a?.id,parent:e.self,syncSnapshot:a?.syncSnapshot,input:"function"==typeof a?.input?a.input({context:r,event:i,self:e.self}):a?.input,src:o,systemId:a?.systemId});return s[u.id]=u,u}})(o,a);return s[c.id]=c,e.defer(()=>{c._processingStatus!==n.V.Stopped&&c.start()}),c}}(e,t,r.event,o),self:e.self,system:e.system},c={};if("function"==typeof s)c=s(a,i);else for(let e of Object.keys(s)){let t=s[e];c[e]="function"==typeof t?t(a,i):t}let u=Object.assign({},t.context,c);return[(0,n.W)(t,{context:u,children:Object.keys(o).length?{...t.children,...o}:t.children}),void 0,void 0]}function s(e){function t(e,t){}return t.type="xstate.assign",t.assignment=e,t.resolve=i,t}},54758:(e,t,r)=>{r.d(t,{default:()=>b});var n=r(40166),i=r(32407),s=r(76444),o=r(5479),a=r(58418),c=r(38653),u=r(38438),l=r(68286),d=r(99549),h=r(84701);let f=(0,a.default)(()=>r.e(4069).then(r.bind(r,24069)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/PresentationComlink.js")]},ssr:!1}),p=(0,a.default)(()=>r.e(6393).then(r.bind(r,96393)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnMount.js")]},ssr:!1}),y=(0,a.default)(()=>r.e(3424).then(r.bind(r,63424)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnFocus.js")]},ssr:!1}),v=(0,a.default)(()=>r.e(1321).then(r.bind(r,21321)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnReconnect.js")]},ssr:!1});function g(e){var t;(0,h.K)(e)?console.warn("Sanity Live is unable to connect to the Sanity API as the current origin - ".concat(window.origin," - is not in the list of allowed CORS origins for this Sanity Project."),e.addOriginUrl&&"Add it here:",null==(t=e.addOriginUrl)?void 0:t.toString()):console.error(e)}function m(e,t){t?console.warn("Sanity Live connection closed, switching to long polling set to a interval of",t/1e3,"seconds and the server gave this reason:",e.reason):console.error("Sanity Live connection closed, automatic revalidation is disabled, the server gave this reason:",e.reason)}function b(e){let{projectId:t,dataset:r,apiHost:a,apiVersion:h,useProjectHostname:b,token:w,requestTagPrefix:_,draftModeEnabled:x,draftModePerspective:E,refreshOnMount:S=!1,refreshOnFocus:T=!x&&(typeof window>"u"||window.self===window.top),refreshOnReconnect:I=!0,intervalOnGoAway:C=3e4,requestTag:k="next-loader.live",onError:j=g,onGoAway:O=m,revalidateSyncTags:A=s.Q}=e,M=(0,u.useMemo)(()=>(0,i.UU)({projectId:t,dataset:r,apiHost:a,apiVersion:h,useProjectHostname:b,ignoreBrowserTokenWarning:!0,token:w,useCdn:!1,requestTagPrefix:_}),[a,h,r,t,_,w,b]),[R,P]=(0,u.useState)(!1),q=(0,c.useRouter)(),D=(0,l.J)(e=>{"message"===e.type?A(e.tags).then(e=>{"refresh"===e&&q.refresh()}):"restart"===e.type||"reconnect"===e.type?q.refresh():"goaway"===e.type&&(O(e,C),P(C))});(0,u.useEffect)(()=>{let e=M.live.events({includeDrafts:!!w,tag:k}).subscribe({next:D,error:e=>{j(e)}});return()=>e.unsubscribe()},[M.live,j,k,w]),(0,u.useEffect)(()=>{x&&E?(0,d.NL)(E):(0,d.NL)("unknown")},[x,E]);let[$,N]=(0,u.useState)(!1);(0,u.useEffect)(()=>{if(!(0,o.vY)()){if(x&&w)return void(0,d.kN)("live");if(x)return void(0,d.kN)("static");(0,d.kN)("unknown")}},[x,w]),(0,u.useEffect)(()=>{if(!(0,o.vY)())return;let e=new AbortController,t=setTimeout(()=>(0,d.kN)("live"),3e3);return window.addEventListener("message",r=>{let{data:n}=r;n&&"object"==typeof n&&"domain"in n&&"sanity/channels"===n.domain&&"from"in n&&"presentation"===n.from&&(clearTimeout(t),(0,d.kN)((0,o.v$)()?"presentation-window":"presentation-iframe"),N(!0),e.abort())},{signal:e.signal}),()=>{clearTimeout(t),e.abort()}},[]);let F=(0,u.useRef)(void 0);return(0,u.useEffect)(()=>
3{if(x)return clearTimeout(F.current),()=>{F.current=setTimeout(()=>{console.warn("Sanity Live: Draft mode was enabled, but is now being disabled")})}},[x]),(0,u.useEffect)(()=>{if(!R)return;let e=setInterval(()=>q.refresh(),R);return()=>clearInterval(e)},[R,q]),(0,n.jsxs)(n.Fragment,{children:[x&&$&&(0,n.jsx)(f,{projectId:t,dataset:r,draftModeEnabled:x,draftModePerspective:E}),!x&&S&&(0,n.jsx)(p,{}),!x&&T&&(0,n.jsx)(y,{}),!x&&I&&(0,n.jsx)(v,{})]})}b.displayName="SanityLive"},57554:(e,t,r)=>{r.d(t,{DT:()=>h,mj:()=>f}),r(18946);var n=r(623),i=r(50688);let s=new WeakMap;function o(e,t,r){let n=s.get(e);return n?t in n||(n[t]=r()):(n={[t]:r()},s.set(e,n)),n[t]}let a={},c=e=>"string"==typeof e?{type:e}:"function"==typeof e?"resolve"in e?{type:e.type}:{type:e.name}:e;class u{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(n.S),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?(0,n.l)(this.config.states,(e,t)=>new u(e,{_parent:this,_key:t,_machine:this.machine})):a,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=!0===this.config.history?"shallow":this.config.history||!1,this.entry=(0,n.t)(this.config.entry).slice(),this.exit=(0,n.t)(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=(0,n.t)(e.tags).slice()}_initialize(){this.transitions=(0,n.q)(this),this.config.always&&(this.always=(0,n.u)(this.config.always).map(e=>(0,n.v)(this,n.N,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(c),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map(c),eventType:null})}:void 0,history:this.history,states:(0,n.l)(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.actions.map(c)})),entry:this.entry.map(c),exit:this.exit.map(c),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return o(this,"invoke",()=>(0,n.t)(this.config.invoke).map((e,t)=>{let{src:r,systemId:i}=e,s=e.id??(0,n.x)(this.id,t),o="string"==typeof r?r:`xstate.invoke.${(0,n.x)(this.id,t)}`;return{...e,src:o,id:s,systemId:i,toJSON(){let{onDone:t,onError:r,...n}=e;return{...n,type:"xstate.invoke",src:o,id:s}}}}))}get on(){return o(this,"on",()=>[...this.transitions].flatMap(([e,t])=>t.map(t=>[e,t])).reduce((e,[t,r])=>(e[t]=e[t]||[],e[t].push(r),e),{}))}get after(){return o(this,"delayedTransitions",()=>(0,n.y)(this))}get initial(){return o(this,"initial",()=>(0,n.z)(this,this.config.initial))}next(e,t){let r,i=t.type,s=[];for(let a of o(this,`candidates-${i}`,()=>(0,n.B)(this,i))){let{guard:o}=a,c=e.context,u=!1;try{u=!o||(0,n.w)(o,c,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 '${i}' in state node '${this.id}': 4${t.message}`)}if(u){s.push(...a.actions),r=a;break}}return r?[r]:void 0}get events(){return o(this,"events",()=>{let{states:e}=this,t=new Set(this.ownEvents);if(e)for(let r of Object.keys(e)){let n=e[r];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 l{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:t?.actors??{},actions:t?.actions??{},delays:t?.delays??{},guards: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 u(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:r,actors:n,delays:i}=this.implementations;return new l(this.config,{actions:{...t,...e.actions},guards:{...r,...e.guards},actors:{...n,...e.actors},delays:{...i,...e.delays}})}resolveState(e){let t=(0,n.C)(this.root,e.value),r=(0,n.D)((0,n.g)(this.root,t));return(0,n.E)({_nodes:[...r],context:e.context||{},children:{},status:(0,n.F)(r,this.root)?"done":e.status||"active",output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,t,r){return(0,n.G)(e,t,r,[]).snapshot}microstep(e,t,r){return(0,n.G)(e,t,r,[]).microstates}getTransitionData(e,t){return(0,n.H)(this.root,e.value,e,t)||[]}getPreInitialState(e,t,r){let{context:s}=this.config,o=(0,n.E)({context:"function"!=typeof s&&s?s:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof s?(0,n.I)(o,t,e,[(0,i.a)(({spawn:e,event:t,self:r})=>s({spawn:e,input:t.input,self:r}))],r,void 0):o}getInitialSnapshot(e,t){let r=(0,n.J)(t),i=[],s=this.getPreInitialState(e,r,i),o=(0,n.K)([{target:[...(0,n.L)(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],s,e,r,!0,i),{snapshot:a}=(0,n.G)(o,r,e,i);return a}start(e){Object.values(e.children).forEach(e=>{"active"===e.getSnapshot().status&&e.start()})}getStateNodeById(e){let t=(0,n.M)(e),r=t.slice(1),i=(0,n.O)(t[0])?t[0].slice(1):t[0],s=this.idMap.get(i);if(!s)throw Error(`Child state node '#${i}' does not exist on machine '${this.id}'`);return(0,n.P)(s,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,t){return(0,n.Q)(e,t)}restoreSnapshot(e,t){let r={},i=e.children;
4Object.keys(i).forEach(e=>{let s=i[e],o=s.snapshot,a=s.src,c="string"==typeof a?(0,n.R)(this,a):a;if(!c)return;let u=(0,n.c)(c,{id:e,parent:t.self,syncSnapshot:s.syncSnapshot,snapshot:o,src:a,systemId:s.systemId});r[e]=u});let s=function(e,t){if(!t||"object"!=typeof t)return{};let r={};for(let n in t)for(let i of t[n]){let t=function(e,t){if(t instanceof u)return t;try{return e.machine.getStateNodeById(t.id)}catch{}}(e,i);t&&(r[n]??=[],r[n].push(t))}return r}(this.root,e.historyValue),o=(0,n.E)({...e,children:r,_nodes:Array.from((0,n.D)((0,n.g)(this.root,e.value))),historyValue:s},this),a=new Set;return!function e(t,r){if(!a.has(t))for(let i in a.add(t),t){let s=t[i];if(s&&"object"==typeof s){if("xstate$$type"in s&&s.xstate$$type===n.$){t[i]=r[s.id];continue}e(s,r)}}}(o.context,r),o}}var d=r(15151);function h(e,t){let r=(0,n.t)(t);if(!r.includes(e.type)){let t=1===r.length?`type "${r[0]}"`:`one of types "${r.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(e)} to have ${t}`)}}function f({schemas:e,actors:t,actions:r,guards:s,delays:o}){return{assign:i.a,sendTo:d.s,raise:n.r,log:d.l,cancel:n.a,stopChild:n.s,enqueueActions:d.e,emit:d.a,spawnChild:n.b,createStateConfig:e=>e,createAction:e=>e,createMachine:n=>new l({...n,schemas:e},{actors:t,actions:r,guards:s,delays:o})}}},58079:(e,t,r)=>{r.d(t,{A_:()=>v,C:()=>h,IM:()=>w,R8:()=>y,T4:()=>g,_S:()=>b,ct:()=>m,iz:()=>_});let n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/_key\s*==\s*['"](.*)['"]/,s=/^\d*:\d*$/;function o(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function a(e){return"string"==typeof e?i.test(e.trim()):"object"==typeof e&&"_key"in e}function c(e){if("string"==typeof e&&s.test(e))return!0;if(!Array.isArray(e)||2!==e.length)return!1;let[t,r]=e;return("number"==typeof t||""===t)&&("number"==typeof r||""===r)}function u(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,r)=>{let n=typeof t;if("number"===n)return"".concat(e,"[").concat(t,"]");if("string"===n)return"".concat(e).concat(0===r?"":".").concat(t);if(a(t)&&t._key)return"".concat(e,'[_key=="').concat(t._key,'"]');if(Array.isArray(t)){let[r,n]=t;return"".concat(e,"[").concat(r,":").concat(n,"]")}throw Error("Unsupported path segment `".concat(JSON.stringify(t),"`"))},"")}function l(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(n);if(!t)throw Error("Invalid path string");return t.map(d)}function d(e){return o(e)?Number(e.replace(/[^\d]/g,"")):a(e)?{_key:e.match(i)[1]}:c(e)?function(e){let[t,r]=e.split(":").map(e=>""===e?e:Number(e));return[t,r]}(e):e}var h=Object.freeze({__proto__:null,fromString:l,get:function(e,t,r){let n="string"==typeof t?l(t):t;if(!Array.isArray(n))throw Error("Path must be an array or a string");let i=e;for(let e=0;e<n.length;e++){let t=n[e];if(o(t)){if(!Array.isArray(i))return r;i=i[t]}if(a(t)){if(!Array.isArray(i))return r;i=i.find(e=>e._key===t._key)}if("string"==typeof t&&(i="object"==typeof i&&null!==i?i[t]:void 0),typeof i>"u")return r}return i},isIndexSegment:o,isIndexTuple:c,isKeySegment:a,reKeySegment:i,toString:u});let f="".concat("drafts").concat("."),p="".concat("versions").concat(".");function y(e){return e.startsWith(f)}function v(e){return e.startsWith(p)}function g(e){return v(e)?f+w(e):y(e)?e:f+e}function m(e,t){if("drafts"===t||"published"===t)throw Error('Version can not be "published" or "drafts"');return"".concat(p).concat(t).concat(".").concat(w(e))}function b(e){if(!v(e))return;let[t,r,...n]=e.split(".");return r}function w(e){return v(e)?e.split(".").slice(2).join("."):y(e)?e.slice(f.length):e}function _(e){let{baseUrl:t,workspace:r="default",tool:n="default",id:i,type:s,path:o,projectId:a,dataset:c}=e;if(!t)throw Error("baseUrl is required");if(!o)throw Error("path is required");if(!i)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let l="default"===r?void 0:r,d="default"===n?void 0:n,h=w(i),f=Array.isArray(o)?u(o.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(""!==e._key)return{_key:e._key};if(-1!==e._index)return e._index;throw Error("invalid segment:".concat(JSON.stringify(e)))})):o,p=new URLSearchParams({baseUrl:t,id:h,type:s,path:f});if(l&&p.set("workspace",l),d&&p.set("tool",d),a&&p.set("projectId",a),c&&p.set("dataset",c),y(i)||v(i)){if
4(v(i)){let e=b(i);p.set("perspective",e)}}else p.set("perspective","published");let g=["/"===t?"":t];l&&g.push(l);let m=["mode=presentation","id=".concat(h),"type=".concat(s),"path=".concat(encodeURIComponent(f))];return d&&m.push("tool=".concat(d)),g.push("intent","edit","".concat(m.join(";"),"?").concat(p)),g.join("/")}},58418:(e,t,r)=>{r.d(t,{default:()=>i.a});var n=r(19295),i=r.n(n)},59867:(e,t,r)=>{r.d(t,{Q:()=>o});var n=r(85681),i=r(48160),s=r(22372);function o(e,t){return void 0===t&&(t=0),(0,i.N)(function(r,i){r.subscribe((0,s._)(i,function(r){return(0,n.N)(i,e,function(){return i.next(r)},t)},function(){return(0,n.N)(i,e,function(){return i.complete()},t)},function(r){return(0,n.N)(i,e,function(){return i.error(r)},t)}))})}},59927:(e,t,r)=>{r.d(t,{D:()=>n});function n(e){return e}},61486:(e,t,r)=>{r.d(t,{v:()=>s});var n=r(72465),i=r(11610);function s(e){return new n.c(function(t){(0,i.Tg)(e()).subscribe(t)})}},63744:(e,t,r)=>{r.d(t,{m:()=>s});var n=r(89250),i=r(31876);function s(e){i.f.setTimeout(function(){var t=n.$.onUnhandledError;if(t)t(e);else throw e})}},63872:(e,t,r)=>{r.d(t,{p:()=>s});var n=r(48160),i=r(22372);function s(e,t){return(0,n.N)(function(r,n){var s=0;r.subscribe((0,i._)(n,function(r){return e.call(t,r,s++)&&n.next(r)}))})}},64770:(e,t,r)=>{r.d(t,{C:()=>s,U:()=>o});var n=r(47097),i=r(82765);function s(e){return(0,n.AQ)(this,arguments,function(){var t,r,i;return(0,n.YH)(this,function(s){switch(s.label){case 0:t=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,(0,n.N3)(t.read())];case 3:if(i=(r=s.sent()).value,!r.done)return[3,5];return[4,(0,n.N3)(void 0)];case 4:return[2,s.sent()];case 5:return[4,(0,n.N3)(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function o(e){return(0,i.T)(null==e?void 0:e.getReader)}},66312:(e,t,r)=>{r.d(t,{B:()=>u});var n=r(47097),i=r(72465),s=r(24495),o=(0,r(26743).L)(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),a=r(12848),c=r(45020),u=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,n.C6)(t,e),t.prototype.lift=function(e){var t=new l(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,c.Y)(function(){var r,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var s=(0,n.Ju)(t.currentObservers),o=s.next();!o.done;o=s.next())o.value.next(e)}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var t=this;(0,c.Y)(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;(0,c.Y)(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null==(e=this.observers)?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,i=this.observers;return r||n?s.Kn:(this.currentObservers=null,i.push(e),new s.yU(function(){t.currentObservers=null,(0,a.o)(i,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},t.prototype.asObservable=function(){var e=new i.c;return e.source=this,e},t.create=function(e,t){return new l(e,t)},t}(i.c),l=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return(0,n.C6)(t,e),t.prototype.next=function(e){var t,r;null==(r=null==(t=this.destination)?void 0:t.next)||r.call(t,e)},t.prototype.error=function(e){var t,r;null==(r=null==(t=this.destination)?void 0:t.error)||r.call(t,e)},t.prototype.complete=function(){var e,t;null==(t=null==(e=this.destination)?void 0:e.complete)||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!=(r=null==(t=this.source)?void 0:t.subscribe(e))?r:s.Kn},t}(u)},66825:(e,t,r)=>
4{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(33287).createAsyncLocalStorage)()},68286:(e,t,r)=>{r.d(t,{J:()=>o});var n=r(38438);let i=n.createContext(!0);function s(){throw Error("A function wrapped in useEffectEvent can't be called during rendering.")}function o(e){let t=n.useRef(s);return n.useInsertionEffect(()=>{t.current=e},[e]),(...e)=>((()=>{try{return n.use(i)}catch{return!1}})()&&s(),(0,t.current)(...e))}},68611:(e,t,r)=>{r.d(t,{l:()=>s});var n=r(41172),i=r(82765);function s(e){return(0,i.T)(e[n.s])}},72465:(e,t,r)=>{r.d(t,{c:()=>l});var n=r(9227),i=r(24495),s=r(41172),o=r(11173),a=r(89250),c=r(82765),u=r(45020),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var s=this,o=!function(e){return e&&e instanceof n.vU||e&&(0,c.T)(e.next)&&(0,c.T)(e.error)&&(0,c.T)(e.complete)&&(0,i.Uv)(e)}(e)?new n.Ms(e,t,r):e;return(0,u.Y)(function(){var e=s.operator,t=s.source;o.add(e?e.call(o,t):t?s._subscribe(o):s._trySubscribe(o))}),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=d(t))(function(t,i){var s=new n.Ms({next:function(t){try{e(t)}catch(e){i(e),s.unsubscribe()}},error:i,complete:t});r.subscribe(s)})},e.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},e.prototype[s.s]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,o.m)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=d(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}();function d(e){var t;return null!=(t=null!=e?e:a.$.Promise)?t:Promise}},72564:(e,t,r)=>{r.d(t,{R:()=>a});var n=r(47097),i=function(e){function t(t,r){return e.call(this)||this}return(0,n.C6)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(24495).yU),s={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=s.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,(0,n.fX)([e,t],(0,n.zs)(r))):setInterval.apply(void 0,(0,n.fX)([e,t],(0,n.zs)(r)))},clearInterval:function(e){var t=s.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=r(12848),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;
4return n.scheduler=t,n.work=r,n.pending=!1,n}return(0,n.C6)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r,n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!=(r=this.id)?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),s.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&s.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.o)(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},73418:(e,t,r)=>{r.d(t,{m:()=>i});var n=r(82765);function i(e){return e&&(0,n.T)(e.schedule)}},74993:(e,t,r)=>{r.d(t,{U:()=>s});var n=r(14896),i=r(59927);function s(e){return void 0===e&&(e=1/0),(0,n.Z)(i.D,e)}},75131:(e,t,r)=>{r.d(t,{U:()=>n});var n={now:function(){return(n.delegate||Date).now()},delegate:void 0}},76207:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return n.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}});let n=r(45028),i=r(29400),s=r(38884)},77007:(e,t,r)=>{r.d(t,{l:()=>n});var n="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},78252:(e,t,r)=>{function n(e){let{reason:t,children:r}=e;return r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return n}}),r(35488)},79752:(e,t,r)=>{r.d(t,{R0:()=>c,lI:()=>a,ms:()=>o});var n=r(82765),i=r(73418);function s(e){return e[e.length-1]}function o(e){return(0,n.T)(s(e))?e.pop():void 0}function a(e){return(0,i.m)(s(e))?e.pop():void 0}function c(e,t){return"number"==typeof s(e)?e.pop():t}},80119:(e,t,r)=>{r.d(t,{x:()=>s});var n=r(77007),i=r(82765);function s(e){return(0,i.T)(null==e?void 0:e[n.l])}},82765:(e,t,r)=>{r.d(t,{T:()=>n});function n(e){return"function"==typeof e}},84701:(e,t,r)=>{r.d(t,{K:()=>i});var n=r(32407);function i(e){return e instanceof n.u_}},84841:(e,t,r)=>{r.d(t,{L:()=>n});function n(e){return TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},85681:(e,t,r)=>{r.d(t,{N:()=>n});function n(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var s=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(s),!i)return s}},86978:(e,t,r)=>{r.d(t,{y:()=>i});var n=r(82765);function i(e){return(0,n.T)(null==e?void 0:e.then)}},88206:(e,t,r)=>{r.d(t,{h:()=>c});var n=r(74993),i=r(11610),s=r(175),o=r(79752),a=r(18550);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,o.lI)(e),c=(0,o.R0)(e,1/0);return e.length?1===e.length?(0,i.Tg)(e[0]):(0,n.U)(c)((0,a.H)(e,r)):s.w}},89250:(e,t,r)=>{r.d(t,{$:()=>n});var n={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},90700:(e,t,r)=>{r.d(t,{q:()=>o});var n=r(47097),i=r(75131),s=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=i.U.now,e}(),o=function(e){function t(t,r){void 0===r&&(r=s.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return(0,n.C6)(t,e),t.prototype.flush=function(e){var t,r=this.actions;if(this._active)return void r.push(e);this._active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}},t}(s)},91076:(e,t,r)=>{r.d(t,{I:()=>o});var n=r(47097),i=r(35164),s=Array.isArray;function o(e){return(0,i.T)(function(t){return s(t)?e.apply(void 0,(0,n.fX)([],(0,n.zs)(t))):e(t)})}},99549:(e,t,r)=>{r.d(t,{El:()=>l,Hi:()=>c,NL:()=>s,kN:()=>a,lc:()=>d,sq:()=>u});let n=new Set,i="checking";function s(e){if(i!==e)for(let t of(i=e,n))t()}let o=new Set;function a(e){for(let e of o)e()}let c=new Set,u=null;function l(e){for(let t of(u=e,c))t()}function d(e,t){for(let e of c)e()}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.