1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9738],{4275:(e,t,r)=>{r.d(t,{q2:()=>n});let n=(0,r(47560).lazy)(()=>Promise.all([r.e(9738),r.e(8034)]).then(r.bind(r,25911)))},17514:(e,t,r)=>{r.r(t),r.d(t,{encodeIntoResult:()=>h,stegaEncodeSourceMap:()=>b,stegaEncodeSourceMap$1:()=>w});var n=r(66624);let i=/_key\s*==\s*['"](.*)['"]/;function s(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,r)=>{let n=typeof t;if("number"===n)return`${e}[${t}]`;if("string"===n)return`${e}${0===r?"":"."}${t}`;if(("string"==typeof t?i.test(t.trim()):"object"==typeof t&&"_key"in t)&&t._key)return`${e}[_key=="${t._key}"]`;if(Array.isArray(t)){let[r,n]=t;return`${e}[${r}:${n}]`}throw Error(`Unsupported path segment \`${JSON.stringify(t)}\``)},"")}let o={"\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","'":"\\'","\\":"\\\\"},a={"\\f":"\f","\\n":` 2`,"\\r":"\r","\\t":" ","\\'":"'","\\\\":"\\"};function u(e){let t,r=[],n=/\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;for(;null!==(t=n.exec(e));){if(void 0!==t[1]){let e=t[1].replace(/\\(\\|f|n|r|t|')/g,e=>a[e]);r.push(e);continue}if(void 0!==t[2]){r.push(parseInt(t[2],10));continue}if(void 0!==t[3]){let e=t[3].replace(/\\(\\')/g,e=>a[e]);r.push({_key:e,_index:-1});continue}}return r}function c(e){return e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(""!==e._key)return{_key:e._key};if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})}function l(e){return e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})}function h(e,t,r){return function e(t,r,i=[]){if(null!==t&&Array.isArray(t))return t.map((t,s)=>{if((0,n.u4)(t)){let n=t._key;if("string"==typeof n)return e(t,r,i.concat({_key:n,_index:s}))}return e(t,r,i.concat(s))});if((0,n.u4)(t)){if("block"===t._type||"span"===t._type){let n={...t};return"block"===t._type?n.children=e(t.children,r,i.concat("children")):"span"===t._type&&(n.text=e(t.text,r,i.concat("text"))),n}return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,e(n,r,i.concat(t))]))}return r(t,i)}(e,(e,n)=>{if("string"!=typeof e)return e;let i=function(e,t){var r;if(!t?.mappings)return;let n=(r=l(e),`$${r.map(e=>"string"==typeof e?`['${e.replace(/[\f\n\r\t'\\]/g,e=>o[e])}']`:"number"==typeof e?`[${e}]`:""!==e._key?`[?(@._key=='${e._key.replace(/['\\]/g,e=>o[e])}')]`:`[${e._index}]`).join("")}`);if(void 0!==t.mappings[n])return{mapping:t.mappings[n],matchedPath:n,pathSuffix:""};let i=l(e).map(e=>"string"==typeof e?`['${e.replace(/[\f\n\r\t'\\]/g,e=>o[e])}']`:"number"==typeof e?`[${e}]`:""!==e._key?`[?(@._key=='${e._key.replace(/['\\]/g,e=>o[e])}')]`:`[${e._index}]`);for(let e=i.length-1;e>=0;e--){let r=`$${i.slice(0,e).join("")}`,s=t.mappings[r];if(s){let e=n.substring(r.length);return{mapping:s,matchedPath:r,pathSuffix:e}}}}(n,t);if(!i)return e;let{mapping:s,matchedPath:a}=i;if("value"!==s.type||"documentValue"!==s.source.type)return e;let c=t.documents[s.source.document],h=t.paths[s.source.path],d=u(a);return r({sourcePath:u(h).concat(n.slice(d.length)),sourceDocument:c,resultPath:n,value:e})})}let d="drafts.";function p(e){return e.startsWith(d)}function f(e){return e.startsWith("versions.")}let g=({sourcePath:e,resultPath:t,value:r})=>{var n;if(n=r,/^\d{4}-\d{2}-\d{2}/.test(n)&&Date.parse(n)||function(e){try{let{protocol:t}=new URL(e,e.startsWith("/")?"https://acme.com":void 0);return m.has(t)||t.startsWith("web+")}catch{return!1}}(r))return!1;let i=e.at(-1);return!("slug"===e.at(-2)&&"current"===i||"string"==typeof i&&(i.startsWith("_")||i.endsWith("Id"))||e.some(e=>"meta"===e||"metadata"===e||"openGraph"===e||"seo"===e)||v(e)||v(t)||"string"==typeof i&&y.has(i))},y=new Set(["color","colour","currency","email","format","gid","hex","href","hsl","hsla","icon","id","index","key","language","layout","link","linkAction","locale","lqip","page","path","ref","rgb","rgba","route","secret","slug","status","tag","template","theme","type","textTheme","unit","url","username","variant","website"]),m=new Set(["app:","data:","discord:","file:","ftp:","ftps:","geo:","http:","https:","imap:","javascript:","magnet:","mailto:","maps:","ms-excel:","ms-powerpoint:","ms-word:","slack:","sms:","spotify:","steam:","teams:","tel:","vscode:","zoom:"]);function v(e){return e.some(e=>"string"==typeof e&&null!==e.match(/type/i))}function b(e,t,r){let{filter:o,logger:a,enabled:u}=r;if(!u){let n="config.enabled must be true, don't call this function otherwise";throw a?.error?.(`[@sanity/client]: ${n}`,{result:e,resultSourceMap:t,config:r}),TypeError(n)}if(!t)return a?.error?.("[@sanity/client]: Missing Content Source Map from response body",{result:e,resultSourceMap:t,config:r}),e;if(!r.studioUrl){let n="config.studioUrl must be defined";throw a?.error?.(`[@sanity/client]: ${n}`,{result:e,resultSourceMap:t,config:r}),TypeError(n)}let l=[],y=[],m=h(e,t,({sourcePath:e,sourceDocument:t,resultPath:i,value:u})=>{var h;let m;if(("function"==typeof o?o({sourcePath:e,resultPath:i,filterDefault:g,sourceDocument:t,value:u}):g({sourcePath:e,resultPath:i,value:u}))===!1)return a&&y.push({path:s(c(e)),value:`${u.slice(0,20)}${u.length>20?"...":""}`,length:u.length}),u;a&&l.push({path:s(c(e)),value:`${u.slice(0,20)}${u.length>20?"...":""}`,length:u.length});let{baseUrl:v,workspace:b,tool:w}=("/"!==(m="string"==typeof(h="function"==typeof r.studioUrl?r.studioUrl(t):r.studioUrl)?h:h.baseUrl)&&(m=m.replace(/\/$/,"")),"string"==typeof h?{baseUrl:m}:{...h,baseUrl:m});if(!v)return u;let{_id:$,_type:q,_projectId:E,_dataset:R}=t;return(0,n.y)(u,{origin:"sanity.io",href:function(e){let{baseUrl:t,workspace:r="default",tool:n="default",id:i,type:o,path:a,projectId:u,dataset:l}=e;if(!t)throw Error("baseUrl is required");if(!a)throw Error("path is required");if(!i)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let h="default"===r?void 0:r,g="default"===n?void 0:n,y=f(i)?i.split(".").slice(2).join("."):p(i)?i.slice(d.length):i,m=Array.isArray(a)?s(c(a)):a,v=new URLSearchParams({baseUrl:t,id:y,type:o,path:m});if(h&&v.set("workspace",h),g&&v.set("tool",g),u&&v.set("projectId",u),l&&v.set("dataset",l),p(i)||f(i)){if(f(i)){let e=function(e){if(!f(e))return;let[t,r]=e.split(".");return r}(i);v.set("perspective",e)}}else v.set("perspective","published");let b=["/"===t?"":t];h&&b.push(h);let w=["mode=presentation",`id=${y}`,`type=${o}`,`path=${encodeURIComponent(m)}`];return g&&w.push(`tool=${g}`),b.push("intent","edit",`${w.join(";")}?${v}`),b.join("/")}({baseUrl:v,workspace:b,tool:w,id:$,type:q,path:e,...!r.omitCrossDatasetReferenceData&&{dataset:R,projectId:E}})},!1)});if(a){let e=y.length,t=l.length;if((e||t)&&((a?.groupCollapsed||a.log)?.("[@sanity/client]: Encoding source map into result"),a.log?.(`[@sanity/client]: Paths encoded: ${l.length}, skipped: ${y.length}`)),l.length>0&&(a?.log?.("[@sanity/client]: Table of encoded paths"),(a?.table||a.log)?.(l)),y.length>0){let e=new Set;for(let{path:t}of y)e.add(t.replace(i,"0").replace(/\[\d+\]/g,"[]"));a?.log?.("[@sanity/client]: List of skipped paths",[...e.values()])}(e||t)&&a?.groupEnd?.()}return m}var w=Object.freeze({__proto__:null,stegaEncodeSourceMap:b})},25911:(e,t,r)=>{r.r(t),r.d(t,{default:()=>f});
2var n=r(9604),i=r(47560),s=r(52152),o=r(2812),a=r(15653);let u="sanity.preview-kit";function c(e,t){switch(t.type){case"message":return{...e,messages:[...e.messages,t]};case"reconnect":case"restart":return{...e,messages:[],resets:e.resets+1};case"welcome":return e;default:throw Error(`Unknown event: ${t.type}`,{cause:t})}}let l={messages:[],resets:0};function h(e,t,r){return`${e}:${JSON.stringify({params:t,perspective:r})}`}function d(e,t){switch(t.type){case"subscribe":return function(e,{payload:t}){let r=h(t.query,t.params,t.perspective);if(!e.get(r)?.listeners.has(t.onStoreChange)){let n=new Map(e),i=n.get(r)||{query:t.query,params:t.params,perspective:t.perspective,listeners:new Set},s=new Set(i.listeners);return s.add(t.onStoreChange),n.set(r,{...i,listeners:s}),n}return e}(e,t);case"unsubscribe":return function(e,{payload:t}){let r=h(t.query,t.params,t.perspective),n=e.get(r);if(!n||!n.listeners.has(t.onStoreChange))return e;let i=new Map(e),s=new Set(n.listeners);return s.delete(t.onStoreChange),0===s.size?i.delete(r):i.set(r,{...n,listeners:s}),i}(e,t);default:throw Error(`Unknown action: ${t.type}`,{cause:t})}}let p=new Map;function f(e){let{children:t,token:r}=e;if(!e.client)throw Error("Missing a `client` prop with a configured Sanity client instance");let f=(0,s.K3)(function(e){let[t,r]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let e=(0,o.RM)({name:"loaders",connectTo:"presentation"},(0,o.Uc)().provide({actors:(0,a.jF)()}));e.on("loader/perspective",({perspective:e})=>{"raw"!==e&&r(t=>(0,s.n4)(t,e)?t:e)});let t=e.start();return()=>t()},[]),null===t?e:t}(e.perspective||"drafts")),[y]=(0,i.useState)(()=>{let{requestTagPrefix:t}=e.client.config();return e.client.withConfig({requestTagPrefix:t||u,...r&&{token:r,useCdn:!1,perspective:"drafts",ignoreBrowserTokenWarning:!0}})}),[m]=(0,i.useState)(()=>e.logger);(0,i.useEffect)(()=>{m&&m.log("[@sanity/preview-kit]: Updates will be applied in real-time using the Sanity Live Content API.")},[m]);let{queries:v,snapshots:b,subscribe:w,update:$}=function(){let[e,t]=(0,i.useReducer)(d,p),[r]=(0,i.useState)(()=>new Map),n=(0,i.useCallback)(e=>(t({type:"subscribe",payload:e}),()=>t({type:"unsubscribe",payload:e})),[]),o=(0,i.useCallback)((e,t,n,i)=>{let o=r.get(e);return!(o&&(0,s.n4)(o,{result:t,resultSourceMap:n,syncTags:i}))&&(r.set(e,{result:(0,s.n4)(o?.result,t)?o?.result:t,resultSourceMap:(0,s.n4)(o?.resultSourceMap,n)?o?.resultSourceMap:n,syncTags:(0,s.n4)(o?.syncTags,i)?o?.syncTags:i}),!0)},[r]);return{queries:e,snapshots:r,subscribe:n,update:o}}(),q=(0,i.useMemo)(()=>function(e,t,r,n){let i=n||f,s=h(t,r,i);return{subscribe:e=>{let n=w({query:t,params:r,perspective:i,onStoreChange:e});return()=>n()},getSnapshot:()=>b.has(s)?b.get(s)?.result:e}},[f,b,w]),E=function(e){let[t,r]=(0,i.useReducer)(c,l),[n,s]=(0,i.useState)(null);if(null!==n)throw n;return(0,i.useEffect)(()=>{let t=e.live.events({includeDrafts:!0,tag:u}).subscribe({next:r,error:e=>s(e instanceof Error?e:Error("Unexpected error in useLiveEvents",{cause:e}))});return()=>t.unsubscribe()},[e.live]),(0,i.useDeferredValue)(t)}(y);return(0,n.jsxs)(s.Ui.Provider,{value:q,children:[t,[...v.entries()].map(([e,{query:t,params:r,perspective:i,listeners:s}])=>(0,n.jsx)(g,{client:y,listeners:s,params:r,query:t,perspective:i,liveEventsMessages:E.messages,snapshotKey:e,syncTags:b.get(e)?.syncTags,update:$},`${E.resets}:${e}`))]})}function g(e){let{client:t,query:r,params:n,perspective:o,snapshotKey:a,update:u,liveEventsMessages:c,syncTags:l,listeners:h}=e,[d]=(0,i.useState)(()=>new Set(c.map(e=>e.id))),p=(0,i.useMemo)(()=>c.filter(e=>!d.has(e.id)),[c,d]),f=(0,i.useMemo)(()=>p.findLast(e=>e.tags.some(e=>l?.includes(e))),[p,l])?.id,[g,y]=(0,i.useState)(null);if(g)throw g;let m=(0,s.$u)();return(0,i.useEffect)(()=>{if(m)return;let e=!1,i=new AbortController;return t.fetch(r,n,{lastLiveEventId:f,perspective:o,signal:i.signal,filterResponse:!1,returnQuery:!1}).then(({result:t,resultSourceMap:r,syncTags:n})=>{for(let e of(u(a,t,r,n),h))e();e=!0}).catch(e=>{"AbortError"!==e.name&&y(e)}),()=>{e||i.abort()}},[t,f,h,n,o,r,m,a,u]),null}f.displayName="LiveStoreProvider",g.displayName="QuerySubscription"},52152:(e,t,r)=>{r.d(t,{$u:()=>d,K3:()=>h,Ui:()=>c,kk:()=>l,n4:()=>u});var n,i,s,o=r(47560),a=r(40165),u=(n=function(){if(s)return i;s=1;var e="u">typeof Element,t="function"==typeof Map,r="function"==typeof Set,n="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;return i=function(i,s){try{return function i(s,o){if(s===o)return!0;
2if(s&&o&&"object"==typeof s&&"object"==typeof o){var a,u,c,l;if(s.constructor!==o.constructor)return!1;if(Array.isArray(s)){if((a=s.length)!=o.length)return!1;for(u=a;0!=u--;)if(!i(s[u],o[u]))return!1;return!0}if(t&&s instanceof Map&&o instanceof Map){if(s.size!==o.size)return!1;for(l=s.entries();!(u=l.next()).done;)if(!o.has(u.value[0]))return!1;for(l=s.entries();!(u=l.next()).done;)if(!i(u.value[1],o.get(u.value[0])))return!1;return!0}if(r&&s instanceof Set&&o instanceof Set){if(s.size!==o.size)return!1;for(l=s.entries();!(u=l.next()).done;)if(!o.has(u.value[0]))return!1;return!0}if(n&&ArrayBuffer.isView(s)&&ArrayBuffer.isView(o)){if((a=s.length)!=o.length)return!1;for(u=a;0!=u--;)if(s[u]!==o[u])return!1;return!0}if(s.constructor===RegExp)return s.source===o.source&&s.flags===o.flags;if(s.valueOf!==Object.prototype.valueOf&&"function"==typeof s.valueOf&&"function"==typeof o.valueOf)return s.valueOf()===o.valueOf();if(s.toString!==Object.prototype.toString&&"function"==typeof s.toString&&"function"==typeof o.toString)return s.toString()===o.toString();if((a=(c=Object.keys(s)).length)!==Object.keys(o).length)return!1;for(u=a;0!=u--;)if(!Object.prototype.hasOwnProperty.call(o,c[u]))return!1;if(e&&s instanceof Element)return!1;for(u=a;0!=u--;)if(!(("_owner"===c[u]||"__v"===c[u]||"__o"===c[u])&&s.$$typeof)&&!i(s[c[u]],o[c[u]]))return!1;return!0}return s!=s&&o!=o}(i,s)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}}())&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;let c=(0,o.createContext)(null);function l(e,t,r,n){var i;let s,{isEqual:l=u,perspective:d=null}=n||{},p=(0,o.useContext)(c),f=(i=r,s=(0,o.useMemo)(()=>JSON.stringify(i||{}),[i]),(0,o.useMemo)(()=>JSON.parse(s),[s])),g=h(d),y=(0,o.useMemo)(()=>({subscribe:()=>()=>{},getSnapshot:()=>e}),[e]),m=(0,o.useMemo)(()=>p?.(e,t,f,g)||{subscribe:()=>()=>{},getSnapshot:()=>e},[p,e,f,t,g]),[v]=(0,o.useState)(()=>{if(void 0===e)throw Error("initialSnapshot can't be undefined, if you don't want an initial value use null instead");try{return JSON.parse(JSON.stringify(e))}catch(t){return console.warn("Failed to deep clone initialSnapshot, this is likely an error and an indication that the snapshot isn't JSON serializable",{initialSnapshot:e,error:t}),e}}),b=(0,o.useCallback)(()=>v,[v]),w=(0,o.useCallback)(e=>e,[]),$=(0,a.useSyncExternalStoreWithSelector)(m?.subscribe||y.subscribe,m?.getSnapshot||y.getSnapshot,b,w,l),q=null!==p;return[$,q&&v===$,q]}function h(e){let t=(0,o.useMemo)(()=>JSON.stringify(e),[e]);return(0,o.useMemo)(()=>JSON.parse(t),[t])}function d(){let[e,t]=(0,o.useState)(!1);(0,o.useEffect)(()=>{t(navigator.onLine);let e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e),window.addEventListener("offline",r),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}},[]);let r=(0,o.useSyncExternalStore)(p,()=>document.visibilityState,()=>"hidden");return!e||"hidden"===r}function p(e){return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)}},57880:(e,t,r)=>{r.d(t,{UU:()=>tD});var n,i=r(54232),s=r(47404),o=r(19932),a=r(37075),u=r(39871),c=r(38036),l=r(80135),h=r(36425),d=r(29250),p=r(41590),f=r(18152),g=r(29297),y=r(36237),m=r(91415),v=r(43096),b=r(51761),w=r(27674),$=r(87815),q=r(8671),E=r(52774),R=r(66624),I=r(71326),S=r(94505);let j="drafts.",T="versions.";function x(e){return e.startsWith(j)}function _(e){return e.startsWith(T)}function C(e){return _(e)?j+P(e):x(e)?e:j+e}function A(e,t){if("drafts"===t||"published"===t)throw Error('Version can not be "published" or "drafts"');return`${T}${t}.${P(e)}`}function O(e){if(!_(e))return;let[t,r]=e.split(".");return r}function P(e){return _(e)?e.split(".").slice(2).join("."):x(e)?e.slice(j.length):e}var D=r(9890);let k=/\r\n|[\n\r\u2028\u2029]/;function M(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n].length+1;if(r+i>e)return{line:n+1,column:e-r};r+=i}return{line:t.length,column:t[t.length-1]?.length??0}}
2class U extends Error{response;statusCode=400;responseBody;details;constructor(e,t){const r=L(e,t);super(r.message),Object.assign(this,r)}}class V extends Error{response;statusCode=500;responseBody;details;constructor(e){const t=L(e);super(t.message),Object.assign(this,t)}}function L(e,t){var r,n,i;let s=e.body,o={response:e,statusCode:e.statusCode,responseBody:(r=s,-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(r,null,2):r),message:"",details:void 0};if(!(0,R.u4)(s))return o.message=W(e,s),o;let a=s.error;if("string"==typeof a&&"string"==typeof s.message)return o.message=`${a} - ${s.message}`,o;if("object"!=typeof a||null===a)return"string"==typeof a?o.message=a:"string"==typeof s.message?o.message=s.message:o.message=W(e,s),o;if("type"in(n=a)&&"mutationError"===n.type&&"description"in n&&"string"==typeof n.description||"type"in(i=a)&&"actionError"===i.type&&"description"in i&&"string"==typeof i.description){let e=a.items||[],t=e.slice(0,5).map(e=>e.error?.description).filter(Boolean),r=t.length?`: 3- ${t.join(` 4- `)}`:"";return e.length>5&&(r+=` 5...and ${e.length-5} more`),o.message=`${a.description}${r}`,o.details=s.error,o}return N(a)?(o.message=z(a,t?.options?.query?.tag),o.details=s.error):"description"in a&&"string"==typeof a.description?(o.message=a.description,o.details=a):o.message=W(e,s),o}function N(e){return(0,R.u4)(e)&&"queryParseError"===e.type&&"string"==typeof e.query&&"number"==typeof e.start&&"number"==typeof e.end}function z(e,t){let{query:r,start:n,end:i,description:s}=e;if(!r||typeof n>"u")return`GROQ query parse error: ${s}`;let o=t?` 6 7Tag: ${t}`:"";return`GROQ query parse error: 8${function(e,t,r){let n=e.split(k),{start:i,end:s,markerLines:o}=function(e,t){let r={...e.start},n={...r,...e.end},i=r.line??-1,s=r.column??0,o=n.line,a=n.column,u=Math.max(i-3,0),c=Math.min(t.length,o+3);-1===i&&(u=0),-1===o&&(c=t.length);let l=o-i,h={};if(l)for(let e=0;e<=l;e++){let r=e+i;if(s)if(0===e){let e=t[r-1].length;h[r]=[s,e-s+1]}else if(e===l)h[r]=[0,a];else{let n=t[r-e].length;h[r]=[0,n]}else h[r]=!0}else s===a?s?h[i]=[s,0]:h[i]=!0:h[i]=[s,a-s];return{start:u,end:c,markerLines:h}}({start:M(t.start,n),end:t.end?M(t.end,n):void 0},n),a=`${s}`.length;return e.split(k,s).slice(i,s).map((e,t)=>{let n=i+1+t,s=` ${` ${n}`.slice(-a)} |`,u=o[n],c=!o[n+1];if(!u)return` ${s}${e.length>0?` ${e}`:""}`;let l="";if(Array.isArray(u)){let t=e.slice(0,Math.max(u[0]-1,0)).replace(/[^\t]/g," "),n=u[1]||1;l=[` 9 `,s.replace(/\d/g," ")," ",t,"^".repeat(n)].join(""),c&&r&&(l+=" "+r)}return[">",s,e.length>0?` ${e}`:"",l].join("")}).join(` 10`)}(r,{start:n,end:i},s)}${o}`}function W(e,t){var r;let n="string"==typeof t?` (${(r=t).length>100?`${r.slice(0,100)}\u2026`:r})`:"",i=e.statusMessage?` ${e.statusMessage}`:"";return`${e.method}-request to ${e.url} resulted in HTTP ${e.statusCode}${i}${n}`}
10class H extends Error{projectId;addOriginUrl;constructor({projectId:e}){super("CorsOriginError"),this.name="CorsOriginError",this.projectId=e;const t=new URL(`https://sanity.io/manage/project/${e}/api`);if("u">typeof location){const{origin:e}=location;t.searchParams.set("cors","add"),t.searchParams.set("origin",e),this.addOriginUrl=t,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${t}`}else this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: ${t}`}}let J={onResponse:(e,t)=>{if(e.statusCode>=500)throw new V(e);if(e.statusCode>=400)throw new U(e,t);return e}};function F(e,t={}){return(0,i.af)([(0,s.L5)({shouldRetry:B}),...e,function(e={}){let t={},r=t=>void 0!==e.ignoreWarnings&&(Array.isArray(e.ignoreWarnings)?e.ignoreWarnings:[e.ignoreWarnings]).some(e=>"string"==typeof e?t.includes(e):e instanceof RegExp&&e.test(t));return{onResponse:e=>{let n=e.headers["x-sanity-warning"];for(let e of Array.isArray(n)?n:[n])!e||t[e]||r(e)||(t[e]=!0,console.warn(e));return e}}}(t),(0,s.UX)(),(0,s.Yf)(),(0,s.qB)(),J,(0,s.sH)({implementation:o.c})])}function B(e,t,r){if(0===r.maxRetries)return!1;let n="GET"===r.method||"HEAD"===r.method,i=(r.uri||r.url).startsWith("/data/query"),o=e.response&&(429===e.response.statusCode||502===e.response.statusCode||503===e.response.statusCode);return(!!n||!!i)&&!!o||s.L5.shouldRetry(e,t,r)}function G(e){return"https://www.sanity.io/help/"+e}let Q=["image","file"],Y=["before","after","replace"],K=e=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(e))throw Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},Z=(e,t)=>{if(null===t||"object"!=typeof t||Array.isArray(t))throw Error(`${e}() takes an object of properties`)},X=(e,t)=>{if("string"!=typeof t||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(t)||t.includes(".."))throw Error(`${e}(): "${t}" is not a valid document ID`)},ee=(e,t)=>{if(!t._id)throw Error(`${e}() requires that the document contains an ID ("_id" property)`);X(e,t._id)},et=(e,t)=>{if(!t._type)throw Error(`\`${e}()\` requires that the document contains a type (\`_type\` property)`);var r=t._type;if("string"!=typeof r)throw Error(`\`${e}()\`: \`${r}\` is not a valid document type`)},er=e=>{if(e.dataset)return e.dataset;let t=e.resource;if(t&&"dataset"===t.type){let e=t.id.split(".");if(2!==e.length)throw Error('Dataset resource ID must be in the format "project.dataset"');return e[1]}throw Error("`dataset` must be provided to perform queries")},en=e=>{if("string"!=typeof e||!/^[a-z0-9._-]{1,75}$/i.test(e))throw Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return e},ei=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:n}=t;switch(r){case"dataset":if(2!==n.split(".").length)throw Error('Dataset resource ID must be in the format "project.dataset"');return;case"dashboard":case"media-library":case"canvas":return;default:throw Error(`Unsupported resource type: ${r.toString()}`)}},es=(e,t)=>{if(t.resource)throw Error(`\`${e}\` does not support resource-based operations`)},eo=e=>{var t;let r,n;return t=(...t)=>console.warn(e.join(" "),...t),r=!1,(...e)=>(r||(n=t(...e),r=!0),n)},ea=eo(["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"]),eu=eo(["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."]),ec=eo(["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."]),el=eo(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),eh=eo(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${G("js-client-browser-token")} for more information and how to hide this warning.`]),ed=eo(["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`."]),ep=eo(["Using the Sanity client without specifying an API version is deprecated.",`See ${G("js-client-api-version")}`]),ef=(eo(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),eo(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."])),eg=eo(["The `~experimental_resource` configuration property has been renamed to `resource`.","Please update your client configuration to use `resource` instead. Support for `~experimental_resource` will be removed in a future version."]),ey={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},em=["localhost","127.0.0.1","0.0.0.0"];function ev(e){if(Array.isArray(e)&&e.length>1&&e.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}let eb=(e,t)=>{let r,n={...t,...e,stega:{..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||ey.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};n.apiVersion||ep();let i={...ey,...n};i["~experimental_resource"]&&!i.resource&&(eg(),i.resource=i["~experimental_resource"]);let s=i.resource,o=i.useProjectHostname&&!s;if(typeof Promise>"u"){let e=G("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${e}`)}if(o&&!i.projectId)throw Error("Configuration must contain `projectId`");if(s&&ei(i),"u">typeof i.perspective&&ev(i.perspective),"encodeSourceMap"in i)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in i)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?");
10if("boolean"!=typeof i.stega.enabled)throw Error(`stega.enabled must be a boolean, received ${i.stega.enabled}`);if(i.stega.enabled&&void 0===i.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(i.stega.enabled&&"string"!=typeof i.stega.studioUrl&&"function"!=typeof i.stega.studioUrl)throw Error(`stega.studioUrl must be a string or a function, received ${i.stega.studioUrl}`);let a="u">typeof window&&window.location&&window.location.hostname,u=a&&(r=window.location.hostname,-1!==em.indexOf(r)),c=!!i.token;i.withCredentials&&c&&(ed(),i.withCredentials=!1),a&&u&&c&&!0!==i.ignoreBrowserTokenWarning?eh():typeof i.useCdn>"u"&&eu(),o&&(e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")})(i.projectId),i.dataset&&K(i.dataset),"requestTagPrefix"in i&&(i.requestTagPrefix=i.requestTagPrefix?en(i.requestTagPrefix).replace(/\.+$/,""):void 0),i.apiVersion=`${i.apiVersion}`.replace(/^v/,""),i.isDefaultApi=i.apiHost===ey.apiHost,!0===i.useCdn&&i.withCredentials&&ea(),i.useCdn=!1!==i.useCdn&&!i.withCredentials,function(e){if("1"===e||"X"===e)return;let t=new Date(e);if(!(/^\d{4}-\d{2}-\d{2}$/.test(e)&&t instanceof Date&&t.getTime()>0))throw Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}(i.apiVersion);let l=i.apiHost.split("://",2),h=l[0],d=l[1],p=i.isDefaultApi?"apicdn.sanity.io":d;return o?(i.url=`${h}://${i.projectId}.${d}/v${i.apiVersion}`,i.cdnUrl=`${h}://${i.projectId}.${p}/v${i.apiVersion}
10`):(i.url=`${i.apiHost}/v${i.apiVersion}`,i.cdnUrl=i.url),i};class ew extends Error{name="ConnectionFailedError"}class e$ extends Error{name="DisconnectError";reason;constructor(e,t,r={}){super(e,r),this.reason=t}}class eq extends Error{name="ChannelError";data;constructor(e,t){super(e),this.data=t}}class eE extends Error{name="MessageError";data;constructor(e,t,r={}){super(e,r),this.data=t}}class eR extends Error{name="MessageParseError"}let eI=["channelError","disconnect"];function eS(e,t){return(0,a.v)(()=>{let t=e();return(0,u.A)(t)?t:(0,c.of)(t)}).pipe((0,l.Z)(e=>{var r,n;return r=e,n=t,new o.c(e=>{let t=n.includes("open"),i=n.includes("reconnect");function s(t){if("data"in t){let[r,n]=ej(t);e.error(r?new eR("Unable to parse EventSource error message",{cause:n}):new eE((n?.data).message,n));return}r.readyState===r.CLOSED?e.error(new ew("EventSource connection failed")):i&&e.next({type:"reconnect"})}function o(){e.next({type:"open"})}function a(t){let[n,i]=ej(t);if(n)return void e.error(new eR("Unable to parse EventSource message",{cause:n}));if("channelError"===t.type){var s,o;let t,n=new URL(r.url).searchParams.get("tag");e.error(new eq((s=i?.data,o=n,(t=s.error)?N(t)?z(t,o):t.description?t.description:"string"==typeof t?t:JSON.stringify(t,null,2):s.message||"Unknown listener error"),i.data));return}"disconnect"===t.type?e.error(new e$(`Server disconnected client: ${i.data?.reason||"unknown error"}`)):e.next({type:t.type,id:t.lastEventId,...i.data?{data:i.data}:{}})}r.addEventListener("error",s),t&&r.addEventListener("open",o);let u=[...new Set([...eI,...n])].filter(e=>"error"!==e&&"open"!==e&&"reconnect"!==e);return u.forEach(e=>r.addEventListener(e,a)),()=>{r.removeEventListener("error",s),t&&r.removeEventListener("open",o),u.forEach(e=>r.removeEventListener(e,a)),r.close()}})}))}function ej(e){try{let t="string"==typeof e.data&&JSON.parse(e.data);return[null,{type:e.type,id:e.lastEventId,...!function(e){for(let t in e)return!1;return!0}(t)?{data:t}:{}}]}catch(e){return[e,null]}}function eT(e){if("string"==typeof e)return{id:e};if(Array.isArray(e))return{query:"*[_id in $ids]",params:{ids:e}};if("object"==typeof e&&null!==e&&"query"in e&&"string"==typeof e.query)return"params"in e&&"object"==typeof e.params&&null!==e.params?{query:e.query,params:e.params}:{query:e.query};let t=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(` 11`);throw Error(`Unknown selection - must be one of: 12 13${t}`)}class ex{selection;operations;constructor(e,t={}){this.selection=e,this.operations=t}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return Z("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,t,r){return((e,t,r)=>{let n="insert(at, selector, items)";if(-1===Y.indexOf(e)){let e=Y.map(e=>`"${e}"`).join(", ");throw Error(`${n} takes an "at"-argument which is one of: ${e}`)}if("string"!=typeof t)throw Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw Error(`${n} takes an "items"-argument which must be an array`)})(e,t,r),this._assign("insert",{[e]:t,items:r})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,r,n){let i=t<0?t-1:t,s=typeof r>"u"||-1===r?-1:Math.max(0,t+r),o=`${e}[${i}:${i<0&&s>=0?"":s}]`;return this.insert("replace",o,n||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...eT(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,r=!0){return Z(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},r&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}}class e_ extends ex{#e;constructor(e,t,r){super(e,t),this.#e=r}clone(){return new e_(this.selection,{...this.operations},this.#e)}commit(e){if(!this.#e)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#e.mutate({patch:this.serialize()},t)}}class eC extends ex{#e;constructor(e,t,r){super(e,t),this.#e=r}clone(){return new eC(this.selection,{...this.operations},this.#e)}commit(e){if(!this.#e)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#e.mutate({patch:this.serialize()},t)}}let eA={returnDocuments:!1};class eO{operations;trxId;constructor(e=[],t){this.operations=e,this.trxId=t}create(e){return Z("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return Z(t,e),ee(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return Z(t,e),ee(t,e),this._add({[t]:e})}delete(e){return X("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 eP extends eO{#e;constructor(e,t,r){super(e,r),this.#e=t}clone(){return new eP([...this.operations],this.#e,this.trxId)}commit(e){if(!this.#e)throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#e.mutate(this.serialize(),Object.assign({transactionId:this.trxId},eA,e||{}))}patch(e,t){let r="function"==typeof t,n="string"!=typeof e&&e instanceof eC,i="object"==typeof e&&("query"in e||"id"in e);if(n)return this._add({patch:e.serialize()});if(r){let r=t(new eC(e,{},this.#e));if(!(r instanceof eC))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(i){let r=new eC(e,t||{},this.#e);return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}class eD extends eO{#e;constructor(e,t,r){super(e,r),this.#e=t}clone(){return new eD([...this.operations],this.#e,this.trxId)}commit(e){if(!this.#e)throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#e.mutate(this.serialize(),Object.assign({transactionId:this.trxId},eA,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof e_)return this._add({patch:e.serialize()});if(r){let r=t(new e_(e,{},this.#e));if(!(r instanceof e_))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}let ek=({query:e,params:t={},options:r={}})=>{let n=new URLSearchParams,{tag:i,includeMutations:s,returnQuery:o,...a}=r;for(let[r,s]of(i&&n.append("tag",i),n.append("query",e),Object.entries(t)))void 0!==s&&n.append(`$${r}`,JSON.stringify(s));for(let[e,t]of Object.entries(a))t&&n.append(e,`${t}`);return!1===o&&n.append("returnQuery","false"),!1===s&&n.append("includeMutations","fal
13se"),`?${n}`},eM=e=>"response"===e.type,eU=e=>e.body;function eV(e,t,n,i,s={},o={}){let a="stega"in o?{...n||{},..."boolean"==typeof o.stega?{enabled:o.stega}:o.stega||{}}:n,u=a.enabled?(0,R.Q)(s):s,c=!1===o.filterResponse?e=>e:e=>e.result,{cache:l,next:d,...p}={useAbortSignal:"u">typeof o.signal,resultSourceMap:a.enabled?"withKeyArraySelector":o.resultSourceMap,...o,returnQuery:!1===o.filterResponse&&!1!==o.returnQuery},f=eX(e,t,"query",{query:i,params:u},"u">typeof l||"u">typeof d?{...p,fetch:{cache:l,next:d}}:p);return a.enabled?f.pipe((0,I.v)((0,h.H)(r.e(9738).then(r.bind(r,17514)).then(function(e){return e.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:e})=>e))),(0,q.T)(([e,t])=>{let r=t(e.result,e.resultSourceMap,a);return c({...e,result:r})})):f.pipe((0,q.T)(c))}function eL(e,t,r,n={}){let i={uri:e9(e,"doc",(()=>{if(!n.releaseId)return r;let e=O(r);if(!e){if(x(r))throw Error(`The document ID (\`${r}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return A(r,n.releaseId)}if(e!==n.releaseId)throw Error(`The document ID (\`${r}\`) is already a version of \`${e}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return r})()),json:!0,tag:n.tag,signal:n.signal,query:void 0!==n.includeAllVersions?{includeAllVersions:n.includeAllVersions}:void 0};return e5(e,t,i).pipe((0,S.p)(eM),(0,q.T)(e=>{let t=e.body.documents;return t?n.includeAllVersions?t:t[0]:n.includeAllVersions?[]:void 0}))}function eN(e,t,r,n={}){let i={uri:e9(e,"doc",r.join(",")),json:!0,tag:n.tag,signal:n.signal};return e5(e,t,i).pipe((0,S.p)(eM),(0,q.T)(e=>{let t,n,i=(t=e.body.documents||[],n=e=>e._id,t.reduce((e,t)=>(e[n(t)]=t,e),Object.create(null)));return r.map(e=>i[e]||null)}))}function ez(e,t,r,n={}){return eX(e,t,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},n)}function eW(e,t,r,n){return ee("createIfNotExists",r),e0(e,t,r,"createIfNotExists",n)}function eH(e,t,r,n){return ee("createOrReplace",r),e0(e,t,r,"createOrReplace",n)}function eJ(e,t,r,n,i){return ee("createVersion",r),et("createVersion",r),ef(),eZ(e,t,{actionType:"sanity.action.document.version.create",publishedId:n,document:r},i)}function eF(e,t,r,n,i,s,o){if(!n)throw Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw Error("`createVersion()` requires `publishedId` when `baseId` is provided");return X("createVersion",n),X("createVersion",r),eZ(e,t,{actionType:"sanity.action.document.version.create",publishedId:r,baseId:n,versionId:i?A(r,i):C(r),ifBaseRevisionId:s},o)}function eB(e,t,r,n){return eX(e,t,"mutate",{mutations:[{delete:eT(r)}]},n)}function eG(e,t,r,n=!1,i){return eZ(e,t,{actionType:"sanity.action.document.version.discard",versionId:r,purge:n},i)}function eQ(e,t,r,n){return ee("replaceVersion",r),et("replaceVersion",r),eZ(e,t,{actionType:"sanity.action.document.version.replace",document:r},n)}function eY(e,t,r,n,i){return eZ(e,t,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:n},i)}function eK(e,t,r,n){let i;return eX(e,t,"mutate",{mutations:Array.isArray(i=r instanceof eC||r instanceof e_?{patch:r.serialize()}:r instanceof eP||r instanceof eD?r.serialize():r)?i:[i],transactionId:n&&n.transactionId||void 0},n)}function eZ(e,t,r,n){let i=Array.isArray(r)?r:[r],s=n&&n.transactionId||void 0;return eX(e,t,"actions",{actions:i,transactionId:s,skipCrossDatasetReferenceValidation:n&&n.skipCrossDatasetReferenceValidation||void 0,dryRun:n&&n.dryRun||void 0},n)}function eX(e,t,r,n,i={}){let s="mutate"===r,o="actions"===r,a=s||o?"":ek(n),u=!s&&!o&&a.length<11264,c=u?a:"",l=i.returnFirst,{timeout:h,token:d,tag:p,headers:f,returnQuery:g,lastLiveEventId:y,cacheMode:m}=i,v={method:u?"GET":"POST",uri:e9(e,r,c),json:!0,body:u?void 0:n,query:s&&((e={})=>{let t;return{dryRun:e.dryRun,returnIds:!0,returnDocuments:(t=e.returnDocuments,!1===t?void 0:!!(typeof t>"u")||t),visibility:e.visibility||"sync",autoGenerateArrayKeys:e.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:e.skipCrossDatasetReferenceValidation}})(i),timeout:h,headers:f,token:d,tag:p,returnQuery:g,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(y)?y[0]:y,cacheMode:m,canUseCdn:"query"===r,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn};return e5(e,t,v).pipe((0,S.p)(eM),(0,q.T)(eU),(0,q.T)(e=>{if(!s)return e;let t=e.results||[];if(i.returnDocuments)return l?t[0]&&t[0].document:t.map(e=>e.document);let r=l?t[0]&&t[0].id:t.map(e=>e.id);return{transactionId:e.transactionId,results:t,[l?"documentId":"documentIds"]:r}}))}function e0(e,t,r,n,i={}){return eX(e,t,"mutate",{mutations:[{[n]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},i))}let e1=e=>{let t=e.config();return void 0!==t.dataset&&void 0!==t.projectId||void 0!==t.resource},e2=(e,t)=>e1(e)&&t.startsWith(e9(e,"query"));function e5(e,t,r){var n;let i=r.url||r.uri,s=e.config(),a=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&(i.startsWith("/data/")||e2(e,i)||e1(e)&&i.startsWith(e9(e,"mutate"))||e1(e)&&i.startsWith(e9(e,"doc",""))||e1(e)&&i.startsWith(e9(e,"listen"))||e1(e)&&i.startsWith(e9(e,"history",""))):r.canUseCdn,u=(r.useCdn??s.useCdn)&&a,c=r.tag&&s.requestTagPrefix?[s.requestTagPrefix,r.tag].join("."):r.tag||s.requestTagPrefix;if(c&&null!==r.tag&&(r.query={tag:en(c),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&e2(e,i)){let e=r.resultSourceMap??s.resultSourceMap;void 0!==e&&!1!==e&&(r.query={resultSourceMap:e,...r.query});let t=r.perspective||s.perspective;"u">typeof t&&("previewDrafts"===t&&el(),ev(t),r.query={perspective:Array.isArray(t)?t.join(","):t,...r.query},(Array.isArray(t)&&t.length>0||"previewDrafts"===t||"drafts"===t)&&u&&(u=!1,ec())),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),!1===r.returnQuery&&(r.query={returnQuery:"false",...r.query}),u&&"noStale"==r.cacheMode&&(r.query={cacheMode:"noStale",...r.query})}let l=function(e,t={}){let r={};e.headers&&Object.assign(r,e.headers);let n=t.token||e.token;n&&(r.Authorization=`Bearer ${n}`),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let i=!!(typeof t.withCredentials>"u"?e.withCredentials:t.withCredentials),s=typeof t.timeout>"u"?e.timeout:t.timeout;return Object.assign({},t,{headers:Object.assign({},r,t.headers||{}),timeout:typeof s>"u"?3e5:s,proxy:t.proxy||e.proxy,json:!0,withCredentials:i,fetch:"object"==typeof t.fetch&&"object"==typeof e.fetch?{...e.fetch,...t.fetch}:t.fetch||e.fetch})}(s,Object.assign({},r,{url:e3(e,i,u)})),h=new o.c(e=>t(l,s.requester).subscribe(e));
13return r.signal?h.pipe((n=r.signal,e=>new o.c(t=>{let r=()=>t.error(function(e){if(e6)return new DOMException(e?.reason??"The operation was aborted.","AbortError");let t=Error(e?.reason??"The operation was aborted.");return t.name="AbortError",t}(n));if(n&&n.aborted)return void r();let i=e.subscribe(t);return n.addEventListener("abort",r),()=>{n.removeEventListener("abort",r),i.unsubscribe()}}))):h}function e4(e,t,r){return e5(e,t,r).pipe((0,S.p)(e=>"response"===e.type),(0,q.T)(e=>e.body))}function e9(e,t,r){let n=e.config();if(n.resource){ei(n);let e=e8(n),i=void 0!==r?`${t}/${r}`:t;return`${e}/${i}`.replace(/\/($|\?)/,"$1")}let i=er(n),s=`/${t}/${i}`;return`/data${void 0!==r?`${s}/${r}`:s}`.replace(/\/($|\?)/,"$1")}function e3(e,t,r=!1){let{url:n,cdnUrl:i}=e.config();return`${r?i:n}/${t.replace(/^\//,"")}`}let e6=!!globalThis.DOMException,e8=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:n}=t;switch(r){case"dataset":{let e=n.split(".");if(2!==e.length)throw Error('Dataset ID must be in the format "project.dataset"');return`/projects/${e[0]}/datasets/${e[1]}`}case"canvas":return`/canvases/${n}`;case"media-library":return`/media-libraries/${n}`;case"dashboard":return`/dashboards/${n}`;default:throw Error(`Unsupported resource type: ${r.toString()}`)}};function e7(e,t,r){let n=er(e.config());return e4(e,t,{method:"POST",uri:`/agent/action/generate/${n}`,body:r})}function te(e,t,r){let n=er(e.config());return e4(e,t,{method:"POST",uri:`/agent/action/transform/${n}`,body:r})}function tt(e,t,r){let n=er(e.config());return e4(e,t,{method:"POST",uri:`/agent/action/translate/${n}`,body:r})}class tr{#e;#t;constructor(e,t){this.#e=e,this.#t=t}generate(e){return e7(this.#e,this.#t,e)}transform(e){return te(this.#e,this.#t,e)}translate(e){return tt(this.#e,this.#t,e)}}class tn{#e;#t;constructor(e,t){this.#e=e,this.#t=t}generate(e){return(0,d.s)(e7(this.#e,this.#t,e))}transform(e){return(0,d.s)(te(this.#e,this.#t,e))}translate(e){return(0,d.s)(tt(this.#e,this.#t,e))}prompt(e){var t,r;let n;return(0,d.s)((t=this.#e,r=this.#t,n=er(t.config()),e4(t,r,{method:"POST",uri:`/agent/action/prompt/${n}`,body:e})))}patch(e){var t,r;let n;return(0,d.s)((t=this.#e,r=this.#t,n=er(t.config()),e4(t,r,{method:"POST",uri:`/agent/action/patch/${n}`,body:e})))}}class ti{#e;#t;constructor(e,t){this.#e=e,this.#t=t}upload(e,t,r){return to(this.#e,this.#t,e,t,r)}}class ts{#e;#t;constructor(e,t){this.#e=e,this.#t=t}upload(e,t,r){let n=to(this.#e,this.#t,e,t,r);return(0,d.s)(n.pipe((0,S.p)(e=>"response"===e.type),(0,q.T)(e=>e.body.document)))}}function to(e,t,r,n,i={}){var s,o;if(-1===Q.indexOf(r))throw Error(`Invalid asset type: ${r}. Must be one of ${Q.join(", ")}`);let a=i.extract||void 0;a&&!a.length&&(a=["none"]);let u=e.config(),c=(s=i,o=n,!(typeof File>"u")&&o instanceof File?Object.assign({filename:!1===s.preserveFilename?void 0:o.name,contentType:o.type},s):s),{tag:l,label:h,title:d,description:p,creditLine:f,filename:g,source:y}=c,m=u.resource?.type==="media-library",v=m?{title:d,filename:g}:{label:h,title:d,description:p,filename:g,meta:a,creditLine:f};return y&&!m&&(v.sourceId=y.id,v.sourceName=y.name,v.sourceUrl=y.url),e5(e,t,{tag:l,method:"POST",timeout:c.timeout||0,uri:function(e,t){let r="image"===t?"images":"files",n=e.resource;if(n){let{type:e,id:t}=n;switch(e){case"dataset":throw Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${t}/assets/${r}`;case"media-library":return`/media-libraries/${t}/upload`;case"dashboard":return`/dashboards/${t}/assets/${r}`;default:throw Error(`Unsupported resource type: ${e.toString()}`)}}let i=er(e);return`assets/${r}/${i}`}(u,r),headers:c.contentType?{"Content-Type":c.contentType}:{},query:v,body:n})}let ta=(0,a.v)(()=>r.e(5643).then(r.t.bind(r,95643,19))).pipe((0,q.T)(({default:e})=>e),(0,p.t)(1));function tu(){return function(e){return e.pipe((0,f.W)((e,t)=>e instanceof ew?(0,g.x)((0,c.of)({type:"reconnect"}),(0,y.O)(1e3).pipe((0,l.Z)(()=>t))):(0,m.$)(()=>e)))}}let tc=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],tl={includeResult:!0};function th(e,t,r={}){let{url:n,token:i,withCredentials:s,requestTagPrefix:o,headers:a}=this.config(),u=r.tag&&o?[o,r.tag].join("."):r.tag,l={...Object.keys(tl).concat(Object.keys(r)).reduce((e,t)=>
13(e[t]=typeof r[t]>"u"?tl[t]:r[t],e),{}),tag:u},h=ek({query:e,params:t,options:{tag:u,...tc.reduce((e,t)=>(typeof l[t]>"u"||(e[t]=l[t]),e),{})}}),d=`${n}${e9(this,"listen",h)}`;if(d.length>14800)return(0,m.$)(()=>Error("Query too large for listener"));let p=l.events?l.events:["mutation"],f={};return s&&(f.withCredentials=!0),(i||a)&&(f.headers={},i&&(f.headers.Authorization=`Bearer ${i}`),a&&Object.assign(f.headers,a)),eS(()=>(typeof EventSource>"u"||f.headers?ta:(0,c.of)(EventSource)).pipe((0,q.T)(e=>new e(d,f))),p).pipe(tu(),(0,S.p)(e=>p.includes(e.type)),(0,q.T)(e=>({type:e.type,..."data"in e?e.data:{}})))}let td="2021-03-25";class tp{#e;constructor(e){this.#e=e}events({includeDrafts:e=!1,tag:t}={}){var r,n,i,s;let{projectId:a,apiVersion:u,token:h,withCredentials:d,requestTagPrefix:p,headers:g}=this.#e.config(),y=u.replace(/^v/,"");if("X"!==y&&y<td)throw Error(`The live events API requires API version ${td} or later. The current API version is ${y}. Please update your API version to use this feature.`);if(e&&!h&&!d)throw Error("The live events API requires a token or withCredentials when 'includeDrafts: true'. Please update your client configuration. The token should have the lowest possible access role.");let m=e9(this.#e,"live/events"),E=new URL(this.#e.getUrl(m,!1)),R=t&&p?[p,t].join("."):t;R&&E.searchParams.set("tag",R),e&&E.searchParams.set("includeDrafts","true");let I={};e&&d&&(I.withCredentials=!0),(e&&h||g)&&(I.headers={},e&&h&&(I.headers.Authorization=`Bearer ${h}`),g&&Object.assign(I.headers,g));let S=`${E.href}::${JSON.stringify(I)}`,j=tf.get(S);if(j)return j;let T=eS(()=>(typeof EventSource>"u"||I.headers?ta:(0,c.of)(EventSource)).pipe((0,q.T)(e=>new e(E.href,I))),["message","restart","welcome","reconnect","goaway"]),x=(n=E,i={method:"OPTIONS",mode:"cors",credentials:I.withCredentials?"include":"omit",headers:I.headers},new o.c(e=>{let t=new AbortController,r=t.signal;return fetch(n,{...i,signal:t.signal}).then(t=>{e.next(t),e.complete()},t=>{r.aborted||e.error(t)}),()=>t.abort()})).pipe((0,f.W)(()=>{throw new H({projectId:a})})),_=T.pipe(tu(),(0,l.Z)(e=>"reconnect"===e.type?x.pipe((0,l.Z)(()=>(0,c.of)(e))):(0,c.of)(e)),(0,f.W)(e=>x.pipe((0,l.Z)(()=>{throw e}))),(0,q.T)(e=>{if("message"===e.type){let{data:t,...r}=e;return{...r,tags:t.tags}}return e})).pipe((0,b.j)(()=>tf.delete(S)),(s="function"==typeof(r={predicate:e=>"welcome"===e.type})?{predicate:r,...void 0}:r,e=>{let t,r=!1,{predicate:n,...i}=s,a=e.pipe((0,v.M)(e=>{s.predicate(e)&&(r=!0,t=e)}),(0,b.j)(()=>{r=!1,t=void 0}),(0,w.u)(i)),u=new o.c(e=>{r&&e.next(t),e.complete()});return(0,$.h)(a,u)}));return tf.set(S,_),_}}let tf=new Map;class tg{#e;#t;constructor(e,t){this.#e=e,this.#t=t}create(e,t){return tv(this.#e,this.#t,"PUT",e,t)}edit(e,t){return tv(this.#e,this.#t,"PATCH",e,t)}delete(e){return tv(this.#e,this.#t,"DELETE",e)}list(){es("dataset",this.#e.config());let e=this.#e.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),e4(this.#e,this.#t,{uri:r,tag:null})}getEmbeddingsSettings(e){return es("dataset",this.#e.config()),K(e),e4(this.#e,this.#t,{uri:tm(this.#e,e),tag:null})}editEmbeddingsSettings(e,t){return es("dataset",this.#e.config()),K(e),e4(this.#e,this.#t,{method:"PUT",uri:tm(this.#e,e),body:t,tag:null})}}class ty{#e;#t;constructor(e,t){this.#e=e,this.#t=t}create(e,t){return es("dataset",this.#e.config()),(0,d.s)(tv(this.#e,this.#t,"PUT",e,t))}edit(e,t){return es("dataset",this.#e.config()),(0,d.s)(tv(this.#e,this.#t,"PATCH",e,t))}delete(e){return es("dataset",this.#e.config()),(0,d.s)(tv(this.#e,this.#t,"DELETE",e))}list(){es("dataset",this.#e.config());let e=this.#e.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),(0,d.s)(e4(this.#e,this.#t,{uri:r,tag:null}))}getEmbeddingsSettings(e){return es("dataset",this.#e.config()),K(e),(0,d.s)(e4(this.#e,this.#t,{uri:tm(this.#e,e),tag:null}))}editEmbeddingsSettings(e,t){return es("dataset",this.#e.config()),K(e),(0,d.s)(e4(this.#e,this.#t,{method:"PUT",uri:tm(this.#e,e),body:t,tag:null}))}}function tm(e,t){let r=e.config();return!1===r.useProjectHostname?`/projects/${r.projectId}/datasets/${t}/settings/embeddings`:`/datasets/${t}/settings/embeddings`}function tv(e,t,r,n,i){return es("dataset",e.config()),K(n),e4(e,t,{method:r,uri:`/datasets/${n}`,body:i,tag:null})}class tb{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getPlaybackInfo(e,t={}){var r,n;let i=this.#e.config(),s=(i.resource||i["~experimental_resource"])?.id,{instanceId:o,library
13Id:a}=function(e){let t="object"==typeof e&&"_ref"in e?e._ref:e,r=t$.exec(t);if(r){let[,e,t]=r;return{libraryId:e,instanceId:t}}if("string"==typeof e&&e.startsWith("video-"))return{instanceId:e};throw Error(`Invalid video asset instance identifier "${t}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}(e),u=a||s;if(!u)throw Error("Could not determine Media Library ID - you need to provide a valid Media Library ID in the client config or a Media Library GDR");let c=(r=o,n=u,`/media-libraries/${n}/video/${r}/playback-info`),l=function(e){let t={};if(e.transformations){let{thumbnail:r,animated:n,storyboard:i}=e.transformations;r&&(r.width&&(t.thumbnailWidth=r.width),r.height&&(t.thumbnailHeight=r.height),void 0!==r.time&&(t.thumbnailTime=r.time),r.fit&&(t.thumbnailFit=r.fit),r.format&&(t.thumbnailFormat=r.format)),n&&(n.width&&(t.animatedWidth=n.width),n.height&&(t.animatedHeight=n.height),void 0!==n.start&&(t.animatedStart=n.start),void 0!==n.end&&(t.animatedEnd=n.end),n.fps&&(t.animatedFps=n.fps),n.format&&(t.animatedFormat=n.format)),i&&i.format&&(t.storyboardFormat=i.format)}return e.expiration&&(t.expiration=e.expiration),t}(t);return e4(this.#e,this.#t,{method:"GET",uri:c,query:l})}}class tw{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getPlaybackInfo(e,t={}){return(0,d.s)(new tb(this.#e.observable,this.#t).getPlaybackInfo(e,t))}}let t$=/^media-library:(ml[^:]+):([^:]+)$/;class tq{#e;#t;constructor(e,t){this.#e=e,this.#t=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),e4(this.#e,this.#t,{uri:"/projects",query:t})}getById(e){return e4(this.#e,this.#t,{uri:`/projects/${e}`})}}class tE{#e;#t;constructor(e,t){this.#e=e,this.#t=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),(0,d.s)(e4(this.#e,this.#t,{uri:"/projects",query:t}))}getById(e){return(0,d.s)(e4(this.#e,this.#t,{uri:`/projects/${e}`}))}}let tR=(0,D.d_)("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),tI=(e,t)=>t?A(e,t):C(e);function tS(e,{releaseId:t,publishedId:r,document:n}){if(r&&n._id){let e=tI(r,t);return((e,t)=>{if(t._id&&t._id!==e)throw Error(`The provided document ID (\`${t._id}\`) does not match the generated version ID (\`${e}\`)`)})(e,n),e}if(n._id){let r=x(n._id),i=_(n._id);if(!r&&!i)throw Error(`\`${e}()\` requires a document with an \`_id\` that is a version or draft ID`);if(t){if(r)throw Error(`\`${e}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${t}\`) was also provided.`);let i=O(n._id);if(i!==t)throw Error(`\`${e}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${t}\`) does not match the document's version ID (\`${i}\`).`)}return n._id}if(r)return tI(r,t);throw Error(`\`${e}()\` requires either a publishedId or a document with an \`_id\``)}let tj=(e,t)=>{let[r,n,i]=((e,t)=>{if("object"==typeof e&&null!==e&&("releaseId"in e||"metadata"in e)){let{releaseId:r=tR(),metadata:n={}}=e;return[r,n,t]}return[tR(),{},e]})(e,t);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...n,releaseType:n.releaseType||"undecided"}},options:i}};class tT{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get({releaseId:e},t){return eL(this.#e,this.#t,`_.releases.${e}`,t)}create(e,t){let{action:r,options:n}=tj(e,t),{releaseId:i,metadata:s}=r;return eZ(this.#e,this.#t,r,n).pipe((0,q.T)(e=>({...e,releaseId:i,metadata:s})))}edit({releaseId:e,patch:t},r){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r)}publish({releaseId:e},t){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.publish",releaseId:e},t)}archive({releaseId:e},t){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.archive",releaseId:e},t)}unarchive({releaseId:e},t){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.unarchive",releaseId:e},t)}schedule({releaseId:e,publishAt:t},r){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r)}unschedule({releaseId:e},t){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.unschedule",releaseId:e},t)}delete({releaseId:e},t){return eZ(this.#e,this.#t,{actionType:"sanity.action.release.delete",releaseId:e},t)}fetchDocuments({releaseId:e},t){return ez(this.#e,this.#t,e,t)}}class tx{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get({releaseId:e},t){return(0,d.s)(eL(this.#e,this.#t,`_.releases.${e}`,t))}async create(e,t){let{action:r,options:n}=tj(e,t),{releaseId:i,metadata:s}=r;return{...await (0,d.s)(eZ(this.#e,this.#t,r,n)),releaseId:i,metadata:s}}edit({releaseId:e,patch:t},r){return(0,d.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r))}publish({releaseId:e},t){return(0,d.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.publish",releaseId:e},t))}archive({releaseId:e},t){return(0,d.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.archive",releaseId:e},t))}unarchive({releaseId:e},t){return(0,d.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.unarchive",releaseId:e},t))}schedule({releaseId:e,publishAt:t},r){return(0,d.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r))}unschedule({releaseId:e},t){return(0,d.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.unschedule",releaseId:e},t))}delete({releaseId:e},t){return(0,d.s)(eZ(this.#e,this.#t,{actionType:"sanity.action.release.delete",releaseId:e},t))}fetchDocuments({releaseId:e},t){return(0,d.s)(ez(this.#e,this.#t,e,t))}}class t_{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getById(e){return e4(this.#e,this.#t,{uri:`/users/${e}`})}}class tC{#e;#t;constructor(e,t){this.#e=e,this.#t=t}getById(e){return(0,d.s)(e4(this.#e,this.#t,{uri:`/users/${e}`}))}}class tA{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#r;#t;listen=th;constructor(e,t=ey){this.config(t),this.#t=e,this.assets=new ti(this,this.#t),this.datasets=new tg(this,this.#t),this.live=new tp(this),this.mediaLibrary={video:new tb(this,this.#t)},this.projects=new tq(this,this.#t),this.users=new t_(this,this.#t),this.agent={action:new tr(this,this.#t)},this.releases=new tT(this,this.#t)}clone(){return new tA(this.#t,this.config())}config(e){if(void 0===e)return{...this.#r};if(this.#r&&!1===this.#r.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.#r=eb(e,this.#r||{}),this}withConfig(e){let t=this.config();return new tA(this.#t,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return eV(this,this.#t,this.#r.stega,e,t,r)}getDocument(e,t){if(t?.includeAllVersions===!0)return eL(this,this.#t,e,{...t,includeAllVersions:!0});let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return eL(this,this.#t,e,r)}getDocuments(e,t){return eN(this,this.#t,e,t)}create(e,t){return e0(this,this.#t,e,"create",t)}createIfNotExists(e,t){return eW(this,this.#t,e,t)}createOrReplace(e,t){return eH(this,this.#t,e,t)}createVersion({document:e,publishedId:t,releaseId:r,baseId:n,ifBaseRevisionId:i},s){if(!e)return eF(this,this.#t,t,n,r,i,s);let o=tS("createVersion",{document:e,publishedId:t,releaseId:r}),a={...e,_id:o},u=t||P(e._id);return eJ(this,this.#t,a,u,s)}delete(e,t){return eB(this,this.#t,e,t)}discardVersion({releaseId:e,publishedId:t},r,n){let i=tI(t,e);return eG(this,this.#t,i,r,n)}replaceVersion({document:e,publishedId:t,releaseId:r},n){let i=tS("replaceVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:i};return eQ(this,this.#t,s,n)}unpublishVersion({releaseId:e,publishedId:t},r){let n=A(t,e);return eY(this,this.#t,n,t,r)}mutate(e,t){return eK(this,this.#t,e,t)}patch(e,t){return new e_(e,t,this)}transaction(e){return new eD(e,this)}action(e,t){return eZ(this,this.#t,e,t)}request(e){return e4(this,this.#t,e)}getUrl(e,t){return e3(this,e,t)}getDataUrl(e,t){return e9(this,e,t)}}class tO{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#r;#t;listen=th;constructor(e,t=ey){this.config(t),this.#t=e,this.assets=new ts(this,this.#t),this.datasets=new ty(this,this.#t),this.live=new tp(this),this.mediaLibrary={video:new tw(this,this.#t)},this.projects=new tE(this,this.#t),this.users=new tC(this,this.#t),this.agent={action:new tn(this,this.#t)},this.releases=new tx(this,this.#t),this.observable=new tA(e,t)}clone(){return new tO(this.#t,this.config())}config(e){if(void 0===e)return{...this.#r};if(this.#r&&!1===this.#r.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),this.#r=eb(e,this.#r||{}),this}withConfig(e){let t=this.config();return new tO(this.#t,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return(0,d.s)(eV(this,this.#t,this.#r.stega,e,t,r))}getDocument(e,t){if(t?.includeAllVersions===!0)return(0,d.s)(eL(this,this.#t,e,{...t,includeAllVersions:!0}));let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return(0,d.s)(eL(this,this.#t,e,r))}getDocuments(e,t){return(0,d.s)(eN(this,this.#t,e,t))}create(e,t){return(0,d.s)(e0(this,this.#t,e,"create",t))}createIfNotExists(e,t){return(0,d.s)(eW(this,this.#t,e,t))}createOrReplace(e,t){return(0,d.s)(eH(this,this.#t,e,t))}createVersion({document:e,publishedId:t,releaseId:r,baseId:n,ifBaseRevisionId:i},s){if(!e)return(0,E._)(eF(this,this.#t,t,n,r,i,s));let o=tS("createVersion",{document:e,publishedId:t,releaseId:r}),a={...e,_id:o},u=t||P(e._id);return(0,E._)(eJ(this,this.#t,a,u,s))}delete(e,t){return(0,d.s)(eB(this,this.#t,e,t))}discardVersion({releaseId:e,publishedId:t},r,n){let i=tI(t,e);return(0,d.s)(eG(this,this.#t,i,r,n))}replaceVersion({document:e,publishedId:t,releaseId:r},n){let i=tS("replaceVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:i};return(0,E._)(eQ(this,this.#t,s,n))}unpublishVersion({releaseId:e,publishedId:t},r){let n=A(t,e);return(0,d.s)(eY(this,this.#t,n,t,r))}mutate(e,t){return(0,d.s)(eK(this,this.#t,e,t))}patch(e,t){return new eC(e,t,this)}transaction(e){return new eP(e,this)}action(e,t){return(0,d.s)(eZ(this,this.#t,e,t))}request(e){return(0,d.s)(e4(this,this.#t,e))}dataRequest(e,t,r){return(0,d.s)(eX(this,this.#t,e,t,r))}getUrl(e,t){return e3(this,e,t)}getDataUrl(e,t){return e9(this,e,t)}}let tP={requester:F(n=[]),createClient:e=>{let t=F(n,{ignoreWarnings:e.ignoreWarnings});return new tO((r,n)=>(n||t)({maxRedirects:0,maxRetries:e.maxRetries,retryDelay:e.retryDelay,lineage:e.lineage,...r}),e)}},tD=(tP.requester,tP.createClient)},66624:(e,t,r)=>{function n(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}r.d(t,{Q:()=>h,u4:()=>n,y:()=>u});var i={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},s={0:8203,1:8204,2:8205,3:65279},o={0:String.fromCodePoint(s[0]),1:String.fromCodePoint(s[1]),2:String.fromCodePoint(s[2]),3:String.fromCodePoint(s[3])},a=[,,,,].fill(String.fromCodePoint(s[0])).join("");function u(e,t,r="auto"){return!0===r||"auto"===r&&(!(!Number.isNaN(Number(e))||/[a-z]/i.test(e)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(e))&&Date.parse(e)||function(e){try{new URL(e,e.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}(e))?e:`${e}${function(e){let t=JSON.stringify(e),r=new TextEncoder().encode(t),n="";for(let e=0;e<r.length;e++){let t=r[e];n+=o[t>>6&3]+o[t>>4&3]+o[t>>2&3]+o[3&t]}return a+n}(t)}`}Object.fromEntries(Object.entries(o).map(e=>[e[1],+e[0]])),Object.fromEntries(Object.entries(i).map(e=>e.reverse()));
13var c=`${Object.values(i).map(e=>`\\u{${e.toString(16)}}`).join("")}`,l=RegExp(`[${c}]{4,}`,"gu");function h(e){var t,r;return e&&JSON.parse({cleaned:(t=JSON.stringify(e)).replace(l,""),encoded:(null==(r=t.match(l))?void 0:r[0])||""}.cleaned)}}}]);
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.