1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[649],{141:(e,t,r)=>{"use strict";r.d(t,{Z:()=>function e(t,r,u){return(void 0===u&&(u=1/0),(0,a.T)(r))?e(function(e,o){return(0,n.T)(function(t,n){return r(e,t,o,n)})((0,i.Tg)(t(e,o)))},u):("number"==typeof r&&(u=r),(0,o.N)(function(e,r){var n,o,a,c,l,h,f,p,d;return n=u,a=[],c=0,l=0,h=!1,f=function(){!h||a.length||c||r.complete()},p=function(e){return c<n?d(e):a.push(e)},d=function(e){c++;var u=!1;(0,i.Tg)(t(e,l++)).subscribe((0,s._)(r,function(e){o?p(e):r.next(e)},function(){u=!0},void 0,function(){if(u)try{for(c--;a.length&&c<n;)!function(){var e=a.shift();d(e)}();f()}catch(e){r.error(e)}}))},e.subscribe((0,s._)(r,p,function(){h=!0,f()})),function(){}}))}});var n=r(4272),i=r(7122),o=r(2380),s=(r(2737),r(1096)),a=r(8229)},169:(e,t,r)=>{"use strict";r.d(t,{B:()=>c});var n=r(4902),i=r(673),o=r(9948),s=(0,r(6011).L)(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),a=r(7436),u=r(6192),c=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,n.C6)(t,e),t.prototype.lift=function(e){var t=new l(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new s},t.prototype.next=function(e){var t=this;(0,u.Y)(function(){var r,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var o=(0,n.Ju)(t.currentObservers),s=o.next();!s.done;s=o.next())s.value.next(e)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var t=this;(0,u.Y)(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;(0,u.Y)(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null==(e=this.observers)?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,i=this.observers;return r||n?o.Kn:(this.currentObservers=null,i.push(e),new o.yU(function(){t.currentObservers=null,(0,a.o)(i,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},t.prototype.asObservable=function(){var e=new i.c;return e.source=this,e},t.create=function(e,t){return new l(e,t)},t}(i.c),l=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return(0,n.C6)(t,e),t.prototype.next=function(e){var t,r;null==(r=null==(t=this.destination)?void 0:t.next)||r.call(t,e)},t.prototype.error=function(e){var t,r;null==(r=null==(t=this.destination)?void 0:t.error)||r.call(t,e)},t.prototype.complete=function(){var e,t;null==(t=null==(e=this.destination)?void 0:e.complete)||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!=(r=null==(t=this.source)?void 0:t.subscribe(e))?r:o.Kn},t}(c)},574:(e,t,r)=>{"use strict";r.d(t,{H:()=>b});var n=r(7122),i=r(8423),o=r(2380);function s(e,t){return void 0===t&&(t=0),(0,o.N)(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}var a=r(673),u=r(4547),c=r(8229),l=r(2737);function h(e,t){if(!e)throw Error("Iterable cannot be null");return new a.c(function(r){(0,l.N)(r,t,function(){var n=e[Symbol.asyncIterator]();(0,l.N)(r,t,function(){n.next().then(function(e){e.done?r.complete():r.next(e.value)})},0,!0)})})}var f=r(2527),p=r(6826),d=r(1749),y=r(2251),g=r(8981),m=r(665),v=r(1706);function b(e,t){return t?function(e,t){if(null!=e){if((0,f.l)(e))return(0,n.Tg)(e).pipe(s(t),(0,i.Q)(t));if((0,d.X)(e))return new a.c(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[
1n++]),r.closed||this.schedule())})});if((0,p.y)(e))return(0,n.Tg)(e).pipe(s(t),(0,i.Q)(t));if((0,g.T)(e))return h(e,t);if((0,y.x)(e))return new a.c(function(r){var n;return(0,l.N)(r,t,function(){n=e[u.l](),(0,l.N)(r,t,function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){r.error(e);return}i?r.complete():r.next(t)},0,!0)}),function(){return(0,c.T)(null==n?void 0:n.return)&&n.return()}});if((0,v.U)(e))return h((0,v.C)(e),t)}throw(0,m.L)(e)}(e,t):(0,n.Tg)(e)}},665:(e,t,r)=>{"use strict";function n(e){return TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}r.d(t,{L:()=>n})},673:(e,t,r)=>{"use strict";r.d(t,{c:()=>l});var n=r(1943),i=r(9948),o=r(8840),s=r(1981),a=r(6554),u=r(8229),c=r(6192),l=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 o=this,s=!function(e){return e&&e instanceof n.vU||e&&(0,u.T)(e.next)&&(0,u.T)(e.error)&&(0,u.T)(e.complete)&&(0,i.Uv)(e)}(e)?new n.Ms(e,t,r):e;return(0,c.Y)(function(){var e=o.operator,t=o.source;s.add(e?e.call(s,t):t?o._subscribe(s):o._trySubscribe(s))}),s},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=h(t))(function(t,i){var o=new n.Ms({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});r.subscribe(o)})},e.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},e.prototype[o.s]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,s.m)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=h(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 h(e){var t;return null!=(t=null!=e?e:a.$.Promise)?t:Promise}},925:(e,t,r)=>{"use strict";function n(){}r.d(t,{l:()=>n})},1072:(e,t,r)=>{"use strict";r.d(t,{q:()=>s});var n=r(4902),i=r(6759),o=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=i.U.now,e}(),s=function(e){function t(t,r){void 0===r&&(r=o.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return(0,n.C6)(t,e),t.prototype.flush=function(e){var t,r=this.actions;if(this._active)return void r.push(e);this._active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}},t}(o)},1096:(e,t,r)=>{"use strict";r.d(t,{_:()=>i});var n=r(4902);function i(e,t,r,n,i){return new o(e,t,r,n,i)}var o=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(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(0,n.C6)(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)||t.call(this)}},t}(r(1943).vU)},1370:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],c=new i((s+a)*3/4-a),l=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(function(e,t,n){for(var i,o=[],s=t;s<n;s+=3)i=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(e,s,s+16383>a?a:s+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},1583:(e,t,r)=>{"use strict";r.d(t,{XL:()=>f,IT:()=>p});var n,i,o=r(8889),s=r(4232),a=r(6241),u=r(7974),c=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((i||(i=1,n=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var n,i,o,s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}),n));let{loadQuery:l,setServerClient:h,useLiveMode:f,useQuery:p}=(e=>{let{createFetcherStore:t,enableLiveMode:r}=(0,o.KS)({tag:"react-loader",...e}),n=function(e){let t="object"==typeof e?e?.config().stega.studioUrl:void 0,r=t,n=new Set;return{subscribe:e=>(n.add(e),()=>n.delete(e)),getSnapshot:()=>t,getServerSnapshot:()=>r,setStudioUrl(e){t=e,n.forEach(e=>e())}}}(e.client);return{loadQuery:()=>{throw Error("The `loadQuery` function is server only.")},useQuery:function({createFetcherStore:e,studioUrlStore:t}){let r={};return(n,i=r,o={})=>{var l,h;let f=(0,s.useMemo)(()=>o.initial?{perspective:"published",...o.initial}:void 0,[o.initial]),p=(0,s.useMemo)(()=>JSON.stringify(i),[i]),[d,y]=(0,s.useState)(()=>e(n,JSON.parse(p),f).value);(0,s.useEffect)(()=>{let t=e(n,JSON.parse(p),f).subscribe(e=>{y(t=>c(t.sourceMap,e.sourceMap)&&c(t.data,e.data)&&t.error===e.error&&t.loading===e.loading&&t.perspective===e.perspective?t:e)});return()=>t()},[p,f,n]);let g=(0,s.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot),m=(l=d.data,h=d.sourceMap,(0,s.useMemo)(()=>(function e(t,r,n,i){let o=e=>e?"string"==typeof e?a.C.fromString(e):e:[],s=o(i);return Object.assign(e=>((e,t,r,n)=>{if(!t||!r)return;let i=(0,a.EH)(n),o=(0,a.Nx)({resultPath:i,resultSourceMap:t,studioUrl:r});if(o)return(0,u.Rw)({baseUrl:o.baseUrl,workspace:o.workspace,tool:o.tool,type:o.type,id:o.id,path:"string"==typeof o.path?o.path:a.C.toString((0,a._y)(o.path))})})(0,r,n,[...s,...o(e)]),{scope:i=>e(t,r,n,[...s,...o(i)])})})(l,h,g),[l,h,g]));return(0,s.useMemo)(()=>({...d,encodeDataAttribute:m}),[d,m])}}({createFetcherStore:t,studioUrlStore:n}),setServerClient:()=>{throw Error("The `setServerClient` function is server only.")},useLiveMode:function({enableLiveMode:e,setStudioUrl:t}){return({allowStudioOrigin:r,client:n,onConnect:i,onDisconnect:o,onPerspective:a,studioUrl:u})=>{(0,s.useEffect)(()=>{r&&console.warn("`allowStudioOrigin` is deprecated and no longer needed");let t=e({client:n,onConnect:i,onDisconnect:o,onPerspective:a});return()=>t()},[r,n,i,o,a]),(0,s.useEffect)(()=>{t(u??"object"==typeof n?n?.config().stega.studioUrl:void 0)},[u,n])}}({enableLiveMode:r,setStudioUrl:n.setStudioUrl})}})({client:!1,ssr:!0})},1706:(e,t,r)=>{"use strict";r.d(t,{C:()=>o,U:()=>s});var n=r(4902),i=r(8229);function o(e){return(0,n.AQ)(this,arguments,function(){var t,r,i;return(0,n.YH)(this,function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,(0,n.N3)(t.read())];case 3:if(i=(r=o.sent()).value,!r.done)return[3,5];return[4,(0,n.N3)(void 0)];case 4:return[2,o.sent()];case 5:return[4,(0,n.N3)(i)];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 s(e){return(0,i.T)(null==e?void 0:e.getReader)}},1749:(e,t,r)=>{"use strict";r.d(t,{X:()=>n});var n=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},1836:(e,t,r)=>{"use strict";r.d(t,{p:()=>o});var n=r(2380),i=r(1096);function o(e,t){return(0,n.N)(function(r,n){var o=0;r.subscribe((0,i._)(n,function(r){return e.call(t,r,o++)&&n.next(r)}))})}},1943:(e,t,r)=>{"use strict";r.d(t,{Ms:()=>m,vU:()=>p});var n=r(4902),i=r(8229),o=r(9948),s=r(6554),a=r(3100),u=r(925),c=l("C",void 0,void 0);function l(e,t,r){return{kind:e,value:t,error:r}}var h=r(4984),f=r(6192),p=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,(0,o.Uv)(t)&&t.add(r)):r.destination=w,r}return(0,n.C6)(t,e),t.create=function(e,t,r){return new m(e,t,r)},t.prototype.next=function(e){this.isStopped?b(l("N",e,void 0),this):this._next(e)},t.prototype.error=function(e){this.isStopped?b(l("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?b(c,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}(o.yU),d=Function.prototype.bind;function y(e,t){return d.call(e,t)}var g=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){v(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){v(e)}else v(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){v(e)}},e}(),m=function(e){function t(t,r,n){var o,a,u=e.call(this)||this;return(0,i.T)(t)||!t?o={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}
1:u&&s.$.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},o={next:t.next&&y(t.next,a),error:t.error&&y(t.error,a),complete:t.complete&&y(t.complete,a)}):o=t,u.destination=new g(o),u}return(0,n.C6)(t,e),t}(p);function v(e){s.$.useDeprecatedSynchronousErrorHandling?(0,f.l)(e):(0,a.m)(e)}function b(e,t){var r=s.$.onStoppedNotification;r&&h.f.setTimeout(function(){return r(e,t)})}var w={closed:!0,next:u.l,error:function(e){throw e},complete:u.l}},1981:(e,t,r)=>{"use strict";r.d(t,{F:()=>i,m:()=>o});var n=r(2619);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(e)}function o(e){return 0===e.length?n.D:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}},2251:(e,t,r)=>{"use strict";r.d(t,{x:()=>o});var n=r(4547),i=r(8229);function o(e){return(0,i.T)(null==e?void 0:e[n.l])}},2380:(e,t,r)=>{"use strict";r.d(t,{N:()=>i});var n=r(8229);function i(e){return function(t){if((0,n.T)(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")}}},2527:(e,t,r)=>{"use strict";r.d(t,{l:()=>o});var n=r(8840),i=r(8229);function o(e){return(0,i.T)(e[n.s])}},2619:(e,t,r)=>{"use strict";function n(e){return e}r.d(t,{D:()=>n})},2737:(e,t,r)=>{"use strict";function n(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(o),!i)return o}r.d(t,{N:()=>n})},2909:(e,t,r)=>{"use strict";var n=r(1370),i=r(7247),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return l(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|d(n,i),u=s(o),c=u.write(n,i);return c!==o&&(u=u.slice(0,c)),u}if(ArrayBuffer.isView(e)){var l=e;if(O(l,Uint8Array)){var y=new Uint8Array(l);return f(y.buffer,y.byteOffset,y.byteLength)}return h(l)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var g=e.valueOf&&e.valueOf();if(null!=g&&g!==e)return a.from(g,t,r);var m=function(e){if(a.isBuffer(e)){var t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?s(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(m)return m;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return c(e),s(e<0?0:0|p(e))}function h(e){for(var t=e.length<0?0:0|p(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),a.prototype),n}function p(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return x(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return T(e).length;default:if(i)return n?-1:x(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){var i,o,s,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=_[e[o]];return i}(this,t,r);case"utf8":case"utf-8":return b(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,o=t,s=r,0===o&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,t,r);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){var o;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return v(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;o<a;
vendor: 13,796 bytes, line 1
1o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else -1!==l&&(o-=o-l),l=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(c(e,o+f)!==c(t,f)){h=!1;break}if(h)return o}return -1}function b(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=r)switch(h){case 1:c<128&&(l=c);break;case 2:(192&(o=e[i+1]))==128&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],(192&o)==128&&(192&s)==128&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=h}var f=n,p=f.length;if(p<=4096)return String.fromCharCode.apply(String,f);for(var d="",y=0;y<p;)d+=String.fromCharCode.apply(String,f.slice(y,y+=4096));return d}function w(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function E(e,t,r,n,i,o){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function R(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function A(e,t,r,n,o){return t*=1,r>>>=0,o||R(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function C(e,t,r,n,o){return t*=1,r>>>=0,o||R(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.hp=a,t.IS=50,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(c(e),e<=0)?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},a.allocUnsafe=function(e){return l(e)},a.allocUnsafeSlow=function(e){return l(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(O(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(O(o,Uint8Array))i+o.length>n.length?a.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else if(a.isBuffer(o))o.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?b(this,0,e):y.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(O(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,u=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r),h=0;h<u;++h)if(c[h]!==l[h]){o=c[h],s=l[h];break}return o<s?-1:+(s<o)},a.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,s,a,u,c,l,h,f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a,u=parseInt(t.substr(2*s,2),16);if((a=u)!=a)break;e[r+s]=u}return s}(this,e,t,r);case"utf8":case"utf-8":return i=t,o=r,$(x(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return s=t,a=r,$(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,s,a);case"base64":return u=t,c=r,$(T(e),this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=t,h=r,$(function(e,t){for(var r,n,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(e,this.length-l),this,l,h);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;E(this,e,t,r,i,0)}var o=1,s=0;for(this[t]=255&e;++s<r&&(o*=256);)this[t+s]=e/o&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;E(this,e,t,r,i,0)}var o=r-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);E(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);E(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||E(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return A(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return A(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return C(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return C(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=a.isBuffer(e)?e:a.from(e,n),u=s.length;
1if(0===u)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%u]}return this};var S=/[^+/0-9A-Za-z-_]/g;function x(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function T(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var _=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},3100:(e,t,r)=>{"use strict";r.d(t,{m:()=>o});var n=r(6554),i=r(4984);function o(e){i.f.setTimeout(function(){var t=n.$.onUnhandledError;if(t)t(e);else throw e})}},4272:(e,t,r)=>{"use strict";r.d(t,{T:()=>o});var n=r(2380),i=r(1096);function o(e,t){return(0,n.N)(function(r,n){var o=0;r.subscribe((0,i._)(n,function(r){n.next(e.call(t,r,o++))}))})}},4374:(e,t,r)=>{"use strict";r.d(t,{t:()=>o});var n=r(7261),i=r(7285);function o(e,t,r){var o,s,a,u,c=!1;return e&&"object"==typeof e?(u=void 0===(o=e.bufferSize)?1/0:o,t=void 0===(s=e.windowTime)?1/0:s,c=void 0!==(a=e.refCount)&&a,r=e.scheduler):u=null!=e?e:1/0,(0,i.u)({connector:function(){return new n.m(u,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}},4547:(e,t,r)=>{"use strict";r.d(t,{l:()=>n});var n="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},4902:(e,t,r)=>{"use strict";r.d(t,{AQ:()=>h,C6:()=>i,Ju:()=>a,N3:()=>l,YH:()=>s,fX:()=>c,sH:()=>o,xN:()=>f,zs:()=>u});var n=function(e,t){return(n=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 i(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}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function o(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})}function s(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){var c=[a,u];if(r)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(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 u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function c(e,t,r){if(r||2==arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function l(e){return this instanceof l?(this.v=e,this):new l(e)}function h(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){i[e]&&(n[e]=function(t){return new Promise(function(r,n){o.push([e,t,r,n])>1||a(e,t)})},t&&(n[e]=t(n[e])))}function a(e,t){try{var r;(r=i[e](t)).value instanceof l?Promise.resolve(r.value.v).then(u,c):h(o[0][2],r)}catch(e){h(o[0][3],e)}}function u(e){a("next",e)}function c(e){a("throw",e)}function h(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function f(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=a(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){var o,s,a;o=n,s=i,a=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){o({value:e,done:a})},s)})}}}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},4984:(e,t,r)=>{"use strict";r.d(t,{f:()=>i});var n=r(4902),i={setTimeout:function(e,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var s=i.delegate;return(null==s?void 0:s.setTimeout)?s.setTimeout.apply(s,(0,n.fX)([e,t],(0,n.zs)(r))):setTimeout.apply(void 0,(0,n.fX)([e,t],(0,n.zs)(r)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},5262:(e,t,r)=>{"use strict";r.d(t,{v:()=>o});var n=r(673),i=r(7122);function o(e){return new n.c(function(t){(0,i.Tg)(e()).subscribe(t)})}},5486:(e,t,r)=>{"use strict";r.d(t,{h:()=>u});var n=r(8673),i=r(7122),o=r(6595),s=r(5812),a=r(574);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,s.lI)(e),u=(0,s.R0)(e,1/0);return e.length?1===e.length?(0,i.Tg)(e[0]):(0,n.U)(u)((0,a.H)(e,r)):o.w}},5604:(e,t,r)=>{"use strict";function n(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}r.d(t,{Q:()=>h,u4:()=>n,y:()=>u});var i={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},o={0:8203,1:8204,2:8205,3:65279},s={0:String.fromCodePoint(o[0]),1:String.fromCodePoint(o[1]),2:String.fromCodePoint(o[2]),3:String.fromCodePoint(o[3])},a=[,,,,].fill(String.fromCodePoint(o[0])).join("");function u(e,t,r="auto"){return!0===r||"auto"===r&&(!(!Number.isNaN(Number(e))||/[a-z]/i.test(e)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(e))&&Date.parse(e)||function(e){try{new URL(e,e.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}(e))?e:`${e}${function(e){let t=JSON.stringify(e),r=new TextEncoder().encode(t),n="";for(let e=0;e<r.length;e++){let t=r[e];n+=s[t>>6&3]+s[t>>4&3]+s[t>>2&3]+s[3&t]}return a+n}(t)}`}Object.fromEntries(Object.entries(s).map(e=>[e[1],+e[0]])),Object.fromEntries(Object.entries(i).map(e=>e.reverse()));var c=`${Object.values(i).map(e=>`\\u{${e.toString(16)}}`).join("")}`,l=RegExp(`[${c}]{4,}`,"gu");function h(e){var t,r;return e&&JSON.parse({cleaned:(t=JSON.stringify(e)).replace(l,""),encoded:(null==(r=t.match(l))?void 0:r[0])||""}.cleaned)}},5752:(e,t,r)=>{"use strict";r.d(t,{I:()=>s});var n=r(4902),i=r(4272),o=Array.isArray;function s(e){return(0,i.T)(function(t){return o(t)?e.apply(void 0,(0,n.fX)([],(0,n.zs)(t))):e(t)})}},5812:(e,t,r)=>{"use strict";r.d(t,{R0:()=>u,lI:()=>a,ms:()=>s});var n=r(8229),i=r(7730);function o(e){return e[e.length-1]}function s(e){return(0,n.T)(o(e))?e.pop():void 0}function a(e){return(0,i.m)(o(e))?e.pop():void 0}function u(e,t){return"number"==typeof o(e)?e.pop():t}},6011:(e,t,r)=>{"use strict";function n(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}r.d(t,{L:()=>n})},6192:(e,t,r)=>{"use strict";r.d(t,{Y:()=>o,l:()=>s});var n=r(6554),i=null;function o(e){if(n.$.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,o=r.errorThrown,s=r.error;if(i=null,o)throw s}}else e()}function s(e){n.$.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},6241:(e,t,r)=>{"use strict";r.d(t,{A_:()=>g,C:()=>f,EH:()=>C,IM:()=>w,Nx:()=>T,R8:()=>y,T4:()=>m,_S:()=>b,_y:()=>A,ct:()=>v,iz:()=>x});let n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/_key\s*==\s*['"](.*)['"]/,o=/^\d*:\d*$/;function s(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function a(e){return"string"==typeof e?i.test(e.trim()):"object"==typeof e&&"_key"in e}function u(e){if("string"==typeof e&&o.test(e))return!0;
1if(!Array.isArray(e)||2!==e.length)return!1;let[t,r]=e;return("number"==typeof t||""===t)&&("number"==typeof r||""===r)}function c(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,r)=>{let n=typeof t;if("number"===n)return`${e}[${t}]`;if("string"===n)return`${e}${0===r?"":"."}${t}`;if(a(t)&&t._key)return`${e}[_key=="${t._key}"]`;if(Array.isArray(t)){let[r,n]=t;return`${e}[${r}:${n}]`}throw Error(`Unsupported path segment \`${JSON.stringify(t)}\``)},"")}function l(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(n);if(!t)throw Error("Invalid path string");return t.map(h)}function h(e){return s(e)?Number(e.replace(/[^\d]/g,"")):a(e)?{_key:e.match(i)[1]}:u(e)?function(e){let[t,r]=e.split(":").map(e=>""===e?e:Number(e));return[t,r]}(e):e}var f=Object.freeze({__proto__:null,fromString:l,get:function(e,t,r){let n="string"==typeof t?l(t):t;if(!Array.isArray(n))throw Error("Path must be an array or a string");let i=e;for(let e=0;e<n.length;e++){let t=n[e];if(s(t)){if(!Array.isArray(i))return r;i=i[t]}if(a(t)){if(!Array.isArray(i))return r;i=i.find(e=>e._key===t._key)}if("string"==typeof t&&(i="object"==typeof i&&null!==i?i[t]:void 0),typeof i>"u")return r}return i},isIndexSegment:s,isIndexTuple:u,isKeySegment:a,reKeySegment:i,toString:c});let p="drafts.",d="versions.";function y(e){return e.startsWith(p)}function g(e){return e.startsWith(d)}function m(e){return g(e)?p+w(e):y(e)?e:p+e}function v(e,t){if("drafts"===t||"published"===t)throw Error('Version can not be "published" or "drafts"');return`${d}${t}.${w(e)}`}function b(e){if(!g(e))return;let[t,r]=e.split(".");return r}function w(e){return g(e)?e.split(".").slice(2).join("."):y(e)?e.slice(p.length):e}let E={"\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","'":"\\'","\\":"\\\\"},R={"\\f":"\f","\\n":` 2`,"\\r":"\r","\\t":" ","\\'":"'","\\\\":"\\"};function A(e){return e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(""!==e._key)return{_key:e._key};if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})}function C(e){return("string"==typeof e?l(e):e).map(e=>{var t;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))throw Error(`IndexTuple segments aren't supported:${JSON.stringify(e)}`);if("object"==typeof(t=e)&&"_key"in t&&"_index"in t)return e;if(e._key)return{_key:e._key,_index:-1};throw Error(`invalid segment:${JSON.stringify(e)}`)})}function S(e){return e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})}function x(e){let{baseUrl:t,workspace:r="default",tool:n="default",id:i,type:o,path:s,projectId:a,dataset:u}=e;if(!t)throw Error("baseUrl is required");if(!s)throw Error("path is required");if(!i)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let l="default"===r?void 0:r,h="default"===n?void 0:n,f=w(i),p=Array.isArray(s)?c(A(s)):s,d=new URLSearchParams({baseUrl:t,id:f,type:o,path:p});if(l&&d.set("workspace",l),h&&d.set("tool",h),a&&d.set("projectId",a),u&&d.set("dataset",u),y(i)||g(i)){if(g(i)){let e=b(i);d.set("perspective",e)}}else d.set("perspective","published");let m=["/"===t?"":t];l&&m.push(l);let v=["mode=presentation",`id=${f}`,`type=${o}`,`path=${encodeURIComponent(p)}`];return h&&v.push(`tool=${h}`),m.push("intent","edit",`${v.join(";")}?${d}`),m.join("/")}function T(e){let{resultSourceMap:t,resultPath:r}=e,{mapping:n,pathSuffix:i}=function(e,t){var r;if(!t?.mappings)return;let n=(r=S(e),`$${r.map(e=>"string"==typeof e?`['${e.replace(/[\f\n\r\t'\\]/g,e=>E[e])}']`:"number"==typeof e?`[${e}]`:""!==e._key?`[?(@._key=='${e._key.replace(/['\\]/g,e=>E[e])}')]`:`[${e._index}]`).join("")}`);if(void 0!==t.mappings[n])return{mapping:t.mappings[n],matchedPath:n,pathSuffix:""};let i=S(e).map(e=>"string"==typeof e?`['${e.replace(/[\f\n\r\t'\\]/g,e=>E[e])}']`:"number"==typeof e?`[${e}]`:""!==e._key?`[?(@._key=='${e._key.replace(/['\\]/g,e=>E[e])}')]`:`[${e._index}]`);for(let e=i.length-1;e>=0;e--){let r=`$${i.slice(0,e).join("")}`,o=t.mappings[r];if(o){let e=n.substring(r.length);return{mapping:o,matchedPath:r,pathSuffix:e}}}}(r,t)||{};
2if(!n||"literal"===n.source.type||"unknown"===n.source.type)return;let o=t.documents[n.source.document],s=t.paths[n.source.path];if(o&&s){var a;let t,{baseUrl:r,workspace:n,tool:u}=("/"!==(t="string"==typeof(a="function"==typeof e.studioUrl?e.studioUrl(o):e.studioUrl)?a:a.baseUrl)&&(t=t.replace(/\/$/,"")),"string"==typeof a?{baseUrl:t}:{...a,baseUrl:t});if(!r)return;let{_id:c,_type:l,_projectId:h,_dataset:f}=o;return{baseUrl:r,workspace:n,tool:u,id:c,type:l,path:function(e){let t,r=[],n=/\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;for(;null!==(t=n.exec(e));){if(void 0!==t[1]){let e=t[1].replace(/\\(\\|f|n|r|t|')/g,e=>R[e]);r.push(e);continue}if(void 0!==t[2]){r.push(parseInt(t[2],10));continue}if(void 0!==t[3]){let e=t[3].replace(/\\(\\')/g,e=>R[e]);r.push({_key:e,_index:-1});continue}}return r}(s+i),projectId:h,dataset:f}}}},6445:function(e){e.exports=function(){function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t(){return(t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}var r="image-Tb9Ew8CXIwaY6R1kjMvI0uRR-2000x3000-jpg";function n(e){return("image-"+e.split("/").slice(-1)[0]).replace(/\.([a-z]+)$/,"-$1")}var i=[["width","w"],["height","h"],["format","fm"],["download","dl"],["blur","blur"],["sharpen","sharp"],["invert","invert"],["orientation","or"],["minHeight","min-h"],["maxHeight","max-h"],["minWidth","min-w"],["maxWidth","max-w"],["quality","q"],["fit","fit"],["crop","crop"],["saturation","sat"],["auto","auto"],["dpr","dpr"],["pad","pad"],["frame","frame"]],o=["clip","crop","fill","fillmax","max","scale","min"],s=["top","bottom","left","right","center","focalpoint","entropy"],a=["format"],u=function(){function u(e,r){this.options=void 0,this.options=e?t({},e.options||{},r||{}):t({},r||{})}var c=u.prototype;return c.withOptions=function(r){var n=r.baseUrl||this.options.baseUrl,o={baseUrl:n};for(var s in r)r.hasOwnProperty(s)&&(o[function(t){for(var r,n=function(t,r){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,r){if(t){if("string"==typeof t)return e(t,void 0);var n=({}).toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t))){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(i);!(r=n()).done;){var o=r.value,s=o[0],a=o[1];if(t===s||t===a)return s}return t}(s)]=r[s]);return new u(this,t({baseUrl:n},o))},c.image=function(e){return this.withOptions({source:e})},c.dataset=function(e){return this.withOptions({dataset:e})},c.projectId=function(e){return this.withOptions({projectId:e})},c.bg=function(e){return this.withOptions({bg:e})},c.dpr=function(e){return this.withOptions(e&&1!==e?{dpr:e}:{})},c.width=function(e){return this.withOptions({width:e})},c.height=function(e){return this.withOptions({height:e})},c.focalPoint=function(e,t){return this.withOptions({focalPoint:{x:e,y:t}})},c.maxWidth=function(e){return this.withOptions({maxWidth:e})},c.minWidth=function(e){return this.withOptions({minWidth:e})},c.maxHeight=function(e){return this.withOptions({maxHeight:e})},c.minHeight=function(e){return this.withOptions({minHeight:e})},c.size=function(e,t){return this.withOptions({width:e,height:t})},c.blur=function(e){return this.withOptions({blur:e})},c.sharpen=function(e){return this.withOptions({sharpen:e})},c.rect=function(e,t,r,n){return this.withOptions({rect:{left:e,top:t,width:r,height:n}})},c.format=function(e){return this.withOptions({format:e})},c.invert=function(e){return this.withOptions({invert:e})},c.orientation=function(e){return this.withOptions({orientation:e})},c.quality=function(e){return this.withOptions({quality:e})},c.forceDownload=function(e){return this.withOptions({download:e})},c.flipHorizontal=function(){return this.withOptions({flipHorizontal:!0})},c.flipVertical=function(){return this.withOptions({flipVertical:!0})},c.ignoreImageParams=function(){return this.withOptions({ignoreImageParams:!0})},c.fit=function(e){if(-1===o.indexOf(e))throw Error('Invalid fit mode "'+e+'"');return this.withOptions({fit:e})},c.crop=function(e){if(-1===s.indexOf(e))throw Error('Invalid crop mode "'+e+'"');return this.withOptions({crop:e})},c.saturation=function(e){return this.withOptions({saturation:e})},c.auto=function(e){if(-1===a.indexOf(e))throw Error('Invalid auto mode "'+e+'"');return this.withOptions({auto:e})},c.pad=function(e){return this.withOptions({pad:e})},c.vanityName=function(e){return this.withOptions({vanityName:e})},c.frame=function(e){if(1!==e)throw Error('Invalid frame value "'+e+'"');return this.withOptions({frame:e})},c.url=function(){return function(e){var o=t({},e||{}),s=o.source;delete o.source;var a=function(e){var r,i;if(!e)return null;if("string"==typeof e&&(i=e,/^https?:\/\//.test(""+i)))r={asset:{_ref:n(e)}};else if("string"==typeof e)r={asset:{_ref:e}};else if(e&&"string"==typeof e._ref)r={asset:e};else if(e&&"string"==typeof e._id)r={asset:{_ref:e._id||""}};else if(e&&e.asset&&"string"==typeof e.asset.url)r={asset:{_ref:n(e.asset.url)}};else{if("object"!=typeof e.asset)return null;r=t({},e)}return e.crop&&(r.crop=e.crop),e.hotspot&&(r.hotspot=e.hotspot),function(e){if(e.crop&&e.hotspot)return e;var r=t({},e);
2return r.crop||(r.crop={left:0,top:0,bottom:0,right:0}),r.hotspot||(r.hotspot={x:.5,y:.5,height:1,width:1}),r}(r)}(s);if(!a){if(s&&"object"==typeof s&&null!==s&&s._upload&&(!s.asset||!s.asset._ref))return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8HwQACfsD/QNViZkAAAAASUVORK5CYII=";throw Error("Unable to resolve image URL from source ("+JSON.stringify(s)+")")}var u=function(e){var t=e.split("-"),n=t[1],i=t[2],o=t[3];if(!n||!i||!o)throw Error("Malformed asset _ref '"+e+"'. Expected an id like \""+r+'".');var s=i.split("x"),a=s[0],u=s[1],c=+a,l=+u;if(!(isFinite(c)&&isFinite(l)))throw Error("Malformed asset _ref '"+e+"'. Expected an id like \""+r+'".');return{id:n,width:c,height:l,format:o}}(a.asset._ref||a.asset._id||""),c=Math.round(a.crop.left*u.width),l=Math.round(a.crop.top*u.height),h={left:c,top:l,width:Math.round(u.width-a.crop.right*u.width-c),height:Math.round(u.height-a.crop.bottom*u.height-l)},f=a.hotspot.height*u.height/2,p=a.hotspot.width*u.width/2,d=a.hotspot.x*u.width,y=a.hotspot.y*u.height;return o.rect||o.focalPoint||o.ignoreImageParams||o.crop||(o=t({},o,function(e,t){var r,n=t.width,i=t.height;if(!(n&&i))return{width:n,height:i,rect:e.crop};var o=e.crop,s=e.hotspot,a=n/i;if(o.width/o.height>a){var u=Math.round(o.height),c=Math.round(u*a),l=Math.max(0,Math.round(o.top)),h=Math.max(0,Math.round(Math.round((s.right-s.left)/2+s.left)-c/2));h<o.left?h=o.left:h+c>o.left+o.width&&(h=o.left+o.width-c),r={left:h,top:l,width:c,height:u}}else{var f=o.width,p=Math.round(f/a),d=Math.max(0,Math.round(o.left)),y=Math.max(0,Math.round(Math.round((s.bottom-s.top)/2+s.top)-p/2));y<o.top?y=o.top:y+p>o.top+o.height&&(y=o.top+o.height-p),r={left:d,top:y,width:f,height:p}}return{width:n,height:i,rect:r}}({crop:h,hotspot:{left:d-p,top:y-f,right:d+p,bottom:y+f}},o))),function(e){var t=(e.baseUrl||"https://cdn.sanity.io").replace(/\/+$/,""),r=e.vanityName?"/"+e.vanityName:"",n=e.asset.id+"-"+e.asset.width+"x"+e.asset.height+"."+e.asset.format+r,o=t+"/images/"+e.projectId+"/"+e.dataset+"/"+n,s=[];if(e.rect){var a=e.rect,u=a.left,c=a.top,l=a.width,h=a.height;(0!==u||0!==c||h!==e.asset.height||l!==e.asset.width)&&s.push("rect="+u+","+c+","+l+","+h)}e.bg&&s.push("bg="+e.bg),e.focalPoint&&(s.push("fp-x="+e.focalPoint.x),s.push("fp-y="+e.focalPoint.y));var f=[e.flipHorizontal&&"h",e.flipVertical&&"v"].filter(Boolean).join("");return(f&&s.push("flip="+f),i.forEach(function(t){var r=t[0],n=t[1];void 0!==e[r]?s.push(n+"="+encodeURIComponent(e[r])):void 0!==e[n]&&s.push(n+"="+encodeURIComponent(e[n]))}),0===s.length)?o:o+"?"+s.join("&")}(t({},o,{asset:u}))}(this.options)},c.toString=function(){return this.url()},u}();return function(e){if(e&&"config"in e&&"function"==typeof e.config){var t=e.config(),r=t.apiHost,n=t.projectId,i=t.dataset;return new u(null,{baseUrl:(r||"https://api.sanity.io").replace(/^https:\/\/api\./,"https://cdn."),projectId:n,dataset:i})}if(e&&"clientConfig"in e&&"object"==typeof e.clientConfig){var o=e.clientConfig,s=o.apiHost,a=o.projectId,c=o.dataset;return new u(null,{baseUrl:(s||"https://api.sanity.io").replace(/^https:\/\/api\./,"https://cdn."),projectId:a,dataset:c})}return new u(null,e||{})}}()},6554:(e,t,r)=>{"use strict";r.d(t,{$:()=>n});var n={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},6595:(e,t,r)=>{"use strict";r.d(t,{w:()=>n});var n=new(r(673)).c(function(e){return e.complete()})},6759:(e,t,r)=>{"use strict";r.d(t,{U:()=>n});var n={now:function(){return(n.delegate||Date).now()},delegate:void 0}},6826:(e,t,r)=>{"use strict";r.d(t,{y:()=>i});var n=r(8229);function i(e){return(0,n.T)(null==e?void 0:e.then)}},7122:(e,t,r)=>{"use strict";r.d(t,{Tg:()=>y});var n=r(4902),i=r(1749),o=r(6826),s=r(673),a=r(2527),u=r(8981),c=r(665),l=r(2251),h=r(1706),f=r(8229),p=r(3100),d=r(8840);function y(e){if(e instanceof s.c)return e;if(null!=e){var t,r,y,m,v;if((0,a.l)(e)){return t=e,new s.c(function(e){var r=t[d.s]();if((0,f.T)(r.subscribe))return r.subscribe(e);throw TypeError("Provided object does not correctly implement Symbol.observable")})}if((0,i.X)(e)){return r=e,new s.c(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}if((0,o.y)(e)){return y=e,new s.c(function(e){y.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,p.m)})}if((0,u.T)(e))return g(e);if((0,l.x)(e)){return m=e,new s.c(function(e){var t,r;try{for(var i=(0,n.Ju)(m),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}e.complete()})}if((0,h.U)(e)){return v=e,g((0,h.C)(v))}}throw(0,c.L)(e)}function g(e){return new s.c(function(t){(function(e,t){var r,i,o,s;return(0,n.sH)(this,void 0,void 0,function(){var a;return(0,n.YH)(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=(0,n.xN)(e),u.label=1;case 1:return[4,r.next()];case 2:if((i=u.sent()).done)return[3,4];if(a=i.value,t.next(a),t.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return o={error:u.sent()},[3,11];case 6:if(u.trys.push([6,,9,10]),!(i&&!i.done&&(s=r.return)))return[3,8];return[4,s.call(r)];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];
2case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}},7247:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+e[t+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=5960464477539062e-23*(23===i),p=n?0:o-1,d=n?1:-1,y=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+h>=1?t+=f/u:t+=f*Math.pow(2,1-h),t*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*y}},7261:(e,t,r)=>{"use strict";r.d(t,{m:()=>s});var n=r(4902),i=r(169),o=r(6759),s=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=o.U);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return(0,n.C6)(t,e),t.prototype.next=function(t){var r=this.isStopped,n=this._buffer,i=this._infiniteTimeWindow,o=this._timestampProvider,s=this._windowTime;!r&&(n.push(t),i||n.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,i=(n?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!n){for(var o=t.now(),s=0,a=1;a<r.length&&r[a]<=o;a+=2)s=a;s&&r.splice(0,s+1)}},t}(i.B)},7285:(e,t,r)=>{"use strict";r.d(t,{u:()=>u});var n=r(4902),i=r(7122),o=r(169),s=r(1943),a=r(2380);function u(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new o.B}:t,n=e.resetOnError,u=void 0===n||n,l=e.resetOnComplete,h=void 0===l||l,f=e.resetOnRefCountZero,p=void 0===f||f;return function(e){var t,n,o,l=0,f=!1,d=!1,y=function(){null==n||n.unsubscribe(),n=void 0},g=function(){y(),t=o=void 0,f=d=!1},m=function(){var e=t;g(),null==e||e.unsubscribe()};return(0,a.N)(function(e,a){l++,d||f||y();var v=o=null!=o?o:r();a.add(function(){0!=--l||d||f||(n=c(m,p))}),v.subscribe(a),!t&&l>0&&(t=new s.Ms({next:function(e){return v.next(e)},error:function(e){d=!0,y(),n=c(g,u,e),v.error(e)},complete:function(){f=!0,y(),n=c(g,h),v.complete()}}),(0,i.Tg)(e).subscribe(t))})(e)}}function c(e,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(!0===t)return void e();if(!1!==t){var a=new s.Ms({next:function(){a.unsubscribe(),e()}});return(0,i.Tg)(t.apply(void 0,(0,n.fX)([],(0,n.zs)(r)))).subscribe(a)}}},7436:(e,t,r)=>{"use strict";function n(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}r.d(t,{o:()=>n})},7730:(e,t,r)=>{"use strict";r.d(t,{m:()=>i});var n=r(8229);function i(e){return e&&(0,n.T)(e.schedule)}},7916:(e,t,r)=>{"use strict";r.d(t,{UU:()=>ru,x_:()=>e1});let n=!(typeof navigator>"u")&&"ReactNative"===navigator.product,i={timeout:n?6e4:12e4},o=function(e){let t={...i,..."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(i.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),i=e.slice(t+1);if(!n)return{url:r,searchParams:new URLSearchParams(i)};if("function"!=typeof decodeURIComponent)throw Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");let o=new URLSearchParams;for(let e of i.split("&")){let[t,r]=e.split("=");t&&o.append(s(t),s(r||""))}return{url:r,searchParams:o}}(t.url);for(let[n,i]of Object.entries(t.query)){if(void 0!==i)if(Array.isArray(i))for(let e of i)r.append(n,e);else r.append(n,i);let o=r.toString();o&&(t.url=`${e}?${o}`)}}return t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t};function s(e){return decodeURIComponent(e.replace(/\+/g," "))}let a=/^https?:\/\//i,u=function(e){if(!a.test(e.url))throw Error(`"${e.url}" is not a valid URL`)},c=["request","response","progress","error","abort"],l=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];
2var h,f,p=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(){if(f)return h;f=1;var e=function(e){return e.replace(/^\s+|\s+$/g,"")};return h=function(t){if(!t)return{};for(var r=Object.create(null),n=e(t).split("\n"),i=0;i<n.length;i++){var o,s=n[i],a=s.indexOf(":"),u=e(s.slice(0,a)).toLowerCase(),c=e(s.slice(a+1));typeof r[u]>"u"?r[u]=c:(o=r[u],"[object Array]"===Object.prototype.toString.call(o))?r[u].push(c):r[u]=[r[u],c]}return r}}());class d{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#e;#t;#r;#n={};#i;#o={};#s;open(e,t,r){this.#e=e,this.#t=t,this.#r="",this.readyState=1,this.onreadystatechange?.(),this.#i=void 0}abort(){this.#i&&this.#i.abort()}getAllResponseHeaders(){return this.#r}setRequestHeader(e,t){this.#n[e]=t}setInit(e,t=!0){this.#o=e,this.#s=t}send(e){let t="arraybuffer"!==this.responseType,r={...this.#o,method:this.#e,headers:this.#n,body:e};"function"==typeof AbortController&&this.#s&&(this.#i=new AbortController,"u">typeof EventTarget&&this.#i.signal instanceof EventTarget&&(r.signal=this.#i.signal)),"u">typeof document&&(r.credentials=this.withCredentials?"include":"omit"),fetch(this.#t,r).then(e=>(e.headers.forEach((e,t)=>{this.#r+=`${t}: ${e}\r 3`}),this.status=e.status,this.statusText=e.statusText,this.readyState=3,this.onreadystatechange?.(),t?e.text():e.arrayBuffer())).then(e=>{"string"==typeof e?this.responseText=e:this.response=e,this.readyState=4,this.onreadystatechange?.()}).catch(e=>{"AbortError"!==e.name?this.onerror?.(e):this.onabort?.()})}}let y="function"==typeof XMLHttpRequest?"xhr":"fetch",g="xhr"===y?XMLHttpRequest:d,m=(e,t)=>{let r=e.options,n=e.applyMiddleware("finalizeOptions",r),i={},o=e.applyMiddleware("interceptRequest",void 0,{adapter:y,context:e});if(o){let e=setTimeout(t,0,null,o);return{abort:()=>clearTimeout(e)}}let s=new g;s instanceof d&&"object"==typeof n.fetch&&s.setInit(n.fetch,n.useAbortSignal??!0);let a=n.headers,u=n.timeout,c=!1,l=!1,h=!1;if(s.onerror=e=>{v(s instanceof d?e instanceof Error?e:Error(`Request error while attempting to reach is ${n.url}`,{cause:e}):Error(`Request error while attempting to reach is ${n.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},s.ontimeout=e=>{v(Error(`Request timeout while attempting to reach ${n.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},s.onabort=()=>{m(!0),c=!0},s.onreadystatechange=function(){u&&(m(),i.socket=setTimeout(()=>f("ESOCKETTIMEDOUT"),u.socket)),!c&&s&&4===s.readyState&&0!==s.status&&function(){if(!(c||l||h)){if(0===s.status)return v(Error("Unknown XHR error"));m(),l=!0,t(null,{body:s.response||(""===s.responseType||"text"===s.responseType?s.responseText:""),url:n.url,method:n.method,headers:p(s.getAllResponseHeaders()),statusCode:s.status,statusMessage:s.statusText})}}()},s.open(n.method,n.url,!0),s.withCredentials=!!n.withCredentials,a&&s.setRequestHeader)for(let e in a)a.hasOwnProperty(e)&&s.setRequestHeader(e,a[e]);return n.rawBody&&(s.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:n,adapter:y,request:s,context:e}),s.send(n.body||null),u&&(i.connect=setTimeout(()=>f("ETIMEDOUT"),u.connect)),{abort:function(){c=!0,s&&s.abort()}};function f(t){h=!0,s.abort();let r=Error("ESOCKETTIMEDOUT"===t?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);r.code=t,e.channels.error.publish(r)}function m(e){(e||c||s&&s.readyState>=2&&i.connect)&&clearTimeout(i.connect),i.socket&&clearTimeout(i.socket)}function v(e){if(l)return;m(!0),l=!0,s=null;let r=e||Error(`Network error while attempting to reach ${n.url}`);r.isNetworkError=!0,r.request=n,t(r)}};var v,b,w,E,R,A=r(9742),C=r(2909).hp,S={exports:{}};R||(R=1,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,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,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")||t.storage.getItem("DEBUG")}catch{}return!e&&"u">typeof A&&"env"in A&&(e=A.env.DEBUG),e},t.useColors=function(){let e;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+)/))&&
3("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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch{}}(),r=!1,t.destroy=()=>{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=(E?w:(E=1,w=function(e){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;let r=Number(new Date);a.diff=r-(n||r),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!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=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,t){let r=0,n=0,i=-1,o=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(i=n,o=r):r++,n++;else{if(-1===i)return!1;n=i+1,r=++o}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}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,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){for(let r of(t.save(e),t.namespaces=e,t.names=[],t.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(let r of t.skips)if(n(e,r))return!1;for(let r of t.names)if(n(e,r))return!0;return!1},t.humanize=function(){if(b)return v;b=1;function e(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}return v=function(t,r){r=r||{};var n,i,o=typeof t;if("string"===o&&t.length>0){var s=t;if(!((s=String(s)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(a){var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*u;case"weeks":case"week":case"w":return 6048e5*u;case"days":case"day":case"d":return 864e5*u;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*u;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*u;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u}}}return}if("number"===o&&isFinite(t))return r.long?(i=Math.abs(t))>=864e5?e(t,i,864e5,"day"):i>=36e5?e(t,i,36e5,"hour"):i>=6e4?e(t,i,6e4,"minute"):i>=1e3?e(t,i,1e3,"second"):t+" ms":(n=Math.abs(t))>=864e5?Math.round(t/864e5)+"d":n>=36e5?Math.round(t/36e5)+"h":n>=6e4?Math.round(t/6e4)+"m":n>=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}))(t);let{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}
3(S,S.exports)),S.exports,Object.prototype.hasOwnProperty;let x=typeof C>"u"?()=>!1:e=>C.isBuffer(e);function T(e){return"[object Object]"===Object.prototype.toString.call(e)}let $=["boolean","string","number"],O={};"u">typeof globalThis?O=globalThis:"u">typeof window?O=window:"u">typeof global?O=global:"u">typeof self&&(O=self);var _=O;let I=(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,i)=>{let o=n.options.cancelToken;o&&o.promise.then(e=>{r.abort.publish(e),i(e)}),r.error.subscribe(i),r.response.subscribe(r=>{t(e.onlyBody?r.body:r)}),setTimeout(()=>{try{r.request.publish(n)}catch(e){i(e)}},0)})}};class j{__CANCEL__=!0;message;constructor(e){this.message=e}toString(){return"Cancel"+(this.message?`: ${this.message}`:"")}}class q{promise;reason;constructor(e){if("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 j(e),t(this.reason))})}static source=()=>{let e;return{token:new q(t=>{e=t}),cancel:e}}}I.Cancel=j,I.CancelToken=q,I.isCancel=e=>!(!e||!e?.__CANCEL__);var k=(e,t,r)=>("GET"===r.method||"HEAD"===r.method)&&(e.isNetworkError||!1);function U(e){return 100*Math.pow(2,e)+100*Math.random()}let P=(e={})=>(e=>{let t=e.maxRetries||5,r=e.retryDelay||U,n=e.shouldRetry;return{onError:(e,i)=>{var o;let s=i.options,a=s.maxRetries||t,u=s.retryDelay||r,c=s.shouldRetry||n,l=s.attemptNumber||0;if(null!==(o=s.body)&&"object"==typeof o&&"function"==typeof o.pipe||!c(e,l,s)||l>=a)return e;let h=Object.assign({},i,{options:Object.assign({},s,{attemptNumber:l+1})});return setTimeout(()=>i.channels.request.publish(h),u(l)),null}}})({shouldRetry:k,...e});P.shouldRetry=k;var M=r(673),N=r(5262),L=r(8229),F=r(5812),z=r(574);function D(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,F.lI)(e);return(0,z.H)(e,r)}var B=r(141),V=(0,r(6011).L)(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function K(e,t){var r="object"==typeof t;return new Promise(function(n,i){var o,s=!1;e.subscribe({next:function(e){o=e,s=!0},error:i,complete:function(){s?n(o):r?n(t.defaultValue):i(new V)}})})}var H=r(4374),J=r(7122),W=r(1096),Y=r(2380);function X(e){return(0,Y.N)(function(t,r){var n,i=null,o=!1;i=t.subscribe((0,W._)(r,void 0,void 0,function(s){n=(0,J.Tg)(e(s,X(e)(t))),i?(i.unsubscribe(),i=null,n.subscribe(r)):o=!0})),o&&(i.unsubscribe(),i=null,n.subscribe(r))})}var Q=r(8673),G=r(8341),Z=new(r(1072)).q(G.R);function ee(e,t){var r=(0,L.T)(e)?e:function(){return e},n=function(e){return e.error(r())};return new M.c(t?function(e){return t.schedule(n,0,e)}:n)}r(7730);var et=r(2619);function er(e){return(0,Y.N)(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}var en=r(7285),ei=r(5486),eo=r(4272),es=r(1943);function ea(e,t){var r="object"==typeof t;return new Promise(function(n,i){var o=new es.Ms({next:function(e){n(e),o.unsubscribe()},error:i,complete:function(){r?n(t.defaultValue):i(new V)}});e.subscribe(o)})}var eu=r(5604),ec=r(4902),el=r(2737);function eh(e,t,r){e?(0,el.N)(r,e,t):t()}var ef=Array.isArray,ep=r(5752),ed=r(1981);function ey(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,F.ms)(e);return r?(0,ed.F)(ey.apply(void 0,(0,ec.fX)([],(0,ec.zs)(e))),(0,ep.I)(r)):(0,Y.N)(function(t,r){var n,i,o;(n=(0,ec.fX)([t],(0,ec.zs)(1===e.length&&ef(e[0])?e[0]:e)),void 0===o&&(o=et.D),function(e){eh(void 0,function(){for(var t=n.length,r=Array(t),s=t,a=t,u=function(t){eh(i,function(){var u=(0,z.H)(n[t],i),c=!1;u.subscribe((0,W._)(e,function(n){r[t]=n,!c&&(c=!0,a--),a||e.next(o(r.slice()))},function(){--s||e.complete()}))},e)},c=0;c<t;c++)u(c)},e)})(r)})}var eg=r(1836),em=r(6241);let ev=e=>crypto.getRandomValues(new Uint8Array(e)),eb=/\r\n|[\n\r\u2028\u2029]/;function ew(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n].length+1;if(r+i>e)return{line:n+1,column:e-r};r+=i}return{line:t.length,column:t[t.length-1]?.length??0}}class eE extends Error{response;statusCode=400;responseBody;details;constructor(e,t){let r=eA(e,t);super(r.message),Object.assign(this,r)}}
3class eR extends Error{response;statusCode=500;responseBody;details;constructor(e){let t=eA(e);super(t.message),Object.assign(this,t)}}function eA(e,t){var r,n,i;let o=e.body,s={response:e,statusCode:e.statusCode,responseBody:(r=o,-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(r,null,2):r),message:"",details:void 0};if(!(0,eu.u4)(o))return s.message=ex(e,o),s;let a=o.error;if("string"==typeof a&&"string"==typeof o.message)return s.message=`${a} - ${o.message}`,s;if("object"!=typeof a||null===a)return"string"==typeof a?s.message=a:"string"==typeof o.message?s.message=o.message:s.message=ex(e,o),s;if("type"in(n=a)&&"mutationError"===n.type&&"description"in n&&"string"==typeof n.description||"type"in(i=a)&&"actionError"===i.type&&"description"in i&&"string"==typeof i.description){let e=a.items||[],t=e.slice(0,5).map(e=>e.error?.description).filter(Boolean),r=t.length?`: 4- ${t.join(` 5- `)}`:"";return e.length>5&&(r+=` 6...and ${e.length-5} more`),s.message=`${a.description}${r}`,s.details=o.error,s}return eC(a)?(s.message=eS(a,t?.options?.query?.tag),s.details=o.error):"description"in a&&"string"==typeof a.description?(s.message=a.description,s.details=a):s.message=ex(e,o),s}function eC(e){return(0,eu.u4)(e)&&"queryParseError"===e.type&&"string"==typeof e.query&&"number"==typeof e.start&&"number"==typeof e.end}function eS(e,t){let{query:r,start:n,end:i,description:o}=e;if(!r||typeof n>"u")return`GROQ query parse error: ${o}`;let s=t?` 7 8Tag: ${t}`:"";return`GROQ query parse error: 9${function(e,t,r){let n=e.split(eb),{start:i,end:o,markerLines:s}=function(e,t){let r={...e.start},n={...r,...e.end},i=r.line??-1,o=r.column??0,s=n.line,a=n.column,u=Math.max(i-3,0),c=Math.min(t.length,s+3);-1===i&&(u=0),-1===s&&(c=t.length);let l=s-i,h={};if(l)for(let e=0;e<=l;e++){let r=e+i;if(o)if(0===e){let e=t[r-1].length;h[r]=[o,e-o+1]}else if(e===l)h[r]=[0,a];else{let n=t[r-e].length;h[r]=[0,n]}else h[r]=!0}else o===a?o?h[i]=[o,0]:h[i]=!0:h[i]=[o,a-o];return{start:u,end:c,markerLines:h}}({start:ew(t.start,n),end:t.end?ew(t.end,n):void 0},n),a=`${o}`.length;return e.split(eb,o).slice(i,o).map((e,t)=>{let n=i+1+t,o=` ${` ${n}`.slice(-a)} |`,u=s[n],c=!s[n+1];if(!u)return` ${o}${e.length>0?` ${e}`:""}`;let l="";if(Array.isArray(u)){let t=e.slice(0,Math.max(u[0]-1,0)).replace(/[^\t]/g," "),n=u[1]||1;l=` 10 `+o.replace(/\d/g," ")+" "+t+"^".repeat(n),c&&r&&(l+=" "+r)}return">"+o+(e.length>0?` ${e}`:"")+l}).join(` 11`)}(r,{start:n,end:i},o)}${s}`}function ex(e,t){var r,n;let i="string"==typeof t?` (${n=100,(r=t).length>100?`${r.slice(0,n)}\u2026`:r})`:"",o=e.statusMessage?` ${e.statusMessage}`:"";return`${e.method}-request to ${e.url} resulted in HTTP ${e.statusCode}${o}${i}`}class eT extends Error{projectId;addOriginUrl;constructor({projectId:e}){super("CorsOriginError"),this.name="CorsOriginError",this.projectId=e;let t=new URL(`https://sanity.io/manage/project/${e}/api`);if("u">typeof location){let{origin:e}=location;t.searchParams.set("cors","add"),t.searchParams.set("origin",e),this.addOriginUrl=t,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${t}`}else this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: ${t}`}}let e$={onResponse:(e,t)=>{if(e.statusCode>=500)throw new eR(e);if(e.statusCode>=400)throw new eE(e,t);return e}};function eO(e,t={}){return((e=[],t=m)=>(function e(t,r){let n=[],i=l.reduce((e,t)=>(e[t]=e[t]||[],e),{processOptions:[o],validateOptions:[u]});function s(e){let t,n=c.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),{}),o=function(e,t,...r){let n="onError"===e,o=t;for(let t=0;t<i[e].length&&(o=(0,i[e][t])(o,...r),!n||o);t++);return o},s=o("processOptions",e);o("validateOptions",s);let a={options:s,channels:n,applyMiddleware:o},u=n.request.subscribe(e=>{t=r(e,(t,r)=>((e,t,r)=>{let i=e,s=t;if(!i)try{s=o("onResponse",t,r)}catch(e){s=null,i=e}(i=i&&o("onError",i,r))?n.error.publish(i):s&&n.response.publish(s)})(t,r,e))});n.abort.subscribe(()=>{u(),t&&t.abort()});let l=o("onReturn",n,a);return l===n&&n.request.publish(a),l}return s.use=function(e){if(!e)throw Error("Tried to add middleware that resolved to fal
11sey 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))([P({shouldRetry:e_}),...e,function(e={}){let t={},r=t=>void 0!==e.ignoreWarnings&&(Array.isArray(e.ignoreWarnings)?e.ignoreWarnings:[e.ignoreWarnings]).some(e=>"string"==typeof e?t.includes(e):e instanceof RegExp&&e.test(t));return{onResponse:e=>{let n=e.headers["x-sanity-warning"];for(let e of Array.isArray(n)?n:[n])!e||t[e]||r(e)||(t[e]=!0,console.warn(e));return e}}}(t),{processOptions:e=>{let t=e.body;return!t||"function"==typeof t.pipe||x(t)||-1===$.indexOf(typeof t)&&!Array.isArray(t)&&!function(e){if(!1===T(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!1!==T(r)&&!1!==r.hasOwnProperty("isPrototypeOf")}(t)?e:Object.assign({},e,{body:JSON.stringify(e.body),headers:Object.assign({},e.headers,{"Content-Type":"application/json"})})}},{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"))}},e$,function(e={}){let t=e.implementation||_.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:M.c})])}function e_(e,t,r){if(0===r.maxRetries)return!1;let n="GET"===r.method||"HEAD"===r.method,i=(r.uri||r.url).startsWith("/data/query"),o=e.response&&(429===e.response.statusCode||502===e.response.statusCode||503===e.response.statusCode);return(!!n||!!i)&&!!o||P.shouldRetry(e,t,r)}function eI(e){return"https://www.sanity.io/help/"+e}let ej=["image","file"],eq=["before","after","replace"],ek=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")},eU=(e,t)=>{if(null===t||"object"!=typeof t||Array.isArray(t))throw Error(`${e}() takes an object of properties`)},eP=(e,t)=>{if("string"!=typeof t||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(t)||t.includes(".."))throw Error(`${e}(): "${t}" is not a valid document ID`)},eM=(e,t)=>{if(!t._id)throw Error(`${e}() requires that the document contains an ID ("_id" property)`);eP(e,t._id)},eN=(e,t)=>{if(!t._type)throw Error(`\`${e}()\` requires that the document contains a type (\`_type\` property)`);((e,t)=>
11{if("string"!=typeof t)throw Error(`\`${e}()\`: \`${t}\` is not a valid document type`)})(e,t._type)},eL=e=>{if(e.dataset)return e.dataset;let t=e.resource;if(t&&"dataset"===t.type){let e=t.id.split(".");if(2!==e.length)throw Error('Dataset resource ID must be in the format "project.dataset"');return e[1]}throw Error("`dataset` must be provided to perform queries")},eF=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},ez=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:n}=t;switch(r){case"dataset":if(2!==n.split(".").length)throw Error('Dataset resource ID must be in the format "project.dataset"');return;case"dashboard":case"media-library":case"canvas":return;default:throw Error(`Unsupported resource type: ${r.toString()}`)}},eD=(e,t)=>{if(t.resource)throw Error(`\`${e}\` does not support resource-based operations`)},eB=e=>(function(e){let t=!1,r;return(...n)=>(t||(r=e(...n),t=!0),r)})((...t)=>console.warn(e.join(" "),...t)),eV=eB(["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"]),eK=eB(["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."]),eH=eB(["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."]),eJ=eB(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),eW=eB(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${eI("js-client-browser-token")} for more information and how to hide this warning.`]),eY=eB(["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`."]),eX=eB(["Using the Sanity client without specifying an API version is deprecated.",`See ${eI("js-client-api-version")}`]),eQ=(eB(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),eB(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."])),eG=eB(["The `~experimental_resource` configuration property has been renamed to `resource`.","Please update your client configuration to use `resource` instead. Support for `~experimental_resource` will be removed in a future version."]),eZ={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},e0=["localhost","127.0.0.1","0.0.0.0"];function e1(e){if(Array.isArray(e)&&e.length>1&&e.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}let e2=(e,t)=>{let r,n={...t,...e,stega:{..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||eZ.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};n.apiVersion||eX();let i={...eZ,...n};i["~experimental_resource"]&&!i.resource&&(eG(),i.resource=i["~experimental_resource"]);let o=i.resource,s=i.useProjectHostname&&!o;if(typeof Promise>"u"){let e=eI("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${e}`)}if(s&&!i.projectId)throw Error("Configuration must contain `projectId`");if(o&&ez(i),"u">typeof i.perspective&&e1(i.perspective),"encodeSourceMap"in i)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in i)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?");
11if("boolean"!=typeof i.stega.enabled)throw Error(`stega.enabled must be a boolean, received ${i.stega.enabled}`);if(i.stega.enabled&&void 0===i.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(i.stega.enabled&&"string"!=typeof i.stega.studioUrl&&"function"!=typeof i.stega.studioUrl)throw Error(`stega.studioUrl must be a string or a function, received ${i.stega.studioUrl}`);let a="u">typeof window&&window.location&&window.location.hostname,u=a&&(r=window.location.hostname,-1!==e0.indexOf(r)),c=!!i.token;i.withCredentials&&c&&(eY(),i.withCredentials=!1),a&&u&&c&&!0!==i.ignoreBrowserTokenWarning?eW():typeof i.useCdn>"u"&&eK(),s&&(e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")})(i.projectId),i.dataset&&ek(i.dataset),"requestTagPrefix"in i&&(i.requestTagPrefix=i.requestTagPrefix?eF(i.requestTagPrefix).replace(/\.+$/,""):void 0),i.apiVersion=`${i.apiVersion}`.replace(/^v/,""),i.isDefaultApi=i.apiHost===eZ.apiHost,!0===i.useCdn&&i.withCredentials&&eV(),i.useCdn=!1!==i.useCdn&&!i.withCredentials,function(e){if("1"===e||"X"===e)return;let t=new Date(e);if(!(/^\d{4}-\d{2}-\d{2}$/.test(e)&&t instanceof Date&&t.getTime()>0))throw Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}(i.apiVersion);let l=i.apiHost.split("://",2),h=l[0],f=l[1],p=i.isDefaultApi?"apicdn.sanity.io":f;return s?(i.url=`${h}://${i.projectId}.${f}/v${i.apiVersion}`,i.cdnUrl=`${h}://${i.projectId}.${p}/v${i.apiVersion}
11`):(i.url=`${i.apiHost}/v${i.apiVersion}`,i.cdnUrl=i.url),i};class e3 extends Error{name="ConnectionFailedError"}class e6 extends Error{name="DisconnectError";reason;constructor(e,t,r={}){super(e,r),this.reason=t}}class e8 extends Error{name="ChannelError";data;constructor(e,t){super(e),this.data=t}}class e5 extends Error{name="MessageError";data;constructor(e,t,r={}){super(e,r),this.data=t}}class e4 extends Error{name="MessageParseError"}let e9=["channelError","disconnect"];function e7(e,t){return(0,N.v)(()=>{let t=e();return t&&(t instanceof M.c||(0,L.T)(t.lift)&&(0,L.T)(t.subscribe))?t:D(t)}).pipe((0,B.Z)(e=>{var r,n;return r=e,n=t,new M.c(e=>{let t=n.includes("open"),i=n.includes("reconnect");function o(t){if("data"in t){let[r,n]=te(t);e.error(r?new e4("Unable to parse EventSource error message",{cause:n}):new e5((n?.data).message,n));return}r.readyState===r.CLOSED?e.error(new e3("EventSource connection failed")):i&&e.next({type:"reconnect"})}function s(){e.next({type:"open"})}function a(t){let[n,i]=te(t);if(n)return void e.error(new e4("Unable to parse EventSource message",{cause:n}));if("channelError"===t.type){let t=new URL(r.url).searchParams.get("tag");e.error(new e8(function(e,t){let r=e.error;return r?eC(r)?eS(r,t):r.description?r.description:"string"==typeof r?r:JSON.stringify(r,null,2):e.message||"Unknown listener error"}(i?.data,t),i.data));return}if("disconnect"===t.type)return void e.error(new e6(`Server disconnected client: ${i.data?.reason||"unknown error"}`));e.next({type:t.type,id:t.lastEventId,...i.data?{data:i.data}:{}})}r.addEventListener("error",o),t&&r.addEventListener("open",s);let u=[...new Set([...e9,...n])].filter(e=>"error"!==e&&"open"!==e&&"reconnect"!==e);return u.forEach(e=>r.addEventListener(e,a)),()=>{r.removeEventListener("error",o),t&&r.removeEventListener("open",s),u.forEach(e=>r.removeEventListener(e,a)),r.close()}})}))}function te(e){try{let t="string"==typeof e.data&&JSON.parse(e.data);return[null,{type:e.type,id:e.lastEventId,...!function(e){for(let t in e)return!1;return!0}(t)?{data:t}:{}}]}catch(e){return[e,null]}}function tt(e){if("string"==typeof e)return{id:e};if(Array.isArray(e))return{query:"*[_id in $ids]",params:{ids:e}};if("object"==typeof e&&null!==e&&"query"in e&&"string"==typeof e.query)return"params"in e&&"object"==typeof e.params&&null!==e.params?{query:e.query,params:e.params}:{query:e.query};let t=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(` 12`);throw Error(`Unknown selection - must be one of: 13 14${t}`)}class tr{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 eU("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,t,r){return((e,t,r)=>{let n="insert(at, selector, items)";if(-1===eq.indexOf(e)){let e=eq.map(e=>`"${e}"`).join(", ");throw Error(`${n} takes an "at"-argument which is one of: ${e}`)}if("string"!=typeof t)throw Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw Error(`${n} takes an "items"-argument which must be an array`)})(e,t,r),this._assign("insert",{[e]:t,items:r})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,r,n){let i=t<0?t-1:t,o=typeof r>"u"||-1===r?-1:Math.max(0,t+r),s=`${e}[${i}:${i<0&&o>=0?"":o}]`;return this.insert("replace",s,n||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...tt(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,r=!0){return eU(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},r&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}}class tn extends tr{#a;constructor(e,t,r){super(e,t),this.#a=r}clone(){return new tn(this.selection,{...this.operations},this.#a)}commit(e){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#a.mutate({patch:this.serialize()},t)}}class ti extends tr{#a;constructor(e,t,r){super(e,t),this.#a=r}clone(){return new ti(this.selection,{...this.operations},this.#a)}commit(e){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#a.mutate({patch:this.serialize()},t)}}let to={returnDocuments:!1};class ts{operations;trxId;constructor(e=[],t){this.operations=e,this.trxId=t}create(e){return eU("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return eU(t,e),eM(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return eU(t,e),eM(t,e),this._add({[t]:e})}delete(e){return eP("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 ta extends ts{#a;constructor(e,t,r){super(e,r),this.#a=t}clone(){return new ta([...this.operations],this.#a,this.trxId)}commit(e){if(!this.#a)throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#a.mutate(this.serialize(),Object.assign({transactionId:this.trxId},to,e||{}))}patch(e,t){let r="function"==typeof t,n="string"!=typeof e&&e instanceof ti,i="object"==typeof e&&("query"in e||"id"in e);if(n)return this._add({patch:e.serialize()});if(r){let r=t(new ti(e,{},this.#a));if(!(r instanceof ti))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(i){let r=new ti(e,t||{},this.#a);return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}class tu extends ts{#a;constructor(e,t,r){super(e,r),this.#a=t}clone(){return new tu([...this.operations],this.#a,this.trxId)}commit(e){if(!this.#a)throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#a.mutate(this.serialize(),Object.assign({transactionId:this.trxId},to,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof tn)return this._add({patch:e.serialize()});if(r){let r=t(new tn(e,{},this.#a));if(!(r instanceof tn))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}let tc=({query:e,params:t={},options:r={}})=>{let n=new URLSearchParams,{tag:i,includeMutations:o,returnQuery:s,...a}=r;for(let[r,o]of(i&&n.append("tag",i),n.append("query",e),Object.entries(t)))void 0!==o&&n.append(`$${r}`,JSON.stringify(o));for(let[e,t]of Object.entries(a))t&&n.append(e,`${t}`);return!1===s&&n.append("returnQuery","false"),!1===o&&n.append("includeMutations","fal
14se"),`?${n}`},tl=e=>"response"===e.type,th=e=>e.body;function tf(e,t,n,i,o={},s={}){let a="stega"in s?{...n||{},..."boolean"==typeof s.stega?{enabled:s.stega}:s.stega||{}}:n,u=a.enabled?(0,eu.Q)(o):o,c=!1===s.filterResponse?e=>e:e=>e.result,{cache:l,next:h,...f}={useAbortSignal:"u">typeof s.signal,resultSourceMap:a.enabled?"withKeyArraySelector":s.resultSourceMap,...s,returnQuery:!1===s.filterResponse&&!1!==s.returnQuery},p=tx(e,t,"query",{query:i,params:u},"u">typeof l||"u">typeof h?{...f,fetch:{cache:l,next:h}}:f);return a.enabled?p.pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ey.apply(void 0,(0,ec.fX)([],(0,ec.zs)(e)))}((0,z.H)(r.e(570).then(r.bind(r,3332)).then(function(e){return e.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:e})=>e))),(0,eo.T)(([e,t])=>{let r=t(e.result,e.resultSourceMap,a);return c({...e,result:r})})):p.pipe((0,eo.T)(c))}function tp(e,t,r,n={}){let i={uri:tj(e,"doc",(()=>{if(!n.releaseId)return r;let e=(0,em._S)(r);if(!e){if((0,em.R8)(r))throw Error(`The document ID (\`${r}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return(0,em.ct)(r,n.releaseId)}if(e!==n.releaseId)throw Error(`The document ID (\`${r}\`) is already a version of \`${e}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return r})()),json:!0,tag:n.tag,signal:n.signal,query:void 0!==n.includeAllVersions?{includeAllVersions:n.includeAllVersions}:void 0};return t_(e,t,i).pipe((0,eg.p)(tl),(0,eo.T)(e=>{let t=e.body.documents;return t?n.includeAllVersions?t:t[0]:n.includeAllVersions?[]:void 0}))}function td(e,t,r,n={}){let i={uri:tj(e,"doc",r.join(",")),json:!0,tag:n.tag,signal:n.signal};return t_(e,t,i).pipe((0,eg.p)(tl),(0,eo.T)(e=>{let t,n,i=(t=e.body.documents||[],n=e=>e._id,t.reduce((e,t)=>(e[n(t)]=t,e),Object.create(null)));return r.map(e=>i[e]||null)}))}function ty(e,t,r,n={}){return tx(e,t,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},n)}function tg(e,t,r,n){return eM("createIfNotExists",r),tT(e,t,r,"createIfNotExists",n)}function tm(e,t,r,n){return eM("createOrReplace",r),tT(e,t,r,"createOrReplace",n)}function tv(e,t,r,n,i){return eM("createVersion",r),eN("createVersion",r),eQ(),tS(e,t,{actionType:"sanity.action.document.version.create",publishedId:n,document:r},i)}function tb(e,t,r,n,i,o,s){if(!n)throw Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw Error("`createVersion()` requires `publishedId` when `baseId` is provided");return eP("createVersion",n),eP("createVersion",r),tS(e,t,{actionType:"sanity.action.document.version.create",publishedId:r,baseId:n,versionId:i?(0,em.ct)(r,i):(0,em.T4)(r),ifBaseRevisionId:o},s)}function tw(e,t,r,n){return tx(e,t,"mutate",{mutations:[{delete:tt(r)}]},n)}function tE(e,t,r,n=!1,i){return tS(e,t,{actionType:"sanity.action.document.version.discard",versionId:r,purge:n},i)}function tR(e,t,r,n){return eM("replaceVersion",r),eN("replaceVersion",r),tS(e,t,{actionType:"sanity.action.document.version.replace",document:r},n)}function tA(e,t,r,n,i){return tS(e,t,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:n},i)}function tC(e,t,r,n){let i;return tx(e,t,"mutate",{mutations:Array.isArray(i=r instanceof ti||r instanceof tn?{patch:r.serialize()}:r instanceof ta||r instanceof tu?r.serialize():r)?i:[i],transactionId:n&&n.transactionId||void 0},n)}function tS(e,t,r,n){let i=Array.isArray(r)?r:[r],o=n&&n.transactionId||void 0;return tx(e,t,"actions",{actions:i,transactionId:o,skipCrossDatasetReferenceValidation:n&&n.skipCrossDatasetReferenceValidation||void 0,dryRun:n&&n.dryRun||void 0},n)}function tx(e,t,r,n,i={}){let o="mutate"===r,s="actions"===r,a=o||s?"":tc(n),u=!o&&!s&&a.length<11264,c=u?a:"",l=i.returnFirst,{timeout:h,token:f,tag:p,headers:d,returnQuery:y,lastLiveEventId:g,cacheMode:m}=i,v={method:u?"GET":"POST",uri:tj(e,r,c),json:!0,body:u?void 0:n,query:o&&((e={})=>{let t,r;return{dryRun:e.dryRun,returnIds:!0,returnDocuments:(t=e.returnDocuments,r=!0,!1===t?void 0:typeof t>"u"?r:t),visibility:e.visibility||"sync",autoGenerateArrayKeys:e.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:e.skipCrossDatasetReferenceValidation}})(i),timeout:h,headers:d,token:f,tag:p,returnQuery:y,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(g)?g[0]:g,cacheMode:m,canUseCdn:"query"===r,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn};return t_(e,t,v).pipe((0,eg.p)(tl),(0,eo.T)(th),(0,eo.T)(e=>{if(!o)return e;let t=e.results||[];if(i.returnDocuments)return l?t[0]&&t[0].document:t.map(e=>e.document);let r=l?t[0]&&t[0].id:t.map(e=>e.id);return{transactionId:e.transactionId,results:t,[l?"documentId":"documentIds"]:r}}))}function tT(e,t,r,n,i={}){return tx(e,t,"mutate",{mutations:[{[n]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},i))}
14let t$=e=>{let t=e.config();return void 0!==t.dataset&&void 0!==t.projectId||void 0!==t.resource},tO=(e,t)=>t$(e)&&t.startsWith(tj(e,"query"));function t_(e,t,r){var n;let i=r.url||r.uri,o=e.config(),s=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&(i.startsWith("/data/")||tO(e,i)||t$(e)&&i.startsWith(tj(e,"mutate"))||t$(e)&&i.startsWith(tj(e,"doc",""))||t$(e)&&i.startsWith(tj(e,"listen"))||t$(e)&&i.startsWith(tj(e,"history",""))):r.canUseCdn,a=(r.useCdn??o.useCdn)&&s,u=r.tag&&o.requestTagPrefix?[o.requestTagPrefix,r.tag].join("."):r.tag||o.requestTagPrefix;if(u&&null!==r.tag&&(r.query={tag:eF(u),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&tO(e,i)){let e=r.resultSourceMap??o.resultSourceMap;void 0!==e&&!1!==e&&(r.query={resultSourceMap:e,...r.query});let t=r.perspective||o.perspective;"u">typeof t&&("previewDrafts"===t&&eJ(),e1(t),r.query={perspective:Array.isArray(t)?t.join(","):t,...r.query},(Array.isArray(t)&&t.length>0||"previewDrafts"===t||"drafts"===t)&&a&&(a=!1,eH())),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),!1===r.returnQuery&&(r.query={returnQuery:"false",...r.query}),a&&"noStale"==r.cacheMode&&(r.query={cacheMode:"noStale",...r.query})}let c=function(e,t={}){let r={};e.headers&&Object.assign(r,e.headers);let n=t.token||e.token;n&&(r.Authorization=`Bearer ${n}`),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let i=!!(typeof t.withCredentials>"u"?e.withCredentials:t.withCredentials),o=typeof t.timeout>"u"?e.timeout:t.timeout;return Object.assign({},t,{headers:Object.assign({},r,t.headers||{}),timeout:typeof o>"u"?3e5:o,proxy:t.proxy||e.proxy,json:!0,withCredentials:i,fetch:"object"==typeof t.fetch&&"object"==typeof e.fetch?{...e.fetch,...t.fetch}:t.fetch||e.fetch})}(o,Object.assign({},r,{url:tq(e,i,a)})),l=new M.c(e=>t(c,o.requester).subscribe(e));return r.signal?l.pipe((n=r.signal,e=>new M.c(t=>{let r=()=>t.error(function(e){if(tk)return new DOMException(e?.reason??"The operation was aborted.","AbortError");let t=Error(e?.reason??"The operation was aborted.");return t.name="AbortError",t}(n));if(n&&n.aborted)return void r();let i=e.subscribe(t);return n.addEventListener("abort",r),()=>{n.removeEventListener("abort",r),i.unsubscribe()}}))):l}function tI(e,t,r){return t_(e,t,r).pipe((0,eg.p)(e=>"response"===e.type),(0,eo.T)(e=>e.body))}function tj(e,t,r){let n=e.config();if(n.resource){ez(n);let e=tU(n),i=void 0!==r?`${t}/${r}`:t;return`${e}/${i}`.replace(/\/($|\?)/,"$1")}let i=eL(n),o=`/${t}/${i}`;return`/data${void 0!==r?`${o}/${r}`:o}`.replace(/\/($|\?)/,"$1")}function tq(e,t,r=!1){let{url:n,cdnUrl:i}=e.config();return`${r?i:n}/${t.replace(/^\//,"")}`}let tk=!!globalThis.DOMException,tU=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:n}=t;switch(r){case"dataset":{let e=n.split(".");if(2!==e.length)throw Error('Dataset ID must be in the format "project.dataset"');return`/projects/${e[0]}/datasets/${e[1]}`}case"canvas":return`/canvases/${n}`;case"media-library":return`/media-libraries/${n}`;case"dashboard":return`/dashboards/${n}`;default:throw Error(`Unsupported resource type: ${r.toString()}`)}};function tP(e,t,r){let n=eL(e.config());return tI(e,t,{method:"POST",uri:`/agent/action/generate/${n}`,body:r})}function tM(e,t,r){let n=eL(e.config());return tI(e,t,{method:"POST",uri:`/agent/action/transform/${n}`,body:r})}function tN(e,t,r){let n=eL(e.config());return tI(e,t,{method:"POST",uri:`/agent/action/translate/${n}`,body:r})}class tL{#a;#u;constructor(e,t){this.#a=e,this.#u=t}generate(e){return tP(this.#a,this.#u,e)}transform(e){return tM(this.#a,this.#u,e)}translate(e){return tN(this.#a,this.#u,e)}}class tF{#a;#u;constructor(e,t){this.#a=e,this.#u=t}generate(e){return K(tP(this.#a,this.#u,e))}transform(e){return K(tM(this.#a,this.#u,e))}translate(e){return K(tN(this.#a,this.#u,e))}prompt(e){return K(function(e,t,r){let n=eL(e.config());return tI(e,t,{method:"POST",uri:`/agent/action/prompt/${n}`,body:r})}(this.#a,this.#u,e))}patch(e){return K(function(e,t,r){let n=eL(e.config());return tI(e,t,{method:"POST",uri:`/agent/action/patch/${n}`,body:r})}(this.#a,this.#u,e))}}class tz{#a;#u;constructor(e,t){this.#a=e,this.#u=t}upload(e,t,r){return tB(this.#a,this.#u,e,t,r)}}class tD{#a;#u;
14constructor(e,t){this.#a=e,this.#u=t}upload(e,t,r){return K(tB(this.#a,this.#u,e,t,r).pipe((0,eg.p)(e=>"response"===e.type),(0,eo.T)(e=>e.body.document)))}}function tB(e,t,r,n,i={}){var o,s;if(-1===ej.indexOf(r))throw Error(`Invalid asset type: ${r}. Must be one of ${ej.join(", ")}`);let a=i.extract||void 0;a&&!a.length&&(a=["none"]);let u=e.config(),c=(o=i,s=n,!(typeof File>"u")&&s instanceof File?Object.assign({filename:!1===o.preserveFilename?void 0:s.name,contentType:s.type},o):o),{tag:l,label:h,title:f,description:p,creditLine:d,filename:y,source:g}=c,m=u.resource?.type==="media-library",v=m?{title:f,filename:y}:{label:h,title:f,description:p,filename:y,meta:a,creditLine:d};return g&&!m&&(v.sourceId=g.id,v.sourceName=g.name,v.sourceUrl=g.url),t_(e,t,{tag:l,method:"POST",timeout:c.timeout||0,uri:function(e,t){let r="image"===t?"images":"files",n=e.resource;if(n){let{type:e,id:t}=n;switch(e){case"dataset":throw Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${t}/assets/${r}`;case"media-library":return`/media-libraries/${t}/upload`;case"dashboard":return`/dashboards/${t}/assets/${r}`;default:throw Error(`Unsupported resource type: ${e.toString()}`)}}let i=eL(e);return`assets/${r}/${i}`}(u,r),headers:c.contentType?{"Content-Type":c.contentType}:{},query:v,body:n})}let tV=(0,N.v)(()=>r.e(723).then(r.t.bind(r,5723,19))).pipe((0,eo.T)(({default:e})=>e),(0,H.t)(1));function tK(){return function(e){return e.pipe(X((e,t)=>{var r;return e instanceof e3?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,Q.U)(1)((0,z.H)(e,(0,F.lI)(e)))}(D({type:"reconnect"}),(void 0===r&&(r=Z),new M.c(function(e){var t=1e3;t<0&&(t=0);var n=0;return r.schedule(function(){e.closed||(e.next(n++),e.complete())},t)})).pipe((0,B.Z)(()=>t))):ee(()=>e)}))}}let tH=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],tJ={includeResult:!0};function tW(e,t,r={}){let{url:n,token:i,withCredentials:o,requestTagPrefix:s,headers:a}=this.config(),u=r.tag&&s?[s,r.tag].join("."):r.tag,c={...Object.keys(tJ).concat(Object.keys(r)).reduce((e,t)=>(e[t]=typeof r[t]>"u"?tJ[t]:r[t],e),{}),tag:u},l=tc({query:e,params:t,options:{tag:u,...tH.reduce((e,t)=>(typeof c[t]>"u"||(e[t]=c[t]),e),{})}}),h=`${n}${tj(this,"listen",l)}`;if(h.length>14800)return ee(()=>Error("Query too large for listener"));let f=c.events?c.events:["mutation"],p={};return o&&(p.withCredentials=!0),(i||a)&&(p.headers={},i&&(p.headers.Authorization=`Bearer ${i}`),a&&Object.assign(p.headers,a)),e7(()=>(typeof EventSource>"u"||p.headers?tV:D(EventSource)).pipe((0,eo.T)(e=>new e(h,p))),f).pipe(tK(),(0,eg.p)(e=>f.includes(e.type)),(0,eo.T)(e=>({type:e.type,..."data"in e?e.data:{}})))}let tY="2021-03-25";class tX{#a;constructor(e){this.#a=e}events({includeDrafts:e=!1,tag:t}={}){var r,n,i,o;let{projectId:s,apiVersion:a,token:u,withCredentials:c,requestTagPrefix:l,headers:h}=this.#a.config(),f=a.replace(/^v/,"");if("X"!==f&&f<tY)throw Error(`The live events API requires API version ${tY} or later. The current API version is ${f}. Please update your API version to use this feature.`);if(e&&!u&&!c)throw Error("The live events API requires a token or withCredentials when 'includeDrafts: true'. Please update your client configuration. The token should have the lowest possible access role.");let p=tj(this.#a,"live/events"),d=new URL(this.#a.getUrl(p,!1)),y=t&&l?[l,t].join("."):t;y&&d.searchParams.set("tag",y),e&&d.searchParams.set("includeDrafts","true");let g={};e&&c&&(g.withCredentials=!0),(e&&u||h)&&(g.headers={},e&&u&&(g.headers.Authorization=`Bearer ${u}`),h&&Object.assign(g.headers,h));let m=`${d.href}::${JSON.stringify(g)}`,v=tQ.get(m);if(v)return v;let b=e7(()=>(typeof EventSource>"u"||g.headers?tV:D(EventSource)).pipe((0,eo.T)(e=>new e(d.href,g))),["message","restart","welcome","reconnect","goaway"]),w=(n=d,i={method:"OPTIONS",mode:"cors",credentials:g.withCredentials?"include":"omit",headers:g.headers},new M.c(e=>{let t=new AbortController,r=t.signal;return fetch(n,{...i,signal:t.signal}).then(t=>{e.next(t),e.complete()},t=>{r.aborted||e.error(t)}),()=>t.abort()})).pipe(X(()=>{throw new eT({projectId:s})})),E=b.pipe(tK(),(0,B.Z)(e=>"reconnect"===e.type?w.pipe((0,B.Z)(()=>D(e))):D(e)),X(e=>w.pipe((0,B.Z)(()=>{throw e}))),(0,eo.T)(e=>{if("message"===e.type){let{data:t,...r}=e;return{...r,tags:t.tags}}return e})).pipe(er(()=>tQ.delete(m)),(o="function"==typeof(r={predicate:e=>"welcome"===e.type})?{predicate:r,...void 0}:r,e=>{var t,r,n,i;let s,a=!1,{predicate:u,...c}=o,l=e.pipe((t=e=>{o.predicate(e)&&(a=!0,s=e)},(i=(0,L.T)(t)?{next:t,error:r,complete:n}:t)?(0,Y.N)(function(e,t){null==(r=i.subscribe)||r.call(i);var r,n=!0;e.subscribe((0,W._)(t,function(e){var r;null==(r=i.next)||r.call(i,e),t.next(e)},function(){var e;n=!1,null==(e=i.complete)||e.call(i),t.complete()},function(e){var r;n=!1,null==(r=i.error)||r.call(i,e),t.error(e)},function(){var e,t;n&&(null==(e=i.unsubscribe)||e.call(i)),null==(t=i.finalize)||t.call(i)}))}):et.D),er(()=>{a=!1,s=void 0}),(0,en.u)(c)),h=new M.c(e=>{a&&e.next(s),e.complete()});return(0,ei.h)(l,h)}));return tQ.set(m,E),E}}let tQ=new Map;class tG{#a;#u;constructor(e,t){this.#a=e,this.#u=t}create(e,t){return t1(this.#a,this.#u,"PUT",e,t)}edit(e,t){return t1(this.#a,this.#u,"PATCH",e,t)}delete(e){return t1(this.#a,this.#u,"DELETE",e)}list(){eD("dataset",this.#a.config());let e=this.#a.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),tI(this.#a,this.#u,{uri:r,tag:null})}getEmbeddingsSettings(e){return eD("dataset",this.#a.config()),ek(e),tI(this.#a,this.#u,{uri:t0(this.#a,e),tag:null})}editEmbeddingsSettings(e,t){return eD("dataset",this.#a.config()),ek(e),tI(this.#a,this.#u,{method:"PUT",uri:t0(this.#a,e),body:t,tag:null})}}class tZ{#a;#u;
14constructor(e,t){this.#a=e,this.#u=t}create(e,t){return eD("dataset",this.#a.config()),K(t1(this.#a,this.#u,"PUT",e,t))}edit(e,t){return eD("dataset",this.#a.config()),K(t1(this.#a,this.#u,"PATCH",e,t))}delete(e){return eD("dataset",this.#a.config()),K(t1(this.#a,this.#u,"DELETE",e))}list(){eD("dataset",this.#a.config());let e=this.#a.config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),K(tI(this.#a,this.#u,{uri:r,tag:null}))}getEmbeddingsSettings(e){return eD("dataset",this.#a.config()),ek(e),K(tI(this.#a,this.#u,{uri:t0(this.#a,e),tag:null}))}editEmbeddingsSettings(e,t){return eD("dataset",this.#a.config()),ek(e),K(tI(this.#a,this.#u,{method:"PUT",uri:t0(this.#a,e),body:t,tag:null}))}}function t0(e,t){let r=e.config();return!1===r.useProjectHostname?`/projects/${r.projectId}/datasets/${t}/settings/embeddings`:`/datasets/${t}/settings/embeddings`}function t1(e,t,r,n,i){return eD("dataset",e.config()),ek(n),tI(e,t,{method:r,uri:`/datasets/${n}`,body:i,tag:null})}class t2{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getPlaybackInfo(e,t={}){var r,n;let i=this.#a.config(),o=(i.resource||i["~experimental_resource"])?.id,{instanceId:s,library
14Id:a}=function(e){let t="object"==typeof e&&"_ref"in e?e._ref:e,r=t6.exec(t);if(r){let[,e,t]=r;return{libraryId:e,instanceId:t}}if("string"==typeof e&&e.startsWith("video-"))return{instanceId:e};throw Error(`Invalid video asset instance identifier "${t}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}(e),u=a||o;if(!u)throw Error("Could not determine Media Library ID - you need to provide a valid Media Library ID in the client config or a Media Library GDR");let c=(r=s,n=u,`/media-libraries/${n}/video/${r}/playback-info`),l=function(e){let t={};if(e.transformations){let{thumbnail:r,animated:n,storyboard:i}=e.transformations;r&&(r.width&&(t.thumbnailWidth=r.width),r.height&&(t.thumbnailHeight=r.height),void 0!==r.time&&(t.thumbnailTime=r.time),r.fit&&(t.thumbnailFit=r.fit),r.format&&(t.thumbnailFormat=r.format)),n&&(n.width&&(t.animatedWidth=n.width),n.height&&(t.animatedHeight=n.height),void 0!==n.start&&(t.animatedStart=n.start),void 0!==n.end&&(t.animatedEnd=n.end),n.fps&&(t.animatedFps=n.fps),n.format&&(t.animatedFormat=n.format)),i&&i.format&&(t.storyboardFormat=i.format)}return e.expiration&&(t.expiration=e.expiration),t}(t);return tI(this.#a,this.#u,{method:"GET",uri:c,query:l})}}class t3{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getPlaybackInfo(e,t={}){return K(new t2(this.#a.observable,this.#u).getPlaybackInfo(e,t))}}let t6=/^media-library:(ml[^:]+):([^:]+)$/;class t8{#a;#u;constructor(e,t){this.#a=e,this.#u=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),tI(this.#a,this.#u,{uri:"/projects",query:t})}getById(e){return tI(this.#a,this.#u,{uri:`/projects/${e}`})}}class t5{#a;#u;constructor(e,t){this.#a=e,this.#u=t}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),K(tI(this.#a,this.#u,{uri:"/projects",query:t}))}getById(e){return K(tI(this.#a,this.#u,{uri:`/projects/${e}`}))}}let t4=((e,t=21)=>((e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return (o=t)=>{let s="";for(;;){let t=r(i),a=0|i;for(;a--;)if((s+=e[t[a]&n]||"").length===o)return s}}})(e,t,ev))("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),t9=(e,t)=>t?(0,em.ct)(e,t):(0,em.T4)(e);function t7(e,{releaseId:t,publishedId:r,document:n}){if(r&&n._id){let e=t9(r,t);return((e,t)=>{if(t._id&&t._id!==e)throw Error(`The provided document ID (\`${t._id}\`) does not match the generated version ID (\`${e}\`)`)})(e,n),e}if(n._id){let r=(0,em.R8)(n._id),i=(0,em.A_)(n._id);if(!r&&!i)throw Error(`\`${e}()\` requires a document with an \`_id\` that is a version or draft ID`);if(t){if(r)throw Error(`\`${e}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${t}\`) was also provided.`);let i=(0,em._S)(n._id);if(i!==t)throw Error(`\`${e}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${t}\`) does not match the document's version ID (\`${i}\`).`)}return n._id}if(r)return t9(r,t);throw Error(`\`${e}()\` requires either a publishedId or a document with an \`_id\``)}let re=(e,t)=>{let[r,n,i]=((e,t)=>{if("object"==typeof e&&null!==e&&("releaseId"in e||"metadata"in e)){let{releaseId:r=t4(),metadata:n={}}=e;return[r,n,t]}return[t4(),{},e]})(e,t);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...n,releaseType:n.releaseType||"undecided"}},options:i}};class rt{#a;#u;constructor(e,t){this.#a=e,this.#u=t}get({releaseId:e},t){return tp(this.#a,this.#u,`_.releases.${e}`,t)}create(e,t){let{action:r,options:n}=re(e,t),{releaseId:i,metadata:o}=r;return tS(this.#a,this.#u,r,n).pipe((0,eo.T)(e=>({...e,releaseId:i,metadata:o})))}edit({releaseId:e,patch:t},r){return tS(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r)}publish({releaseId:e},t){return tS(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:e},t)}archive({releaseId:e},t){return tS(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:e},t)}unarchive({releaseId:e},t){return tS(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:e},t)}schedule({releaseId:e,publishAt:t},r){return tS(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r)}unschedule({releaseId:e},t){return tS(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:e},t)}delete({releaseId:e},t){return tS(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:e},t)}fetchDocuments({releaseId:e},t){return ty(this.#a,this.#u,e,t)}}class rr{#a;#u;constructor(e,t){this.#a=e,this.#u=t}get({releaseId:e},t){return K(tp(this.#a,this.#u,`_.releases.${e}`,t))}async create(e,t){let{action:r,options:n}=re(e,t),{releaseId:i,metadata:o}=r;return{...await K(tS(this.#a,this.#u,r,n)),releaseId:i,metadata:o}}edit({releaseId:e,patch:t},r){return K(tS(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r))}publish({releaseId:e},t){return K(tS(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:e},t))}archive({releaseId:e},t){return K(tS(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:e},t))}unarchive({releaseId:e},t){return K(tS(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:e},t))}schedule({releaseId:e,publishAt:t},r){return K(tS(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r))}unschedule({releaseId:e},t){return K(tS(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:e},t))}delete({releaseId:e},t){return K(tS(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:e},t))}fetchDocuments({releaseId:e},t){return K(ty(this.#a,this.#u,e,t))}}class rn{#a;#u;
14constructor(e,t){this.#a=e,this.#u=t}getById(e){return tI(this.#a,this.#u,{uri:`/users/${e}`})}}class ri{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getById(e){return K(tI(this.#a,this.#u,{uri:`/users/${e}`}))}}class ro{assets;datasets;live;mediaLibrary;projects;users;agent;releases;#c;#u;listen=tW;constructor(e,t=eZ){this.config(t),this.#u=e,this.assets=new tz(this,this.#u),this.datasets=new tG(this,this.#u),this.live=new tX(this),this.mediaLibrary={video:new t2(this,this.#u)},this.projects=new t8(this,this.#u),this.users=new rn(this,this.#u),this.agent={action:new tL(this,this.#u)},this.releases=new rt(this,this.#u)}clone(){return new ro(this.#u,this.config())}config(e){if(void 0===e)return{...this.#c};if(this.#c&&!1===this.#c.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.#c=e2(e,this.#c||{}),this}withConfig(e){let t=this.config();return new ro(this.#u,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return tf(this,this.#u,this.#c.stega,e,t,r)}getDocument(e,t){if(t?.includeAllVersions===!0)return tp(this,this.#u,e,{...t,includeAllVersions:!0});let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return tp(this,this.#u,e,r)}getDocuments(e,t){return td(this,this.#u,e,t)}create(e,t){return tT(this,this.#u,e,"create",t)}createIfNotExists(e,t){return tg(this,this.#u,e,t)}createOrReplace(e,t){return tm(this,this.#u,e,t)}createVersion({document:e,publishedId:t,releaseId:r,baseId:n,ifBaseRevisionId:i},o){if(!e)return tb(this,this.#u,t,n,r,i,o);let s=t7("createVersion",{document:e,publishedId:t,releaseId:r}),a={...e,_id:s},u=t||(0,em.IM)(e._id);return tv(this,this.#u,a,u,o)}delete(e,t){return tw(this,this.#u,e,t)}discardVersion({releaseId:e,publishedId:t},r,n){let i=t9(t,e);return tE(this,this.#u,i,r,n)}replaceVersion({document:e,publishedId:t,releaseId:r},n){let i=t7("replaceVersion",{document:e,publishedId:t,releaseId:r}),o={...e,_id:i};return tR(this,this.#u,o,n)}unpublishVersion({releaseId:e,publishedId:t},r){let n=(0,em.ct)(t,e);return tA(this,this.#u,n,t,r)}mutate(e,t){return tC(this,this.#u,e,t)}patch(e,t){return new tn(e,t,this)}transaction(e){return new tu(e,this)}action(e,t){return tS(this,this.#u,e,t)}request(e){return tI(this,this.#u,e)}getUrl(e,t){return tq(this,e,t)}getDataUrl(e,t){return tj(this,e,t)}}class rs{assets;datasets;live;mediaLibrary;projects;users;agent;releases;observable;#c;#u;listen=tW;constructor(e,t=eZ){this.config(t),this.#u=e,this.assets=new tD(this,this.#u),this.datasets=new tZ(this,this.#u),this.live=new tX(this),this.mediaLibrary={video:new t3(this,this.#u)},this.projects=new t5(this,this.#u),this.users=new ri(this,this.#u),this.agent={action:new tF(this,this.#u)},this.releases=new rr(this,this.#u),this.observable=new ro(e,t)}clone(){return new rs(this.#u,this.config())}config(e){if(void 0===e)return{...this.#c};if(this.#c&&!1===this.#c.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),this.#c=e2(e,this.#c||{}),this}withConfig(e){let t=this.config();return new rs(this.#u,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return K(tf(this,this.#u,this.#c.stega,e,t,r))}getDocument(e,t){if(t?.includeAllVersions===!0)return K(tp(this,this.#u,e,{...t,includeAllVersions:!0}));let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return K(tp(this,this.#u,e,r))}getDocuments(e,t){return K(td(this,this.#u,e,t))}create(e,t){return K(tT(this,this.#u,e,"create",t))}createIfNotExists(e,t){return K(tg(this,this.#u,e,t))}createOrReplace(e,t){return K(tm(this,this.#u,e,t))}createVersion({document:e,publishedId:t,releaseId:r,baseId:n,ifBaseRevisionId:i},o){if(!e)return ea(tb(this,this.#u,t,n,r,i,o));let s=t7("createVersion",{document:e,publishedId:t,releaseId:r}),a={...e,_id:s},u=t||(0,em.IM)(e._id);return ea(tv(this,this.#u,a,u,o))}delete(e,t){return K(tw(this,this.#u,e,t))}discardVersion({releaseId:e,publishedId:t},r,n){let i=t9(t,e);return K(tE(this,this.#u,i,r,n))}replaceVersion({document:e,publishedId:t,releaseId:r},n){let i=t7("replaceVersion",{document:e,publishedId:t,releaseId:r}),o={...e,_id:i};return ea(tR(this,this.#u,o,n))}unpublishVersion({releaseId:e,publishedId:t},r){let n=(0,em.ct)(t,e);return K(tA(this,this.#u,n,t,r))}mutate(e,t){return K(tC(this,this.#u,e,t))}patch(e,t){return new ti(e,t,this)}transaction(e){return new ta(e,this)}action(e,t){return K(tS(this,this.#u,e,t))}request(e){return K(tI(this,this.#u,e))}dataRequest(e,t,r){return K(tx(this,this.#u,e,t,r))}getUrl(e,t){return tq(this,e,t)}getDataUrl(e,t){return tj(this,e,t)}}let ra=function(e,t){return{requester:eO(e),createClient:r=>{let n=eO(e,{ignoreWarnings:r.ignoreWarnings});return new t((e,t)=>
14(t||n)({maxRedirects:0,maxRetries:r.maxRetries,retryDelay:r.retryDelay,lineage:r.lineage,...e}),r)}}}([],rs),ru=(ra.requester,ra.createClient)},7974:(e,t,r)=>{"use strict";r.d(t,{Rw:()=>c,bX:()=>g,hy:()=>u});var n=r(6241),i=r(2977);let o=(0,i.FsL)((0,i.YjP)(),(0,i.BpQ)(1)),s=(0,i.lqM)(o),a=(0,i.Ikc)({baseUrl:o,dataset:s,id:o,path:o,projectId:s,tool:s,type:s,workspace:s});function u(e){let t="";for(let r of e){if("string"==typeof r){t&&(t+="."),t+=r;continue}if("number"==typeof r){t&&(t+=":"),t+=`${r}`;continue}if(null!==r&&Array.isArray(r)){t&&(t+=":"),t+=`${r.join(",")}}`;continue}if(r._key){t&&(t+=":"),t+=`${r._key}`;continue}}return t}function c(e){let{id:t,path:r,baseUrl:o,tool:s,workspace:c,type:l}=e;return(0,i.is)(a,e)?[["id",(0,n.IM)(t)],["type",l],["path",u(n.C.fromString(r))],["base",encodeURIComponent(o)],["workspace",c],["tool",s]].filter(([,e])=>!!e).map(e=>e.join("=")).join(";"):void 0}let l=/^([\w-]+):(0|[1-9][0-9]*)$/,h=/^([\w-]+):([0-9]+),([0-9]+)$/,f=/^([\w-]+):([\w-]+)$/,p=(0,i.FsL)((0,i.YjP)(),(0,i.BpQ)(1)),d=(0,i.Ikc)({origin:p,href:p,data:(0,i.lqM)((0,i.g1P)((0,i.YjP)(),(0,i.L5J)()))});function y(e){let t=(0,i.xLC)(a,e);if(t.success)return t.output;let r=(0,i.xLC)(d,e);if(r.success)try{let e=new URL(r.output.href,typeof document>"u"?"https://example.com":location.origin);return e.searchParams.size>0?(0,i.qgA)(a,Object.fromEntries(e.searchParams.entries())):r.output}catch(e){return console.error("Failed to parse sanity node",e),r.output}}function g(e){if("object"==typeof e&&null!==e)return y(e);try{let t=JSON.parse(e);return y(t)}catch{let t=e.split(";").reduce((e,t)=>{let[r,i]=t.split("=");if(!r||t.includes("=")&&!i)return e;switch(r){case"id":e.id=i;break;case"type":e.type=i;break;case"path":e.path=n.C.toString(function(e){let t=[];for(let r of e.split(".")){let e=l.exec(r);if(e){t.push(e[1],Number(e[2]));continue}let n=h.exec(r);if(n){t.push(n[1],[Number(n[2]),Number(n[3])]);continue}let i=f.exec(r);if(i){t.push(i[1],{_key:i[2]});continue}t.push(r)}return t}(i));break;case"base":e.baseUrl=decodeURIComponent(i);break;case"tool":e.tool=i;break;case"workspace":e.workspace=i;break;case"projectId":e.projectId=i;break;case"dataset":e.dataset=i}return e},{});if((0,i.is)(a,t))return t;return}}},8229:(e,t,r)=>{"use strict";function n(e){return"function"==typeof e}r.d(t,{T:()=>n})},8341:(e,t,r)=>{"use strict";r.d(t,{R:()=>a});var n=r(4902),i=function(e){function t(t,r){return e.call(this)||this}return(0,n.C6)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(9948).yU),o={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var s=o.delegate;return(null==s?void 0:s.setInterval)?s.setInterval.apply(s,(0,n.fX)([e,t],(0,n.zs)(r))):setInterval.apply(void 0,(0,n.fX)([e,t],(0,n.zs)(r)))},clearInterval:function(e){var t=o.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},s=r(7436),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;
14return n.scheduler=t,n.work=r,n.pending=!1,n}return(0,n.C6)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r,n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!=(r=this.id)?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),o.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&o.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,s.o)(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},8423:(e,t,r)=>{"use strict";r.d(t,{Q:()=>s});var n=r(2737),i=r(2380),o=r(1096);function s(e,t){return void 0===t&&(t=0),(0,i.N)(function(r,i){r.subscribe((0,o._)(i,function(r){return(0,n.N)(i,e,function(){return i.next(r)},t)},function(){return(0,n.N)(i,e,function(){return i.complete()},t)},function(r){return(0,n.N)(i,e,function(){return i.error(r)},t)}))})}},8673:(e,t,r)=>{"use strict";r.d(t,{U:()=>o});var n=r(141),i=r(2619);function o(e){return void 0===e&&(e=1/0),(0,n.Z)(i.D,e)}},8840:(e,t,r)=>{"use strict";r.d(t,{s:()=>n});var n="function"==typeof Symbol&&Symbol.observable||"@@observable"},8889:(e,t,r)=>{"use strict";r.d(t,{KS:()=>J,eU:()=>V});var n,i,o,s,a,u,c,l,h,f,p,d,y={},g={exports:{}};function m(){return d||(d=1,function(e,t){let{hasOwnProperty:r}=Object.prototype,n=f();n.configure=f,n.stringify=n,n.default=n,t.stringify=n,t.configure=f,e.exports=n;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function o(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function s(e,t){if(e.length>200||t)return e.sort(t);for(let t=1;t<e.length;t++){let r=e[t],n=t;for(;0!==n&&e[n-1]>r;)e[n]=e[n-1],n--;e[n]=r}return e}let a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function u(e){return void 0!==a.call(e)&&0!==e.length}function c(e,t,r){e.length<r&&(r=e.length);let n=","===t?"":" ",i=`"0":${n}${e[0]}`;for(let o=1;o<r;o++)i+=`${t}"${o}":${n}${e[o]}`;return i}function l(e,t){let n;if(r.call(e,t)){if("number"!=typeof(n=e[t]))throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(n))throw TypeError(`The "${t}" argument must be an integer`);if(n<1)throw RangeError(`The "${t}" argument must be >= 1`)}return void 0===n?1/0:n}function h(e){return 1===e?"1 item":`${e} items`}function f(e){let t=function(e){if(r.call(e,"strict")){let t=e.strict;if("boolean"!=typeof t)throw TypeError('The "strict" argument must be of type boolean');if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw"function"!=typeof e&&(t+=` (${e.toString()})`),Error(t)}}}(e={...e});t&&(void 0===e.bigint&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let n=function(e){if(r.call(e,"circularValue")){let t=e.circularValue;if("string"==typeof t)return`"${t}"`;if(null==t)return t;if(t===Error||t===TypeError)return{toString(){throw TypeError("Converting circular structure to JSON")}};throw TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}(e),i=function(e,t){let n;if(r.call(e,t)&&"boolean"!=typeof(n=e[t]))throw TypeError(`The "${t}" argument must be of type boolean`);return void 0===n||n}(e,"bigint"),a=function(e){let t;if(r.call(e,"deterministic")&&"boolean"!=typeof(t=e.deterministic)&&"function"!=typeof t)throw TypeError('The "deterministic" argument must be of type boolean or comparator function');return void 0===t||t}(e),f="function"==typeof a?a:void 0,p=l(e,"maximumDepth"),d=l(e,"maximumBreadth");return function(e,r,l){if(arguments.length>1){let y="";if("number"==typeof l?y=" ".repeat(Math.min(l,10)):"string"==typeof l&&(y=l.slice(0,10)),null!=r){if("function"==typeof r)return function e(r,c,l,y,g,m){let v=c[r];switch("object"==typeof v&&null!==v&&"function"==typeof v.toJSON&&(v=v.toJSON(r)),typeof(v=y.call(c,r,v))){case"string":return o(v);case"object":{if(null===v)return"null";if(-1!==l.indexOf(v))return n;let t="",r=",",i=m;if(Array.isArray(v)){if(0===v.length)return"[]";if(p<l.length+1)return'"[Array]"';l.push(v),""!==g&&(m+=g,t+=` 15${m}`,r=`, 16${m}`);let n=Math.min(v.length,d),o=0;for(;o<n-1;o++){let n=e(String(o),v,l,y,g,m);t+=void 0!==n?n:"null",t+=r}let s=e(String(o),v,l,y,g,m);if(t+=void 0!==s?s:"null",v.length-1>d){let e=v.length-d-1;t+=`${r}"... ${h(e)} not stringified"`}return""!==g&&(t+=` 17${i}`),l.pop(),`[${t}]`}let c=Object.keys(v),b=c.length;if(0===b)return"{}";if(p<l.length+1)return'"[Object]"';let w="",E="";""!==g&&(m+=g,r=`, 18${m}`,w=" ");let R=Math.min(b,d);a&&!u(v)&&(c=s(c,f)),l.push(v);for(let n=0;n<R;n++){let i=c[n],s=e(i,v,l,y,g,m);void 0!==s&&(t+=`${E}${o(i)}:${w}${s}`,E=r)}return b>d&&(t+=`${E}"...":${w}"${h(b-d)} not stringified"`,E=r),""!==g&&E.length>1&&(t=` 19${m}${t} 20${i}`),l.pop(),`{${t}}`}case"number":return isFinite(v)?String(v):t?t(v):"null";case"boolean":return!0===v?"true":"false";case"undefined":return;case"bigint":if(i)return String(v);default:return t?t(v):void 0}}("",{"":e},[],r,y,"");if(Array.isArray(r))return function e(r,s,a,u,c,l){switch("object"==typeof s&&null!==s&&"function"==typeof s.toJSON&&(s=s.toJSON(r)),typeof s){case"string":return o(s);case"object":{if(null===s)return"null";if(-1!==a.indexOf(s))return n;let t=l,r="",i=",";if(Array.isArray(s)){if(0===s.length)return"[]";if(p<a.length+1)return'"[Array]"';a.push(s),""!==c&&(l+=c,r+=` 21${l}`,i=`, 22${l}`);let n=Math.min(s.length,d),o=0;for(;o<n-1;o++){let t=e(String(o),s[o],a,u,c,l);r+=void 0!==t?t:"null",r+=i}let f=e(String(o),s[o],a,u,c,l);if(r+=void 0!==f?f:"null",s.length-1>d){let e=s.length-d-1;r+=`${i}"... ${h(e)} not stringified"`}return""!==c&&(r+=` 23${t}`),a.pop(),`[${r}]`}a.push(s);let f="";""!==c&&(l+=c,i=`, 24${l}`,f=" ");let y="";for(let t of u){let n=e(t,s[t],a,u,c,l);void 0!==n&&(r+=`${y}${o(t)}:${f}${n}`,y=i)}return""!==c&&y.length>1&&(r=` 25${l}${r} 26${t}`),a.pop(),`{${r}}`}case"number":return isFinite(s)?String(s):t?t(s):"null";case"boolean":return!0===s?"true":"false";case"undefined":return;case"bigint":if(i)return String(s);default:return t?t(s):void 0}}("",e,[],function(e){let t=new Set;for(let r of e)("string"==typeof r||"number"==typeof r)&&t.add(String(r));return t}(r),y,"")}if(0!==y.length)return function e(r,l,y,g,m){switch(typeof l){case"string":return o(l);case"object":{if(null===l)return"null";if("function"==typeof l.toJSON){if("object"!=typeof(l=l.toJSON(r)))return e(r,l,y,g,m);if(null===l)return"null"}if(-1!==y.indexOf(l))return n;let t=m;if(Array.isArray(l)){if(0===l.length)return"[]";if(p<y.length+1)return'"[Array]"';y.push(l),m+=g;let r=` 27${m}`,n=`, 28${m}`,i=Math.min(l.length,d),o=0;for(;o<i-1;o++){let t=e(String(o),l[o],y,g,m);r+=void 0!==t?t:"null",r+=n}let s=e(String(o),l[o],y,g,m);if(r+=void 0!==s?s:"null",l.length-1>d){let e=l.length-d-1;r+=`${n}"... ${h(e)} not stringified"`}return r+=` 29${t}`,y.pop(),`[${r}]`}let i=Object.keys(l),v=i.length;if(0===v)return"{}";if(p<y.length+1)return'"[Object]"';m+=g;let b=`, 30${m}`,w="",E="",R=Math.min(v,d);u(l)&&(w+=c(l,b,d),i=i.slice(l.length),R-=l.length,E=b),a&&(i=s(i,f)),y.push(l);for(let t=0;t<R;t++){let r=i[t],n=e(r,l[r],y,g,m);void 0!==n&&(w+=`${E}${o(r)}: ${n}`,E=b)}return v>d&&(w+=`${E}"...": "${h(v-d)} not stringified"`,E=b),""!==E&&(w=` 31${m}${w} 32${t}`),y.pop(),`{${w}}`}case"number":return isFinite(l)?String(l):t?t(l):"null";case"boolean":return!0===l?"true":"false";case"undefined":return;case"bigint":if(i)return String(l);default:return t?t(l):void 0}}("",e,[],y,"")}return function e(r,l,y){switch(typeof l){case"string":return o(l);case"object":{if(null===l)return"null";if("function"==typeof l.toJSON){if("object"!=typeof(l=l.toJSON(r)))return e(r,l,y);if(null===l)return"null"}if(-1!==y.indexOf(l))return n;let t="",i=void 0!==l.length;if(i&&Array.isArray(l)){if(0===l.length)return"[]";if(p<y.length+1)return'"[Array]"';y.push(l);let r=Math.min(l.length,d),n=0;for(;n<r-1;n++){let r=e(String(n),l[n],y);t+=void 0!==r?r:"null",t+=","}let i=e(String(n),l[n],y);if(t+=void 0!==i?i:"null",l.length-1>d){let e=l.length-d-1;t+=`,"... ${h(e)} not stringified"`}return y.pop(),`[${t}]`}let g=Object.keys(l),m=g.length;if(0===m)return"{}";if(p<y.length+1)return'"[Object]"';let v="",b=Math.min(m,d);i&&u(l)&&(t+=c(l,",",d),g=g.slice(l.length),b-=l.length,v=","),a&&(g=s(g,f)),y.push(l);for(let r=0;r<b;r++){let n=g[r],i=e(n,l[n],y);void 0!==i&&(t+=`${v}${o(n)}:${i}`,v=",")}return m>d&&(t+=`${v}"...":"${h(m-d)} not stringified"`),y.pop(),`{${t}}`}case"number":return isFinite(l)?String(l):t?t(l):"null";case"boolean":return!0===l?"true":"false";case"undefined":return;case"bigint":if(i)return String(l);default:return t?t(l):void 0}}("",e,[])}}}(g,g.exports)),g.exports}function v(){if(E)return w;function e(e){return e*Math.random()|0}return E=1,w={findNotMatching:function(e,t){let r=[],n=0;for(let i=0;i<e.length;i++)for(let o=n;o<t.length;o++)e[i]!==t[o]&&(r.push(t[o]),n=o+1);return r},findMatchingIndexes:function(e,t){let r=[],n=0;for(let i=0;i<e.length;i++)for(let o=n;o<t.length;o++)e[i]===t[o]&&(r.push(o),n=o+1);return r},bsearchIndex:function(e,t){let r=0,n=e.length-1;for(;r<=n;){let i=(r+n)/2|0;if(e[i]===t)return i;e[i]<t?r=i+1:n=i-1}return -1},wildcardMatch:function(e,t){if("*"===e||e.length===t.length&&e===t)return!0;let r=0,n=0;for(;r<e.length&&n<t.length;){if(e[r]===t[n]){r++,n++;continue}if("*"===e[r]){if(e[r+1]===t[n]){r++;continue}n++;continue}return!1}return r>=e.length-1},randomSubset:function(t,r){var n,i;if(t.length<1||r<1)return[];let o=(n=1,i=Math.min(t.length,r),(n=Math.floor(n))+e(1+(i=Math.floor(i))-n)),s=new Set;for(let r=0;r<o;r++)s.add(e(t.length));let a=[];for(let e of s)a.push(t[e]);return a},abstractLogging:function(){let e=()=>{};return{fatal:e,error:e,warn:e,info:e,debug:e,trace:e}},isServerSide:typeof window>"u"}}function b(){if(A)return R;A=1;class e{constructor(e){this.options=e}async get(e){throw Error("storage get method not implemented")}async set(e,t,r,n){throw Error("storage set method not implemented")}async remove(e){throw Error("storage remove method not implemented")}
32async invalidate(e){throw Error("storage invalidate method not implemented")}async clear(e){throw Error("storage clear method not implemented")}async refresh(){throw Error("storage refresh method not implemented")}}return R=e}var w,E,R,A,C,S,x,T,$,O={};function _(){if(j)return I;j=1;var e=($||($=1,O.ARRAY_BUFFER_SUPPORT="u">typeof ArrayBuffer,O.SYMBOL_SUPPORT="u">typeof Symbol),O),t=e.ARRAY_BUFFER_SUPPORT,r=e.SYMBOL_SUPPORT;return I=function(e,n){var i,o,s,a,u;if(!e)throw Error("obliterator/forEach: invalid iterable.");if("function"!=typeof n)throw Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString()){for(s=0,a=e.length;s<a;s++)n(e[s],s);return}if("function"==typeof e.forEach)return void e.forEach(n);if(r&&Symbol.iterator in e&&"function"!=typeof e.next&&(e=e[Symbol.iterator]()),"function"==typeof e.next){for(i=e,s=0;!0!==(u=i.next()).done;)n(u.value,s),s++;return}for(o in e)e.hasOwnProperty(o)&&n(e[o],o)}}var I,j,q,k={};function U(){var e;return q||(q=1,k.getPointerArray=function(e){var t=e-1;if(t<=255)return Uint8Array;
32if(t<=65535)return Uint16Array;if(t<=0xffffffff)return Uint32Array;throw Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},k.getSignedPointerArray=function(e){var t=e-1;return t<=127?Int8Array:t<=32767?Int16Array:t<=0x7fffffff?Int32Array:Float64Array},k.getNumberType=function(e){return e===(0|e)?-1===Math.sign(e)?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array},e={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8},k.getMinimalRepresentation=function(t,r){var n,i,o,s,a,u=null,c=0;for(s=0,a=t.length;s<a;s++)o=r?r(t[s]):t[s],(n=e[(i=k.getNumberType(o)).name])>c&&(c=n,u=i);return u},k.isTypedArray=function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView(e)},k.concat=function(){var e,t,r,n=0;for(e=0,r=arguments.length;e<r;e++)n+=arguments[e].length;var i=new arguments[0].constructor(n);for(e=0,t=0;e<r;e++)i.set(arguments[e],t),t+=arguments[e].length;return i},k.indices=function(e){for(var t=k.getPointerArray(e),r=new t(e),n=0;n<e;n++)r[n]=n;return r}),k}var P,M={};function N(){let e;if(u)return a;u=1;let{isServerSide:t}=v();t&&(e=function(){if(S)return C;S=1;let e=m(),t=b(),{findNotMatching:r,randomSubset:n,abstractLogging:i}=v();class o extends t{constructor(e={}){if(!e.client||"object"!=typeof e.client)throw Error("Redis client is required");
32if(super(e),e.invalidation&&e.invalidation.referencesTTL&&("number"!=typeof e.invalidation.referencesTTL||e.invalidation.referencesTTL<1))throw Error("invalidation.referencesTTL must be a positive integer greater than 1");this.log=e.log||i(),this.store=e.client,this.invalidation=!!e.invalidation,this.referencesTTL=e.invalidation&&e.invalidation.referencesTTL||60}getReferenceKeyLabel(e){return`r:${e}`}getKeyReferenceLabel(e){return`k:${e}`}async get(e){this.log.debug({msg:"acd/storage/redis.get",key:e});try{let t=await this.store.get(e);if(!t){if(!this.invalidation)return;this.clearReferences(e);return}return JSON.parse(t)}catch(t){this.log.error({msg:"acd/storage/redis.get error",err:t,key:e})}}async getTTL(e){this.log.debug({msg:"acd/storage/memory.getTTL",key:e});let t=await this.store.pttl(e);return t<0?0:t=Math.ceil(t/1e3)}async set(t,n,i,o){if(this.log.debug({msg:"acd/storage/redis.set key",key:t,value:n,ttl:i,references:o}),!(!(i=Number(i))||i<0))try{if(await this.store.set(t,e(n),"EX",i),!o||o.length<1)return;if(!this.invalidation)return void this.log.warn({msg:"acd/storage/redis.set, invalidation is disabled, references are useless",key:t,references:o});let s=[],a=await this.store.smembers(this.getKeyReferenceLabel(t));if(this.log.debug({msg:"acd/storage/redis.set current references",key:t,currentReferences:a}),a.length>1){for(let e of(a.sort(),o.sort(),r(o,a)))s.push(["srem",this.getReferenceKeyLabel(e),t]);s.push(["del",this.getKeyReferenceLabel(t)])}let u=a.length>1?r(a,o):o;this.log.debug({msg:"acd/storage/redis.set references to add",key:t,referencesToAdd:u});for(let e=0;e<u.length;e++){let r=u[e],n=this.getReferenceKeyLabel(r);s.push(["sadd",n,t]),s.push(["expire",n,this.referencesTTL])}let c=this.getKeyReferenceLabel(t);s.push(["sadd",c,o]),s.push(["expire",c,i]),this.log.debug({msg:"acd/storage/redis.set references writes",writes:s}),await this.store.pipeline(s).exec()}catch(e){this.log.error({msg:"acd/storage/redis.set error",err:e,key:t,ttl:i,references:o})}}async remove(e){this.log.debug({msg:"acd/storage/redis.remove",key:e});try{let t=await this.store.del(e)>0;return t&&this.invalidation&&await this.clearReferences(e),t}catch(t){this.log.error({msg:"acd/storage/redis.remove error",err:t,key:e})}}async invalidate(e){if(!this.invalidation)return this.log.warn({msg:"acd/storage/redis.invalidate, exit due invalidation is disabled"}),[];this.log.debug({msg:"acd/storage/redis.invalidate",references:e});try{return Array.isArray(e)?await this._invalidateReferences(e):await this._invalidateReference(e)}catch(t){return this.log.error({msg:"acd/storage/redis.invalidate error",err:t,references:e}),[]}}async _invalidateReferences(e,t=!0){let r=e.map(e=>["smembers",t?this.getReferenceKeyLabel(e):e]),n=await this.store.pipeline(r).exec();this.log.debug({msg:"acd/storage/redis._invalidateReferences keys",keys:n});let i=[],o=[];for(let e=0;e<n.length;e++){let t=n[e][1];if(t){this.log.debug({msg:"acd/storage/redis._invalidateReferences got keys to be invalidated",keys:t});for(let e=0;e<t.length;e++){let r=t[e];this.log.debug({msg:"acd/storage/redis._invalidateReferences del key"+r}),o.push(r),i.push(["del",r])}}}return await this.store.pipeline(i).exec(),await this.clearReferences(o),o}async _invalidateReference(e){let t;if(e.includes("*")){let t=await this.store.keys(this.getReferenceKeyLabel(e));return this._invalidateReferences(t,!1)}t=await this.store.smembers(this.getReferenceKeyLabel(e)),this.log.debug({msg:"acd/storage/redis._invalidateReference keys",keys:t});let r=[],n=[];for(let e=0;e<t.length;e++){let i=t[e];this.log.debug({msg:"acd/storage/redis._invalidateReference del key"+i}),n.push(i),r.push(["del",i])}return await this.store.pipeline(r).exec(),await this.clearReferences(n),n}async clear(e){this.log.debug({msg:"acd/storage/redis.clear",name:e});try{if(!e)return void await this.store.flushall();let t=await this.store.keys(`${e}*`);this.log.debug({msg:"acd/storage/redis.clear keys",keys:t});let r=t.map(e=>["del",e]);if(await this.store.pipeline(r).exec(),!this.invalidation)return;await this.clearReferences(t)}catch(t){this.log.error({msg:"acd/storage/redis.clear error",err:t,name:e})}}async refresh(){try{await this.store.flushall()}catch(e){this.log.error({msg:"acd/storage/redis.refresh error",err:e})}}async clearReferences(e){try{if(!e)return void this.log.warn({msg:"acd/storage/redis.clearReferences invalid call due to empty key"});Array.isArray(e)||(e=[e]);let t=e.map(e=>["smembers",this.getKeyReferenceLabel(e)]),r=await this.store.pipeline(t).exec();this.log.debug({msg:"acd/storage/redis.clearReferences references",keys:e,referencesKeys:r});let n={};for(let t=0;t<e.length;t++){for(let i=0;i<r[t][1].length;i++){let o=this.getReferenceKeyLabel(r[t][1][i]);n[o]||(n[o]=["srem",o,e])}let i=this.getKeyReferenceLabel(e[t]);n[i]=["del",i]}this.log.debug({msg:"acd/storage/redis.clearReferences writes pipeline",writes:n}),await this.store.pipeline(Object.values(n)).exec()}catch(e){this.log.error({msg:"acd/storage/redis.clearReferences error",err:e})}}async gc(e="lazy",t={}){if(this.log.debug({msg:"acd/storage/redis.gc",mode:e,options:t}),!this.invalidation)return void this.log.warn({msg:"acd/storage/redis.gc does not run due to invali
32dation is disabled"});"strict"!==e&&"lazy"!==e&&(e="lazy");let r={references:{scanned:[],removed:[]},keys:{scanned:new Set,removed:new Set},loops:0,cursor:0,error:null};try{let i=0,o=64;if(t.chunk&&("number"!=typeof t.chunk||t.chunk<1))return r.error=Error("chunk must be a positive integer greater than 1"),r;if(t.lazy){if(t.lazy.chunk){if("number"!=typeof t.lazy.chunk||t.lazy.chunk<1)return r.error=Error("lazy.chunk must be a positive integer greater than 1"),r;o=t.lazy.chunk}if(t.lazy.cursor){if("number"!=typeof t.lazy.cursor||t.lazy.cursor<0)return r.error=Error("lazy.cursor must be a positive integer greater than 0"),r;i=t.lazy.cursor}}let s=t.chunk||64,a=Math.min(o,s),u=i,c=-1,l=-1;do{r.loops++;let t=await this.store.scan(i,"match","r:*","count",a);i=Number(t[0]),c=t[1].length;let s="lazy"===e?n(t[1],o):t[1];r.references.scanned=r.references.scanned.concat(s);let u=[];for(let e=0;e<s.length;e++){let t=s[e];u.push(["smembers",t])}let h=await this.store.pipeline(u).exec(),f={},p={};for(let e=0;e<h.length;e++){let t=h[e],n=s[e];p[n]=t[1];for(let e=0;e<t[1].length;e++){let i=t[1][e];f[i]?f[i].push(n):f[i]=[n],r.keys.scanned.add(i)}}let d=Object.keys(f);u=d.map(e=>["exists",e]);let y=await this.store.pipeline(u).exec(),g={};for(let e=0;e<d.length;e++){let t=d[e];if(1!==y[e][1])for(let e=0;e<f[t].length;e++){let n=f[t][e];g[n]?g[n].push(t):g[n]=[t],r.keys.removed.add(t)}}let m=Object.keys(g),v=[];for(let e=0;e<m.length;e++){let t=m[e];p[t].length===g[t].length?(v.push(["del",t]),r.references.removed.push(t)):v.push(["srem",t,g[t]])}if(await this.store.pipeline(v).exec(),l=v.length,"lazy"===e&&r.references.scanned.length>=o)break}while(u!==i&&c>0&&l>0);r.cursor=i,r.keys.scanned=Array.from(r.keys.scanned),r.keys.removed=Array.from(r.keys.removed)}catch(e){this.log.error({msg:"acd/storage/redis.gc error",err:e}),r.error=e}return r}}return C=o}());let r=function(){let e;if(s)return o;s=1;let t=function(){if(i)return n;i=1;var e=function(){if(T)return x;function e(e){if("function"!=typeof e)throw Error("obliterator/iterator: expecting a function!");this.next=e}return T=1,"u">typeof Symbol&&(e.prototype[Symbol.iterator]=function(){return this}),e.of=function(){var t=arguments,r=t.length,n=0;return new e(function(){return n>=r?{done:!0}:{done:!1,value:t[n++]}})},e.empty=function(){return new e(function(){return{done:!0}})},e.fromSequence=function(t){var r=0,n=t.length;return new e(function(){return r>=n?{done:!0}:{done:!1,value:t[r++]}})},e.is=function(t){return t instanceof e||"object"==typeof t&&null!==t&&"function"==typeof t.next},x=e}(),t=_(),r=U(),o=function(){if(P)return M;P=1;var e=_(),t=U();function r(e){return"number"==typeof e.length?e.length:"number"==typeof e.size?e.size:void 0}return M.isArrayLike=function(e){return Array.isArray(e)||t.isTypedArray(e)},M.guessLength=r,M.toArray=function(t){var n=r(t),i="number"==typeof n?Array(n):[],o=0;return e(t,function(e){i[o++]=e}),i},M.toArrayWithIndices=function(n){var i=r(n),o="number"==typeof i?t.getPointerArray(i):Array,s="number"==typeof i?Array(i):[],a="number"==typeof i?new o(i):[],u=0;return e(n,function(e){s[u]=e,a[u]=u++}),[s,a]},M}();function s(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,"number"!=typeof this.capacity||this.capacity<=0)throw Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var i=r.getPointerArray(n);this.forward=new i(n),this.backward=new i(n),this.K="function"==typeof e?new e(n):Array(n),this.V="function"==typeof t?new t(n):Array(n),this.size=0,this.head=0,this.tail=0,this.items={}}return s.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},s.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var r=this.backward[e],n=this.forward[e];return this.tail===e?this.tail=r:this.backward[n]=r,this.forward[r]=n,this.backward[t]=e,this.head=e,this.forward[e]=t,this},s.prototype.set=function(e,t){var r=this.items[e];if("u">typeof r){this.splayOnTop(r),this.V[r]=t;return}this.size<this.capacity?r=this.size++:(r=this.tail,this.tail=this.backward[r],delete this.items[this.K[r]]),this.items[e]=r,this.K[r]=e,this.V[r]=t,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r},s.prototype.setpop=function(e,t){var r=null,n=null,i=this.items[e];return"u">typeof i?(this.splayOnTop(i),r=this.V[i],this.V[i]=t,{evicted:!1,key:e,value:r}):(this.size<this.capacity?i=this.size++:(i=this.tail,this.tail=this.backward[i],r=this.V[i],n=this.K[i],delete this.items[n]),this.items[e]=i,this.K[i]=e,this.V[i]=t,this.forward[i]=this.head,this.backward[this.head]=i,this.head=i,n?{evicted:!0,key:n,value:r}:null)},s.prototype.has=function(e){return e in this.items},s.prototype.get=function(e){var t=this.items[e];if(!(typeof t>"u"))return this.splayOnTop(t),this.V[t]},s.prototype.peek=function(e){var t=this.items[e];if(!(typeof t>"u"))return this.V[t]},s.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var r=0,n=this.size,i=this.head,o=this.K,s=this.V,a=this.forward;r<n;)e.call(t,s[i],o[i],this),i=a[i],r++},s.prototype.keys=function(){var t=0,r=this.size,n=this.head,i=this.K,o=this.forward;return new e(function(){if(t>=r)return{done:!0};var e=i[n];return++t<r&&(n=o[n]),{done:!1,value:e}})},s.prototype.values=function(){var t=0,r=this.size,n=this.head,i=this.V,o=this.forward;return new e(function(){if(t>=r)return{done:!0};var e=i[n];return++t<r&&(n=o[n]),{done:!1,value:e}})},s.prototype.entries=function(){var t=0,r=this.size,n=this.head,i=this.K,o=this.V,s=this.forward;return new e(function(){if(t>=r)return{done:!0};var e=i[n],a=o[n];return++t<r&&(n=s[n]),{done:!1,value:[e,a]}})},"u">typeof Symbol&&(s.prototype[Symbol.iterator]=s.prototype.entries),s.prototype.inspect=function(){for(var e,t=new Map,r=this.entries();!(e=r.next()).done;)t.set(e.value[0],e.value[1]);return Object.defineProperty(t,"constructor",{value:s,enumerable:!1}),t},"u">typeof Symbol&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.from=function(e,r,n,i){if(arguments.length<2){if("number"!=typeof(i=o.guessLength(e)))throw Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else 2==arguments.length&&(i=r,r=null,n=null);var a=new s(r,n,i);return t(e,function(e,t){a.set(t,e)}),a},n=s}(),{abstractLogging:r}=v(),a=b(),{findMatchingIndexes:u,findNotMatching:c,bsearchIndex:l,wildcardMatch:h}=v(),f="u">typeof globalThis.setImmediate?globalThis.setImmediate:(e,...t)=>setTimeout(e,0,...t);class p extends a{constructor(e={}){if(e.size&&("number"!=typeof e.size||e.size<1))throw Error("size must be a positive integer greater than 0");super(e),this.size=e.size||1024,this.log=e.log||r(),this.invalidation=e.invalidation||!1,this.init()}init(){this.store=new t(this.size),this.invalidation&&(this.keysReferences=new Map,this.referencesKeys=new Map)}get(e){this.log.debug({msg:"acd/storage/memory.get",key:e});let t=this.store.get(e);if(t){if(this.log.debug({msg:"acd/storage/memory.get, entry",entry:t,now:d()}),t.start+t.ttl>d())return this.log.debug({msg:"acd/storage/memory.get, key is NOT expired",key:e,entry:t}),t.value;this.log.debug({msg:"acd/storage/memory.get, key is EXPIRED",key:e,entry:t}),f(()=>this.remove(e))}}getTTL(e){this.log.debug({msg:"acd/storage/memory.getTTL",key:e});let t=this.store.peek(e),r=0;return t&&(r=t.start+t.ttl-d())<0&&(r=0),r}set(e,t,r,n){let i;if(this.log.debug({msg:"acd/storage/memory.set",key:e,value:t,ttl:r,references:n}),!(r=Number(r))||r<0)return;let o=this.store.has(e),s=this.store.setpop(e,{value:t,ttl:r,start:d()});if(this.log.debug({msg:"acd/storage/memory.set, evicted",removed:s}),s&&s.evicted&&(this.log.debug({msg:"acd/storage/memory.set, remove evicted key",key:s.key}),this._removeReferences([s.key])),!n||n.length<1)return;if(!this.invalidation)return void this.log.warn({msg:"acd/storage/memory.set, invalidation is disabled, references are useless"});if(n=[...new Set(n)],o&&(i=this.keysReferences.get(e),this.log.debug({msg:"acd/storage/memory.set, current keys-references",key:e,references:i}),i))for(let t of(i.sort(),n.sort(),c(n,i))){let r=this.referencesKeys.get(t);if(!r)continue;let n=l(r,e);
32if(!(n<0)){if(r.splice(n,1),r.length<1){this.referencesKeys.delete(t);continue}this.referencesKeys.set(t,r)}}let a=i?c(i,n):n;for(let t=0;t<a.length;t++){let r=a[t],n=this.referencesKeys.get(r);n?(this.log.debug({msg:"acd/storage/memory.set, add reference-key",key:e,reference:r}),n.push(e)):n=[e],this.log.debug({msg:"acd/storage/memory.set, set reference-keys",keys:n,reference:r}),this.referencesKeys.set(r,n)}this.keysReferences.set(e,n)}remove(e){this.log.debug({msg:"acd/storage/memory.remove",key:e});let t=this._removeKey(e);return this._removeReferences([e]),t}_removeKey(e){return this.log.debug({msg:"acd/storage/memory._removeKey",key:e}),!!this.store.has(e)&&(this.store.set(e,void 0),!0)}_removeReferences(e){if(!this.invalidation)return;this.log.debug({msg:"acd/storage/memory._removeReferences",keys:e});let t=new Set;for(let r=0;r<e.length;r++){let n=e[r],i=this.keysReferences.get(n);if(i){for(let e=0;e<i.length;e++)t.add(i[e]);this.log.debug({msg:"acd/storage/memory._removeReferences, delete key-references",key:n}),this.keysReferences.delete(n)}}this._removeReferencesKeys([...t],e)}_removeReferencesKeys(e,t){t.sort(),this.log.debug({msg:"acd/storage/memory._removeReferencesKeys",references:e,keys:t});for(let r=0;r<e.length;r++){let n=e[r],i=this.referencesKeys.get(n);if(this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, get reference-key",reference:n,keys:t,referencesKeys:i}),!i)continue;let o=u(t,i);if(this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, removing",reference:n,referencesToRemove:o,referencesKeys:i}),o.length===i.length){this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, delete",reference:n}),this.referencesKeys.delete(n);continue}for(let e=o.length-1;e>=0;e--)this.log.debug({msg:"acd/storage/memory._removeReferencesKeys, remove",reference:n,referencesKeys:i,at:o[e]}),i.splice(o[e],1)}}invalidate(e){return this.invalidation?(this.log.debug({msg:"acd/storage/memory.invalidate",references:e}),Array.isArray(e)?this._invalidateReferences(e):this._invalidateReference(e)):(this.log.warn({msg:"acd/storage/memory.invalidate, exit due invalidation is disabled"}),[])}_invalidateReferences(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],i=this.referencesKeys.get(n);if(this.log.debug({msg:"acd/storage/memory._invalidateReferences, remove keys on reference",reference:n,keys:i}),i){for(let e=0;e<i.length;e++){let r=i[e];this.log.debug({msg:"acd/storage/memory._invalidateReferences, remove key on reference",reference:n,key:r}),this._removeKey(r)&&t.push(r)}this.log.debug({msg:"acd/storage/memory._invalidateReferences, remove references of",reference:n,keys:i}),this._removeReferences([...i])}}return t}_invalidateReference(e){if(e.includes("*")){let t=[];for(let r of this.referencesKeys.keys())h(e,r)&&t.push(r);return this._invalidateReferences(t)}let t=this.referencesKeys.get(e),r=[];if(this.log.debug({msg:"acd/storage/memory._invalidateReference, remove keys on reference",reference:e,keys:t}),!t)return r;for(let n=0;n<t.length;n++){let i=t[n];this.log.debug({msg:"acd/storage/memory._invalidateReference, remove key on reference",reference:e,key:i}),this._removeKey(i)&&r.push(i)}return this.log.debug({msg:"acd/storage/memory._invalidateReference, remove references of",reference:e,keys:t}),this._removeReferences([...t]),r}clear(e){if(this.log.debug({msg:"acd/storage/memory.clear",name:e}),!e){if(this.store.clear(),!this.invalidation)return;this.referencesKeys.clear(),this.keysReferences.clear();return}let t=[];this.store.forEach((r,n)=>{this.log.debug({msg:"acd/storage/memory.clear, iterate key",key:n}),0===n.indexOf(e)&&(this.log.debug({msg:"acd/storage/memory.clear, remove key",key:n}),t.push(n))});let r=[];for(let e=0;e<t.length;e++)this._removeKey(t[e])&&r.push(t[e]);return this._removeReferences(r),r}refresh(){this.log.debug({msg:"acd/storage/memory.refresh"}),this.init()}}function d(){if(void 0!==e)return e;e=Math.floor(Date.now()/1e3);let t=setTimeout(y,1e3);return"function"==typeof t.unref&&t.unref(),e}function y(){e=void 0}return o=p}(),c="redis";
32return a=function(n,i){if(!t&&n===c)throw Error("Redis storage is not supported in the browser");return n===c?new e(i):new r(i)}}var L=function(){if(h)return l;h=1;let{Cache:e}=function(){if(c)return y;c=1;let{kValues:e,kStorage:t,kStorages:r,kTransfromer:n,kTTL:i,kOnDedupe:o,kOnError:s,kOnHit:a,kOnMiss:u,kStale:l}=function(){if(p)return f;p=1;let e=Symbol("values"),t=Symbol("kStorage"),r=Symbol("kStorages"),n=Symbol("kTransformer"),i=Symbol("kTTL"),o=Symbol("kOnDedupe"),s=Symbol("kOnError"),a=Symbol("kOnHit");return f={kValues:e,kStorage:t,kStorages:r,kTransfromer:n,kTTL:i,kOnDedupe:o,kOnError:s,kOnHit:a,kOnMiss:Symbol("kOnMiss"),kStale:Symbol("kStale")}}(),h=m(),d=N();class g{constructor(c={}){if(!c.storage)throw Error("storage is required");if(c.ttl&&"number"==typeof c.ttl&&(c.ttl<0||!Number.isInteger(c.ttl)))throw Error("ttl must be a positive integer greater than 0");if(c.onDedupe&&"function"!=typeof c.onDedupe)throw Error("onDedupe must be a function");if(c.onError&&"function"!=typeof c.onError)throw Error("onError must be a function");if(c.onHit&&"function"!=typeof c.onHit)throw Error("onHit must be a function");if(c.onMiss&&"function"!=typeof c.onMiss)throw Error("onMiss must be a function");if("number"==typeof c.stale&&!(Math.floor(c.stale)===c.stale&&c.stale>=0))throw Error("stale must be an integer greater or equal to 0");this[e]={},this[t]=c.storage,this[r]=new Map,this[r].set("_default",c.storage),this[n]=c.transformer,this[i]=c.ttl||0,this[o]=c.onDedupe||w,this[s]=c.onError||w,this[a]=c.onHit||w,this[u]=c.onMiss||w,this[l]=c.stale||0}define(c,h,f){let p;if("function"==typeof h&&(f=h,h={}),c&&this[c])throw Error(`${c} is already defined in the cache or it is a forbidden name`);if(h=h||{},"function"!=typeof f)throw TypeError(`Missing the function parameter for '${c}'`);let y=h.serialize;if(y&&"function"!=typeof y)throw TypeError("serialize must be a function");let g=h.references;if(g&&"function"!=typeof g)throw TypeError("references must be a function");if("function"!=typeof h.ttl&&h.ttl&&("number"!=typeof h.ttl||h.ttl<0||!Number.isInteger(h.ttl)))throw Error("ttl must be a positive integer greater than 0");h.storage?(p=d(h.storage.type,h.storage.options),this[r].set(c,p)):p=this[t];let m=void 0!==h.ttl?h.ttl:this[i],b=void 0!==h.stale?h.stale:this[l],w=h.onDedupe||this[o],E=h.onError||this[s],R=h.onHit||this[a],A=h.onMiss||this[u],C=h.transformer||this[n],S=new v(f,c,y,g,p,C,m,w,E,R,A,b);return this[e][c]=S,this[c]=S.add.bind(S),this}async clear(t,r){if(t){if(!this[e][t])throw Error(`${t} is not defined in the cache`);await this[e][t].clear(r);return}let n=[];for(let t of Object.values(this[e]))n.push(t.clear());await Promise.all(n)}async get(t,r){if(!this[e][t])throw Error(`${t} is not defined in the cache`);return this[e][t].get(r)}async set(t,r,n,i,o){if(!this[e][t])throw Error(`${t} is not defined in the cache`);return this[e][t].set(r,n,i,o)}async invalidate(t,r){if(!this[e][t])throw Error(`${t} is not defined in the cache`);return this[e][t].invalidate(r)}async invalidateAll(e,t="_default"){if(!this[r].has(t))throw Error(`${t} storage is not defined in the cache`);await this[r].get(t).invalidate(e)}}class v{constructor(e,t,r,n,i,o,s,a,u,c,l,h){this.dedupes=new Map,this.func=e,this.name=t,this.serialize=r,this.references=n,this.storage=i,this.transformer=o,this.ttl=s,this.onDedupe=a,this.onError=u,this.onHit=c,this.onMiss=l,this.stale=h}getKey(e){let t=this.serialize?this.serialize(e):e;return"string"==typeof t?t:h(t)}getStorageKey(e){return`${this.name}~${e}`}getStorageName(){return`${this.name}~`}add(e){try{let t=this.getKey(e),r=this.dedupes.get(t);return r?this.onDedupe(t):(r=new b,this.buildPromise(r,e,t),this.dedupes.set(t,r)),r.promise}catch(e){this.onError(e)}}async wrapFunction(e,t){let r=this.getStorageKey(t);if(this.ttl>0||"function"==typeof this.ttl){let n=await this.get(r);if(void 0!==n){this.onHit(t);let i="function"==typeof this.stale?this.stale(n):this.stale;return i>0&&await this.storage.getTTL(r)<=i&&this._wrapFunction(r,e,t).catch(w),n}this.onMiss(t)}return this._wrapFunction(r,e,t)}async _wrapFunction(e,t,r){let n=await this.func(t,r),i="function"==typeof this.stale?this.stale(n):this.stale,o="function"==typeof this.ttl?this.ttl(n):this.ttl;if(null==o||"number"!=typeof o||!Number.isInteger(o))return this.onError(Error("ttl must be an integer")),n;if((o+=i)<1)return n;if(!this.references)return await this.set(e,n,o),n;try{let i=this.references(t,r,n),s=n;i&&"function"==typeof i.then&&(i=await i),this.transformer&&(s=this.transformer.serialize(n)),await this.storage.set(e,s,o,i)}catch(e){this.onError(e)}return n}buildPromise(e,t,r){e.promise=this.wrapFunction(t,r),e.promise.then(e=>(this.dedupes.delete(r),e)).catch(e=>{this.onError(e),this.dedupes.delete(r);let t=this.storage.remove(this.getStorageKey(r));t&&"function"==typeof t.catch&&t.catch(w)})}async clear(e){if(e){let t=this.getKey(e);this.dedupes.delete(t),await this.storage.remove(this.getStorageKey(t));return}await this.storage.clear(this.getStorageName()),this.dedupes.clear()}async get(e){let t=await this.storage.get(e);return this.transformer&&t?await this.transformer.deserialize(t):t}async set(e,t,r,n){return this.transformer&&(t=this.transformer.serialize(t)),this.storage.set(e,t,r,n)}
32async invalidate(e){return this.storage.invalidate(e)}}class b{constructor(){this.promise=null}}function w(){}return y.Cache=g,y}(),t=N();return l={Cache:e,createCache:function(r){r?r.storage||(r.storage={type:"memory"}):r={storage:{type:"memory"}};let n=t(r.storage.type,r.storage.options);return new e({...r,storage:n})},createStorage:t}}();let F=0,z=[];Symbol("clean");let D=[],B=0,V=e=>{let t=[],r={get:()=>(r.lc||r.listen(()=>{})(),r.value),lc:0,listen:e=>(r.lc=t.push(e),()=>{for(let t=B+4;t<D.length;)D[t]===e?D.splice(t,4):t+=4;let n=t.indexOf(e);~n&&(t.splice(n,1),--r.lc||r.off())}),notify(e,n){let i=!D.length;for(let i of t)D.push(i,r.value,e,n);if(i){for(B=0;B<D.length;B+=4)D[B](D[B+1],D[B+2],D[B+3]);D.length=0}},off(){},set(e){let t=r.value;t!==e&&(r.value=e,r.notify(t))},subscribe(e){let t=r.listen(e);return e(r.value),t},value:e};return r},K=typeof document>"u"?"server":"browser";function H(e){return e.withConfig({allowReconfigure:!1})}let J=e=>{let{ssr:t=!1,tag:n="core-loader"}=e;if(t&&e.client)throw TypeError("`client` option is not allowed when `ssr: true`, use `setServerClient` from your server entry point instead");if(!t&&!1===e.client)throw TypeError("You must set `ssr: true` when `client: false` is used");if(!t&&!e.client)throw TypeError("`client` is required");let i=t?void 0:H(e.client);function o(e){return L.createCache().define("fetch",async t=>{if(!e)throw Error("You have to set the Sanity client with `setServerClient` before any data fetching is done");let{query:r,params:i={},perspective:o,useCdn:s,stega:a}=JSON.parse(t),{result:u,resultSourceMap:c}=await e.fetch(r,i,{tag:n,filterResponse:!1,perspective:o,useCdn:s,stega:a});return{result:u,resultSourceMap:c}})}function s(){let e=i?.config().perspective||"published";return a.instance=o(i),{hydrate:(t,r,n)=>({loading:n?.data===void 0||n?.sourceMap===void 0,error:void 0,data:n?.data,sourceMap:n?.sourceMap,perspective:e}),fetch:(t,r,n,i)=>{if(i.signal.aborted)return;let o=(F+=1,()=>{if(0==(F-=1)){let e=z;for(let t of(z=[],e))t()}});n.setKey("loading",!0),n.setKey("error",void 0),a.instance.fetch(JSON.stringify({query:t,params:r})).then(t=>{i.signal.aborted||(n.setKey("data",t.result),n.setKey("sourceMap",t.resultSourceMap),n.setKey("perspective",e))}).catch(e=>{n.setKey("error",e)}).finally(()=>{n.setKey("loading",!1),o()})}}}let a={instance:o(i)},u=V(i?s():void 0),c=(e=>{let{ssr:t,setFetcher:n}=e;return i=>{let o;if("server"===K)throw Error("Live mode is not supported in server environments");if(t&&!i.client)throw Error("The `client` option in `enableLiveMode` is required");let s=i.client||e.client||void 0,a=new AbortController;return Promise.all([r.e(409),r.e(485)]).then(r.bind(r,3485)).then(({enableLiveMode:e})=>{a.signal.aborted||(o=e({...i,client:s,setFetcher:n,ssr:t}))}),()=>{a.abort(),o?.()}}})({client:i||void 0,ssr:t,setFetcher:e=>{let t=u.get();return u.set(e),()=>u.set(t)}}),l={instance:void 0,canPreviewDrafts:!1};return{createFetcherStore:(e,t={},r)=>{let n=u.get(),i=((e={})=>{let t=V(e);return t.setKey=function(e,r){let n=t.value;typeof r>"u"&&e in t.value?(t.value={...t.value},delete t.value[e],t.notify(n,e)):t.value[e]!==r&&(t.value={...t.value,[e]:r},t.notify(n,e))},t})(n?n.hydrate(e,t,r):{loading:!1,error:typeof r?.data>"u"?Error("The `initial` option is required when `ssr: true`"):void 0,data:r?.data,sourceMap:r?.sourceMap,perspective:r?.perspective});return((e,t)=>((e,t,r,n)=>(e.events=e.events||{},e.events[r+10]||(e.events[r+10]=n(t=>{e.events[r].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[r]=e.events[r]||[],e.events[r].push(t),()=>{let n=e.events[r],i=n.indexOf(t);n.splice(i,1),n.length||(delete e.events[r],e.events[r+10](),delete e.events[r+10])}))(e,r=>{let n=t(r);n&&e.events[6].push(n)},5,t=>{let r=e.listen;e.listen=(...n)=>(e.lc||e.active||(e.active=!0,t()),r(...n));let n=e.off;return e.events[6]=[],e.off=()=>{n(),setTimeout(()=>{if(e.active&&!e.lc){for(let t of(e.active=!1,e.events[6]))t();e.events[6]=[]}},1e3)},()=>{e.listen=r,e.off=n}}))(i,()=>{let r=new AbortController,n=u.subscribe(n=>{!n||r.signal.aborted||(r.abort(),r=new AbortController,n.fetch(e,t,i,r))});return()=>{r.abort(),n()}}),i},enableLiveMode:c,setServerClient:e=>{if("server"!==K)throw Error("`setServerClient` can only be called in server environments, detected: "+JSON.stringify(K));if(!t)throw Error("`setServerClient` can only be called when `ssr: true`");l.instance=i=H(e),l.canPreviewDrafts=!!i.config().token,u.set(s())}
32,unstable__cache:a,unstable__serverClient:l}}},8981:(e,t,r)=>{"use strict";r.d(t,{T:()=>i});var n=r(8229);function i(e){return Symbol.asyncIterator&&(0,n.T)(null==e?void 0:e[Symbol.asyncIterator])}},9948:(e,t,r)=>{"use strict";r.d(t,{Kn:()=>u,yU:()=>a,Uv:()=>c});var n=r(4902),i=r(8229),o=(0,r(6011).L)(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}}),s=r(7436),a=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,s,a,u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var c=(0,n.Ju)(u),h=c.next();!h.done;h=c.next())h.value.remove(this)}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.T)(f))try{f()}catch(e){a=e instanceof o?e.errors:[e]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var d=(0,n.Ju)(p),y=d.next();!y.done;y=d.next()){var g=y.value;try{l(g)}catch(e){a=null!=a?a:[],e instanceof o?a=(0,n.fX)((0,n.fX)([],(0,n.zs)(a)),(0,n.zs)(e.errors)):a.push(e)}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}}if(a)throw new o(a)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)l(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(r=this._finalizers)?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)&&(0,s.o)(t,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&(0,s.o)(r,e),e instanceof t&&e._removeParent(this)},(e=new t).closed=!0,t.EMPTY=e,t}(),u=a.EMPTY;function c(e){return e instanceof a||e&&"closed"in e&&(0,i.T)(e.remove)&&(0,i.T)(e.add)&&(0,i.T)(e.unsubscribe)}function l(e){(0,i.T)(e)?e():e.unsubscribe()}}}]);
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.