1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browser-CipVhaGa.js","assets/react-BpH_hX3_.js"])))=>i.map(i=>d[i]); 2const zr="modulepreload",Hr=function(r){return"/"+r},He={},wt=function(e,t,n){let s=Promise.resolve();if(t&&t.length>0){let c=function(u){return Promise.all(u.map(l=>Promise.resolve(l).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");s=c(t.map(u=>{if(u=Hr(u),u in He)return;He[u]=!0;const l=u.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const y=document.createElement("link");if(y.rel=l?"stylesheet":zr,l||(y.as="script"),y.crossOrigin="",y.href=u,a&&y.setAttribute("nonce",a),document.head.appendChild(y),l)return new Promise((f,p)=>{y.addEventListener("load",f),y.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})},Et=!(typeof navigator>"u")&&navigator.product==="ReactNative",Ct={timeout:Et?6e4:12e4},Gr=function(r){const e={...Ct,...typeof r=="string"?{url:r}:r};if(e.timeout=It(e.timeout),e.query){const{url:t,searchParams:n}=(function(s){const i=s.indexOf("?");if(i===-1)return{url:s,searchParams:new URLSearchParams};const o=s.slice(0,i),a=s.slice(i+1);if(!Et)return{url:o,searchParams:new URLSearchParams(a)};if(typeof decodeURIComponent!="function")throw new Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");const c=new URLSearchParams;for(const u of a.split("&")){const[l,d]=u.split("=");l&&c.append(Ge(l),Ge(d||""))}return{url:o,searchParams:c}})(e.url);for(const[s,i]of Object.entries(e.query)){if(i!==void 0)if(Array.isArray(i))for(const a of i)n.append(s,a);else n.append(s,i);const o=n.toString();o&&(e.url=`${t}?${o}`)}}return e.method=e.body&&!e.method?"POST":(e.method||"GET").toUpperCase(),e};function Ge(r){return decodeURIComponent(r.replace(/\+/g," "))}function It(r){if(r===!1||r===0)return!1;if(r.connect||r.socket)return r;const e=Number(r);return isNaN(e)?It(Ct.timeout):{connect:e,socket:e}}const Qr=/^https?:\/\//i,Yr=function(r){if(!Qr.test(r.url))throw new Error(`"${r.url}" is not a valid URL`)};function St(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}const Jr=["request","response","progress","error","abort"],Qe=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];function At(r,e){const t=[],n=Qe.reduce((i,o)=>(i[o]=i[o]||[],i),{processOptions:[Gr],validateOptions:[Yr]});function s(i){const o=Jr.reduce((f,p)=>(f[p]=(function(){const h=Object.create(null);let m=0;return{publish:function(w){for(const g in h)h[g](w)},subscribe:function(w){const g=m++;return h[g]=w,function(){delete h[g]}}}})(),f),{}),a=(f=>function(p,h,...m){const w=p==="onError";let g=h;for(let v=0;v<f[p].length&&(g=(0,f[p][v])(g,...m),!w||g);v++);return g})(n),c=a("processOptions",i);a("validateOptions",c);const u={options:c,channels:o,applyMiddleware:a};let l;const d=o.request.subscribe(f=>{l=e(f,(p,h)=>((m,w,g)=>{let v=m,I=w;if(!v)try{I=a("onResponse",w,g)}catch($){I=null,v=$}v=v&&a("onError",v,g),v?o.error.publish(v):I&&o.response.publish(I)})(p,h,f))});o.abort.subscribe(()=>{d(),l&&l.abort()});const y=a("onReturn",o,u);return y===o&&o.request.publish(u),y}return s.use=function(i){if(!i)throw new Error("Tried to add middleware that resolved to falsey value");if(typeof i=="function")throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(i.onReturn&&n.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return Qe.forEach(o=>{i[o]&&n[o].push(i[o])}),t.push(i),s},s.clone=()=>At(t,e),r.forEach(s.use),s}var Ye,Je,Xr=St((function(){if(Je)return Ye;Je=1;var r=function(t){return t.replace(/^\s+|\s+$/g,"")},e=function(t){return Object.prototype.toString.call(t)==="[object Array]"};return Ye=function(t){if(!t)return{};for(var n=Object.create(null),s=r(t).split(` 3`),i=0;i<s.length;i++){var o=s[i],a=o.indexOf(":"),c=r(o.slice(0,a)).toLowerCase(),u=r(o.slice(a+1));typeof n[c]>"u"?n[c]=u:e(n[c])?n[c].push(u):n[c]=[n[c],u]}return n}})());let je=class{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#t;#e;#n;#s={};#r;#i={};#o;open(e,t,n){this.#t=e,this.#e=t,this.#n="",this.readyState=1,this.onreadystatechange?.(),this.#r=void 0}abort(){this.#r&&this.#r.abort()}getAllResponseHeaders(){return this.#n}setRequestHeader(e,t){this.#s[e]=t}setInit(e,t=!0){this.#i=e,this.#o=t}send(e){const t=this.responseType!=="arraybuffer",n={...this.#i,method:this.#t,headers:this.#s,body:e};typeof AbortController=="function"&&this.#o&&(this.#r=new AbortController,typeof EventTarget<"u"&&this.#r.signal instanceof EventTarget&&(n.signal=this.#r.signal)),typeof document<"u"&&(n.credentials=this.withCredentials?"include":"omit"),fetch(this.#e,n).then(s=>
3(s.headers.forEach((i,o)=>{this.#n+=`${o}: ${i}\r 4`}),this.status=s.status,this.statusText=s.statusText,this.readyState=3,this.onreadystatechange?.(),t?s.text():s.arrayBuffer())).then(s=>{typeof s=="string"?this.responseText=s:this.response=s,this.readyState=4,this.onreadystatechange?.()}).catch(s=>{s.name!=="AbortError"?this.onerror?.(s):this.onabort?.()})}};const Pe=typeof XMLHttpRequest=="function"?"xhr":"fetch",Kr=Pe==="xhr"?XMLHttpRequest:je,Zr=(r,e)=>{const t=r.options,n=r.applyMiddleware("finalizeOptions",t),s={},i=r.applyMiddleware("interceptRequest",void 0,{adapter:Pe,context:r});if(i){const h=setTimeout(e,0,null,i);return{abort:()=>clearTimeout(h)}}let o=new Kr;o instanceof je&&typeof n.fetch=="object"&&o.setInit(n.fetch,n.useAbortSignal??!0);const a=n.headers,c=n.timeout;let u=!1,l=!1,d=!1;if(o.onerror=h=>{p(o instanceof je?h instanceof Error?h:new Error(`Request error while attempting to reach is ${n.url}`,{cause:h}):new Error(`Request error while attempting to reach is ${n.url}${h.lengthComputable?`(${h.loaded} of ${h.total} bytes transferred)`:""}`))},o.ontimeout=h=>{p(new Error(`Request timeout while attempting to reach ${n.url}${h.lengthComputable?`(${h.loaded} of ${h.total} bytes transferred)`:""}`))},o.onabort=()=>{f(!0),u=!0},o.onreadystatechange=function(){c&&(f(),s.socket=setTimeout(()=>y("ESOCKETTIMEDOUT"),c.socket)),!u&&o&&o.readyState===4&&o.status!==0&&(function(){if(!(u||l||d)){if(o.status===0)return void p(new Error("Unknown XHR error"));f(),l=!0,e(null,{body:o.response||(o.responseType===""||o.responseType==="text"?o.responseText:""),url:n.url,method:n.method,headers:Xr(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}})()},o.open(n.method,n.url,!0),o.withCredentials=!!n.withCredentials,a&&o.setRequestHeader)for(const h in a)a.hasOwnProperty(h)&&o.setRequestHeader(h,a[h]);return n.rawBody&&(o.responseType="arraybuffer"),r.applyMiddleware("onRequest",{options:n,adapter:Pe,request:o,context:r}),o.send(n.body||null),c&&(s.connect=setTimeout(()=>y("ETIMEDOUT"),c.connect)),{abort:function(){u=!0,o&&o.abort()}};function y(h){d=!0,o.abort();const m=new Error(h==="ESOCKETTIMEDOUT"?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);m.code=h,r.channels.error.publish(m)}function f(h){(h||u||o&&o.readyState>=2&&s.connect)&&clearTimeout(s.connect),s.socket&&clearTimeout(s.socket)}function p(h){if(l)return;f(!0),l=!0,o=null;const m=h||new Error(`Network error while attempting to reach ${n.url}`);m.isNetworkError=!0,m.request=n,e(m)}},en=(r=[],e=Zr)=>At(r,e);var tn={},Xe,Ke,Ze,et,tt,Ae={exports:{}};tt||(tt=1,(function(r,e){e.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+r.exports.humanize(this.diff),!this.useColors)return;const s="color: "+this.color;n.splice(1,0,s,"color: inherit");let i=0,o=0;n[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(i++,a==="%c"&&(o=i))}),n.splice(o,0,s)},e.save=function(n){try{n?e.storage.setItem("debug",n):e.storage.removeItem("debug")}catch{}},e.load=function(){let n;try{n=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=tn.DEBUG),n},e.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=(function(){try{return localStorage}catch{}})(),e.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33
4CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),r.exports=(et?Ze:(et=1,Ze=function(n){function s(a){let c,u,l,d=null;function y(...f){if(!y.enabled)return;const p=y,h=Number(new Date),m=h-(c||h);p.diff=m,p.prev=c,p.curr=h,c=h,f[0]=s.coerce(f[0]),typeof f[0]!="string"&&f.unshift("%O");let w=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,(g,v)=>{if(g==="%%")return"%";w++;const I=s.formatters[v];if(typeof I=="function"){const $=f[w];g=I.call(p,$),f.splice(w,1),w--}return g}),s.formatArgs.call(p,f),(p.log||s.log).apply(p,f)}return y.namespace=a,y.useColors=s.useColors(),y.color=s.selectColor(a),y.extend=i,y.destroy=s.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(u!==s.namespaces&&(u=s.namespaces,l=s.enabled(a)),l),set:f=>{d=f}}),typeof s.init=="function"&&s.init(y),y}function i(a,c){const u=s(this.namespace+(typeof c>"u"?":":c)+a);return u.log=this.log,u}function o(a,c){let u=0,l=0,d=-1,y=0;for(;u<a.length;)if(l<c.length&&(c[l]===a[u]||c[l]==="*"))c[l]==="*"?(d=l,y=u,l++):(u++,l++);else{if(d===-1)return!1;l=d+1,y++,u=y}for(;l<c.length&&c[l]==="*";)l++;return l===c.length}return s.debug=s,s.default=s,s.coerce=function(a){return a instanceof Error?a.stack||a.message:a},s.disable=function(){const a=[...s.names,...s.skips.map(c=>"-"+c)].join(",");return s.enable(""),a},s.enable=function(a){s.save(a),s.namespaces=a,s.names=[],s.skips=[];const c=(typeof a=="string"?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const u of c)u[0]==="-"?s.skips.push(u.slice(1)):s.names.push(u)},s.enabled=function(a){for(const c of s.skips)if(o(a,c))return!1;for(const c of s.names)if(o(a,c))return!0;return!1},s.humanize=(function(){if(Ke)return Xe;Ke=1;var a=1e3,c=60*a,u=60*c,l=24*u,d=7*l;function y(f,p,h,m){var w=p>=1.5*h;return Math.round(f/h)+" "+m+(w?"s":"")}return Xe=function(f,p){p=p||{};var h,m,w=typeof f;if(w==="string"&&f.length>0)return(function(g){if(!((g=String(g)).length>100)){var v=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(g);if(v){var I=parseFloat(v[1]);switch((v[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*I;case"weeks":case"week":case"w":return I*d;case"days":case"day":case"d":return I*l;case"hours":case"hour":case"hrs":case"hr":case"h":return I*u;case"minutes":case"minute":case"mins":case"min":case"m":return I*c;case"seconds":case"second":case"secs":case"sec":case"s":return I*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return I;default:return}}}})(f);if(w==="number"&&isFinite(f))return p.long?(h=f,(m=Math.abs(h))>=l?y(h,m,l,"day"):m>=u?y(h,m,u,"hour"):m>=c?y(h,m,c,"minute"):m>=a?y(h,m,a,"second"):h+" ms"):(function(g){var v=Math.abs(g);return v>=l?Math.round(g/l)+"d":v>=u?Math.round(g/u)+"h":v>=c?Math.round(g/c)+"m":v>=a?Math.round(g/a)+"s":g+"ms"})(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))}})(),s.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach(a=>{s[a]=n[a]}),s.names=[],s.skips=[],s.formatters={},s.selectColor=function(a){let c=0;for(let u=0;u<a.length;u++)c=(c<<5)-c+a.charCodeAt(u),c|=0;return s.colors[Math.abs(c)%s.colors.length]},s.enable(s.load()),s}))(e);const{formatters:t}=r.exports;t.j=function(n){try{return JSON.stringify(n)}catch(s){return"[UnexpectedJSONParseError]: "+s.message}}})(Ae,Ae.exports)),Ae.exports;const rn=typeof Buffer>"u"?()=>!1:r=>Buffer.isBuffer(r);function rt(r){return Object.prototype.toString.call(r)==="[object Object]"}function nn(r){if(rt(r)===!1)return!1;const e=r.constructor;if(e===void 0)return!0;const t=e.prototype;return!(rt(t)===!1||t.hasOwnProperty("isPrototypeOf")===!1)}const sn=["boolean","string","number"];function on(){return{processOptions:r=>{const e=r.body;return!e||typeof e.pipe=="function"||rn(e)||sn.indexOf(typeof e)===-1&&!Array.isArray(e)&&!nn(e)?r:Object.assign({},r,{body:JSON.stringify(r.body),headers:Object.assign({},r.headers,{"Content-Type":"application/json"})})}}}function an(r){return{onResponse:t=>{const n=t.headers["content-type"]||"",s=r&&r.force||n.indexOf("application/json")!==-1;return t.body&&n&&s?Object.assign({},t,{body:e(t.body)}):t},processOptions:t=>Object.assign({},t,{headers:Object.assign({Accept:"application/json"},t.headers)})};function e(t){try{return JSON.parse(t)}catch(n){throw n.message=`Failed to parsed response body as JSON: ${n.message}`,n}}}let Z={};typeof globalThis<"u"?Z=globalThis:typeof window<"u"?Z=window:typeof global<"u"?Z=global:typeof self<"u"&&(Z=self);var un=Z;function cn(r={}
4){const e=r.implementation||un.Observable;if(!e)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:(t,n)=>new e(s=>(t.error.subscribe(i=>s.error(i)),t.progress.subscribe(i=>s.next(Object.assign({type:"progress"},i))),t.response.subscribe(i=>{s.next(Object.assign({type:"response"},i)),s.complete()}),t.request.publish(n),()=>t.abort.publish()))}}function ln(){return{onRequest:r=>{if(r.adapter!=="xhr")return;const e=r.request,t=r.context;function n(s){return i=>{const o=i.lengthComputable?i.loaded/i.total*100:-1;t.channels.progress.publish({stage:s,percent:o,total:i.total,loaded:i.loaded,lengthComputable:i.lengthComputable})}}"upload"in e&&"onprogress"in e.upload&&(e.upload.onprogress=n("upload")),"onprogress"in e&&(e.onprogress=n("download"))}}}var _t=(r,e,t)=>(t.method==="GET"||t.method==="HEAD")&&(r.isNetworkError||!1);function fn(r){return 100*Math.pow(2,r)+100*Math.random()}const Fe=(r={})=>(e=>{const t=e.maxRetries||5,n=e.retryDelay||fn,s=e.shouldRetry;return{onError:(i,o)=>{const a=o.options,c=a.maxRetries||t,u=a.retryDelay||n,l=a.shouldRetry||s,d=a.attemptNumber||0;if((y=a.body)!==null&&typeof y=="object"&&typeof y.pipe=="function"||!l(i,d,a)||d>=c)return i;var y;const f=Object.assign({},o,{options:Object.assign({},a,{attemptNumber:d+1})});return setTimeout(()=>o.channels.request.publish(f),u(d)),null}}})({shouldRetry:_t,...r});Fe.shouldRetry=_t;var qe=function(r,e){return qe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])},qe(r,e)};function q(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");qe(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function hn(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(d){o(d)}}function c(l){try{u(n.throw(l))}catch(d){o(d)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function $t(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(n=1,s&&(i=u[0]&2?s.return:u[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,u[1])).done)return i;switch(s=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){t.label=u[1];break}if(u[0]===6&&t.label<i[1]){t.label=i[1],i=u;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(u);break}i[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],s=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function G(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return i}function P(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}function B(r){return this instanceof B?(this.v=r,this):new B(r)}function dn(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(f){return function(p){return Promise.resolve(p).then(f,d)}}function a(f,p){n[f]&&(s[f]=function(h){return new Promise(function(m,w){i.push([f,h,m,w])>1||c(f,h)})},p&&(s[f]=p(s[f])))}function c(f,p){try{u(n[f](p))}catch(h){y(i[0][3],h)}}function u(f){f.value instanceof B?Promise.resolve(f.value.v).then(l,d):y(i[0][2],f)}function l(f){c("next",f)}function d(f){c("throw",f)}function y(f,p){f(p),i.shift(),i.length&&c(i[0][0],i[0][1])}}function pn(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof G=="function"?G(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(o){return new Promise(function(a,c){o=r[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}function E(r){return typeof r=="function"}function De(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var _e=De(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription: 5`+t.map(function(n,s){return s+1+") "+n.toString()}).join(` 6 `):"",this.name="UnsubscriptionError",this.errors=t}});function ce(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var re=(function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,s,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=G(o),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(h){e={error:h}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;
vendor: 5,121 bytes, line 6
6if(E(l))try{l()}catch(h){i=h instanceof _e?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var y=G(d),f=y.next();!f.done;f=y.next()){var p=f.value;try{nt(p)}catch(h){i=i??[],h instanceof _e?i=P(P([],j(i)),j(h.errors)):i.push(h)}}}catch(h){n={error:h}}finally{try{f&&!f.done&&(s=y.return)&&s.call(y)}finally{if(n)throw n.error}}}if(i)throw new _e(i)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)nt(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&ce(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&ce(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=(function(){var e=new r;return e.closed=!0,e})(),r})(),xt=re.EMPTY;function Ot(r){return r instanceof re||r&&"closed"in r&&E(r.remove)&&E(r.add)&&E(r.unsubscribe)}function nt(r){E(r)?r():r.unsubscribe()}var yn={Promise:void 0},mn={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,P([r,e],j(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Tt(r){mn.setTimeout(function(){throw r})}function st(){}function ue(r){r()}var ke=(function(r){q(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Ot(t)&&t.add(n)):n.destination=bn,n}return e.create=function(t,n,s){return new Q(t,n,s)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(re),vn=(function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){ae(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){ae(n)}else ae(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){ae(t)}},r})(),Q=(function(r){q(e,r);function e(t,n,s){var i=r.call(this)||this,o;return E(t)||!t?o={next:t??void 0,error:n??void 0,complete:s??void 0}:o=t,i.destination=new vn(o),i}return e})(ke);function ae(r){Tt(r)}function gn(r){throw r}var bn={closed:!0,next:st,error:gn,complete:st},Me=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ve(r){return r}function wn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Rt(r)}function Rt(r){return r.length===0?ve:r.length===1?r[0]:function(t){return r.reduce(function(n,s){return s(n)},t)}}var S=(function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var s=this,i=Cn(e)?e:new Q(e,t,n);return ue(function(){var o=s,a=o.operator,c=o.source;i.add(a?a.call(i,c):c?s._subscribe(i):s._trySubscribe(i))}),i},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=it(t),new t(function(s,i){var o=new Q({next:function(a){try{e(a)}catch(c){i(c),o.unsubscribe()}},error:i,complete:s});n.subscribe(o)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[Me]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Rt(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=it(e),new e(function(n,s){var i;t.subscribe(function(o){return i=o},function(o){return s(o)},function(){return n(i)})})},r.create=function(e){return new r(e)},r})();function it(r){var e;return(e=r??yn.Promise)!==null&&e!==void 0?e:Promise}function En(r){return r&&E(r.next)&&E(r.error)&&E(r.complete)}function Cn(r){return r&&r instanceof ke||En(r)&&Ot(r)}function In(r){return E(r?.lift)}function T(r){return function(e){if(In(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function D(r,e,t,n,s){return new Sn(r,e,t,n,s)}var Sn=(function(r){q(e,r);function e(t,n,s,i,o,a){var c=r.call(this,t)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=n?function(u){try{n(u)}catch(l){t.error(l)}}:r.prototype._next,c._error=i?function(u){try{i(u)}catch(l){t.error(l)}finally{this.unsubscribe()}}
6:r.prototype._error,c._complete=s?function(){try{s()}catch(u){t.error(u)}finally{this.unsubscribe()}}:r.prototype._complete,c}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(ke),An=De(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Le=(function(r){q(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new ot(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new An},e.prototype.next=function(t){var n=this;ue(function(){var s,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=G(n.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(t)}}catch(u){s={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(s)throw s.error}}}})},e.prototype.error=function(t){var n=this;ue(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var s=n.observers;s.length;)s.shift().error(t)}})},e.prototype.complete=function(){var t=this;ue(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,s=this,i=s.hasError,o=s.isStopped,a=s.observers;return i||o?xt:(this.currentObservers=null,a.push(t),new re(function(){n.currentObservers=null,ce(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,s=n.hasError,i=n.thrownError,o=n.isStopped;s?t.error(i):o&&t.complete()},e.prototype.asObservable=function(){var t=new S;return t.source=this,t},e.create=function(t,n){return new ot(t,n)},e})(S),ot=(function(r){q(e,r);function e(t,n){var s=r.call(this)||this;return s.destination=t,s.source=n,s}return e.prototype.next=function(t){var n,s;(s=(n=this.destination)===null||n===void 0?void 0:n.next)===null||s===void 0||s.call(n,t)},e.prototype.error=function(t){var n,s;(s=(n=this.destination)===null||n===void 0?void 0:n.error)===null||s===void 0||s.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,s;return(s=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&s!==void 0?s:xt},e})(Le),Ve={now:function(){return(Ve.delegate||Date).now()},delegate:void 0},_n=(function(r){q(e,r);function e(t,n,s){t===void 0&&(t=1/0),n===void 0&&(n=1/0),s===void 0&&(s=Ve);var i=r.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=s,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return e.prototype.next=function(t){var n=this,s=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,c=n._windowTime;s||(i.push(t),!o&&i.push(a.now()+c)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),s=this,i=s._infiniteTimeWindow,o=s._buffer,a=o.slice(),c=0;c<a.length&&!t.closed;c+=i?1:2)t.next(a[c]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,s=t._timestampProvider,i=t._buffer,o=t._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<i.length&&i.splice(0,i.length-a),!o){for(var c=s.now(),u=0,l=1;l<i.length&&i[l]<=c;l+=2)u=l;u&&i.splice(0,u+1)}},e})(Le),$n=(function(r){q(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return this},e})(re),at={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setInterval.apply(void 0,P([r,e],j(t)))},clearInterval:function(r){return clearInterval(r)},delegate:void 0},xn=(function(r){q(e,r);function e(t,n){var s=r.call(this,t,n)||this;
vendor: 4,797 bytes, line 6
6return s.scheduler=t,s.work=n,s.pending=!1,s}return e.prototype.schedule=function(t,n){var s;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(t,n,s){return s===void 0&&(s=0),at.setInterval(t.flush.bind(t,this),s)},e.prototype.recycleAsyncId=function(t,n,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return n;n!=null&&at.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(t,n);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var s=!1,i;try{this.work(t)}catch(o){s=!0,i=o||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),i},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,s=t.scheduler,i=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ce(i,this),n!=null&&(this.id=this.recycleAsyncId(s,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e})($n),ut=(function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=Ve.now,r})(),On=(function(r){q(e,r);function e(t,n){n===void 0&&(n=ut.now);var s=r.call(this,t,n)||this;return s.actions=[],s._active=!1,s}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var s;this._active=!0;do if(s=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,s){for(;t=n.shift();)t.unsubscribe();throw s}},e})(ut),Tn=new On(xn),Rn=Tn,jn=new S(function(r){return r.complete()});function Pn(r){return r&&E(r.schedule)}function Ue(r){return r[r.length-1]}function qn(r){return E(Ue(r))?r.pop():void 0}function Ne(r){return Pn(Ue(r))?r.pop():void 0}function Fn(r,e){return typeof Ue(r)=="number"?r.pop():e}var jt=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function Pt(r){return E(r?.then)}function qt(r){return E(r[Me])}function Ft(r){return Symbol.asyncIterator&&E(r?.[Symbol.asyncIterator])}function Dt(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Dn(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var kt=Dn();function Mt(r){return E(r?.[kt])}function Lt(r){return dn(this,arguments,function(){var t,n,s,i;return $t(this,function(o){switch(o.label){case 0:t=r.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,B(t.read())];case 3:return n=o.sent(),s=n.value,i=n.done,i?[4,B(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,B(s)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Vt(r){return E(r?.getReader)}function R(r){if(r instanceof S)return r;if(r!=null){if(qt(r))return kn(r);if(jt(r))return Mn(r);if(Pt(r))return Ln(r);if(Ft(r))return Ut(r);if(Mt(r))return Vn(r);if(Vt(r))return Un(r)}throw Dt(r)}function kn(r){return new S(function(e){var t=r[Me]();if(E(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Mn(r){return new S(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function Ln(r){return new S(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Tt)})}function Vn(r){return new S(function(e){var t,n;try{for(var s=G(r),i=s.next();!i.done;i=s.next()){var o=i.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}e.complete()})}function Ut(r){return new S(function(e){Nn(r,e).catch(function(t){return e.error(t)})})}function Un(r){return Ut(Lt(r))}function Nn(r,e){var t,n,s,i;return hn(this,void 0,void 0,function(){var o,a;return $t(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),t=pn(r),c.label=1;case 1:return[4,t.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),s={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(i=t.return)?[4,i.call(t)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];
6case 10:return[7];case 11:return e.complete(),[2]}})})}function L(r,e,t,n,s){n===void 0&&(n=0),s===void 0&&(s=!1);var i=e.schedule(function(){t(),s?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(i),!s)return i}function Nt(r,e){return e===void 0&&(e=0),T(function(t,n){t.subscribe(D(n,function(s){return L(n,r,function(){return n.next(s)},e)},function(){return L(n,r,function(){return n.complete()},e)},function(s){return L(n,r,function(){return n.error(s)},e)}))})}function Wt(r,e){return e===void 0&&(e=0),T(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}function Wn(r,e){return R(r).pipe(Wt(e),Nt(e))}function Bn(r,e){return R(r).pipe(Wt(e),Nt(e))}function zn(r,e){return new S(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}function Hn(r,e){return new S(function(t){var n;return L(t,e,function(){n=r[kt](),L(t,e,function(){var s,i,o;try{s=n.next(),i=s.value,o=s.done}catch(a){t.error(a);return}o?t.complete():t.next(i)},0,!0)}),function(){return E(n?.return)&&n.return()}})}function Bt(r,e){if(!r)throw new Error("Iterable cannot be null");return new S(function(t){L(t,e,function(){var n=r[Symbol.asyncIterator]();L(t,e,function(){n.next().then(function(s){s.done?t.complete():t.next(s.value)})},0,!0)})})}function Gn(r,e){return Bt(Lt(r),e)}function Qn(r,e){if(r!=null){if(qt(r))return Wn(r,e);if(jt(r))return zn(r,e);if(Pt(r))return Bn(r,e);if(Ft(r))return Bt(r,e);if(Mt(r))return Hn(r,e);if(Vt(r))return Gn(r,e)}throw Dt(r)}function ne(r,e){return e?Qn(r,e):R(r)}function z(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Ne(r);return ne(r,t)}function zt(r,e){var t=E(r)?r:function(){return r},n=function(s){return s.error(t())};return new S(n)}function Yn(r){return!!r&&(r instanceof S||E(r.lift)&&E(r.subscribe))}var Ht=De(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function b(r,e){return new Promise(function(t,n){var s=!1,i;r.subscribe({next:function(o){i=o,s=!0},error:n,complete:function(){s?t(i):n(new Ht)}})})}function $e(r,e){return new Promise(function(t,n){var s=new Q({next:function(i){t(i),s.unsubscribe()},error:n,complete:function(){n(new Ht)}});r.subscribe(s)})}function Jn(r){return r instanceof Date&&!isNaN(r)}function _(r,e){return T(function(t,n){var s=0;t.subscribe(D(n,function(i){n.next(r.call(e,i,s++))}))})}var Xn=Array.isArray;function Kn(r,e){return Xn(e)?r.apply(void 0,P([],j(e))):r(e)}function Zn(r){return _(function(e){return Kn(r,e)})}function es(r,e,t){return t===void 0&&(t=ve),function(n){ct(e,function(){for(var s=r.length,i=new Array(s),o=s,a=s,c=function(l){ct(e,function(){var d=ne(r[l],e),y=!1;d.subscribe(D(n,function(f){i[l]=f,y||(y=!0,a--),a||n.next(t(i.slice()))},function(){--o||n.complete()}))},n)},u=0;u<s;u++)c(u)})}}function ct(r,e,t){e()}function ts(r,e,t,n,s,i,o,a){var c=[],u=0,l=0,d=!1,y=function(){d&&!c.length&&!u&&e.complete()},f=function(h){return u<n?p(h):c.push(h)},p=function(h){u++;var m=!1;R(t(h,l++)).subscribe(D(e,function(w){e.next(w)},function(){m=!0},void 0,function(){if(m)try{u--;for(var w=function(){var g=c.shift();o||p(g)};c.length&&u<n;)w();y()}catch(g){e.error(g)}}))};return r.subscribe(D(e,f,function(){d=!0,y()})),function(){}}function V(r,e,t){return t===void 0&&(t=1/0),E(e)?V(function(n,s){return _(function(i,o){return e(n,i,s,o)})(R(r(n,s)))},t):(typeof e=="number"&&(t=e),T(function(n,s){return ts(n,s,r,t)}))}function Gt(r){return r===void 0&&(r=1/0),V(ve,r)}function rs(){return Gt(1)}function ns(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return rs()(ne(r,Ne(r)))}function Qt(r){return new S(function(e){R(r()).subscribe(e)})}function ss(r,e,t){return t===void 0&&(t=Rn),new S(function(n){var s=Jn(r)?+r-t.now():r;s<0&&(s=0);var i=0;return t.schedule(function(){n.closed||(n.next(i++),n.complete())},s)})}function is(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Ne(r),n=Fn(r,1/0),s=r;return s.length?s.length===1?R(s[0]):Gt(n)(ne(s,t)):jn}var os=Array.isArray;function as(r){return r.length===1&&os(r[0])?r[0]:r}function K(r,e){return T(function(t,n){var s=0;t.subscribe(D(n,function(i){return r.call(e,i,s++)&&n.next(i)}))})}function le(r){return T(function(e,t){var n=null,s=!1,i;n=e.subscribe(D(t,void 0,void 0,function(o){i=R(r(o,le(r)(e))),n?(n.unsubscribe(),n=null,i.subscribe(t)):s=!0})),s&&(n.unsubscribe(),n=null,i.subscribe(t))})}function Yt(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=qn(r);return t?wn(Yt.apply(void 0,P([],j(r))),Zn(t)):T(function(n,s){es(P([n],j(as(r))))(s)})}function us(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Yt.apply(void 0,P([],j(r)))}function Jt(r){return T(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}function Xt(r){r===void 0&&(r={});var e=r.connector,t=e===void 0?function(){return new Le}:e,n=r.resetOnError,s=n===void 0?!0:n,i=r.resetOnComplete,o=i===void 0?!0:i,a=r.resetOnRefCountZero,c=a===void 0?!0:a;return function(u){var l,d,y,f=0,p=!1,h=!1,m=function(){d?.unsubscribe(),d=void 0},w=function(){m(),l=y=void 0,p=h=!1},g=function(){var v=l;w(),v?.unsubscribe()};return T(function(v,I){f++,!h&&!p&&m();var $=y=y??t();I.add(function(){f--,f===0&&!h&&!p&&(d=xe(g,c))}),$.subscribe(I),!l&&f>0&&(l=new Q({next:function(x){return $.next(x)},error:function(x){h=!0,m(),d=xe(w,s,x),$.error(x)},complete:function(){p=!0,m(),d=xe(w,o),$.complete()}}),R(v).subscribe(l))})(u)}}function xe(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e===!0){r();return}if(e!==!1){var s=new Q({next:function(){s.unsubscribe(),r()}});return R(e.apply(void 0,P([],j(t)))).subscribe(s)}}function cs(r,e,t){var n,s=!1;return n=r,Xt({connector:function(){return new _n(n,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}function ls(r,e,t){var n=E(r)||e||t?{next:r,error:e,complete:t}:r;return n?T(function(s,i){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;s.subscribe(D(i,function(c){var u;(u=n.next)===null||u===void 0||u.call(n,c),i.next(c)},function(){var c;
6a=!1,(c=n.complete)===null||c===void 0||c.call(n),i.complete()},function(c){var u;a=!1,(u=n.error)===null||u===void 0||u.call(n,c),i.error(c)},function(){var c,u;a&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):ve}function Kt(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var Zt={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},er={0:8203,1:8204,2:8205,3:65279};new Array(4).fill(String.fromCodePoint(er[0])).join("");Object.fromEntries(Object.entries(er).map(r=>r.reverse()));Object.fromEntries(Object.entries(Zt).map(r=>r.reverse()));var fs=`${Object.values(Zt).map(r=>`\\u{${r.toString(16)}}`).join("")}`,lt=new RegExp(`[${fs}]{4,}`,"gu");function hs(r){var e;return{cleaned:r.replace(lt,""),encoded:((e=r.match(lt))==null?void 0:e[0])||""}}function ds(r){return r&&JSON.parse(hs(JSON.stringify(r)).cleaned)}function ps(r){return ds(r)}const ys="drafts",ms="versions",Y=".",fe=`${ys}${Y}`,tr=`${ms}${Y}`;function ge(r){return r.startsWith(fe)}function be(r){return r.startsWith(tr)}function rr(r){if(be(r)){const e=we(r);return fe+e}return ge(r)?r:fe+r}function se(r,e){if(e==="drafts"||e==="published")throw new Error('Version can not be "published" or "drafts"');return`${tr}${e}${Y}${we(r)}`}function nr(r){if(!be(r))return;const[e,t,...n]=r.split(Y);return t}function we(r){return be(r)?r.split(Y).slice(2).join(Y):ge(r)?r.slice(fe.length):r}let vs=r=>crypto.getRandomValues(new Uint8Array(r)),gs=(r,e,t)=>{let n=(2<<Math.log(r.length-1)/Math.LN2)-1,s=-~(1.6*n*e/r.length);return(i=e)=>{if(i<=0)return"";let o="";for(;;){let a=t(s),c=s|0;for(;c--;)if(o+=r[a[c]&n]||"",o.length===i)return o}}},bs=(r,e=21)=>gs(r,e,vs);const ft=/\r\n|[\n\r\u2028\u2029]/;function ws(r,e,t){const n=r.split(ft),s={start:ht(e.start,n),end:e.end?ht(e.end,n):void 0},{start:i,end:o,markerLines:a}=Es(s,n),c=`${o}`.length;return r.split(ft,o).slice(i,o).map((u,l)=>{const d=i+1+l,y=` ${` ${d}`.slice(-c)} |`,f=a[d],p=!a[d+1];if(!f)return` ${y}${u.length>0?` ${u}`:""}`;let h="";if(Array.isArray(f)){const m=u.slice(0,Math.max(f[0]-1,0)).replace(/[^\t]/g," "),w=f[1]||1;h=[` 7 `,y.replace(/\d/g," ")," ",m,"^".repeat(w)].join(""),p&&t&&(h+=" "+t)}return[">",y,u.length>0?` ${u}`:"",h].join("")}).join(` 8`)}function Es(r,e){const t={...r.start},n={...t,...r.end},s=2,i=3,o=t.line??-1,a=t.column??0,c=n.line,u=n.column;let l=Math.max(o-(s+1),0),d=Math.min(e.length,c+i);o===-1&&(l=0),c===-1&&(d=e.length);const y=c-o,f={};if(y)for(let p=0;p<=y;p++){const h=p+o;if(!a)f[h]=!0;else if(p===0){const m=e[h-1].length;f[h]=[a,m-a+1]}else if(p===y)f[h]=[0,u];else{const m=e[h-p].length;f[h]=[0,m]}}else a===u?a?f[o]=[a,0]:f[o]=!0:f[o]=[a,u-a];return{start:l,end:d,markerLines:f}}function ht(r,e){let t=0;for(let n=0;n<e.length;n++){const s=e[n].length+1;if(t+s>r)return{line:n+1,column:r-t};t+=s}return{line:e.length,column:e[e.length-1]?.length??0}}const Oe=5;class Cs extends Error{response;statusCode=400;responseBody;details;constructor(e,t){const n=sr(e,t);super(n.message),Object.assign(this,n)}}class Is extends Error{response;statusCode=500;responseBody;details;constructor(e){const t=sr(e);super(t.message),Object.assign(this,t)}}function sr(r,e){const t=r.body,n={response:r,statusCode:r.statusCode,responseBody:_s(t,r),message:"",details:void 0};if(!Kt(t))return n.message=Te(r,t),n;const s=t.error;if(typeof s=="string"&&typeof t.message=="string")return n.message=`${s} - ${t.message}`,n;if(typeof s!="object"||s===null)return typeof s=="string"?n.message=s:typeof t.message=="string"?n.message=t.message:n.message=Te(r,t),n;if(Ss(s)||As(s)){const i=s.items||[],o=i.slice(0,Oe).map(c=>c.error?.description).filter(Boolean);let a=o.length?`: 9- ${o.join(` 10- `)}`:"";return i.length>Oe&&(a+=` 11...and ${i.length-Oe} more`),n.message=`${s.description}${a}`,n.details=t.error,n}if(ir(s)){const i=e?.options?.query?.tag;return n.message=or(s,i),n.details=t.error,n}return"description"in s&&typeof s.description=="string"?(n.message=s.description,n.details=s,n):(n.message=Te(r,t),n)}function Ss(r){return"type"in r&&r.type==="mutationError"&&"description"in r&&typeof r.description=="str
11ing"}function As(r){return"type"in r&&r.type==="actionError"&&"description"in r&&typeof r.description=="string"}function ir(r){return Kt(r)&&r.type==="queryParseError"&&typeof r.query=="string"&&typeof r.start=="number"&&typeof r.end=="number"}function or(r,e){const{query:t,start:n,end:s,description:i}=r;if(!t||typeof n>"u")return`GROQ query parse error: ${i}`;const o=e?` 12 13Tag: ${e}`:"";return`GROQ query parse error: 14${ws(t,{start:n,end:s},i)}${o}`}function Te(r,e){const t=typeof e=="string"?` (${$s(e,100)})`:"",n=r.statusMessage?` ${r.statusMessage}`:"";return`${r.method}-request to ${r.url} resulted in HTTP ${r.statusCode}${n}${t}`}function _s(r,e){return(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")!==-1?JSON.stringify(r,null,2):r}function $s(r,e){return r.length>e?`${r.slice(0,e)}â¦`:r}class xs 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(typeof location<"u"){const{origin:n}=location;t.searchParams.set("cors","add"),t.searchParams.set("origin",n),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}`}}const Os={onResponse:(r,e)=>{if(r.statusCode>=500)throw new Is(r);if(r.statusCode>=400)throw new Cs(r,e);return r}};function Ts(r={}){const e={},t=n=>r.ignoreWarnings===void 0?!1:(Array.isArray(r.ignoreWarnings)?r.ignoreWarnings:[r.ignoreWarnings]).some(s=>typeof s=="string"?n.includes(s):s instanceof RegExp?s.test(n):!1);return{onResponse:n=>{const s=n.headers["x-sanity-warning"],i=Array.isArray(s)?s:[s];for(const o of i)!o||e[o]||t(o)||(e[o]=!0,console.warn(o));return n}}}function dt(r,e={}){return en([Fe({shouldRetry:Rs}),...r,Ts(e),on(),an(),ln(),Os,cn({implementation:S})])}function Rs(r,e,t){if(t.maxRetries===0)return!1;const n=t.method==="GET"||t.method==="HEAD",s=(t.uri||t.url).startsWith("/data/query"),i=r.response&&(r.response.statusCode===429||r.response.statusCode===502||r.response.statusCode===503);return(n||s)&&i?!0:Fe.shouldRetry(r,e,t)}const js="https://www.sanity.io/help/";function We(r){return js+r}const pt=["image","file"],yt=["before","after","replace"],ar=r=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(r))throw new Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},Ps=r=>{if(!/^[-a-z0-9]+$/i.test(r))throw new Error("`projectId` can only contain only a-z, 0-9 and dashes")},qs=r=>{if(pt.indexOf(r)===-1)throw new Error(`Invalid asset type: ${r}. Must be one of ${pt.join(", ")}`)},ee=(r,e)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`${r}() takes an object of properties`)},he=(r,e)=>{if(typeof e!="string"||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(e)||e.includes(".."))throw new Error(`${r}(): "${e}" is not a valid document ID`)},J=(r,e)=>{if(!e._id)throw new Error(`${r}() requires that the document contains an ID ("_id" property)`);he(r,e._id)},Fs=(r,e)=>{if(typeof e!="string")throw new Error(`\`${r}()\`: \`${e}\` is not a valid document type`)},ur=(r,e)=>{if(!e._type)throw new Error(`\`${r}()\` requires that the document contains a type (\`_type\` property)`);Fs(r,e._type)},Ds=(r,e)=>{if(e._id&&e._id!==r)throw new Error(`The provided document ID (\`${e._id}\`) does not match the generated version ID (\`${r}\`)`)},ks=(r,e,t)=>{const n="insert(at, selector, items)";if(yt.indexOf(r)===-1){const s=yt.map(i=>`"${i}"`).join(", ");throw new Error(`${n} takes an "at"-argument which is one of: ${s}`)}if(typeof e!="string")throw new Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(t))throw new Error(`${n} takes an "items"-argument which must be an array`)},N=r=>{if(!r.dataset)throw new Error("`dataset` must be provided to perform queries");return r.dataset||""},cr=r=>{if(typeof r!="string"||!/^[a-z0-9._-]{1,75}$/i.test(r))throw new Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return r},lr=r=>{if(!r["~experimental_resource"])throw new Error("`resource` must be provided to perform resource queries");const{type:e,id:t}=r["~experimental_resource"];switch(e){case"dataset":{if(t.split(".").length!==2)throw new Error('Dataset resource ID must be in the format "project.dataset"');return}case"dashboard":case"media-library":case"canvas":return;default:throw new Error(`Unsupported resource type: ${e.toString()}`)}},M=(r,e)=>{if(e["~experimental_resource"])throw new Error(`\`${r}\` does not support resource-based operations`)};function Ms(r){let e=!1,t;return(...n)=>(e||(t=r(...n),e=!0),t)}const k=r=>Ms((...e)=>console.warn(r.join(" "),...e)),Ls=k(["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"]),Vs=k(["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."]),Us=k(["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."]),Ns=k(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),Ws=k(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${We("js-client-browser-token")} for more information and how to hide this warning.`]),Bs=k(["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`."]),zs=k(["Using the Sanity client without specifying an API version is deprecated.",`See ${We("js-client-api-version")}`]),Hs=k(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."]),Gs="apicdn.sanity.io",te={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},Qs=["localhost","127.0.0.1","0.0.0.0"],Ys=r=>Qs.indexOf(r)!==-1;
14function Js(r){if(r==="1"||r==="X")return;const e=new Date(r);if(!(/^\d{4}-\d{2}-\d{2}$/.test(r)&&e instanceof Date&&e.getTime()>0))throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}function fr(r){if(Array.isArray(r)&&r.length>1&&r.includes("raw"))throw new TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}const hr=(r,e)=>{const t={...e,...r,stega:{...typeof e.stega=="boolean"?{enabled:e.stega}:e.stega||te.stega,...typeof r.stega=="boolean"?{enabled:r.stega}:r.stega||{}}};t.apiVersion||zs();const n={...te,...t},s=n.useProjectHostname&&!n["~experimental_resource"];if(typeof Promise>"u"){const y=We("js-client-promise-polyfill");throw new Error(`No native Promise-implementation found, polyfill needed - see ${y}`)}if(s&&!n.projectId)throw new Error("Configuration must contain `projectId`");if(n["~experimental_resource"]&&lr(n),typeof n.perspective<"u"&&fr(n.perspective),"encodeSourceMap"in n)throw new Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in n)throw new Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?");if(typeof n.stega.enabled!="boolean")throw new Error(`stega.enabled must be a boolean, received ${n.stega.enabled}`);if(n.stega.enabled&&n.stega.studioUrl===void 0)throw new Error("stega.studioUrl must be defined when stega.enabled is true");if(n.stega.enabled&&typeof n.stega.studioUrl!="string"&&typeof n.stega.studioUrl!="function")throw new Error(`stega.studioUrl must be a string or a function, received ${n.stega.studioUrl}`);const i=typeof window<"u"&&window.location&&window.location.hostname,o=i&&Ys(window.location.hostname),a=!!n.token;n.withCredentials&&a&&(Bs(),n.withCredentials=!1),i&&o&&a&&n.ignoreBrowserTokenWarning!==!0?Ws():typeof n.useCdn>"u"&&Vs(),s&&Ps(n.projectId),n.dataset&&ar(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?cr(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===te.apiHost,n.useCdn===!0&&n.withCredentials&&Ls(),n.useCdn=n.useCdn!==!1&&!n.withCredentials,Js(n.apiVersion);const c=n.apiHost.split("://",2),u=c[0],l=c[1],d=n.isDefaultApi?Gs:l;return s?(n.url=`${u}://${n.projectId}.${l}/v${n.apiVersion}`,n.cdnUrl=`${u}://${n.projectId}.${d}/v${n.apiVersion}`):(n.url=`${n.apiHost}/v${n.apiVersion}`,n.cdnUrl=n.url),n};class dr extends Error{name="ConnectionFailedError"}class Xs extends Error{name="DisconnectError";reason;constructor(e,t,n={}){super(e,n),this.reason=t}}
14class Ks extends Error{name="ChannelError";data;constructor(e,t){super(e),this.data=t}}class Zs extends Error{name="MessageError";data;constructor(e,t,n={}){super(e,n),this.data=t}}class mt extends Error{name="MessageParseError"}const ei=["channelError","disconnect"];function pr(r,e){return Qt(()=>{const t=r();return Yn(t)?t:z(t)}).pipe(V(t=>ti(t,e)))}function ti(r,e){return new S(t=>{const n=e.includes("open"),s=e.includes("reconnect");function i(u){if("data"in u){const[l,d]=vt(u);t.error(l?new mt("Unable to parse EventSource error message",{cause:d}):new Zs((d?.data).message,d));return}r.readyState===r.CLOSED?t.error(new dr("EventSource connection failed")):s&&t.next({type:"reconnect"})}function o(){t.next({type:"open"})}function a(u){const[l,d]=vt(u);if(l){t.error(new mt("Unable to parse EventSource message",{cause:l}));return}if(u.type==="channelError"){const y=new URL(r.url).searchParams.get("tag");t.error(new Ks(ri(d?.data,y),d.data));return}if(u.type==="disconnect"){t.error(new Xs(`Server disconnected client: ${d.data?.reason||"unknown error"}`));return}t.next({type:u.type,id:u.lastEventId,...d.data?{data:d.data}:{}})}r.addEventListener("error",i),n&&r.addEventListener("open",o);const c=[...new Set([...ei,...e])].filter(u=>u!=="error"&&u!=="open"&&u!=="reconnect");return c.forEach(u=>r.addEventListener(u,a)),()=>{r.removeEventListener("error",i),n&&r.removeEventListener("open",o),c.forEach(u=>r.removeEventListener(u,a)),r.close()}})}function vt(r){try{const e=typeof r.data=="string"&&JSON.parse(r.data);return[null,{type:r.type,id:r.lastEventId,...ni(e)?{}:{data:e}}]}catch(e){return[e,null]}}function ri(r,e){const t=r.error;return t?ir(t)?or(t,e):t.description?t.description:typeof t=="string"?t:JSON.stringify(t,null,2):r.message||"Unknown listener error"}function ni(r){for(const e in r)return!1;return!0}function yr(r){if(typeof r=="string")return{id:r};if(Array.isArray(r))return{query:"*[_id in $ids]",params:{ids:r}};if(typeof r=="object"&&r!==null&&"query"in r&&typeof r.query=="string")return"params"in r&&typeof r.params=="object"&&r.params!==null?{query:r.query,params:r.params}:{query:r.query};const e=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(` 15`);throw new Error(`Unknown selection - must be one of: 16 17${e}`)}class mr{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 ee("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw new Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,t,n){return ks(e,t,n),this._assign("insert",{[e]:t,items:n})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,n,s){const i=typeof n>"u"||n===-1,o=t<0?t-1:t,a=i?-1:Math.max(0,t+n),c=o<0&&a>=0?"":a,u=`${e}[${o}:${c}]`;return this.insert("replace",u,s||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...yr(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,n=!0){return ee(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},n&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}}class U extends mr{#t;constructor(e,t,n){super(e,t),this.#t=n}clone(){return new U(this.selection,{...this.operations},this.#t)}commit(e){if(!this.#t)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");const t=typeof this.selection=="string",n=Object.assign({returnFirst:t,returnDocuments:!0},e);return this.#t.mutate({patch:this.serialize()},n)}}class F extends mr{#t;constructor(e,t,n){super(e,t),this.#t=n}clone(){return new F(this.selection,{...this.operations},this.#t)}commit(e){if(!this.#t)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");
17const t=typeof this.selection=="string",n=Object.assign({returnFirst:t,returnDocuments:!0},e);return this.#t.mutate({patch:this.serialize()},n)}}const vr={returnDocuments:!1};class gr{operations;trxId;constructor(e=[],t){this.operations=e,this.trxId=t}create(e){return ee("create",e),this._add({create:e})}createIfNotExists(e){const t="createIfNotExists";return ee(t,e),J(t,e),this._add({[t]:e})}createOrReplace(e){const t="createOrReplace";return ee(t,e),J(t,e),this._add({[t]:e})}delete(e){return he("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 Ee extends gr{#t;constructor(e,t,n){super(e,n),this.#t=t}clone(){return new Ee([...this.operations],this.#t,this.trxId)}commit(e){if(!this.#t)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#t.mutate(this.serialize(),Object.assign({transactionId:this.trxId},vr,e||{}))}patch(e,t){const n=typeof t=="function",s=typeof e!="string"&&e instanceof F,i=typeof e=="object"&&("query"in e||"id"in e);if(s)return this._add({patch:e.serialize()});if(n){const o=t(new F(e,{},this.#t));if(!(o instanceof F))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:o.serialize()})}if(i){const o=new F(e,t||{},this.#t);return this._add({patch:o.serialize()})}return this._add({patch:{id:e,...t}})}}class Ce extends gr{#t;constructor(e,t,n){super(e,n),this.#t=t}clone(){return new Ce([...this.operations],this.#t,this.trxId)}commit(e){if(!this.#t)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#t.mutate(this.serialize(),Object.assign({transactionId:this.trxId},vr,e||{}))}patch(e,t){const n=typeof t=="function";if(typeof e!="string"&&e instanceof U)return this._add({patch:e.serialize()});if(n){const s=t(new U(e,{},this.#t));if(!(s instanceof U))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:s.serialize()})}return this._add({patch:{id:e,...t}})}}const si="X-Sanity-Project-ID";function ii(r,e={}){const t={};r.headers&&Object.assign(t,r.headers);const n=e.token||r.token;n&&(t.Authorization=`Bearer ${n}`),!e.useGlobalApi&&!r.useProjectHostname&&r.projectId&&(t[si]=r.projectId);const s=!!(typeof e.withCredentials>"u"?r.withCredentials:e.withCredentials),i=typeof e.timeout>"u"?r.timeout:e.timeout;return Object.assign({},e,{headers:Object.assign({},t,e.headers||{}),timeout:typeof i>"u"?300*1e3:i,proxy:e.proxy||r.proxy,json:!0,withCredentials:s,fetch:typeof e.fetch=="object"&&typeof r.fetch=="object"?{...r.fetch,...e.fetch}:e.fetch||r.fetch})}const br=({query:r,params:e={},options:t={}})=>{const n=new URLSearchParams,{tag:s,includeMutations:i,returnQuery:o,...a}=t;s&&n.append("tag",s),n.append("query",r);for(const[c,u]of Object.entries(e))u!==void 0&&n.append(`$${c}`,JSON.stringify(u));for(const[c,u]of Object.entries(a))u&&n.append(c,`${u}`);return o===!1&&n.append("returnQuery","false"),i===!1&&n.append("includeMutations","false"),`?${n}`},oi=(r,e)=>r===!1?void 0:typeof r>"u"?e:r,ai=(r={})=>({dryRun:r.dryRun,returnIds:!0,returnDocuments:oi(r.returnDocuments,!0),visibility:r.visibility||"sync",autoGenerateArrayKeys:r.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:r.skipCrossDatasetReferenceValidation}),Be=r=>r.type==="response",ui=r=>r.body,ci=(r,e)=>r.reduce((t,n)=>(t[e(n)]=n,t),Object.create(null)),li=11264;function wr(r,e,t,n,s={},i={}){const o="stega"in i?{...t||{},...typeof i.stega=="boolean"?{enabled:i.stega}:i.stega||{}}:t,a=o.enabled?ps(s):s,c=i.filterResponse===!1?p=>p:p=>p.result,{cache:u,next:l,...d}={useAbortSignal:typeof i.signal<"u",resultSourceMap:o.enabled?"withKeyArraySelector":i.resultSourceMap,...i,returnQuery:i.filterResponse===!1&&i.returnQuery!==!1},y=typeof u<"u"||typeof l<"u"?{...d,fetch:{cache:u,next:l}}:d,f=W(r,e,"query",{query:n,params:a},y);return o.enabled?f.pipe(us(ne(wt(()=>import("./stegaEncodeSourceMap-sl4ofCY7.js"),[]).then(function(p){return p.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:p})=>p))),_(([p,h])=>{const m=h(p.result,p.resultSourceMap,o);return c({...p,result:m})})):f.pipe(_(c))}function X(r,e,t,n={}){const s=(()=>
17{if(!n.releaseId)return t;const o=nr(t);if(!o){if(ge(t))throw new Error(`The document ID (\`${t}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return se(t,n.releaseId)}if(o!==n.releaseId)throw new Error(`The document ID (\`${t}\`) is already a version of \`${o}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return t})(),i={uri:O(r,"doc",s),json:!0,tag:n.tag,signal:n.signal,query:n.includeAllVersions!==void 0?{includeAllVersions:n.includeAllVersions}:void 0};return oe(r,e,i).pipe(K(Be),_(o=>{const a=o.body.documents;return a?n.includeAllVersions?a:a[0]:n.includeAllVersions?[]:void 0}))}function Er(r,e,t,n={}){const s={uri:O(r,"doc",t.join(",")),json:!0,tag:n.tag,signal:n.signal};return oe(r,e,s).pipe(K(Be),_(i=>{const o=ci(i.body.documents||[],a=>a._id);return t.map(a=>o[a]||null)}))}function Cr(r,e,t,n={}){return W(r,e,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:t}},n)}function Ir(r,e,t,n){return J("createIfNotExists",t),Ie(r,e,t,"createIfNotExists",n)}function Sr(r,e,t,n){return J("createOrReplace",t),Ie(r,e,t,"createOrReplace",n)}function Ar(r,e,t,n,s){return J("createVersion",t),ur("createVersion",t),Hs(),C(r,e,{actionType:"sanity.action.document.version.create",publishedId:n,document:t},s)}function _r(r,e,t,n,s,i,o){if(!n)throw new Error("`createVersion()` requires `baseId` when no `document` is provided");if(!t)throw new Error("`createVersion()` requires `publishedId` when `baseId` is provided");he("createVersion",n),he("createVersion",t);const a={actionType:"sanity.action.document.version.create",publishedId:t,baseId:n,versionId:s?se(t,s):rr(t),ifBaseRevisionId:i};return C(r,e,a,o)}function $r(r,e,t,n){return W(r,e,"mutate",{mutations:[{delete:yr(t)}]},n)}function xr(r,e,t,n=!1,s){return C(r,e,{actionType:"sanity.action.document.version.discard",versionId:t,purge:n},s)}function Or(r,e,t,n){return J("replaceVersion",t),ur("replaceVersion",t),C(r,e,{actionType:"sanity.action.document.version.replace",document:t},n)}function Tr(r,e,t,n,s){return C(r,e,{actionType:"sanity.action.document.version.unpublish",versionId:t,publishedId:n},s)}function Rr(r,e,t,n){let s;t instanceof F||t instanceof U?s={patch:t.serialize()}:t instanceof Ee||t instanceof Ce?s=t.serialize():s=t;const i=Array.isArray(s)?s:[s],o=n&&n.transactionId||void 0;return W(r,e,"mutate",{mutations:i,transactionId:o},n)}function C(r,e,t,n){const s=Array.isArray(t)?t:[t],i=n&&n.transactionId||void 0,o=n&&n.skipCrossDatasetReferenceValidation||void 0,a=n&&n.dryRun||void 0;return W(r,e,"actions",{actions:s,transactionId:i,skipCrossDatasetReferenceValidation:o,dryRun:a},n)}function W(r,e,t,n,s={}){const i=t==="mutate",o=t==="actions",a=t==="query",c=i||o?"":br(n),u=!i&&!o&&c.length<li,l=u?c:"",d=s.returnFirst,{timeout:y,token:f,tag:p,headers:h,returnQuery:m,lastLiveEventId:w,cacheMode:g}=s,v=O(r,t,l),I={method:u?"GET":"POST",uri:v,json:!0,body:u?void 0:n,query:i&&ai(s),timeout:y,headers:h,token:f,tag:p,returnQuery:m,perspective:s.perspective,resultSourceMap:s.resultSourceMap,lastLiveEventId:Array.isArray(w)?w[0]:w,cacheMode:g,canUseCdn:a,signal:s.signal,fetch:s.fetch,useAbortSignal:s.useAbortSignal,useCdn:s.useCdn};return oe(r,e,I).pipe(K(Be),_(ui),_($=>{if(!i)return $;const x=$.results||[];if(s.returnDocuments)return d?x[0]&&x[0].document:x.map(Se=>Se.document);const Wr=d?"documentId":"documentIds",Br=d?x[0]&&x[0].id:x.map(Se=>Se.id);return{transactionId:$.transactionId,results:x,[Wr]:Br}}))}function Ie(r,e,t,n,s={}){const i={[n]:t},o=Object.assign({returnFirst:!0,returnDocuments:!0},s);return W(r,e,"mutate",{mutations:[i]},o)}const ie=r=>r.config().dataset!==void 0&&r.config().projectId!==void 0||r.config()["~experimental_resource"]!==void 0,jr=(r,e)=>ie(r)&&e.startsWith(O(r,"query")),fi=(r,e)=>ie(r)&&e.startsWith(O(r,"mutate")),hi=(r,e)=>ie(r)&&e.startsWith(O(r,"doc","")),di=(r,e)=>ie(r)&&e.startsWith(O(r,"listen")),pi=(r,e)=>ie(r)&&e.startsWith(O(r,"history","")),yi=(r,e)=>e.startsWith("/data/")||jr(r,e)||fi(r,e)||hi(r,e)||di(r,e)||pi(r,e);function oe(r,e,t){const n=t.url||t.uri,s=r.config(),i=typeof t.canUseCdn>"u"?["GET","HEAD"].indexOf(t.method||"GET")>=0&&yi(r,n):t.canUseCdn;let o=(t.useCdn??s.useCdn)&&i;const a=t.tag&&s.requestTagPrefix?[s.requestTagPrefix,t.tag].join("."):t.tag||s.requestTagPrefix;if(a&&t.tag!==null&&(t.query={tag:cr(a),...t.query}),["GET","HEAD","POST"].indexOf(t.method||"GET")>=0&&jr(r,n)){const l=t.resultSourceMap??s.resultSourceMap;l!==void 0&&l!==!1&&(t.query={resultSourceMap:l,...t.query});const d=t.perspective||s.perspective;typeof d<"u"&&(d==="previewDrafts"&&Ns(),fr(d),t.query={perspective:Array.isArray(d)?d.join(","):d,...t.query},(Array.isArray(d)&&d.length>0||d==="previewDrafts"||d==="drafts")&&o&&(o=!1,Us())),t.lastLiveEventId&&(t.query={...t.query,lastLiveEventId:t.lastLiveEventId}),t.returnQuery===!1&&(t.query={returnQuery:"false",...t.query}),o&&t.cacheMode=="noStale"&&(t.query={cacheMode:"noStale",...t.query})}const c=ii(s,Object.assign({},t,{url:ze(r,n,o)})),u=new S(l=>e(c,s.requester).subscribe(l));return t.signal?u.pipe(mi(t.signal)):u}function A(r,e,t){return oe(r,e,t).pipe(K(n=>n.type==="response"),_(n=>n.body))}function O(r,e,t){const n=r.config();if(n["~experimental_resource"]){lr(n);const o=bi(n),a=t!==void 0?`${e}/${t}`:e;return`${o}/${a}`.replace(/\/($|\?)/,"$1")}const s=N(n),i=`/${e}/${s}`;return`/data${t!==void 0?`${i}/${t}`:i}`.replace(/\/($|\?)/,"$1")}function ze(r,e,t=!1){const{url:n,cdnUrl:s}=r.config();return`${t?s:n}/${e.replace(/^\//,"")}`}function mi(r){return e=>new S(t=>{const n=()=>t.error(gi(r));if(r&&r.aborted){n();return}const s=e.subscribe(t);return r.addEventListener("abort",n),()=>{r.removeEventListener("abort",n),s.unsubscribe()}})}const vi=!!globalThis.DOMException;function gi(r){if(vi)return new DOMException(r?.reason??"The operation was aborted.","AbortError");const e=new Error(r?.reason??"The operation was aborted.");return e.name="AbortError",e}const bi=r=>
17{if(!r["~experimental_resource"])throw new Error("`resource` must be provided to perform resource queries");const{type:e,id:t}=r["~experimental_resource"];switch(e){case"dataset":{const n=t.split(".");if(n.length!==2)throw new Error('Dataset ID must be in the format "project.dataset"');return`/projects/${n[0]}/datasets/${n[1]}`}case"canvas":return`/canvases/${t}`;case"media-library":return`/media-libraries/${t}`;case"dashboard":return`/dashboards/${t}`;default:throw new Error(`Unsupported resource type: ${e.toString()}`)}};function Pr(r,e,t){const n=N(r.config());return A(r,e,{method:"POST",uri:`/agent/action/generate/${n}`,body:t})}function wi(r,e,t){const n=N(r.config());return A(r,e,{method:"POST",uri:`/agent/action/patch/${n}`,body:t})}function Ei(r,e,t){const n=N(r.config());return A(r,e,{method:"POST",uri:`/agent/action/prompt/${n}`,body:t})}function qr(r,e,t){const n=N(r.config());return A(r,e,{method:"POST",uri:`/agent/action/transform/${n}`,body:t})}function Fr(r,e,t){const n=N(r.config());return A(r,e,{method:"POST",uri:`/agent/action/translate/${n}`,body:t})}class Ci{#t;#e;constructor(e,t){this.#t=e,this.#e=t}generate(e){return Pr(this.#t,this.#e,e)}transform(e){return qr(this.#t,this.#e,e)}translate(e){return Fr(this.#t,this.#e,e)}}class Ii{#t;#e;constructor(e,t){this.#t=e,this.#e=t}generate(e){return b(Pr(this.#t,this.#e,e))}transform(e){return b(qr(this.#t,this.#e,e))}translate(e){return b(Fr(this.#t,this.#e,e))}prompt(e){return b(Ei(this.#t,this.#e,e))}patch(e){return b(wi(this.#t,this.#e,e))}}class Si{#t;#e;constructor(e,t){this.#t=e,this.#e=t}upload(e,t,n){return Dr(this.#t,this.#e,e,t,n)}}class Ai{#t;#e;constructor(e,t){this.#t=e,this.#e=t}upload(e,t,n){const s=Dr(this.#t,this.#e,e,t,n);return b(s.pipe(K(i=>i.type==="response"),_(i=>i.body.document)))}}function Dr(r,e,t,n,s={}){qs(t);let i=s.extract||void 0;i&&!i.length&&(i=["none"]);const o=r.config(),a=$i(s,n),{tag:c,label:u,title:l,description:d,creditLine:y,filename:f,source:p}=a,h={label:u,title:l,description:d,filename:f,meta:i,creditLine:y};return p&&(h.sourceId=p.id,h.sourceName=p.name,h.sourceUrl=p.url),oe(r,e,{tag:c,method:"POST",timeout:a.timeout||0,uri:_i(o,t),headers:a.contentType?{"Content-Type":a.contentType}:{},query:h,body:n})}function _i(r,e){const t=e==="image"?"images":"files";if(r["~experimental_resource"]){const{type:s,id:i}=r["~experimental_resource"];switch(s){case"dataset":throw new Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${i}/assets/${t}`;case"media-library":return`/media-libraries/${i}/upload`;case"dashboard":return`/dashboards/${i}/assets/${t}`;default:throw new Error(`Unsupported resource type: ${s.toString()}`)}}const n=N(r);return`assets/${t}/${n}`}function $i(r,e){return typeof File>"u"||!(e instanceof File)?r:Object.assign({filename:r.preserveFilename===!1?void 0:e.name,contentType:e.type},r)}var xi=(r,e)=>Object.keys(e).concat(Object.keys(r)).reduce((t,n)=>(t[n]=typeof r[n]>"u"?e[n]:r[n],t),{});const Oi=(r,e)=>e.reduce((t,n)=>(typeof r[n]>"u"||(t[n]=r[n]),t),{}),kr=Qt(()=>wt(()=>import("./browser-CipVhaGa.js").then(r=>r.b),__vite__mapDeps([0,1]))).pipe(_(({default:r})=>r),cs(1));function Mr(){return function(r){return r.pipe(le((e,t)=>e instanceof dr?ns(z({type:"reconnect"}),ss(1e3).pipe(V(()=>t))):zt(()=>e)))}}const Ti=14800,Ri=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","tag"],ji={includeResult:!0};function Lr(r,e,t={}){const{url:n,token:s,withCredentials:i,requestTagPrefix:o,headers:a}=this.config(),c=t.tag&&o?[o,t.tag].join("."):t.tag,u={...xi(t,ji),tag:c},l=Oi(u,Ri),d=br({query:r,params:e,options:{tag:c,...l}}),y=`${n}${O(this,"listen",d)}`;if(y.length>Ti)return zt(()=>new Error("Query too large for listener"));const f=u.events?u.events:["mutation"],p={};return i&&(p.withCredentials=!0),(s||a)&&(p.headers={},s&&(p.headers.Authorization=`Bearer ${s}`),a&&Object.assign(p.headers,a)),pr(()=>(typeof EventSource>"u"||p.headers?kr:z(EventSource)).pipe(_(h=>new h(y,p))),f).pipe(Mr(),K(h=>f.includes(h.type)),_(h=>({type:h.type,..."data"in h?h.data:{}})))}function Pi(r,e){return qi(typeof r=="function"?{predicate:r,...e}:r)}function qi(r){return e=>{let t,n=!1;const{predicate:s,...i}=r,o=e.pipe(ls(c=>{r.predicate(c)&&(n=!0,t=c)}),Jt(()=>{n=!1,t=void 0}),Xt(i)),a=new S(c=>{n&&c.next(t),c.complete()});return is(o,a)}}const gt="2021-03-25";class Vr{#t;constructor(e){this.#t=e}events({includeDrafts:e=!1,tag:t}={}){M("live",this.#t.config());const{projectId:n,apiVersion:s,token:i,withCredentials:o,requestTagPrefix:a,headers:c}=this.#t.config(),u=s.replace(/^v/,"");if(u!=="X"&&u<gt)throw new Error(`The live events API requires API version ${gt} or later. The current API version is ${u}. Please update your API version to use this feature.`);if(e&&!i&&!o)throw new Error("The live events API requires a token or withCredentials when 'includeDrafts: true'. Please update your client configuration. The token should have the lowest possible access role.");const l=O(this.#t,"live/events"),d=new URL(this.#t.getUrl(l,!1)),y=t&&a?[a,t].join("."):t;y&&d.searchParams.set("tag",y),e&&d.searchParams.set("includeDrafts","true");const f={};e&&o&&(f.withCredentials=!0),(e&&i||c)&&(f.headers={},e&&i&&(f.headers.Authorization=`Bearer ${i}`),c&&Object.assign(f.headers,c));const p=`${d.href}::${JSON.stringify(f)}`,h=Re.get(p);if(h)return h;const m=pr(()=>(typeof EventSource>"u"||f.headers?kr:z(EventSource)).pipe(_(v=>new v(d.href,f))),["message","restart","welcome","reconnect","goaway"]),w=Fi(d,{method:"OPTIONS",mode:"cors",credentials:f.withCredentials?"include":"omit",headers:f.headers}).pipe(le(()=>{throw new xs({projectId:n})})),g=m.pipe(Mr(),V(v=>v.type==="reconnect"?w.pipe(V(()=>z(v))):z(v)),le(v=>w.pipe(V(()=>{throw v}))),_(v=>{if(v.type==="message"){const{data:I,...$}=v;return{...$,tags:I.tags}}return v})).pipe(Jt(()=>Re.delete(p)),Pi({predicate:v=>v.type==="welcome"}));return Re.set(p,g),g}}function Fi(r,e){return new S(t=>{const n=new AbortController,s=n.signal;return fetch(r,{...e,signal:n.signal}).then(i=>{t.next(i),t.complete()},i=>{s.aborted||t.error(i)}),()=>n.abort()})}const Re=new Map;class Di{#t;#e;constructor(e,t){this.#t=e,this.#e=t}create(e,t){return H(this.#t,this.#e,"PUT",e,t)}edit(e,t){return H(this.#t,this.#e,"PATCH",e,t)}delete(e){return H(this.#t,this.#e,"DELETE",e)}list(){M("dataset",this.#t.config());const e=this.#t.config(),t=e.projectId;let n="/datasets";return e.useProjectHostname===!1&&(n=`/projects/${t}/datasets`),A(this.#t,this.#e,{uri:n,tag:null})}}class ki{#t;#e;constructor(e,t){this.#t=e,this.#e=t}create(e,t){return M("dataset",this.#t.config()),b(H(this.#t,this.#e,"PUT",e,t))}edit(e,t){return M("dataset",this.#t.config()),b(H(this.#t,this.#e,"PATCH",e,t))}delete(e){return M("dataset",this.#t.config()),b(H(this.#t,this.#e,"DELETE",e))}list(){M("dataset",this.#t.config());const e=this.#t.config(),t=e.projectId;let n="/datasets";return e.useProjectHostname===!1&&(n=`/projects/${t}/datasets`),b(A(this.#t,this.#e,{uri:n,tag:null}))}}function H(r,e,t,n,s){return M("dataset",r.config()),ar(n),A(r,e,{method:t,uri:`/datasets/${n}`,body:s,tag:null})}class Ur{#t;#e;constructor(e,t){this.#t=e,this.#e=t}getPlaybackInfo(e,t={}){const n=this.#t.config()["~experimental_resource"]?.id,{instanceId:s,library
17Id:i}=Ui(e),o=i||n;if(!o)throw new Error("Could not determine Media Library ID - you need to provide a valid Media Library ID in the client config or a Media Library GDR");const a=Ni(s,o),c=Wi(t);return A(this.#t,this.#e,{method:"GET",uri:a,query:c})}}class Mi{#t;#e;constructor(e,t){this.#t=e,this.#e=t}getPlaybackInfo(e,t={}){return b(new Ur(this.#t.observable,this.#e).getPlaybackInfo(e,t))}}const Li=/^media-library:(ml[^:]+):([^:]+)$/;function Vi(r){return typeof r=="object"&&"_ref"in r}function Ui(r){const e=Vi(r)?r._ref:r,t=Li.exec(e);if(t){const[,n,s]=t;return{libraryId:n,instanceId:s}}if(typeof r=="string"&&r.startsWith("video-"))return{instanceId:r};throw new Error(`Invalid video asset instance identifier "${e}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}function Ni(r,e){return`/media-libraries/${e}/video/${r}/playback-info`}function Wi(r){const e={};if(r.transformations){const{thumbnail:t,animated:n,storyboard:s}=r.transformations;t&&(t.width&&(e.thumbnailWidth=t.width),t.height&&(e.thumbnailHeight=t.height),t.time!==void 0&&(e.thumbnailTime=t.time),t.fit&&(e.thumbnailFit=t.fit),t.format&&(e.thumbnailFormat=t.format)),n&&(n.width&&(e.animatedWidth=n.width),n.height&&(e.animatedHeight=n.height),n.start!==void 0&&(e.animatedStart=n.start),n.end!==void 0&&(e.animatedEnd=n.end),n.fps&&(e.animatedFps=n.fps),n.format&&(e.animatedFormat=n.format)),s&&s.format&&(e.storyboardFormat=s.format)}return r.expiration&&(e.expiration=r.expiration),e}class Bi{#t;#e;constructor(e,t){this.#t=e,this.#e=t}list(e){const t={},n="/projects";return e?.includeMembers===!1&&(t.includeMembers="false"),e?.organizationId&&(t.organizationId=e.organizationId),A(this.#t,this.#e,{uri:n,query:t})}getById(e){return A(this.#t,this.#e,{uri:`/projects/${e}`})}}class zi{#t;#e;constructor(e,t){this.#t=e,this.#e=t}list(e){const t={},n="/projects";return e?.includeMembers===!1&&(t.includeMembers="false"),e?.organizationId&&(t.organizationId=e.organizationId),b(A(this.#t,this.#e,{uri:n,query:t}))}getById(e){return b(A(this.#t,this.#e,{uri:`/projects/${e}`}))}}const bt=bs("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),de=(r,e)=>e?se(r,e):rr(r);function pe(r,{releaseId:e,publishedId:t,document:n}){if(t&&n._id){const s=de(t,e);return Ds(s,n),s}if(n._id){const s=ge(n._id),i=be(n._id);if(!s&&!i)throw new Error(`\`${r}()\` requires a document with an \`_id\` that is a version or draft ID`);if(e){if(s)throw new Error(`\`${r}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${e}\`) was also provided.`);const o=nr(n._id);if(o!==e)throw new Error(`\`${r}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${e}\`) does not match the document's version ID (\`${o}\`).`)}return n._id}if(t)return de(t,e);throw new Error(`\`${r}()\` requires either a publishedId or a document with an \`_id\``)}const Hi=(r,e)=>{if(typeof r=="object"&&r!==null&&("releaseId"in r||"metadata"in r)){const{releaseId:t=bt(),metadata:n={}}=r;return[t,n,e]}return[bt(),{},r]},Nr=(r,e)=>{const[t,n,s]=Hi(r,e),i={...n,releaseType:n.releaseType||"undecided"};return{action:{actionType:"sanity.action.release.create",releaseId:t,metadata:i},options:s}};class Gi{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get({releaseId:e},t){return X(this.#t,this.#e,`_.releases.${e}`,t)}create(e,t){const{action:n,options:s}=Nr(e,t),{releaseId:i,metadata:o}=n;return C(this.#t,this.#e,n,s).pipe(_(a=>({...a,releaseId:i,metadata:o})))}edit({releaseId:e,patch:t},n){const s={actionType:"sanity.action.release.edit",releaseId:e,patch:t};return C(this.#t,this.#e,s,n)}publish({releaseId:e},t){const n={actionType:"sanity.action.release.publish",releaseId:e};return C(this.#t,this.#e,n,t)}archive({releaseId:e},t){const n={actionType:"sanity.action.release.archive",releaseId:e};return C(this.#t,this.#e,n,t)}unarchive({releaseId:e},t){const n={actionType:"sanity.action.release.unarchive",releaseId:e};return C(this.#t,this.#e,n,t)}schedule({releaseId:e,publishAt:t},n){const s={actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t};return C(this.#t,this.#e,s,n)}unschedule({releaseId:e},t){const n={actionType:"sanity.action.release.unschedule",releaseId:e};return C(this.#t,this.#e,n,t)}delete({releaseId:e},t){const n={actionType:"sanity.action.release.delete",releaseId:e};return C(this.#t,this.#e,n,t)}fetchDocuments({releaseId:e},t){return Cr(this.#t,this.#e,e,t)}}class Qi{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get({releaseId:e},t){return b(X(this.#t,this.#e,`_.releases.${e}`,t))}async create(e,t){const{action:n,options:s}=Nr(e,t),{releaseId:i,metadata:o}=n;return{...await b(C(this.#t,this.#e,n,s)),releaseId:i,metadata:o}}edit({releaseId:e,patch:t},n){const s={actionType:"sanity.action.release.edit",releaseId:e,patch:t};return b(C(this.#t,this.#e,s,n))}publish({releaseId:e},t){const n={actionType:"sanity.action.release.publish",releaseId:e};return b(C(this.#t,this.#e,n,t))}archive({releaseId:e},t){const n={actionType:"sanity.action.release.archive",releaseId:e};return b(C(this.#t,this.#e,n,t))}unarchive({releaseId:e},t){const n={actionType:"sanity.action.release.unarchive",releaseId:e};return b(C(this.#t,this.#e,n,t))}schedule({releaseId:e,publishAt:t},n){const s={actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t};return b(C(this.#t,this.#e,s,n))}unschedule({releaseId:e},t){const n={actionType:"sanity.action.release.unschedule",releaseId:e};return b(C(this.#t,this.#e,n,t))}delete({releaseId:e},t){const n={actionType:"sanity.action.release.delete",releaseId:e};return b(C(this.#t,this.#e,n,t))}fetchDocuments({releaseId:e},t){return b(Cr(this.#t,this.#e,e,t))}}class Yi{#t;#e;constructor(e,t){this.#t=e,this.#e=t}getById(e){return A(this.#t,this.#e,{uri:`/users/${e}`})}}class Ji{#t;#e;constructor(e,t){this.#t=e,this.#e=t}getById(e){return b(A(this.#t,this.#e,{uri:`/users/${e}`}))}}class ye{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#t;#e;listen=Lr;constructor(e,t=te){this.config(t),this.#e=e,this.assets=new Si(this,this.#e),this.datasets=new Di(this,this.#e),this.live=new Vr(this),this.mediaLibrary={video:new Ur(this,this.#e)},this.projects=new Bi(this,this.#e),this.users=new Yi(this,this.#e),this.agent={action:new Ci(this,this.#e)},this.releases=new Gi(this,this.#e)}clone(){return new ye(this.#e,this.config())}config(e){if(e===void 0)return{...this.#t};if(this.#t&&this.#t.allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.#t=hr(e,this.#t||{}),this}withConfig(e){const t=this.config();return new ye(this.#e,{...t,...e,stega:{...t.stega||{},...typeof e?.stega=="boolean"?{enabled:e.stega}:e?.stega||{}}})}
17fetch(e,t,n){return wr(this,this.#e,this.#t.stega,e,t,n)}getDocument(e,t){if(t?.includeAllVersions===!0)return X(this,this.#e,e,{...t,includeAllVersions:!0});const n={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return X(this,this.#e,e,n)}getDocuments(e,t){return Er(this,this.#e,e,t)}create(e,t){return Ie(this,this.#e,e,"create",t)}createIfNotExists(e,t){return Ir(this,this.#e,e,t)}createOrReplace(e,t){return Sr(this,this.#e,e,t)}createVersion({document:e,publishedId:t,releaseId:n,baseId:s,ifBaseRevisionId:i},o){if(!e)return _r(this,this.#e,t,s,n,i,o);const a=pe("createVersion",{document:e,publishedId:t,releaseId:n}),c={...e,_id:a},u=t||we(e._id);return Ar(this,this.#e,c,u,o)}delete(e,t){return $r(this,this.#e,e,t)}discardVersion({releaseId:e,publishedId:t},n,s){const i=de(t,e);return xr(this,this.#e,i,n,s)}replaceVersion({document:e,publishedId:t,releaseId:n},s){const i=pe("replaceVersion",{document:e,publishedId:t,releaseId:n}),o={...e,_id:i};return Or(this,this.#e,o,s)}unpublishVersion({releaseId:e,publishedId:t},n){const s=se(t,e);return Tr(this,this.#e,s,t,n)}mutate(e,t){return Rr(this,this.#e,e,t)}patch(e,t){return new U(e,t,this)}transaction(e){return new Ce(e,this)}action(e,t){return C(this,this.#e,e,t)}request(e){return A(this,this.#e,e)}getUrl(e,t){return ze(this,e,t)}getDataUrl(e,t){return O(this,e,t)}}class me{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#t;#e;listen=Lr;constructor(e,t=te){this.config(t),this.#e=e,this.assets=new Ai(this,this.#e),this.datasets=new ki(this,this.#e),this.live=new Vr(this),this.mediaLibrary={video:new Mi(this,this.#e)},this.projects=new zi(this,this.#e),this.users=new Ji(this,this.#e),this.agent={action:new Ii(this,this.#e)},this.releases=new Qi(this,this.#e),this.observable=new ye(e,t)}clone(){return new me(this.#e,this.config())}config(e){if(e===void 0)return{...this.#t};if(this.#t&&this.#t.allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),this.#t=hr(e,this.#t||{}),this}withConfig(e){const t=this.config();return new me(this.#e,{...t,...e,stega:{...t.stega||{},...typeof e?.stega=="boolean"?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,n){return b(wr(this,this.#e,this.#t.stega,e,t,n))}getDocument(e,t){if(t?.includeAllVersions===!0)return b(X(this,this.#e,e,{...t,includeAllVersions:!0}));const n={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return b(X(this,this.#e,e,n))}getDocuments(e,t){return b(Er(this,this.#e,e,t))}create(e,t){return b(Ie(this,this.#e,e,"create",t))}createIfNotExists(e,t){return b(Ir(this,this.#e,e,t))}createOrReplace(e,t){return b(Sr(this,this.#e,e,t))}createVersion({document:e,publishedId:t,releaseId:n,baseId:s,ifBaseRevisionId:i},o){if(!e)return $e(_r(this,this.#e,t,s,n,i,o));const a=pe("createVersion",{document:e,publishedId:t,releaseId:n}),c={...e,_id:a},u=t||we(e._id);return $e(Ar(this,this.#e,c,u,o))}delete(e,t){return b($r(this,this.#e,e,t))}discardVersion({releaseId:e,publishedId:t},n,s){const i=de(t,e);return b(xr(this,this.#e,i,n,s))}replaceVersion({document:e,publishedId:t,releaseId:n},s){const i=pe("replaceVersion",{document:e,publishedId:t,releaseId:n}),o={...e,_id:i};return $e(Or(this,this.#e,o,s))}unpublishVersion({releaseId:e,publishedId:t},n){const s=se(t,e);return b(Tr(this,this.#e,s,t,n))}mutate(e,t){return b(Rr(this,this.#e,e,t))}patch(e,t){return new F(e,t,this)}transaction(e){return new Ee(e,this)}action(e,t){return b(C(this,this.#e,e,t))}request(e){return b(A(this,this.#e,e))}dataRequest(e,t,n){return b(W(this,this.#e,e,t,n))}getUrl(e,t){return ze(this,e,t)}getDataUrl(e,t){return O(this,e,t)}}function Xi(r,e){return{requester:dt(r),createClient:t=>{const n=dt(r,{ignoreWarnings:t.ignoreWarnings});return new e((s,i)=>(i||n)({maxRedirects:0,maxRetries:t.maxRetries,retryDelay:t.retryDelay,lineage:t.lineage,...s}),t)}}}var Ki=[];const Zi=Xi(Ki,me),to=Zi.createClient;export{wt as _,to as c,Kt as i};
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.