PageSourceSearch

https://chrismacarifilms.com/_nuxt/Chx3igEn.js

js chrismacarifilms.com collected 2026-10-06 13:13:53 UTC 135,863 bytes, 35 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BYNARvin.js","./2ocTJhLv.js","./B8LJoUAe.js","./entry.4aWA1RuV.css"])))=>i.map(i=>d[i]);
2import{c as Ur,aT as bi,aa as kr,aU as se,m as Ht,aV as wi,aW as Ei,r as Si,aX as ot,aY as _i,A as Ci,aZ as Ti,f as Ai,a_ as Ii,a$ as Ri,B as $i,b0 as Oi,b1 as xi,a5 as Pi,ab as Di,b2 as Pt}from"#entry";const Mi={trailing:!0};function ji(t,e=25,r={}){if(r={...Mi,...r},!Number.isFinite(e))throw new TypeError("Expected `wait` to be a finite number");let n,i,s=[],o,a;const c=(h,m)=>(o=Li(t,h,m),o.finally(()=>{if(o=null,r.trailing&&a&&!i){const y=c(h,a);return a=null,y}}),o),u=function(...h){return r.trailing&&(a=h),o||new Promise(m=>{const y=!i&&r.leading;clearTimeout(i),i=setTimeout(()=>{i=null;const f=r.leading?n:c(this,h);a=null;for(const p of s)p(f);s=[]},e),y?(n=c(this,h),m(n)):s.push(m)})},l=h=>{h&&(clearTimeout(h),i=null)};return u.isPending=()=>!!i,u.cancel=()=>{l(i),s=[],a=null},u.flush=()=>{if(l(i),!a||o)return;const h=a;return a=null,c(this,h)},u}async function Li(t,e,r){return await t.apply(e,r)}const qi=Symbol.for("nuxt:client-only"),Fi=t=>t==="defer"||t===!1;function wc(...t){const e=typeof t[t.length-1]=="string"?t.pop():void 0;Vi(t[0],t[1])&&t.unshift(e);let[r,n,i={}]=t,s=!1;const o=Ur(()=>bi(r));if(typeof o.value!="string")throw new TypeError("[nuxt] [useAsyncData] key must be a string.");if(typeof n!="function")throw new TypeError("[nuxt] [useAsyncData] handler must be a function.");const a=kr();i.server??=!0,i.default??=ki,i.getCachedData??=zr,i.lazy??=!1,i.immediate??=!0,i.deep??=se.deep,i.dedupe??="cancel",i._functionName,a._asyncData[o.value];function c(){const f={cause:"initial",dedupe:i.dedupe};return a._asyncData[o.value]?._init||(f.cachedData=i.getCachedData(o.value,a,{cause:"initial"}),a._asyncData[o.value]=Kt(a,o.value,n,i,f.cachedData)),()=>a._asyncData[o.value].execute(f)}const u=c(),l=a._asyncData[o.value];l._deps++;const h=i.server!==!1&&a.payload.serverRendered;{let f=function(b){const S=a._asyncData[b];S?._deps&&(S._deps--,S._deps===0&&S?._off())};const p=Ii();if(p&&h&&i.immediate&&!p.sp&&(p.sp=[]),p&&!p._nuxtOnBeforeMountCbs){p._nuxtOnBeforeMountCbs=[];const b=p._nuxtOnBeforeMountCbs;Ri(()=>{b.forEach(S=>{S()}),b.splice(0,b.length)}),$i(()=>b.splice(0,b.length))}const w=p&&(p._nuxtClientOnly||Oi(qi,!1));h&&a.isHydrating&&(l.error.value||l.data.value!=null)?(l.pending.value=!1,l.status.value=l.error.value?"error":"success"):p&&(!w&&a.payload.serverRendered&&a.isHydrating||i.lazy)&&i.immediate?p._nuxtOnBeforeMountCbs.push(u):i.immediate&&u();const g=Ei(),d=Ht(o,(b,S)=>{if((b||S)&&b!==S){s=!0;const _=a._asyncData[S]?.data.value!==se.value,x=a._asyncDataPromises[S]!==void 0,$={cause:"initial",dedupe:i.dedupe};if(!a._asyncData[b]?._init){let A;S&&_?A=a._asyncData[S].data.value:(A=i.getCachedData(b,a,{cause:"initial"}),$.cachedData=A),a._asyncData[b]=Kt(a,b,n,i,A)}a._asyncData[b]._deps++,S&&f(S),(i.immediate||_||x)&&a._asyncData[b].execute($),xi(()=>{s=!1})}},{flush:"sync"}),v=i.watch?Ht(i.watch,()=>{s||l._execute({cause:"watch",dedupe:i.dedupe})}):()=>{};g&&wi(()=>{d(),v(),f(o.value)})}const m={data:Fe(()=>a._asyncData[o.value]?.data),pending:Fe(()=>a._asyncData[o.value]?.pending),status:Fe(()=>a._asyncData[o.value]?.status),error:Fe(()=>a._asyncData[o.value]?.error),refresh:(...f)=>a._asyncData[o.value]?._init?a._asyncData[o.value].execute(...f):c()(),execute:(...f)=>m.refresh(...f),clear:()=>Nr(a,o.value)},y=Promise.resolve(a._asyncDataPromises[o.value]).then(()=>m);return Object.assign(y,m),y}function Fe(t){return Ur({get(){return t()?.value},set(e){const r=t();r&&(r.value=e)}})}function Vi(t,e){return!(typeof t=="string"||typeof t=="object"&&t!==null||typeof t=="function"&&typeof e=="function")}function Nr(t,e){e in t.payload.data&&(t.payload.data[e]=void 0),e in t.payload._errors&&(t.payload._errors[e]=se.errorValue),t._asyncData[e]&&(t._asyncData[e].data.value=void 0,t._asyncData[e].error.value=se.errorValue,t._asyncData[e].pending.value=!1,t._asyncData[e].status.value="idle"),e in t._asyncDataPromises&&(t._asyncDataPromises[e]&&(t._asyncDataPromises[e].cancelled=!0),t._asyncDataPromises[e]=void 0)}function Ui(t,e){const r={};for(const n of e)r[n]=t[n];return r}function Kt(t,e,r,n,i){t.payload._errors[e]??=se.errorValue;const s=n.getCachedData!==zr,o=r,a=n.deep?Si:ot,c=i!=null,u=t.hook("app:data:refresh",async h=>{(!h||h.includes(e))&&await l.execute({cause:"refresh:hook"})}),l={data:a(c?i:n.default()),pending:ot(!c),error:_i(t.payload._errors,e),status:ot("idle"),execute:(...h)=>{const[m,y=void 0]=h,f=m&&y===void 0&&typeof m=="object"?m:{};
2if(t._asyncDataPromises[e]){if(Fi(f.dedupe??n.dedupe))return t._asyncDataPromises[e];t._asyncDataPromises[e].cancelled=!0}if(f.cause==="initial"||t.isHydrating){const w="cachedData"in f?f.cachedData:n.getCachedData(e,t,{cause:f.cause??"refresh:manual"});if(w!=null)return t.payload.data[e]=l.data.value=w,l.error.value=se.errorValue,l.status.value="success",Promise.resolve(w)}l.pending.value=!0,l.status.value="pending";const p=new Promise((w,g)=>{try{w(o(t))}catch(d){g(d)}}).then(async w=>{if(p.cancelled)return t._asyncDataPromises[e];let g=w;n.transform&&(g=await n.transform(w)),n.pick&&(g=Ui(g,n.pick)),t.payload.data[e]=g,l.data.value=g,l.error.value=se.errorValue,l.status.value="success"}).catch(w=>{if(p.cancelled)return t._asyncDataPromises[e];l.error.value=Ti(w),l.data.value=Ai(n.default()),l.status.value="error"}).finally(()=>{p.cancelled||(l.pending.value=!1,delete t._asyncDataPromises[e])});return t._asyncDataPromises[e]=p,t._asyncDataPromises[e]},_execute:ji((...h)=>l.execute(...h),0,{leading:!0}),_default:n.default,_deps:0,_init:!0,_hash:void 0,_off:()=>{u(),t._asyncData[e]?._init&&(t._asyncData[e]._init=!1),s||Ci(()=>{t._asyncData[e]?._init||(Nr(t,e),l.execute=()=>Promise.resolve(),l.data.value=se.value)})}};return l}const ki=()=>se.value,zr=(t,e,r)=>{if(e.isHydrating)return e.payload.data[t];if(r.cause!=="refresh:manual"&&r.cause!=="refresh:hook")return e.static.data[t]},Br=()=>{const t=Di();return Pi({},t.public.sanity)},Ni=t=>{if(!t)return;const e=new Map;return{notify(r,n){e.forEach(i=>{const s=()=>{i.lastLiveEventId=n};i.callback(r,s)})},subscribe(r,n){return e.set(r,{lastLiveEventId:void 0,callback:n}),{getLastLiveEventId:()=>e.get(r)?.lastLiveEventId,unsubscribe:()=>{e.delete(r)}}}}};var at={},ct,Wt;function zi(){if(Wt)return ct;Wt=1;const t=Symbol("values"),e=Symbol("kStorage"),r=Symbol("kStorages"),n=Symbol("kTransformer"),i=Symbol("kTTL"),s=Symbol("kOnDedupe"),o=Symbol("kOnError"),a=Symbol("kOnHit"),c=Symbol("kOnMiss"),u=Symbol("kStale");return ct={kValues:t,kStorage:e,kStorages:r,kTransfromer:n,kTTL:i,kOnDedupe:s,kOnError:o,kOnHit:a,kOnMiss:c,kStale:u},ct}var ut={exports:{}},Gt;function Hr(){return Gt||(Gt=1,(function(t,e){const{hasOwnProperty:r}=Object.prototype,n=g();n.configure=g,n.stringify=n,n.default=n,e.stringify=n,e.configure=g,t.exports=n;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function s(d){return d.length<5e3&&!i.test(d)?`"${d}"`:JSON.stringify(d)}function o(d,v){if(d.length>200||v)return d.sort(v);for(let b=1;b<d.length;b++){const S=d[b];let _=b;for(;_!==0&&d[_-1]>S;)d[_]=d[_-1],_--;d[_]=S}return d}const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(d){return a.call(d)!==void 0&&d.length!==0}function u(d,v,b){d.length<b&&(b=d.length);const S=v===","?"":" ";let _=`"0":${S}${d[0]}`;for(let x=1;x<b;x++)_+=`${v}"${x}":${S}${d[x]}`;return _}function l(d){if(r.call(d,"circularValue")){const v=d.circularValue;if(typeof v=="string")return`"${v}"`;if(v==null)return v;if(v===Error||v===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function h(d){let v;if(r.call(d,"deterministic")&&(v=d.deterministic,typeof v!="boolean"&&typeof v!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return v===void 0?!0:v}function m(d,v){let b;if(r.call(d,v)&&(b=d[v],typeof b!="boolean"))throw new TypeError(`The "${v}" argument must be of type boolean`);return b===void 0?!0:b}function y(d,v){let b;if(r.call(d,v)){if(b=d[v],typeof b!="number")throw new TypeError(`The "${v}" argument must be of type number`);if(!Number.isInteger(b))throw new TypeError(`The "${v}" argument must be an integer`);if(b<1)throw new RangeError(`The "${v}" argument must be >= 1`)}return b===void 0?1/0:b}function f(d){return d===1?"1 item":`${d} items`}function p(d){const v=new Set;for(const b of d)(typeof b=="string"||typeof b=="number")&&v.add(String(b));return v}function w(d){if(r.call(d,"strict")){const v=d.strict;if(typeof v!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(v)return b=>{let S=`Object can not safely be stringified. Received type ${typeof b}`;throw typeof b!="function"&&(S+=` (${b.toString()})`),new Error(S)}}}function g(d){d={...d};const v=w(d);v&&(d.bigint===void 0&&(d.bigint=!1),"circularValue"in d||(d.circularValue=Error));const b=l(d),S=m(d,"bigint"),_=h(d),x=typeof _=="function"?_:void 0,$=y(d,"maximumDepth"),A=y(d,"maximumBreadth");function G(P,E,C,I,R,M){let T=E[P];switch(typeof T=="object"&&T!==null&&typeof T.toJSON=="function"&&(T=T.toJSON(P)),T=I.call(E,P,T),typeof T){case"string":return s(T);case"object":{if(T===null)return"null";if(C.indexOf(T)!==-1)return b;let D="",U=",";const k=M;if(Array.isArray(T)){if(T.length===0)return"[]";
2if($<C.length+1)return'"[Array]"';C.push(T),R!==""&&(M+=R,D+=`
3${M}`,U=`,
4${M}`);const W=Math.min(T.length,A);let te=0;for(;te<W-1;te++){const qe=G(String(te),T,C,I,R,M);D+=qe!==void 0?qe:"null",D+=U}const re=G(String(te),T,C,I,R,M);if(D+=re!==void 0?re:"null",T.length-1>A){const qe=T.length-A-1;D+=`${U}"... ${f(qe)} not stringified"`}return R!==""&&(D+=`
5${k}`),C.pop(),`[${D}]`}let L=Object.keys(T);const N=L.length;if(N===0)return"{}";if($<C.length+1)return'"[Object]"';let j="",K="";R!==""&&(M+=R,U=`,
6${M}`,j=" ");const Y=Math.min(N,A);_&&!c(T)&&(L=o(L,x)),C.push(T);for(let W=0;W<Y;W++){const te=L[W],re=G(te,T,C,I,R,M);re!==void 0&&(D+=`${K}${s(te)}:${j}${re}`,K=U)}if(N>A){const W=N-A;D+=`${K}"...":${j}"${f(W)} not stringified"`,K=U}return R!==""&&K.length>1&&(D=`
7${M}${D}
8${k}`),C.pop(),`{${D}}`}case"number":return isFinite(T)?String(T):v?v(T):"null";case"boolean":return T===!0?"true":"false";case"undefined":return;case"bigint":if(S)return String(T);default:return v?v(T):void 0}}function X(P,E,C,I,R,M){switch(typeof E=="object"&&E!==null&&typeof E.toJSON=="function"&&(E=E.toJSON(P)),typeof E){case"string":return s(E);case"object":{if(E===null)return"null";if(C.indexOf(E)!==-1)return b;const T=M;let D="",U=",";if(Array.isArray(E)){if(E.length===0)return"[]";if($<C.length+1)return'"[Array]"';C.push(E),R!==""&&(M+=R,D+=`
9${M}`,U=`,
10${M}`);const N=Math.min(E.length,A);let j=0;for(;j<N-1;j++){const Y=X(String(j),E[j],C,I,R,M);D+=Y!==void 0?Y:"null",D+=U}const K=X(String(j),E[j],C,I,R,M);if(D+=K!==void 0?K:"null",E.length-1>A){const Y=E.length-A-1;D+=`${U}"... ${f(Y)} not stringified"`}return R!==""&&(D+=`
11${T}`),C.pop(),`[${D}]`}C.push(E);let k="";R!==""&&(M+=R,U=`,
12${M}`,k=" ");let L="";for(const N of I){const j=X(N,E[N],C,I,R,M);j!==void 0&&(D+=`${L}${s(N)}:${k}${j}`,L=U)}return R!==""&&L.length>1&&(D=`
13${M}${D}
14${T}`),C.pop(),`{${D}}`}case"number":return isFinite(E)?String(E):v?v(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(S)return String(E);default:return v?v(E):void 0}}function B(P,E,C,I,R){switch(typeof E){case"string":return s(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(P),typeof E!="object")return B(P,E,C,I,R);if(E===null)return"null"}if(C.indexOf(E)!==-1)return b;const M=R;if(Array.isArray(E)){if(E.length===0)return"[]";if($<C.length+1)return'"[Array]"';C.push(E),R+=I;let j=`
15${R}`;const K=`,
16${R}`,Y=Math.min(E.length,A);let W=0;for(;W<Y-1;W++){const re=B(String(W),E[W],C,I,R);j+=re!==void 0?re:"null",j+=K}const te=B(String(W),E[W],C,I,R);if(j+=te!==void 0?te:"null",E.length-1>A){const re=E.length-A-1;j+=`${K}"... ${f(re)} not stringified"`}return j+=`
17${M}`,C.pop(),`[${j}]`}let T=Object.keys(E);const D=T.length;if(D===0)return"{}";if($<C.length+1)return'"[Object]"';R+=I;const U=`,
18${R}`;let k="",L="",N=Math.min(D,A);c(E)&&(k+=u(E,U,A),T=T.slice(E.length),N-=E.length,L=U),_&&(T=o(T,x)),C.push(E);for(let j=0;j<N;j++){const K=T[j],Y=B(K,E[K],C,I,R);Y!==void 0&&(k+=`${L}${s(K)}: ${Y}`,L=U)}if(D>A){const j=D-A;k+=`${L}"...": "${f(j)} not stringified"`,L=U}return L!==""&&(k=`
19${R}${k}
20${M}`),C.pop(),`{${k}}`}case"number":return isFinite(E)?String(E):v?v(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(S)return String(E);default:return v?v(E):void 0}}function Z(P,E,C){switch(typeof E){case"string":return s(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(P),typeof E!="object")return Z(P,E,C);if(E===null)return"null"}if(C.indexOf(E)!==-1)return b;let I="";const R=E.length!==void 0;if(R&&Array.isArray(E)){if(E.length===0)return"[]";if($<C.length+1)return'"[Array]"';C.push(E);const k=Math.min(E.length,A);let L=0;for(;L<k-1;L++){const j=Z(String(L),E[L],C);I+=j!==void 0?j:"null",I+=","}const N=Z(String(L),E[L],C);if(I+=N!==void 0?N:"null",E.length-1>A){const j=E.length-A-1;I+=`,"... ${f(j)} not stringified"`}return C.pop(),`[${I}]`}let M=Object.keys(E);const T=M.length;if(T===0)return"{}";if($<C.length+1)return'"[Object]"';let D="",U=Math.min(T,A);R&&c(E)&&(I+=u(E,",",A),M=M.slice(E.length),U-=E.length,D=","),_&&(M=o(M,x)),C.push(E);for(let k=0;k<U;k++){const L=M[k],N=Z(L,E[L],C);N!==void 0&&(I+=`${D}${s(L)}:${N}`,D=",")}if(T>A){const k=T-A;I+=`${D}"...":"${f(k)} not stringified"`}return C.pop(),`{${I}}`}case"number":return isFinite(E)?String(E):v?v(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(S)return String(E);default:return v?v(E):void 0}}function ee(P,E,C){if(arguments.length>1){let I="";if(typeof C=="number"?I=" ".repeat(Math.min(C,10)):typeof C=="string"&&(I=C.slice(0,10)),E!=null){if(typeof E=="function")return G("",{"":P},[],E,I,"");if(Array.isArray(E))return X("",P,[],p(E),I,"")}if(I.length!==0)return B("",P,[],I,"")}return Z("",P,[])}return ee}})(ut,ut.exports)),ut.exports}var lt,Jt;function Be(){if(Jt)return lt;Jt=1;function t(c,u){const l=[];let h=0;for(let m=0;m<c.length;m++)for(let y=h;y<u.length;y++)c[m]===u[y]&&(l.push(y),h=y+1);return l}function e(c,u){const l=[];let h=0;for(let m=0;m<c.length;m++)for(let y=h;y<u.length;y++)c[m]!==u[y]&&(l.push(u[y]),h=y+1);return l}function r(c,u){let l=0,h=c.length-1;for(;l<=h;){const m=(l+h)/2|0;if(c[m]===u)return m;c[m]<u?l=m+1:h=m-1}return-1}function n(c){return c*Math.random()|0}function i(c,u){return c=Math.floor(c),u=Math.floor(u),c+n(1+u-c)}function s(c,u){if(c.length<1||u<1)return[];const l=Math.min(c.length,u),h=i(1,l),m=new Set;for(let f=0;f<h;f++)m.add(n(c.length));const y=[];for(const f of m)y.push(c[f]);return y}function o(c,u){if(c==="*"||c.length===u.length&&c===u)return!0;let l=0,h=0;for(;l<c.length&&h<u.length;){if(c[l]===u[h]){l++,h++;continue}if(c[l]==="*"){if(c[l+1]===u[h]){l++;continue}h++;continue}return!1}return l>=c.length-1}function a(){const c=()=>{};return{fatal:c,error:c,warn:c,info:c,debug:c,trace:c}}
20return lt={findNotMatching:e,findMatchingIndexes:t,bsearchIndex:r,wildcardMatch:o,randomSubset:s,abstractLogging:a,isServerSide:typeof window>"u"},lt}var ft,Yt;function Kr(){if(Yt)return ft;Yt=1;class t{constructor(r){this.options=r}async get(r){throw new Error("storage get method not implemented")}async set(r,n,i,s){throw new Error("storage set method not implemented")}async remove(r){throw new Error("storage remove method not implemented")}async invalidate(r){throw new Error("storage invalidate method not implemented")}async clear(r){throw new Error("storage clear method not implemented")}async refresh(){throw new Error("storage refresh method not implemented")}}return ft=t,ft}var ht,Qt;function Bi(){if(Qt)return ht;Qt=1;const t=Hr(),e=Kr(),{findNotMatching:r,randomSubset:n,abstractLogging:i}=Be(),s=64,o=64,a=60;class c extends e{constructor(l={}){if(!l.client||typeof l.client!="object")throw new Error("Redis client is required");if(super(l),l.invalidation&&l.invalidation.referencesTTL&&(typeof l.invalidation.referencesTTL!="number"||l.invalidation.referencesTTL<1))throw new Error("invalidation.referencesTTL must be a positive integer greater than 1");this.log=l.log||i(),this.store=l.client,this.invalidation=!!l.invalidation,this.referencesTTL=l.invalidation&&l.invalidation.referencesTTL||a}getReferenceKeyLabel(l){return`r:${l}`}getKeyReferenceLabel(l){return`k:${l}`}async get(l){this.log.debug({msg:"acd/storage/redis.get",key:l});try{const h=await this.store.get(l);if(!h){if(!this.invalidation)return;this.clearReferences(l);return}return JSON.parse(h)}catch(h){this.log.error({msg:"acd/storage/redis.get error",err:h,key:l})}}async getTTL(l){this.log.debug({msg:"acd/storage/memory.getTTL",key:l});let h=await this.store.pttl(l);return h<0?0:(h=Math.ceil(h/1e3),h)}async set(l,h,m,y){if(this.log.debug({msg:"acd/storage/redis.set key",key:l,value:h,ttl:m,references:y}),m=Number(m),!(!m||m<0))try{if(await this.store.set(l,t(h),"EX",m),!y||y.length<1)return;if(!this.invalidation){this.log.warn({msg:"acd/storage/redis.set, invalidation is disabled, references are useless",key:l,references:y});return}const f=[],p=await this.store.smembers(this.getKeyReferenceLabel(l));if(this.log.debug({msg:"acd/storage/redis.set current references",key:l,currentReferences:p}),p.length>1){p.sort(),y.sort();const d=r(y,p);for(const v of d)f.push(["srem",this.getReferenceKeyLabel(v),l]);f.push(["del",this.getKeyReferenceLabel(l)])}const w=p.length>1?r(p,y):y;this.log.debug({msg:"acd/storage/redis.set references to add",key:l,referencesToAdd:w});for(let d=0;d<w.length;d++){const v=w[d],b=this.getReferenceKeyLabel(v);f.push(["sadd",b,l]),f.push(["expire",b,this.referencesTTL])}const g=this.getKeyReferenceLabel(l);f.push(["sadd",g,y]),f.push(["expire",g,m]),this.log.debug({msg:"acd/storage/redis.set references writes",writes:f}),await this.store.pipeline(f).exec()}catch(f){this.log.error({msg:"acd/storage/redis.set error",err:f,key:l,ttl:m,references:y})}}async remove(l){this.log.debug({msg:"acd/storage/redis.remove",key:l});try{const h=await this.store.del(l)>0;return h&&this.invalidation&&await this.clearReferences(l),h}catch(h){this.log.error({msg:"acd/storage/redis.remove error",err:h,key:l})}}async invalidate(l){if(!this.invalidation)return this.log.warn({msg:"acd/storage/redis.invalidate, exit due invalidation is disabled"}),[];this.log.debug({msg:"acd/storage/redis.invalidate",references:l});try{return Array.isArray(l)?await this._invalidateReferences(l):await this._invalidateReference(l)}catch(h){return this.log.error({msg:"acd/storage/redis.invalidate error",err:h,references:l}),[]}}async _invalidateReferences(l,h=!0){const m=l.map(w=>["smembers",h?this.getReferenceKeyLabel(w):w]),y=await this.store.pipeline(m).exec();this.log.debug({msg:"acd/storage/redis._invalidateReferences keys",keys:y});const f=[],p=[];for(let w=0;w<y.length;w++){const g=y[w][1];if(g){this.log.debug({msg:"acd/storage/redis._invalidateReferences got keys to be invalidated",keys:g});for(let d=0;d<g.length;d++){const v=g[d];this.log.debug({msg:"acd/storage/redis._invalidateReferences del key"+v}),p.push(v),f.push(["del",v])}}}return await this.store.pipeline(f).exec(),await this.clearReferences(p),p}async _invalidateReference(l){let h;if(l.includes("*")){const f=await this.store.keys(this.getReferenceKeyLabel(l));return this._invalidateReferences(f,!1)}else h=await this.store.smembers(this.getReferenceKeyLabel(l));this.log.debug({msg:"acd/storage/redis._invalidateReference keys",keys:h});const m=[],y=[];for(let f=0;f<h.length;f++){const p=h[f];this.log.debug({msg:"acd/storage/redis._invalidateReference del key"+p}),y.push(p),m.push(["del",p])}return await this.store.pipeline(m).exec(),await this.clearReferences(y),y}async clear(l){this.log.debug({msg:"acd/storage/redis.clear",name:l});try{if(!l){await this.store.flushall();return}const h=await this.store.keys(`${l}*`);this.log.debug({msg:"acd/storage/redis.clear keys",keys:h});const m=h.map(y=>["del",y]);if(await this.store.pipeline(m).exec(),!this.invalidation)return;await this.clearReferences(h)}catch(h){this.log.error({msg:"acd/storage/redis.clear error",err:h,name:l})}}async refresh(){try{await this.store.flushall()}catch(l){this.log.error({msg:"acd/storage/redis.refresh error",err:l})}}async clearReferences(l){try{if(!l){this.log.warn({msg:"acd/storage/redis.clearReferences invalid call due to empty key"});return}Array.isArray(l)||(l=[l]);const h=l.map(f=>["smembers",this.getKeyReferenceLabel(f)]),m=await this.store.pipeline(h).exec();this.log.debug({msg:"acd/storage/redis.clearReferences references",keys:l,referencesKeys:m});const y={};for(let f=0;f<l.length;f++){for(let w=0;w<m[f][1].length;w++){const g=this.getReferenceKeyLabel(m[f][1][w]);y[g]||(y[g]=["srem",g,l])}const p=this.getKeyReferenceLabel(l[f]);y[p]=["del",p]}this.log.debug({msg:"acd/storage/redis.clearReferences writes pipeline",writes:y}),await this.store.pipeline(Object.values(y)).exec()}catch(h){this.log.error({msg:"acd/storage/redis.clearReferences error",err:h})}}async gc(l="lazy",h={}){if(this.log.debug({msg:"acd/storage/redis.gc",mode:l,options:h}),!this.invalidation){this.log.warn({msg:"acd/storage/redis.gc does not run due to invali
20dation is disabled"});return}l!=="strict"&&l!=="lazy"&&(l="lazy");const m={references:{scanned:[],removed:[]},keys:{scanned:new Set,removed:new Set},loops:0,cursor:0,error:null};try{let y=0,f=o;if(h.chunk&&(typeof h.chunk!="number"||h.chunk<1))return m.error=new Error("chunk must be a positive integer greater than 1"),m;if(h.lazy){if(h.lazy.chunk){if(typeof h.lazy.chunk!="number"||h.lazy.chunk<1)return m.error=new Error("lazy.chunk must be a positive integer greater than 1"),m;f=h.lazy.chunk}if(h.lazy.cursor){if(typeof h.lazy.cursor!="number"||h.lazy.cursor<0)return m.error=new Error("lazy.cursor must be a positive integer greater than 0"),m;y=h.lazy.cursor}}const p=h.chunk||s,w=Math.min(f,p),g=y;let d=-1,v=-1;do{m.loops++;const b=await this.store.scan(y,"match","r:*","count",w);y=Number(b[0]),d=b[1].length;const S=l==="lazy"?n(b[1],f):b[1];m.references.scanned=m.references.scanned.concat(S);let _=[];for(let P=0;P<S.length;P++){const E=S[P];_.push(["smembers",E])}const x=await this.store.pipeline(_).exec(),$={},A={};for(let P=0;P<x.length;P++){const E=x[P],C=S[P];A[C]=E[1];for(let I=0;I<E[1].length;I++){const R=E[1][I];$[R]?$[R].push(C):$[R]=[C],m.keys.scanned.add(R)}}const G=Object.keys($);_=G.map(P=>["exists",P]);const X=await this.store.pipeline(_).exec(),B={};for(let P=0;P<G.length;P++){const E=G[P];if(X[P][1]!==1)for(let C=0;C<$[E].length;C++){const I=$[E][C];B[I]?B[I].push(E):B[I]=[E],m.keys.removed.add(E)}}const Z=Object.keys(B),ee=[];for(let P=0;P<Z.length;P++){const E=Z[P];A[E].length===B[E].length?(ee.push(["del",E]),m.references.removed.push(E)):ee.push(["srem",E,B[E]])}if(await this.store.pipeline(ee).exec(),v=ee.length,l==="lazy"&&m.references.scanned.length>=f)break}while(g!==y&&d>0&&v>0);m.cursor=y,m.keys.scanned=Array.from(m.keys.scanned),m.keys.removed=Array.from(m.keys.removed)}catch(y){this.log.error({msg:"acd/storage/redis.gc error",err:y}),m.error=y}return m}}return ht=c,ht}var dt,Xt;function Hi(){if(Xt)return dt;Xt=1;function t(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=function(){return this}),t.of=function(){var e=arguments,r=e.length,n=0;return new t(function(){return n>=r?{done:!0}:{done:!1,value:e[n++]}})},t.empty=function(){var e=new t(function(){return{done:!0}});return e},t.fromSequence=function(e){var r=0,n=e.length;return new t(function(){return r>=n?{done:!0}:{done:!1,value:e[r++]}})},t.is=function(e){return e instanceof t?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},dt=t,dt}var pt={},Zt;function Ki(){return Zt||(Zt=1,pt.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",pt.SYMBOL_SUPPORT=typeof Symbol<"u"),pt}var gt,er;function Wr(){if(er)return gt;er=1;var t=Ki(),e=t.ARRAY_BUFFER_SUPPORT,r=t.SYMBOL_SUPPORT;return gt=function(n,i){var s,o,a,c,u;if(!n)throw new Error("obliterator/forEach: invalid iterable.");if(typeof i!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(n)||e&&ArrayBuffer.isView(n)||typeof n=="string"||n.toString()==="[object Arguments]"){for(a=0,c=n.length;a<c;a++)i(n[a],a);return}if(typeof n.forEach=="function"){n.forEach(i);return}if(r&&Symbol.iterator in n&&typeof n.next!="function"&&(n=n[Symbol.iterator]()),typeof n.next=="function"){for(s=n,a=0;u=s.next(),u.done!==!0;)i(u.value,a),a++;return}for(o in n)n.hasOwnProperty(o)&&i(n[o],o)},gt}var tr={},rr;function Gr(){return rr||(rr=1,(function(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,n=Math.pow(2,32)-1,i=Math.pow(2,7)-1,s=Math.pow(2,15)-1,o=Math.pow(2,31)-1;t.getPointerArray=function(c){var u=c-1;if(u<=e)return Uint8Array;
20if(u<=r)return Uint16Array;if(u<=n)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(c){var u=c-1;return u<=i?Int8Array:u<=s?Int16Array:u<=o?Int32Array:Float64Array},t.getNumberType=function(c){return c===(c|0)?Math.sign(c)===-1?c<=127&&c>=-128?Int8Array:c<=32767&&c>=-32768?Int16Array:Int32Array:c<=255?Uint8Array:c<=65535?Uint16Array:Uint32Array:Float64Array};var a={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(c,u){var l=null,h=0,m,y,f,p,w;for(p=0,w=c.length;p<w;p++)f=u?u(c[p]):c[p],y=t.getNumberType(f),m=a[y.name],m>h&&(h=m,l=y);return l},t.isTypedArray=function(c){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(c)},t.concat=function(){var c=0,u,l,h;for(u=0,h=arguments.length;u<h;u++)c+=arguments[u].length;var m=new arguments[0].constructor(c);for(u=0,l=0;u<h;u++)m.set(arguments[u],l),l+=arguments[u].length;return m},t.indices=function(c){for(var u=t.getPointerArray(c),l=new u(c),h=0;h<c;h++)l[h]=h;return l}})(tr)),tr}var be={},nr;function Wi(){if(nr)return be;nr=1;var t=Wr(),e=Gr();function r(o){return Array.isArray(o)||e.isTypedArray(o)}function n(o){if(typeof o.length=="number")return o.length;if(typeof o.size=="number")return o.size}function i(o){var a=n(o),c=typeof a=="number"?new Array(a):[],u=0;return t(o,function(l){c[u++]=l}),c}function s(o){var a=n(o),c=typeof a=="number"?e.getPointerArray(a):Array,u=typeof a=="number"?new Array(a):[],l=typeof a=="number"?new c(a):[],h=0;return t(o,function(m){u[h]=m,l[h]=h++}),[u,l]}return be.isArrayLike=r,be.guessLength=n,be.toArray=i,be.toArrayWithIndices=s,be}var yt,ir;function Gi(){if(ir)return yt;ir=1;var t=Hi(),e=Wr(),r=Gr(),n=Wi();function i(s,o,a){if(arguments.length<2&&(a=s,s=null,o=null),this.capacity=a,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var c=r.getPointerArray(a);this.forward=new c(a),this.backward=new c(a),this.K=typeof s=="function"?new s(a):new Array(a),this.V=typeof o=="function"?new o(a):new Array(a),this.size=0,this.head=0,this.tail=0,this.items={}}return i.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},i.prototype.splayOnTop=function(s){var o=this.head;if(this.head===s)return this;var a=this.backward[s],c=this.forward[s];return this.tail===s?this.tail=a:this.backward[c]=a,this.forward[a]=c,this.backward[o]=s,this.head=s,this.forward[s]=o,this},i.prototype.set=function(s,o){var a=this.items[s];if(typeof a<"u"){this.splayOnTop(a),this.V[a]=o;return}this.size<this.capacity?a=this.size++:(a=this.tail,this.tail=this.backward[a],delete this.items[this.K[a]]),this.items[s]=a,this.K[a]=s,this.V[a]=o,this.forward[a]=this.head,this.backward[this.head]=a,this.head=a},i.prototype.setpop=function(s,o){var a=null,c=null,u=this.items[s];return typeof u<"u"?(this.splayOnTop(u),a=this.V[u],this.V[u]=o,{evicted:!1,key:s,value:a}):(this.size<this.capacity?u=this.size++:(u=this.tail,this.tail=this.backward[u],a=this.V[u],c=this.K[u],delete this.items[c]),this.items[s]=u,this.K[u]=s,this.V[u]=o,this.forward[u]=this.head,this.backward[this.head]=u,this.head=u,c?{evicted:!0,key:c,value:a}:null)},i.prototype.has=function(s){return s in this.items},i.prototype.get=function(s){var o=this.items[s];if(!(typeof o>"u"))return this.splayOnTop(o),this.V[o]},i.prototype.peek=function(s){var o=this.items[s];if(!(typeof o>"u"))return this.V[o]},i.prototype.forEach=function(s,o){o=arguments.length>1?o:this;for(var a=0,c=this.size,u=this.head,l=this.K,h=this.V,m=this.forward;a<c;)s.call(o,h[u],l[u],this),u=m[u],a++},i.prototype.keys=function(){var s=0,o=this.size,a=this.head,c=this.K,u=this.forward;return new t(function(){if(s>=o)return{done:!0};var l=c[a];return s++,s<o&&(a=u[a]),{done:!1,value:l}})},i.prototype.values=function(){var s=0,o=this.size,a=this.head,c=this.V,u=this.forward;return new t(function(){if(s>=o)return{done:!0};var l=c[a];return s++,s<o&&(a=u[a]),{done:!1,value:l}})},i.prototype.entries=function(){var s=0,o=this.size,a=this.head,c=this.K,u=this.V,l=this.forward;return new t(function(){if(s>=o)return{done:!0};var h=c[a],m=u[a];return s++,s<o&&(a=l[a]),{done:!1,value:[h,m]}})},typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=i.prototype.entries),i.prototype.inspect=function(){for(var s=new Map,o=this.entries(),a;a=o.next(),!a.done;)s.set(a.value[0],a.value[1]);return Object.defineProperty(s,"constructor",{value:i,enumerable:!1}),s},typeof Symbol<"u"&&(i.prototype[Symbol.for("nodejs.util.inspect.custom")]=i.prototype.inspect),i.from=function(s,o,a,c){if(arguments.length<2){if(c=n.guessLength(s),typeof c!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(c=o,o=null,a=null);var u=new i(o,a,c);return e(s,function(l,h){u.set(h,l)}),u},yt=i,yt}var mt,sr;function Ji(){if(sr)return mt;sr=1;const t=Gi(),{abstractLogging:e}
20=Be(),r=Kr(),{findMatchingIndexes:n,findNotMatching:i,bsearchIndex:s,wildcardMatch:o}=Be(),a=typeof globalThis.setImmediate<"u"?globalThis.setImmediate:(y,...f)=>setTimeout(y,0,...f),c=1024;class u extends r{constructor(f={}){if(f.size&&(typeof f.size!="number"||f.size<1))throw new Error("size must be a positive integer greater than 0");super(f),this.size=f.size||c,this.log=f.log||e(),this.invalidation=f.invalidation||!1,this.init()}init(){this.store=new t(this.size),this.invalidation&&(this.keysReferences=new Map,this.referencesKeys=new Map)}get(f){this.log.debug({msg:"acd/storage/memory.get",key:f});const p=this.store.get(f);if(p){if(this.log.debug({msg:"acd/storage/memory.get, entry",entry:p,now:h()}),p.start+p.ttl>h())return this.log.debug({msg:"acd/storage/memory.get, key is NOT expired",key:f,entry:p}),p.value;this.log.debug({msg:"acd/storage/memory.get, key is EXPIRED",key:f,entry:p}),a(()=>this.remove(f))}}getTTL(f){this.log.debug({msg:"acd/storage/memory.getTTL",key:f});const p=this.store.peek(f);let w=0;return p&&(w=p.start+p.ttl-h(),w<0&&(w=0)),w}set(f,p,w,g){if(this.log.debug({msg:"acd/storage/memory.set",key:f,value:p,ttl:w,references:g}),w=Number(w),!w||w<0)return;const d=this.store.has(f),v=this.store.setpop(f,{value:p,ttl:w,start:h()});if(this.log.debug({msg:"acd/storage/memory.set, evicted",removed:v}),v&&v.evicted&&(this.log.debug({msg:"acd/storage/memory.set, remove evicted key",key:v.key}),this._removeReferences([v.key])),!g||g.length<1)return;if(!this.invalidation){this.log.warn({msg:"acd/storage/memory.set, invalidation is disabled, references are useless"});return}g=[...new Set(g)];let b;if(d&&(b=this.keysReferences.get(f),this.log.debug({msg:"acd/storage/memory.set, current keys-references",key:f,references:b}),b)){b.sort(),g.sort();const _=i(g,b);for(const x of _){const $=this.referencesKeys.get(x);if(!$)continue;const A=s($,f);if(!(A<0)){if($.splice(A,1),$.length<1){this.referencesKeys.delete(x);continue}this.referencesKeys.set(x,$)}}}const S=b?i(b,g):g;for(let _=0;_<S.length;_++){const x=S[_];let $=this.referencesKeys.get(x);$?(this.log.debug({msg:"acd/storage/memory.set, add reference-key",key:f,reference:x}),$.push(f)):$=[f],this.log.debug({msg:"acd/storage/memory.set, set reference-keys",keys:$,reference:x}),this.referencesKeys.set(x,$)}this.keysReferences.set(f,g)}remove(f){this.log.debug({msg:"acd/storage/memory.remove",key:f});const p=this._removeKey(f);return this._removeReferences([f]),p}_removeKey(f){return this.log.debug({msg:"acd/storage/memory._removeKey",key:f}),this.store.has(f)?(this.store.set(f,void 0),!0):!1}_removeReferences(f){if(!this.invalidation)return;this.log.debug({msg:"acd/storage/memory._removeReferences",keys:f});const p=new Set;for(let w=0;w<f.length;w++){const g=f[w],d=this.keysReferences.get(g);if(d){for(let v=0;v<d.length;v++)p.add(d[v]);this.log.debug({msg:"acd/storage/memory._removeReferences, delete key-references",key:g}),this.keysReferences.delete(g)}}this._removeReferencesKeys([...p],f)}_removeReferencesKeys(f,p){p.sort(),this.log.debug({msg:"acd/storage/memory._removeReferencesKeys",references:f,keys:p});for(let w=0;w<f.length;w++){const g=f[w],d=this.referencesKeys.get(g);if(this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, get reference-key",reference:g,keys:p,referencesKeys:d}),!d)continue;const v=n(p,d);if(this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, removing",reference:g,referencesToRemove:v,referencesKeys:d}),v.length===d.length){this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, delete",reference:g}),this.referencesKeys.delete(g);continue}for(let b=v.length-1;b>=0;b--)this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, remove",reference:g,referencesKeys:d,at:v[b]}),d.splice(v[b],1)}}invalidate(f){return this.invalidation?(this.log.debug({msg:"acd/storage/memory.invalidate",references:f}),Array.isArray(f)?this._invalidateReferences(f):this._invalidateReference(f)):(this.log.warn({msg:"acd/storage/memory.invalidate, exit due invalidation is disabled"}),[])}_invalidateReferences(f){const p=[];for(let w=0;w<f.length;w++){const g=f[w],d=this.referencesKeys.get(g);if(this.log.debug({msg:"acd/storage/memory._invalidateReferences, remove keys on reference",reference:g,keys:d}),!!d){for(let v=0;v<d.length;v++){const b=d[v];this.log.debug({msg:"acd/storage/memory._invalidateReferences, remove key on reference",reference:g,key:b}),this._removeKey(b)&&p.push(b)}this.log.debug({msg:"acd/storage/memory._invalidateReferences, remove references of",reference:g,keys:d}),this._removeReferences([...d])}}return p}_invalidateReference(f){if(f.includes("*")){const g=[];for(const d of this.referencesKeys.keys())o(f,d)&&g.push(d);return this._invalidateReferences(g)}const p=this.referencesKeys.get(f),w=[];if(this.log.debug({msg:"acd/storage/memory._invalidateReference, remove keys on reference",reference:f,keys:p}),!p)return w;for(let g=0;g<p.length;g++){const d=p[g];this.log.debug({msg:"acd/storage/memory._invalidateReference, remove key on reference",reference:f,key:d}),this._removeKey(d)&&w.push(d)}return this.log.debug({msg:"acd/storage/memory._invalidateReference, remove references of",reference:f,keys:p}),this._removeReferences([...p]),w}clear(f){if(this.log.debug({msg:"acd/storage/memory.clear",name:f}),!f){if(this.store.clear(),!this.invalidation)return;this.referencesKeys.clear(),this.keysReferences.clear();return}const p=[];this.store.forEach((g,d)=>{this.log.debug({msg:"acd/storage/memory.clear, iterate key",key:d}),d.indexOf(f)===0&&(this.log.debug({msg:"acd/storage/memory.clear, remove key",key:d}),p.push(d))});const w=[];for(let g=0;g<p.length;g++)this._removeKey(p[g])&&w.push(p[g]);return this._removeReferences(w),w}refresh(){this.log.debug({msg:"acd/storage/memory.refresh"}),this.init()}}let l;function h(){if(l!==void 0)return l;l=Math.floor(Date.now()/1e3);const y=setTimeout(m,1e3);return typeof y.unref=="function"&&y.unref(),l}function m(){l=void 0}return mt=u,mt}var vt,or;function Jr(){if(or)return vt;or=1;const{isServerSide:t}=Be();let e;t&&(e=Bi());const r=Ji(),n={redis:"redis"};function i(s,o){if(!t&&s===n.redis)throw new Error("Redis storage is not supported in the browser");return s===n.redis?new e(o):new r(o)}return vt=i,vt}var ar;function Yi(){if(ar)return at;ar=1;const{kValues:t,kStorage:e,kStorages:r,kTransfromer:n,kTTL:i,kOnDedupe:s,kOnError:o,kOnHit:a,kOnMiss:c,kStale:u}=zi(),l=Hr(),h=Jr();class m{constructor(g={}){if(!g.storage)throw new Error("storage is required");if(g.ttl&&typeof g.ttl=="number"&&(g.ttl<0||!Number.isInteger(g.ttl)))throw new Error("ttl must be a positive integer greater than 0");if(g.onDedupe&&typeof g.onDedupe!="function")throw new Error("onDedupe must be a function");if(g.onError&&typeof g.onError!="function")throw new Error("onError must be a function");if(g.onHit&&typeof g.onHit!="function")throw new Error("onHit must be a function");if(g.onMiss&&typeof g.onMiss!="function")throw new Error("onMiss must be a function");if(typeof g.stale=="number"&&!(Math.floor(g.stale)===g.stale&&g.stale>=0))throw new Error("stale must be an integer greater or equal to 0");this[t]={},this[e]=g.storage,this[r]=new Map,this[r].set("_default",g.storage),this[n]=g.transformer,this[i]=g.ttl||0,this[s]=g.onDedupe||p,this[o]=g.onError||p,this[a]=g.onHit||p,this[c]=g.onMiss||p,this[u]=g.stale||0}define(g,d,v){if(typeof d=="function"&&(v=d,d={}),g&&this[g])throw new Error(`${g} is already defined in the cache or it is a forbidden name`);if(d=d||{},typeof v!="function")throw new TypeError(`Missing the function parameter for '${g}'`);const b=d.serialize;
20if(b&&typeof b!="function")throw new TypeError("serialize must be a function");const S=d.references;if(S&&typeof S!="function")throw new TypeError("references must be a function");if(typeof d.ttl!="function"&&d.ttl&&(typeof d.ttl!="number"||d.ttl<0||!Number.isInteger(d.ttl)))throw new Error("ttl must be a positive integer greater than 0");let _;d.storage?(_=h(d.storage.type,d.storage.options),this[r].set(g,_)):_=this[e];const x=d.ttl!==void 0?d.ttl:this[i],$=d.stale!==void 0?d.stale:this[u],A=d.onDedupe||this[s],G=d.onError||this[o],X=d.onHit||this[a],B=d.onMiss||this[c],Z=d.transformer||this[n],ee=new y(v,g,b,S,_,Z,x,A,G,X,B,$);return this[t][g]=ee,this[g]=ee.add.bind(ee),this}async clear(g,d){if(g){if(!this[t][g])throw new Error(`${g} is not defined in the cache`);await this[t][g].clear(d);return}const v=[];for(const b of Object.values(this[t]))v.push(b.clear());await Promise.all(v)}async get(g,d){if(!this[t][g])throw new Error(`${g} is not defined in the cache`);return this[t][g].get(d)}async set(g,d,v,b,S){if(!this[t][g])throw new Error(`${g} is not defined in the cache`);return this[t][g].set(d,v,b,S)}async invalidate(g,d){if(!this[t][g])throw new Error(`${g} is not defined in the cache`);return this[t][g].invalidate(d)}async invalidateAll(g,d="_default"){if(!this[r].has(d))throw new Error(`${d} storage is not defined in the cache`);await this[r].get(d).invalidate(g)}}class y{constructor(g,d,v,b,S,_,x,$,A,G,X,B){this.dedupes=new Map,this.func=g,this.name=d,this.serialize=v,this.references=b,this.storage=S,this.transformer=_,this.ttl=x,this.onDedupe=$,this.onError=A,this.onHit=G,this.onMiss=X,this.stale=B}getKey(g){const d=this.serialize?this.serialize(g):g;return typeof d=="string"?d:l(d)}getStorageKey(g){return`${this.name}~${g}`}getStorageName(){return`${this.name}~`}add(g){try{const d=this.getKey(g);let v=this.dedupes.get(d);return v?this.onDedupe(d):(v=new f,this.buildPromise(v,g,d),this.dedupes.set(d,v)),v.promise}catch(d){this.onError(d)}}async wrapFunction(g,d){const v=this.getStorageKey(d);if(this.ttl>0||typeof this.ttl=="function"){const b=await this.get(v);if(b!==void 0){this.onHit(d);const S=typeof this.stale=="function"?this.stale(b):this.stale;return S>0&&await this.storage.getTTL(v)<=S&&this._wrapFunction(v,g,d).catch(p),b}else this.onMiss(d)}return this._wrapFunction(v,g,d)}async _wrapFunction(g,d,v){const b=await this.func(d,v),S=typeof this.stale=="function"?this.stale(b):this.stale;let _=typeof this.ttl=="function"?this.ttl(b):this.ttl;if(_==null||typeof _!="number"||!Number.isInteger(_))return this.onError(new Error("ttl must be an integer")),b;if(_+=S,_<1)return b;if(!this.references)return await this.set(g,b,_),b;try{let x=this.references(d,v,b),$=b;x&&typeof x.then=="function"&&(x=await x),this.transformer&&($=this.transformer.serialize(b)),await this.storage.set(g,$,_,x)}catch(x){this.onError(x)}return b}buildPromise(g,d,v){g.promise=this.wrapFunction(d,v),g.promise.then(b=>(this.dedupes.delete(v),b)).catch(b=>{this.onError(b),this.dedupes.delete(v);const S=this.storage.remove(this.getStorageKey(v));S&&typeof S.catch=="function"&&S.catch(p)})}async clear(g){if(g){const d=this.getKey(g);this.dedupes.delete(d),await this.storage.remove(this.getStorageKey(d)
20);return}await this.storage.clear(this.getStorageName()),this.dedupes.clear()}async get(g){const d=await this.storage.get(g);return this.transformer&&d?await this.transformer.deserialize(d):d}async set(g,d,v,b){return this.transformer&&(d=this.transformer.serialize(d)),this.storage.set(g,d,v,b)}async invalidate(g){return this.storage.invalidate(g)}}class f{constructor(){this.promise=null}}function p(){}return at.Cache=m,at}var bt,cr;function Qi(){if(cr)return bt;cr=1;const{Cache:t}=Yi(),e=Jr();function r(n){n?n.storage||(n.storage={type:"memory"}):n={storage:{type:"memory"}};const i=e(n.storage.type,n.storage.options);return new t({...n,storage:i})}return bt={Cache:t,createCache:r,createStorage:e},bt}var Xi=Qi();let wt=0,ur=[];function Zi(){return wt+=1,()=>{if(wt-=1,wt===0){let t=ur;ur=[];for(let e of t)e()}}}let Q=[],ue=0;const Ve=4;let Yr=t=>{let e=[],r={get(){return r.lc||r.listen(()=>{})(),r.value},lc:0,listen(n){return r.lc=e.push(n),()=>{for(let s=ue+Ve;s<Q.length;)Q[s]===n?Q.splice(s,Ve):s+=Ve;let i=e.indexOf(n);~i&&(e.splice(i,1),--r.lc||r.off())}},notify(n,i){let s=!Q.length;for(let o of e)Q.push(o,r.value,n,i);if(s){for(ue=0;ue<Q.length;ue+=Ve)Q[ue](Q[ue+1],Q[ue+2],Q[ue+3]);Q.length=0}},off(){},set(n){let i=r.value;i!==n&&(r.value=n,r.notify(i))},subscribe(n){let i=r.listen(n);return n(r.value),i},value:t};return r};const es=5,Ue=6,ke=10;let ts=(t,e,r,n)=>(t.events=t.events||{},t.events[r+ke]||(t.events[r+ke]=n(i=>{t.events[r].reduceRight((s,o)=>(o(s),s),{shared:{},...i})})),t.events[r]=t.events[r]||[],t.events[r].push(e),()=>{let i=t.events[r],s=i.indexOf(e);i.splice(s,1),i.length||(delete t.events[r],t.events[r+ke](),delete t.events[r+ke])}),rs=1e3,ns=(t,e)=>ts(t,r=>{let n=e(r);n&&t.events[Ue].push(n)},es,r=>{let n=t.listen;t.listen=(...s)=>(!t.lc&&!t.active&&(t.active=!0,r()),n(...s));let i=t.off;return t.events[Ue]=[],t.off=()=>{i(),setTimeout(()=>{if(t.active&&!t.lc){t.active=!1;for(let s of t.events[Ue])s();t.events[Ue]=[]}},rs)},()=>{t.listen=n,t.off=i}}),is=(t={})=>{let e=Yr(t);return e.setKey=function(r,n){let i=e.value;typeof n>"u"&&r in e.value?(e.value={...e.value},delete e.value[r],e.notify(i,r)):e.value[r]!==n&&(e.value={...e.value,[r]:n},e.notify(i,r))},e};const Rt=typeof document>"u"?"server":"browser",ss=t=>{const{ssr:e,setFetcher:r}=t;return n=>{if(Rt==="server")throw new Error("Live mode is not supported in server environments");if(e&&!n.client)throw new Error("The `client` option in `enableLiveMode` is required");const i=n.client||t.client||void 0,s=new AbortController;let o;return Pt(async()=>{const{enableLiveMode:a}=await import("./BYNARvin.js");return{enableLiveMode:a}},__vite__mapDeps([0,1,2,3]),import.meta.url).then(({enableLiveMode:a})=>{s.signal.aborted||(o=a({...n,client:i,setFetcher:r,ssr:e}))}),()=>{s.abort(),o?.()}}};function lr(t){return t.withConfig({allowReconfigure:!1})}const os=t=>{const{ssr:e=!1,tag:r="core-loader"}=t;if(e&&t.client)throw new TypeError("`client` option is not allowed when `ssr: true`, use `setServerClient` from your server entry point instead");if(!e&&t.client===!1)throw new TypeError("You must set `ssr: true` when `client: false` is used");if(!e&&!t.client)throw new TypeError("`client` is required");let n=e?void 0:lr(t.client);function i(h){return Xi.createCache().define("fetch",async m=>{if(!h)throw new Error("You have to set the Sanity client with `setServerClient` before any data fetching is done");const{query:y,params:f={},perspective:p,useCdn:w,stega:g}=JSON.parse(m),{result:d,resultSourceMap:v}=await h.fetch(y,f,{tag:r,filterResponse:!1,perspective:p,useCdn:w,stega:g});return{result:d,resultSourceMap:v}})}function s(){const h=n?.config().perspective||"published";return o.instance=i(n),{hydrate:(m,y,f)=>({loading:f?.data===void 0||f?.sourceMap===void 0,error:void 0,data:f?.data,sourceMap:f?.sourceMap,perspective:h}),fetch:(m,y,f,p)=>{if(p.signal.aborted)return;const w=Zi();f.setKey("loading",!0),f.setKey("error",void 0),o.instance.fetch(JSON.stringify({query:m,params:y})).then(g=>{p.signal.aborted||(f.setKey("data",g.result),f.setKey("sourceMap",g.resultSourceMap),f.setKey("perspective",h))}).catch(g=>{f.setKey("error",g)}).finally(()=>{f.setKey("loading",!1),w()})}}}const o={instance:i(n)},a=Yr(n?s():void 0),c=ss({client:n||void 0,ssr:e,setFetcher:h=>{const m=a.get();return a.set(h),()=>a.set(m)}}),u=(h,m={},y)=>{const f=a.get(),p=is(f?f.hydrate(h,m,y):{loading:!1,error:typeof y?.data>"u"?new Error("The `initial` option is required when `ssr: true`"):void 0,data:y?.data,sourceMap:y?.sourceMap,perspective:y?.perspective});return ns(p,()=>{let w=new AbortController;const g=a.subscribe(d=>{!d||w.signal.aborted||(w.abort(),w=new AbortController,d.fetch(h,m,p,w))});return()=>{w.abort(),g()}}),p},l={instance:void 0,canPreviewDrafts:!1};return{createFetcherStore:u,enableLiveMode:c,setServerClient:h=>{if(Rt!=="server")throw new Error("`setServerClient` can only be called in server environments, detected: "+JSON.stringify(Rt));if(!e)throw new Error("`setServerClient` can only be called when `ssr: true`");
20l.instance=n=lr(h),l.canPreviewDrafts=!!n.config().token,a.set(s())},unstable__cache:o,unstable__serverClient:l}},fr=(t,e,r)=>t?os({tag:"nuxt-loader",client:!1,ssr:!0}):void 0,Qr=!(typeof navigator>"u")&&navigator.product==="ReactNative",Xr={timeout:Qr?6e4:12e4},as=function(t){const e={...Xr,...typeof t=="string"?{url:t}:t};if(e.timeout=Zr(e.timeout),e.query){const{url:r,searchParams:n}=(function(i){const s=i.indexOf("?");if(s===-1)return{url:i,searchParams:new URLSearchParams};const o=i.slice(0,s),a=i.slice(s+1);if(!Qr)return{url:o,searchParams:new URLSearchParams(a)};if(typeof decodeURIComponent!="function")throw new Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");const c=new URLSearchParams;for(const u of a.split("&")){const[l,h]=u.split("=");l&&c.append(hr(l),hr(h||""))}return{url:o,searchParams:c}})(e.url);for(const[i,s]of Object.entries(e.query)){if(s!==void 0)if(Array.isArray(s))for(const a of s)n.append(i,a);else n.append(i,s);const o=n.toString();o&&(e.url=`${r}?${o}`)}}return e.method=e.body&&!e.method?"POST":(e.method||"GET").toUpperCase(),e};function hr(t){return decodeURIComponent(t.replace(/\+/g," "))}function Zr(t){if(t===!1||t===0)return!1;if(t.connect||t.socket)return t;const e=Number(t);return isNaN(e)?Zr(Xr.timeout):{connect:e,socket:e}}const cs=/^https?:\/\//i,us=function(t){if(!cs.test(t.url))throw new Error(`"${t.url}" is not a valid URL`)};function en(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const ls=["request","response","progress","error","abort"],dr=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];function tn(t,e){const r=[],n=dr.reduce((s,o)=>(s[o]=s[o]||[],s),{processOptions:[as],validateOptions:[us]});function i(s){const o=ls.reduce((y,f)=>(y[f]=(function(){const p=Object.create(null);let w=0;return{publish:function(g){for(const d in p)p[d](g)},subscribe:function(g){const d=w++;return p[d]=g,function(){delete p[d]}}}})(),y),{}),a=(y=>function(f,p,...w){const g=f==="onError";let d=p;for(let v=0;v<y[f].length&&(d=(0,y[f][v])(d,...w),!g||d);v++);return d})(n),c=a("processOptions",s);a("validateOptions",c);const u={options:c,channels:o,applyMiddleware:a};let l;const h=o.request.subscribe(y=>{l=e(y,(f,p)=>((w,g,d)=>{let v=w,b=g;if(!v)try{b=a("onResponse",g,d)}catch(S){b=null,v=S}v=v&&a("onError",v,d),v?o.error.publish(v):b&&o.response.publish(b)})(f,p,y))});o.abort.subscribe(()=>{h(),l&&l.abort()});const m=a("onReturn",o,u);return m===o&&o.request.publish(u),m}return i.use=function(s){if(!s)throw new Error("Tried to add middleware that resolved to falsey value");if(typeof s=="function")throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(s.onReturn&&n.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return dr.forEach(o=>{s[o]&&n[o].push(s[o])}),r.push(s),i},i.clone=()=>tn(r,e),t.forEach(i.use),i}var pr,gr,fs=en((function(){if(gr)return pr;gr=1;var t=function(r){return r.replace(/^\s+|\s+$/g,"")},e=function(r){return Object.prototype.toString.call(r)==="[object Array]"};return pr=function(r){if(!r)return{};for(var n=Object.create(null),i=t(r).split(`
21`),s=0;s<i.length;s++){var o=i[s],a=o.indexOf(":"),c=t(o.slice(0,a)).toLowerCase(),u=t(o.slice(a+1));typeof n[c]>"u"?n[c]=u:e(n[c])?n[c].push(u):n[c]=[n[c],u]}return n}})());let $t=class{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#t;#e;#n;#i={};#r;#s={};#o;open(e,r,n){this.#t=e,this.#e=r,this.#n="",this.readyState=1,this.onreadystatechange?.(),this.#r=void 0}abort(){this.#r&&this.#r.abort()}getAllResponseHeaders(){return this.#n}setRequestHeader(e,r){this.#i[e]=r}setInit(e,r=!0){this.#s=e,this.#o=r}send(e){const r=this.responseType!=="arraybuffer",n={...this.#s,method:this.#t,headers:this.#i,body:e};typeof AbortController=="function"&&this.#o&&(this.#r=new AbortController,typeof EventTarget<"u"&&this.#r.signal instanceof EventTarget&&(n.signal=this.#r.signal)),typeof document<"u"&&(n.credentials=this.withCredentials?"include":"omit"),fetch(this.#e,n).then(i=>
21(i.headers.forEach((s,o)=>{this.#n+=`${o}: ${s}\r
22`}),this.status=i.status,this.statusText=i.statusText,this.readyState=3,this.onreadystatechange?.(),r?i.text():i.arrayBuffer())).then(i=>{typeof i=="string"?this.responseText=i:this.response=i,this.readyState=4,this.onreadystatechange?.()}).catch(i=>{i.name!=="AbortError"?this.onerror?.(i):this.onabort?.()})}};const Ot=typeof XMLHttpRequest=="function"?"xhr":"fetch",hs=Ot==="xhr"?XMLHttpRequest:$t,ds=(t,e)=>{const r=t.options,n=t.applyMiddleware("finalizeOptions",r),i={},s=t.applyMiddleware("interceptRequest",void 0,{adapter:Ot,context:t});if(s){const p=setTimeout(e,0,null,s);return{abort:()=>clearTimeout(p)}}let o=new hs;o instanceof $t&&typeof n.fetch=="object"&&o.setInit(n.fetch,n.useAbortSignal??!0);const a=n.headers,c=n.timeout;let u=!1,l=!1,h=!1;if(o.onerror=p=>{f(o instanceof $t?p instanceof Error?p:new Error(`Request error while attempting to reach is ${n.url}`,{cause:p}):new Error(`Request error while attempting to reach is ${n.url}${p.lengthComputable?`(${p.loaded} of ${p.total} bytes transferred)`:""}`))},o.ontimeout=p=>{f(new Error(`Request timeout while attempting to reach ${n.url}${p.lengthComputable?`(${p.loaded} of ${p.total} bytes transferred)`:""}`))},o.onabort=()=>{y(!0),u=!0},o.onreadystatechange=function(){c&&(y(),i.socket=setTimeout(()=>m("ESOCKETTIMEDOUT"),c.socket)),!u&&o&&o.readyState===4&&o.status!==0&&(function(){if(!(u||l||h)){if(o.status===0)return void f(new Error("Unknown XHR error"));y(),l=!0,e(null,{body:o.response||(o.responseType===""||o.responseType==="text"?o.responseText:""),url:n.url,method:n.method,headers:fs(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}})()},o.open(n.method,n.url,!0),o.withCredentials=!!n.withCredentials,a&&o.setRequestHeader)for(const p in a)a.hasOwnProperty(p)&&o.setRequestHeader(p,a[p]);return n.rawBody&&(o.responseType="arraybuffer"),t.applyMiddleware("onRequest",{options:n,adapter:Ot,request:o,context:t}),o.send(n.body||null),c&&(i.connect=setTimeout(()=>m("ETIMEDOUT"),c.connect)),{abort:function(){u=!0,o&&o.abort()}};function m(p){h=!0,o.abort();const w=new Error(p==="ESOCKETTIMEDOUT"?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);w.code=p,t.channels.error.publish(w)}function y(p){(p||u||o&&o.readyState>=2&&i.connect)&&clearTimeout(i.connect),i.socket&&clearTimeout(i.socket)}function f(p){if(l)return;y(!0),l=!0,o=null;const w=p||new Error(`Network error while attempting to reach ${n.url}`);w.isNetworkError=!0,w.request=n,e(w)}},ps=(t=[],e=ds)=>tn(t,e);var gs={},yr,mr,vr,br,wr,Et={exports:{}};wr||(wr=1,(function(t,e){e.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;n.splice(1,0,i,"color: inherit");let s=0,o=0;n[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(s++,a==="%c"&&(o=s))}),n.splice(o,0,i)},e.save=function(n){try{n?e.storage.setItem("debug",n):e.storage.removeItem("debug")}catch{}},e.load=function(){let n;try{n=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=gs.DEBUG),n},e.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=(function(){try{return localStorage}catch{}})(),e.destroy=(()=>{let n=!1;return()=>{n||(n=!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`."))}})(),e.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","#33
22CCCC","#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"],e.log=console.debug||console.log||(()=>{}),t.exports=(br?vr:(br=1,vr=function(n){function i(a){let c,u,l,h=null;function m(...y){if(!m.enabled)return;const f=m,p=Number(new Date),w=p-(c||p);f.diff=w,f.prev=c,f.curr=p,c=p,y[0]=i.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let g=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(d,v)=>{if(d==="%%")return"%";g++;const b=i.formatters[v];if(typeof b=="function"){const S=y[g];d=b.call(f,S),y.splice(g,1),g--}return d}),i.formatArgs.call(f,y),(f.log||i.log).apply(f,y)}return m.namespace=a,m.useColors=i.useColors(),m.color=i.selectColor(a),m.extend=s,m.destroy=i.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(u!==i.namespaces&&(u=i.namespaces,l=i.enabled(a)),l),set:y=>{h=y}}),typeof i.init=="function"&&i.init(m),m}function s(a,c){const u=i(this.namespace+(typeof c>"u"?":":c)+a);return u.log=this.log,u}function o(a,c){let u=0,l=0,h=-1,m=0;for(;u<a.length;)if(l<c.length&&(c[l]===a[u]||c[l]==="*"))c[l]==="*"?(h=l,m=u,l++):(u++,l++);else{if(h===-1)return!1;l=h+1,m++,u=m}for(;l<c.length&&c[l]==="*";)l++;return l===c.length}return i.debug=i,i.default=i,i.coerce=function(a){return a instanceof Error?a.stack||a.message:a},i.disable=function(){const a=[...i.names,...i.skips.map(c=>"-"+c)].join(",");return i.enable(""),a},i.enable=function(a){i.save(a),i.namespaces=a,i.names=[],i.skips=[];const c=(typeof a=="string"?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const u of c)u[0]==="-"?i.skips.push(u.slice(1)):i.names.push(u)},i.enabled=function(a){for(const c of i.skips)if(o(a,c))return!1;for(const c of i.names)if(o(a,c))return!0;return!1},i.humanize=(function(){if(mr)return yr;mr=1;var a=1e3,c=60*a,u=60*c,l=24*u,h=7*l;function m(y,f,p,w){var g=f>=1.5*p;return Math.round(y/p)+" "+w+(g?"s":"")}return yr=function(y,f){f=f||{};var p,w,g=typeof y;if(g==="string"&&y.length>0)return(function(d){if(!((d=String(d)).length>100)){var v=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(v){var b=parseFloat(v[1]);switch((v[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*b;case"weeks":case"week":case"w":return b*h;case"days":case"day":case"d":return b*l;case"hours":case"hour":case"hrs":case"hr":case"h":return b*u;case"minutes":case"minute":case"mins":case"min":case"m":return b*c;case"seconds":case"second":case"secs":case"sec":case"s":return b*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}})(y);if(g==="number"&&isFinite(y))return f.long?(p=y,(w=Math.abs(p))>=l?m(p,w,l,"day"):w>=u?m(p,w,u,"hour"):w>=c?m(p,w,c,"minute"):w>=a?m(p,w,a,"second"):p+" ms"):(function(d){var v=Math.abs(d);return v>=l?Math.round(d/l)+"d":v>=u?Math.round(d/u)+"h":v>=c?Math.round(d/c)+"m":v>=a?Math.round(d/a)+"s":d+"ms"})(y);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(y))}})(),i.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(n).forEach(a=>{i[a]=n[a]}),i.names=[],i.skips=[],i.formatters={},i.selectColor=function(a){let c=0;for(let u=0;u<a.length;u++)c=(c<<5)-c+a.charCodeAt(u),c|=0;return i.colors[Math.abs(c)%i.colors.length]},i.enable(i.load()),i}))(e);const{formatters:r}=t.exports;r.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}})(Et,Et.exports)),Et.exports;const ys=typeof Buffer>"u"?()=>!1:t=>Buffer.isBuffer(t);function Er(t){return Object.prototype.toString.call(t)==="[object Object]"}function ms(t){if(Er(t)===!1)return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(Er(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)}const vs=["boolean","string","number"];function bs(){return{processOptions:t=>{const e=t.body;return!e||typeof e.pipe=="function"||ys(e)||vs.indexOf(typeof e)===-1&&!Array.isArray(e)&&!ms(e)?t:Object.assign({},t,{body:JSON.stringify(t.body),headers:Object.assign({},t.headers,{"Content-Type":"application/json"})})}}}function ws(t){return{onResponse:r=>{const n=r.headers["content-type"]||"",i=t&&t.force||n.indexOf("application/json")!==-1;return r.body&&n&&i?Object.assign({},r,{body:e(r.body)}):r},processOptions:r=>Object.assign({},r,{headers:Object.assign({Accept:"application/json"},r.headers)})};function e(r){try{return JSON.parse(r)}catch(n){throw n.message=`Failed to parsed response body as JSON: ${n.message}`,n}}}let $e={};typeof globalThis<"u"?$e=globalThis:typeof window<"u"?$e=window:typeof global<"u"?$e=global:typeof self<"u"&&($e=self);var Es=$e;function Ss(t={}){const e=t.implementation||Es.Observable;if(!e)throw new Error("`Observable` is not available in global scope, and n
22o implementation was passed");return{onReturn:(r,n)=>new e(i=>(r.error.subscribe(s=>i.error(s)),r.progress.subscribe(s=>i.next(Object.assign({type:"progress"},s))),r.response.subscribe(s=>{i.next(Object.assign({type:"response"},s)),i.complete()}),r.request.publish(n),()=>r.abort.publish()))}}function _s(){return{onRequest:t=>{if(t.adapter!=="xhr")return;const e=t.request,r=t.context;function n(i){return s=>{const o=s.lengthComputable?s.loaded/s.total*100:-1;r.channels.progress.publish({stage:i,percent:o,total:s.total,loaded:s.loaded,lengthComputable:s.lengthComputable})}}"upload"in e&&"onprogress"in e.upload&&(e.upload.onprogress=n("upload")),"onprogress"in e&&(e.onprogress=n("download"))}}}var rn=(t,e,r)=>(r.method==="GET"||r.method==="HEAD")&&(t.isNetworkError||!1);function Cs(t){return 100*Math.pow(2,t)+100*Math.random()}const Dt=(t={})=>(e=>{const r=e.maxRetries||5,n=e.retryDelay||Cs,i=e.shouldRetry;return{onError:(s,o)=>{const a=o.options,c=a.maxRetries||r,u=a.retryDelay||n,l=a.shouldRetry||i,h=a.attemptNumber||0;if((m=a.body)!==null&&typeof m=="object"&&typeof m.pipe=="function"||!l(s,h,a)||h>=c)return s;var m;const y=Object.assign({},o,{options:Object.assign({},a,{attemptNumber:h+1})});return setTimeout(()=>o.channels.request.publish(y),u(h)),null}}})({shouldRetry:rn,...t});Dt.shouldRetry=rn;var xt=function(t,e){return xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},xt(t,e)};function ce(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");xt(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Ts(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{u(n.next(l))}catch(h){o(h)}}function c(l){try{u(n.throw(l))}catch(h){o(h)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((n=n.apply(t,e||[])).next())})}function nn(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(l){u=[6,l],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _e(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function oe(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function ae(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function we(t){return this instanceof we?(this.v=t,this):new we(t)}function As(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(y){return function(f){return Promise.resolve(f).then(y,h)}}function a(y,f){n[y]&&(i[y]=function(p){return new Promise(function(w,g){s.push([y,p,w,g])>1||c(y,p)})},f&&(i[y]=f(i[y])))}function c(y,f){try{u(n[y](f))}catch(p){m(s[0][3],p)}}function u(y){y.value instanceof we?Promise.resolve(y.value.v).then(l,h):m(s[0][2],y)}function l(y){c("next",y)}function h(y){c("throw",y)}function m(y,f){y(f),s.shift(),s.length&&c(s[0][0],s[0][1])}}function Is(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof _e=="function"?_e(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);
vendor: 7,141 bytes, lines 22-24
22function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function q(t){return typeof t=="function"}function Mt(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var St=Mt(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
23`+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
24  `):"",this.name="UnsubscriptionError",this.errors=r}});function He(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var Pe=(function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=_e(o),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(p){e={error:p}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(q(l))try{l()}catch(p){s=p instanceof St?p.errors:[p]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var m=_e(h),y=m.next();!y.done;y=m.next()){var f=y.value;try{Sr(f)}catch(p){s=s??[],p instanceof St?s=ae(ae([],oe(s)),oe(p.errors)):s.push(p)}}}catch(p){n={error:p}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}}if(s)throw new St(s)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)Sr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&He(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&He(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=(function(){var e=new t;return e.closed=!0,e})(),t})(),sn=Pe.EMPTY;function on(t){return t instanceof Pe||t&&"closed"in t&&q(t.remove)&&q(t.add)&&q(t.unsubscribe)}function Sr(t){q(t)?t():t.unsubscribe()}var Rs={Promise:void 0},$s={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,ae([t,e],oe(r)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function an(t){$s.setTimeout(function(){throw t})}function _r(){}function ze(t){t()}var jt=(function(t){ce(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,on(r)&&r.add(n)):n.destination=Ps,n}return e.create=function(r,n,i){return new Ce(r,n,i)},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(Pe),Os=(function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){Ne(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){Ne(n)}else Ne(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){Ne(r)}},t})(),Ce=(function(t){ce(e,t);function e(r,n,i){var s=t.call(this)||this,o;return q(r)||!r?o={next:r??void 0,error:n??void 0,complete:i??void 0}:o=r,s.destination=new Os(o),s}return e})(jt);function Ne(t){an(t)}function xs(t){throw t}var Ps={closed:!0,next:_r,error:xs,complete:_r},Lt=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Ze(t){return t}function Ds(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cn(t)}function cn(t){return t.length===0?Ze:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var V=(function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,s=js(e)?e:new Ce(e,r,n);return ze(function(){var o=i,a=o.operator,c=o.source;s.add(a?a.call(s,c):c?i._subscribe(s):i._trySubscribe(s))}),s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=Cr(r),new r(function(i,s){var o=new Ce({next:function(a){try{e(a)}catch(c){s(c),o.unsubscribe()}},error:s,complete:i});n.subscribe(o)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[Lt]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return cn(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=Cr(e),new e(function(n,i){var s;r.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},t.create=function(e){return new t(e)},t})();function Cr(t){var e;return(e=t??Rs.Promise)!==null&&e!==void 0?e:Promise}function Ms(t){return t&&q(t.next)&&q(t.error)&&q(t.complete)}function js(t){return t&&t instanceof jt||Ms(t)&&on(t)}function Ls(t){return q(t?.lift)}function ne(t){return function(e){if(Ls(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function fe(t,e,r,n,i){return new qs(t,e,r,n,i)}var qs=(function(t){ce(e,t);function e(r,n,i,s,o,a){var c=t.call(this,r)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=n?function(u){try{n(u)}catch(l){r.error(l)}}:t.prototype._next,c._error=s?function(u){try{s(u)}catch(l){r.error(l)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=i?function(){try{i()}catch(u){r.error(u)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e})(jt),Fs=Mt(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),qt=(function(t){ce(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new Tr(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new Fs},e.prototype.next=function(r){var n=this;
24ze(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=_e(n.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(r)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;ze(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;ze(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?sn:(this.currentObservers=null,a.push(r),new Pe(function(){n.currentObservers=null,He(a,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,s=n.thrownError,o=n.isStopped;i?r.error(s):o&&r.complete()},e.prototype.asObservable=function(){var r=new V;return r.source=this,r},e.create=function(r,n){return new Tr(r,n)},e})(V),Tr=(function(t){ce(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:sn},e})(qt),Ft={now:function(){return(Ft.delegate||Date).now()},delegate:void 0},Vs=(function(t){ce(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=Ft);var s=t.call(this)||this;return s._bufferSize=r,s._windowTime=n,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=n===1/0,s._bufferSize=Math.max(1,r),s._windowTime=Math.max(1,n),s}return e.prototype.next=function(r){var n=this,i=n.isStopped,s=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,c=n._windowTime;i||(s.push(r),!o&&s.push(a.now()+c)),this._trimBuffer(),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),i=this,s=i._infiniteTimeWindow,o=i._buffer,a=o.slice(),c=0;c<a.length&&!r.closed;c+=s?1:2)r.next(a[c]);return this._checkFinalizedStatuses(r),n},e.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,i=r._timestampProvider,s=r._buffer,o=r._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<s.length&&s.splice(0,s.length-a),!o){for(var c=i.now(),u=0,l=1;l<s.length&&s[l]<=c;l+=2)u=l;u&&s.splice(0,u+1)}},e})(qt),Us=(function(t){ce(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e})(Pe),Ar={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,ae([t,e],oe(r)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},ks=(function(t){ce(e,t);function e(r,n){var i=t.call(this,r,n)||this;
vendor: 4,803 bytes, line 24
24return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var s=this.id,o=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(o,s,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),Ar.setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Ar.clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,s;try{this.work(r)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,He(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e})(Us),Ir=(function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=Ft.now,t})(),Ns=(function(t){ce(e,t);function e(r,n){n===void 0&&(n=Ir.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e})(Ir),zs=new Ns(ks),Bs=zs,Hs=new V(function(t){return t.complete()});function Ks(t){return t&&q(t.schedule)}function Vt(t){return t[t.length-1]}function Ws(t){return q(Vt(t))?t.pop():void 0}function Ut(t){return Ks(Vt(t))?t.pop():void 0}function Gs(t,e){return typeof Vt(t)=="number"?t.pop():e}var un=(function(t){return t&&typeof t.length=="number"&&typeof t!="function"});function ln(t){return q(t?.then)}function fn(t){return q(t[Lt])}function hn(t){return Symbol.asyncIterator&&q(t?.[Symbol.asyncIterator])}function dn(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Js(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var pn=Js();function gn(t){return q(t?.[pn])}function yn(t){return As(this,arguments,function(){var r,n,i,s;return nn(this,function(o){switch(o.label){case 0:r=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,we(r.read())];case 3:return n=o.sent(),i=n.value,s=n.done,s?[4,we(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,we(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function mn(t){return q(t?.getReader)}function ie(t){if(t instanceof V)return t;if(t!=null){if(fn(t))return Ys(t);if(un(t))return Qs(t);if(ln(t))return Xs(t);if(hn(t))return vn(t);if(gn(t))return Zs(t);if(mn(t))return eo(t)}throw dn(t)}function Ys(t){return new V(function(e){var r=t[Lt]();if(q(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Qs(t){return new V(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function Xs(t){return new V(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,an)})}function Zs(t){return new V(function(e){var r,n;try{for(var i=_e(t),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){r={error:a}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}function vn(t){return new V(function(e){to(t,e).catch(function(r){return e.error(r)})})}function eo(t){return vn(yn(t))}function to(t,e){var r,n,i,s;return Ts(this,void 0,void 0,function(){var o,a;return nn(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=Is(t),c.label=1;case 1:return[4,r.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];
24case 10:return[7];case 11:return e.complete(),[2]}})})}function pe(t,e,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=e.schedule(function(){r(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(s),!i)return s}function bn(t,e){return e===void 0&&(e=0),ne(function(r,n){r.subscribe(fe(n,function(i){return pe(n,t,function(){return n.next(i)},e)},function(){return pe(n,t,function(){return n.complete()},e)},function(i){return pe(n,t,function(){return n.error(i)},e)}))})}function wn(t,e){return e===void 0&&(e=0),ne(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}function ro(t,e){return ie(t).pipe(wn(e),bn(e))}function no(t,e){return ie(t).pipe(wn(e),bn(e))}function io(t,e){return new V(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}function so(t,e){return new V(function(r){var n;return pe(r,e,function(){n=t[pn](),pe(r,e,function(){var i,s,o;try{i=n.next(),s=i.value,o=i.done}catch(a){r.error(a);return}o?r.complete():r.next(s)},0,!0)}),function(){return q(n?.return)&&n.return()}})}function En(t,e){if(!t)throw new Error("Iterable cannot be null");return new V(function(r){pe(r,e,function(){var n=t[Symbol.asyncIterator]();pe(r,e,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function oo(t,e){return En(yn(t),e)}function ao(t,e){if(t!=null){if(fn(t))return ro(t,e);if(un(t))return io(t,e);if(ln(t))return no(t,e);if(hn(t))return En(t,e);if(gn(t))return so(t,e);if(mn(t))return oo(t,e)}throw dn(t)}function De(t,e){return e?ao(t,e):ie(t)}function Ee(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ut(t);return De(t,r)}function Sn(t,e){var r=q(t)?t:function(){return t},n=function(i){return i.error(r())};return new V(n)}function co(t){return!!t&&(t instanceof V||q(t.lift)&&q(t.subscribe))}var _n=Mt(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function O(t,e){return new Promise(function(r,n){var i=!1,s;t.subscribe({next:function(o){s=o,i=!0},error:n,complete:function(){i?r(s):n(new _n)}})})}function _t(t,e){return new Promise(function(r,n){var i=new Ce({next:function(s){r(s),i.unsubscribe()},error:n,complete:function(){n(new _n)}});t.subscribe(i)})}function uo(t){return t instanceof Date&&!isNaN(t)}function H(t,e){return ne(function(r,n){var i=0;r.subscribe(fe(n,function(s){n.next(t.call(e,s,i++))}))})}var lo=Array.isArray;function fo(t,e){return lo(e)?t.apply(void 0,ae([],oe(e))):t(e)}function ho(t){return H(function(e){return fo(t,e)})}function po(t,e,r){return r===void 0&&(r=Ze),function(n){Rr(e,function(){for(var i=t.length,s=new Array(i),o=i,a=i,c=function(l){Rr(e,function(){var h=De(t[l],e),m=!1;h.subscribe(fe(n,function(y){s[l]=y,m||(m=!0,a--),a||n.next(r(s.slice()))},function(){--o||n.complete()}))},n)},u=0;u<i;u++)c(u)})}}function Rr(t,e,r){e()}function go(t,e,r,n,i,s,o,a){var c=[],u=0,l=0,h=!1,m=function(){h&&!c.length&&!u&&e.complete()},y=function(p){return u<n?f(p):c.push(p)},f=function(p){u++;var w=!1;ie(r(p,l++)).subscribe(fe(e,function(g){e.next(g)},function(){w=!0},void 0,function(){if(w)try{u--;for(var g=function(){var d=c.shift();o||f(d)};c.length&&u<n;)g();m()}catch(d){e.error(d)}}))};return t.subscribe(fe(e,y,function(){h=!0,m()})),function(){}}function ge(t,e,r){return r===void 0&&(r=1/0),q(e)?ge(function(n,i){return H(function(s,o){return e(n,s,i,o)})(ie(t(n,i)))},r):(typeof e=="number"&&(r=e),ne(function(n,i){return go(n,i,t,r)}))}function Cn(t){return t===void 0&&(t=1/0),ge(Ze,t)}function yo(){return Cn(1)}function mo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return yo()(De(t,Ut(t)))}function Tn(t){return new V(function(e){ie(t()).subscribe(e)})}function vo(t,e,r){return r===void 0&&(r=Bs),new V(function(n){var i=uo(t)?+t-r.now():t;i<0&&(i=0);var s=0;return r.schedule(function(){n.closed||(n.next(s++),n.complete())},i)})}function bo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ut(t),n=Gs(t,1/0),i=t;return i.length?i.length===1?ie(i[0]):Cn(n)(De(i,r)):Hs}var wo=Array.isArray;function Eo(t){return t.length===1&&wo(t[0])?t[0]:t}function Re(t,e){return ne(function(r,n){var i=0;r.subscribe(fe(n,function(s){return t.call(e,s,i++)&&n.next(s)}))})}function Ke(t){return ne(function(e,r){var n=null,i=!1,s;n=e.subscribe(fe(r,void 0,void 0,function(o){s=ie(t(o,Ke(t)(e))),n?(n.unsubscribe(),n=null,s.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,s.subscribe(r))})}function An(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ws(t);return r?Ds(An.apply(void 0,ae([],oe(t))),ho(r)):ne(function(n,i){po(ae([n],oe(Eo(t))))(i)})}function So(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return An.apply(void 0,ae([],oe(t)))}function In(t){return ne(function(e,r){try{e.subscribe(r)}finally{r.add(t)}})}function Rn(t){t===void 0&&(t={});var e=t.connector,r=e===void 0?function(){return new qt}:e,n=t.resetOnError,i=n===void 0?!0:n,s=t.resetOnComplete,o=s===void 0?!0:s,a=t.resetOnRefCountZero,c=a===void 0?!0:a;return function(u){var l,h,m,y=0,f=!1,p=!1,w=function(){h?.unsubscribe(),h=void 0},g=function(){w(),l=m=void 0,f=p=!1},d=function(){var v=l;g(),v?.unsubscribe()};return ne(function(v,b){y++,!p&&!f&&w();var S=m=m??r();b.add(function(){y--,y===0&&!p&&!f&&(h=Ct(d,c))}),S.subscribe(b),!l&&y>0&&(l=new Ce({next:function(_){return S.next(_)},error:function(_){p=!0,w(),h=Ct(g,i,_),S.error(_)},complete:function(){f=!0,w(),h=Ct(g,o),S.complete()}}),ie(v).subscribe(l))})(u)}}function Ct(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(e===!0){t();return}if(e!==!1){var i=new Ce({next:function(){i.unsubscribe(),t()}});return ie(e.apply(void 0,ae([],oe(r)))).subscribe(i)}}function _o(t,e,r){var n,i=!1;return n=t,Rn({connector:function(){return new Vs(n,e,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function Co(t,e,r){var n=q(t)||e||r?{next:t,error:e,complete:r}:t;return n?ne(function(i,s){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(fe(s,function(c){var u;(u=n.next)===null||u===void 0||u.call(n,c),s.next(c)},function(){var c;
24a=!1,(c=n.complete)===null||c===void 0||c.call(n),s.complete()},function(c){var u;a=!1,(u=n.error)===null||u===void 0||u.call(n,c),s.error(c)},function(){var c,u;a&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):Ze}function $n(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var On={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},kt={0:8203,1:8204,2:8205,3:65279},To=new Array(4).fill(String.fromCodePoint(kt[0])).join("");function Ao(t){let e=JSON.stringify(t);return`${To}${Array.from(e).map(r=>{let n=r.charCodeAt(0);if(n>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${e} on character ${r} (${n})`);return Array.from(n.toString(4).padStart(4,"0")).map(i=>String.fromCodePoint(kt[i])).join("")}).join("")}`}function Io(t){return!Number.isNaN(Number(t))||/[a-z]/i.test(t)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(t)?!1:!!Date.parse(t)}function Ro(t){try{new URL(t,t.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}function Sc(t,e,r="auto"){return r===!0||r==="auto"&&(Io(t)||Ro(t))?t:`${t}${Ao(e)}`}Object.fromEntries(Object.entries(kt).map(t=>t.reverse()));Object.fromEntries(Object.entries(On).map(t=>t.reverse()));var $o=`${Object.values(On).map(t=>`\\u{${t.toString(16)}}`).join("")}`,$r=new RegExp(`[${$o}]{4,}`,"gu");function Oo(t){var e;return{cleaned:t.replace($r,""),encoded:((e=t.match($r))==null?void 0:e[0])||""}}function xo(t){return t&&JSON.parse(Oo(JSON.stringify(t)).cleaned)}function Po(t){return xo(t)}const Do="drafts",Mo="versions",Te=".",We=`${Do}${Te}`,xn=`${Mo}${Te}`;function et(t){return t.startsWith(We)}function tt(t){return t.startsWith(xn)}function Pn(t){if(tt(t)){const e=rt(t);return We+e}return et(t)?t:We+t}function Me(t,e){if(e==="drafts"||e==="published")throw new Error('Version can not be "published" or "drafts"');return`${xn}${e}${Te}${rt(t)}`}function Dn(t){if(!tt(t))return;const[e,r,...n]=t.split(Te);return r}function rt(t){return tt(t)?t.split(Te).slice(2).join(Te):et(t)?t.slice(We.length):t}let jo=t=>crypto.getRandomValues(new Uint8Array(t)),Lo=(t,e,r)=>{let n=(2<<Math.log(t.length-1)/Math.LN2)-1,i=-~(1.6*n*e/t.length);return(s=e)=>{let o="";for(;;){let a=r(i),c=i|0;for(;c--;)if(o+=t[a[c]&n]||"",o.length===s)return o}}},qo=(t,e=21)=>Lo(t,e,jo);const Or=/\r\n|[\n\r\u2028\u2029]/;function Fo(t,e,r){const n=t.split(Or),i={start:xr(e.start,n),end:e.end?xr(e.end,n):void 0},{start:s,end:o,markerLines:a}=Vo(i,n),c=`${o}`.length;return t.split(Or,o).slice(s,o).map((u,l)=>{const h=s+1+l,m=` ${` ${h}`.slice(-c)} |`,y=a[h],f=!a[h+1];if(!y)return` ${m}${u.length>0?` ${u}`:""}`;let p="";if(Array.isArray(y)){const w=u.slice(0,Math.max(y[0]-1,0)).replace(/[^\t]/g," "),g=y[1]||1;p=[`
25 `,m.replace(/\d/g," ")," ",w,"^".repeat(g)].join(""),f&&r&&(p+=" "+r)}return[">",m,u.length>0?` ${u}`:"",p].join("")}).join(`
26`)}function Vo(t,e){const r={...t.start},n={...r,...t.end},i=2,s=3,o=r.line??-1,a=r.column??0,c=n.line,u=n.column;let l=Math.max(o-(i+1),0),h=Math.min(e.length,c+s);o===-1&&(l=0),c===-1&&(h=e.length);const m=c-o,y={};if(m)for(let f=0;f<=m;f++){const p=f+o;if(!a)y[p]=!0;else if(f===0){const w=e[p-1].length;y[p]=[a,w-a+1]}else if(f===m)y[p]=[0,u];else{const w=e[p-f].length;y[p]=[0,w]}}else a===u?a?y[o]=[a,0]:y[o]=!0:y[o]=[a,u-a];return{start:l,end:h,markerLines:y}}function xr(t,e){let r=0;for(let n=0;n<e.length;n++){const i=e[n].length+1;if(r+i>t)return{line:n+1,column:t-r};r+=i}return{line:e.length,column:e[e.length-1]?.length??0}}const Tt=5;class Uo extends Error{response;statusCode=400;responseBody;details;constructor(e,r){const n=Mn(e,r);super(n.message),Object.assign(this,n)}}class ko extends Error{response;statusCode=500;responseBody;details;constructor(e){const r=Mn(e);super(r.message),Object.assign(this,r)}}function Mn(t,e){const r=t.body,n={response:t,statusCode:t.statusCode,responseBody:Bo(r,t),message:"",details:void 0};if(!$n(r))return n.message=At(t,r),n;const i=r.error;if(typeof i=="string"&&typeof r.message=="string")return n.message=`${i} - ${r.message}`,n;if(typeof i!="object"||i===null)return typeof i=="string"?n.message=i:typeof r.message=="string"?n.message=r.message:n.message=At(t,r),n;if(No(i)||zo(i)){const s=i.items||[],o=s.slice(0,Tt).map(c=>
26c.error?.description).filter(Boolean);let a=o.length?`:
27- ${o.join(`
28- `)}`:"";return s.length>Tt&&(a+=`
29...and ${s.length-Tt} more`),n.message=`${i.description}${a}`,n.details=r.error,n}if(jn(i)){const s=e?.options?.query?.tag;return n.message=Ln(i,s),n.details=r.error,n}return"description"in i&&typeof i.description=="string"?(n.message=i.description,n.details=i,n):(n.message=At(t,r),n)}function No(t){return"type"in t&&t.type==="mutationError"&&"description"in t&&typeof t.description=="string"}function zo(t){return"type"in t&&t.type==="actionError"&&"description"in t&&typeof t.description=="string"}function jn(t){return $n(t)&&t.type==="queryParseError"&&typeof t.query=="string"&&typeof t.start=="number"&&typeof t.end=="number"}function Ln(t,e){const{query:r,start:n,end:i,description:s}=t;if(!r||typeof n>"u")return`GROQ query parse error: ${s}`;const o=e?`
30
31Tag: ${e}`:"";return`GROQ query parse error:
32${Fo(r,{start:n,end:i},s)}${o}`}function At(t,e){const r=typeof e=="string"?` (${Ho(e,100)})`:"",n=t.statusMessage?` ${t.statusMessage}`:"";return`${t.method}-request to ${t.url} resulted in HTTP ${t.statusCode}${n}${r}`}function Bo(t,e){return(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")!==-1?JSON.stringify(t,null,2):t}function Ho(t,e){return t.length>e?`${t.slice(0,e)}…`:t}class Ko extends Error{projectId;addOriginUrl;constructor({projectId:e}){super("CorsOriginError"),this.name="CorsOriginError",this.projectId=e;const r=new URL(`https://sanity.io/manage/project/${e}/api`);if(typeof location<"u"){const{origin:n}=location;r.searchParams.set("cors","add"),r.searchParams.set("origin",n),this.addOriginUrl=r,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${r}`}else this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: ${r}`}}const Wo={onResponse:(t,e)=>{if(t.statusCode>=500)throw new ko(t);if(t.statusCode>=400)throw new Uo(t,e);return t}};function Go(t={}){const e={},r=n=>t.ignoreWarnings===void 0?!1:(Array.isArray(t.ignoreWarnings)?t.ignoreWarnings:[t.ignoreWarnings]).some(i=>typeof i=="string"?n.includes(i):i instanceof RegExp?i.test(n):!1);return{onResponse:n=>{const i=n.headers["x-sanity-warning"],s=Array.isArray(i)?i:[i];for(const o of s)!o||e[o]||r(o)||(e[o]=!0,console.warn(o));return n}}}function Pr(t,e={}){return ps([Dt({shouldRetry:Jo}),...t,Go(e),bs(),ws(),_s(),Wo,Ss({implementation:V})])}function Jo(t,e,r){if(r.maxRetries===0)return!1;const n=r.method==="GET"||r.method==="HEAD",i=(r.uri||r.url).startsWith("/data/query"),s=t.response&&(t.response.statusCode===429||t.response.statusCode===502||t.response.statusCode===503);return(n||i)&&s?!0:Dt.shouldRetry(t,e,r)}const Yo="https://www.sanity.io/help/";function Nt(t){return Yo+t}const Dr=["image","file"],Mr=["before","after","replace"],qn=t=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(t))throw new Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},Qo=t=>{if(!/^[-a-z0-9]+$/i.test(t))throw new Error("`projectId` can only contain only a-z, 0-9 and dashes")},Xo=t=>{if(Dr.indexOf(t)===-1)throw new Error(`Invalid asset type: ${t}. Must be one of ${Dr.join(", ")}`)},Oe=(t,e)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`${t}() takes an object of properties`)},Ge=(t,e)=>{if(typeof e!="string"||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(e)||e.includes(".."))throw new Error(`${t}(): "${e}" is not a valid document ID`)},Ae=(t,e)=>{if(!e._id)throw new Error(`${t}() requires that the document contains an ID ("_id" property)`);Ge(t,e._id)},Zo=(t,e)=>{if(typeof e!="string")throw new Error(`\`${t}()\`: \`${e}\` is not a valid document type`)},Fn=(t,e)=>{if(!e._type)throw new Error(`\`${t}()\` requires that the document contains a type (\`_type\` property)`);Zo(t,e._type)},ea=(t,e)=>{if(e._id&&e._id!==t)throw new Error(`The provided document ID (\`${e._id}\`) does not match the generated version ID (\`${t}\`)`)},ta=(t,e,r)=>{const n="insert(at, selector, items)";if(Mr.indexOf(t)===-1){const i=Mr.map(s=>`"${s}"`).join(", ");throw new Error(`${n} takes an "at"-argument which is one of: ${i}`)}if(typeof e!="string")throw new Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw new Error(`${n} takes an "items"-argument which must be an array`)},me=t=>{if(!t.dataset)throw new Error("`dataset` must be provided to perform queries");return t.dataset||""},Vn=t=>{if(typeof t!="string"||!/^[a-z0-9._-]{1,75}$/i.test(t))throw new Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return t},Un=t=>{if(!t["~experimental_resource"])throw new Error("`resource` must be provided to perform resource queries");const{type:e,id:r}=t["~experimental_resource"];switch(e){case"dataset":{if(r.split(".").length!==2)throw new Error('Dataset resource ID must be in the format "project.dataset"');return}case"dashboard":case"media-library":case"canvas":return;default:throw new Error(`Unsupported resource type: ${e.toString()}`)}},de=(t,e)=>{if(e["~experimental_resource"])throw new Error(`\`${t}\` does not support resource-based operations`)};function ra(t){let e=!1,r;return(...n)=>(e||(r=t(...n),e=!0),r)}const he=t=>ra((...e)=>console.warn(t.join(" "),...e)),na=he(["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"]),ia=he(["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."]),sa=he(["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."]),oa=he(["The `previewDrafts` perspective has been renamed to  `drafts` and will be removed in a future API version"]),aa=he(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${Nt("js-client-browser-token")} for more information and how to hide this warning.`]),ca=he(["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`."]),ua=he(["Using the Sanity client without specifying an API version is deprecated.",`See ${Nt("js-client-api-version")}`]),la=he(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."]),fa="apicdn.sanity.io",xe={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},ha=["localhost","127.0.0.1","0.0.0.0"],da=t=>ha.indexOf(t)!==-1;function pa(t){if(t==="1"||t==="X")return;const e=new Date(t);if(!(/^\d{4}-\d{2}-\d{2}$/.test(t)&&e instanceof Date&&e.getTime()>0))throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}function kn(t){if(Array.isArray(t)&&t.length>1&&t.includes("raw"))throw new TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}const Nn=(t,e)=>{const r={...e,...t,stega:{...typeof e.stega=="boolean"?{enabled:e.stega}:e.stega||xe.stega,...typeof t.stega=="boolean"?{enabled:t.stega}:t.stega||{}}};r.apiVersion||ua();const n={...xe,...r},i=n.useProjectHostname&&!n["~experimental_resource"];if(typeof Promise>"u"){const m=Nt("js-client-promise-polyfill");throw new Error(`No native Promise-implementation found, polyfill needed - see ${m}`)}if(i&&!n.projectId)throw new Error("Configuration must contain `projectId`");if(n["~experimental_resource"]&&Un(n),typeof n.perspective<"u"&&kn(n.perspective),"encodeSourceMap"in n)throw new 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 n)throw new 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'?");
32if(typeof n.stega.enabled!="boolean")throw new Error(`stega.enabled must be a boolean, received ${n.stega.enabled}`);if(n.stega.enabled&&n.stega.studioUrl===void 0)throw new Error("stega.studioUrl must be defined when stega.enabled is true");if(n.stega.enabled&&typeof n.stega.studioUrl!="string"&&typeof n.stega.studioUrl!="function")throw new Error(`stega.studioUrl must be a string or a function, received ${n.stega.studioUrl}`);const s=typeof window<"u"&&window.location&&window.location.hostname,o=s&&da(window.location.hostname),a=!!n.token;n.withCredentials&&a&&(ca(),n.withCredentials=!1),s&&o&&a&&n.ignoreBrowserTokenWarning!==!0?aa():typeof n.useCdn>"u"&&ia(),i&&Qo(n.projectId),n.dataset&&qn(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?Vn(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===xe.apiHost,n.useCdn===!0&&n.withCredentials&&na(),n.useCdn=n.useCdn!==!1&&!n.withCredentials,pa(n.apiVersion);const c=n.apiHost.split("://",2),u=c[0],l=c[1],h=n.isDefaultApi?fa:l;return i?(n.url=`${u}://${n.projectId}.${l}/v${n.apiVersion}`,n.cdnUrl=`${u}://${n.projectId}.${h}/v${n.apiVersion}`):(n.url=`${n.apiHost}/v${n.apiVersion}`,n.cdnUrl=n.url),n};class zn extends Error{name="ConnectionFailedError"}class ga extends Error{name="DisconnectError";reason;constructor(e,r,n={}){super(e,n),this.reason=r}}class ya extends Error{name="ChannelError";data;constructor(e,r){super(e),this.data=r}}
32class ma extends Error{name="MessageError";data;constructor(e,r,n={}){super(e,n),this.data=r}}class jr extends Error{name="MessageParseError"}const va=["channelError","disconnect"];function Bn(t,e){return Tn(()=>{const r=t();return co(r)?r:Ee(r)}).pipe(ge(r=>ba(r,e)))}function ba(t,e){return new V(r=>{const n=e.includes("open"),i=e.includes("reconnect");function s(u){if("data"in u){const[l,h]=Lr(u);r.error(l?new jr("Unable to parse EventSource error message",{cause:h}):new ma((h?.data).message,h));return}t.readyState===t.CLOSED?r.error(new zn("EventSource connection failed")):i&&r.next({type:"reconnect"})}function o(){r.next({type:"open"})}function a(u){const[l,h]=Lr(u);if(l){r.error(new jr("Unable to parse EventSource message",{cause:l}));return}if(u.type==="channelError"){const m=new URL(t.url).searchParams.get("tag");r.error(new ya(wa(h?.data,m),h.data));return}if(u.type==="disconnect"){r.error(new ga(`Server disconnected client: ${h.data?.reason||"unknown error"}`));return}r.next({type:u.type,id:u.lastEventId,...h.data?{data:h.data}:{}})}t.addEventListener("error",s),n&&t.addEventListener("open",o);const c=[...new Set([...va,...e])].filter(u=>u!=="error"&&u!=="open"&&u!=="reconnect");return c.forEach(u=>t.addEventListener(u,a)),()=>{t.removeEventListener("error",s),n&&t.removeEventListener("open",o),c.forEach(u=>t.removeEventListener(u,a)),t.close()}})}function Lr(t){try{const e=typeof t.data=="string"&&JSON.parse(t.data);return[null,{type:t.type,id:t.lastEventId,...Ea(e)?{}:{data:e}}]}catch(e){return[e,null]}}function wa(t,e){const r=t.error;return r?jn(r)?Ln(r,e):r.description?r.description:typeof r=="string"?r:JSON.stringify(r,null,2):t.message||"Unknown listener error"}function Ea(t){for(const e in t)return!1;return!0}function Hn(t){if(typeof t=="string")return{id:t};if(Array.isArray(t))return{query:"*[_id in $ids]",params:{ids:t}};if(typeof t=="object"&&t!==null&&"query"in t&&typeof t.query=="string")return"params"in t&&typeof t.params=="object"&&t.params!==null?{query:t.query,params:t.params}:{query:t.query};const e=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(`
33`);throw new Error(`Unknown selection - must be one of:
34
35${e}`)}class Kn{selection;operations;constructor(e,r={}){this.selection=e,this.operations=r}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return Oe("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw new 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,r,n){return ta(e,r,n),this._assign("insert",{[e]:r,items:n})}append(e,r){return this.insert("after",`${e}[-1]`,r)}prepend(e,r){return this.insert("before",`${e}[0]`,r)}splice(e,r,n,i){const s=typeof n>"u"||n===-1,o=r<0?r-1:r,a=s?-1:Math.max(0,r+n),c=o<0&&a>=0?"":a,u=`${e}[${o}:${c}]`;return this.insert("replace",u,i||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...Hn(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,r,n=!0){return Oe(e,r),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},n&&this.operations[e]||{},r)}),this}_set(e,r){return this._assign(e,r,!1)}}class ye extends Kn{#t;constructor(e,r,n){super(e,r),this.#t=n}clone(){return new ye(this.selection,{...this.operations},this.#t)}commit(e){if(!this.#t)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");const r=typeof this.selection=="string",n=Object.assign({returnFirst:r,returnDocuments:!0},e);return this.#t.mutate({patch:this.serialize()},n)}}class le extends Kn{#t;constructor(e,r,n){super(e,r),this.#t=n}clone(){return new le(this.selection,{...this.operations},this.#t)}commit(e){if(!this.#t)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");
35const r=typeof this.selection=="string",n=Object.assign({returnFirst:r,returnDocuments:!0},e);return this.#t.mutate({patch:this.serialize()},n)}}const Wn={returnDocuments:!1};class Gn{operations;trxId;constructor(e=[],r){this.operations=e,this.trxId=r}create(e){return Oe("create",e),this._add({create:e})}createIfNotExists(e){const r="createIfNotExists";return Oe(r,e),Ae(r,e),this._add({[r]:e})}createOrReplace(e){const r="createOrReplace";return Oe(r,e),Ae(r,e),this._add({[r]:e})}delete(e){return Ge("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}}class nt extends Gn{#t;constructor(e,r,n){super(e,n),this.#t=r}clone(){return new nt([...this.operations],this.#t,this.trxId)}commit(e){if(!this.#t)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#t.mutate(this.serialize(),Object.assign({transactionId:this.trxId},Wn,e||{}))}patch(e,r){const n=typeof r=="function",i=typeof e!="string"&&e instanceof le,s=typeof e=="object"&&("query"in e||"id"in e);if(i)return this._add({patch:e.serialize()});if(n){const o=r(new le(e,{},this.#t));if(!(o instanceof le))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:o.serialize()})}if(s){const o=new le(e,r||{},this.#t);return this._add({patch:o.serialize()})}return this._add({patch:{id:e,...r}})}}class it extends Gn{#t;constructor(e,r,n){super(e,n),this.#t=r}clone(){return new it([...this.operations],this.#t,this.trxId)}commit(e){if(!this.#t)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#t.mutate(this.serialize(),Object.assign({transactionId:this.trxId},Wn,e||{}))}patch(e,r){const n=typeof r=="function";if(typeof e!="string"&&e instanceof ye)return this._add({patch:e.serialize()});if(n){const i=r(new ye(e,{},this.#t));if(!(i instanceof ye))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:i.serialize()})}return this._add({patch:{id:e,...r}})}}const Sa="X-Sanity-Project-ID";function _a(t,e={}){const r={};t.headers&&Object.assign(r,t.headers);const n=e.token||t.token;n&&(r.Authorization=`Bearer ${n}`),!e.useGlobalApi&&!t.useProjectHostname&&t.projectId&&(r[Sa]=t.projectId);const i=!!(typeof e.withCredentials>"u"?t.withCredentials:e.withCredentials),s=typeof e.timeout>"u"?t.timeout:e.timeout;return Object.assign({},e,{headers:Object.assign({},r,e.headers||{}),timeout:typeof s>"u"?300*1e3:s,proxy:e.proxy||t.proxy,json:!0,withCredentials:i,fetch:typeof e.fetch=="object"&&typeof t.fetch=="object"?{...t.fetch,...e.fetch}:e.fetch||t.fetch})}const Jn=({query:t,params:e={},options:r={}})=>{const n=new URLSearchParams,{tag:i,includeMutations:s,returnQuery:o,...a}=r;i&&n.append("tag",i),n.append("query",t);for(const[c,u]of Object.entries(e))u!==void 0&&n.append(`$${c}`,JSON.stringify(u));for(const[c,u]of Object.entries(a))u&&n.append(c,`${u}`);return o===!1&&n.append("returnQuery","false"),s===!1&&n.append("includeMutations","false"),`?${n}`},Ca=(t,e)=>t===!1?void 0:typeof t>"u"?e:t,Ta=(t={})=>({dryRun:t.dryRun,returnIds:!0,returnDocuments:Ca(t.returnDocuments,!0),visibility:t.visibility||"sync",autoGenerateArrayKeys:t.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:t.skipCrossDatasetReferenceValidation}),zt=t=>t.type==="response",Aa=t=>t.body,Ia=(t,e)=>t.reduce((r,n)=>(r[e(n)]=n,r),Object.create(null)),Ra=11264;function Yn(t,e,r,n,i={},s={}){const o="stega"in s?{...r||{},...typeof s.stega=="boolean"?{enabled:s.stega}:s.stega||{}}:r,a=o.enabled?Po(i):i,c=s.filterResponse===!1?f=>f:f=>f.result,{cache:u,next:l,...h}={useAbortSignal:typeof s.signal<"u",resultSourceMap:o.enabled?"withKeyArraySelector":s.resultSourceMap,...s,returnQuery:s.filterResponse===!1&&s.returnQuery!==!1},m=typeof u<"u"||typeof l<"u"?{...h,fetch:{cache:u,next:l}}:h,y=ve(t,e,"query",{query:n,params:a},m);return o.enabled?y.pipe(So(De(Pt(()=>import("./2ocTJhLv.js"),__vite__mapDeps([1,2,3]),import.meta.url).then(function(f){return f.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:f})=>f))),H(([f,p])=>{const w=p(f.result,f.resultSourceMap,o);return c({...f,result:w})})):y.pipe(H(c))}function Ie(t,e,r,n={}){const i=(()=>
35{if(!n.releaseId)return r;const o=Dn(r);if(!o){if(et(r))throw new Error(`The document ID (\`${r}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return Me(r,n.releaseId)}if(o!==n.releaseId)throw new Error(`The document ID (\`${r}\`) is already a version of \`${o}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return r})(),s={uri:J(t,"doc",i),json:!0,tag:n.tag,signal:n.signal,query:n.includeAllVersions!==void 0?{includeAllVersions:n.includeAllVersions}:void 0};return Le(t,e,s).pipe(Re(zt),H(o=>{const a=o.body.documents;return a?n.includeAllVersions?a:a[0]:n.includeAllVersions?[]:void 0}))}function Qn(t,e,r,n={}){const i={uri:J(t,"doc",r.join(",")),json:!0,tag:n.tag,signal:n.signal};return Le(t,e,i).pipe(Re(zt),H(s=>{const o=Ia(s.body.documents||[],a=>a._id);return r.map(a=>o[a]||null)}))}function Xn(t,e,r,n={}){return ve(t,e,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},n)}function Zn(t,e,r,n){return Ae("createIfNotExists",r),st(t,e,r,"createIfNotExists",n)}function ei(t,e,r,n){return Ae("createOrReplace",r),st(t,e,r,"createOrReplace",n)}function ti(t,e,r,n,i){return Ae("createVersion",r),Fn("createVersion",r),la(),F(t,e,{actionType:"sanity.action.document.version.create",publishedId:n,document:r},i)}function ri(t,e,r,n,i,s,o){if(!n)throw new Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw new Error("`createVersion()` requires `publishedId` when `baseId` is provided");Ge("createVersion",n),Ge("createVersion",r);const a={actionType:"sanity.action.document.version.create",publishedId:r,baseId:n,versionId:i?Me(r,i):Pn(r),ifBaseRevisionId:s};return F(t,e,a,o)}function ni(t,e,r,n){return ve(t,e,"mutate",{mutations:[{delete:Hn(r)}]},n)}function ii(t,e,r,n=!1,i){return F(t,e,{actionType:"sanity.action.document.version.discard",versionId:r,purge:n},i)}function si(t,e,r,n){return Ae("replaceVersion",r),Fn("replaceVersion",r),F(t,e,{actionType:"sanity.action.document.version.replace",document:r},n)}function oi(t,e,r,n,i){return F(t,e,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:n},i)}function ai(t,e,r,n){let i;r instanceof le||r instanceof ye?i={patch:r.serialize()}:r instanceof nt||r instanceof it?i=r.serialize():i=r;const s=Array.isArray(i)?i:[i],o=n&&n.transactionId||void 0;return ve(t,e,"mutate",{mutations:s,transactionId:o},n)}function F(t,e,r,n){const i=Array.isArray(r)?r:[r],s=n&&n.transactionId||void 0,o=n&&n.skipCrossDatasetReferenceValidation||void 0,a=n&&n.dryRun||void 0;return ve(t,e,"actions",{actions:i,transactionId:s,skipCrossDatasetReferenceValidation:o,dryRun:a},n)}function ve(t,e,r,n,i={}){const s=r==="mutate",o=r==="actions",a=r==="query",c=s||o?"":Jn(n),u=!s&&!o&&c.length<Ra,l=u?c:"",h=i.returnFirst,{timeout:m,token:y,tag:f,headers:p,returnQuery:w,lastLiveEventId:g,cacheMode:d}=i,v=J(t,r,l),b={method:u?"GET":"POST",uri:v,json:!0,body:u?void 0:n,query:s&&Ta(i),timeout:m,headers:p,token:y,tag:f,returnQuery:w,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(g)?g[0]:g,cacheMode:d,canUseCdn:a,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn};return Le(t,e,b).pipe(Re(zt),H(Aa),H(S=>{if(!s)return S;const _=S.results||[];if(i.returnDocuments)return h?_[0]&&_[0].document:_.map(A=>A.document);const x=h?"documentId":"documentIds",$=h?_[0]&&_[0].id:_.map(A=>A.id);return{transactionId:S.transactionId,results:_,[x]:$}}))}function st(t,e,r,n,i={}){const s={[n]:r},o=Object.assign({returnFirst:!0,returnDocuments:!0},i);return ve(t,e,"mutate",{mutations:[s]},o)}const je=t=>t.config().dataset!==void 0&&t.config().projectId!==void 0||t.config()["~experimental_resource"]!==void 0,ci=(t,e)=>je(t)&&e.startsWith(J(t,"query")),$a=(t,e)=>je(t)&&e.startsWith(J(t,"mutate")),Oa=(t,e)=>je(t)&&e.startsWith(J(t,"doc","")),xa=(t,e)=>je(t)&&e.startsWith(J(t,"listen")),Pa=(t,e)=>je(t)&&e.startsWith(J(t,"history","")),Da=(t,e)=>e.startsWith("/data/")||ci(t,e)||$a(t,e)||Oa(t,e)||xa(t,e)||Pa(t,e);function Le(t,e,r){const n=r.url||r.uri,i=t.config(),s=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&Da(t,n):r.canUseCdn;let o=(r.useCdn??i.useCdn)&&s;const a=r.tag&&i.requestTagPrefix?[i.requestTagPrefix,r.tag].join("."):r.tag||i.requestTagPrefix;if(a&&r.tag!==null&&(r.query={tag:Vn(a),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&ci(t,n)){const l=r.resultSourceMap??i.resultSourceMap;l!==void 0&&l!==!1&&(r.query={resultSourceMap:l,...r.query});const h=r.perspective||i.perspective;typeof h<"u"&&(h==="previewDrafts"&&oa(),kn(h),r.query={perspective:Array.isArray(h)?h.join(","):h,...r.query},(Array.isArray(h)&&h.length>0||h==="previewDrafts"||h==="drafts")&&o&&(o=!1,sa())),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),r.returnQuery===!1&&(r.query={returnQuery:"false",...r.query}),o&&r.cacheMode=="noStale"&&(r.query={cacheMode:"noStale",...r.query})}const c=_a(i,Object.assign({},r,{url:Bt(t,n,o)})),u=new V(l=>e(c,i.requester).subscribe(l));return r.signal?u.pipe(Ma(r.signal)):u}function z(t,e,r){return Le(t,e,r).pipe(Re(n=>n.type==="response"),H(n=>n.body))}function J(t,e,r){const n=t.config();if(n["~experimental_resource"]){Un(n);const o=qa(n),a=r!==void 0?`${e}/${r}`:e;return`${o}/${a}`.replace(/\/($|\?)/,"$1")}const i=me(n),s=`/${e}/${i}`;return`/data${r!==void 0?`${s}/${r}`:s}`.replace(/\/($|\?)/,"$1")}function Bt(t,e,r=!1){const{url:n,cdnUrl:i}=t.config();return`${r?i:n}/${e.replace(/^\//,"")}`}function Ma(t){return e=>new V(r=>{const n=()=>r.error(La(t));if(t&&t.aborted){n();return}const i=e.subscribe(r);return t.addEventListener("abort",n),()=>{t.removeEventListener("abort",n),i.unsubscribe()}})}const ja=!!globalThis.DOMException;function La(t){if(ja)return new DOMException(t?.reason??"The operation was aborted.","AbortError");const e=new Error(t?.reason??"The operation was aborted.");return e.name="AbortError",e}const qa=t=>{if(!t["~experimental_resource"])throw new Error("`resource` must be provided to perform resource queries");const{type:e,id:r}=t["~experimental_resource"];switch(e){case"dataset":{const n=r.split(".");if(n.length!==2)throw new Error('Dataset ID must be in the format "project.dataset"');return`/projects/${n[0]}/datasets/${n[1]}`}case"canvas":return`/canvases/${r}`;case"media-library":return`/media-libraries/${r}`;case"dashboard":return`/dashboards/${r}`;default:throw new Error(`Unsupported resource type: ${e.toString()}`)}};function ui(t,e,r){const n=me(t.config());return z(t,e,{method:"POST",uri:`/agent/action/generate/${n}`,body:r})}function Fa(t,e,r){const n=me(t.config());return z(t,e,{method:"POST",uri:`/agent/action/patch/${n}`,body:r})}function Va(t,e,r){const n=me(t.config());return z(t,e,{method:"POST",uri:`/agent/action/prompt/${n}`,body:r})}function li(t,e,r){const n=me(t.config());return z(t,e,{method:"POST",uri:`/agent/action/transform/${n}`,body:r})}function fi(t,e,r){const n=me(t.config());return z(t,e,{method:"POST",uri:`/agent/action/translate/${n}`,body:r})}class Ua{#t;#e;constructor(e,r){this.#t=e,this.#e=r}generate(e){return ui(this.#t,this.#e,e)}transform(e){return li(this.#t,this.#e,e)}translate(e){return fi(this.#t,this.#e,e)}}class ka{#t;#e;constructor(e,r){this.#t=e,this.#e=r}generate(e){return O(ui(this.#t,this.#e,e))}transform(e){return O(li(this.#t,this.#e,e))}translate(e){return O(fi(this.#t,this.#e,e))}prompt(e){return O(Va(this.#t,this.#e,e))}patch(e){return O(Fa(this.#t,this.#e,e))}}class Na{#t;#e;constructor(e,r){this.#t=e,this.#e=r}upload(e,r,n){return hi(this.#t,this.#e,e,r,n)}}class za{#t;#e;constructor(e,r){this.#t=e,this.#e=r}upload(e,r,n){const i=hi(this.#t,this.#e,e,r,n);return O(i.pipe(Re(s=>s.type==="response"),H(s=>s.body.document)))}}function hi(t,e,r,n,i={}){Xo(r);let s=i.extract||void 0;s&&!s.length&&(s=["none"]);const o=t.config(),a=Ha(i,n),{tag:c,label:u,title:l,description:h,creditLine:m,filename:y,source:f}=a,p={label:u,title:l,description:h,filename:y,meta:s,creditLine:m};return f&&(p.sourceId=f.id,p.sourceName=f.name,p.sourceUrl=f.url),Le(t,e,{tag:c,method:"POST",timeout:a.timeout||0,uri:Ba(o,r),headers:a.contentType?{"Content-Type":a.contentType}:{},query:p,body:n})}function Ba(t,e){const r=e==="image"?"images":"files";if(t["~experimental_resource"]){const{type:i,id:s}=t["~experimental_resource"];switch(i){case"dataset":throw new Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${s}/assets/${r}`;case"media-library":return`/media-libraries/${s}/upload`;case"dashboard":return`/dashboards/${s}/assets/${r}`;default:throw new Error(`Unsupported resource type: ${i.toString()}`)}}const n=me(t);return`assets/${r}/${n}`}function Ha(t,e){return typeof File>"u"||!(e instanceof File)?t:Object.assign({filename:t.preserveFilename===!1?void 0:e.name,contentType:e.type},t)}var Ka=(t,e)=>Object.keys(e).concat(Object.keys(t)).reduce((r,n)=>(r[n]=typeof t[n]>"u"?e[n]:t[n],r),{});const Wa=(t,e)=>e.reduce((r,n)=>(typeof t[n]>"u"||(r[n]=t[n]),r),{}),di=Tn(()=>Pt(()=>import("./D3nRscUw.js").then(t=>t.b),[],import.meta.url)).pipe(H(({default:t})=>t),_o(1));function pi(){return function(t){return t.pipe(Ke((e,r)=>e instanceof zn?mo(Ee({type:"reconnect"}),vo(1e3).pipe(ge(()=>r))):Sn(()=>e)))}}const Ga=14800,Ja=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","tag"],Ya={includeResult:!0};function gi(t,e,r={}){const{url:n,token:i,withCredentials:s,requestTagPrefix:o,headers:a}=this.config(),c=r.tag&&o?[o,r.tag].join("."):r.tag,u={...Ka(r,Ya),tag:c},l=Wa(u,Ja),h=Jn({query:t,params:e,options:{tag:c,...l}}),m=`${n}${J(this,"listen",h)}`;if(m.length>Ga)return Sn(()=>new Error("Query too large for listener"));const y=u.events?u.events:["mutation"],f={};return s&&(f.withCredentials=!0),(i||a)&&(f.headers={},i&&(f.headers.Authorization=`Bearer ${i}`),a&&Object.assign(f.headers,a)),Bn(()=>(typeof EventSource>"u"||f.headers?di:Ee(EventSource)).pipe(H(p=>new p(m,f))),y).pipe(pi(),Re(p=>y.includes(p.type)),H(p=>({type:p.type,..."data"in p?p.data:{}})))}function Qa(t,e){return Xa(typeof t=="function"?{predicate:t,...e}:t)}function Xa(t){return e=>{let r,n=!1;const{predicate:i,...s}=t,o=e.pipe(Co(c=>{t.predicate(c)&&(n=!0,r=c)}),In(()=>{n=!1,r=void 0}),Rn(s)),a=new V(c=>{n&&c.next(r),c.complete()});return bo(o,a)}}const qr="2021-03-25";class yi{#t;constructor(e){this.#t=e}events({includeDrafts:e=!1,tag:r}={}){de("live",this.#t.config());const{projectId:n,apiVersion:i,token:s,withCredentials:o,requestTagPrefix:a,headers:c}=this.#t.config(),u=i.replace(/^v/,"");if(u!=="X"&&u<qr)throw new Error(`The live events API requires API version ${qr} or later. The current API version is ${u}. Please update your API version to use this feature.`);if(e&&!s&&!o)throw new 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.");const l=J(this.#t,"live/events"),h=new URL(this.#t.getUrl(l,!1)),m=r&&a?[a,r].join("."):r;m&&h.searchParams.set("tag",m),e&&h.searchParams.set("includeDrafts","true");const y={};e&&o&&(y.withCredentials=!0),(e&&s||c)&&(y.headers={},e&&s&&(y.headers.Authorization=`Bearer ${s}`),c&&Object.assign(y.headers,c));const f=`${h.href}::${JSON.stringify(y)}`,p=It.get(f);if(p)return p;const w=Bn(()=>(typeof EventSource>"u"||y.headers?di:Ee(EventSource)).pipe(H(v=>new v(h.href,y))),["message","restart","welcome","reconnect","goaway"]),g=Za(h,{method:"OPTIONS",mode:"cors",credentials:y.withCredentials?"include":"omit",headers:y.headers}).pipe(Ke(()=>{throw new Ko({projectId:n})})),d=w.pipe(pi(),ge(v=>v.type==="reconnect"?g.pipe(ge(()=>Ee(v))):Ee(v)),Ke(v=>g.pipe(ge(()=>{throw v}))),H(v=>{if(v.type==="message"){const{data:b,...S}=v;return{...S,tags:b.tags}}return v})).pipe(In(()=>It.delete(f)),Qa({predicate:v=>v.type==="welcome"}));return It.set(f,d),d}}function Za(t,e){return new V(r=>{const n=new AbortController,i=n.signal;return fetch(t,{...e,signal:n.signal}).then(s=>{r.next(s),r.complete()},s=>{i.aborted||r.error(s)}),()=>n.abort()})}const It=new Map;class ec{#t;#e;constructor(e,r){this.#t=e,this.#e=r}create(e,r){return Se(this.#t,this.#e,"PUT",e,r)}edit(e,r){return Se(this.#t,this.#e,"PATCH",e,r)}delete(e){return Se(this.#t,this.#e,"DELETE",e)}list(){de("dataset",this.#t.config());const e=this.#t.config(),r=e.projectId;let n="/datasets";return e.useProjectHostname===!1&&(n=`/projects/${r}/datasets`),z(this.#t,this.#e,{uri:n,tag:null})}}class tc{#t;#e;constructor(e,r){this.#t=e,this.#e=r}create(e,r){return de("dataset",this.#t.config()),O(Se(this.#t,this.#e,"PUT",e,r))}edit(e,r){return de("dataset",this.#t.config()),O(Se(this.#t,this.#e,"PATCH",e,r))}delete(e){return de("dataset",this.#t.config()),O(Se(this.#t,this.#e,"DELETE",e))}list(){de("dataset",this.#t.config());const e=this.#t.config(),r=e.projectId;let n="/datasets";return e.useProjectHostname===!1&&(n=`/projects/${r}/datasets`),O(z(this.#t,this.#e,{uri:n,tag:null}))}}function Se(t,e,r,n,i){return de("dataset",t.config()),qn(n),z(t,e,{method:r,uri:`/datasets/${n}`,body:i,tag:null})}class mi{#t;#e;constructor(e,r){this.#t=e,this.#e=r}getPlaybackInfo(e,r={}){const n=this.#t.config()["~experimental_resource"]?.id,{instanceId:i,library
35Id:s}=sc(e),o=s||n;if(!o)throw new 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");const a=oc(i,o),c=ac(r);return z(this.#t,this.#e,{method:"GET",uri:a,query:c})}}class rc{#t;#e;constructor(e,r){this.#t=e,this.#e=r}getPlaybackInfo(e,r={}){return O(new mi(this.#t.observable,this.#e).getPlaybackInfo(e,r))}}const nc=/^media-library:(ml[^:]+):([^:]+)$/;function ic(t){return typeof t=="object"&&"_ref"in t}function sc(t){const e=ic(t)?t._ref:t,r=nc.exec(e);if(r){const[,n,i]=r;return{libraryId:n,instanceId:i}}if(typeof t=="string"&&t.startsWith("video-"))return{instanceId:t};throw new Error(`Invalid video asset instance identifier "${e}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}function oc(t,e){return`/media-libraries/${e}/video/${t}/playback-info`}function ac(t){const e={};if(t.transformations){const{thumbnail:r,animated:n,storyboard:i}=t.transformations;r&&(r.width&&(e.thumbnailWidth=r.width),r.height&&(e.thumbnailHeight=r.height),r.time!==void 0&&(e.thumbnailTime=r.time),r.fit&&(e.thumbnailFit=r.fit),r.format&&(e.thumbnailFormat=r.format)),n&&(n.width&&(e.animatedWidth=n.width),n.height&&(e.animatedHeight=n.height),n.start!==void 0&&(e.animatedStart=n.start),n.end!==void 0&&(e.animatedEnd=n.end),n.fps&&(e.animatedFps=n.fps),n.format&&(e.animatedFormat=n.format)),i&&i.format&&(e.storyboardFormat=i.format)}return t.expiration&&(e.expiration=t.expiration),e}class cc{#t;#e;constructor(e,r){this.#t=e,this.#e=r}list(e){const r={},n="/projects";return e?.includeMembers===!1&&(r.includeMembers="false"),e?.organizationId&&(r.organizationId=e.organizationId),z(this.#t,this.#e,{uri:n,query:r})}getById(e){return z(this.#t,this.#e,{uri:`/projects/${e}`})}}class uc{#t;#e;constructor(e,r){this.#t=e,this.#e=r}list(e){const r={},n="/projects";return e?.includeMembers===!1&&(r.includeMembers="false"),e?.organizationId&&(r.organizationId=e.organizationId),O(z(this.#t,this.#e,{uri:n,query:r}))}getById(e){return O(z(this.#t,this.#e,{uri:`/projects/${e}`}))}}const Fr=qo("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),Je=(t,e)=>e?Me(t,e):Pn(t);function Ye(t,{releaseId:e,publishedId:r,document:n}){if(r&&n._id){const i=Je(r,e);return ea(i,n),i}if(n._id){const i=et(n._id),s=tt(n._id);if(!i&&!s)throw new Error(`\`${t}()\` requires a document with an \`_id\` that is a version or draft ID`);if(e){if(i)throw new Error(`\`${t}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${e}\`) was also provided.`);const o=Dn(n._id);if(o!==e)throw new Error(`\`${t}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${e}\`) does not match the document's version ID (\`${o}\`).`)}return n._id}if(r)return Je(r,e);throw new Error(`\`${t}()\` requires either a publishedId or a document with an \`_id\``)}const lc=(t,e)=>{if(typeof t=="object"&&t!==null&&("releaseId"in t||"metadata"in t)){const{releaseId:r=Fr(),metadata:n={}}=t;return[r,n,e]}return[Fr(),{},t]},vi=(t,e)=>{const[r,n,i]=lc(t,e),s={...n,releaseType:n.releaseType||"undecided"};return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:s},options:i}};class fc{#t;#e;constructor(e,r){this.#t=e,this.#e=r}get({releaseId:e},r){return Ie(this.#t,this.#e,`_.releases.${e}`,r)}create(e,r){const{action:n,options:i}=vi(e,r),{releaseId:s,metadata:o}=n;return F(this.#t,this.#e,n,i).pipe(H(a=>({...a,releaseId:s,metadata:o})))}edit({releaseId:e,patch:r},n){const i={actionType:"sanity.action.release.edit",releaseId:e,patch:r};return F(this.#t,this.#e,i,n)}publish({releaseId:e},r){const n={actionType:"sanity.action.release.publish",releaseId:e};return F(this.#t,this.#e,n,r)}archive({releaseId:e},r){const n={actionType:"sanity.action.release.archive",releaseId:e};return F(this.#t,this.#e,n,r)}unarchive({releaseId:e},r){const n={actionType:"sanity.action.release.unarchive",releaseId:e};return F(this.#t,this.#e,n,r)}schedule({releaseId:e,publishAt:r},n){const i={actionType:"sanity.action.release.schedule",releaseId:e,publishAt:r};return F(this.#t,this.#e,i,n)}unschedule({releaseId:e},r){const n={actionType:"sanity.action.release.unschedule",releaseId:e};return F(this.#t,this.#e,n,r)}delete({releaseId:e},r){const n={actionType:"sanity.action.release.delete",releaseId:e};return F(this.#t,this.#e,n,r)}fetchDocuments({releaseId:e},r){return Xn(this.#t,this.#e,e,r)}}class hc{#t;#e;constructor(e,r){this.#t=e,this.#e=r}get({releaseId:e},r){return O(Ie(this.#t,this.#e,`_.releases.${e}`,r))}async create(e,r){const{action:n,options:i}=vi(e,r),{releaseId:s,metadata:o}=n;return{...await O(F(this.#t,this.#e,n,i)),releaseId:s,metadata:o}}edit({releaseId:e,patch:r},n){const i={actionType:"sanity.action.release.edit",releaseId:e,patch:r};return O(F(this.#t,this.#e,i,n))}publish({releaseId:e},r){const n={actionType:"sanity.action.release.publish",releaseId:e};return O(F(this.#t,this.#e,n,r))}archive({releaseId:e},r){const n={actionType:"sanity.action.release.archive",releaseId:e};return O(F(this.#t,this.#e,n,r))}unarchive({releaseId:e},r){const n={actionType:"sanity.action.release.unarchive",releaseId:e};return O(F(this.#t,this.#e,n,r))}schedule({releaseId:e,publishAt:r},n){const i={actionType:"sanity.action.release.schedule",releaseId:e,publishAt:r};return O(F(this.#t,this.#e,i,n))}unschedule({releaseId:e},r){const n={actionType:"sanity.action.release.unschedule",releaseId:e};return O(F(this.#t,this.#e,n,r))}delete({releaseId:e},r){const n={actionType:"sanity.action.release.delete",releaseId:e};return O(F(this.#t,this.#e,n,r))}fetchDocuments({releaseId:e},r){return O(Xn(this.#t,this.#e,e,r))}}class dc{#t;#e;constructor(e,r){this.#t=e,this.#e=r}getById(e){return z(this.#t,this.#e,{uri:`/users/${e}`})}}class pc{#t;#e;constructor(e,r){this.#t=e,this.#e=r}getById(e){return O(z(this.#t,this.#e,{uri:`/users/${e}`}))}}class Qe{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#t;#e;listen=gi;constructor(e,r=xe){this.config(r),this.#e=e,this.assets=new Na(this,this.#e),this.datasets=new ec(this,this.#e),this.live=new yi(this),this.mediaLibrary={video:new mi(this,this.#e)},this.projects=new cc(this,this.#e),this.users=new dc(this,this.#e),this.agent={action:new Ua(this,this.#e)},this.releases=new fc(this,this.#e)}clone(){return new Qe(this.#e,this.config())}config(e){if(e===void 0)return{...this.#t};if(this.#t&&this.#t.allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.#t=Nn(e,this.#t||{}),this}withConfig(e){const r=this.config();return new Qe(this.#e,{...r,...e,stega:{...r.stega||{},...typeof e?.stega=="boolean"?{enabled:e.stega}:e?.stega||{}}})}fetch(e,r,n){return Yn(this,this.#e,this.#t.stega,e,r,n)}getDocument(e,r){if(r?.includeAllVersions===!0)return Ie(this,this.#e,e,{...r,includeAllVersions:!0});const n={signal:r?.signal,tag:r?.tag,releaseId:r?.releaseId,...r&&"includeAllVersions"in r?{includeAllVersions:!1}:{}};return Ie(this,this.#e,e,n)}getDocuments(e,r){return Qn(this,this.#e,e,r)}create(e,r){return st(this,this.#e,e,"create",r)}createIfNotExists(e,r){return Zn(this,this.#e,e,r)}createOrReplace(e,r){return ei(this,this.#e,e,r)}createVersion({document:e,publishedId:r,releaseId:n,baseId:i,ifBaseRevisionId:s},o){if(!e)return ri(this,this.#e,r,i,n,s,o);const a=Ye("createVersion",{document:e,publishedId:r,releaseId:n}),c={...e,_id:a},u=r||rt(e._id);return ti(this,this.#e,c,u,o)}delete(e,r){return ni(this,this.#e,e,r)}discardVersion({releaseId:e,publishedId:r},n,i){const s=Je(r,e);return ii(this,this.#e,s,n,i)}replaceVersion({document:e,publishedId:r,releaseId:n},i){const s=Ye("replaceVersion",{document:e,publishedId:r,releaseId:n}),o={...e,_id:s};return si(this,this.#e,o,i)}unpublishVersion({releaseId:e,publishedId:r},n){const i=Me(r,e);return oi(this,this.#e,i,r,n)}mutate(e,r){return ai(this,this.#e,e,r)}patch(e,r){return new ye(e,r,this)}transaction(e){return new it(e,this)}action(e,r){return F(this,this.#e,e,r)}request(e){return z(this,this.#e,e)}getUrl(e,r){return Bt(this,e,r)}getDataUrl(e,r){return J(this,e,r)}}class Xe{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#t;#e;listen=gi;constructor(e,r=xe){this.config(r),this.#e=e,this.assets=new za(this,this.#e),this.datasets=new tc(this,this.#e),this.live=new yi(this),this.mediaLibrary={video:new rc(this,this.#e)},this.projects=new uc(this,this.#e),this.users=new pc(this,this.#e),this.agent={action:new ka(this,this.#e)},this.releases=new hc(this,this.#e),this.observable=new Qe(e,r)}clone(){return new Xe(this.#e,this.config())}config(e){if(e===void 0)return{...this.#t};if(this.#t&&this.#t.allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),this.#t=Nn(e,this.#t||{}),this}withConfig(e){const r=this.config();return new Xe(this.#e,{...r,...e,stega:{...r.stega||{},...typeof e?.stega=="boolean"?{enabled:e.stega}:e?.stega||{}}})}
35fetch(e,r,n){return O(Yn(this,this.#e,this.#t.stega,e,r,n))}getDocument(e,r){if(r?.includeAllVersions===!0)return O(Ie(this,this.#e,e,{...r,includeAllVersions:!0}));const n={signal:r?.signal,tag:r?.tag,releaseId:r?.releaseId,...r&&"includeAllVersions"in r?{includeAllVersions:!1}:{}};return O(Ie(this,this.#e,e,n))}getDocuments(e,r){return O(Qn(this,this.#e,e,r))}create(e,r){return O(st(this,this.#e,e,"create",r))}createIfNotExists(e,r){return O(Zn(this,this.#e,e,r))}createOrReplace(e,r){return O(ei(this,this.#e,e,r))}createVersion({document:e,publishedId:r,releaseId:n,baseId:i,ifBaseRevisionId:s},o){if(!e)return _t(ri(this,this.#e,r,i,n,s,o));const a=Ye("createVersion",{document:e,publishedId:r,releaseId:n}),c={...e,_id:a},u=r||rt(e._id);return _t(ti(this,this.#e,c,u,o))}delete(e,r){return O(ni(this,this.#e,e,r))}discardVersion({releaseId:e,publishedId:r},n,i){const s=Je(r,e);return O(ii(this,this.#e,s,n,i))}replaceVersion({document:e,publishedId:r,releaseId:n},i){const s=Ye("replaceVersion",{document:e,publishedId:r,releaseId:n}),o={...e,_id:s};return _t(si(this,this.#e,o,i))}unpublishVersion({releaseId:e,publishedId:r},n){const i=Me(r,e);return O(oi(this,this.#e,i,r,n))}mutate(e,r){return O(ai(this,this.#e,e,r))}patch(e,r){return new le(e,r,this)}transaction(e){return new nt(e,this)}action(e,r){return O(F(this,this.#e,e,r))}request(e){return O(z(this,this.#e,e))}dataRequest(e,r,n){return O(ve(this,this.#e,e,r,n))}getUrl(e,r){return Bt(this,e,r)}getDataUrl(e,r){return J(this,e,r)}}function gc(t,e){return{requester:Pr(t),createClient:r=>{const n=Pr(t,{ignoreWarnings:r.ignoreWarnings});return new e((i,s)=>(s||n)({maxRedirects:0,maxRetries:r.maxRetries,retryDelay:r.retryDelay,lineage:r.lineage,...i}),r)}}}var yc=[];const mc=gc(yc,Xe),Vr=mc.createClient,vc=t=>{const e=Br(),r={...t};let n=Vr(r),i=fr(e.visualEditing);const s=Ni(e.liveContent);return{client:n,config:r,fetch:(...o)=>n.fetch(...o),liveStore:s,queryStore:i,setToken(o){r.token=o,n=Vr(r),i&&e.visualEditing&&(i=fr(e.visualEditing))}}};function _c(t,e){const r="default",n=kr();if(n._sanity?.[r])return n._sanity[r];n._sanity=n._sanity||{};const i=Br(),{additionalClients:s={},liveContent:o,visualEditing:a,...c}=i;return!c.disableSmartCdn&&n.$preview?c.useCdn=!1:!c.useCdn&&!c.token&&(c.useCdn=!0),n._sanity.default=vc(c),n._sanity.default}export{Sc as C,Hs as E,V as O,oe as _,wc as a,un as b,ge as c,ie as d,q as e,fe as f,_e as g,He as h,$n as i,Tn as j,H as k,Re as l,ho as m,_r as n,ne as o,Ds as p,Yr as q,_c as u,kn as v};

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.