@wovin/connect-nftstorage 0.0.14 → 0.0.15
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.
- package/dist/{chunk-WJCHHT2E.min.js → chunk-BKKH6BET.min.js} +1 -1
- package/dist/{chunk-WJCHHT2E.min.js.map → chunk-BKKH6BET.min.js.map} +1 -1
- package/dist/{chunk-RCYKXPTN.min.js → chunk-PRWLUGGV.min.js} +2 -2
- package/dist/chunk-S46LOB6N.min.js +80 -0
- package/dist/chunk-S46LOB6N.min.js.map +1 -0
- package/dist/index.min.js +1 -1
- package/dist/retrieve.d.ts +6 -6
- package/dist/retrieve.min.js +1 -1
- package/dist/store.min.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-UKUL4GYR.min.js +0 -80
- package/dist/chunk-UKUL4GYR.min.js.map +0 -1
- /package/dist/{chunk-RCYKXPTN.min.js.map → chunk-PRWLUGGV.min.js.map} +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import{e as va}from"./chunk-BKKH6BET.min.js";var pp=Object.create,cc=Object.defineProperty,hp=Object.getOwnPropertyDescriptor,yp=Object.getOwnPropertyNames,mp=Object.getPrototypeOf,gp=Object.prototype.hasOwnProperty,gn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yp(t))!gp.call(e,i)&&i!==r&&cc(e,i,{get:()=>t[i],enumerable:!(n=hp(t,i))||n.enumerable});return e},gi=(e,t,r)=>(r=e!=null?pp(mp(e)):{},vp(t||!e||!e.__esModule?cc(r,"default",{value:e,enumerable:!0}):r,e)),bp=gn((e,t)=>{"use strict";t.exports=a;var r=128,n=127,i=~n,o=Math.pow(2,31);function a(s,u,c){if(Number.MAX_SAFE_INTEGER&&s>Number.MAX_SAFE_INTEGER)throw a.bytes=0,new RangeError("Could not encode varint");u=u||[],c=c||0;for(var f=c;s>=o;)u[c++]=s&255|r,s/=128;for(;s&i;)u[c++]=s&255|r,s>>>=7;return u[c]=s|0,a.bytes=c-f+1,u}}),wp=gn((e,t)=>{"use strict";t.exports=i;var r=128,n=127;function i(o,u){var s=0,u=u||0,c=0,f=u,p,S=o.length;do{if(f>=S||c>49)throw i.bytes=0,new RangeError("Could not decode varint");p=o[f++],s+=c<28?(p&n)<<c:(p&n)*Math.pow(2,c),c+=7}while(p>=r);return i.bytes=f-u,s}}),_p=gn((e,t)=>{"use strict";var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),a=Math.pow(2,35),s=Math.pow(2,42),u=Math.pow(2,49),c=Math.pow(2,56),f=Math.pow(2,63);t.exports=function(p){return p<r?1:p<n?2:p<i?3:p<o?4:p<a?5:p<s?6:p<u?7:p<c?8:p<f?9:10}}),ds=gn((e,t)=>{"use strict";t.exports={encode:bp(),decode:wp(),encodingLength:_p()}}),Tp=gn(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r=typeof window<"u"&&typeof window.document<"u",n=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,i=(typeof self>"u"?"undefined":t(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",o=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),a=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";e.isBrowser=r,e.isWebWorker=i,e.isNode=n,e.isJsDom=o,e.isDeno=a}),Op=gn((e,t)=>{"use strict";t.exports=function(r,n){n||(n={}),typeof n=="function"&&(n={cmp:n});var i=typeof n.cycles=="boolean"?n.cycles:!1,o=n.cmp&&function(s){return function(u){return function(c,f){var p={key:c,value:u[c]},S={key:f,value:u[f]};return s(p,S)}}}(n.cmp),a=[];return function s(u){if(u&&u.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u!==void 0){if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);var c,f;if(Array.isArray(u)){for(f="[",c=0;c<u.length;c++)c&&(f+=","),f+=s(u[c])||"null";return f+"]"}if(u===null)return"null";if(a.indexOf(u)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var p=a.push(u)-1,S=Object.keys(u).sort(o&&o(u));for(f="",c=0;c<S.length;c++){var T=S[c],I=s(u[T]);I&&(f&&(f+=","),f+=JSON.stringify(T)+":"+I)}return a.splice(p,1),"{"+f+"}"}}(r)}}),xp=["string","number","bigint","symbol"],Ep=["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 Ap(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;return xp.includes(t)?t:t==="function"?"Function":Array.isArray(e)?"Array":Ip(e)?"Buffer":Sp(e)||"Object"}function Ip(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Sp(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Ep.includes(t))return t}var H=class{constructor(e,t,r){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};H.uint=new H(0,"uint",!0);H.negint=new H(1,"negint",!0);H.bytes=new H(2,"bytes",!0);H.string=new H(3,"string",!0);H.array=new H(4,"array",!1);H.map=new H(5,"map",!1);H.tag=new H(6,"tag",!1);H.float=new H(7,"float",!0);H.false=new H(7,"false",!0);H.true=new H(7,"true",!0);H.null=new H(7,"null",!0);H.undefined=new H(7,"undefined",!0);H.break=new H(7,"break",!0);var pe=class{constructor(e,t,r){this.type=e,this.value=t,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},vn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",jp=new TextDecoder,$p=new TextEncoder;function Yi(e){return vn&&globalThis.Buffer.isBuffer(e)}function kp(e){return e instanceof Uint8Array?Yi(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var Pp=vn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):xu(e,t,r):(e,t,r)=>r-t>64?jp.decode(e.subarray(t,r)):xu(e,t,r),Np=vn?e=>e.length>64?globalThis.Buffer.from(e):Ou(e):e=>e.length>64?$p.encode(e):Ou(e),ps=vn?(e,t,r)=>Yi(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Up=vn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),kp(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},Rp=vn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function Bp(e,t){if(Yi(e)&&Yi(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function Ou(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}function xu(e,t,r){let n=[];for(;t<r;){let i=e[t],o=null,a=i>239?4:i>223?3:i>191?2:1;if(t+a<=r){let s,u,c,f;switch(a){case 1:i<128&&(o=i);break;case 2:s=e[t+1],(s&192)===128&&(f=(i&31)<<6|s&63,f>127&&(o=f));break;case 3:s=e[t+1],u=e[t+2],(s&192)===128&&(u&192)===128&&(f=(i&15)<<12|(s&63)<<6|u&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:s=e[t+1],u=e[t+2],c=e[t+3],(s&192)===128&&(u&192)===128&&(c&192)===128&&(f=(i&15)<<18|(s&63)<<12|(u&63)<<6|c&63,f>65535&&f<1114112&&(o=f))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),t+=a}return Mp(n)}var Eu=4096;function Mp(e){let t=e.length;if(t<=Eu)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Eu));return r}var Cp=256,Lp=class{constructor(e=Cp){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=Rp(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 r=this.chunks[0];e&&this.cursor>r.length/2?(t=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=ps(r,0,this.cursor)}else t=Up(this.chunks,this.cursor);return e&&this.reset(),t}},Te="CBOR decode error:",fc="CBOR encode error:",vi=[];vi[23]=1;vi[24]=2;vi[25]=3;vi[26]=5;vi[27]=9;function bn(e,t,r){if(e.length-t<r)throw new Error(`${Te} not enough data for type`)}var Je=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Fr(e,t,r){bn(e,t,1);let n=e[t];if(r.strict===!0&&n<Je[0])throw new Error(`${Te} integer encoded in more bytes than necessary (strict decode)`);return n}function Gr(e,t,r){bn(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Je[1])throw new Error(`${Te} integer encoded in more bytes than necessary (strict decode)`);return n}function zr(e,t,r){bn(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Je[2])throw new Error(`${Te} integer encoded in more bytes than necessary (strict decode)`);return n}function Kr(e,t,r){bn(e,t,8);let n=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],o=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&o<Je[3])throw new Error(`${Te} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(r.allowBigInt===!0)return o;throw new Error(`${Te} integers outside of the safe integer range are not supported`)}function Dp(e,t,r,n){return new pe(H.uint,Fr(e,t+1,n),2)}function Vp(e,t,r,n){return new pe(H.uint,Gr(e,t+1,n),3)}function Fp(e,t,r,n){return new pe(H.uint,zr(e,t+1,n),5)}function Gp(e,t,r,n){return new pe(H.uint,Kr(e,t+1,n),9)}function qr(e,t){return St(e,0,t.value)}function St(e,t,r){if(r<Je[0]){let n=Number(r);e.push([t|n])}else if(r<Je[1]){let n=Number(r);e.push([t|24,n])}else if(r<Je[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Je[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Je[4]){let i=[t|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),a=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=o&255,o=o>>8,i[7]=o&255,o=o>>8,i[6]=o&255,o=o>>8,i[5]=o&255,i[4]=a&255,a=a>>8,i[3]=a&255,a=a>>8,i[2]=a&255,a=a>>8,i[1]=a&255,e.push(i)}else throw new Error(`${Te} encountered BigInt larger than allowable range`)}}qr.encodedSize=function(e){return St.encodedSize(e.value)};St.encodedSize=function(e){return e<Je[0]?1:e<Je[1]?2:e<Je[2]?3:e<Je[3]?5:9};qr.compareTokens=function(e,t){return e.value<t.value?-1:e.value>t.value?1:0};function zp(e,t,r,n){return new pe(H.negint,-1-Fr(e,t+1,n),2)}function Kp(e,t,r,n){return new pe(H.negint,-1-Gr(e,t+1,n),3)}function qp(e,t,r,n){return new pe(H.negint,-1-zr(e,t+1,n),5)}var hs=BigInt(-1),dc=BigInt(1);function Wp(e,t,r,n){let i=Kr(e,t+1,n);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new pe(H.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${Te} integers outside of the safe integer range are not supported`);return new pe(H.negint,hs-BigInt(i),9)}function ys(e,t){let r=t.value,n=typeof r=="bigint"?r*hs-dc:r*-1-1;St(e,t.type.majorEncoded,n)}ys.encodedSize=function(e){let t=e.value,r=typeof t=="bigint"?t*hs-dc:t*-1-1;return r<Je[0]?1:r<Je[1]?2:r<Je[2]?3:r<Je[3]?5:9};ys.compareTokens=function(e,t){return e.value<t.value?1:e.value>t.value?-1:0};function bi(e,t,r,n){bn(e,t,r+n);let i=ps(e,t+r,t+r+n);return new pe(H.bytes,i,r+n)}function Hp(e,t,r,n){return bi(e,t,1,r)}function Jp(e,t,r,n){return bi(e,t,2,Fr(e,t+1,n))}function Xp(e,t,r,n){return bi(e,t,3,Gr(e,t+1,n))}function Zp(e,t,r,n){return bi(e,t,5,zr(e,t+1,n))}function Qp(e,t,r,n){let i=Kr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${Te} 64-bit integer bytes lengths not supported`);return bi(e,t,9,i)}function eo(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===H.string?Np(e.value):e.value),e.encodedBytes}function Bo(e,t){let r=eo(t);St(e,t.type.majorEncoded,r.length),e.push(r)}Bo.encodedSize=function(e){let t=eo(e);return St.encodedSize(t.length)+t.length};Bo.compareTokens=function(e,t){return Yp(eo(e),eo(t))};function Yp(e,t){return e.length<t.length?-1:e.length>t.length?1:Bp(e,t)}function wi(e,t,r,n,i){let o=r+n;bn(e,t,o);let a=new pe(H.string,Pp(e,t+r,t+o),o);return i.retainStringBytes===!0&&(a.byteValue=ps(e,t+r,t+o)),a}function eh(e,t,r,n){return wi(e,t,1,r,n)}function th(e,t,r,n){return wi(e,t,2,Fr(e,t+1,n),n)}function rh(e,t,r,n){return wi(e,t,3,Gr(e,t+1,n),n)}function nh(e,t,r,n){return wi(e,t,5,zr(e,t+1,n),n)}function ih(e,t,r,n){let i=Kr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${Te} 64-bit integer string lengths not supported`);return wi(e,t,9,i,n)}var oh=Bo;function wn(e,t,r,n){return new pe(H.array,n,r)}function ah(e,t,r,n){return wn(e,t,1,r)}function sh(e,t,r,n){return wn(e,t,2,Fr(e,t+1,n))}function uh(e,t,r,n){return wn(e,t,3,Gr(e,t+1,n))}function lh(e,t,r,n){return wn(e,t,5,zr(e,t+1,n))}function ch(e,t,r,n){let i=Kr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${Te} 64-bit integer array lengths not supported`);return wn(e,t,9,i)}function fh(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Te} indefinite length items not allowed`);return wn(e,t,1,1/0)}function ms(e,t){St(e,H.array.majorEncoded,t.value)}ms.compareTokens=qr.compareTokens;ms.encodedSize=function(e){return St.encodedSize(e.value)};function _n(e,t,r,n){return new pe(H.map,n,r)}function dh(e,t,r,n){return _n(e,t,1,r)}function ph(e,t,r,n){return _n(e,t,2,Fr(e,t+1,n))}function hh(e,t,r,n){return _n(e,t,3,Gr(e,t+1,n))}function yh(e,t,r,n){return _n(e,t,5,zr(e,t+1,n))}function mh(e,t,r,n){let i=Kr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${Te} 64-bit integer map lengths not supported`);return _n(e,t,9,i)}function gh(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Te} indefinite length items not allowed`);return _n(e,t,1,1/0)}function gs(e,t){St(e,H.map.majorEncoded,t.value)}gs.compareTokens=qr.compareTokens;gs.encodedSize=function(e){return St.encodedSize(e.value)};function vh(e,t,r,n){return new pe(H.tag,r,1)}function bh(e,t,r,n){return new pe(H.tag,Fr(e,t+1,n),2)}function wh(e,t,r,n){return new pe(H.tag,Gr(e,t+1,n),3)}function _h(e,t,r,n){return new pe(H.tag,zr(e,t+1,n),5)}function Th(e,t,r,n){return new pe(H.tag,Kr(e,t+1,n),9)}function vs(e,t){St(e,H.tag.majorEncoded,t.value)}vs.compareTokens=qr.compareTokens;vs.encodedSize=function(e){return St.encodedSize(e.value)};var Oh=20,xh=21,Eh=22,Ah=23;function Ih(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${Te} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new pe(H.null,null,1):new pe(H.undefined,void 0,1)}function Sh(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Te} indefinite length items not allowed`);return new pe(H.break,void 0,1)}function bs(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${Te} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${Te} Infinity values are not supported`)}return new pe(H.float,e,t)}function jh(e,t,r,n){return bs(_s(e,t+1),3,n)}function $h(e,t,r,n){return bs(Ts(e,t+1),5,n)}function kh(e,t,r,n){return bs(mc(e,t+1),9,n)}function ws(e,t,r){let n=t.value;if(n===!1)e.push([H.float.majorEncoded|Oh]);else if(n===!0)e.push([H.float.majorEncoded|xh]);else if(n===null)e.push([H.float.majorEncoded|Eh]);else if(n===void 0)e.push([H.float.majorEncoded|Ah]);else{let i,o=!1;(!r||r.float64!==!0)&&(hc(n),i=_s(Pt,1),n===i||Number.isNaN(n)?(Pt[0]=249,e.push(Pt.slice(0,3)),o=!0):(yc(n),i=Ts(Pt,1),n===i&&(Pt[0]=250,e.push(Pt.slice(0,5)),o=!0))),o||(Ph(n),i=mc(Pt,1),Pt[0]=251,e.push(Pt.slice(0,9)))}}ws.encodedSize=function(e,t){let r=e.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!t||t.float64!==!0){hc(r);let n=_s(Pt,1);if(r===n||Number.isNaN(r))return 3;if(yc(r),n=Ts(Pt,1),r===n)return 5}return 9};var pc=new ArrayBuffer(9),mt=new DataView(pc,1),Pt=new Uint8Array(pc,0);function hc(e){if(e===1/0)mt.setUint16(0,31744,!1);else if(e===-1/0)mt.setUint16(0,64512,!1);else if(Number.isNaN(e))mt.setUint16(0,32256,!1);else{mt.setFloat32(0,e);let t=mt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)mt.setUint16(0,31744,!1);else if(r===0)mt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?mt.setUint16(0,0):i<-14?mt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):mt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function _s(e,t){if(e.length-t<2)throw new Error(`${Te} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,o;return n===0?o=i*2**-24:n!==31?o=(i+1024)*2**(n-25):o=i===0?1/0:NaN,r&32768?-o:o}function yc(e){mt.setFloat32(0,e,!1)}function Ts(e,t){if(e.length-t<4)throw new Error(`${Te} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function Ph(e){mt.setFloat64(0,e,!1)}function mc(e,t){if(e.length-t<8)throw new Error(`${Te} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}ws.compareTokens=qr.compareTokens;function Ae(e,t,r){throw new Error(`${Te} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function Mo(e){return()=>{throw new Error(`${Te} ${e}`)}}var ae=[];for(let e=0;e<=23;e++)ae[e]=Ae;ae[24]=Dp;ae[25]=Vp;ae[26]=Fp;ae[27]=Gp;ae[28]=Ae;ae[29]=Ae;ae[30]=Ae;ae[31]=Ae;for(let e=32;e<=55;e++)ae[e]=Ae;ae[56]=zp;ae[57]=Kp;ae[58]=qp;ae[59]=Wp;ae[60]=Ae;ae[61]=Ae;ae[62]=Ae;ae[63]=Ae;for(let e=64;e<=87;e++)ae[e]=Hp;ae[88]=Jp;ae[89]=Xp;ae[90]=Zp;ae[91]=Qp;ae[92]=Ae;ae[93]=Ae;ae[94]=Ae;ae[95]=Mo("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ae[e]=eh;ae[120]=th;ae[121]=rh;ae[122]=nh;ae[123]=ih;ae[124]=Ae;ae[125]=Ae;ae[126]=Ae;ae[127]=Mo("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ae[e]=ah;ae[152]=sh;ae[153]=uh;ae[154]=lh;ae[155]=ch;ae[156]=Ae;ae[157]=Ae;ae[158]=Ae;ae[159]=fh;for(let e=160;e<=183;e++)ae[e]=dh;ae[184]=ph;ae[185]=hh;ae[186]=yh;ae[187]=mh;ae[188]=Ae;ae[189]=Ae;ae[190]=Ae;ae[191]=gh;for(let e=192;e<=215;e++)ae[e]=vh;ae[216]=bh;ae[217]=wh;ae[218]=_h;ae[219]=Th;ae[220]=Ae;ae[221]=Ae;ae[222]=Ae;ae[223]=Ae;for(let e=224;e<=243;e++)ae[e]=Mo("simple values are not supported");ae[244]=Ae;ae[245]=Ae;ae[246]=Ae;ae[247]=Ih;ae[248]=Mo("simple values are not supported");ae[249]=jh;ae[250]=$h;ae[251]=kh;ae[252]=Ae;ae[253]=Ae;ae[254]=Ae;ae[255]=Sh;var Jt=[];for(let e=0;e<24;e++)Jt[e]=new pe(H.uint,e,1);for(let e=-1;e>=-24;e--)Jt[31-e]=new pe(H.negint,e,1);Jt[64]=new pe(H.bytes,new Uint8Array(0),1);Jt[96]=new pe(H.string,"",1);Jt[128]=new pe(H.array,0,1);Jt[160]=new pe(H.map,0,1);Jt[244]=new pe(H.false,!1,1);Jt[245]=new pe(H.true,!0,1);Jt[246]=new pe(H.null,null,1);function gc(){let e=[];return e[H.uint.major]=qr,e[H.negint.major]=ys,e[H.bytes.major]=Bo,e[H.string.major]=oh,e[H.array.major]=ms,e[H.map.major]=gs,e[H.tag.major]=vs,e[H.float.major]=ws,e}var lI=gc(),cI=new Lp,Au=class vc{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${fc} object contains circular references`);return new vc(r,t)}},cr={null:new pe(H.null,null),undefined:new pe(H.undefined,void 0),true:new pe(H.true,!0),false:new pe(H.false,!1),emptyArray:new pe(H.array,0),emptyMap:new pe(H.map,0)},wr={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new pe(H.float,e):e>=0?new pe(H.uint,e):new pe(H.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new pe(H.uint,e):new pe(H.negint,e)},Uint8Array(e,t,r,n){return new pe(H.bytes,e)},string(e,t,r,n){return new pe(H.string,e)},boolean(e,t,r,n){return e?cr.true:cr.false},null(e,t,r,n){return cr.null},undefined(e,t,r,n){return cr.undefined},ArrayBuffer(e,t,r,n){return new pe(H.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new pe(H.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[cr.emptyArray,new pe(H.break)]:cr.emptyArray;n=Au.createCheck(n,e);let i=[],o=0;for(let a of e)i[o++]=ba(a,r,n);return r.addBreakTokens?[new pe(H.array,e.length),i,new pe(H.break)]:[new pe(H.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",o=i?e.keys():Object.keys(e),a=i?e.size:o.length;if(!a)return r.addBreakTokens===!0?[cr.emptyMap,new pe(H.break)]:cr.emptyMap;n=Au.createCheck(n,e);let s=[],u=0;for(let c of o)s[u++]=[ba(c,r,n),ba(i?e.get(c):e[c],r,n)];return Nh(s,r),r.addBreakTokens?[new pe(H.map,a),s,new pe(H.break)]:[new pe(H.map,a),s]}};wr.Map=wr.Object;wr.Buffer=wr.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))wr[`${e}Array`]=wr.DataView;function ba(e,t={},r){let n=Ap(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||wr[n];if(typeof i=="function"){let a=i(e,n,t,r);if(a!=null)return a}let o=wr[n];if(!o)throw new Error(`${fc} unsupported type: ${n}`);return o(e,n,t,r)}function Nh(e,t){t.mapSorter&&e.sort(t.mapSorter)}var Uh={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Rh=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=Jt[e];if(t===void 0){let r=ae[e];if(!r)throw new Error(`${Te} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let n=e&31;t=r(this.data,this._pos,n,this.options)}return this._pos+=t.encodedLength,t}},ni=Symbol.for("DONE"),Co=Symbol.for("BREAK");function Bh(e,t,r){let n=[];for(let i=0;i<e.value;i++){let o=ii(t,r);if(o===Co){if(e.value===1/0)break;throw new Error(`${Te} got unexpected break to lengthed array`)}if(o===ni)throw new Error(`${Te} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=o}return n}function Mh(e,t,r){let n=r.useMaps===!0,i=n?void 0:{},o=n?new Map:void 0;for(let a=0;a<e.value;a++){let s=ii(t,r);if(s===Co){if(e.value===1/0)break;throw new Error(`${Te} got unexpected break to lengthed map`)}if(s===ni)throw new Error(`${Te} found map but not enough entries (got ${a} [no key], expected ${e.value})`);if(n!==!0&&typeof s!="string")throw new Error(`${Te} non-string keys not supported (got ${typeof s})`);if(r.rejectDuplicateMapKeys===!0&&(n&&o.has(s)||!n&&s in i))throw new Error(`${Te} found repeat map key "${s}"`);let u=ii(t,r);if(u===ni)throw new Error(`${Te} found map but not enough entries (got ${a} [no value], expected ${e.value})`);n?o.set(s,u):i[s]=u}return n?o:i}function ii(e,t){if(e.done())return ni;let r=e.next();if(r.type===H.break)return Co;if(r.type.terminal)return r.value;if(r.type===H.array)return Bh(r,e,t);if(r.type===H.map)return Mh(r,e,t);if(r.type===H.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=ii(e,t);return t.tags[r.value](n)}throw new Error(`${Te} tag not supported (${r.value})`)}throw new Error("unsupported")}function Ch(e,t){if(!(e instanceof Uint8Array))throw new Error(`${Te} data to decode must be a Uint8Array`);t=Object.assign({},Uh,t);let r=t.tokenizer||new Rh(e,t),n=ii(r,t);if(n===ni)throw new Error(`${Te} did not find any content to decode`);if(n===Co)throw new Error(`${Te} got unexpected break`);return[n,e.subarray(r.pos())]}function Lh(e,t){let[r,n]=Ch(e,t);if(n.length>0)throw new Error(`${Te} too many terminals, data makes no sense`);return r}var fI=new Uint8Array(0);function Dh(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}function Os(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 Vh(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),a=o.charCodeAt(0);if(r[a]!==255)throw new TypeError(o+" is ambiguous");r[a]=i}var s=e.length,u=e.charAt(0),c=Math.log(s)/Math.log(256),f=Math.log(256)/Math.log(s);function p(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var z=0,Y=0,V=0,M=I.length;V!==M&&I[V]===0;)V++,z++;for(var F=(M-V)*f+1>>>0,W=new Uint8Array(F);V!==M;){for(var D=I[V],re=0,K=F-1;(D!==0||re<Y)&&K!==-1;K--,re++)D+=256*W[K]>>>0,W[K]=D%s>>>0,D=D/s>>>0;if(D!==0)throw new Error("Non-zero carry");Y=re,V++}for(var fe=F-Y;fe!==F&&W[fe]===0;)fe++;for(var U=u.repeat(z);fe<F;++fe)U+=e.charAt(W[fe]);return U}function S(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var z=0;if(I[z]!==" "){for(var Y=0,V=0;I[z]===u;)Y++,z++;for(var M=(I.length-z)*c+1>>>0,F=new Uint8Array(M);I[z];){var W=r[I.charCodeAt(z)];if(W===255)return;for(var D=0,re=M-1;(W!==0||D<V)&&re!==-1;re--,D++)W+=s*F[re]>>>0,F[re]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");V=D,z++}if(I[z]!==" "){for(var K=M-V;K!==M&&F[K]===0;)K++;for(var fe=new Uint8Array(Y+(M-K)),U=Y;K!==M;)fe[U++]=F[K++];return fe}}}function T(I){var z=S(I);if(z)return z;throw new Error(`Non-${t} character`)}return{encode:p,decodeUnsafe:S,decode:T}}var Fh=Vh,Gh=Fh,zh=Gh,Kh=class{name;prefix;baseEncode;constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},qh=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}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 bc(this,e)}},Wh=class{decoders;constructor(e){this.decoders=e}or(e){return bc(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function bc(e,t){return new Wh({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var Hh=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Kh(e,t,r),this.decoder=new qh(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function wc({name:e,prefix:t,encode:r,decode:n}){return new Hh(e,t,r,n)}function _c({name:e,prefix:t,alphabet:r}){let{encode:n,decode:i}=zh(r,e);return wc({prefix:t,name:e,encode:n,decode:o=>Os(i(o))})}function Jh(e,t,r,n){let i={};for(let f=0;f<t.length;++f)i[t[f]]=f;let o=e.length;for(;e[o-1]==="=";)--o;let a=new Uint8Array(o*r/8|0),s=0,u=0,c=0;for(let f=0;f<o;++f){let p=i[e[f]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<r|p,s+=r,s>=8&&(s-=8,a[c++]=255&u>>s)}if(s>=r||255&u<<8-s)throw new SyntaxError("Unexpected end of data");return a}function Xh(e,t,r){let n=t[t.length-1]==="=",i=(1<<r)-1,o="",a=0,s=0;for(let u=0;u<e.length;++u)for(s=s<<8|e[u],a+=8;a>r;)a-=r,o+=t[i&s>>a];if(a!==0&&(o+=t[i&s<<r-a]),n)for(;o.length*r&7;)o+="=";return o}function ar({name:e,prefix:t,bitsPerChar:r,alphabet:n}){return wc({prefix:t,name:e,encode(i){return Xh(i,n,r)},decode(i){return Jh(i,n,r,e)}})}var Gi=ar({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),dI=ar({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),pI=ar({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),hI=ar({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),yI=ar({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),mI=ar({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),gI=ar({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),vI=ar({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),bI=ar({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),hr=_c({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),wI=_c({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Zh=Tc,Iu=128,Qh=127,Yh=~Qh,ey=Math.pow(2,31);function Tc(e,t,r){t=t||[],r=r||0;for(var n=r;e>=ey;)t[r++]=e&255|Iu,e/=128;for(;e&Yh;)t[r++]=e&255|Iu,e>>>=7;return t[r]=e|0,Tc.bytes=r-n+1,t}var ty=Ma,ry=128,Su=127;function Ma(e,n){var r=0,n=n||0,i=0,o=n,a,s=e.length;do{if(o>=s)throw Ma.bytes=0,new RangeError("Could not decode varint");a=e[o++],r+=i<28?(a&Su)<<i:(a&Su)*Math.pow(2,i),i+=7}while(a>=ry);return Ma.bytes=o-n,r}var ny=Math.pow(2,7),iy=Math.pow(2,14),oy=Math.pow(2,21),ay=Math.pow(2,28),sy=Math.pow(2,35),uy=Math.pow(2,42),ly=Math.pow(2,49),cy=Math.pow(2,56),fy=Math.pow(2,63),dy=function(e){return e<ny?1:e<iy?2:e<oy?3:e<ay?4:e<sy?5:e<uy?6:e<ly?7:e<cy?8:e<fy?9:10},py={encode:Zh,decode:ty,encodingLength:dy},hy=py,to=hy;function Ca(e,t=0){return[to.decode(e,t),to.decode.bytes]}function ro(e,t,r=0){return to.encode(e,t,r),t}function no(e){return to.encodingLength(e)}function yy(e,t){let r=t.byteLength,n=no(e),i=n+no(r),o=new Uint8Array(i+r);return ro(e,o,0),ro(r,o,n),o.set(t,i),new xs(e,r,t,o)}function La(e){let t=Os(e),[r,n]=Ca(t),[i,o]=Ca(t.subarray(n)),a=t.subarray(n+o);if(a.byteLength!==i)throw new Error("Incorrect length");return new xs(r,i,a,t)}function my(e,t){if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&Dh(e.bytes,r.bytes)}}var xs=class{code;size;digest;bytes;constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}};function ju(e,t){let{bytes:r,version:n}=e;switch(n){case 0:return vy(r,Da(e),t??hr.encoder);default:return by(r,Da(e),t??Gi.encoder)}}var $u=new WeakMap;function Da(e){let t=$u.get(e);if(t==null){let r=new Map;return $u.set(e,r),r}return t}var io=class Ye{code;version;multihash;bytes;"/";constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,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:r}=this;if(t!==Fn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==wy)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ye.createV0(r)}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:r}=this.multihash,n=yy(t,r);return Ye.createV1(this.code,n)}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 Ye.equals(this,t)}static equals(t,r){let n=r;return n!=null&&t.code===n.code&&t.version===n.version&&my(t.multihash,n.multihash)}toString(t){return ju(this,t)}toJSON(){return{"/":ju(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 r=t;if(r instanceof Ye)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:o,bytes:a}=r;return new Ye(n,i,o,a??ku(n,i,o.bytes))}else if(r[_y]===!0){let{version:n,multihash:i,code:o}=r,a=La(i);return Ye.create(n,o,a)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==Fn)throw new Error(`Version 0 CID must use dag-pb (code: ${Fn}) block encoding`);return new Ye(t,r,n,n.bytes)}case 1:{let i=ku(t,r,n.bytes);return new Ye(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return Ye.create(0,Fn,t)}static createV1(t,r){return Ye.create(1,t,r)}static decode(t){let[r,n]=Ye.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=Ye.inspectBytes(t),n=r.size-r.multihashSize,i=Os(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=i.subarray(r.multihashSize-r.digestSize),a=new xs(r.multihashCode,r.digestSize,o,i);return[r.version===0?Ye.createV0(a):Ye.createV1(r.codec,a),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[p,S]=Ca(t.subarray(r));return r+=S,p},i=n(),o=Fn;if(i===18?(i=0,r=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let a=r,s=n(),u=n(),c=r+u,f=c-a;return{version:i,codec:o,multihashCode:s,digestSize:u,multihashSize:f,size:c}}static parse(t,r){let[n,i]=gy(t,r),o=Ye.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Da(o).set(n,t),o}};function gy(e,t){switch(e[0]){case"Q":{let r=t??hr;return[hr.prefix,r.decode(`${hr.prefix}${e}`)]}case hr.prefix:{let r=t??hr;return[hr.prefix,r.decode(e)]}case Gi.prefix:{let r=t??Gi;return[Gi.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function vy(e,t,r){let{prefix:n}=r;if(n!==hr.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let o=r.encode(e).slice(1);return t.set(n,o),o}else return i}function by(e,t,r){let{prefix:n}=r,i=t.get(n);if(i==null){let o=r.encode(e);return t.set(n,o),o}else return i}var Fn=112,wy=18;function ku(e,t,r){let n=no(e),i=n+no(t),o=new Uint8Array(i+r.byteLength);return ro(e,o,0),ro(t,o,n),o.set(r,i),o}var _y=Symbol.for("@ipld/js-cid/CID"),Oc=42;function Ty(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=io.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new pe(H.tag,Oc),new pe(H.bytes,r)]}function Oy(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function xy(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 Pu={float64:!0,typeEncoders:{Object:Ty,undefined:Oy,number:xy}},_I={...Pu,typeEncoders:{...Pu.typeEncoders}};function Ey(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return io.decode(e.subarray(1))}var oo={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};oo.tags[Oc]=Ey;var TI={...oo,tags:oo.tags.slice()},Ay=e=>Lh(e,oo),Rr=gi(ds(),1),wa={SHA2_256:18,LENGTH:32,DAG_PB:112},Iy=40;function ao(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=Rr.default.decode(e);return t.seek(Rr.default.decode.bytes),r}function Sy(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0;return{version:2,characteristics:[t.getBigUint64(r,!0),t.getBigUint64(r+=8,!0)],dataOffset:Number(t.getBigUint64(r+=8,!0)),dataSize:Number(t.getBigUint64(r+=8,!0)),indexOffset:Number(t.getBigUint64(r+=8,!0))}}function jy(e){Rr.default.decode(e);let t=Rr.default.decode.bytes,r=Rr.default.decode(e.subarray(Rr.default.decode.bytes)),n=Rr.default.decode.bytes;return t+n+r}var mr={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},Wn={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":mr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(mr.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Wn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=Wn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:mr.Int,CarV1HeaderOrV2Pragma:e=>{if(mr.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,a]=t[i];switch(o){case"roots":{let s=Wn["CarV1HeaderOrV2Pragma > roots (anon)"](e[o]);if(s===void 0)return;if(s!==a||r!==e){if(r===e){r={};for(let u=0;u<i;u++)r[t[u][0]]=t[u][1]}r.roots=s}}break;case"version":{n--;let s=Wn.Int(e[o]);if(s===void 0)return;if(s!==a||r!==e){if(r===e){r={};for(let u=0;u<i;u++)r[t[u][0]]=t[u][1]}r.version=s}}break;default:return}}if(!(n>0))return r}},Hn={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":mr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(mr.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Hn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=Hn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:mr.Int,CarV1HeaderOrV2Pragma:e=>{if(mr.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,a]=t[i];switch(o){case"roots":{let s=Hn["CarV1HeaderOrV2Pragma > roots (anon)"](a);if(s===void 0)return;if(s!==a||r!==e){if(r===e){r={};for(let u=0;u<i;u++)r[t[u][0]]=t[u][1]}r.roots=s}}break;case"version":{n--;let s=Hn.Int(a);if(s===void 0)return;if(s!==a||r!==e){if(r===e){r={};for(let u=0;u<i;u++)r[t[u][0]]=t[u][1]}r.version=s}}break;default:return}}if(!(n>0))return r}},$y={toTyped:Wn.CarV1HeaderOrV2Pragma,toRepresentation:Hn.CarV1HeaderOrV2Pragma},OI=gc(),xI=gi(ds(),1),EI=[new pe(H.map,2),new pe(H.string,"version"),new pe(H.uint,1),new pe(H.string,"roots")],AI=new pe(H.tag,42);async function xc(e,t){let r=ao(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=Ay(n);if($y.toTyped(i)===void 0)throw new Error("Invalid CAR header format");if(i.version!==1&&i.version!==2||t!==void 0&&i.version!==t)throw new Error(`Invalid CAR version: ${i.version}${t!==void 0?` (expected ${t})`:""}`);if(i.version===1){if(!Array.isArray(i.roots))throw new Error("Invalid CAR header format");return i}if(i.roots!==void 0)throw new Error("Invalid CAR header format");let o=Sy(await e.exactly(Iy,!0));e.seek(o.dataOffset-e.pos);let a=await xc(e,1);return Object.assign(a,o)}async function ky(e){let t=await e.exactly(2,!1);if(t[0]===wa.SHA2_256&&t[1]===wa.LENGTH){let a=await e.exactly(34,!0),s=La(a);return io.create(0,wa.DAG_PB,s)}let r=ao(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=ao(await e.upTo(8),e),i=await e.exactly(jy(await e.upTo(8)),!0),o=La(i);return io.create(r,n,o)}async function Ec(e){let t=e.pos,r=ao(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await ky(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function Py(e){let{cid:t,blockLength:r}=await Ec(e);return{bytes:await e.exactly(r,!0),cid:t}}async function Ny(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await Ec(e),o={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(o.blockLength),o}function Uy(e){let t=(async()=>{let r=await xc(e);if(r.version===2){let n=e.pos-r.dataOffset;e=Cy(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await Py(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await Ny(e)}}}function Ry(e){let t=0;return{async upTo(r){return e.subarray(t,t+Math.min(r,e.length-t))},async exactly(r,n=!1){if(r>e.length-t)throw new Error("Unexpected end of data");let i=e.subarray(t,t+r);return n&&(t+=r),i},seek(r){t+=r},get pos(){return t}}}function By(e){let t=0,r=0,n=0,i=new Uint8Array(0),o=async a=>{r=i.length-n;let s=[i.subarray(n)];for(;r<a;){let c=await e();if(c==null)break;r<0?c.length>r&&s.push(c.subarray(-r)):s.push(c),r+=c.length}i=new Uint8Array(s.reduce((c,f)=>c+f.length,0));let u=0;for(let c of s)i.set(c,u),u+=c.length;n=0};return{async upTo(a){return i.length-n<a&&await o(a),i.subarray(n,n+Math.min(i.length-n,a))},async exactly(a,s=!1){if(i.length-n<a&&await o(a),i.length-n<a)throw new Error("Unexpected end of data");let u=i.subarray(n,n+a);return s&&(t+=a,n+=a),u},seek(a){t+=a,n+=a},get pos(){return t}}}function My(e){let t=e[Symbol.asyncIterator]();async function r(){let n=await t.next();return n.done?null:n.value}return By(r)}function Cy(e,t){let r=0;return{async upTo(n){let i=await e.upTo(n);return i.length+r>t&&(i=i.subarray(0,t-r)),i},async exactly(n,i=!1){let o=await e.exactly(n,i);if(o.length+r>t)throw new Error("Unexpected end of data");return i&&(r+=n),o},seek(n){r+=n,e.seek(n)},get pos(){return e.pos}}}var Ac=class{constructor(e,t){this._header=e,this._blocks=t,this._keys=t.map(r=>r.cid.toString())}get version(){return this._header.version}async getRoots(){return this._header.roots}async has(e){return this._keys.indexOf(e.toString())>-1}async get(e){let t=this._keys.indexOf(e.toString());return t>-1?this._blocks[t]:void 0}async*blocks(){for(let e of this._blocks)yield e}async*cids(){for(let e of this._blocks)yield e.cid}static async fromBytes(e){if(!(e instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return Nu(Ry(e))}static async fromIterable(e){if(!e||typeof e[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return Nu(My(e))}};async function Nu(e){let t=Uy(e),r=await t.header(),n=[];for await(let i of t.blocks())n.push(i);return new Ac(r,n)}var II=gi(ds(),1),Ly={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(e,t){return"Cannot apply '"+e+"' to '"+t.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(e,t){return"[mobx.array] Index out of bounds, "+e+" is larger than "+t},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(e){return"Cannot initialize from classes that inherit from Map: "+e.constructor.name},20:function(e){return"Cannot initialize map from "+e},21:function(e){return"Cannot convert to map from '"+e+"'"},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(e){return"Cannot obtain administration from "+e},25:function(e,t){return"the entry '"+e+"' does not exist in the observable map '"+t+"'"},26:"please specify a property",27:function(e,t){return"no observable property '"+e.toString()+"' found on the observable object '"+t+"'"},28:function(e){return"Cannot obtain atom from "+e},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(e,t){return"Cycle detected in computation "+e+": "+t},33:function(e){return"The setter of computed value '"+e+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(e){return"[ComputedValue '"+e+"'] 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(e){return"[mobx] `observableArray."+e+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+e+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},Dy=Ly;function le(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=typeof e=="string"?e:Dy[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}var Vy={};function Lo(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Vy}var Ic=Object.assign,so=Object.getOwnPropertyDescriptor,Kt=Object.defineProperty,_i=Object.prototype,uo=[];Object.freeze(uo);var Es={};Object.freeze(Es);var Fy=typeof Proxy<"u",Gy=Object.toString();function Sc(){Fy||le("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function Gn(e){J.verifyProxies&&le("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function jt(){return++J.mobxGuid}function As(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var sn=function(){};function Me(e){return typeof e=="function"}function Mr(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Do(e){return e!==null&&typeof e=="object"}function Lt(e){if(!Do(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===Gy}function jc(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Vo(e,t,r){Kt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function $c(e,t,r){Kt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function xr(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Do(n)&&n[r]===!0}}function Tn(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function zy(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function Yt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var kc=typeof Object.getOwnPropertySymbols<"u";function Ky(e){var t=Object.keys(e);if(!kc)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return _i.propertyIsEnumerable.call(e,n)})):t}var Fo=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:kc?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Va(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Pc(e){return e===null?null:typeof e=="object"?""+e:e}function xt(e,t){return _i.hasOwnProperty.call(e,t)}var qy=Object.getOwnPropertyDescriptors||function(e){var t={};return Fo(e).forEach(function(r){t[r]=so(e,r)}),t};function st(e,t){return!!(e&t)}function ut(e,t,r){return r?e|=t:e&=~t,e}function Uu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Ru(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Hy(n.key),n)}}function On(e,t,r){return t&&Ru(e.prototype,t),r&&Ru(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function un(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Jy(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}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 nr(){return nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nr.apply(null,arguments)}function Nc(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Fa(e,t)}function Fa(e,t){return Fa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Fa(e,t)}function Wy(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hy(e){var t=Wy(e,"string");return typeof t=="symbol"?t:t+""}function Jy(e,t){if(e){if(typeof e=="string")return Uu(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Uu(e,t):void 0}}var at=Symbol("mobx-stored-annotations");function qt(e){function t(r,n){if(Oi(n))return e.decorate_20223_(r,n);Ti(r,n,e)}return Object.assign(t,e)}function Ti(e,t,r){if(xt(e,at)||Vo(e,at,nr({},e[at])),lo(r)&&!xt(e[at],t)){var n=e.constructor.name+".prototype."+t.toString();le("'"+n+"' is decorated with 'override', but no such decorated member was found on prototype.")}Xy(e,r,t),lo(r)||(e[at][t]=r)}function Xy(e,t,r){if(!lo(t)&&xt(e[at],r)){var n=e.constructor.name+".prototype."+r.toString(),i=e[at][r].annotationType_,o=t.annotationType_;le("Cannot apply '@"+o+"' to '"+n+"':"+(`
|
|
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 Zy(e){return xt(e,at)||Vo(e,at,nr({},e[at])),e[at]}function Oi(e){return typeof e=="object"&&typeof e.kind=="string"}function Go(e,t){t.includes(e.kind)||le("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var ge=Symbol("mobx administration"),Er=function(){function e(r){r===void 0&&(r="Atom@"+jt()),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Ee.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}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 Jc(this)},t.reportChanged=function(){_t(),Xc(this),Tt()},t.toString=function(){return this.name_},On(e,[{key:"isBeingObserved",get:function(){return st(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ut(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return st(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ut(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return st(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ut(this.flags_,e.diffValueMask_,r===1)}}])}();Er.isBeingObservedMask_=1;Er.isPendingUnobservationMask_=2;Er.diffValueMask_=4;var Is=xr("Atom",Er);function Uc(e,t,r){t===void 0&&(t=sn),r===void 0&&(r=sn);var n=new Er(e);return t!==sn&&Ho(n,t),r!==sn&&En(n,r),n}function Qy(e,t){return e===t}function Yy(e,t){return Us(e,t)}function em(e,t){return Us(e,t,1)}function tm(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Fe={identity:Qy,structural:Yy,default:tm,shallow:em};function xn(e,t,r){return dn(e)?e:Array.isArray(e)?Be.array(e,{name:r}):Lt(e)?Be.object(e,void 0,{name:r}):Tn(e)?Be.map(e,{name:r}):Yt(e)?Be.set(e,{name:r}):typeof e=="function"&&!Lr(e)&&!si(e)?jc(e)?fn(e):oi(r,e):e}function rm(e,t,r){if(e==null||Dr(e)||In(e)||Xt(e)||Ut(e))return e;if(Array.isArray(e))return Be.array(e,{name:r,deep:!1});if(Lt(e))return Be.object(e,void 0,{name:r,deep:!1});if(Tn(e))return Be.map(e,{name:r,deep:!1});if(Yt(e))return Be.set(e,{name:r,deep:!1});le("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function zo(e){return e}function nm(e,t){return dn(e)&&le("observable.struct should not be used with observable values"),Us(e,t)?t:e}var im="override";function lo(e){return e.annotationType_===im}function xi(e,t){return{annotationType_:e,options_:t,make_:om,extend_:am,decorate_20223_:sm}}function om(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(Lr(r.value))return 1;var o=Rc(e,this,t,r,!1);return Kt(n,t,o),2}function am(e,t,r,n){var i=Rc(e,this,t,r);return e.defineProperty_(t,i,n)}function sm(e,t){Go(t,["method","field"]);var r=t.kind,n=t.name,i=t.addInitializer,o=this,a=function(u){var c,f,p,S;return Cr((c=(f=o.options_)==null?void 0:f.name)!=null?c:n.toString(),u,(p=(S=o.options_)==null?void 0:S.autoAction)!=null?p:!1)};if(r=="field")return function(u){var c,f=u;return Lr(f)||(f=a(f)),(c=o.options_)!=null&&c.bound&&(f=f.bind(this),f.isMobxAction=!0),f};if(r=="method"){var s;return Lr(e)||(e=a(e)),(s=this.options_)!=null&&s.bound&&i(function(){var u=this,c=u[n].bind(u);c.isMobxAction=!0,u[n]=c}),e}le("Cannot apply '"+o.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
|
|
6
|
+
'`+o.annotationType_+"' can only be used on properties with a function value."))}function um(e,t,r,n){var i=t.annotationType_,o=n.value;Me(o)||le("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
|
|
7
|
+
'`+i+"' can only be used on properties with a function value."))}function Rc(e,t,r,n,i){var o,a,s,u,c,f,p;i===void 0&&(i=J.safeDescriptors),um(e,t,r,n);var S=n.value;if((o=t.options_)!=null&&o.bound){var T;S=S.bind((T=e.proxy_)!=null?T:e.target_)}return{value:Cr((a=(s=t.options_)==null?void 0:s.name)!=null?a:r.toString(),S,(u=(c=t.options_)==null?void 0:c.autoAction)!=null?u:!1,(f=t.options_)!=null&&f.bound?(p=e.proxy_)!=null?p:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Bc(e,t){return{annotationType_:e,options_:t,make_:lm,extend_:cm,decorate_20223_:fm}}function lm(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!xt(e.target_,t)||!si(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(si(r.value))return 1;var o=Mc(e,this,t,r,!1,!1);return Kt(n,t,o),2}function cm(e,t,r,n){var i,o=Mc(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,o,n)}function fm(e,t){var r;Go(t,["method"]);var n=t.name,i=t.addInitializer;return si(e)||(e=fn(e)),(r=this.options_)!=null&&r.bound&&i(function(){var o=this,a=o[n].bind(o);a.isMobXFlow=!0,o[n]=a}),e}function dm(e,t,r,n){var i=t.annotationType_,o=n.value;Me(o)||le("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
|
|
8
|
+
'`+i+"' can only be used on properties with a generator function value."))}function Mc(e,t,r,n,i,o){o===void 0&&(o=J.safeDescriptors),dm(e,t,r,n);var a=n.value;if(si(a)||(a=fn(a)),i){var s;a=a.bind((s=e.proxy_)!=null?s:e.target_),a.isMobXFlow=!0}return{value:a,configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function Ss(e,t){return{annotationType_:e,options_:t,make_:pm,extend_:hm,decorate_20223_:ym}}function pm(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function hm(e,t,r,n){return mm(e,this,t,r),e.defineComputedProperty_(t,nr({},this.options_,{get:r.get,set:r.set}),n)}function ym(e,t){Go(t,["getter"]);var r=this,n=t.name,i=t.addInitializer;return i(function(){var o=Sn(this)[ge],a=nr({},r.options_,{get:e,context:this});a.name||(a.name=o.name_+"."+n.toString()),o.values_.set(n,new At(a))}),function(){return this[ge].getObservablePropValue_(n)}}function mm(e,t,r,n){var i=t.annotationType_,o=n.get;o||le("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
|
|
9
|
+
'`+i+"' can only be used on getter(+setter) properties."))}function Ko(e,t){return{annotationType_:e,options_:t,make_:gm,extend_:vm,decorate_20223_:bm}}function gm(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function vm(e,t,r,n){var i,o;return wm(e,this,t,r),e.defineObservableProperty_(t,r.value,(i=(o=this.options_)==null?void 0:o.enhancer)!=null?i:xn,n)}function bm(e,t){if(t.kind==="field")throw le("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");Go(t,["accessor"]);var r=this,n=t.kind,i=t.name,o=new WeakSet;function a(s,u){var c,f,p=Sn(s)[ge],S=new br(u,(c=(f=r.options_)==null?void 0:f.enhancer)!=null?c:xn,p.name_+"."+i.toString(),!1);p.values_.set(i,S),o.add(s)}if(n=="accessor")return{get:function(){return o.has(this)||a(this,e.get.call(this)),this[ge].getObservablePropValue_(i)},set:function(s){return o.has(this)||a(this,s),this[ge].setObservablePropValue_(i,s)},init:function(s){return o.has(this)||a(this,s),s}}}function wm(e,t,r,n){var i=t.annotationType_;"value"in n||le("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
|
|
10
|
+
'`+i+"' cannot be used on getter/setter properties"))}var _m="true",Tm=Cc();function Cc(e){return{annotationType_:_m,options_:e,make_:Om,extend_:xm,decorate_20223_:Em}}function Om(e,t,r,n){var i,o;if(r.get)return De.make_(e,t,r,n);if(r.set){var a=Cr(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:J.safeDescriptors?e.isPlainObject_:!0,set:a})===null?0:2:(Kt(n,t,{configurable:!0,set:a}),2)}if(n!==e.target_&&typeof r.value=="function"){var s;if(jc(r.value)){var u,c=(u=this.options_)!=null&&u.autoBind?fn.bound:fn;return c.make_(e,t,r,n)}var f=(s=this.options_)!=null&&s.autoBind?oi.bound:oi;return f.make_(e,t,r,n)}var p=((i=this.options_)==null?void 0:i.deep)===!1?Be.ref:Be;if(typeof r.value=="function"&&(o=this.options_)!=null&&o.autoBind){var S;r.value=r.value.bind((S=e.proxy_)!=null?S:e.target_)}return p.make_(e,t,r,n)}function xm(e,t,r,n){var i,o;if(r.get)return De.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:J.safeDescriptors?e.isPlainObject_:!0,set:Cr(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var a;r.value=r.value.bind((a=e.proxy_)!=null?a:e.target_)}var s=((o=this.options_)==null?void 0:o.deep)===!1?Be.ref:Be;return s.extend_(e,t,r,n)}function Em(e,t){le("'"+this.annotationType_+"' cannot be used as a decorator")}var Am="observable",Im="observable.ref",Sm="observable.shallow",jm="observable.struct",Lc={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Lc);function Mi(e){return e||Lc}var Ga=Ko(Am),$m=Ko(Im,{enhancer:zo}),km=Ko(Sm,{enhancer:rm}),Pm=Ko(jm,{enhancer:nm}),Dc=qt(Ga);function Ci(e){return e.deep===!0?xn:e.deep===!1?zo:Um(e.defaultDecorator)}function Nm(e){var t;return e?(t=e.defaultDecorator)!=null?t:Cc(e):void 0}function Um(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:xn}function Vc(e,t,r){if(Oi(t))return Ga.decorate_20223_(e,t);if(Mr(t)){Ti(e,t,Ga);return}return dn(e)?e:Lt(e)?Be.object(e,t,r):Array.isArray(e)?Be.array(e,t):Tn(e)?Be.map(e,t):Yt(e)?Be.set(e,t):typeof e=="object"&&e!==null?e:Be.box(e,t)}Ic(Vc,Dc);var Rm={box:function(e,t){var r=Mi(t);return new br(e,Ci(r),r.name,!0,r.equals)},array:function(e,t){var r=Mi(t);return(J.useProxies===!1||r.proxy===!1?Lg:jg)(e,Ci(r),r.name)},map:function(e,t){var r=Mi(t);return new ff(e,Ci(r),r.name)},set:function(e,t){var r=Mi(t);return new df(e,Ci(r),r.name)},object:function(e,t,r){return Hr(function(){return vg(J.useProxies===!1||r?.proxy===!1?Sn({},r):Ag({},r),e,t)})},ref:qt($m),shallow:qt(km),deep:Dc,struct:qt(Pm)},Be=Ic(Vc,Rm),Fc="computed",Bm="computed.struct",za=Ss(Fc),Mm=Ss(Bm,{equals:Fe.structural}),De=function(e,t){if(Oi(t))return za.decorate_20223_(e,t);if(Mr(t))return Ti(e,t,za);if(Lt(e))return qt(Ss(Fc,e));Me(e)||le("First argument to `computed` should be an expression."),Me(t)&&le("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var r=Lt(t)?t:{};return r.get=e,r.name||(r.name=e.name||""),new At(r)};Object.assign(De,za);De.struct=qt(Mm);var Bu,Mu,co=0,Cm=1,Lm=(Bu=(Mu=so(function(){},"name"))==null?void 0:Mu.configurable)!=null?Bu:!1,Cu={value:"action",configurable:!0,writable:!1,enumerable:!1};function Cr(e,t,r,n){r===void 0&&(r=!1),Me(t)||le("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&le("actions should have valid names, got: '"+e+"'");function i(){return Gc(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Lm&&(Cu.value=e,Kt(i,"name",Cu)),i}function Gc(e,t,r,n,i){var o=Dm(e,t,n,i);try{return r.apply(n,i)}catch(a){throw o.error_=a,a}finally{Vm(o)}}function Dm(e,t,r,n){var i=Ze()&&!!e,o=0;if(i){o=Date.now();var a=n?Array.from(n):uo;lt({type:$s,name:e,object:r,arguments:a})}var s=J.trackingDerivation,u=!t||!s;_t();var c=J.allowStateChanges;u&&(Wr(),c=qo(!0));var f=js(!0),p={runAsAction_:u,prevDerivation_:s,prevAllowStateChanges_:c,prevAllowStateReads_:f,notifySpy_:i,startTime_:o,actionId_:Cm++,parentActionId_:co};return co=p.actionId_,p}function Vm(e){co!==e.actionId_&&le(30),co=e.parentActionId_,e.error_!==void 0&&(J.suppressReactionErrors=!0),Wo(e.prevAllowStateChanges_),ei(e.prevAllowStateReads_),Tt(),e.runAsAction_&&tr(e.prevDerivation_),e.notifySpy_&&ct({time:Date.now()-e.startTime_}),J.suppressReactionErrors=!1}function Fm(e,t){var r=qo(e);try{return t()}finally{Wo(r)}}function qo(e){var t=J.allowStateChanges;return J.allowStateChanges=e,t}function Wo(e){J.allowStateChanges=e}var Gm="create",br=function(e){function t(n,i,o,a,s){var u;return o===void 0&&(o="ObservableValue@"+jt()),a===void 0&&(a=!0),s===void 0&&(s=Fe.default),u=e.call(this,o)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=o,u.equals=s,u.value_=i(n,void 0,o),a&&Ze()&&cn({type:Gm,object:u,observableKind:"value",debugObjectName:u.name_,newValue:""+u.value_}),u}Nc(t,e);var r=t.prototype;return r.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},r.set=function(n){var i=this.value_;if(n=this.prepareNewValue_(n),n!==J.UNCHANGED){var o=Ze();o&<({type:Bt,object:this,observableKind:"value",debugObjectName:this.name_,newValue:n,oldValue:i}),this.setNewValue_(n),o&&ct()}},r.prepareNewValue_=function(n){if(zt(this),bt(this)){var i=wt(this,{object:this,type:Bt,newValue:n});if(!i)return J.UNCHANGED;n=i.newValue}return n=this.enhancer(n,this.value_,this.name_),this.equals(this.value_,n)?J.UNCHANGED:n},r.setNewValue_=function(n){var i=this.value_;this.value_=n,this.reportChanged(),Mt(this)&&Ct(this,{type:Bt,object:this,newValue:n,oldValue:i})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(n){return Ai(this,n)},r.observe_=function(n,i){return i&&n({observableKind:"value",debugObjectName:this.name_,object:this,type:Bt,newValue:this.value_,oldValue:void 0}),Ii(this,n)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Pc(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(Er),zm=xr("ObservableValue",br),At=function(){function e(r){this.dependenciesState_=Ee.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ee.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new fo(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Et.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,r.get||le(31),this.derivation=r.get,this.name_=r.name||"ComputedValue@"+jt(),r.set&&(this.setter_=Cr(this.name_+"-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?Fe.structural:Fe.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){tg(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&&le(32,this.name_,this.derivation),J.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Ka(this)&&(this.warnAboutUntrackedRead_(),_t(),this.value_=this.computeValue_(!1),Tt());else if(Jc(this),Ka(this)){var r=J.trackingContext;this.keepAlive_&&!r&&(J.trackingContext=this),this.trackAndCompute()&&eg(this),J.trackingContext=r}var n=this.value_;if(zi(n))throw n.cause;return n},t.set=function(r){if(this.setter_){this.isRunningSetter&&le(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else le(34,this.name_)},t.trackAndCompute=function(){var r=this.value_,n=this.dependenciesState_===Ee.NOT_TRACKING_,i=this.computeValue_(!0),o=n||zi(r)||zi(i)||!this.equals_(r,i);return o&&(this.value_=i,Ze()&&cn({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:r,newValue:i})),o},t.computeValue_=function(r){this.isComputing=!0;var n=qo(!1),i;if(r)i=zc(this,this.derivation,this.scope_);else if(J.disableErrorBoundaries===!0)i=this.derivation.call(this.scope_);else try{i=this.derivation.call(this.scope_)}catch(o){i=new fo(o)}return Wo(n),this.isComputing=!1,i},t.suspend_=function(){this.keepAlive_||(qa(this),this.value_=void 0,this.isTracing_!==Et.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(r,n){var i=this,o=!0,a=void 0;return It(function(){var s=i.get();if(!o||n){var u=Wr();r({observableKind:"computed",debugObjectName:i.name_,type:Bt,object:i,newValue:s,oldValue:a}),tr(u)}o=!1,a=s})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==Et.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_:J.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 Pc(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},On(e,[{key:"isComputing",get:function(){return st(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=ut(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return st(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=ut(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return st(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ut(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return st(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ut(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return st(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ut(this.flags_,e.diffValueMask_,r===1)}}])}();At.isComputingMask_=1;At.isRunningSetterMask_=2;At.isBeingObservedMask_=4;At.isPendingUnobservationMask_=8;At.diffValueMask_=16;var Ei=xr("ComputedValue",At),Ee;(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_"})(Ee||(Ee={}));var Et;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Et||(Et={}));var fo=function(e){this.cause=void 0,this.cause=e};function zi(e){return e instanceof fo}function Ka(e){switch(e.dependenciesState_){case Ee.UP_TO_DATE_:return!1;case Ee.NOT_TRACKING_:case Ee.STALE_:return!0;case Ee.POSSIBLY_STALE_:{for(var t=js(!0),r=Wr(),n=e.observing_,i=n.length,o=0;o<i;o++){var a=n[o];if(Ei(a)){if(J.disableErrorBoundaries)a.get();else try{a.get()}catch{return tr(r),ei(t),!0}if(e.dependenciesState_===Ee.STALE_)return tr(r),ei(t),!0}}return Kc(e),tr(r),ei(t),!1}}}function Km(){return J.trackingDerivation!==null}function zt(e){var t=e.observers_.size>0;!J.allowStateChanges&&(t||J.enforceActions==="always")&&console.warn("[MobX] "+(J.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 qm(e){!J.allowStateReads&&J.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function zc(e,t,r){var n=js(!0);Kc(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++J.runId;var i=J.trackingDerivation;J.trackingDerivation=e,J.inBatch++;var o;if(J.disableErrorBoundaries===!0)o=t.call(r);else try{o=t.call(r)}catch(a){o=new fo(a)}return J.inBatch--,J.trackingDerivation=i,Hm(e),Wm(e),ei(n),o}function Wm(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:J.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function Hm(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=Ee.UP_TO_DATE_,i=0,o=e.unboundDepsCount_,a=0;a<o;a++){var s=r[a];s.diffValue===0&&(s.diffValue=1,i!==a&&(r[i]=s),i++),s.dependenciesState_>n&&(n=s.dependenciesState_)}for(r.length=i,e.newObserving_=null,o=t.length;o--;){var u=t[o];u.diffValue===0&&Wc(u,e),u.diffValue=0}for(;i--;){var c=r[i];c.diffValue===1&&(c.diffValue=0,Ym(c,e))}n!==Ee.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function qa(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)Wc(t[r],e);e.dependenciesState_=Ee.NOT_TRACKING_}function Re(e){var t=Wr();try{return e()}finally{tr(t)}}function Wr(){var e=J.trackingDerivation;return J.trackingDerivation=null,e}function tr(e){J.trackingDerivation=e}function js(e){var t=J.allowStateReads;return J.allowStateReads=e,t}function ei(e){J.allowStateReads=e}function Kc(e){if(e.dependenciesState_!==Ee.UP_TO_DATE_){e.dependenciesState_=Ee.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Ee.UP_TO_DATE_}}var Ki=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},qi=!0,qc=!1,J=function(){var e=Lo();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(qi=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Ki().version&&(qi=!1),qi?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ki):(setTimeout(function(){qc||le(35)},1),new Ki)}();function Jm(){if((J.pendingReactions.length||J.inBatch||J.isRunningReactions)&&le(36),qc=!0,qi){var e=Lo();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),J=new Ki}}function Xm(){return J}function Zm(e){return e.observers_&&e.observers_.size>0}function Qm(e){return e.observers_}function Ym(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Wc(e,t){e.observers_.delete(t),e.observers_.size===0&&Hc(e)}function Hc(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,J.pendingUnobservations.push(e))}function _t(){J.inBatch++}function Tt(){if(--J.inBatch===0){Yc();for(var e=J.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof At&&r.suspend_())}J.pendingUnobservations=[]}}function Jc(e){qm(e);var t=J.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&J.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&J.inBatch>0&&Hc(e),!1)}function Xc(e){e.lowestObserverState_!==Ee.STALE_&&(e.lowestObserverState_=Ee.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ee.UP_TO_DATE_&&(t.isTracing_!==Et.NONE&&Zc(t,e),t.onBecomeStale_()),t.dependenciesState_=Ee.STALE_}))}function eg(e){e.lowestObserverState_!==Ee.STALE_&&(e.lowestObserverState_=Ee.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ee.POSSIBLY_STALE_?(t.dependenciesState_=Ee.STALE_,t.isTracing_!==Et.NONE&&Zc(t,e)):t.dependenciesState_===Ee.UP_TO_DATE_&&(e.lowestObserverState_=Ee.UP_TO_DATE_)}))}function tg(e){e.lowestObserverState_===Ee.UP_TO_DATE_&&(e.lowestObserverState_=Ee.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ee.UP_TO_DATE_&&(t.dependenciesState_=Ee.POSSIBLY_STALE_,t.onBecomeStale_())}))}function Zc(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===Et.BREAK){var r=[];Qc(Jo(e),r,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 At?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
|
19
|
+
|
|
20
|
+
The dependencies for this derivation are:
|
|
21
|
+
|
|
22
|
+
`+r.join(`
|
|
23
|
+
`)+`
|
|
24
|
+
*/
|
|
25
|
+
`)()}}function Qc(e,t,r){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(r-1)+e.name),e.dependencies&&e.dependencies.forEach(function(n){return Qc(n,t,r+1)})}var Wt=function(){function e(r,n,i,o){r===void 0&&(r="Reaction@"+jt()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Ee.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Et.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=o}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,J.pendingReactions.push(this),Yc())},t.runReaction_=function(){if(!this.isDisposed){_t(),this.isScheduled=!1;var r=J.trackingContext;if(J.trackingContext=this,Ka(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&Ze()&&cn({name:this.name_,type:"scheduled-reaction"})}catch(n){this.reportExceptionInDerivation_(n)}}J.trackingContext=r,Tt()}},t.track=function(r){if(!this.isDisposed){_t();var n=Ze(),i;n&&(i=Date.now(),lt({name:this.name_,type:"reaction"})),this.isRunning=!0;var o=J.trackingContext;J.trackingContext=this;var a=zc(this,r,void 0);J.trackingContext=o,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&qa(this),zi(a)&&this.reportExceptionInDerivation_(a.cause),n&&ct({time:Date.now()-i}),Tt()}},t.reportExceptionInDerivation_=function(r){var n=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(J.disableErrorBoundaries)throw r;var i="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";J.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(i,r),Ze()&&cn({type:"error",name:this.name_,message:i,error:""+r}),J.globalReactionErrorHandlers.forEach(function(o){return o(r,n)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(_t(),qa(this),Tt()))},t.getDisposer_=function(r){var n=this,i=function o(){n.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",o)};return r==null||r.addEventListener==null||r.addEventListener("abort",i),i[ge]=this,i},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(r){r===void 0&&(r=!1),lf(this,r)},On(e,[{key:"isDisposed",get:function(){return st(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=ut(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return st(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=ut(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return st(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=ut(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return st(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=ut(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return st(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ut(this.flags_,e.diffValueMask_,r===1)}}])}();Wt.isDisposedMask_=1;Wt.isScheduledMask_=2;Wt.isTrackPendingMask_=4;Wt.isRunningMask_=8;Wt.diffValueMask_=16;var Lu=100,Wa=function(e){return e()};function Yc(){J.inBatch>0||J.isRunningReactions||Wa(rg)}function rg(){J.isRunningReactions=!0;for(var e=J.pendingReactions,t=0;e.length>0;){++t===Lu&&(console.error("Reaction doesn't converge to a stable state after "+Lu+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}J.isRunningReactions=!1}var po=xr("Reaction",Wt);function ng(e){var t=Wa;Wa=function(r){return e(function(){return t(r)})}}function Ze(){return!!J.spyListeners.length}function cn(e){if(J.spyListeners.length)for(var t=J.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function lt(e){var t=nr({},e,{spyReportStart:!0});cn(t)}var ig={type:"report-end",spyReportEnd:!0};function ct(e){cn(e?nr({},e,{type:"report-end",spyReportEnd:!0}):ig)}function og(e){return J.spyListeners.push(e),As(function(){J.spyListeners=J.spyListeners.filter(function(t){return t!==e})})}var $s="action",ag="action.bound",ef="autoAction",sg="autoAction.bound",tf="<unnamed action>",Ha=xi($s),ug=xi(ag,{bound:!0}),Ja=xi(ef,{autoAction:!0}),lg=xi(sg,{autoAction:!0,bound:!0});function rf(e){var t=function(r,n){if(Me(r))return Cr(r.name||tf,r,e);if(Me(n))return Cr(r,n,e);if(Oi(n))return(e?Ja:Ha).decorate_20223_(r,n);if(Mr(n))return Ti(r,n,e?Ja:Ha);if(Mr(r))return qt(xi(e?ef:$s,{name:r,autoAction:e}));le("Invalid arguments for `action`")};return t}var Ot=rf(!1);Object.assign(Ot,Ha);var oi=rf(!0);Object.assign(oi,Ja);Ot.bound=qt(ug);oi.bound=qt(lg);function ai(e){return Gc(e.name||tf,!1,e,this,void 0)}function Lr(e){return Me(e)&&e.isMobxAction===!0}function It(e,t){var r,n,i,o;t===void 0&&(t=Es),Me(e)||le("Autorun expects a function as first argument"),Lr(e)&&le("Autorun does not accept actions since actions are untrackable");var a=(r=(n=t)==null?void 0:n.name)!=null?r:e.name||"Autorun@"+jt(),s=!t.scheduler&&!t.delay,u;if(s)u=new Wt(a,function(){this.track(p)},t.onError,t.requiresObservable);else{var c=nf(t),f=!1;u=new Wt(a,function(){f||(f=!0,c(function(){f=!1,u.isDisposed||u.track(p)}))},t.onError,t.requiresObservable)}function p(){e(u)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((o=t)==null?void 0:o.signal)}var cg=function(e){return e()};function nf(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:cg}function fg(e,t,r){var n,i,o;r===void 0&&(r=Es),(!Me(e)||!Me(t))&&le("First and second argument to reaction should be functions"),Lt(r)||le("Third argument of reactions should be an object");var a=(n=r.name)!=null?n:"Reaction@"+jt(),s=Ot(a,r.onError?dg(r.onError,t):t),u=!r.scheduler&&!r.delay,c=nf(r),f=!0,p=!1,S,T=r.compareStructural?Fe.structural:r.equals||Fe.default,I=new Wt(a,function(){f||u?z():p||(p=!0,c(z))},r.onError,r.requiresObservable);function z(){if(p=!1,!I.isDisposed){var Y=!1,V=S;I.track(function(){var M=Fm(!1,function(){return e(I)});Y=f||!T(S,M),S=M}),(f&&r.fireImmediately||!f&&Y)&&s(S,V,I),f=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||I.schedule_(),I.getDisposer_((o=r)==null?void 0:o.signal)}function dg(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var pg="onBO",hg="onBUO";function Ho(e,t,r){return of(pg,e,t,r)}function En(e,t,r){return of(hg,e,t,r)}function of(e,t,r,n){var i=typeof n=="function"?Dt(t,r):Dt(t),o=Me(n)?n:r,a=e+"L";return i[a]?i[a].add(o):i[a]=new Set([o]),function(){var s=i[a];s&&(s.delete(o),s.size===0&&delete i[a])}}var yg="never",Li="always",mg="observed";function gg(e){e.isolateGlobalState===!0&&Jm();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(J.useProxies=t===Li?!0:t===yg?!1:typeof Proxy<"u"),t==="ifavailable"&&(J.verifyProxies=!0),r!==void 0){var n=r===Li?Li:r===mg;J.enforceActions=n,J.allowStateChanges=!(n===!0||n===Li)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(J[i]=!!e[i])}),J.allowStateReads=!J.observableRequiresReaction,J.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&ng(e.reactionScheduler)}function vg(e,t,r,n){arguments.length>4&&le("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&le("'extendObservable' expects an object as first argument"),Xt(e)&&le("'extendObservable' should not be used on maps, use map.merge instead"),Lt(t)||le("'extendObservable' only accepts plain objects as second argument"),(dn(t)||dn(r))&&le("Extending an object with another observable (object) is not supported");var i=qy(t);return Hr(function(){var o=Sn(e,n)[ge];Fo(i).forEach(function(a){o.extend_(a,i[a],r&&a in r?r[a]:!0)})}),e}function Jo(e,t){return af(Dt(e,t))}function af(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=bg(e.observing_).map(af)),t}function ho(e,t){return sf(Dt(e,t))}function sf(e){var t={name:e.name_};return Zm(e)&&(t.observers=Array.from(Qm(e)).map(sf)),t}function bg(e){return Array.from(new Set(e))}var wg=0;function uf(){this.message="FLOW_CANCELLED"}uf.prototype=Object.create(Error.prototype);var _a=Bc("flow"),_g=Bc("flow.bound",{bound:!0}),fn=Object.assign(function(e,t){if(Oi(t))return _a.decorate_20223_(e,t);if(Mr(t))return Ti(e,t,_a);arguments.length!==1&&le("Flow expects single argument with generator function");var r=e,n=r.name||"<unnamed flow>",i=function(){var o=this,a=arguments,s=++wg,u=Ot(n+" - runid: "+s+" - init",r).apply(o,a),c,f=void 0,p=new Promise(function(S,T){var I=0;c=T;function z(M){f=void 0;var F;try{F=Ot(n+" - runid: "+s+" - yield "+I++,u.next).call(u,M)}catch(W){return T(W)}V(F)}function Y(M){f=void 0;var F;try{F=Ot(n+" - runid: "+s+" - yield "+I++,u.throw).call(u,M)}catch(W){return T(W)}V(F)}function V(M){if(Me(M?.then)){M.then(V,T);return}return M.done?S(M.value):(f=Promise.resolve(M.value),f.then(z,Y))}z(void 0)});return p.cancel=Ot(n+" - runid: "+s+" - cancel",function(){try{f&&Du(f);var S=u.return(void 0),T=Promise.resolve(S.value);T.then(sn,sn),Du(T),c(new uf)}catch(I){c(I)}}),p};return i.isMobXFlow=!0,i},_a);fn.bound=qt(_g);function Du(e){Me(e.cancel)&&e.cancel()}function si(e){return e?.isMobXFlow===!0}function Tg(e,t){return e?t!==void 0?Xt(e)||In(e)?le("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):Dr(e)?e[ge].values_.has(t):!1:Dr(e)||!!e[ge]||Is(e)||po(e)||Ei(e):!1}function dn(e){return arguments.length!==1&&le("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),Tg(e)}function Og(e){if(Dr(e))return e[ge].ownKeys_();le(38)}function Di(e,t,r){return e.set(t,r),r}function an(e,t){if(e==null||typeof e!="object"||e instanceof Date||!dn(e))return e;if(zm(e)||Ei(e))return an(e.get(),t);if(t.has(e))return t.get(e);if(In(e)){var r=Di(t,e,new Array(e.length));return e.forEach(function(a,s){r[s]=an(a,t)}),r}if(Ut(e)){var n=Di(t,e,new Set);return e.forEach(function(a){n.add(an(a,t))}),n}if(Xt(e)){var i=Di(t,e,new Map);return e.forEach(function(a,s){i.set(s,an(a,t))}),i}else{var o=Di(t,e,{});return Og(e).forEach(function(a){_i.propertyIsEnumerable.call(e,a)&&(o[a]=an(e[a],t))}),o}}function rr(e,t){return t&&le("toJS no longer supports options"),an(e,new Map)}function lf(){for(var e=!1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[r.length-1]=="boolean"&&(e=r.pop());var i=xg(r);if(!i)return le("'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_===Et.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?Et.BREAK:Et.LOG}function xg(e){switch(e.length){case 0:return J.trackingDerivation;case 1:return Dt(e[0]);case 2:return Dt(e[0],e[1])}}function er(e,t){t===void 0&&(t=void 0),_t();try{return e.apply(t)}finally{Tt()}}function kr(e){return e[ge]}var Eg={has:function(e,t){return J.trackingDerivation&&Gn("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),kr(e).has_(t)},get:function(e,t){return kr(e).get_(t)},set:function(e,t,r){var n;return Mr(t)?(kr(e).values_.has(t)||Gn("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(n=kr(e).set_(t,r,!0))!=null?n:!0):!1},deleteProperty:function(e,t){var r;return Gn("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Mr(t)?(r=kr(e).delete_(t,!0))!=null?r:!0:!1},defineProperty:function(e,t,r){var n;return Gn("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(n=kr(e).defineProperty_(t,r))!=null?n:!0},ownKeys:function(e){return J.trackingDerivation&&Gn("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),kr(e).ownKeys_()},preventExtensions:function(e){le(13)}};function Ag(e,t){var r,n;return Sc(),e=Sn(e,t),(n=(r=e[ge]).proxy_)!=null?n:r.proxy_=new Proxy(e,Eg)}function bt(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Ai(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),As(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function wt(e,t){var r=Wr();try{for(var n=[].concat(e.interceptors_||[]),i=0,o=n.length;i<o&&(t=n[i](t),t&&!t.type&&le(14),!!t);i++);return t}finally{tr(r)}}function Mt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Ii(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),As(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Ct(e,t){var r=Wr(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,o=n.length;i<o;i++)n[i](t);tr(r)}}function An(e,t,r){return Hr(function(){var n,i=Sn(e,r)[ge];t&&e[at]&&le("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(n=t)!=null||(t=Zy(e)),Fo(t).forEach(function(o){return i.make_(o,t[o])})}),e}var Vu="splice",Bt="update",Ig=1e4,Sg={get:function(e,t){var r=e[ge];return t===ge?r:t==="length"?r.getArrayLength_():typeof t=="string"&&!isNaN(t)?r.get_(parseInt(t)):xt(yo,t)?yo[t]:e[t]},set:function(e,t,r){var n=e[ge];return t==="length"&&n.setArrayLength_(r),typeof t=="symbol"||isNaN(t)?e[t]=r:n.set_(parseInt(t),r),!0},preventExtensions:function(){le(15)}},ks=function(){function e(r,n,i,o){r===void 0&&(r="ObservableArray@"+jt()),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_=o,this.atom_=new Er(r),this.enhancer_=function(a,s){return n(a,s,r+"[..]")}}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 Ai(this,r)},t.observe_=function(r,n){return n===void 0&&(n=!1),n&&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}),Ii(this,r)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&le("Out of range: "+r);var n=this.values_.length;if(r!==n)if(r>n){for(var i=new Array(r-n),o=0;o<r-n;o++)i[o]=void 0;this.spliceWithArray_(n,0,i)}else this.spliceWithArray_(r,n-r)},t.updateArrayLength_=function(r,n){r!==this.lastKnownLength_&&le(16),this.lastKnownLength_+=n,this.legacyMode_&&n>0&&yf(r+n+1)},t.spliceWithArray_=function(r,n,i){var o=this;zt(this.atom_);var a=this.values_.length;if(r===void 0?r=0:r>a?r=a:r<0&&(r=Math.max(0,a+r)),arguments.length===1?n=a-r:n==null?n=0:n=Math.max(0,Math.min(n,a-r)),i===void 0&&(i=uo),bt(this)){var s=wt(this,{object:this.proxy_,type:Vu,index:r,removedCount:n,added:i});if(!s)return uo;n=s.removedCount,i=s.added}i=i.length===0?i:i.map(function(f){return o.enhancer_(f,void 0)}),this.legacyMode_;var u=i.length-n;this.updateArrayLength_(a,u);var c=this.spliceItemsIntoValues_(r,n,i);return(n!==0||i.length!==0)&&this.notifyArraySplice_(r,i,c),this.dehanceValues_(c)},t.spliceItemsIntoValues_=function(r,n,i){if(i.length<Ig){var o;return(o=this.values_).splice.apply(o,[r,n].concat(i))}else{var a=this.values_.slice(r,r+n),s=this.values_.slice(r+n);this.values_.length+=i.length-n;for(var u=0;u<i.length;u++)this.values_[r+u]=i[u];for(var c=0;c<s.length;c++)this.values_[r+i.length+c]=s[c];return a}},t.notifyArrayChildUpdate_=function(r,n,i){var o=!this.owned_&&Ze(),a=Mt(this),s=a||o?{observableKind:"array",object:this.proxy_,type:Bt,debugObjectName:this.atom_.name_,index:r,newValue:n,oldValue:i}:null;o&<(s),this.atom_.reportChanged(),a&&Ct(this,s),o&&ct()},t.notifyArraySplice_=function(r,n,i){var o=!this.owned_&&Ze(),a=Mt(this),s=a||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Vu,index:r,removed:i,added:n,removedCount:i.length,addedCount:n.length}:null;o&<(s),this.atom_.reportChanged(),a&&Ct(this,s),o&&ct()},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,n){var i=this.values_;if(this.legacyMode_&&r>i.length&&le(17,r,i.length),r<i.length){zt(this.atom_);var o=i[r];if(bt(this)){var a=wt(this,{type:Bt,object:this.proxy_,index:r,newValue:n});if(!a)return;n=a.newValue}n=this.enhancer_(n,o);var s=n!==o;s&&(i[r]=n,this.notifyArrayChildUpdate_(r,n,o))}else{for(var u=new Array(r+1-i.length),c=0;c<u.length-1;c++)u[c]=void 0;u[u.length-1]=n,this.spliceWithArray_(i.length,0,u)}},e}();function jg(e,t,r,n){return r===void 0&&(r="ObservableArray@"+jt()),n===void 0&&(n=!1),Sc(),Hr(function(){var i=new ks(r,t,n,!1);$c(i.values_,ge,i);var o=new Proxy(i.values_,Sg);return i.proxy_=o,e&&e.length&&i.spliceWithArray_(0,0,e),o})}var yo={clear:function(){return this.splice(0)},replace:function(e){var t=this[ge];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];var o=this[ge];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,t)}return o.spliceWithArray_(e,t,n)},spliceWithArray:function(e,t,r){return this[ge].spliceWithArray_(e,t,r)},push:function(){for(var e=this[ge],t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.spliceWithArray_(e.values_.length,0,r),e.values_.length},pop:function(){return this.splice(Math.max(this[ge].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[ge],t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.spliceWithArray_(0,0,r),e.values_.length},reverse:function(){return J.trackingDerivation&&le(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){J.trackingDerivation&&le(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[ge],r=t.dehanceValues_(t.values_).indexOf(e);return r>-1?(this.splice(r,1),!0):!1}};Pe("at",dt);Pe("concat",dt);Pe("flat",dt);Pe("includes",dt);Pe("indexOf",dt);Pe("join",dt);Pe("lastIndexOf",dt);Pe("slice",dt);Pe("toString",dt);Pe("toLocaleString",dt);Pe("toSorted",dt);Pe("toSpliced",dt);Pe("with",dt);Pe("every",Ft);Pe("filter",Ft);Pe("find",Ft);Pe("findIndex",Ft);Pe("findLast",Ft);Pe("findLastIndex",Ft);Pe("flatMap",Ft);Pe("forEach",Ft);Pe("map",Ft);Pe("some",Ft);Pe("toReversed",Ft);Pe("reduce",cf);Pe("reduceRight",cf);function Pe(e,t){typeof Array.prototype[e]=="function"&&(yo[e]=t(e))}function dt(e){return function(){var t=this[ge];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Ft(e){return function(t,r){var n=this,i=this[ge];i.atom_.reportObserved();var o=i.dehanceValues_(i.values_);return o[e](function(a,s){return t.call(r,a,s,n)})}}function cf(e){return function(){var t=this,r=this[ge];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(o,a,s){return i(o,a,s,t)},n[e].apply(n,arguments)}}var $g=xr("ObservableArrayAdministration",ks);function In(e){return Do(e)&&$g(e[ge])}var kg={},gr="add",mo="delete",ff=function(){function e(r,n,i){var o=this;n===void 0&&(n=xn),i===void 0&&(i="ObservableMap@"+jt()),this.enhancer_=void 0,this.name_=void 0,this[ge]=kg,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_=n,this.name_=i,Me(Map)||le(18),Hr(function(){o.keysAtom_=Uc(o.name_+".keys()"),o.data_=new Map,o.hasMap_=new Map,r&&o.merge(r)})}var t=e.prototype;return t.has_=function(r){return this.data_.has(r)},t.has=function(r){var n=this;if(!J.trackingDerivation)return this.has_(r);var i=this.hasMap_.get(r);if(!i){var o=i=new br(this.has_(r),zo,this.name_+"."+Va(r)+"?",!1);this.hasMap_.set(r,o),En(o,function(){return n.hasMap_.delete(r)})}return i.get()},t.set=function(r,n){var i=this.has_(r);if(bt(this)){var o=wt(this,{type:i?Bt:gr,object:this,newValue:n,name:r});if(!o)return this;n=o.newValue}return i?this.updateValue_(r,n):this.addValue_(r,n),this},t.delete=function(r){var n=this;if(zt(this.keysAtom_),bt(this)){var i=wt(this,{type:mo,object:this,name:r});if(!i)return!1}if(this.has_(r)){var o=Ze(),a=Mt(this),s=a||o?{observableKind:"map",debugObjectName:this.name_,type:mo,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return o&<(s),er(function(){var u;n.keysAtom_.reportChanged(),(u=n.hasMap_.get(r))==null||u.setNewValue_(!1);var c=n.data_.get(r);c.setNewValue_(void 0),n.data_.delete(r)}),a&&Ct(this,s),o&&ct(),!0}return!1},t.updateValue_=function(r,n){var i=this.data_.get(r);if(n=i.prepareNewValue_(n),n!==J.UNCHANGED){var o=Ze(),a=Mt(this),s=a||o?{observableKind:"map",debugObjectName:this.name_,type:Bt,object:this,oldValue:i.value_,name:r,newValue:n}:null;o&<(s),i.setNewValue_(n),a&&Ct(this,s),o&&ct()}},t.addValue_=function(r,n){var i=this;zt(this.keysAtom_),er(function(){var u,c=new br(n,i.enhancer_,i.name_+"."+Va(r),!1);i.data_.set(r,c),n=c.value_,(u=i.hasMap_.get(r))==null||u.setNewValue_(!0),i.keysAtom_.reportChanged()});var o=Ze(),a=Mt(this),s=a||o?{observableKind:"map",debugObjectName:this.name_,type:gr,object:this,name:r,newValue:n}:null;o&<(s),a&&Ct(this,s),o&&ct()},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,n=this.keys();return Fu({next:function(){var i=n.next(),o=i.done,a=i.value;return{done:o,value:o?void 0:r.get(a)}}})},t.entries=function(){var r=this,n=this.keys();return Fu({next:function(){var i=n.next(),o=i.done,a=i.value;return{done:o,value:o?void 0:[a,r.get(a)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(r,n){for(var i=un(this),o;!(o=i()).done;){var a=o.value,s=a[0],u=a[1];r.call(n,u,s,this)}},t.merge=function(r){var n=this;return Xt(r)&&(r=new Map(r)),er(function(){Lt(r)?Ky(r).forEach(function(i){return n.set(i,r[i])}):Array.isArray(r)?r.forEach(function(i){var o=i[0],a=i[1];return n.set(o,a)}):Tn(r)?(zy(r)||le(19,r),r.forEach(function(i,o){return n.set(o,i)})):r!=null&&le(20,r)}),this},t.clear=function(){var r=this;er(function(){Re(function(){for(var n=un(r.keys()),i;!(i=n()).done;){var o=i.value;r.delete(o)}})})},t.replace=function(r){var n=this;return er(function(){for(var i=Pg(r),o=new Map,a=!1,s=un(n.data_.keys()),u;!(u=s()).done;){var c=u.value;if(!i.has(c)){var f=n.delete(c);if(f)a=!0;else{var p=n.data_.get(c);o.set(c,p)}}}for(var S=un(i.entries()),T;!(T=S()).done;){var I=T.value,z=I[0],Y=I[1],V=n.data_.has(z);if(n.set(z,Y),n.data_.has(z)){var M=n.data_.get(z);o.set(z,M),V||(a=!0)}}if(!a)if(n.data_.size!==o.size)n.keysAtom_.reportChanged();else for(var F=n.data_.keys(),W=o.keys(),D=F.next(),re=W.next();!D.done;){if(D.value!==re.value){n.keysAtom_.reportChanged();break}D=F.next(),re=W.next()}n.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(r,n){return n===!0&&le("`observe` doesn't support fireImmediately=true in combination with maps."),Ii(this,r)},t.intercept_=function(r){return Ai(this,r)},On(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Xt=xr("ObservableMap",ff);function Fu(e){return e[Symbol.toStringTag]="MapIterator",Rs(e)}function Pg(e){if(Tn(e)||Xt(e))return e;if(Array.isArray(e))return new Map(e);if(Lt(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return le(21,e)}var Ng={},df=function(){function e(r,n,i){var o=this;n===void 0&&(n=xn),i===void 0&&(i="ObservableSet@"+jt()),this.name_=void 0,this[ge]=Ng,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,Me(Set)||le(22),this.enhancer_=function(a,s){return n(a,s,i)},Hr(function(){o.atom_=Uc(o.name_),r&&o.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.clear=function(){var r=this;er(function(){Re(function(){for(var n=un(r.data_.values()),i;!(i=n()).done;){var o=i.value;r.delete(o)}})})},t.forEach=function(r,n){for(var i=un(this),o;!(o=i()).done;){var a=o.value;r.call(n,a,a,this)}},t.add=function(r){var n=this;if(zt(this.atom_),bt(this)){var i=wt(this,{type:gr,object:this,newValue:r});if(!i)return this;r=i.newValue}if(!this.has(r)){er(function(){n.data_.add(n.enhancer_(r,void 0)),n.atom_.reportChanged()});var o=Ze(),a=Mt(this),s=a||o?{observableKind:"set",debugObjectName:this.name_,type:gr,object:this,newValue:r}:null;o&<(s),a&&Ct(this,s),o&&ct()}return this},t.delete=function(r){var n=this;if(bt(this)){var i=wt(this,{type:mo,object:this,oldValue:r});if(!i)return!1}if(this.has(r)){var o=Ze(),a=Mt(this),s=a||o?{observableKind:"set",debugObjectName:this.name_,type:mo,object:this,oldValue:r}:null;return o&<(s),er(function(){n.atom_.reportChanged(),n.data_.delete(r)}),a&&Ct(this,s),o&&ct(),!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 Gu({next:function(){var n=r.next(),i=n.value,o=n.done;return o?{value:void 0,done:o}:{value:[i,i],done:o}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var r=this,n=this.data_.values();return Gu({next:function(){var i=n.next(),o=i.value,a=i.done;return a?{value:void 0,done:a}:{value:r.dehanceValue_(o),done:a}}})},t.intersection=function(r){if(Yt(r)&&!Ut(r))return r.intersection(this);var n=new Set(this);return n.intersection(r)},t.union=function(r){if(Yt(r)&&!Ut(r))return r.union(this);var n=new Set(this);return n.union(r)},t.difference=function(r){return new Set(this).difference(r)},t.symmetricDifference=function(r){if(Yt(r)&&!Ut(r))return r.symmetricDifference(this);var n=new Set(this);return n.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(Yt(r)&&!Ut(r))return r.isDisjointFrom(this);var n=new Set(this);return n.isDisjointFrom(r)},t.replace=function(r){var n=this;return Ut(r)&&(r=new Set(r)),er(function(){Array.isArray(r)?(n.clear(),r.forEach(function(i){return n.add(i)})):Yt(r)?(n.clear(),r.forEach(function(i){return n.add(i)})):r!=null&&le("Cannot initialize set from "+r)}),this},t.observe_=function(r,n){return n===!0&&le("`observe` doesn't support fireImmediately=true in combination with sets."),Ii(this,r)},t.intercept_=function(r){return Ai(this,r)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},On(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Ut=xr("ObservableSet",df);function Gu(e){return e[Symbol.toStringTag]="SetIterator",Rs(e)}var zu=Object.create(null),Ku="remove",Xa=function(){function e(r,n,i,o){n===void 0&&(n=new Map),o===void 0&&(o=Tm),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_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=o,this.keysAtom_=new Er(this.name_+".keys"),this.isPlainObject_=Lt(this.target_),mf(this.defaultAnnotation_)||le("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,n){var i=this.values_.get(r);if(i instanceof At)return i.set(n),!0;if(bt(this)){var o=wt(this,{type:Bt,object:this.proxy_||this.target_,name:r,newValue:n});if(!o)return null;n=o.newValue}if(n=i.prepareNewValue_(n),n!==J.UNCHANGED){var a=Mt(this),s=Ze(),u=a||s?{type:Bt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:i.value_,name:r,newValue:n}:null;s&<(u),i.setNewValue_(n),a&&Ct(this,u),s&&ct()}return!0},t.get_=function(r){return J.trackingDerivation&&!xt(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,n,i){return i===void 0&&(i=!1),xt(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,n):i?Reflect.set(this.target_,r,n):(this.target_[r]=n,!0):this.extend_(r,{value:n,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,i)},t.has_=function(r){if(!J.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var n=this.pendingKeys_.get(r);return n||(n=new br(r in this.target_,zo,this.name_+"."+Va(r)+"?",!1),this.pendingKeys_.set(r,n)),n.get()},t.make_=function(r,n){if(n===!0&&(n=this.defaultAnnotation_),n!==!1){if(Hu(this,n,r),!(r in this.target_)){var i;if((i=this.target_[at])!=null&&i[r])return;le(1,n.annotationType_,this.name_+"."+r.toString())}for(var o=this.target_;o&&o!==_i;){var a=so(o,r);if(a){var s=n.make_(this,r,a,o);if(s===0)return;if(s===1)break}o=Object.getPrototypeOf(o)}Wu(this,n,r)}},t.extend_=function(r,n,i,o){if(o===void 0&&(o=!1),i===!0&&(i=this.defaultAnnotation_),i===!1)return this.defineProperty_(r,n,o);Hu(this,i,r);var a=i.extend_(this,r,n,o);return a&&Wu(this,i,r),a},t.defineProperty_=function(r,n,i){i===void 0&&(i=!1),zt(this.keysAtom_);try{_t();var o=this.delete_(r);if(!o)return o;if(bt(this)){var a=wt(this,{object:this.proxy_||this.target_,name:r,type:gr,newValue:n.value});if(!a)return null;var s=a.newValue;n.value!==s&&(n=nr({},n,{value:s}))}if(i){if(!Reflect.defineProperty(this.target_,r,n))return!1}else Kt(this.target_,r,n);this.notifyPropertyAddition_(r,n.value)}finally{Tt()}return!0},t.defineObservableProperty_=function(r,n,i,o){o===void 0&&(o=!1),zt(this.keysAtom_);try{_t();var a=this.delete_(r);if(!a)return a;if(bt(this)){var s=wt(this,{object:this.proxy_||this.target_,name:r,type:gr,newValue:n});if(!s)return null;n=s.newValue}var u=qu(r),c={configurable:J.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:u.get,set:u.set};if(o){if(!Reflect.defineProperty(this.target_,r,c))return!1}else Kt(this.target_,r,c);var f=new br(n,i,this.name_+"."+r.toString(),!1);this.values_.set(r,f),this.notifyPropertyAddition_(r,f.value_)}finally{Tt()}return!0},t.defineComputedProperty_=function(r,n,i){i===void 0&&(i=!1),zt(this.keysAtom_);try{_t();var o=this.delete_(r);if(!o)return o;if(bt(this)){var a=wt(this,{object:this.proxy_||this.target_,name:r,type:gr,newValue:void 0});if(!a)return null}n.name||(n.name=this.name_+"."+r.toString()),n.context=this.proxy_||this.target_;var s=qu(r),u={configurable:J.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:s.get,set:s.set};if(i){if(!Reflect.defineProperty(this.target_,r,u))return!1}else Kt(this.target_,r,u);this.values_.set(r,new At(n)),this.notifyPropertyAddition_(r,void 0)}finally{Tt()}return!0},t.delete_=function(r,n){if(n===void 0&&(n=!1),zt(this.keysAtom_),!xt(this.target_,r))return!0;if(bt(this)){var i=wt(this,{object:this.proxy_||this.target_,name:r,type:Ku});if(!i)return null}try{var o;_t();var a=Mt(this),s=Ze(),u=this.values_.get(r),c=void 0;if(!u&&(a||s)){var f;c=(f=so(this.target_,r))==null?void 0:f.value}if(n){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(delete this.appliedAnnotations_[r],u&&(this.values_.delete(r),u instanceof br&&(c=u.value_),Xc(u)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(r in this.target_),a||s){var p={type:Ku,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:c,name:r};s&<(p),a&&Ct(this,p),s&&ct()}}finally{Tt()}return!0},t.observe_=function(r,n){return n===!0&&le("`observe` doesn't support the fire immediately property for observable objects."),Ii(this,r)},t.intercept_=function(r){return Ai(this,r)},t.notifyPropertyAddition_=function(r,n){var i,o=Mt(this),a=Ze();if(o||a){var s=o||a?{type:gr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:n}:null;a&<(s),o&&Ct(this,s),a&&ct()}(i=this.pendingKeys_)==null||(i=i.get(r))==null||i.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Fo(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Sn(e,t){var r;if(t&&Dr(e)&&le("Options can't be provided for already observable objects."),xt(e,ge))return Ns(e)instanceof Xa||le("Cannot convert '"+go(e)+`' into observable object:
|
|
26
|
+
The target is already observable of different type.
|
|
27
|
+
Extending builtins is not supported.`),e;Object.isExtensible(e)||le("Cannot make the designated object observable; it is not extensible");var n=(r=t?.name)!=null?r:(Lt(e)?"ObservableObject":e.constructor.name)+"@"+jt(),i=new Xa(e,new Map,String(n),Nm(t));return Vo(e,ge,i),e}var Ug=xr("ObservableObjectAdministration",Xa);function qu(e){return zu[e]||(zu[e]={get:function(){return this[ge].getObservablePropValue_(e)},set:function(t){return this[ge].setObservablePropValue_(e,t)}})}function Dr(e){return Do(e)?Ug(e[ge]):!1}function Wu(e,t,r){var n;e.appliedAnnotations_[r]=t,(n=e.target_[at])==null||delete n[r]}function Hu(e,t,r){if(mf(t)||le("Cannot annotate '"+e.name_+"."+r.toString()+"': Invalid annotation."),!lo(t)&&xt(e.appliedAnnotations_,r)){var n=e.name_+"."+r.toString(),i=e.appliedAnnotations_[r].annotationType_,o=t.annotationType_;le("Cannot apply '"+o+"' to '"+n+"':"+(`
|
|
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 Rg=hf(0),Bg=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Ta=0,pf=function(){};function Mg(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Mg(pf,Array.prototype);var Ps=function(e){function t(n,i,o,a){var s;return o===void 0&&(o="ObservableArray@"+jt()),a===void 0&&(a=!1),s=e.call(this)||this,Hr(function(){var u=new ks(o,i,a,!0);u.proxy_=s,$c(s,ge,u),n&&n.length&&s.spliceWithArray(0,0,n),Bg&&Object.defineProperty(s,"0",Rg)}),s}Nc(t,e);var r=t.prototype;return r.concat=function(){this[ge].atom_.reportObserved();for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),i.map(function(a){return In(a)?a.slice():a}))},r[Symbol.iterator]=function(){var n=this,i=0;return Rs({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},On(t,[{key:"length",get:function(){return this[ge].getArrayLength_()},set:function(n){this[ge].setArrayLength_(n)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(pf);Object.entries(yo).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Vo(Ps.prototype,t,r)});function hf(e){return{enumerable:!1,configurable:!0,get:function(){return this[ge].get_(e)},set:function(t){this[ge].set_(e,t)}}}function Cg(e){Kt(Ps.prototype,""+e,hf(e))}function yf(e){if(e>Ta){for(var t=Ta;t<e+100;t++)Cg(t);Ta=e}}yf(1e3);function Lg(e,t,r){return new Ps(e,t,r)}function Dt(e,t){if(typeof e=="object"&&e!==null){if(In(e))return t!==void 0&&le(23),e[ge].atom_;if(Ut(e))return e.atom_;if(Xt(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||le(25,t,go(e)),r}if(Dr(e)){if(!t)return le(26);var n=e[ge].values_.get(t);return n||le(27,t,go(e)),n}if(Is(e)||Ei(e)||po(e))return e}else if(Me(e)&&po(e[ge]))return e[ge];le(28)}function Ns(e,t){if(e||le(29),t!==void 0)return Ns(Dt(e,t));if(Is(e)||Ei(e)||po(e)||Xt(e)||Ut(e))return e;if(e[ge])return e[ge];le(24,e)}function go(e,t){var r;if(t!==void 0)r=Dt(e,t);else{if(Lr(e))return e.name;Dr(e)||Xt(e)||Ut(e)?r=Ns(e):r=Dt(e)}return r.name_}function Hr(e){var t=Wr(),r=qo(!0);_t();try{return e()}finally{Tt(),Wo(r),tr(t)}}var Ju=_i.toString;function Us(e,t,r){return r===void 0&&(r=-1),Za(e,t,r)}function Za(e,t,r,n,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 o=typeof e;if(o!=="function"&&o!=="object"&&typeof t!="object")return!1;var a=Ju.call(e);if(a!==Ju.call(t))return!1;switch(a){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]":r>=0&&r++;break}e=Xu(e),t=Xu(t);var s=a==="[object Array]";if(!s){if(typeof e!="object"||typeof t!="object")return!1;var u=e.constructor,c=t.constructor;if(u!==c&&!(Me(u)&&u instanceof u&&Me(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var f=n.length;f--;)if(n[f]===e)return i[f]===t;if(n.push(e),i.push(t),s){if(f=e.length,f!==t.length)return!1;for(;f--;)if(!Za(e[f],t[f],r-1,n,i))return!1}else{var p=Object.keys(e),S=p.length;if(Object.keys(t).length!==S)return!1;for(var T=0;T<S;T++){var I=p[T];if(!(xt(t,I)&&Za(e[I],t[I],r-1,n,i)))return!1}}return n.pop(),i.pop(),!0}function Xu(e){return In(e)?e.slice():Tn(e)||Xt(e)||Yt(e)||Ut(e)?Array.from(e.entries()):e}var Zu,Dg=((Zu=Lo().Iterator)==null?void 0:Zu.prototype)||{};function Rs(e){return e[Symbol.iterator]=Vg,Object.assign(Object.create(Dg),e)}function Vg(){return this}function mf(e){return e instanceof Object&&typeof e.annotationType_=="string"&&Me(e.make_)&&Me(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Lo();typeof t[e]>"u"&&le("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:og,extras:{getDebugName:go},$mobx:ge});var Fg=Object.create,Bs=Object.defineProperty,Gg=Object.getOwnPropertyDescriptor,gf=Object.getOwnPropertyNames,zg=Object.getPrototypeOf,Kg=Object.prototype.hasOwnProperty,qe=(e,t)=>function(){return t||(0,e[gf(e)[0]])((t={exports:{}}).exports,t),t.exports},vf=(e,t)=>{for(var r in t)Bs(e,r,{get:t[r],enumerable:!0})},qg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gf(t))!Kg.call(e,i)&&i!==r&&Bs(e,i,{get:()=>t[i],enumerable:!(n=Gg(t,i))||n.enumerable});return e},sr=(e,t,r)=>(r=e!=null?Fg(zg(e)):{},qg(t||!e||!e.__esModule?Bs(r,"default",{value:e,enumerable:!0}):r,e)),Ar=qe({"../../../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(d){let w=new Map;function E(){return new Map(w)}d.Entries=E;function N(){return w.clear()}d.Clear=N;function j(_){return w.delete(_)}d.Delete=j;function k(_){return w.has(_)}d.Has=k;function m(_,l){w.set(_,l)}d.Set=m;function x(_){return w.get(_)}d.Get=x})(t||(e.TypeRegistry=t={}));var r=class extends Error{constructor(d){super(d)}};e.TypeBoxError=r;var n;(function(d){let w=new Map;function E(){return new Map(w)}d.Entries=E;function N(){return w.clear()}d.Clear=N;function j(_){return w.delete(_)}d.Delete=j;function k(_){return w.has(_)}d.Has=k;function m(_,l){w.set(_,l)}d.Set=m;function x(_){return w.get(_)}d.Get=x})(n||(e.FormatRegistry=n={}));var i;(function(d){function w(b){return Array.isArray(b)}d.IsArray=w;function E(b){return typeof b=="bigint"}d.IsBigInt=E;function N(b){return typeof b=="boolean"}d.IsBoolean=N;function j(b){return b instanceof globalThis.Date}d.IsDate=j;function k(b){return b===null}d.IsNull=k;function m(b){return typeof b=="number"}d.IsNumber=m;function x(b){return typeof b=="object"&&b!==null}d.IsObject=x;function _(b){return typeof b=="string"}d.IsString=_;function l(b){return b instanceof globalThis.Uint8Array}d.IsUint8Array=l;function O(b){return b===void 0}d.IsUndefined=O})(i||(e.ValueGuard=i={}));var o=class extends r{};e.TypeGuardUnknownTypeError=o;var a;(function(d){function w(g){try{return new RegExp(g),!0}catch{return!1}}function E(g){if(!i.IsString(g))return!1;for(let $e=0;$e<g.length;$e++){let yt=g.charCodeAt($e);if(yt>=7&&yt<=13||yt===27||yt===127)return!1}return!0}function N(g){return m(g)||ze(g)}function j(g){return i.IsUndefined(g)||i.IsBigInt(g)}function k(g){return i.IsUndefined(g)||i.IsNumber(g)}function m(g){return i.IsUndefined(g)||i.IsBoolean(g)}function x(g){return i.IsUndefined(g)||i.IsString(g)}function _(g){return i.IsUndefined(g)||i.IsString(g)&&E(g)&&w(g)}function l(g){return i.IsUndefined(g)||i.IsString(g)&&E(g)}function O(g){return i.IsUndefined(g)||ze(g)}function b(g){return be(g,"Any")&&x(g.$id)}d.TAny=b;function v(g){return be(g,"Array")&&g.type==="array"&&x(g.$id)&&ze(g.items)&&k(g.minItems)&&k(g.maxItems)&&m(g.uniqueItems)&&O(g.contains)&&k(g.minContains)&&k(g.maxContains)}d.TArray=v;function P(g){return be(g,"AsyncIterator")&&g.type==="AsyncIterator"&&x(g.$id)&&ze(g.items)}d.TAsyncIterator=P;function G(g){return be(g,"BigInt")&&g.type==="bigint"&&x(g.$id)&&j(g.exclusiveMaximum)&&j(g.exclusiveMinimum)&&j(g.maximum)&&j(g.minimum)&&j(g.multipleOf)}d.TBigInt=G;function ee(g){return be(g,"Boolean")&&g.type==="boolean"&&x(g.$id)}d.TBoolean=ee;function ne(g){return be(g,"Constructor")&&g.type==="Constructor"&&x(g.$id)&&i.IsArray(g.parameters)&&g.parameters.every($e=>ze($e))&&ze(g.returns)}d.TConstructor=ne;function me(g){return be(g,"Date")&&g.type==="Date"&&x(g.$id)&&k(g.exclusiveMaximumTimestamp)&&k(g.exclusiveMinimumTimestamp)&&k(g.maximumTimestamp)&&k(g.minimumTimestamp)&&k(g.multipleOfTimestamp)}d.TDate=me;function _e(g){return be(g,"Function")&&g.type==="Function"&&x(g.$id)&&i.IsArray(g.parameters)&&g.parameters.every($e=>ze($e))&&ze(g.returns)}d.TFunction=_e;function Ne(g){return be(g,"Integer")&&g.type==="integer"&&x(g.$id)&&k(g.exclusiveMaximum)&&k(g.exclusiveMinimum)&&k(g.maximum)&&k(g.minimum)&&k(g.multipleOf)}d.TInteger=Ne;function Ce(g){return be(g,"Intersect")&&!(i.IsString(g.type)&&g.type!=="object")&&i.IsArray(g.allOf)&&g.allOf.every($e=>ze($e)&&!Dn($e))&&x(g.type)&&(m(g.unevaluatedProperties)||O(g.unevaluatedProperties))&&x(g.$id)}d.TIntersect=Ce;function Ir(g){return be(g,"Iterator")&&g.type==="Iterator"&&x(g.$id)&&ze(g.items)}d.TIterator=Ir;function be(g,$e){return ur(g)&&g[e.Kind]===$e}d.TKindOf=be;function ur(g){return i.IsObject(g)&&e.Kind in g&&i.IsString(g[e.Kind])}d.TKind=ur;function Sr(g){return $(g)&&i.IsString(g.const)}d.TLiteralString=Sr;function A(g){return $(g)&&i.IsNumber(g.const)}d.TLiteralNumber=A;function ce(g){return $(g)&&i.IsBoolean(g.const)}d.TLiteralBoolean=ce;function $(g){return be(g,"Literal")&&x(g.$id)&&(i.IsBoolean(g.const)||i.IsNumber(g.const)||i.IsString(g.const))}d.TLiteral=$;function ve(g){return be(g,"Never")&&i.IsObject(g.not)&&Object.getOwnPropertyNames(g.not).length===0}d.TNever=ve;function ie(g){return be(g,"Not")&&ze(g.not)}d.TNot=ie;function de(g){return be(g,"Null")&&g.type==="null"&&x(g.$id)}d.TNull=de;function Se(g){return be(g,"Number")&&g.type==="number"&&x(g.$id)&&k(g.exclusiveMaximum)&&k(g.exclusiveMinimum)&&k(g.maximum)&&k(g.minimum)&&k(g.multipleOf)}d.TNumber=Se;function Le(g){return be(g,"Object")&&g.type==="object"&&x(g.$id)&&i.IsObject(g.properties)&&N(g.additionalProperties)&&k(g.minProperties)&&k(g.maxProperties)&&Object.entries(g.properties).every(([$e,yt])=>E($e)&&ze(yt))}d.TObject=Le;function tt(g){return be(g,"Promise")&&g.type==="Promise"&&x(g.$id)&&ze(g.item)}d.TPromise=tt;function Qe(g){return be(g,"Record")&&g.type==="object"&&x(g.$id)&&N(g.additionalProperties)&&i.IsObject(g.patternProperties)&&($e=>{let yt=Object.getOwnPropertyNames($e.patternProperties);return yt.length===1&&w(yt[0])&&i.IsObject($e.patternProperties)&&ze($e.patternProperties[yt[0]])})(g)}d.TRecord=Qe;function nt(g){return i.IsObject(g)&&e.Hint in g&&g[e.Hint]==="Recursive"}d.TRecursive=nt;function lr(g){return be(g,"Ref")&&x(g.$id)&&i.IsString(g.$ref)}d.TRef=lr;function rn(g){return be(g,"String")&&g.type==="string"&&x(g.$id)&&k(g.minLength)&&k(g.maxLength)&&_(g.pattern)&&l(g.format)}d.TString=rn;function nn(g){return be(g,"Symbol")&&g.type==="symbol"&&x(g.$id)}d.TSymbol=nn;function jr(g){return be(g,"TemplateLiteral")&&g.type==="string"&&i.IsString(g.pattern)&&g.pattern[0]==="^"&&g.pattern[g.pattern.length-1]==="$"}d.TTemplateLiteral=jr;function Ui(g){return be(g,"This")&&x(g.$id)&&i.IsString(g.$ref)}d.TThis=Ui;function Dn(g){return i.IsObject(g)&&e.Transform in g}d.TTransform=Dn;function Ge(g){return be(g,"Tuple")&&g.type==="array"&&x(g.$id)&&i.IsNumber(g.minItems)&&i.IsNumber(g.maxItems)&&g.minItems===g.maxItems&&(i.IsUndefined(g.items)&&i.IsUndefined(g.additionalItems)&&g.minItems===0||i.IsArray(g.items)&&g.items.every($e=>ze($e)))}d.TTuple=Ge;function Ri(g){return be(g,"Undefined")&&g.type==="undefined"&&x(g.$id)}d.TUndefined=Ri;function ha(g){return $r(g)&&g.anyOf.every($e=>Sr($e)||A($e))}d.TUnionLiteral=ha;function $r(g){return be(g,"Union")&&x(g.$id)&&i.IsObject(g)&&i.IsArray(g.anyOf)&&g.anyOf.every($e=>ze($e))}d.TUnion=$r;function on(g){return be(g,"Uint8Array")&&g.type==="Uint8Array"&&x(g.$id)&&k(g.minByteLength)&&k(g.maxByteLength)}d.TUint8Array=on;function rt(g){return be(g,"Unknown")&&x(g.$id)}d.TUnknown=rt;function Bi(g){return be(g,"Unsafe")}d.TUnsafe=Bi;function Vn(g){return be(g,"Void")&&g.type==="void"&&x(g.$id)}d.TVoid=Vn;function ya(g){return i.IsObject(g)&&g[e.Readonly]==="Readonly"}d.TReadonly=ya;function ma(g){return i.IsObject(g)&&g[e.Optional]==="Optional"}d.TOptional=ma;function ze(g){return i.IsObject(g)&&(b(g)||v(g)||ee(g)||G(g)||P(g)||ne(g)||me(g)||_e(g)||Ne(g)||Ce(g)||Ir(g)||$(g)||ve(g)||ie(g)||de(g)||Se(g)||Le(g)||tt(g)||Qe(g)||lr(g)||rn(g)||nn(g)||jr(g)||Ui(g)||Ge(g)||Ri(g)||$r(g)||on(g)||rt(g)||Bi(g)||Vn(g)||ur(g)&&t.Has(g[e.Kind]))}d.TSchema=ze})(a||(e.TypeGuard=a={}));var s;(function(d){function w(E){return E[e.Kind]==="Intersect"?E.allOf.every(N=>w(N)):E[e.Kind]==="Union"?E.anyOf.some(N=>w(N)):E[e.Kind]==="Undefined"?!0:E[e.Kind]==="Not"?!w(E.not):!1}d.Check=w})(s||(e.ExtendsUndefined=s={}));var u=class extends r{};e.TypeExtendsError=u;var c;(function(d){d[d.Union=0]="Union",d[d.True=1]="True",d[d.False=2]="False"})(c||(e.TypeExtendsResult=c={}));var f;(function(d){function w(y){return y===c.False?y:c.True}function E(y){throw new u(y)}function N(y){return a.TNever(y)||a.TIntersect(y)||a.TUnion(y)||a.TUnknown(y)||a.TAny(y)}function j(y,h){return a.TNever(h)?be(y,h):a.TIntersect(h)?_e(y,h):a.TUnion(h)?ga(y,h):a.TUnknown(h)?Tu(y,h):a.TAny(h)?k(y,h):E("StructuralRight")}function k(y,h){return c.True}function m(y,h){return a.TIntersect(h)?_e(y,h):a.TUnion(h)&&h.anyOf.some(xe=>a.TAny(xe)||a.TUnknown(xe))?c.True:a.TUnion(h)?c.Union:a.TUnknown(h)||a.TAny(h)?c.True:c.Union}function x(y,h){return a.TUnknown(y)?c.False:a.TAny(y)?c.Union:a.TNever(y)?c.True:c.False}function _(y,h){return a.TObject(h)&&jr(h)?c.True:N(h)?j(y,h):a.TArray(h)?w(ke(y.items,h.items)):c.False}function l(y,h){return N(h)?j(y,h):a.TAsyncIterator(h)?w(ke(y.items,h.items)):c.False}function O(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):a.TBigInt(h)?c.True:c.False}function b(y,h){return a.TLiteral(y)&&i.IsBoolean(y.const)||a.TBoolean(y)?c.True:c.False}function v(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):a.TBoolean(h)?c.True:c.False}function P(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TConstructor(h)?y.parameters.length>h.parameters.length?c.False:y.parameters.every((xe,Qt)=>w(ke(h.parameters[Qt],xe))===c.True)?w(ke(y.returns,h.returns)):c.False:c.False}function G(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):a.TDate(h)?c.True:c.False}function ee(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TFunction(h)?y.parameters.length>h.parameters.length?c.False:y.parameters.every((xe,Qt)=>w(ke(h.parameters[Qt],xe))===c.True)?w(ke(y.returns,h.returns)):c.False:c.False}function ne(y,h){return a.TLiteral(y)&&i.IsNumber(y.const)||a.TNumber(y)||a.TInteger(y)?c.True:c.False}function me(y,h){return a.TInteger(h)||a.TNumber(h)?c.True:N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):c.False}function _e(y,h){return h.allOf.every(xe=>ke(y,xe)===c.True)?c.True:c.False}function Ne(y,h){return y.allOf.some(xe=>ke(xe,h)===c.True)?c.True:c.False}function Ce(y,h){return N(h)?j(y,h):a.TIterator(h)?w(ke(y.items,h.items)):c.False}function Ir(y,h){return a.TLiteral(h)&&h.const===y.const?c.True:N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):a.TString(h)?Vn(y,h):a.TNumber(h)?$(y,h):a.TInteger(h)?ne(y,h):a.TBoolean(h)?b(y,h):c.False}function be(y,h){return c.False}function ur(y,h){return c.True}function Sr(y){let[h,xe]=[y,0];for(;a.TNot(h);)h=h.not,xe+=1;return xe%2===0?h:e.Type.Unknown()}function A(y,h){return a.TNot(y)?ke(Sr(y),h):a.TNot(h)?ke(y,Sr(h)):E("Invalid fallthrough for Not")}function ce(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):a.TNull(h)?c.True:c.False}function $(y,h){return a.TLiteralNumber(y)||a.TNumber(y)||a.TInteger(y)?c.True:c.False}function ve(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):a.TInteger(h)||a.TNumber(h)?c.True:c.False}function ie(y,h){return Object.getOwnPropertyNames(y.properties).length===h}function de(y){return jr(y)}function Se(y){return ie(y,0)||ie(y,1)&&"description"in y.properties&&a.TUnion(y.properties.description)&&y.properties.description.anyOf.length===2&&(a.TString(y.properties.description.anyOf[0])&&a.TUndefined(y.properties.description.anyOf[1])||a.TString(y.properties.description.anyOf[1])&&a.TUndefined(y.properties.description.anyOf[0]))}function Le(y){return ie(y,0)}function tt(y){return ie(y,0)}function Qe(y){return ie(y,0)}function nt(y){return ie(y,0)}function lr(y){return jr(y)}function rn(y){let h=e.Type.Number();return ie(y,0)||ie(y,1)&&"length"in y.properties&&w(ke(y.properties.length,h))===c.True}function nn(y){return ie(y,0)}function jr(y){let h=e.Type.Number();return ie(y,0)||ie(y,1)&&"length"in y.properties&&w(ke(y.properties.length,h))===c.True}function Ui(y){let h=e.Type.Function([e.Type.Any()],e.Type.Any());return ie(y,0)||ie(y,1)&&"then"in y.properties&&w(ke(y.properties.then,h))===c.True}function Dn(y,h){return ke(y,h)===c.False||a.TOptional(y)&&!a.TOptional(h)?c.False:c.True}function Ge(y,h){return a.TUnknown(y)?c.False:a.TAny(y)?c.Union:a.TNever(y)||a.TLiteralString(y)&&de(h)||a.TLiteralNumber(y)&&Le(h)||a.TLiteralBoolean(y)&&tt(h)||a.TSymbol(y)&&Se(h)||a.TBigInt(y)&&Qe(h)||a.TString(y)&&de(h)||a.TSymbol(y)&&Se(h)||a.TNumber(y)&&Le(h)||a.TInteger(y)&&Le(h)||a.TBoolean(y)&&tt(h)||a.TUint8Array(y)&&lr(h)||a.TDate(y)&&nt(h)||a.TConstructor(y)&&nn(h)||a.TFunction(y)&&rn(h)?c.True:a.TRecord(y)&&a.TString($r(y))?h[e.Hint]==="Record"?c.True:c.False:a.TRecord(y)&&a.TNumber($r(y))&&ie(h,0)?c.True:c.False}function Ri(y,h){return N(h)?j(y,h):a.TRecord(h)?rt(y,h):a.TObject(h)?(()=>{for(let xe of Object.getOwnPropertyNames(h.properties)){if(!(xe in y.properties)&&!a.TOptional(h.properties[xe]))return c.False;if(a.TOptional(h.properties[xe]))return c.True;if(Dn(y.properties[xe],h.properties[xe])===c.False)return c.False}return c.True})():c.False}function ha(y,h){return N(h)?j(y,h):a.TObject(h)&&Ui(h)?c.True:a.TPromise(h)?w(ke(y.item,h.item)):c.False}function $r(y){return e.PatternNumberExact in y.patternProperties?e.Type.Number():e.PatternStringExact in y.patternProperties?e.Type.String():E("Unknown record key pattern")}function on(y){return e.PatternNumberExact in y.patternProperties?y.patternProperties[e.PatternNumberExact]:e.PatternStringExact in y.patternProperties?y.patternProperties[e.PatternStringExact]:E("Unable to get record value schema")}function rt(y,h){let[xe,Qt]=[$r(h),on(h)];return a.TLiteralString(y)&&a.TNumber(xe)&&w(ke(y,Qt))===c.True?c.True:a.TUint8Array(y)&&a.TNumber(xe)||a.TString(y)&&a.TNumber(xe)||a.TArray(y)&&a.TNumber(xe)?ke(y,Qt):a.TObject(y)?(()=>{for(let dp of Object.getOwnPropertyNames(y.properties))if(Dn(Qt,y.properties[dp])===c.False)return c.False;return c.True})():c.False}function Bi(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?ke(on(y),on(h)):c.False}function Vn(y,h){return a.TLiteral(y)&&i.IsString(y.const)||a.TString(y)?c.True:c.False}function ya(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):a.TString(h)?c.True:c.False}function ma(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):a.TSymbol(h)?c.True:c.False}function ze(y,h){return a.TTemplateLiteral(y)?ke(D.Resolve(y),h):a.TTemplateLiteral(h)?ke(y,D.Resolve(h)):E("Invalid fallthrough for TemplateLiteral")}function g(y,h){return a.TArray(h)&&y.items!==void 0&&y.items.every(xe=>ke(xe,h.items)===c.True)}function $e(y,h){return a.TNever(y)?c.True:a.TUnknown(y)?c.False:a.TAny(y)?c.Union:c.False}function yt(y,h){return N(h)?j(y,h):a.TObject(h)&&jr(h)||a.TArray(h)&&g(y,h)?c.True:a.TTuple(h)?i.IsUndefined(y.items)&&!i.IsUndefined(h.items)||!i.IsUndefined(y.items)&&i.IsUndefined(h.items)?c.False:i.IsUndefined(y.items)&&!i.IsUndefined(h.items)||y.items.every((xe,Qt)=>ke(xe,h.items[Qt])===c.True)?c.True:c.False:c.False}function op(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):a.TUint8Array(h)?c.True:c.False}function ap(y,h){return N(h)?j(y,h):a.TObject(h)?Ge(y,h):a.TRecord(h)?rt(y,h):a.TVoid(h)?lp(y,h):a.TUndefined(h)?c.True:c.False}function ga(y,h){return h.anyOf.some(xe=>ke(y,xe)===c.True)?c.True:c.False}function sp(y,h){return y.anyOf.every(xe=>ke(xe,h)===c.True)?c.True:c.False}function Tu(y,h){return c.True}function up(y,h){return a.TNever(h)?be(y,h):a.TIntersect(h)?_e(y,h):a.TUnion(h)?ga(y,h):a.TAny(h)?k(y,h):a.TString(h)?Vn(y,h):a.TNumber(h)?$(y,h):a.TInteger(h)?ne(y,h):a.TBoolean(h)?b(y,h):a.TArray(h)?x(y,h):a.TTuple(h)?$e(y,h):a.TObject(h)?Ge(y,h):a.TUnknown(h)?c.True:c.False}function lp(y,h){return a.TUndefined(y)||a.TUndefined(y)?c.True:c.False}function cp(y,h){return a.TIntersect(h)?_e(y,h):a.TUnion(h)?ga(y,h):a.TUnknown(h)?Tu(y,h):a.TAny(h)?k(y,h):a.TObject(h)?Ge(y,h):a.TVoid(h)?c.True:c.False}function ke(y,h){return a.TTemplateLiteral(y)||a.TTemplateLiteral(h)?ze(y,h):a.TNot(y)||a.TNot(h)?A(y,h):a.TAny(y)?m(y,h):a.TArray(y)?_(y,h):a.TBigInt(y)?O(y,h):a.TBoolean(y)?v(y,h):a.TAsyncIterator(y)?l(y,h):a.TConstructor(y)?P(y,h):a.TDate(y)?G(y,h):a.TFunction(y)?ee(y,h):a.TInteger(y)?me(y,h):a.TIntersect(y)?Ne(y,h):a.TIterator(y)?Ce(y,h):a.TLiteral(y)?Ir(y,h):a.TNever(y)?ur(y,h):a.TNull(y)?ce(y,h):a.TNumber(y)?ve(y,h):a.TObject(y)?Ri(y,h):a.TRecord(y)?Bi(y,h):a.TString(y)?ya(y,h):a.TSymbol(y)?ma(y,h):a.TTuple(y)?yt(y,h):a.TPromise(y)?ha(y,h):a.TUint8Array(y)?op(y,h):a.TUndefined(y)?ap(y,h):a.TUnion(y)?sp(y,h):a.TUnknown(y)?up(y,h):a.TVoid(y)?cp(y,h):E(`Unknown left type operand '${y[e.Kind]}'`)}function fp(y,h){return ke(y,h)}d.Extends=fp})(f||(e.TypeExtends=f={}));var p;(function(d){function w(_){return _.map(l=>k(l))}function E(_){return new Date(_.getTime())}function N(_){return new Uint8Array(_)}function j(_){let l=Object.getOwnPropertyNames(_).reduce((b,v)=>({...b,[v]:k(_[v])}),{}),O=Object.getOwnPropertySymbols(_).reduce((b,v)=>({...b,[v]:k(_[v])}),{});return{...l,...O}}function k(_){return i.IsArray(_)?w(_):i.IsDate(_)?E(_):i.IsUint8Array(_)?N(_):i.IsObject(_)?j(_):_}function m(_){return _.map(l=>x(l))}d.Rest=m;function x(_,l={}){return{...k(_),...l}}d.Type=x})(p||(e.TypeClone=p={}));var S;(function(d){function w(P){return P.map(G=>{let{[e.Optional]:ee,...ne}=p.Type(G);return ne})}function E(P){return P.every(G=>a.TOptional(G))}function N(P){return P.some(G=>a.TOptional(G))}function j(P){return E(P.allOf)?e.Type.Optional(e.Type.Intersect(w(P.allOf))):P}function k(P){return N(P.anyOf)?e.Type.Optional(e.Type.Union(w(P.anyOf))):P}function m(P){return P[e.Kind]==="Intersect"?j(P):P[e.Kind]==="Union"?k(P):P}function x(P,G){let ee=P.allOf.reduce((ne,me)=>{let _e=b(me,G);return _e[e.Kind]==="Never"?ne:[...ne,_e]},[]);return m(e.Type.Intersect(ee))}function _(P,G){let ee=P.anyOf.map(ne=>b(ne,G));return m(e.Type.Union(ee))}function l(P,G){let ee=P.properties[G];return i.IsUndefined(ee)?e.Type.Never():e.Type.Union([ee])}function O(P,G){let ee=P.items;if(i.IsUndefined(ee))return e.Type.Never();let ne=ee[G];return i.IsUndefined(ne)?e.Type.Never():ne}function b(P,G){return P[e.Kind]==="Intersect"?x(P,G):P[e.Kind]==="Union"?_(P,G):P[e.Kind]==="Object"?l(P,G):P[e.Kind]==="Tuple"?O(P,G):e.Type.Never()}function v(P,G,ee={}){let ne=G.map(me=>b(P,me.toString()));return m(e.Type.Union(ne,ee))}d.Resolve=v})(S||(e.IndexedAccessor=S={}));var T;(function(d){function w(O){let[b,v]=[O.slice(0,1),O.slice(1)];return`${b.toLowerCase()}${v}`}function E(O){let[b,v]=[O.slice(0,1),O.slice(1)];return`${b.toUpperCase()}${v}`}function N(O){return O.toUpperCase()}function j(O){return O.toLowerCase()}function k(O,b){let v=K.ParseExact(O.pattern);if(!U.Check(v))return{...O,pattern:m(O.pattern,b)};let P=[...L.Generate(v)].map(ne=>e.Type.Literal(ne)),G=x(P,b),ee=e.Type.Union(G);return e.Type.TemplateLiteral([ee])}function m(O,b){return typeof O=="string"?b==="Uncapitalize"?w(O):b==="Capitalize"?E(O):b==="Uppercase"?N(O):b==="Lowercase"?j(O):O:O.toString()}function x(O,b){if(O.length===0)return[];let[v,...P]=O;return[l(v,b),...x(P,b)]}function _(O,b){return a.TTemplateLiteral(O)?k(O,b):a.TUnion(O)?e.Type.Union(x(O.anyOf,b)):a.TLiteral(O)?e.Type.Literal(m(O.const,b)):O}function l(O,b){return _(O,b)}d.Map=l})(T||(e.Intrinsic=T={}));var I;(function(d){function w(m,x){return e.Type.Intersect(m.allOf.map(_=>j(_,x)),{...m})}function E(m,x){return e.Type.Union(m.anyOf.map(_=>j(_,x)),{...m})}function N(m,x){return x(m)}function j(m,x){return m[e.Kind]==="Intersect"?w(m,x):m[e.Kind]==="Union"?E(m,x):m[e.Kind]==="Object"?N(m,x):m}function k(m,x,_){return{...j(p.Type(m),x),..._}}d.Map=k})(I||(e.ObjectMap=I={}));var z;(function(d){function w(l){return l[0]==="^"&&l[l.length-1]==="$"?l.slice(1,l.length-1):l}function E(l,O){return l.allOf.reduce((b,v)=>[...b,...m(v,O)],[])}function N(l,O){let b=l.anyOf.map(v=>m(v,O));return[...b.reduce((v,P)=>P.map(G=>b.every(ee=>ee.includes(G))?v.add(G):v)[0],new Set)]}function j(l,O){return Object.getOwnPropertyNames(l.properties)}function k(l,O){return O.includePatterns?Object.getOwnPropertyNames(l.patternProperties):[]}function m(l,O){return a.TIntersect(l)?E(l,O):a.TUnion(l)?N(l,O):a.TObject(l)?j(l,O):a.TRecord(l)?k(l,O):[]}function x(l,O){return[...new Set(m(l,O))]}d.ResolveKeys=x;function _(l){return`^(${x(l,{includePatterns:!0}).map(O=>`(${w(O)})`).join("|")})$`}d.ResolvePattern=_})(z||(e.KeyResolver=z={}));var Y=class extends r{};e.KeyArrayResolverError=Y;var V;(function(d){function w(E){return Array.isArray(E)?E:a.TUnionLiteral(E)?E.anyOf.map(N=>N.const.toString()):a.TLiteral(E)?[E.const]:a.TTemplateLiteral(E)?(()=>{let N=K.ParseExact(E.pattern);if(!U.Check(N))throw new Y("Cannot resolve keys from infinite template expression");return[...L.Generate(N)]})():[]}d.Resolve=w})(V||(e.KeyArrayResolver=V={}));var M;(function(d){function*w(N){for(let j of N.anyOf)j[e.Kind]==="Union"?yield*w(j):yield j}function E(N){return e.Type.Union([...w(N)],{...N})}d.Resolve=E})(M||(e.UnionResolver=M={}));var F=class extends r{};e.TemplateLiteralPatternError=F;var W;(function(d){function w(k){throw new F(k)}function E(k){return k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function N(k,m){return a.TTemplateLiteral(k)?k.pattern.slice(1,k.pattern.length-1):a.TUnion(k)?`(${k.anyOf.map(x=>N(x,m)).join("|")})`:a.TNumber(k)?`${m}${e.PatternNumber}`:a.TInteger(k)?`${m}${e.PatternNumber}`:a.TBigInt(k)?`${m}${e.PatternNumber}`:a.TString(k)?`${m}${e.PatternString}`:a.TLiteral(k)?`${m}${E(k.const.toString())}`:a.TBoolean(k)?`${m}${e.PatternBoolean}`:w(`Unexpected Kind '${k[e.Kind]}'`)}function j(k){return`^${k.map(m=>N(m,"")).join("")}$`}d.Create=j})(W||(e.TemplateLiteralPattern=W={}));var D;(function(d){function w(E){let N=K.ParseExact(E.pattern);if(!U.Check(N))return e.Type.String();let j=[...L.Generate(N)].map(k=>e.Type.Literal(k));return e.Type.Union(j)}d.Resolve=w})(D||(e.TemplateLiteralResolver=D={}));var re=class extends r{};e.TemplateLiteralParserError=re;var K;(function(d){function w(P,G,ee){return P[G]===ee&&P.charCodeAt(G-1)!==92}function E(P,G){return w(P,G,"(")}function N(P,G){return w(P,G,")")}function j(P,G){return w(P,G,"|")}function k(P){if(!(E(P,0)&&N(P,P.length-1)))return!1;let G=0;for(let ee=0;ee<P.length;ee++)if(E(P,ee)&&(G+=1),N(P,ee)&&(G-=1),G===0&&ee!==P.length-1)return!1;return!0}function m(P){return P.slice(1,P.length-1)}function x(P){let G=0;for(let ee=0;ee<P.length;ee++)if(E(P,ee)&&(G+=1),N(P,ee)&&(G-=1),j(P,ee)&&G===0)return!0;return!1}function _(P){for(let G=0;G<P.length;G++)if(E(P,G))return!0;return!1}function l(P){let[G,ee]=[0,0],ne=[];for(let _e=0;_e<P.length;_e++)if(E(P,_e)&&(G+=1),N(P,_e)&&(G-=1),j(P,_e)&&G===0){let Ne=P.slice(ee,_e);Ne.length>0&&ne.push(b(Ne)),ee=_e+1}let me=P.slice(ee);return me.length>0&&ne.push(b(me)),ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"or",expr:ne}}function O(P){function G(me,_e){if(!E(me,_e))throw new re("TemplateLiteralParser: Index must point to open parens");let Ne=0;for(let Ce=_e;Ce<me.length;Ce++)if(E(me,Ce)&&(Ne+=1),N(me,Ce)&&(Ne-=1),Ne===0)return[_e,Ce];throw new re("TemplateLiteralParser: Unclosed group parens in expression")}function ee(me,_e){for(let Ne=_e;Ne<me.length;Ne++)if(E(me,Ne))return[_e,Ne];return[_e,me.length]}let ne=[];for(let me=0;me<P.length;me++)if(E(P,me)){let[_e,Ne]=G(P,me),Ce=P.slice(_e,Ne+1);ne.push(b(Ce)),me=Ne}else{let[_e,Ne]=ee(P,me),Ce=P.slice(_e,Ne);Ce.length>0&&ne.push(b(Ce)),me=Ne-1}return ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"and",expr:ne}}function b(P){return k(P)?b(m(P)):x(P)?l(P):_(P)?O(P):{type:"const",const:P}}d.Parse=b;function v(P){return b(P.slice(1,P.length-1))}d.ParseExact=v})(K||(e.TemplateLiteralParser=K={}));var fe=class extends r{};e.TemplateLiteralFiniteError=fe;var U;(function(d){function w(m){throw new fe(m)}function E(m){return m.type==="or"&&m.expr.length===2&&m.expr[0].type==="const"&&m.expr[0].const==="0"&&m.expr[1].type==="const"&&m.expr[1].const==="[1-9][0-9]*"}function N(m){return m.type==="or"&&m.expr.length===2&&m.expr[0].type==="const"&&m.expr[0].const==="true"&&m.expr[1].type==="const"&&m.expr[1].const==="false"}function j(m){return m.type==="const"&&m.const===".*"}function k(m){return N(m)?!0:E(m)||j(m)?!1:m.type==="and"?m.expr.every(x=>k(x)):m.type==="or"?m.expr.every(x=>k(x)):m.type==="const"?!0:w("Unknown expression type")}d.Check=k})(U||(e.TemplateLiteralFinite=U={}));var B=class extends r{};e.TemplateLiteralGeneratorError=B;var L;(function(d){function*w(m){if(m.length===1)return yield*m[0];for(let x of m[0])for(let _ of w(m.slice(1)))yield`${x}${_}`}function*E(m){return yield*w(m.expr.map(x=>[...k(x)]))}function*N(m){for(let x of m.expr)yield*k(x)}function*j(m){return yield m.const}function*k(m){return m.type==="and"?yield*E(m):m.type==="or"?yield*N(m):m.type==="const"?yield*j(m):(()=>{throw new B("Unknown expression")})()}d.Generate=k})(L||(e.TemplateLiteralGenerator=L={}));var Q;(function(d){function*w(k){let m=k.trim().replace(/"|'/g,"");return m==="boolean"?yield e.Type.Boolean():m==="number"?yield e.Type.Number():m==="bigint"?yield e.Type.BigInt():m==="string"?yield e.Type.String():yield(()=>{let x=m.split("|").map(_=>e.Type.Literal(_.trim()));return x.length===0?e.Type.Never():x.length===1?x[0]:e.Type.Union(x)})()}function*E(k){if(k[1]!=="{"){let m=e.Type.Literal("$"),x=N(k.slice(1));return yield*[m,...x]}for(let m=2;m<k.length;m++)if(k[m]==="}"){let x=w(k.slice(2,m)),_=N(k.slice(m+1));return yield*[...x,..._]}yield e.Type.Literal(k)}function*N(k){for(let m=0;m<k.length;m++)if(k[m]==="$"){let x=e.Type.Literal(k.slice(0,m)),_=E(k.slice(m));return yield*[x,..._]}yield e.Type.Literal(k)}function j(k){return[...N(k)]}d.Parse=j})(Q||(e.TemplateLiteralDslParser=Q={}));var oe=class{constructor(d){this.schema=d}Decode(d){return new Z(this.schema,d)}};e.TransformDecodeBuilder=oe;var Z=class{constructor(d,w){this.schema=d,this.decode=w}Encode(d){let w=p.Type(this.schema);return a.TTransform(w)?(()=>{let E={Encode:N=>w[e.Transform].Encode(d(N)),Decode:N=>this.decode(w[e.Transform].Decode(N))};return{...w,[e.Transform]:E}})():(()=>{let E={Decode:this.decode,Encode:d};return{...w,[e.Transform]:E}})()}};e.TransformEncodeBuilder=Z;var ue=0,C=class extends r{};e.TypeBuilderError=C;var q=class{Create(d){return d}Throw(d){throw new C(d)}Discard(d,w){return w.reduce((E,N)=>{let{[N]:j,...k}=E;return k},d)}Strict(d){return JSON.parse(JSON.stringify(d))}};e.TypeBuilder=q;var X=class extends q{ReadonlyOptional(d){return this.Readonly(this.Optional(d))}Readonly(d){return{...p.Type(d),[e.Readonly]:"Readonly"}}Optional(d){return{...p.Type(d),[e.Optional]:"Optional"}}Any(d={}){return this.Create({...d,[e.Kind]:"Any"})}Array(d,w={}){return this.Create({...w,[e.Kind]:"Array",type:"array",items:p.Type(d)})}Boolean(d={}){return this.Create({...d,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(d,w={}){return{...T.Map(p.Type(d),"Capitalize"),...w}}Composite(d,w){let E=e.Type.Intersect(d,{}),N=z.ResolveKeys(E,{includePatterns:!1}).reduce((j,k)=>({...j,[k]:e.Type.Index(E,[k])}),{});return e.Type.Object(N,w)}Enum(d,w={}){if(i.IsUndefined(d))return this.Throw("Enum undefined or empty");let E=Object.getOwnPropertyNames(d).filter(j=>isNaN(j)).map(j=>d[j]),N=[...new Set(E)].map(j=>e.Type.Literal(j));return this.Union(N,{...w,[e.Hint]:"Enum"})}Extends(d,w,E,N,j={}){switch(f.Extends(d,w)){case c.Union:return this.Union([p.Type(E,j),p.Type(N,j)]);case c.True:return p.Type(E,j);case c.False:return p.Type(N,j)}}Exclude(d,w,E={}){return a.TTemplateLiteral(d)?this.Exclude(D.Resolve(d),w,E):a.TTemplateLiteral(w)?this.Exclude(d,D.Resolve(w),E):a.TUnion(d)?(()=>{let N=d.anyOf.filter(j=>f.Extends(j,w)===c.False);return N.length===1?p.Type(N[0],E):this.Union(N,E)})():f.Extends(d,w)!==c.False?this.Never(E):p.Type(d,E)}Extract(d,w,E={}){return a.TTemplateLiteral(d)?this.Extract(D.Resolve(d),w,E):a.TTemplateLiteral(w)?this.Extract(d,D.Resolve(w),E):a.TUnion(d)?(()=>{let N=d.anyOf.filter(j=>f.Extends(j,w)!==c.False);return N.length===1?p.Type(N[0],E):this.Union(N,E)})():f.Extends(d,w)!==c.False?p.Type(d,E):this.Never(E)}Index(d,w,E={}){return a.TArray(d)&&a.TNumber(w)?p.Type(d.items,E):a.TTuple(d)&&a.TNumber(w)?(()=>{let N=(i.IsUndefined(d.items)?[]:d.items).map(j=>p.Type(j));return this.Union(N,E)})():(()=>{let N=V.Resolve(w),j=p.Type(d);return S.Resolve(j,N,E)})()}Integer(d={}){return this.Create({...d,[e.Kind]:"Integer",type:"integer"})}Intersect(d,w={}){if(d.length===0)return e.Type.Never();if(d.length===1)return p.Type(d[0],w);d.some(k=>a.TTransform(k))&&this.Throw("Cannot intersect transform types");let E=d.every(k=>a.TObject(k)),N=p.Rest(d),j=a.TSchema(w.unevaluatedProperties)?{unevaluatedProperties:p.Type(w.unevaluatedProperties)}:{};return w.unevaluatedProperties===!1||a.TSchema(w.unevaluatedProperties)||E?this.Create({...w,...j,[e.Kind]:"Intersect",type:"object",allOf:N}):this.Create({...w,...j,[e.Kind]:"Intersect",allOf:N})}KeyOf(d,w={}){return a.TRecord(d)?(()=>{let E=Object.getOwnPropertyNames(d.patternProperties)[0];return E===e.PatternNumberExact?this.Number(w):E===e.PatternStringExact?this.String(w):this.Throw("Unable to resolve key type from Record key pattern")})():a.TTuple(d)?(()=>{let E=(i.IsUndefined(d.items)?[]:d.items).map((N,j)=>e.Type.Literal(j.toString()));return this.Union(E,w)})():a.TArray(d)?this.Number(w):(()=>{let E=z.ResolveKeys(d,{includePatterns:!1});if(E.length===0)return this.Never(w);let N=E.map(j=>this.Literal(j));return this.Union(N,w)})()}Literal(d,w={}){return this.Create({...w,[e.Kind]:"Literal",const:d,type:typeof d})}Lowercase(d,w={}){return{...T.Map(p.Type(d),"Lowercase"),...w}}Never(d={}){return this.Create({...d,[e.Kind]:"Never",not:{}})}Not(d,w){return this.Create({...w,[e.Kind]:"Not",not:p.Type(d)})}Null(d={}){return this.Create({...d,[e.Kind]:"Null",type:"null"})}Number(d={}){return this.Create({...d,[e.Kind]:"Number",type:"number"})}Object(d,w={}){let E=Object.getOwnPropertyNames(d),N=E.filter(x=>a.TOptional(d[x])),j=E.filter(x=>!N.includes(x)),k=a.TSchema(w.additionalProperties)?{additionalProperties:p.Type(w.additionalProperties)}:{},m=E.reduce((x,_)=>({...x,[_]:p.Type(d[_])}),{});return j.length>0?this.Create({...w,...k,[e.Kind]:"Object",type:"object",properties:m,required:j}):this.Create({...w,...k,[e.Kind]:"Object",type:"object",properties:m})}Omit(d,w,E={}){let N=V.Resolve(w);return I.Map(this.Discard(p.Type(d),["$id",e.Transform]),j=>{i.IsArray(j.required)&&(j.required=j.required.filter(k=>!N.includes(k)),j.required.length===0&&delete j.required);for(let k of Object.getOwnPropertyNames(j.properties))N.includes(k)&&delete j.properties[k];return this.Create(j)},E)}Partial(d,w={}){return I.Map(this.Discard(p.Type(d),["$id",e.Transform]),E=>{let N=Object.getOwnPropertyNames(E.properties).reduce((j,k)=>({...j,[k]:this.Optional(E.properties[k])}),{});return this.Object(N,this.Discard(E,["required"]))},w)}Pick(d,w,E={}){let N=V.Resolve(w);return I.Map(this.Discard(p.Type(d),["$id",e.Transform]),j=>{i.IsArray(j.required)&&(j.required=j.required.filter(k=>N.includes(k)),j.required.length===0&&delete j.required);for(let k of Object.getOwnPropertyNames(j.properties))N.includes(k)||delete j.properties[k];return this.Create(j)},E)}Record(d,w,E={}){return a.TTemplateLiteral(d)?(()=>{let N=K.ParseExact(d.pattern);return U.Check(N)?this.Object([...L.Generate(N)].reduce((j,k)=>({...j,[k]:p.Type(w)}),{}),E):this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[d.pattern]:p.Type(w)}})})():a.TUnion(d)?(()=>{let N=M.Resolve(d);if(a.TUnionLiteral(N)){let j=N.anyOf.reduce((k,m)=>({...k,[m.const]:p.Type(w)}),{});return this.Object(j,{...E,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():a.TLiteral(d)?i.IsString(d.const)||i.IsNumber(d.const)?this.Object({[d.const]:p.Type(w)},E):this.Throw("Record key of type literal is not of type string or number"):a.TInteger(d)||a.TNumber(d)?this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:p.Type(w)}}):a.TString(d)?(()=>{let N=i.IsUndefined(d.pattern)?e.PatternStringExact:d.pattern;return this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[N]:p.Type(w)}})})():this.Never()}Recursive(d,w={}){i.IsUndefined(w.$id)&&(w.$id=`T${ue++}`);let E=d({[e.Kind]:"This",$ref:`${w.$id}`});return E.$id=w.$id,this.Create({...w,[e.Hint]:"Recursive",...E})}Ref(d,w={}){return i.IsString(d)?this.Create({...w,[e.Kind]:"Ref",$ref:d}):(i.IsUndefined(d.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({...w,[e.Kind]:"Ref",$ref:d.$id}))}Required(d,w={}){return I.Map(this.Discard(p.Type(d),["$id",e.Transform]),E=>{let N=Object.getOwnPropertyNames(E.properties).reduce((j,k)=>({...j,[k]:this.Discard(E.properties[k],[e.Optional])}),{});return this.Object(N,E)},w)}Rest(d){return a.TTuple(d)&&!i.IsUndefined(d.items)?p.Rest(d.items):a.TIntersect(d)?p.Rest(d.allOf):a.TUnion(d)?p.Rest(d.anyOf):[]}String(d={}){return this.Create({...d,[e.Kind]:"String",type:"string"})}TemplateLiteral(d,w={}){let E=i.IsString(d)?W.Create(Q.Parse(d)):W.Create(d);return this.Create({...w,[e.Kind]:"TemplateLiteral",type:"string",pattern:E})}Transform(d){return new oe(d)}Tuple(d,w={}){let[E,N,j]=[!1,d.length,d.length],k=p.Rest(d),m=d.length>0?{...w,[e.Kind]:"Tuple",type:"array",items:k,additionalItems:E,minItems:N,maxItems:j}:{...w,[e.Kind]:"Tuple",type:"array",minItems:N,maxItems:j};return this.Create(m)}Uncapitalize(d,w={}){return{...T.Map(p.Type(d),"Uncapitalize"),...w}}Union(d,w={}){return a.TTemplateLiteral(d)?D.Resolve(d):(()=>{let E=d;if(E.length===0)return this.Never(w);if(E.length===1)return this.Create(p.Type(E[0],w));let N=p.Rest(E);return this.Create({...w,[e.Kind]:"Union",anyOf:N})})()}Unknown(d={}){return this.Create({...d,[e.Kind]:"Unknown"})}Unsafe(d={}){return this.Create({...d,[e.Kind]:d[e.Kind]||"Unsafe"})}Uppercase(d,w={}){return{...T.Map(p.Type(d),"Uppercase"),...w}}};e.JsonTypeBuilder=X;var he=class extends X{AsyncIterator(d,w={}){return this.Create({...w,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:p.Type(d)})}Awaited(d,w={}){let E=N=>N.length>0?(()=>{let[j,...k]=N;return[this.Awaited(j),...E(k)]})():N;return a.TIntersect(d)?e.Type.Intersect(E(d.allOf)):a.TUnion(d)?e.Type.Union(E(d.anyOf)):a.TPromise(d)?this.Awaited(d.item):p.Type(d,w)}BigInt(d={}){return this.Create({...d,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(d,w={}){return this.Tuple([...d.parameters],{...w})}Constructor(d,w,E){let[N,j]=[p.Rest(d),p.Type(w)];return this.Create({...E,[e.Kind]:"Constructor",type:"Constructor",parameters:N,returns:j})}Date(d={}){return this.Create({...d,[e.Kind]:"Date",type:"Date"})}Function(d,w,E){let[N,j]=[p.Rest(d),p.Type(w)];return this.Create({...E,[e.Kind]:"Function",type:"Function",parameters:N,returns:j})}InstanceType(d,w={}){return p.Type(d.returns,w)}Iterator(d,w={}){return this.Create({...w,[e.Kind]:"Iterator",type:"Iterator",items:p.Type(d)})}Parameters(d,w={}){return this.Tuple(d.parameters,{...w})}Promise(d,w={}){return this.Create({...w,[e.Kind]:"Promise",type:"Promise",item:p.Type(d)})}RegExp(d,w={}){let E=i.IsString(d)?d:d.source;return this.Create({...w,[e.Kind]:"String",type:"string",pattern:E})}RegEx(d,w={}){return this.RegExp(d,w)}ReturnType(d,w={}){return p.Type(d.returns,w)}Symbol(d){return this.Create({...d,[e.Kind]:"Symbol",type:"symbol"})}Undefined(d={}){return this.Create({...d,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(d={}){return this.Create({...d,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(d={}){return this.Create({...d,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=he,e.JsonType=new X,e.Type=new he}}),jn=sr(Ar(),1),{String:Wg,Optional:Hg,Boolean:Jg,Object:Xg,Number:Zg}=jn.Type,Qg=Wg.bind(jn.Type),Yg=Zg.bind(jn.Type),SI=Xg.bind(jn.Type),jI=Hg.bind(jn.Type),ev=Jg.bind(jn.Type),$I=Qg(),kI=Yg(),PI=ev();function vo(e){return Array.isArray(e)?e:[e]}var tv=qe({"../../../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(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r=typeof window<"u"&&typeof window.document<"u",n=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,i=(typeof self>"u"?"undefined":t(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",o=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),a=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";e.isBrowser=r,e.isWebWorker=i,e.isNode=n,e.isJsDom=o,e.isDeno=a}}),rv=qe({"../../../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(r,n){n||(n={}),typeof n=="function"&&(n={cmp:n});var i=typeof n.cycles=="boolean"?n.cycles:!1,o=n.cmp&&function(s){return function(u){return function(c,f){var p={key:c,value:u[c]},S={key:f,value:u[f]};return s(p,S)}}}(n.cmp),a=[];return function s(u){if(u&&u.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u!==void 0){if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);var c,f;if(Array.isArray(u)){for(f="[",c=0;c<u.length;c++)c&&(f+=","),f+=s(u[c])||"null";return f+"]"}if(u===null)return"null";if(a.indexOf(u)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var p=a.push(u)-1,S=Object.keys(u).sort(o&&o(u));for(f="",c=0;c<S.length;c++){var T=S[c],I=s(u[T]);I&&(f&&(f+=","),f+=JSON.stringify(T)+":"+I)}return a.splice(p,1),"{"+f+"}"}}(r)}}}),nv=qe({"../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(e,t){"use strict";var{hasOwnProperty:r}=Object.prototype,n=V();n.configure=V,n.stringify=n,n.default=n,e.stringify=n,e.configure=V,t.exports=n;var i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function o(M){return M.length<5e3&&!i.test(M)?`"${M}"`:JSON.stringify(M)}function a(M,F){if(M.length>200||F)return M.sort(F);for(let W=1;W<M.length;W++){let D=M[W],re=W;for(;re!==0&&M[re-1]>D;)M[re]=M[re-1],re--;M[re]=D}return M}var s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function u(M){return s.call(M)!==void 0&&M.length!==0}function c(M,F,W){M.length<W&&(W=M.length);let D=F===","?"":" ",re=`"0":${D}${M[0]}`;for(let K=1;K<W;K++)re+=`${F}"${K}":${D}${M[K]}`;return re}function f(M){if(r.call(M,"circularValue")){let F=M.circularValue;if(typeof F=="string")return`"${F}"`;if(F==null)return F;if(F===Error||F===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 p(M){let F;if(r.call(M,"deterministic")&&(F=M.deterministic,typeof F!="boolean"&&typeof F!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return F===void 0?!0:F}function S(M,F){let W;if(r.call(M,F)&&(W=M[F],typeof W!="boolean"))throw new TypeError(`The "${F}" argument must be of type boolean`);return W===void 0?!0:W}function T(M,F){let W;if(r.call(M,F)){if(W=M[F],typeof W!="number")throw new TypeError(`The "${F}" argument must be of type number`);if(!Number.isInteger(W))throw new TypeError(`The "${F}" argument must be an integer`);if(W<1)throw new RangeError(`The "${F}" argument must be >= 1`)}return W===void 0?1/0:W}function I(M){return M===1?"1 item":`${M} items`}function z(M){let F=new Set;for(let W of M)(typeof W=="string"||typeof W=="number")&&F.add(String(W));return F}function Y(M){if(r.call(M,"strict")){let F=M.strict;if(typeof F!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(F)return W=>{let D=`Object can not safely be stringified. Received type ${typeof W}`;throw typeof W!="function"&&(D+=` (${W.toString()})`),new Error(D)}}}function V(M){M={...M};let F=Y(M);F&&(M.bigint===void 0&&(M.bigint=!1),"circularValue"in M||(M.circularValue=Error));let W=f(M),D=S(M,"bigint"),re=p(M),K=typeof re=="function"?re:void 0,fe=T(M,"maximumDepth"),U=T(M,"maximumBreadth");function B(ue,C,q,X,he,d){let w=C[ue];switch(typeof w=="object"&&w!==null&&typeof w.toJSON=="function"&&(w=w.toJSON(ue)),w=X.call(C,ue,w),typeof w){case"string":return o(w);case"object":{if(w===null)return"null";if(q.indexOf(w)!==-1)return W;let E="",N=",",j=d;if(Array.isArray(w)){if(w.length===0)return"[]";if(fe<q.length+1)return'"[Array]"';q.push(w),he!==""&&(d+=he,E+=`
|
|
31
|
+
${d}`,N=`,
|
|
32
|
+
${d}`);let O=Math.min(w.length,U),b=0;for(;b<O-1;b++){let P=B(String(b),w,q,X,he,d);E+=P!==void 0?P:"null",E+=N}let v=B(String(b),w,q,X,he,d);if(E+=v!==void 0?v:"null",w.length-1>U){let P=w.length-U-1;E+=`${N}"... ${I(P)} not stringified"`}return he!==""&&(E+=`
|
|
33
|
+
${j}`),q.pop(),`[${E}]`}let k=Object.keys(w),m=k.length;if(m===0)return"{}";if(fe<q.length+1)return'"[Object]"';let x="",_="";he!==""&&(d+=he,N=`,
|
|
34
|
+
${d}`,x=" ");let l=Math.min(m,U);re&&!u(w)&&(k=a(k,K)),q.push(w);for(let O=0;O<l;O++){let b=k[O],v=B(b,w,q,X,he,d);v!==void 0&&(E+=`${_}${o(b)}:${x}${v}`,_=N)}if(m>U){let O=m-U;E+=`${_}"...":${x}"${I(O)} not stringified"`,_=N}return he!==""&&_.length>1&&(E=`
|
|
35
|
+
${d}${E}
|
|
36
|
+
${j}`),q.pop(),`{${E}}`}case"number":return isFinite(w)?String(w):F?F(w):"null";case"boolean":return w===!0?"true":"false";case"undefined":return;case"bigint":if(D)return String(w);default:return F?F(w):void 0}}function L(ue,C,q,X,he,d){switch(typeof C=="object"&&C!==null&&typeof C.toJSON=="function"&&(C=C.toJSON(ue)),typeof C){case"string":return o(C);case"object":{if(C===null)return"null";if(q.indexOf(C)!==-1)return W;let w=d,E="",N=",";if(Array.isArray(C)){if(C.length===0)return"[]";if(fe<q.length+1)return'"[Array]"';q.push(C),he!==""&&(d+=he,E+=`
|
|
37
|
+
${d}`,N=`,
|
|
38
|
+
${d}`);let m=Math.min(C.length,U),x=0;for(;x<m-1;x++){let l=L(String(x),C[x],q,X,he,d);E+=l!==void 0?l:"null",E+=N}let _=L(String(x),C[x],q,X,he,d);if(E+=_!==void 0?_:"null",C.length-1>U){let l=C.length-U-1;E+=`${N}"... ${I(l)} not stringified"`}return he!==""&&(E+=`
|
|
39
|
+
${w}`),q.pop(),`[${E}]`}q.push(C);let j="";he!==""&&(d+=he,N=`,
|
|
40
|
+
${d}`,j=" ");let k="";for(let m of X){let x=L(m,C[m],q,X,he,d);x!==void 0&&(E+=`${k}${o(m)}:${j}${x}`,k=N)}return he!==""&&k.length>1&&(E=`
|
|
41
|
+
${d}${E}
|
|
42
|
+
${w}`),q.pop(),`{${E}}`}case"number":return isFinite(C)?String(C):F?F(C):"null";case"boolean":return C===!0?"true":"false";case"undefined":return;case"bigint":if(D)return String(C);default:return F?F(C):void 0}}function Q(ue,C,q,X,he){switch(typeof C){case"string":return o(C);case"object":{if(C===null)return"null";if(typeof C.toJSON=="function"){if(C=C.toJSON(ue),typeof C!="object")return Q(ue,C,q,X,he);if(C===null)return"null"}if(q.indexOf(C)!==-1)return W;let d=he;if(Array.isArray(C)){if(C.length===0)return"[]";if(fe<q.length+1)return'"[Array]"';q.push(C),he+=X;let x=`
|
|
43
|
+
${he}`,_=`,
|
|
44
|
+
${he}`,l=Math.min(C.length,U),O=0;for(;O<l-1;O++){let v=Q(String(O),C[O],q,X,he);x+=v!==void 0?v:"null",x+=_}let b=Q(String(O),C[O],q,X,he);if(x+=b!==void 0?b:"null",C.length-1>U){let v=C.length-U-1;x+=`${_}"... ${I(v)} not stringified"`}return x+=`
|
|
45
|
+
${d}`,q.pop(),`[${x}]`}let w=Object.keys(C),E=w.length;if(E===0)return"{}";if(fe<q.length+1)return'"[Object]"';he+=X;let N=`,
|
|
46
|
+
${he}`,j="",k="",m=Math.min(E,U);u(C)&&(j+=c(C,N,U),w=w.slice(C.length),m-=C.length,k=N),re&&(w=a(w,K)),q.push(C);for(let x=0;x<m;x++){let _=w[x],l=Q(_,C[_],q,X,he);l!==void 0&&(j+=`${k}${o(_)}: ${l}`,k=N)}if(E>U){let x=E-U;j+=`${k}"...": "${I(x)} not stringified"`,k=N}return k!==""&&(j=`
|
|
47
|
+
${he}${j}
|
|
48
|
+
${d}`),q.pop(),`{${j}}`}case"number":return isFinite(C)?String(C):F?F(C):"null";case"boolean":return C===!0?"true":"false";case"undefined":return;case"bigint":if(D)return String(C);default:return F?F(C):void 0}}function oe(ue,C,q){switch(typeof C){case"string":return o(C);case"object":{if(C===null)return"null";if(typeof C.toJSON=="function"){if(C=C.toJSON(ue),typeof C!="object")return oe(ue,C,q);if(C===null)return"null"}if(q.indexOf(C)!==-1)return W;let X="",he=C.length!==void 0;if(he&&Array.isArray(C)){if(C.length===0)return"[]";if(fe<q.length+1)return'"[Array]"';q.push(C);let j=Math.min(C.length,U),k=0;for(;k<j-1;k++){let x=oe(String(k),C[k],q);X+=x!==void 0?x:"null",X+=","}let m=oe(String(k),C[k],q);if(X+=m!==void 0?m:"null",C.length-1>U){let x=C.length-U-1;X+=`,"... ${I(x)} not stringified"`}return q.pop(),`[${X}]`}let d=Object.keys(C),w=d.length;if(w===0)return"{}";if(fe<q.length+1)return'"[Object]"';let E="",N=Math.min(w,U);he&&u(C)&&(X+=c(C,",",U),d=d.slice(C.length),N-=C.length,E=","),re&&(d=a(d,K)),q.push(C);for(let j=0;j<N;j++){let k=d[j],m=oe(k,C[k],q);m!==void 0&&(X+=`${E}${o(k)}:${m}`,E=",")}if(w>U){let j=w-U;X+=`${E}"...":"${I(j)} not stringified"`}return q.pop(),`{${X}}`}case"number":return isFinite(C)?String(C):F?F(C):"null";case"boolean":return C===!0?"true":"false";case"undefined":return;case"bigint":if(D)return String(C);default:return F?F(C):void 0}}function Z(ue,C,q){if(arguments.length>1){let X="";if(typeof q=="number"?X=" ".repeat(Math.min(q,10)):typeof q=="string"&&(X=q.slice(0,10)),C!=null){if(typeof C=="function")return B("",{"":ue},[],C,X,"");if(Array.isArray(C))return L("",ue,[],z(C),X,"")}if(X.length!==0)return Q("",ue,[],X,"")}return oe("",ue,[])}return Z}}}),$n=qe({"../../../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(D){return c(D)&&Symbol.asyncIterator in D}e.IsAsyncIterator=t;function r(D){return c(D)&&Symbol.iterator in D}e.IsIterator=r;function n(D){return ArrayBuffer.isView(D)}e.IsTypedArray=n;function i(D){return D instanceof Promise}e.IsPromise=i;function o(D){return D instanceof Uint8Array}e.IsUint8Array=o;function a(D){return D instanceof Date&&Number.isFinite(D.getTime())}e.IsDate=a;function s(D,re){return re in D}e.HasPropertyKey=s;function u(D){return c(D)&&M(D.constructor)&&D.constructor.name==="Object"}e.IsPlainObject=u;function c(D){return D!==null&&typeof D=="object"}e.IsObject=c;function f(D){return Array.isArray(D)&&!ArrayBuffer.isView(D)}e.IsArray=f;function p(D){return D===void 0}e.IsUndefined=p;function S(D){return D===null}e.IsNull=S;function T(D){return typeof D=="boolean"}e.IsBoolean=T;function I(D){return typeof D=="number"}e.IsNumber=I;function z(D){return I(D)&&Number.isInteger(D)}e.IsInteger=z;function Y(D){return typeof D=="bigint"}e.IsBigInt=Y;function V(D){return typeof D=="string"}e.IsString=V;function M(D){return typeof D=="function"}e.IsFunction=M;function F(D){return typeof D=="symbol"}e.IsSymbol=F;function W(D){return Y(D)||T(D)||S(D)||I(D)||V(D)||F(D)||p(D)}e.IsValueType=W}}),bf=qe({"../../../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=$n(),r=Zo(),n=Ar(),i=class extends n.TypeBoxError{constructor(f){super(`Duplicate type kind '${f}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var o=class extends n.TypeBoxError{constructor(f){super(`Duplicate string format '${f}' detected`)}};e.TypeSystemDuplicateFormat=o;var a;(function(f){function p(T,I){if(n.TypeRegistry.Has(T))throw new i(T);return n.TypeRegistry.Set(T,I),(z={})=>n.Type.Unsafe({...z,[n.Kind]:T})}f.Type=p;function S(T,I){if(n.FormatRegistry.Has(T))throw new o(T);return n.FormatRegistry.Set(T,I),T}f.Format=S})(a||(e.TypeSystem=a={}));var s;(function(f){let p=c;function S(){p=c}f.Reset=S;function T(z){p=z}f.Set=T;function I(){return p}f.Get=I})(s||(e.TypeSystemErrorFunction=s={}));var u;(function(f){f.ExactOptionalPropertyTypes=!1,f.AllowArrayObject=!1,f.AllowNaN=!1,f.AllowNullVoid=!1;function p(Y,V){return f.ExactOptionalPropertyTypes?V in Y:Y[V]!==void 0}f.IsExactOptionalProperty=p;function S(Y){let V=(0,t.IsObject)(Y);return f.AllowArrayObject?V:V&&!(0,t.IsArray)(Y)}f.IsObjectLike=S;function T(Y){return S(Y)&&!(Y instanceof Date)&&!(Y instanceof Uint8Array)}f.IsRecordLike=T;function I(Y){let V=(0,t.IsNumber)(Y);return f.AllowNaN?V:V&&Number.isFinite(Y)}f.IsNumberLike=I;function z(Y){let V=(0,t.IsUndefined)(Y);return f.AllowNullVoid?V||Y===null:V}f.IsVoidLike=z})(u||(e.TypeSystemPolicy=u={}));function c(f,p){switch(p){case r.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case r.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${f.maxContains} matching values`;case r.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${f.minContains} matching values`;case r.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${f.maxItems}`;case r.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${f.minItems}`;case r.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case r.ValueErrorType.Array:return"Expected array";case r.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case r.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${f.exclusiveMaximum}`;case r.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${f.exclusiveMinimum}`;case r.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${f.maximum}`;case r.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${f.minimum}`;case r.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${f.multipleOf}`;case r.ValueErrorType.BigInt:return"Expected bigint";case r.ValueErrorType.Boolean:return"Expected boolean";case r.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${f.exclusiveMinimumTimestamp}`;case r.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${f.exclusiveMaximumTimestamp}`;case r.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${f.minimumTimestamp}`;case r.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${f.maximumTimestamp}`;case r.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${f.multipleOfTimestamp}`;case r.ValueErrorType.Date:return"Expected Date";case r.ValueErrorType.Function:return"Expected function";case r.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${f.exclusiveMaximum}`;case r.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${f.exclusiveMinimum}`;case r.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${f.maximum}`;case r.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${f.minimum}`;case r.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${f.multipleOf}`;case r.ValueErrorType.Integer:return"Expected integer";case r.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case r.ValueErrorType.Intersect:return"Expected all values to match";case r.ValueErrorType.Iterator:return"Expected Iterator";case r.ValueErrorType.Literal:return`Expected ${typeof f.const=="string"?`'${f.const}'`:f.const}`;case r.ValueErrorType.Never:return"Never";case r.ValueErrorType.Not:return"Value should not match";case r.ValueErrorType.Null:return"Expected null";case r.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${f.exclusiveMaximum}`;case r.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${f.exclusiveMinimum}`;case r.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${f.maximum}`;case r.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${f.minimum}`;case r.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${f.multipleOf}`;case r.ValueErrorType.Number:return"Expected number";case r.ValueErrorType.Object:return"Expected object";case r.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case r.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${f.maxProperties} properties`;case r.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${f.minProperties} properties`;case r.ValueErrorType.ObjectRequiredProperty:return"Required property";case r.ValueErrorType.Promise:return"Expected Promise";case r.ValueErrorType.StringFormatUnknown:return`Unknown format '${f.format}'`;case r.ValueErrorType.StringFormat:return`Expected string to match '${f.format}' format`;case r.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${f.maxLength}`;case r.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${f.minLength}`;case r.ValueErrorType.StringPattern:return`Expected string to match '${f.pattern}'`;case r.ValueErrorType.String:return"Expected string";case r.ValueErrorType.Symbol:return"Expected symbol";case r.ValueErrorType.TupleLength:return`Expected tuple to have ${f.maxItems||0} elements`;case r.ValueErrorType.Tuple:return"Expected tuple";case r.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${f.maxByteLength}`;case r.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${f.minByteLength}`;case r.ValueErrorType.Uint8Array:return"Expected Uint8Array";case r.ValueErrorType.Undefined:return"Expected undefined";case r.ValueErrorType.Union:return"Expected union value";case r.ValueErrorType.Void:return"Expected void";case r.ValueErrorType.Kind:return`Expected kind '${f[n.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=c}}),Xo=qe({"../../../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=Ar(),r=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=r;function n(i,o){let a=o.findIndex(s=>s.$id===i.$ref);if(a===-1)throw new r(i);return o[a]}e.Deref=n}}),Ms=qe({"../../../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=$n(),r=class extends Error{constructor(B){super("Unable to hash value"),this.value=B}};e.ValueHashError=r;var n;(function(B){B[B.Undefined=0]="Undefined",B[B.Null=1]="Null",B[B.Boolean=2]="Boolean",B[B.Number=3]="Number",B[B.String=4]="String",B[B.Object=5]="Object",B[B.Array=6]="Array",B[B.Date=7]="Date",B[B.Uint8Array=8]="Uint8Array",B[B.Symbol=9]="Symbol",B[B.BigInt=10]="BigInt"})(n||(e.ByteMarker=n={}));var i=BigInt("14695981039346656037"),[o,a]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],s=Array.from({length:256}).map((B,L)=>BigInt(L)),u=new Float64Array(1),c=new DataView(u.buffer),f=new Uint8Array(u.buffer);function*p(B){let L=B===0?1:Math.ceil(Math.floor(Math.log2(B)+1)/8);for(let Q=0;Q<L;Q++)yield B>>8*(L-1-Q)&255}function S(B){fe(n.Array);for(let L of B)K(L)}function T(B){fe(n.Boolean),fe(B?1:0)}function I(B){fe(n.BigInt),c.setBigInt64(0,B);for(let L of f)fe(L)}function z(B){fe(n.Date),K(B.getTime())}function Y(B){fe(n.Null)}function V(B){fe(n.Number),c.setFloat64(0,B);for(let L of f)fe(L)}function M(B){fe(n.Object);for(let L of globalThis.Object.keys(B).sort())K(L),K(B[L])}function F(B){fe(n.String);for(let L=0;L<B.length;L++)for(let Q of p(B.charCodeAt(L)))fe(Q)}function W(B){fe(n.Symbol),K(B.description)}function D(B){fe(n.Uint8Array);for(let L=0;L<B.length;L++)fe(B[L])}function re(B){return fe(n.Undefined)}function K(B){if((0,t.IsArray)(B))return S(B);if((0,t.IsBoolean)(B))return T(B);if((0,t.IsBigInt)(B))return I(B);if((0,t.IsDate)(B))return z(B);if((0,t.IsNull)(B))return Y(B);if((0,t.IsNumber)(B))return V(B);if((0,t.IsPlainObject)(B))return M(B);if((0,t.IsString)(B))return F(B);if((0,t.IsSymbol)(B))return W(B);if((0,t.IsUint8Array)(B))return D(B);if((0,t.IsUndefined)(B))return re(B);throw new r(B)}function fe(B){i=i^s[B],i=i*o%a}function U(B){return i=BigInt("14695981039346656037"),K(B),i}e.Hash=U}}),Zo=qe({"../../../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=$n(),r=bf(),n=Xo(),i=Ms(),o=Ar(),a;(function(l){l[l.ArrayContains=0]="ArrayContains",l[l.ArrayMaxContains=1]="ArrayMaxContains",l[l.ArrayMaxItems=2]="ArrayMaxItems",l[l.ArrayMinContains=3]="ArrayMinContains",l[l.ArrayMinItems=4]="ArrayMinItems",l[l.ArrayUniqueItems=5]="ArrayUniqueItems",l[l.Array=6]="Array",l[l.AsyncIterator=7]="AsyncIterator",l[l.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",l[l.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",l[l.BigIntMaximum=10]="BigIntMaximum",l[l.BigIntMinimum=11]="BigIntMinimum",l[l.BigIntMultipleOf=12]="BigIntMultipleOf",l[l.BigInt=13]="BigInt",l[l.Boolean=14]="Boolean",l[l.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",l[l.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",l[l.DateMaximumTimestamp=17]="DateMaximumTimestamp",l[l.DateMinimumTimestamp=18]="DateMinimumTimestamp",l[l.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",l[l.Date=20]="Date",l[l.Function=21]="Function",l[l.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",l[l.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",l[l.IntegerMaximum=24]="IntegerMaximum",l[l.IntegerMinimum=25]="IntegerMinimum",l[l.IntegerMultipleOf=26]="IntegerMultipleOf",l[l.Integer=27]="Integer",l[l.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",l[l.Intersect=29]="Intersect",l[l.Iterator=30]="Iterator",l[l.Kind=31]="Kind",l[l.Literal=32]="Literal",l[l.Never=33]="Never",l[l.Not=34]="Not",l[l.Null=35]="Null",l[l.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",l[l.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",l[l.NumberMaximum=38]="NumberMaximum",l[l.NumberMinimum=39]="NumberMinimum",l[l.NumberMultipleOf=40]="NumberMultipleOf",l[l.Number=41]="Number",l[l.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",l[l.ObjectMaxProperties=43]="ObjectMaxProperties",l[l.ObjectMinProperties=44]="ObjectMinProperties",l[l.ObjectRequiredProperty=45]="ObjectRequiredProperty",l[l.Object=46]="Object",l[l.Promise=47]="Promise",l[l.StringFormatUnknown=48]="StringFormatUnknown",l[l.StringFormat=49]="StringFormat",l[l.StringMaxLength=50]="StringMaxLength",l[l.StringMinLength=51]="StringMinLength",l[l.StringPattern=52]="StringPattern",l[l.String=53]="String",l[l.Symbol=54]="Symbol",l[l.TupleLength=55]="TupleLength",l[l.Tuple=56]="Tuple",l[l.Uint8ArrayMaxByteLength=57]="Uint8ArrayMaxByteLength",l[l.Uint8ArrayMinByteLength=58]="Uint8ArrayMinByteLength",l[l.Uint8Array=59]="Uint8Array",l[l.Undefined=60]="Undefined",l[l.Union=61]="Union",l[l.Void=62]="Void"})(a||(e.ValueErrorType=a={}));var s=class extends o.TypeBoxError{constructor(l){super("Unknown type"),this.schema=l}};e.ValueErrorsUnknownTypeError=s;function u(l){return l.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=u;function c(l){return l!==void 0}var f=class{constructor(l){this.iterator=l}[Symbol.iterator](){return this.iterator}First(){let l=this.iterator.next();return l.done?void 0:l.value}};e.ValueErrorIterator=f;function p(l,O,b,v){return{type:l,schema:O,path:b,value:v,message:r.TypeSystemErrorFunction.Get()(O,l)}}function*S(l,O,b,v){}function*T(l,O,b,v){if(!(0,t.IsArray)(v))return yield p(a.Array,l,b,v);c(l.minItems)&&!(v.length>=l.minItems)&&(yield p(a.ArrayMinItems,l,b,v)),c(l.maxItems)&&!(v.length<=l.maxItems)&&(yield p(a.ArrayMaxItems,l,b,v));for(let ee=0;ee<v.length;ee++)yield*x(l.items,O,`${b}/${ee}`,v[ee]);if(l.uniqueItems===!0&&!function(){let ee=new Set;for(let ne of v){let me=(0,i.Hash)(ne);if(ee.has(me))return!1;ee.add(me)}return!0}()&&(yield p(a.ArrayUniqueItems,l,b,v)),!(c(l.contains)||c(l.minContains)||c(l.maxContains)))return;let P=c(l.contains)?l.contains:o.Type.Never(),G=v.reduce((ee,ne,me)=>x(P,O,`${b}${me}`,ne).next().done===!0?ee+1:ee,0);G===0&&(yield p(a.ArrayContains,l,b,v)),(0,t.IsNumber)(l.minContains)&&G<l.minContains&&(yield p(a.ArrayMinContains,l,b,v)),(0,t.IsNumber)(l.maxContains)&&G>l.maxContains&&(yield p(a.ArrayMaxContains,l,b,v))}function*I(l,O,b,v){(0,t.IsAsyncIterator)(v)||(yield p(a.AsyncIterator,l,b,v))}function*z(l,O,b,v){if(!(0,t.IsBigInt)(v))return yield p(a.BigInt,l,b,v);c(l.exclusiveMaximum)&&!(v<l.exclusiveMaximum)&&(yield p(a.BigIntExclusiveMaximum,l,b,v)),c(l.exclusiveMinimum)&&!(v>l.exclusiveMinimum)&&(yield p(a.BigIntExclusiveMinimum,l,b,v)),c(l.maximum)&&!(v<=l.maximum)&&(yield p(a.BigIntMaximum,l,b,v)),c(l.minimum)&&!(v>=l.minimum)&&(yield p(a.BigIntMinimum,l,b,v)),c(l.multipleOf)&&v%l.multipleOf!==BigInt(0)&&(yield p(a.BigIntMultipleOf,l,b,v))}function*Y(l,O,b,v){(0,t.IsBoolean)(v)||(yield p(a.Boolean,l,b,v))}function*V(l,O,b,v){yield*x(l.returns,O,b,v.prototype)}function*M(l,O,b,v){if(!(0,t.IsDate)(v))return yield p(a.Date,l,b,v);c(l.exclusiveMaximumTimestamp)&&!(v.getTime()<l.exclusiveMaximumTimestamp)&&(yield p(a.DateExclusiveMaximumTimestamp,l,b,v)),c(l.exclusiveMinimumTimestamp)&&!(v.getTime()>l.exclusiveMinimumTimestamp)&&(yield p(a.DateExclusiveMinimumTimestamp,l,b,v)),c(l.maximumTimestamp)&&!(v.getTime()<=l.maximumTimestamp)&&(yield p(a.DateMaximumTimestamp,l,b,v)),c(l.minimumTimestamp)&&!(v.getTime()>=l.minimumTimestamp)&&(yield p(a.DateMinimumTimestamp,l,b,v)),c(l.multipleOfTimestamp)&&v.getTime()%l.multipleOfTimestamp!==0&&(yield p(a.DateMultipleOfTimestamp,l,b,v))}function*F(l,O,b,v){(0,t.IsFunction)(v)||(yield p(a.Function,l,b,v))}function*W(l,O,b,v){if(!(0,t.IsInteger)(v))return yield p(a.Integer,l,b,v);c(l.exclusiveMaximum)&&!(v<l.exclusiveMaximum)&&(yield p(a.IntegerExclusiveMaximum,l,b,v)),c(l.exclusiveMinimum)&&!(v>l.exclusiveMinimum)&&(yield p(a.IntegerExclusiveMinimum,l,b,v)),c(l.maximum)&&!(v<=l.maximum)&&(yield p(a.IntegerMaximum,l,b,v)),c(l.minimum)&&!(v>=l.minimum)&&(yield p(a.IntegerMinimum,l,b,v)),c(l.multipleOf)&&v%l.multipleOf!==0&&(yield p(a.IntegerMultipleOf,l,b,v))}function*D(l,O,b,v){for(let P of l.allOf){let G=x(P,O,b,v).next();G.done||(yield p(a.Intersect,l,b,v),yield G.value)}if(l.unevaluatedProperties===!1){let P=new RegExp(o.KeyResolver.ResolvePattern(l));for(let G of Object.getOwnPropertyNames(v))P.test(G)||(yield p(a.IntersectUnevaluatedProperties,l,`${b}/${G}`,v))}if(typeof l.unevaluatedProperties=="object"){let P=new RegExp(o.KeyResolver.ResolvePattern(l));for(let G of Object.getOwnPropertyNames(v))if(!P.test(G)){let ee=x(l.unevaluatedProperties,O,`${b}/${G}`,v[G]).next();ee.done||(yield ee.value)}}}function*re(l,O,b,v){(0,t.IsIterator)(v)||(yield p(a.Iterator,l,b,v))}function*K(l,O,b,v){v!==l.const&&(yield p(a.Literal,l,b,v))}function*fe(l,O,b,v){yield p(a.Never,l,b,v)}function*U(l,O,b,v){x(l.not,O,b,v).next().done===!0&&(yield p(a.Not,l,b,v))}function*B(l,O,b,v){(0,t.IsNull)(v)||(yield p(a.Null,l,b,v))}function*L(l,O,b,v){if(!r.TypeSystemPolicy.IsNumberLike(v))return yield p(a.Number,l,b,v);c(l.exclusiveMaximum)&&!(v<l.exclusiveMaximum)&&(yield p(a.NumberExclusiveMaximum,l,b,v)),c(l.exclusiveMinimum)&&!(v>l.exclusiveMinimum)&&(yield p(a.NumberExclusiveMinimum,l,b,v)),c(l.maximum)&&!(v<=l.maximum)&&(yield p(a.NumberMaximum,l,b,v)),c(l.minimum)&&!(v>=l.minimum)&&(yield p(a.NumberMinimum,l,b,v)),c(l.multipleOf)&&v%l.multipleOf!==0&&(yield p(a.NumberMultipleOf,l,b,v))}function*Q(l,O,b,v){if(!r.TypeSystemPolicy.IsObjectLike(v))return yield p(a.Object,l,b,v);c(l.minProperties)&&!(Object.getOwnPropertyNames(v).length>=l.minProperties)&&(yield p(a.ObjectMinProperties,l,b,v)),c(l.maxProperties)&&!(Object.getOwnPropertyNames(v).length<=l.maxProperties)&&(yield p(a.ObjectMaxProperties,l,b,v));let P=Array.isArray(l.required)?l.required:[],G=Object.getOwnPropertyNames(l.properties),ee=Object.getOwnPropertyNames(v);for(let ne of P)ee.includes(ne)||(yield p(a.ObjectRequiredProperty,l.properties[ne],`${b}/${u(ne)}`,void 0));if(l.additionalProperties===!1)for(let ne of ee)G.includes(ne)||(yield p(a.ObjectAdditionalProperties,l,`${b}/${u(ne)}`,v[ne]));if(typeof l.additionalProperties=="object")for(let ne of ee)G.includes(ne)||(yield*x(l.additionalProperties,O,`${b}/${u(ne)}`,v[ne]));for(let ne of G){let me=l.properties[ne];l.required&&l.required.includes(ne)?(yield*x(me,O,`${b}/${u(ne)}`,v[ne]),o.ExtendsUndefined.Check(l)&&!(ne in v)&&(yield p(a.ObjectRequiredProperty,me,`${b}/${u(ne)}`,void 0))):r.TypeSystemPolicy.IsExactOptionalProperty(v,ne)&&(yield*x(me,O,`${b}/${u(ne)}`,v[ne]))}}function*oe(l,O,b,v){(0,t.IsPromise)(v)||(yield p(a.Promise,l,b,v))}function*Z(l,O,b,v){if(!r.TypeSystemPolicy.IsRecordLike(v))return yield p(a.Object,l,b,v);c(l.minProperties)&&!(Object.getOwnPropertyNames(v).length>=l.minProperties)&&(yield p(a.ObjectMinProperties,l,b,v)),c(l.maxProperties)&&!(Object.getOwnPropertyNames(v).length<=l.maxProperties)&&(yield p(a.ObjectMaxProperties,l,b,v));let[P,G]=Object.entries(l.patternProperties)[0],ee=new RegExp(P);for(let[ne,me]of Object.entries(v))ee.test(ne)&&(yield*x(G,O,`${b}/${u(ne)}`,me));if(typeof l.additionalProperties=="object")for(let[ne,me]of Object.entries(v))ee.test(ne)||(yield*x(l.additionalProperties,O,`${b}/${u(ne)}`,me));if(l.additionalProperties===!1){for(let[ne,me]of Object.entries(v))if(!ee.test(ne))return yield p(a.ObjectAdditionalProperties,l,`${b}/${u(ne)}`,me)}}function*ue(l,O,b,v){yield*x((0,n.Deref)(l,O),O,b,v)}function*C(l,O,b,v){if(!(0,t.IsString)(v))return yield p(a.String,l,b,v);c(l.minLength)&&!(v.length>=l.minLength)&&(yield p(a.StringMinLength,l,b,v)),c(l.maxLength)&&!(v.length<=l.maxLength)&&(yield p(a.StringMaxLength,l,b,v)),(0,t.IsString)(l.pattern)&&(new RegExp(l.pattern).test(v)||(yield p(a.StringPattern,l,b,v))),(0,t.IsString)(l.format)&&(o.FormatRegistry.Has(l.format)?o.FormatRegistry.Get(l.format)(v)||(yield p(a.StringFormat,l,b,v)):yield p(a.StringFormatUnknown,l,b,v))}function*q(l,O,b,v){(0,t.IsSymbol)(v)||(yield p(a.Symbol,l,b,v))}function*X(l,O,b,v){if(!(0,t.IsString)(v))return yield p(a.String,l,b,v);new RegExp(l.pattern).test(v)||(yield p(a.StringPattern,l,b,v))}function*he(l,O,b,v){yield*x((0,n.Deref)(l,O),O,b,v)}function*d(l,O,b,v){if(!(0,t.IsArray)(v))return yield p(a.Tuple,l,b,v);if(l.items===void 0&&v.length!==0)return yield p(a.TupleLength,l,b,v);if(v.length!==l.maxItems)return yield p(a.TupleLength,l,b,v);if(l.items)for(let P=0;P<l.items.length;P++)yield*x(l.items[P],O,`${b}/${P}`,v[P])}function*w(l,O,b,v){(0,t.IsUndefined)(v)||(yield p(a.Undefined,l,b,v))}function*E(l,O,b,v){let P=0;for(let G of l.anyOf){let ee=[...x(G,O,b,v)];if(ee.length===0)return;P+=ee.length}P>0&&(yield p(a.Union,l,b,v))}function*N(l,O,b,v){if(!(0,t.IsUint8Array)(v))return yield p(a.Uint8Array,l,b,v);c(l.maxByteLength)&&!(v.length<=l.maxByteLength)&&(yield p(a.Uint8ArrayMaxByteLength,l,b,v)),c(l.minByteLength)&&!(v.length>=l.minByteLength)&&(yield p(a.Uint8ArrayMinByteLength,l,b,v))}function*j(l,O,b,v){}function*k(l,O,b,v){r.TypeSystemPolicy.IsVoidLike(v)||(yield p(a.Void,l,b,v))}function*m(l,O,b,v){o.TypeRegistry.Get(l[o.Kind])(l,v)||(yield p(a.Kind,l,b,v))}function*x(l,O,b,v){let P=c(l.$id)?[...O,l]:O,G=l;switch(G[o.Kind]){case"Any":return yield*S(G,P,b,v);case"Array":return yield*T(G,P,b,v);case"AsyncIterator":return yield*I(G,P,b,v);case"BigInt":return yield*z(G,P,b,v);case"Boolean":return yield*Y(G,P,b,v);case"Constructor":return yield*V(G,P,b,v);case"Date":return yield*M(G,P,b,v);case"Function":return yield*F(G,P,b,v);case"Integer":return yield*W(G,P,b,v);case"Intersect":return yield*D(G,P,b,v);case"Iterator":return yield*re(G,P,b,v);case"Literal":return yield*K(G,P,b,v);case"Never":return yield*fe(G,P,b,v);case"Not":return yield*U(G,P,b,v);case"Null":return yield*B(G,P,b,v);case"Number":return yield*L(G,P,b,v);case"Object":return yield*Q(G,P,b,v);case"Promise":return yield*oe(G,P,b,v);case"Record":return yield*Z(G,P,b,v);case"Ref":return yield*ue(G,P,b,v);case"String":return yield*C(G,P,b,v);case"Symbol":return yield*q(G,P,b,v);case"TemplateLiteral":return yield*X(G,P,b,v);case"This":return yield*he(G,P,b,v);case"Tuple":return yield*d(G,P,b,v);case"Undefined":return yield*w(G,P,b,v);case"Union":return yield*E(G,P,b,v);case"Uint8Array":return yield*N(G,P,b,v);case"Unknown":return yield*j(G,P,b,v);case"Void":return yield*k(G,P,b,v);default:if(!o.TypeRegistry.Has(G[o.Kind]))throw new s(l);return yield*m(G,P,b,v)}}function _(...l){let O=l.length===3?x(l[0],l[1],"",l[2]):x(l[0],[],"",l[1]);return new f(O)}e.Errors=_}}),iv=qe({"../../../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(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}:function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]}),r=e&&e.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Zo(),e)}}),wf=qe({"../../../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,o,a,s){s===void 0&&(s=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(i,s,u)}:function(i,o,a,s){s===void 0&&(s=a),i[s]=o[a]}),r=e&&e.__exportStar||function(i,o){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorType=void 0;var n=Zo();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),r(bf(),e)}}),ov=qe({"../../../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=$n(),r=wf(),n=Xo(),i=Ms(),o=Ar(),a=class extends o.TypeBoxError{constructor(m){super("Unknown type"),this.schema=m}};e.ValueCheckUnknownTypeError=a;function s(m){return m[o.Kind]==="Any"||m[o.Kind]==="Unknown"}function u(m){return m!==void 0}function c(m,x,_){return!0}function f(m,x,_){if(!(0,t.IsArray)(_)||u(m.minItems)&&!(_.length>=m.minItems)||u(m.maxItems)&&!(_.length<=m.maxItems)||!_.every(b=>j(m.items,x,b))||m.uniqueItems===!0&&!function(){let b=new Set;for(let v of _){let P=(0,i.Hash)(v);if(b.has(P))return!1;b.add(P)}return!0}())return!1;if(!(u(m.contains)||(0,t.IsNumber)(m.minContains)||(0,t.IsNumber)(m.maxContains)))return!0;let l=u(m.contains)?m.contains:o.Type.Never(),O=_.reduce((b,v)=>j(l,x,v)?b+1:b,0);return!(O===0||(0,t.IsNumber)(m.minContains)&&O<m.minContains||(0,t.IsNumber)(m.maxContains)&&O>m.maxContains)}function p(m,x,_){return(0,t.IsAsyncIterator)(_)}function S(m,x,_){return!(!(0,t.IsBigInt)(_)||u(m.exclusiveMaximum)&&!(_<m.exclusiveMaximum)||u(m.exclusiveMinimum)&&!(_>m.exclusiveMinimum)||u(m.maximum)&&!(_<=m.maximum)||u(m.minimum)&&!(_>=m.minimum)||u(m.multipleOf)&&_%m.multipleOf!==BigInt(0))}function T(m,x,_){return(0,t.IsBoolean)(_)}function I(m,x,_){return j(m.returns,x,_.prototype)}function z(m,x,_){return!(!(0,t.IsDate)(_)||u(m.exclusiveMaximumTimestamp)&&!(_.getTime()<m.exclusiveMaximumTimestamp)||u(m.exclusiveMinimumTimestamp)&&!(_.getTime()>m.exclusiveMinimumTimestamp)||u(m.maximumTimestamp)&&!(_.getTime()<=m.maximumTimestamp)||u(m.minimumTimestamp)&&!(_.getTime()>=m.minimumTimestamp)||u(m.multipleOfTimestamp)&&_.getTime()%m.multipleOfTimestamp!==0)}function Y(m,x,_){return(0,t.IsFunction)(_)}function V(m,x,_){return!(!(0,t.IsInteger)(_)||u(m.exclusiveMaximum)&&!(_<m.exclusiveMaximum)||u(m.exclusiveMinimum)&&!(_>m.exclusiveMinimum)||u(m.maximum)&&!(_<=m.maximum)||u(m.minimum)&&!(_>=m.minimum)||u(m.multipleOf)&&_%m.multipleOf!==0)}function M(m,x,_){let l=m.allOf.every(O=>j(O,x,_));if(m.unevaluatedProperties===!1){let O=new RegExp(o.KeyResolver.ResolvePattern(m)),b=Object.getOwnPropertyNames(_).every(v=>O.test(v));return l&&b}else if(o.TypeGuard.TSchema(m.unevaluatedProperties)){let O=new RegExp(o.KeyResolver.ResolvePattern(m)),b=Object.getOwnPropertyNames(_).every(v=>O.test(v)||j(m.unevaluatedProperties,x,_[v]));return l&&b}else return l}function F(m,x,_){return(0,t.IsIterator)(_)}function W(m,x,_){return _===m.const}function D(m,x,_){return!1}function re(m,x,_){return!j(m.not,x,_)}function K(m,x,_){return(0,t.IsNull)(_)}function fe(m,x,_){return!(!r.TypeSystemPolicy.IsNumberLike(_)||u(m.exclusiveMaximum)&&!(_<m.exclusiveMaximum)||u(m.exclusiveMinimum)&&!(_>m.exclusiveMinimum)||u(m.minimum)&&!(_>=m.minimum)||u(m.maximum)&&!(_<=m.maximum)||u(m.multipleOf)&&_%m.multipleOf!==0)}function U(m,x,_){if(!r.TypeSystemPolicy.IsObjectLike(_)||u(m.minProperties)&&!(Object.getOwnPropertyNames(_).length>=m.minProperties)||u(m.maxProperties)&&!(Object.getOwnPropertyNames(_).length<=m.maxProperties))return!1;let l=Object.getOwnPropertyNames(m.properties);for(let O of l){let b=m.properties[O];if(m.required&&m.required.includes(O)){if(!j(b,x,_[O])||(o.ExtendsUndefined.Check(b)||s(b))&&!(O in _))return!1}else if(r.TypeSystemPolicy.IsExactOptionalProperty(_,O)&&!j(b,x,_[O]))return!1}if(m.additionalProperties===!1){let O=Object.getOwnPropertyNames(_);return m.required&&m.required.length===l.length&&O.length===l.length?!0:O.every(b=>l.includes(b))}else return typeof m.additionalProperties=="object"?Object.getOwnPropertyNames(_).every(O=>l.includes(O)||j(m.additionalProperties,x,_[O])):!0}function B(m,x,_){return(0,t.IsPromise)(_)}function L(m,x,_){if(!r.TypeSystemPolicy.IsRecordLike(_)||u(m.minProperties)&&!(Object.getOwnPropertyNames(_).length>=m.minProperties)||u(m.maxProperties)&&!(Object.getOwnPropertyNames(_).length<=m.maxProperties))return!1;let[l,O]=Object.entries(m.patternProperties)[0],b=new RegExp(l),v=Object.entries(_).every(([ee,ne])=>b.test(ee)?j(O,x,ne):!0),P=typeof m.additionalProperties=="object"?Object.entries(_).every(([ee,ne])=>b.test(ee)?!0:j(m.additionalProperties,x,ne)):!0,G=m.additionalProperties===!1?Object.getOwnPropertyNames(_).every(ee=>b.test(ee)):!0;return v&&P&&G}function Q(m,x,_){return j((0,n.Deref)(m,x),x,_)}function oe(m,x,_){return!(0,t.IsString)(_)||u(m.minLength)&&!(_.length>=m.minLength)||u(m.maxLength)&&!(_.length<=m.maxLength)||u(m.pattern)&&!new RegExp(m.pattern).test(_)?!1:u(m.format)?o.FormatRegistry.Has(m.format)?o.FormatRegistry.Get(m.format)(_):!1:!0}function Z(m,x,_){return(0,t.IsSymbol)(_)}function ue(m,x,_){return(0,t.IsString)(_)&&new RegExp(m.pattern).test(_)}function C(m,x,_){return j((0,n.Deref)(m,x),x,_)}function q(m,x,_){if(!(0,t.IsArray)(_)||m.items===void 0&&_.length!==0||_.length!==m.maxItems)return!1;if(!m.items)return!0;for(let l=0;l<m.items.length;l++)if(!j(m.items[l],x,_[l]))return!1;return!0}function X(m,x,_){return(0,t.IsUndefined)(_)}function he(m,x,_){return m.anyOf.some(l=>j(l,x,_))}function d(m,x,_){return!(!(0,t.IsUint8Array)(_)||u(m.maxByteLength)&&!(_.length<=m.maxByteLength)||u(m.minByteLength)&&!(_.length>=m.minByteLength))}function w(m,x,_){return!0}function E(m,x,_){return r.TypeSystemPolicy.IsVoidLike(_)}function N(m,x,_){return o.TypeRegistry.Has(m[o.Kind])?o.TypeRegistry.Get(m[o.Kind])(m,_):!1}function j(m,x,_){let l=u(m.$id)?[...x,m]:x,O=m;switch(O[o.Kind]){case"Any":return c(O,l,_);case"Array":return f(O,l,_);case"AsyncIterator":return p(O,l,_);case"BigInt":return S(O,l,_);case"Boolean":return T(O,l,_);case"Constructor":return I(O,l,_);case"Date":return z(O,l,_);case"Function":return Y(O,l,_);case"Integer":return V(O,l,_);case"Intersect":return M(O,l,_);case"Iterator":return F(O,l,_);case"Literal":return W(O,l,_);case"Never":return D(O,l,_);case"Not":return re(O,l,_);case"Null":return K(O,l,_);case"Number":return fe(O,l,_);case"Object":return U(O,l,_);case"Promise":return B(O,l,_);case"Record":return L(O,l,_);case"Ref":return Q(O,l,_);case"String":return oe(O,l,_);case"Symbol":return Z(O,l,_);case"TemplateLiteral":return ue(O,l,_);case"This":return C(O,l,_);case"Tuple":return q(O,l,_);case"Undefined":return X(O,l,_);case"Union":return he(O,l,_);case"Uint8Array":return d(O,l,_);case"Unknown":return w(O,l,_);case"Void":return E(O,l,_);default:if(!o.TypeRegistry.Has(O[o.Kind]))throw new a(O);return N(O,l,_)}}function k(...m){return m.length===3?j(m[0],m[1],m[2]):j(m[0],[],m[1])}e.Check=k}}),av=qe({"../../../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=$n(),r=Xo(),n=ov(),i=Ar(),o=class extends i.TypeBoxError{constructor(S,T,I){super("Unable to decode due to invalid value"),this.schema=S,this.value=T,this.error=I}};e.TransformDecodeCheckError=o;var a=class extends i.TypeBoxError{constructor(S,T,I){super("Unable to encode due to invalid value"),this.schema=S,this.value=T,this.error=I}};e.TransformEncodeCheckError=a;var s=class extends i.TypeBoxError{constructor(S,T,I){super(`${I instanceof Error?I.message:"Unknown error"}`),this.schema=S,this.value=T}};e.TransformDecodeError=s;var u=class extends i.TypeBoxError{constructor(S,T,I){super(`${I instanceof Error?I.message:"Unknown error"}`),this.schema=S,this.value=T}};e.TransformEncodeError=u;var c;(function(S){function T(Z,ue){return i.TypeGuard.TTransform(Z)||L(Z.items,ue)}function I(Z,ue){return i.TypeGuard.TTransform(Z)||L(Z.items,ue)}function z(Z,ue){return i.TypeGuard.TTransform(Z)||L(Z.returns,ue)||Z.parameters.some(C=>L(C,ue))}function Y(Z,ue){return i.TypeGuard.TTransform(Z)||L(Z.returns,ue)||Z.parameters.some(C=>L(C,ue))}function V(Z,ue){return i.TypeGuard.TTransform(Z)||i.TypeGuard.TTransform(Z.unevaluatedProperties)||Z.allOf.some(C=>L(C,ue))}function M(Z,ue){return i.TypeGuard.TTransform(Z)||L(Z.items,ue)}function F(Z,ue){return i.TypeGuard.TTransform(Z)||L(Z.not,ue)}function W(Z,ue){return i.TypeGuard.TTransform(Z)||Object.values(Z.properties).some(C=>L(C,ue))||i.TypeGuard.TSchema(Z.additionalProperties)&&L(Z.additionalProperties,ue)}function D(Z,ue){return i.TypeGuard.TTransform(Z)||L(Z.item,ue)}function re(Z,ue){let C=Object.getOwnPropertyNames(Z.patternProperties)[0],q=Z.patternProperties[C];return i.TypeGuard.TTransform(Z)||L(q,ue)||i.TypeGuard.TSchema(Z.additionalProperties)&&i.TypeGuard.TTransform(Z.additionalProperties)}function K(Z,ue){return i.TypeGuard.TTransform(Z)?!0:L((0,r.Deref)(Z,ue),ue)}function fe(Z,ue){return i.TypeGuard.TTransform(Z)?!0:L((0,r.Deref)(Z,ue),ue)}function U(Z,ue){return i.TypeGuard.TTransform(Z)||!(0,t.IsUndefined)(Z.items)&&Z.items.some(C=>L(C,ue))}function B(Z,ue){return i.TypeGuard.TTransform(Z)||Z.anyOf.some(C=>L(C,ue))}function L(Z,ue){let C=(0,t.IsString)(Z.$id)?[...ue,Z]:ue,q=Z;if(Z.$id&&Q.has(Z.$id))return!1;switch(Z.$id&&Q.add(Z.$id),Z[i.Kind]){case"Array":return T(q,C);case"AsyncIterator":return I(q,C);case"Constructor":return z(q,C);case"Function":return Y(q,C);case"Intersect":return V(q,C);case"Iterator":return M(q,C);case"Not":return F(q,C);case"Object":return W(q,C);case"Promise":return D(q,C);case"Record":return re(q,C);case"Ref":return K(q,C);case"This":return fe(q,C);case"Tuple":return U(q,C);case"Union":return B(q,C);default:return i.TypeGuard.TTransform(Z)}}let Q=new Set;function oe(Z,ue){return Q.clear(),L(Z,ue)}S.Has=oe})(c||(e.HasTransform=c={}));var f;(function(S){function T(U,B){try{return i.TypeGuard.TTransform(U)?U[i.Transform].Decode(B):B}catch(L){throw new s(U,B,L)}}function I(U,B,L){return(0,t.IsArray)(L)?T(U,L.map(Q=>K(U.items,B,Q))):T(U,L)}function z(U,B,L){if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return T(U,L);let Q=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),oe=Q.reduce((q,X)=>X in q?{...q,[X]:K(i.IndexedAccessor.Resolve(U,[X]),B,q[X])}:q,L);if(!i.TypeGuard.TTransform(U.unevaluatedProperties))return T(U,oe);let Z=Object.getOwnPropertyNames(oe),ue=U.unevaluatedProperties,C=Z.reduce((q,X)=>Q.includes(X)?q:{...q,[X]:T(ue,q[X])},oe);return T(U,C)}function Y(U,B,L){return T(U,K(U.not,B,L))}function V(U,B,L){if(!(0,t.IsPlainObject)(L))return T(U,L);let Q=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),oe=Q.reduce((q,X)=>X in q?{...q,[X]:K(U.properties[X],B,q[X])}:q,L);if(!i.TypeGuard.TSchema(U.additionalProperties))return T(U,oe);let Z=Object.getOwnPropertyNames(oe),ue=U.additionalProperties,C=Z.reduce((q,X)=>Q.includes(X)?q:{...q,[X]:T(ue,q[X])},oe);return T(U,C)}function M(U,B,L){if(!(0,t.IsPlainObject)(L))return T(U,L);let Q=Object.getOwnPropertyNames(U.patternProperties)[0],oe=new RegExp(Q),Z=Object.getOwnPropertyNames(L).reduce((X,he)=>oe.test(he)?{...X,[he]:K(U.patternProperties[Q],B,X[he])}:X,L);if(!i.TypeGuard.TSchema(U.additionalProperties))return T(U,Z);let ue=Object.getOwnPropertyNames(Z),C=U.additionalProperties,q=ue.reduce((X,he)=>oe.test(he)?X:{...X,[he]:T(C,X[he])},Z);return T(U,q)}function F(U,B,L){let Q=(0,r.Deref)(U,B);return T(U,K(Q,B,L))}function W(U,B,L){let Q=(0,r.Deref)(U,B);return T(U,K(Q,B,L))}function D(U,B,L){return(0,t.IsArray)(L)&&(0,t.IsArray)(U.items)?T(U,U.items.map((Q,oe)=>K(Q,B,L[oe]))):T(U,L)}function re(U,B,L){let Q=T(U,L);for(let oe of U.anyOf)if((0,n.Check)(oe,B,Q))return K(oe,B,Q);return Q}function K(U,B,L){let Q=typeof U.$id=="string"?[...B,U]:B,oe=U;switch(U[i.Kind]){case"Array":return I(oe,Q,L);case"Intersect":return z(oe,Q,L);case"Not":return Y(oe,Q,L);case"Object":return V(oe,Q,L);case"Record":return M(oe,Q,L);case"Ref":return F(oe,Q,L);case"Symbol":return T(oe,L);case"This":return W(oe,Q,L);case"Tuple":return D(oe,Q,L);case"Union":return re(oe,Q,L);default:return T(oe,L)}}function fe(U,B,L){return K(U,B,L)}S.Decode=fe})(f||(e.DecodeTransform=f={}));var p;(function(S){function T(U,B){try{return i.TypeGuard.TTransform(U)?U[i.Transform].Encode(B):B}catch(L){throw new u(U,B,L)}}function I(U,B,L){let Q=T(U,L);return(0,t.IsArray)(Q)?Q.map(oe=>K(U.items,B,oe)):Q}function z(U,B,L){let Q=T(U,L);if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return Q;let oe=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),Z=oe.reduce((q,X)=>X in Q?{...q,[X]:K(i.IndexedAccessor.Resolve(U,[X]),B,q[X])}:q,Q);if(!i.TypeGuard.TTransform(U.unevaluatedProperties))return T(U,Z);let ue=Object.getOwnPropertyNames(Z),C=U.unevaluatedProperties;return ue.reduce((q,X)=>oe.includes(X)?q:{...q,[X]:T(C,q[X])},Z)}function Y(U,B,L){return T(U.not,T(U,L))}function V(U,B,L){let Q=T(U,L);if(!(0,t.IsPlainObject)(L))return Q;let oe=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),Z=oe.reduce((q,X)=>X in q?{...q,[X]:K(U.properties[X],B,q[X])}:q,Q);if(!i.TypeGuard.TSchema(U.additionalProperties))return Z;let ue=Object.getOwnPropertyNames(Z),C=U.additionalProperties;return ue.reduce((q,X)=>oe.includes(X)?q:{...q,[X]:T(C,q[X])},Z)}function M(U,B,L){let Q=T(U,L);if(!(0,t.IsPlainObject)(L))return Q;let oe=Object.getOwnPropertyNames(U.patternProperties)[0],Z=new RegExp(oe),ue=Object.getOwnPropertyNames(L).reduce((X,he)=>Z.test(he)?{...X,[he]:K(U.patternProperties[oe],B,X[he])}:X,Q);if(!i.TypeGuard.TSchema(U.additionalProperties))return T(U,ue);let C=Object.getOwnPropertyNames(ue),q=U.additionalProperties;return C.reduce((X,he)=>Z.test(he)?X:{...X,[he]:T(q,X[he])},ue)}function F(U,B,L){let Q=(0,r.Deref)(U,B),oe=K(Q,B,L);return T(U,oe)}function W(U,B,L){let Q=(0,r.Deref)(U,B),oe=K(Q,B,L);return T(U,oe)}function D(U,B,L){let Q=T(U,L);return(0,t.IsArray)(U.items)?U.items.map((oe,Z)=>K(oe,B,Q[Z])):[]}function re(U,B,L){for(let Q of U.anyOf){if(!(0,n.Check)(Q,B,L))continue;let oe=K(Q,B,L);return T(U,oe)}for(let Q of U.anyOf){let oe=K(Q,B,L);if((0,n.Check)(U,B,oe))return T(U,oe)}return T(U,L)}function K(U,B,L){let Q=typeof U.$id=="string"?[...B,U]:B,oe=U;switch(U[i.Kind]){case"Array":return I(oe,Q,L);case"Intersect":return z(oe,Q,L);case"Not":return Y(oe,Q,L);case"Object":return V(oe,Q,L);case"Record":return M(oe,Q,L);case"Ref":return F(oe,Q,L);case"This":return W(oe,Q,L);case"Tuple":return D(oe,Q,L);case"Union":return re(oe,Q,L);default:return T(oe,L)}}function fe(U,B,L){return K(U,B,L)}S.Encode=fe})(p||(e.EncodeTransform=p={}))}}),sv=qe({"../../../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=av(),r=$n(),n=Zo(),i=wf(),o=Xo(),a=Ms(),s=Ar(),u=class{constructor(V,M,F,W){this.schema=V,this.references=M,this.checkFunc=F,this.code=W,this.hasTransform=t.HasTransform.Has(V,M)}Code(){return this.code}Errors(V){return(0,n.Errors)(this.schema,this.references,V)}Check(V){return this.checkFunc(V)}Decode(V){if(!this.checkFunc(V))throw new t.TransformDecodeCheckError(this.schema,V,this.Errors(V).First());return this.hasTransform?t.DecodeTransform.Decode(this.schema,this.references,V):V}Encode(V){let M=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,V):V;if(!this.checkFunc(M))throw new t.TransformEncodeCheckError(this.schema,V,this.Errors(V).First());return M}};e.TypeCheck=u;var c;(function(V){function M(re){return re===36}V.DollarSign=M;function F(re){return re===95}V.IsUnderscore=F;function W(re){return re>=65&&re<=90||re>=97&&re<=122}V.IsAlpha=W;function D(re){return re>=48&&re<=57}V.IsNumeric=D})(c||(c={}));var f;(function(V){function M(re){return re.length===0?!1:c.IsNumeric(re.charCodeAt(0))}function F(re){if(M(re))return!1;for(let K=0;K<re.length;K++){let fe=re.charCodeAt(K);if(!(c.IsAlpha(fe)||c.IsNumeric(fe)||c.DollarSign(fe)||c.IsUnderscore(fe)))return!1}return!0}function W(re){return re.replace(/'/g,"\\'")}function D(re,K){return F(K)?`${re}.${K}`:`${re}['${W(K)}']`}V.Encode=D})(f||(f={}));var p;(function(V){function M(F){let W=[];for(let D=0;D<F.length;D++){let re=F.charCodeAt(D);c.IsNumeric(re)||c.IsAlpha(re)?W.push(F.charAt(D)):W.push(`_${re}_`)}return W.join("").replace(/__/g,"_")}V.Encode=M})(p||(p={}));var S;(function(V){function M(F){return F.replace(/'/g,"\\'")}V.Escape=M})(S||(S={}));var T=class extends s.TypeBoxError{constructor(V){super("Unknown type"),this.schema=V}};e.TypeCompilerUnknownTypeError=T;var I=class extends s.TypeBoxError{constructor(V){super("Preflight validation check failed to guard for the given schema"),this.schema=V}};e.TypeCompilerTypeGuardError=I;var z;(function(V){function M(K,fe,U){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${fe}' in ${K} ? ${U} : true)`:`(${f.Encode(K,fe)} !== undefined ? ${U} : true)`}V.IsExactOptionalProperty=M;function F(K){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${K} === 'object' && ${K} !== null)`:`(typeof ${K} === 'object' && ${K} !== null && !Array.isArray(${K}))`}V.IsObjectLike=F;function W(K){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${K} === 'object' && ${K} !== null && !(${K} instanceof Date) && !(${K} instanceof Uint8Array))`:`(typeof ${K} === 'object' && ${K} !== null && !Array.isArray(${K}) && !(${K} instanceof Date) && !(${K} instanceof Uint8Array))`}V.IsRecordLike=W;function D(K){return i.TypeSystemPolicy.AllowNaN?`typeof ${K} === 'number'`:`(typeof ${K} === 'number' && Number.isFinite(${K}))`}V.IsNumberLike=D;function re(K){return i.TypeSystemPolicy.AllowNullVoid?`(${K} === undefined || ${K} === null)`:`${K} === undefined`}V.IsVoidLike=re})(z||(e.Policy=z={}));var Y;(function(V){function M(A){return A[s.Kind]==="Any"||A[s.Kind]==="Unknown"}function*F(A,ce,$){yield"true"}function*W(A,ce,$){yield`Array.isArray(${$})`;let[ve,ie]=[Ce("value","any"),Ce("acc","number")];(0,r.IsNumber)(A.maxItems)&&(yield`${$}.length <= ${A.maxItems}`),(0,r.IsNumber)(A.minItems)&&(yield`${$}.length >= ${A.minItems}`);let de=ne(A.items,ce,"value");if(yield`${$}.every((${ve}) => ${de})`,s.TypeGuard.TSchema(A.contains)||(0,r.IsNumber)(A.minContains)||(0,r.IsNumber)(A.maxContains)){let Se=s.TypeGuard.TSchema(A.contains)?A.contains:s.Type.Never(),Le=ne(Se,ce,"value"),tt=(0,r.IsNumber)(A.minContains)?[`(count >= ${A.minContains})`]:[],Qe=(0,r.IsNumber)(A.maxContains)?[`(count <= ${A.maxContains})`]:[],nt=`const count = value.reduce((${ie}, ${ve}) => ${Le} ? acc + 1 : acc, 0)`,lr=["(count > 0)",...tt,...Qe].join(" && ");yield`((${ve}) => { ${nt}; return ${lr}})(${$})`}A.uniqueItems===!0&&(yield`((${ve}) => { 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 } )(${$})`)}function*D(A,ce,$){yield`(typeof value === 'object' && Symbol.asyncIterator in ${$})`}function*re(A,ce,$){yield`(typeof ${$} === 'bigint')`,(0,r.IsBigInt)(A.exclusiveMaximum)&&(yield`${$} < BigInt(${A.exclusiveMaximum})`),(0,r.IsBigInt)(A.exclusiveMinimum)&&(yield`${$} > BigInt(${A.exclusiveMinimum})`),(0,r.IsBigInt)(A.maximum)&&(yield`${$} <= BigInt(${A.maximum})`),(0,r.IsBigInt)(A.minimum)&&(yield`${$} >= BigInt(${A.minimum})`),(0,r.IsBigInt)(A.multipleOf)&&(yield`(${$} % BigInt(${A.multipleOf})) === 0`)}function*K(A,ce,$){yield`(typeof ${$} === 'boolean')`}function*fe(A,ce,$){yield*G(A.returns,ce,`${$}.prototype`)}function*U(A,ce,$){yield`(${$} instanceof Date) && Number.isFinite(${$}.getTime())`,(0,r.IsNumber)(A.exclusiveMaximumTimestamp)&&(yield`${$}.getTime() < ${A.exclusiveMaximumTimestamp}`),(0,r.IsNumber)(A.exclusiveMinimumTimestamp)&&(yield`${$}.getTime() > ${A.exclusiveMinimumTimestamp}`),(0,r.IsNumber)(A.maximumTimestamp)&&(yield`${$}.getTime() <= ${A.maximumTimestamp}`),(0,r.IsNumber)(A.minimumTimestamp)&&(yield`${$}.getTime() >= ${A.minimumTimestamp}`),(0,r.IsNumber)(A.multipleOfTimestamp)&&(yield`(${$}.getTime() % ${A.multipleOfTimestamp}) === 0`)}function*B(A,ce,$){yield`(typeof ${$} === 'function')`}function*L(A,ce,$){yield`(typeof ${$} === 'number' && Number.isInteger(${$}))`,(0,r.IsNumber)(A.exclusiveMaximum)&&(yield`${$} < ${A.exclusiveMaximum}`),(0,r.IsNumber)(A.exclusiveMinimum)&&(yield`${$} > ${A.exclusiveMinimum}`),(0,r.IsNumber)(A.maximum)&&(yield`${$} <= ${A.maximum}`),(0,r.IsNumber)(A.minimum)&&(yield`${$} >= ${A.minimum}`),(0,r.IsNumber)(A.multipleOf)&&(yield`(${$} % ${A.multipleOf}) === 0`)}function*Q(A,ce,$){let ve=A.allOf.map(ie=>ne(ie,ce,$)).join(" && ");if(A.unevaluatedProperties===!1){let ie=_e(`${new RegExp(s.KeyResolver.ResolvePattern(A))};`),de=`Object.getOwnPropertyNames(${$}).every(key => ${ie}.test(key))`;yield`(${ve} && ${de})`}else if(s.TypeGuard.TSchema(A.unevaluatedProperties)){let ie=_e(`${new RegExp(s.KeyResolver.ResolvePattern(A))};`),de=`Object.getOwnPropertyNames(${$}).every(key => ${ie}.test(key) || ${ne(A.unevaluatedProperties,ce,`${$}[key]`)})`;yield`(${ve} && ${de})`}else yield`(${ve})`}function*oe(A,ce,$){yield`(typeof value === 'object' && Symbol.iterator in ${$})`}function*Z(A,ce,$){typeof A.const=="number"||typeof A.const=="boolean"?yield`(${$} === ${A.const})`:yield`(${$} === '${S.Escape(A.const)}')`}function*ue(A,ce,$){yield"false"}function*C(A,ce,$){yield`(!${ne(A.not,ce,$)})`}function*q(A,ce,$){yield`(${$} === null)`}function*X(A,ce,$){yield z.IsNumberLike($),(0,r.IsNumber)(A.exclusiveMaximum)&&(yield`${$} < ${A.exclusiveMaximum}`),(0,r.IsNumber)(A.exclusiveMinimum)&&(yield`${$} > ${A.exclusiveMinimum}`),(0,r.IsNumber)(A.maximum)&&(yield`${$} <= ${A.maximum}`),(0,r.IsNumber)(A.minimum)&&(yield`${$} >= ${A.minimum}`),(0,r.IsNumber)(A.multipleOf)&&(yield`(${$} % ${A.multipleOf}) === 0`)}function*he(A,ce,$){yield z.IsObjectLike($),(0,r.IsNumber)(A.minProperties)&&(yield`Object.getOwnPropertyNames(${$}).length >= ${A.minProperties}`),(0,r.IsNumber)(A.maxProperties)&&(yield`Object.getOwnPropertyNames(${$}).length <= ${A.maxProperties}`);let ve=Object.getOwnPropertyNames(A.properties);for(let ie of ve){let de=f.Encode($,ie),Se=A.properties[ie];if(A.required&&A.required.includes(ie))yield*G(Se,ce,de),(s.ExtendsUndefined.Check(Se)||M(Se))&&(yield`('${ie}' in ${$})`);else{let Le=ne(Se,ce,de);yield z.IsExactOptionalProperty($,ie,Le)}}if(A.additionalProperties===!1)if(A.required&&A.required.length===ve.length)yield`Object.getOwnPropertyNames(${$}).length === ${ve.length}`;else{let ie=`[${ve.map(de=>`'${de}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${$}).every(key => ${ie}.includes(key))`}if(typeof A.additionalProperties=="object"){let ie=ne(A.additionalProperties,ce,`${$}[key]`),de=`[${ve.map(Se=>`'${Se}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${$}).every(key => ${de}.includes(key) || ${ie}))`}}function*d(A,ce,$){yield`(typeof value === 'object' && typeof ${$}.then === 'function')`}function*w(A,ce,$){yield z.IsRecordLike($),(0,r.IsNumber)(A.minProperties)&&(yield`Object.getOwnPropertyNames(${$}).length >= ${A.minProperties}`),(0,r.IsNumber)(A.maxProperties)&&(yield`Object.getOwnPropertyNames(${$}).length <= ${A.maxProperties}`);let[ve,ie]=Object.entries(A.patternProperties)[0],de=_e(`${new RegExp(ve)}`),Se=ne(ie,ce,"value"),Le=s.TypeGuard.TSchema(A.additionalProperties)?ne(A.additionalProperties,ce,$):A.additionalProperties===!1?"false":"true",tt=`(${de}.test(key) ? ${Se} : ${Le})`;yield`(Object.entries(${$}).every(([key, value]) => ${tt}))`}function*E(A,ce,$){let ve=(0,o.Deref)(A,ce);if(ee.functions.has(A.$ref))return yield`${me(A.$ref)}(${$})`;yield*G(ve,ce,$)}function*N(A,ce,$){yield`(typeof ${$} === 'string')`,(0,r.IsNumber)(A.maxLength)&&(yield`${$}.length <= ${A.maxLength}`),(0,r.IsNumber)(A.minLength)&&(yield`${$}.length >= ${A.minLength}`),A.pattern!==void 0&&(yield`${_e(`${new RegExp(A.pattern)};`)}.test(${$})`),A.format!==void 0&&(yield`format('${A.format}', ${$})`)}function*j(A,ce,$){yield`(typeof ${$} === 'symbol')`}function*k(A,ce,$){yield`(typeof ${$} === 'string')`,yield`${_e(`${new RegExp(A.pattern)};`)}.test(${$})`}function*m(A,ce,$){yield`${me(A.$ref)}(${$})`}function*x(A,ce,$){if(yield`Array.isArray(${$})`,A.items===void 0)return yield`${$}.length === 0`;yield`(${$}.length === ${A.maxItems})`;for(let ve=0;ve<A.items.length;ve++)yield`${ne(A.items[ve],ce,`${$}[${ve}]`)}`}function*_(A,ce,$){yield`${$} === undefined`}function*l(A,ce,$){yield`(${A.anyOf.map(ve=>ne(ve,ce,$)).join(" || ")})`}function*O(A,ce,$){yield`${$} instanceof Uint8Array`,(0,r.IsNumber)(A.maxByteLength)&&(yield`(${$}.length <= ${A.maxByteLength})`),(0,r.IsNumber)(A.minByteLength)&&(yield`(${$}.length >= ${A.minByteLength})`)}function*b(A,ce,$){yield"true"}function*v(A,ce,$){yield z.IsVoidLike($)}function*P(A,ce,$){let ve=ee.instances.size;ee.instances.set(ve,A),yield`kind('${A[s.Kind]}', ${ve}, ${$})`}function*G(A,ce,$,ve=!0){let ie=(0,r.IsString)(A.$id)?[...ce,A]:ce,de=A;if(ve&&(0,r.IsString)(A.$id)){let Se=me(A.$id);if(ee.functions.has(Se))return yield`${Se}(${$})`;{let Le=Ne(Se,A,ce,"value",!1);return ee.functions.set(Se,Le),yield`${Se}(${$})`}}switch(de[s.Kind]){case"Any":return yield*F(de,ie,$);case"Array":return yield*W(de,ie,$);case"AsyncIterator":return yield*D(de,ie,$);case"BigInt":return yield*re(de,ie,$);case"Boolean":return yield*K(de,ie,$);case"Constructor":return yield*fe(de,ie,$);case"Date":return yield*U(de,ie,$);case"Function":return yield*B(de,ie,$);case"Integer":return yield*L(de,ie,$);case"Intersect":return yield*Q(de,ie,$);case"Iterator":return yield*oe(de,ie,$);case"Literal":return yield*Z(de,ie,$);case"Never":return yield*ue(de,ie,$);case"Not":return yield*C(de,ie,$);case"Null":return yield*q(de,ie,$);case"Number":return yield*X(de,ie,$);case"Object":return yield*he(de,ie,$);case"Promise":return yield*d(de,ie,$);case"Record":return yield*w(de,ie,$);case"Ref":return yield*E(de,ie,$);case"String":return yield*N(de,ie,$);case"Symbol":return yield*j(de,ie,$);case"TemplateLiteral":return yield*k(de,ie,$);case"This":return yield*m(de,ie,$);case"Tuple":return yield*x(de,ie,$);case"Undefined":return yield*_(de,ie,$);case"Union":return yield*l(de,ie,$);case"Uint8Array":return yield*O(de,ie,$);case"Unknown":return yield*b(de,ie,$);case"Void":return yield*v(de,ie,$);default:if(!s.TypeRegistry.Has(de[s.Kind]))throw new T(A);return yield*P(de,ie,$)}}let ee={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function ne(A,ce,$,ve=!0){return`(${[...G(A,ce,$,ve)].join(" && ")})`}function me(A){return`check_${p.Encode(A)}`}function _e(A){let ce=`local_${ee.variables.size}`;return ee.variables.set(ce,`const ${ce} = ${A}`),ce}function Ne(A,ce,$,ve,ie=!0){let[de,Se]=[`
|
|
49
|
+
`,nt=>"".padStart(nt," ")],Le=Ce("value","any"),tt=Ir("boolean"),Qe=[...G(ce,$,ve,ie)].map(nt=>`${Se(4)}${nt}`).join(` &&${de}`);return`function ${A}(${Le})${tt} {${de}${Se(2)}return (${de}${Qe}${de}${Se(2)})
|
|
50
|
+
}`}function Ce(A,ce){let $=ee.language==="typescript"?`: ${ce}`:"";return`${A}${$}`}function Ir(A){return ee.language==="typescript"?`: ${A}`:""}function be(A,ce,$){let ve=Ne("check",A,ce,"value"),ie=Ce("value","any"),de=Ir("boolean"),Se=[...ee.functions.values()],Le=[...ee.variables.values()],tt=(0,r.IsString)(A.$id)?`return function check(${ie})${de} {
|
|
51
|
+
return ${me(A.$id)}(value)
|
|
52
|
+
}`:`return ${ve}`;return[...Le,...Se,tt].join(`
|
|
53
|
+
`)}function ur(...A){let ce={language:"javascript"},[$,ve,ie]=A.length===2&&(0,r.IsArray)(A[1])?[A[0],A[1],ce]:A.length===2&&!(0,r.IsArray)(A[1])?[A[0],[],A[1]]:A.length===3?[A[0],A[1],A[2]]:A.length===1?[A[0],[],ce]:[null,[],ce];if(ee.language=ie.language,ee.variables.clear(),ee.functions.clear(),ee.instances.clear(),!s.TypeGuard.TSchema($))throw new I($);for(let de of ve)if(!s.TypeGuard.TSchema(de))throw new I(de);return be($,ve,ie)}V.Code=ur;function Sr(A,ce=[]){let $=ur(A,ce,{language:"javascript"}),ve=globalThis.Function("kind","format","hash",$),ie=new Map(ee.instances);function de(Qe,nt,lr){if(!s.TypeRegistry.Has(Qe)||!ie.has(nt))return!1;let rn=s.TypeRegistry.Get(Qe),nn=ie.get(nt);return rn(nn,lr)}function Se(Qe,nt){return s.FormatRegistry.Has(Qe)?s.FormatRegistry.Get(Qe)(nt):!1}function Le(Qe){return(0,a.Hash)(Qe)}let tt=ve(de,Se,Le);return new u(A,ce,tt,$)}V.Compile=Sr})(Y||(e.TypeCompiler=Y={}))}}),uv=qe({"../../../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,o,a,s){s===void 0&&(s=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(i,s,u)}:function(i,o,a,s){s===void 0&&(s=a),i[s]=o[a]}),r=e&&e.__exportStar||function(i,o){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorIterator=e.ValueErrorType=void 0;var n=iv();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return n.ValueErrorIterator}}),r(sv(),e)}}),bo=sr(tv(),1),lv=sr(rv(),1),_f=!1,Tf=!1;bo.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(_f=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(Tf=process?.env?.LOGGER_PERF_PREFIX==="true"));var cv={prefix:void 0,time:_f,delta:Tf,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0},Oa=[],Of=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,r,n){Object.assign(this,{sinceFirst:e,sinceLast:t,time:r,delta:n})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<5?2:1),r=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?r:null].filter(n=>n!=null).join(",")}]`}},xf=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},Jn=!1,je=class it{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=it.INFO,r={}){r=Object.assign({},cv,r),t>10&&console.debug("setup logger",{config:r});let n=this.wrapLog(console.debug,{...r,dim:r.dimDebugOnServer}),i=(...u)=>{typeof window<"u"&&window?.FORCE_DISABLE_LOGLEVEL&&n(...u)};i.isDisabled=!0,i.isEnabled=!1;let o=this.wrapLog(console.groupCollapsed,r),a=(u,c)=>{function f(...S){let T=S[S.length-1];return T===i?T():(o(...S.slice(0,-1)),(async()=>{try{let I=T();return I instanceof Promise?await I:I}finally{console.groupEnd()}})())}let p=Object.assign(c.bind({}),{isEnabled:u,isDisabled:!u,group:f,force:c});return u?p:Object.assign(i.bind({}),{isEnabled:u,isDisabled:!u,group:f,force:p})},s=a(t>=it.ERROR,this.wrapLog(console.error,r));return{ERROR:(...u)=>(s(...u),new Error(u.map(c=>typeof c=="string"?c:(0,lv.default)(c)).join(" "))),WARN:a(t>=it.WARN,this.wrapLog(console.warn,r)),LOG:a(t>=it.INFO,this.wrapLog(console.log,r)),DEBUG:a(t>=it.DEBUG,this.wrapLog(console.log,{...r,dim:r.dimDebugOnServer})),VERBOSE:a(t>=it.VERBOSE,this.wrapLog(console.debug,{...r,dim:r.dimDebugOnServer}))}}static wrapLog(t,r){if(bo.isNode)return t.bind(console);{let n=[];if(r.time||r.delta){let i=bo.isBrowser&&navigator.userAgent.includes("Chrome")?["",it.timeStr(!!r.time,!!r.delta)]:[];n.push(...i)}return r.prefix&&(Jn?n.push(new xf("dim",r.prefix)):n.push(r.prefix)),t.bind(console,...n)}}static timeStr(t,r,n=0){if(!performance.now)return;let i=performance.now();it.firstLog||(it.firstLog=i,it.lastLog=i);let o=new Of(i-it.firstLog,i-it.lastLog,t,r);return it.lastLog=i,n?o.toString():o}static getOriginFromStack(t){let r=!1;for(let n of t.split(`
|
|
54
|
+
`)){let i=n.match(/^\s+at\s+(.*)/);if(i){if(r)return i[1].trim().replace(__dirname,"");r=!0}}}};bo.isBrowser&&(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Oa&&Oa.length){for(let t of Oa)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof Of))return null;Jn||(Jn=!0);let t=je.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof xf?(Jn||(Jn=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1}));var fv=typeof global=="object"&&global&&global.Object===Object&&global,Ef=fv,dv=typeof self=="object"&&self&&self.Object===Object&&self,pv=Ef||dv||Function("return this")(),pt=pv,hv=pt.Symbol,Ht=hv,Af=Object.prototype,yv=Af.hasOwnProperty,mv=Af.toString,zn=Ht?Ht.toStringTag:void 0;function gv(e){var t=yv.call(e,zn),r=e[zn];try{e[zn]=void 0;var n=!0}catch{}var i=mv.call(e);return n&&(t?e[zn]=r:delete e[zn]),i}var vv=gv,bv=Object.prototype,wv=bv.toString;function _v(e){return wv.call(e)}var Tv=_v,Ov="[object Null]",xv="[object Undefined]",Qu=Ht?Ht.toStringTag:void 0;function Ev(e){return e==null?e===void 0?xv:Ov:Qu&&Qu in Object(e)?vv(e):Tv(e)}var kn=Ev;function Av(e){return e!=null&&typeof e=="object"}var _r=Av,Iv="[object Symbol]";function Sv(e){return typeof e=="symbol"||_r(e)&&kn(e)==Iv}var pn=Sv;function jv(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var If=jv,$v=Array.isArray,Vt=$v,kv=1/0,Yu=Ht?Ht.prototype:void 0,el=Yu?Yu.toString:void 0;function Sf(e){if(typeof e=="string")return e;if(Vt(e))return If(e,Sf)+"";if(pn(e))return el?el.call(e):"";var t=e+"";return t=="0"&&1/e==-kv?"-0":t}var Pv=Sf,Nv=/\s/;function Uv(e){for(var t=e.length;t--&&Nv.test(e.charAt(t)););return t}var Rv=Uv,Bv=/^\s+/;function Mv(e){return e&&e.slice(0,Rv(e)+1).replace(Bv,"")}var Cv=Mv;function Lv(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ir=Lv,tl=NaN,Dv=/^[-+]0x[0-9a-f]+$/i,Vv=/^0b[01]+$/i,Fv=/^0o[0-7]+$/i,Gv=parseInt;function zv(e){if(typeof e=="number")return e;if(pn(e))return tl;if(ir(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ir(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Cv(e);var r=Vv.test(e);return r||Fv.test(e)?Gv(e.slice(2),r?2:8):Dv.test(e)?tl:+e}var Kv=zv,rl=1/0,qv=17976931348623157e292;function Wv(e){if(!e)return e===0?e:0;if(e=Kv(e),e===rl||e===-rl){var t=e<0?-1:1;return t*qv}return e===e?e:0}var Hv=Wv;function Jv(e){var t=Hv(e),r=t%1;return t===t?r?t-r:t:0}var nl=Jv;function Xv(e){return e}var Qo=Xv,Zv="[object AsyncFunction]",Qv="[object Function]",Yv="[object GeneratorFunction]",eb="[object Proxy]";function tb(e){if(!ir(e))return!1;var t=kn(e);return t==Qv||t==Yv||t==Zv||t==eb}var jf=tb,rb=pt["__core-js_shared__"],xa=rb,il=function(){var e=/[^.]+$/.exec(xa&&xa.keys&&xa.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function nb(e){return!!il&&il in e}var ib=nb,ob=Function.prototype,ab=ob.toString;function sb(e){if(e!=null){try{return ab.call(e)}catch{}try{return e+""}catch{}}return""}var Jr=sb,ub=/[\\^$.*+?()[\]{}|]/g,lb=/^\[object .+?Constructor\]$/,cb=Function.prototype,fb=Object.prototype,db=cb.toString,pb=fb.hasOwnProperty,hb=RegExp("^"+db.call(pb).replace(ub,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yb(e){if(!ir(e)||ib(e))return!1;var t=jf(e)?hb:lb;return t.test(Jr(e))}var mb=yb;function gb(e,t){return e?.[t]}var vb=gb;function bb(e,t){var r=vb(e,t);return mb(r)?r:void 0}var Xr=bb,wb=Xr(pt,"WeakMap"),ui=wb,_b=ui&&new ui,wo=_b,Tb=wo?function(e,t){return wo.set(e,t),e}:Qo,$f=Tb,ol=Object.create,Ob=function(){function e(){}return function(t){if(!ir(t))return{};if(ol)return ol(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Cs=Ob;function xb(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 r=Cs(e.prototype),n=e.apply(r,t);return ir(n)?n:r}}var li=xb,Eb=1;function Ab(e,t,r){var n=t&Eb,i=li(e);function o(){var a=this&&this!==pt&&this instanceof o?i:e;return a.apply(n?r:this,arguments)}return o}var Ib=Ab;function Sb(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Ls=Sb,jb=Math.max;function $b(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,u=t.length,c=jb(o-a,0),f=Array(u+c),p=!n;++s<u;)f[s]=t[s];for(;++i<a;)(p||i<o)&&(f[r[i]]=e[i]);for(;c--;)f[s++]=e[i++];return f}var kf=$b,kb=Math.max;function Pb(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,u=-1,c=t.length,f=kb(o-s,0),p=Array(f+c),S=!n;++i<f;)p[i]=e[i];for(var T=i;++u<c;)p[T+u]=t[u];for(;++a<s;)(S||i<o)&&(p[T+r[a]]=e[i++]);return p}var Pf=Pb;function Nb(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Ub=Nb;function Rb(){}var Ds=Rb,Bb=4294967295;function _o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Bb,this.__views__=[]}_o.prototype=Cs(Ds.prototype);_o.prototype.constructor=_o;var Vs=_o;function Mb(){}var Nf=Mb,Cb=wo?function(e){return wo.get(e)}:Nf,Uf=Cb,Lb={},al=Lb,Db=Object.prototype,Vb=Db.hasOwnProperty;function Fb(e){for(var t=e.name+"",r=al[t],n=Vb.call(al,t)?r.length:0;n--;){var i=r[n],o=i.func;if(o==null||o==e)return i.name}return t}var Gb=Fb;function To(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}To.prototype=Cs(Ds.prototype);To.prototype.constructor=To;var Qa=To;function zb(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Rf=zb;function Kb(e){if(e instanceof Vs)return e.clone();var t=new Qa(e.__wrapped__,e.__chain__);return t.__actions__=Rf(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var qb=Kb,Wb=Object.prototype,Hb=Wb.hasOwnProperty;function Oo(e){if(_r(e)&&!Vt(e)&&!(e instanceof Vs)){if(e instanceof Qa)return e;if(Hb.call(e,"__wrapped__"))return qb(e)}return new Qa(e)}Oo.prototype=Ds.prototype;Oo.prototype.constructor=Oo;var Jb=Oo;function Xb(e){var t=Gb(e),r=Jb[t];if(typeof r!="function"||!(t in Vs.prototype))return!1;if(e===r)return!0;var n=Uf(r);return!!n&&e===n[0]}var Zb=Xb,Qb=800,Yb=16,e0=Date.now;function t0(e){var t=0,r=0;return function(){var n=e0(),i=Yb-(n-r);if(r=n,i>0){if(++t>=Qb)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Bf=t0,r0=Bf($f),Mf=r0,n0=/\{\n\/\* \[wrapped with (.+)\] \*/,i0=/,? & /;function o0(e){var t=e.match(n0);return t?t[1].split(i0):[]}var a0=o0,s0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function u0(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(s0,`{
|
|
55
|
+
/* [wrapped with `+t+`] */
|
|
56
|
+
`)}var l0=u0;function c0(e){return function(){return e}}var f0=c0,d0=function(){try{var e=Xr(Object,"defineProperty");return e({},"",{}),e}catch{}}(),xo=d0,p0=xo?function(e,t){return xo(e,"toString",{configurable:!0,enumerable:!1,value:f0(t),writable:!0})}:Qo,h0=p0,y0=Bf(h0),Fs=y0;function m0(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var g0=m0;function v0(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var b0=v0;function w0(e){return e!==e}var _0=w0;function T0(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var O0=T0;function x0(e,t,r){return t===t?O0(e,t,r):b0(e,_0,r)}var E0=x0;function A0(e,t){var r=e==null?0:e.length;return!!r&&E0(e,t,0)>-1}var Cf=A0,I0=1,S0=2,j0=8,$0=16,k0=32,P0=64,N0=128,U0=256,R0=512,B0=[["ary",N0],["bind",I0],["bindKey",S0],["curry",j0],["curryRight",$0],["flip",R0],["partial",k0],["partialRight",P0],["rearg",U0]];function M0(e,t){return g0(B0,function(r){var n="_."+r[0];t&r[1]&&!Cf(e,n)&&e.push(n)}),e.sort()}var C0=M0;function L0(e,t,r){var n=t+"";return Fs(e,l0(n,C0(a0(n),r)))}var Lf=L0,D0=1,V0=2,F0=4,G0=8,sl=32,ul=64;function z0(e,t,r,n,i,o,a,s,u,c){var f=t&G0,p=f?a:void 0,S=f?void 0:a,T=f?o:void 0,I=f?void 0:o;t|=f?sl:ul,t&=~(f?ul:sl),t&F0||(t&=~(D0|V0));var z=[e,t,i,T,p,I,S,s,u,c],Y=r.apply(void 0,z);return Zb(e)&&Mf(Y,z),Y.placeholder=n,Lf(Y,e,t)}var Df=z0;function K0(e){var t=e;return t.placeholder}var Gs=K0,q0=9007199254740991,W0=/^(?:0|[1-9]\d*)$/;function H0(e,t){var r=typeof e;return t=t??q0,!!t&&(r=="number"||r!="symbol"&&W0.test(e))&&e>-1&&e%1==0&&e<t}var Yo=H0,J0=Math.min;function X0(e,t){for(var r=e.length,n=J0(t.length,r),i=Rf(e);n--;){var o=t[n];e[n]=Yo(o,r)?i[o]:void 0}return e}var Z0=X0,ll="__lodash_placeholder__";function Q0(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r];(a===t||a===ll)&&(e[r]=ll,o[i++]=r)}return o}var ci=Q0,Y0=1,e1=2,t1=8,r1=16,n1=128,i1=512;function Vf(e,t,r,n,i,o,a,s,u,c){var f=t&n1,p=t&Y0,S=t&e1,T=t&(t1|r1),I=t&i1,z=S?void 0:li(e);function Y(){for(var V=arguments.length,M=Array(V),F=V;F--;)M[F]=arguments[F];if(T)var W=Gs(Y),D=Ub(M,W);if(n&&(M=kf(M,n,i,T)),o&&(M=Pf(M,o,a,T)),V-=D,T&&V<c){var re=ci(M,W);return Df(e,t,Vf,Y.placeholder,r,M,re,s,u,c-V)}var K=p?r:this,fe=S?K[e]:e;return V=M.length,s?M=Z0(M,s):I&&V>1&&M.reverse(),f&&u<V&&(M.length=u),this&&this!==pt&&this instanceof Y&&(fe=z||li(fe)),fe.apply(K,M)}return Y}var Ff=Vf;function o1(e,t,r){var n=li(e);function i(){for(var o=arguments.length,a=Array(o),s=o,u=Gs(i);s--;)a[s]=arguments[s];var c=o<3&&a[0]!==u&&a[o-1]!==u?[]:ci(a,u);if(o-=c.length,o<r)return Df(e,t,Ff,i.placeholder,void 0,a,c,void 0,void 0,r-o);var f=this&&this!==pt&&this instanceof i?n:e;return Ls(f,this,a)}return i}var a1=o1,s1=1;function u1(e,t,r,n){var i=t&s1,o=li(e);function a(){for(var s=-1,u=arguments.length,c=-1,f=n.length,p=Array(f+u),S=this&&this!==pt&&this instanceof a?o:e;++c<f;)p[c]=n[c];for(;u--;)p[c++]=arguments[++s];return Ls(S,i?r:this,p)}return a}var l1=u1,cl="__lodash_placeholder__",Ea=1,c1=2,f1=4,fl=8,Kn=128,dl=256,d1=Math.min;function p1(e,t){var r=e[1],n=t[1],i=r|n,o=i<(Ea|c1|Kn),a=n==Kn&&r==fl||n==Kn&&r==dl&&e[7].length<=t[8]||n==(Kn|dl)&&t[7].length<=t[8]&&r==fl;if(!(o||a))return e;n&Ea&&(e[2]=t[2],i|=r&Ea?0:f1);var s=t[3];if(s){var u=e[3];e[3]=u?kf(u,s,t[4]):s,e[4]=u?ci(e[3],cl):t[4]}return s=t[5],s&&(u=e[5],e[5]=u?Pf(u,s,t[6]):s,e[6]=u?ci(e[5],cl):t[6]),s=t[7],s&&(e[7]=s),n&Kn&&(e[8]=e[8]==null?t[8]:d1(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var h1=p1,y1="Expected a function",pl=1,m1=2,Aa=8,Ia=16,Sa=32,hl=64,yl=Math.max;function g1(e,t,r,n,i,o,a,s){var u=t&m1;if(!u&&typeof e!="function")throw new TypeError(y1);var c=n?n.length:0;if(c||(t&=~(Sa|hl),n=i=void 0),a=a===void 0?a:yl(nl(a),0),s=s===void 0?s:nl(s),c-=i?i.length:0,t&hl){var f=n,p=i;n=i=void 0}var S=u?void 0:Uf(e),T=[e,t,r,n,i,f,p,o,a,s];if(S&&h1(T,S),e=T[0],t=T[1],r=T[2],n=T[3],i=T[4],s=T[9]=T[9]===void 0?u?0:e.length:yl(T[9]-c,0),!s&&t&(Aa|Ia)&&(t&=~(Aa|Ia)),!t||t==pl)var I=Ib(e,t,r);else t==Aa||t==Ia?I=a1(e,t,s):(t==Sa||t==(pl|Sa))&&!i.length?I=l1(e,t,r,n):I=Ff.apply(void 0,T);var z=S?$f:Mf;return Lf(z(I,T),e,t)}var v1=g1;function b1(e,t,r){t=="__proto__"&&xo?xo(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var w1=b1;function _1(e,t){return e===t||e!==e&&t!==t}var zs=_1,T1=Object.prototype,O1=T1.hasOwnProperty;function x1(e,t,r){var n=e[t];(!(O1.call(e,t)&&zs(n,r))||r===void 0&&!(t in e))&&w1(e,t,r)}var E1=x1,ml=Math.max;function A1(e,t,r){return t=ml(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=ml(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),Ls(e,this,s)}}var Gf=A1;function I1(e,t){return Fs(Gf(e,t,Qo),e+"")}var zf=I1,S1=9007199254740991;function j1(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=S1}var Ks=j1;function $1(e){return e!=null&&Ks(e.length)&&!jf(e)}var Kf=$1,k1=Object.prototype;function P1(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||k1;return e===r}var N1=P1;function U1(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var R1=U1,B1="[object Arguments]";function M1(e){return _r(e)&&kn(e)==B1}var gl=M1,qf=Object.prototype,C1=qf.hasOwnProperty,L1=qf.propertyIsEnumerable,D1=gl(function(){return arguments}())?gl:function(e){return _r(e)&&C1.call(e,"callee")&&!L1.call(e,"callee")},qs=D1;function V1(){return!1}var F1=V1,Wf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vl=Wf&&typeof module=="object"&&module&&!module.nodeType&&module,G1=vl&&vl.exports===Wf,bl=G1?pt.Buffer:void 0,z1=bl?bl.isBuffer:void 0,K1=z1||F1,Ya=K1,q1="[object Arguments]",W1="[object Array]",H1="[object Boolean]",J1="[object Date]",X1="[object Error]",Z1="[object Function]",Q1="[object Map]",Y1="[object Number]",ew="[object Object]",tw="[object RegExp]",rw="[object Set]",nw="[object String]",iw="[object WeakMap]",ow="[object ArrayBuffer]",aw="[object DataView]",sw="[object Float32Array]",uw="[object Float64Array]",lw="[object Int8Array]",cw="[object Int16Array]",fw="[object Int32Array]",dw="[object Uint8Array]",pw="[object Uint8ClampedArray]",hw="[object Uint16Array]",yw="[object Uint32Array]",Ue={};Ue[sw]=Ue[uw]=Ue[lw]=Ue[cw]=Ue[fw]=Ue[dw]=Ue[pw]=Ue[hw]=Ue[yw]=!0;Ue[q1]=Ue[W1]=Ue[ow]=Ue[H1]=Ue[aw]=Ue[J1]=Ue[X1]=Ue[Z1]=Ue[Q1]=Ue[Y1]=Ue[ew]=Ue[tw]=Ue[rw]=Ue[nw]=Ue[iw]=!1;function mw(e){return _r(e)&&Ks(e.length)&&!!Ue[kn(e)]}var gw=mw;function vw(e){return function(t){return e(t)}}var Hf=vw,Jf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ti=Jf&&typeof module=="object"&&module&&!module.nodeType&&module,bw=ti&&ti.exports===Jf,ja=bw&&Ef.process,ww=function(){try{var e=ti&&ti.require&&ti.require("util").types;return e||ja&&ja.binding&&ja.binding("util")}catch{}}(),wl=ww,_l=wl&&wl.isTypedArray,_w=_l?Hf(_l):gw,Xf=_w,Tw=Object.prototype,Ow=Tw.hasOwnProperty;function xw(e,t){var r=Vt(e),n=!r&&qs(e),i=!r&&!n&&Ya(e),o=!r&&!n&&!i&&Xf(e),a=r||n||i||o,s=a?R1(e.length,String):[],u=s.length;for(var c in e)(t||Ow.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Yo(c,u)))&&s.push(c);return s}var Ew=xw;function Aw(e,t){return function(r){return e(t(r))}}var Iw=Aw,Sw=Iw(Object.keys,Object),jw=Sw,$w=Object.prototype,kw=$w.hasOwnProperty;function Pw(e){if(!N1(e))return jw(e);var t=[];for(var r in Object(e))kw.call(e,r)&&r!="constructor"&&t.push(r);return t}var Nw=Pw;function Uw(e){return Kf(e)?Ew(e):Nw(e)}var Zf=Uw,Rw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bw=/^\w*$/;function Mw(e,t){if(Vt(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||pn(e)?!0:Bw.test(e)||!Rw.test(e)||t!=null&&e in Object(t)}var Ws=Mw,Cw=Xr(Object,"create"),fi=Cw;function Lw(){this.__data__=fi?fi(null):{},this.size=0}var Dw=Lw;function Vw(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Fw=Vw,Gw="__lodash_hash_undefined__",zw=Object.prototype,Kw=zw.hasOwnProperty;function qw(e){var t=this.__data__;if(fi){var r=t[e];return r===Gw?void 0:r}return Kw.call(t,e)?t[e]:void 0}var Ww=qw,Hw=Object.prototype,Jw=Hw.hasOwnProperty;function Xw(e){var t=this.__data__;return fi?t[e]!==void 0:Jw.call(t,e)}var Zw=Xw,Qw="__lodash_hash_undefined__";function Yw(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=fi&&t===void 0?Qw:t,this}var e_=Yw;function Pn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Pn.prototype.clear=Dw;Pn.prototype.delete=Fw;Pn.prototype.get=Ww;Pn.prototype.has=Zw;Pn.prototype.set=e_;var Tl=Pn;function t_(){this.__data__=[],this.size=0}var r_=t_;function n_(e,t){for(var r=e.length;r--;)if(zs(e[r][0],t))return r;return-1}var ea=n_,i_=Array.prototype,o_=i_.splice;function a_(e){var t=this.__data__,r=ea(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():o_.call(t,r,1),--this.size,!0}var s_=a_;function u_(e){var t=this.__data__,r=ea(t,e);return r<0?void 0:t[r][1]}var l_=u_;function c_(e){return ea(this.__data__,e)>-1}var f_=c_;function d_(e,t){var r=this.__data__,n=ea(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var p_=d_;function Nn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Nn.prototype.clear=r_;Nn.prototype.delete=s_;Nn.prototype.get=l_;Nn.prototype.has=f_;Nn.prototype.set=p_;var ta=Nn,h_=Xr(pt,"Map"),di=h_;function y_(){this.size=0,this.__data__={hash:new Tl,map:new(di||ta),string:new Tl}}var m_=y_;function g_(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var v_=g_;function b_(e,t){var r=e.__data__;return v_(t)?r[typeof t=="string"?"string":"hash"]:r.map}var ra=b_;function w_(e){var t=ra(this,e).delete(e);return this.size-=t?1:0,t}var __=w_;function T_(e){return ra(this,e).get(e)}var O_=T_;function x_(e){return ra(this,e).has(e)}var E_=x_;function A_(e,t){var r=ra(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var I_=A_;function Un(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Un.prototype.clear=m_;Un.prototype.delete=__;Un.prototype.get=O_;Un.prototype.has=E_;Un.prototype.set=I_;var na=Un,S_="Expected a function";function Hs(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(S_);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Hs.Cache||na),r}Hs.Cache=na;var j_=Hs,$_=500;function k_(e){var t=j_(e,function(n){return r.size===$_&&r.clear(),n}),r=t.cache;return t}var P_=k_,N_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,U_=/\\(\\)?/g,R_=P_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(N_,function(r,n,i,o){t.push(i?o.replace(U_,"$1"):n||r)}),t}),B_=R_;function M_(e){return e==null?"":Pv(e)}var C_=M_;function L_(e,t){return Vt(e)?e:Ws(e,t)?[e]:B_(C_(e))}var ia=L_,D_=1/0;function V_(e){if(typeof e=="string"||pn(e))return e;var t=e+"";return t=="0"&&1/e==-D_?"-0":t}var Si=V_;function F_(e,t){t=ia(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Si(t[r++])];return r&&r==n?e:void 0}var Js=F_;function G_(e,t,r){var n=e==null?void 0:Js(e,t);return n===void 0?r:n}var z_=G_;function K_(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Qf=K_,Ol=Ht?Ht.isConcatSpreadable:void 0;function q_(e){return Vt(e)||qs(e)||!!(Ol&&e&&e[Ol])}var W_=q_;function Yf(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=W_),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?Yf(s,t-1,r,n,i):Qf(i,s):n||(i[i.length]=s)}return i}var H_=Yf;function J_(e){var t=e==null?0:e.length;return t?H_(e,1):[]}var X_=J_;function Z_(e){return Fs(Gf(e,void 0,X_),e+"")}var Q_=Z_;function Y_(){this.__data__=new ta,this.size=0}var eT=Y_;function tT(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var rT=tT;function nT(e){return this.__data__.get(e)}var iT=nT;function oT(e){return this.__data__.has(e)}var aT=oT,sT=200;function uT(e,t){var r=this.__data__;if(r instanceof ta){var n=r.__data__;if(!di||n.length<sT-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new na(n)}return r.set(e,t),this.size=r.size,this}var lT=uT;function Rn(e){var t=this.__data__=new ta(e);this.size=t.size}Rn.prototype.clear=eT;Rn.prototype.delete=rT;Rn.prototype.get=iT;Rn.prototype.has=aT;Rn.prototype.set=lT;var Wi=Rn;function cT(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}var fT=cT;function dT(){return[]}var pT=dT,hT=Object.prototype,yT=hT.propertyIsEnumerable,xl=Object.getOwnPropertySymbols,mT=xl?function(e){return e==null?[]:(e=Object(e),fT(xl(e),function(t){return yT.call(e,t)}))}:pT,gT=mT;function vT(e,t,r){var n=t(e);return Vt(e)?n:Qf(n,r(e))}var bT=vT;function wT(e){return bT(e,Zf,gT)}var El=wT,_T=Xr(pt,"DataView"),es=_T,TT=Xr(pt,"Promise"),ts=TT,OT=Xr(pt,"Set"),ln=OT,Al="[object Map]",xT="[object Object]",Il="[object Promise]",Sl="[object Set]",jl="[object WeakMap]",$l="[object DataView]",ET=Jr(es),AT=Jr(di),IT=Jr(ts),ST=Jr(ln),jT=Jr(ui),Ur=kn;(es&&Ur(new es(new ArrayBuffer(1)))!=$l||di&&Ur(new di)!=Al||ts&&Ur(ts.resolve())!=Il||ln&&Ur(new ln)!=Sl||ui&&Ur(new ui)!=jl)&&(Ur=function(e){var t=kn(e),r=t==xT?e.constructor:void 0,n=r?Jr(r):"";if(n)switch(n){case ET:return $l;case AT:return Al;case IT:return Il;case ST:return Sl;case jT:return jl}return t});var kl=Ur,$T=pt.Uint8Array,Pl=$T,kT="__lodash_hash_undefined__";function PT(e){return this.__data__.set(e,kT),this}var NT=PT;function UT(e){return this.__data__.has(e)}var RT=UT;function Eo(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new na;++t<r;)this.add(e[t])}Eo.prototype.add=Eo.prototype.push=NT;Eo.prototype.has=RT;var ed=Eo;function BT(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var MT=BT;function CT(e,t){return e.has(t)}var td=CT,LT=1,DT=2;function VT(e,t,r,n,i,o){var a=r<,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var c=o.get(e),f=o.get(t);if(c&&f)return c==t&&f==e;var p=-1,S=!0,T=r&DT?new ed:void 0;for(o.set(e,t),o.set(t,e);++p<s;){var I=e[p],z=t[p];if(n)var Y=a?n(z,I,p,t,e,o):n(I,z,p,e,t,o);if(Y!==void 0){if(Y)continue;S=!1;break}if(T){if(!MT(t,function(V,M){if(!td(T,M)&&(I===V||i(I,V,r,n,o)))return T.push(M)})){S=!1;break}}else if(!(I===z||i(I,z,r,n,o))){S=!1;break}}return o.delete(e),o.delete(t),S}var rd=VT;function FT(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var GT=FT;function zT(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var nd=zT,KT=1,qT=2,WT="[object Boolean]",HT="[object Date]",JT="[object Error]",XT="[object Map]",ZT="[object Number]",QT="[object RegExp]",YT="[object Set]",eO="[object String]",tO="[object Symbol]",rO="[object ArrayBuffer]",nO="[object DataView]",Nl=Ht?Ht.prototype:void 0,$a=Nl?Nl.valueOf:void 0;function iO(e,t,r,n,i,o,a){switch(r){case nO:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case rO:return!(e.byteLength!=t.byteLength||!o(new Pl(e),new Pl(t)));case WT:case HT:case ZT:return zs(+e,+t);case JT:return e.name==t.name&&e.message==t.message;case QT:case eO:return e==t+"";case XT:var s=GT;case YT:var u=n&KT;if(s||(s=nd),e.size!=t.size&&!u)return!1;var c=a.get(e);if(c)return c==t;n|=qT,a.set(e,t);var f=rd(s(e),s(t),n,i,o,a);return a.delete(e),f;case tO:if($a)return $a.call(e)==$a.call(t)}return!1}var oO=iO,aO=1,sO=Object.prototype,uO=sO.hasOwnProperty;function lO(e,t,r,n,i,o){var a=r&aO,s=El(e),u=s.length,c=El(t),f=c.length;if(u!=f&&!a)return!1;for(var p=u;p--;){var S=s[p];if(!(a?S in t:uO.call(t,S)))return!1}var T=o.get(e),I=o.get(t);if(T&&I)return T==t&&I==e;var z=!0;o.set(e,t),o.set(t,e);for(var Y=a;++p<u;){S=s[p];var V=e[S],M=t[S];if(n)var F=a?n(M,V,S,t,e,o):n(V,M,S,e,t,o);if(!(F===void 0?V===M||i(V,M,r,n,o):F)){z=!1;break}Y||(Y=S=="constructor")}if(z&&!Y){var W=e.constructor,D=t.constructor;W!=D&&"constructor"in e&&"constructor"in t&&!(typeof W=="function"&&W instanceof W&&typeof D=="function"&&D instanceof D)&&(z=!1)}return o.delete(e),o.delete(t),z}var cO=lO,fO=1,Ul="[object Arguments]",Rl="[object Array]",Vi="[object Object]",dO=Object.prototype,Bl=dO.hasOwnProperty;function pO(e,t,r,n,i,o){var a=Vt(e),s=Vt(t),u=a?Rl:kl(e),c=s?Rl:kl(t);u=u==Ul?Vi:u,c=c==Ul?Vi:c;var f=u==Vi,p=c==Vi,S=u==c;if(S&&Ya(e)){if(!Ya(t))return!1;a=!0,f=!1}if(S&&!f)return o||(o=new Wi),a||Xf(e)?rd(e,t,r,n,i,o):oO(e,t,u,r,n,i,o);if(!(r&fO)){var T=f&&Bl.call(e,"__wrapped__"),I=p&&Bl.call(t,"__wrapped__");if(T||I){var z=T?e.value():e,Y=I?t.value():t;return o||(o=new Wi),i(z,Y,r,n,o)}}return S?(o||(o=new Wi),cO(e,t,r,n,i,o)):!1}var hO=pO;function id(e,t,r,n,i){return e===t?!0:e==null||t==null||!_r(e)&&!_r(t)?e!==e&&t!==t:hO(e,t,r,n,id,i)}var od=id,yO=1,mO=2;function gO(e,t,r,n){var i=r.length,o=i,a=!n;if(e==null)return!o;for(e=Object(e);i--;){var s=r[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=r[i];var u=s[0],c=e[u],f=s[1];if(a&&s[2]){if(c===void 0&&!(u in e))return!1}else{var p=new Wi;if(n)var S=n(c,f,u,e,t,p);if(!(S===void 0?od(f,c,yO|mO,n,p):S))return!1}}return!0}var vO=gO;function bO(e){return e===e&&!ir(e)}var ad=bO;function wO(e){for(var t=Zf(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,ad(i)]}return t}var _O=wO;function TO(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var sd=TO;function OO(e){var t=_O(e);return t.length==1&&t[0][2]?sd(t[0][0],t[0][1]):function(r){return r===e||vO(r,e,t)}}var xO=OO;function EO(e,t){return e!=null&&t in Object(e)}var AO=EO;function IO(e,t,r){t=ia(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var a=Si(t[n]);if(!(o=e!=null&&r(e,a)))break;e=e[a]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&Ks(i)&&Yo(a,i)&&(Vt(e)||qs(e)))}var SO=IO;function jO(e,t){return e!=null&&SO(e,t,AO)}var ud=jO,$O=1,kO=2;function PO(e,t){return Ws(e)&&ad(t)?sd(Si(e),t):function(r){var n=z_(r,e);return n===void 0&&n===t?ud(r,e):od(t,n,$O|kO)}}var NO=PO;function UO(e){return function(t){return t?.[e]}}var RO=UO;function BO(e){return function(t){return Js(t,e)}}var MO=BO;function CO(e){return Ws(e)?RO(Si(e)):MO(e)}var LO=CO;function DO(e){return typeof e=="function"?e:e==null?Qo:typeof e=="object"?Vt(e)?NO(e[0],e[1]):xO(e):LO(e)}var VO=DO;function FO(e){return _r(e)&&Kf(e)}var GO=FO;function zO(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var KO=zO,qO=200;function WO(e,t,r,n){var i=-1,o=Cf,a=!0,s=e.length,u=[],c=t.length;if(!s)return u;r&&(t=If(t,Hf(r))),n?(o=KO,a=!1):t.length>=qO&&(o=td,a=!1,t=new ed(t));e:for(;++i<s;){var f=e[i],p=r==null?f:r(f);if(f=n||f!==0?f:0,a&&p===p){for(var S=c;S--;)if(t[S]===p)continue e;u.push(f)}else o(t,p,n)||u.push(f)}return u}var HO=WO;function JO(e,t,r,n){if(!ir(e))return e;t=ia(t,e);for(var i=-1,o=t.length,a=o-1,s=e;s!=null&&++i<o;){var u=Si(t[i]),c=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(i!=a){var f=s[u];c=n?n(f,u,s):void 0,c===void 0&&(c=ir(f)?f:Yo(t[i+1])?[]:{})}E1(s,u,c),s=s[u]}return e}var XO=JO;function ZO(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=Js(e,a);r(s,a)&&XO(o,ia(a,e),s)}return o}var QO=ZO,YO=32,Xs=zf(function(e,t){var r=ci(t,Gs(Xs));return v1(e,YO,void 0,t,r)});Xs.placeholder={};var ex=Xs;function tx(e,t){return QO(e,t,function(r,n){return ud(e,n)})}var rx=tx,nx=Q_(function(e,t){return e==null?{}:rx(e,t)}),Ml=nx,ix=4294967295,ox=ix-1,ax=Math.floor,sx=Math.min;function ux(e,t,r,n){var i=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var a=t!==t,s=t===null,u=pn(t),c=t===void 0;i<o;){var f=ax((i+o)/2),p=r(e[f]),S=p!==void 0,T=p===null,I=p===p,z=pn(p);if(a)var Y=n||I;else c?Y=I&&(n||S):s?Y=I&&S&&(n||!T):u?Y=I&&S&&!T&&(n||!z):T||z?Y=!1:Y=n?p<=t:p<t;Y?i=f+1:o=f}return sx(o,ox)}var lx=ux;function cx(e,t,r){return lx(e,t,VO(r,2))}var fx=cx,dx=1/0,NI=ln&&1/nd(new ln([,-0]))[1]==dx?function(e){return new ln(e)}:Nf,px=zf(function(e,t){return GO(e)?HO(e,t):[]}),Cl=px,ld=sr(nv(),1),UI=ld.default.configure,pi=ld.default,ka=100,{WARN:hx,LOG:RI,DEBUG:Ke,VERBOSE:we,ERROR:BI}=je.setup(je.INFO),Ao=Be.set();gg({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var Ve=({caller:e,thread:t,pattern:r,args:n})=>Re(()=>(n=n||r,`${!Array.isArray(t)&&t?.name?t.name+" | ":""}${e??"caller?"}${n?`{${typeof n=="string"?n:pi(n)}}`:""}`));function yx(e,t){return Re(()=>Fe.structural(e.get(),t.get()))}function ji(e,t){return Fe.shallow(e.applogs,t.applogs)}function Zs(e,t){if(e.size!==t.size)return!1;for(let r=0;r<e.size;r++){let n=e.nodes[r],i=t.nodes[r];if(we.isEnabled&&we("queryNodesComparer",r,n,i),!Fe.structural(n.variables,i.variables))return we.isEnabled&&we("[queryNodesComparer] changed vars:",r,n,i),!1;if(!ji(n.logsOfThisNode,i.logsOfThisNode))return we.isEnabled&&we("[queryNodesComparer] changed logsOfThisNode:",r,n,i),!1}return we.isEnabled&&we("[queryNodesComparer] equal:",{a:e,b:t}),!0}var mx=0;function Rt(e,{name:t,equals:r}={}){let n=`observableArrayMap@${++mx}{${t}}`;we.isEnabled&&we(`[${n}] create`,{fnname:e.name,fn:e,name:t,equals:r});let i,o=cd(e,s=>{i?Re(()=>(r??Fe.structural)(i,s))?Ke.isEnabled&&Ke(`[${n}] update skipped`,{updatedItems:s,observableArr:i}):(i.replace(s),Ke.isEnabled&&Ke(`[${n}] updated`,{updatedItems:s,observableArr:i})):i=Be.array(s,{deep:!1,name:t,equals:r})},{name:n});if(n.includes("useRoots")){var a=Dt(i);Ke(`[${n}] deps`,{disposeAutorun:o,rootsAtom:a,observableArr:i,observers:ho(i)}),ai(()=>Ao.add(a))}return we.isEnabled&&Ho(i,()=>{we(`[${n}] observed`,ho(i),{rootsAtom:a,observableArr:i})}),En(i,()=>{we.isEnabled&&we(`[${n}] dispose`),a&&ai(()=>Ao.delete(a)),o()}),i}var gx=0;function vx(e,{name:t}={}){let r=`observableSetMap@${++gx}{${t}}`;we.isEnabled&&we(`[${r}] create`,{fnname:e.name,fn:e,name:t});let n,i=cd(e,a=>{if(!n)n=Be.set(a,{deep:!1,name:t});else{let{deleted:s,added:u}=Re(()=>{let c=new Set(n.values()),f=new Set;for(let p of a)n.has(p)?(we.isEnabled&&we(`[${r}] unchanged`,p,{updatedItems:a,observableSet:n}),c.delete(p)):f.add(p);return Ke.isEnabled&&Ke(`[${r}] updated:`,{unseen:c,added:f,updatedItems:a,observableSet:n}),{added:f,deleted:c}});for(let c of s)n.delete(c);for(let c of u)n.add(c)}},{name:r});if(r.includes("useRoots")){var o=Dt(n);Ke.isEnabled&&Ke(`[${r}] deps`,{disposeAutorun:i,rootsAtom:o,observableSet:n,observers:ho(n)}),ai(()=>Ao.add(o))}return we.isEnabled&&Ho(n,()=>{we(`[${r}] observed`,ho(n),{rootsAtom:o,observableSet:n})}),En(n,()=>{we.isEnabled&&we(`[${r}] dispose`),o&&ai(()=>Ao.delete(o)),i()}),n}function cd(e,t=null,{name:r}={}){Ke.isEnabled&&Ke("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:r});let n=`${r}.autorunImm`,i,o=new Wt(n,function(...s){Ke.isEnabled&&Ke(`[${n}] reaction.invalidate`,s),a()});function a(){o.track(function(){let s=ka&&performance.now();Ke.isEnabled&&Ke(`[${n}] runAndTrack:`,{name:r??e.name,fn:e}),i=e(),Ke.isEnabled&&Ke(`[${n}] runAndTrack =>`,i),ai(()=>{t?.(i)}),ka&&performance.now()-s>ka&&hx(`[${n}] took ${performance.now()-s}ms`)})}return a(),Ke.isEnabled&&Ke(`[${n}] deps of reaction`,{reaction:o,result:i,deps:Jo(o)}),()=>{we.isEnabled&&we(`[${n}] dispose`),setTimeout(()=>o.dispose())}}function He(e,t,r=!1){if(Lr(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let n=!1,i=0,o=typeof r=="boolean"?{keepAlive:r}:r,a=new Map;return function(...s){let u,c=Re(()=>{let T=s;for(let I=0;I<s.length;I++)s[I]instanceof hn&&s===T&&(T=s.slice());return T}),f=`computedFnDeepCompare(${e||t.name}#${++i})${o.argsDebugName?`{${o.argsDebugName(...s)}}`:""}`;for(let[T,I]of a.entries())if(wx(T,c)){u=I;break}else if(we.isEnabled)for(let z=0;z<T.length;z++)T[z]instanceof hn&&T[z].name===s[z].name&&Fe.structural(Cl(T,T[z]),Cl(c,c[z]))&&we.force(`[${f}] threadState mismatch => cachebust`,{diffFields:Object.keys(T[z]).filter(Y=>!Fe.structural(T[z][Y],s[z][Y])),cacheArg:T[z],freshArg:s[z]});if(u){let T=u.get();return we.isEnabled&&we(`[${f}] cache hit`,{untrackedArgs:c,cachedResult:T}),T}if(!o.keepAlive&&!Km())return!n&&Xm().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),n=!0),t.apply(this,s);we.isEnabled&&we(`[${f}] new computation`,{untrackedArgs:c});let p,S=De(()=>(we.isEnabled&&we(`[${f}] update->rerun`,Re(()=>({args:s})),t),we.isEnabled&&lf(),p=t.apply(this,s)),{...o,name:f});if(we.isEnabled&&we(`[${f}] deps`,Jo(S),{untrackedArgs:c}),a.set(c,S),!o.keepAlive){let T=En(S,()=>{we.isEnabled&&we(`[${f}] dispose`,S),T(),a.delete(c),o.onCleanup&&o.onCleanup(p,...s),p=void 0})}return S.get()}}function bx(e){let t=0,r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("?r+=o+`
|
|
57
|
+
`+" ".repeat(++t):o===")"?r+=`
|
|
58
|
+
`+" ".repeat(--t)+o:o===","&&n===0?r+=o+`
|
|
59
|
+
`+" ".repeat(t):o==="{"&&n===0?(n++,r+=o+`
|
|
60
|
+
`+" ".repeat(t+1)):o==="}"&&n===1?(n--,r+=`
|
|
61
|
+
`+" ".repeat(t)+o):o==="{"&&n>0?(n++,r+=o):(o==="}"&&n>1&&n--,r+=o)}return r}function wx(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]instanceof hn){if(t[r]!==e[r])return!1}else if(!Fe.structural(e[r],t[r]))return!1;return!0}var{WARN:Ll,LOG:MI,DEBUG:_x,VERBOSE:CI,ERROR:Pr}=je.setup(je.INFO,{prefix:"[thread]"});function Tr(e){return e.init!==void 0}var hn=class{constructor(e,t,r,n=[],i={}){this.name=e,this._applogs=n,this.parents=t===null?null:vo(t),this.filters=r,Re(()=>this.parents?.length===0)&&Ll("[Thread] empty parents array",e),i.skipObservable||An(this,{applogsCids:De,applogsByCid:De,insert:Ot,size:De,isEmpty:De,firstLog:De,latestLog:De},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw Pr("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Pr("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Pr("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw Pr("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Pr("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Pr("[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):Ll("unsubscribe called for non-existent",e)}notifySubscribers(e){_x(`[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 Pr("[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 Re(()=>this.size)}get nameAndSizeUntracked(){return Re(()=>`${this.name} (${this.size})`)}get prettyName(){return bx(this.name)}get hasParents(){return!!this.parents?.length}},Tx=class fd extends hn{static fromArray(t,r){return new fd(r||"static",null,[],t)}constructor(t,r,n,i){super(t,r,n,i,{skipObservable:!0})}get readOnly(){return!0}},Ox={};vf(Ox,{code:()=>Pd,decode:()=>du,encode:()=>fu,format:()=>Xl,name:()=>NA,parse:()=>RA,stringify:()=>Xl});var xx=["string","number","bigint","symbol"],Ex=["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 Ax(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;return xx.includes(t)?t:t==="function"?"Function":Array.isArray(e)?"Array":Ix(e)?"Buffer":Sx(e)||"Object"}function Ix(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Sx(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Ex.includes(t))return t}var R=class{constructor(e,t,r){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};R.uint=new R(0,"uint",!0);R.negint=new R(1,"negint",!0);R.bytes=new R(2,"bytes",!0);R.string=new R(3,"string",!0);R.array=new R(4,"array",!1);R.map=new R(5,"map",!1);R.tag=new R(6,"tag",!1);R.float=new R(7,"float",!0);R.false=new R(7,"false",!0);R.true=new R(7,"true",!0);R.null=new R(7,"null",!0);R.undefined=new R(7,"undefined",!0);R.break=new R(7,"break",!0);var te=class{constructor(e,t,r){this.type=e,this.value=t,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},Bn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",jx=new TextDecoder,$x=new TextEncoder;function Io(e){return Bn&&globalThis.Buffer.isBuffer(e)}function Qs(e){return e instanceof Uint8Array?Io(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var kx=Bn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Vl(e,t,r):(e,t,r)=>r-t>64?jx.decode(e.subarray(t,r)):Vl(e,t,r),dd=Bn?e=>e.length>64?globalThis.Buffer.from(e):Dl(e):e=>e.length>64?$x.encode(e):Dl(e),Ys=Bn?(e,t,r)=>Io(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Px=Bn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),Qs(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},Nx=Bn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function Ux(e,t){if(Io(e)&&Io(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function Dl(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}function Vl(e,t,r){let n=[];for(;t<r;){let i=e[t],o=null,a=i>239?4:i>223?3:i>191?2:1;if(t+a<=r){let s,u,c,f;switch(a){case 1:i<128&&(o=i);break;case 2:s=e[t+1],(s&192)===128&&(f=(i&31)<<6|s&63,f>127&&(o=f));break;case 3:s=e[t+1],u=e[t+2],(s&192)===128&&(u&192)===128&&(f=(i&15)<<12|(s&63)<<6|u&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:s=e[t+1],u=e[t+2],c=e[t+3],(s&192)===128&&(u&192)===128&&(c&192)===128&&(f=(i&15)<<18|(s&63)<<12|(u&63)<<6|c&63,f>65535&&f<1114112&&(o=f))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),t+=a}return pd(n)}var Fl=4096;function pd(e){let t=e.length;if(t<=Fl)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Fl));return r}var Rx=256,hd=class{constructor(e=Rx){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=Nx(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 r=this.chunks[0];e&&this.cursor>r.length/2?(t=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=Ys(r,0,this.cursor)}else t=Px(this.chunks,this.cursor);return e&&this.reset(),t}},ye="CBOR decode error:",Br="CBOR encode error:",$i=[];$i[23]=1;$i[24]=2;$i[25]=3;$i[26]=5;$i[27]=9;function Mn(e,t,r){if(e.length-t<r)throw new Error(`${ye} not enough data for type`)}var Xe=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Zr(e,t,r){Mn(e,t,1);let n=e[t];if(r.strict===!0&&n<Xe[0])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return n}function Qr(e,t,r){Mn(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Xe[1])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return n}function Yr(e,t,r){Mn(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Xe[2])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return n}function en(e,t,r){Mn(e,t,8);let n=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],o=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&o<Xe[3])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(r.allowBigInt===!0)return o;throw new Error(`${ye} integers outside of the safe integer range are not supported`)}function Bx(e,t,r,n){return new te(R.uint,Zr(e,t+1,n),2)}function Mx(e,t,r,n){return new te(R.uint,Qr(e,t+1,n),3)}function Cx(e,t,r,n){return new te(R.uint,Yr(e,t+1,n),5)}function Lx(e,t,r,n){return new te(R.uint,en(e,t+1,n),9)}function tn(e,t){return $t(e,0,t.value)}function $t(e,t,r){if(r<Xe[0]){let n=Number(r);e.push([t|n])}else if(r<Xe[1]){let n=Number(r);e.push([t|24,n])}else if(r<Xe[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Xe[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Xe[4]){let i=[t|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),a=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=o&255,o=o>>8,i[7]=o&255,o=o>>8,i[6]=o&255,o=o>>8,i[5]=o&255,i[4]=a&255,a=a>>8,i[3]=a&255,a=a>>8,i[2]=a&255,a=a>>8,i[1]=a&255,e.push(i)}else throw new Error(`${ye} encountered BigInt larger than allowable range`)}}tn.encodedSize=function(e){return $t.encodedSize(e.value)};$t.encodedSize=function(e){return e<Xe[0]?1:e<Xe[1]?2:e<Xe[2]?3:e<Xe[3]?5:9};tn.compareTokens=function(e,t){return e.value<t.value?-1:e.value>t.value?1:0};function Dx(e,t,r,n){return new te(R.negint,-1-Zr(e,t+1,n),2)}function Vx(e,t,r,n){return new te(R.negint,-1-Qr(e,t+1,n),3)}function Fx(e,t,r,n){return new te(R.negint,-1-Yr(e,t+1,n),5)}var eu=BigInt(-1),yd=BigInt(1);function Gx(e,t,r,n){let i=en(e,t+1,n);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new te(R.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${ye} integers outside of the safe integer range are not supported`);return new te(R.negint,eu-BigInt(i),9)}function tu(e,t){let r=t.value,n=typeof r=="bigint"?r*eu-yd:r*-1-1;$t(e,t.type.majorEncoded,n)}tu.encodedSize=function(e){let t=e.value,r=typeof t=="bigint"?t*eu-yd:t*-1-1;return r<Xe[0]?1:r<Xe[1]?2:r<Xe[2]?3:r<Xe[3]?5:9};tu.compareTokens=function(e,t){return e.value<t.value?1:e.value>t.value?-1:0};function ki(e,t,r,n){Mn(e,t,r+n);let i=Ys(e,t+r,t+r+n);return new te(R.bytes,i,r+n)}function zx(e,t,r,n){return ki(e,t,1,r)}function Kx(e,t,r,n){return ki(e,t,2,Zr(e,t+1,n))}function qx(e,t,r,n){return ki(e,t,3,Qr(e,t+1,n))}function Wx(e,t,r,n){return ki(e,t,5,Yr(e,t+1,n))}function Hx(e,t,r,n){let i=en(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer bytes lengths not supported`);return ki(e,t,9,i)}function So(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===R.string?dd(e.value):e.value),e.encodedBytes}function oa(e,t){let r=So(t);$t(e,t.type.majorEncoded,r.length),e.push(r)}oa.encodedSize=function(e){let t=So(e);return $t.encodedSize(t.length)+t.length};oa.compareTokens=function(e,t){return Jx(So(e),So(t))};function Jx(e,t){return e.length<t.length?-1:e.length>t.length?1:Ux(e,t)}function Pi(e,t,r,n,i){let o=r+n;Mn(e,t,o);let a=new te(R.string,kx(e,t+r,t+o),o);return i.retainStringBytes===!0&&(a.byteValue=Ys(e,t+r,t+o)),a}function Xx(e,t,r,n){return Pi(e,t,1,r,n)}function Zx(e,t,r,n){return Pi(e,t,2,Zr(e,t+1,n),n)}function Qx(e,t,r,n){return Pi(e,t,3,Qr(e,t+1,n),n)}function Yx(e,t,r,n){return Pi(e,t,5,Yr(e,t+1,n),n)}function eE(e,t,r,n){let i=en(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer string lengths not supported`);return Pi(e,t,9,i,n)}var tE=oa;function Cn(e,t,r,n){return new te(R.array,n,r)}function rE(e,t,r,n){return Cn(e,t,1,r)}function nE(e,t,r,n){return Cn(e,t,2,Zr(e,t+1,n))}function iE(e,t,r,n){return Cn(e,t,3,Qr(e,t+1,n))}function oE(e,t,r,n){return Cn(e,t,5,Yr(e,t+1,n))}function aE(e,t,r,n){let i=en(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer array lengths not supported`);return Cn(e,t,9,i)}function sE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return Cn(e,t,1,1/0)}function ru(e,t){$t(e,R.array.majorEncoded,t.value)}ru.compareTokens=tn.compareTokens;ru.encodedSize=function(e){return $t.encodedSize(e.value)};function Ln(e,t,r,n){return new te(R.map,n,r)}function uE(e,t,r,n){return Ln(e,t,1,r)}function lE(e,t,r,n){return Ln(e,t,2,Zr(e,t+1,n))}function cE(e,t,r,n){return Ln(e,t,3,Qr(e,t+1,n))}function fE(e,t,r,n){return Ln(e,t,5,Yr(e,t+1,n))}function dE(e,t,r,n){let i=en(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer map lengths not supported`);return Ln(e,t,9,i)}function pE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return Ln(e,t,1,1/0)}function nu(e,t){$t(e,R.map.majorEncoded,t.value)}nu.compareTokens=tn.compareTokens;nu.encodedSize=function(e){return $t.encodedSize(e.value)};function hE(e,t,r,n){return new te(R.tag,r,1)}function yE(e,t,r,n){return new te(R.tag,Zr(e,t+1,n),2)}function mE(e,t,r,n){return new te(R.tag,Qr(e,t+1,n),3)}function gE(e,t,r,n){return new te(R.tag,Yr(e,t+1,n),5)}function vE(e,t,r,n){return new te(R.tag,en(e,t+1,n),9)}function iu(e,t){$t(e,R.tag.majorEncoded,t.value)}iu.compareTokens=tn.compareTokens;iu.encodedSize=function(e){return $t.encodedSize(e.value)};var bE=20,wE=21,_E=22,TE=23;function OE(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${ye} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new te(R.null,null,1):new te(R.undefined,void 0,1)}function xE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return new te(R.break,void 0,1)}function ou(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${ye} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${ye} Infinity values are not supported`)}return new te(R.float,e,t)}function EE(e,t,r,n){return ou(su(e,t+1),3,n)}function AE(e,t,r,n){return ou(uu(e,t+1),5,n)}function IE(e,t,r,n){return ou(bd(e,t+1),9,n)}function au(e,t,r){let n=t.value;if(n===!1)e.push([R.float.majorEncoded|bE]);else if(n===!0)e.push([R.float.majorEncoded|wE]);else if(n===null)e.push([R.float.majorEncoded|_E]);else if(n===void 0)e.push([R.float.majorEncoded|TE]);else{let i,o=!1;(!r||r.float64!==!0)&&(gd(n),i=su(Nt,1),n===i||Number.isNaN(n)?(Nt[0]=249,e.push(Nt.slice(0,3)),o=!0):(vd(n),i=uu(Nt,1),n===i&&(Nt[0]=250,e.push(Nt.slice(0,5)),o=!0))),o||(SE(n),i=bd(Nt,1),Nt[0]=251,e.push(Nt.slice(0,9)))}}au.encodedSize=function(e,t){let r=e.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!t||t.float64!==!0){gd(r);let n=su(Nt,1);if(r===n||Number.isNaN(r))return 3;if(vd(r),n=uu(Nt,1),r===n)return 5}return 9};var md=new ArrayBuffer(9),gt=new DataView(md,1),Nt=new Uint8Array(md,0);function gd(e){if(e===1/0)gt.setUint16(0,31744,!1);else if(e===-1/0)gt.setUint16(0,64512,!1);else if(Number.isNaN(e))gt.setUint16(0,32256,!1);else{gt.setFloat32(0,e);let t=gt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)gt.setUint16(0,31744,!1);else if(r===0)gt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?gt.setUint16(0,0):i<-14?gt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):gt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function su(e,t){if(e.length-t<2)throw new Error(`${ye} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,o;return n===0?o=i*2**-24:n!==31?o=(i+1024)*2**(n-25):o=i===0?1/0:NaN,r&32768?-o:o}function vd(e){gt.setFloat32(0,e,!1)}function uu(e,t){if(e.length-t<4)throw new Error(`${ye} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function SE(e){gt.setFloat64(0,e,!1)}function bd(e,t){if(e.length-t<8)throw new Error(`${ye} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}au.compareTokens=tn.compareTokens;function Ie(e,t,r){throw new Error(`${ye} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function aa(e){return()=>{throw new Error(`${ye} ${e}`)}}var se=[];for(let e=0;e<=23;e++)se[e]=Ie;se[24]=Bx;se[25]=Mx;se[26]=Cx;se[27]=Lx;se[28]=Ie;se[29]=Ie;se[30]=Ie;se[31]=Ie;for(let e=32;e<=55;e++)se[e]=Ie;se[56]=Dx;se[57]=Vx;se[58]=Fx;se[59]=Gx;se[60]=Ie;se[61]=Ie;se[62]=Ie;se[63]=Ie;for(let e=64;e<=87;e++)se[e]=zx;se[88]=Kx;se[89]=qx;se[90]=Wx;se[91]=Hx;se[92]=Ie;se[93]=Ie;se[94]=Ie;se[95]=aa("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)se[e]=Xx;se[120]=Zx;se[121]=Qx;se[122]=Yx;se[123]=eE;se[124]=Ie;se[125]=Ie;se[126]=Ie;se[127]=aa("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)se[e]=rE;se[152]=nE;se[153]=iE;se[154]=oE;se[155]=aE;se[156]=Ie;se[157]=Ie;se[158]=Ie;se[159]=sE;for(let e=160;e<=183;e++)se[e]=uE;se[184]=lE;se[185]=cE;se[186]=fE;se[187]=dE;se[188]=Ie;se[189]=Ie;se[190]=Ie;se[191]=pE;for(let e=192;e<=215;e++)se[e]=hE;se[216]=yE;se[217]=mE;se[218]=gE;se[219]=vE;se[220]=Ie;se[221]=Ie;se[222]=Ie;se[223]=Ie;for(let e=224;e<=243;e++)se[e]=aa("simple values are not supported");se[244]=Ie;se[245]=Ie;se[246]=Ie;se[247]=OE;se[248]=aa("simple values are not supported");se[249]=EE;se[250]=AE;se[251]=IE;se[252]=Ie;se[253]=Ie;se[254]=Ie;se[255]=xE;var Zt=[];for(let e=0;e<24;e++)Zt[e]=new te(R.uint,e,1);for(let e=-1;e>=-24;e--)Zt[31-e]=new te(R.negint,e,1);Zt[64]=new te(R.bytes,new Uint8Array(0),1);Zt[96]=new te(R.string,"",1);Zt[128]=new te(R.array,0,1);Zt[160]=new te(R.map,0,1);Zt[244]=new te(R.false,!1,1);Zt[245]=new te(R.true,!0,1);Zt[246]=new te(R.null,null,1);function wd(){let e=[];return e[R.uint.major]=tn,e[R.negint.major]=tu,e[R.bytes.major]=oa,e[R.string.major]=tE,e[R.array.major]=ru,e[R.map.major]=nu,e[R.tag.major]=iu,e[R.float.major]=au,e}var LI=wd(),Pa=new hd,Gl=class _d{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${Br} object contains circular references`);return new _d(r,t)}},fr={null:new te(R.null,null),undefined:new te(R.undefined,void 0),true:new te(R.true,!0),false:new te(R.false,!1),emptyArray:new te(R.array,0),emptyMap:new te(R.map,0)},Or={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new te(R.float,e):e>=0?new te(R.uint,e):new te(R.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new te(R.uint,e):new te(R.negint,e)},Uint8Array(e,t,r,n){return new te(R.bytes,e)},string(e,t,r,n){return new te(R.string,e)},boolean(e,t,r,n){return e?fr.true:fr.false},null(e,t,r,n){return fr.null},undefined(e,t,r,n){return fr.undefined},ArrayBuffer(e,t,r,n){return new te(R.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new te(R.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[fr.emptyArray,new te(R.break)]:fr.emptyArray;n=Gl.createCheck(n,e);let i=[],o=0;for(let a of e)i[o++]=Hi(a,r,n);return r.addBreakTokens?[new te(R.array,e.length),i,new te(R.break)]:[new te(R.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",o=i?e.keys():Object.keys(e),a=i?e.size:o.length;if(!a)return r.addBreakTokens===!0?[fr.emptyMap,new te(R.break)]:fr.emptyMap;n=Gl.createCheck(n,e);let s=[],u=0;for(let c of o)s[u++]=[Hi(c,r,n),Hi(i?e.get(c):e[c],r,n)];return jE(s,r),r.addBreakTokens?[new te(R.map,a),s,new te(R.break)]:[new te(R.map,a),s]}};Or.Map=Or.Object;Or.Buffer=Or.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Or[`${e}Array`]=Or.DataView;function Hi(e,t={},r){let n=Ax(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||Or[n];if(typeof i=="function"){let a=i(e,n,t,r);if(a!=null)return a}let o=Or[n];if(!o)throw new Error(`${Br} unsupported type: ${n}`);return o(e,n,t,r)}function jE(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Td(e,t,r,n){if(Array.isArray(t))for(let i of t)Td(e,i,r,n);else r[t.type.major](e,t,n)}function $E(e,t,r){let n=Hi(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let i=r.quickEncodeToken(n);if(i)return i;let o=t[n.type.major];if(o.encodedSize){let a=o.encodedSize(n,r),s=new hd(a);if(o(s,n,r),s.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return Qs(s.chunks[0])}}return Pa.reset(),Td(Pa,n,t,r),Pa.toBytes(!0)}var kE={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},PE=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=Zt[e];if(t===void 0){let r=se[e];if(!r)throw new Error(`${ye} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let n=e&31;t=r(this.data,this._pos,n,this.options)}return this._pos+=t.encodedLength,t}},hi=Symbol.for("DONE"),sa=Symbol.for("BREAK");function NE(e,t,r){let n=[];for(let i=0;i<e.value;i++){let o=yi(t,r);if(o===sa){if(e.value===1/0)break;throw new Error(`${ye} got unexpected break to lengthed array`)}if(o===hi)throw new Error(`${ye} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=o}return n}function UE(e,t,r){let n=r.useMaps===!0,i=n?void 0:{},o=n?new Map:void 0;for(let a=0;a<e.value;a++){let s=yi(t,r);if(s===sa){if(e.value===1/0)break;throw new Error(`${ye} got unexpected break to lengthed map`)}if(s===hi)throw new Error(`${ye} found map but not enough entries (got ${a} [no key], expected ${e.value})`);if(n!==!0&&typeof s!="string")throw new Error(`${ye} non-string keys not supported (got ${typeof s})`);if(r.rejectDuplicateMapKeys===!0&&(n&&o.has(s)||!n&&s in i))throw new Error(`${ye} found repeat map key "${s}"`);let u=yi(t,r);if(u===hi)throw new Error(`${ye} found map but not enough entries (got ${a} [no value], expected ${e.value})`);n?o.set(s,u):i[s]=u}return n?o:i}function yi(e,t){if(e.done())return hi;let r=e.next();if(r.type===R.break)return sa;if(r.type.terminal)return r.value;if(r.type===R.array)return NE(r,e,t);if(r.type===R.map)return UE(r,e,t);if(r.type===R.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=yi(e,t);return t.tags[r.value](n)}throw new Error(`${ye} tag not supported (${r.value})`)}throw new Error("unsupported")}function RE(e,t){if(!(e instanceof Uint8Array))throw new Error(`${ye} data to decode must be a Uint8Array`);t=Object.assign({},kE,t);let r=t.tokenizer||new PE(e,t),n=yi(r,t);if(n===hi)throw new Error(`${ye} did not find any content to decode`);if(n===sa)throw new Error(`${ye} got unexpected break`);return[n,e.subarray(r.pos())]}function BE(e,t){let[r,n]=RE(e,t);if(n.length>0)throw new Error(`${ye} too many terminals, data makes no sense`);return r}var ME=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===R.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===R.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[R.uint.major](e,t){this.prefix(e);let r=String(t.value),n=[];for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);e.push(n)}[R.negint.major](e,t){this[R.uint.major](e,t)}[R.bytes.major](e,t){throw new Error(`${Br} unsupported type: Uint8Array`)}[R.string.major](e,t){this.prefix(e);let r=dd(JSON.stringify(t.value));e.push(r.length>32?Qs(r):r)}[R.array.major](e,t){this.prefix(e),this.inRecursive.push({type:R.array,elements:0}),e.push([91])}[R.map.major](e,t){this.prefix(e),this.inRecursive.push({type:R.map,elements:0}),e.push([123])}[R.tag.major](e,t){}[R.float.major](e,t){if(t.type.name==="break"){let o=this.inRecursive.pop();if(o){if(o.type===R.array)e.push([93]);else if(o.type===R.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(`${Br} 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 r=String(t.value),n=[],i=!1;for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o),!i&&(n[o]===46||n[o]===101||n[o]===69)&&(i=!0);i||(n.push(46),n.push(48)),e.push(n)}};function CE(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${Br} complex map keys are not supported`);let r=e[0],n=t[0];if(r.type!==R.string||n.type!==R.string)throw new Error(`${Br} non-string map keys are not supported`);if(r<n)return-1;if(r>n)return 1;throw new Error(`${Br} unexpected duplicate map keys, this is not supported`)}var LE={addBreakTokens:!0,mapSorter:CE};function DE(e,t){return t=Object.assign({},LE,t),$E(e,new ME,t)}var Od=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(`${ye} 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(`${ye} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,r=!1,n=a=>{for(;!this.done();){let s=this.ch();if(a.includes(s))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,r=!0;else return new te(R.uint,0,this._pos-e);if(n([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${ye} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(r)throw new Error(`${ye} unexpected token at position ${this._pos}`);r=!0,this._pos++,n([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(r=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,n([48,49,50,51,52,53,54,55,56,57]));let i=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),o=parseFloat(i);return r?new te(R.float,o,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(o)?new te(o>=0?R.uint:R.negint,o,this._pos-e):new te(o>=0?R.uint:R.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${ye} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,o=0;i<this.data.length&&o<65536;i++,o++){let a=this.data[i];if(a===92||a<32||a>=128)break;if(a===34){let s=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new te(R.string,s,o)}}let e=this._pos,t=[],r=()=>{if(this._pos+4>=this.data.length)throw new Error(`${ye} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let o=0;o<4;o++){let a=this.ch();if(a>=48&&a<=57)a-=48;else if(a>=97&&a<=102)a=a-97+10;else if(a>=65&&a<=70)a=a-65+10;else throw new Error(`${ye} unexpected unicode escape character at position ${this._pos}`);i=i*16+a,this._pos++}return i},n=()=>{let i=this.ch(),o=null,a=i>239?4:i>223?3:i>191?2:1;if(this._pos+a>this.data.length)throw new Error(`${ye} unexpected unicode sequence at position ${this._pos}`);let s,u,c,f;switch(a){case 1:i<128&&(o=i);break;case 2:s=this.data[this._pos+1],(s&192)===128&&(f=(i&31)<<6|s&63,f>127&&(o=f));break;case 3:s=this.data[this._pos+1],u=this.data[this._pos+2],(s&192)===128&&(u&192)===128&&(f=(i&15)<<12|(s&63)<<6|u&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:s=this.data[this._pos+1],u=this.data[this._pos+2],c=this.data[this._pos+3],(s&192)===128&&(u&192)===128&&(c&192)===128&&(f=(i&15)<<18|(s&63)<<12|(u&63)<<6|c&63,f>65535&&f<1114112&&(o=f))}o===null?(o=65533,a=1):o>65535&&(o-=65536,t.push(o>>>10&1023|55296),o=56320|o&1023),t.push(o),this._pos+=a};for(;!this.done();){let i=this.ch(),o;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${ye} unexpected string termination at position ${this._pos}`);switch(o=this.ch(),this._pos++,o){case 34:case 39:case 92:case 47:t.push(o);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(r());break;default:throw new Error(`${ye} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new te(R.string,pd(t),this._pos-e);default:if(i<32)throw new Error(`${ye} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):n()}}throw new Error(`${ye} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new te(R.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new te(R.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new te(R.null,null,4);case 102:return this.expect([102,97,108,115,101]),new te(R.false,!1,5);case 116:return this.expect([116,114,117,101]),new te(R.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(`${ye} 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 te(R.break,void 0,1);if(this.ch()!==44)throw new Error(`${ye} 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 te(R.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 te(R.break,void 0,1);if(this.ch()!==44)throw new Error(`${ye} 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 te(R.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${ye} 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(`${ye} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function VE(e,t){return t=Object.assign({tokenizer:new Od(e,t)},t),BE(e,t)}var DI=new Uint8Array(0);function FE(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}function lu(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 GE(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),a=o.charCodeAt(0);if(r[a]!==255)throw new TypeError(o+" is ambiguous");r[a]=i}var s=e.length,u=e.charAt(0),c=Math.log(s)/Math.log(256),f=Math.log(256)/Math.log(s);function p(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var z=0,Y=0,V=0,M=I.length;V!==M&&I[V]===0;)V++,z++;for(var F=(M-V)*f+1>>>0,W=new Uint8Array(F);V!==M;){for(var D=I[V],re=0,K=F-1;(D!==0||re<Y)&&K!==-1;K--,re++)D+=256*W[K]>>>0,W[K]=D%s>>>0,D=D/s>>>0;if(D!==0)throw new Error("Non-zero carry");Y=re,V++}for(var fe=F-Y;fe!==F&&W[fe]===0;)fe++;for(var U=u.repeat(z);fe<F;++fe)U+=e.charAt(W[fe]);return U}function S(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var z=0;if(I[z]!==" "){for(var Y=0,V=0;I[z]===u;)Y++,z++;for(var M=(I.length-z)*c+1>>>0,F=new Uint8Array(M);I[z];){var W=r[I.charCodeAt(z)];if(W===255)return;for(var D=0,re=M-1;(W!==0||D<V)&&re!==-1;re--,D++)W+=s*F[re]>>>0,F[re]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");V=D,z++}if(I[z]!==" "){for(var K=M-V;K!==M&&F[K]===0;)K++;for(var fe=new Uint8Array(Y+(M-K)),U=Y;K!==M;)fe[U++]=F[K++];return fe}}}function T(I){var z=S(I);if(z)return z;throw new Error(`Non-${t} character`)}return{encode:p,decodeUnsafe:S,decode:T}}var zE=GE,KE=zE,qE=KE,WE=class{name;prefix;baseEncode;constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},HE=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){this.name=e,this.prefix=t;let n=t.codePointAt(0);if(n===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n,this.baseDecode=r}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 xd(this,e)}},JE=class{decoders;constructor(e){this.decoders=e}or(e){return xd(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function xd(e,t){return new JE({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var XE=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new WE(e,t,r),this.decoder=new HE(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Ed({name:e,prefix:t,encode:r,decode:n}){return new XE(e,t,r,n)}function ua({name:e,prefix:t,alphabet:r}){let{encode:n,decode:i}=qE(r,e);return Ed({prefix:t,name:e,encode:n,decode:o=>lu(i(o))})}function ZE(e,t,r,n){let i=e.length;for(;e[i-1]==="=";)--i;let o=new Uint8Array(i*r/8|0),a=0,s=0,u=0;for(let c=0;c<i;++c){let f=t[e[c]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);s=s<<r|f,a+=r,a>=8&&(a-=8,o[u++]=255&s>>a)}if(a>=r||255&s<<8-a)throw new SyntaxError("Unexpected end of data");return o}function QE(e,t,r){let n=t[t.length-1]==="=",i=(1<<r)-1,o="",a=0,s=0;for(let u=0;u<e.length;++u)for(s=s<<8|e[u],a+=8;a>r;)a-=r,o+=t[i&s>>a];if(a!==0&&(o+=t[i&s<<r-a]),n)for(;o.length*r&7;)o+="=";return o}function YE(e){let t={};for(let r=0;r<e.length;++r)t[e[r]]=r;return t}function ht({name:e,prefix:t,bitsPerChar:r,alphabet:n}){let i=YE(n);return Ed({prefix:t,name:e,encode(o){return QE(o,n,r)},decode(o){return ZE(o,i,r,e)}})}var Ji=ht({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),VI=ht({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),FI=ht({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),GI=ht({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),zI=ht({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),KI=ht({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),qI=ht({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),WI=ht({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),HI=ht({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Xi=ua({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),JI=ua({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),yr=ua({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),XI=ua({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Ad={};vf(Ad,{Digest:()=>la,create:()=>cu,decode:()=>Sd,equals:()=>jd,hasCode:()=>vA});var eA=Id,zl=128,tA=127,rA=~tA,nA=Math.pow(2,31);function Id(e,t,r){t=t||[],r=r||0;for(var n=r;e>=nA;)t[r++]=e&255|zl,e/=128;for(;e&rA;)t[r++]=e&255|zl,e>>>=7;return t[r]=e|0,Id.bytes=r-n+1,t}var iA=rs,oA=128,Kl=127;function rs(e,n){var r=0,n=n||0,i=0,o=n,a,s=e.length;do{if(o>=s)throw rs.bytes=0,new RangeError("Could not decode varint");a=e[o++],r+=i<28?(a&Kl)<<i:(a&Kl)*Math.pow(2,i),i+=7}while(a>=oA);return rs.bytes=o-n,r}var aA=Math.pow(2,7),sA=Math.pow(2,14),uA=Math.pow(2,21),lA=Math.pow(2,28),cA=Math.pow(2,35),fA=Math.pow(2,42),dA=Math.pow(2,49),pA=Math.pow(2,56),hA=Math.pow(2,63),yA=function(e){return e<aA?1:e<sA?2:e<uA?3:e<lA?4:e<cA?5:e<fA?6:e<dA?7:e<pA?8:e<hA?9:10},mA={encode:eA,decode:iA,encodingLength:yA},gA=mA,jo=gA;function ns(e,t=0){return[jo.decode(e,t),jo.decode.bytes]}function $o(e,t,r=0){return jo.encode(e,t,r),t}function ko(e){return jo.encodingLength(e)}function cu(e,t){let r=t.byteLength,n=ko(e),i=n+ko(r),o=new Uint8Array(i+r);return $o(e,o,0),$o(r,o,n),o.set(t,i),new la(e,r,t,o)}function Sd(e){let t=lu(e),[r,n]=ns(t),[i,o]=ns(t.subarray(n)),a=t.subarray(n+o);if(a.byteLength!==i)throw new Error("Incorrect length");return new la(r,i,a,t)}function jd(e,t){if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&FE(e.bytes,r.bytes)}}var la=class{code;size;digest;bytes;constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}};function vA(e,t){return e.code===t}function ql(e,t){let{bytes:r,version:n}=e;switch(n){case 0:return wA(r,is(e),t??yr.encoder);default:return _A(r,is(e),t??Ji.encoder)}}var Wl=new WeakMap;function is(e){let t=Wl.get(e);if(t==null){let r=new Map;return Wl.set(e,r),r}return t}var ft=class et{code;version;multihash;bytes;"/";constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,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:r}=this;if(t!==qn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==TA)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return et.createV0(r)}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:r}=this.multihash,n=cu(t,r);return et.createV1(this.code,n)}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 et.equals(this,t)}static equals(t,r){let n=r;return n!=null&&t.code===n.code&&t.version===n.version&&jd(t.multihash,n.multihash)}toString(t){return ql(this,t)}toJSON(){return{"/":ql(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 r=t;if(r instanceof et)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:o,bytes:a}=r;return new et(n,i,o,a??Hl(n,i,o.bytes))}else if(r[OA]===!0){let{version:n,multihash:i,code:o}=r,a=Sd(i);return et.create(n,o,a)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==qn)throw new Error(`Version 0 CID must use dag-pb (code: ${qn}) block encoding`);return new et(t,r,n,n.bytes)}case 1:{let i=Hl(t,r,n.bytes);return new et(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return et.create(0,qn,t)}static createV1(t,r){return et.create(1,t,r)}static decode(t){let[r,n]=et.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=et.inspectBytes(t),n=r.size-r.multihashSize,i=lu(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=i.subarray(r.multihashSize-r.digestSize),a=new la(r.multihashCode,r.digestSize,o,i);return[r.version===0?et.createV0(a):et.createV1(r.codec,a),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[p,S]=ns(t.subarray(r));return r+=S,p},i=n(),o=qn;if(i===18?(i=0,r=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let a=r,s=n(),u=n(),c=r+u,f=c-a;return{version:i,codec:o,multihashCode:s,digestSize:u,multihashSize:f,size:c}}static parse(t,r){let[n,i]=bA(t,r),o=et.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return is(o).set(n,t),o}};function bA(e,t){switch(e[0]){case"Q":{let r=t??yr;return[yr.prefix,r.decode(`${yr.prefix}${e}`)]}case yr.prefix:{let r=t??yr;return[yr.prefix,r.decode(e)]}case Ji.prefix:{let r=t??Ji;return[Ji.prefix,r.decode(e)]}case Xi.prefix:{let r=t??Xi;return[Xi.prefix,r.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 wA(e,t,r){let{prefix:n}=r;if(n!==yr.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let o=r.encode(e).slice(1);return t.set(n,o),o}else return i}function _A(e,t,r){let{prefix:n}=r,i=t.get(n);if(i==null){let o=r.encode(e);return t.set(n,o),o}else return i}var qn=112,TA=18;function Hl(e,t,r){let n=ko(e),i=n+ko(t),o=new Uint8Array(i+r.byteLength);return $o(e,o,0),$o(t,o,n),o.set(r,i),o}var OA=Symbol.for("@ipld/js-cid/CID"),xA=20;function $d({name:e,code:t,encode:r,minDigestLength:n,maxDigestLength:i}){return new EA(e,t,r,n,i)}var EA=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,r,n,i){this.name=e,this.code=t,this.encode=r,this.minDigestLength=n??xA,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 r=this.encode(e);return r instanceof Uint8Array?Jl(r,this.code,t?.truncate):r.then(n=>Jl(n,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function Jl(e,t,r){if(r!=null&&r!==e.byteLength){if(r>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,r)}return cu(t,e)}var kd=ht({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ZI=ht({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),QI=ht({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),YI=ht({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function AA(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function IA(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=ft.asCID(e);if(!t)return null;let r=t.toString();return[new te(R.map,1/0,1),new te(R.string,"/",1),new te(R.string,r,r.length),new te(R.break,void 0,1)]}function Po(e){let t=kd.encode(e).slice(1);return[new te(R.map,1/0,1),new te(R.string,"/",1),new te(R.map,1/0,1),new te(R.string,"bytes",5),new te(R.string,t,t.length),new te(R.break,void 0,1),new te(R.break,void 0,1)]}function kt(e){return Po(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function SA(e){return Po(new Uint8Array(e))}function jA(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function $A(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 kA={typeEncoders:{Object:IA,Buffer:Po,Uint8Array:Po,Int8Array:kt,Uint16Array:kt,Int16Array:kt,Uint32Array:kt,Int32Array:kt,Float32Array:kt,Float64Array:kt,Uint8ClampedArray:kt,BigInt64Array:kt,BigUint64Array:kt,DataView:kt,ArrayBuffer:SA,undefined:jA,number:$A}},PA=class extends Od{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===R.map){let t=this._next();if(t.type===R.string&&t.value==="/"){let r=this._next();if(r.type===R.string){if(this._next().type!==R.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(r),new te(R.tag,42,0)}if(r.type===R.map){let n=this._next();if(n.type===R.string&&n.value==="bytes"){let i=this._next();if(i.type===R.string){for(let a=0;a<2;a++)if(this._next().type!==R.break)throw new Error("Invalid encoded Bytes form");let o=kd.decode(`m${i.value}`);return new te(R.bytes,o,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(r)}this.tokenBuffer.push(t)}return e}},os={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};os.tags[42]=ft.parse;var NA="dag-json",Pd=297,fu=e=>DE(e,kA),du=e=>{let t=AA(e),r=Object.assign(os,{tokenizer:new PA(t,os)});return VE(t,r)},Xl=e=>UA.decode(fu(e)),UA=new TextDecoder,RA=e=>du(BA.encode(e)),BA=new TextEncoder;function MA(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Nd(e,t,r=""){let n=MA(e),i=e?.length,o=t!==void 0;if(!n||o&&i!==t){let a=r&&`"${r}" `,s=o?` of length ${t}`:"",u=n?`length=${i}`:`type=${typeof e}`;throw new Error(a+"expected Uint8Array"+s+", got "+u)}return e}function Zl(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function CA(e,t){Nd(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw new Error('"digestInto() output" expected to be of length >='+r)}function as(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Na(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Gt(e,t){return e<<32-t|e>>>t}function LA(e,t={}){let r=(i,o)=>e(o).update(i).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.create=i=>e(i),Object.assign(r,t),Object.freeze(r)}var DA=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function VA(e,t,r){return e&t^~e&r}function FA(e,t,r){return e&t^e&r^t&r}var GA=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=Na(this.buffer)}update(e){Zl(this),Nd(e);let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let o=0;o<i;){let a=Math.min(n-this.pos,i-o);if(a===n){let s=Na(e);for(;n<=i-o;o+=n)this.process(s,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Zl(this),CA(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;t[o++]=128,as(this.buffer.subarray(o)),this.padOffset>n-o&&(this.process(r,0),o=0);for(let f=o;f<n;f++)t[f]=0;r.setBigUint64(n-8,BigInt(this.length*8),i),this.process(r,0);let a=Na(e),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let u=s/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,c[f],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=i,e.length=n,e.pos=a,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}},dr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),zA=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),pr=new Uint32Array(64),KA=class extends GA{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:r,D:n,E:i,F:o,G:a,H:s}=this;return[e,t,r,n,i,o,a,s]}set(e,t,r,n,i,o,a,s){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=s|0}process(e,t){for(let f=0;f<16;f++,t+=4)pr[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){let p=pr[f-15],S=pr[f-2],T=Gt(p,7)^Gt(p,18)^p>>>3,I=Gt(S,17)^Gt(S,19)^S>>>10;pr[f]=I+pr[f-7]+T+pr[f-16]|0}let{A:r,B:n,C:i,D:o,E:a,F:s,G:u,H:c}=this;for(let f=0;f<64;f++){let p=Gt(a,6)^Gt(a,11)^Gt(a,25),S=c+p+VA(a,s,u)+zA[f]+pr[f]|0,T=(Gt(r,2)^Gt(r,13)^Gt(r,22))+FA(r,n,i)|0;c=u,u=s,s=a,a=o+S|0,o=i,i=n,n=r,r=S+T|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,s=s+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,n,i,o,a,s,u,c)}roundClean(){as(pr)}destroy(){this.set(0,0,0,0,0,0,0,0),as(this.buffer)}},qA=class extends KA{A=dr[0]|0;B=dr[1]|0;C=dr[2]|0;D=dr[3]|0;E=dr[4]|0;F=dr[5]|0;G=dr[6]|0;H=dr[7]|0;constructor(){super(32)}},WA=LA(()=>new qA,DA(1)),We=sr(Ar(),1),Ud=sr(uv(),1),Ql=e=>We.Type.Union([e,We.Type.Null()]),Rd=/^(k51qz|baguq)[0-9a-z]{56,57}$/,HA=/^[0-9A-Fa-f]{7,8}$/g;We.FormatRegistry.Set("EntityID",e=>!!e.match(HA)||!!e.match(Rd));var JA=We.Type.String(),ss=e=>e?.enc instanceof Uint8Array;We.FormatRegistry.Set("CID",e=>!!e.match(Rd));var Bd=We.Type.String({format:"CID"}),XA=/^http([s]?):\/\/.*\..*/;We.FormatRegistry.Set("URL",e=>!!e.match(XA));var eS=We.Type.String({format:"URL"}),Md=We.Type.Object({en:JA,at:We.Type.String(),vl:Ql(We.Type.Union([We.Type.String(),We.Type.Boolean(),We.Type.Number()])),ts:We.Type.String(),ag:We.Type.String(),pv:Ql(Bd)}),Yl=Ud.TypeCompiler.Compile(Md),tS=Yl.Check.bind(Yl),ZA=We.Type.Composite([We.Type.Object({cid:Bd}),Md]),us=Ud.TypeCompiler.Compile(ZA),QA=e=>Array.from(us.Errors(e)),Cd=us.Check.bind(us);function Ld(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var YA=$d({name:"sha2-256",code:18,encode:Ld("SHA-256")}),rS=$d({name:"sha2-512",code:19,encode:Ld("SHA-512")}),{WARN:ec,LOG:nS,DEBUG:e2,VERBOSE:No,ERROR:t2}=je.setup(je.INFO),r2=114;function n2(e,t=["cid"]){if(!e)throw t2("falsy log",e);let r=e.cid;if(ss(e))return r||(r=pu(Dd(e).bytes).toString()),ec("preparing an encrypted applog - really?"),{log:e,cid:r};let n={};for(let[i,o]of Object.entries(e))o===void 0&&(ec(`log.${i} is undefined, which is not allowed - encoding as null`,e),o=null),t.includes(i)?No("excluding app log",{key:i,val:o}):n[i]=o;return{log:n,cid:r}}function i2(e){return pu(o2(e).bytes)}function o2(e){return Dd(n2(e)?.log)}function pu(e){let t=WA(e),r=Ad.create(YA.code,t),n=ft.create(1,Pd,r);return No("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function Dd(e){e2("[encodeBlock]",e);let t=fu(e);return{bytes:t,cid:pu(t)}}function a2(e){let t=null,r=[];try{t=ft.parse(e)}catch(n){No("[retrieveThread] couldn't parse pubID with default base"),r.push(n)}if(!t)try{t=ft.parse(e,Xi)}catch(n){No("[retrieveThread] couldn't parse pubID with base36"),r.push(n)}return{cid:t,errors:t?null:r,isIpns:t&&hu(t)}}function hu(e){return e.code===r2}function ls(e){return typeof e=="string"?ft.parse(e):typeof e.toV1!="function"?ft.decode(e.bytes):e}function yu(e,t){if(!e||!t)throw new Error(`[areCidsEqual] invalid params: ${e}, ${t}`);if(e===t)return!0;let r=ls(e),n=ls(t);return r.toV1().toString()===n.toV1().toString()}function s2(e,t){return e instanceof Set?e.has(typeof t=="string"?t:t.toV1().toString()):e.some(r=>yu(r,t))}function tc(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function u2(e,t){let r=tc(e),n=tc(t);return+r<+n}var{WARN:iS,LOG:oS,DEBUG:aS,VERBOSE:l2,ERROR:rc}=je.setup(je.INFO),c2=(e,t,r="asc")=>r==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),Vd=(e,t,r)=>Fe.structural(Ml(t,e),Ml(r,e)),f2=(e,t,r="asc")=>c2(e.ts,t.ts,r),sS=ex(Vd,["en","at"]);function mi(e,t="asc"){return e.sort((r,n)=>f2(r,n,t))}var d2=(e,t)=>u2(new Date(e.ts),new Date(t.ts)),Fd=e=>{let t=new Map;for(let r of e){if(!r)throw rc("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!r.cid)throw rc("applog with missing CID",r),new Error("applog with missing CID");let n=r.cid;t.has(n)?l2("Skipping duplicate applog:",[t.get(n),r]):t.set(n,r)}return Array.from(t.values())};function p2(e){return typeof e=="string"&&e.startsWith("?")}function h2(e){return e.slice(1)}function Gd(e,t){let r={},n={};for(let[i,o]of Object.entries(e))if(p2(o)){let a=h2(o),s=t[a];s?n[i]=s:r[i]=a}else n[i]=o;return[n,r]}function y2(e,t,r){let n;if(t){let i=typeof t;i==="string"?n=t===r:i==="function"?n=t(r):typeof t.has=="function"?n=t.has(r):Array.isArray(t)&&!Array.isArray(r)?n=t.includes(r):n=t===r}else n=t===r;return e.charAt(0)==="!"?!n:n}var zd=function(e){for(var t=0,r=0,n=e.length;r<n;r++)t+=e[r];return t},nc=function(e){return zd(e)/e.length},vt={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return vt.max(e)-vt.min(e)},midrange:function(e){return vt.range(e)/2},sum:zd,mean:nc,average:nc,median:function(e){e.sort(function(r,n){return r-n});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={},r=0,n=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>r?(n=[i],r=t[i]):t[i]===r&&(n.push(i),r=t[i])}),n},variance:function(e){var t=vt.mean(e);return vt.mean(e.map(function(r){return Math.pow(r-t,2)}))},standardDeviation:function(e){return Math.sqrt(vt.variance(e))},meanAbsoluteDeviation:function(e){var t=vt.mean(e);return vt.mean(e.map(function(r){return Math.abs(r-t)}))},zScores:function(e){var t=vt.mean(e),r=vt.standardDeviation(e);return e.map(function(n){return(n-t)/r})}};vt.average=vt.mean;function Kd(){return new Date().toISOString()}var{WARN:m2,LOG:uS,DEBUG:g2,VERBOSE:lS,ERROR:Uo}=je.setup(je.INFO);function v2(e,t){let r=Kd(),n=t;return e.map(i=>b2(i,{ts:r,threadForPv:n}))}function b2(e,{ts:t,threadForPv:r}={}){let n=T2(e,t??Kd()),i=O2(n,r),o=i2(i).toString();e.cid&&e.cid!==o&&m2("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:o,logWithPv:i});let a={...i,cid:o};if(!Cd(a))throw Uo(`Bogus Applog ${JSON.stringify(a)}`,QA(a));return Object.freeze(a)}function w2(e){return!!e.ts}function _2(e){return!!e.pv}function T2(e,t){return w2(e)?e:{...e,ts:t}}function O2(e,t){if(e.pv!==void 0)return e;if(t){let{en:r,at:n}=e,i=t.findLast(a=>a.en==r&&a.at==n);if(Vd(["en","at","vl","ts","ag"],e,i))throw Uo("[withPvFrom] Same as previous:",{log:e,pv:i,thread:t});let o=(e.pv!==void 0?e.pv:i?.cid)??null;return{...e,pv:o}}else{if(!_2(e))throw Uo("[withPvFrom] no thread and no pv:",e);return e}}function cs(e){let t=()=>(Re(()=>e.length<2&&g2(`joinThreads with count=${e.length}`)),mi(Fd(e.flatMap(i=>{let o=i.applogs;if(!o)throw Uo("falsy applogs of thread",i),new Error("falsy applogs of thread");return o})))),r=Re(()=>t()),n=Ot(function(i,o){return Tr(i)?{init:Re(()=>t())}:{added:i.added.filter(a=>!this.hasApplog(a,!0)),removed:i.removed?.filter(a=>!!this.parents.some(s=>s===o?!1:s.hasApplog(a,!0)))}});return new mu(Re(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],r,n)}var{WARN:ic,LOG:cS,DEBUG:oc,VERBOSE:Nr,ERROR:ac}=je.setup(je.INFO),mu=class qd extends hn{constructor(t,r,n,i,o,a=null){super(t,r,n,o?Be.array([...i],{deep:!1,name:`${t}.array`}):i),this.name=t,this._initialLogs=i,this._eventMapper=o,this._writeMapper=a,An(this,{onParentUpdate:Ot}),o&&this.subscribeToParents()}static mapWrites(t,r,n){return new qd(`${r}<${t.nameAndSizeUntracked}>`,t,t.filters,t._applogs,null,n)}_parentSubscriptions=null;insert(t){let r=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!r))return this.parents.forEach(n=>n.insert(r))}insertRaw(t){let r=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!r))return this.parents.forEach(n=>n.insertRaw(r))}subscribeToParents(){this._parentSubscriptions=new Map;let t=It(()=>{this.parents.length||ic("MappedThread has no parents",this),Nr(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(n=>n.name));let r=new Set([...this._parentSubscriptions.keys()]);for(let n of this.parents){r.delete(n)&&Nr(`[MappedThread: ${this.name}] Skipping re-sub to parent`,n.nameAndSizeUntracked),Nr(`[MappedThread: ${this.name}] sub to new parent`,n.nameAndSizeUntracked);let i=this.onParentUpdate.bind(this,n),o=n.subscribe(i);this._parentSubscriptions.set(n,o)}for(let n of r)Nr(`[MappedThread: ${this.name}] un-subscribing from old parent`,n.nameAndSizeUntracked),this._parentSubscriptions.get(n)(),this._parentSubscriptions.delete(n)})}subscribe(t){return this._parentSubscriptions||this.subscribeToParents(),super.subscribe(t)}triggerRemap(){if(!this._eventMapper)throw ac("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);oc(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&ic(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Re(()=>rr(t.applogs))})})}onParentUpdate(t,r){Nr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,r);let n=this._eventMapper?this._eventMapper(r,t):r;if(this._eventMapper)if(Nr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,n),Tr(n))this._applogs.replace([...n.init]);else{for(let i of n.added)this._applogs.splice(fx(this._applogs,i,"ts"),0,i);if(n.removed){for(let i of n.removed)if(!this._applogs.remove(i))if(!Tr(r)&&r.removed?.includes(i))oc("Ignoring remove event for non-existent because it was part of parent event's removed",i,r);else throw ac(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:r,mapResult:n})}}Nr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Jo(this._applogs)),this.notifySubscribers(n)}get readOnly(){return!1}},{WARN:fS,LOG:dS,DEBUG:pS,VERBOSE:Ua,ERROR:x2}=je.setup(je.INFO),yn=He("rollingFilter",function(e,t,r={}){let n=A2(t),i=sc(n),o=Be.array(Re(function(){return i(e.applogs)}),{deep:!1,name:`${e.name} | ${r.name||`rollingFilter.array{${pi(n)}}`}`}),a=f=>{let p;return Tr(f)?p={init:i(f.init)}:p={added:i(f.added),removed:f.removed},Ua(`rollingFilter{${e.nameAndSizeUntracked} | ${r.name?` '${r.name}'}`:""} parentUpdate`,n,f,"=>",p),p},s=new mu(`${e.name} | ${r.name||`rollingFilter{${pi(n)}}`}`,e,[...e.filters,...r.extraFilterName?[r.extraFilterName]:[]],o,a),u=fg(()=>rr(t),f=>{Ua(`rollingFilter<${e.nameAndSizeUntracked}>${r.name?` '${r.name}'`:""} patternUpdate`,n,"=>",f),n=f,i=sc(n),s.triggerRemap()}),c=En(o,()=>{Ua(`rollingFilter<${Re(()=>e.name)}>${r.name?` '${r.name}'`:""} unobserve`,n),u(),c()});return s},{equals:ji,argsDebugName:(e,t,r)=>Ve({caller:"rollingFilter",thread:e,pattern:t,args:r})}),E2=He("rollingMapper",function(e,t,r={}){let n=Re(()=>t.call(null,{init:e.applogs},e));if(!Tr(n))throw x2("Initial run must return init event");let i=n.init;return new mu(`${e.name} | ${r.name||"rollingMapper"}`,e,[...e.filters,...r.extraFilterName?[r.extraFilterName]:[]],i,t)},{equals:ji,argsDebugName:(e,t,r)=>Ve({caller:"rollingMapper",thread:e,args:r})}),hS=He("rollingAcc",function(e,t,r,n={}){let i=Ot(r);return i({init:e.applogs},t),e.subscribe(o=>{i(o,t)}),t},{argsDebugName:(e,t,r,n)=>`rollingAcc{${e.nameAndSizeUntracked}${n?.name?` | ${n?.name}`:""}}`}),A2=function(e){let t=Re(function(){return Object.fromEntries(Object.entries(rr(e)).map(([r,n])=>[rr(r),rr(n)]))});if(!Object.entries(t).length)throw new Error("Pattern is empty");return t};function sc(e){return function(t){return t.filter(function(r){for(let n of Object.keys(e)){let i=e[n];if(i===void 0)continue;let o=r[n.startsWith("!")?n.slice(1):n];if(!y2(n,i,o))return!1}return!0})}}var{WARN:I2,LOG:S2,DEBUG:j2,VERBOSE:$2,ERROR:Zi}=je.setup(je.INFO),k2=class extends hn{constructor(e,t=[],r){super(e,null,r,t),An(this,{})}purge(e){let t=this.applogs.length;return this._applogs=this.applogs.filter(r=>!e.includes(r.cid)),t-this.applogs.length}insert(e){let t=v2(e,this);return this.insertRaw(t)}insertRaw(e){let t=Fd(e);if(t.length!==e.length)throw Zi(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});let r=e.filter(o=>!Cd(o));if(r.length)throw Zi(`[insertRaw] bogus applogs passed: ${r.length}`,{bogus:r});let n=e.filter(o=>this.hasApplog(o,!1));if(n.length)throw Zi(`[insertRaw] already existing applogs passed: ${n.length}`,{existing:n});if(!e.length){I2("[insertRaw] skipping empty insert empty logs array");return}(!this.hasParents&&!(this instanceof Ni)?S2:j2)("Inserting:",e.length===1?e[0]:e,{ds:this}),mi(e);let i=this._applogs.length&&d2(e[0],this._applogs[this._applogs.length-1]);return this._applogs.push(...e),i&&mi(this._applogs),this.notifySubscribers({added:e,removed:null}),this.persist(e),e}get readOnly(){return!1}},Ni=class Qi extends k2{constructor(t,r,n,i){super(t,r,n),this._readOnly=i,An(this,{_applogs:Be.shallow})}static empty(t){return Qi.fromArray([],t??"empty in-memory",!1)}static fromArray(t,r,n=!1){return new Qi(r??"in-memory",t,[],n)}static fromReadOnlyArray(t,r){return new Qi(r??"in-memory",t,[],!0)}get readOnly(){return this._readOnly}async persist(t){if($2("[InMem.persist] no persist for",t),this.readOnly)throw Zi("[persist] called for readOnly thread")}},{WARN:yS,LOG:mS,DEBUG:gS,VERBOSE:vS,ERROR:bS}=je.setup(je.INFO),P2=class{constructor(e,t,r=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=r,An(this,{threadOfTrail:De})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?cs([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},Wd=class{constructor(e){this.nodes=e,An(this,{threadOfAllTrails:De,size:De,isEmpty:De})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Re(()=>this.records.length)}get records(){return Rt(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return cs(Rt(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogSet(){return Rt(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogSet"})}get leafNodeLogs(){return Rt(()=>this.nodes.flatMap(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return cs(Rt(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:wS,LOG:ca,DEBUG:or,VERBOSE:Oe,ERROR:Vr}=je.setup(je.INFO,{prefix:"[q]"}),Ra=null,_S=He("lastWriteWins",function(e,{inverseToOnlyReturnFirstLogs:t,tolerateAlreadyFiltered:r}={}){if(Oe(`lastWriteWins${t?".inversed":""} < ${e.nameAndSizeUntracked} > initializing`),e.filters.includes("lastWriteWins")){if(r)return or("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),e;throw Vr("thread already filtered lastWriteWins:",e.filters,{name:e.name})}let n,i=E2(e,function(o,a){let s=Tr(o),u,c=[],f=s?null:[];s?(n=new Map,u=o.init):u=o.added;let p;for(let S=t?0:u.length-1;t?S<u.length:S>=0;t?S++:S--){let T=u[S],I=T.en+"|"+T.at;if(p&&(t?p>T.ts:p<T.ts))throw Vr("lastWriteWins.mapper logs not sorted:",p,t?">":"<",T.ts,{log:T,i:S,newLogs:u,inverseToOnlyReturnFirstLogs:t});p=T.ts;let z=n.get(I);(!z||(t?z.ts>T.ts:z.ts<T.ts))&&(z&&!s&&f.push(z),c.push(T),n.set(I,T))}return mi(c),Oe.isDisabled||Oe(`lastWriteWins${t?".inversed":""}<${e.nameAndSizeUntracked}> mapped event`,s?{...Object.fromEntries(Object.entries(o).map(([S,T])=>[S,T?.length])),toAdd:c.length,toRemove:f}:{...o,toAdd:c,toRemove:f}),s?{init:c}:{added:c,removed:f}},{name:`lastWriteWins${t?".inversed":""}`,extraFilterName:"lastWriteWins"});return Oe.isDisabled||It(()=>{Oe(`lastWriteWins<${e.nameAndSizeUntracked}> filtered down to`,i.applogs.length)}),i},{equals:ji,argsDebugName:e=>Ve({caller:"lastWriteWins",thread:e})}),TS=He("withoutDeleted",function(e){if(Oe.isEnabled&&Oe(`withoutDeleted<${e.nameAndSizeUntracked}>`),e.filters.includes("withoutDeleted"))throw Vr("thread already filtered withoutDeleted:",e.filters,{name:e.name});let t=yn(e,{at:["isDeleted","relation/isDeleted","block/isDeleted"],vl:!0},{name:"isDeleted"});Oe.isEnabled&&Oe(`withoutDeleted<${e.nameAndSizeUntracked}> deletionLogs:`,Re(function(){return[...t.applogs]}));let r=Ve({caller:"allDeletedEntities",thread:e}),n=vx(function(){return t.map(i=>i.en)},{name:r});return Oe.isEnabled&&It(()=>{Oe(`withoutDeleted<${e.nameAndSizeUntracked}> deleted:`,[...n])}),yn(e,{"!en":n},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:ji}),Hd=He("query",function e(t,r,n={},i={}){D2();let o=Jd(t);or(`query<${o.nameAndSizeUntracked}>:`,r);let a=Array.isArray(r)?r:[r],s;if(a.length===1)s=null;else{let f=a.slice(0,-1);s=e(o,f,n,i)}let u=a[a.length-1],c=N2(o,s,u,i);return Oe.isDisabled||It(()=>Oe("query result:",rr(c))),c},{equals:Zs,argsDebugName:(e,t,r)=>Ve({caller:"query",thread:e,args:r?{pattern:t,startVars:r}:t})}),N2=He("queryStep",function(e,t,r,n={}){if(or(`queryStep<${e.nameAndSizeUntracked}> with`,t?.untrackedSize??"all","nodes, pattern:",r),!Object.entries(r).length)throw new Error("Pattern is empty");function i(a){let[s,u]=Gd(r,a?.variables??{});Oe("[queryStep.doQuery] patternWithoutVars: ",s);let c=yn(e,s),f=fa(u),p=Rt(function(){let S=c.map(T=>({log:T,vars:f(T)}));return Oe.isEnabled&&Oe("[queryStep.doQuery] step node:",a?.variables," =>",S,"from:",Re(()=>c.applogs)),S.map(({log:T,vars:I})=>{let z=Object.assign({},a?.variables,I);return new P2(Tx.fromArray([T],Ve({caller:"QueryNode",thread:c,pattern:`${pi(z)}@${pi(s)}`})),z,a)})},{name:Ve({caller:"doQuery.mapNodes",thread:c,pattern:r})});return Oe.isEnabled&&It(()=>Oe("[queryStep.doQuery] resultNodes:",[...p])),n.debug&&ca("[queryStep] step result:",Re(()=>p.map(({variables:S,logsOfThisNode:T})=>({variables:S,thread:T})))),p}let o=Rt(function(){return or(`[queryStep] Running with ${t?.nodes?.length} input nodes:`),t?[...t.nodes.flatMap(i)]:[...i(null)]},{name:Ve({caller:"queryStep",thread:e,pattern:r})});return Oe.isEnabled&&It(()=>Oe("[queryStep] observableResultNodes:",[...o])),new Wd(o)},{equals:Zs,argsDebugName:(e,t,r)=>Ve({caller:"queryStep",thread:e,pattern:r})}),OS=He("queryNot",function(e,t,r,n={}){let i=t.nodes;or(`queryNot<${e.nameAndSizeUntracked}> from: ${i.length} nodes`);let o=Array.isArray(r)?r:[r];for(let a of o){if(!Object.entries(r).length)throw new Error("Pattern is empty");i=i.filter(function({variables:s}){let[u,c]=Gd(a,s??{});Oe("[queryNot] patternWithoutVars: ",u);let f=yn(e,u);return Oe("[queryNot] step node:",s," =>",f.size,"applogs"),Oe.isDisabled||Oe("[queryNot] step node:",s," => empty?",Re(()=>f.applogs)),n.debug&&ca("[queryNot] node result:",s,"=>",f.applogs),f.isEmpty})}return new Wd(i)},{equals:Zs,argsDebugName:(e,t,r)=>Ve({caller:"queryNot",thread:e,pattern:r})}),xS=He("filterAndMap",function(e,t,r){or(`filterAndMap<${e.nameAndSizeUntracked}>`,t);let n=yn(e,t);Oe.isEnabled&&(Oe("[filterAndMap] filtered:",n.untrackedSize),It(()=>Oe("[filterAndMap] filtered:",n.applogs)));let i=Ve({thread:e,pattern:t,caller:"filterAndMap"}),o=Rt(()=>B2(n,r),{name:i});return Oe.isDisabled||It(()=>Oe("[filterAndMap] mapped:",o)),o},{equals:Fe.structural,argsDebugName:(e,t)=>Ve({caller:"filterAndMap",thread:e,pattern:t})}),ES=He("queryAndMap",function(e,t,r,n={}){let i=Jd(e);or(`queryAndMap<${i.nameAndSizeUntracked}>`,{patternOrPatterns:t,variables:n,map:r});let o=Ve({thread:i,caller:"queryAndMap"}),a=Hd(i,t);Oe("[queryAndMap] filtered count:",a.untrackedSize);let s=Rt(()=>M2(a,r),{name:o});return Oe.isDisabled||It(()=>Oe("[queryAndMap] result:",rr(s))),s},{equals:Fe.structural,argsDebugName:(e,t)=>Ve({caller:"queryAndMap",thread:e,pattern:t})}),AS=He("queryEntity",function(e,t,r,n){or(`queryEntity<${e.nameAndSizeUntracked}>`,r,t);let i=yn(e,{en:r,at:C2(t,n)});return Oe("queryEntity applogs:",i.applogs),De(()=>i.isEmpty?null:Object.fromEntries(i.map(({at:o,vl:a})=>[o.slice(t.length+1),a])))},{equals:yx,argsDebugName:(e,t,r)=>Ve({caller:"queryEntity",thread:e,args:{name:t,entityID:r}})}),IS=He("agentsOfThread",function(e){or(`agentsOfThread<${e.nameAndSizeUntracked}>`);let t=Be.map(),r=Ot(i=>{for(let o of Tr(i)?i.init:i.added){let a=t.get(o.ag)??0;t.set(o.ag,a+1)}for(let o of!Tr(i)&&i.removed||[]){let a=t.get(o.ag);if(!a||a<1)throw Vr("[agentsOfThread] number is now negative",{log:o,event:i,mapped:t,prev:a});t.set(o.ag,a-1)}ca(`agentsOfThread<${e.nameAndSizeUntracked}> processed event`,{event:i,mapped:t})});r({init:e.applogs});let n=e.subscribe(r);return Ho(t,n),t}),U2=He("entityOverlap",function(e,t){return ca(`entityOverlap<${e.nameAndSizeUntracked}, ${t.nameAndSizeUntracked}>`),De(()=>{let r=new Set(e.map(i=>i.en)),n=new Set(t.map(i=>i.en));return[...r].filter(i=>n.has(i))})}),SS=He("entityOverlapCount",function(e,t){return De(()=>U2(e,t).get().length)}),R2=He("querySingle",function(e,t,r={}){let n=Hd(e,t,r);return De(()=>{if(n.isEmpty)return null;if(n.size>1)throw Vr("[querySingle] got",n.size,"results:",n);let i=n.nodes[0].logsOfThisNode;if(i.size!=1)throw Vr("[querySingle] single result, but got",i.size,"logs:",i.applogs);return i.applogs[0]})},{equals:Fe.structural,argsDebugName:(e,t)=>Ve({caller:"querySingle",thread:e,pattern:t})}),jS=He("querySingleAndMap",function(e,t,r,n={}){let i=R2(e,t,n);return De(()=>{let o=i.get();if(o)return typeof r=="string"?o[r]:fa(r)(o)})},{equals:Fe.structural,argsDebugName:(e,t)=>Ve({caller:"querySingleAndMap",thread:e,pattern:t})}),B2=function(e,t){return typeof t=="function"?e.map(t):typeof t=="string"?e.map(r=>r[t]):e.map(fa(t))},M2=function(e,t){return typeof t=="function"?e.records.map(t):typeof t=="string"?e.nodes.map(r=>{if(!Object.hasOwn(r.record,t)){if(r.logsOfThisNode.size!==1)throw Vr(`not sure what to map (it's not a var and a result node log count of ${r.logsOfThisNode.size})`);return r.logsOfThisNode.firstLog[t]}return r.record[t]}):e.nodes.map(r=>fa(t)(e))};function fa(e){return t=>Object.entries(e).reduce((r,[n,i])=>(r[i]=t[n],r),{})}function C2(e,t){return t.map(r=>L2(e,r))}function L2(e,t){return`${e}/${t}`}function Jd(e,t){return Array.isArray(e)?Ni.fromArray(e,t||`threadFromArray[${e.length}]`,!0):e}function D2(){if(Ra!=null&&performance.now()>=Ra)throw new V2(Ra)}var V2=class extends Error{constructor(e){super(e)}},F2=qe({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){"use strict";t.exports=a;var r=128,n=127,i=~n,o=Math.pow(2,31);function a(s,u,c){if(Number.MAX_SAFE_INTEGER&&s>Number.MAX_SAFE_INTEGER)throw a.bytes=0,new RangeError("Could not encode varint");u=u||[],c=c||0;for(var f=c;s>=o;)u[c++]=s&255|r,s/=128;for(;s&i;)u[c++]=s&255|r,s>>>=7;return u[c]=s|0,a.bytes=c-f+1,u}}}),G2=qe({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){"use strict";t.exports=i;var r=128,n=127;function i(o,u){var s=0,u=u||0,c=0,f=u,p,S=o.length;do{if(f>=S||c>49)throw i.bytes=0,new RangeError("Could not decode varint");p=o[f++],s+=c<28?(p&n)<<c:(p&n)*Math.pow(2,c),c+=7}while(p>=r);return i.bytes=f-u,s}}}),z2=qe({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){"use strict";var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),a=Math.pow(2,35),s=Math.pow(2,42),u=Math.pow(2,49),c=Math.pow(2,56),f=Math.pow(2,63);t.exports=function(p){return p<r?1:p<n?2:p<i?3:p<o?4:p<a?5:p<s?6:p<u?7:p<c?8:p<f?9:10}}}),gu=qe({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:F2(),decode:G2(),encodingLength:z2()}}}),Xd=42;function K2(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=ft.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new te(R.tag,Xd),new te(R.bytes,r)]}function q2(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function W2(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}function H2(e){for(let t of e.keys())if(typeof t!="string"||t.length===0)throw new Error("Non-string Map keys are not supported by the IPLD Data Model and cannot be encoded");return null}var uc={float64:!0,typeEncoders:{Map:H2,Object:K2,undefined:q2,number:W2}},$S={...uc,typeEncoders:{...uc.typeEncoders}};function J2(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return ft.decode(e.subarray(1))}var fs={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};fs.tags[Xd]=J2;var kS={...fs,tags:fs.tags.slice()},PS=sr(gu(),1),vr={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},Xn={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":vr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(vr.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Xn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=Xn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:vr.Int,CarV1HeaderOrV2Pragma:e=>{if(vr.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,a]=t[i];switch(o){case"roots":{let s=Xn["CarV1HeaderOrV2Pragma > roots (anon)"](e[o]);if(s===void 0)return;if(s!==a||r!==e){if(r===e){r={};for(let u=0;u<i;u++)r[t[u][0]]=t[u][1]}r.roots=s}}break;case"version":{n--;let s=Xn.Int(e[o]);if(s===void 0)return;if(s!==a||r!==e){if(r===e){r={};for(let u=0;u<i;u++)r[t[u][0]]=t[u][1]}r.version=s}}break;default:return}}if(!(n>0))return r}},Zn={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":vr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(vr.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Zn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=Zn["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:vr.Int,CarV1HeaderOrV2Pragma:e=>{if(vr.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,a]=t[i];switch(o){case"roots":{let s=Zn["CarV1HeaderOrV2Pragma > roots (anon)"](a);if(s===void 0)return;if(s!==a||r!==e){if(r===e){r={};for(let u=0;u<i;u++)r[t[u][0]]=t[u][1]}r.roots=s}}break;case"version":{n--;let s=Zn.Int(a);if(s===void 0)return;if(s!==a||r!==e){if(r===e){r={};for(let u=0;u<i;u++)r[t[u][0]]=t[u][1]}r.version=s}}break;default:return}}if(!(n>0))return r}},NS={toTyped:Xn.CarV1HeaderOrV2Pragma,toRepresentation:Zn.CarV1HeaderOrV2Pragma},US=wd(),RS=sr(gu(),1),BS=[new te(R.map,2),new te(R.string,"version"),new te(R.uint,1),new te(R.string,"roots")],MS=new te(R.tag,42),CS=sr(gu(),1),{WARN:Zd,LOG:LS,DEBUG:lc,VERBOSE:vu,ERROR:Fi}=je.setup(je.INFO);async function X2(e){let t=await Z2(e);return await Qd(t)}async function Qd({rootCID:e,blockStore:t},r=[]){if(!e||!t)throw Fi("Empty roots/blocks",{rootCID:e,blockStore:t});let n=await Qn(t,e),i,o=null,a=null;if(vu("[decodePubFromBlocks] root:",e.toString(),n,{blockStore:t}),!n)throw Fi("root not found in blockStore",{blockStore:t,rootCID:e});if(n?.info){o=n.applogs;let f=await Qn(t,o);i=await eI(f,t),a=await Qn(t,n.info),lc("new format - infoLogs",a.logs.map(p=>({[p.toString()]:p})))}else i=n.applogs;let s=async f=>{let p=f,S=await Qn(t,p);if(!S)throw Fi("Could not find applog CID in pub blocks:",p.toString(),{cid:p,root:n,blockStore:t}),new Error(`Could not find applog CID in pub blocks: ${p.toString()}`);return S.pv instanceof ft&&(S.pv=S.pv.toV1().toString()),{...S,cid:p.toV1().toString()}},u;if(u=await Promise.all(i.map(s)),n.prev){if(yu(n.prev,e)||s2(r,n.prev))throw Fi("[pubFromBlocks] pub chain has a loop",{rootCID:e,prev:n.prev,recursionTrace:r});u=u.concat((await Qd({rootCID:n.prev,blockStore:t},[...r,e])).applogs)}let c={cid:e,info:{...a,logs:await Promise.all(a.logs.map(s))},applogsCID:o,applogs:u};return lc("[decodePubFromBlocks] result:",c,{rootCID:e.toString(),root:n,blockStore:t,applogs:u,info:a}),c}async function Z2(e){let t=(await e.getRoots()).map(n=>(typeof n.toV1=="function"?n:ft.decode(n.bytes)).toV1().toString()),r=new Map;for await(let{cid:n,bytes:i}of e.blocks()){let o=typeof n.toV1=="function"?n:ft.decode(n.bytes);vu({cidFromCarblocks:n,cid:o}),r.set(o.toV1().toString(),i)}return t.length!==1&&Zd("Unexpected roots count:",t),{rootCID:ft.parse(t[0]),blockStore:{get:n=>r.get(n.toV1().toString())}}}async function Qn(e,t){try{var r=await e.get(t);if(!r)return Zd("returning null"),null}catch(n){if(n.message==="Not Found")return null;throw n}return du(r)}function Q2(e){return async function*(){for(;;){let{done:t,value:r}=await e.read();if(vu("[car] chunk",{done:t,value:r}),t)break;yield r}}()}var{WARN:DS,LOG:VS,DEBUG:FS,VERBOSE:GS,ERROR:Y2}=je.setup(je.INFO);async function eI(e,t){return tI(e)?(await Promise.all(e.chunks.map(async r=>{let n=await Qn(t,r);if(!n.logs)throw Y2("Weird chunk",n);return n.logs}))).flat():e.logs}function tI(e){return e.chunks}var Ro=gi(Tp(),1),rI=gi(Op(),1),Yd=!1,ep=!1;Ro.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(Yd=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(ep=process?.env?.LOGGER_PERF_PREFIX==="true"));var nI={prefix:void 0,time:Yd,delta:ep,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0},Ba=[],tp=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,r,n){Object.assign(this,{sinceFirst:e,sinceLast:t,time:r,delta:n})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<5?2:1),r=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?r:null].filter(n=>n!=null).join(",")}]`}},rp=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},Yn=!1,mn=class ot{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=ot.INFO,r={}){r=Object.assign({},nI,r),t>10&&console.debug("setup logger",{config:r});let n=this.wrapLog(console.debug,{...r,dim:r.dimDebugOnServer}),i=(...u)=>{typeof window<"u"&&window?.FORCE_DISABLE_LOGLEVEL&&n(...u)};i.isDisabled=!0,i.isEnabled=!1;let o=this.wrapLog(console.groupCollapsed,r),a=(u,c)=>{function f(...S){let T=S[S.length-1];return T===i?T():(o(...S.slice(0,-1)),(async()=>{try{let I=T();return I instanceof Promise?await I:I}finally{console.groupEnd()}})())}let p=Object.assign(c.bind({}),{isEnabled:u,isDisabled:!u,group:f,force:c});return u?p:Object.assign(i.bind({}),{isEnabled:u,isDisabled:!u,group:f,force:p})},s=a(t>=ot.ERROR,this.wrapLog(console.error,r));return{ERROR:(...u)=>(s(...u),new Error((0,rI.default)(u))),WARN:a(t>=ot.WARN,this.wrapLog(console.warn,r)),LOG:a(t>=ot.INFO,this.wrapLog(console.log,r)),DEBUG:a(t>=ot.DEBUG,this.wrapLog(console.log,{...r,dim:r.dimDebugOnServer})),VERBOSE:a(t>=ot.VERBOSE,this.wrapLog(console.debug,{...r,dim:r.dimDebugOnServer}))}}static wrapLog(t,r){if(Ro.isNode)return t.bind(console);{let n=[];if(r.time||r.delta){let i=Ro.isBrowser&&navigator.userAgent.includes("Chrome")?["",ot.timeStr(!!r.time,!!r.delta)]:[];n.push(...i)}return r.prefix&&(Yn?n.push(new rp("dim",r.prefix)):n.push(r.prefix)),t.bind(console,...n)}}static timeStr(t,r,n=0){if(!performance.now)return;let i=performance.now();ot.firstLog||(ot.firstLog=i,ot.lastLog=i);let o=new tp(i-ot.firstLog,i-ot.lastLog,t,r);return ot.lastLog=i,n?o.toString():o}static getOriginFromStack(t){let r=!1;for(let n of t.split(`
|
|
62
|
+
`)){let i=n.match(/^\s+at\s+(.*)/);if(i){if(r)return i[1].trim().replace(__dirname,"");r=!0}}}};Ro.isBrowser&&(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Ba&&Ba.length){for(let t of Ba)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof tp))return null;Yn||(Yn=!0);let t=mn.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof rp?(Yn||(Yn=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1}));var{WARN:iI,LOG:zS,DEBUG:ri,VERBOSE:KS,ERROR:da}=mn.setup(mn.INFO),bu=["https://trustless-gateway.link/","https://ipfs.4everland.io/"].map(e=>({url:e}));async function wu(e,{readOnly:t=!0,pinnedCID:r,gateways:n=bu}={}){let{cid:i,errors:o,isIpns:a}=a2(e);if(!i)throw da("Failed to parse pubID",e,o);ri("[retrieveThread] parsedPubID",{cid:i.toString(),errors:o,isIpns:a});let s=await np(i),{applogs:u,info:c}=await X2(s),f=u.filter(ss);f.length&&iI(`Found ${f.length} encrypted logs - skipping`);let p=u.filter(T=>!ss(T));mi(p);let S=Ni.fromArray(p,`preview${e&&e!==i.toString()?"-"+e:""}@${i.toString()}`,t);return{cid:i,info:c,thread:S,encryptedCount:f.length}}async function np(e,t=bu){return e=ls(e),ri("Retrieving:",e,e.toString(),"from",t),await _u(t,async(r,n)=>{var i=ip(r,e);n>1&&(i+=`&cache-bust=${performance.now()}`);let o=await fetch(i),a=await oI(o,i);ri("[retrieveCar] GW result",{result:a,gateway:r});let s=await Ac.fromIterable(a);ri("[retrieveCar] GW decodeResult",{car:s,gateway:r});let u=(await s.getRoots())[0];if(!hu(e)&&!yu(e,u))throw da("Fetched CAR has different CID",u.toString(),"than the one asked for:",e.toString());return s})}function ip(e,t){let r=new URL(e.url),n=hu(t),i=`${r}${n?"ipns/":"ipfs/"}${t.toString()}?format=car&dag-scope=all`;return ri({isIpns:n,url:i}),i}async function oI(e,t){if(!e?.ok||!e?.body)throw da("[retrieveCar] unexpected response",e?.statusText,{url:t});return Q2(e.body.getReader())}async function _u(e,t,r=1){try{return await Promise.any(vo(e).map(async n=>{try{return await t(n,r)}catch(i){throw da("still trying",i),i instanceof Error?i:new Error(`[retrieveCar] error: ${i}`)}}))}catch(n){if(r<3)return await _u(e,t,r+1);throw new Error("[Gateway] no valid results after 3 attempts via: "+vo(e).map(({url:i})=>i)+`
|
|
63
|
+
`+n.errors.map(i=>i.message))}}var{WARN:o$,LOG:a$,DEBUG:s$,VERBOSE:u$,ERROR:l$}=je.setup(je.INFO),{WARN:aI,LOG:c$,DEBUG:sI,VERBOSE:pa,ERROR:f$}=je.setup(je.INFO),d$=He("queryDivergencesByPrev",function(e){sI(`queryDivergencesByPrev<${e.nameAndSizeUntracked}>`),e.filters.includes("lastWriteWins")&&aI("queryDivergencesByPrev on thread lastWriteWins",e);let t=Rt(()=>{let r=new Map,n=new Set;pa("all applogs:",e.applogs);for(let i of e.applogs){let o;i.pv&&(o=i.pv&&r.get(i.pv.toString()),n.delete(i.pv.toString())),pa("traversing log",{log:i,prevLogs:o,leafs:Array.from(n)}),r.set(i.cid,o?[...o,i]:[i]),n.add(i.cid)}return Array.from(n).map(i=>{let o=new Ni(Ve({caller:"DivergenceLeaf",thread:e,pattern:`leaf: ${i}`}),r.get(i),e.filters,!0);return{log:o.latestLog,thread:o}})},{name:Ve({caller:"queryDivergencesByPrev",thread:e})});return pa.isDisabled||It(()=>pa("[queryDivergencesByPrev] result:",rr(t))),t},{equals:Fe.structural}),{WARN:p$,LOG:h$,DEBUG:y$,VERBOSE:m$,ERROR:g$}=mn.setup(mn.INFO);var{WARN:_$,LOG:T$,DEBUG:O$,VERBOSE:x$,ERROR:E$}=va.setup(va.INFO),uI="https://nftstorage.link";async function A$(e,{readOnly:t=!0,pinnedCID:r}={}){return wu(e,{readOnly:t,pinnedCID:r,gateways:[{url:uI}]})}export{uI as a,A$ as b};
|
|
64
|
+
/*! Bundled license information:
|
|
65
|
+
|
|
66
|
+
lodash-es/lodash.js:
|
|
67
|
+
(**
|
|
68
|
+
* @license
|
|
69
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
70
|
+
* Build: `lodash modularize exports="es" -o ./`
|
|
71
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
72
|
+
* Released under MIT license <https://lodash.com/license>
|
|
73
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
74
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
75
|
+
*)
|
|
76
|
+
|
|
77
|
+
@noble/hashes/utils.js:
|
|
78
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
79
|
+
*/
|
|
80
|
+
//# sourceMappingURL=chunk-S46LOB6N.min.js.map
|