@note3/utils 0.0.19 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,78 @@
1
+ var uf={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,n){return"Cannot apply '"+t+"' to '"+n.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(t,n){return"[mobx.array] Index out of bounds, "+t+" is larger than "+n},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(t){return"Cannot initialize from classes that inherit from Map: "+t.constructor.name},20:function(t){return"Cannot initialize map from "+t},21:function(t){return"Cannot convert to map from '"+t+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(t){return"Cannot obtain administration from "+t},25:function(t,n){return"the entry '"+t+"' does not exist in the observable map '"+n+"'"},26:"please specify a property",27:function(t,n){return"no observable property '"+t.toString()+"' found on the observable object '"+n+"'"},28:function(t){return"Cannot obtain atom from "+t},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(t,n){return"Cycle detected in computation "+t+": "+n},33:function(t){return"The setter of computed value '"+t+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(t){return"[ComputedValue '"+t+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(t){return"[mobx] `observableArray."+t+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+t+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},cf=uf;function ae(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=typeof e=="string"?e:cf[e];throw typeof i=="function"&&(i=i.apply(null,n)),new Error("[MobX] "+i)}var ff={};function Kr(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:ff}var Cs=Object.assign,xr=Object.getOwnPropertyDescriptor,Et=Object.defineProperty,Zn=Object.prototype,Ur=[];Object.freeze(Ur);var Yi={};Object.freeze(Yi);var lf=typeof Proxy<"u",df=Object.toString();function xs(){lf||ae("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function Jn(e){W.verifyProxies&&ae("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function ft(){return++W.mobxGuid}function Qi(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var In=function(){};function $e(e){return typeof e=="function"}function nn(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Gr(e){return e!==null&&typeof e=="object"}function _t(e){if(!Gr(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===df}function Us(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Vr(e,t,n){Et(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function js(e,t,n){Et(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Vt(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(r){return Gr(r)&&r[n]===!0}}function $n(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function pf(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function xt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Ds=typeof Object.getOwnPropertySymbols<"u";function yf(e){var t=Object.keys(e);if(!Ds)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return Zn.propertyIsEnumerable.call(e,r)})):t}var zr=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Ds?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Fi(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Ms(e){return e===null?null:typeof e=="object"?""+e:e}function st(e,t){return Zn.hasOwnProperty.call(e,t)}var hf=Object.getOwnPropertyDescriptors||function(t){var n={};return zr(t).forEach(function(r){n[r]=xr(t,r)}),n};function qe(e,t){return!!(e&t)}function We(e,t,n){return n?e|=t:e&=~t,e}function ys(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mf(r.key),r)}}function Rn(e,t,n){return t&&hs(e.prototype,t),n&&hs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function En(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=bf(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dt(){return Dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dt.apply(null,arguments)}function Ls(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ki(e,t)}function ki(e,t){return ki=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ki(e,t)}function gf(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mf(e){var t=gf(e,"string");return typeof t=="symbol"?t:t+""}function bf(e,t){if(e){if(typeof e=="string")return ys(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ys(e,t):void 0}}var Ge=Symbol("mobx-stored-annotations");function St(e){function t(n,r){if(tr(r))return e.decorate_20223_(n,r);er(n,r,e)}return Object.assign(t,e)}function er(e,t,n){if(st(e,Ge)||Vr(e,Ge,Dt({},e[Ge])),jr(n)&&!st(e[Ge],t)){var r=e.constructor.name+".prototype."+t.toString();ae("'"+r+"' is decorated with 'override', but no such decorated member was found on prototype.")}vf(e,n,t),jr(n)||(e[Ge][t]=n)}function vf(e,t,n){if(!jr(t)&&st(e[Ge],n)){var r=e.constructor.name+".prototype."+n.toString(),i=e[Ge][n].annotationType_,s=t.annotationType_;ae("Cannot apply '@"+s+"' to '"+r+"':"+(`
3
+ The field is already decorated with '@`+i+"'.")+`
4
+ Re-decorating fields is not allowed.
5
+ Use '@override' decorator for methods overridden by subclass.`)}}function _f(e){return st(e,Ge)||Vr(e,Ge,Dt({},e[Ge])),e[Ge]}function tr(e){return typeof e=="object"&&typeof e.kind=="string"}function qr(e,t){t.includes(e.kind)||ae("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var he=Symbol("mobx administration"),zt=(function(){function e(n){n===void 0&&(n="Atom@"+ft()),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=ve.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.reportObserved=function(){return ta(this)},t.reportChanged=function(){it(),na(this),ot()},t.toString=function(){return this.name_},Rn(e,[{key:"isBeingObserved",get:function(){return qe(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=We(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return qe(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=We(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return qe(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=We(this.flags_,e.diffValueMask_,r===1)}}])})();zt.isBeingObservedMask_=1;zt.isPendingUnobservationMask_=2;zt.diffValueMask_=4;var Zi=Vt("Atom",zt);function Bs(e,t,n){t===void 0&&(t=In),n===void 0&&(n=In);var r=new zt(e);return t!==In&&fa(r,t),n!==In&&ir(r,n),r}function Tf(e,t){return e===t}function wf(e,t){return co(e,t)}function Of(e,t){return co(e,t,1)}function Af(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ut={identity:Tf,structural:wf,default:Af,shallow:Of};function rn(e,t,n){return Pn(e)?e:Array.isArray(e)?Pe.array(e,{name:n}):_t(e)?Pe.object(e,void 0,{name:n}):$n(e)?Pe.map(e,{name:n}):xt(e)?Pe.set(e,{name:n}):typeof e=="function"&&!Gt(e)&&!Qn(e)?Us(e)?Sn(e):Yn(n,e):e}function If(e,t,n){if(e==null||an(e)||Cn(e)||$t(e)||ht(e))return e;if(Array.isArray(e))return Pe.array(e,{name:n,deep:!1});if(_t(e))return Pe.object(e,void 0,{name:n,deep:!1});if($n(e))return Pe.map(e,{name:n,deep:!1});if(xt(e))return Pe.set(e,{name:n,deep:!1});ae("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function Wr(e){return e}function Ef(e,t){return Pn(e)&&ae("observable.struct should not be used with observable values"),co(e,t)?t:e}var Sf="override";function jr(e){return e.annotationType_===Sf}function nr(e,t){return{annotationType_:e,options_:t,make_:Pf,extend_:$f,decorate_20223_:Rf}}function Pf(e,t,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,n,!1)===null?0:1;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if(Gt(n.value))return 1;var s=Fs(e,this,t,n,!1);return Et(r,t,s),2}function $f(e,t,n,r){var i=Fs(e,this,t,n);return e.defineProperty_(t,i,r)}function Rf(e,t){qr(t,["method","field"]);var n=t.kind,r=t.name,i=t.addInitializer,s=this,o=function(c){var g,b,M,$;return on((g=(b=s.options_)==null?void 0:b.name)!=null?g:r.toString(),c,(M=($=s.options_)==null?void 0:$.autoAction)!=null?M:!1)};if(n=="field")return function(f){var c,g=f;return Gt(g)||(g=o(g)),(c=s.options_)!=null&&c.bound&&(g=g.bind(this),g.isMobxAction=!0),g};if(n=="method"){var u;return Gt(e)||(e=o(e)),(u=this.options_)!=null&&u.bound&&i(function(){var f=this,c=f[r].bind(f);c.isMobxAction=!0,f[r]=c}),e}ae("Cannot apply '"+s.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
6
+ '`+s.annotationType_+"' can only be used on properties with a function value."))}function Nf(e,t,n,r){var i=t.annotationType_,s=r.value;$e(s)||ae("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
7
+ '`+i+"' can only be used on properties with a function value."))}function Fs(e,t,n,r,i){var s,o,u,f,c,g,b;i===void 0&&(i=W.safeDescriptors),Nf(e,t,n,r);var M=r.value;if((s=t.options_)!=null&&s.bound){var $;M=M.bind(($=e.proxy_)!=null?$:e.target_)}return{value:on((o=(u=t.options_)==null?void 0:u.name)!=null?o:n.toString(),M,(f=(c=t.options_)==null?void 0:c.autoAction)!=null?f:!1,(g=t.options_)!=null&&g.bound?(b=e.proxy_)!=null?b:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function ks(e,t){return{annotationType_:e,options_:t,make_:Cf,extend_:xf,decorate_20223_:Uf}}function Cf(e,t,n,r){var i;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!st(e.target_,t)||!Qn(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(Qn(n.value))return 1;var s=Ks(e,this,t,n,!1,!1);return Et(r,t,s),2}function xf(e,t,n,r){var i,s=Ks(e,this,t,n,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,s,r)}function Uf(e,t){var n;qr(t,["method"]);var r=t.name,i=t.addInitializer;return Qn(e)||(e=Sn(e)),(n=this.options_)!=null&&n.bound&&i(function(){var s=this,o=s[r].bind(s);o.isMobXFlow=!0,s[r]=o}),e}function jf(e,t,n,r){var i=t.annotationType_,s=r.value;$e(s)||ae("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
8
+ '`+i+"' can only be used on properties with a generator function value."))}function Ks(e,t,n,r,i,s){s===void 0&&(s=W.safeDescriptors),jf(e,t,n,r);var o=r.value;if(Qn(o)||(o=Sn(o)),i){var u;o=o.bind((u=e.proxy_)!=null?u:e.target_),o.isMobXFlow=!0}return{value:o,configurable:s?e.isPlainObject_:!0,enumerable:!1,writable:!s}}function eo(e,t){return{annotationType_:e,options_:t,make_:Df,extend_:Mf,decorate_20223_:Lf}}function Df(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Mf(e,t,n,r){return Bf(e,this,t,n),e.defineComputedProperty_(t,Dt({},this.options_,{get:n.get,set:n.set}),r)}function Lf(e,t){qr(t,["getter"]);var n=this,r=t.name,i=t.addInitializer;return i(function(){var s=xn(this)[he],o=Dt({},n.options_,{get:e,context:this});o.name||(o.name=s.name_+"."+r.toString()),s.values_.set(r,new ct(o))}),function(){return this[he].getObservablePropValue_(r)}}function Bf(e,t,n,r){var i=t.annotationType_,s=r.get;s||ae("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
9
+ '`+i+"' can only be used on getter(+setter) properties."))}function Hr(e,t){return{annotationType_:e,options_:t,make_:Ff,extend_:kf,decorate_20223_:Kf}}function Ff(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function kf(e,t,n,r){var i,s;return Gf(e,this,t,n),e.defineObservableProperty_(t,n.value,(i=(s=this.options_)==null?void 0:s.enhancer)!=null?i:rn,r)}function Kf(e,t){if(t.kind==="field")throw ae("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");qr(t,["accessor"]);var n=this,r=t.kind,i=t.name,s=new WeakSet;function o(u,f){var c,g,b=xn(u)[he],M=new Kt(f,(c=(g=n.options_)==null?void 0:g.enhancer)!=null?c:rn,b.name_+"."+i.toString(),!1);b.values_.set(i,M),s.add(u)}if(r=="accessor")return{get:function(){return s.has(this)||o(this,e.get.call(this)),this[he].getObservablePropValue_(i)},set:function(f){return s.has(this)||o(this,f),this[he].setObservablePropValue_(i,f)},init:function(f){return s.has(this)||o(this,f),f}}}function Gf(e,t,n,r){var i=t.annotationType_;"value"in r||ae("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
10
+ '`+i+"' cannot be used on getter/setter properties"))}var Vf="true",zf=Gs();function Gs(e){return{annotationType_:Vf,options_:e,make_:qf,extend_:Wf,decorate_20223_:Hf}}function qf(e,t,n,r){var i,s;if(n.get)return lt.make_(e,t,n,r);if(n.set){var o=on(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:W.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Et(r,t,{configurable:!0,set:o}),2)}if(r!==e.target_&&typeof n.value=="function"){var u;if(Us(n.value)){var f,c=(f=this.options_)!=null&&f.autoBind?Sn.bound:Sn;return c.make_(e,t,n,r)}var g=(u=this.options_)!=null&&u.autoBind?Yn.bound:Yn;return g.make_(e,t,n,r)}var b=((i=this.options_)==null?void 0:i.deep)===!1?Pe.ref:Pe;if(typeof n.value=="function"&&(s=this.options_)!=null&&s.autoBind){var M;n.value=n.value.bind((M=e.proxy_)!=null?M:e.target_)}return b.make_(e,t,n,r)}function Wf(e,t,n,r){var i,s;if(n.get)return lt.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:W.safeDescriptors?e.isPlainObject_:!0,set:on(t.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;n.value=n.value.bind((o=e.proxy_)!=null?o:e.target_)}var u=((s=this.options_)==null?void 0:s.deep)===!1?Pe.ref:Pe;return u.extend_(e,t,n,r)}function Hf(e,t){ae("'"+this.annotationType_+"' cannot be used as a decorator")}var Jf="observable",Xf="observable.ref",Yf="observable.shallow",Qf="observable.struct",Vs={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Vs);function Er(e){return e||Vs}var Ki=Hr(Jf),Zf=Hr(Xf,{enhancer:Wr}),el=Hr(Yf,{enhancer:If}),tl=Hr(Qf,{enhancer:Ef}),zs=St(Ki);function Sr(e){return e.deep===!0?rn:e.deep===!1?Wr:rl(e.defaultDecorator)}function nl(e){var t;return e?(t=e.defaultDecorator)!=null?t:Gs(e):void 0}function rl(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:rn}function qs(e,t,n){if(tr(t))return Ki.decorate_20223_(e,t);if(nn(t)){er(e,t,Ki);return}return Pn(e)?e:_t(e)?Pe.object(e,t,n):Array.isArray(e)?Pe.array(e,t):$n(e)?Pe.map(e,t):xt(e)?Pe.set(e,t):typeof e=="object"&&e!==null?e:Pe.box(e,t)}Cs(qs,zs);var il={box:function(t,n){var r=Er(n);return new Kt(t,Sr(r),r.name,!0,r.equals)},array:function(t,n){var r=Er(n);return(W.useProxies===!1||r.proxy===!1?id:Hl)(t,Sr(r),r.name)},map:function(t,n){var r=Er(n);return new ga(t,Sr(r),r.name)},set:function(t,n){var r=Er(n);return new ma(t,Sr(r),r.name)},object:function(t,n,r){return cn(function(){return Ml(W.useProxies===!1||r?.proxy===!1?xn({},r):zl({},r),t,n)})},ref:St(Zf),shallow:St(el),deep:zs,struct:St(tl)},Pe=Cs(qs,il),Ws="computed",ol="computed.struct",Gi=eo(Ws),sl=eo(ol,{equals:ut.structural}),lt=function(t,n){if(tr(n))return Gi.decorate_20223_(t,n);if(nn(n))return er(t,n,Gi);if(_t(t))return St(eo(Ws,t));$e(t)||ae("First argument to `computed` should be an expression."),$e(n)&&ae("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var r=_t(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new ct(r)};Object.assign(lt,Gi);lt.struct=St(sl);var gs,ms,Dr=0,al=1,ul=(gs=(ms=xr(function(){},"name"))==null?void 0:ms.configurable)!=null?gs:!1,bs={value:"action",configurable:!0,writable:!1,enumerable:!1};function on(e,t,n,r){n===void 0&&(n=!1),$e(t)||ae("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&ae("actions should have valid names, got: '"+e+"'");function i(){return cl(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},ul&&(bs.value=e,Et(i,"name",bs)),i}function cl(e,t,n,r,i){var s=fl(e,t,r,i);try{return n.apply(r,i)}catch(o){throw s.error_=o,o}finally{ll(s)}}function fl(e,t,n,r){var i=je()&&!!e,s=0;if(i){s=Date.now();var o=r?Array.from(r):Ur;He({type:no,name:e,object:n,arguments:o})}var u=W.trackingDerivation,f=!t||!u;it();var c=W.allowStateChanges;f&&(un(),c=Jr(!0));var g=to(!0),b={runAsAction_:f,prevDerivation_:u,prevAllowStateChanges_:c,prevAllowStateReads_:g,notifySpy_:i,startTime_:s,actionId_:al++,parentActionId_:Dr};return Dr=b.actionId_,b}function ll(e){Dr!==e.actionId_&&ae(30),Dr=e.parentActionId_,e.error_!==void 0&&(W.suppressReactionErrors=!0),Xr(e.prevAllowStateChanges_),Xn(e.prevAllowStateReads_),ot(),e.runAsAction_&&jt(e.prevDerivation_),e.notifySpy_&&Je({time:Date.now()-e.startTime_}),W.suppressReactionErrors=!1}function dl(e,t){var n=Jr(e);try{return t()}finally{Xr(n)}}function Jr(e){var t=W.allowStateChanges;return W.allowStateChanges=e,t}function Xr(e){W.allowStateChanges=e}var pl="create",Kt=(function(e){function t(r,i,s,o,u){var f;return s===void 0&&(s="ObservableValue@"+ft()),o===void 0&&(o=!0),u===void 0&&(u=ut.default),f=e.call(this,s)||this,f.enhancer=void 0,f.name_=void 0,f.equals=void 0,f.hasUnreportedChange_=!1,f.interceptors_=void 0,f.changeListeners_=void 0,f.value_=void 0,f.dehancer=void 0,f.enhancer=i,f.name_=s,f.equals=u,f.value_=i(r,void 0,s),o&&je()&&sn({type:pl,object:f,observableKind:"value",debugObjectName:f.name_,newValue:""+f.value_}),f}Ls(t,e);var n=t.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){var s=this.value_;if(i=this.prepareNewValue_(i),i!==W.UNCHANGED){var o=je();o&&He({type:mt,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:s}),this.setNewValue_(i),o&&Je()}},n.prepareNewValue_=function(i){if(It(this),nt(this)){var s=rt(this,{object:this,type:mt,newValue:i});if(!s)return W.UNCHANGED;i=s.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?W.UNCHANGED:i},n.setNewValue_=function(i){var s=this.value_;this.value_=i,this.reportChanged(),bt(this)&&vt(this,{type:mt,object:this,newValue:i,oldValue:s})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return or(this,i)},n.observe_=function(i,s){return s&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:mt,newValue:this.value_,oldValue:void 0}),sr(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Ms(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t})(zt),yl=Vt("ObservableValue",Kt),ct=(function(){function e(n){this.dependenciesState_=ve.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=ve.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Mr(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=at.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||ae(31),this.derivation=n.get,this.name_=n.name||"ComputedValue@"+ft(),n.set&&(this.setter_=on(this.name_+"-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?ut.structural:ut.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Tl(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.get=function(){if(this.isComputing&&ae(32,this.name_,this.derivation),W.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Vi(this)&&(this.warnAboutUntrackedRead_(),it(),this.value_=this.computeValue_(!1),ot());else if(ta(this),Vi(this)){var r=W.trackingContext;this.keepAlive_&&!r&&(W.trackingContext=this),this.trackAndCompute()&&_l(this),W.trackingContext=r}var i=this.value_;if(Rr(i))throw i.cause;return i},t.set=function(r){if(this.setter_){this.isRunningSetter&&ae(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else ae(34,this.name_)},t.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===ve.NOT_TRACKING_,s=this.computeValue_(!0),o=i||Rr(r)||Rr(s)||!this.equals_(r,s);return o&&(this.value_=s,je()&&sn({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:r,newValue:s})),o},t.computeValue_=function(r){this.isComputing=!0;var i=Jr(!1),s;if(r)s=Js(this,this.derivation,this.scope_);else if(W.disableErrorBoundaries===!0)s=this.derivation.call(this.scope_);else try{s=this.derivation.call(this.scope_)}catch(o){s=new Mr(o)}return Xr(i),this.isComputing=!1,s},t.suspend_=function(){this.keepAlive_||(zi(this),this.value_=void 0,this.isTracing_!==at.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(r,i){var s=this,o=!0,u=void 0;return ro(function(){var f=s.get();if(!o||i){var c=un();r({observableKind:"computed",debugObjectName:s.name_,type:mt,object:s,newValue:f,oldValue:u}),jt(c)}o=!1,u=f})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==at.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:W.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute.")},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Ms(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Rn(e,[{key:"isComputing",get:function(){return qe(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=We(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return qe(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=We(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return qe(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=We(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return qe(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=We(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return qe(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=We(this.flags_,e.diffValueMask_,r===1)}}])})();ct.isComputingMask_=1;ct.isRunningSetterMask_=2;ct.isBeingObservedMask_=4;ct.isPendingUnobservationMask_=8;ct.diffValueMask_=16;var rr=Vt("ComputedValue",ct),ve;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(ve||(ve={}));var at;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(at||(at={}));var Mr=function(t){this.cause=void 0,this.cause=t};function Rr(e){return e instanceof Mr}function Vi(e){switch(e.dependenciesState_){case ve.UP_TO_DATE_:return!1;case ve.NOT_TRACKING_:case ve.STALE_:return!0;case ve.POSSIBLY_STALE_:{for(var t=to(!0),n=un(),r=e.observing_,i=r.length,s=0;s<i;s++){var o=r[s];if(rr(o)){if(W.disableErrorBoundaries)o.get();else try{o.get()}catch{return jt(n),Xn(t),!0}if(e.dependenciesState_===ve.STALE_)return jt(n),Xn(t),!0}}return Xs(e),jt(n),Xn(t),!1}}}function Hs(){return W.trackingDerivation!==null}function It(e){var t=e.observers_.size>0;!W.allowStateChanges&&(t||W.enforceActions==="always")&&console.warn("[MobX] "+(W.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}function hl(e){!W.allowStateReads&&W.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Js(e,t,n){var r=to(!0);Xs(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++W.runId;var i=W.trackingDerivation;W.trackingDerivation=e,W.inBatch++;var s;if(W.disableErrorBoundaries===!0)s=t.call(n);else try{s=t.call(n)}catch(o){s=new Mr(o)}return W.inBatch--,W.trackingDerivation=i,ml(e),gl(e),Xn(r),s}function gl(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:W.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function ml(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=ve.UP_TO_DATE_,i=0,s=e.unboundDepsCount_,o=0;o<s;o++){var u=n[o];u.diffValue===0&&(u.diffValue=1,i!==o&&(n[i]=u),i++),u.dependenciesState_>r&&(r=u.dependenciesState_)}for(n.length=i,e.newObserving_=null,s=t.length;s--;){var f=t[s];f.diffValue===0&&Zs(f,e),f.diffValue=0}for(;i--;){var c=n[i];c.diffValue===1&&(c.diffValue=0,vl(c,e))}r!==ve.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function zi(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Zs(t[n],e);e.dependenciesState_=ve.NOT_TRACKING_}function Ve(e){var t=un();try{return e()}finally{jt(t)}}function un(){var e=W.trackingDerivation;return W.trackingDerivation=null,e}function jt(e){W.trackingDerivation=e}function to(e){var t=W.allowStateReads;return W.allowStateReads=e,t}function Xn(e){W.allowStateReads=e}function Xs(e){if(e.dependenciesState_!==ve.UP_TO_DATE_){e.dependenciesState_=ve.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=ve.UP_TO_DATE_}}var Nr=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Cr=!0,Ys=!1,W=(function(){var e=Kr();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Cr=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Nr().version&&(Cr=!1),Cr?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Nr):(setTimeout(function(){Ys||ae(35)},1),new Nr)})();function bl(){if((W.pendingReactions.length||W.inBatch||W.isRunningReactions)&&ae(36),Ys=!0,Cr){var e=Kr();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),W=new Nr}}function Qs(){return W}function vl(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Zs(e,t){e.observers_.delete(t),e.observers_.size===0&&ea(e)}function ea(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,W.pendingUnobservations.push(e))}function it(){W.inBatch++}function ot(){if(--W.inBatch===0){oa();for(var e=W.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof ct&&n.suspend_())}W.pendingUnobservations=[]}}function ta(e){hl(e);var t=W.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&W.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&W.inBatch>0&&ea(e),!1)}function na(e){e.lowestObserverState_!==ve.STALE_&&(e.lowestObserverState_=ve.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===ve.UP_TO_DATE_&&(t.isTracing_!==at.NONE&&ra(t,e),t.onBecomeStale_()),t.dependenciesState_=ve.STALE_}))}function _l(e){e.lowestObserverState_!==ve.STALE_&&(e.lowestObserverState_=ve.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===ve.POSSIBLY_STALE_?(t.dependenciesState_=ve.STALE_,t.isTracing_!==at.NONE&&ra(t,e)):t.dependenciesState_===ve.UP_TO_DATE_&&(e.lowestObserverState_=ve.UP_TO_DATE_)}))}function Tl(e){e.lowestObserverState_===ve.UP_TO_DATE_&&(e.lowestObserverState_=ve.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===ve.UP_TO_DATE_&&(t.dependenciesState_=ve.POSSIBLY_STALE_,t.onBecomeStale_())}))}function ra(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===at.BREAK){var n=[];ia(Yr(e),n,1),new Function(`debugger;
11
+ /*
12
+ Tracing '`+e.name_+`'
13
+
14
+ You are entering this break point because derivation '`+e.name_+"' is being traced and '"+t.name_+`' is now forcing it to update.
15
+ Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
16
+ The stackframe you are looking for is at least ~6-8 stack-frames up.
17
+
18
+ `+(e instanceof ct?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
19
+
20
+ The dependencies for this derivation are:
21
+
22
+ `+n.join(`
23
+ `)+`
24
+ */
25
+ `)()}}function ia(e,t,n){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(n-1)+e.name),e.dependencies&&e.dependencies.forEach(function(r){return ia(r,t,n+1)})}var Pt=(function(){function e(n,r,i,s){n===void 0&&(n="Reaction@"+ft()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=ve.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=at.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=s}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,W.pendingReactions.push(this),oa())},t.runReaction_=function(){if(!this.isDisposed){it(),this.isScheduled=!1;var r=W.trackingContext;if(W.trackingContext=this,Vi(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&je()&&sn({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}W.trackingContext=r,ot()}},t.track=function(r){if(!this.isDisposed){it();var i=je(),s;i&&(s=Date.now(),He({name:this.name_,type:"reaction"})),this.isRunning=!0;var o=W.trackingContext;W.trackingContext=this;var u=Js(this,r,void 0);W.trackingContext=o,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&zi(this),Rr(u)&&this.reportExceptionInDerivation_(u.cause),i&&Je({time:Date.now()-s}),ot()}},t.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(W.disableErrorBoundaries)throw r;var s="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";W.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(s,r),je()&&sn({type:"error",name:this.name_,message:s,error:""+r}),W.globalReactionErrorHandlers.forEach(function(o){return o(r,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(it(),zi(this),ot()))},t.getDisposer_=function(r){var i=this,s=function o(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",o)};return r==null||r.addEventListener==null||r.addEventListener("abort",s),s[he]=this,s},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(r){r===void 0&&(r=!1),io(this,r)},Rn(e,[{key:"isDisposed",get:function(){return qe(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=We(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return qe(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=We(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return qe(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=We(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return qe(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=We(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return qe(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=We(this.flags_,e.diffValueMask_,r===1)}}])})();Pt.isDisposedMask_=1;Pt.isScheduledMask_=2;Pt.isTrackPendingMask_=4;Pt.isRunningMask_=8;Pt.diffValueMask_=16;var vs=100,qi=function(t){return t()};function oa(){W.inBatch>0||W.isRunningReactions||qi(wl)}function wl(){W.isRunningReactions=!0;for(var e=W.pendingReactions,t=0;e.length>0;){++t===vs&&(console.error("Reaction doesn't converge to a stable state after "+vs+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}W.isRunningReactions=!1}var Lr=Vt("Reaction",Pt);function Ol(e){var t=qi;qi=function(r){return e(function(){return t(r)})}}function je(){return!!W.spyListeners.length}function sn(e){if(W.spyListeners.length)for(var t=W.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function He(e){var t=Dt({},e,{spyReportStart:!0});sn(t)}var Al={type:"report-end",spyReportEnd:!0};function Je(e){sn(e?Dt({},e,{type:"report-end",spyReportEnd:!0}):Al)}function Il(e){return W.spyListeners.push(e),Qi(function(){W.spyListeners=W.spyListeners.filter(function(t){return t!==e})})}var no="action",El="action.bound",sa="autoAction",Sl="autoAction.bound",Pl="<unnamed action>",Wi=nr(no),$l=nr(El,{bound:!0}),Hi=nr(sa,{autoAction:!0}),Rl=nr(Sl,{autoAction:!0,bound:!0});function aa(e){var t=function(r,i){if($e(r))return on(r.name||Pl,r,e);if($e(i))return on(r,i,e);if(tr(i))return(e?Hi:Wi).decorate_20223_(r,i);if(nn(i))return er(r,i,e?Hi:Wi);if(nn(r))return St(nr(e?sa:no,{name:r,autoAction:e}));ae("Invalid arguments for `action`")};return t}var gt=aa(!1);Object.assign(gt,Wi);var Yn=aa(!0);Object.assign(Yn,Hi);gt.bound=St($l);Yn.bound=St(Rl);function Gt(e){return $e(e)&&e.isMobxAction===!0}function ro(e,t){var n,r,i,s;t===void 0&&(t=Yi),$e(e)||ae("Autorun expects a function as first argument"),Gt(e)&&ae("Autorun does not accept actions since actions are untrackable");var o=(n=(r=t)==null?void 0:r.name)!=null?n:e.name||"Autorun@"+ft(),u=!t.scheduler&&!t.delay,f;if(u)f=new Pt(o,function(){this.track(b)},t.onError,t.requiresObservable);else{var c=ua(t),g=!1;f=new Pt(o,function(){g||(g=!0,c(function(){g=!1,f.isDisposed||f.track(b)}))},t.onError,t.requiresObservable)}function b(){e(f)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||f.schedule_(),f.getDisposer_((s=t)==null?void 0:s.signal)}var Nl=function(t){return t()};function ua(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Nl}function ca(e,t,n){var r,i,s;n===void 0&&(n=Yi),(!$e(e)||!$e(t))&&ae("First and second argument to reaction should be functions"),_t(n)||ae("Third argument of reactions should be an object");var o=(r=n.name)!=null?r:"Reaction@"+ft(),u=gt(o,n.onError?Cl(n.onError,t):t),f=!n.scheduler&&!n.delay,c=ua(n),g=!0,b=!1,M,$=n.compareStructural?ut.structural:n.equals||ut.default,L=new Pt(o,function(){g||f?H():b||(b=!0,c(H))},n.onError,n.requiresObservable);function H(){if(b=!1,!L.isDisposed){var Z=!1,K=M;L.track(function(){var B=dl(!1,function(){return e(L)});Z=g||!$(M,B),M=B}),(g&&n.fireImmediately||!g&&Z)&&u(M,K,L),g=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||L.schedule_(),L.getDisposer_((s=n)==null?void 0:s.signal)}function Cl(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}var xl="onBO",Ul="onBUO";function fa(e,t,n){return la(xl,e,t,n)}function ir(e,t,n){return la(Ul,e,t,n)}function la(e,t,n,r){var i=typeof r=="function"?Mt(t,n):Mt(t),s=$e(r)?r:n,o=e+"L";return i[o]?i[o].add(s):i[o]=new Set([s]),function(){var u=i[o];u&&(u.delete(s),u.size===0&&delete i[o])}}var jl="never",Pr="always",Dl="observed";function da(e){e.isolateGlobalState===!0&&bl();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(W.useProxies=t===Pr?!0:t===jl?!1:typeof Proxy<"u"),t==="ifavailable"&&(W.verifyProxies=!0),n!==void 0){var r=n===Pr?Pr:n===Dl;W.enforceActions=r,W.allowStateChanges=!(r===!0||r===Pr)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(W[i]=!!e[i])}),W.allowStateReads=!W.observableRequiresReaction,W.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&Ol(e.reactionScheduler)}function Ml(e,t,n,r){arguments.length>4&&ae("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&ae("'extendObservable' expects an object as first argument"),$t(e)&&ae("'extendObservable' should not be used on maps, use map.merge instead"),_t(t)||ae("'extendObservable' only accepts plain objects as second argument"),(Pn(t)||Pn(n))&&ae("Extending an object with another observable (object) is not supported");var i=hf(t);return cn(function(){var s=xn(e,r)[he];zr(i).forEach(function(o){s.extend_(o,i[o],n&&o in n?n[o]:!0)})}),e}function Yr(e,t){return pa(Mt(e,t))}function pa(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=Ll(e.observing_).map(pa)),t}function Ll(e){return Array.from(new Set(e))}var Bl=0;function ya(){this.message="FLOW_CANCELLED"}ya.prototype=Object.create(Error.prototype);var Li=ks("flow"),Fl=ks("flow.bound",{bound:!0}),Sn=Object.assign(function(t,n){if(tr(n))return Li.decorate_20223_(t,n);if(nn(n))return er(t,n,Li);arguments.length!==1&&ae("Flow expects single argument with generator function");var r=t,i=r.name||"<unnamed flow>",s=function(){var u=this,f=arguments,c=++Bl,g=gt(i+" - runid: "+c+" - init",r).apply(u,f),b,M=void 0,$=new Promise(function(L,H){var Z=0;b=H;function K(q){M=void 0;var F;try{F=gt(i+" - runid: "+c+" - yield "+Z++,g.next).call(g,q)}catch(ee){return H(ee)}V(F)}function B(q){M=void 0;var F;try{F=gt(i+" - runid: "+c+" - yield "+Z++,g.throw).call(g,q)}catch(ee){return H(ee)}V(F)}function V(q){if($e(q?.then)){q.then(V,H);return}return q.done?L(q.value):(M=Promise.resolve(q.value),M.then(K,B))}K(void 0)});return $.cancel=gt(i+" - runid: "+c+" - cancel",function(){try{M&&_s(M);var L=g.return(void 0),H=Promise.resolve(L.value);H.then(In,In),_s(H),b(new ya)}catch(Z){b(Z)}}),$};return s.isMobXFlow=!0,s},Li);Sn.bound=St(Fl);function _s(e){$e(e.cancel)&&e.cancel()}function Qn(e){return e?.isMobXFlow===!0}function kl(e,t){return e?t!==void 0?$t(e)||Cn(e)?ae("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):an(e)?e[he].values_.has(t):!1:an(e)||!!e[he]||Zi(e)||Lr(e)||rr(e):!1}function Pn(e){return arguments.length!==1&&ae("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),kl(e)}function Kl(e){if(an(e))return e[he].ownKeys_();ae(38)}function $r(e,t,n){return e.set(t,n),n}function An(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Pn(e))return e;if(yl(e)||rr(e))return An(e.get(),t);if(t.has(e))return t.get(e);if(Cn(e)){var n=$r(t,e,new Array(e.length));return e.forEach(function(o,u){n[u]=An(o,t)}),n}if(ht(e)){var r=$r(t,e,new Set);return e.forEach(function(o){r.add(An(o,t))}),r}if($t(e)){var i=$r(t,e,new Map);return e.forEach(function(o,u){i.set(u,An(o,t))}),i}else{var s=$r(t,e,{});return Kl(e).forEach(function(o){Zn.propertyIsEnumerable.call(e,o)&&(s[o]=An(e[o],t))}),s}}function Nn(e,t){return t&&ae("toJS no longer supports options"),An(e,new Map)}function io(){for(var e=!1,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];typeof n[n.length-1]=="boolean"&&(e=n.pop());var i=Gl(n);if(!i)return ae("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");i.isTracing_===at.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?at.BREAK:at.LOG}function Gl(e){switch(e.length){case 0:return W.trackingDerivation;case 1:return Mt(e[0]);case 2:return Mt(e[0],e[1])}}function Ut(e,t){t===void 0&&(t=void 0),it();try{return e.apply(t)}finally{ot()}}function tn(e){return e[he]}var Vl={has:function(t,n){return W.trackingDerivation&&Jn("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),tn(t).has_(n)},get:function(t,n){return tn(t).get_(n)},set:function(t,n,r){var i;return nn(n)?(tn(t).values_.has(n)||Jn("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=tn(t).set_(n,r,!0))!=null?i:!0):!1},deleteProperty:function(t,n){var r;return Jn("delete properties from an observable object. Use 'remove' from 'mobx' instead."),nn(n)?(r=tn(t).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(t,n,r){var i;return Jn("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=tn(t).defineProperty_(n,r))!=null?i:!0},ownKeys:function(t){return W.trackingDerivation&&Jn("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),tn(t).ownKeys_()},preventExtensions:function(t){ae(13)}};function zl(e,t){var n,r;return xs(),e=xn(e,t),(r=(n=e[he]).proxy_)!=null?r:n.proxy_=new Proxy(e,Vl)}function nt(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function or(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),Qi(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function rt(e,t){var n=un();try{for(var r=[].concat(e.interceptors_||[]),i=0,s=r.length;i<s&&(t=r[i](t),t&&!t.type&&ae(14),!!t);i++);return t}finally{jt(n)}}function bt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function sr(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),Qi(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function vt(e,t){var n=un(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,s=r.length;i<s;i++)r[i](t);jt(n)}}function oo(e,t,n){return cn(function(){var r,i=xn(e,n)[he];t&&e[Ge]&&ae("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(r=t)!=null||(t=_f(e)),zr(t).forEach(function(s){return i.make_(s,t[s])})}),e}var Ts="splice",mt="update",ql=1e4,Wl={get:function(t,n){var r=t[he];return n===he?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):st(Br,n)?Br[n]:t[n]},set:function(t,n,r){var i=t[he];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?t[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){ae(15)}},so=(function(){function e(n,r,i,s){n===void 0&&(n="ObservableArray@"+ft()),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=s,this.atom_=new zt(n),this.enhancer_=function(o,u){return r(o,u,n+"[..]")}}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},t.intercept_=function(r){return or(this,r)},t.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),sr(this,r)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&ae("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var s=new Array(r-i),o=0;o<r-i;o++)s[o]=void 0;this.spliceWithArray_(i,0,s)}else this.spliceWithArray_(r,i-r)},t.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&ae(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&_a(r+i+1)},t.spliceWithArray_=function(r,i,s){var o=this;It(this.atom_);var u=this.values_.length;if(r===void 0?r=0:r>u?r=u:r<0&&(r=Math.max(0,u+r)),arguments.length===1?i=u-r:i==null?i=0:i=Math.max(0,Math.min(i,u-r)),s===void 0&&(s=Ur),nt(this)){var f=rt(this,{object:this.proxy_,type:Ts,index:r,removedCount:i,added:s});if(!f)return Ur;i=f.removedCount,s=f.added}s=s.length===0?s:s.map(function(b){return o.enhancer_(b,void 0)}),this.legacyMode_;var c=s.length-i;this.updateArrayLength_(u,c);var g=this.spliceItemsIntoValues_(r,i,s);return(i!==0||s.length!==0)&&this.notifyArraySplice_(r,s,g),this.dehanceValues_(g)},t.spliceItemsIntoValues_=function(r,i,s){if(s.length<ql){var o;return(o=this.values_).splice.apply(o,[r,i].concat(s))}else{var u=this.values_.slice(r,r+i),f=this.values_.slice(r+i);this.values_.length+=s.length-i;for(var c=0;c<s.length;c++)this.values_[r+c]=s[c];for(var g=0;g<f.length;g++)this.values_[r+s.length+g]=f[g];return u}},t.notifyArrayChildUpdate_=function(r,i,s){var o=!this.owned_&&je(),u=bt(this),f=u||o?{observableKind:"array",object:this.proxy_,type:mt,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:s}:null;o&&He(f),this.atom_.reportChanged(),u&&vt(this,f),o&&Je()},t.notifyArraySplice_=function(r,i,s){var o=!this.owned_&&je(),u=bt(this),f=u||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Ts,index:r,removed:s,added:i,removedCount:s.length,addedCount:i.length}:null;o&&He(f),this.atom_.reportChanged(),u&&vt(this,f),o&&Je()},t.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx.array] Attempt to read an array index ("+r+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX");return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},t.set_=function(r,i){var s=this.values_;if(this.legacyMode_&&r>s.length&&ae(17,r,s.length),r<s.length){It(this.atom_);var o=s[r];if(nt(this)){var u=rt(this,{type:mt,object:this.proxy_,index:r,newValue:i});if(!u)return;i=u.newValue}i=this.enhancer_(i,o);var f=i!==o;f&&(s[r]=i,this.notifyArrayChildUpdate_(r,i,o))}else{for(var c=new Array(r+1-s.length),g=0;g<c.length-1;g++)c[g]=void 0;c[c.length-1]=i,this.spliceWithArray_(s.length,0,c)}},e})();function Hl(e,t,n,r){return n===void 0&&(n="ObservableArray@"+ft()),r===void 0&&(r=!1),xs(),cn(function(){var i=new so(n,t,r,!1);js(i.values_,he,i);var s=new Proxy(i.values_,Wl);return i.proxy_=s,e&&e.length&&i.spliceWithArray_(0,0,e),s})}var Br={clear:function(){return this.splice(0)},replace:function(t){var n=this[he];return n.spliceWithArray_(0,n.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];var o=this[he];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,n)}return o.spliceWithArray_(t,n,i)},spliceWithArray:function(t,n,r){return this[he].spliceWithArray_(t,n,r)},push:function(){for(var t=this[he],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,r),t.values_.length},pop:function(){return this.splice(Math.max(this[he].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[he],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(0,0,r),t.values_.length},reverse:function(){return W.trackingDerivation&&ae(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){W.trackingDerivation&&ae(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var n=this[he],r=n.dehanceValues_(n.values_).indexOf(t);return r>-1?(this.splice(r,1),!0):!1}};Ae("at",Xe);Ae("concat",Xe);Ae("flat",Xe);Ae("includes",Xe);Ae("indexOf",Xe);Ae("join",Xe);Ae("lastIndexOf",Xe);Ae("slice",Xe);Ae("toString",Xe);Ae("toLocaleString",Xe);Ae("toSorted",Xe);Ae("toSpliced",Xe);Ae("with",Xe);Ae("every",Tt);Ae("filter",Tt);Ae("find",Tt);Ae("findIndex",Tt);Ae("findLast",Tt);Ae("findLastIndex",Tt);Ae("flatMap",Tt);Ae("forEach",Tt);Ae("map",Tt);Ae("some",Tt);Ae("toReversed",Tt);Ae("reduce",ha);Ae("reduceRight",ha);function Ae(e,t){typeof Array.prototype[e]=="function"&&(Br[e]=t(e))}function Xe(e){return function(){var t=this[he];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function Tt(e){return function(t,n){var r=this,i=this[he];i.atom_.reportObserved();var s=i.dehanceValues_(i.values_);return s[e](function(o,u){return t.call(n,o,u,r)})}}function ha(e){return function(){var t=this,n=this[he];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(s,o,u){return i(s,o,u,t)},r[e].apply(r,arguments)}}var Jl=Vt("ObservableArrayAdministration",so);function Cn(e){return Gr(e)&&Jl(e[he])}var Xl={},kt="add",Fr="delete",ga=(function(){function e(n,r,i){var s=this;r===void 0&&(r=rn),i===void 0&&(i="ObservableMap@"+ft()),this.enhancer_=void 0,this.name_=void 0,this[he]=Xl,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=i,$e(Map)||ae(18),cn(function(){s.keysAtom_=Bs(s.name_+".keys()"),s.data_=new Map,s.hasMap_=new Map,n&&s.merge(n)})}var t=e.prototype;return t.has_=function(r){return this.data_.has(r)},t.has=function(r){var i=this;if(!W.trackingDerivation)return this.has_(r);var s=this.hasMap_.get(r);if(!s){var o=s=new Kt(this.has_(r),Wr,this.name_+"."+Fi(r)+"?",!1);this.hasMap_.set(r,o),ir(o,function(){return i.hasMap_.delete(r)})}return s.get()},t.set=function(r,i){var s=this.has_(r);if(nt(this)){var o=rt(this,{type:s?mt:kt,object:this,newValue:i,name:r});if(!o)return this;i=o.newValue}return s?this.updateValue_(r,i):this.addValue_(r,i),this},t.delete=function(r){var i=this;if(It(this.keysAtom_),nt(this)){var s=rt(this,{type:Fr,object:this,name:r});if(!s)return!1}if(this.has_(r)){var o=je(),u=bt(this),f=u||o?{observableKind:"map",debugObjectName:this.name_,type:Fr,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return o&&He(f),Ut(function(){var c;i.keysAtom_.reportChanged(),(c=i.hasMap_.get(r))==null||c.setNewValue_(!1);var g=i.data_.get(r);g.setNewValue_(void 0),i.data_.delete(r)}),u&&vt(this,f),o&&Je(),!0}return!1},t.updateValue_=function(r,i){var s=this.data_.get(r);if(i=s.prepareNewValue_(i),i!==W.UNCHANGED){var o=je(),u=bt(this),f=u||o?{observableKind:"map",debugObjectName:this.name_,type:mt,object:this,oldValue:s.value_,name:r,newValue:i}:null;o&&He(f),s.setNewValue_(i),u&&vt(this,f),o&&Je()}},t.addValue_=function(r,i){var s=this;It(this.keysAtom_),Ut(function(){var c,g=new Kt(i,s.enhancer_,s.name_+"."+Fi(r),!1);s.data_.set(r,g),i=g.value_,(c=s.hasMap_.get(r))==null||c.setNewValue_(!0),s.keysAtom_.reportChanged()});var o=je(),u=bt(this),f=u||o?{observableKind:"map",debugObjectName:this.name_,type:kt,object:this,name:r,newValue:i}:null;o&&He(f),u&&vt(this,f),o&&Je()},t.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var r=this,i=this.keys();return ws({next:function(){var o=i.next(),u=o.done,f=o.value;return{done:u,value:u?void 0:r.get(f)}}})},t.entries=function(){var r=this,i=this.keys();return ws({next:function(){var o=i.next(),u=o.done,f=o.value;return{done:u,value:u?void 0:[f,r.get(f)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(r,i){for(var s=En(this),o;!(o=s()).done;){var u=o.value,f=u[0],c=u[1];r.call(i,c,f,this)}},t.merge=function(r){var i=this;return $t(r)&&(r=new Map(r)),Ut(function(){_t(r)?yf(r).forEach(function(s){return i.set(s,r[s])}):Array.isArray(r)?r.forEach(function(s){var o=s[0],u=s[1];return i.set(o,u)}):$n(r)?(pf(r)||ae(19,r),r.forEach(function(s,o){return i.set(o,s)})):r!=null&&ae(20,r)}),this},t.clear=function(){var r=this;Ut(function(){Ve(function(){for(var i=En(r.keys()),s;!(s=i()).done;){var o=s.value;r.delete(o)}})})},t.replace=function(r){var i=this;return Ut(function(){for(var s=Yl(r),o=new Map,u=!1,f=En(i.data_.keys()),c;!(c=f()).done;){var g=c.value;if(!s.has(g)){var b=i.delete(g);if(b)u=!0;else{var M=i.data_.get(g);o.set(g,M)}}}for(var $=En(s.entries()),L;!(L=$()).done;){var H=L.value,Z=H[0],K=H[1],B=i.data_.has(Z);if(i.set(Z,K),i.data_.has(Z)){var V=i.data_.get(Z);o.set(Z,V),B||(u=!0)}}if(!u)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var q=i.data_.keys(),F=o.keys(),ee=q.next(),z=F.next();!ee.done;){if(ee.value!==z.value){i.keysAtom_.reportChanged();break}ee=q.next(),z=F.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(r,i){return i===!0&&ae("`observe` doesn't support fireImmediately=true in combination with maps."),sr(this,r)},t.intercept_=function(r){return or(this,r)},Rn(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])})(),$t=Vt("ObservableMap",ga);function ws(e){return e[Symbol.toStringTag]="MapIterator",fo(e)}function Yl(e){if($n(e)||$t(e))return e;if(Array.isArray(e))return new Map(e);if(_t(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return ae(21,e)}var Ql={},ma=(function(){function e(n,r,i){var s=this;r===void 0&&(r=rn),i===void 0&&(i="ObservableSet@"+ft()),this.name_=void 0,this[he]=Ql,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,$e(Set)||ae(22),this.enhancer_=function(o,u){return r(o,u,i)},cn(function(){s.atom_=Bs(s.name_),n&&s.replace(n)})}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.clear=function(){var r=this;Ut(function(){Ve(function(){for(var i=En(r.data_.values()),s;!(s=i()).done;){var o=s.value;r.delete(o)}})})},t.forEach=function(r,i){for(var s=En(this),o;!(o=s()).done;){var u=o.value;r.call(i,u,u,this)}},t.add=function(r){var i=this;if(It(this.atom_),nt(this)){var s=rt(this,{type:kt,object:this,newValue:r});if(!s)return this;r=s.newValue}if(!this.has(r)){Ut(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var o=je(),u=bt(this),f=u||o?{observableKind:"set",debugObjectName:this.name_,type:kt,object:this,newValue:r}:null;o&&He(f),u&&vt(this,f),o&&Je()}return this},t.delete=function(r){var i=this;if(nt(this)){var s=rt(this,{type:Fr,object:this,oldValue:r});if(!s)return!1}if(this.has(r)){var o=je(),u=bt(this),f=u||o?{observableKind:"set",debugObjectName:this.name_,type:Fr,object:this,oldValue:r}:null;return o&&He(f),Ut(function(){i.atom_.reportChanged(),i.data_.delete(r)}),u&&vt(this,f),o&&Je(),!0}return!1},t.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},t.entries=function(){var r=this.values();return Os({next:function(){var s=r.next(),o=s.value,u=s.done;return u?{value:void 0,done:u}:{value:[o,o],done:u}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var r=this,i=this.data_.values();return Os({next:function(){var o=i.next(),u=o.value,f=o.done;return f?{value:void 0,done:f}:{value:r.dehanceValue_(u),done:f}}})},t.intersection=function(r){if(xt(r)&&!ht(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},t.union=function(r){if(xt(r)&&!ht(r))return r.union(this);var i=new Set(this);return i.union(r)},t.difference=function(r){return new Set(this).difference(r)},t.symmetricDifference=function(r){if(xt(r)&&!ht(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},t.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},t.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},t.isDisjointFrom=function(r){if(xt(r)&&!ht(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},t.replace=function(r){var i=this;return ht(r)&&(r=new Set(r)),Ut(function(){Array.isArray(r)?(i.clear(),r.forEach(function(s){return i.add(s)})):xt(r)?(i.clear(),r.forEach(function(s){return i.add(s)})):r!=null&&ae("Cannot initialize set from "+r)}),this},t.observe_=function(r,i){return i===!0&&ae("`observe` doesn't support fireImmediately=true in combination with sets."),sr(this,r)},t.intercept_=function(r){return or(this,r)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Rn(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])})(),ht=Vt("ObservableSet",ma);function Os(e){return e[Symbol.toStringTag]="SetIterator",fo(e)}var As=Object.create(null),Is="remove",Ji=(function(){function e(n,r,i,s){r===void 0&&(r=new Map),s===void 0&&(s=zf),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=s,this.keysAtom_=new zt(this.name_+".keys"),this.isPlainObject_=_t(this.target_),Ta(this.defaultAnnotation_)||ae("defaultAnnotation must be valid annotation"),this.appliedAnnotations_={}}var t=e.prototype;return t.getObservablePropValue_=function(r){return this.values_.get(r).get()},t.setObservablePropValue_=function(r,i){var s=this.values_.get(r);if(s instanceof ct)return s.set(i),!0;if(nt(this)){var o=rt(this,{type:mt,object:this.proxy_||this.target_,name:r,newValue:i});if(!o)return null;i=o.newValue}if(i=s.prepareNewValue_(i),i!==W.UNCHANGED){var u=bt(this),f=je(),c=u||f?{type:mt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:r,newValue:i}:null;f&&He(c),s.setNewValue_(i),u&&vt(this,c),f&&Je()}return!0},t.get_=function(r){return W.trackingDerivation&&!st(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,i,s){return s===void 0&&(s=!1),st(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):s?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,s)},t.has_=function(r){if(!W.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new Kt(r in this.target_,Wr,this.name_+"."+Fi(r)+"?",!1),this.pendingKeys_.set(r,i)),i.get()},t.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(Ps(this,i,r),!(r in this.target_)){var s;if((s=this.target_[Ge])!=null&&s[r])return;ae(1,i.annotationType_,this.name_+"."+r.toString())}for(var o=this.target_;o&&o!==Zn;){var u=xr(o,r);if(u){var f=i.make_(this,r,u,o);if(f===0)return;if(f===1)break}o=Object.getPrototypeOf(o)}Ss(this,i,r)}},t.extend_=function(r,i,s,o){if(o===void 0&&(o=!1),s===!0&&(s=this.defaultAnnotation_),s===!1)return this.defineProperty_(r,i,o);Ps(this,s,r);var u=s.extend_(this,r,i,o);return u&&Ss(this,s,r),u},t.defineProperty_=function(r,i,s){s===void 0&&(s=!1),It(this.keysAtom_);try{it();var o=this.delete_(r);if(!o)return o;if(nt(this)){var u=rt(this,{object:this.proxy_||this.target_,name:r,type:kt,newValue:i.value});if(!u)return null;var f=u.newValue;i.value!==f&&(i=Dt({},i,{value:f}))}if(s){if(!Reflect.defineProperty(this.target_,r,i))return!1}else Et(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{ot()}return!0},t.defineObservableProperty_=function(r,i,s,o){o===void 0&&(o=!1),It(this.keysAtom_);try{it();var u=this.delete_(r);if(!u)return u;if(nt(this)){var f=rt(this,{object:this.proxy_||this.target_,name:r,type:kt,newValue:i});if(!f)return null;i=f.newValue}var c=Es(r),g={configurable:W.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,r,g))return!1}else Et(this.target_,r,g);var b=new Kt(i,s,this.name_+"."+r.toString(),!1);this.values_.set(r,b),this.notifyPropertyAddition_(r,b.value_)}finally{ot()}return!0},t.defineComputedProperty_=function(r,i,s){s===void 0&&(s=!1),It(this.keysAtom_);try{it();var o=this.delete_(r);if(!o)return o;if(nt(this)){var u=rt(this,{object:this.proxy_||this.target_,name:r,type:kt,newValue:void 0});if(!u)return null}i.name||(i.name=this.name_+"."+r.toString()),i.context=this.proxy_||this.target_;var f=Es(r),c={configurable:W.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:f.get,set:f.set};if(s){if(!Reflect.defineProperty(this.target_,r,c))return!1}else Et(this.target_,r,c);this.values_.set(r,new ct(i)),this.notifyPropertyAddition_(r,void 0)}finally{ot()}return!0},t.delete_=function(r,i){if(i===void 0&&(i=!1),It(this.keysAtom_),!st(this.target_,r))return!0;if(nt(this)){var s=rt(this,{object:this.proxy_||this.target_,name:r,type:Is});if(!s)return null}try{var o;it();var u=bt(this),f=je(),c=this.values_.get(r),g=void 0;if(!c&&(u||f)){var b;g=(b=xr(this.target_,r))==null?void 0:b.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(delete this.appliedAnnotations_[r],c&&(this.values_.delete(r),c instanceof Kt&&(g=c.value_),na(c)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(r in this.target_),u||f){var M={type:Is,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:g,name:r};f&&He(M),u&&vt(this,M),f&&Je()}}finally{ot()}return!0},t.observe_=function(r,i){return i===!0&&ae("`observe` doesn't support the fire immediately property for observable objects."),sr(this,r)},t.intercept_=function(r){return or(this,r)},t.notifyPropertyAddition_=function(r,i){var s,o=bt(this),u=je();if(o||u){var f=o||u?{type:kt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;u&&He(f),o&&vt(this,f),u&&Je()}(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),zr(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e})();function xn(e,t){var n;if(t&&an(e)&&ae("Options can't be provided for already observable objects."),st(e,he))return uo(e)instanceof Ji||ae("Cannot convert '"+kr(e)+`' into observable object:
26
+ The target is already observable of different type.
27
+ Extending builtins is not supported.`),e;Object.isExtensible(e)||ae("Cannot make the designated object observable; it is not extensible");var r=(n=t?.name)!=null?n:(_t(e)?"ObservableObject":e.constructor.name)+"@"+ft(),i=new Ji(e,new Map,String(r),nl(t));return Vr(e,he,i),e}var Zl=Vt("ObservableObjectAdministration",Ji);function Es(e){return As[e]||(As[e]={get:function(){return this[he].getObservablePropValue_(e)},set:function(n){return this[he].setObservablePropValue_(e,n)}})}function an(e){return Gr(e)?Zl(e[he]):!1}function Ss(e,t,n){var r;e.appliedAnnotations_[n]=t,(r=e.target_[Ge])==null||delete r[n]}function Ps(e,t,n){if(Ta(t)||ae("Cannot annotate '"+e.name_+"."+n.toString()+"': Invalid annotation."),!jr(t)&&st(e.appliedAnnotations_,n)){var r=e.name_+"."+n.toString(),i=e.appliedAnnotations_[n].annotationType_,s=t.annotationType_;ae("Cannot apply '"+s+"' to '"+r+"':"+(`
28
+ The field is already annotated with '`+i+"'.")+`
29
+ Re-annotating fields is not allowed.
30
+ Use 'override' annotation for methods overridden by subclass.`)}}var ed=va(0),td=(function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1})(),Bi=0,ba=function(){};function nd(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}nd(ba,Array.prototype);var ao=(function(e){function t(r,i,s,o){var u;return s===void 0&&(s="ObservableArray@"+ft()),o===void 0&&(o=!1),u=e.call(this)||this,cn(function(){var f=new so(s,i,o,!0);f.proxy_=u,js(u,he,f),r&&r.length&&u.spliceWithArray(0,0,r),td&&Object.defineProperty(u,"0",ed)}),u}Ls(t,e);var n=t.prototype;return n.concat=function(){this[he].atom_.reportObserved();for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),s.map(function(u){return Cn(u)?u.slice():u}))},n[Symbol.iterator]=function(){var r=this,i=0;return fo({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},Rn(t,[{key:"length",get:function(){return this[he].getArrayLength_()},set:function(i){this[he].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])})(ba);Object.entries(Br).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&Vr(ao.prototype,t,n)});function va(e){return{enumerable:!1,configurable:!0,get:function(){return this[he].get_(e)},set:function(n){this[he].set_(e,n)}}}function rd(e){Et(ao.prototype,""+e,va(e))}function _a(e){if(e>Bi){for(var t=Bi;t<e+100;t++)rd(t);Bi=e}}_a(1e3);function id(e,t,n){return new ao(e,t,n)}function Mt(e,t){if(typeof e=="object"&&e!==null){if(Cn(e))return t!==void 0&&ae(23),e[he].atom_;if(ht(e))return e.atom_;if($t(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||ae(25,t,kr(e)),n}if(an(e)){if(!t)return ae(26);var r=e[he].values_.get(t);return r||ae(27,t,kr(e)),r}if(Zi(e)||rr(e)||Lr(e))return e}else if($e(e)&&Lr(e[he]))return e[he];ae(28)}function uo(e,t){if(e||ae(29),t!==void 0)return uo(Mt(e,t));if(Zi(e)||rr(e)||Lr(e)||$t(e)||ht(e))return e;if(e[he])return e[he];ae(24,e)}function kr(e,t){var n;if(t!==void 0)n=Mt(e,t);else{if(Gt(e))return e.name;an(e)||$t(e)||ht(e)?n=uo(e):n=Mt(e)}return n.name_}function cn(e){var t=un(),n=Jr(!0);it();try{return e()}finally{ot(),Xr(n),jt(t)}}var $s=Zn.toString;function co(e,t,n){return n===void 0&&(n=-1),Xi(e,t,n)}function Xi(e,t,n,r,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var s=typeof e;if(s!=="function"&&s!=="object"&&typeof t!="object")return!1;var o=$s.call(e);if(o!==$s.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++;break}e=Rs(e),t=Rs(t);var u=o==="[object Array]";if(!u){if(typeof e!="object"||typeof t!="object")return!1;var f=e.constructor,c=t.constructor;if(f!==c&&!($e(f)&&f instanceof f&&$e(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var g=r.length;g--;)if(r[g]===e)return i[g]===t;if(r.push(e),i.push(t),u){if(g=e.length,g!==t.length)return!1;for(;g--;)if(!Xi(e[g],t[g],n-1,r,i))return!1}else{var b=Object.keys(e),M=b.length;if(Object.keys(t).length!==M)return!1;for(var $=0;$<M;$++){var L=b[$];if(!(st(t,L)&&Xi(e[L],t[L],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function Rs(e){return Cn(e)?e.slice():$n(e)||$t(e)||xt(e)||ht(e)?Array.from(e.entries()):e}var Ns,od=((Ns=Kr().Iterator)==null?void 0:Ns.prototype)||{};function fo(e){return e[Symbol.iterator]=sd,Object.assign(Object.create(od),e)}function sd(){return this}function Ta(e){return e instanceof Object&&typeof e.annotationType_=="string"&&$e(e.make_)&&$e(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Kr();typeof t[e]>"u"&&ae("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Il,extras:{getDebugName:kr},$mobx:he});var ad=Object.create,lo=Object.defineProperty,ud=Object.getOwnPropertyDescriptor,wa=Object.getOwnPropertyNames,cd=Object.getPrototypeOf,fd=Object.prototype.hasOwnProperty,De=(e,t)=>function(){return t||(0,e[wa(e)[0]])((t={exports:{}}).exports,t),t.exports},po=(e,t)=>{for(var n in t)lo(e,n,{get:t[n],enumerable:!0})},ld=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of wa(t))!fd.call(e,i)&&i!==n&&lo(e,i,{get:()=>t[i],enumerable:!(r=ud(t,i))||r.enumerable});return e},qt=(e,t,n)=>(n=e!=null?ad(cd(e)):{},ld(t||!e||!e.__esModule?lo(n,"default",{value:e,enumerable:!0}):n,e));var Lt=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/typebox.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.JsonType=e.JavaScriptTypeBuilder=e.JsonTypeBuilder=e.TypeBuilder=e.TypeBuilderError=e.TransformEncodeBuilder=e.TransformDecodeBuilder=e.TemplateLiteralDslParser=e.TemplateLiteralGenerator=e.TemplateLiteralGeneratorError=e.TemplateLiteralFinite=e.TemplateLiteralFiniteError=e.TemplateLiteralParser=e.TemplateLiteralParserError=e.TemplateLiteralResolver=e.TemplateLiteralPattern=e.TemplateLiteralPatternError=e.UnionResolver=e.KeyArrayResolver=e.KeyArrayResolverError=e.KeyResolver=e.ObjectMap=e.Intrinsic=e.IndexedAccessor=e.TypeClone=e.TypeExtends=e.TypeExtendsResult=e.TypeExtendsError=e.ExtendsUndefined=e.TypeGuard=e.TypeGuardUnknownTypeError=e.ValueGuard=e.FormatRegistry=e.TypeBoxError=e.TypeRegistry=e.PatternStringExact=e.PatternNumberExact=e.PatternBooleanExact=e.PatternString=e.PatternNumber=e.PatternBoolean=e.Kind=e.Hint=e.Optional=e.Readonly=e.Transform=void 0,e.Transform=Symbol.for("TypeBox.Transform"),e.Readonly=Symbol.for("TypeBox.Readonly"),e.Optional=Symbol.for("TypeBox.Optional"),e.Hint=Symbol.for("TypeBox.Hint"),e.Kind=Symbol.for("TypeBox.Kind"),e.PatternBoolean="(true|false)",e.PatternNumber="(0|[1-9][0-9]*)",e.PatternString="(.*)",e.PatternBooleanExact=`^${e.PatternBoolean}$`,e.PatternNumberExact=`^${e.PatternNumber}$`,e.PatternStringExact=`^${e.PatternString}$`;var t;(function(l){let _=new Map;function I(){return new Map(_)}l.Entries=I;function C(){return _.clear()}l.Clear=C;function R(T){return _.delete(T)}l.Delete=R;function E(T){return _.has(T)}l.Has=E;function y(T,a){_.set(T,a)}l.Set=y;function w(T){return _.get(T)}l.Get=w})(t||(e.TypeRegistry=t={}));var n=class extends Error{constructor(l){super(l)}};e.TypeBoxError=n;var r;(function(l){let _=new Map;function I(){return new Map(_)}l.Entries=I;function C(){return _.clear()}l.Clear=C;function R(T){return _.delete(T)}l.Delete=R;function E(T){return _.has(T)}l.Has=E;function y(T,a){_.set(T,a)}l.Set=y;function w(T){return _.get(T)}l.Get=w})(r||(e.FormatRegistry=r={}));var i;(function(l){function _(v){return Array.isArray(v)}l.IsArray=_;function I(v){return typeof v=="bigint"}l.IsBigInt=I;function C(v){return typeof v=="boolean"}l.IsBoolean=C;function R(v){return v instanceof globalThis.Date}l.IsDate=R;function E(v){return v===null}l.IsNull=E;function y(v){return typeof v=="number"}l.IsNumber=y;function w(v){return typeof v=="object"&&v!==null}l.IsObject=w;function T(v){return typeof v=="string"}l.IsString=T;function a(v){return v instanceof globalThis.Uint8Array}l.IsUint8Array=a;function O(v){return v===void 0}l.IsUndefined=O})(i||(e.ValueGuard=i={}));var s=class extends n{};e.TypeGuardUnknownTypeError=s;var o;(function(l){function _(h){try{return new RegExp(h),!0}catch{return!1}}function I(h){if(!i.IsString(h))return!1;for(let Oe=0;Oe<h.length;Oe++){let tt=h.charCodeAt(Oe);if(tt>=7&&tt<=13||tt===27||tt===127)return!1}return!0}function C(h){return y(h)||Ce(h)}function R(h){return i.IsUndefined(h)||i.IsBigInt(h)}function E(h){return i.IsUndefined(h)||i.IsNumber(h)}function y(h){return i.IsUndefined(h)||i.IsBoolean(h)}function w(h){return i.IsUndefined(h)||i.IsString(h)}function T(h){return i.IsUndefined(h)||i.IsString(h)&&I(h)&&_(h)}function a(h){return i.IsUndefined(h)||i.IsString(h)&&I(h)}function O(h){return i.IsUndefined(h)||Ce(h)}function v(h){return me(h,"Any")&&w(h.$id)}l.TAny=v;function m(h){return me(h,"Array")&&h.type==="array"&&w(h.$id)&&Ce(h.items)&&E(h.minItems)&&E(h.maxItems)&&y(h.uniqueItems)&&O(h.contains)&&E(h.minContains)&&E(h.maxContains)}l.TArray=m;function S(h){return me(h,"AsyncIterator")&&h.type==="AsyncIterator"&&w(h.$id)&&Ce(h.items)}l.TAsyncIterator=S;function k(h){return me(h,"BigInt")&&h.type==="bigint"&&w(h.$id)&&R(h.exclusiveMaximum)&&R(h.exclusiveMinimum)&&R(h.maximum)&&R(h.minimum)&&R(h.multipleOf)}l.TBigInt=k;function Q(h){return me(h,"Boolean")&&h.type==="boolean"&&w(h.$id)}l.TBoolean=Q;function te(h){return me(h,"Constructor")&&h.type==="Constructor"&&w(h.$id)&&i.IsArray(h.parameters)&&h.parameters.every(Oe=>Ce(Oe))&&Ce(h.returns)}l.TConstructor=te;function pe(h){return me(h,"Date")&&h.type==="Date"&&w(h.$id)&&E(h.exclusiveMaximumTimestamp)&&E(h.exclusiveMinimumTimestamp)&&E(h.maximumTimestamp)&&E(h.minimumTimestamp)&&E(h.multipleOfTimestamp)}l.TDate=pe;function ge(h){return me(h,"Function")&&h.type==="Function"&&w(h.$id)&&i.IsArray(h.parameters)&&h.parameters.every(Oe=>Ce(Oe))&&Ce(h.returns)}l.TFunction=ge;function Ie(h){return me(h,"Integer")&&h.type==="integer"&&w(h.$id)&&E(h.exclusiveMaximum)&&E(h.exclusiveMinimum)&&E(h.maximum)&&E(h.minimum)&&E(h.multipleOf)}l.TInteger=Ie;function Re(h){return me(h,"Intersect")&&!(i.IsString(h.type)&&h.type!=="object")&&i.IsArray(h.allOf)&&h.allOf.every(Oe=>Ce(Oe)&&!Wn(Oe))&&w(h.type)&&(y(h.unevaluatedProperties)||O(h.unevaluatedProperties))&&w(h.$id)}l.TIntersect=Re;function Yt(h){return me(h,"Iterator")&&h.type==="Iterator"&&w(h.$id)&&Ce(h.items)}l.TIterator=Yt;function me(h,Oe){return Ft(h)&&h[e.Kind]===Oe}l.TKindOf=me;function Ft(h){return i.IsObject(h)&&e.Kind in h&&i.IsString(h[e.Kind])}l.TKind=Ft;function Qt(h){return P(h)&&i.IsString(h.const)}l.TLiteralString=Qt;function A(h){return P(h)&&i.IsNumber(h.const)}l.TLiteralNumber=A;function ue(h){return P(h)&&i.IsBoolean(h.const)}l.TLiteralBoolean=ue;function P(h){return me(h,"Literal")&&w(h.$id)&&(i.IsBoolean(h.const)||i.IsNumber(h.const)||i.IsString(h.const))}l.TLiteral=P;function ye(h){return me(h,"Never")&&i.IsObject(h.not)&&Object.getOwnPropertyNames(h.not).length===0}l.TNever=ye;function ne(h){return me(h,"Not")&&Ce(h.not)}l.TNot=ne;function ce(h){return me(h,"Null")&&h.type==="null"&&w(h.$id)}l.TNull=ce;function Te(h){return me(h,"Number")&&h.type==="number"&&w(h.$id)&&E(h.exclusiveMaximum)&&E(h.exclusiveMinimum)&&E(h.maximum)&&E(h.minimum)&&E(h.multipleOf)}l.TNumber=Te;function Se(h){return me(h,"Object")&&h.type==="object"&&w(h.$id)&&i.IsObject(h.properties)&&C(h.additionalProperties)&&E(h.minProperties)&&E(h.maxProperties)&&Object.entries(h.properties).every(([Oe,tt])=>I(Oe)&&Ce(tt))}l.TObject=Se;function Fe(h){return me(h,"Promise")&&h.type==="Promise"&&w(h.$id)&&Ce(h.item)}l.TPromise=Fe;function Le(h){return me(h,"Record")&&h.type==="object"&&w(h.$id)&&C(h.additionalProperties)&&i.IsObject(h.patternProperties)&&(Oe=>{let tt=Object.getOwnPropertyNames(Oe.patternProperties);return tt.length===1&&_(tt[0])&&i.IsObject(Oe.patternProperties)&&Ce(Oe.patternProperties[tt[0]])})(h)}l.TRecord=Le;function Ke(h){return i.IsObject(h)&&e.Hint in h&&h[e.Hint]==="Recursive"}l.TRecursive=Ke;function Ct(h){return me(h,"Ref")&&w(h.$id)&&i.IsString(h.$ref)}l.TRef=Ct;function Tn(h){return me(h,"String")&&h.type==="string"&&w(h.$id)&&E(h.minLength)&&E(h.maxLength)&&T(h.pattern)&&a(h.format)}l.TString=Tn;function wn(h){return me(h,"Symbol")&&h.type==="symbol"&&w(h.$id)}l.TSymbol=wn;function Zt(h){return me(h,"TemplateLiteral")&&h.type==="string"&&i.IsString(h.pattern)&&h.pattern[0]==="^"&&h.pattern[h.pattern.length-1]==="$"}l.TTemplateLiteral=Zt;function Or(h){return me(h,"This")&&w(h.$id)&&i.IsString(h.$ref)}l.TThis=Or;function Wn(h){return i.IsObject(h)&&e.Transform in h}l.TTransform=Wn;function Ne(h){return me(h,"Tuple")&&h.type==="array"&&w(h.$id)&&i.IsNumber(h.minItems)&&i.IsNumber(h.maxItems)&&h.minItems===h.maxItems&&(i.IsUndefined(h.items)&&i.IsUndefined(h.additionalItems)&&h.minItems===0||i.IsArray(h.items)&&h.items.every(Oe=>Ce(Oe)))}l.TTuple=Ne;function Ar(h){return me(h,"Undefined")&&h.type==="undefined"&&w(h.$id)}l.TUndefined=Ar;function Ui(h){return en(h)&&h.anyOf.every(Oe=>Qt(Oe)||A(Oe))}l.TUnionLiteral=Ui;function en(h){return me(h,"Union")&&w(h.$id)&&i.IsObject(h)&&i.IsArray(h.anyOf)&&h.anyOf.every(Oe=>Ce(Oe))}l.TUnion=en;function On(h){return me(h,"Uint8Array")&&h.type==="Uint8Array"&&w(h.$id)&&E(h.minByteLength)&&E(h.maxByteLength)}l.TUint8Array=On;function ke(h){return me(h,"Unknown")&&w(h.$id)}l.TUnknown=ke;function Ir(h){return me(h,"Unsafe")}l.TUnsafe=Ir;function Hn(h){return me(h,"Void")&&h.type==="void"&&w(h.$id)}l.TVoid=Hn;function ji(h){return i.IsObject(h)&&h[e.Readonly]==="Readonly"}l.TReadonly=ji;function Di(h){return i.IsObject(h)&&h[e.Optional]==="Optional"}l.TOptional=Di;function Ce(h){return i.IsObject(h)&&(v(h)||m(h)||Q(h)||k(h)||S(h)||te(h)||pe(h)||ge(h)||Ie(h)||Re(h)||Yt(h)||P(h)||ye(h)||ne(h)||ce(h)||Te(h)||Se(h)||Fe(h)||Le(h)||Ct(h)||Tn(h)||wn(h)||Zt(h)||Or(h)||Ne(h)||Ar(h)||en(h)||On(h)||ke(h)||Ir(h)||Hn(h)||Ft(h)&&t.Has(h[e.Kind]))}l.TSchema=Ce})(o||(e.TypeGuard=o={}));var u;(function(l){function _(I){return I[e.Kind]==="Intersect"?I.allOf.every(C=>_(C)):I[e.Kind]==="Union"?I.anyOf.some(C=>_(C)):I[e.Kind]==="Undefined"?!0:I[e.Kind]==="Not"?!_(I.not):!1}l.Check=_})(u||(e.ExtendsUndefined=u={}));var f=class extends n{};e.TypeExtendsError=f;var c;(function(l){l[l.Union=0]="Union",l[l.True=1]="True",l[l.False=2]="False"})(c||(e.TypeExtendsResult=c={}));var g;(function(l){function _(d){return d===c.False?d:c.True}function I(d){throw new f(d)}function C(d){return o.TNever(d)||o.TIntersect(d)||o.TUnion(d)||o.TUnknown(d)||o.TAny(d)}function R(d,p){return o.TNever(p)?me(d,p):o.TIntersect(p)?ge(d,p):o.TUnion(p)?Mi(d,p):o.TUnknown(p)?ps(d,p):o.TAny(p)?E(d,p):I("StructuralRight")}function E(d,p){return c.True}function y(d,p){return o.TIntersect(p)?ge(d,p):o.TUnion(p)&&p.anyOf.some(be=>o.TAny(be)||o.TUnknown(be))?c.True:o.TUnion(p)?c.Union:o.TUnknown(p)||o.TAny(p)?c.True:c.Union}function w(d,p){return o.TUnknown(d)?c.False:o.TAny(d)?c.Union:o.TNever(d)?c.True:c.False}function T(d,p){return o.TObject(p)&&Zt(p)?c.True:C(p)?R(d,p):o.TArray(p)?_(we(d.items,p.items)):c.False}function a(d,p){return C(p)?R(d,p):o.TAsyncIterator(p)?_(we(d.items,p.items)):c.False}function O(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):o.TBigInt(p)?c.True:c.False}function v(d,p){return o.TLiteral(d)&&i.IsBoolean(d.const)||o.TBoolean(d)?c.True:c.False}function m(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):o.TBoolean(p)?c.True:c.False}function S(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TConstructor(p)?d.parameters.length>p.parameters.length?c.False:d.parameters.every((be,yt)=>_(we(p.parameters[yt],be))===c.True)?_(we(d.returns,p.returns)):c.False:c.False}function k(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):o.TDate(p)?c.True:c.False}function Q(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TFunction(p)?d.parameters.length>p.parameters.length?c.False:d.parameters.every((be,yt)=>_(we(p.parameters[yt],be))===c.True)?_(we(d.returns,p.returns)):c.False:c.False}function te(d,p){return o.TLiteral(d)&&i.IsNumber(d.const)||o.TNumber(d)||o.TInteger(d)?c.True:c.False}function pe(d,p){return o.TInteger(p)||o.TNumber(p)?c.True:C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):c.False}function ge(d,p){return p.allOf.every(be=>we(d,be)===c.True)?c.True:c.False}function Ie(d,p){return d.allOf.some(be=>we(be,p)===c.True)?c.True:c.False}function Re(d,p){return C(p)?R(d,p):o.TIterator(p)?_(we(d.items,p.items)):c.False}function Yt(d,p){return o.TLiteral(p)&&p.const===d.const?c.True:C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):o.TString(p)?Hn(d,p):o.TNumber(p)?P(d,p):o.TInteger(p)?te(d,p):o.TBoolean(p)?v(d,p):c.False}function me(d,p){return c.False}function Ft(d,p){return c.True}function Qt(d){let[p,be]=[d,0];for(;o.TNot(p);)p=p.not,be+=1;return be%2===0?p:e.Type.Unknown()}function A(d,p){return o.TNot(d)?we(Qt(d),p):o.TNot(p)?we(d,Qt(p)):I("Invalid fallthrough for Not")}function ue(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):o.TNull(p)?c.True:c.False}function P(d,p){return o.TLiteralNumber(d)||o.TNumber(d)||o.TInteger(d)?c.True:c.False}function ye(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):o.TInteger(p)||o.TNumber(p)?c.True:c.False}function ne(d,p){return Object.getOwnPropertyNames(d.properties).length===p}function ce(d){return Zt(d)}function Te(d){return ne(d,0)||ne(d,1)&&"description"in d.properties&&o.TUnion(d.properties.description)&&d.properties.description.anyOf.length===2&&(o.TString(d.properties.description.anyOf[0])&&o.TUndefined(d.properties.description.anyOf[1])||o.TString(d.properties.description.anyOf[1])&&o.TUndefined(d.properties.description.anyOf[0]))}function Se(d){return ne(d,0)}function Fe(d){return ne(d,0)}function Le(d){return ne(d,0)}function Ke(d){return ne(d,0)}function Ct(d){return Zt(d)}function Tn(d){let p=e.Type.Number();return ne(d,0)||ne(d,1)&&"length"in d.properties&&_(we(d.properties.length,p))===c.True}function wn(d){return ne(d,0)}function Zt(d){let p=e.Type.Number();return ne(d,0)||ne(d,1)&&"length"in d.properties&&_(we(d.properties.length,p))===c.True}function Or(d){let p=e.Type.Function([e.Type.Any()],e.Type.Any());return ne(d,0)||ne(d,1)&&"then"in d.properties&&_(we(d.properties.then,p))===c.True}function Wn(d,p){return we(d,p)===c.False||o.TOptional(d)&&!o.TOptional(p)?c.False:c.True}function Ne(d,p){return o.TUnknown(d)?c.False:o.TAny(d)?c.Union:o.TNever(d)||o.TLiteralString(d)&&ce(p)||o.TLiteralNumber(d)&&Se(p)||o.TLiteralBoolean(d)&&Fe(p)||o.TSymbol(d)&&Te(p)||o.TBigInt(d)&&Le(p)||o.TString(d)&&ce(p)||o.TSymbol(d)&&Te(p)||o.TNumber(d)&&Se(p)||o.TInteger(d)&&Se(p)||o.TBoolean(d)&&Fe(p)||o.TUint8Array(d)&&Ct(p)||o.TDate(d)&&Ke(p)||o.TConstructor(d)&&wn(p)||o.TFunction(d)&&Tn(p)?c.True:o.TRecord(d)&&o.TString(en(d))?p[e.Hint]==="Record"?c.True:c.False:o.TRecord(d)&&o.TNumber(en(d))?ne(p,0)?c.True:c.False:c.False}function Ar(d,p){return C(p)?R(d,p):o.TRecord(p)?ke(d,p):o.TObject(p)?(()=>{for(let be of Object.getOwnPropertyNames(p.properties)){if(!(be in d.properties)&&!o.TOptional(p.properties[be]))return c.False;if(o.TOptional(p.properties[be]))return c.True;if(Wn(d.properties[be],p.properties[be])===c.False)return c.False}return c.True})():c.False}function Ui(d,p){return C(p)?R(d,p):o.TObject(p)&&Or(p)?c.True:o.TPromise(p)?_(we(d.item,p.item)):c.False}function en(d){return e.PatternNumberExact in d.patternProperties?e.Type.Number():e.PatternStringExact in d.patternProperties?e.Type.String():I("Unknown record key pattern")}function On(d){return e.PatternNumberExact in d.patternProperties?d.patternProperties[e.PatternNumberExact]:e.PatternStringExact in d.patternProperties?d.patternProperties[e.PatternStringExact]:I("Unable to get record value schema")}function ke(d,p){let[be,yt]=[en(p),On(p)];return o.TLiteralString(d)&&o.TNumber(be)&&_(we(d,yt))===c.True?c.True:o.TUint8Array(d)&&o.TNumber(be)||o.TString(d)&&o.TNumber(be)||o.TArray(d)&&o.TNumber(be)?we(d,yt):o.TObject(d)?(()=>{for(let af of Object.getOwnPropertyNames(d.properties))if(Wn(yt,d.properties[af])===c.False)return c.False;return c.True})():c.False}function Ir(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?we(On(d),On(p)):c.False}function Hn(d,p){return o.TLiteral(d)&&i.IsString(d.const)||o.TString(d)?c.True:c.False}function ji(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):o.TString(p)?c.True:c.False}function Di(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):o.TSymbol(p)?c.True:c.False}function Ce(d,p){return o.TTemplateLiteral(d)?we(F.Resolve(d),p):o.TTemplateLiteral(p)?we(d,F.Resolve(p)):I("Invalid fallthrough for TemplateLiteral")}function h(d,p){return o.TArray(p)&&d.items!==void 0&&d.items.every(be=>we(be,p.items)===c.True)}function Oe(d,p){return o.TNever(d)?c.True:o.TUnknown(d)?c.False:o.TAny(d)?c.Union:c.False}function tt(d,p){return C(p)?R(d,p):o.TObject(p)&&Zt(p)||o.TArray(p)&&h(d,p)?c.True:o.TTuple(p)?i.IsUndefined(d.items)&&!i.IsUndefined(p.items)||!i.IsUndefined(d.items)&&i.IsUndefined(p.items)?c.False:i.IsUndefined(d.items)&&!i.IsUndefined(p.items)||d.items.every((be,yt)=>we(be,p.items[yt])===c.True)?c.True:c.False:c.False}function Zc(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):o.TUint8Array(p)?c.True:c.False}function ef(d,p){return C(p)?R(d,p):o.TObject(p)?Ne(d,p):o.TRecord(p)?ke(d,p):o.TVoid(p)?rf(d,p):o.TUndefined(p)?c.True:c.False}function Mi(d,p){return p.anyOf.some(be=>we(d,be)===c.True)?c.True:c.False}function tf(d,p){return d.anyOf.every(be=>we(be,p)===c.True)?c.True:c.False}function ps(d,p){return c.True}function nf(d,p){return o.TNever(p)?me(d,p):o.TIntersect(p)?ge(d,p):o.TUnion(p)?Mi(d,p):o.TAny(p)?E(d,p):o.TString(p)?Hn(d,p):o.TNumber(p)?P(d,p):o.TInteger(p)?te(d,p):o.TBoolean(p)?v(d,p):o.TArray(p)?w(d,p):o.TTuple(p)?Oe(d,p):o.TObject(p)?Ne(d,p):o.TUnknown(p)?c.True:c.False}function rf(d,p){return o.TUndefined(d)||o.TUndefined(d)?c.True:c.False}function of(d,p){return o.TIntersect(p)?ge(d,p):o.TUnion(p)?Mi(d,p):o.TUnknown(p)?ps(d,p):o.TAny(p)?E(d,p):o.TObject(p)?Ne(d,p):o.TVoid(p)?c.True:c.False}function we(d,p){return o.TTemplateLiteral(d)||o.TTemplateLiteral(p)?Ce(d,p):o.TNot(d)||o.TNot(p)?A(d,p):o.TAny(d)?y(d,p):o.TArray(d)?T(d,p):o.TBigInt(d)?O(d,p):o.TBoolean(d)?m(d,p):o.TAsyncIterator(d)?a(d,p):o.TConstructor(d)?S(d,p):o.TDate(d)?k(d,p):o.TFunction(d)?Q(d,p):o.TInteger(d)?pe(d,p):o.TIntersect(d)?Ie(d,p):o.TIterator(d)?Re(d,p):o.TLiteral(d)?Yt(d,p):o.TNever(d)?Ft(d,p):o.TNull(d)?ue(d,p):o.TNumber(d)?ye(d,p):o.TObject(d)?Ar(d,p):o.TRecord(d)?Ir(d,p):o.TString(d)?ji(d,p):o.TSymbol(d)?Di(d,p):o.TTuple(d)?tt(d,p):o.TPromise(d)?Ui(d,p):o.TUint8Array(d)?Zc(d,p):o.TUndefined(d)?ef(d,p):o.TUnion(d)?tf(d,p):o.TUnknown(d)?nf(d,p):o.TVoid(d)?of(d,p):I(`Unknown left type operand '${d[e.Kind]}'`)}function sf(d,p){return we(d,p)}l.Extends=sf})(g||(e.TypeExtends=g={}));var b;(function(l){function _(T){return T.map(a=>E(a))}function I(T){return new Date(T.getTime())}function C(T){return new Uint8Array(T)}function R(T){let a=Object.getOwnPropertyNames(T).reduce((v,m)=>({...v,[m]:E(T[m])}),{}),O=Object.getOwnPropertySymbols(T).reduce((v,m)=>({...v,[m]:E(T[m])}),{});return{...a,...O}}function E(T){return i.IsArray(T)?_(T):i.IsDate(T)?I(T):i.IsUint8Array(T)?C(T):i.IsObject(T)?R(T):T}function y(T){return T.map(a=>w(a))}l.Rest=y;function w(T,a={}){return{...E(T),...a}}l.Type=w})(b||(e.TypeClone=b={}));var M;(function(l){function _(S){return S.map(k=>{let{[e.Optional]:Q,...te}=b.Type(k);return te})}function I(S){return S.every(k=>o.TOptional(k))}function C(S){return S.some(k=>o.TOptional(k))}function R(S){return I(S.allOf)?e.Type.Optional(e.Type.Intersect(_(S.allOf))):S}function E(S){return C(S.anyOf)?e.Type.Optional(e.Type.Union(_(S.anyOf))):S}function y(S){return S[e.Kind]==="Intersect"?R(S):S[e.Kind]==="Union"?E(S):S}function w(S,k){let Q=S.allOf.reduce((te,pe)=>{let ge=v(pe,k);return ge[e.Kind]==="Never"?te:[...te,ge]},[]);return y(e.Type.Intersect(Q))}function T(S,k){let Q=S.anyOf.map(te=>v(te,k));return y(e.Type.Union(Q))}function a(S,k){let Q=S.properties[k];return i.IsUndefined(Q)?e.Type.Never():e.Type.Union([Q])}function O(S,k){let Q=S.items;if(i.IsUndefined(Q))return e.Type.Never();let te=Q[k];return i.IsUndefined(te)?e.Type.Never():te}function v(S,k){return S[e.Kind]==="Intersect"?w(S,k):S[e.Kind]==="Union"?T(S,k):S[e.Kind]==="Object"?a(S,k):S[e.Kind]==="Tuple"?O(S,k):e.Type.Never()}function m(S,k,Q={}){let te=k.map(pe=>v(S,pe.toString()));return y(e.Type.Union(te,Q))}l.Resolve=m})(M||(e.IndexedAccessor=M={}));var $;(function(l){function _(O){let[v,m]=[O.slice(0,1),O.slice(1)];return`${v.toLowerCase()}${m}`}function I(O){let[v,m]=[O.slice(0,1),O.slice(1)];return`${v.toUpperCase()}${m}`}function C(O){return O.toUpperCase()}function R(O){return O.toLowerCase()}function E(O,v){let m=z.ParseExact(O.pattern);if(!N.Check(m))return{...O,pattern:y(O.pattern,v)};let Q=[...D.Generate(m)].map(ge=>e.Type.Literal(ge)),te=w(Q,v),pe=e.Type.Union(te);return e.Type.TemplateLiteral([pe])}function y(O,v){return typeof O=="string"?v==="Uncapitalize"?_(O):v==="Capitalize"?I(O):v==="Uppercase"?C(O):v==="Lowercase"?R(O):O:O.toString()}function w(O,v){if(O.length===0)return[];let[m,...S]=O;return[a(m,v),...w(S,v)]}function T(O,v){return o.TTemplateLiteral(O)?E(O,v):o.TUnion(O)?e.Type.Union(w(O.anyOf,v)):o.TLiteral(O)?e.Type.Literal(y(O.const,v)):O}function a(O,v){return T(O,v)}l.Map=a})($||(e.Intrinsic=$={}));var L;(function(l){function _(y,w){return e.Type.Intersect(y.allOf.map(T=>R(T,w)),{...y})}function I(y,w){return e.Type.Union(y.anyOf.map(T=>R(T,w)),{...y})}function C(y,w){return w(y)}function R(y,w){return y[e.Kind]==="Intersect"?_(y,w):y[e.Kind]==="Union"?I(y,w):y[e.Kind]==="Object"?C(y,w):y}function E(y,w,T){return{...R(b.Type(y),w),...T}}l.Map=E})(L||(e.ObjectMap=L={}));var H;(function(l){function _(a){return a[0]==="^"&&a[a.length-1]==="$"?a.slice(1,a.length-1):a}function I(a,O){return a.allOf.reduce((v,m)=>[...v,...y(m,O)],[])}function C(a,O){let v=a.anyOf.map(m=>y(m,O));return[...v.reduce((m,S)=>S.map(k=>v.every(Q=>Q.includes(k))?m.add(k):m)[0],new Set)]}function R(a,O){return Object.getOwnPropertyNames(a.properties)}function E(a,O){return O.includePatterns?Object.getOwnPropertyNames(a.patternProperties):[]}function y(a,O){return o.TIntersect(a)?I(a,O):o.TUnion(a)?C(a,O):o.TObject(a)?R(a,O):o.TRecord(a)?E(a,O):[]}function w(a,O){return[...new Set(y(a,O))]}l.ResolveKeys=w;function T(a){return`^(${w(a,{includePatterns:!0}).map(m=>`(${_(m)})`).join("|")})$`}l.ResolvePattern=T})(H||(e.KeyResolver=H={}));var Z=class extends n{};e.KeyArrayResolverError=Z;var K;(function(l){function _(I){return Array.isArray(I)?I:o.TUnionLiteral(I)?I.anyOf.map(C=>C.const.toString()):o.TLiteral(I)?[I.const]:o.TTemplateLiteral(I)?(()=>{let C=z.ParseExact(I.pattern);if(!N.Check(C))throw new Z("Cannot resolve keys from infinite template expression");return[...D.Generate(C)]})():[]}l.Resolve=_})(K||(e.KeyArrayResolver=K={}));var B;(function(l){function*_(C){for(let R of C.anyOf)R[e.Kind]==="Union"?yield*_(R):yield R}function I(C){return e.Type.Union([..._(C)],{...C})}l.Resolve=I})(B||(e.UnionResolver=B={}));var V=class extends n{};e.TemplateLiteralPatternError=V;var q;(function(l){function _(E){throw new V(E)}function I(E){return E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(E,y){return o.TTemplateLiteral(E)?E.pattern.slice(1,E.pattern.length-1):o.TUnion(E)?`(${E.anyOf.map(w=>C(w,y)).join("|")})`:o.TNumber(E)?`${y}${e.PatternNumber}`:o.TInteger(E)?`${y}${e.PatternNumber}`:o.TBigInt(E)?`${y}${e.PatternNumber}`:o.TString(E)?`${y}${e.PatternString}`:o.TLiteral(E)?`${y}${I(E.const.toString())}`:o.TBoolean(E)?`${y}${e.PatternBoolean}`:_(`Unexpected Kind '${E[e.Kind]}'`)}function R(E){return`^${E.map(y=>C(y,"")).join("")}$`}l.Create=R})(q||(e.TemplateLiteralPattern=q={}));var F;(function(l){function _(I){let C=z.ParseExact(I.pattern);if(!N.Check(C))return e.Type.String();let R=[...D.Generate(C)].map(E=>e.Type.Literal(E));return e.Type.Union(R)}l.Resolve=_})(F||(e.TemplateLiteralResolver=F={}));var ee=class extends n{};e.TemplateLiteralParserError=ee;var z;(function(l){function _(S,k,Q){return S[k]===Q&&S.charCodeAt(k-1)!==92}function I(S,k){return _(S,k,"(")}function C(S,k){return _(S,k,")")}function R(S,k){return _(S,k,"|")}function E(S){if(!(I(S,0)&&C(S,S.length-1)))return!1;let k=0;for(let Q=0;Q<S.length;Q++)if(I(S,Q)&&(k+=1),C(S,Q)&&(k-=1),k===0&&Q!==S.length-1)return!1;return!0}function y(S){return S.slice(1,S.length-1)}function w(S){let k=0;for(let Q=0;Q<S.length;Q++)if(I(S,Q)&&(k+=1),C(S,Q)&&(k-=1),R(S,Q)&&k===0)return!0;return!1}function T(S){for(let k=0;k<S.length;k++)if(I(S,k))return!0;return!1}function a(S){let[k,Q]=[0,0],te=[];for(let ge=0;ge<S.length;ge++)if(I(S,ge)&&(k+=1),C(S,ge)&&(k-=1),R(S,ge)&&k===0){let Ie=S.slice(Q,ge);Ie.length>0&&te.push(v(Ie)),Q=ge+1}let pe=S.slice(Q);return pe.length>0&&te.push(v(pe)),te.length===0?{type:"const",const:""}:te.length===1?te[0]:{type:"or",expr:te}}function O(S){function k(pe,ge){if(!I(pe,ge))throw new ee("TemplateLiteralParser: Index must point to open parens");let Ie=0;for(let Re=ge;Re<pe.length;Re++)if(I(pe,Re)&&(Ie+=1),C(pe,Re)&&(Ie-=1),Ie===0)return[ge,Re];throw new ee("TemplateLiteralParser: Unclosed group parens in expression")}function Q(pe,ge){for(let Ie=ge;Ie<pe.length;Ie++)if(I(pe,Ie))return[ge,Ie];return[ge,pe.length]}let te=[];for(let pe=0;pe<S.length;pe++)if(I(S,pe)){let[ge,Ie]=k(S,pe),Re=S.slice(ge,Ie+1);te.push(v(Re)),pe=Ie}else{let[ge,Ie]=Q(S,pe),Re=S.slice(ge,Ie);Re.length>0&&te.push(v(Re)),pe=Ie-1}return te.length===0?{type:"const",const:""}:te.length===1?te[0]:{type:"and",expr:te}}function v(S){return E(S)?v(y(S)):w(S)?a(S):T(S)?O(S):{type:"const",const:S}}l.Parse=v;function m(S){return v(S.slice(1,S.length-1))}l.ParseExact=m})(z||(e.TemplateLiteralParser=z={}));var fe=class extends n{};e.TemplateLiteralFiniteError=fe;var N;(function(l){function _(y){throw new fe(y)}function I(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="0"&&y.expr[1].type==="const"&&y.expr[1].const==="[1-9][0-9]*"}function C(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="true"&&y.expr[1].type==="const"&&y.expr[1].const==="false"}function R(y){return y.type==="const"&&y.const===".*"}function E(y){return C(y)?!0:I(y)||R(y)?!1:y.type==="and"?y.expr.every(w=>E(w)):y.type==="or"?y.expr.every(w=>E(w)):y.type==="const"?!0:_("Unknown expression type")}l.Check=E})(N||(e.TemplateLiteralFinite=N={}));var x=class extends n{};e.TemplateLiteralGeneratorError=x;var D;(function(l){function*_(y){if(y.length===1)return yield*y[0];for(let w of y[0])for(let T of _(y.slice(1)))yield`${w}${T}`}function*I(y){return yield*_(y.expr.map(w=>[...E(w)]))}function*C(y){for(let w of y.expr)yield*E(w)}function*R(y){return yield y.const}function*E(y){return y.type==="and"?yield*I(y):y.type==="or"?yield*C(y):y.type==="const"?yield*R(y):(()=>{throw new x("Unknown expression")})()}l.Generate=E})(D||(e.TemplateLiteralGenerator=D={}));var Y;(function(l){function*_(E){let y=E.trim().replace(/"|'/g,"");return y==="boolean"?yield e.Type.Boolean():y==="number"?yield e.Type.Number():y==="bigint"?yield e.Type.BigInt():y==="string"?yield e.Type.String():yield(()=>{let w=y.split("|").map(T=>e.Type.Literal(T.trim()));return w.length===0?e.Type.Never():w.length===1?w[0]:e.Type.Union(w)})()}function*I(E){if(E[1]!=="{"){let y=e.Type.Literal("$"),w=C(E.slice(1));return yield*[y,...w]}for(let y=2;y<E.length;y++)if(E[y]==="}"){let w=_(E.slice(2,y)),T=C(E.slice(y+1));return yield*[...w,...T]}yield e.Type.Literal(E)}function*C(E){for(let y=0;y<E.length;y++)if(E[y]==="$"){let w=e.Type.Literal(E.slice(0,y)),T=I(E.slice(y));return yield*[w,...T]}yield e.Type.Literal(E)}function R(E){return[...C(E)]}l.Parse=R})(Y||(e.TemplateLiteralDslParser=Y={}));var ie=class{constructor(l){this.schema=l}Decode(l){return new X(this.schema,l)}};e.TransformDecodeBuilder=ie;var X=class{constructor(l,_){this.schema=l,this.decode=_}Encode(l){let _=b.Type(this.schema);return o.TTransform(_)?(()=>{let R={Encode:E=>_[e.Transform].Encode(l(E)),Decode:E=>this.decode(_[e.Transform].Decode(E))};return{..._,[e.Transform]:R}})():(()=>{let I={Decode:this.decode,Encode:l};return{..._,[e.Transform]:I}})()}};e.TransformEncodeBuilder=X;var se=0,j=class extends n{};e.TypeBuilderError=j;var G=class{Create(l){return l}Throw(l){throw new j(l)}Discard(l,_){return _.reduce((I,C)=>{let{[C]:R,...E}=I;return E},l)}Strict(l){return JSON.parse(JSON.stringify(l))}};e.TypeBuilder=G;var J=class extends G{ReadonlyOptional(l){return this.Readonly(this.Optional(l))}Readonly(l){return{...b.Type(l),[e.Readonly]:"Readonly"}}Optional(l){return{...b.Type(l),[e.Optional]:"Optional"}}Any(l={}){return this.Create({...l,[e.Kind]:"Any"})}Array(l,_={}){return this.Create({..._,[e.Kind]:"Array",type:"array",items:b.Type(l)})}Boolean(l={}){return this.Create({...l,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(l,_={}){return{...$.Map(b.Type(l),"Capitalize"),..._}}Composite(l,_){let I=e.Type.Intersect(l,{}),R=H.ResolveKeys(I,{includePatterns:!1}).reduce((E,y)=>({...E,[y]:e.Type.Index(I,[y])}),{});return e.Type.Object(R,_)}Enum(l,_={}){if(i.IsUndefined(l))return this.Throw("Enum undefined or empty");let I=Object.getOwnPropertyNames(l).filter(E=>isNaN(E)).map(E=>l[E]),R=[...new Set(I)].map(E=>e.Type.Literal(E));return this.Union(R,{..._,[e.Hint]:"Enum"})}Extends(l,_,I,C,R={}){switch(g.Extends(l,_)){case c.Union:return this.Union([b.Type(I,R),b.Type(C,R)]);case c.True:return b.Type(I,R);case c.False:return b.Type(C,R)}}Exclude(l,_,I={}){return o.TTemplateLiteral(l)?this.Exclude(F.Resolve(l),_,I):o.TTemplateLiteral(_)?this.Exclude(l,F.Resolve(_),I):o.TUnion(l)?(()=>{let C=l.anyOf.filter(R=>g.Extends(R,_)===c.False);return C.length===1?b.Type(C[0],I):this.Union(C,I)})():g.Extends(l,_)!==c.False?this.Never(I):b.Type(l,I)}Extract(l,_,I={}){return o.TTemplateLiteral(l)?this.Extract(F.Resolve(l),_,I):o.TTemplateLiteral(_)?this.Extract(l,F.Resolve(_),I):o.TUnion(l)?(()=>{let C=l.anyOf.filter(R=>g.Extends(R,_)!==c.False);return C.length===1?b.Type(C[0],I):this.Union(C,I)})():g.Extends(l,_)!==c.False?b.Type(l,I):this.Never(I)}Index(l,_,I={}){return o.TArray(l)&&o.TNumber(_)?b.Type(l.items,I):o.TTuple(l)&&o.TNumber(_)?(()=>{let R=(i.IsUndefined(l.items)?[]:l.items).map(E=>b.Type(E));return this.Union(R,I)})():(()=>{let C=K.Resolve(_),R=b.Type(l);return M.Resolve(R,C,I)})()}Integer(l={}){return this.Create({...l,[e.Kind]:"Integer",type:"integer"})}Intersect(l,_={}){if(l.length===0)return e.Type.Never();if(l.length===1)return b.Type(l[0],_);l.some(E=>o.TTransform(E))&&this.Throw("Cannot intersect transform types");let I=l.every(E=>o.TObject(E)),C=b.Rest(l),R=o.TSchema(_.unevaluatedProperties)?{unevaluatedProperties:b.Type(_.unevaluatedProperties)}:{};return _.unevaluatedProperties===!1||o.TSchema(_.unevaluatedProperties)||I?this.Create({..._,...R,[e.Kind]:"Intersect",type:"object",allOf:C}):this.Create({..._,...R,[e.Kind]:"Intersect",allOf:C})}KeyOf(l,_={}){return o.TRecord(l)?(()=>{let I=Object.getOwnPropertyNames(l.patternProperties)[0];return I===e.PatternNumberExact?this.Number(_):I===e.PatternStringExact?this.String(_):this.Throw("Unable to resolve key type from Record key pattern")})():o.TTuple(l)?(()=>{let C=(i.IsUndefined(l.items)?[]:l.items).map((R,E)=>e.Type.Literal(E.toString()));return this.Union(C,_)})():o.TArray(l)?this.Number(_):(()=>{let I=H.ResolveKeys(l,{includePatterns:!1});if(I.length===0)return this.Never(_);let C=I.map(R=>this.Literal(R));return this.Union(C,_)})()}Literal(l,_={}){return this.Create({..._,[e.Kind]:"Literal",const:l,type:typeof l})}Lowercase(l,_={}){return{...$.Map(b.Type(l),"Lowercase"),..._}}Never(l={}){return this.Create({...l,[e.Kind]:"Never",not:{}})}Not(l,_){return this.Create({..._,[e.Kind]:"Not",not:b.Type(l)})}Null(l={}){return this.Create({...l,[e.Kind]:"Null",type:"null"})}Number(l={}){return this.Create({...l,[e.Kind]:"Number",type:"number"})}Object(l,_={}){let I=Object.getOwnPropertyNames(l),C=I.filter(w=>o.TOptional(l[w])),R=I.filter(w=>!C.includes(w)),E=o.TSchema(_.additionalProperties)?{additionalProperties:b.Type(_.additionalProperties)}:{},y=I.reduce((w,T)=>({...w,[T]:b.Type(l[T])}),{});return R.length>0?this.Create({..._,...E,[e.Kind]:"Object",type:"object",properties:y,required:R}):this.Create({..._,...E,[e.Kind]:"Object",type:"object",properties:y})}Omit(l,_,I={}){let C=K.Resolve(_);return L.Map(this.Discard(b.Type(l),["$id",e.Transform]),R=>{i.IsArray(R.required)&&(R.required=R.required.filter(E=>!C.includes(E)),R.required.length===0&&delete R.required);for(let E of Object.getOwnPropertyNames(R.properties))C.includes(E)&&delete R.properties[E];return this.Create(R)},I)}Partial(l,_={}){return L.Map(this.Discard(b.Type(l),["$id",e.Transform]),I=>{let C=Object.getOwnPropertyNames(I.properties).reduce((R,E)=>({...R,[E]:this.Optional(I.properties[E])}),{});return this.Object(C,this.Discard(I,["required"]))},_)}Pick(l,_,I={}){let C=K.Resolve(_);return L.Map(this.Discard(b.Type(l),["$id",e.Transform]),R=>{i.IsArray(R.required)&&(R.required=R.required.filter(E=>C.includes(E)),R.required.length===0&&delete R.required);for(let E of Object.getOwnPropertyNames(R.properties))C.includes(E)||delete R.properties[E];return this.Create(R)},I)}Record(l,_,I={}){return o.TTemplateLiteral(l)?(()=>{let C=z.ParseExact(l.pattern);return N.Check(C)?this.Object([...D.Generate(C)].reduce((R,E)=>({...R,[E]:b.Type(_)}),{}),I):this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[l.pattern]:b.Type(_)}})})():o.TUnion(l)?(()=>{let C=B.Resolve(l);if(o.TUnionLiteral(C)){let R=C.anyOf.reduce((E,y)=>({...E,[y.const]:b.Type(_)}),{});return this.Object(R,{...I,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():o.TLiteral(l)?i.IsString(l.const)||i.IsNumber(l.const)?this.Object({[l.const]:b.Type(_)},I):this.Throw("Record key of type literal is not of type string or number"):o.TInteger(l)||o.TNumber(l)?this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:b.Type(_)}}):o.TString(l)?(()=>{let C=i.IsUndefined(l.pattern)?e.PatternStringExact:l.pattern;return this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[C]:b.Type(_)}})})():this.Never()}Recursive(l,_={}){i.IsUndefined(_.$id)&&(_.$id=`T${se++}`);let I=l({[e.Kind]:"This",$ref:`${_.$id}`});return I.$id=_.$id,this.Create({..._,[e.Hint]:"Recursive",...I})}Ref(l,_={}){return i.IsString(l)?this.Create({..._,[e.Kind]:"Ref",$ref:l}):(i.IsUndefined(l.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({..._,[e.Kind]:"Ref",$ref:l.$id}))}Required(l,_={}){return L.Map(this.Discard(b.Type(l),["$id",e.Transform]),I=>{let C=Object.getOwnPropertyNames(I.properties).reduce((R,E)=>({...R,[E]:this.Discard(I.properties[E],[e.Optional])}),{});return this.Object(C,I)},_)}Rest(l){return o.TTuple(l)&&!i.IsUndefined(l.items)?b.Rest(l.items):o.TIntersect(l)?b.Rest(l.allOf):o.TUnion(l)?b.Rest(l.anyOf):[]}String(l={}){return this.Create({...l,[e.Kind]:"String",type:"string"})}TemplateLiteral(l,_={}){let I=i.IsString(l)?q.Create(Y.Parse(l)):q.Create(l);return this.Create({..._,[e.Kind]:"TemplateLiteral",type:"string",pattern:I})}Transform(l){return new ie(l)}Tuple(l,_={}){let[I,C,R]=[!1,l.length,l.length],E=b.Rest(l),y=l.length>0?{..._,[e.Kind]:"Tuple",type:"array",items:E,additionalItems:I,minItems:C,maxItems:R}:{..._,[e.Kind]:"Tuple",type:"array",minItems:C,maxItems:R};return this.Create(y)}Uncapitalize(l,_={}){return{...$.Map(b.Type(l),"Uncapitalize"),..._}}Union(l,_={}){return o.TTemplateLiteral(l)?F.Resolve(l):(()=>{let I=l;if(I.length===0)return this.Never(_);if(I.length===1)return this.Create(b.Type(I[0],_));let C=b.Rest(I);return this.Create({..._,[e.Kind]:"Union",anyOf:C})})()}Unknown(l={}){return this.Create({...l,[e.Kind]:"Unknown"})}Unsafe(l={}){return this.Create({...l,[e.Kind]:l[e.Kind]||"Unsafe"})}Uppercase(l,_={}){return{...$.Map(b.Type(l),"Uppercase"),..._}}};e.JsonTypeBuilder=J;var le=class extends J{AsyncIterator(l,_={}){return this.Create({..._,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:b.Type(l)})}Awaited(l,_={}){let I=C=>C.length>0?(()=>{let[R,...E]=C;return[this.Awaited(R),...I(E)]})():C;return o.TIntersect(l)?e.Type.Intersect(I(l.allOf)):o.TUnion(l)?e.Type.Union(I(l.anyOf)):o.TPromise(l)?this.Awaited(l.item):b.Type(l,_)}BigInt(l={}){return this.Create({...l,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(l,_={}){return this.Tuple([...l.parameters],{..._})}Constructor(l,_,I){let[C,R]=[b.Rest(l),b.Type(_)];return this.Create({...I,[e.Kind]:"Constructor",type:"Constructor",parameters:C,returns:R})}Date(l={}){return this.Create({...l,[e.Kind]:"Date",type:"Date"})}Function(l,_,I){let[C,R]=[b.Rest(l),b.Type(_)];return this.Create({...I,[e.Kind]:"Function",type:"Function",parameters:C,returns:R})}InstanceType(l,_={}){return b.Type(l.returns,_)}Iterator(l,_={}){return this.Create({..._,[e.Kind]:"Iterator",type:"Iterator",items:b.Type(l)})}Parameters(l,_={}){return this.Tuple(l.parameters,{..._})}Promise(l,_={}){return this.Create({..._,[e.Kind]:"Promise",type:"Promise",item:b.Type(l)})}RegExp(l,_={}){let I=i.IsString(l)?l:l.source;return this.Create({..._,[e.Kind]:"String",type:"string",pattern:I})}RegEx(l,_={}){return this.RegExp(l,_)}ReturnType(l,_={}){return b.Type(l.returns,_)}Symbol(l){return this.Create({...l,[e.Kind]:"Symbol",type:"symbol"})}Undefined(l={}){return this.Create({...l,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(l={}){return this.Create({...l,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(l={}){return this.Create({...l,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=le,e.JsonType=new J,e.Type=new le}}),Un=qt(Lt(),1),{String:dd,Optional:pd,Boolean:yd,Object:hd,Number:gd}=Un.Type,md=dd.bind(Un.Type),bd=gd.bind(Un.Type),pw=hd.bind(Un.Type),yw=pd.bind(Un.Type),vd=yd.bind(Un.Type),hw=md(),gw=bd(),mw=vd();function Oa(e){return Array.isArray(e)?e:[e]}var _d=De({"../../../node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},n=typeof window<"u"&&typeof window.document<"u",r=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,i=(typeof self>"u"?"undefined":t(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",s=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),o=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";e.isBrowser=n,e.isWebWorker=i,e.isNode=r,e.isJsDom=s,e.isDeno=o}}),Td=De({"../../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(e,t){"use strict";t.exports=function(n,r){r||(r={}),typeof r=="function"&&(r={cmp:r});var i=typeof r.cycles=="boolean"?r.cycles:!1,s=r.cmp&&(function(u){return function(f){return function(c,g){var b={key:c,value:f[c]},M={key:g,value:f[g]};return u(b,M)}}})(r.cmp),o=[];return(function u(f){if(f&&f.toJSON&&typeof f.toJSON=="function"&&(f=f.toJSON()),f!==void 0){if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!="object")return JSON.stringify(f);var c,g;if(Array.isArray(f)){for(g="[",c=0;c<f.length;c++)c&&(g+=","),g+=u(f[c])||"null";return g+"]"}if(f===null)return"null";if(o.indexOf(f)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var b=o.push(f)-1,M=Object.keys(f).sort(s&&s(f));for(g="",c=0;c<M.length;c++){var $=M[c],L=u(f[$]);L&&(g&&(g+=","),g+=JSON.stringify($)+":"+L)}return o.splice(b,1),"{"+g+"}"}})(n)}}}),wd=De({"../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(e,t){"use strict";var{hasOwnProperty:n}=Object.prototype,r=K();r.configure=K,r.stringify=r,r.default=r,e.stringify=r,e.configure=K,t.exports=r;var i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function s(B){return B.length<5e3&&!i.test(B)?`"${B}"`:JSON.stringify(B)}function o(B,V){if(B.length>200||V)return B.sort(V);for(let q=1;q<B.length;q++){let F=B[q],ee=q;for(;ee!==0&&B[ee-1]>F;)B[ee]=B[ee-1],ee--;B[ee]=F}return B}var u=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function f(B){return u.call(B)!==void 0&&B.length!==0}function c(B,V,q){B.length<q&&(q=B.length);let F=V===","?"":" ",ee=`"0":${F}${B[0]}`;for(let z=1;z<q;z++)ee+=`${V}"${z}":${F}${B[z]}`;return ee}function g(B){if(n.call(B,"circularValue")){let V=B.circularValue;if(typeof V=="string")return`"${V}"`;if(V==null)return V;if(V===Error||V===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function b(B){let V;if(n.call(B,"deterministic")&&(V=B.deterministic,typeof V!="boolean"&&typeof V!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return V===void 0?!0:V}function M(B,V){let q;if(n.call(B,V)&&(q=B[V],typeof q!="boolean"))throw new TypeError(`The "${V}" argument must be of type boolean`);return q===void 0?!0:q}function $(B,V){let q;if(n.call(B,V)){if(q=B[V],typeof q!="number")throw new TypeError(`The "${V}" argument must be of type number`);if(!Number.isInteger(q))throw new TypeError(`The "${V}" argument must be an integer`);if(q<1)throw new RangeError(`The "${V}" argument must be >= 1`)}return q===void 0?1/0:q}function L(B){return B===1?"1 item":`${B} items`}function H(B){let V=new Set;for(let q of B)(typeof q=="string"||typeof q=="number")&&V.add(String(q));return V}function Z(B){if(n.call(B,"strict")){let V=B.strict;if(typeof V!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(V)return q=>{let F=`Object can not safely be stringified. Received type ${typeof q}`;throw typeof q!="function"&&(F+=` (${q.toString()})`),new Error(F)}}}function K(B){B={...B};let V=Z(B);V&&(B.bigint===void 0&&(B.bigint=!1),"circularValue"in B||(B.circularValue=Error));let q=g(B),F=M(B,"bigint"),ee=b(B),z=typeof ee=="function"?ee:void 0,fe=$(B,"maximumDepth"),N=$(B,"maximumBreadth");function x(se,j,G,J,le,l){let _=j[se];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(se)),_=J.call(j,se,_),typeof _){case"string":return s(_);case"object":{if(_===null)return"null";if(G.indexOf(_)!==-1)return q;let I="",C=",",R=l;if(Array.isArray(_)){if(_.length===0)return"[]";if(fe<G.length+1)return'"[Array]"';G.push(_),le!==""&&(l+=le,I+=`
31
+ ${l}`,C=`,
32
+ ${l}`);let O=Math.min(_.length,N),v=0;for(;v<O-1;v++){let S=x(String(v),_,G,J,le,l);I+=S!==void 0?S:"null",I+=C}let m=x(String(v),_,G,J,le,l);if(I+=m!==void 0?m:"null",_.length-1>N){let S=_.length-N-1;I+=`${C}"... ${L(S)} not stringified"`}return le!==""&&(I+=`
33
+ ${R}`),G.pop(),`[${I}]`}let E=Object.keys(_),y=E.length;if(y===0)return"{}";if(fe<G.length+1)return'"[Object]"';let w="",T="";le!==""&&(l+=le,C=`,
34
+ ${l}`,w=" ");let a=Math.min(y,N);ee&&!f(_)&&(E=o(E,z)),G.push(_);for(let O=0;O<a;O++){let v=E[O],m=x(v,_,G,J,le,l);m!==void 0&&(I+=`${T}${s(v)}:${w}${m}`,T=C)}if(y>N){let O=y-N;I+=`${T}"...":${w}"${L(O)} not stringified"`,T=C}return le!==""&&T.length>1&&(I=`
35
+ ${l}${I}
36
+ ${R}`),G.pop(),`{${I}}`}case"number":return isFinite(_)?String(_):V?V(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(F)return String(_);default:return V?V(_):void 0}}function D(se,j,G,J,le,l){switch(typeof j=="object"&&j!==null&&typeof j.toJSON=="function"&&(j=j.toJSON(se)),typeof j){case"string":return s(j);case"object":{if(j===null)return"null";if(G.indexOf(j)!==-1)return q;let _=l,I="",C=",";if(Array.isArray(j)){if(j.length===0)return"[]";if(fe<G.length+1)return'"[Array]"';G.push(j),le!==""&&(l+=le,I+=`
37
+ ${l}`,C=`,
38
+ ${l}`);let y=Math.min(j.length,N),w=0;for(;w<y-1;w++){let a=D(String(w),j[w],G,J,le,l);I+=a!==void 0?a:"null",I+=C}let T=D(String(w),j[w],G,J,le,l);if(I+=T!==void 0?T:"null",j.length-1>N){let a=j.length-N-1;I+=`${C}"... ${L(a)} not stringified"`}return le!==""&&(I+=`
39
+ ${_}`),G.pop(),`[${I}]`}G.push(j);let R="";le!==""&&(l+=le,C=`,
40
+ ${l}`,R=" ");let E="";for(let y of J){let w=D(y,j[y],G,J,le,l);w!==void 0&&(I+=`${E}${s(y)}:${R}${w}`,E=C)}return le!==""&&E.length>1&&(I=`
41
+ ${l}${I}
42
+ ${_}`),G.pop(),`{${I}}`}case"number":return isFinite(j)?String(j):V?V(j):"null";case"boolean":return j===!0?"true":"false";case"undefined":return;case"bigint":if(F)return String(j);default:return V?V(j):void 0}}function Y(se,j,G,J,le){switch(typeof j){case"string":return s(j);case"object":{if(j===null)return"null";if(typeof j.toJSON=="function"){if(j=j.toJSON(se),typeof j!="object")return Y(se,j,G,J,le);if(j===null)return"null"}if(G.indexOf(j)!==-1)return q;let l=le;if(Array.isArray(j)){if(j.length===0)return"[]";if(fe<G.length+1)return'"[Array]"';G.push(j),le+=J;let w=`
43
+ ${le}`,T=`,
44
+ ${le}`,a=Math.min(j.length,N),O=0;for(;O<a-1;O++){let m=Y(String(O),j[O],G,J,le);w+=m!==void 0?m:"null",w+=T}let v=Y(String(O),j[O],G,J,le);if(w+=v!==void 0?v:"null",j.length-1>N){let m=j.length-N-1;w+=`${T}"... ${L(m)} not stringified"`}return w+=`
45
+ ${l}`,G.pop(),`[${w}]`}let _=Object.keys(j),I=_.length;if(I===0)return"{}";if(fe<G.length+1)return'"[Object]"';le+=J;let C=`,
46
+ ${le}`,R="",E="",y=Math.min(I,N);f(j)&&(R+=c(j,C,N),_=_.slice(j.length),y-=j.length,E=C),ee&&(_=o(_,z)),G.push(j);for(let w=0;w<y;w++){let T=_[w],a=Y(T,j[T],G,J,le);a!==void 0&&(R+=`${E}${s(T)}: ${a}`,E=C)}if(I>N){let w=I-N;R+=`${E}"...": "${L(w)} not stringified"`,E=C}return E!==""&&(R=`
47
+ ${le}${R}
48
+ ${l}`),G.pop(),`{${R}}`}case"number":return isFinite(j)?String(j):V?V(j):"null";case"boolean":return j===!0?"true":"false";case"undefined":return;case"bigint":if(F)return String(j);default:return V?V(j):void 0}}function ie(se,j,G){switch(typeof j){case"string":return s(j);case"object":{if(j===null)return"null";if(typeof j.toJSON=="function"){if(j=j.toJSON(se),typeof j!="object")return ie(se,j,G);if(j===null)return"null"}if(G.indexOf(j)!==-1)return q;let J="",le=j.length!==void 0;if(le&&Array.isArray(j)){if(j.length===0)return"[]";if(fe<G.length+1)return'"[Array]"';G.push(j);let R=Math.min(j.length,N),E=0;for(;E<R-1;E++){let w=ie(String(E),j[E],G);J+=w!==void 0?w:"null",J+=","}let y=ie(String(E),j[E],G);if(J+=y!==void 0?y:"null",j.length-1>N){let w=j.length-N-1;J+=`,"... ${L(w)} not stringified"`}return G.pop(),`[${J}]`}let l=Object.keys(j),_=l.length;if(_===0)return"{}";if(fe<G.length+1)return'"[Object]"';let I="",C=Math.min(_,N);le&&f(j)&&(J+=c(j,",",N),l=l.slice(j.length),C-=j.length,I=","),ee&&(l=o(l,z)),G.push(j);for(let R=0;R<C;R++){let E=l[R],y=ie(E,j[E],G);y!==void 0&&(J+=`${I}${s(E)}:${y}`,I=",")}if(_>N){let R=_-N;J+=`${I}"...":"${L(R)} not stringified"`}return G.pop(),`{${J}}`}case"number":return isFinite(j)?String(j):V?V(j):"null";case"boolean":return j===!0?"true":"false";case"undefined":return;case"bigint":if(F)return String(j);default:return V?V(j):void 0}}function X(se,j,G){if(arguments.length>1){let J="";if(typeof G=="number"?J=" ".repeat(Math.min(G,10)):typeof G=="string"&&(J=G.slice(0,10)),j!=null){if(typeof j=="function")return x("",{"":se},[],j,J,"");if(Array.isArray(j))return D("",se,[],H(j),J,"")}if(J.length!==0)return Y("",se,[],J,"")}return ie("",se,[])}return X}}}),Mn=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/guard.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IsValueType=e.IsSymbol=e.IsFunction=e.IsString=e.IsBigInt=e.IsInteger=e.IsNumber=e.IsBoolean=e.IsNull=e.IsUndefined=e.IsArray=e.IsObject=e.IsPlainObject=e.HasPropertyKey=e.IsDate=e.IsUint8Array=e.IsPromise=e.IsTypedArray=e.IsIterator=e.IsAsyncIterator=void 0;function t(F){return c(F)&&Symbol.asyncIterator in F}e.IsAsyncIterator=t;function n(F){return c(F)&&Symbol.iterator in F}e.IsIterator=n;function r(F){return ArrayBuffer.isView(F)}e.IsTypedArray=r;function i(F){return F instanceof Promise}e.IsPromise=i;function s(F){return F instanceof Uint8Array}e.IsUint8Array=s;function o(F){return F instanceof Date&&Number.isFinite(F.getTime())}e.IsDate=o;function u(F,ee){return ee in F}e.HasPropertyKey=u;function f(F){return c(F)&&B(F.constructor)&&F.constructor.name==="Object"}e.IsPlainObject=f;function c(F){return F!==null&&typeof F=="object"}e.IsObject=c;function g(F){return Array.isArray(F)&&!ArrayBuffer.isView(F)}e.IsArray=g;function b(F){return F===void 0}e.IsUndefined=b;function M(F){return F===null}e.IsNull=M;function $(F){return typeof F=="boolean"}e.IsBoolean=$;function L(F){return typeof F=="number"}e.IsNumber=L;function H(F){return L(F)&&Number.isInteger(F)}e.IsInteger=H;function Z(F){return typeof F=="bigint"}e.IsBigInt=Z;function K(F){return typeof F=="string"}e.IsString=K;function B(F){return typeof F=="function"}e.IsFunction=B;function V(F){return typeof F=="symbol"}e.IsSymbol=V;function q(F){return Z(F)||$(F)||M(F)||L(F)||K(F)||V(F)||b(F)}e.IsValueType=q}}),Pu=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/system.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultErrorFunction=e.TypeSystemPolicy=e.TypeSystemErrorFunction=e.TypeSystem=e.TypeSystemDuplicateFormat=e.TypeSystemDuplicateTypeKind=void 0;var t=Mn(),n=vi(),r=Lt(),i=class extends r.TypeBoxError{constructor(g){super(`Duplicate type kind '${g}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var s=class extends r.TypeBoxError{constructor(g){super(`Duplicate string format '${g}' detected`)}};e.TypeSystemDuplicateFormat=s;var o;(function(g){function b($,L){if(r.TypeRegistry.Has($))throw new i($);return r.TypeRegistry.Set($,L),(H={})=>r.Type.Unsafe({...H,[r.Kind]:$})}g.Type=b;function M($,L){if(r.FormatRegistry.Has($))throw new s($);return r.FormatRegistry.Set($,L),$}g.Format=M})(o||(e.TypeSystem=o={}));var u;(function(g){let b=c;function M(){b=c}g.Reset=M;function $(H){b=H}g.Set=$;function L(){return b}g.Get=L})(u||(e.TypeSystemErrorFunction=u={}));var f;(function(g){g.ExactOptionalPropertyTypes=!1,g.AllowArrayObject=!1,g.AllowNaN=!1,g.AllowNullVoid=!1;function b(Z,K){return g.ExactOptionalPropertyTypes?K in Z:Z[K]!==void 0}g.IsExactOptionalProperty=b;function M(Z){let K=(0,t.IsObject)(Z);return g.AllowArrayObject?K:K&&!(0,t.IsArray)(Z)}g.IsObjectLike=M;function $(Z){return M(Z)&&!(Z instanceof Date)&&!(Z instanceof Uint8Array)}g.IsRecordLike=$;function L(Z){let K=(0,t.IsNumber)(Z);return g.AllowNaN?K:K&&Number.isFinite(Z)}g.IsNumberLike=L;function H(Z){let K=(0,t.IsUndefined)(Z);return g.AllowNullVoid?K||Z===null:K}g.IsVoidLike=H})(f||(e.TypeSystemPolicy=f={}));function c(g,b){switch(b){case n.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case n.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${g.maxContains} matching values`;case n.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${g.minContains} matching values`;case n.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${g.maxItems}`;case n.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${g.minItems}`;case n.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case n.ValueErrorType.Array:return"Expected array";case n.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case n.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${g.exclusiveMaximum}`;case n.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${g.exclusiveMinimum}`;case n.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${g.maximum}`;case n.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${g.minimum}`;case n.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${g.multipleOf}`;case n.ValueErrorType.BigInt:return"Expected bigint";case n.ValueErrorType.Boolean:return"Expected boolean";case n.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${g.exclusiveMinimumTimestamp}`;case n.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${g.exclusiveMaximumTimestamp}`;case n.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${g.minimumTimestamp}`;case n.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${g.maximumTimestamp}`;case n.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${g.multipleOfTimestamp}`;case n.ValueErrorType.Date:return"Expected Date";case n.ValueErrorType.Function:return"Expected function";case n.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${g.exclusiveMaximum}`;case n.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${g.exclusiveMinimum}`;case n.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${g.maximum}`;case n.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${g.minimum}`;case n.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${g.multipleOf}`;case n.ValueErrorType.Integer:return"Expected integer";case n.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case n.ValueErrorType.Intersect:return"Expected all values to match";case n.ValueErrorType.Iterator:return"Expected Iterator";case n.ValueErrorType.Literal:return`Expected ${typeof g.const=="string"?`'${g.const}'`:g.const}`;case n.ValueErrorType.Never:return"Never";case n.ValueErrorType.Not:return"Value should not match";case n.ValueErrorType.Null:return"Expected null";case n.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${g.exclusiveMaximum}`;case n.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${g.exclusiveMinimum}`;case n.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${g.maximum}`;case n.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${g.minimum}`;case n.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${g.multipleOf}`;case n.ValueErrorType.Number:return"Expected number";case n.ValueErrorType.Object:return"Expected object";case n.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case n.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${g.maxProperties} properties`;case n.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${g.minProperties} properties`;case n.ValueErrorType.ObjectRequiredProperty:return"Required property";case n.ValueErrorType.Promise:return"Expected Promise";case n.ValueErrorType.StringFormatUnknown:return`Unknown format '${g.format}'`;case n.ValueErrorType.StringFormat:return`Expected string to match '${g.format}' format`;case n.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${g.maxLength}`;case n.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${g.minLength}`;case n.ValueErrorType.StringPattern:return`Expected string to match '${g.pattern}'`;case n.ValueErrorType.String:return"Expected string";case n.ValueErrorType.Symbol:return"Expected symbol";case n.ValueErrorType.TupleLength:return`Expected tuple to have ${g.maxItems||0} elements`;case n.ValueErrorType.Tuple:return"Expected tuple";case n.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${g.maxByteLength}`;case n.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${g.minByteLength}`;case n.ValueErrorType.Uint8Array:return"Expected Uint8Array";case n.ValueErrorType.Undefined:return"Expected undefined";case n.ValueErrorType.Union:return"Expected union value";case n.ValueErrorType.Void:return"Expected void";case n.ValueErrorType.Kind:return`Expected kind '${g[r.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=c}}),bi=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/deref.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Deref=e.TypeDereferenceError=void 0;var t=Lt(),n=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=n;function r(i,s){let o=s.findIndex(u=>u.$id===i.$ref);if(o===-1)throw new n(i);return s[o]}e.Deref=r}}),Do=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/hash.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.ByteMarker=e.ValueHashError=void 0;var t=Mn(),n=class extends Error{constructor(x){super("Unable to hash value"),this.value=x}};e.ValueHashError=n;var r;(function(x){x[x.Undefined=0]="Undefined",x[x.Null=1]="Null",x[x.Boolean=2]="Boolean",x[x.Number=3]="Number",x[x.String=4]="String",x[x.Object=5]="Object",x[x.Array=6]="Array",x[x.Date=7]="Date",x[x.Uint8Array=8]="Uint8Array",x[x.Symbol=9]="Symbol",x[x.BigInt=10]="BigInt"})(r||(e.ByteMarker=r={}));var i=BigInt("14695981039346656037"),[s,o]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],u=Array.from({length:256}).map((x,D)=>BigInt(D)),f=new Float64Array(1),c=new DataView(f.buffer),g=new Uint8Array(f.buffer);function*b(x){let D=x===0?1:Math.ceil(Math.floor(Math.log2(x)+1)/8);for(let Y=0;Y<D;Y++)yield x>>8*(D-1-Y)&255}function M(x){fe(r.Array);for(let D of x)z(D)}function $(x){fe(r.Boolean),fe(x?1:0)}function L(x){fe(r.BigInt),c.setBigInt64(0,x);for(let D of g)fe(D)}function H(x){fe(r.Date),z(x.getTime())}function Z(x){fe(r.Null)}function K(x){fe(r.Number),c.setFloat64(0,x);for(let D of g)fe(D)}function B(x){fe(r.Object);for(let D of globalThis.Object.keys(x).sort())z(D),z(x[D])}function V(x){fe(r.String);for(let D=0;D<x.length;D++)for(let Y of b(x.charCodeAt(D)))fe(Y)}function q(x){fe(r.Symbol),z(x.description)}function F(x){fe(r.Uint8Array);for(let D=0;D<x.length;D++)fe(x[D])}function ee(x){return fe(r.Undefined)}function z(x){if((0,t.IsArray)(x))return M(x);if((0,t.IsBoolean)(x))return $(x);if((0,t.IsBigInt)(x))return L(x);if((0,t.IsDate)(x))return H(x);if((0,t.IsNull)(x))return Z(x);if((0,t.IsNumber)(x))return K(x);if((0,t.IsPlainObject)(x))return B(x);if((0,t.IsString)(x))return V(x);if((0,t.IsSymbol)(x))return q(x);if((0,t.IsUint8Array)(x))return F(x);if((0,t.IsUndefined)(x))return ee(x);throw new n(x)}function fe(x){i=i^u[x],i=i*s%o}function N(x){return i=BigInt("14695981039346656037"),z(x),i}e.Hash=N}}),vi=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/errors.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Errors=e.ValueErrorIterator=e.EscapeKey=e.ValueErrorsUnknownTypeError=e.ValueErrorType=void 0;var t=Mn(),n=Pu(),r=bi(),i=Do(),s=Lt(),o;(function(a){a[a.ArrayContains=0]="ArrayContains",a[a.ArrayMaxContains=1]="ArrayMaxContains",a[a.ArrayMaxItems=2]="ArrayMaxItems",a[a.ArrayMinContains=3]="ArrayMinContains",a[a.ArrayMinItems=4]="ArrayMinItems",a[a.ArrayUniqueItems=5]="ArrayUniqueItems",a[a.Array=6]="Array",a[a.AsyncIterator=7]="AsyncIterator",a[a.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",a[a.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",a[a.BigIntMaximum=10]="BigIntMaximum",a[a.BigIntMinimum=11]="BigIntMinimum",a[a.BigIntMultipleOf=12]="BigIntMultipleOf",a[a.BigInt=13]="BigInt",a[a.Boolean=14]="Boolean",a[a.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",a[a.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",a[a.DateMaximumTimestamp=17]="DateMaximumTimestamp",a[a.DateMinimumTimestamp=18]="DateMinimumTimestamp",a[a.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",a[a.Date=20]="Date",a[a.Function=21]="Function",a[a.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",a[a.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",a[a.IntegerMaximum=24]="IntegerMaximum",a[a.IntegerMinimum=25]="IntegerMinimum",a[a.IntegerMultipleOf=26]="IntegerMultipleOf",a[a.Integer=27]="Integer",a[a.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",a[a.Intersect=29]="Intersect",a[a.Iterator=30]="Iterator",a[a.Kind=31]="Kind",a[a.Literal=32]="Literal",a[a.Never=33]="Never",a[a.Not=34]="Not",a[a.Null=35]="Null",a[a.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",a[a.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",a[a.NumberMaximum=38]="NumberMaximum",a[a.NumberMinimum=39]="NumberMinimum",a[a.NumberMultipleOf=40]="NumberMultipleOf",a[a.Number=41]="Number",a[a.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",a[a.ObjectMaxProperties=43]="ObjectMaxProperties",a[a.ObjectMinProperties=44]="ObjectMinProperties",a[a.ObjectRequiredProperty=45]="ObjectRequiredProperty",a[a.Object=46]="Object",a[a.Promise=47]="Promise",a[a.StringFormatUnknown=48]="StringFormatUnknown",a[a.StringFormat=49]="StringFormat",a[a.StringMaxLength=50]="StringMaxLength",a[a.StringMinLength=51]="StringMinLength",a[a.StringPattern=52]="StringPattern",a[a.String=53]="String",a[a.Symbol=54]="Symbol",a[a.TupleLength=55]="TupleLength",a[a.Tuple=56]="Tuple",a[a.Uint8ArrayMaxByteLength=57]="Uint8ArrayMaxByteLength",a[a.Uint8ArrayMinByteLength=58]="Uint8ArrayMinByteLength",a[a.Uint8Array=59]="Uint8Array",a[a.Undefined=60]="Undefined",a[a.Union=61]="Union",a[a.Void=62]="Void"})(o||(e.ValueErrorType=o={}));var u=class extends s.TypeBoxError{constructor(a){super("Unknown type"),this.schema=a}};e.ValueErrorsUnknownTypeError=u;function f(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=f;function c(a){return a!==void 0}var g=class{constructor(a){this.iterator=a}[Symbol.iterator](){return this.iterator}First(){let a=this.iterator.next();return a.done?void 0:a.value}};e.ValueErrorIterator=g;function b(a,O,v,m){return{type:a,schema:O,path:v,value:m,message:n.TypeSystemErrorFunction.Get()(O,a)}}function*M(a,O,v,m){}function*$(a,O,v,m){if(!(0,t.IsArray)(m))return yield b(o.Array,a,v,m);c(a.minItems)&&!(m.length>=a.minItems)&&(yield b(o.ArrayMinItems,a,v,m)),c(a.maxItems)&&!(m.length<=a.maxItems)&&(yield b(o.ArrayMaxItems,a,v,m));for(let Q=0;Q<m.length;Q++)yield*w(a.items,O,`${v}/${Q}`,m[Q]);if(a.uniqueItems===!0&&!(function(){let Q=new Set;for(let te of m){let pe=(0,i.Hash)(te);if(Q.has(pe))return!1;Q.add(pe)}return!0})()&&(yield b(o.ArrayUniqueItems,a,v,m)),!(c(a.contains)||c(a.minContains)||c(a.maxContains)))return;let S=c(a.contains)?a.contains:s.Type.Never(),k=m.reduce((Q,te,pe)=>w(S,O,`${v}${pe}`,te).next().done===!0?Q+1:Q,0);k===0&&(yield b(o.ArrayContains,a,v,m)),(0,t.IsNumber)(a.minContains)&&k<a.minContains&&(yield b(o.ArrayMinContains,a,v,m)),(0,t.IsNumber)(a.maxContains)&&k>a.maxContains&&(yield b(o.ArrayMaxContains,a,v,m))}function*L(a,O,v,m){(0,t.IsAsyncIterator)(m)||(yield b(o.AsyncIterator,a,v,m))}function*H(a,O,v,m){if(!(0,t.IsBigInt)(m))return yield b(o.BigInt,a,v,m);c(a.exclusiveMaximum)&&!(m<a.exclusiveMaximum)&&(yield b(o.BigIntExclusiveMaximum,a,v,m)),c(a.exclusiveMinimum)&&!(m>a.exclusiveMinimum)&&(yield b(o.BigIntExclusiveMinimum,a,v,m)),c(a.maximum)&&!(m<=a.maximum)&&(yield b(o.BigIntMaximum,a,v,m)),c(a.minimum)&&!(m>=a.minimum)&&(yield b(o.BigIntMinimum,a,v,m)),c(a.multipleOf)&&m%a.multipleOf!==BigInt(0)&&(yield b(o.BigIntMultipleOf,a,v,m))}function*Z(a,O,v,m){(0,t.IsBoolean)(m)||(yield b(o.Boolean,a,v,m))}function*K(a,O,v,m){yield*w(a.returns,O,v,m.prototype)}function*B(a,O,v,m){if(!(0,t.IsDate)(m))return yield b(o.Date,a,v,m);c(a.exclusiveMaximumTimestamp)&&!(m.getTime()<a.exclusiveMaximumTimestamp)&&(yield b(o.DateExclusiveMaximumTimestamp,a,v,m)),c(a.exclusiveMinimumTimestamp)&&!(m.getTime()>a.exclusiveMinimumTimestamp)&&(yield b(o.DateExclusiveMinimumTimestamp,a,v,m)),c(a.maximumTimestamp)&&!(m.getTime()<=a.maximumTimestamp)&&(yield b(o.DateMaximumTimestamp,a,v,m)),c(a.minimumTimestamp)&&!(m.getTime()>=a.minimumTimestamp)&&(yield b(o.DateMinimumTimestamp,a,v,m)),c(a.multipleOfTimestamp)&&m.getTime()%a.multipleOfTimestamp!==0&&(yield b(o.DateMultipleOfTimestamp,a,v,m))}function*V(a,O,v,m){(0,t.IsFunction)(m)||(yield b(o.Function,a,v,m))}function*q(a,O,v,m){if(!(0,t.IsInteger)(m))return yield b(o.Integer,a,v,m);c(a.exclusiveMaximum)&&!(m<a.exclusiveMaximum)&&(yield b(o.IntegerExclusiveMaximum,a,v,m)),c(a.exclusiveMinimum)&&!(m>a.exclusiveMinimum)&&(yield b(o.IntegerExclusiveMinimum,a,v,m)),c(a.maximum)&&!(m<=a.maximum)&&(yield b(o.IntegerMaximum,a,v,m)),c(a.minimum)&&!(m>=a.minimum)&&(yield b(o.IntegerMinimum,a,v,m)),c(a.multipleOf)&&m%a.multipleOf!==0&&(yield b(o.IntegerMultipleOf,a,v,m))}function*F(a,O,v,m){for(let S of a.allOf){let k=w(S,O,v,m).next();k.done||(yield b(o.Intersect,a,v,m),yield k.value)}if(a.unevaluatedProperties===!1){let S=new RegExp(s.KeyResolver.ResolvePattern(a));for(let k of Object.getOwnPropertyNames(m))S.test(k)||(yield b(o.IntersectUnevaluatedProperties,a,`${v}/${k}`,m))}if(typeof a.unevaluatedProperties=="object"){let S=new RegExp(s.KeyResolver.ResolvePattern(a));for(let k of Object.getOwnPropertyNames(m))if(!S.test(k)){let Q=w(a.unevaluatedProperties,O,`${v}/${k}`,m[k]).next();Q.done||(yield Q.value)}}}function*ee(a,O,v,m){(0,t.IsIterator)(m)||(yield b(o.Iterator,a,v,m))}function*z(a,O,v,m){m!==a.const&&(yield b(o.Literal,a,v,m))}function*fe(a,O,v,m){yield b(o.Never,a,v,m)}function*N(a,O,v,m){w(a.not,O,v,m).next().done===!0&&(yield b(o.Not,a,v,m))}function*x(a,O,v,m){(0,t.IsNull)(m)||(yield b(o.Null,a,v,m))}function*D(a,O,v,m){if(!n.TypeSystemPolicy.IsNumberLike(m))return yield b(o.Number,a,v,m);c(a.exclusiveMaximum)&&!(m<a.exclusiveMaximum)&&(yield b(o.NumberExclusiveMaximum,a,v,m)),c(a.exclusiveMinimum)&&!(m>a.exclusiveMinimum)&&(yield b(o.NumberExclusiveMinimum,a,v,m)),c(a.maximum)&&!(m<=a.maximum)&&(yield b(o.NumberMaximum,a,v,m)),c(a.minimum)&&!(m>=a.minimum)&&(yield b(o.NumberMinimum,a,v,m)),c(a.multipleOf)&&m%a.multipleOf!==0&&(yield b(o.NumberMultipleOf,a,v,m))}function*Y(a,O,v,m){if(!n.TypeSystemPolicy.IsObjectLike(m))return yield b(o.Object,a,v,m);c(a.minProperties)&&!(Object.getOwnPropertyNames(m).length>=a.minProperties)&&(yield b(o.ObjectMinProperties,a,v,m)),c(a.maxProperties)&&!(Object.getOwnPropertyNames(m).length<=a.maxProperties)&&(yield b(o.ObjectMaxProperties,a,v,m));let S=Array.isArray(a.required)?a.required:[],k=Object.getOwnPropertyNames(a.properties),Q=Object.getOwnPropertyNames(m);for(let te of S)Q.includes(te)||(yield b(o.ObjectRequiredProperty,a.properties[te],`${v}/${f(te)}`,void 0));if(a.additionalProperties===!1)for(let te of Q)k.includes(te)||(yield b(o.ObjectAdditionalProperties,a,`${v}/${f(te)}`,m[te]));if(typeof a.additionalProperties=="object")for(let te of Q)k.includes(te)||(yield*w(a.additionalProperties,O,`${v}/${f(te)}`,m[te]));for(let te of k){let pe=a.properties[te];a.required&&a.required.includes(te)?(yield*w(pe,O,`${v}/${f(te)}`,m[te]),s.ExtendsUndefined.Check(a)&&!(te in m)&&(yield b(o.ObjectRequiredProperty,pe,`${v}/${f(te)}`,void 0))):n.TypeSystemPolicy.IsExactOptionalProperty(m,te)&&(yield*w(pe,O,`${v}/${f(te)}`,m[te]))}}function*ie(a,O,v,m){(0,t.IsPromise)(m)||(yield b(o.Promise,a,v,m))}function*X(a,O,v,m){if(!n.TypeSystemPolicy.IsRecordLike(m))return yield b(o.Object,a,v,m);c(a.minProperties)&&!(Object.getOwnPropertyNames(m).length>=a.minProperties)&&(yield b(o.ObjectMinProperties,a,v,m)),c(a.maxProperties)&&!(Object.getOwnPropertyNames(m).length<=a.maxProperties)&&(yield b(o.ObjectMaxProperties,a,v,m));let[S,k]=Object.entries(a.patternProperties)[0],Q=new RegExp(S);for(let[te,pe]of Object.entries(m))Q.test(te)&&(yield*w(k,O,`${v}/${f(te)}`,pe));if(typeof a.additionalProperties=="object")for(let[te,pe]of Object.entries(m))Q.test(te)||(yield*w(a.additionalProperties,O,`${v}/${f(te)}`,pe));if(a.additionalProperties===!1){for(let[te,pe]of Object.entries(m))if(!Q.test(te))return yield b(o.ObjectAdditionalProperties,a,`${v}/${f(te)}`,pe)}}function*se(a,O,v,m){yield*w((0,r.Deref)(a,O),O,v,m)}function*j(a,O,v,m){if(!(0,t.IsString)(m))return yield b(o.String,a,v,m);c(a.minLength)&&!(m.length>=a.minLength)&&(yield b(o.StringMinLength,a,v,m)),c(a.maxLength)&&!(m.length<=a.maxLength)&&(yield b(o.StringMaxLength,a,v,m)),(0,t.IsString)(a.pattern)&&(new RegExp(a.pattern).test(m)||(yield b(o.StringPattern,a,v,m))),(0,t.IsString)(a.format)&&(s.FormatRegistry.Has(a.format)?s.FormatRegistry.Get(a.format)(m)||(yield b(o.StringFormat,a,v,m)):yield b(o.StringFormatUnknown,a,v,m))}function*G(a,O,v,m){(0,t.IsSymbol)(m)||(yield b(o.Symbol,a,v,m))}function*J(a,O,v,m){if(!(0,t.IsString)(m))return yield b(o.String,a,v,m);new RegExp(a.pattern).test(m)||(yield b(o.StringPattern,a,v,m))}function*le(a,O,v,m){yield*w((0,r.Deref)(a,O),O,v,m)}function*l(a,O,v,m){if(!(0,t.IsArray)(m))return yield b(o.Tuple,a,v,m);if(a.items===void 0&&m.length!==0)return yield b(o.TupleLength,a,v,m);if(m.length!==a.maxItems)return yield b(o.TupleLength,a,v,m);if(a.items)for(let S=0;S<a.items.length;S++)yield*w(a.items[S],O,`${v}/${S}`,m[S])}function*_(a,O,v,m){(0,t.IsUndefined)(m)||(yield b(o.Undefined,a,v,m))}function*I(a,O,v,m){let S=0;for(let k of a.anyOf){let Q=[...w(k,O,v,m)];if(Q.length===0)return;S+=Q.length}S>0&&(yield b(o.Union,a,v,m))}function*C(a,O,v,m){if(!(0,t.IsUint8Array)(m))return yield b(o.Uint8Array,a,v,m);c(a.maxByteLength)&&!(m.length<=a.maxByteLength)&&(yield b(o.Uint8ArrayMaxByteLength,a,v,m)),c(a.minByteLength)&&!(m.length>=a.minByteLength)&&(yield b(o.Uint8ArrayMinByteLength,a,v,m))}function*R(a,O,v,m){}function*E(a,O,v,m){n.TypeSystemPolicy.IsVoidLike(m)||(yield b(o.Void,a,v,m))}function*y(a,O,v,m){s.TypeRegistry.Get(a[s.Kind])(a,m)||(yield b(o.Kind,a,v,m))}function*w(a,O,v,m){let S=c(a.$id)?[...O,a]:O,k=a;switch(k[s.Kind]){case"Any":return yield*M(k,S,v,m);case"Array":return yield*$(k,S,v,m);case"AsyncIterator":return yield*L(k,S,v,m);case"BigInt":return yield*H(k,S,v,m);case"Boolean":return yield*Z(k,S,v,m);case"Constructor":return yield*K(k,S,v,m);case"Date":return yield*B(k,S,v,m);case"Function":return yield*V(k,S,v,m);case"Integer":return yield*q(k,S,v,m);case"Intersect":return yield*F(k,S,v,m);case"Iterator":return yield*ee(k,S,v,m);case"Literal":return yield*z(k,S,v,m);case"Never":return yield*fe(k,S,v,m);case"Not":return yield*N(k,S,v,m);case"Null":return yield*x(k,S,v,m);case"Number":return yield*D(k,S,v,m);case"Object":return yield*Y(k,S,v,m);case"Promise":return yield*ie(k,S,v,m);case"Record":return yield*X(k,S,v,m);case"Ref":return yield*se(k,S,v,m);case"String":return yield*j(k,S,v,m);case"Symbol":return yield*G(k,S,v,m);case"TemplateLiteral":return yield*J(k,S,v,m);case"This":return yield*le(k,S,v,m);case"Tuple":return yield*l(k,S,v,m);case"Undefined":return yield*_(k,S,v,m);case"Union":return yield*I(k,S,v,m);case"Uint8Array":return yield*C(k,S,v,m);case"Unknown":return yield*R(k,S,v,m);case"Void":return yield*E(k,S,v,m);default:if(!s.TypeRegistry.Has(k[s.Kind]))throw new u(a);return yield*y(k,S,v,m)}}function T(...a){let O=a.length===3?w(a[0],a[1],"",a[2]):w(a[0],[],"",a[1]);return new g(O)}e.Errors=T}}),Od=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(r,i,s,o){o===void 0&&(o=s);var u=Object.getOwnPropertyDescriptor(i,s);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,u)}):(function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]})),n=e&&e.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(vi(),e)}}),$u=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(i,s,o,u){u===void 0&&(u=o);var f=Object.getOwnPropertyDescriptor(s,o);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,u,f)}):(function(i,s,o,u){u===void 0&&(u=o),i[u]=s[o]})),n=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorType=void 0;var r=vi();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),n(Pu(),e)}}),Ad=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/check.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Check=e.ValueCheckUnknownTypeError=void 0;var t=Mn(),n=$u(),r=bi(),i=Do(),s=Lt(),o=class extends s.TypeBoxError{constructor(y){super("Unknown type"),this.schema=y}};e.ValueCheckUnknownTypeError=o;function u(y){return y[s.Kind]==="Any"||y[s.Kind]==="Unknown"}function f(y){return y!==void 0}function c(y,w,T){return!0}function g(y,w,T){if(!(0,t.IsArray)(T)||f(y.minItems)&&!(T.length>=y.minItems)||f(y.maxItems)&&!(T.length<=y.maxItems)||!T.every(v=>R(y.items,w,v))||y.uniqueItems===!0&&!(function(){let v=new Set;for(let m of T){let S=(0,i.Hash)(m);if(v.has(S))return!1;v.add(S)}return!0})())return!1;if(!(f(y.contains)||(0,t.IsNumber)(y.minContains)||(0,t.IsNumber)(y.maxContains)))return!0;let a=f(y.contains)?y.contains:s.Type.Never(),O=T.reduce((v,m)=>R(a,w,m)?v+1:v,0);return!(O===0||(0,t.IsNumber)(y.minContains)&&O<y.minContains||(0,t.IsNumber)(y.maxContains)&&O>y.maxContains)}function b(y,w,T){return(0,t.IsAsyncIterator)(T)}function M(y,w,T){return!(!(0,t.IsBigInt)(T)||f(y.exclusiveMaximum)&&!(T<y.exclusiveMaximum)||f(y.exclusiveMinimum)&&!(T>y.exclusiveMinimum)||f(y.maximum)&&!(T<=y.maximum)||f(y.minimum)&&!(T>=y.minimum)||f(y.multipleOf)&&T%y.multipleOf!==BigInt(0))}function $(y,w,T){return(0,t.IsBoolean)(T)}function L(y,w,T){return R(y.returns,w,T.prototype)}function H(y,w,T){return!(!(0,t.IsDate)(T)||f(y.exclusiveMaximumTimestamp)&&!(T.getTime()<y.exclusiveMaximumTimestamp)||f(y.exclusiveMinimumTimestamp)&&!(T.getTime()>y.exclusiveMinimumTimestamp)||f(y.maximumTimestamp)&&!(T.getTime()<=y.maximumTimestamp)||f(y.minimumTimestamp)&&!(T.getTime()>=y.minimumTimestamp)||f(y.multipleOfTimestamp)&&T.getTime()%y.multipleOfTimestamp!==0)}function Z(y,w,T){return(0,t.IsFunction)(T)}function K(y,w,T){return!(!(0,t.IsInteger)(T)||f(y.exclusiveMaximum)&&!(T<y.exclusiveMaximum)||f(y.exclusiveMinimum)&&!(T>y.exclusiveMinimum)||f(y.maximum)&&!(T<=y.maximum)||f(y.minimum)&&!(T>=y.minimum)||f(y.multipleOf)&&T%y.multipleOf!==0)}function B(y,w,T){let a=y.allOf.every(O=>R(O,w,T));if(y.unevaluatedProperties===!1){let O=new RegExp(s.KeyResolver.ResolvePattern(y)),v=Object.getOwnPropertyNames(T).every(m=>O.test(m));return a&&v}else if(s.TypeGuard.TSchema(y.unevaluatedProperties)){let O=new RegExp(s.KeyResolver.ResolvePattern(y)),v=Object.getOwnPropertyNames(T).every(m=>O.test(m)||R(y.unevaluatedProperties,w,T[m]));return a&&v}else return a}function V(y,w,T){return(0,t.IsIterator)(T)}function q(y,w,T){return T===y.const}function F(y,w,T){return!1}function ee(y,w,T){return!R(y.not,w,T)}function z(y,w,T){return(0,t.IsNull)(T)}function fe(y,w,T){return!(!n.TypeSystemPolicy.IsNumberLike(T)||f(y.exclusiveMaximum)&&!(T<y.exclusiveMaximum)||f(y.exclusiveMinimum)&&!(T>y.exclusiveMinimum)||f(y.minimum)&&!(T>=y.minimum)||f(y.maximum)&&!(T<=y.maximum)||f(y.multipleOf)&&T%y.multipleOf!==0)}function N(y,w,T){if(!n.TypeSystemPolicy.IsObjectLike(T)||f(y.minProperties)&&!(Object.getOwnPropertyNames(T).length>=y.minProperties)||f(y.maxProperties)&&!(Object.getOwnPropertyNames(T).length<=y.maxProperties))return!1;let a=Object.getOwnPropertyNames(y.properties);for(let O of a){let v=y.properties[O];if(y.required&&y.required.includes(O)){if(!R(v,w,T[O])||(s.ExtendsUndefined.Check(v)||u(v))&&!(O in T))return!1}else if(n.TypeSystemPolicy.IsExactOptionalProperty(T,O)&&!R(v,w,T[O]))return!1}if(y.additionalProperties===!1){let O=Object.getOwnPropertyNames(T);return y.required&&y.required.length===a.length&&O.length===a.length?!0:O.every(v=>a.includes(v))}else return typeof y.additionalProperties=="object"?Object.getOwnPropertyNames(T).every(v=>a.includes(v)||R(y.additionalProperties,w,T[v])):!0}function x(y,w,T){return(0,t.IsPromise)(T)}function D(y,w,T){if(!n.TypeSystemPolicy.IsRecordLike(T)||f(y.minProperties)&&!(Object.getOwnPropertyNames(T).length>=y.minProperties)||f(y.maxProperties)&&!(Object.getOwnPropertyNames(T).length<=y.maxProperties))return!1;let[a,O]=Object.entries(y.patternProperties)[0],v=new RegExp(a),m=Object.entries(T).every(([Q,te])=>v.test(Q)?R(O,w,te):!0),S=typeof y.additionalProperties=="object"?Object.entries(T).every(([Q,te])=>v.test(Q)?!0:R(y.additionalProperties,w,te)):!0,k=y.additionalProperties===!1?Object.getOwnPropertyNames(T).every(Q=>v.test(Q)):!0;return m&&S&&k}function Y(y,w,T){return R((0,r.Deref)(y,w),w,T)}function ie(y,w,T){return!(0,t.IsString)(T)||f(y.minLength)&&!(T.length>=y.minLength)||f(y.maxLength)&&!(T.length<=y.maxLength)||f(y.pattern)&&!new RegExp(y.pattern).test(T)?!1:f(y.format)?s.FormatRegistry.Has(y.format)?s.FormatRegistry.Get(y.format)(T):!1:!0}function X(y,w,T){return(0,t.IsSymbol)(T)}function se(y,w,T){return(0,t.IsString)(T)&&new RegExp(y.pattern).test(T)}function j(y,w,T){return R((0,r.Deref)(y,w),w,T)}function G(y,w,T){if(!(0,t.IsArray)(T)||y.items===void 0&&T.length!==0||T.length!==y.maxItems)return!1;if(!y.items)return!0;for(let a=0;a<y.items.length;a++)if(!R(y.items[a],w,T[a]))return!1;return!0}function J(y,w,T){return(0,t.IsUndefined)(T)}function le(y,w,T){return y.anyOf.some(a=>R(a,w,T))}function l(y,w,T){return!(!(0,t.IsUint8Array)(T)||f(y.maxByteLength)&&!(T.length<=y.maxByteLength)||f(y.minByteLength)&&!(T.length>=y.minByteLength))}function _(y,w,T){return!0}function I(y,w,T){return n.TypeSystemPolicy.IsVoidLike(T)}function C(y,w,T){return s.TypeRegistry.Has(y[s.Kind])?s.TypeRegistry.Get(y[s.Kind])(y,T):!1}function R(y,w,T){let a=f(y.$id)?[...w,y]:w,O=y;switch(O[s.Kind]){case"Any":return c(O,a,T);case"Array":return g(O,a,T);case"AsyncIterator":return b(O,a,T);case"BigInt":return M(O,a,T);case"Boolean":return $(O,a,T);case"Constructor":return L(O,a,T);case"Date":return H(O,a,T);case"Function":return Z(O,a,T);case"Integer":return K(O,a,T);case"Intersect":return B(O,a,T);case"Iterator":return V(O,a,T);case"Literal":return q(O,a,T);case"Never":return F(O,a,T);case"Not":return ee(O,a,T);case"Null":return z(O,a,T);case"Number":return fe(O,a,T);case"Object":return N(O,a,T);case"Promise":return x(O,a,T);case"Record":return D(O,a,T);case"Ref":return Y(O,a,T);case"String":return ie(O,a,T);case"Symbol":return X(O,a,T);case"TemplateLiteral":return se(O,a,T);case"This":return j(O,a,T);case"Tuple":return G(O,a,T);case"Undefined":return J(O,a,T);case"Union":return le(O,a,T);case"Uint8Array":return l(O,a,T);case"Unknown":return _(O,a,T);case"Void":return I(O,a,T);default:if(!s.TypeRegistry.Has(O[s.Kind]))throw new o(O);return C(O,a,T)}}function E(...y){return y.length===3?R(y[0],y[1],y[2]):R(y[0],[],y[1])}e.Check=E}}),Id=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/transform.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EncodeTransform=e.DecodeTransform=e.HasTransform=e.TransformEncodeError=e.TransformDecodeError=e.TransformEncodeCheckError=e.TransformDecodeCheckError=void 0;var t=Mn(),n=bi(),r=Ad(),i=Lt(),s=class extends i.TypeBoxError{constructor(M,$,L){super("Unable to decode due to invalid value"),this.schema=M,this.value=$,this.error=L}};e.TransformDecodeCheckError=s;var o=class extends i.TypeBoxError{constructor(M,$,L){super("Unable to encode due to invalid value"),this.schema=M,this.value=$,this.error=L}};e.TransformEncodeCheckError=o;var u=class extends i.TypeBoxError{constructor(M,$,L){super(`${L instanceof Error?L.message:"Unknown error"}`),this.schema=M,this.value=$}};e.TransformDecodeError=u;var f=class extends i.TypeBoxError{constructor(M,$,L){super(`${L instanceof Error?L.message:"Unknown error"}`),this.schema=M,this.value=$}};e.TransformEncodeError=f;var c;(function(M){function $(X,se){return i.TypeGuard.TTransform(X)||D(X.items,se)}function L(X,se){return i.TypeGuard.TTransform(X)||D(X.items,se)}function H(X,se){return i.TypeGuard.TTransform(X)||D(X.returns,se)||X.parameters.some(j=>D(j,se))}function Z(X,se){return i.TypeGuard.TTransform(X)||D(X.returns,se)||X.parameters.some(j=>D(j,se))}function K(X,se){return i.TypeGuard.TTransform(X)||i.TypeGuard.TTransform(X.unevaluatedProperties)||X.allOf.some(j=>D(j,se))}function B(X,se){return i.TypeGuard.TTransform(X)||D(X.items,se)}function V(X,se){return i.TypeGuard.TTransform(X)||D(X.not,se)}function q(X,se){return i.TypeGuard.TTransform(X)||Object.values(X.properties).some(j=>D(j,se))||i.TypeGuard.TSchema(X.additionalProperties)&&D(X.additionalProperties,se)}function F(X,se){return i.TypeGuard.TTransform(X)||D(X.item,se)}function ee(X,se){let j=Object.getOwnPropertyNames(X.patternProperties)[0],G=X.patternProperties[j];return i.TypeGuard.TTransform(X)||D(G,se)||i.TypeGuard.TSchema(X.additionalProperties)&&i.TypeGuard.TTransform(X.additionalProperties)}function z(X,se){return i.TypeGuard.TTransform(X)?!0:D((0,n.Deref)(X,se),se)}function fe(X,se){return i.TypeGuard.TTransform(X)?!0:D((0,n.Deref)(X,se),se)}function N(X,se){return i.TypeGuard.TTransform(X)||!(0,t.IsUndefined)(X.items)&&X.items.some(j=>D(j,se))}function x(X,se){return i.TypeGuard.TTransform(X)||X.anyOf.some(j=>D(j,se))}function D(X,se){let j=(0,t.IsString)(X.$id)?[...se,X]:se,G=X;if(X.$id&&Y.has(X.$id))return!1;switch(X.$id&&Y.add(X.$id),X[i.Kind]){case"Array":return $(G,j);case"AsyncIterator":return L(G,j);case"Constructor":return H(G,j);case"Function":return Z(G,j);case"Intersect":return K(G,j);case"Iterator":return B(G,j);case"Not":return V(G,j);case"Object":return q(G,j);case"Promise":return F(G,j);case"Record":return ee(G,j);case"Ref":return z(G,j);case"This":return fe(G,j);case"Tuple":return N(G,j);case"Union":return x(G,j);default:return i.TypeGuard.TTransform(X)}}let Y=new Set;function ie(X,se){return Y.clear(),D(X,se)}M.Has=ie})(c||(e.HasTransform=c={}));var g;(function(M){function $(N,x){try{return i.TypeGuard.TTransform(N)?N[i.Transform].Decode(x):x}catch(D){throw new u(N,x,D)}}function L(N,x,D){return(0,t.IsArray)(D)?$(N,D.map(Y=>z(N.items,x,Y))):$(N,D)}function H(N,x,D){if(!(0,t.IsPlainObject)(D)||(0,t.IsValueType)(D))return $(N,D);let Y=i.KeyResolver.ResolveKeys(N,{includePatterns:!1}),ie=Y.reduce((G,J)=>J in G?{...G,[J]:z(i.IndexedAccessor.Resolve(N,[J]),x,G[J])}:G,D);if(!i.TypeGuard.TTransform(N.unevaluatedProperties))return $(N,ie);let X=Object.getOwnPropertyNames(ie),se=N.unevaluatedProperties,j=X.reduce((G,J)=>Y.includes(J)?G:{...G,[J]:$(se,G[J])},ie);return $(N,j)}function Z(N,x,D){return $(N,z(N.not,x,D))}function K(N,x,D){if(!(0,t.IsPlainObject)(D))return $(N,D);let Y=i.KeyResolver.ResolveKeys(N,{includePatterns:!1}),ie=Y.reduce((G,J)=>J in G?{...G,[J]:z(N.properties[J],x,G[J])}:G,D);if(!i.TypeGuard.TSchema(N.additionalProperties))return $(N,ie);let X=Object.getOwnPropertyNames(ie),se=N.additionalProperties,j=X.reduce((G,J)=>Y.includes(J)?G:{...G,[J]:$(se,G[J])},ie);return $(N,j)}function B(N,x,D){if(!(0,t.IsPlainObject)(D))return $(N,D);let Y=Object.getOwnPropertyNames(N.patternProperties)[0],ie=new RegExp(Y),X=Object.getOwnPropertyNames(D).reduce((J,le)=>ie.test(le)?{...J,[le]:z(N.patternProperties[Y],x,J[le])}:J,D);if(!i.TypeGuard.TSchema(N.additionalProperties))return $(N,X);let se=Object.getOwnPropertyNames(X),j=N.additionalProperties,G=se.reduce((J,le)=>ie.test(le)?J:{...J,[le]:$(j,J[le])},X);return $(N,G)}function V(N,x,D){let Y=(0,n.Deref)(N,x);return $(N,z(Y,x,D))}function q(N,x,D){let Y=(0,n.Deref)(N,x);return $(N,z(Y,x,D))}function F(N,x,D){return(0,t.IsArray)(D)&&(0,t.IsArray)(N.items)?$(N,N.items.map((Y,ie)=>z(Y,x,D[ie]))):$(N,D)}function ee(N,x,D){let Y=$(N,D);for(let ie of N.anyOf)if((0,r.Check)(ie,x,Y))return z(ie,x,Y);return Y}function z(N,x,D){let Y=typeof N.$id=="string"?[...x,N]:x,ie=N;switch(N[i.Kind]){case"Array":return L(ie,Y,D);case"Intersect":return H(ie,Y,D);case"Not":return Z(ie,Y,D);case"Object":return K(ie,Y,D);case"Record":return B(ie,Y,D);case"Ref":return V(ie,Y,D);case"Symbol":return $(ie,D);case"This":return q(ie,Y,D);case"Tuple":return F(ie,Y,D);case"Union":return ee(ie,Y,D);default:return $(ie,D)}}function fe(N,x,D){return z(N,x,D)}M.Decode=fe})(g||(e.DecodeTransform=g={}));var b;(function(M){function $(N,x){try{return i.TypeGuard.TTransform(N)?N[i.Transform].Encode(x):x}catch(D){throw new f(N,x,D)}}function L(N,x,D){let Y=$(N,D);return(0,t.IsArray)(Y)?Y.map(ie=>z(N.items,x,ie)):Y}function H(N,x,D){let Y=$(N,D);if(!(0,t.IsPlainObject)(D)||(0,t.IsValueType)(D))return Y;let ie=i.KeyResolver.ResolveKeys(N,{includePatterns:!1}),X=ie.reduce((G,J)=>J in Y?{...G,[J]:z(i.IndexedAccessor.Resolve(N,[J]),x,G[J])}:G,Y);if(!i.TypeGuard.TTransform(N.unevaluatedProperties))return $(N,X);let se=Object.getOwnPropertyNames(X),j=N.unevaluatedProperties;return se.reduce((G,J)=>ie.includes(J)?G:{...G,[J]:$(j,G[J])},X)}function Z(N,x,D){return $(N.not,$(N,D))}function K(N,x,D){let Y=$(N,D);if(!(0,t.IsPlainObject)(D))return Y;let ie=i.KeyResolver.ResolveKeys(N,{includePatterns:!1}),X=ie.reduce((G,J)=>J in G?{...G,[J]:z(N.properties[J],x,G[J])}:G,Y);if(!i.TypeGuard.TSchema(N.additionalProperties))return X;let se=Object.getOwnPropertyNames(X),j=N.additionalProperties;return se.reduce((G,J)=>ie.includes(J)?G:{...G,[J]:$(j,G[J])},X)}function B(N,x,D){let Y=$(N,D);if(!(0,t.IsPlainObject)(D))return Y;let ie=Object.getOwnPropertyNames(N.patternProperties)[0],X=new RegExp(ie),se=Object.getOwnPropertyNames(D).reduce((J,le)=>X.test(le)?{...J,[le]:z(N.patternProperties[ie],x,J[le])}:J,Y);if(!i.TypeGuard.TSchema(N.additionalProperties))return $(N,se);let j=Object.getOwnPropertyNames(se),G=N.additionalProperties;return j.reduce((J,le)=>X.test(le)?J:{...J,[le]:$(G,J[le])},se)}function V(N,x,D){let Y=(0,n.Deref)(N,x),ie=z(Y,x,D);return $(N,ie)}function q(N,x,D){let Y=(0,n.Deref)(N,x),ie=z(Y,x,D);return $(N,ie)}function F(N,x,D){let Y=$(N,D);return(0,t.IsArray)(N.items)?N.items.map((ie,X)=>z(ie,x,Y[X])):[]}function ee(N,x,D){for(let Y of N.anyOf){if(!(0,r.Check)(Y,x,D))continue;let ie=z(Y,x,D);return $(N,ie)}for(let Y of N.anyOf){let ie=z(Y,x,D);if((0,r.Check)(N,x,ie))return $(N,ie)}return $(N,D)}function z(N,x,D){let Y=typeof N.$id=="string"?[...x,N]:x,ie=N;switch(N[i.Kind]){case"Array":return L(ie,Y,D);case"Intersect":return H(ie,Y,D);case"Not":return Z(ie,Y,D);case"Object":return K(ie,Y,D);case"Record":return B(ie,Y,D);case"Ref":return V(ie,Y,D);case"This":return q(ie,Y,D);case"Tuple":return F(ie,Y,D);case"Union":return ee(ie,Y,D);default:return $(ie,D)}}function fe(N,x,D){return z(N,x,D)}M.Encode=fe})(b||(e.EncodeTransform=b={}))}}),Ed=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/compiler.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeCompiler=e.Policy=e.TypeCompilerTypeGuardError=e.TypeCompilerUnknownTypeError=e.TypeCheck=void 0;var t=Id(),n=Mn(),r=vi(),i=$u(),s=bi(),o=Do(),u=Lt(),f=class{constructor(K,B,V,q){this.schema=K,this.references=B,this.checkFunc=V,this.code=q,this.hasTransform=t.HasTransform.Has(K,B)}Code(){return this.code}Errors(K){return(0,r.Errors)(this.schema,this.references,K)}Check(K){return this.checkFunc(K)}Decode(K){if(!this.checkFunc(K))throw new t.TransformDecodeCheckError(this.schema,K,this.Errors(K).First());return this.hasTransform?t.DecodeTransform.Decode(this.schema,this.references,K):K}Encode(K){let B=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,K):K;if(!this.checkFunc(B))throw new t.TransformEncodeCheckError(this.schema,K,this.Errors(K).First());return B}};e.TypeCheck=f;var c;(function(K){function B(ee){return ee===36}K.DollarSign=B;function V(ee){return ee===95}K.IsUnderscore=V;function q(ee){return ee>=65&&ee<=90||ee>=97&&ee<=122}K.IsAlpha=q;function F(ee){return ee>=48&&ee<=57}K.IsNumeric=F})(c||(c={}));var g;(function(K){function B(ee){return ee.length===0?!1:c.IsNumeric(ee.charCodeAt(0))}function V(ee){if(B(ee))return!1;for(let z=0;z<ee.length;z++){let fe=ee.charCodeAt(z);if(!(c.IsAlpha(fe)||c.IsNumeric(fe)||c.DollarSign(fe)||c.IsUnderscore(fe)))return!1}return!0}function q(ee){return ee.replace(/'/g,"\\'")}function F(ee,z){return V(z)?`${ee}.${z}`:`${ee}['${q(z)}']`}K.Encode=F})(g||(g={}));var b;(function(K){function B(V){let q=[];for(let F=0;F<V.length;F++){let ee=V.charCodeAt(F);c.IsNumeric(ee)||c.IsAlpha(ee)?q.push(V.charAt(F)):q.push(`_${ee}_`)}return q.join("").replace(/__/g,"_")}K.Encode=B})(b||(b={}));var M;(function(K){function B(V){return V.replace(/'/g,"\\'")}K.Escape=B})(M||(M={}));var $=class extends u.TypeBoxError{constructor(K){super("Unknown type"),this.schema=K}};e.TypeCompilerUnknownTypeError=$;var L=class extends u.TypeBoxError{constructor(K){super("Preflight validation check failed to guard for the given schema"),this.schema=K}};e.TypeCompilerTypeGuardError=L;var H;(function(K){function B(z,fe,N){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${fe}' in ${z} ? ${N} : true)`:`(${g.Encode(z,fe)} !== undefined ? ${N} : true)`}K.IsExactOptionalProperty=B;function V(z){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${z} === 'object' && ${z} !== null)`:`(typeof ${z} === 'object' && ${z} !== null && !Array.isArray(${z}))`}K.IsObjectLike=V;function q(z){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${z} === 'object' && ${z} !== null && !(${z} instanceof Date) && !(${z} instanceof Uint8Array))`:`(typeof ${z} === 'object' && ${z} !== null && !Array.isArray(${z}) && !(${z} instanceof Date) && !(${z} instanceof Uint8Array))`}K.IsRecordLike=q;function F(z){return i.TypeSystemPolicy.AllowNaN?`typeof ${z} === 'number'`:`(typeof ${z} === 'number' && Number.isFinite(${z}))`}K.IsNumberLike=F;function ee(z){return i.TypeSystemPolicy.AllowNullVoid?`(${z} === undefined || ${z} === null)`:`${z} === undefined`}K.IsVoidLike=ee})(H||(e.Policy=H={}));var Z;(function(K){function B(A){return A[u.Kind]==="Any"||A[u.Kind]==="Unknown"}function*V(A,ue,P){yield"true"}function*q(A,ue,P){yield`Array.isArray(${P})`;let[ye,ne]=[Re("value","any"),Re("acc","number")];(0,n.IsNumber)(A.maxItems)&&(yield`${P}.length <= ${A.maxItems}`),(0,n.IsNumber)(A.minItems)&&(yield`${P}.length >= ${A.minItems}`);let ce=te(A.items,ue,"value");if(yield`${P}.every((${ye}) => ${ce})`,u.TypeGuard.TSchema(A.contains)||(0,n.IsNumber)(A.minContains)||(0,n.IsNumber)(A.maxContains)){let Te=u.TypeGuard.TSchema(A.contains)?A.contains:u.Type.Never(),Se=te(Te,ue,"value"),Fe=(0,n.IsNumber)(A.minContains)?[`(count >= ${A.minContains})`]:[],Le=(0,n.IsNumber)(A.maxContains)?[`(count <= ${A.maxContains})`]:[],Ke=`const count = value.reduce((${ne}, ${ye}) => ${Se} ? acc + 1 : acc, 0)`,Ct=["(count > 0)",...Fe,...Le].join(" && ");yield`((${ye}) => { ${Ke}; return ${Ct}})(${P})`}A.uniqueItems===!0&&(yield`((${ye}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${P})`)}function*F(A,ue,P){yield`(typeof value === 'object' && Symbol.asyncIterator in ${P})`}function*ee(A,ue,P){yield`(typeof ${P} === 'bigint')`,(0,n.IsBigInt)(A.exclusiveMaximum)&&(yield`${P} < BigInt(${A.exclusiveMaximum})`),(0,n.IsBigInt)(A.exclusiveMinimum)&&(yield`${P} > BigInt(${A.exclusiveMinimum})`),(0,n.IsBigInt)(A.maximum)&&(yield`${P} <= BigInt(${A.maximum})`),(0,n.IsBigInt)(A.minimum)&&(yield`${P} >= BigInt(${A.minimum})`),(0,n.IsBigInt)(A.multipleOf)&&(yield`(${P} % BigInt(${A.multipleOf})) === 0`)}function*z(A,ue,P){yield`(typeof ${P} === 'boolean')`}function*fe(A,ue,P){yield*k(A.returns,ue,`${P}.prototype`)}function*N(A,ue,P){yield`(${P} instanceof Date) && Number.isFinite(${P}.getTime())`,(0,n.IsNumber)(A.exclusiveMaximumTimestamp)&&(yield`${P}.getTime() < ${A.exclusiveMaximumTimestamp}`),(0,n.IsNumber)(A.exclusiveMinimumTimestamp)&&(yield`${P}.getTime() > ${A.exclusiveMinimumTimestamp}`),(0,n.IsNumber)(A.maximumTimestamp)&&(yield`${P}.getTime() <= ${A.maximumTimestamp}`),(0,n.IsNumber)(A.minimumTimestamp)&&(yield`${P}.getTime() >= ${A.minimumTimestamp}`),(0,n.IsNumber)(A.multipleOfTimestamp)&&(yield`(${P}.getTime() % ${A.multipleOfTimestamp}) === 0`)}function*x(A,ue,P){yield`(typeof ${P} === 'function')`}function*D(A,ue,P){yield`(typeof ${P} === 'number' && Number.isInteger(${P}))`,(0,n.IsNumber)(A.exclusiveMaximum)&&(yield`${P} < ${A.exclusiveMaximum}`),(0,n.IsNumber)(A.exclusiveMinimum)&&(yield`${P} > ${A.exclusiveMinimum}`),(0,n.IsNumber)(A.maximum)&&(yield`${P} <= ${A.maximum}`),(0,n.IsNumber)(A.minimum)&&(yield`${P} >= ${A.minimum}`),(0,n.IsNumber)(A.multipleOf)&&(yield`(${P} % ${A.multipleOf}) === 0`)}function*Y(A,ue,P){let ye=A.allOf.map(ne=>te(ne,ue,P)).join(" && ");if(A.unevaluatedProperties===!1){let ne=ge(`${new RegExp(u.KeyResolver.ResolvePattern(A))};`),ce=`Object.getOwnPropertyNames(${P}).every(key => ${ne}.test(key))`;yield`(${ye} && ${ce})`}else if(u.TypeGuard.TSchema(A.unevaluatedProperties)){let ne=ge(`${new RegExp(u.KeyResolver.ResolvePattern(A))};`),ce=`Object.getOwnPropertyNames(${P}).every(key => ${ne}.test(key) || ${te(A.unevaluatedProperties,ue,`${P}[key]`)})`;yield`(${ye} && ${ce})`}else yield`(${ye})`}function*ie(A,ue,P){yield`(typeof value === 'object' && Symbol.iterator in ${P})`}function*X(A,ue,P){typeof A.const=="number"||typeof A.const=="boolean"?yield`(${P} === ${A.const})`:yield`(${P} === '${M.Escape(A.const)}')`}function*se(A,ue,P){yield"false"}function*j(A,ue,P){yield`(!${te(A.not,ue,P)})`}function*G(A,ue,P){yield`(${P} === null)`}function*J(A,ue,P){yield H.IsNumberLike(P),(0,n.IsNumber)(A.exclusiveMaximum)&&(yield`${P} < ${A.exclusiveMaximum}`),(0,n.IsNumber)(A.exclusiveMinimum)&&(yield`${P} > ${A.exclusiveMinimum}`),(0,n.IsNumber)(A.maximum)&&(yield`${P} <= ${A.maximum}`),(0,n.IsNumber)(A.minimum)&&(yield`${P} >= ${A.minimum}`),(0,n.IsNumber)(A.multipleOf)&&(yield`(${P} % ${A.multipleOf}) === 0`)}function*le(A,ue,P){yield H.IsObjectLike(P),(0,n.IsNumber)(A.minProperties)&&(yield`Object.getOwnPropertyNames(${P}).length >= ${A.minProperties}`),(0,n.IsNumber)(A.maxProperties)&&(yield`Object.getOwnPropertyNames(${P}).length <= ${A.maxProperties}`);let ye=Object.getOwnPropertyNames(A.properties);for(let ne of ye){let ce=g.Encode(P,ne),Te=A.properties[ne];if(A.required&&A.required.includes(ne))yield*k(Te,ue,ce),(u.ExtendsUndefined.Check(Te)||B(Te))&&(yield`('${ne}' in ${P})`);else{let Se=te(Te,ue,ce);yield H.IsExactOptionalProperty(P,ne,Se)}}if(A.additionalProperties===!1)if(A.required&&A.required.length===ye.length)yield`Object.getOwnPropertyNames(${P}).length === ${ye.length}`;else{let ne=`[${ye.map(ce=>`'${ce}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${P}).every(key => ${ne}.includes(key))`}if(typeof A.additionalProperties=="object"){let ne=te(A.additionalProperties,ue,`${P}[key]`),ce=`[${ye.map(Te=>`'${Te}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${P}).every(key => ${ce}.includes(key) || ${ne}))`}}function*l(A,ue,P){yield`(typeof value === 'object' && typeof ${P}.then === 'function')`}function*_(A,ue,P){yield H.IsRecordLike(P),(0,n.IsNumber)(A.minProperties)&&(yield`Object.getOwnPropertyNames(${P}).length >= ${A.minProperties}`),(0,n.IsNumber)(A.maxProperties)&&(yield`Object.getOwnPropertyNames(${P}).length <= ${A.maxProperties}`);let[ye,ne]=Object.entries(A.patternProperties)[0],ce=ge(`${new RegExp(ye)}`),Te=te(ne,ue,"value"),Se=u.TypeGuard.TSchema(A.additionalProperties)?te(A.additionalProperties,ue,P):A.additionalProperties===!1?"false":"true",Fe=`(${ce}.test(key) ? ${Te} : ${Se})`;yield`(Object.entries(${P}).every(([key, value]) => ${Fe}))`}function*I(A,ue,P){let ye=(0,s.Deref)(A,ue);if(Q.functions.has(A.$ref))return yield`${pe(A.$ref)}(${P})`;yield*k(ye,ue,P)}function*C(A,ue,P){yield`(typeof ${P} === 'string')`,(0,n.IsNumber)(A.maxLength)&&(yield`${P}.length <= ${A.maxLength}`),(0,n.IsNumber)(A.minLength)&&(yield`${P}.length >= ${A.minLength}`),A.pattern!==void 0&&(yield`${ge(`${new RegExp(A.pattern)};`)}.test(${P})`),A.format!==void 0&&(yield`format('${A.format}', ${P})`)}function*R(A,ue,P){yield`(typeof ${P} === 'symbol')`}function*E(A,ue,P){yield`(typeof ${P} === 'string')`,yield`${ge(`${new RegExp(A.pattern)};`)}.test(${P})`}function*y(A,ue,P){yield`${pe(A.$ref)}(${P})`}function*w(A,ue,P){if(yield`Array.isArray(${P})`,A.items===void 0)return yield`${P}.length === 0`;yield`(${P}.length === ${A.maxItems})`;for(let ye=0;ye<A.items.length;ye++)yield`${te(A.items[ye],ue,`${P}[${ye}]`)}`}function*T(A,ue,P){yield`${P} === undefined`}function*a(A,ue,P){yield`(${A.anyOf.map(ne=>te(ne,ue,P)).join(" || ")})`}function*O(A,ue,P){yield`${P} instanceof Uint8Array`,(0,n.IsNumber)(A.maxByteLength)&&(yield`(${P}.length <= ${A.maxByteLength})`),(0,n.IsNumber)(A.minByteLength)&&(yield`(${P}.length >= ${A.minByteLength})`)}function*v(A,ue,P){yield"true"}function*m(A,ue,P){yield H.IsVoidLike(P)}function*S(A,ue,P){let ye=Q.instances.size;Q.instances.set(ye,A),yield`kind('${A[u.Kind]}', ${ye}, ${P})`}function*k(A,ue,P,ye=!0){let ne=(0,n.IsString)(A.$id)?[...ue,A]:ue,ce=A;if(ye&&(0,n.IsString)(A.$id)){let Te=pe(A.$id);if(Q.functions.has(Te))return yield`${Te}(${P})`;{let Se=Ie(Te,A,ue,"value",!1);return Q.functions.set(Te,Se),yield`${Te}(${P})`}}switch(ce[u.Kind]){case"Any":return yield*V(ce,ne,P);case"Array":return yield*q(ce,ne,P);case"AsyncIterator":return yield*F(ce,ne,P);case"BigInt":return yield*ee(ce,ne,P);case"Boolean":return yield*z(ce,ne,P);case"Constructor":return yield*fe(ce,ne,P);case"Date":return yield*N(ce,ne,P);case"Function":return yield*x(ce,ne,P);case"Integer":return yield*D(ce,ne,P);case"Intersect":return yield*Y(ce,ne,P);case"Iterator":return yield*ie(ce,ne,P);case"Literal":return yield*X(ce,ne,P);case"Never":return yield*se(ce,ne,P);case"Not":return yield*j(ce,ne,P);case"Null":return yield*G(ce,ne,P);case"Number":return yield*J(ce,ne,P);case"Object":return yield*le(ce,ne,P);case"Promise":return yield*l(ce,ne,P);case"Record":return yield*_(ce,ne,P);case"Ref":return yield*I(ce,ne,P);case"String":return yield*C(ce,ne,P);case"Symbol":return yield*R(ce,ne,P);case"TemplateLiteral":return yield*E(ce,ne,P);case"This":return yield*y(ce,ne,P);case"Tuple":return yield*w(ce,ne,P);case"Undefined":return yield*T(ce,ne,P);case"Union":return yield*a(ce,ne,P);case"Uint8Array":return yield*O(ce,ne,P);case"Unknown":return yield*v(ce,ne,P);case"Void":return yield*m(ce,ne,P);default:if(!u.TypeRegistry.Has(ce[u.Kind]))throw new $(A);return yield*S(ce,ne,P)}}let Q={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function te(A,ue,P,ye=!0){return`(${[...k(A,ue,P,ye)].join(" && ")})`}function pe(A){return`check_${b.Encode(A)}`}function ge(A){let ue=`local_${Q.variables.size}`;return Q.variables.set(ue,`const ${ue} = ${A}`),ue}function Ie(A,ue,P,ye,ne=!0){let[ce,Te]=[`
49
+ `,Ke=>"".padStart(Ke," ")],Se=Re("value","any"),Fe=Yt("boolean"),Le=[...k(ue,P,ye,ne)].map(Ke=>`${Te(4)}${Ke}`).join(` &&${ce}`);return`function ${A}(${Se})${Fe} {${ce}${Te(2)}return (${ce}${Le}${ce}${Te(2)})
50
+ }`}function Re(A,ue){let P=Q.language==="typescript"?`: ${ue}`:"";return`${A}${P}`}function Yt(A){return Q.language==="typescript"?`: ${A}`:""}function me(A,ue,P){let ye=Ie("check",A,ue,"value"),ne=Re("value","any"),ce=Yt("boolean"),Te=[...Q.functions.values()],Se=[...Q.variables.values()],Fe=(0,n.IsString)(A.$id)?`return function check(${ne})${ce} {
51
+ return ${pe(A.$id)}(value)
52
+ }`:`return ${ye}`;return[...Se,...Te,Fe].join(`
53
+ `)}function Ft(...A){let ue={language:"javascript"},[P,ye,ne]=A.length===2&&(0,n.IsArray)(A[1])?[A[0],A[1],ue]:A.length===2&&!(0,n.IsArray)(A[1])?[A[0],[],A[1]]:A.length===3?[A[0],A[1],A[2]]:A.length===1?[A[0],[],ue]:[null,[],ue];if(Q.language=ne.language,Q.variables.clear(),Q.functions.clear(),Q.instances.clear(),!u.TypeGuard.TSchema(P))throw new L(P);for(let ce of ye)if(!u.TypeGuard.TSchema(ce))throw new L(ce);return me(P,ye,ne)}K.Code=Ft;function Qt(A,ue=[]){let P=Ft(A,ue,{language:"javascript"}),ye=globalThis.Function("kind","format","hash",P),ne=new Map(Q.instances);function ce(Le,Ke,Ct){if(!u.TypeRegistry.Has(Le)||!ne.has(Ke))return!1;let Tn=u.TypeRegistry.Get(Le),wn=ne.get(Ke);return Tn(wn,Ct)}function Te(Le,Ke){return u.FormatRegistry.Has(Le)?u.FormatRegistry.Get(Le)(Ke):!1}function Se(Le){return(0,o.Hash)(Le)}let Fe=ye(ce,Te,Se);return new f(A,ue,Fe,P)}K.Compile=Qt})(Z||(e.TypeCompiler=Z={}))}}),Sd=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(i,s,o,u){u===void 0&&(u=o);var f=Object.getOwnPropertyDescriptor(s,o);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,u,f)}):(function(i,s,o,u){u===void 0&&(u=o),i[u]=s[o]})),n=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorIterator=e.ValueErrorType=void 0;var r=Od();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return r.ValueErrorIterator}}),n(Ed(),e)}}),ni=qt(_d(),1),Pd=qt(Td(),1),Ru=!1,Nu=!1;ni.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(Ru=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(Nu=process?.env?.LOGGER_PERF_PREFIX==="true"));var $d={prefix:void 0,time:Ru,delta:Nu,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0},yo=[],Cu=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,n,r){Object.assign(this,{sinceFirst:e,sinceLast:t,time:n,delta:r})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<5?2:1),n=this.sinceLast<1e3?`${this.sinceLast.toFixed(0)}`.padStart(5," "):`${`${(this.sinceLast*.001).toFixed(this.sinceLast<1e4?1:0)}`.padStart(4," ")}s`;return`[${[this.time?t:null,this.delta?n:null].filter(r=>r!=null).join(",")}]`}},xu=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},fr=!1,xe=class ze{static ERROR=2;static WARN=4;static INFO=6;static LOG=6;static DEBUG=8;static VERBOSE=10;static firstLog=0;static lastLog=0;static setup(t=ze.INFO,n={}){n=Object.assign({},$d,n),t>10&&console.debug("setup logger",{config:n});let r=this.wrapLog(console.debug,{...n,dim:n.dimDebugOnServer}),i=(...f)=>{typeof window<"u"&&window?.FORCE_DISABLE_LOGLEVEL&&r(...f)};i.isDisabled=!0,i.isEnabled=!1;let s=this.wrapLog(console.groupCollapsed,n),o=(f,c)=>{function g(...M){let $=M[M.length-1];return $===i?$():(s(...M.slice(0,-1)),(async()=>{try{let L=$();return L instanceof Promise?await L:L}finally{console.groupEnd()}})())}let b=Object.assign(c.bind({}),{isEnabled:f,isDisabled:!f,group:g,force:c});return f?b:Object.assign(i.bind({}),{isEnabled:f,isDisabled:!f,group:g,force:b})},u=o(t>=ze.ERROR,this.wrapLog(console.error,n));return{ERROR:(...f)=>(u(...f),new Error(f.map(c=>typeof c=="string"?c:(0,Pd.default)(c)).join(" "))),WARN:o(t>=ze.WARN,this.wrapLog(console.warn,n)),LOG:o(t>=ze.INFO,this.wrapLog(console.log,n)),DEBUG:o(t>=ze.DEBUG,this.wrapLog(console.log,{...n,dim:n.dimDebugOnServer})),VERBOSE:o(t>=ze.VERBOSE,this.wrapLog(console.debug,{...n,dim:n.dimDebugOnServer}))}}static wrapLog(t,n){if(ni.isNode)return t.bind(console);{let r=[];if(n.time||n.delta){let i=ni.isBrowser&&navigator.userAgent.includes("Chrome")?["",ze.timeStr(!!n.time,!!n.delta)]:[];r.push(...i)}return n.prefix&&(fr?r.push(new xu("dim",n.prefix)):r.push(n.prefix)),t.bind(console,...r)}}static timeStr(t,n,r=0){if(!performance.now)return;let i=performance.now();ze.firstLog||(ze.firstLog=i,ze.lastLog=i);let s=new Cu(i-ze.firstLog,i-ze.lastLog,t,n);return ze.lastLog=i,r?s.toString():s}static getOriginFromStack(t){let n=!1;for(let r of t.split(`
54
+ `)){let i=r.match(/^\s+at\s+(.*)/);if(i){if(n)return i[1].trim().replace(__dirname,"");n=!0}}}};ni.isBrowser&&(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(yo&&yo.length){for(let t of yo)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof Cu))return null;fr||(fr=!0);let t=xe.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof xu?(fr||(fr=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1}));var Rd=typeof global=="object"&&global&&global.Object===Object&&global,Uu=Rd,Nd=typeof self=="object"&&self&&self.Object===Object&&self,Cd=Uu||Nd||Function("return this")(),Ze=Cd,xd=Ze.Symbol,Rt=xd,ju=Object.prototype,Ud=ju.hasOwnProperty,jd=ju.toString,ar=Rt?Rt.toStringTag:void 0;function Dd(e){var t=Ud.call(e,ar),n=e[ar];try{e[ar]=void 0;var r=!0}catch{}var i=jd.call(e);return r&&(t?e[ar]=n:delete e[ar]),i}var Md=Dd,Ld=Object.prototype,Bd=Ld.toString;function Fd(e){return Bd.call(e)}var kd=Fd,Kd="[object Null]",Gd="[object Undefined]",Aa=Rt?Rt.toStringTag:void 0;function Vd(e){return e==null?e===void 0?Gd:Kd:Aa&&Aa in Object(e)?Md(e):kd(e)}var Ln=Vd;function zd(e){return e!=null&&typeof e=="object"}var Jt=zd,qd="[object Symbol]";function Wd(e){return typeof e=="symbol"||Jt(e)&&Ln(e)==qd}var Dn=Wd;function Hd(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Du=Hd,Jd=Array.isArray,At=Jd,Xd=1/0,Ia=Rt?Rt.prototype:void 0,Ea=Ia?Ia.toString:void 0;function Mu(e){if(typeof e=="string")return e;if(At(e))return Du(e,Mu)+"";if(Dn(e))return Ea?Ea.call(e):"";var t=e+"";return t=="0"&&1/e==-Xd?"-0":t}var Yd=Mu,Qd=/\s/;function Zd(e){for(var t=e.length;t--&&Qd.test(e.charAt(t)););return t}var ep=Zd,tp=/^\s+/;function np(e){return e&&e.slice(0,ep(e)+1).replace(tp,"")}var rp=np;function ip(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Bt=ip,Sa=NaN,op=/^[-+]0x[0-9a-f]+$/i,sp=/^0b[01]+$/i,ap=/^0o[0-7]+$/i,up=parseInt;function cp(e){if(typeof e=="number")return e;if(Dn(e))return Sa;if(Bt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Bt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=rp(e);var n=sp.test(e);return n||ap.test(e)?up(e.slice(2),n?2:8):op.test(e)?Sa:+e}var fp=cp,Pa=1/0,lp=17976931348623157e292;function dp(e){if(!e)return e===0?e:0;if(e=fp(e),e===Pa||e===-Pa){var t=e<0?-1:1;return t*lp}return e===e?e:0}var pp=dp;function yp(e){var t=pp(e),n=t%1;return t===t?n?t-n:t:0}var $a=yp;function hp(e){return e}var _i=hp,gp="[object AsyncFunction]",mp="[object Function]",bp="[object GeneratorFunction]",vp="[object Proxy]";function _p(e){if(!Bt(e))return!1;var t=Ln(e);return t==mp||t==bp||t==gp||t==vp}var Lu=_p,Tp=Ze["__core-js_shared__"],ho=Tp,Ra=(function(){var e=/[^.]+$/.exec(ho&&ho.keys&&ho.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function wp(e){return!!Ra&&Ra in e}var Op=wp,Ap=Function.prototype,Ip=Ap.toString;function Ep(e){if(e!=null){try{return Ip.call(e)}catch{}try{return e+""}catch{}}return""}var yn=Ep,Sp=/[\\^$.*+?()[\]{}|]/g,Pp=/^\[object .+?Constructor\]$/,$p=Function.prototype,Rp=Object.prototype,Np=$p.toString,Cp=Rp.hasOwnProperty,xp=RegExp("^"+Np.call(Cp).replace(Sp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Up(e){if(!Bt(e)||Op(e))return!1;var t=Lu(e)?xp:Pp;return t.test(yn(e))}var jp=Up;function Dp(e,t){return e?.[t]}var Mp=Dp;function Lp(e,t){var n=Mp(e,t);return jp(n)?n:void 0}var hn=Lp,Bp=hn(Ze,"WeakMap"),dr=Bp,Fp=dr&&new dr,ri=Fp,kp=ri?function(e,t){return ri.set(e,t),e}:_i,Bu=kp,Na=Object.create,Kp=(function(){function e(){}return function(t){if(!Bt(t))return{};if(Na)return Na(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})(),Mo=Kp;function Gp(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Mo(e.prototype),r=e.apply(n,t);return Bt(r)?r:n}}var pr=Gp,Vp=1;function zp(e,t,n){var r=t&Vp,i=pr(e);function s(){var o=this&&this!==Ze&&this instanceof s?i:e;return o.apply(r?n:this,arguments)}return s}var qp=zp;function Wp(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Lo=Wp,Hp=Math.max;function Jp(e,t,n,r){for(var i=-1,s=e.length,o=n.length,u=-1,f=t.length,c=Hp(s-o,0),g=Array(f+c),b=!r;++u<f;)g[u]=t[u];for(;++i<o;)(b||i<s)&&(g[n[i]]=e[i]);for(;c--;)g[u++]=e[i++];return g}var Fu=Jp,Xp=Math.max;function Yp(e,t,n,r){for(var i=-1,s=e.length,o=-1,u=n.length,f=-1,c=t.length,g=Xp(s-u,0),b=Array(g+c),M=!r;++i<g;)b[i]=e[i];for(var $=i;++f<c;)b[$+f]=t[f];for(;++o<u;)(M||i<s)&&(b[$+n[o]]=e[i++]);return b}var ku=Yp;function Qp(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Zp=Qp;function ey(){}var Bo=ey,ty=4294967295;function ii(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ty,this.__views__=[]}ii.prototype=Mo(Bo.prototype);ii.prototype.constructor=ii;var Fo=ii;function ny(){}var Ku=ny,ry=ri?function(e){return ri.get(e)}:Ku,Gu=ry,iy={},Ca=iy,oy=Object.prototype,sy=oy.hasOwnProperty;function ay(e){for(var t=e.name+"",n=Ca[t],r=sy.call(Ca,t)?n.length:0;r--;){var i=n[r],s=i.func;if(s==null||s==e)return i.name}return t}var uy=ay;function oi(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}oi.prototype=Mo(Bo.prototype);oi.prototype.constructor=oi;var Io=oi;function cy(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Vu=cy;function fy(e){if(e instanceof Fo)return e.clone();var t=new Io(e.__wrapped__,e.__chain__);return t.__actions__=Vu(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var ly=fy,dy=Object.prototype,py=dy.hasOwnProperty;function si(e){if(Jt(e)&&!At(e)&&!(e instanceof Fo)){if(e instanceof Io)return e;if(py.call(e,"__wrapped__"))return ly(e)}return new Io(e)}si.prototype=Bo.prototype;si.prototype.constructor=si;var yy=si;function hy(e){var t=uy(e),n=yy[t];if(typeof n!="function"||!(t in Fo.prototype))return!1;if(e===n)return!0;var r=Gu(n);return!!r&&e===r[0]}var gy=hy,my=800,by=16,vy=Date.now;function _y(e){var t=0,n=0;return function(){var r=vy(),i=by-(r-n);if(n=r,i>0){if(++t>=my)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var zu=_y,Ty=zu(Bu),qu=Ty,wy=/\{\n\/\* \[wrapped with (.+)\] \*/,Oy=/,? & /;function Ay(e){var t=e.match(wy);return t?t[1].split(Oy):[]}var Iy=Ay,Ey=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Sy(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Ey,`{
55
+ /* [wrapped with `+t+`] */
56
+ `)}var Py=Sy;function $y(e){return function(){return e}}var Ry=$y,Ny=(function(){try{var e=hn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),ai=Ny,Cy=ai?function(e,t){return ai(e,"toString",{configurable:!0,enumerable:!1,value:Ry(t),writable:!0})}:_i,xy=Cy,Uy=zu(xy),ko=Uy;function jy(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Dy=jy;function My(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var Ly=My;function By(e){return e!==e}var Fy=By;function ky(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var Ky=ky;function Gy(e,t,n){return t===t?Ky(e,t,n):Ly(e,Fy,n)}var Vy=Gy;function zy(e,t){var n=e==null?0:e.length;return!!n&&Vy(e,t,0)>-1}var Wu=zy,qy=1,Wy=2,Hy=8,Jy=16,Xy=32,Yy=64,Qy=128,Zy=256,eh=512,th=[["ary",Qy],["bind",qy],["bindKey",Wy],["curry",Hy],["curryRight",Jy],["flip",eh],["partial",Xy],["partialRight",Yy],["rearg",Zy]];function nh(e,t){return Dy(th,function(n){var r="_."+n[0];t&n[1]&&!Wu(e,r)&&e.push(r)}),e.sort()}var rh=nh;function ih(e,t,n){var r=t+"";return ko(e,Py(r,rh(Iy(r),n)))}var Hu=ih,oh=1,sh=2,ah=4,uh=8,xa=32,Ua=64;function ch(e,t,n,r,i,s,o,u,f,c){var g=t&uh,b=g?o:void 0,M=g?void 0:o,$=g?s:void 0,L=g?void 0:s;t|=g?xa:Ua,t&=~(g?Ua:xa),t&ah||(t&=~(oh|sh));var H=[e,t,i,$,b,L,M,u,f,c],Z=n.apply(void 0,H);return gy(e)&&qu(Z,H),Z.placeholder=r,Hu(Z,e,t)}var Ju=ch;function fh(e){var t=e;return t.placeholder}var Ko=fh,lh=9007199254740991,dh=/^(?:0|[1-9]\d*)$/;function ph(e,t){var n=typeof e;return t=t??lh,!!t&&(n=="number"||n!="symbol"&&dh.test(e))&&e>-1&&e%1==0&&e<t}var Ti=ph,yh=Math.min;function hh(e,t){for(var n=e.length,r=yh(t.length,n),i=Vu(e);r--;){var s=t[r];e[r]=Ti(s,n)?i[s]:void 0}return e}var gh=hh,ja="__lodash_placeholder__";function mh(e,t){for(var n=-1,r=e.length,i=0,s=[];++n<r;){var o=e[n];(o===t||o===ja)&&(e[n]=ja,s[i++]=n)}return s}var yr=mh,bh=1,vh=2,_h=8,Th=16,wh=128,Oh=512;function Xu(e,t,n,r,i,s,o,u,f,c){var g=t&wh,b=t&bh,M=t&vh,$=t&(_h|Th),L=t&Oh,H=M?void 0:pr(e);function Z(){for(var K=arguments.length,B=Array(K),V=K;V--;)B[V]=arguments[V];if($)var q=Ko(Z),F=Zp(B,q);if(r&&(B=Fu(B,r,i,$)),s&&(B=ku(B,s,o,$)),K-=F,$&&K<c){var ee=yr(B,q);return Ju(e,t,Xu,Z.placeholder,n,B,ee,u,f,c-K)}var z=b?n:this,fe=M?z[e]:e;return K=B.length,u?B=gh(B,u):L&&K>1&&B.reverse(),g&&f<K&&(B.length=f),this&&this!==Ze&&this instanceof Z&&(fe=H||pr(fe)),fe.apply(z,B)}return Z}var Yu=Xu;function Ah(e,t,n){var r=pr(e);function i(){for(var s=arguments.length,o=Array(s),u=s,f=Ko(i);u--;)o[u]=arguments[u];var c=s<3&&o[0]!==f&&o[s-1]!==f?[]:yr(o,f);if(s-=c.length,s<n)return Ju(e,t,Yu,i.placeholder,void 0,o,c,void 0,void 0,n-s);var g=this&&this!==Ze&&this instanceof i?r:e;return Lo(g,this,o)}return i}var Ih=Ah,Eh=1;function Sh(e,t,n,r){var i=t&Eh,s=pr(e);function o(){for(var u=-1,f=arguments.length,c=-1,g=r.length,b=Array(g+f),M=this&&this!==Ze&&this instanceof o?s:e;++c<g;)b[c]=r[c];for(;f--;)b[c++]=arguments[++u];return Lo(M,i?n:this,b)}return o}var Ph=Sh,Da="__lodash_placeholder__",go=1,$h=2,Rh=4,Ma=8,ur=128,La=256,Nh=Math.min;function Ch(e,t){var n=e[1],r=t[1],i=n|r,s=i<(go|$h|ur),o=r==ur&&n==Ma||r==ur&&n==La&&e[7].length<=t[8]||r==(ur|La)&&t[7].length<=t[8]&&n==Ma;if(!(s||o))return e;r&go&&(e[2]=t[2],i|=n&go?0:Rh);var u=t[3];if(u){var f=e[3];e[3]=f?Fu(f,u,t[4]):u,e[4]=f?yr(e[3],Da):t[4]}return u=t[5],u&&(f=e[5],e[5]=f?ku(f,u,t[6]):u,e[6]=f?yr(e[5],Da):t[6]),u=t[7],u&&(e[7]=u),r&ur&&(e[8]=e[8]==null?t[8]:Nh(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var xh=Ch,Uh="Expected a function",Ba=1,jh=2,mo=8,bo=16,vo=32,Fa=64,ka=Math.max;function Dh(e,t,n,r,i,s,o,u){var f=t&jh;if(!f&&typeof e!="function")throw new TypeError(Uh);var c=r?r.length:0;if(c||(t&=~(vo|Fa),r=i=void 0),o=o===void 0?o:ka($a(o),0),u=u===void 0?u:$a(u),c-=i?i.length:0,t&Fa){var g=r,b=i;r=i=void 0}var M=f?void 0:Gu(e),$=[e,t,n,r,i,g,b,s,o,u];if(M&&xh($,M),e=$[0],t=$[1],n=$[2],r=$[3],i=$[4],u=$[9]=$[9]===void 0?f?0:e.length:ka($[9]-c,0),!u&&t&(mo|bo)&&(t&=~(mo|bo)),!t||t==Ba)var L=qp(e,t,n);else t==mo||t==bo?L=Ih(e,t,u):(t==vo||t==(Ba|vo))&&!i.length?L=Ph(e,t,n,r):L=Yu.apply(void 0,$);var H=M?Bu:qu;return Hu(H(L,$),e,t)}var Mh=Dh;function Lh(e,t,n){t=="__proto__"&&ai?ai(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Bh=Lh;function Fh(e,t){return e===t||e!==e&&t!==t}var Go=Fh,kh=Object.prototype,Kh=kh.hasOwnProperty;function Gh(e,t,n){var r=e[t];(!(Kh.call(e,t)&&Go(r,n))||n===void 0&&!(t in e))&&Bh(e,t,n)}var Vh=Gh,Ka=Math.max;function zh(e,t,n){return t=Ka(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=Ka(r.length-t,0),o=Array(s);++i<s;)o[i]=r[t+i];i=-1;for(var u=Array(t+1);++i<t;)u[i]=r[i];return u[t]=n(o),Lo(e,this,u)}}var Qu=zh;function qh(e,t){return ko(Qu(e,t,_i),e+"")}var Zu=qh,Wh=9007199254740991;function Hh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Wh}var Vo=Hh;function Jh(e){return e!=null&&Vo(e.length)&&!Lu(e)}var ec=Jh,Xh=Object.prototype;function Yh(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Xh;return e===n}var Qh=Yh;function Zh(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var eg=Zh,tg="[object Arguments]";function ng(e){return Jt(e)&&Ln(e)==tg}var Ga=ng,tc=Object.prototype,rg=tc.hasOwnProperty,ig=tc.propertyIsEnumerable,og=Ga((function(){return arguments})())?Ga:function(e){return Jt(e)&&rg.call(e,"callee")&&!ig.call(e,"callee")},zo=og;function sg(){return!1}var ag=sg,nc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Va=nc&&typeof module=="object"&&module&&!module.nodeType&&module,ug=Va&&Va.exports===nc,za=ug?Ze.Buffer:void 0,cg=za?za.isBuffer:void 0,fg=cg||ag,Eo=fg,lg="[object Arguments]",dg="[object Array]",pg="[object Boolean]",yg="[object Date]",hg="[object Error]",gg="[object Function]",mg="[object Map]",bg="[object Number]",vg="[object Object]",_g="[object RegExp]",Tg="[object Set]",wg="[object String]",Og="[object WeakMap]",Ag="[object ArrayBuffer]",Ig="[object DataView]",Eg="[object Float32Array]",Sg="[object Float64Array]",Pg="[object Int8Array]",$g="[object Int16Array]",Rg="[object Int32Array]",Ng="[object Uint8Array]",Cg="[object Uint8ClampedArray]",xg="[object Uint16Array]",Ug="[object Uint32Array]",Ee={};Ee[Eg]=Ee[Sg]=Ee[Pg]=Ee[$g]=Ee[Rg]=Ee[Ng]=Ee[Cg]=Ee[xg]=Ee[Ug]=!0;Ee[lg]=Ee[dg]=Ee[Ag]=Ee[pg]=Ee[Ig]=Ee[yg]=Ee[hg]=Ee[gg]=Ee[mg]=Ee[bg]=Ee[vg]=Ee[_g]=Ee[Tg]=Ee[wg]=Ee[Og]=!1;function jg(e){return Jt(e)&&Vo(e.length)&&!!Ee[Ln(e)]}var Dg=jg;function Mg(e){return function(t){return e(t)}}var rc=Mg,ic=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lr=ic&&typeof module=="object"&&module&&!module.nodeType&&module,Lg=lr&&lr.exports===ic,_o=Lg&&Uu.process,Bg=(function(){try{var e=lr&&lr.require&&lr.require("util").types;return e||_o&&_o.binding&&_o.binding("util")}catch{}})(),qa=Bg,Wa=qa&&qa.isTypedArray,Fg=Wa?rc(Wa):Dg,oc=Fg,kg=Object.prototype,Kg=kg.hasOwnProperty;function Gg(e,t){var n=At(e),r=!n&&zo(e),i=!n&&!r&&Eo(e),s=!n&&!r&&!i&&oc(e),o=n||r||i||s,u=o?eg(e.length,String):[],f=u.length;for(var c in e)(t||Kg.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ti(c,f)))&&u.push(c);return u}var Vg=Gg;function zg(e,t){return function(n){return e(t(n))}}var qg=zg,Wg=qg(Object.keys,Object),Hg=Wg,Jg=Object.prototype,Xg=Jg.hasOwnProperty;function Yg(e){if(!Qh(e))return Hg(e);var t=[];for(var n in Object(e))Xg.call(e,n)&&n!="constructor"&&t.push(n);return t}var Qg=Yg;function Zg(e){return ec(e)?Vg(e):Qg(e)}var sc=Zg,em=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tm=/^\w*$/;function nm(e,t){if(At(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Dn(e)?!0:tm.test(e)||!em.test(e)||t!=null&&e in Object(t)}var qo=nm,rm=hn(Object,"create"),hr=rm;function im(){this.__data__=hr?hr(null):{},this.size=0}var om=im;function sm(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var am=sm,um="__lodash_hash_undefined__",cm=Object.prototype,fm=cm.hasOwnProperty;function lm(e){var t=this.__data__;if(hr){var n=t[e];return n===um?void 0:n}return fm.call(t,e)?t[e]:void 0}var dm=lm,pm=Object.prototype,ym=pm.hasOwnProperty;function hm(e){var t=this.__data__;return hr?t[e]!==void 0:ym.call(t,e)}var gm=hm,mm="__lodash_hash_undefined__";function bm(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hr&&t===void 0?mm:t,this}var vm=bm;function Bn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bn.prototype.clear=om;Bn.prototype.delete=am;Bn.prototype.get=dm;Bn.prototype.has=gm;Bn.prototype.set=vm;var Ha=Bn;function _m(){this.__data__=[],this.size=0}var Tm=_m;function wm(e,t){for(var n=e.length;n--;)if(Go(e[n][0],t))return n;return-1}var wi=wm,Om=Array.prototype,Am=Om.splice;function Im(e){var t=this.__data__,n=wi(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Am.call(t,n,1),--this.size,!0}var Em=Im;function Sm(e){var t=this.__data__,n=wi(t,e);return n<0?void 0:t[n][1]}var Pm=Sm;function $m(e){return wi(this.__data__,e)>-1}var Rm=$m;function Nm(e,t){var n=this.__data__,r=wi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Cm=Nm;function Fn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fn.prototype.clear=Tm;Fn.prototype.delete=Em;Fn.prototype.get=Pm;Fn.prototype.has=Rm;Fn.prototype.set=Cm;var Oi=Fn,xm=hn(Ze,"Map"),gr=xm;function Um(){this.size=0,this.__data__={hash:new Ha,map:new(gr||Oi),string:new Ha}}var jm=Um;function Dm(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Mm=Dm;function Lm(e,t){var n=e.__data__;return Mm(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Ai=Lm;function Bm(e){var t=Ai(this,e).delete(e);return this.size-=t?1:0,t}var Fm=Bm;function km(e){return Ai(this,e).get(e)}var Km=km;function Gm(e){return Ai(this,e).has(e)}var Vm=Gm;function zm(e,t){var n=Ai(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var qm=zm;function kn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kn.prototype.clear=jm;kn.prototype.delete=Fm;kn.prototype.get=Km;kn.prototype.has=Vm;kn.prototype.set=qm;var Ii=kn,Wm="Expected a function";function Wo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Wm);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(Wo.Cache||Ii),n}Wo.Cache=Ii;var Hm=Wo,Jm=500;function Xm(e){var t=Hm(e,function(r){return n.size===Jm&&n.clear(),r}),n=t.cache;return t}var Ym=Xm,Qm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zm=/\\(\\)?/g,eb=Ym(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Qm,function(n,r,i,s){t.push(i?s.replace(Zm,"$1"):r||n)}),t}),tb=eb;function nb(e){return e==null?"":Yd(e)}var rb=nb;function ib(e,t){return At(e)?e:qo(e,t)?[e]:tb(rb(e))}var Ei=ib,ob=1/0;function sb(e){if(typeof e=="string"||Dn(e))return e;var t=e+"";return t=="0"&&1/e==-ob?"-0":t}var vr=sb;function ab(e,t){t=Ei(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[vr(t[n++])];return n&&n==r?e:void 0}var Ho=ab;function ub(e,t,n){var r=e==null?void 0:Ho(e,t);return r===void 0?n:r}var cb=ub;function fb(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var ac=fb,Ja=Rt?Rt.isConcatSpreadable:void 0;function lb(e){return At(e)||zo(e)||!!(Ja&&e&&e[Ja])}var db=lb;function uc(e,t,n,r,i){var s=-1,o=e.length;for(n||(n=db),i||(i=[]);++s<o;){var u=e[s];t>0&&n(u)?t>1?uc(u,t-1,n,r,i):ac(i,u):r||(i[i.length]=u)}return i}var pb=uc;function yb(e){var t=e==null?0:e.length;return t?pb(e,1):[]}var hb=yb;function gb(e){return ko(Qu(e,void 0,hb),e+"")}var mb=gb;function bb(){this.__data__=new Oi,this.size=0}var vb=bb;function _b(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Tb=_b;function wb(e){return this.__data__.get(e)}var Ob=wb;function Ab(e){return this.__data__.has(e)}var Ib=Ab,Eb=200;function Sb(e,t){var n=this.__data__;if(n instanceof Oi){var r=n.__data__;if(!gr||r.length<Eb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ii(r)}return n.set(e,t),this.size=n.size,this}var Pb=Sb;function Kn(e){var t=this.__data__=new Oi(e);this.size=t.size}Kn.prototype.clear=vb;Kn.prototype.delete=Tb;Kn.prototype.get=Ob;Kn.prototype.has=Ib;Kn.prototype.set=Pb;var Zr=Kn;function $b(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}var Rb=$b;function Nb(){return[]}var Cb=Nb,xb=Object.prototype,Ub=xb.propertyIsEnumerable,Xa=Object.getOwnPropertySymbols,jb=Xa?function(e){return e==null?[]:(e=Object(e),Rb(Xa(e),function(t){return Ub.call(e,t)}))}:Cb,Db=jb;function Mb(e,t,n){var r=t(e);return At(e)?r:ac(r,n(e))}var Lb=Mb;function Bb(e){return Lb(e,sc,Db)}var Ya=Bb,Fb=hn(Ze,"DataView"),So=Fb,kb=hn(Ze,"Promise"),Po=kb,Kb=hn(Ze,"Set"),jn=Kb,Qa="[object Map]",Gb="[object Object]",Za="[object Promise]",eu="[object Set]",tu="[object WeakMap]",nu="[object DataView]",Vb=yn(So),zb=yn(gr),qb=yn(Po),Wb=yn(jn),Hb=yn(dr),dn=Ln;(So&&dn(new So(new ArrayBuffer(1)))!=nu||gr&&dn(new gr)!=Qa||Po&&dn(Po.resolve())!=Za||jn&&dn(new jn)!=eu||dr&&dn(new dr)!=tu)&&(dn=function(e){var t=Ln(e),n=t==Gb?e.constructor:void 0,r=n?yn(n):"";if(r)switch(r){case Vb:return nu;case zb:return Qa;case qb:return Za;case Wb:return eu;case Hb:return tu}return t});var ru=dn,Jb=Ze.Uint8Array,iu=Jb,Xb="__lodash_hash_undefined__";function Yb(e){return this.__data__.set(e,Xb),this}var Qb=Yb;function Zb(e){return this.__data__.has(e)}var ev=Zb;function ui(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Ii;++t<n;)this.add(e[t])}ui.prototype.add=ui.prototype.push=Qb;ui.prototype.has=ev;var cc=ui;function tv(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var nv=tv;function rv(e,t){return e.has(t)}var fc=rv,iv=1,ov=2;function sv(e,t,n,r,i,s){var o=n&iv,u=e.length,f=t.length;if(u!=f&&!(o&&f>u))return!1;var c=s.get(e),g=s.get(t);if(c&&g)return c==t&&g==e;var b=-1,M=!0,$=n&ov?new cc:void 0;for(s.set(e,t),s.set(t,e);++b<u;){var L=e[b],H=t[b];if(r)var Z=o?r(H,L,b,t,e,s):r(L,H,b,e,t,s);if(Z!==void 0){if(Z)continue;M=!1;break}if($){if(!nv(t,function(K,B){if(!fc($,B)&&(L===K||i(L,K,n,r,s)))return $.push(B)})){M=!1;break}}else if(!(L===H||i(L,H,n,r,s))){M=!1;break}}return s.delete(e),s.delete(t),M}var lc=sv;function av(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var uv=av;function cv(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var dc=cv,fv=1,lv=2,dv="[object Boolean]",pv="[object Date]",yv="[object Error]",hv="[object Map]",gv="[object Number]",mv="[object RegExp]",bv="[object Set]",vv="[object String]",_v="[object Symbol]",Tv="[object ArrayBuffer]",wv="[object DataView]",ou=Rt?Rt.prototype:void 0,To=ou?ou.valueOf:void 0;function Ov(e,t,n,r,i,s,o){switch(n){case wv:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Tv:return!(e.byteLength!=t.byteLength||!s(new iu(e),new iu(t)));case dv:case pv:case gv:return Go(+e,+t);case yv:return e.name==t.name&&e.message==t.message;case mv:case vv:return e==t+"";case hv:var u=uv;case bv:var f=r&fv;if(u||(u=dc),e.size!=t.size&&!f)return!1;var c=o.get(e);if(c)return c==t;r|=lv,o.set(e,t);var g=lc(u(e),u(t),r,i,s,o);return o.delete(e),g;case _v:if(To)return To.call(e)==To.call(t)}return!1}var Av=Ov,Iv=1,Ev=Object.prototype,Sv=Ev.hasOwnProperty;function Pv(e,t,n,r,i,s){var o=n&Iv,u=Ya(e),f=u.length,c=Ya(t),g=c.length;if(f!=g&&!o)return!1;for(var b=f;b--;){var M=u[b];if(!(o?M in t:Sv.call(t,M)))return!1}var $=s.get(e),L=s.get(t);if($&&L)return $==t&&L==e;var H=!0;s.set(e,t),s.set(t,e);for(var Z=o;++b<f;){M=u[b];var K=e[M],B=t[M];if(r)var V=o?r(B,K,M,t,e,s):r(K,B,M,e,t,s);if(!(V===void 0?K===B||i(K,B,n,r,s):V)){H=!1;break}Z||(Z=M=="constructor")}if(H&&!Z){var q=e.constructor,F=t.constructor;q!=F&&"constructor"in e&&"constructor"in t&&!(typeof q=="function"&&q instanceof q&&typeof F=="function"&&F instanceof F)&&(H=!1)}return s.delete(e),s.delete(t),H}var $v=Pv,Rv=1,su="[object Arguments]",au="[object Array]",Qr="[object Object]",Nv=Object.prototype,uu=Nv.hasOwnProperty;function Cv(e,t,n,r,i,s){var o=At(e),u=At(t),f=o?au:ru(e),c=u?au:ru(t);f=f==su?Qr:f,c=c==su?Qr:c;var g=f==Qr,b=c==Qr,M=f==c;if(M&&Eo(e)){if(!Eo(t))return!1;o=!0,g=!1}if(M&&!g)return s||(s=new Zr),o||oc(e)?lc(e,t,n,r,i,s):Av(e,t,f,n,r,i,s);if(!(n&Rv)){var $=g&&uu.call(e,"__wrapped__"),L=b&&uu.call(t,"__wrapped__");if($||L){var H=$?e.value():e,Z=L?t.value():t;return s||(s=new Zr),i(H,Z,n,r,s)}}return M?(s||(s=new Zr),$v(e,t,n,r,i,s)):!1}var xv=Cv;function pc(e,t,n,r,i){return e===t?!0:e==null||t==null||!Jt(e)&&!Jt(t)?e!==e&&t!==t:xv(e,t,n,r,pc,i)}var yc=pc,Uv=1,jv=2;function Dv(e,t,n,r){var i=n.length,s=i,o=!r;if(e==null)return!s;for(e=Object(e);i--;){var u=n[i];if(o&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++i<s;){u=n[i];var f=u[0],c=e[f],g=u[1];if(o&&u[2]){if(c===void 0&&!(f in e))return!1}else{var b=new Zr;if(r)var M=r(c,g,f,e,t,b);if(!(M===void 0?yc(g,c,Uv|jv,r,b):M))return!1}}return!0}var Mv=Dv;function Lv(e){return e===e&&!Bt(e)}var hc=Lv;function Bv(e){for(var t=sc(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,hc(i)]}return t}var Fv=Bv;function kv(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var gc=kv;function Kv(e){var t=Fv(e);return t.length==1&&t[0][2]?gc(t[0][0],t[0][1]):function(n){return n===e||Mv(n,e,t)}}var Gv=Kv;function Vv(e,t){return e!=null&&t in Object(e)}var zv=Vv;function qv(e,t,n){t=Ei(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var o=vr(t[r]);if(!(s=e!=null&&n(e,o)))break;e=e[o]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Vo(i)&&Ti(o,i)&&(At(e)||zo(e)))}var Wv=qv;function Hv(e,t){return e!=null&&Wv(e,t,zv)}var mc=Hv,Jv=1,Xv=2;function Yv(e,t){return qo(e)&&hc(t)?gc(vr(e),t):function(n){var r=cb(n,e);return r===void 0&&r===t?mc(n,e):yc(t,r,Jv|Xv)}}var Qv=Yv;function Zv(e){return function(t){return t?.[e]}}var e_=Zv;function t_(e){return function(t){return Ho(t,e)}}var n_=t_;function r_(e){return qo(e)?e_(vr(e)):n_(e)}var i_=r_;function o_(e){return typeof e=="function"?e:e==null?_i:typeof e=="object"?At(e)?Qv(e[0],e[1]):Gv(e):i_(e)}var s_=o_;function a_(e){return Jt(e)&&ec(e)}var u_=a_;function c_(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var f_=c_,l_=200;function d_(e,t,n,r){var i=-1,s=Wu,o=!0,u=e.length,f=[],c=t.length;if(!u)return f;n&&(t=Du(t,rc(n))),r?(s=f_,o=!1):t.length>=l_&&(s=fc,o=!1,t=new cc(t));e:for(;++i<u;){var g=e[i],b=n==null?g:n(g);if(g=r||g!==0?g:0,o&&b===b){for(var M=c;M--;)if(t[M]===b)continue e;f.push(g)}else s(t,b,r)||f.push(g)}return f}var p_=d_;function y_(e,t,n,r){if(!Bt(e))return e;t=Ei(t,e);for(var i=-1,s=t.length,o=s-1,u=e;u!=null&&++i<s;){var f=vr(t[i]),c=n;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=o){var g=u[f];c=r?r(g,f,u):void 0,c===void 0&&(c=Bt(g)?g:Ti(t[i+1])?[]:{})}Vh(u,f,c),u=u[f]}return e}var h_=y_;function g_(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var o=t[r],u=Ho(e,o);n(u,o)&&h_(s,Ei(o,e),u)}return s}var m_=g_,b_=32,Jo=Zu(function(e,t){var n=yr(t,Ko(Jo));return Mh(e,b_,void 0,t,n)});Jo.placeholder={};var v_=Jo;function __(e,t){return m_(e,t,function(n,r){return mc(e,r)})}var T_=__,w_=mb(function(e,t){return e==null?{}:T_(e,t)}),cu=w_,O_=4294967295,A_=O_-1,I_=Math.floor,E_=Math.min;function S_(e,t,n,r){var i=0,s=e==null?0:e.length;if(s===0)return 0;t=n(t);for(var o=t!==t,u=t===null,f=Dn(t),c=t===void 0;i<s;){var g=I_((i+s)/2),b=n(e[g]),M=b!==void 0,$=b===null,L=b===b,H=Dn(b);if(o)var Z=r||L;else c?Z=L&&(r||M):u?Z=L&&M&&(r||!$):f?Z=L&&M&&!$&&(r||!H):$||H?Z=!1:Z=r?b<=t:b<t;Z?i=g+1:s=g}return E_(s,A_)}var P_=S_;function $_(e,t,n){return P_(e,t,s_(n,2))}var R_=$_,N_=1/0,Lw=jn&&1/dc(new jn([,-0]))[1]==N_?function(e){return new jn(e)}:Ku;var C_=Zu(function(e,t){return u_(e)?p_(e,t):[]}),fu=C_,bc=qt(wd(),1),Bw=bc.default.configure,ci=bc.default;var{WARN:Fw,LOG:kw,DEBUG:Kw,VERBOSE:Ye,ERROR:Gw}=xe.setup(xe.INFO),Vw=Pe.set();da({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var vc=({caller:e,thread:t,pattern:n,args:r})=>Ve(()=>(r=r||n,`${!Array.isArray(t)&&t?.name?t.name+" | ":""}${e??"caller?"}${r?`{${typeof r=="string"?r:ci(r)}}`:""}`));function _c(e,t){return ut.shallow(e.applogs,t.applogs)}function Xo(e,t,n=!1){if(Gt(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let r=!1,i=0,s=typeof n=="boolean"?{keepAlive:n}:n,o=new Map;return function(...u){let f,c=Ve(()=>{let $=u;for(let L=0;L<u.length;L++)u[L]instanceof li&&u===$&&($=u.slice());return $}),g=`computedFnDeepCompare(${e||t.name}#${++i})${s.argsDebugName?`{${s.argsDebugName(...u)}}`:""}`;for(let[$,L]of o.entries())if(U_($,c)){f=L;break}else if(Ye.isEnabled)for(let H=0;H<$.length;H++)$[H]instanceof li&&$[H].name===u[H].name&&ut.structural(fu($,$[H]),fu(c,c[H]))&&Ye.force(`[${g}] threadState mismatch => cachebust`,{diffFields:Object.keys($[H]).filter(Z=>!ut.structural($[H][Z],u[H][Z])),cacheArg:$[H],freshArg:u[H]});if(f){let $=f.get();return Ye.isEnabled&&Ye(`[${g}] cache hit`,{untrackedArgs:c,cachedResult:$}),$}if(!s.keepAlive&&!Hs())return!r&&Qs().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),r=!0),t.apply(this,u);Ye.isEnabled&&Ye(`[${g}] new computation`,{untrackedArgs:c});let b,M=lt(()=>(Ye.isEnabled&&Ye(`[${g}] update->rerun`,Ve(()=>({args:u})),t),Ye.isEnabled&&io(),b=t.apply(this,u)),{...s,name:g});if(Ye.isEnabled&&Ye(`[${g}] deps`,Yr(M),{untrackedArgs:c}),o.set(c,M),!s.keepAlive){let $=ir(M,()=>{Ye.isEnabled&&Ye(`[${g}] dispose`,M),$(),o.delete(c),s.onCleanup&&s.onCleanup(b,...u),b=void 0})}return M.get()}}function x_(e){let t=0,n="",r=0;for(let i=0;i<e.length;i++){let s=e[i];s==="("?n+=s+`
57
+ `+" ".repeat(++t):s===")"?n+=`
58
+ `+" ".repeat(--t)+s:s===","&&r===0?n+=s+`
59
+ `+" ".repeat(t):s==="{"&&r===0?(r++,n+=s+`
60
+ `+" ".repeat(t+1)):s==="}"&&r===1?(r--,n+=`
61
+ `+" ".repeat(t)+s):s==="{"&&r>0?(r++,n+=s):(s==="}"&&r>1&&r--,n+=s)}return n}function U_(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]instanceof li){if(t[n]!==e[n])return!1}else if(!ut.structural(e[n],t[n]))return!1;return!0}var{WARN:lu,LOG:zw,DEBUG:j_,VERBOSE:qw,ERROR:fn}=xe.setup(xe.INFO,{prefix:"[thread]"});function fi(e){return e.init!==void 0}var li=class{constructor(e,t,n,r=[],i={}){this.name=e,this._applogs=r,this.parents=t===null?null:Oa(t),this.filters=n,Ve(()=>this.parents?.length===0)&&lu("[Thread] empty parents array",e),i.skipObservable||oo(this,{applogsCids:lt,applogsByCid:lt,insert:gt,size:lt,isEmpty:lt,firstLog:lt,latestLog:lt},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw fn("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw fn("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw fn("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw fn("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw fn("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw fn("[Thread] insertRaw() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insertRaw(e)}subscribe(e){return this._subscribers.push(e),this.unsubscribe.bind(this,e)}unsubscribe(e){let t=this._subscribers.indexOf(e);t!==-1?this._subscribers.splice(t,1):lu("unsubscribe called for non-existent",e)}notifySubscribers(e){j_(`[thread: ${this.name}] notifying`,this._subscribers.length,"subscribers of",{...e,subs:this._subscribers});for(let t of this._subscribers)t(e)}get applogs(){return this._applogs}get applogsCids(){return this._applogs.map(e=>e.cid)}map(e){return this.applogs.map(e)}get findLast(){return this.applogs.findLast.bind(this.applogs)}get findFirst(){return this.applogs.find.bind(this.applogs)}get firstLog(){return this.applogs[0]}get latestLog(){return this.applogs[this.applogs.length-1]}hasApplog(e,t){if(t)return this.applogs.includes(e);if(!e.cid)throw fn("[hasApplogs] applog without CID:",e);return this.hasApplogCid(e.cid)}hasApplogCid(e){return this.applogsCids.includes(e.toString())}get applogsByCid(){return new Map(this.applogs.map(e=>[e.cid,e]))}getApplog(e){return this.applogsByCid.get(e.toString())}hasApplogWithDiffTs(e){return this.applogs.find(t=>t.en===e.en&&t.at===e.at&&t.vl===e.vl&&t.ag===e.ag)}get isEmpty(){return this.size===0}get size(){return this.applogs.length}get length(){return this.applogs.length}get untrackedSize(){return Ve(()=>this.size)}get nameAndSizeUntracked(){return Ve(()=>`${this.name} (${this.size})`)}get prettyName(){return x_(this.name)}get hasParents(){return!!this.parents?.length}};var D_={};po(D_,{code:()=>J0,decode:()=>kc,encode:()=>Fc,format:()=>wu,name:()=>H0,parse:()=>Y0,stringify:()=>wu});var M_=["string","number","bigint","symbol"],L_=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function B_(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(M_.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(F_(e))return"Buffer";let n=k_(e);return n||"Object"}function F_(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function k_(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(L_.includes(t))return t}var U=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};U.uint=new U(0,"uint",!0);U.negint=new U(1,"negint",!0);U.bytes=new U(2,"bytes",!0);U.string=new U(3,"string",!0);U.array=new U(4,"array",!1);U.map=new U(5,"map",!1);U.tag=new U(6,"tag",!1);U.float=new U(7,"float",!0);U.false=new U(7,"false",!0);U.true=new U(7,"true",!0);U.null=new U(7,"null",!0);U.undefined=new U(7,"undefined",!0);U.break=new U(7,"break",!0);var re=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},Gn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",K_=new TextDecoder,G_=new TextEncoder;function di(e){return Gn&&globalThis.Buffer.isBuffer(e)}function Yo(e){return e instanceof Uint8Array?di(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var V_=Gn?((e,t,n)=>n-t>64?globalThis.Buffer.from(e.subarray(t,n)).toString("utf8"):pu(e,t,n)):((e,t,n)=>n-t>64?K_.decode(e.subarray(t,n)):pu(e,t,n)),Tc=Gn?(e=>e.length>64?globalThis.Buffer.from(e):du(e)):(e=>e.length>64?G_.encode(e):du(e)),Qo=Gn?((e,t,n)=>di(e)?new Uint8Array(e.subarray(t,n)):e.slice(t,n)):((e,t,n)=>e.slice(t,n)),z_=Gn?((e,t)=>(e=e.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),Yo(globalThis.Buffer.concat(e,t)))):((e,t)=>{let n=new Uint8Array(t),r=0;for(let i of e)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n}),q_=Gn?(e=>globalThis.Buffer.allocUnsafe(e)):(e=>new Uint8Array(e));function W_(e,t){if(di(e)&&di(t))return e.compare(t);for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return 0}function du(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}function pu(e,t,n){let r=[];for(;t<n;){let i=e[t],s=null,o=i>239?4:i>223?3:i>191?2:1;if(t+o<=n){let u,f,c,g;switch(o){case 1:i<128&&(s=i);break;case 2:u=e[t+1],(u&192)===128&&(g=(i&31)<<6|u&63,g>127&&(s=g));break;case 3:u=e[t+1],f=e[t+2],(u&192)===128&&(f&192)===128&&(g=(i&15)<<12|(u&63)<<6|f&63,g>2047&&(g<55296||g>57343)&&(s=g));break;case 4:u=e[t+1],f=e[t+2],c=e[t+3],(u&192)===128&&(f&192)===128&&(c&192)===128&&(g=(i&15)<<18|(u&63)<<12|(f&63)<<6|c&63,g>65535&&g<1114112&&(s=g))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),t+=o}return wc(r)}var yu=4096;function wc(e){let t=e.length;if(t<=yu)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=yu));return n}var H_=256,Oc=class{constructor(e=H_){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let r=t.length-(this.maxCursor-this.cursor)-1;t.set(e,r)}else{if(t){let r=t.length-(this.maxCursor-this.cursor)-1;r<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,r),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=q_(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=Qo(n,0,this.cursor)}else t=z_(this.chunks,this.cursor);return e&&this.reset(),t}},de="CBOR decode error:",pn="CBOR encode error:",_r=[];_r[23]=1;_r[24]=2;_r[25]=3;_r[26]=5;_r[27]=9;function Vn(e,t,n){if(e.length-t<n)throw new Error(`${de} not enough data for type`)}var Me=[24,256,65536,4294967296,BigInt("18446744073709551616")];function gn(e,t,n){Vn(e,t,1);let r=e[t];if(n.strict===!0&&r<Me[0])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return r}function mn(e,t,n){Vn(e,t,2);let r=e[t]<<8|e[t+1];if(n.strict===!0&&r<Me[1])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return r}function bn(e,t,n){Vn(e,t,4);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(n.strict===!0&&r<Me[2])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return r}function vn(e,t,n){Vn(e,t,8);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(r)<<BigInt(32))+BigInt(i);if(n.strict===!0&&s<Me[3])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(n.allowBigInt===!0)return s;throw new Error(`${de} integers outside of the safe integer range are not supported`)}function J_(e,t,n,r){return new re(U.uint,gn(e,t+1,r),2)}function X_(e,t,n,r){return new re(U.uint,mn(e,t+1,r),3)}function Y_(e,t,n,r){return new re(U.uint,bn(e,t+1,r),5)}function Q_(e,t,n,r){return new re(U.uint,vn(e,t+1,r),9)}function _n(e,t){return pt(e,0,t.value)}function pt(e,t,n){if(n<Me[0]){let r=Number(n);e.push([t|r])}else if(n<Me[1]){let r=Number(n);e.push([t|24,r])}else if(n<Me[2]){let r=Number(n);e.push([t|25,r>>>8,r&255])}else if(n<Me[3]){let r=Number(n);e.push([t|26,r>>>24&255,r>>>16&255,r>>>8&255,r&255])}else{let r=BigInt(n);if(r<Me[4]){let i=[t|27,0,0,0,0,0,0,0],s=Number(r&BigInt(4294967295)),o=Number(r>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,e.push(i)}else throw new Error(`${de} encountered BigInt larger than allowable range`)}}_n.encodedSize=function(t){return pt.encodedSize(t.value)};pt.encodedSize=function(t){return t<Me[0]?1:t<Me[1]?2:t<Me[2]?3:t<Me[3]?5:9};_n.compareTokens=function(t,n){return t.value<n.value?-1:t.value>n.value?1:0};function Z_(e,t,n,r){return new re(U.negint,-1-gn(e,t+1,r),2)}function eT(e,t,n,r){return new re(U.negint,-1-mn(e,t+1,r),3)}function tT(e,t,n,r){return new re(U.negint,-1-bn(e,t+1,r),5)}var Zo=BigInt(-1),Ac=BigInt(1);function nT(e,t,n,r){let i=vn(e,t+1,r);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new re(U.negint,s,9)}if(r.allowBigInt!==!0)throw new Error(`${de} integers outside of the safe integer range are not supported`);return new re(U.negint,Zo-BigInt(i),9)}function es(e,t){let n=t.value,r=typeof n=="bigint"?n*Zo-Ac:n*-1-1;pt(e,t.type.majorEncoded,r)}es.encodedSize=function(t){let n=t.value,r=typeof n=="bigint"?n*Zo-Ac:n*-1-1;return r<Me[0]?1:r<Me[1]?2:r<Me[2]?3:r<Me[3]?5:9};es.compareTokens=function(t,n){return t.value<n.value?1:t.value>n.value?-1:0};function Tr(e,t,n,r){Vn(e,t,n+r);let i=Qo(e,t+n,t+n+r);return new re(U.bytes,i,n+r)}function rT(e,t,n,r){return Tr(e,t,1,n)}function iT(e,t,n,r){return Tr(e,t,2,gn(e,t+1,r))}function oT(e,t,n,r){return Tr(e,t,3,mn(e,t+1,r))}function sT(e,t,n,r){return Tr(e,t,5,bn(e,t+1,r))}function aT(e,t,n,r){let i=vn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer bytes lengths not supported`);return Tr(e,t,9,i)}function pi(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===U.string?Tc(e.value):e.value),e.encodedBytes}function Si(e,t){let n=pi(t);pt(e,t.type.majorEncoded,n.length),e.push(n)}Si.encodedSize=function(t){let n=pi(t);return pt.encodedSize(n.length)+n.length};Si.compareTokens=function(t,n){return uT(pi(t),pi(n))};function uT(e,t){return e.length<t.length?-1:e.length>t.length?1:W_(e,t)}function wr(e,t,n,r,i){let s=n+r;Vn(e,t,s);let o=new re(U.string,V_(e,t+n,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=Qo(e,t+n,t+s)),o}function cT(e,t,n,r){return wr(e,t,1,n,r)}function fT(e,t,n,r){return wr(e,t,2,gn(e,t+1,r),r)}function lT(e,t,n,r){return wr(e,t,3,mn(e,t+1,r),r)}function dT(e,t,n,r){return wr(e,t,5,bn(e,t+1,r),r)}function pT(e,t,n,r){let i=vn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer string lengths not supported`);return wr(e,t,9,i,r)}var yT=Si;function zn(e,t,n,r){return new re(U.array,r,n)}function hT(e,t,n,r){return zn(e,t,1,n)}function gT(e,t,n,r){return zn(e,t,2,gn(e,t+1,r))}function mT(e,t,n,r){return zn(e,t,3,mn(e,t+1,r))}function bT(e,t,n,r){return zn(e,t,5,bn(e,t+1,r))}function vT(e,t,n,r){let i=vn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer array lengths not supported`);return zn(e,t,9,i)}function _T(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return zn(e,t,1,1/0)}function ts(e,t){pt(e,U.array.majorEncoded,t.value)}ts.compareTokens=_n.compareTokens;ts.encodedSize=function(t){return pt.encodedSize(t.value)};function qn(e,t,n,r){return new re(U.map,r,n)}function TT(e,t,n,r){return qn(e,t,1,n)}function wT(e,t,n,r){return qn(e,t,2,gn(e,t+1,r))}function OT(e,t,n,r){return qn(e,t,3,mn(e,t+1,r))}function AT(e,t,n,r){return qn(e,t,5,bn(e,t+1,r))}function IT(e,t,n,r){let i=vn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer map lengths not supported`);return qn(e,t,9,i)}function ET(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return qn(e,t,1,1/0)}function ns(e,t){pt(e,U.map.majorEncoded,t.value)}ns.compareTokens=_n.compareTokens;ns.encodedSize=function(t){return pt.encodedSize(t.value)};function ST(e,t,n,r){return new re(U.tag,n,1)}function PT(e,t,n,r){return new re(U.tag,gn(e,t+1,r),2)}function $T(e,t,n,r){return new re(U.tag,mn(e,t+1,r),3)}function RT(e,t,n,r){return new re(U.tag,bn(e,t+1,r),5)}function NT(e,t,n,r){return new re(U.tag,vn(e,t+1,r),9)}function rs(e,t){pt(e,U.tag.majorEncoded,t.value)}rs.compareTokens=_n.compareTokens;rs.encodedSize=function(t){return pt.encodedSize(t.value)};var CT=20,xT=21,UT=22,jT=23;function DT(e,t,n,r){if(r.allowUndefined===!1)throw new Error(`${de} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new re(U.null,null,1):new re(U.undefined,void 0,1)}function MT(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return new re(U.break,void 0,1)}function is(e,t,n){if(n){if(n.allowNaN===!1&&Number.isNaN(e))throw new Error(`${de} NaN values are not supported`);if(n.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${de} Infinity values are not supported`)}return new re(U.float,e,t)}function LT(e,t,n,r){return is(ss(e,t+1),3,r)}function BT(e,t,n,r){return is(as(e,t+1),5,r)}function FT(e,t,n,r){return is(Pc(e,t+1),9,r)}function os(e,t,n){let r=t.value;if(r===!1)e.push([U.float.majorEncoded|CT]);else if(r===!0)e.push([U.float.majorEncoded|xT]);else if(r===null)e.push([U.float.majorEncoded|UT]);else if(r===void 0)e.push([U.float.majorEncoded|jT]);else{let i,s=!1;(!n||n.float64!==!0)&&(Ec(r),i=ss(Ot,1),r===i||Number.isNaN(r)?(Ot[0]=249,e.push(Ot.slice(0,3)),s=!0):(Sc(r),i=as(Ot,1),r===i&&(Ot[0]=250,e.push(Ot.slice(0,5)),s=!0))),s||(kT(r),i=Pc(Ot,1),Ot[0]=251,e.push(Ot.slice(0,9)))}}os.encodedSize=function(t,n){let r=t.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){Ec(r);let i=ss(Ot,1);if(r===i||Number.isNaN(r))return 3;if(Sc(r),i=as(Ot,1),r===i)return 5}return 9};var Ic=new ArrayBuffer(9),dt=new DataView(Ic,1),Ot=new Uint8Array(Ic,0);function Ec(e){if(e===1/0)dt.setUint16(0,31744,!1);else if(e===-1/0)dt.setUint16(0,64512,!1);else if(Number.isNaN(e))dt.setUint16(0,32256,!1);else{dt.setFloat32(0,e);let t=dt.getUint32(0),n=(t&2139095040)>>23,r=t&8388607;if(n===255)dt.setUint16(0,31744,!1);else if(n===0)dt.setUint16(0,(e&2147483648)>>16|r>>13,!1);else{let i=n-127;i<-24?dt.setUint16(0,0):i<-14?dt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):dt.setUint16(0,(t&2147483648)>>16|i+15<<10|r>>13,!1)}}}function ss(e,t){if(e.length-t<2)throw new Error(`${de} not enough data for float16`);let n=(e[t]<<8)+e[t+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;let r=n>>10&31,i=n&1023,s;return r===0?s=i*2**-24:r!==31?s=(i+1024)*2**(r-25):s=i===0?1/0:NaN,n&32768?-s:s}function Sc(e){dt.setFloat32(0,e,!1)}function as(e,t){if(e.length-t<4)throw new Error(`${de} not enough data for float32`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,4).getFloat32(0,!1)}function kT(e){dt.setFloat64(0,e,!1)}function Pc(e,t){if(e.length-t<8)throw new Error(`${de} not enough data for float64`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,8).getFloat64(0,!1)}os.compareTokens=_n.compareTokens;function _e(e,t,n){throw new Error(`${de} encountered invalid minor (${n}) for major ${e[t]>>>5}`)}function Pi(e){return()=>{throw new Error(`${de} ${e}`)}}var oe=[];for(let e=0;e<=23;e++)oe[e]=_e;oe[24]=J_;oe[25]=X_;oe[26]=Y_;oe[27]=Q_;oe[28]=_e;oe[29]=_e;oe[30]=_e;oe[31]=_e;for(let e=32;e<=55;e++)oe[e]=_e;oe[56]=Z_;oe[57]=eT;oe[58]=tT;oe[59]=nT;oe[60]=_e;oe[61]=_e;oe[62]=_e;oe[63]=_e;for(let e=64;e<=87;e++)oe[e]=rT;oe[88]=iT;oe[89]=oT;oe[90]=sT;oe[91]=aT;oe[92]=_e;oe[93]=_e;oe[94]=_e;oe[95]=Pi("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)oe[e]=cT;oe[120]=fT;oe[121]=lT;oe[122]=dT;oe[123]=pT;oe[124]=_e;oe[125]=_e;oe[126]=_e;oe[127]=Pi("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)oe[e]=hT;oe[152]=gT;oe[153]=mT;oe[154]=bT;oe[155]=vT;oe[156]=_e;oe[157]=_e;oe[158]=_e;oe[159]=_T;for(let e=160;e<=183;e++)oe[e]=TT;oe[184]=wT;oe[185]=OT;oe[186]=AT;oe[187]=IT;oe[188]=_e;oe[189]=_e;oe[190]=_e;oe[191]=ET;for(let e=192;e<=215;e++)oe[e]=ST;oe[216]=PT;oe[217]=$T;oe[218]=RT;oe[219]=NT;oe[220]=_e;oe[221]=_e;oe[222]=_e;oe[223]=_e;for(let e=224;e<=243;e++)oe[e]=Pi("simple values are not supported");oe[244]=_e;oe[245]=_e;oe[246]=_e;oe[247]=DT;oe[248]=Pi("simple values are not supported");oe[249]=LT;oe[250]=BT;oe[251]=FT;oe[252]=_e;oe[253]=_e;oe[254]=_e;oe[255]=MT;var Nt=[];for(let e=0;e<24;e++)Nt[e]=new re(U.uint,e,1);for(let e=-1;e>=-24;e--)Nt[31-e]=new re(U.negint,e,1);Nt[64]=new re(U.bytes,new Uint8Array(0),1);Nt[96]=new re(U.string,"",1);Nt[128]=new re(U.array,0,1);Nt[160]=new re(U.map,0,1);Nt[244]=new re(U.false,!1,1);Nt[245]=new re(U.true,!0,1);Nt[246]=new re(U.null,null,1);function KT(){let e=[];return e[U.uint.major]=_n,e[U.negint.major]=es,e[U.bytes.major]=Si,e[U.string.major]=yT,e[U.array.major]=ts,e[U.map.major]=ns,e[U.tag.major]=rs,e[U.float.major]=os,e}var Ww=KT(),wo=new Oc,hu=class $c{constructor(t,n){this.obj=t,this.parent=n}includes(t){let n=this;do if(n.obj===t)return!0;while(n=n.parent);return!1}static createCheck(t,n){if(t&&t.includes(n))throw new Error(`${pn} object contains circular references`);return new $c(n,t)}},Wt={null:new re(U.null,null),undefined:new re(U.undefined,void 0),true:new re(U.true,!0),false:new re(U.false,!1),emptyArray:new re(U.array,0),emptyMap:new re(U.map,0)},Xt={number(e,t,n,r){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new re(U.float,e):e>=0?new re(U.uint,e):new re(U.negint,e)},bigint(e,t,n,r){return e>=BigInt(0)?new re(U.uint,e):new re(U.negint,e)},Uint8Array(e,t,n,r){return new re(U.bytes,e)},string(e,t,n,r){return new re(U.string,e)},boolean(e,t,n,r){return e?Wt.true:Wt.false},null(e,t,n,r){return Wt.null},undefined(e,t,n,r){return Wt.undefined},ArrayBuffer(e,t,n,r){return new re(U.bytes,new Uint8Array(e))},DataView(e,t,n,r){return new re(U.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,n,r){if(!e.length)return n.addBreakTokens===!0?[Wt.emptyArray,new re(U.break)]:Wt.emptyArray;r=hu.createCheck(r,e);let i=[],s=0;for(let o of e)i[s++]=ei(o,n,r);return n.addBreakTokens?[new re(U.array,e.length),i,new re(U.break)]:[new re(U.array,e.length),i]},Object(e,t,n,r){let i=t!=="Object",s=i?e.keys():Object.keys(e),o=i?e.size:s.length;if(!o)return n.addBreakTokens===!0?[Wt.emptyMap,new re(U.break)]:Wt.emptyMap;r=hu.createCheck(r,e);let u=[],f=0;for(let c of s)u[f++]=[ei(c,n,r),ei(i?e.get(c):e[c],n,r)];return GT(u,n),n.addBreakTokens?[new re(U.map,o),u,new re(U.break)]:[new re(U.map,o),u]}};Xt.Map=Xt.Object;Xt.Buffer=Xt.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Xt[`${e}Array`]=Xt.DataView;function ei(e,t={},n){let r=B_(e),i=t&&t.typeEncoders&&t.typeEncoders[r]||Xt[r];if(typeof i=="function"){let o=i(e,r,t,n);if(o!=null)return o}let s=Xt[r];if(!s)throw new Error(`${pn} unsupported type: ${r}`);return s(e,r,t,n)}function GT(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Rc(e,t,n,r){if(Array.isArray(t))for(let i of t)Rc(e,i,n,r);else n[t.type.major](e,t,r)}function VT(e,t,n){let r=ei(e,n);if(!Array.isArray(r)&&n.quickEncodeToken){let i=n.quickEncodeToken(r);if(i)return i;let s=t[r.type.major];if(s.encodedSize){let o=s.encodedSize(r,n),u=new Oc(o);if(s(u,r,n),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return Yo(u.chunks[0])}}return wo.reset(),Rc(wo,r,t,n),wo.toBytes(!0)}var zT={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},qT=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=Nt[e];if(t===void 0){let n=oe[e];if(!n)throw new Error(`${de} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let r=e&31;t=n(this.data,this._pos,r,this.options)}return this._pos+=t.encodedLength,t}},mr=Symbol.for("DONE"),$i=Symbol.for("BREAK");function WT(e,t,n){let r=[];for(let i=0;i<e.value;i++){let s=br(t,n);if(s===$i){if(e.value===1/0)break;throw new Error(`${de} got unexpected break to lengthed array`)}if(s===mr)throw new Error(`${de} found array but not enough entries (got ${i}, expected ${e.value})`);r[i]=s}return r}function HT(e,t,n){let r=n.useMaps===!0,i=r?void 0:{},s=r?new Map:void 0;for(let o=0;o<e.value;o++){let u=br(t,n);if(u===$i){if(e.value===1/0)break;throw new Error(`${de} got unexpected break to lengthed map`)}if(u===mr)throw new Error(`${de} found map but not enough entries (got ${o} [no key], expected ${e.value})`);if(r!==!0&&typeof u!="string")throw new Error(`${de} non-string keys not supported (got ${typeof u})`);if(n.rejectDuplicateMapKeys===!0&&(r&&s.has(u)||!r&&u in i))throw new Error(`${de} found repeat map key "${u}"`);let f=br(t,n);if(f===mr)throw new Error(`${de} found map but not enough entries (got ${o} [no value], expected ${e.value})`);r?s.set(u,f):i[u]=f}return r?s:i}function br(e,t){if(e.done())return mr;let n=e.next();if(n.type===U.break)return $i;if(n.type.terminal)return n.value;if(n.type===U.array)return WT(n,e,t);if(n.type===U.map)return HT(n,e,t);if(n.type===U.tag){if(t.tags&&typeof t.tags[n.value]=="function"){let r=br(e,t);return t.tags[n.value](r)}throw new Error(`${de} tag not supported (${n.value})`)}throw new Error("unsupported")}function JT(e,t){if(!(e instanceof Uint8Array))throw new Error(`${de} data to decode must be a Uint8Array`);t=Object.assign({},zT,t);let n=t.tokenizer||new qT(e,t),r=br(n,t);if(r===mr)throw new Error(`${de} did not find any content to decode`);if(r===$i)throw new Error(`${de} got unexpected break`);return[r,e.subarray(n.pos())]}function XT(e,t){let[n,r]=JT(e,t);if(r.length>0)throw new Error(`${de} too many terminals, data makes no sense`);return n}var YT=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===U.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===U.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[U.uint.major](e,t){this.prefix(e);let n=String(t.value),r=[];for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);e.push(r)}[U.negint.major](e,t){this[U.uint.major](e,t)}[U.bytes.major](e,t){throw new Error(`${pn} unsupported type: Uint8Array`)}[U.string.major](e,t){this.prefix(e);let n=Tc(JSON.stringify(t.value));e.push(n.length>32?Yo(n):n)}[U.array.major](e,t){this.prefix(e),this.inRecursive.push({type:U.array,elements:0}),e.push([91])}[U.map.major](e,t){this.prefix(e),this.inRecursive.push({type:U.map,elements:0}),e.push([123])}[U.tag.major](e,t){}[U.float.major](e,t){if(t.type.name==="break"){let s=this.inRecursive.pop();if(s){if(s.type===U.array)e.push([93]);else if(s.type===U.map)e.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(t.value===void 0)throw new Error(`${pn} unsupported type: undefined`);if(this.prefix(e),t.type.name==="true"){e.push([116,114,117,101]);return}else if(t.type.name==="false"){e.push([102,97,108,115,101]);return}else if(t.type.name==="null"){e.push([110,117,108,108]);return}let n=String(t.value),r=[],i=!1;for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s),!i&&(r[s]===46||r[s]===101||r[s]===69)&&(i=!0);i||(r.push(46),r.push(48)),e.push(r)}};function QT(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${pn} complex map keys are not supported`);let n=e[0],r=t[0];if(n.type!==U.string||r.type!==U.string)throw new Error(`${pn} non-string map keys are not supported`);if(n<r)return-1;if(n>r)return 1;throw new Error(`${pn} unexpected duplicate map keys, this is not supported`)}var ZT={addBreakTokens:!0,mapSorter:QT};function e0(e,t){return t=Object.assign({},ZT,t),VT(e,new YT,t)}var Nc=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t,this.modeStack=["value"],this.lastToken=""}pos(){return this._pos}done(){return this._pos>=this.data.length}ch(){return this.data[this._pos]}currentMode(){return this.modeStack[this.modeStack.length-1]}skipWhitespace(){let e=this.ch();for(;e===32||e===9||e===13||e===10;)e=this.data[++this._pos]}expect(e){if(this.data.length-this._pos<e.length)throw new Error(`${de} unexpected end of input at position ${this._pos}`);for(let t=0;t<e.length;t++)if(this.data[this._pos++]!==e[t])throw new Error(`${de} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,n=!1,r=o=>{for(;!this.done();){let u=this.ch();if(o.includes(u))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,n=!0;else return new re(U.uint,0,this._pos-e);if(r([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${de} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(n)throw new Error(`${de} unexpected token at position ${this._pos}`);n=!0,this._pos++,r([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(n=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,r([48,49,50,51,52,53,54,55,56,57]));let i=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),s=parseFloat(i);return n?new re(U.float,s,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(s)?new re(s>=0?U.uint:U.negint,s,this._pos-e):new re(s>=0?U.uint:U.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${de} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,s=0;i<this.data.length&&s<65536;i++,s++){let o=this.data[i];if(o===92||o<32||o>=128)break;if(o===34){let u=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new re(U.string,u,s)}}let e=this._pos,t=[],n=()=>{if(this._pos+4>=this.data.length)throw new Error(`${de} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let s=0;s<4;s++){let o=this.ch();if(o>=48&&o<=57)o-=48;else if(o>=97&&o<=102)o=o-97+10;else if(o>=65&&o<=70)o=o-65+10;else throw new Error(`${de} unexpected unicode escape character at position ${this._pos}`);i=i*16+o,this._pos++}return i},r=()=>{let i=this.ch(),s=null,o=i>239?4:i>223?3:i>191?2:1;if(this._pos+o>this.data.length)throw new Error(`${de} unexpected unicode sequence at position ${this._pos}`);let u,f,c,g;switch(o){case 1:i<128&&(s=i);break;case 2:u=this.data[this._pos+1],(u&192)===128&&(g=(i&31)<<6|u&63,g>127&&(s=g));break;case 3:u=this.data[this._pos+1],f=this.data[this._pos+2],(u&192)===128&&(f&192)===128&&(g=(i&15)<<12|(u&63)<<6|f&63,g>2047&&(g<55296||g>57343)&&(s=g));break;case 4:u=this.data[this._pos+1],f=this.data[this._pos+2],c=this.data[this._pos+3],(u&192)===128&&(f&192)===128&&(c&192)===128&&(g=(i&15)<<18|(u&63)<<12|(f&63)<<6|c&63,g>65535&&g<1114112&&(s=g))}s===null?(s=65533,o=1):s>65535&&(s-=65536,t.push(s>>>10&1023|55296),s=56320|s&1023),t.push(s),this._pos+=o};for(;!this.done();){let i=this.ch(),s;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${de} unexpected string termination at position ${this._pos}`);switch(s=this.ch(),this._pos++,s){case 34:case 39:case 92:case 47:t.push(s);break;case 98:t.push(8);break;case 116:t.push(9);break;case 110:t.push(10);break;case 102:t.push(12);break;case 114:t.push(13);break;case 117:t.push(n());break;default:throw new Error(`${de} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new re(U.string,wc(t),this._pos-e);default:if(i<32)throw new Error(`${de} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):r()}}throw new Error(`${de} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new re(U.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new re(U.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new re(U.null,null,4);case 102:return this.expect([102,97,108,115,101]),new re(U.false,!1,5);case 116:return this.expect([116,114,117,101]),new re(U.true,!0,4);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:throw new Error(`${de} unexpected character at position ${this._pos}`)}}next(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue();case"array-value":{if(this.modeStack.pop(),this.ch()===93)return this._pos++,this.skipWhitespace(),new re(U.break,void 0,1);if(this.ch()!==44)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()}case"array-start":return this.modeStack.pop(),this.ch()===93?(this._pos++,this.skipWhitespace(),new re(U.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue());case"obj-key":if(this.ch()===125)return this.modeStack.pop(),this._pos++,this.skipWhitespace(),new re(U.break,void 0,1);if(this.ch()!==44)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`);this._pos++,this.skipWhitespace();case"obj-start":{if(this.modeStack.pop(),this.ch()===125)return this._pos++,this.skipWhitespace(),new re(U.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("obj-value"),e}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${de} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function t0(e,t){return t=Object.assign({tokenizer:new Nc(e,t)},t),XT(e,t)}var Hw=new Uint8Array(0);function n0(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function us(e){if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}function r0(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(n[o]!==255)throw new TypeError(s+" is ambiguous");n[o]=i}var u=e.length,f=e.charAt(0),c=Math.log(u)/Math.log(256),g=Math.log(256)/Math.log(u);function b(L){if(L instanceof Uint8Array||(ArrayBuffer.isView(L)?L=new Uint8Array(L.buffer,L.byteOffset,L.byteLength):Array.isArray(L)&&(L=Uint8Array.from(L))),!(L instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(L.length===0)return"";for(var H=0,Z=0,K=0,B=L.length;K!==B&&L[K]===0;)K++,H++;for(var V=(B-K)*g+1>>>0,q=new Uint8Array(V);K!==B;){for(var F=L[K],ee=0,z=V-1;(F!==0||ee<Z)&&z!==-1;z--,ee++)F+=256*q[z]>>>0,q[z]=F%u>>>0,F=F/u>>>0;if(F!==0)throw new Error("Non-zero carry");Z=ee,K++}for(var fe=V-Z;fe!==V&&q[fe]===0;)fe++;for(var N=f.repeat(H);fe<V;++fe)N+=e.charAt(q[fe]);return N}function M(L){if(typeof L!="string")throw new TypeError("Expected String");if(L.length===0)return new Uint8Array;var H=0;if(L[H]!==" "){for(var Z=0,K=0;L[H]===f;)Z++,H++;for(var B=(L.length-H)*c+1>>>0,V=new Uint8Array(B);L[H];){var q=n[L.charCodeAt(H)];if(q===255)return;for(var F=0,ee=B-1;(q!==0||F<K)&&ee!==-1;ee--,F++)q+=u*V[ee]>>>0,V[ee]=q%256>>>0,q=q/256>>>0;if(q!==0)throw new Error("Non-zero carry");K=F,H++}if(L[H]!==" "){for(var z=B-K;z!==B&&V[z]===0;)z++;for(var fe=new Uint8Array(Z+(B-z)),N=Z;z!==B;)fe[N++]=V[z++];return fe}}}function $(L){var H=M(L);if(H)return H;throw new Error(`Non-${t} character`)}return{encode:b,decodeUnsafe:M,decode:$}}var i0=r0,o0=i0,s0=o0,a0=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},u0=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let r=t.codePointAt(0);if(r===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r,this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Cc(this,e)}},c0=class{decoders;constructor(e){this.decoders=e}or(e){return Cc(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Cc(e,t){return new c0({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var f0=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new a0(e,t,n),this.decoder=new u0(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function xc({name:e,prefix:t,encode:n,decode:r}){return new f0(e,t,n,r)}function Ri({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=s0(n,e);return xc({prefix:t,name:e,encode:r,decode:s=>us(i(s))})}function l0(e,t,n,r){let i=e.length;for(;e[i-1]==="=";)--i;let s=new Uint8Array(i*n/8|0),o=0,u=0,f=0;for(let c=0;c<i;++c){let g=t[e[c]];if(g===void 0)throw new SyntaxError(`Non-${r} character`);u=u<<n|g,o+=n,o>=8&&(o-=8,s[f++]=255&u>>o)}if(o>=n||(255&u<<8-o)!==0)throw new SyntaxError("Unexpected end of data");return s}function d0(e,t,n){let r=t[t.length-1]==="=",i=(1<<n)-1,s="",o=0,u=0;for(let f=0;f<e.length;++f)for(u=u<<8|e[f],o+=8;o>n;)o-=n,s+=t[i&u>>o];if(o!==0&&(s+=t[i&u<<n-o]),r)for(;(s.length*n&7)!==0;)s+="=";return s}function p0(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function et({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=p0(r);return xc({prefix:t,name:e,encode(s){return d0(s,r,n)},decode(s){return l0(s,i,n,e)}})}var ti=et({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Jw=et({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Xw=et({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Yw=et({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Qw=et({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Zw=et({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),eO=et({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),tO=et({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),nO=et({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Oo=Ri({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rO=Ri({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Ht=Ri({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),iO=Ri({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),y0={};po(y0,{Digest:()=>Ni,create:()=>cs,decode:()=>jc,equals:()=>Dc,hasCode:()=>x0});var h0=Uc,gu=128,g0=127,m0=~g0,b0=Math.pow(2,31);function Uc(e,t,n){t=t||[],n=n||0;for(var r=n;e>=b0;)t[n++]=e&255|gu,e/=128;for(;e&m0;)t[n++]=e&255|gu,e>>>=7;return t[n]=e|0,Uc.bytes=n-r+1,t}var v0=$o,_0=128,mu=127;function $o(e,r){var n=0,r=r||0,i=0,s=r,o,u=e.length;do{if(s>=u)throw $o.bytes=0,new RangeError("Could not decode varint");o=e[s++],n+=i<28?(o&mu)<<i:(o&mu)*Math.pow(2,i),i+=7}while(o>=_0);return $o.bytes=s-r,n}var T0=Math.pow(2,7),w0=Math.pow(2,14),O0=Math.pow(2,21),A0=Math.pow(2,28),I0=Math.pow(2,35),E0=Math.pow(2,42),S0=Math.pow(2,49),P0=Math.pow(2,56),$0=Math.pow(2,63),R0=function(e){return e<T0?1:e<w0?2:e<O0?3:e<A0?4:e<I0?5:e<E0?6:e<S0?7:e<P0?8:e<$0?9:10},N0={encode:h0,decode:v0,encodingLength:R0},C0=N0,yi=C0;function Ro(e,t=0){return[yi.decode(e,t),yi.decode.bytes]}function hi(e,t,n=0){return yi.encode(e,t,n),t}function gi(e){return yi.encodingLength(e)}function cs(e,t){let n=t.byteLength,r=gi(e),i=r+gi(n),s=new Uint8Array(i+n);return hi(e,s,0),hi(n,s,r),s.set(t,i),new Ni(e,n,t,s)}function jc(e){let t=us(e),[n,r]=Ro(t),[i,s]=Ro(t.subarray(r)),o=t.subarray(r+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Ni(n,i,o,t)}function Dc(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&n0(e.bytes,n.bytes)}}var Ni=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}};function x0(e,t){return e.code===t}function bu(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return j0(n,No(e),t??Ht.encoder);default:return D0(n,No(e),t??ti.encoder)}}var vu=new WeakMap;function No(e){let t=vu.get(e);if(t==null){let n=new Map;return vu.set(e,n),n}return t}var Mc=class Be{code;version;multihash;bytes;"/";constructor(t,n,r,i){this.code=n,this.version=t,this.multihash=r,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:n}=this;if(t!==cr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==M0)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Be.createV0(n)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:n}=this.multihash,r=cs(t,n);return Be.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return Be.equals(this,t)}static equals(t,n){let r=n;return r!=null&&t.code===r.code&&t.version===r.version&&Dc(t.multihash,r.multihash)}toString(t){return bu(this,t)}toJSON(){return{"/":bu(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let n=t;if(n instanceof Be)return n;if(n["/"]!=null&&n["/"]===n.bytes||n.asCID===n){let{version:r,code:i,multihash:s,bytes:o}=n;return new Be(r,i,s,o??_u(r,i,s.bytes))}else if(n[L0]===!0){let{version:r,multihash:i,code:s}=n,o=jc(i);return Be.create(r,s,o)}else return null}static create(t,n,r){if(typeof n!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(n!==cr)throw new Error(`Version 0 CID must use dag-pb (code: ${cr}) block encoding`);return new Be(t,n,r,r.bytes)}case 1:{let i=_u(t,n,r.bytes);return new Be(t,n,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return Be.create(0,cr,t)}static createV1(t,n){return Be.create(1,t,n)}static decode(t){let[n,r]=Be.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return n}static decodeFirst(t){let n=Be.inspectBytes(t),r=n.size-n.multihashSize,i=us(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw new Error("Incorrect length");let s=i.subarray(n.multihashSize-n.digestSize),o=new Ni(n.multihashCode,n.digestSize,s,i);return[n.version===0?Be.createV0(o):Be.createV1(n.codec,o),t.subarray(n.size)]}static inspectBytes(t){let n=0,r=()=>{let[b,M]=Ro(t.subarray(n));return n+=M,b},i=r(),s=cr;if(i===18?(i=0,n=0):s=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=n,u=r(),f=r(),c=n+f,g=c-o;return{version:i,codec:s,multihashCode:u,digestSize:f,multihashSize:g,size:c}}static parse(t,n){let[r,i]=U0(t,n),s=Be.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return No(s).set(r,t),s}};function U0(e,t){switch(e[0]){case"Q":{let n=t??Ht;return[Ht.prefix,n.decode(`${Ht.prefix}${e}`)]}case Ht.prefix:{let n=t??Ht;return[Ht.prefix,n.decode(e)]}case ti.prefix:{let n=t??ti;return[ti.prefix,n.decode(e)]}case Oo.prefix:{let n=t??Oo;return[Oo.prefix,n.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function j0(e,t,n){let{prefix:r}=n;if(r!==Ht.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let s=n.encode(e).slice(1);return t.set(r,s),s}else return i}function D0(e,t,n){let{prefix:r}=n,i=t.get(r);if(i==null){let s=n.encode(e);return t.set(r,s),s}else return i}var cr=112,M0=18;function _u(e,t,n){let r=gi(e),i=r+gi(t),s=new Uint8Array(i+n.byteLength);return hi(e,s,0),hi(t,s,r),s.set(n,i),s}var L0=Symbol.for("@ipld/js-cid/CID"),B0=20;function Lc({name:e,code:t,encode:n,minDigestLength:r,maxDigestLength:i}){return new F0(e,t,n,r,i)}var F0=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,r,i){this.name=e,this.code=t,this.encode=n,this.minDigestLength=r??B0,this.maxDigestLength=i}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let n=this.encode(e);return n instanceof Uint8Array?Tu(n,this.code,t?.truncate):n.then(r=>Tu(r,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function Tu(e,t,n){if(n!=null&&n!==e.byteLength){if(n>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,n)}return cs(t,e)}var Bc=et({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),oO=et({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),sO=et({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),aO=et({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function k0(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function K0(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Mc.asCID(e);if(!t)return null;let n=t.toString();return[new re(U.map,1/0,1),new re(U.string,"/",1),new re(U.string,n,n.length),new re(U.break,void 0,1)]}function mi(e){let t=Bc.encode(e).slice(1);return[new re(U.map,1/0,1),new re(U.string,"/",1),new re(U.map,1/0,1),new re(U.string,"bytes",5),new re(U.string,t,t.length),new re(U.break,void 0,1),new re(U.break,void 0,1)]}function wt(e){return mi(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function G0(e){return mi(new Uint8Array(e))}function V0(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function z0(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var q0={typeEncoders:{Object:K0,Buffer:mi,Uint8Array:mi,Int8Array:wt,Uint16Array:wt,Int16Array:wt,Uint32Array:wt,Int32Array:wt,Float32Array:wt,Float64Array:wt,Uint8ClampedArray:wt,BigInt64Array:wt,BigUint64Array:wt,DataView:wt,ArrayBuffer:G0,undefined:V0,number:z0}},W0=class extends Nc{constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===U.map){let t=this._next();if(t.type===U.string&&t.value==="/"){let n=this._next();if(n.type===U.string){if(this._next().type!==U.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(n),new re(U.tag,42,0)}if(n.type===U.map){let r=this._next();if(r.type===U.string&&r.value==="bytes"){let i=this._next();if(i.type===U.string){for(let o=0;o<2;o++)if(this._next().type!==U.break)throw new Error("Invalid encoded Bytes form");let s=Bc.decode(`m${i.value}`);return new re(U.bytes,s,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(r)}this.tokenBuffer.push(n)}this.tokenBuffer.push(t)}return e}},Co={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Co.tags[42]=Mc.parse;var H0="dag-json",J0=297,Fc=e=>e0(e,q0),kc=e=>{let t=k0(e),n=Object.assign(Co,{tokenizer:new W0(t,Co)});return t0(t,n)},wu=e=>X0.decode(Fc(e)),X0=new TextDecoder,Y0=e=>kc(Q0.encode(e)),Q0=new TextEncoder;var Ue=qt(Lt(),1),Kc=qt(Sd(),1),xo=e=>Ue.Type.Union([e,Ue.Type.Null()]);var Gc=/^(k51qz|baguq)[0-9a-z]{56,57}$/,Z0=/^[0-9A-Fa-f]{7,8}$/g;Ue.FormatRegistry.Set("EntityID",e=>!!e.match(Z0)||!!e.match(Gc));var Vc=Ue.Type.String();Ue.FormatRegistry.Set("CID",e=>!!e.match(Gc));var fs=Ue.Type.String({format:"CID"}),ew=/^http([s]?):\/\/.*\..*/;Ue.FormatRegistry.Set("URL",e=>!!e.match(ew));var tw=Ue.Type.String({format:"URL"}),ls=Ue.Type.Object({en:Vc,at:Ue.Type.String(),vl:xo(Ue.Type.Union([Ue.Type.String(),Ue.Type.Boolean(),Ue.Type.Number()])),ts:Ue.Type.String(),ag:Ue.Type.String(),pv:xo(fs)}),Uo=Kc.TypeCompiler.Compile(ls);var nw=Uo.Check.bind(Uo),zc=Ue.Type.Composite([Ue.Type.Object({cid:fs}),ls]),jo=Kc.TypeCompiler.Compile(zc);var rw=jo.Check.bind(jo);function qc(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var uO=Lc({name:"sha2-256",code:18,encode:qc("SHA-256")}),cO=Lc({name:"sha2-512",code:19,encode:qc("SHA-512")}),{WARN:fO,LOG:lO,DEBUG:dO,VERBOSE:pO,ERROR:yO}=xe.setup(xe.INFO);var{WARN:hO,LOG:gO,DEBUG:mO,VERBOSE:bO,ERROR:vO}=xe.setup(xe.INFO);var Wc=(e,t,n)=>ut.structural(cu(t,e),cu(n,e));var iw=v_(Wc,["en","at"]);var Ci=(e,t=8)=>Xc(ci(e),31,t);function Hc(e,t,n){let r;if(t){let i=typeof t;i==="string"?r=t===n:i==="function"?r=t(n):typeof t.has=="function"?r=t.has(n):Array.isArray(t)&&!Array.isArray(n)?r=t.includes(n):r=t===n}else r=t===n;return e.charAt(0)==="!"?!r:r}var Jc=function(t){for(var n=0,r=0,i=t.length;r<i;r++)n+=t[r];return n},Ou=function(t){return Jc(t)/t.length},Qe={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return Qe.max(e)-Qe.min(e)},midrange:function(e){return Qe.range(e)/2},sum:Jc,mean:Ou,average:Ou,median:function(e){e.sort(function(n,r){return n-r});var t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2},modes:function(e){if(!e.length)return[];var t={},n=0,r=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>n?(r=[i],n=t[i]):t[i]===n&&(r.push(i),n=t[i])}),r},variance:function(e){var t=Qe.mean(e);return Qe.mean(e.map(function(n){return Math.pow(n-t,2)}))},standardDeviation:function(e){return Math.sqrt(Qe.variance(e))},meanAbsoluteDeviation:function(e){var t=Qe.mean(e);return Qe.mean(e.map(function(n){return Math.abs(n-t)}))},zScores:function(e){var t=Qe.mean(e),n=Qe.standardDeviation(e);return e.map(function(r){return(r-t)/n})}};Qe.average=Qe.mean;var Xc=function(e,t=13,n){if(!e?.length)throw new Error(`Empty string: ${e}`);let r=3735928559^t,i=1103547991^t;for(let o=0,u;o<e.length;o++)u=e.charCodeAt(o),r=Math.imul(r^u,2654435761),i=Math.imul(i^u,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),(4294967296*(2097151&i)+(r>>>0)).toString(16).slice(-n).padStart(n,"0")};function xi(){return new Date().toISOString()}var{WARN:_O,LOG:TO,DEBUG:wO,VERBOSE:OO,ERROR:AO}=xe.setup(xe.INFO);var{WARN:Au,LOG:IO,DEBUG:Iu,VERBOSE:ln,ERROR:Eu}=xe.setup(xe.INFO),Yc=class Qc extends li{constructor(t,n,r,i,s,o=null){super(t,n,r,s?Pe.array([...i],{deep:!1,name:`${t}.array`}):i),this.name=t,this._initialLogs=i,this._eventMapper=s,this._writeMapper=o,oo(this,{onParentUpdate:gt}),s&&this.subscribeToParents()}static mapWrites(t,n,r){return new Qc(`${n}<${t.nameAndSizeUntracked}>`,t,t.filters,t._applogs,null,r)}_parentSubscriptions=null;insert(t){let n=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!n))return this.parents.forEach(r=>r.insert(n))}insertRaw(t){let n=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!n))return this.parents.forEach(r=>r.insertRaw(n))}subscribeToParents(){this._parentSubscriptions=new Map;let t=ro(()=>{this.parents.length||Au("MappedThread has no parents",this),ln(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(r=>r.name));let n=new Set([...this._parentSubscriptions.keys()]);for(let r of this.parents){n.delete(r)&&ln(`[MappedThread: ${this.name}] Skipping re-sub to parent`,r.nameAndSizeUntracked),ln(`[MappedThread: ${this.name}] sub to new parent`,r.nameAndSizeUntracked);let s=this.onParentUpdate.bind(this,r),o=r.subscribe(s);this._parentSubscriptions.set(r,o)}for(let r of n)ln(`[MappedThread: ${this.name}] un-subscribing from old parent`,r.nameAndSizeUntracked),this._parentSubscriptions.get(r)(),this._parentSubscriptions.delete(r)})}subscribe(t){return this._parentSubscriptions||this.subscribeToParents(),super.subscribe(t)}triggerRemap(){if(!this._eventMapper)throw Eu("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);Iu(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&Au(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Ve(()=>Nn(t.applogs))})})}onParentUpdate(t,n){ln(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,n);let r=this._eventMapper?this._eventMapper(n,t):n;if(this._eventMapper)if(ln(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,r),fi(r))this._applogs.replace([...r.init]);else{for(let i of r.added)this._applogs.splice(R_(this._applogs,i,"ts"),0,i);if(r.removed){for(let i of r.removed)if(!this._applogs.remove(i))if(!fi(n)&&n.removed?.includes(i))Iu("Ignoring remove event for non-existent because it was part of parent event's removed",i,n);else throw Eu(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:n,mapResult:r})}}ln(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Yr(this._applogs)),this.notifySubscribers(r)}get readOnly(){return!1}},{WARN:EO,LOG:SO,DEBUG:PO,VERBOSE:Ao,ERROR:ow}=xe.setup(xe.INFO),$O=Xo("rollingFilter",function(t,n,r={}){let i=sw(n),s=Su(i),o=Pe.array(Ve(function(){return s(t.applogs)}),{deep:!1,name:`${t.name} | ${r.name||`rollingFilter.array{${ci(i)}}`}`}),u=b=>{let M;return fi(b)?M={init:s(b.init)}:M={added:s(b.added),removed:b.removed},Ao(`rollingFilter{${t.nameAndSizeUntracked} | ${r.name?` '${r.name}'}`:""} parentUpdate`,i,b,"=>",M),M},f=new Yc(`${t.name} | ${r.name||`rollingFilter{${ci(i)}}`}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],o,u),c=ca(()=>Nn(n),b=>{Ao(`rollingFilter<${t.nameAndSizeUntracked}>${r.name?` '${r.name}'`:""} patternUpdate`,i,"=>",b),i=b,s=Su(i),f.triggerRemap()}),g=ir(o,()=>{Ao(`rollingFilter<${Ve(()=>t.name)}>${r.name?` '${r.name}'`:""} unobserve`,i),c(),g()});return f},{equals:_c,argsDebugName:(e,t,n)=>vc({caller:"rollingFilter",thread:e,pattern:t,args:n})}),RO=Xo("rollingMapper",function(t,n,r={}){let i=Ve(()=>n.call(null,{init:t.applogs},t));if(!fi(i))throw ow("Initial run must return init event");let s=i.init;return new Yc(`${t.name} | ${r.name||"rollingMapper"}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],s,n)},{equals:_c,argsDebugName:(e,t,n)=>vc({caller:"rollingMapper",thread:e,args:n})}),NO=Xo("rollingAcc",function(t,n,r,i={}){let s=gt(r);return s({init:t.applogs},n),t.subscribe(o=>{s(o,n)}),n},{argsDebugName:(e,t,n,r)=>`rollingAcc{${e.nameAndSizeUntracked}${r?.name?` | ${r?.name}`:""}}`}),sw=function(t){let n=Ve(function(){return Object.fromEntries(Object.entries(Nn(t)).map(([i,s])=>[Nn(i),Nn(s)]))});if(!Object.entries(n).length)throw new Error("Pattern is empty");return n};function Su(e){return function(n){return n.filter(function(i){for(let s of Object.keys(e)){let o=e[s];if(o===void 0)continue;let u=i[s.startsWith("!")?s.slice(1):s];if(!Hc(s,o,u))return!1}return!0})}}var{WARN:CO,LOG:xO,DEBUG:UO,VERBOSE:jO,ERROR:DO}=xe.setup(xe.INFO);var{WARN:MO,LOG:LO,DEBUG:BO,VERBOSE:FO,ERROR:kO}=xe.setup(xe.INFO);function aw(e){return typeof e=="string"?e:JSON.stringify(e)}function uw(e,t){let n=aw(e),r=t??Ci({content:n,ts:xi()},7);return{en:r,applogs:[{en:r,at:"block/content",vl:n}]}}function cw(e,t,n,r){let i=r??Ci({blockID:e,childOf:t,after:n,ts:xi()},7);return{en:i,applogs:[{en:i,at:"relation/block",vl:e},{en:i,at:"relation/childOf",vl:t},{en:i,at:"relation/after",vl:n}]}}function ds(e,t,n){let r=[],{en:i,applogs:s}=uw(e.content);if(r.push(...s),t){let{applogs:u}=cw(i,t,n??null);r.push(...u)}let o=null;if(e.children)for(let u of e.children){let f=ds(u,i,o);r.push(...f.applogs),o=f.blockID}return{blockID:i,applogs:r}}function tI(e,t){let n=[],r=[],i=null;for(let s of e){let o=ds(s,t,i);n.push(...o.applogs),r.push(o.blockID),i=o.blockID}return{rootIDs:r,applogs:n}}function nI(e){return ds(e)}export{uw as a,cw as b,ds as c,tI as d,nI as e};
62
+ /*! Bundled license information:
63
+
64
+ lodash-es/lodash.js:
65
+ (**
66
+ * @license
67
+ * Lodash (Custom Build) <https://lodash.com/>
68
+ * Build: `lodash modularize exports="es" -o ./`
69
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
70
+ * Released under MIT license <https://lodash.com/license>
71
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
72
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
73
+ *)
74
+
75
+ @noble/hashes/utils.js:
76
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
77
+ */
78
+ //# sourceMappingURL=chunk-K5PSO7Y4.min.js.map