PageSourceSearch

https://www.harvey.ai/_next/static/immutable/chunks/3n6ibql3wt51s.js

js harvey.ai collected 2026-10-01 10:40:25 UTC 84,680 bytes, 11 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="9f2251d7-f6d2-4855-80fa-5163fc447ca4")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,866249,372966,e=>{"use strict";try{var t="u">typeof window?window:e.g;t._sentryModuleMetadata=t._sentryModuleMetadata||{},t._sentryModuleMetadata[(new t.Error).stack]=Object.assign({},t._sentryModuleMetadata[(new t.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}function r(e){return"https://www.sanity.io/help/"+e}let i=["image","file"],n=["before","after","replace"],s=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")},a=(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`)},o=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},u=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:i}=t;switch(r){case"dataset":if(2!==i.split(".").length)throw Error('Dataset resource ID must be in the format "project.dataset"');return;case"dashboard":case"knowledge-base":case"media-library":case"canvas":return;default:throw Error(`Unsupported resource type: ${r.toString()}`)}},c=e=>{var t;let r,i;return t=(...t)=>console.warn(e.join(" "),...t),r=!1,(...e)=>(r||(i=t(...e),r=!0),i)},d=c(["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"]),l=c(["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."]),h=c(["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."]),p=c(["The `previewDrafts` perspective has been renamed to  `drafts` and will be removed in a future API version"]),f=c(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${r("js-client-browser-token")} for more information and how to hide this warning.`]),g=c(["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`."]),y=c(["Using the Sanity client without specifying an API version is deprecated.",`See ${r("js-client-api-version")}`]),m=c(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),v=c(["You have called `createVersion()` with a defined `document`.","If you are creating a version of a document that already exists, prefer providing `baseId` and `releaseId` instead."]),w=c(["The `uri` request option has been renamed to `url`.","Please update your code to use `url` instead. Support for `uri` will be removed in a future version."]),b=c(["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."]),E={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},M=["localhost","127.0.0.1","0.0.0.0"];function I(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')}e.s(["_",0,a,"a",0,v,"b",0,(e,t)=>{if(t._id&&t._id!==e)throw Error(`The provided document ID (\`${t._id}
2\`) does not match the generated version ID (\`${e}\`)`)},"c",0,p,"d",0,o,"f",0,(e,t)=>{if(!t._id)throw Error(`${e}() requires that the document contains an ID ("_id" property)`);a(e,t._id)},"g",0,e=>{if(-1===i.indexOf(e))throw Error(`Invalid asset type: ${e}. Must be one of ${i.join(", ")}`)},"h",0,(e,t)=>{if(t.resource)throw Error(`\`${e}\` does not support resource-based operations`)},"i",0,h,"l",0,s,"m",0,u,"n",0,(e,t)=>{let i,n={...t,...e,stega:{..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||E.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};n.apiVersion||y();let a={...E,...n,apiHost:n.apiHost??E.apiHost};a["~experimental_resource"]&&!a.resource&&(b(),a.resource=a["~experimental_resource"]);let c=a.resource,h=a.useProjectHostname&&!c;if(typeof Promise>"u"){let e=r("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${e}`)}if(h&&!a.projectId)throw Error("Configuration must contain `projectId`");if(c&&u(a),void 0!==a.perspective&&I(a.perspective),"encodeSourceMap"in a)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 a)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'?");if("boolean"!=typeof a.stega.enabled)throw Error(`stega.enabled must be a boolean, received ${a.stega.enabled}`);if(a.stega.enabled&&void 0===a.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(a.stega.enabled&&"string"!=typeof a.stega.studioUrl&&"function"!=typeof a.stega.studioUrl)throw Error(`stega.studioUrl must be a string or a function, received ${a.stega.studioUrl}`);let p="u">typeof window&&window.location&&window.location.hostname,m=p&&(i=window.location.hostname,-1!==M.indexOf(i)),v=!!a.token;a.withCredentials&&v&&(g(),a.withCredentials=!1),p&&m&&v&&!0!==a.ignoreBrowserTokenWarning?f():void 0===a.useCdn&&l(),h&&(e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")})(a.projectId),a.dataset&&s(a.dataset),"requestTagPrefix"in a&&(a.requestTagPrefix=a.requestTagPrefix?o(a.requestTagPrefix).replace(/\.+$/,""):void 0),a.apiVersion=`${a.apiVersion}`.replace(/^v/,""),a.isDefaultApi=a.apiHost===E.apiHost,!0===a.useCdn&&a.withCredentials&&d(),a.useCdn=!1!==a.useCdn&&!a.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`")}(a.apiVersion);let w=a.apiHost.split("://",2),$=w[0],_=w[1],k=a.isDefaultApi?"apicdn.sanity.io":_;return h?(a.url=`${$}://${a.projectId}.${_}/v${a.apiVersion}`,a.cdnUrl=`${$}://${a.projectId}.${k}/v${a.apiVersion}`):(a.url=`${a.apiHost}/v${a.apiVersion}`,a.cdnUrl=a.url),a},"o",0,w,"p",0,(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`)},"r",0,I,"s",0,m,"t",0,E,"u",0,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")},"v",0,(e,t,r)=>{let i="insert(at, selector, items)";if(-1===n.indexOf(e)){let e=n.map(e=>`"${e}"`).join(", ");throw Error(`${i} takes an "at"-argument which is one of: ${e}`)}if("string"!=typeof t)throw Error(`${i} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw Error(`${i} takes an "items"-argument which must be an array`)},"y",0,(e,t)=>{if("object"!=typeof t||!t||Array.isArray(t))throw Error(`${e}() takes an object of properties`)}],866249);var $=e.i(342539);e.s(["isTimeoutError",()=>$.n],372966)},224941,e=>{"use strict";e.i(328368);var t,r=e.i(426346),i=e.i(56504),n=e.i(866249),s=e.i(136238);e.i(372966);var a=e.i(4290),o=e.i(394426),u=e.i(992481),c=e.i(602400),d=e.i(172441),l=e.i(128068),h=e.i(245912),p=e.i(305753),f=e.i(94059),g=e.i(993817),y=e.i(484973),m=e.i(245281),v=e.i(277497),w=e.i(218692),b=e.i(254201),E=e.i(817312),M=e.i(230038),I=e.i(204042),$=e.i(949988),_=e.i(222738),k=e.i(458711),C=e.i(883107),T=e.i(722249),A=e.i(844032);try{var O="u">typeof window?window:e.g;O._sentryModuleMetadata=O._sentryModuleMetadata||{},O._sentryModuleMetadata[(new O.Error).stack]=Object.assign({},O._sentryModuleMetadata[(new O.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}
2class x extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}try{var S="u">typeof window?window:e.g;S._sentryModuleMetadata=S._sentryModuleMetadata||{},S._sentryModuleMetadata[(new S.Error).stack]=Object.assign({},S._sentryModuleMetadata[(new S.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}function P(e,t,r){return 100===r&&97===e.charCodeAt(t+1)&&116===e.charCodeAt(t+2)&&97===e.charCodeAt(t+3)&&58===e.charCodeAt(t+4)}function j(e,t,r){return 101===r&&118===e.charCodeAt(t+1)&&101===e.charCodeAt(t+2)&&110===e.charCodeAt(t+3)&&116===e.charCodeAt(t+4)&&58===e.charCodeAt(t+5)}function D(e,t){let r=1;for(;r<e.length&&r<t.length;){if(e.charCodeAt(r)!==t.charCodeAt(r))return!1;r++}return e.length<=t.length||58===e.charCodeAt(t.length)}try{var R="u">typeof window?window:e.g;R._sentryModuleMetadata=R._sentryModuleMetadata||{},R._sentryModuleMetadata[(new R.Error).stack]=Object.assign({},R._sentryModuleMetadata[(new R.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}class q extends Event{code;message;constructor(e,t){super(e),this.code=t?.code??void 0,this.message=t?.message??void 0}[Symbol.for("nodejs.util.inspect.custom")](e,t,r){return r(U(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(U(this),t)}}function U(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}try{var V="u">typeof window?window:e.g;V._sentryModuleMetadata=V._sentryModuleMetadata||{},V._sentryModuleMetadata[(new V.Error).stack]=Object.assign({},V._sentryModuleMetadata[(new V.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}class L extends EventTarget{static CONNECTING=0;static OPEN=1;static CLOSED=2;CONNECTING=0;OPEN=1;CLOSED=2;get readyState(){return this.#e}get url(){return this.#t.href}get withCredentials(){return this.#r}get onerror(){return this.#i}set onerror(e){this.#i&&this.removeEventListener("error",this.#i),this.#i=e,e&&this.addEventListener("error",e)}get onmessage(){return this.#n}set onmessage(e){this.#n&&this.removeEventListener("message",this.#n),this.#n=e,e&&this.addEventListener("message",e)}get onopen(){return this.#s}set onopen(e){this.#s&&this.removeEventListener("open",this.#s),this.#s=e,e&&this.addEventListener("open",e)}addEventListener(e,t,r){super.addEventListener(e,t,r)}removeEventListener(e,t,r){super.removeEventListener(e,t,r)}constructor(e,t){super();try{if(e instanceof URL)this.#t=e;else if("string"==typeof e)this.#t=new URL(e,function(){let e="document"in globalThis?globalThis.document:void 0;return e&&"object"==typeof e&&"baseURI"in e&&"string"==typeof e.baseURI?e.baseURI:void 0}());else throw Error("Invalid URL")}catch{throw function(e){let t=globalThis.DOMException;return"function"==typeof t?new t(e,"SyntaxError"):SyntaxError(e)}("An invalid or illegal string was specified")}this.#a=function(e){let t,r;if("function"==typeof e)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:i,onComment:n,onError:s,onEvent:a,onId:o,onRetry:u}=e,c=[],d=0,l="",h="",p=0,f=!1,g=!1,y=!1;function m(e){if(e){if(13===e.charCodeAt(e.length-1)){E(e,0,e.length-1),y=!0;return}if(v(e)){c.push(e),d=e.length;return}g=!0}}function v(e){let t=e.charCodeAt(0);return 58===t&&!!n||100===t&&D(e,"data")||101===t&&D(e,"event")||105===t&&D(e,"id")||114===t&&D(e,"retry")}function w(){void 0===i||d+h.length<=i||(f=!0,c.length=0,d=0,t=void 0,h="",p=0,r=void 0,g=!1,y=!1,null==s||s(new x(`Buffered data exceeded max buffer size of ${i} characters`,{type:"max-buffer-size-exceeded"})))}function b(e){let i=0;if(-1===e.indexOf("\r")){let n=e.indexOf("\n",i);for(;-1!==n;){if(i===n){void 0!==t&&(null==o||o(t)),p>0&&(null==a||a({id:t,event:r,data:h})),t=void 0,h="",p=0,r=void 0,i=n+1,n=e.indexOf("\n",i);continue}let s=e.charCodeAt(i);if(P(e,i,s)){let s=32===e.charCodeAt(i+5)?i+6:i+5,u=e.slice(s,n);if(0===p&&10===e.charCodeAt(n+1)){void 0!==t&&(null==o||o(t)),null==a||a({id:t,event:r,data:u}),t=void 0,h="",r=void 0,i=n+2,n=e.indexOf("\n",i);continue}h=0===p?u:`${h}
3${u}`,p++}else j(e,i,s)?r=e.slice(32===e.charCodeAt(i+6)?i+7:i+6,n)||void 0:E(e,i,n);i=n+1,n=e.indexOf("\n",i)}return e.slice(i)}for(;i<e.length;){let t=e.indexOf("\r",i),r=e.indexOf("\n",i),n=-1;if(-1!==t&&-1!==r?n=t<r?t:r:-1!==t?n=t===e.length-1?-1:t:-1!==r&&(n=r),-1===n)break;E(e,i,n),i=n+1,13===e.charCodeAt(i-1)&&10===e.charCodeAt(i)&&i++}return e.slice(i)}function E(e,i,s){if(i===s)return void(void 0!==t&&(null==o||o(t)),p>0&&(null==a||a({id:t,event:r,data:h}
3)),t=void 0,h="",p=0,r=void 0);let u=e.charCodeAt(i);if(P(e,i,u)){let t=32===e.charCodeAt(i+5)?i+6:i+5,r=e.slice(t,s);h=0===p?r:`${h}
4${r}`,p++;return}if(j(e,i,u)){r=e.slice(32===e.charCodeAt(i+6)?i+7:i+6,s)||void 0;return}if(105===u&&100===e.charCodeAt(i+1)&&58===e.charCodeAt(i+2)){let r=e.slice(32===e.charCodeAt(i+3)?i+4:i+3,s);r.includes("\0")||(t=r);return}if(58===u){n&&n(e.slice(i,s).slice(32===e.charCodeAt(i+1)?2:1));return}let c=e.slice(i,s),d=c.indexOf(":");if(-1===d)return void M(c,"",c);let l=c.slice(0,d),f=32===c.charCodeAt(d+1)?2:1;M(l,c.slice(d+f),c)}function M(e,i,n){switch(e){case"event":r=i||void 0;break;case"data":h=0===p?i:`${h}
5${i}`,p++;break;case"id":i.includes("\0")||(t=i);break;case"retry":/^\d+$/.test(i)?null==u||u(parseInt(i,10)):null==s||s(new x(`Invalid \`retry\` value: "${i}"`,{type:"invalid-retry",value:i,line:n}));break;default:null==s||s(new x(`Unknown field "${e.length>20?`${e.slice(0,20)}…`:e}"`,{type:"unknown-field",field:e,value:i,line:n}))}}return{feed:function(e){if(f)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(void 0!==l){if(""===(e=l+e)||"ï"===e||"ï»"===e){l=e;return}l=void 0,e=e.replace(/^(?:\uFEFF|\xEF\xBB\xBF)/,"")}if((g||y)&&!(e=function(e){if(0===e.length)return e;if(y)return y=!1,10===e.charCodeAt(0)?e.slice(1):e;let t=e.indexOf("\r"),r=e.indexOf("\n"),i=-1===t?r:-1===r||t<r?t:r;return -1===i?"":i===e.length-1&&13===e.charCodeAt(i)?(g=!1,y=!0,""):(g=!1,e.slice(i+(13===e.charCodeAt(i)&&10===e.charCodeAt(i+1)?2:1)))}(e)))return;if(!c.length){let t=b(e);""!==t&&m(t),w();return}if(-1===e.indexOf("\n")&&-1===e.indexOf("\r")){if(d<6&&!v(c.join("")+e.slice(0,6-d))){c.length=0,d=0,g=!0;return}c.push(e),d+=e.length,w();return}c.push(e);let t=c.join("");c.length=0,d=0,m(b(t)),w()},reset:function(e={}){if(e.consume&&c.length>0){let e=c.join("");E(e,0,e.length)}l="",t=void 0,h="",p=0,r=void 0,c.length=0,d=0,f=!1,g=!1,y=!1}}}({maxBufferSize:t?.maxBufferSize??0x6400000,onEvent:this.#o,onError:this.#u,onId:this.#c,onRetry:this.#d}),this.#e=this.CONNECTING,this.#l=3e3,this.#h=t?.fetch??globalThis.fetch,this.#r=t?.withCredentials??!1,this.#p()}close(){this.#f&&clearTimeout(this.#f),this.#e!==this.CLOSED&&(this.#g&&this.#g.abort(),this.#e=this.CLOSED,this.#g=void 0)}#e;#t;#y;#r;#h;#l;#f;#m=null;#g;#a;#i=null;#n=null;#s=null;#p(){this.#e=this.CONNECTING,this.#g=new AbortController,(0,this.#h)(this.#t,this.#v()).then(this.#w).catch(this.#b)}#w=async e=>{this.#a.reset();let{body:t,redirected:r,status:i,headers:n}=e;
5if(204===i){this.#E("Server sent HTTP 204, not reconnecting",204),this.close();return}if(r?this.#y=new URL(e.url):this.#y=void 0,200!==i)return void this.#E(`Non-200 status code (${i})`,i);if(!(n.get("content-type")||"").startsWith("text/event-stream"))return void this.#E('Invalid content type, expected "text/event-stream"',i);if(this.#e===this.CLOSED)return;this.#e=this.OPEN;let s=new Event("open");if(this.dispatchEvent(s),"object"!=typeof t||!t||!("getReader"in t)){this.#E("Invalid response body, expected a web ReadableStream",i),this.close();return}let a=new TextDecoder,o=t.getReader(),u=!0;do{let{done:e,value:t}=await o.read();if(this.#e===this.CLOSED){u=!1;break}if(t&&this.#a.feed(a.decode(t,{stream:!e})),!e)continue;u=!1,this.#a.reset(),this.#M()}while(u)};#b=e=>{this.#g=void 0,"AbortError"!==e.name&&"aborted"!==e.type&&this.#M(function e(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(e).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${e(t.cause)}`:t.message:`${t}`}(e))};#v(){let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...this.#m?{"Last-Event-ID":this.#m}:void 0},cache:"no-store",signal:this.#g?.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e}#c=e=>{this.#m=e};#o=e=>{if(this.#e===this.CLOSED)return;let t=this.#y?this.#y.origin:this.#t.origin,r=this.#m??"",i=new MessageEvent(e.event||"message",{data:e.data,origin:t,lastEventId:r});i.origin!==t&&F(i,"origin",t),i.lastEventId!==r&&F(i,"lastEventId",r),this.dispatchEvent(i)};#d=e=>{this.#l=e};#u=e=>{"max-buffer-size-exceeded"===e.type&&(this.close(),this.#E(e.message))};#E(e,t){this.close();let r=new q("error",{code:t,message:e});this.dispatchEvent(r)}#M(e,t){if(this.#e===this.CLOSED)return;this.#e=this.CONNECTING;let r=new q("error",{code:t,message:e});this.dispatchEvent(r);let i=setTimeout(this.#I,this.#l);"object"==typeof i&&null!==i&&"unref"in i&&i.unref(),this.#f=i}#I=()=>{this.#f=void 0,this.#e===this.CONNECTING&&this.#p()}}function F(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0})}Object.defineProperty(L,"name",{value:"EventSource"}),Object.defineProperty(L,Symbol.for("eventsource.supports-fetch-override"),{value:!0,writable:!1,configurable:!1,enumerable:!1});try{var W="u">typeof window?window:e.g;W._sentryModuleMetadata=W._sentryModuleMetadata||{},W._sentryModuleMetadata[(new W.Error).stack]=Object.assign({},W._sentryModuleMetadata[(new W.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}var z=class extends Error{constructor(e,t={}){let{status:i,...n}=t;super(e,n),(0,r.u)(this,"name","ConnectionFailedError"),(0,r.u)(this,"status",void 0),this.status=i}},N=class extends Error{constructor(e,t,i={}){super(e,i),(0,r.u)(this,"name","DisconnectError"),(0,r.u)(this,"reason",void 0),this.reason=t}},B=class extends Error{constructor(e,t){super(e),(0,r.u)(this,"name","ChannelError"),(0,r.u)(this,"data",void 0),this.data=t}},H=class extends Error{constructor(e,t,i={}){super(e,i),(0,r.u)(this,"name","MessageError"),(0,r.u)(this,"data",void 0),this.data=t}},G=class extends Error{constructor(...e){super(...e),(0,r.u)(this,"name","MessageParseError")}};let K=["channelError","disconnect"];function Q(e,t){return(0,d.defer)(()=>{let t=e();return(0,h.isObservable)(t)?t:(0,m.of)(t)}).pipe((0,y.mergeMap)(e=>{var n,s;return n=e,s=t,new o.Observable(e=>{let t=new Set(s),a=t.has("open");function o(r){if("data"in r){let[t,n]=X(r);e.error(t||!n?new G("Unable to parse EventSource error message",{cause:t}):new H((0,i.t)(n.data)&&"string"==typeof n.data.message?n.data.message:"",n));return}if(void 0!==r.code)return void e.error(new z("EventSource connection failed",{status:r.code}));if(n.readyState===n.CLOSED)e.error(new z("EventSource connection failed"));else{let r="reconnect";t.has(r)&&e.next({type:r})}}function u(){let r="open";t.has(r)&&e.next({type:r})}function c(s){let a,[o,u]=X(s);if(o||!u)return void e.error(new G("Unable to parse EventSource message",{cause:o}));if("channelError"===s.type){let t=new URL(n.url).searchParams.get("tag");e.error(new B(function(e,t){let n=(0,i.t)(e)?e.error:void 0;if(!n){let t=(0,i.t)(e)?e.message:void 0;return"string"==typeof t&&t||"Unknown listener error"}if((0,i.t)(n)){if((0,r.l)(n))return(0,r.o)(n,t);if("string"==typeof n.description)return n.description}return"string"==typeof n?n:JSON.stringify(n,null,2)}(u?.data,t),u.data));return}"disconnect"===s.type?e.error(new N(`Server disconnected client: ${(0,i.t)(u.data)&&"string"==typeof u.data.reason&&u.data.reason||"unknown error"}`)):(a=s.type,t.has(a)&&e.next({type:s.type,id:s.lastEventId,...u.data?{data:u.data}:{}}))}n.addEventListener("error",o),a&&n.addEventListener("open",u);let d=[...new Set([...K,...s])].filter(e=>"error"!==e&&"open"!==e&&"reconnect"!==e);
5return d.forEach(e=>n.addEventListener(e,c)),()=>{n.removeEventListener("error",o),a&&n.removeEventListener("open",u),d.forEach(e=>n.removeEventListener(e,c)),n.close()}})}))}function X(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 Y(e){if("string"==typeof e)return{id:e};if(Array.isArray(e))return{query:"*[_id in $ids]",params:{ids:e}};if("object"==typeof e&&e&&"query"in e&&"string"==typeof e.query)return"params"in e&&"object"==typeof e.params&&null!==e.params?{query:e.query,params:e.params}:{query:e.query};throw Error(`Unknown selection - must be one of:
6
7* Document ID (<docId>)
8* Array of document IDs
9* Object containing \`query\``)}function J(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function Z(e,t,r){J(e,t),t.set(e,r)}function ee(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}function et(e,t,r){return e.set(ee(e,t),r),r}function er(e,t){return e.get(ee(e,t))}var ei=class{constructor(e,t={}){(0,r.u)(this,"selection",void 0),(0,r.u)(this,"operations",void 0),this.selection=e,this.operations=t}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return(0,n.y)("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(0,n.v)(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,i){let n=t<0?t-1:t,s=void 0===r||-1===r?-1:Math.max(0,t+r),a=`${e}[${n}:${n<0&&s>=0?"":s}]`;return this.insert("replace",a,i||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...Y(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,r=!0){return(0,n.y)(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)}},en=new WeakMap,es=class e extends ei{constructor(e,t,r){super(e,t),Z(this,en,void 0),et(en,this,r)}clone(){return new e(this.selection,{...this.operations},er(en,this))}commit(e){if(!er(en,this))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 er(en,this).mutate({patch:this.serialize()},t)}},ea=new WeakMap,eo=class e extends ei{constructor(e,t,r){super(e,t),Z(this,ea,void 0),et(ea,this,r)}clone(){return new e(this.selection,{...this.operations},er(ea,this))}commit(e){if(!er(ea,this))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 er(ea,this).mutate({patch:this.serialize()},t)}};let eu={returnDocuments:!1};var ec=class{constructor(e=[],t){(0,r.u)(this,"operations",void 0),(0,r.u)(this,"trxId",void 0),this.operations=e,this.trxId=t}create(e){return(0,n.y)("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return(0,n.y)(t,e),(0,n.f)(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return(0,n.y)(t,e),(0,n.f)(t,e),this._add({[t]:e})}delete(e){return(0,n._)("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}},ed=new WeakMap,el=class e extends ec{constructor(e,t,r){super(e,r),Z(this,ed,void 0),et(ed,this,t)}clone(){return new e([...this.operations],er(ed,this),this.trxId)}commit(e){if(!er(ed,this))throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return er(ed,this).mutate(this.serialize(),Object.assign({transactionId:this.trxId},eu,e||{}))}patch(e,t){let r="function"==typeof t,i="string"!=typeof e&&e instanceof eo,n="object"==typeof e&&("query"in e||"id"in e);if(i)return this._add({patch:e.serialize()});if(r){let r=t(new eo(e,{},er(ed,this)));if(!(r instanceof eo))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(n){let r=new eo(e,t||{},er(ed,this));return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}},eh=new WeakMap,ep=class e extends ec{constructor(e,t,r){super(e,r),Z(this,eh,void 0),et(eh,this,t)}clone(){return new e([...this.operations],er(eh,this),this.trxId)}commit(e){if(!er(eh,this))throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return er(eh,this).mutate(this.serialize(),Object.assign({transactionId:this.trxId},eu,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof es)return this._add({patch:e.serialize()});if(r){let r=t(new es(e,{},er(eh,this)));if(!(r instanceof es))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}};
9let ef=["headers","signal","tag","timeout","token"],eg=({query:e,params:t={},options:r={}})=>{let i=new URLSearchParams,{tag:n,includeMutations:s,returnQuery:a,...o}=r;for(let[r,s]of(n&&i.append("tag",n),i.append("query",e),Object.entries(t)))void 0!==s&&i.append(`$${r}`,JSON.stringify(s));for(let[e,t]of Object.entries(o))t&&i.append(e,`${t}`);return!1===a&&i.append("returnQuery","false"),!1===s&&i.append("includeMutations","false"),`?${i}`};function ey(t,r,i,n,a={},o={}){let{stega:u,params:c,mapResponse:d,reqOpts:l}=function(e,t,r){let i="stega"in r?{...e,..."boolean"==typeof r.stega?{enabled:r.stega}:r.stega||{}}:e,n=i.enabled?(0,s.t)(t):t,a=!1===r.filterResponse?e=>e:e=>e.result,{cache:o,next:u,...c}={useAbortSignal:void 0!==r.signal,resultSourceMap:i.enabled?"withKeyArraySelector":r.resultSourceMap,...r,returnQuery:!1===r.filterResponse&&!1!==r.returnQuery};return{stega:i,params:n,mapResponse:a,reqOpts:void 0!==o||void 0!==u?{...c,fetch:{cache:o,next:u}}:c}}(i,a,o),h=e_(t,r,"query",{query:n,params:c},l);return u.enabled?Promise.all([h,e.A(743945).then(e=>e.n)]).then(([e,{stegaEncodeSourceMap:t}])=>{let r=t(e.result,e.resultSourceMap,u);return d({...e,result:r})}):h.then(d)}function em(e,t,r,i={}){return eL(i.signal,n=>eF(e,t,ew(e,r,{...i,signal:n})).then(e=>eb(e,i.includeAllVersions)))}function ev(e,t,r,i={}){return eF(e,t,ew(e,r,i)).then(e=>eb(e,i.includeAllVersions))}function ew(e,t,r){let i=t;if(r.releaseId){let e=(0,$.getVersionFromId)(t);if(e){if(e!==r.releaseId)throw Error(`The document ID (\`${t}\`) is already a version of \`${e}\` release, but this does not match the provided \`options.releaseId\` (\`${r.releaseId}\`)`)}else{if((0,k.isDraftId)(t))throw Error(`The document ID (\`${t}\`) is a draft, but \`options.releaseId\` is set as \`${r.releaseId}\``);i=(0,_.getVersionId)(t,r.releaseId)}}return{url:ez(e,"doc",i),tag:r.tag,signal:r.signal,query:void 0===r.includeAllVersions?void 0:{includeAllVersions:r.includeAllVersions}}}function eb(e,t){let r=e.documents;return r?t?r:r[0]:t?[]:void 0}function eE(e,t,r,i={}){var n,s,a;return eF(e,t,(n=e,s=r,a=i,{url:ez(n,"doc",s.join(",")),tag:a.tag,signal:a.signal})).then(e=>{var t,i;let n,s,a;return t=e,i=r,a=(n=t.documents||[],s=e=>e._id,n.reduce((e,t)=>(e[s(t)]=t,e),Object.create(null))),i.map(e=>a[e]||null)})}async function eM(e,t,r,i={}){let n=new Set;if(0===r.length)return n;for(let s=0;s<r.length;s+=100){let a=r.slice(s,s+100),o=await eF(e,t,{url:ez(e,"doc",a.map(encodeURIComponent).join(",")),tag:i.tag,signal:i.signal,query:{excludeContent:!0}}),u=new Set;for(let e of o.omitted||[])"existence"===e.reason&&u.add(e.id);for(let e of a)u.has(e)||n.add(e)}return n}function eI(e,t,r,i={}){return e_(e,t,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},i)}function e$(e,t,r,i){return eL(i?.signal,n=>eC(e,t,r,{...i,signal:n}))}function e_(e,t,r,i,n={}){let{reqOptions:s,isMutation:a,returnFirst:o}=function(e,t,r,i={}){let n="mutate"===t,s="actions"===t,a="query"===t,o=n||s?"":eg(r),u=!n&&!s&&o.length<11264,c=u?o:"",d=i.returnFirst,{timeout:l,token:h,tag:p,headers:f,returnQuery:g,lastLiveEventId:y,cacheMode:m}=i;return{reqOptions:{method:u?"GET":"POST",url:ez(e,t,c),body:u?void 0:r,query:n&&((e={})=>{let t;return{dryRun:e.dryRun,returnIds:!0,returnDocuments:(t=e.returnDocuments,!1===t?void 0:void 0===t||t),visibility:e.visibility||"sync",autoGenerateArrayKeys:e.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:e.skipCrossDatasetReferenceValidation}})(i),timeout:l,headers:f,token:h,tag:p,returnQuery:g,perspective:i.perspective,variant:i.variant,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(y)?y[0]:y,cacheMode:m,canUseCdn:a,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn},isMutation:n,returnFirst:d}}(e,r,i,n);return eF(e,t,s).then(e=>(function(e,t,r,i){if(!t)return e;let n=e.results||[];if(i)return r?n[0]&&n[0].document:n.map(e=>e.document);let s=r?n[0]&&n[0].id:n.map(e=>e.id);return{transactionId:e.transactionId,results:n,[r?"documentId":"documentIds"]:s}})(e,a,o,n.returnDocuments))}function ek(e,t,r,i,n={}){return e_(e,t,"mutate",{mutations:[{[i]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},n))}function eC(e,t,r,i){return e_(e,t,"actions",{actions:Array.isArray(r)?r:[r],transactionId:i&&i.transactionId||void 0,skipCrossDatasetReferenceValidation:i&&i.skipCrossDatasetReferenceValidation||void 0,dryRun:i&&i.dryRun||void 0},i)}
9function eT(e,t,r,i){let n;return e_(e,t,"mutate",{mutations:Array.isArray(n=r instanceof eo||r instanceof es?{patch:r.serialize()}:r instanceof el||r instanceof ep?r.serialize():r)?n:[n],transactionId:i&&i.transactionId||void 0},i)}function eA(e,t,r,i){return e_(e,t,"mutate",{mutations:[{delete:Y(r)}]},i)}function eO(e,t,r,i){return(0,n.f)("createIfNotExists",r),ek(e,t,r,"createIfNotExists",i)}function ex(e,t,r,i){return(0,n.f)("createOrReplace",r),ek(e,t,r,"createOrReplace",i)}function eS(e,t,r,i,s){return(0,n.f)("createVersion",r),(0,n.p)("createVersion",r),(0,n.a)(),eC(e,t,{actionType:"sanity.action.document.version.create",publishedId:i,document:r},s)}function eP(e,t,r,i,s,a,o){if(!i)throw Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw Error("`createVersion()` requires `publishedId` when `baseId` is provided");return(0,n._)("createVersion",i),(0,n._)("createVersion",r),eC(e,t,{actionType:"sanity.action.document.version.create",publishedId:r,baseId:i,versionId:s?(0,_.getVersionId)(r,s):(0,M.getDraftId)(r),ifBaseRevisionId:a},o)}function ej(e,t,r,i=!1,n){return eC(e,t,{actionType:"sanity.action.document.version.discard",versionId:r,purge:i},n)}function eD(e,t,r,i){return(0,n.f)("replaceVersion",r),(0,n.p)("replaceVersion",r),eC(e,t,{actionType:"sanity.action.document.version.replace",document:r},i)}function eR(e,t,r,i,n){return eC(e,t,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:i},n)}let eq=e=>{let t=e.config();return void 0!==t.dataset&&void 0!==t.projectId||void 0!==t.resource},eU=(e,t)=>eq(e)&&t.startsWith(ez(e,"query"));function eV(e,t){void 0!==t.uri&&(0,n.o)();let r=t.uri||t.url;if("string"!=typeof r)throw TypeError("Request options must include a `url`");let i=e.config(),s=void 0===t.canUseCdn?["GET","HEAD"].indexOf(t.method||"GET")>=0&&(r.startsWith("/data/")||eU(e,r)||eq(e)&&r.startsWith(ez(e,"mutate"))||eq(e)&&r.startsWith(ez(e,"doc",""))||eq(e)&&r.startsWith(ez(e,"listen"))||eq(e)&&r.startsWith(ez(e,"history",""))):t.canUseCdn,a=(t.useCdn??i.useCdn)&&s,o=t.tag&&i.requestTagPrefix?[i.requestTagPrefix,t.tag].join("."):t.tag||i.requestTagPrefix;if(o&&null!==t.tag&&(t.query={tag:(0,n.d)(o),...t.query}),["GET","HEAD","POST"].indexOf(t.method||"GET")>=0&&eU(e,r)){let e=t.resultSourceMap??i.resultSourceMap;void 0!==e&&!1!==e&&(t.query={resultSourceMap:e,...t.query});let r=t.perspective||i.perspective;void 0!==r&&("previewDrafts"===r&&(0,n.c)(),(0,n.r)(r),t.query={perspective:Array.isArray(r)?r.join(","):r,...t.query},(Array.isArray(r)&&r.length>0||"previewDrafts"===r||"drafts"===r)&&a&&(a=!1,(0,n.i)()));let s=t.variant||i.variant;"string"==typeof s&&(t.query={variant:s,...t.query}),"object"==typeof s&&(t.query={variantCondition:Object.entries(s).map(([e,t])=>`${e}:${t}`).toSorted(),...t.query}),t.lastLiveEventId&&(t.query={...t.query,lastLiveEventId:t.lastLiveEventId}),!1===t.returnQuery&&(t.query={returnQuery:"false",...t.query}),a&&"noStale"==t.cacheMode&&(t.query={cacheMode:"noStale",...t.query})}return function(e,t={}){let r={};e.headers&&Object.assign(r,e.headers);let i=t.token||e.token;i&&(r.Authorization=`Bearer ${i}`),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let n={url:t.url,headers:Object.assign(r,t.headers||{})};t.method&&(n.method=t.method),void 0!==t.body&&(n.body=t.body),t.query&&(n.query=function(e){if(e instanceof URLSearchParams||!e||"object"!=typeof e||!Object.values(e).some(Array.isArray))return e;let t=new URLSearchParams;for(let[r,i]of Object.entries(e))if(null!=i)if(Array.isArray(i))for(let e of i)null!=e&&t.append(r,`${e}`);else t.append(r,`${i}`);return t}(t.query)),t.signal&&(n.signal=t.signal),(void 0===t.withCredentials?e.withCredentials:t.withCredentials)&&(n.credentials="include"),"number"==typeof t.maxRedirects&&(n.redirect=0===t.maxRedirects?"manual":"follow");let s=void 0===t.timeout?e.timeout:t.timeout;n.timeout=void 0===s?3e5:0!==s&&s,!1!==t.useAbortSignal||n.signal||(n.timeout="number"==typeof n.timeout&&n.timeout>0&&{total:n.timeout,signal:!1});let a="object"==typeof t.fetch&&"object"==typeof e.fetch?{...e.fetch,...t.fetch}:t.fetch||e.fetch;return"function"==typeof a?n.fetch=a:"object"==typeof a&&a&&(n.meta={...n.meta,fetchInit:a}),!n.fetch&&e.resolveFetch&&(n.fetch=e.resolveFetch("string"==typeof e.proxy?e.proxy:void 0)),"number"==typeof t.maxRetries&&(n.maxRetries=t.maxRetries),"string"==typeof e.lineage&&e.lineage&&(n.meta={...n.meta,lineage:e.lineage}),n}(i,Object.assign({},t,{url:eN(e,r,a)}))}function eL(e,t){return new o.Observable(r=>{let i=new AbortController;return t(e?(0,a.anySignal)([e,i.signal]):i.signal).then(e=>{r.next(e),r.complete()},e=>r.error(e)),()=>i.abort()})}function eF(e,t,r){return t(eV(e,r),e.config().requestHandler).then(e=>e)}function eW(e,t,r){return eL(r.signal,i=>eF(e,t,{...r,signal:i}))}function ez(e,t,r){let i=e.config();if(i.resource)return(0,n.m)(i),`${eB(i)}/${void 0===r?t:`${t}/${r}`}`.replace(/\/($|\?)/,"$1");let s=`/${t}/${(0,n.u)(i)}`;return`/data${void 0===r?s:`${s}/${r}`}`.replace(/\/($|\?)/,"$1")}function eN(e,t,r=!1){let{url:i,cdnUrl:n}=e.config();return`${r?n:i}/${t.replace(/^\//,"")}`}let eB=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:i}=t;switch(r){case"dataset":{let e=i.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/${i}`;case"knowledge-base":return`/knowledge-bases/${i}`;case"media-library":return`/media-libraries/${i}`;case"dashboard":return`/dashboards/${i}`;default:throw Error(`Unsupported resource type: ${r.toString()}`)}};var eH=new WeakMap,eG=new WeakMap,eK=class{constructor(e,t){Z(this,eH,void 0),Z(this,eG,void 0),et(eH,this,e),et(eG,this,t)}generate(e){var t,r;return t=er(eH,this),r=er(eG,this),eW(t,r,{method:"POST",url:`/agent/action/generate/${(0,n.u)(t.config())}`,body:e})}transform(e){var t,r;return t=er(eH,this),r=er(eG,this),eW(t,r,{method:"POST",url:`/agent/action/transform/${(0,n.u)(t.config())}`,body:e})}translate(e){var t,r;return t=er(eH,this),r=er(eG,this),eW(t,r,{method:"POST",url:`/agent/action/translate/${(0,n.u)(t.config())}`,body:e})}},eQ=new WeakMap,eX=new WeakMap,eY=class{constructor(e,t){Z(this,eQ,void 0),Z(this,eX,void 0),et(eQ,this,e),et(eX,this,t)}generate(e){var t,r;return t=er(eQ,this),r=er(eX,this),eF(t,r,{method:"POST",url:`/agent/action/generate/${(0,n.u)(t.config())}`,body:e})}transform(e){var t,r;return t=er(eQ,this),r=er(eX,this),eF(t,r,{method:"POST",url:`/agent/action/transform/${(0,n.u)(t.config())}`,body:e})}translate(e){var t,r;return t=er(eQ,this),r=er(eX,this),eF(t,r,{method:"POST",url:`/agent/action/translate/${(0,n.u)(t.config())}`,body:e})}prompt(e){var t,r;return t=er(eQ,this),r=er(eX,this),eF(t,r,{method:"POST",url:`/agent/action/prompt/${(0,n.u)(t.config())}`,body:e})}patch(e){var t,r;return t=er(eQ,this),r=er(eX,this),eF(t,r,{method:"POST",url:`/agent/action/patch/${(0,n.u)(t.config())}`,body:e})}},eJ=new WeakMap,eZ=new WeakMap,e0=class{constructor(e,t){Z(this,eJ,void 0),Z(this,eZ,void 0),et(eJ,this,e),et(eZ,this,t)}upload(e,t,r){return e3(er(eJ,this),er(eZ,this),e,t,r)}},e1=new WeakMap,e2=new WeakMap,e4=class{constructor(e,t){Z(this,e1,void 0),Z(this,e2,void 0),et(e1,this,e),et(e2,this,t)}upload(e,t,r){let i=e3(er(e1,this),er(e2,this),e,t,r);return(0,p.lastValueFrom)(i.pipe((0,T.filter)(e=>
9"response"===e.type),(0,f.map)(e=>{var t;return"asset"in(t=e.body)?t.asset:t.document})))}};function e3(t,r,i,s,a={}){var u,c,l;let h,p,g;(0,n.g)(i);let y=a.extract||void 0;y&&!y.length&&(y=["none"]);let m=t.config(),v=(u=a,c=s,!(typeof File>"u")&&c instanceof File?Object.assign({filename:!1===u.preserveFilename?void 0:c.name,contentType:c.type},u):u),{tag:w,label:b,title:E,description:M,creditLine:I,filename:$,source:_}=v,k=m.resource?.type==="media-library",C=k?{title:E,filename:$}:{label:b,title:E,description:M,filename:$,meta:y,creditLine:I};_&&!k&&(C.sourceId=_.id,C.sourceName=_.name,C.sourceUrl=_.url);let O=v.contentType?{"Content-Type":v.contentType}:{},x={tag:w,method:"POST",timeout:v.timeout||0,url:function(e,t){let r="image"===t?"images":"files",i=e.resource;if(i){let{type:e,id:t}=i;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"knowledge-base":throw Error("Assets are not supported for knowledge-base resources. Use `client.context.imports` to add content instead.");case"media-library":return`/media-libraries/${t}/upload`;case"dashboard":return`/dashboards/${t}/assets/${r}`;default:throw Error(`Unsupported resource type: ${e.toString()}`)}}return`assets/${r}/${(0,n.u)(e)}`}(m,i),headers:O,query:C,body:s};return"u">typeof XMLHttpRequest?(0,d.defer)(async()=>{let{uploadWithProgress:r}=await e.A(705633),i=eV(t,{...x});return r({url:function(e,t){if(!t)return e;let r=(t instanceof URLSearchParams?t:new URLSearchParams(Object.entries(t).flatMap(([e,t])=>null==t?[]:[[e,`${t}`]]))).toString();return r?e+(e.includes("?")?"&":"?")+r:e}(i.url,i.query),method:i.method??"POST",headers:i.headers,body:s,withCredentials:"include"===i.credentials,timeout:"object"==typeof i.timeout?i.timeout.total:i.timeout,signal:i.signal})}).pipe((0,A.mergeAll)()):(h=eV(t,x),p=t.config().requester,g=new o.Observable(e=>p(h).subscribe(e)).pipe((0,T.filter)(e=>e?.type==="progress"||e?.type==="response"),(0,f.map)(e=>"progress"===e.type?{type:"progress",stage:e.stage,percent:e.percent,total:e.total,loaded:e.loaded,lengthComputable:e.lengthComputable}:{type:"response",body:e.body})),x.signal?g.pipe((l=x.signal,e=>new o.Observable(t=>{let r=()=>{var e;return t.error((e=l,new DOMException(e?.reason??"The operation was aborted.","AbortError")))};if(l&&l.aborted)return void r();let i=e.subscribe(t);return l.addEventListener("abort",r),()=>{l.removeEventListener("abort",r),i.unsubscribe()}}))):g)}var e6=(e,t)=>Object.keys(t).concat(Object.keys(e)).reduce((r,i)=>(r[i]=void 0===e[i]?t[i]:e[i],r),{});let e9=(e,t)=>t.reduce((t,r)=>(void 0===e[r]||(t[r]=e[r]),t),{}),e8=new Set([408,429]);function e5(){return function(e){return e.pipe((0,u.catchError)((e,t)=>e instanceof z&&("number"!=typeof e.status||e.status<400||e.status>=500||e8.has(e.status))?(0,c.concat)((0,m.of)({type:"reconnect"}),(0,E.timer)(1e3).pipe((0,y.mergeMap)(()=>t))):(0,b.throwError)(()=>e)))}}function e7(e,t={}){let r=t.headers,i=t.withCredentials?"include":void 0;return function(t,n){let s=te(e),a={...n};if(r){let e=new Headers(n?.headers);for(let[t,i]of Object.entries(r))e.set(t,i);a.headers=e}return void 0!==i&&(a.credentials=i),s("string"==typeof t?t:t.href,a)}}function te(e){return e.resolveFetch?e.resolveFetch("string"==typeof e.proxy?e.proxy:void 0):globalThis.fetch.bind(globalThis)}let tt=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],tr={includeResult:!0};function ti(e,t,r={}){let{url:i,requestTagPrefix:n}=this.config(),s=r.tag&&n?[n,r.tag].join("."):r.tag,a={...e6(r,tr),tag:s},o=eg({query:e,params:t,options:{tag:s,...e9(a,tt)}}),u=`${i}${ez(this,"listen",o)}`;return u.length>14800?(0,b.throwError)(()=>Error("Query too large for listener")):tn(this,u,a.events?a.events:["mutation"])}function tn(e,t,r){let i=e.config(),{token:n,withCredentials:s,headers:a}=i,o={};return n&&(o.Authorization=`Bearer ${n}`),a&&Object.assign(o,a),Q(()=>new L(t,{fetch:e7(i,{headers:Object.keys(o).length?o:void 0,withCredentials:s})}),r).pipe(e5(),(0,T.filter)(e=>
9r.includes(e.type)),(0,f.map)(e=>({type:e.type,..."data"in e?e.data:{}})))}let ts=["headers","signal","tag","timeout","token"];function ta(e){if(!e)throw Error("Comment ID must be provided");return`/collaboration/comments/${encodeURIComponent(e)}`}function to(e){let{resource:t,projectId:r,dataset:i}=e.config();if(t)return t;if(r&&i)return{type:"dataset",id:`${r}.${i}`};throw Error("`resource` or `projectId` and `dataset` must be configured to use collaboration comments")}function tu(e){let{collaboration:t}=e.config(),r=t?.organizationId;if(!r)throw Error("`collaboration.organizationId` must be configured to use collaboration comments");let i=to(e);return{organizationId:r,resourceId:i.id,resourceType:i.type}}function tc(e,t){if(!t)throw Error("Document ID must be provided");let r=to(e);return`${r.type}:${r.id}:${(0,I.getPublishedId)(t)}`}function td(e,t,r,i,n,s={}){return eW(e,t,{method:r,url:i,body:n,query:{...tu(e),...s.transactionId?{transactionId:s.transactionId}:{}},...e9(s,ts)})}function tl(e,...t){return td(...t).pipe((0,f.map)(({results:t})=>{let r=e?t.find(({id:t})=>t===e):t[0];if(!r?.document)throw Error("Comment write did not return a comment document");return r.document}))}function th(e,t,r,i){return tl(r._id,e,t,"POST","/collaboration/comments",r,i)}function tp(e,t,r,i,n){return tl(r,e,t,"PATCH",ta(r),i,n)}function tf(e,t,r,i){return function(...e){return td(...e).pipe((0,f.map)(({transactionId:e,results:t})=>({transactionId:e,documentIds:t.map(e=>e.id),results:t})))}(e,t,"DELETE",ta(r),void 0,i)}function tg(e,t,r,i,n){return tl(r,e,t,"POST",`${ta(r)}/reactions`,{shortName:i},n)}function ty(e,t,r,i,n){return tl(r,e,t,"DELETE",`${ta(r)}/reactions/${encodeURIComponent(i)}`,void 0,n)}function tm(e,t,r,i,n){let s=tu(e);return eW(e,t,{...eg({query:r,params:i}).length<11264?{method:"GET",url:`/collaboration/comments/query${eg({query:r,params:i,options:s})}`}:{method:"POST",url:"/collaboration/comments/query",query:s,body:{query:r,params:i??{}}},...e9(n||{},ts)}).pipe((0,f.map)(e=>e.result))}function tv(e,t,r,i){let n=i??{},{requestTagPrefix:s}=e.config(),a=n.tag&&s?[s,n.tag].join("."):n.tag,o=eg({query:t,params:r,options:{...e9({...e6(n,tr),tag:a},tt),...tu(e)}}),u=`${e.getUrl("/collaboration/comments/listen")}${o}`;return u.length>14800?(0,b.throwError)(()=>Error("Query too large for listener")):tn(e,u,n.events?n.events:["mutation"])}var tw=new WeakMap,tb=new WeakMap,tE=class{constructor(e,t){Z(this,tw,void 0),Z(this,tb,void 0),et(tw,this,e),et(tb,this,t)}create(e,t){return th(er(tw,this),er(tb,this),e,t)}update(e,t,r){return tp(er(tw,this),er(tb,this),e,t,r)}delete(e,t){return tf(er(tw,this),er(tb,this),e,t)}addReaction(e,t,r){return tg(er(tw,this),er(tb,this),e,t,r)}removeReaction(e,t,r){return ty(er(tw,this),er(tb,this),e,t,r)}getTargetDocumentRef(e){return tc(er(tw,this),e)}fetch(e,t,r){return tm(er(tw,this),er(tb,this),e,t,r)}listen(e,t,r){return tv(er(tw,this),e,t,r)}},tM=new WeakMap,tI=new WeakMap,t$=class{constructor(e,t){Z(this,tM,void 0),Z(this,tI,void 0),et(tM,this,e),et(tI,this,t)}create(e,t){return(0,p.lastValueFrom)(th(er(tM,this),er(tI,this),e,t))}update(e,t,r){return(0,p.lastValueFrom)(tp(er(tM,this),er(tI,this),e,t,r))}delete(e,t){return(0,p.lastValueFrom)(tf(er(tM,this),er(tI,this),e,t))}addReaction(e,t,r){return(0,p.lastValueFrom)(tg(er(tM,this),er(tI,this),e,t,r))}removeReaction(e,t,r){return(0,p.lastValueFrom)(ty(er(tM,this),er(tI,this),e,t,r))}getTargetDocumentRef(e){return tc(er(tM,this),e)}fetch(e,t,r){return(0,p.lastValueFrom)(tm(er(tM,this),er(tI,this),e,t,r))}listen(e,t,r){return tv(er(tM,this),e,t,r)}};function t_(e){let t=e.config().context?.organizationId;if(!t)throw Error("`context.organizationId` must be configured to query Context documents");return t}function tk(e,t){return`/context/organizations/${encodeURIComponent(t_(e))}/${t}`}function tC(e,t,r,i,n){let s=tk(e,"query");return eW(e,t,{...eg({query:r,params:i}).length<11264?{method:"GET",url:`${s}${eg({query:r,params:i})}`}:{method:"POST",url:s,body:{query:r,params:i??{}}},...e9(n||{},ef)}).pipe((0,f.map)(e=>e.result))}
9function tT(e,t,r,i){let n=i??{},{requestTagPrefix:s}=e.config(),a=n.tag&&s?[s,n.tag].join("."):n.tag,o=eg({query:t,params:r,options:e9({...e6(n,tr),tag:a},tt)}),u=`${e.getUrl(tk(e,"listen"))}${o}`;return u.length>14800?(0,b.throwError)(()=>Error("Query too large for listener")):tn(e,u,n.events?n.events:["mutation"])}let tA="sanity.context.entry",tO="sanity.context.issue",tx="sanity.context.mcp";function tS(e,t,r,i,n){return(0,p.lastValueFrom)(tC(e,t,r,i,n))}async function tP(e,t,r,i,n){let s=[],a;for(;;){let o=`*[${a?`${r} && (_createdAt > $c || (_createdAt == $c && _id > $i))`:r}] | order(_createdAt asc, _id asc) [0...200]`,u=await (0,p.lastValueFrom)(tC(e,t,o,a?{...i,...a}:i,n));if(s.push(...u),u.length<200)return s;let c=u[u.length-1];a={c:c._createdAt,i:c._id}}}function tj(e,t,r,i,n){return tS(e,t,`*[_type == "${tA}" && knowledgeBaseId == $kb && path == $path][0]`,{kb:r,path:i},n)}async function tD(e,t,r,i){let n=[],s="";for(;;){let a=await (0,p.lastValueFrom)(tC(e,t,`*[_type == "${tA}" && knowledgeBaseId == $kb && path > $after] | order(path asc) [0...200] {_id, path, title, tldr, status}`,{kb:r,after:s},i));if(n.push(...a),a.length<200)return n;s=a[a.length-1].path}}function tR(e,t,r,i,n){return tP(e,t,`_type == "${tO}" && knowledgeBaseId == $kb${void 0===i?"":" && status == $status"}`,void 0===i?{kb:r}:{kb:r,status:i},n)}function tq(e,t,r,i,n){return tS(e,t,`*[_type == "${tO}" && knowledgeBaseId == $kb && _id == $id][0]`,{kb:r,id:i},n)}function tU(e,t,r,i){return tP(e,t,'_type == "sanity.context.instruction" && knowledgeBaseId == $kb && schemaVersion == 1',{kb:r},i)}function tV(e,t,r){return(0,p.lastValueFrom)(tC(e,t,`*[_type == "${tx}" && organizationId == $org] | order(_createdAt asc, _id asc) [0...500]`,{org:t_(e)},r))}function tL(e,t,r,i){return tS(e,t,`*[_type == "${tx}" && organizationId == $org && name == $name][0]`,{org:t_(e),name:r},i)}function tF(e,t,r,i){return tS(e,t,'*[_type == "sanity.context.conversation" && organizationId == $org && threadId == $threadId][0]',{org:t_(e),threadId:r},i)}let tW="/context/knowledge-bases";function tz(e){let t=e.config().resource;if(t?.type!=="knowledge-base")throw Error("`resource` of type `knowledge-base` must be configured to use knowledge-base methods");return t.id}function tN(e,t=""){return`${tW}/${encodeURIComponent(e)}${t}`}function tB(e,t){let r=e.config().context?.organizationId;if(!r)throw Error("`context.organizationId` must be configured to record conversations");if(!t)throw Error("`threadId` must be provided");return`/context/organizations/${encodeURIComponent(r)}/conversations/${encodeURIComponent(t)}`}function tH(e){return Object.fromEntries(Object.entries(e).flatMap(([e,t])=>void 0===t?[]:[[e,`${t}`]]))}var tG=new WeakMap,tK=new WeakMap,tQ=new WeakSet,tX=class{constructor(e,t){(function(e,t){J(e,t),t.add(e)})(this,tQ),Z(this,tG,void 0),Z(this,tK,void 0),(0,r.u)(this,"knowledgeBases",{create:(e,t)=>eF(er(tG,this),er(tK,this),{url:tW,method:"POST",body:e,...t}),list:e=>eF(er(tG,this),er(tK,this),{url:tW,query:tH({organizationId:e.organizationId,cursor:e.cursor,limit:e.limit}),signal:e.signal,tag:e.tag}),get:(e,t)=>eF(er(tG,this),er(tK,this),{url:tN(e),...t}),edit:(e,t,r)=>eF(er(tG,this),er(tK,this),{url:tN(e),method:"PATCH",body:t,...r}),delete:async(e,t)=>{await eF(er(tG,this),er(tK,this),{url:tN(e),method:"DELETE",...t})}}),(0,r.u)(this,"conversations",{save:(e,t)=>{let{threadId:r,...i}=e;return eF(er(tG,this),er(tK,this),{url:tB(er(tG,this),r),method:"PUT",body:i,...t})},classify:(e,t)=>{let{threadId:r,...i}=e;return eF(er(tG,this),er(tK,this),{url:tB(er(tG,this),r),method:"PATCH",body:i,...t})},get:(e,t)=>tF(er(tG,this),er(tK,this),e.threadId,t)}),(0,r.u)(this,"imports",{create:(e,t)=>"file"===e.type?ee(tQ,this,tZ).call(this,e,t):ee(tQ,this,tY).call(this,"/imports",{method:"POST",body:e,...t}),list:e=>ee(tQ,this,tJ).call(this,"/imports",e),get:(e,t)=>ee(tQ,this,tY).call(this,`/imports/${encodeURIComponent(e.importId)}`,t),download:(e,t)=>ee(tQ,this,tY).call(this,`/imports/${encodeURIComponent(e.importId)}/download`,t),delete:async(e,t)=>{await ee(tQ,this,tY).call(this,`/imports/${encodeURIComponent(e.importId)}`,{method:"DELETE",...t})}}),(0,r.u)(this,"jobs",{get:(e,t)=>ee(tQ,this,tY).call(this,`/jobs/${encodeURIComponent(e.jobId)}`,t)}),(0,r.u)(this,"issues",{list:(e,t)=>
9tR(er(tG,this),er(tK,this),tz(er(tG,this)),e?.status,t),get:(e,t)=>tq(er(tG,this),er(tK,this),tz(er(tG,this)),e.issueId,t),resolve:(e,t)=>{let{issueId:r,...i}=e;return ee(tQ,this,tY).call(this,`/issues/${encodeURIComponent(r)}/resolve`,{method:"POST",body:i,...t})},dismiss:(e,t)=>ee(tQ,this,tY).call(this,`/issues/${encodeURIComponent(e.issueId)}/dismiss`,{method:"POST",...t}),reopen:(e,t)=>ee(tQ,this,tY).call(this,`/issues/${encodeURIComponent(e.issueId)}/reopen`,{method:"POST",...t}),apply:(e,t)=>ee(tQ,this,tY).call(this,"/issues/apply",{method:"POST",body:e,...t})}),(0,r.u)(this,"instructions",{create:(e,t)=>ee(tQ,this,tY).call(this,"/instructions",{method:"POST",body:e,...t}),list:e=>tU(er(tG,this),er(tK,this),tz(er(tG,this)),e),edit:(e,t)=>{let{instructionId:r,...i}=e;return ee(tQ,this,tY).call(this,`/instructions/${encodeURIComponent(r)}`,{method:"PATCH",body:i,...t})},delete:async(e,t)=>{await ee(tQ,this,tY).call(this,`/instructions/${encodeURIComponent(e.instructionId)}`,{method:"DELETE",...t})}}),(0,r.u)(this,"entries",{list:e=>tD(er(tG,this),er(tK,this),tz(er(tG,this)),e),get:(e,t)=>tj(er(tG,this),er(tK,this),tz(er(tG,this)),e.path,t),rebuild:(e,t)=>ee(tQ,this,tY).call(this,`/entries/${encodeURIComponent(e.path)}/rebuild`,{method:"POST",...t})}),(0,r.u)(this,"mcpEndpoints",{list:e=>tV(er(tG,this),er(tK,this),e),get:(e,t)=>tL(er(tG,this),er(tK,this),e.name,t)}),(0,r.u)(this,"sources",{list:e=>ee(tQ,this,tJ).call(this,"/sources",e,{status:e?.status,importId:e?.importId,ids:e?.ids?.join(",")}),get:(e,t)=>ee(tQ,this,tY).call(this,`/sources/${encodeURIComponent(e.sourceId)}`,t),content:(e,t)=>ee(tQ,this,tY).call(this,`/sources/${encodeURIComponent(e.sourceId)}/content`,{query:tH({startLine:e.startLine,endLine:e.endLine}),...t}),delete:async(e,t)=>{await ee(tQ,this,tY).call(this,`/sources/${encodeURIComponent(e.sourceId)}`,{method:"DELETE",...t})}}),et(tG,this,e),et(tK,this,t)}fetch(e,t,r){return(0,p.lastValueFrom)(tC(er(tG,this),er(tK,this),e,t,r))}listen(e,t,r){return tT(er(tG,this),e,t,r)}build(e){return ee(tQ,this,tY).call(this,"/build",{method:"POST",...e})}cancelBuild(e){return ee(tQ,this,tY).call(this,"/build/cancel",{method:"POST",...e})}refresh(e){return ee(tQ,this,tY).call(this,"/refresh",{method:"POST",...e})}};function tY(e,t={}){return eF(er(tG,this),er(tK,this),{url:tN(tz(er(tG,this)),e),...t})}function tJ(e,t,r){return ee(tQ,this,tY).call(this,e,{query:tH({cursor:t?.cursor,limit:t?.limit,...r}),signal:t?.signal,tag:t?.tag})}async function tZ(e,t){var r;let i=await ee(tQ,this,tY).call(this,"/imports/uploads",{method:"POST",body:{filename:e.filename,...e.contentType&&{contentType:e.contentType}},...t}),n=er(tG,this).config(),s=await (n.resolveFetch?.(n.proxy)??globalThis.fetch)(i.uploadUrl,{method:"PUT",body:ArrayBuffer.isView(r=e.file)?r.buffer instanceof ArrayBuffer?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):Uint8Array.from(r):r,...e.contentType&&{headers:{"content-type":e.contentType}},signal:t?.signal});if(!s.ok)throw Error(`File upload failed: ${s.status} ${s.statusText}`);return ee(tQ,this,tY).call(this,`/imports/uploads/${encodeURIComponent(i.importId)}/complete`,{method:"POST",body:{},...t})}var t0=new WeakMap,t1=new WeakMap,t2=class{constructor(e,t){Z(this,t0,void 0),Z(this,t1,void 0),(0,r.u)(this,"knowledgeBases",{create:(e,t)=>eL(t?.signal,r=>eF(er(t0,this),er(t1,this),{url:tW,method:"POST",body:e,tag:t?.tag,signal:r})),list:e=>eL(e.signal,t=>eF(er(t0,this),er(t1,this),{url:tW,query:tH({organizationId:e.organizationId,cursor:e.cursor,limit:e.limit}),tag:e.tag,signal:t})),get:(e,t)=>eL(t?.signal,r=>eF(er(t0,this),er(t1,this),{url:tN(e),tag:t?.tag,signal:r})),edit:(e,t,r)=>eL(r?.signal,i=>eF(er(t0,this),er(t1,this),{url:tN(e),method:"PATCH",body:t,tag:r?.tag,signal:i})),delete:(e,t)=>eL(t?.signal,r=>eF(er(t0,this),er(t1,this),{url:tN(e),method:"DELETE",tag:t?.tag,signal:r}))}),(0,r.u)(this,"conversations",{save:(e,t)=>{let{threadId:r,...i}=e;return eL(t?.signal,e=>eF(er(t0,this),er(t1,this),{url:tB(er(t0,this),r),method:"PUT",body:i,tag:t?.tag,signal:e}))},classify:(e,t)=>{let{threadId:r,...i}=e;return eL(t?.signal,e=>eF(er(t0,this),er(t1,this),{url:tB(er(t0,this),r),method:"PATCH",body:i,tag:t?.tag,signal:e}))},get:(e,t)=>eL(t?.signal,r=>tF(er(t0,this),er(t1,this),e.threadId,{...t,signal:r}))}),(0,r.u)(this,"entries",{list:e=>eL(e?.signal,t=>tD(er(t0,this),er(t1,this),tz(er(t0,this)),{...e,signal:t})),get:(e,t)=>eL(t?.signal,r=>tj(er(t0,this),er(t1,this),tz(er(t0,this)),e.path,{...t,signal:r})),rebuild:(e,t)=>eL(t?.signal,r=>eF(er(t0,this),er(t1,this),{url:tN(tz(er(t0,this)),`/entries/${encodeURIComponent(e.path)}/rebuild`),method:"POST",tag:t?.tag,signal:r}))}),(0,r.u)(this,"issues",{list:(e,t)=>
9eL(t?.signal,r=>tR(er(t0,this),er(t1,this),tz(er(t0,this)),e?.status,{...t,signal:r})),get:(e,t)=>eL(t?.signal,r=>tq(er(t0,this),er(t1,this),tz(er(t0,this)),e.issueId,{...t,signal:r}))}),(0,r.u)(this,"instructions",{list:e=>eL(e?.signal,t=>tU(er(t0,this),er(t1,this),tz(er(t0,this)),{...e,signal:t}))}),(0,r.u)(this,"mcpEndpoints",{list:e=>eL(e?.signal,t=>tV(er(t0,this),er(t1,this),{...e,signal:t})),get:(e,t)=>eL(t?.signal,r=>tL(er(t0,this),er(t1,this),e.name,{...t,signal:r}))}),et(t0,this,e),et(t1,this,t)}fetch(e,t,r){return tC(er(t0,this),er(t1,this),e,t,r)}listen(e,t,r){return tT(er(t0,this),e,t,r)}};let t4="2021-03-25";var t3=new WeakMap,t6=class{constructor(e){Z(this,t3,void 0),et(t3,this,e)}events({includeDrafts:e=!1,tag:t,waitFor:n}={}){var s,a,c,d,h,p;let E=er(t3,this).config(),{projectId:M,apiVersion:I,token:$,withCredentials:_,requestTagPrefix:k,headers:C}=E,T=I.replace(/^v/,"");if("X"!==T&&T<t4)throw Error(`The live events API requires API version ${t4} or later. The current API version is ${T}. Please update your API version to use this feature.`);if(e&&!$&&!_)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 A=ez(er(t3,this),"live/events"),O=new URL(er(t3,this).getUrl(A,!1)),x=t&&k?[k,t].join("."):t;x&&O.searchParams.set("tag",x),e&&O.searchParams.set("includeDrafts","true"),n&&O.searchParams.set("waitFor",n);let S={};e&&$&&(S.Authorization=`Bearer ${$}`),C&&Object.assign(S,C);let P=!!(e&&_),j=t9.get(E.resolveFetch);j||(j=new Map,t9.set(E.resolveFetch,j));let D=JSON.stringify([O.href,"string"==typeof E.proxy?E.proxy:null,S,P]),R=j.get(D);if(R)return R;let q=Q(()=>new L(O.href,{fetch:e7(E,{headers:Object.keys(S).length?S:void 0,withCredentials:P})}),["message","restart","welcome","reconnect","goaway"]),U=(a=new URL(er(t3,this).getUrl("/check/cors",!1)),c=M,d=P,h=te(E),new o.Observable(e=>{let t=new AbortController,{signal:n}=t;return h(a.href,{method:"GET",credentials:"omit",signal:n}).then(e=>{if(!(n.aborted||!e.ok))return e.text()}).then(t=>{if(n.aborted)return;let s=void 0===t?void 0:JSON.parse(t),a=(0,i.t)(s)?s.result:void 0;d&&(0,i.t)(a)&&!1===a.withCredentials?e.error(new r.i({projectId:c,credentials:!0})):(0,i.t)(a)&&!1===a.allowed?e.error(new r.i({projectId:c,credentials:d})):(e.next(),e.complete())}).catch(()=>{n.aborted||e.closed||(e.next(),e.complete())}),()=>t.abort()})),V=q.pipe(e5(),(0,y.mergeMap)(e=>"reconnect"===e.type?U.pipe((0,y.mergeMap)(()=>(0,m.of)(e))):(0,m.of)(e)),(0,u.catchError)(e=>e instanceof r.i?(0,b.throwError)(()=>e):U.pipe((0,y.mergeMap)(()=>{throw e}))),(0,f.map)(e=>{if("message"===e.type){let{data:t,...r}=e;return{...r,tags:t.tags}}return e})).pipe((0,l.finalize)(()=>{j.delete(D),0===j.size&&t9.delete(E.resolveFetch)}),(p="function"==typeof(s={predicate:e=>"welcome"===e.type})?{predicate:s,...void 0}:s,e=>{let t,r=!1,{predicate:i,...n}=p,s=e.pipe((0,w.tap)(e=>{p.predicate(e)&&(r=!0,t=e)}),(0,l.finalize)(()=>{r=!1,t=void 0}),(0,v.share)(n)),a=new o.Observable(e=>{r&&e.next(t),e.complete()});return(0,g.merge)(s,a)}));return j.set(D,V),V}};let t9=new Map;var t8=new WeakMap,t5=new WeakMap,t7=class{constructor(e,t){Z(this,t8,void 0),Z(this,t5,void 0),et(t8,this,e),et(t5,this,t)}create(e,t){return rn(er(t8,this),er(t5,this),"PUT",e,t)}edit(e,t){return rn(er(t8,this),er(t5,this),"PATCH",e,t)}delete(e){return rn(er(t8,this),er(t5,this),"DELETE",e)}list(){(0,n.h)("dataset",er(t8,this).config());let e=er(t8,this).config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),eW(er(t8,this),er(t5,this),{url:r,tag:null})}getEmbeddingsSettings(e){return(0,n.h)("dataset",er(t8,this).config()),(0,n.l)(e),eW(er(t8,this),er(t5,this),{url:ri(er(t8,this),e),tag:null})}editEmbeddingsSettings(e,t){return(0,n.h)("dataset",er(t8,this).config()),(0,n.l)(e),eW(er(t8,this),er(t5,this),{method:"PUT",url:ri(er(t8,this),e),body:t,tag:null})}},re=new WeakMap,rt=new WeakMap,rr=class{constructor(e,t){Z(this,re,void 0),Z(this,rt,void 0),et(re,this,e),et(rt,this,t)}create(e,t){return(0,n.h)("dataset",er(re,this).config()),rs(er(re,this),er(rt,this),"PUT",e,t)}edit(e,t){return(0,n.h)("dataset",er(re,this).config()),rs(er(re,this),er(rt,this),"PATCH",e,t)}delete(e){return(0,n.h)("dataset",er(re,this).config()),rs(er(re,this),er(rt,this),"DELET
9E",e)}list(){(0,n.h)("dataset",er(re,this).config());let e=er(re,this).config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),eF(er(re,this),er(rt,this),{url:r,tag:null})}getEmbeddingsSettings(e){return(0,n.h)("dataset",er(re,this).config()),(0,n.l)(e),eF(er(re,this),er(rt,this),{url:ri(er(re,this),e),tag:null})}editEmbeddingsSettings(e,t){return(0,n.h)("dataset",er(re,this).config()),(0,n.l)(e),eF(er(re,this),er(rt,this),{method:"PUT",url:ri(er(re,this),e),body:t,tag:null})}};function ri(e,t){let r=e.config();return!1===r.useProjectHostname?`/projects/${r.projectId}/datasets/${t}/settings/embeddings`:`/datasets/${t}/settings/embeddings`}function rn(e,t,r,i,s){return(0,n.h)("dataset",e.config()),(0,n.l)(i),eW(e,t,{method:r,url:`/datasets/${i}`,body:s,tag:null})}function rs(e,t,r,i,s){return(0,n.h)("dataset",e.config()),(0,n.l)(i),eF(e,t,{method:r,url:`/datasets/${i}`,body:s,tag:null})}let ra=["sanity.function.pubsub"],ro=["sanity.function.durable","sanity.function.pubsub","sanity.function.queue"],ru=[...new Set([...ra,...ro])];function rc(e,t,r,i,n){return(0,d.defer)(()=>{let s=e.config(),a=((e,t)=>{let r=t?.organizationId||e.organizationId;if(r)return{"X-Sanity-Scope-Type":"organization","X-Sanity-Scope-Id":r};let{projectId:i}=e;if(!i)throw Error("`functions.invoke()` requires a `projectId` to be set in the client config, or an `organizationId` for a stack deployed at organization scope");return{"X-Sanity-Scope-Type":"project","X-Sanity-Scope-Id":i}})(s,i),o=((e,t)=>{let r=t?.stackId||e.stackId;if(!r)throw Error("`functions.invoke()` requires a `stackId`, either in the client config or on the request. Function names are only unique within a stack.");return r})(s,i),u=n?.sync??!1;return eW(e,t,{method:"GET",url:`/blueprints/stacks/${o}`,headers:a,signal:i?.signal}).pipe((0,f.map)(e=>{let t=(e?.resources||[]).find(e=>e.type?.startsWith("sanity.function.")&&e.name===r);if(!t)throw Error(`Function "${r}" not found in stack "${o}"`);if(!t.externalId)throw Error(`Function "${r}" is declared in stack "${o}" but is not deployed`);if(!ru.includes(t.type))throw Error(`Function invocation is not supported for ${t.type}`);if(u&&!ra.includes(t.type))throw Error(`Synchronous function invocation is not supported for ${t.type}`);if(!u&&!ro.includes(t.type))throw Error(`Asynchronous function invocation is not supported for ${t.type}`);return t.externalId})).pipe((0,y.mergeMap)(r=>eW(e,t,{method:"POST",url:`/functions/${r}/invoke${u?"?sync=true":""}`,headers:a,body:{event:{data:i?.event?.data??{}}},timeout:i?.timeout,signal:i?.signal})))})}var rd=new WeakMap,rl=new WeakMap,rh=class{constructor(e,t){Z(this,rd,void 0),Z(this,rl,void 0),et(rd,this,e),et(rl,this,t)}invoke(e,t,r){return rc(er(rd,this),er(rl,this),e,t,r)}},rp=new WeakMap,rf=new WeakMap,rg=class{constructor(e,t){Z(this,rp,void 0),Z(this,rf,void 0),et(rp,this,e),et(rf,this,t)}invoke(e,t,r){return(0,p.lastValueFrom)(rc(er(rp,this),er(rf,this),e,t,r))}},ry=new WeakMap,rm=new WeakMap,rv=class{constructor(e,t){Z(this,ry,void 0),Z(this,rm,void 0),et(ry,this,e),et(rm,this,t)}getPlaybackInfo(e,t={}){let r=er(ry,this).config(),i=(r.resource||r["~experimental_resource"])?.id,{instanceId:n,library
9Id:s}=rI(e),a=s||i;if(!a)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 o=r$(n,a),u=r_(t);return eW(er(ry,this),er(rm,this),{method:"GET",url:o,query:u})}},rw=new WeakMap,rb=new WeakMap,rE=class{constructor(e,t){Z(this,rw,void 0),Z(this,rb,void 0),et(rw,this,e),et(rb,this,t)}getPlaybackInfo(e,t={}){let r=er(rw,this).config(),i=(r.resource||r["~experimental_resource"])?.id,{instanceId:n,libraryId:s}=rI(e),a=s||i;if(!a)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 o=r$(n,a),u=r_(t);return eF(er(rw,this),er(rb,this),{method:"GET",url:o,query:u})}};let rM=/^media-library:(ml[^:]+):([^:]+)$/;function rI(e){let t="object"==typeof e&&"_ref"in e?e._ref:e,r=rM.exec(t);if(r){let[,e,t]=r;return{libraryId:e,instanceId:t}}if("string"==typeof e&&e.startsWith("video-"))return{instanceId:e};throw Error(`Invalid video asset instance identifier "${t}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}function r$(e,t){return`/media-libraries/${t}/video/${e}/playback-info`}function r_(e){let t={};if(e.transformations){let{thumbnail:r,animated:i,storyboard:n}=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)),i&&(i.width&&(t.animatedWidth=i.width),i.height&&(t.animatedHeight=i.height),void 0!==i.start&&(t.animatedStart=i.start),void 0!==i.end&&(t.animatedEnd=i.end),i.fps&&(t.animatedFps=i.fps),i.format&&(t.animatedFormat=i.format)),n&&n.format&&(t.storyboardFormat=n.format)}return e.expiration&&(t.expiration=e.expiration),t}var rk=new WeakMap,rC=new WeakMap,rT=class{constructor(e,t){Z(this,rk,void 0),Z(this,rC,void 0),et(rk,this,e),et(rC,this,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"),eW(er(rk,this),er(rC,this),{url:"/projects",query:t})}getById(e){return eW(er(rk,this),er(rC,this),{url:`/projects/${e}`})}},rA=new WeakMap,rO=new WeakMap,rx=class{constructor(e,t){Z(this,rA,void 0),Z(this,rO,void 0),et(rA,this,e),et(rO,this,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"),eF(er(rA,this),er(rO,this),{url:"/projects",query:t})}getById(e){return eF(er(rA,this),er(rO,this),{url:`/projects/${e}`})}};function rS(){let e="";for(;e.length<8;)for(let t of crypto.getRandomValues(new Uint8Array(8-e.length))){let r=63&t;r<62&&(e+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[r])}return e}let rP=(e,t)=>t?(0,_.getVersionId)(e,t):(0,M.getDraftId)(e);function rj(e,{releaseId:t,publishedId:r,document:i}){if(r&&i._id){let e=rP(r,t);return(0,n.b)(e,i),e}if(i._id){let r=(0,k.isDraftId)(i._id),n=(0,C.isVersionId)(i._id);if(!r&&!n)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 (\`${i._id}\`) that is a draft ID, but a release ID (\`${t}\`) was also provided.`);let n=(0,$.getVersionFromId)(i._id);if(n!==t)throw Error(`\`${e}()\` was called with a document ID (\`${i._id}\`) that is a version ID, but the release ID (\`${t}\`) does not match the document's version ID (\`${n}\`).`)}return i._id}if(r)return rP(r,t);throw Error(`\`${e}()\` requires either a publishedId or a document with an \`_id\``)}let rD=(e,t)=>{let[r,i,n]=((e,t)=>{if("object"==typeof e&&e&&("releaseId"in e||"metadata"in e)){let{releaseId:r=rS(),metadata:i={}}=e;return[r,i,t]}return[rS(),{},e]})(e,t);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...i,releaseType:i.releaseType||"undecided"}},options:n}};var rR=new WeakMap,rq=new WeakMap,rU=class{constructor(e,t){Z(this,rR,void 0),Z(this,rq,void 0),et(rR,this,e),et(rq,this,t)}get({releaseId:e},t){return em(er(rR,this),er(rq,this),`_.releases.${e}`,t)}create(e,t){let{action:r,options:i}=rD(e,t),{releaseId:n,metadata:s}=r;
9return e$(er(rR,this),er(rq,this),r,i).pipe((0,f.map)(e=>({...e,releaseId:n,metadata:s})))}edit({releaseId:e,patch:t},r){return e$(er(rR,this),er(rq,this),{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r)}publish({releaseId:e},t){return e$(er(rR,this),er(rq,this),{actionType:"sanity.action.release.publish",releaseId:e},t)}archive({releaseId:e},t){return e$(er(rR,this),er(rq,this),{actionType:"sanity.action.release.archive",releaseId:e},t)}unarchive({releaseId:e},t){return e$(er(rR,this),er(rq,this),{actionType:"sanity.action.release.unarchive",releaseId:e},t)}schedule({releaseId:e,publishAt:t},r){return e$(er(rR,this),er(rq,this),{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r)}unschedule({releaseId:e},t){return e$(er(rR,this),er(rq,this),{actionType:"sanity.action.release.unschedule",releaseId:e},t)}delete({releaseId:e},t){return e$(er(rR,this),er(rq,this),{actionType:"sanity.action.release.delete",releaseId:e},t)}fetchDocuments({releaseId:e},t){return function(e,t,r,i={}){return eL(i.signal,n=>eI(e,t,r,{...i,signal:n}))}(er(rR,this),er(rq,this),e,t)}},rV=new WeakMap,rL=new WeakMap,rF=class{constructor(e,t){Z(this,rV,void 0),Z(this,rL,void 0),et(rV,this,e),et(rL,this,t)}get({releaseId:e},t){return ev(er(rV,this),er(rL,this),`_.releases.${e}`,t)}async create(e,t){let{action:r,options:i}=rD(e,t),{releaseId:n,metadata:s}=r;return{...await eC(er(rV,this),er(rL,this),r,i),releaseId:n,metadata:s}}edit({releaseId:e,patch:t},r){return eC(er(rV,this),er(rL,this),{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r)}publish({releaseId:e},t){return eC(er(rV,this),er(rL,this),{actionType:"sanity.action.release.publish",releaseId:e},t)}archive({releaseId:e},t){return eC(er(rV,this),er(rL,this),{actionType:"sanity.action.release.archive",releaseId:e},t)}unarchive({releaseId:e},t){return eC(er(rV,this),er(rL,this),{actionType:"sanity.action.release.unarchive",releaseId:e},t)}schedule({releaseId:e,publishAt:t},r){return eC(er(rV,this),er(rL,this),{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r)}unschedule({releaseId:e},t){return eC(er(rV,this),er(rL,this),{actionType:"sanity.action.release.unschedule",releaseId:e},t)}delete({releaseId:e},t){return eC(er(rV,this),er(rL,this),{actionType:"sanity.action.release.delete",releaseId:e},t)}fetchDocuments({releaseId:e},t){return eI(er(rV,this),er(rL,this),e,t)}},rW=new WeakMap,rz=new WeakMap,rN=class{constructor(e,t){Z(this,rW,void 0),Z(this,rz,void 0),et(rW,this,e),et(rz,this,t)}getById(e){return eW(er(rW,this),er(rz,this),{url:`/users/${e}`})}},rB=new WeakMap,rH=new WeakMap,rG=class{constructor(e,t){Z(this,rB,void 0),Z(this,rH,void 0),et(rB,this,e),et(rH,this,t)}getById(e){return eF(er(rB,this),er(rH,this),{url:`/users/${e}`})}},rK=new WeakMap,rQ=new WeakMap,rX=class e{constructor(e,t=n.t){(0,r.u)(this,"assets",void 0),(0,r.u)(this,"datasets",void 0),(0,r.u)(this,"live",void 0),(0,r.u)(this,"mediaLibrary",void 0),(0,r.u)(this,"projects",void 0),(0,r.u)(this,"users",void 0),(0,r.u)(this,"agent",void 0),(0,r.u)(this,"collaboration",void 0),(0,r.u)(this,"functions",void 0),(0,r.u)(this,"releases",void 0),(0,r.u)(this,"context",void 0),Z(this,rK,void 0),Z(this,rQ,void 0),(0,r.u)(this,"listen",ti),this.config(t),et(rQ,this,e),this.assets=new e0(this,er(rQ,this)),this.datasets=new t7(this,er(rQ,this)),this.live=new t6(this),this.mediaLibrary={video:new rv(this,er(rQ,this))},this.projects=new rT(this,er(rQ,this)),this.users=new rN(this,er(rQ,this)),this.agent={action:new eK(this,er(rQ,this))},this.collaboration={comments:new tE(this,er(rQ,this))},this.functions=new rh(this,er(rQ,this)),this.releases=new rU(this,er(rQ,this)),this.context=new t2(this,er(rQ,this))}clone(){return new e(er(rQ,this),this.config())}config(e){if(void 0===e)return{...er(rK,this)};if(er(rK,this)&&!1===er(rK,this).allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return et(rK,this,(0,n.n)(e,er(rK,this)||{})),this}withConfig(t){let r=this.config();return new e(er(rQ,this),{...r,...t,stega:{...r.stega,..."boolean"==typeof t?.stega?{enabled:t.stega}:t?.stega||{}}})}fetch(e,t,r){return function(e,t,r,i,n={},s={}){return eL(s.signal,a=>ey(e,t,r,i,n,{...s,signal:a}))}(this,er(rQ,this),er(rK,this).stega,e,t,r)}getDocument(e,t){if(t?.includeAllVersions===!0)return em(this,er(rQ,this),e,{...t,includeAllVersions:!0});let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return em(this,er(rQ,this),e,r)}getDocuments(e,t){return function(e,t,r,i={}){return eL(i.signal,n=>eE(e,t,r,{...i,signal:n}))}(this,er(rQ,this),e,t)}documentsExists(e,t){return function(e,t,r,i={}){return eL(i.signal,n=>eM(e,t,r,{...i,signal:n}))}(this,er(rQ,this),e,t)}create(e,t){return function(e,t,r,i,n={}){return eL(n.signal,s=>ek(e,t,r,i,{...n,signal:s}))}(this,er(rQ,this),e,"create",t)}createIfNotExists(e,t){var r,i;return r=this,i=er(rQ,this),eL(t?.signal,n=>eO(r,i,e,{...t,signal:n}))}createOrReplace(e,t){var r,i;return r=this,i=er(rQ,this),eL(t?.signal,n=>ex(r,i,e,{...t,signal:n}))}createVersion({document:e,publishedId:t,releaseId:r,baseId:i,ifBaseRevisionId:n},s){var a,o,u,c;if(!e)return a=this,o=er(rQ,this),eL(s?.signal,e=>eP(a,o,t,i,r,n,{...s,signal:e}));let d=rj("createVersion",{document:e,publishedId:t,releaseId:r}),l={...e,_id:d},h=t||(0,I.getPublishedId)(e._id);return u=this,c=er(rQ,this),eL(s?.signal,e=>eS(u,c,l,h,{...s,signal:e}))}delete(e,t){var r,i;return r=this,i=er(rQ,this),eL(t?.signal,n=>eA(r,i,e,{...t,signal:n}))}discardVersion({releaseId:e,publishedId:t},r,i){let n=rP(t,e);return function(e,t,r,i=!1,n){return eL(n?.signal,s=>ej(e,t,r,i,{...n,signal:s}))}(this,er(rQ,this),n,r,i)}replaceVersion({document:e,publishedId:t,releaseId:r},i){var n,s;let a=rj("replaceVersion",{document:e,publishedId:t,releaseId:r}),o={...e,_id:a};return n=this,s=er(rQ,this),eL(i?.signal,e=>eD(n,s,o,{...i,signal:e}))}unpublishVersion({releaseId:e,publishedId:t},r){var i,n;let s=(0,_.getVersionId)(t,e);return i=this,n=er(rQ,this),eL(r?.signal,e=>eR(i,n,s,t,{...r,signal:e}))}mutate(e,t){var r,i;return r=this,i=er(rQ,this),eL(t?.signal,n=>eT(r,i,e,{...t,signal:n}))}patch(e,t){return new es(e,t,this)}transaction(e){return new ep(e,this)}action(e,t){return e$(this,er(rQ,this),e,t)}request(e){return eW(this,er(rQ,this),e)}getUrl(e,t){return eN(this,e,t)}getDataUrl(e,t){return ez(this,e,t)}},rY=new WeakMap,rJ=new WeakMap,rZ=class e{constructor(e,t=n.t){(0,r.u)(this,"assets",void 0),(0,r.u)(this,"datasets",void 0),(0,r.u)(this,"live",void 0),(0,r.u)(this,"mediaLibrary",void 0),(0,r.u)(this,"projects",void 0),(0,r.u)(this,"users",void 0),(0,r.u)(this,"agent",void 0),(0,r.u)(this,"collaboration",void 0),(0,r.u)(this,"functions",void 0),(0,r.u)(this,"releases",void 0),(0,r.u)(this,"context",void 0),(0,r.u)(this,"observable",void 0),Z(this,rY,void 0),Z(this,rJ,void 0),(0,r.u)(this,"listen",ti),this.config(t),et(rJ,this,e),this.assets=new e4(this,er(rJ,this)),this.datasets=new rr(this,er(rJ,this)),this.live=new t6(this),this.mediaLibrary={video:new rE(this,er(rJ,this))},this.projects=new rx(this,er(rJ,this)),this.users=new rG(this,er(rJ,this)),this.agent={action:new eY(this,er(rJ,this))},this.collaboration={comments:new t$(this,er(rJ,this))},this.functions=new rg(this,er(rJ,this)),this.releases=new rF(this,er(rJ,this)),this.context=new tX(this,er(rJ,this)),this.observable=new rX(e,t)}clone(){return new e(er(rJ,this),this.config())}config(e){if(void 0===e)return{...er(rY,this)};if(er(rY,this)&&!1===er(rY,this).allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),et(rY,this,(0,n.n)(e,er(rY,this)||{})),this}withConfig(t){let r=this.config();return new e(er(rJ,this),{...r,...t,stega:{...r.stega,..."boolean"==typeof t?.stega?{enabled:t.stega}:t?.stega||{}}})}fetch(e,t,r){return ey(this,er(rJ,this),er(rY,this).stega,e,t,r)}getDocument(e,t){if(t?.includeAllVersions===!0)return ev(this,er(rJ,this),e,{...t,includeAllVersions:!0});let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return ev(this,er(rJ,this),e,r)}getDocuments(e,t){return eE(this,er(rJ,this),e,t)}documentsExists(e,t){return eM(this,er(rJ,this),e,t)}create(e,t){return ek(this,er(rJ,this),e,"create",t)}createIfNotExists(e,t){return eO(this,er(rJ,this),e,t)}createOrReplace(e,t){return ex(this,er(rJ,this),e,t)}createVersion({document:e,publishedId:t,releaseId:r,baseId:i,ifBaseRevisionId:n},s){if(!e)return eP(this,er(rJ,this),t,i,r,n,s);let a=rj("createVersion",{document:e,publishedId:t,releaseId:r}),o={...e,_id:a},u=t||(0,I.getPublishedId)(e._id);return eS(this,er(rJ,this),o,u,s)}delete(e,t){return eA(this,er(rJ,this),e,t)}discardVersion({releaseId:e,publishedId:t},r,i){let n=rP(t,e);return ej(this,er(rJ,this),n,r,i)}replaceVersion({document:e,publishedId:t,releaseId:r},i){let n=rj("replaceVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:n};return eD(this,er(rJ,this),s,i)}unpublishVersion({releaseId:e,publishedId:t},r){let i=(0,_.getVersionId)(t,e);return eR(this,er(rJ,this),i,t,r)}mutate(e,t){return eT(this,er(rJ,this),e,t)}patch(e,t){return new eo(e,t,this)}transaction(e){return new el(e,this)}action(e,t){return eC(this,er(rJ,this),e,t)}request(e){return eF(this,er(rJ,this),e)}dataRequest(e,t,r){return e_(this,er(rJ,this),e,t,r)}getUrl(e,t){return eN(this,e,t)}getDataUrl(e,t){return ez(this,e,t)}};let r0=(t={middleware:[]},{requester:(0,r.t)(t).observable,createClient:e=>{let{observable:i,promise:n}=(0,r.t)(t,{ignoreWarnings:e.ignoreWarnings,maxRetries:e.maxRetries,retryDelay:e.retryDelay}),s=async e=>(await n({redirect:"manual",...e})).body;return new rZ((e,t)=>t?t(e,s):s(e),{...e,requester:i,resolveFetch:e.resolveFetch??t.resolveFetch})}}),r1=(r0.requester,r0.createClient);e.s(["ChannelError",0,B,"ConnectionFailedError",0,z,"DisconnectError",0,N,"createClient",0,r1],224941)},305753,e=>{"use strict";var t=e.i(234915);try{var r="u">typeof window?window:e.g;r._sentryModuleMetadata=r._sentryModuleMetadata||{},r._sentryModuleMetadata[(new r.Error).stack]=Object.assign({},r._sentryModuleMetadata[(new r.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}e.s(["lastValueFrom",0,function(e,r){var i="object"==typeof r;return new Promise(function(n,s){var a,o=!1;e.subscribe({next:function(e){a=e,o=!0},error:s,complete:function(){o?n(a):i?n(r.defaultValue):s(new t.EmptyError)}})})}])},602400,761101,e=>{"use strict";var t=e.i(844032);try{var r="u">typeof window?window:e.g;r._sentryModuleMetadata=r._sentryModuleMetadata||{},r._sentryModuleMetadata[(new r.Error).stack]=Object.assign({},r._sentryModuleMetadata[(new r.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}function i(){return(0,t.mergeAll)(1)}e.s(["concatAll",0,i],761101);var n=e.i(673649),s=e.i(330823);try{var a="u">typeof window?window:e.g;a._sentryModuleMetadata=a._sentryModuleMetadata||{},a._sentryModuleMetadata[(new a.Error).stack]=Object.assign({},a._sentryModuleMetadata[(new a.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}e.s(["concat",0,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i()((0,s.from)(e,(0,n.popScheduler)(e)))}],602400)},245281,218692,e=>{"use strict";var t=e.i(673649),r=e.i(330823);try{var i="u">typeof window?window:e.g;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}e.s(["of",0,function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=(0,t.popScheduler)(e);return(0,r.from)(e,n)}],245281);var n=e.i(603752),s=e.i(902965),a=e.i(627608),o=e.i(979165);try{var u="u">typeof window?window:e.g;u._sentryModuleMetadata=u._sentryModuleMetadata||{},u._sentryModuleMetadata[(new u.Error).stack]=Object.assign({},u._sentryModuleMetadata[(new u.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}e.s(["tap",0,function(e,t,r){var i=(0,n.isFunction)(e)||t||r?{next:e,error:t,complete:r}:e;return i?(0,s.operate)(function(e,t){null==(r=i.subscribe)||r.call(i);var r,n=!0;e.subscribe((0,a.createOperatorSubscriber)(t,function(e){var r;null==(r=i.next)||r.call(i,e),t.next(e)},function(){var e;n=!1,null==(e=i.complete)||e.call(i),t.complete()},function(e){var r;n=!1,null==(r=i.error)||r.call(i,e),t.error(e)},function(){var e,t;n&&(null==(e=i.unsubscribe)||e.call(i)),null==(t=i.finalize)||t.call(i)}))}):o.identity}],218692)},254201,e=>{"use strict";var t=e.i(394426),r=e.i(603752);try{var i="u">typeof window?window:e.g;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}e.s(["throwError",0,function(e,i){var n=(0,r.isFunction)(e)?e:function(){return e},s=function(e){return e.error(n())};return new t.Observable(i?function(e){return i.schedule(s,0,e)}:s)}])},817312,161538,e=>{"use strict";var t=e.i(394426),r=e.i(629437),i=e.i(871041);try{var n="u">typeof window?window:e.g;n._sentryModuleMetadata=n._sentryModuleMetadata||{},n._sentryModuleMetadata[(new n.Error).stack]=Object.assign({},n._sentryModuleMetadata[(new n.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}function s(e){return e instanceof Date&&!isNaN(e)}e.s(["isValidDate",0,s],161538);try{var a="u">typeof window?window:e.g;a._sentryModuleMetadata=a._sentryModuleMetadata||{},a._sentryModuleMetadata[(new a.Error).stack]=Object.assign({},a._sentryModuleMetadata[(new a.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}e.s(["timer",0,function(e,n,a){void 0===e&&(e=0),void 0===a&&(a=r.async);var o=-1;return null!=n&&((0,i.isScheduler)(n)?a=n:o=n),new t.Observable(function(t){var r=s(e)?e-a.now():e;r<0&&(r=0);var i=0;return a.schedule(function(){t.closed||(t.next(i++),0<=o?this.schedule(void 0,o):t.complete())},r)})}],817312)},992481,e=>{"use strict";var t=e.i(220324),r=e.i(627608),i=e.i(902965);try{var n="u">typeof window?window:e.g;n._sentryModuleMetadata=n._sentryModuleMetadata||{},n._sentryModuleMetadata[(new n.Error).stack]=Object.assign({},n._sentryModuleMetadata[(new n.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}e.s(["catchError",0,function e(n){return(0,i.operate)(function(i,s){var a,o=null,u=!1;o=i.subscribe((0,r.createOperatorSubscriber)(s,void 0,void 0,function(r){a=(0,t.innerFrom)(n(r,e(n)(i))),o?(o.unsubscribe(),o=null,a.subscribe(s)):u=!0})),u&&(o.unsubscribe(),o=null,a.subscribe(s))})}])},128068,e=>{"use strict";var t=e.i(902965);try{var r="u">typeof window?window:e.g;r._sentryModuleMetadata=r._sentryModuleMetadata||{},r._sentryModuleMetadata[(new r.Error).stack]=Object.assign({},r._sentryModuleMetadata[(new r.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}e.s(["finalize",0,function(e){return(0,t.operate)(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}])},629437,e=>{"use strict";var t=e.i(329418),r=e.i(796989);try{var i="u">typeof window?window:e.g;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}var n=new r.AsyncScheduler(t.AsyncAction);e.s(["async",0,n,"asyncScheduler",0,n])},234915,e=>{"use strict";var t=e.i(842093);try{var r="u">typeof window?window:e.g;r._sentryModuleMetadata=r._sentryModuleMetadata||{},r._sentryModuleMetadata[(new r.Error).stack]=Object.assign({},r._sentryModuleMetadata[(new r.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}var i=(0,t.createErrorClass)(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});e.s(["EmptyError",0,i])},245912,e=>{"use strict";var t=e.i(394426),r=e.i(603752);try{var i="u">typeof window?window:e.g;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:brand-site":!0})}catch(e){}e.s(["isObservable",0,functi
9on(e){return!!e&&(e instanceof t.Observable||(0,r.isFunction)(e.lift)&&(0,r.isFunction)(e.subscribe))}])}]);
10
11//# debugId=9f2251d7-f6d2-4855-80fa-5163fc447ca4

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.