(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2757],{24059:function(e,t,r){var n,o,i;void 0!==(o="function"==typeof(n=i=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(n){function o(){}function i(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(new Date*1+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var s=JSON.stringify(r);/^[\{\[]/.test(s)&&(r=s)}catch(e){}r=n.write?n.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,!0!==i[c]&&(a+="="+i[c].split(";")[0]));return document.cookie=t+"="+r+a}}function s(e,r){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],s=0;s<i.length;s++){var a=i[s].split("="),c=a.slice(1).join("=");r||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var u=t(a[0]);if(c=(n.read||n)(c,u)||t(c),r)try{c=JSON.parse(c)}catch(e){}if(o[u]=c,e===u)break}catch(e){}}return e?o[e]:o}}return o.set=i,o.get=function(e){return s(e,!1)},o.getJSON=function(e){return s(e,!0)},o.remove=function(t,r){i(t,"",e(r,{expires:-1}))},o.defaults={},o.withConverter=r,o}(function(){})})?n.call(t,r,t,e):n)&&(e.exports=o),e.exports=i()},14622:function(e,t,r){"use strict";var n=r(9584),o=r(24059),i=r.n(o);t.Z=function(e){var t=(0,n.useState)(function(){return i().get(e)||null}),r=t[0],o=t[1];return[r,(0,n.useCallback)(function(t,r){i().set(e,t,r),o(t)},[e]),(0,n.useCallback)(function(){i().remove(e),o(null)},[e])]}},64601:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(9584),o=function(e,t){var r,o=(r=(0,n.useRef)(!0)).current?(r.current=!1,!0):r.current;(0,n.useEffect)(function(){if(!o)return e()},t)}},68890:function(e,t,r){"use strict";r.d(t,{eI:function(){return rq}});let n={timeout:typeof navigator>"u"||"ReactNative"!==navigator.product?12e4:6e4},o=function(e){let t={...n,..."string"==typeof e?{url:e}:e};if(t.timeout=function e(t){if(!1===t||0===t)return!1;if(t.connect||t.socket)return t;let r=Number(t);return isNaN(r)?e(n.timeout):{connect:r,socket:r}}(t.timeout),t.query){let{url:e,searchParams:r}=function(e){let t=e.indexOf("?");if(-1===t)return{url:e,searchParams:new URLSearchParams};let r=e.slice(0,t),n=e.slice(t+1),o=new URLSearchParams(n);if("function"==typeof o.set)return{url:r,searchParams:o};if("function"!=typeof decodeURIComponent)throw Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");let s=new URLSearchParams;for(let e of n.split("&")){let[t,r]=e.split("=");t&&s.append(i(t),i(r||""))}return{url:r,searchParams:s}}(t.url);for(let[n,o]of Object.entries(t.query)){if(void 0!==o){if(Array.isArray(o))for(let e of o)r.append(n,e);else r.append(n,o)}let i=r.toString();i&&(t.url=`${e}?${i}`)}}return t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t};function i(e){return decodeURIComponent(e.replace(/\+/g," "))}let s=/^https?:\/\//i,a=function(e){if(!s.test(e.url))throw Error(`"${e.url}" is not a valid URL`)},c=e=>function(t,r,...n){let o="onError"===t,i=r;for(let r=0;r<e[t].length&&(i=(0,e[t][r])(i,...n),!o||i);r++);return i},u=["request","response","progress","error","abort"],l=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];var h,d,p,f,y,m,g,v,b,w,C,E,x,O,T,j,k,_,F,S,R,I,A,M,P,q,D,N,U,W,z,$,L=function(e){return e.replace(/^\s+|\s+$/g,"")},H=(h=function(e){if(!e)return{};for(var t={},r=L(e).split(`
`),n=0;n<r.length;n++){var o,i=r[n],s=i.indexOf(":"),a=L(i.slice(0,s)).toLowerCase(),c=L(i.slice(s+1));typeof t[a]>"u"?t[a]=c:(o=t[a],"[object Array]"===Object.prototype.toString.call(o))?t[a].push(c):t[a]=[t[a],c]}return t}).__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h,B=Object.defineProperty,J=(e,t,r)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G=(e,t,r)=>(J(e,"symbol"!=typeof t?t+"":t,r),r),V=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Y=(e,t,r)=>(V(e,t,"read from private field"),r?r.call(e):t.get(e)),X=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Z=(e,t,r,n)=>(V(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);class K{constructor(){G(this,"onabort"),G(this,"onerror"),G(this,"onreadystatechange"),G(this,"ontimeout"),G(this,"readyState",0),G(this,"response"),G(this,"responseText",""),G(this,"responseType",""),G(this,"status"),G(this,"statusText"),G(this,"withCredentials"),X(this,q,void 0),X(this,D,void 0),X(this,N,void 0),X(this,U,{}),X(this,W,void 0),X(this,z,{}),X(this,$,void 0)}open(e,t,r){var n;Z(this,q,e),Z(this,D,t),Z(this,N,""),this.readyState=1,null==(n=this.onreadystatechange)||n.call(this),Z(this,W,void 0)}abort(){Y(this,W)&&Y(this,W).abort()}getAllResponseHeaders(){return Y(this,N)}setRequestHeader(e,t){Y(this,U)[e]=t}setInit(e,t=!0){Z(this,z,e),Z(this,$,t)}send(e){let t="arraybuffer"!==this.responseType,r={...Y(this,z),method:Y(this,q),headers:Y(this,U),body:e};"function"==typeof AbortController&&Y(this,$)&&(Z(this,W,new AbortController),"u">typeof EventTarget&&Y(this,W).signal instanceof EventTarget&&(r.signal=Y(this,W).signal)),"u">typeof document&&(r.credentials=this.withCredentials?"include":"omit"),fetch(Y(this,D),r).then(e=>(e.headers.forEach((e,t)=>{Z(this,N,Y(this,N)+`${t}: ${e}\r
`)}),this.status=e.status,this.statusText=e.statusText,this.readyState=3,t?e.text():e.arrayBuffer())).then(e=>{var t;"string"==typeof e?this.responseText=e:this.response=e,this.readyState=4,null==(t=this.onreadystatechange)||t.call(this)}).catch(e=>{var t,r;if("AbortError"===e.name){null==(t=this.onabort)||t.call(this);return}null==(r=this.onerror)||r.call(this,e)})}}q=new WeakMap,D=new WeakMap,N=new WeakMap,U=new WeakMap,W=new WeakMap,z=new WeakMap,$=new WeakMap;let Q="function"==typeof XMLHttpRequest?"xhr":"fetch",ee="xhr"===Q?XMLHttpRequest:K,et=(e,t)=>{var r;let n=e.options,o=e.applyMiddleware("finalizeOptions",n),i={},s=e.applyMiddleware("interceptRequest",void 0,{adapter:Q,context:e});if(s){let e=setTimeout(t,0,null,s);return{abort:()=>clearTimeout(e)}}let a=new ee;a instanceof K&&"object"==typeof o.fetch&&a.setInit(o.fetch,null==(r=o.useAbortSignal)||r);let c=o.headers,u=o.timeout,l=!1,h=!1,d=!1;if(a.onerror=e=>{a instanceof K?y(e instanceof Error?e:Error(`Request error while attempting to reach is ${o.url}`,{cause:e})):y(Error(`Request error while attempting to reach is ${o.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},a.ontimeout=e=>{y(Error(`Request timeout while attempting to reach ${o.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},a.onabort=()=>{f(!0),l=!0},a.onreadystatechange=()=>{u&&(f(),i.socket=setTimeout(()=>p("ESOCKETTIMEDOUT"),u.socket)),l||4!==a.readyState||0===a.status||function(){if(!(l||h||d)){if(0===a.status){y(Error("Unknown XHR error"));return}f(),h=!0,t(null,{body:a.response||(""===a.responseType||"text"===a.responseType?a.responseText:""),url:o.url,method:o.method,headers:H(a.getAllResponseHeaders()),statusCode:a.status,statusMessage:a.statusText})}}()},a.open(o.method,o.url,!0),a.withCredentials=!!o.withCredentials,c&&a.setRequestHeader)for(let e in c)c.hasOwnProperty(e)&&a.setRequestHeader(e,c[e]);return o.rawBody&&(a.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:o,adapter:Q,request:a,context:e}),a.send(o.body||null),u&&(i.connect=setTimeout(()=>p("ETIMEDOUT"),u.connect)),{abort:function(){l=!0,a&&a.abort()}};function p(t){d=!0,a.abort();let r=Error("ESOCKETTIMEDOUT"===t?`Socket timed out on request to ${o.url}`:`Connection timed out on request to ${o.url}`);r.code=t,e.channels.error.publish(r)}function f(e){(e||l||a.readyState>=2&&i.connect)&&clearTimeout(i.connect),i.socket&&clearTimeout(i.socket)}function y(e){if(h)return;f(!0),h=!0,a=null;let r=e||Error(`Network error while attempting to reach ${o.url}`);r.isNetworkError=!0,r.request=o,t(r)}},er=(e=[],t=et)=>(function e(t,r){let n=[],i=l.reduce((e,t)=>(e[t]=e[t]||[],e),{processOptions:[o],validateOptions:[a]});function s(e){let t;let n=(e,t,r)=>{let n=e,i=t;if(!n)try{i=s("onResponse",t,r)}catch(e){i=null,n=e}(n=n&&s("onError",n,r))?o.error.publish(n):i&&o.response.publish(i)},o=u.reduce((e,t)=>(e[t]=function(){let e=Object.create(null),t=0;return{publish:function(t){for(let r in e)e[r](t)},subscribe:function(r){let n=t++;return e[n]=r,function(){delete e[n]}}}}(),e),{}),s=c(i),a=s("processOptions",e);s("validateOptions",a);let l={options:a,channels:o,applyMiddleware:s},h=o.request.subscribe(e=>{t=r(e,(t,r)=>n(t,r,e))});o.abort.subscribe(()=>{h(),t&&t.abort()});let d=s("onReturn",o,l);return d===o&&o.request.publish(l),d}return s.use=function(e){if(!e)throw Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&i.onReturn.length>0)throw Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return l.forEach(t=>{e[t]&&i[t].push(e[t])}),n.push(e),s},s.clone=()=>e(n,r),t.forEach(s.use),s})(e,t);var en,eo,ei=r(32608),es=r(12958).lW,ea={exports:{}},ec=function(e){function t(e){let n,o=null,i,s;function a(...e){if(!a.enabled)return;let r=Number(new Date),o=r-(n||r);a.diff=o,a.prev=n,a.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return"%";i++;let o=t.formatters[n];if("function"==typeof o){let t=e[i];r=o.call(a,t),e.splice(i,1),i--}return r}),t.formatArgs.call(a,e),(a.log||t.log).apply(a,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names.map(n),...t.skips.map(n).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];let n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(RegExp("^"+e.slice(1)+"$")):t.names.push(RegExp("^"+e+"$")))},t.enabled=function(e){let r,n;if("*"===e[e.length-1])return!0;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=function(){if(eo)return en;function e(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}return eo=1,en=function(t,r){r=r||{};var n,o,i=typeof t;if("string"===i&&t.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return 864e5*r;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*r;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(t);if("number"===i&&isFinite(t))return r.long?(n=Math.abs(t))>=864e5?e(t,n,864e5,"day"):n>=36e5?e(t,n,36e5,"hour"):n>=6e4?e(t,n,6e4,"minute"):n>=1e3?e(t,n,1e3,"second"):t+" ms":(o=Math.abs(t))>=864e5?Math.round(t/864e5)+"d":o>=36e5?Math.round(t/36e5)+"h":o>=6e4?Math.round(t/6e4)+"m":o>=1e3?Math.round(t/1e3)+"s":t+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t};!function(e,t){let r;t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch{}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch{}return!e&&"u">typeof ei&&"env"in ei&&(e=ei.env.DEBUG),e},t.useColors=function(){return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch{}}(),t.destroy=(r=!1,()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=ec(t);let{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(ea,ea.exports),ea.exports,Object.prototype.hasOwnProperty;let eu=typeof es>"u"?()=>!1:e=>es.isBuffer(e);function el(e){return"[object Object]"===Object.prototype.toString.call(e)}let eh=["boolean","string","number"],ed={};"u">typeof globalThis?ed=globalThis:"u">typeof window?ed=window:"u">typeof global?ed=global:"u">typeof self&&(ed=self);var ep=ed,ef=Object.defineProperty,ey=(e,t,r)=>t in e?ef(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,em=(e,t,r)=>(ey(e,"symbol"!=typeof t?t+"":t,r),r);let eg=(e={})=>{let t=e.implementation||Promise;if(!t)throw Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:(r,n)=>new t((t,o)=>{let i=n.options.cancelToken;i&&i.promise.then(e=>{r.abort.publish(e),o(e)}),r.error.subscribe(o),r.response.subscribe(r=>{t(e.onlyBody?r.body:r)}),setTimeout(()=>{try{r.request.publish(n)}catch(e){o(e)}},0)})}};class ev{constructor(e){em(this,"__CANCEL__",!0),em(this,"message"),this.message=e}toString(){return`Cancel${this.message?`: ${this.message}`:""}`}}let eb=class{constructor(e){if(em(this,"promise"),em(this,"reason"),"function"!=typeof e)throw TypeError("executor must be a function.");let t=null;this.promise=new Promise(e=>{t=e}),e(e=>{this.reason||(this.reason=new ev(e),t(this.reason))})}};em(eb,"source",()=>{let e;return{token:new eb(t=>{e=t}),cancel:e}}),eg.Cancel=ev,eg.CancelToken=eb,eg.isCancel=e=>!!(e&&null!=e&&e.__CANCEL__);var ew=(e,t,r)=>("GET"===r.method||"HEAD"===r.method)&&(e.isNetworkError||!1);let eC=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;var eE=e=>{let t=e.maxRetries||5,r=e.retryDelay||ex,n=e.shouldRetry;return{onError:(e,o)=>{let i=o.options,s=i.maxRetries||t,a=i.retryDelay||r,c=i.shouldRetry||n,u=i.attemptNumber||0;if(eC(i.body)||!c(e,u,i)||u>=s)return e;let l=Object.assign({},o,{options:Object.assign({},i,{attemptNumber:u+1})});return setTimeout(()=>o.channels.request.publish(l),a(u)),null}}};function ex(e){return 100*Math.pow(2,e)+100*Math.random()}let eO=(e={})=>eE({shouldRetry:ew,...e});eO.shouldRetry=ew;var eT=function(e,t){return(eT=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function ej(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}eT(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function ek(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function e_(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function eF(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function eS(e){return"function"==typeof e}function eR(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var eI=eR(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t}});function eA(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var eM=function(){var e;function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,r,n,o,i=this._parentage;if(i){if(this._parentage=null,Array.isArray(i))try{for(var s=ek(i),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else i.remove(this)}var c=this.initialTeardown;if(eS(c))try{c()}catch(e){o=e instanceof eI?e.errors:[e]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=ek(u),h=l.next();!h.done;h=l.next()){var d=h.value;try{eq(d)}catch(e){o=null!=o?o:[],e instanceof eI?o=eF(eF([],e_(o)),e_(e.errors)):o.push(e)}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(o)throw new eI(o)}},t.prototype.add=function(e){var r;if(e&&e!==this){if(this.closed)eq(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(e)}}},t.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},t.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},t.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&eA(t,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&eA(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}();function eP(e){return e instanceof eM||e&&"closed"in e&&eS(e.remove)&&eS(e.add)&&eS(e.unsubscribe)}function eq(e){eS(e)?e():e.unsubscribe()}eM.EMPTY;var eD={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},eN={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=eN.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,eF([e,t],e_(r))):setTimeout.apply(void 0,eF([e,t],e_(r)))},clearTimeout:function(e){var t=eN.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function eU(){}var eW=ez("C",void 0,void 0);function ez(e,t,r){return{kind:e,value:t,error:r}}var e$=null,eL=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,eP(t)&&t.add(r)):r.destination=eX,r}return ej(t,e),t.create=function(e,t,r){return new eG(e,t,r)},t.prototype.next=function(e){this.isStopped?eY(ez("N",e,void 0),this):this._next(e)},t.prototype.error=function(e){this.isStopped?eY(ez("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?eY(eW,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(eM),eH=Function.prototype.bind;function eB(e,t){return eH.call(e,t)}var eJ=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){eV(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){eV(e)}else eV(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){eV(e)}},e}(),eG=function(e){function t(t,r,n){var o,i,s=e.call(this)||this;return eS(t)||!t?o={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&eD.useDeprecatedNextContext?((i=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},o={next:t.next&&eB(t.next,i),error:t.error&&eB(t.error,i),complete:t.complete&&eB(t.complete,i)}):o=t,s.destination=new eJ(o),s}return ej(t,e),t}(eL);function eV(e){eD.useDeprecatedSynchronousErrorHandling?eD.useDeprecatedSynchronousErrorHandling&&e$&&(e$.errorThrown=!0,e$.error=e):eN.setTimeout(function(){var t=eD.onUnhandledError;if(t)t(e);else throw e})}function eY(e,t){var r=eD.onStoppedNotification;r&&eN.setTimeout(function(){return r(e,t)})}var eX={closed:!0,next:eU,error:function(e){throw e},complete:eU},eZ="function"==typeof Symbol&&Symbol.observable||"@@observable",eK=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,o=this,i=(n=e)&&n instanceof eL||n&&eS(n.next)&&eS(n.error)&&eS(n.complete)&&eP(n)?e:new eG(e,t,r);return function(e){if(eD.useDeprecatedSynchronousErrorHandling){var t=!e$;if(t&&(e$={errorThrown:!1,error:null}),e(),t){var r=e$,n=r.errorThrown,o=r.error;if(e$=null,n)throw o}}else e()}(function(){var e=o.operator,t=o.source;i.add(e?e.call(i,t):t?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=eQ(t))(function(t,n){var o=new eG({next:function(t){try{e(t)}catch(e){n(e),o.unsubscribe()}},error:n,complete:t});r.subscribe(o)})},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[eZ]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===e.length?function(e){return e}:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=eQ(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}();function eQ(e){var t;return null!==(t=null!=e?e:eD.Promise)&&void 0!==t?t:Promise}var e0=eR(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function e3(e,t){var r="object"==typeof t;return new Promise(function(n,o){var i,s=!1;e.subscribe({next:function(e){i=e,s=!0},error:o,complete:function(){s?n(i):r?n(t.defaultValue):o(new e0)}})})}function e1(e){return function(t){if(eS(null==t?void 0:t.lift))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}var e6=function(e){function t(t,r,n,o,i,s){var a=e.call(this,t)||this;return a.onFinalize=i,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=o?function(e){try{o(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return ej(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),r||null===(t=this.onFinalize)||void 0===t||t.call(this)}},t}(eL);function e9(e,t){return e1(function(r,n){var o=0;r.subscribe(new e6(n,function(r){n.next(e.call(t,r,o++))},void 0,void 0,void 0))})}function e2(e,t){return e1(function(r,n){var o=0;r.subscribe(new e6(n,function(r){return e.call(t,r,o++)&&n.next(r)},void 0,void 0,void 0))})}var e4=[];class e5 extends Error{constructor(e){let t=e7(e);super(t.message),this.statusCode=400,Object.assign(this,t)}}class e8 extends Error{constructor(e){let t=e7(e);super(t.message),this.statusCode=500,Object.assign(this,t)}}function e7(e){let t=e.body,r={response:e,statusCode:e.statusCode,responseBody:-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(t,null,2):t,message:"",details:void 0};if(t.error&&t.message)return r.message="".concat(t.error," - ").concat(t.message),r;if(te(t)&&te(t.error)&&"mutationError"===t.error.type&&"string"==typeof t.error.description){let e=t.error.items||[],n=e.slice(0,5).map(e=>{var t;return null==(t=e.error)?void 0:t.description}).filter(Boolean),o=n.length?":\n- ".concat(n.join("\n- ")):"";return e.length>5&&(o+="\n...and ".concat(e.length-5," more")),r.message="".concat(t.error.description).concat(o),r.details=t.error,r}return t.error&&t.error.description?(r.message=t.error.description,r.details=t.error):r.message=t.error||t.message||function(e){let t=e.statusMessage?" ".concat(e.statusMessage):"";return"".concat(e.method,"-request to ").concat(e.url," resulted in HTTP ").concat(e.statusCode).concat(t)}(e),r}function te(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let tt={onResponse:e=>{if(e.statusCode>=500)throw new e8(e);if(e.statusCode>=400)throw new e5(e);return e}},tr={onResponse:e=>{let t=e.headers["x-sanity-warning"];return(Array.isArray(t)?t:[t]).filter(Boolean).forEach(e=>console.warn(e)),e}};function tn(e,t){let{maxRetries:r=5,retryDelay:n}=t,o=er([r>0?eO({retryDelay:n,maxRetries:r,shouldRetry:to}):{},...e,tr,{processOptions:e=>{let t=e.body;return t&&"function"!=typeof t.pipe&&!eu(t)&&(-1!==eh.indexOf(typeof t)||Array.isArray(t)||function(e){if(!1===el(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!(!1===el(r)||!1===r.hasOwnProperty("isPrototypeOf"))}(t))?Object.assign({},e,{body:JSON.stringify(e.body),headers:Object.assign({},e.headers,{"Content-Type":"application/json"})}):e}},{onResponse:e=>{let t=e.headers["content-type"]||"",r=-1!==t.indexOf("application/json");return e.body&&t&&r?Object.assign({},e,{body:function(e){try{return JSON.parse(e)}catch(e){throw e.message=`Failed to parsed response body as JSON: ${e.message}`,e}}(e.body)}):e},processOptions:e=>Object.assign({},e,{headers:Object.assign({Accept:"application/json"},e.headers)})},{onRequest:e=>{if("xhr"!==e.adapter)return;let t=e.request,r=e.context;function n(e){return t=>{let n=t.lengthComputable?t.loaded/t.total*100:-1;r.channels.progress.publish({stage:e,percent:n,total:t.total,loaded:t.loaded,lengthComputable:t.lengthComputable})}}"upload"in t&&"onprogress"in t.upload&&(t.upload.onprogress=n("upload")),"onprogress"in t&&(t.onprogress=n("download"))}},tt,function(e={}){let t=e.implementation||ep.Observable;if(!t)throw Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:(e,r)=>new t(t=>(e.error.subscribe(e=>t.error(e)),e.progress.subscribe(e=>t.next(Object.assign({type:"progress"},e))),e.response.subscribe(e=>{t.next(Object.assign({type:"response"},e)),t.complete()}),e.request.publish(r),()=>e.abort.publish()))}}({implementation:eK})]);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;return t({maxRedirects:0,...e})}return i.defaultRequester=o,i}function to(e,t,r){let n="GET"===r.method||"HEAD"===r.method,o=(r.uri||r.url).startsWith("/data/query"),i=e.response&&(429===e.response.statusCode||502===e.response.statusCode||503===e.response.statusCode);return(!!n||!!o)&&!!i||eO.shouldRetry(e,t,r)}function ti(e){if("string"==typeof e||Array.isArray(e))return{id:e};if("object"==typeof e&&null!==e&&"query"in e&&"string"==typeof e.query)return"params"in e&&"object"==typeof e.params&&null!==e.params?{query:e.query,params:e.params}:{query:e.query};throw Error("Unknown selection - must be one of:\n\n".concat("* Document ID (<docId>)\n* Array of document IDs\n* Object containing `query`"))}let ts=["image","file"],ta=["before","after","replace"],tc=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")},tu=e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")},tl=e=>{if(-1===ts.indexOf(e))throw Error("Invalid asset type: ".concat(e,". Must be one of ").concat(ts.join(", ")))},th=(e,t)=>{if(null===t||"object"!=typeof t||Array.isArray(t))throw Error("".concat(e,"() takes an object of properties"))},td=(e,t)=>{if("string"!=typeof t||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(t)||t.includes(".."))throw Error("".concat(e,'(): "').concat(t,'" is not a valid document ID'))},tp=(e,t)=>{if(!t._id)throw Error("".concat(e,'() requires that the document contains an ID ("_id" property)'));td(e,t._id)},tf=(e,t,r)=>{let n="insert(at, selector, items)";if(-1===ta.indexOf(e)){let e=ta.map(e=>'"'.concat(e,'"')).join(", ");throw Error("".concat(n,' takes an "at"-argument which is one of: ').concat(e))}if("string"!=typeof t)throw Error("".concat(n,' takes a "selector"-argument which must be a string'));if(!Array.isArray(r))throw Error("".concat(n,' takes an "items"-argument which must be an array'))},ty=e=>{if(!e.dataset)throw Error("`dataset` must be provided to perform queries");return e.dataset||""},tm=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},tg=e=>{let{query:t,params:r={},options:n={}}=e,o=new URLSearchParams,{tag:i,...s}=n;for(let[e,n]of(i&&o.set("tag",i),o.set("query",t),Object.entries(r)))o.set("$".concat(e),JSON.stringify(n));for(let[e,t]of Object.entries(s))t&&o.set(e,"".concat(t));return"?".concat(o)};var tv=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},tb=(e,t,r)=>(tv(e,t,"read from private field"),r?r.call(e):t.get(e)),tw=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},tC=(e,t,r,n)=>(tv(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);class tE{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.selection=e,this.operations=t}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return th("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 tf(e,t,r),this._assign("insert",{[e]:t,items:r})}append(e,t){return this.insert("after","".concat(e,"[-1]"),t)}prepend(e,t){return this.insert("before","".concat(e,"[0]"),t)}splice(e,t,r,n){let o=t<0?t-1:t,i=void 0===r||-1===r?-1:Math.max(0,t+r),s="".concat(e,"[").concat(o,":").concat(o<0&&i>=0?"":i,"]");return this.insert("replace",s,n||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...ti(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return th(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)}}let tx=class extends tE{constructor(e,t,r){super(e,t),tw(this,d,void 0),tC(this,d,r)}clone(){return new tx(this.selection,{...this.operations},tb(this,d))}commit(e){if(!tb(this,d))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 tb(this,d).mutate({patch:this.serialize()},t)}};d=new WeakMap;let tO=class extends tE{constructor(e,t,r){super(e,t),tw(this,p,void 0),tC(this,p,r)}clone(){return new tO(this.selection,{...this.operations},tb(this,p))}commit(e){if(!tb(this,p))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 tb(this,p).mutate({patch:this.serialize()},t)}};p=new WeakMap;var tT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},tj=(e,t,r)=>(tT(e,t,"read from private field"),r?r.call(e):t.get(e)),tk=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},t_=(e,t,r,n)=>(tT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);let tF={returnDocuments:!1};class tS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;this.operations=e,this.trxId=t}create(e){return th("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return th(t,e),tp(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return th(t,e),tp(t,e),this._add({[t]:e})}delete(e){return td("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}}let tR=class extends tS{constructor(e,t,r){super(e,r),tk(this,f,void 0),t_(this,f,t)}clone(){return new tR([...this.operations],tj(this,f),this.trxId)}commit(e){if(!tj(this,f))throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return tj(this,f).mutate(this.serialize(),Object.assign({transactionId:this.trxId},tF,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof tO)return this._add({patch:e.serialize()});if(r){let r=t(new tO(e,{},tj(this,f)));if(!(r instanceof tO))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}};f=new WeakMap;let tI=class extends tS{constructor(e,t,r){super(e,r),tk(this,y,void 0),t_(this,y,t)}clone(){return new tI([...this.operations],tj(this,y),this.trxId)}commit(e){if(!tj(this,y))throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return tj(this,y).mutate(this.serialize(),Object.assign({transactionId:this.trxId},tF,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof tx)return this._add({patch:e.serialize()});if(r){let r=t(new tx(e,{},tj(this,y)));if(!(r instanceof tx))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}};y=new WeakMap;let tA=(e,t)=>!1===e?void 0:void 0===e?t:e,tM=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{dryRun:e.dryRun,returnIds:!0,returnDocuments:tA(e.returnDocuments,!0),visibility:e.visibility||"sync",autoGenerateArrayKeys:e.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:e.skipCrossDatasetReferenceValidation}},tP=e=>"response"===e.type,tq=e=>e.body,tD=(e,t)=>e.reduce((e,r)=>(e[t(r)]=r,e),Object.create(null));function tN(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=!1===o.filterResponse?e=>e:e=>e.result;return tB(e,t,"query",{query:r,params:n},o).pipe(e9(i))}function tU(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={uri:tY(e,"doc",r),json:!0,tag:n.tag};return tG(e,t,o).pipe(e2(tP),e9(e=>e.body.documents&&e.body.documents[0]))}function tW(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={uri:tY(e,"doc",r.join(",")),json:!0,tag:n.tag};return tG(e,t,o).pipe(e2(tP),e9(e=>{let t=tD(e.body.documents||[],e=>e._id);return r.map(e=>t[e]||null)}))}function tz(e,t,r,n){return tp("createIfNotExists",r),tJ(e,t,r,"createIfNotExists",n)}function t$(e,t,r,n){return tp("createOrReplace",r),tJ(e,t,r,"createOrReplace",n)}function tL(e,t,r,n){return tB(e,t,"mutate",{mutations:[{delete:ti(r)}]},n)}function tH(e,t,r,n){let o;return tB(e,t,"mutate",{mutations:Array.isArray(o=r instanceof tO||r instanceof tx?{patch:r.serialize()}:r instanceof tR||r instanceof tI?r.serialize():r)?o:[o],transactionId:n&&n.transactionId||void 0},n)}function tB(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i="mutate"===r,s=i?"":tg(n),a=!i&&s.length<11264,c=o.returnFirst,{timeout:u,token:l,tag:h,headers:d}=o,p=tY(e,r,a?s:"");return tG(e,t,{method:a?"GET":"POST",uri:p,json:!0,body:a?void 0:n,query:i&&tM(o),timeout:u,headers:d,token:l,tag:h,canUseCdn:"query"===r,signal:o.signal}).pipe(e2(tP),e9(tq),e9(e=>{if(!i)return e;let t=e.results||[];if(o.returnDocuments)return c?t[0]&&t[0].document:t.map(e=>e.document);let r=c?t[0]&&t[0].id:t.map(e=>e.id);return{transactionId:e.transactionId,results:t,[c?"documentId":"documentIds"]:r}}))}function tJ(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return tB(e,t,"mutate",{mutations:[{[n]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},o))}function tG(e,t,r){var n;let o=r.url||r.uri,i=e.config(),s=void 0===r.canUseCdn?["GET","HEAD"].indexOf(r.method||"GET")>=0&&0===o.indexOf("/data/"):r.canUseCdn,a=i.useCdn&&s,c=r.tag&&i.requestTagPrefix?[i.requestTagPrefix,r.tag].join("."):r.tag||i.requestTagPrefix;c&&(r.query={tag:tm(c),...r.query}),["GET","HEAD"].indexOf(r.method||"GET")>=0&&0===o.indexOf("/data/query/")&&(i.resultSourceMap&&(r.query={resultSourceMap:!0,...r.query}),"string"==typeof i.perspective&&"all"!==i.perspective&&(r.query={perspective:i.perspective,...r.query}));let u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=t.token||e.token;n&&(r.Authorization="Bearer ".concat(n)),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let o=!!(void 0===t.withCredentials?e.token||e.withCredentials:t.withCredentials),i=void 0===t.timeout?e.timeout:t.timeout;return Object.assign({},t,{headers:Object.assign({},r,t.headers||{}),timeout:void 0===i?3e5:i,proxy:t.proxy||e.proxy,json:!0,withCredentials:o})}(i,Object.assign({},r,{url:tX(e,o,a)})),l=new eK(e=>t(u,i.requester).subscribe(e));return r.signal?l.pipe((n=r.signal,e=>new eK(t=>{let r=()=>t.error(function(e){var t,r;if(tZ)return new DOMException(null!=(t=null==e?void 0:e.reason)?t:"The operation was aborted.","AbortError");let n=Error(null!=(r=null==e?void 0:e.reason)?r:"The operation was aborted.");return n.name="AbortError",n}(n));if(n&&n.aborted){r();return}let o=e.subscribe(t);return n.addEventListener("abort",r),()=>{n.removeEventListener("abort",r),o.unsubscribe()}}))):l}function tV(e,t,r){return tG(e,t,r).pipe(e2(e=>"response"===e.type),e9(e=>e.body))}function tY(e,t,r){let n=ty(e.config()),o="/".concat(t,"/").concat(n),i=r?"".concat(o,"/").concat(r):o;return"/data".concat(i).replace(/\/($|\?)/,"$1")}function tX(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{url:n,cdnUrl:o}=e.config();return"".concat(r?o:n,"/").concat(t.replace(/^\//,""))}let tZ=!!globalThis.DOMException;var tK=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},tQ=(e,t,r)=>(tK(e,t,"read from private field"),r?r.call(e):t.get(e)),t0=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},t3=(e,t,r,n)=>(tK(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);class t1{constructor(e,t){t0(this,m,void 0),t0(this,g,void 0),t3(this,m,e),t3(this,g,t)}upload(e,t,r){return t9(tQ(this,m),tQ(this,g),e,t,r)}}m=new WeakMap,g=new WeakMap;class t6{constructor(e,t){t0(this,v,void 0),t0(this,b,void 0),t3(this,v,e),t3(this,b,t)}upload(e,t,r){return e3(t9(tQ(this,v),tQ(this,b),e,t,r).pipe(e2(e=>"response"===e.type),e9(e=>e.body.document)))}}function t9(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};tl(r);let i=o.extract||void 0;i&&!i.length&&(i=["none"]);let s=ty(e.config()),a="image"===r?"images":"files",c="undefined"!=typeof File&&n instanceof File?Object.assign({filename:!1===o.preserveFilename?void 0:n.name,contentType:n.type},o):o,{tag:u,label:l,title:h,description:d,creditLine:p,filename:f,source:y}=c,m={label:l,title:h,description:d,filename:f,meta:i,creditLine:p};return y&&(m.sourceId=y.id,m.sourceName=y.name,m.sourceUrl=y.url),tG(e,t,{tag:u,method:"POST",timeout:c.timeout||0,uri:"/assets/".concat(a,"/").concat(s),headers:c.contentType?{"Content-Type":c.contentType}:{},query:m,body:n})}function t2(e){return"https://www.sanity.io/help/"+e}v=new WeakMap,b=new WeakMap;let t4=e=>{var t;let r,n;return t=function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return console.warn(e.join(" "),...r)},n=!1,function(){return n||(r=t(...arguments),n=!0),r}},t5=t4(["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."]),t8=t4(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.","See ".concat(t2("js-client-browser-token")," for more information and how to hide this warning.")]),t7=t4(["Using the Sanity client without specifying an API version is deprecated.","See ".concat(t2("js-client-api-version"))]);t4(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]);let re={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0},rt=["localhost","127.0.0.1","0.0.0.0"],rr=e=>-1!==rt.indexOf(e),rn=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`")},ro=(e,t)=>{let r=Object.assign({},t,e);r.apiVersion||t7();let n=Object.assign({},re,r),o=n.useProjectHostname;if("undefined"==typeof Promise){let e=t2("js-client-promise-polyfill");throw Error("No native Promise-implementation found, polyfill needed - see ".concat(e))}if(o&&!n.projectId)throw Error("Configuration must contain `projectId`");let i="undefined"!=typeof window&&window.location&&window.location.hostname,s=i&&rr(window.location.hostname);i&&s&&n.token&&!0!==n.ignoreBrowserTokenWarning?t8():void 0===n.useCdn&&t5(),o&&tu(n.projectId),n.dataset&&tc(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?tm(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion="".concat(n.apiVersion).replace(/^v/,""),n.isDefaultApi=n.apiHost===re.apiHost,n.useCdn=!1!==n.useCdn&&!n.withCredentials,rn(n.apiVersion);let a=n.apiHost.split("://",2),c=a[0],u=a[1],l=n.isDefaultApi?"apicdn.sanity.io":u;return n.useProjectHostname?(n.url="".concat(c,"://").concat(n.projectId,".").concat(u,"/v").concat(n.apiVersion),n.cdnUrl="".concat(c,"://").concat(n.projectId,".").concat(l,"/v").concat(n.apiVersion)):(n.url="".concat(n.apiHost,"/v").concat(n.apiVersion),n.cdnUrl=n.url),n};var ri=(e,t)=>Object.keys(t).concat(Object.keys(e)).reduce((r,n)=>(r[n]=void 0===e[n]?t[n]:e[n],r),{});let rs=(e,t)=>t.reduce((t,r)=>(void 0===e[r]||(t[r]=e[r]),t),{}),ra=["includePreviousRevision","includeResult","visibility","effectFormat","tag"],rc={includeResult:!0};function ru(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{url:o,token:i,withCredentials:s,requestTagPrefix:a}=this.config(),c=n.tag&&a?[a,n.tag].join("."):n.tag,u={...ri(n,rc),tag:c},l=tg({query:e,params:t,options:{tag:c,...rs(u,ra)}}),h="".concat(o).concat(tY(this,"listen",l));if(h.length>14800)return new eK(e=>e.error(Error("Query too large for listener")));let d=u.events?u.events:["mutation"],p=-1!==d.indexOf("reconnect"),f={};return(i||s)&&(f.withCredentials=!0),i&&(f.headers={Authorization:"Bearer ".concat(i)}),new eK(e=>{let t,n;l().then(e=>{t=e}).catch(t=>{e.error(t),m()});let o=!1;function i(){!o&&(p&&e.next({type:"reconnect"}),o||t.readyState!==t.CLOSED||(u(),clearTimeout(n),n=setTimeout(y,100)))}function s(t){e.error(function(e){if(e instanceof Error)return e;let t=rl(e);return t instanceof Error?t:Error(t.error?t.error.description?t.error.description:"string"==typeof t.error?t.error:JSON.stringify(t.error,null,2):t.message||"Unknown listener error")}(t))}function a(t){let r=rl(t);return r instanceof Error?e.error(r):e.next(r)}function c(){o=!0,u(),e.complete()}function u(){t&&(t.removeEventListener("error",i),t.removeEventListener("channelError",s),t.removeEventListener("disconnect",c),d.forEach(e=>t.removeEventListener(e,a)),t.close())}async function l(){let{default:e}=await r.e(9653).then(r.t.bind(r,89653,19)),t=new e(h,f);return t.addEventListener("error",i),t.addEventListener("channelError",s),t.addEventListener("disconnect",c),d.forEach(e=>t.addEventListener(e,a)),t}function y(){l().then(e=>{t=e}).catch(t=>{e.error(t),m()})}function m(){o=!0,u()}return m})}function rl(e){try{let t=e.data&&JSON.parse(e.data)||{};return Object.assign({type:e.type},t)}catch(e){return e}}var rh=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},rd=(e,t,r)=>(rh(e,t,"read from private field"),r?r.call(e):t.get(e)),rp=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},rf=(e,t,r,n)=>(rh(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);class ry{constructor(e,t){rp(this,w,void 0),rp(this,C,void 0),rf(this,w,e),rf(this,C,t)}create(e,t){return rg(rd(this,w),rd(this,C),"PUT",e,t)}edit(e,t){return rg(rd(this,w),rd(this,C),"PATCH",e,t)}delete(e){return rg(rd(this,w),rd(this,C),"DELETE",e)}list(){return tV(rd(this,w),rd(this,C),{uri:"/datasets"})}}w=new WeakMap,C=new WeakMap;class rm{constructor(e,t){rp(this,E,void 0),rp(this,x,void 0),rf(this,E,e),rf(this,x,t)}create(e,t){return e3(rg(rd(this,E),rd(this,x),"PUT",e,t))}edit(e,t){return e3(rg(rd(this,E),rd(this,x),"PATCH",e,t))}delete(e){return e3(rg(rd(this,E),rd(this,x),"DELETE",e))}list(){return e3(tV(rd(this,E),rd(this,x),{uri:"/datasets"}))}}function rg(e,t,r,n,o){return tc(n),tV(e,t,{method:r,uri:"/datasets/".concat(n),body:o})}E=new WeakMap,x=new WeakMap;var rv=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},rb=(e,t,r)=>(rv(e,t,"read from private field"),r?r.call(e):t.get(e)),rw=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},rC=(e,t,r,n)=>(rv(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);class rE{constructor(e,t){rw(this,O,void 0),rw(this,T,void 0),rC(this,O,e),rC(this,T,t)}list(){return tV(rb(this,O),rb(this,T),{uri:"/projects"})}getById(e){return tV(rb(this,O),rb(this,T),{uri:"/projects/".concat(e)})}}O=new WeakMap,T=new WeakMap;class rx{constructor(e,t){rw(this,j,void 0),rw(this,k,void 0),rC(this,j,e),rC(this,k,t)}list(){return e3(tV(rb(this,j),rb(this,k),{uri:"/projects"}))}getById(e){return e3(tV(rb(this,j),rb(this,k),{uri:"/projects/".concat(e)}))}}j=new WeakMap,k=new WeakMap;var rO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},rT=(e,t,r)=>(rO(e,t,"read from private field"),r?r.call(e):t.get(e)),rj=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},rk=(e,t,r,n)=>(rO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);class r_{constructor(e,t){rj(this,_,void 0),rj(this,F,void 0),rk(this,_,e),rk(this,F,t)}getById(e){return tV(rT(this,_),rT(this,F),{uri:"/users/".concat(e)})}}_=new WeakMap,F=new WeakMap;class rF{constructor(e,t){rj(this,S,void 0),rj(this,R,void 0),rk(this,S,e),rk(this,R,t)}getById(e){return e3(tV(rT(this,S),rT(this,R),{uri:"/users/".concat(e)}))}}S=new WeakMap,R=new WeakMap;var rS=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},rR=(e,t,r)=>(rS(e,t,"read from private field"),r?r.call(e):t.get(e)),rI=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},rA=(e,t,r,n)=>(rS(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);let rM=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:re;rI(this,I,void 0),rI(this,A,void 0),this.listen=ru,this.config(t),rA(this,A,e),this.assets=new t1(this,rR(this,A)),this.datasets=new ry(this,rR(this,A)),this.projects=new rE(this,rR(this,A)),this.users=new r_(this,rR(this,A))}clone(){return new rM(rR(this,A),this.config())}config(e){if(void 0===e)return{...rR(this,I)};if(rR(this,I)&&!1===rR(this,I).allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return rA(this,I,ro(e,rR(this,I)||{})),this}withConfig(e){return new rM(rR(this,A),{...this.config(),...e})}fetch(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return tN(this,rR(this,A),e,t,r)}getDocument(e,t){return tU(this,rR(this,A),e,t)}getDocuments(e,t){return tW(this,rR(this,A),e,t)}create(e,t){return tJ(this,rR(this,A),e,"create",t)}createIfNotExists(e,t){return tz(this,rR(this,A),e,t)}createOrReplace(e,t){return t$(this,rR(this,A),e,t)}delete(e,t){return tL(this,rR(this,A),e,t)}mutate(e,t){return tH(this,rR(this,A),e,t)}patch(e,t){return new tx(e,t,this)}transaction(e){return new tI(e,this)}request(e){return tV(this,rR(this,A),e)}getUrl(e,t){return tX(this,e,t)}getDataUrl(e,t){return tY(this,e,t)}};I=new WeakMap,A=new WeakMap;let rP=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:re;rI(this,M,void 0),rI(this,P,void 0),this.listen=ru,this.config(t),rA(this,P,e),this.assets=new t6(this,rR(this,P)),this.datasets=new rm(this,rR(this,P)),this.projects=new rx(this,rR(this,P)),this.users=new rF(this,rR(this,P)),this.observable=new rM(e,t)}clone(){return new rP(rR(this,P),this.config())}config(e){if(void 0===e)return{...rR(this,M)};if(rR(this,M)&&!1===rR(this,M).allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),rA(this,M,ro(e,rR(this,M)||{})),this}withConfig(e){return new rP(rR(this,P),{...this.config(),...e})}fetch(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e3(tN(this,rR(this,P),e,t,r))}getDocument(e,t){return e3(tU(this,rR(this,P),e,t))}getDocuments(e,t){return e3(tW(this,rR(this,P),e,t))}create(e,t){return e3(tJ(this,rR(this,P),e,"create",t))}createIfNotExists(e,t){return e3(tz(this,rR(this,P),e,t))}createOrReplace(e,t){return e3(t$(this,rR(this,P),e,t))}delete(e,t){return e3(tL(this,rR(this,P),e,t))}mutate(e,t){return e3(tH(this,rR(this,P),e,t))}patch(e,t){return new tO(e,t,this)}transaction(e){return new tR(e,this)}request(e){return e3(tV(this,rR(this,P),e))}dataRequest(e,t,r){return e3(tB(this,rR(this,P),e,t,r))}getUrl(e,t){return tX(this,e,t)}getDataUrl(e,t){return tY(this,e,t)}};M=new WeakMap,P=new WeakMap,tn(e4,{}).defaultRequester;let rq=e=>new rP(tn(e4,{maxRetries:e.maxRetries,retryDelay:e.retryDelay}),e)}}]);