zeed 0.10.21 → 0.10.22
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/README.md +4 -2
- package/dist/chunk-FXACG46Y.js +16 -0
- package/dist/chunk-FXACG46Y.js.map +1 -0
- package/dist/index.all.d.ts +17 -13
- package/dist/index.browser.cjs +156 -155
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.ts +2 -2
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +277 -275
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +3 -2
- package/dist/index.node.js +11 -10
- package/dist/index.node.js.map +1 -1
- package/dist/{uuid-a8aab0ad.d.ts → uuid-e68c76fc.d.ts} +16 -13
- package/package.json +7 -7
- package/dist/chunk-ONVG2KLG.js +0 -16
- package/dist/chunk-ONVG2KLG.js.map +0 -1
package/dist/index.browser.cjs
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function
|
|
4
|
-
`)}var ne;function $t(){return ne===void 0&&(ne=(typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}))??null,ne&&ne.decode(new Uint8Array).length===1&&(ne=null)),ne}var _t="Unexpected end of array",Vt="Integer out of Range",Je=class{constructor(t){this.arr=t,this.pos=0;}};function Ue(e){return new Je(e)}function Ze(e,t){let n=ge(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n}function re(e){let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let o=e.arr[e.pos++];if(t=t+(o&127)*n,n*=128,o<128)return t;if(t>Number.MAX_SAFE_INTEGER)throw new Error(Vt)}throw new Error(_t)}function ve(e){return Ze(e,re(e))}function de(e){return e.arr[e.pos++]}function jt(e){let t=e.arr[e.pos]+(e.arr[e.pos+1]<<8);return e.pos+=2,t}function Ht(e){let t=e.arr[e.pos]+(e.arr[e.pos+1]<<8)+(e.arr[e.pos+2]<<16)+(e.arr[e.pos+3]<<24)>>>0;return e.pos+=4,t}function Ke(e){let t=e.arr[e.pos++],n=t&63,r=64,o=(t&64)>0?-1:1;if(!(t&128))return o*n;let i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n=n+(t&127)*r,r*=128,t<128)return o*n;if(n>Number.MAX_SAFE_INTEGER)throw new Error(Vt)}throw new Error(_t)}function er(e){let t=re(e);if(t===0)return "";{let n=String.fromCodePoint(de(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(de(e));else for(;t>0;){let r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r;}return decodeURIComponent(escape(n))}}function Ce(e){let t=$t();return t?t.decode(ve(e)):er(e)}function Ye(e,t){let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n}function Xe(e){return Ye(e,4).getFloat32(0,!1)}function tr(e){return Ye(e,8).getFloat64(0,!1)}function nr(e){return Ye(e,8).getBigInt64(0,!1)}var rr=[e=>{},e=>null,Ke,Xe,tr,nr,e=>!1,e=>!0,Ce,e=>{let t=re(e),n={};for(let r=0;r<t;r++){let o=Ce(e);n[o]=oe(e);}return n},e=>{let t=re(e),n=[];for(let r=0;r<t;r++)n.push(oe(e));return n},ve];function oe(e){return rr[127-de(e)](e)}function ge(e,t,n){return new Uint8Array(e,t,n)}var Qe=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[];}};function Ee(){return new Qe}function et(e){let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t}function Se(e){let t=new Uint8Array(et(e)),n=0;for(let r=0;r<e.bufs.length;r++){let o=e.bufs[r];t.set(o,n),n+=o.length;}return t.set(ge(e.cbuf.buffer,0,e.cpos),n),t}function or(e,t){let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(ge(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Math.max(n,t)*2),e.cpos=0);}function F(e,t){let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t;}var Gt=F;function qt(e,t){F(e,t&255),F(e,t>>>8&255);}function Wt(e,t){for(let n=0;n<4;n++)F(e,t&255),t>>>=8;}function K(e,t){for(;t>127;)F(e,128|127&t),t=Math.floor(t/128);F(e,127&t);}function ir(e){return e!==0?e<0:1/e<0}function tt(e,t){let n=ir(t);for(n&&(t=-t),F(e,(t>63?128:0)|(n?64:0)|63&t),t=Math.floor(t/64);t>0;)F(e,(t>127?128:0)|127&t),t=Math.floor(t/128);}function Pe(e,t){let n=e.cbuf.length,r=e.cpos,o=Math.min(n-r,t.length),i=t.length-o;e.cbuf.set(t.subarray(0,o),r),e.cpos+=o,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Math.max(n*2,i)),e.cbuf.set(t.subarray(o)),e.cpos=i);}function Ie(e,t){K(e,t.byteLength),Pe(e,t);}function ar(e,t){let n=unescape(encodeURIComponent(t)),r=n.length;K(e,r);for(let o=0;o<r;o++)F(e,n.codePointAt(o));}function Fe(e,t){return ar(e,t)}function nt(e,t){or(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n}function rt(e,t){return nt(e,4).setFloat32(0,t,!1)}function ur(e,t){return nt(e,8).setFloat64(0,t,!1)}function cr(e,t){return nt(e,8).setBigInt64(0,t,!1)}var De;function lr(e){return De==null&&(De=new DataView(new ArrayBuffer(4))),De.setFloat32(0,e),De.getFloat32(0)===e}function se(e,t){switch(typeof t){case"string":F(e,119),Fe(e,t);break;case"number":Number.isInteger(t)&&Math.abs(t)<=2147483647?(F(e,125),tt(e,t)):lr(t)?(F(e,124),rt(e,t)):(F(e,123),ur(e,t));break;case"bigint":F(e,122),cr(e,t);break;case"object":if(t===null)F(e,126);else if(Array.isArray(t)){F(e,117),K(e,t.length);for(let n=0;n<t.length;n++)se(e,t[n]);}else if(t instanceof Uint8Array)F(e,116),Ie(e,t);else {F(e,118);let n=Object.keys(t);K(e,n.length);for(let r=0;r<n.length;r++){let o=n[r];Fe(e,o),se(e,t[o]);}}break;case"boolean":F(e,t?120:121);break;default:F(e,127);}}var Jt=class{async encode(t){let n=Ee();return se(n,t),Se(n)}async decode(t){return oe(Ue(D(t)))}};function ri(e){let t=Ee();return se(t,e),Se(t)}function oi(e){return oe(Ue(D(e)))}function ii(e){let t=Ee();return e!=null&&Pe(t,D(e)),{writeBytes:(n,r)=>{let o=D(n);Et(!(r!=null&&o.length!==r),`Expected ${r} bytes, got ${o.length}`),Pe(t,o);},writeBytesVar:n=>Ie(t,D(n)),writeUintVar:n=>K(t,n),writeUint8:n=>Gt(t,n),writeUint16:n=>qt(t,n),writeUint32:n=>Wt(t,n),writeIntVar:n=>tt(t,n),writeFloat:n=>rt(t,n),writeStringVar:n=>Fe(t,n),write:n=>se(t,n),getUint8Array:()=>Se(t),getLength:()=>et(t)}}function si(e){let t=Ue(D(e));return {readBytes:n=>Ze(t,n),readBytesVar:()=>ve(t),readUintVar:()=>re(t),readUint8:()=>de(t),readUint16:()=>jt(t),readUint32:()=>Ht(t),readIntVar:()=>Ke(t),readFloat:()=>Xe(t),readStringVar:()=>Ce(t),read:()=>oe(t),getOffset:()=>t.pos||0}}function ai(e=0){return {setBit:(t,n=!0)=>n?e|=1<<t:e&=~(1<<t),unsetBit:t=>e&=1<<t,toggleBit:t=>e^=1<<t,getBit:t=>(e&1<<t)!==0,getValue:()=>e}}async function fr(e){return await e.arrayBuffer()}async function ui(e){let t=await fr(e);if(t!=null)return D(t)}function ae(e=16){let t=new Uint8Array(e);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let n=0;n<e;n++)t[n]=Math.floor(Math.random()*256);return t}var Kt="SHA-256",ot="AES-GCM",Zt="PBKDF2",pr=1e5;async function fi(e,t=Kt){return D(await crypto.subtle.digest(t,D(e)))}async function pi(e,t={}){let n=D(e),r=await crypto.subtle.importKey("raw",n,Zt,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:Zt,salt:t.salt?D(t.salt):new Uint8Array(0),iterations:t.iterations??pr,hash:Kt},r,{name:ot,length:256},!0,["encrypt","decrypt"])}function Yt(){return new Uint8Array([1,1])}async function Xt(e,t){let n=Yt(),r=ae(12),o=await crypto.subtle.encrypt({name:ot,iv:r},t,e),i=new Uint8Array(o),s=n.length+r.length+i.length,u=new Uint8Array(s),a=0;return u.set(n,a),a+=n.length,u.set(r,a),a+=r.length,u.set(i,a),u}async function Qt(e,t){let n=e.subarray(0,2);if(!Rt(n,Yt()))return Promise.reject(new Error(`Unknown magic ${n}`));let r=e.subarray(2,2+12),o=e.subarray(2+12,e.length),i=await crypto.subtle.decrypt({name:ot,iv:r},t,o);return new Uint8Array(i)}function dr(){return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}function S(){return typeof crypto<"u"?dr():Math.random()}function gi(e=.25){return S()<e}function mi(e=100,t=0){return t+Math.floor(S()*(e-t))}function yi(e=100,t=0){return t+S()*(e-t)}function hi(e,t,n){return Math.max(e,Math.min(n,t))}function gr(e){return e.reduce((t,n)=>t+n,0)}function xi(e){return gr(e)/e.length}function bi(e){return !/^1?$|^(11+?)\1+$/.test("1".repeat(e))}function wi(e){for(let t=2;t<e;t++)if(e%t===0)return !1;return e>1}var it=6;function Ti(e=0,t=1,n){it=((n??it)*9301+49297)%233280;let r=it/233280;return t+r*(e-t)}function mr(e=""){let[t="",n="asc"]=e.split(" ");return n=n.toLowerCase(),{field:t,orderby:n,asc:n!=="desc",desc:n==="desc"}}function Ai(e,t=!0){return `${e} ${t?"asc":"desc"}`}function st(e,t,n=!0){let r=e||0,o=t||0;return r>o?n?1:-1:r<o?n?-1:1:0}function Ci(e,...t){if(t.length>0){let n=t.map(mr),r=Array.from(e);return r.sort((o,i)=>{for(let{field:s,asc:u}of n){let a=st(o[s],i[s],u);if(a!==0)return a}return 0}),r}return e}function at(e){return e.filter((t,n)=>e.indexOf(t)===n)}function yr(e,t){return at(e.filter(n=>!t.includes(n)))}function hr(...e){return at(e.reduce((t=[],n)=>t.concat(n),[]))}function ue(...e){return e.flat(1/0)}function xr(e,t){return at(e).filter(n=>t.includes(n))}function Fi(e,t){return yr(hr(e,t),xr(e,t))}function en(e,t){if(e&&Array.isArray(e)){let n;for(;(n=e.indexOf(t))!==-1;)e.splice(n,1);return e}return []}function Ei(e,t){return e.includes(t)||e.push(t),e}function ut(e,t){return e.splice(0,e.length,...e.filter(t)),e}function Si(e,t){let n=e.findIndex(r=>r===t);return n>=0?e.splice(n,1):e.push(t),e}function Pi(e){return e.splice(0,e.length),e}function br(e,t=st){return Array.from(e).sort(t)}function Ii(e){return br(e,(t,n)=>t-n)}function wr(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function tn(e){return e.sort(()=>S()>.5?1:-1),e}function Mi(e){return tn(Array.from(e))}function Ri(e){for(;e.length>1;){let t=Array.from(e);if(tn(t),!wr(e,t))return t}return e}function ki(e){return e[Math.floor(S()*e.length)]}function Bi(...e){return ue(e).reduce((t,n)=>t!=null?n>t?n:t:n,void 0)}function $i(...e){return ue(e).reduce((t,n)=>t!=null?n<t?n:t:n,void 0)}function Oi(...e){return ue(e).reduce((t,n)=>t+n,0)}function _i(...e){let t=ue(e);return t.reduce((n,r)=>n+r,0)/t.length}function Vi(e,t){let n=[],r=0,o=e.length;for(;r<o;)n.push(e.slice(r,r+=t));return n}function ji(e=0,t){if(e<=0)return [];let n=new Array(e);for(let r=0;r<e;r++)n[r]=t instanceof Function?t(r):t;return n}var Tr={2:"01",8:"01234567",11:"0123456789a",16:"0123456789abcdef",32:"0123456789abcdefghjkmnpqrtuvwxyz","32-crockford":"0123456789ABCDEFGHJKMNPQRSTVWXYZ","32-geohash":"0123456789bcdefghjkmnpqrstuvwxyz","32-agnoster":"0123456789abcdefghjkmnpqrtuvwxyz","32-rfc":"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567","32-hex":"0123456789ABCDEFGHIJKLMNOPQRSTUV","32-zbase":"ybndrfg8ejkmcpqxot1uwisza345h769",36:"0123456789abcdefghijklmnopqrstuvwxyz",58:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",62:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","64-url":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",66:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~",85:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"};function Lr(e){let t=Tr[String(e)];if(!t)if(typeof e=="string")t=e;else throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let n=new Uint8Array(256);for(let g=0;g<n.length;g++)n[g]=255;for(let g=0;g<t.length;g++){let m=t.charAt(g),x=m.charCodeAt(0);if(n[x]!==255)throw new TypeError(`${m} is ambiguous`);n[x]=g;}let r=t.length,o=t.charAt(0),i=Math.log(r)/Math.log(256),s=Math.log(256)/Math.log(r);function u(g,m=-1){let x=D(g);if(x.byteLength===0)return "";let w=0,T=0,h=x.byteLength;for(;T!==h&&x[T]===0;)T++;let b=(h-T)*s+1>>>0,L=new Uint8Array(b);for(;T!==h;){let p=x[T],d=0;for(let l=b-1;(p!==0||d<w)&&l!==-1;l--,d++)p+=256*L[l]>>>0,L[l]=p%r>>>0,p=p/r>>>0;if(p!==0)throw new Error("Non-zero carry");w=d,T++;}let y=b-w;for(;y!==b&&L[y]===0;)y++;let c="";for(;y<b;++y)c+=t.charAt(L[y]);return m>0?c.padStart(m,o):c}function a(g,m=-1){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;g=g.replace(/\s+/gi,"");let x=0,w=0;for(;g[x]===o;)x++;let T=(g.length-x)*i+1>>>0,h=new Uint8Array(T);for(;g[x];){let L=n[g.charCodeAt(x)];if(L===255)throw new Error(`Unsupported character "${g[x]}"`);let y=0;for(let c=T-1;(L!==0||y<w)&&c!==-1;c--,y++)L+=r*h[c]>>>0,h[c]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");w=y,x++;}let b=T-w;for(;b!==T&&h[b]===0;)b++;return m>0?new Uint8Array([...new Uint8Array(m-h.length+b),...h.slice(b)]):h.slice(b)}return {encode:u,decode:a}}var Me;function J(e){Me==null&&(Me=new Map);function t(){let o=Me.get(e);return o==null&&(o=Lr(e),Me.set(e,o)),o}function n(o,i=-1){return t().encode(o,i)}function r(o,i=-1){return t().decode(o,i)}return {encode:n,decode:r}}function ct(e,t=-1){return J(32).encode(e,t)}function nn(e,t=-1){return J(32).decode(e.toLocaleLowerCase().replaceAll("l","1").replaceAll("s","5").replaceAll("o","0").replaceAll("i","1"),t)}function zi(e,t=-1){return J(16).encode(e,t)}function Gi(e,t=-1){return J(16).decode(e,t)}function qi(e,t=-1){return J(58).encode(e,t)}function Wi(e,t=-1){return J(58).decode(e,t)}function lt(e,t=-1){return J(62).encode(e,t)}function rn(e,t=-1){return J(62).decode(e,t)}function Ji(e,t){return Math.ceil(e*(Math.log(256)/Math.log(t)))}var Ki=e=>(e.length>0&&(/^[A-Z0-9_\-\ ]*$/g.test(e)&&(e=e.toLowerCase()),e=e.replace(/^[-_\ ]+/gi,"").replace(/[-_\ ]+$/gi,"").replace(/[-_\ ]+([a-z0-9])/gi,(t,n)=>n.toUpperCase()),e=e[0].toLowerCase()+e.substring(1)),e);function Ar(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}function Yi(e){return e.replace(/\w\S*/g,Ar)}function Xi(e,t="-"){return t=typeof t>"u"?"_":t,e.replace(/([a-z\d])([A-Z])/g,`$1${t}$2`).replace(/([A-Z]+)([A-Z][a-z\d]+)/g,`$1${t}$2`).toLowerCase()}var on=["1","true","yes","y","on"];function ts(e,t=!1){return e==null||typeof e!="string"?t:on.includes(String(e).trim().toLowerCase())}function ns(e,t=0){return e==null||typeof e!="string"?t:parseInt(e.trim(),10)??t}function rs(e,t=0){return e==null||typeof e!="string"?t:parseFloat(e.trim())??t}function Cr(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:on.includes(String(e).trim().toLowerCase())}function Ur(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseInt(String(e).trim(),10)??t}function vr(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseFloat(String(e).trim())??t}function ft(e,t=""){return e==null?t:String(e)??t}var os=vr,is=Ur,ss=ft,as=Cr;function Dr(e,t={}){let{trace:n=!0,pretty:r=!0}=t;return e.map(o=>{if(o&&typeof o=="object"){if(r&&(o instanceof Uint8Array||o instanceof ArrayBuffer))return `
|
|
5
|
-
${
|
|
3
|
+
function zn(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}function ee(){let e=zn();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}function Gn(e){return e===!0||e==="true"||e==="1"||typeof e=="number"&&e!==0?e="*":e===!1||e==="false"||e===0||e==="0"||e==null||e==="null"||e==="undefined"?e="":e=String(e),e}function qn(){return Gn(typeof process<"u"?process.env.ZEED??process.env.DEBUG:typeof localStorage<"u"?localStorage.zeed??localStorage.debug:"*")}function j(e=qn()){let t,n=[],r=[];if(!e)t=function(o){return !1};else if(e==="*")t=function(o){return !0};else {let o,i=e.split(/[\s,]+/),s=i.length;for(o=0;o<s;o++){if(!i[o])continue;let u=i[o].replace(/\*/g,".*?");u[0]==="-"?n.push(new RegExp(`^${u.substr(1)}$`)):r.push(new RegExp(`^${u}$`));}t=function(u){if(n.length===0&&r.length===0)return !0;let a,g;for(a=0,g=n.length;a<g;a++)if(n[a].test(u))return !1;for(a=0,g=r.length;a<g;a++)if(r[a].test(u))return !0;return !1};}return t.accept=r,t.reject=n,t.filter=e,t}function Wn(){return typeof process<"u"?process.env.ZEED_LEVEL??process.env.LEVEL??process.env.DEBUG_LEVEL:typeof localStorage<"u"?localStorage.zeed_level??localStorage.level??localStorage.debug_level:void 0}function le(e){if(e===!1)return W;if(typeof e=="number")return e;if(typeof e=="string"){let t=Dt[e.toLocaleLowerCase().trim()];if(t!=null)return t}return V}function te(e=Wn()){let t=le(e);return n=>n>=t}function xe(e={}){let{level:t=void 0,filter:n=void 0}=e,r=j(n),o=te(t);return i=>{if(!o(i.level)||!r(i.name))return;let s=i.name?`[${i.name}]`:"";switch(i.level){case B:console.info(`I|* ${s}`,...i.messages);break;case O:console.warn(`W|** ${s}`,...i.messages);break;case $:console.error(`E|*** ${s}`,...i.messages);break;default:console.debug(`D| ${s}`,...i.messages);break}}}var V=-1,H=0,B=1,O=2,$=3,Z=4,W=9007199254740991,Dt={"*":V,a:V,all:V,d:H,dbg:H,debug:H,i:B,inf:B,info:B,w:O,warn:O,warning:O,e:$,err:$,error:$,fatal:Z,off:W,"-":W};function Ft(e=""){let t=[xe()],n=a=>!0,r=!1,o=s,i=!1;function s(a="",g){let m=le(g??V);function x(h,b){return m<=h?b:()=>{}}let w=x(H,(...h)=>{T({name:a,messages:h,level:H});});w.label=a,w.extend=function(h){return o(a?`${a}:${h}`:h)};let T=h=>{if(n(a))for(let b of t)b&&b(h);};return w.debug=x(H,(...h)=>{T({name:a,messages:h,level:H});}),w.info=x(B,(...h)=>{T({name:a,messages:h,level:B});}),w.warn=x(O,(...h)=>{T({name:a,messages:h,level:O});}),w.error=x($,(...h)=>{T({name:a,messages:h,level:$});}),w.fatal=x(Z,(...h)=>{throw T({name:a,messages:h,level:Z}),new Error(`${h.map(String).join(" ")}`)}),w.assert=x(Z,(h,...b)=>{(h==null||typeof h=="number"&&isNaN(h)||!h)&&w.fatal(...b);}),w}function u(a="",g){let m=o(a,g);return i&&m.debug(`+++ init of logger "${a}" on level "${m.level}".`),m}return u.registerHandler=function(a){t.push(a);},u.setFilter=function(a){n=j(a);},u.setLock=(a=!0)=>r=a,u.setDebug=(a=!0)=>i=a,u.setHandlers=function(a=[]){o!==s&&(o=s),!r&&(t=[...a].filter(g=>typeof g=="function"));},u.level=V,u.setLogLevel=function(a=V){r||(u.level=a);},u.setFactory=function(a){r||(o=a);},u}var z;function ze(e){let t=Ft();return e?e(t):t.setHandlers([xe()]),t}function Ge(e){if(z==null)try{let t=ee();t!=null?t?.logger==null?(z=ze(e),t.logger=z):z=t.logger:z=ze(e);}catch{z=ze(e);}return z}function Et(){if(z!=null)return z;try{let e=ee();if(e?.logger!=null)return e.logger}catch{}}function R(e,t){return Ge()(e,t)}function Jn(...e){throw Et()?.("assert")?.fatal(...e),new Error(`${e.map(String).join(" ")}`)}function Zn(e,...t){(e==null||typeof e=="number"&&isNaN(e)||!e)&&Jn(...t);}function Pt(e,...t){Zn(e,...t);}var Kn=(e,t)=>t instanceof Object&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,r)=>(n[r]=t[r],n),{}):t;function Io(e,t=void 0){return JSON.stringify(e,Kn,t)}function Yn(e,t){let n=[],r=[];return t==null&&(t=function(o,i){return n[0]===i?"[Circular ~]":`[Circular ~.${r.slice(0,n.indexOf(i)).join(".")}]`}),function(o,i){if(n.length>0){let s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?r.splice(s,1/0,o):r.push(o),~n.indexOf(i)&&(i=t?.call(this,o,i));}else n.push(i);try{return e==null?i:e.call(this,o,i)}catch{}return String(i)}}function M(e,t,n,r){return JSON.stringify(e,Yn(t??void 0,r),n??void 0)}var ko=M;function Xn(e){let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=t.codePointAt(o)||0;return r}function Qn(e){let t=e.length,n="",r=0;for(;t>0;){let o=t<1e4?t:1e4,i=e.subarray(r,r+o);r+=o,n+=String.fromCodePoint.apply(null,i),t-=o;}return decodeURIComponent(escape(n))}var be;function St(e){if(be==null&&(be=Xn,typeof TextEncoder<"u")){let t=new TextEncoder;be=n=>t.encode(n);}return be(e.normalize("NFC"))}var we;function Rt(e){if(we==null&&(we=Qn,typeof TextDecoder<"u")){let t=new TextDecoder("utf-8",{ignoreBOM:!0});we=n=>t.decode(n);}return we(e).normalize("NFC")}function D(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?St(e):e.length?new Uint8Array(e):e}function $o(...e){let t=0,n=e.flat(1).map(i=>{let s=D(i);return t+=s.length,s}),r=new Uint8Array(t),o=0;for(let i of n)r.set(i,o),o+=i.length;return r}function Mt(e){if(typeof Buffer<"u")return Buffer.from(D(e)).toString("hex");let t="0123456789abcdef",n="";for(let r of [...D(e)])n+=t[r>>4]+t[r&15];return n}function It(e){return Uint8Array.from(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}function fe(e,t=!1){let n=D(e),r="";if(typeof Buffer<"u")r=Buffer.from(n).toString("base64");else {let o="";for(let i=0;i<n.byteLength;i++)o+=String.fromCharCode(n[i]);r=btoa(o);}return t?r.replaceAll("=",""):r}function _o(e){let t=D(e);if(typeof Buffer<"u")return Buffer.from(t).toString("base64url").replaceAll("=","");let n="";for(let r=0;r<t.byteLength;r++)n+=String.fromCharCode(t[r]);return btoa(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function Te(e){if(e=e.replaceAll("-","+").replaceAll("_","/"),typeof Buffer<"u"){let r=Buffer.from(e,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function jo(e){return Rt(Te(e))}function kt(e,t){if(e.byteLength!==t.byteLength)return !1;let n=D(e),r=D(t);for(let o=0;o<n.length;o++)if(n[o]!==r[o])return !1;return !0}function qe(e){return St(M(e))}function We(e){return JSON.parse(Rt(e))}function Bt(e,t){if(typeof e!="string")if(e instanceof ArrayBuffer&&e.byteLength!==void 0)e=String.fromCharCode.apply(String,[].slice.call(new Uint8Array(e)));else if(Array.isArray(e))e=String.fromCharCode.apply(String,e);else if(e.constructor===Uint8Array)e=String.fromCharCode.apply(String,[].slice.call(e));else return !1;t=t||16;let n=[],r="0123456789ABCDEF";for(let o=0;o<e.length;o+=t){let i=e.slice(o,Math.min(o+t,e.length)),s=`0000${o.toString(16)}`.slice(-4),u=i.split("").map(g=>{let m=g.charCodeAt(0);return ` ${r[(240&m)>>4]}${r[15&m]}`}).join("");u+=" ".repeat(t-i.length);let a=i.replace(/[\x00-\x1F\x20\x7F-\xA0\xAD]/g,".");a+=" ".repeat(t-i.length),n.push(`${s} ${u} ${a}`);}return n.join(`
|
|
4
|
+
`)}var ne;function $t(){return ne===void 0&&(ne=(typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}))??null,ne&&ne.decode(new Uint8Array).length===1&&(ne=null)),ne}var jt="Unexpected end of array",Vt="Integer out of Range",Je=class{constructor(t){this.arr=t,this.pos=0;}};function ve(e){return new Je(e)}function Ze(e,t){let n=ge(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n}function re(e){let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let o=e.arr[e.pos++];if(t=t+(o&127)*n,n*=128,o<128)return t;if(t>Number.MAX_SAFE_INTEGER)throw new Error(Vt)}throw new Error(jt)}function Ue(e){return Ze(e,re(e))}function de(e){return e.arr[e.pos++]}function Ht(e){let t=e.arr[e.pos]+(e.arr[e.pos+1]<<8);return e.pos+=2,t}function Nt(e){let t=e.arr[e.pos]+(e.arr[e.pos+1]<<8)+(e.arr[e.pos+2]<<16)+(e.arr[e.pos+3]<<24)>>>0;return e.pos+=4,t}function Ke(e){let t=e.arr[e.pos++],n=t&63,r=64,o=(t&64)>0?-1:1;if(!(t&128))return o*n;let i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n=n+(t&127)*r,r*=128,t<128)return o*n;if(n>Number.MAX_SAFE_INTEGER)throw new Error(Vt)}throw new Error(jt)}function nr(e){let t=re(e);if(t===0)return "";{let n=String.fromCodePoint(de(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(de(e));else for(;t>0;){let r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r;}return decodeURIComponent(escape(n))}}function Ce(e){let t=$t();return t?t.decode(Ue(e)):nr(e)}function Ye(e,t){let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n}function Xe(e){return Ye(e,4).getFloat32(0,!1)}function rr(e){return Ye(e,8).getFloat64(0,!1)}function or(e){return Ye(e,8).getBigInt64(0,!1)}var ir=[e=>{},e=>null,Ke,Xe,rr,or,e=>!1,e=>!0,Ce,e=>{let t=re(e),n={};for(let r=0;r<t;r++){let o=Ce(e);n[o]=oe(e);}return n},e=>{let t=re(e),n=[];for(let r=0;r<t;r++)n.push(oe(e));return n},Ue];function oe(e){return ir[127-de(e)](e)}function ge(e,t,n){return new Uint8Array(e,t,n)}var Qe=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[];}};function Ee(){return new Qe}function et(e){let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t}function Pe(e){let t=new Uint8Array(et(e)),n=0;for(let r=0;r<e.bufs.length;r++){let o=e.bufs[r];t.set(o,n),n+=o.length;}return t.set(ge(e.cbuf.buffer,0,e.cpos),n),t}function sr(e,t){let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(ge(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Math.max(n,t)*2),e.cpos=0);}function F(e,t){let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t;}var qt=F;function Wt(e,t){F(e,t&255),F(e,t>>>8&255);}function Jt(e,t){for(let n=0;n<4;n++)F(e,t&255),t>>>=8;}function K(e,t){for(;t>127;)F(e,128|127&t),t=Math.floor(t/128);F(e,127&t);}function ar(e){return e!==0?e<0:1/e<0}function tt(e,t){let n=ar(t);for(n&&(t=-t),F(e,(t>63?128:0)|(n?64:0)|63&t),t=Math.floor(t/64);t>0;)F(e,(t>127?128:0)|127&t),t=Math.floor(t/128);}function Se(e,t){let n=e.cbuf.length,r=e.cpos,o=Math.min(n-r,t.length),i=t.length-o;e.cbuf.set(t.subarray(0,o),r),e.cpos+=o,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Math.max(n*2,i)),e.cbuf.set(t.subarray(o)),e.cpos=i);}function Re(e,t){K(e,t.byteLength),Se(e,t);}function cr(e,t){let n=unescape(encodeURIComponent(t)),r=n.length;K(e,r);for(let o=0;o<r;o++)F(e,n.codePointAt(o));}function Fe(e,t){return cr(e,t)}function nt(e,t){sr(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n}function rt(e,t){return nt(e,4).setFloat32(0,t,!1)}function lr(e,t){return nt(e,8).setFloat64(0,t,!1)}function fr(e,t){return nt(e,8).setBigInt64(0,t,!1)}var De;function pr(e){return De==null&&(De=new DataView(new ArrayBuffer(4))),De.setFloat32(0,e),De.getFloat32(0)===e}function se(e,t){switch(typeof t){case"string":F(e,119),Fe(e,t);break;case"number":Number.isInteger(t)&&Math.abs(t)<=2147483647?(F(e,125),tt(e,t)):pr(t)?(F(e,124),rt(e,t)):(F(e,123),lr(e,t));break;case"bigint":F(e,122),fr(e,t);break;case"object":if(t===null)F(e,126);else if(Array.isArray(t)){F(e,117),K(e,t.length);for(let n=0;n<t.length;n++)se(e,t[n]);}else if(t instanceof Uint8Array)F(e,116),Re(e,t);else {F(e,118);let n=Object.keys(t);K(e,n.length);for(let r=0;r<n.length;r++){let o=n[r];Fe(e,o),se(e,t[o]);}}break;case"boolean":F(e,t?120:121);break;default:F(e,127);}}var Zt=class{async encode(t){let n=Ee();return se(n,t),Pe(n)}async decode(t){return oe(ve(D(t)))}};function ri(e){let t=Ee();return se(t,e),Pe(t)}function oi(e){return oe(ve(D(e)))}function ii(e){let t=Ee();return e!=null&&Se(t,D(e)),{writeBytes:(n,r)=>{let o=D(n);Pt(!(r!=null&&o.length!==r),`Expected ${r} bytes, got ${o.length}`),Se(t,o);},writeBytesVar:n=>Re(t,D(n)),writeUintVar:n=>K(t,n),writeUint8:n=>qt(t,n),writeUint16:n=>Wt(t,n),writeUint32:n=>Jt(t,n),writeIntVar:n=>tt(t,n),writeFloat:n=>rt(t,n),writeStringVar:n=>Fe(t,n),write:n=>se(t,n),getUint8Array:()=>Pe(t),getLength:()=>et(t)}}function si(e){let t=ve(D(e));return {readBytes:n=>Ze(t,n),readBytesVar:()=>Ue(t),readUintVar:()=>re(t),readUint8:()=>de(t),readUint16:()=>Ht(t),readUint32:()=>Nt(t),readIntVar:()=>Ke(t),readFloat:()=>Xe(t),readStringVar:()=>Ce(t),read:()=>oe(t),getOffset:()=>t.pos||0}}function ai(e=0){return {setBit:(t,n=!0)=>n?e|=1<<t:e&=~(1<<t),unsetBit:t=>e&=1<<t,toggleBit:t=>e^=1<<t,getBit:t=>(e&1<<t)!==0,getValue:()=>e}}async function dr(e){return await e.arrayBuffer()}async function ui(e){let t=await dr(e);if(t!=null)return D(t)}function ae(e=16){let t=new Uint8Array(e);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let n=0;n<e;n++)t[n]=Math.floor(Math.random()*256);return t}var Yt="SHA-256",ot="AES-GCM",Kt="PBKDF2",gr=1e5;async function fi(e,t=Yt){return D(await crypto.subtle.digest(t,D(e)))}async function pi(e,t={}){let n=D(e),r=await crypto.subtle.importKey("raw",n,Kt,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:Kt,salt:t.salt?D(t.salt):new Uint8Array(0),iterations:t.iterations??gr,hash:Yt},r,{name:ot,length:256},!0,["encrypt","decrypt"])}function Xt(){return new Uint8Array([1,1])}async function Qt(e,t){let n=Xt(),r=ae(12),o=await crypto.subtle.encrypt({name:ot,iv:r},t,e),i=new Uint8Array(o),s=n.length+r.length+i.length,u=new Uint8Array(s),a=0;return u.set(n,a),a+=n.length,u.set(r,a),a+=r.length,u.set(i,a),u}async function en(e,t){let n=e.subarray(0,2);if(!kt(n,Xt()))return Promise.reject(new Error(`Unknown magic ${n}`));let r=e.subarray(2,2+12),o=e.subarray(2+12,e.length),i=await crypto.subtle.decrypt({name:ot,iv:r},t,o);return new Uint8Array(i)}function mr(){return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}function P(){return typeof crypto<"u"?mr():Math.random()}function gi(e=.25){return P()<e}function mi(e=100,t=0){return t+Math.floor(P()*(e-t))}function yi(e=100,t=0){return t+P()*(e-t)}function hi(e,t,n){return Math.max(e,Math.min(n,t))}function yr(e){return e.reduce((t,n)=>t+n,0)}function xi(e){return yr(e)/e.length}function bi(e){return !/^1?$|^(11+?)\1+$/.test("1".repeat(e))}function wi(e){for(let t=2;t<e;t++)if(e%t===0)return !1;return e>1}var it=6;function Ti(e=0,t=1,n){it=((n??it)*9301+49297)%233280;let r=it/233280;return t+r*(e-t)}function hr(e=""){let[t="",n="asc"]=e.split(" ");return n=n.toLowerCase(),{field:t,orderby:n,asc:n!=="desc",desc:n==="desc"}}function Ai(e,t=!0){return `${e} ${t?"asc":"desc"}`}function st(e,t,n=!0){let r=e||0,o=t||0;return r>o?n?1:-1:r<o?n?-1:1:0}function Ci(e,...t){if(t.length>0){let n=t.map(hr),r=Array.from(e);return r.sort((o,i)=>{for(let{field:s,asc:u}of n){let a=st(o[s],i[s],u);if(a!==0)return a}return 0}),r}return e}function at(e){return e.filter((t,n)=>e.indexOf(t)===n)}function xr(e,t){return at(e.filter(n=>!t.includes(n)))}function br(...e){return at(e.reduce((t=[],n)=>t.concat(n),[]))}function ue(...e){return e.flat(1/0)}function wr(e,t){return at(e).filter(n=>t.includes(n))}function Fi(e,t){return xr(br(e,t),wr(e,t))}function tn(e,t){if(e&&Array.isArray(e)){let n;for(;(n=e.indexOf(t))!==-1;)e.splice(n,1);return e}return []}function Ei(e,t){return e.includes(t)||e.push(t),e}function ut(e,t){return e.splice(0,e.length,...e.filter(t)),e}function Pi(e,t){let n=e.findIndex(r=>r===t);return n>=0?e.splice(n,1):e.push(t),e}function Si(e){return e.splice(0,e.length),e}function Tr(e,t=st){return Array.from(e).sort(t)}function Ri(e){return Tr(e,(t,n)=>t-n)}function Lr(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function nn(e){return e.sort(()=>P()>.5?1:-1),e}function Mi(e){return nn(Array.from(e))}function Ii(e){for(;e.length>1;){let t=Array.from(e);if(nn(t),!Lr(e,t))return t}return e}function ki(e){return e[Math.floor(P()*e.length)]}function Bi(...e){return ue(e).reduce((t,n)=>t!=null?n>t?n:t:n,void 0)}function Oi(...e){return ue(e).reduce((t,n)=>t!=null?n<t?n:t:n,void 0)}function $i(...e){return ue(e).reduce((t,n)=>t+n,0)}function _i(...e){let t=ue(e);return t.reduce((n,r)=>n+r,0)/t.length}function ji(e,t){let n=[],r=0,o=e.length;for(;r<o;)n.push(e.slice(r,r+=t));return n}function Vi(e=0,t){if(e<=0)return [];let n=new Array(e);for(let r=0;r<e;r++)n[r]=t instanceof Function?t(r):t;return n}var Ar={2:"01",8:"01234567",11:"0123456789a",16:"0123456789abcdef",32:"0123456789abcdefghjkmnpqrtuvwxyz","32-crockford":"0123456789ABCDEFGHJKMNPQRSTVWXYZ","32-geohash":"0123456789bcdefghjkmnpqrstuvwxyz","32-agnoster":"0123456789abcdefghjkmnpqrtuvwxyz","32-rfc":"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567","32-hex":"0123456789ABCDEFGHIJKLMNOPQRSTUV","32-zbase":"ybndrfg8ejkmcpqxot1uwisza345h769",36:"0123456789abcdefghijklmnopqrstuvwxyz",58:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",62:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","64-url":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",66:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~",85:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"};function Cr(e){let t=Ar[String(e)];if(!t)if(typeof e=="string")t=e;else throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let n=new Uint8Array(256);for(let g=0;g<n.length;g++)n[g]=255;for(let g=0;g<t.length;g++){let m=t.charAt(g),x=m.charCodeAt(0);if(n[x]!==255)throw new TypeError(`${m} is ambiguous`);n[x]=g;}let r=t.length,o=t.charAt(0),i=Math.log(r)/Math.log(256),s=Math.log(256)/Math.log(r);function u(g,m=-1){let x=D(g);if(x.byteLength===0)return "";let w=0,T=0,h=x.byteLength;for(;T!==h&&x[T]===0;)T++;let b=(h-T)*s+1>>>0,L=new Uint8Array(b);for(;T!==h;){let p=x[T],d=0;for(let l=b-1;(p!==0||d<w)&&l!==-1;l--,d++)p+=256*L[l]>>>0,L[l]=p%r>>>0,p=p/r>>>0;if(p!==0)throw new Error("Non-zero carry");w=d,T++;}let y=b-w;for(;y!==b&&L[y]===0;)y++;let c="";for(;y<b;++y)c+=t.charAt(L[y]);return m>0?c.padStart(m,o):c}function a(g,m=-1){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;g=g.replace(/\s+/gi,"");let x=0,w=0;for(;g[x]===o;)x++;let T=(g.length-x)*i+1>>>0,h=new Uint8Array(T);for(;g[x];){let L=n[g.charCodeAt(x)];if(L===255)throw new Error(`Unsupported character "${g[x]}"`);let y=0;for(let c=T-1;(L!==0||y<w)&&c!==-1;c--,y++)L+=r*h[c]>>>0,h[c]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");w=y,x++;}let b=T-w;for(;b!==T&&h[b]===0;)b++;return m>0?new Uint8Array([...new Uint8Array(m-h.length+b),...h.slice(b)]):h.slice(b)}return {encode:u,decode:a}}var Me;function J(e){Me==null&&(Me=new Map);function t(){let o=Me.get(e);return o==null&&(o=Cr(e),Me.set(e,o)),o}function n(o,i=-1){return t().encode(o,i)}function r(o,i=-1){return t().decode(o,i)}return {encode:n,decode:r}}function ct(e,t=-1){return J(32).encode(e,t)}function rn(e,t=-1){return J(32).decode(e.toLocaleLowerCase().replaceAll("l","1").replaceAll("s","5").replaceAll("o","0").replaceAll("i","1"),t)}function zi(e,t=-1){return J(16).encode(e,t)}function Gi(e,t=-1){return J(16).decode(e,t)}function qi(e,t=-1){return J(58).encode(e,t)}function Wi(e,t=-1){return J(58).decode(e,t)}function lt(e,t=-1){return J(62).encode(e,t)}function on(e,t=-1){return J(62).decode(e,t)}function Ji(e,t){return Math.ceil(e*(Math.log(256)/Math.log(t)))}function Ki(e){return e.length>0&&(/^[A-Z0-9_\-\ ]*$/g.test(e)&&(e=e.toLowerCase()),e=e.replace(/^[-_\ ]+/gi,"").replace(/[-_\ ]+$/gi,"").replace(/[-_\ ]+([a-z0-9])/gi,(t,n)=>n.toUpperCase()),e=e[0].toLowerCase()+e.substring(1)),e}function vr(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}function Yi(e){return e.replace(/\w\S*/g,vr)}function Xi(e,t="-"){return t=typeof t>"u"?"_":t,e.replace(/([a-z\d])([A-Z])/g,`$1${t}$2`).replace(/([A-Z]+)([A-Z][a-z\d]+)/g,`$1${t}$2`).toLowerCase()}var sn=["1","true","yes","y","on"];function ts(e,t=!1){return e==null||typeof e!="string"?t:sn.includes(String(e).trim().toLowerCase())}function ns(e,t=0){return e==null||typeof e!="string"?t:parseInt(e.trim(),10)??t}function rs(e,t=0){return e==null||typeof e!="string"?t:parseFloat(e.trim())??t}function Ur(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:sn.includes(String(e).trim().toLowerCase())}function Dr(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseInt(String(e).trim(),10)??t}function Fr(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseFloat(String(e).trim())??t}function ft(e,t=""){return e==null?t:String(e)??t}var os=Fr,is=Dr,ss=ft,as=Ur;function Er(e,t={}){let{trace:n=!0,pretty:r=!0}=t;return e.map(o=>{if(o&&typeof o=="object"){if(r&&(o instanceof Uint8Array||o instanceof ArrayBuffer))return `
|
|
5
|
+
${Bt(o)}
|
|
6
6
|
`;if(o instanceof Error)return n?`${o.name||"Error"}: ${o.message}
|
|
7
|
-
${o.stack}`:`${o.name||"Error"}: ${o.message}`;try{return r?JSON.stringify(o,null,2):JSON.stringify(o)}catch{}}return String(o)})}function us(e,t={}){return Dr(e,t).join(" ")}function cs(e){try{return decodeURIComponent(escape(e))}catch{}return e}function ps(e){if(e.startsWith("data:"))return Te(e.split(",",2)[1])}function ds(e){if(e.startsWith("data:"))return e.slice(5).split(",",2)[0]}function gs(e){if(e.startsWith("data:")){let[t,n]=e.slice(5).split(",",2);return new Blob([Te(n)],{type:t})}}async function ms(e){let t=await e.arrayBuffer();if(t)return `data:${e.type},${fe(t)}`}function ys(e,t="application/octet-stream"){return `data:${t},${fe(e)}`}var sn=864e5;function dt(e){return Math.floor(e/1e4)}function an(e){return Math.floor(e/100%100)}function Fr(e){return Math.floor(e%100)}function xs(e){return [dt(e),an(e),Fr(e)]}function un(e,t=!1){return t?new Date(`${Sr(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}function cn(){return ke(new Date)}function bs(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return ln(e);if(Array.isArray(e)&&e.length===3){let[n,r,o]=e;return gt(n,r,o)}else if(e instanceof Date)return ke(e,t)}function ws(e){return un(e,!0)}function ke(e,t=!1){return t?ln(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}function Ts(e){return ke(e,!0)}function pt(e,t=!0){return un(e,t).getTime()}function Er(e,t=!0){return ke(new Date(e),t)}function Sr(e,t="-"){let n=String(e);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}function gt(e,t=1,n=1){if(!(t<1||t>12||n<1||n>31))return e*1e4+t*100+n}function ln(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return +t}function Ls(e,t=0){let n=dt(e),r=an(e);return t!==0&&(r+=t,n+=Math.floor((r-1)/12),r=Math.floor((r-1)%12)+1,r===0&&(r=12)),gt(n,r,1)}function As(e,t=0){let n=dt(e);return gt(n+t,1,1)}function Re(e,t){return Er(pt(e)+t*864e5)}function Cs(e,t){return Math.round((pt(t)-pt(e))/864e5)}function Us(e,t){let n=[];for(t==null&&(t=cn()),e<0&&(e=Re(t,e+1));e<=t;)n.push(e),e=Re(e,1);return n}function*vs(e,t){let n=[];for(t==null&&(t=cn()),e<0&&(e=Re(t,e+1));e<=t;)yield e,e=Re(e,1);return n}function fn(){let e,t;return [new Promise((r,o)=>{e=r,t=o;}),e,t]}async function Fs(e){return new Promise(t=>setTimeout(t,e))}async function Es(){return new Promise(e=>setTimeout(e,0))}async function Ss(e,t,n="timeoutReached"){return new Promise(async(r,o)=>{let i=!1,s=setTimeout(()=>{i=!0,r(n);},t);try{let u=await e;clearTimeout(s),i||r(u);}catch(u){clearTimeout(s),i||o(u);}})}function Ps(e){return e==="timeoutReached"||e?.name==="Timeout reached"}async function pn(e,t){return t<=0?await e:new Promise(async(n,r)=>{let o=!1,i=setTimeout(()=>{o=!0,r(new Error("Timeout reached"));},t);try{let s=await e;clearTimeout(i),o||n(s);}catch(s){clearTimeout(i),o||r(s);}})}function Is(e,t,n=1e3){return new Promise((r,o)=>{let i=a=>{u&&(clearTimeout(u),s(),r(a));},s=()=>{u=null,e.off?e.off(t,i):e.removeEventListener&&e.removeEventListener(t,i);},u=setTimeout(()=>{s(),o(new Error("Did not response in time"));},n);e.on?e.on(t,i):e.addEventListener&&e.addEventListener(t,i);})}function R(e){return !!(e&&(e instanceof Promise||typeof e.then=="function"))}function G(e){return Promise.resolve(e)}var U=class{get value(){return this.days}constructor(t){if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=U.from(t)?.days),t==null){let n=new Date;this.days=n.getFullYear()*1e4+(n.getMonth()+1)*100+n.getDate();}else this.days=t;}static fromNumber(t){return new U(t)}static fromString(t){return U.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,n=!1){return n?U.fromString(t.toISOString().substr(0,10)):U.from(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return U.fromDate(t,!0)}static from(t,n=!1){if(typeof t=="number")return t<100?void 0:new U(t);if(typeof t=="string")return U.fromString(t);if(Array.isArray(t)&&t.length===3){let[r,o=1,i=1]=t;return o<1||o>12||i<1||i>31?void 0:new U(r*1e4+o*100+i)}else {if(t instanceof Date)return U.fromDate(t,n);if(t instanceof U)return t}}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let n=String(this.days);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}toDate(t=!1){return t?new Date(`${this.toString()}T00:00:00.000Z`):new Date(this.days/1e4,this.days/100%100-1,this.days%100)}toDateGMT(){return this.toDate(!0)}get year(){return Math.floor(this.days/1e4)}get month(){return Math.floor(this.days/100%100)}get day(){return Math.floor(this.days%100)}dayOffset(t){return U.fromDateGMT(new Date(this.toDateGMT().getTime()+t*864e5))}monthStart(){return U.from([this.year,this.month,1])}yearStart(){return U.from([this.year,1,1])}monthOffset(t){let n=this.month+t,r=Math.floor((n-1)%12)+1;r===0&&(r=12);let o=Math.floor((n-1)/12);return U.from([this.year+o,r,this.day])}daysUntil(t){return Math.round((new U(t)?.toDateGMT().getTime()-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};async function ks(e,t,n){let r=U.from(e),o=U.from(t);for(;r&&o&&r?.days<=o?.days;){let i=n(r);R(i)&&await i,r=r.dayOffset(1);}}function Bs(){return new U}function $s(e){return new U(e)}function Os(e){return U.fromDate(new Date(e)).days}function Pr(e,t=2){return +(+e).toFixed(t)}function Vs(e,t=2){return +(+e/10**t).toFixed(t)}function js(e,t=2){return Math.round(+e*10**t)}function Hs(e,t=2){return t*(Pr(e,t)%1)}function Gs(e,t,n){let r=e[t];return r===void 0&&(r=n(t,e),e[t]=r),r}async function qs(e,t,n){let r=e[t];return r===void 0&&(r=await n(t,e),e[t]=r),r}function dn(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}function Ws(e){return e!=null&&e.length>0?e[0]:void 0}function Js(e){return e!=null&&e.length>0?e[e.length-1]:void 0}function Zs(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:e?.size!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.warn("Failed to check if empty for",e,t);}return !0}function mt(e){return Object(e)!==e?e:JSON.parse(M(e))}function Ks(e){return Object(e)!==e?e:JSON.parse(M(e))}function Ys(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=e(n);return t.set(n,r),r}}function Xs(e){let t=new Map;return async(...n)=>{let r=M(n);if(t.has(r))return t.get(r);let o=await e(...n);return t.set(r,o),o}}function Qs(e,t){let n=[];for(let r=0;r<e;r++)n.push(t(r,e));return n}function N(e){return e!=null&&typeof e=="object"}function yt(e){return Object(e)!==e}function q(e){return Array.isArray(e)}function Be(e){return N(e)&&!q(e)}function na(e){return e?.constructor===Object}function gn(e){return typeof e=="string"}function mn(e){return typeof e=="number"&&!isNaN(e)}function ra(e){return mn(e)&&Number.isInteger(e)}function oa(e){return mn(e)&&Number.isSafeInteger(e)}function yn(e){return typeof e=="boolean"}function ia(e){return e==null}function sa(e){return e==null}function aa(e){return N(e)&&e.constructor.name==="Uint8Array"}function ua(e){return e!=null}function Ir(e){return e==null||e===""||N(e)&&dn(e)<=0}function ca(e){return !Ir(e)}function la(e){return e!=null&&e!==!1&&e!==!0}function fa(e){return e!=null&&e!==!1&&e!==0&&e!==""}function Mr(e,t,n=new WeakSet){if(e===t)return !0;if(n.has(t)||(yt(t)||n.add(t),!(e instanceof Object)||!(t instanceof Object))||e.constructor!==t.constructor||e.length!==t.length)return !1;for(let r in e){if(!e.hasOwnProperty(r))continue;if(!t.hasOwnProperty(r))return !1;let o=e[r],i=t[r];if(!Mr(o,i,n))return !1}for(let r in t)if(t.hasOwnProperty(r)&&!e.hasOwnProperty(r))return !1;return !0}function Rr(e,t=new WeakSet){if(t.has(e))return "[Circular ~]";if(yt(e)||t.add(e),Be(e)){for(let n in e)if(e.hasOwnProperty(n)){if(e[n]===void 0){delete e[n];continue}Rr(e[n],t);}}else if(q(e))for(let n=e.length-1;n>=0;n--)e[n]===void 0&&e.splice(n,1);return e}function $e(e,...t){for(let n of t)N(e)||(e={}),!(n==null||!N(n))&&Object.keys(n).forEach(r=>{let o=e[r],i=n[r];Array.isArray(o)&&Array.isArray(i)?e[r]=o.concat(i):N(o)&&N(i)?e[r]=$e(Object.assign({},o),i):e[r]=i;});return e}function kr(e,t,n={cyclesFix:!0},r=[]){let o=[],i=Array.isArray(e);for(let u in e){let a=e[u],g=i?+u:u;if(!(u in t)){o.push({type:"del",path:[g]});continue}let m=t[u],x=typeof a=="object"&&typeof m=="object";if(a&&m&&x&&!["Date","RegExp","String","Number"].includes(Object.getPrototypeOf(a).constructor.name)&&(!n.cyclesFix||!r.includes(a))){let w=kr(a,m,n,n.cyclesFix?r.concat([a]):[]);o=[...o,...w.map(T=>(T.path.unshift(g),T))];}else a!==m&&!(x&&(isNaN(a)?`${a}`==`${m}`:+a==+m))&&o.push({path:[g],type:"upd",value:m});}let s=Array.isArray(t);for(let u in t)u in e||o.push({type:"new",path:[s?+u:u],value:t[u]});return o}var hn=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),ya=e=>e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&");function xa(e,t,n=[]){return e.filter(r=>!t.some(o=>!o(r))).map(r=>{for(let o of n)r=o(r);return r}).filter(r=>r!=null)}function ba(e,t){return e.reduce((n,r)=>{let o=String(r[t]);return (n[o]=n[o]||[]).push(r),n},{})}function wa(e,t){return Array.from(e.reduce((n,r)=>n.add(r[t]),new Set))}function Ta(e,t){return e.map(n=>n[t])}function Ca(e,t){return N(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>{let o=t(n,r);return q(o)&&o.length===2?o:[n,o]}).filter(n=>n!=null)):{}}function Ua(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}function va(e){return Object.keys(e).length<=0}var Br=/[\\\-\[\]\/{}()*+?.^$|]/g;function Oe(e){return e?e instanceof RegExp?e.source:e.replace(Br,"\\$&"):""}var $r=100,Or=/^\.+/,_r=/\.+$/,Vr=/[<>:\"/\\|?*\u0000-\u001F\u0080-\u009F]+/gm;function xn(){return Vr}function jr(){return /^(con|prn|aux|nul|com\d|lpt\d)$/i}function Sa(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(xn().test(t))throw new Error("Replacement string cannot contain reserved filename characters");let n=`(${Oe(t)})+`;return e=e.replace(xn(),t).replace(Or,t).replace(_r,"").replace(new RegExp(n,"gm"),t).trim(),e=jr().test(e)?e+t:e,e.slice(0,$r)}var ye=e=>Math.abs(e)%1===.5,bn=e=>e%2===0,Ia=e=>Math.ceil(e),Ma=e=>Math.floor(e),Ra=e=>Math.round(e),ka=e=>{let t=Math.round(e);return ye(e)&&bn(t)?t-1:t},Ba=e=>ye(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),$a=e=>ye(e)?Math.floor(e):Math.round(e),Oa=e=>{let t=Math.round(e);return ye(e)?bn(t)?t:t-1:t},_a=e=>ye(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e);function wn(e){return e.reduce((t,n)=>Math.min(t,n.sort_weight||0),0)-1-S()}function Tn(e){return e.reduce((t,n)=>Math.max(t,n.sort_weight||0),0)+1+S()}function Ha(e,t,n){let r=n.length,o=e<t;if(r<=0||e>=r-1)return Tn(n);if(e<=0)return wn(n);n=Hr([...n]);let i=o?-1:0,s=n[e+i].sort_weight||0,a=(n[e+i+1].sort_weight||0)-s;if(a===0)return o?wn(n):Tn(n);let g=s+a/2,m=a*.01*(S()-.5);return g+m}function Hr(e){return e.sort((t,n)=>(t.sort_weight||0)-(n.sort_weight||0)),e}function Ga(e={}){let{getter:t=u=>u.sort}=e;function n(u){return u.sort((a,g)=>(t(a)||0)-(t(g)||0)),u}function r(u){return u.reduce((a,g)=>Math.min(a,t(g)||0),0)-1-S()}function o(u){return u.reduce((a,g)=>Math.max(a,t(g)||0),0)+1+S()}function i(u,a){u==null&&(u=(a??0)-1),a==null&&(a=(u??0)+1);let g=a-u,m=u+g/2,x=g*.01*(S()-.5);return m+x}function s(u,a,g){let m=g.length,x=u<a;if(m<=0||u>=m-1)return o(g);if(u<=0)return r(g);g=n([...g]);let w=x?-1:0,T=t(g[u+w])||0,b=(t(g[u+w+1])||0)-T;if(b===0)return x?r(g):o(g);let L=T+b/2,y=b*.01*(S()-.5);return L+y}return {start:r,end:o,between:i,move:s,items:n}}var Nr=/((?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00A1-\uFFFF][a-z0-9\u00A1-\uFFFF_-]{0,62})?[a-z0-9\u00A1-\uFFFF]\.)+(?:[a-z\u00A1-\uFFFF]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?)/gim;function Ja(e){return e.split(Nr).map((t,n)=>{let r=hn(t);return n%2?`<a target="_blank" href="${r}">${zr(r)}</a>`:r}).join("")}function zr(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}function Ln(e){let t=[];for(let[n,r]of Object.entries(e))if(r!=null){Array.isArray(r)||(r=[r]);for(let o of r)o!=null&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(o))}`);}return t.join("&")}function Za(e){let t={},n=(e[0]==="?"?e.substr(1):e).split("&");for(let r=0;r<n.length;r++){let o=n[r].split("="),i=decodeURIComponent(o[0]),s=decodeURIComponent(o[1]||"");t[i]!=null?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(s)):t[i]=s;}return t}var Gr=/\\\s|\s+|#[^\n]*\n?/gm,qr=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,An=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm;function Wr(e){return typeof e=="string"?e:e.source||""}function Ya(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}var Cn=class{constructor(t,n){this.namedGroups={};this.names=[];let r=n??"",o;if(t instanceof RegExp?(n==null&&(r=t.flags),o=t.source):o=t,r&&r.includes("x")&&(r=r.replace("x",""),o=o.replace(Gr,u=>u[0]==="\\"?u:"")),!(t instanceof RegExp)){let u=0;o=o.replace(qr,(a,g)=>(u+=1,g?(g!=="index"&&g!=="length"&&!this.namedGroups[g]&&(this.namedGroups[g]=u),"("):a)),this.names=Object.keys(this.namedGroups);}o=Wr(o),An.lastIndex=0;let s=An.exec(o);s&&(this.lookBehind={rx:new RegExp(`${s[3]}$(?!\\s)`),expect:s?s[2]==="=":!s},o=o.substr(s[0].length)),this.rx=new RegExp(o,r);}get lastIndex(){return this.rx.lastIndex}set lastIndex(t){this.rx.lastIndex=t;}_handleMatch(t){if(this.lookBehind){let n=t.input.slice(0,t.index);if(this.lookBehind.expect!==this.lookBehind.rx.test(n))return null}for(let n of this.names)t[n]=t[this.namedGroups[n]];return t}exec(t){let n;for(;n=this.rx.exec(t);)if(this.rx.lastIndex===n.index&&this.rx.lastIndex++,n=this._handleMatch(n),n!=null)return n}execAll(t){let n=[],r;for(this.rx.lastIndex=0;r=this.exec(t);)n.push(r);return this.rx.lastIndex=0,n}replace(t,n){let r=typeof n=="function"?n:()=>n;return t.replace(this.rx,o=>r(o))}};var Jr=",";function eu(e,t={}){let{separator:n=Jr}=t,r="";for(let o=0;o<e.length;o++)r+=`${e[o].map(i=>{if(i==null||i==="")return "";if(yn(i))return i?1:0;let s=String(i);return (Be(i)||q(i))&&(s=M(i)),s.includes('"')||s.includes(`
|
|
7
|
+
${o.stack}`:`${o.name||"Error"}: ${o.message}`;try{return r?JSON.stringify(o,null,2):JSON.stringify(o)}catch{}}return String(o)})}function us(e,t={}){return Er(e,t).join(" ")}function cs(e){try{return decodeURIComponent(escape(e))}catch{}return e}function ps(e){if(e.startsWith("data:"))return Te(e.split(",",2)[1])}function ds(e){if(e.startsWith("data:"))return e.slice(5).split(",",2)[0]}function gs(e){if(e.startsWith("data:")){let[t,n]=e.slice(5).split(",",2);return new Blob([Te(n)],{type:t})}}async function ms(e){let t=await e.arrayBuffer();if(t)return `data:${e.type},${fe(t)}`}function ys(e,t="application/octet-stream"){return `data:${t},${fe(e)}`}var an=864e5;function dt(e){return Math.floor(e/1e4)}function un(e){return Math.floor(e/100%100)}function Pr(e){return Math.floor(e%100)}function xs(e){return [dt(e),un(e),Pr(e)]}function cn(e,t=!1){return t?new Date(`${Rr(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}function ln(){return ke(new Date)}function bs(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return fn(e);if(Array.isArray(e)&&e.length===3){let[n,r,o]=e;return gt(n,r,o)}else if(e instanceof Date)return ke(e,t)}function ws(e){return cn(e,!0)}function ke(e,t=!1){return t?fn(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}function Ts(e){return ke(e,!0)}function pt(e,t=!0){return cn(e,t).getTime()}function Sr(e,t=!0){return ke(new Date(e),t)}function Rr(e,t="-"){let n=String(e);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}function gt(e,t=1,n=1){if(!(t<1||t>12||n<1||n>31))return e*1e4+t*100+n}function fn(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return +t}function Ls(e,t=0){let n=dt(e),r=un(e);return t!==0&&(r+=t,n+=Math.floor((r-1)/12),r=Math.floor((r-1)%12)+1,r===0&&(r=12)),gt(n,r,1)}function As(e,t=0){let n=dt(e);return gt(n+t,1,1)}function Ie(e,t){return Sr(pt(e)+t*864e5)}function Cs(e,t){return Math.round((pt(t)-pt(e))/864e5)}function vs(e,t){let n=[];for(t==null&&(t=ln()),e<0&&(e=Ie(t,e+1));e<=t;)n.push(e),e=Ie(e,1);return n}function*Us(e,t){let n=[];for(t==null&&(t=ln()),e<0&&(e=Ie(t,e+1));e<=t;)yield e,e=Ie(e,1);return n}function pn(){let e,t;return [new Promise((r,o)=>{e=r,t=o;}),e,t]}async function Fs(e){return new Promise(t=>setTimeout(t,e))}async function Es(){return new Promise(e=>setTimeout(e,0))}async function Ps(e,t,n="timeoutReached"){return new Promise(async(r,o)=>{let i=!1,s=setTimeout(()=>{i=!0,r(n);},t);try{let u=await e;clearTimeout(s),i||r(u);}catch(u){clearTimeout(s),i||o(u);}})}function Ss(e){return e==="timeoutReached"||e?.name==="Timeout reached"}async function dn(e,t){return t<=0?await e:new Promise(async(n,r)=>{let o=!1,i=setTimeout(()=>{o=!0,r(new Error("Timeout reached"));},t);try{let s=await e;clearTimeout(i),o||n(s);}catch(s){clearTimeout(i),o||r(s);}})}function Rs(e,t,n=1e3){return new Promise((r,o)=>{let i=a=>{u&&(clearTimeout(u),s(),r(a));},s=()=>{u=null,e.off?e.off(t,i):e.removeEventListener&&e.removeEventListener(t,i);},u=setTimeout(()=>{s(),o(new Error("Did not response in time"));},n);e.on?e.on(t,i):e.addEventListener&&e.addEventListener(t,i);})}function I(e){return !!(e&&(e instanceof Promise||typeof e.then=="function"))}function G(e){return Promise.resolve(e)}var v=class{get value(){return this.days}constructor(t){if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=v.from(t)?.days),t==null){let n=new Date;this.days=n.getFullYear()*1e4+(n.getMonth()+1)*100+n.getDate();}else this.days=t;}static fromNumber(t){return new v(t)}static fromString(t){return v.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,n=!1){return n?v.fromString(t.toISOString().substr(0,10)):v.from(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return v.fromDate(t,!0)}static from(t,n=!1){if(typeof t=="number")return t<100?void 0:new v(t);if(typeof t=="string")return v.fromString(t);if(Array.isArray(t)&&t.length===3){let[r,o=1,i=1]=t;return o<1||o>12||i<1||i>31?void 0:new v(r*1e4+o*100+i)}else {if(t instanceof Date)return v.fromDate(t,n);if(t instanceof v)return t}}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let n=String(this.days);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}toDate(t=!1){return t?new Date(`${this.toString()}T00:00:00.000Z`):new Date(this.days/1e4,this.days/100%100-1,this.days%100)}toDateGMT(){return this.toDate(!0)}get year(){return Math.floor(this.days/1e4)}get month(){return Math.floor(this.days/100%100)}get day(){return Math.floor(this.days%100)}dayOffset(t){return v.fromDateGMT(new Date(this.toDateGMT().getTime()+t*864e5))}monthStart(){return v.from([this.year,this.month,1])}yearStart(){return v.from([this.year,1,1])}monthOffset(t){let n=this.month+t,r=Math.floor((n-1)%12)+1;r===0&&(r=12);let o=Math.floor((n-1)/12);return v.from([this.year+o,r,this.day])}daysUntil(t){return Math.round((new v(t)?.toDateGMT().getTime()-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};async function ks(e,t,n){let r=v.from(e),o=v.from(t);for(;r&&o&&r?.days<=o?.days;){let i=n(r);I(i)&&await i,r=r.dayOffset(1);}}function Bs(){return new v}function Os(e){return new v(e)}function $s(e){return v.fromDate(new Date(e)).days}function Mr(e,t=2){return +(+e).toFixed(t)}function js(e,t=2){return +(+e/10**t).toFixed(t)}function Vs(e,t=2){return Math.round(+e*10**t)}function Hs(e,t=2){return t*(Mr(e,t)%1)}function Gs(e,t,n){let r=e[t];return r===void 0&&(r=n(t,e),e[t]=r),r}async function qs(e,t,n){let r=e[t];return r===void 0&&(r=await n(t,e),e[t]=r),r}function gn(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}function Ws(e){return e!=null&&e.length>0?e[0]:void 0}function Js(e){return e!=null&&e.length>0?e[e.length-1]:void 0}function Zs(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:e?.size!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.warn("Failed to check if empty for",e,t);}return !0}function mt(e){return Object(e)!==e?e:JSON.parse(M(e))}function Ks(e){return Object(e)!==e?e:JSON.parse(M(e))}function Ys(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=e(n);return t.set(n,r),r}}function Xs(e){let t=new Map;return async(...n)=>{let r=M(n);if(t.has(r))return t.get(r);let o=await e(...n);return t.set(r,o),o}}function Qs(e,t){let n=[];for(let r=0;r<e;r++)n.push(t(r,e));return n}function N(e){return e!=null&&typeof e=="object"}function yt(e){return Object(e)!==e}function q(e){return Array.isArray(e)}function Be(e){return N(e)&&!q(e)}function na(e){return e?.constructor===Object}function mn(e){return typeof e=="string"}function yn(e){return typeof e=="number"&&!isNaN(e)}function ra(e){return yn(e)&&Number.isInteger(e)}function oa(e){return yn(e)&&Number.isSafeInteger(e)}function hn(e){return typeof e=="boolean"}function ia(e){return e==null}function sa(e){return e==null}function aa(e){return N(e)&&e.constructor.name==="Uint8Array"}function ua(e){return e!=null}function Ir(e){return e==null||e===""||N(e)&&gn(e)<=0}function ca(e){return !Ir(e)}function la(e){return e!=null&&e!==!1&&e!==!0}function fa(e){return e!=null&&e!==!1&&e!==0&&e!==""}function kr(e,t,n=new WeakSet){if(e===t)return !0;if(n.has(t)||(yt(t)||n.add(t),!(e instanceof Object)||!(t instanceof Object))||e.constructor!==t.constructor||e.length!==t.length)return !1;for(let r in e){if(!e.hasOwnProperty(r))continue;if(!t.hasOwnProperty(r))return !1;let o=e[r],i=t[r];if(!kr(o,i,n))return !1}for(let r in t)if(t.hasOwnProperty(r)&&!e.hasOwnProperty(r))return !1;return !0}function Br(e,t=new WeakSet){if(t.has(e))return "[Circular ~]";if(yt(e)||t.add(e),Be(e)){for(let n in e)if(e.hasOwnProperty(n)){if(e[n]===void 0){delete e[n];continue}Br(e[n],t);}}else if(q(e))for(let n=e.length-1;n>=0;n--)e[n]===void 0&&e.splice(n,1);return e}function Oe(e,...t){for(let n of t)N(e)||(e={}),!(n==null||!N(n))&&Object.keys(n).forEach(r=>{let o=e[r],i=n[r];Array.isArray(o)&&Array.isArray(i)?e[r]=o.concat(i):N(o)&&N(i)?e[r]=Oe(Object.assign({},o),i):e[r]=i;});return e}function Or(e,t,n={cyclesFix:!0},r=[]){let o=[],i=Array.isArray(e);for(let u in e){let a=e[u],g=i?+u:u;if(!(u in t)){o.push({type:"del",path:[g]});continue}let m=t[u],x=typeof a=="object"&&typeof m=="object";if(a&&m&&x&&!["Date","RegExp","String","Number"].includes(Object.getPrototypeOf(a).constructor.name)&&(!n.cyclesFix||!r.includes(a))){let w=Or(a,m,n,n.cyclesFix?r.concat([a]):[]);o=[...o,...w.map(T=>(T.path.unshift(g),T))];}else a!==m&&!(x&&(isNaN(a)?`${a}`==`${m}`:+a==+m))&&o.push({path:[g],type:"upd",value:m});}let s=Array.isArray(t);for(let u in t)u in e||o.push({type:"new",path:[s?+u:u],value:t[u]});return o}function xn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")}function ya(e){return e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&")}function xa(e,t,n=[]){return e.filter(r=>!t.some(o=>!o(r))).map(r=>{for(let o of n)r=o(r);return r}).filter(r=>r!=null)}function ba(e,t){return e.reduce((n,r)=>{let o=String(r[t]);return (n[o]=n[o]||[]).push(r),n},{})}function wa(e,t){return Array.from(e.reduce((n,r)=>n.add(r[t]),new Set))}function Ta(e,t){return e.map(n=>n[t])}function Ca(e,t){return N(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>{let o=t(n,r);return q(o)&&o.length===2?o:[n,o]}).filter(n=>n!=null)):{}}function va(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}function Ua(e){return Object.keys(e).length<=0}var $r=/[\\\-\[\]\/{}()*+?.^$|]/g;function $e(e){return e?e instanceof RegExp?e.source:e.replace($r,"\\$&"):""}var _r=100,jr=/^\.+/,Vr=/\.+$/,Hr=/[<>:\"/\\|?*\u0000-\u001F\u0080-\u009F]+/gm;function bn(){return Hr}function Nr(){return /^(con|prn|aux|nul|com\d|lpt\d)$/i}function Pa(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(bn().test(t))throw new Error("Replacement string cannot contain reserved filename characters");let n=`(${$e(t)})+`;return e=e.replace(bn(),t).replace(jr,t).replace(Vr,"").replace(new RegExp(n,"gm"),t).trim(),e=Nr().test(e)?e+t:e,e.slice(0,_r)}function ye(e){return Math.abs(e)%1===.5}function wn(e){return e%2===0}var Ra=e=>Math.ceil(e),Ma=e=>Math.floor(e),Ia=e=>Math.round(e),ka=e=>{let t=Math.round(e);return ye(e)&&wn(t)?t-1:t},Ba=e=>ye(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),Oa=e=>ye(e)?Math.floor(e):Math.round(e),$a=e=>{let t=Math.round(e);return ye(e)?wn(t)?t:t-1:t},_a=e=>ye(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e);function Tn(e){return e.reduce((t,n)=>Math.min(t,n.sort_weight||0),0)-1-P()}function Ln(e){return e.reduce((t,n)=>Math.max(t,n.sort_weight||0),0)+1+P()}function Ha(e,t,n){let r=n.length,o=e<t;if(r<=0||e>=r-1)return Ln(n);if(e<=0)return Tn(n);n=zr([...n]);let i=o?-1:0,s=n[e+i].sort_weight||0,a=(n[e+i+1].sort_weight||0)-s;if(a===0)return o?Tn(n):Ln(n);let g=s+a/2,m=a*.01*(P()-.5);return g+m}function zr(e){return e.sort((t,n)=>(t.sort_weight||0)-(n.sort_weight||0)),e}function Ga(e={}){let{getter:t=u=>u.sort}=e;function n(u){return u.sort((a,g)=>(t(a)||0)-(t(g)||0)),u}function r(u){return u.reduce((a,g)=>Math.min(a,t(g)||0),0)-1-P()}function o(u){return u.reduce((a,g)=>Math.max(a,t(g)||0),0)+1+P()}function i(u,a){u==null&&(u=(a??0)-1),a==null&&(a=(u??0)+1);let g=a-u,m=u+g/2,x=g*.01*(P()-.5);return m+x}function s(u,a,g){let m=g.length,x=u<a;if(m<=0||u>=m-1)return o(g);if(u<=0)return r(g);g=n([...g]);let w=x?-1:0,T=t(g[u+w])||0,b=(t(g[u+w+1])||0)-T;if(b===0)return x?r(g):o(g);let L=T+b/2,y=b*.01*(P()-.5);return L+y}return {start:r,end:o,between:i,move:s,items:n}}var Gr=/((?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00A1-\uFFFF][a-z0-9\u00A1-\uFFFF_-]{0,62})?[a-z0-9\u00A1-\uFFFF]\.)+(?:[a-z\u00A1-\uFFFF]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?)/gim;function Ja(e){return e.split(Gr).map((t,n)=>{let r=xn(t);return n%2?`<a target="_blank" href="${r}">${qr(r)}</a>`:r}).join("")}function qr(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}function An(e){let t=[];for(let[n,r]of Object.entries(e))if(r!=null){Array.isArray(r)||(r=[r]);for(let o of r)o!=null&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(o))}`);}return t.join("&")}function Za(e){let t={},n=(e[0]==="?"?e.substr(1):e).split("&");for(let r=0;r<n.length;r++){let o=n[r].split("="),i=decodeURIComponent(o[0]),s=decodeURIComponent(o[1]||"");t[i]!=null?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(s)):t[i]=s;}return t}var Wr=/\\\s|\s+|#[^\n]*\n?/gm,Jr=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,Cn=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm;function Zr(e){return typeof e=="string"?e:e.source||""}function Ya(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}var vn=class{constructor(t,n){this.namedGroups={};this.names=[];let r=n??"",o;if(t instanceof RegExp?(n==null&&(r=t.flags),o=t.source):o=t,r&&r.includes("x")&&(r=r.replace("x",""),o=o.replace(Wr,u=>u[0]==="\\"?u:"")),!(t instanceof RegExp)){let u=0;o=o.replace(Jr,(a,g)=>(u+=1,g?(g!=="index"&&g!=="length"&&!this.namedGroups[g]&&(this.namedGroups[g]=u),"("):a)),this.names=Object.keys(this.namedGroups);}o=Zr(o),Cn.lastIndex=0;let s=Cn.exec(o);s&&(this.lookBehind={rx:new RegExp(`${s[3]}$(?!\\s)`),expect:s?s[2]==="=":!s},o=o.substr(s[0].length)),this.rx=new RegExp(o,r);}get lastIndex(){return this.rx.lastIndex}set lastIndex(t){this.rx.lastIndex=t;}_handleMatch(t){if(this.lookBehind){let n=t.input.slice(0,t.index);if(this.lookBehind.expect!==this.lookBehind.rx.test(n))return null}for(let n of this.names)t[n]=t[this.namedGroups[n]];return t}exec(t){let n;for(;n=this.rx.exec(t);)if(this.rx.lastIndex===n.index&&this.rx.lastIndex++,n=this._handleMatch(n),n!=null)return n}execAll(t){let n=[],r;for(this.rx.lastIndex=0;r=this.exec(t);)n.push(r);return this.rx.lastIndex=0,n}replace(t,n){let r=typeof n=="function"?n:()=>n;return t.replace(this.rx,o=>r(o))}};var Kr=",";function eu(e,t={}){let{separator:n=Kr}=t,r="";for(let o=0;o<e.length;o++)r+=`${e[o].map(i=>{if(i==null||i==="")return "";if(hn(i))return i?1:0;let s=String(i);return (Be(i)||q(i))&&(s=M(i)),s.includes('"')||s.includes(`
|
|
8
8
|
`)||s.includes(n)?`"${s.replace(/"/g,'""')}"`:s}).join(n)}
|
|
9
|
-
`;return r}function
|
|
9
|
+
`;return r}function Yr(e,t={}){let n=/("((?:(?:[^"]*?)(?:"")?)*)"|([^,;\t\n]*))([,;\t]|\n|\r\n)/g;t.separator&&(n=new RegExp(n.source.replaceAll(",;\\t",$e(t.separator)),n.flags));let r=[],o=[],i,s=`${e.replaceAll(`\r
|
|
10
10
|
`,`
|
|
11
11
|
`).trim()}
|
|
12
12
|
`;for(;i=n.exec(s);){let u=i[2]??i[3]??"";u=u.replaceAll('""','"'),o.push(u),i[4]===`
|
|
13
|
-
`&&(r.push(o),o=[]);}return r}function tu(e,t={}){let n=Zr(e,t),r=n[0];return n.slice(1).map(o=>Object.fromEntries(o.map((i,s)=>[r[s],i])))}async function Kr(e){typeof e=="function"?await G(e()):R(e)?await e:typeof e.dispose=="function"?await G(e.dispose()):R(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await G(e.cleanup()):R(e.cleanup)&&await e.cleanup;}function he(e){let t=e;t!=null&&(gn(t)?t={name:t}:"debug"in t&&"label"in t&&(t={name:t.label,log:t}));let n=t?.name,r=t?.log??I("zeed:dispose"),o=[],i=async a=>{a!=null&&o.includes(a)&&(ut(o,g=>g!==a),await Kr(a));},s=async()=>{for(n&&r.debug(`dispose "${n}": ${o.length} entries`);o.length>0;)await i(o[0]);},u=a=>{if(a!=null)return o.unshift(a),()=>i(a)};return Object.assign(s,{track:u,add:u,untrack:i,dispose:s,exec:s,getSize(){return o.length},isDisposed(){return o.length<=0}})}var au=he;function uu(e={}){let{mode:t="fifo"}=e,n=[],r=async(i=!1)=>{for(;n.length>0;){let s=n[0];if(ut(n,u=>u!==s),typeof s=="function"){let u=s();if(R(u)){if(i)throw new Error(`Expected sync only function, but found async: ${s}`);await u;}}else if(R(s)){if(i)throw new Error(`Expected sync only function, but found async: ${s}`);await s;}else throw new Error(`Unhandled disposable: ${s}`)}};return Object.assign(r,{add:i=>{t==="lifo"?n.unshift(i):n.push(i);},exec:r,getSize(){return n.length}})}function cu(e,t=0){let n=setTimeout(e,t);return ()=>{n&&(clearTimeout(n),n=void 0);}}function lu(e,t){let n=setInterval(e,t);return ()=>{n&&(clearInterval(n),n=void 0);}}function fu(e,t,n,...r){return e==null?()=>{}:(e.on?e.on(t,n,...r):e.addEventListener&&e.addEventListener(t,n,...r),()=>{e.off?e.off(t,n,...r):e.removeEventListener&&e.removeEventListener(t,n,...r);})}function gu(){let e=!0;return (t,n)=>{let r=!1;if(e){e=!1;try{t(),r=!0;}finally{e=!0;}}else n!==void 0&&n();return r}}function mu(){let e=!0;return async(t,n)=>{let r=!1;if(e){e=!1;try{let o=t();R(o)&&await o,r=!0;}finally{e=!0;}}else if(n!==void 0){let o=n();R(o)&&await o;}return r}}var k=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this._logEmitter=I("zeed:emitter","error");this.dispose=he();this.call=new Proxy({},{get:(t,n)=>async(...r)=>await this.emit(n,...r)});}async emit(t,...n){let r=!1;try{let o=this.subscribers[t]||[];if(this._logEmitter.debug("emit",this?.constructor?.name,t,...n,o),this.subscribersOnAny.forEach(i=>i(t,...n)),o.length>0){let i=o.map(s=>{try{return G(s(...n))}catch(u){this._logEmitter.warn("emit warning:",u);}return null}).filter(s=>s!=null);r=!0,await Promise.all(i);}}catch(o){this._logEmitter.error("emit exception",o);}return r}onAny(t){this.subscribersOnAny.push(t);}on(t,n){let r=this.subscribers[t]||[];return r.push(n),this.subscribers[t]=r,()=>{this.off(t,n);}}onCall(t){for(let[n,r]of Object.entries(t))this.on(n,r);}once(t,n){let r=async(...o)=>(this.off(t,r),await G(n(...o)));return this.on(t,r),()=>{this.off(t,n);}}off(t,n){return this.subscribers[t]=(this.subscribers[t]||[]).filter(r=>n&&r!==n),this}removeAllListeners(){return this.subscribers={},this}};function Lu(){let e=ee().emitter;return e||(e=new k,ee().emitter=e),e}function Au(e,t){let n=Math.round(S()*100),r=[],o,i=(u,a)=>{let g={key:u,obj:a};r.push(g),o&&o();};return t?e.on?e.on(t,u=>{i(t,u);}):e.addEventListener?e.addEventListener(t,u=>{i(t,u);}):e.log.error(n,"Cannot listen to key"):e.onAny?e.onAny((u,a)=>{i(u,a);}):e.log.error(n,"cannot listen to all for",e),(u,a=!0)=>new Promise((g,m)=>{u||(u=t,u||r.length&&(u=r[0].key)),o=()=>{for(;r.length>0;){let x=r.shift();if(x.key===u)o=void 0,g(x.obj);else {if(a)continue;m(new Error(`Expected ${u}, but found ${x.key} with value=${x.obj}`));}break}},o();})}var Y=()=>Date.now();function ht(e){return e>999?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}function Uu(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let n=null;if(t.includes(":"))try{n=new Date(t);}catch{}if(!(n instanceof Date)){let r=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);r&&(n=new Date(+r[1],+r[2]-1,+r[3],12,0));}if(n instanceof Date)return n}}}var Un=()=>typeof performance<"u"?performance.now():Date.now();function vu(){let e=Un();return function(){let t=Un()-e;return ht(t)}}var _e=16;function bt(){return ae(_e)}function Yr(e=bt()){return lt(e,22)}function Xr(e){return lt(e,22)}function Qr(e){return rn(e,_e)}function eo(e=bt()){return ct(e,26)}function to(e){return ct(e,26)}function no(e){return nn(e,_e)}var ro="10000000-1000-4000-8000-100000000000",oo=function(){return typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID():ro.replace(/[018]/g,e=>(e^ae(1)[0]&15>>e/4).toString(16))};function io(e){let t=It(e);return `${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}function so(e){return Mt(e.replaceAll("-",""))}var vn=16e11;function ao(e){let t=new Uint8Array([0,0,0,0,0,0]),n=t.length-1;for(let r=0;r<t.length;r++){let o=e&255;t[n-r]=o,e=(e-o)/256;}return t}function Dn(){let e=Y()-vn;return new Uint8Array([...ao(e),...ae(10)])}function Iu(){return co(Dn())}function Mu(e){return uo(En(e))}function uo(e){return new Date(vn+e.slice(0,6).reduce((t,n)=>t*256+n,0))}function Ru(){return new Uint32Array(ae(4))[0]}var wt={base62:{uuid:Yr,uuidDecode:Qr,uuidEncode:Xr},base32:{uuid:eo,uuidDecode:no,uuidEncode:to},uuidv4:{uuid:oo,uuidDecode:so,uuidEncode:io}},Ve="base62",Fn=!1;function ku(e,t=!1){Ve=e,Fn=t;}function X(){return wt[Ve].uuid(Fn?Dn():bt())}function En(e){return wt[Ve].uuidDecode(e)}function co(e){return wt[Ve].uuidEncode(e)}function Bu(e){try{return En(e).length===_e}catch{}return !1}var xt={};function _(e="id"){return xt[e]==null&&(xt[e]=0),`${e}-${xt[e]++}`}var lo=0;function $u(){return `id-${lo++}`}var Tt=class extends k{constructor(){super(...arguments);this.id=X();}close(){this.dispose();}},je=class extends Tt{constructor(){super(...arguments);this.isConnected=!0;}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:X()});}};function ju(){let e=new je,t=new je;return e.other=t,t.other=e,[e,t]}var Sn=class{async encode(t){return t}async decode(t){return t}},ce=class{async encode(t){return qe(t)}async decode(t){return We(t)}},Pn=class{constructor(t){this.key=t;}async encode(t){let n=qe(t);return await Xt(n,this.key)}async decode(t){let n=await Qt(t,this.key);return We(n)}};var In=(e,t,n={})=>new Proxy(n,{get:(r,o)=>o in r?r[o]:(...i)=>e(o,i,t)});function Yu(e={}){let{name:t=_("hub"),encoder:n=new ce,retryAfter:r=1e3,ignoreUnhandled:o=!0,logLevel:i=!1}=e,s=I(t,i),u={},a,g=[],m,x={},w=()=>{clearTimeout(m);},T=async()=>{if(clearTimeout(m),a){if(a.isConnected)for(;g.length;){let y=g[0];try{a.postMessage(await n.encode(y)),g.shift();}catch(c){s.warn("postMessage",c);break}}g.length>0&&r>0&&(m=setTimeout(T,r));}},h=async y=>{s("enqueue postMessage",y),g.push(y),await T();},b=async y=>{a=y,a.on("connect",T),a.on("message",async c=>{s("onmessage",typeof c);let{name:p,args:d,id:l,result:f,error:A}=await n.decode(c.data);if(p){s(`name ${p} id ${l}`);try{if(u[p]==null)throw new Error(`handler for ${p} was not found`);let v=u[p](...d);R(v)&&(v=await v),s(`result ${v}`),l&&await h({id:l,result:v});}catch(v){let C=v instanceof Error?v:new Error(ft(v));s.warn("execution error",C.name),await h({id:l,error:{message:C.message,stack:C.stack,name:C.name}});}}else if(l)if(s(`response for id=${l}: result=${f}, error=${A}`),x[l]==null)f===void 0?s(`skip response for ${l}`):s.warn(`no response hook for ${l}`);else {let[v,C]=x[l];if(v&&C)if(delete x[l],A){let E=new Error(A.message);E.stack=A.stack,E.name=A.name,s.warn("reject",E.name),C(E);}else s("resolve",f),v(f);}else o||s.warn("Unhandled message",c);}),await T();},L=async(y,c,p={})=>{let{timeout:d=5e3}=p,l=X();return await h({name:y,args:c,id:l}),pn(new Promise((f,A)=>x[l]=[f,A]),d)};return e.channel&&b(e.channel),{dispose:w,connect:b,listen(y){Object.assign(u,y);},send(){return In(L,{},{options(y){return In(L,{...y})}})}}}var Lt=class extends k{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:r,encoder:o=new ce,channel:i,debug:s=!1}=n;this.channel=i,this.encoder=o,this.debug=s,this.name=r??this.channel.id??_("pubsub"),this.log=I(`${this.shortId}`),this.debug&&(this.channel.on("connect",()=>{this.log("channel connected");}),this.channel.on("disconnect",()=>{this.log("channel disconnected");})),this.channel.on("message",async({data:u})=>{let a=await this.encoder.decode(u);if(this.debug?this.log(`channel message, event=${a?.event}, info=`,a):this.log(`channel message, event=${a?.event}`),a){let{event:g,args:m}=a;await this.emitSuper(g,...m);}});}get shortId(){return this.name.substr(0,6)}async emitSuper(n,...r){return await super.emit(n,...r)}async emit(n,...r){try{if(this.debug?this.log(`emit(${String(n)})`,n):this.log(`emit(${String(n)})`,r.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let o=await this.encoder.encode({event:n,args:r});return this.channel.postMessage(o),!0}catch(o){this.log.warn(`emit(${String(n)})`,o);}return !1}};function rc(e){return new Lt(e)}var fo=1;var Mn=e=>e,po=Mn;function ic(e,t){let{post:n,on:r,eventNames:o=[],serialize:i=Mn,deserialize:s=po}=t,u=new Map;return r(async a=>{let g=s(a),[m,x,w,T]=g;if(m===1||m===2){let h,b;if(T!=null)try{let L=e[T];h=await L(...x);}catch(L){b=String(L);}else b="Method implementation missing";m===1&&w&&n(i(b?[4,b,w]:[3,h,w]));}else if(w){let h=u.get(w);h!=null&&(m===4?h.reject(x):h.resolve(x)),u.delete(w);}}),new Proxy({},{get(a,g){let m=(...w)=>{n(i([2,w,null,g]));};if(t.onlyEvents||o.includes(g))return m.asEvent=m,m;let x=(...w)=>new Promise((T,h)=>{let b=fo++;u.set(b,{resolve:T,reject:h}),n(i([1,w,b,g]));});return x.asEvent=m,x}})}var Q=class extends k{constructor(n={}){super();this._isCancelled=!1;this._resetWhenFinished=!0;this._children=[];this._totalUnits=n.totalUnits??0,this._completedUnits=n.completeUnits??0,this._resetWhenFinished=n.resetWhenFinished??!0,this.name=n.name??_("progress"),this.dispose.add(async()=>{for(let r of this._children)await r.dispose();await this.emit("progressDispose",this);});}update(){this.emit("progressChanged",this),this._isCancelled&&this._resetWhenFinished&&this.getTotalUnits()<=this.getCompletedUnits()&&this.reset();}reset(){if(this._isCancelled){this._isCancelled=!1;for(let n of this._children)n.reset();this.update();}}async cancel(){if(!this._isCancelled){this._isCancelled=!0,await this.emit("progressCancelled",this);for(let n of this._children)await n.cancel();this.update();}}addChild(n){n.on("progressDispose",()=>this.removeChild(n)),n.on("progressChanged",()=>this.update()),this._children.includes(n)||this._children.push(n),this.update();}createChildProgress(n){let r=new Q(n);return this.addChild(r),r}removeChild(n){en(this._children,n),this.update();}getTotalUnits(){if(this.isIndeterminate())return 0;let n=this._totalUnits;for(let r of this._children)n+=r.getTotalUnits();return n}getCompletedUnits(){if(this.isIndeterminate())return 0;let n=this._completedUnits;for(let r of this._children)n+=r.getCompletedUnits();return n}isIndeterminate(){return this._totalUnits<=0&&this._children.length<=0}isCancelled(){return this._isCancelled}isFinished(){return this.dispose.isDisposed()||!this.isIndeterminate()&&this.getTotalUnits()<=this.getCompletedUnits()}getFraction(){if(this.isIndeterminate())return 0;let n=this.getCompletedUnits()/this.getTotalUnits();return isNaN(n)&&(n=0),Math.min(1,Math.max(0,n))}getChildrenCount(){return this._children.length}setTotalUnits(n,r){this._totalUnits=n,r!=null&&(this._completedUnits=r),this.update();}incTotalUnits(n=1){this._totalUnits+=n,this.update();}setCompletetedUnits(n){this._completedUnits=n,this.update();}setCompleted(){this._completedUnits=this._totalUnits,this.update();}incCompletedUnits(n=1){this._completedUnits+=n,this.update();}toString(n=0){let r=`${" ".repeat(n)}${this.name}: ${this._completedUnits} of ${this._totalUnits} units, ${Math.floor(this.getFraction()*100)} %, cancel=${this._isCancelled}
|
|
14
|
-
`;for(let o of this._children)r+=o.toString(n+1);return n===0?r.trim():r}};function yc(e={}){let{maxParallel:t=3,name:n=_("pool"),idConflictResolution:r="memoize"}=e,o=new k,i=he();i.add(c);let s=new Q({name:n});s.on("progressCancelled",c);let u=0,a=0,g=0,m=0,x={};async function w(){if(u>0){let[l,f]=fn();return o.once("didFinish",f),l}}async function T(){for(let l of Object.keys(x))x[l].state==="finished"&&(await x[l].progress.dispose(),delete x[l]);}function h(){o.emit("didFinish"),u=0,a=0,T(),s.reset();}function b(){let l=0,f=0;for(let{max:A,resolved:v,state:C}of Object.values(x))l+=A,f+=C==="finished"?A:Math.min(A,v);o.emit("didUpdate",u,a,l,f);}function L(){if(b(),u>0&&u===a&&h(),g>=t)return;let l=Object.values(x).filter(f=>f.state==="waiting");if(l.length>0){let f;for(let A of l)A.group!=null&&Object.values(x).some(v=>v.state==="running"&&v.id!==A.id&&v.group===A.group)||(f==null||A.priority<f.priority)&&(f=A);if(f!=null){let A=f.id,v=f.done;f.state="running",++g,o.emit("didStart",A);let C=E=>{f&&(f.result=E,f.state="finished",f.resolved=f.max,f.progress?.setCompleted()),--g,++a,L();};f.task(f).then(E=>{v(E),o.emit("didResolve",A,E),C(E);}).catch(E=>{v(),o.emit("didReject",A,E),C();});}}}function y(l){let f=x[l];f&&f.state==="waiting"&&(x[l].state="finished",++a,o.emit("didCancel",l),x[l].progress.dispose(),b());}function c(){Object.keys(x).forEach(y);}function p(l){return x[l]!=null}function d(l,f={}){let A,v=new Promise(P=>A=P),C=f.id??X();if(x[C]!=null){let P=f.idConflictResolution??r;if(P==="replace")y(C);else if(P==="memoize"||P==="prioritize"){let Ut=x[C];return P==="prioritize"&&(Ut.priority=++m),{id:C,promise:(async()=>{if(Ut.state==="finished")return x[C].result})(),dispose:()=>y(C),cancel:()=>y(C)}}else throw new Error(`Pool task with id=${C} already exists!`)}let E=new Q({name:C,totalUnits:f.max??1,completeUnits:f.resolved??0});return s.addChild(E),x[C]={id:C,task:l,priority:++m,group:f.group,state:"waiting",max:f.max??1,resolved:f.resolved??0,done:A,payload:f.payload,progress:E,setMax(P){E.setTotalUnits(P),x[C].max=P,b();},setResolved(P){E.setCompletetedUnits(P),x[C].resolved=P,b();},incResolved(P=1){E.incCompletedUnits(P),x[C].resolved+=P,b();}},++u,L(),{id:C,promise:v,dispose:()=>y(C),cancel:()=>y(C)}}return {events:o,cancel:y,cancelAll:c,hasById:p,progress:s,enqueue:d,dispose:i,waitFinishAll:w}}var Rn=class extends k{constructor(n={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:r=_("queue"),logLevel:o}=n;this.name=r,this.log=I(`zeed:queue:${r}`,o??W);}async performNext(){if(this.log("performNext, queue.length =",this.queue.length),this.currentTask!=null){this.log("performNext => skip while another task is running");return}if(this.paused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.paused;){let n=this.queue.shift();if(this.log(`performNext => ${n?.name}`),n==null)break;this.countResolved===0&&this.emit("didStart",this.countMax);let{name:r,task:o,resolve:i}=n;this.currentTask=o();let s;try{this.log.info(`start task ${r}`),s=await this.currentTask,this.log(`finished task ${r} with result =`,s);}catch(u){this.log.warn("Error performing task",u);}i(s),this.currentTask=void 0,this.countResolved+=1,this.emit("didUpdate",this.countMax,this.countResolved);}for(this.queue.length===0&&(this.emit("didFinish"),this.countMax=0,this.countResolved=0);this.waitToFinish.length>0;)this.waitToFinish.shift()();}async enqueue(n,r={}){let{immediate:o=!1,name:i=_(this.name)}=r;return o?(this.log.info(`immediate execution ${i}`),await n()):(this.log(`enqueue ${i}`),new Promise(s=>{this.queue.push({name:i,task:n,resolve:s}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext();}))}async enqueueReentrant(n,r={}){return this.enqueue(n,{immediate:this.currentTask!=null,name:r.name})}async cancelAll(n=!0){this.log("cancelAll"),this.emit("didCancel");let r=this.queue.map(o=>o.resolve);this.queue=[],r.forEach(o=>o(void 0)),await this.wait();}async pause(){this.log("pause"),this.paused=!0,await this.wait();}resume(){this.log("resume"),this.paused=!1,this.performNext();}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.paused)))return new Promise(n=>{this.waitToFinish.push(n);})}get isPaused(){return this.paused}get hasTasks(){return this.queue.length!==0}};function Cc(e,t={}){let{delay:n=100,trailing:r=!0,leading:o=!0}=t,i=0,s=0,u=0,a;function g(){return i?(clearTimeout(i),i=void 0,!0):!1}function m(...x){let w=Date.now(),T=w-s,h=()=>{u=0,s=Date.now(),e.apply(this,x);};if(a=h,T>n||!i){o&&(T>n?h():++u);let b=T>n?n:n-T;g(),s=w,i=setTimeout(()=>{i=0,r&&(!o||u>0)&&a?.();},b);}else ++u;}return m.cancel=g,m.stop=()=>{g()&&a&&a();},m.immediate=async function(...w){g(),s=Date.now(),e.apply(this,w);},m.dispose=()=>m.stop(),m}function Uc(e,t={}){let{delay:n=100}=t,r=0,o=!1,i;function s(){r&&(clearTimeout(r),r=0);}async function u(){try{if(s(),i!=null){let m=[...i];i=void 0,o=!0,await G(e(...m)),o=!1,i!=null&&(s(),r=setTimeout(u,n));}}catch{}}function a(...m){i=[...m],s(),o===!1&&(r=setTimeout(u,n));}async function g(...m){s(),i=[...m],await u();}return a.cancel=s,a.dispose=s,a.immediate=g,a}function Dc(e=globalThis?.location?.hostname??""){return ["::ffff:127.0.0.1","localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}var kn=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function He(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return kn[Math.abs(t)%kn.length]}function Ic(e){let{level:t=void 0,filter:n=void 0,messages:r=[]}=e,o=V(n),i=te(t);return s=>{i(s.level)&&o(s.name)&&(s.timestamp=Y(),r.push(s));}}var At={cache:"no-cache",redirect:"follow",headers:{}};function go(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[n,r]=t[1].split(":",2);return {url:e.replace(`${t[1]}@`,""),username:n,password:r}}}async function Bn(e,t={},n=fetch){try{q(t)&&(t=$e({},...ue(t)));let r=go(String(e));r&&(e=r.url,t=$e({},t,mo(r.username,r.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let o=await n(String(e),t);if(o.status<400)return o;let i=I("zeed:network");try{i.warn(`Fetch of ${String(e)} returned status=${o.status}. Options:`,t),i.warn(`Response: ${await o.text()}`);}catch(s){i.error("Exception:",s);}}catch(r){I("zeed:network").error("fetchBasic",r);}}async function $c(e,t={},n=fetch){try{let r=await Bn(e,[{method:"GET",headers:{Accept:"application/json"}},t],n);if(r)return await r.json()}catch(r){I("zeed:network").error("fetchJSON error:",r);}}async function Oc(e,t={},n=fetch){try{let r=await Bn(e,[At,{method:"GET"},t],n);if(r)return await r.text()}catch(r){I("zeed:network").error("fetchHTML error:",r);}}function _c(e,t="POST"){return {method:t,...At,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:Ln(e)}}function Vc(e,t="POST"){return {method:t,...At,headers:{"Content-Type":"application/json; charset=utf-8"},body:M(e)}}function mo(e,t){return {headers:{Authorization:`Basic ${fe(`${e}:${t}`)}`}}}function $n(){if(typeof window<"u")return window}function yo(){if(typeof navigator<"u")return navigator}function Hc(){return $n()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}function Nc(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,test:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){let t=yo(),n=$n();return e.ios=t?.platform?.match(/(iPhone|iPod|iPad)/i)!=null,e.macos=!!t?.platform?.startsWith("Mac"),e.windows=!!t?.platform?.startsWith("Win"),e.beaker=n?.beaker!=null,e.electron=(t?.userAgent?.toLowerCase()?.indexOf(" electron/")||-1)>-1&&!e.beaker,e.wkwebview=n?.webkit?.messageHandlers!=null,e.pwa=t?.serviceWorker!=null,e.pwaInstalled=t?.standalone||n?.matchMedia?.("(display-mode: standalone)")?.matches,e.node=typeof process<"u"&&process?.release?.name==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,e.jest=typeof jest<"u"||typeof vitest<"u",e.test=e.jest,e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=n&&"ontouchstart"in n||(t?.maxTouchPoints||0)>1||t?.msPointerEnabled&&n?.MSGesture||n?.DocumentTouch&&document instanceof DocumentTouch,e}function Ct(){return typeof window<"u"&&globalThis===window}function zc(e){Ct()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e);}var On=class{constructor(t={}){this.store={};}setItem(t,n){this.store[t]=mt(n);}getItem(t){return mt(this.store[t])}removeItem(t){delete this.store[t];}clear(){this.store={};}allKeys(){return Object.keys(this.store)}};var Jc=()=>{};function Kc(e){let t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(n),o=new Uint8Array(r.length);for(let i=0;i<r.length;++i)o[i]=r.charCodeAt(i);return o}function ho(e,t){let n="0123456789abcdef".split("");function r(y,c){let p=y[0],d=y[1],l=y[2],f=y[3];p=i(p,d,l,f,c[0],7,-680876936),f=i(f,p,d,l,c[1],12,-389564586),l=i(l,f,p,d,c[2],17,606105819),d=i(d,l,f,p,c[3],22,-1044525330),p=i(p,d,l,f,c[4],7,-176418897),f=i(f,p,d,l,c[5],12,1200080426),l=i(l,f,p,d,c[6],17,-1473231341),d=i(d,l,f,p,c[7],22,-45705983),p=i(p,d,l,f,c[8],7,1770035416),f=i(f,p,d,l,c[9],12,-1958414417),l=i(l,f,p,d,c[10],17,-42063),d=i(d,l,f,p,c[11],22,-1990404162),p=i(p,d,l,f,c[12],7,1804603682),f=i(f,p,d,l,c[13],12,-40341101),l=i(l,f,p,d,c[14],17,-1502002290),d=i(d,l,f,p,c[15],22,1236535329),p=s(p,d,l,f,c[1],5,-165796510),f=s(f,p,d,l,c[6],9,-1069501632),l=s(l,f,p,d,c[11],14,643717713),d=s(d,l,f,p,c[0],20,-373897302),p=s(p,d,l,f,c[5],5,-701558691),f=s(f,p,d,l,c[10],9,38016083),l=s(l,f,p,d,c[15],14,-660478335),d=s(d,l,f,p,c[4],20,-405537848),p=s(p,d,l,f,c[9],5,568446438),f=s(f,p,d,l,c[14],9,-1019803690),l=s(l,f,p,d,c[3],14,-187363961),d=s(d,l,f,p,c[8],20,1163531501),p=s(p,d,l,f,c[13],5,-1444681467),f=s(f,p,d,l,c[2],9,-51403784),l=s(l,f,p,d,c[7],14,1735328473),d=s(d,l,f,p,c[12],20,-1926607734),p=u(p,d,l,f,c[5],4,-378558),f=u(f,p,d,l,c[8],11,-2022574463),l=u(l,f,p,d,c[11],16,1839030562),d=u(d,l,f,p,c[14],23,-35309556),p=u(p,d,l,f,c[1],4,-1530992060),f=u(f,p,d,l,c[4],11,1272893353),l=u(l,f,p,d,c[7],16,-155497632),d=u(d,l,f,p,c[10],23,-1094730640),p=u(p,d,l,f,c[13],4,681279174),f=u(f,p,d,l,c[0],11,-358537222),l=u(l,f,p,d,c[3],16,-722521979),d=u(d,l,f,p,c[6],23,76029189),p=u(p,d,l,f,c[9],4,-640364487),f=u(f,p,d,l,c[12],11,-421815835),l=u(l,f,p,d,c[15],16,530742520),d=u(d,l,f,p,c[2],23,-995338651),p=a(p,d,l,f,c[0],6,-198630844),f=a(f,p,d,l,c[7],10,1126891415),l=a(l,f,p,d,c[14],15,-1416354905),d=a(d,l,f,p,c[5],21,-57434055),p=a(p,d,l,f,c[12],6,1700485571),f=a(f,p,d,l,c[3],10,-1894986606),l=a(l,f,p,d,c[10],15,-1051523),d=a(d,l,f,p,c[1],21,-2054922799),p=a(p,d,l,f,c[8],6,1873313359),f=a(f,p,d,l,c[15],10,-30611744),l=a(l,f,p,d,c[6],15,-1560198380),d=a(d,l,f,p,c[13],21,1309151649),p=a(p,d,l,f,c[4],6,-145523070),f=a(f,p,d,l,c[11],10,-1120210379),l=a(l,f,p,d,c[2],15,718787259),d=a(d,l,f,p,c[9],21,-343485551),y[0]=h(p,y[0]),y[1]=h(d,y[1]),y[2]=h(l,y[2]),y[3]=h(f,y[3]);}function o(y,c,p,d,l,f){return c=h(h(c,y),h(d,f)),h(c<<l|c>>>32-l,p)}function i(y,c,p,d,l,f,A){return o(c&p|~c&d,y,c,l,f,A)}function s(y,c,p,d,l,f,A){return o(c&d|p&~d,y,c,l,f,A)}function u(y,c,p,d,l,f,A){return o(c^p^d,y,c,l,f,A)}function a(y,c,p,d,l,f,A){return o(p^(c|~d),y,c,l,f,A)}function g(y){let c=y.length,p=[1732584193,-271733879,-1732584194,271733878],d;for(d=64;d<=y.length;d+=64)r(p,m(y.substring(d-64,d)));y=y.substring(d-64);let l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(d=0;d<y.length;d++)l[d>>2]|=y.charCodeAt(d)<<(d%4<<3);if(l[d>>2]|=128<<(d%4<<3),d>55)for(r(p,l),d=0;d<16;d++)l[d]=0;return l[14]=c*8,r(p,l),p}function m(y){let c=[],p;for(p=0;p<64;p+=4)c[p>>2]=y.charCodeAt(p)+(y.charCodeAt(p+1)<<8)+(y.charCodeAt(p+2)<<16)+(y.charCodeAt(p+3)<<24);return c}function x(y){let c="",p=0;for(;p<4;p++)c+=n[y>>p*8+4&15]+n[y>>p*8&15];return c}function w(y){for(let c=0;c<y.length;c++)y[c]=x(y[c]);return y.join("")}function T(y){return w(g(y))}function h(y,c){return y+c&4294967295}t=t||{};let b=[];t={size:t.size||"50",rating:t.rating||"g",secure:t.secure||location.protocol==="https:",backup:t.backup||""},e=e.trim().toLowerCase();let L=t.secure?"https://secure.gravatar.com/avatar/":"http://www.gravatar.com/avatar/";return t.rating&&b.push(`r=${t.rating}`),t.backup&&b.push(`d=${encodeURIComponent(t.backup)}`),t.size&&b.push(`s=${t.size}`),`${L+T(e)}?${b.join("&")}`}function Xc(e,t=""){try{return ho(e,{size:256,backup:"monsterid",secure:!0})}catch{return t}}var _n=class{constructor(t){this.pretty=!1;this.name=t.name??"zeed",this.prefix=`${t.name}$`,this.objectToString=t.objectToString??(n=>this.pretty?M(n,null,2):M(n)),this.objectFromString=t.objectFromString??(n=>{try{return JSON.parse(n)}catch{}});}setItem(t,n){let r=this.objectToString(n);localStorage.setItem(`${this.prefix}${t}`,r);}getItem(t){let n=localStorage.getItem(`${this.prefix}${t}`);if(n!=null)return this.objectFromString(n)}removeItem(t){localStorage.removeItem(`${this.prefix}${t}`);}clear(){Object.keys(localStorage).filter(t=>t.startsWith(this.prefix)).forEach(t=>{localStorage.removeItem(t);});}allKeys(){let t=this.prefix.length;return Object.keys(localStorage).filter(n=>n.startsWith(this.prefix)).map(n=>n.substr(t))}};function Ne(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Vn(e={}){let t='font-family: "JetBrains Mono", Menlo; font-size: 11px;',n=`${t}`,r=`font-weight: 600; ${t}`,o=Ne(),i={},s=Y(),{filter:u=void 0,level:a=void 0,colors:g=!0,padding:m=16,time:x=!0}=e,w=V(u),T=te(a);return h=>{if(!T(h.level)||!w(h.name))return;let b=x?`+${ht(Y()-s)}`:"",L=h.name||"",y=i[L||""];y==null&&(y={color:He(L)},i[L]=y);let c;switch(m>0&&(L=L.padEnd(16," ")),g&&o?(c=[`%c${L}%c %s %c${b}`],c.push(`color:${y.color}; ${r}`),c.push(n),c.push(h.messages?.[0]??""),c.push(`color:${y.color};`),c.push(...h.messages.slice(1))):c=[L,...h.messages,`+${b}`],c=c.map(p=>p instanceof Uint8Array?`<Uint8Array size=${p.length}>`:p),h.level){case B:e.levelHelper&&(c[0]=`I|* ${c[0]}`),console.info(...c);break;case $:e.levelHelper&&(c[0]=`W|** ${c[0]}`),console.warn(...c);break;case O:e.levelHelper&&(c[0]=`E|*** ${c[0]}`),console.error(...c);break;default:e.levelHelper&&(c[0]=`D| ${c[0]}`),console.debug(...c);break}}}function jn(e={}){let t=e.filter??localStorage.zeed??localStorage.debug,n='font-family: "JetBrains Mono", Menlo; font-size: 11px;',r=`${n}`,o=`font-weight: 600; ${n}`,i=Ne(),s=()=>{};return function u(a="",g){let m,x=V(t),w=le(g??j);if(x(a)&&w!==W){let b=function(L,y){return w<=L?y:()=>{}};let h=[];if(i){let L=He(a);h.push(`%c${a.padEnd(16," ")}%c %s`),h.push(`color:${L}; ${o}`),h.push(r);}else h.push(`[${a}] %s`);m=b(H,console.debug.bind(console,...h)),m.debug=b(H,console.debug.bind(console,...h)),m.info=b(B,console.info.bind(console,...h)),m.warn=b($,console.warn.bind(console,...h)),m.error=b(O,console.error.bind(console,...h)),m.fatal=b(Z,(...L)=>{throw m.error(...L),new Error(`${L.map(String).join(" ")}`)}),m.assert=b(Z,(L,...y)=>{(L==null||typeof L=="number"&&isNaN(L)||!L)&&m.fatal(...y);});}else m=()=>{},m.debug=s,m.info=s,m.warn=s,m.error=s,m.assert=s,m.fatal=s;return m.extend=h=>u(a?`${a}:${h}`:h),m.label=a,m}}function dl(e={}){console.info("activateConsoleDebug is activated by default in browsers");}function xo(e,t){return Ge(n=>{Ct()&&(n.setHandlers([Vn()]),n.setFactory(jn({})));})(e,t)}
|
|
13
|
+
`&&(r.push(o),o=[]);}return r}function tu(e,t={}){let n=Yr(e,t),r=n[0];return n.slice(1).map(o=>Object.fromEntries(o.map((i,s)=>[r[s],i])))}async function Xr(e){typeof e=="function"?await G(e()):I(e)?await e:typeof e.dispose=="function"?await G(e.dispose()):I(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await G(e.cleanup()):I(e.cleanup)&&await e.cleanup;}function he(e){let t=e;t!=null&&(mn(t)?t={name:t}:"debug"in t&&"label"in t&&(t={name:t.label,log:t}));let n=t?.name,r=t?.log??R("zeed:dispose"),o=[],i=async a=>{a!=null&&o.includes(a)&&(ut(o,g=>g!==a),await Xr(a));},s=async()=>{for(n&&r.debug(`dispose "${n}": ${o.length} entries`);o.length>0;)await i(o[0]);},u=a=>{if(a!=null)return o.unshift(a),()=>i(a)};return Object.assign(s,{track:u,add:u,untrack:i,dispose:s,exec:s,getSize(){return o.length},isDisposed(){return o.length<=0}})}var au=he;function uu(e={}){let{mode:t="fifo"}=e,n=[],r=async(i=!1)=>{for(;n.length>0;){let s=n[0];if(ut(n,u=>u!==s),typeof s=="function"){let u=s();if(I(u)){if(i)throw new Error(`Expected sync only function, but found async: ${s}`);await u;}}else if(I(s)){if(i)throw new Error(`Expected sync only function, but found async: ${s}`);await s;}else throw new Error(`Unhandled disposable: ${s}`)}};return Object.assign(r,{add:i=>{t==="lifo"?n.unshift(i):n.push(i);},exec:r,getSize(){return n.length}})}function cu(e,t=0){let n=setTimeout(e,t);return ()=>{n&&(clearTimeout(n),n=void 0);}}function lu(e,t){let n=setInterval(e,t);return ()=>{n&&(clearInterval(n),n=void 0);}}function fu(e,t,n,...r){return e==null?()=>{}:(e.on?e.on(t,n,...r):e.addEventListener&&e.addEventListener(t,n,...r),()=>{e.off?e.off(t,n,...r):e.removeEventListener&&e.removeEventListener(t,n,...r);})}function gu(){let e=!0;return (t,n)=>{let r=!1;if(e){e=!1;try{t(),r=!0;}finally{e=!0;}}else n!==void 0&&n();return r}}function mu(){let e=!0;return async(t,n)=>{let r=!1;if(e){e=!1;try{let o=t();I(o)&&await o,r=!0;}finally{e=!0;}}else if(n!==void 0){let o=n();I(o)&&await o;}return r}}var k=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this._logEmitter=R("zeed:emitter","error");this.dispose=he();this.call=new Proxy({},{get:(t,n)=>async(...r)=>await this.emit(n,...r)});}async emit(t,...n){let r=!1;try{let o=this.subscribers[t]||[];if(this._logEmitter.debug("emit",this?.constructor?.name,t,...n,o),this.subscribersOnAny.forEach(i=>i(t,...n)),o.length>0){let i=o.map(s=>{try{return G(s(...n))}catch(u){this._logEmitter.warn("emit warning:",u);}return null}).filter(s=>s!=null);r=!0,await Promise.all(i);}}catch(o){this._logEmitter.error("emit exception",o);}return r}onAny(t){this.subscribersOnAny.push(t);}on(t,n){let r=this.subscribers[t]||[];return r.push(n),this.subscribers[t]=r,()=>{this.off(t,n);}}onCall(t){for(let[n,r]of Object.entries(t))this.on(n,r);}once(t,n){let r=async(...o)=>(this.off(t,r),await G(n(...o)));return this.on(t,r),()=>{this.off(t,n);}}off(t,n){return this.subscribers[t]=(this.subscribers[t]||[]).filter(r=>n&&r!==n),this}removeAllListeners(){return this.subscribers={},this}};function Lu(){let e=ee().emitter;return e||(e=new k,ee().emitter=e),e}function Au(e,t){let n=Math.round(P()*100),r=[],o,i=(u,a)=>{let g={key:u,obj:a};r.push(g),o&&o();};return t?e.on?e.on(t,u=>{i(t,u);}):e.addEventListener?e.addEventListener(t,u=>{i(t,u);}):e.log.error(n,"Cannot listen to key"):e.onAny?e.onAny((u,a)=>{i(u,a);}):e.log.error(n,"cannot listen to all for",e),(u,a=!0)=>new Promise((g,m)=>{u||(u=t,u||r.length&&(u=r[0].key)),o=()=>{for(;r.length>0;){let x=r.shift();if(x.key===u)o=void 0,g(x.obj);else {if(a)continue;m(new Error(`Expected ${u}, but found ${x.key} with value=${x.obj}`));}break}},o();})}function Y(){return Date.now()}function ht(e){return e>999?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}function vu(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let n=null;if(t.includes(":"))try{n=new Date(t);}catch{}if(!(n instanceof Date)){let r=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);r&&(n=new Date(+r[1],+r[2]-1,+r[3],12,0));}if(n instanceof Date)return n}}}function Un(){return typeof performance<"u"?performance.now():Date.now()}function Uu(){let e=Un();return function(){let t=Un()-e;return ht(t)}}var _e=16;function bt(){return ae(_e)}function Qr(e=bt()){return lt(e,22)}function eo(e){return lt(e,22)}function to(e){return on(e,_e)}function no(e=bt()){return ct(e,26)}function ro(e){return ct(e,26)}function oo(e){return rn(e,_e)}var io="10000000-1000-4000-8000-100000000000",so=function(){return typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID():io.replace(/[018]/g,e=>(e^ae(1)[0]&15>>e/4).toString(16))};function ao(e){let t=Mt(e);return `${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}function uo(e){return It(e.replaceAll("-",""))}var Dn=16e11;function co(e){let t=new Uint8Array([0,0,0,0,0,0]),n=t.length-1;for(let r=0;r<t.length;r++){let o=e&255;t[n-r]=o,e=(e-o)/256;}return t}function Fn(){let e=Y()-Dn;return new Uint8Array([...co(e),...ae(10)])}function Ru(){return fo(Fn())}function Mu(e){return lo(Pn(e))}function lo(e){return new Date(Dn+e.slice(0,6).reduce((t,n)=>t*256+n,0))}function Iu(){return new Uint32Array(ae(4))[0]}var wt={base62:{uuid:Qr,uuidDecode:to,uuidEncode:eo},base32:{uuid:no,uuidDecode:oo,uuidEncode:ro},uuidv4:{uuid:so,uuidDecode:uo,uuidEncode:ao}},je="base62",En=!1;function ku(e,t=!1){je=e,En=t;}function X(){return wt[je].uuid(En?Fn():bt())}function Pn(e){return wt[je].uuidDecode(e)}function fo(e){return wt[je].uuidEncode(e)}function Bu(e){try{return Pn(e).length===_e}catch{}return !1}var xt={};function _(e="id"){return xt[e]==null&&(xt[e]=0),`${e}-${xt[e]++}`}var po=0;function Ou(){return `id-${po++}`}var Tt=class extends k{constructor(){super(...arguments);this.id=X();}close(){this.dispose();}},Ve=class extends Tt{constructor(){super(...arguments);this.isConnected=!0;}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:X()});}};function Vu(){let e=new Ve,t=new Ve;return e.other=t,t.other=e,[e,t]}var Sn=class{async encode(t){return t}async decode(t){return t}},ce=class{async encode(t){return qe(t)}async decode(t){return We(t)}},Rn=class{constructor(t){this.key=t;}async encode(t){let n=qe(t);return await Qt(n,this.key)}async decode(t){let n=await en(t,this.key);return We(n)}};function Mn(e,t,n={}){return new Proxy(n,{get:(r,o)=>o in r?r[o]:(...i)=>e(o,i,t)})}function Yu(e={}){let{name:t=_("hub"),encoder:n=new ce,retryAfter:r=1e3,ignoreUnhandled:o=!0,logLevel:i=!1}=e,s=R(t,i),u={},a,g=[],m,x={},w=()=>{clearTimeout(m);},T=async()=>{if(clearTimeout(m),a){if(a.isConnected)for(;g.length;){let y=g[0];try{a.postMessage(await n.encode(y)),g.shift();}catch(c){s.warn("postMessage",c);break}}g.length>0&&r>0&&(m=setTimeout(T,r));}},h=async y=>{s("enqueue postMessage",y),g.push(y),await T();},b=async y=>{a=y,a.on("connect",T),a.on("message",async c=>{s("onmessage",typeof c);let{name:p,args:d,id:l,result:f,error:A}=await n.decode(c.data);if(p){s(`name ${p} id ${l}`);try{if(u[p]==null)throw new Error(`handler for ${p} was not found`);let U=u[p](...d);I(U)&&(U=await U),s(`result ${U}`),l&&await h({id:l,result:U});}catch(U){let C=U instanceof Error?U:new Error(ft(U));s.warn("execution error",C.name),await h({id:l,error:{message:C.message,stack:C.stack,name:C.name}});}}else if(l)if(s(`response for id=${l}: result=${f}, error=${A}`),x[l]==null)f===void 0?s(`skip response for ${l}`):s.warn(`no response hook for ${l}`);else {let[U,C]=x[l];if(U&&C)if(delete x[l],A){let E=new Error(A.message);E.stack=A.stack,E.name=A.name,s.warn("reject",E.name),C(E);}else s("resolve",f),U(f);}else o||s.warn("Unhandled message",c);}),await T();},L=async(y,c,p={})=>{let{timeout:d=5e3}=p,l=X();return await h({name:y,args:c,id:l}),dn(new Promise((f,A)=>x[l]=[f,A]),d)};return e.channel&&b(e.channel),{dispose:w,connect:b,listen(y){Object.assign(u,y);},send(){return Mn(L,{},{options(y){return Mn(L,{...y})}})}}}var Lt=class extends k{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:r,encoder:o=new ce,channel:i,debug:s=!1}=n;this.channel=i,this.encoder=o,this.debug=s,this.name=r??this.channel.id??_("pubsub"),this.log=R(`${this.shortId}`),this.debug&&(this.channel.on("connect",()=>{this.log("channel connected");}),this.channel.on("disconnect",()=>{this.log("channel disconnected");})),this.channel.on("message",async({data:u})=>{let a=await this.encoder.decode(u);if(this.debug?this.log(`channel message, event=${a?.event}, info=`,a):this.log(`channel message, event=${a?.event}`),a){let{event:g,args:m}=a;await this.emitSuper(g,...m);}});}get shortId(){return this.name.substr(0,6)}async emitSuper(n,...r){return await super.emit(n,...r)}async emit(n,...r){try{if(this.debug?this.log(`emit(${String(n)})`,n):this.log(`emit(${String(n)})`,r.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let o=await this.encoder.encode({event:n,args:r});return this.channel.postMessage(o),!0}catch(o){this.log.warn(`emit(${String(n)})`,o);}return !1}};function rc(e){return new Lt(e)}var In=1;var At=e=>e,kn=At;function ic(e,t){let{post:n,on:r,eventNames:o=[],serialize:i=At,deserialize:s=kn}=t,u=new Map;return r(async a=>{let g=s(a),[m,x,w,T]=g;if(m===1||m===2){let h,b;if(T!=null)try{let L=e[T];h=await L(...x);}catch(L){b=String(L);}else b="Method implementation missing";m===1&&w&&n(i(b?[4,b,w]:[3,h,w]));}else if(w){let h=u.get(w);h!=null&&(m===4?h.reject(x):h.resolve(x)),u.delete(w);}}),new Proxy({},{get(a,g){let m=(...w)=>{n(i([2,w,null,g]));};if(t.onlyEvents||o.includes(g))return m.asEvent=m,m;let x=(...w)=>new Promise((T,h)=>{let b=In++;u.set(b,{resolve:T,reject:h}),n(i([1,w,b,g]));});return x.asEvent=m,x}})}function sc(e){let{post:t,on:n,serialize:r=At,deserialize:o=kn}=e,i=[],s={},u=new Map;n(async g=>{let m=o(g),[x,w,T,h]=m;if(x===1||x===2){let b,L;if(h!=null)try{let y=s[h];b=await y(...w);}catch(y){L=String(y);}else L="Method implementation missing";x===1&&T&&t(r(L?[4,L,T]:[3,b,T]));}else if(T){let b=u.get(T);b!=null&&(x===4?b.reject(w):b.resolve(w)),u.delete(T);}});function a(){return new Proxy({},{get(g,m){let x=(...T)=>{t(r([2,T,null,m]));};if(e.onlyEvents||i.includes(m))return x.asEvent=x,x;let w=(...T)=>new Promise((h,b)=>{let L=In++;u.set(L,{resolve:h,reject:b}),t(r([1,T,L,m]));});return w.asEvent=x,w}})}return function(g,m=[]){return Object.assign(s,g??{}),i.push(...m),a()}}var Q=class extends k{constructor(n={}){super();this._isCancelled=!1;this._resetWhenFinished=!0;this._children=[];this._totalUnits=n.totalUnits??0,this._completedUnits=n.completeUnits??0,this._resetWhenFinished=n.resetWhenFinished??!0,this.name=n.name??_("progress"),this.dispose.add(async()=>{for(let r of this._children)await r.dispose();await this.emit("progressDispose",this);});}update(){this.emit("progressChanged",this),this._isCancelled&&this._resetWhenFinished&&this.getTotalUnits()<=this.getCompletedUnits()&&this.reset();}reset(){if(this._isCancelled){this._isCancelled=!1;for(let n of this._children)n.reset();this.update();}}async cancel(){if(!this._isCancelled){this._isCancelled=!0,await this.emit("progressCancelled",this);for(let n of this._children)await n.cancel();this.update();}}addChild(n){n.on("progressDispose",()=>this.removeChild(n)),n.on("progressChanged",()=>this.update()),this._children.includes(n)||this._children.push(n),this.update();}createChildProgress(n){let r=new Q(n);return this.addChild(r),r}removeChild(n){tn(this._children,n),this.update();}getTotalUnits(){if(this.isIndeterminate())return 0;let n=this._totalUnits;for(let r of this._children)n+=r.getTotalUnits();return n}getCompletedUnits(){if(this.isIndeterminate())return 0;let n=this._completedUnits;for(let r of this._children)n+=r.getCompletedUnits();return n}isIndeterminate(){return this._totalUnits<=0&&this._children.length<=0}isCancelled(){return this._isCancelled}isFinished(){return this.dispose.isDisposed()||!this.isIndeterminate()&&this.getTotalUnits()<=this.getCompletedUnits()}getFraction(){if(this.isIndeterminate())return 0;let n=this.getCompletedUnits()/this.getTotalUnits();return isNaN(n)&&(n=0),Math.min(1,Math.max(0,n))}getChildrenCount(){return this._children.length}setTotalUnits(n,r){this._totalUnits=n,r!=null&&(this._completedUnits=r),this.update();}incTotalUnits(n=1){this._totalUnits+=n,this.update();}setCompletetedUnits(n){this._completedUnits=n,this.update();}setCompleted(){this._completedUnits=this._totalUnits,this.update();}incCompletedUnits(n=1){this._completedUnits+=n,this.update();}toString(n=0){let r=`${" ".repeat(n)}${this.name}: ${this._completedUnits} of ${this._totalUnits} units, ${Math.floor(this.getFraction()*100)} %, cancel=${this._isCancelled}
|
|
14
|
+
`;for(let o of this._children)r+=o.toString(n+1);return n===0?r.trim():r}};function hc(e={}){let{maxParallel:t=3,name:n=_("pool"),idConflictResolution:r="memoize"}=e,o=new k,i=he();i.add(c);let s=new Q({name:n});s.on("progressCancelled",c);let u=0,a=0,g=0,m=0,x={};async function w(){if(u>0){let[l,f]=pn();return o.once("didFinish",f),l}}async function T(){for(let l of Object.keys(x))x[l].state==="finished"&&(await x[l].progress.dispose(),delete x[l]);}function h(){o.emit("didFinish"),u=0,a=0,T(),s.reset();}function b(){let l=0,f=0;for(let{max:A,resolved:U,state:C}of Object.values(x))l+=A,f+=C==="finished"?A:Math.min(A,U);o.emit("didUpdate",u,a,l,f);}function L(){if(b(),u>0&&u===a&&h(),g>=t)return;let l=Object.values(x).filter(f=>f.state==="waiting");if(l.length>0){let f;for(let A of l)A.group!=null&&Object.values(x).some(U=>U.state==="running"&&U.id!==A.id&&U.group===A.group)||(f==null||A.priority<f.priority)&&(f=A);if(f!=null){let A=f.id,U=f.done;f.state="running",++g,o.emit("didStart",A);let C=E=>{f&&(f.result=E,f.state="finished",f.resolved=f.max,f.progress?.setCompleted()),--g,++a,L();};f.task(f).then(E=>{U(E),o.emit("didResolve",A,E),C(E);}).catch(E=>{U(),o.emit("didReject",A,E),C();});}}}function y(l){let f=x[l];f&&f.state==="waiting"&&(x[l].state="finished",++a,o.emit("didCancel",l),x[l].progress.dispose(),b());}function c(){Object.keys(x).forEach(y);}function p(l){return x[l]!=null}function d(l,f={}){let A,U=new Promise(S=>A=S),C=f.id??X();if(x[C]!=null){let S=f.idConflictResolution??r;if(S==="replace")y(C);else if(S==="memoize"||S==="prioritize"){let Ut=x[C];return S==="prioritize"&&(Ut.priority=++m),{id:C,promise:(async()=>{if(Ut.state==="finished")return x[C].result})(),dispose:()=>y(C),cancel:()=>y(C)}}else throw new Error(`Pool task with id=${C} already exists!`)}let E=new Q({name:C,totalUnits:f.max??1,completeUnits:f.resolved??0});return s.addChild(E),x[C]={id:C,task:l,priority:++m,group:f.group,state:"waiting",max:f.max??1,resolved:f.resolved??0,done:A,payload:f.payload,progress:E,setMax(S){E.setTotalUnits(S),x[C].max=S,b();},setResolved(S){E.setCompletetedUnits(S),x[C].resolved=S,b();},incResolved(S=1){E.incCompletedUnits(S),x[C].resolved+=S,b();}},++u,L(),{id:C,promise:U,dispose:()=>y(C),cancel:()=>y(C)}}return {events:o,cancel:y,cancelAll:c,hasById:p,progress:s,enqueue:d,dispose:i,waitFinishAll:w}}var Bn=class extends k{constructor(n={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:r=_("queue"),logLevel:o}=n;this.name=r,this.log=R(`zeed:queue:${r}`,o??W);}async performNext(){if(this.log("performNext, queue.length =",this.queue.length),this.currentTask!=null){this.log("performNext => skip while another task is running");return}if(this.paused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.paused;){let n=this.queue.shift();if(this.log(`performNext => ${n?.name}`),n==null)break;this.countResolved===0&&this.emit("didStart",this.countMax);let{name:r,task:o,resolve:i}=n;this.currentTask=o();let s;try{this.log.info(`start task ${r}`),s=await this.currentTask,this.log(`finished task ${r} with result =`,s);}catch(u){this.log.warn("Error performing task",u);}i(s),this.currentTask=void 0,this.countResolved+=1,this.emit("didUpdate",this.countMax,this.countResolved);}for(this.queue.length===0&&(this.emit("didFinish"),this.countMax=0,this.countResolved=0);this.waitToFinish.length>0;)this.waitToFinish.shift()();}async enqueue(n,r={}){let{immediate:o=!1,name:i=_(this.name)}=r;return o?(this.log.info(`immediate execution ${i}`),await n()):(this.log(`enqueue ${i}`),new Promise(s=>{this.queue.push({name:i,task:n,resolve:s}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext();}))}async enqueueReentrant(n,r={}){return this.enqueue(n,{immediate:this.currentTask!=null,name:r.name})}async cancelAll(n=!0){this.log("cancelAll"),this.emit("didCancel");let r=this.queue.map(o=>o.resolve);this.queue=[],r.forEach(o=>o(void 0)),await this.wait();}async pause(){this.log("pause"),this.paused=!0,await this.wait();}resume(){this.log("resume"),this.paused=!1,this.performNext();}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.paused)))return new Promise(n=>{this.waitToFinish.push(n);})}get isPaused(){return this.paused}get hasTasks(){return this.queue.length!==0}};function vc(e,t={}){let{delay:n=100,trailing:r=!0,leading:o=!0}=t,i=0,s=0,u=0,a;function g(){return i?(clearTimeout(i),i=void 0,!0):!1}function m(...x){let w=Date.now(),T=w-s,h=()=>{u=0,s=Date.now(),e.apply(this,x);};if(a=h,T>n||!i){o&&(T>n?h():++u);let b=T>n?n:n-T;g(),s=w,i=setTimeout(()=>{i=0,r&&(!o||u>0)&&a?.();},b);}else ++u;}return m.cancel=g,m.stop=()=>{g()&&a&&a();},m.immediate=async function(...w){g(),s=Date.now(),e.apply(this,w);},m.dispose=()=>m.stop(),m}function Uc(e,t={}){let{delay:n=100}=t,r=0,o=!1,i;function s(){r&&(clearTimeout(r),r=0);}async function u(){try{if(s(),i!=null){let m=[...i];i=void 0,o=!0,await G(e(...m)),o=!1,i!=null&&(s(),r=setTimeout(u,n));}}catch{}}function a(...m){i=[...m],s(),o===!1&&(r=setTimeout(u,n));}async function g(...m){s(),i=[...m],await u();}return a.cancel=s,a.dispose=s,a.immediate=g,a}function Fc(e=globalThis?.location?.hostname??""){return ["::ffff:127.0.0.1","localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}var On=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function He(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return On[Math.abs(t)%On.length]}function Mc(e){let{level:t=void 0,filter:n=void 0,messages:r=[]}=e,o=j(n),i=te(t);return s=>{i(s.level)&&o(s.name)&&(s.timestamp=Y(),r.push(s));}}var Ct={cache:"no-cache",redirect:"follow",headers:{}};function go(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[n,r]=t[1].split(":",2);return {url:e.replace(`${t[1]}@`,""),username:n,password:r}}}async function $n(e,t={},n=fetch){try{q(t)&&(t=Oe({},...ue(t)));let r=go(String(e));r&&(e=r.url,t=Oe({},t,mo(r.username,r.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let o=await n(String(e),t);if(o.status<400)return o;let i=R("zeed:network");try{i.warn(`Fetch of ${String(e)} returned status=${o.status}. Options:`,t),i.warn(`Response: ${await o.text()}`);}catch(s){i.error("Exception:",s);}}catch(r){R("zeed:network").error("fetchBasic",r);}}async function $c(e,t={},n=fetch){try{let r=await $n(e,[{method:"GET",headers:{Accept:"application/json"}},t],n);if(r)return await r.json()}catch(r){R("zeed:network").error("fetchJSON error:",r);}}async function _c(e,t={},n=fetch){try{let r=await $n(e,[Ct,{method:"GET"},t],n);if(r)return await r.text()}catch(r){R("zeed:network").error("fetchHTML error:",r);}}function jc(e,t="POST"){return {method:t,...Ct,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:An(e)}}function Vc(e,t="POST"){return {method:t,...Ct,headers:{"Content-Type":"application/json; charset=utf-8"},body:M(e)}}function mo(e,t){return {headers:{Authorization:`Basic ${fe(`${e}:${t}`)}`}}}function _n(){if(typeof window<"u")return window}function yo(){if(typeof navigator<"u")return navigator}function Nc(){return _n()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}function zc(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,test:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){let t=yo(),n=_n();return e.ios=t?.platform?.match(/(iPhone|iPod|iPad)/i)!=null,e.macos=!!t?.platform?.startsWith("Mac"),e.windows=!!t?.platform?.startsWith("Win"),e.beaker=n?.beaker!=null,e.electron=(t?.userAgent?.toLowerCase()?.indexOf(" electron/")||-1)>-1&&!e.beaker,e.wkwebview=n?.webkit?.messageHandlers!=null,e.pwa=t?.serviceWorker!=null,e.pwaInstalled=t?.standalone||n?.matchMedia?.("(display-mode: standalone)")?.matches,e.node=typeof process<"u"&&process?.release?.name==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,e.jest=typeof jest<"u"||typeof vitest<"u",e.test=e.jest,e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=n&&"ontouchstart"in n||(t?.maxTouchPoints||0)>1||t?.msPointerEnabled&&n?.MSGesture||n?.DocumentTouch&&document instanceof DocumentTouch,e}function vt(){return typeof window<"u"&&globalThis===window}function Gc(e){vt()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e);}var jn=class{constructor(t={}){this.store={};}setItem(t,n){this.store[t]=mt(n);}getItem(t){return mt(this.store[t])}removeItem(t){delete this.store[t];}clear(){this.store={};}allKeys(){return Object.keys(this.store)}};function Zc(){}function Yc(e){let t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(n),o=new Uint8Array(r.length);for(let i=0;i<r.length;++i)o[i]=r.charCodeAt(i);return o}function ho(e,t){let n="0123456789abcdef".split("");function r(y,c){let p=y[0],d=y[1],l=y[2],f=y[3];p=i(p,d,l,f,c[0],7,-680876936),f=i(f,p,d,l,c[1],12,-389564586),l=i(l,f,p,d,c[2],17,606105819),d=i(d,l,f,p,c[3],22,-1044525330),p=i(p,d,l,f,c[4],7,-176418897),f=i(f,p,d,l,c[5],12,1200080426),l=i(l,f,p,d,c[6],17,-1473231341),d=i(d,l,f,p,c[7],22,-45705983),p=i(p,d,l,f,c[8],7,1770035416),f=i(f,p,d,l,c[9],12,-1958414417),l=i(l,f,p,d,c[10],17,-42063),d=i(d,l,f,p,c[11],22,-1990404162),p=i(p,d,l,f,c[12],7,1804603682),f=i(f,p,d,l,c[13],12,-40341101),l=i(l,f,p,d,c[14],17,-1502002290),d=i(d,l,f,p,c[15],22,1236535329),p=s(p,d,l,f,c[1],5,-165796510),f=s(f,p,d,l,c[6],9,-1069501632),l=s(l,f,p,d,c[11],14,643717713),d=s(d,l,f,p,c[0],20,-373897302),p=s(p,d,l,f,c[5],5,-701558691),f=s(f,p,d,l,c[10],9,38016083),l=s(l,f,p,d,c[15],14,-660478335),d=s(d,l,f,p,c[4],20,-405537848),p=s(p,d,l,f,c[9],5,568446438),f=s(f,p,d,l,c[14],9,-1019803690),l=s(l,f,p,d,c[3],14,-187363961),d=s(d,l,f,p,c[8],20,1163531501),p=s(p,d,l,f,c[13],5,-1444681467),f=s(f,p,d,l,c[2],9,-51403784),l=s(l,f,p,d,c[7],14,1735328473),d=s(d,l,f,p,c[12],20,-1926607734),p=u(p,d,l,f,c[5],4,-378558),f=u(f,p,d,l,c[8],11,-2022574463),l=u(l,f,p,d,c[11],16,1839030562),d=u(d,l,f,p,c[14],23,-35309556),p=u(p,d,l,f,c[1],4,-1530992060),f=u(f,p,d,l,c[4],11,1272893353),l=u(l,f,p,d,c[7],16,-155497632),d=u(d,l,f,p,c[10],23,-1094730640),p=u(p,d,l,f,c[13],4,681279174),f=u(f,p,d,l,c[0],11,-358537222),l=u(l,f,p,d,c[3],16,-722521979),d=u(d,l,f,p,c[6],23,76029189),p=u(p,d,l,f,c[9],4,-640364487),f=u(f,p,d,l,c[12],11,-421815835),l=u(l,f,p,d,c[15],16,530742520),d=u(d,l,f,p,c[2],23,-995338651),p=a(p,d,l,f,c[0],6,-198630844),f=a(f,p,d,l,c[7],10,1126891415),l=a(l,f,p,d,c[14],15,-1416354905),d=a(d,l,f,p,c[5],21,-57434055),p=a(p,d,l,f,c[12],6,1700485571),f=a(f,p,d,l,c[3],10,-1894986606),l=a(l,f,p,d,c[10],15,-1051523),d=a(d,l,f,p,c[1],21,-2054922799),p=a(p,d,l,f,c[8],6,1873313359),f=a(f,p,d,l,c[15],10,-30611744),l=a(l,f,p,d,c[6],15,-1560198380),d=a(d,l,f,p,c[13],21,1309151649),p=a(p,d,l,f,c[4],6,-145523070),f=a(f,p,d,l,c[11],10,-1120210379),l=a(l,f,p,d,c[2],15,718787259),d=a(d,l,f,p,c[9],21,-343485551),y[0]=h(p,y[0]),y[1]=h(d,y[1]),y[2]=h(l,y[2]),y[3]=h(f,y[3]);}function o(y,c,p,d,l,f){return c=h(h(c,y),h(d,f)),h(c<<l|c>>>32-l,p)}function i(y,c,p,d,l,f,A){return o(c&p|~c&d,y,c,l,f,A)}function s(y,c,p,d,l,f,A){return o(c&d|p&~d,y,c,l,f,A)}function u(y,c,p,d,l,f,A){return o(c^p^d,y,c,l,f,A)}function a(y,c,p,d,l,f,A){return o(p^(c|~d),y,c,l,f,A)}function g(y){let c=y.length,p=[1732584193,-271733879,-1732584194,271733878],d;for(d=64;d<=y.length;d+=64)r(p,m(y.substring(d-64,d)));y=y.substring(d-64);let l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(d=0;d<y.length;d++)l[d>>2]|=y.charCodeAt(d)<<(d%4<<3);if(l[d>>2]|=128<<(d%4<<3),d>55)for(r(p,l),d=0;d<16;d++)l[d]=0;return l[14]=c*8,r(p,l),p}function m(y){let c=[],p;for(p=0;p<64;p+=4)c[p>>2]=y.charCodeAt(p)+(y.charCodeAt(p+1)<<8)+(y.charCodeAt(p+2)<<16)+(y.charCodeAt(p+3)<<24);return c}function x(y){let c="",p=0;for(;p<4;p++)c+=n[y>>p*8+4&15]+n[y>>p*8&15];return c}function w(y){for(let c=0;c<y.length;c++)y[c]=x(y[c]);return y.join("")}function T(y){return w(g(y))}function h(y,c){return y+c&4294967295}t=t||{};let b=[];t={size:t.size||"50",rating:t.rating||"g",secure:t.secure||location.protocol==="https:",backup:t.backup||""},e=e.trim().toLowerCase();let L=t.secure?"https://secure.gravatar.com/avatar/":"http://www.gravatar.com/avatar/";return t.rating&&b.push(`r=${t.rating}`),t.backup&&b.push(`d=${encodeURIComponent(t.backup)}`),t.size&&b.push(`s=${t.size}`),`${L+T(e)}?${b.join("&")}`}function Qc(e,t=""){try{return ho(e,{size:256,backup:"monsterid",secure:!0})}catch{return t}}var Vn=class{constructor(t){this.pretty=!1;this.name=t.name??"zeed",this.prefix=`${t.name}$`,this.objectToString=t.objectToString??(n=>this.pretty?M(n,null,2):M(n)),this.objectFromString=t.objectFromString??(n=>{try{return JSON.parse(n)}catch{}});}setItem(t,n){let r=this.objectToString(n);localStorage.setItem(`${this.prefix}${t}`,r);}getItem(t){let n=localStorage.getItem(`${this.prefix}${t}`);if(n!=null)return this.objectFromString(n)}removeItem(t){localStorage.removeItem(`${this.prefix}${t}`);}clear(){Object.keys(localStorage).filter(t=>t.startsWith(this.prefix)).forEach(t=>{localStorage.removeItem(t);});}allKeys(){let t=this.prefix.length;return Object.keys(localStorage).filter(n=>n.startsWith(this.prefix)).map(n=>n.substr(t))}};function Ne(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Hn(e={}){let t='font-family: "JetBrains Mono", Menlo; font-size: 11px;',n=`${t}`,r=`font-weight: 600; ${t}`,o=Ne(),i={},s=Y(),{filter:u=void 0,level:a=void 0,colors:g=!0,padding:m=16,time:x=!0}=e,w=j(u),T=te(a);return h=>{if(!T(h.level)||!w(h.name))return;let b=x?`+${ht(Y()-s)}`:"",L=h.name||"",y=i[L||""];y==null&&(y={color:He(L)},i[L]=y);let c;switch(m>0&&(L=L.padEnd(16," ")),g&&o?(c=[`%c${L}%c %s %c${b}`],c.push(`color:${y.color}; ${r}`),c.push(n),c.push(h.messages?.[0]??""),c.push(`color:${y.color};`),c.push(...h.messages.slice(1))):c=[L,...h.messages,`+${b}`],c=c.map(p=>p instanceof Uint8Array?`<Uint8Array size=${p.length}>`:p),h.level){case B:e.levelHelper&&(c[0]=`I|* ${c[0]}`),console.info(...c);break;case O:e.levelHelper&&(c[0]=`W|** ${c[0]}`),console.warn(...c);break;case $:e.levelHelper&&(c[0]=`E|*** ${c[0]}`),console.error(...c);break;default:e.levelHelper&&(c[0]=`D| ${c[0]}`),console.debug(...c);break}}}function Nn(e={}){let t=e.filter??localStorage.zeed??localStorage.debug,n='font-family: "JetBrains Mono", Menlo; font-size: 11px;',r=`${n}`,o=`font-weight: 600; ${n}`,i=Ne(),s=()=>{};return function u(a="",g){let m,x=j(t),w=le(g??V);if(x(a)&&w!==W){let b=function(L,y){return w<=L?y:()=>{}};let h=[];if(i){let L=He(a);h.push(`%c${a.padEnd(16," ")}%c %s`),h.push(`color:${L}; ${o}`),h.push(r);}else h.push(`[${a}] %s`);m=b(H,console.debug.bind(console,...h)),m.debug=b(H,console.debug.bind(console,...h)),m.info=b(B,console.info.bind(console,...h)),m.warn=b(O,console.warn.bind(console,...h)),m.error=b($,console.error.bind(console,...h)),m.fatal=b(Z,(...L)=>{throw m.error(...L),new Error(`${L.map(String).join(" ")}`)}),m.assert=b(Z,(L,...y)=>{(L==null||typeof L=="number"&&isNaN(L)||!L)&&m.fatal(...y);});}else m=()=>{},m.debug=s,m.info=s,m.warn=s,m.error=s,m.assert=s,m.fatal=s;return m.extend=h=>u(a?`${a}:${h}`:h),m.label=a,m}}function gl(e={}){console.info("activateConsoleDebug is activated by default in browsers");}function xo(e,t){return Ge(n=>{vt()&&(n.setHandlers([Hn()]),n.setFactory(Nn({})));})(e,t)}
|
|
15
15
|
|
|
16
|
-
exports.BinaryEncoder =
|
|
16
|
+
exports.BinaryEncoder = Zt;
|
|
17
17
|
exports.CRYPTO_DEFAULT_ALG = ot;
|
|
18
|
-
exports.CRYPTO_DEFAULT_DERIVE_ALG =
|
|
19
|
-
exports.CRYPTO_DEFAULT_DERIVE_ITERATIONS =
|
|
20
|
-
exports.CRYPTO_DEFAULT_HASH_ALG =
|
|
18
|
+
exports.CRYPTO_DEFAULT_DERIVE_ALG = Kt;
|
|
19
|
+
exports.CRYPTO_DEFAULT_DERIVE_ITERATIONS = gr;
|
|
20
|
+
exports.CRYPTO_DEFAULT_HASH_ALG = Yt;
|
|
21
21
|
exports.Channel = Tt;
|
|
22
|
-
exports.CryptoEncoder =
|
|
23
|
-
exports.DAY_MS =
|
|
24
|
-
exports.Day =
|
|
25
|
-
exports.DefaultLogger =
|
|
22
|
+
exports.CryptoEncoder = Rn;
|
|
23
|
+
exports.DAY_MS = an;
|
|
24
|
+
exports.Day = v;
|
|
25
|
+
exports.DefaultLogger = R;
|
|
26
26
|
exports.Emitter = k;
|
|
27
27
|
exports.JsonEncoder = ce;
|
|
28
|
-
exports.LocalChannel =
|
|
29
|
-
exports.LocalStorage =
|
|
30
|
-
exports.LogLevelAlias =
|
|
31
|
-
exports.LogLevelAll =
|
|
28
|
+
exports.LocalChannel = Ve;
|
|
29
|
+
exports.LocalStorage = Vn;
|
|
30
|
+
exports.LogLevelAlias = Dt;
|
|
31
|
+
exports.LogLevelAll = V;
|
|
32
32
|
exports.LogLevelDebug = H;
|
|
33
|
-
exports.LogLevelError =
|
|
33
|
+
exports.LogLevelError = $;
|
|
34
34
|
exports.LogLevelFatal = Z;
|
|
35
35
|
exports.LogLevelInfo = B;
|
|
36
36
|
exports.LogLevelOff = W;
|
|
37
|
-
exports.LogLevelWarn =
|
|
37
|
+
exports.LogLevelWarn = O;
|
|
38
38
|
exports.Logger = xo;
|
|
39
|
-
exports.LoggerBrowserHandler =
|
|
40
|
-
exports.LoggerBrowserSetupDebugFactory =
|
|
39
|
+
exports.LoggerBrowserHandler = Hn;
|
|
40
|
+
exports.LoggerBrowserSetupDebugFactory = Nn;
|
|
41
41
|
exports.LoggerConsoleHandler = xe;
|
|
42
|
-
exports.LoggerContext =
|
|
43
|
-
exports.LoggerMemoryHandler =
|
|
44
|
-
exports.MemStorage =
|
|
42
|
+
exports.LoggerContext = Ft;
|
|
43
|
+
exports.LoggerMemoryHandler = Mc;
|
|
44
|
+
exports.MemStorage = jn;
|
|
45
45
|
exports.NoopEncoder = Sn;
|
|
46
46
|
exports.Progress = Q;
|
|
47
47
|
exports.PubSub = Lt;
|
|
48
|
-
exports.SerialQueue =
|
|
48
|
+
exports.SerialQueue = Bn;
|
|
49
49
|
exports.Uint8ArrayToDataUri = ys;
|
|
50
|
-
exports.Uint8ArrayToHexDump =
|
|
50
|
+
exports.Uint8ArrayToHexDump = Bt;
|
|
51
51
|
exports.Uint8ArrayToJson = We;
|
|
52
|
-
exports.Uint8ArrayToString =
|
|
53
|
-
exports.XRX =
|
|
54
|
-
exports._decodeUtf8Polyfill =
|
|
55
|
-
exports._encodeUtf8Polyfill =
|
|
56
|
-
exports._useBase =
|
|
57
|
-
exports.activateConsoleDebug =
|
|
52
|
+
exports.Uint8ArrayToString = Rt;
|
|
53
|
+
exports.XRX = vn;
|
|
54
|
+
exports._decodeUtf8Polyfill = Qn;
|
|
55
|
+
exports._encodeUtf8Polyfill = Xn;
|
|
56
|
+
exports._useBase = Cr;
|
|
57
|
+
exports.activateConsoleDebug = gl;
|
|
58
58
|
exports.arrayAvg = _i;
|
|
59
|
-
exports.arrayBatches =
|
|
60
|
-
exports.arrayEmptyInPlace =
|
|
59
|
+
exports.arrayBatches = ji;
|
|
60
|
+
exports.arrayEmptyInPlace = Si;
|
|
61
61
|
exports.arrayFilterInPlace = ut;
|
|
62
62
|
exports.arrayFlatten = ue;
|
|
63
|
-
exports.arrayIntersection =
|
|
64
|
-
exports.arrayIsEqual =
|
|
63
|
+
exports.arrayIntersection = wr;
|
|
64
|
+
exports.arrayIsEqual = Lr;
|
|
65
65
|
exports.arrayMax = Bi;
|
|
66
|
-
exports.arrayMin =
|
|
67
|
-
exports.arrayMinus =
|
|
66
|
+
exports.arrayMin = Oi;
|
|
67
|
+
exports.arrayMinus = xr;
|
|
68
68
|
exports.arrayRandomElement = ki;
|
|
69
|
-
exports.arrayRemoveElement =
|
|
69
|
+
exports.arrayRemoveElement = tn;
|
|
70
70
|
exports.arraySetElement = Ei;
|
|
71
71
|
exports.arrayShuffle = Mi;
|
|
72
|
-
exports.arrayShuffleForce =
|
|
73
|
-
exports.arrayShuffleInPlace =
|
|
74
|
-
exports.arraySorted =
|
|
75
|
-
exports.arraySortedNumbers =
|
|
76
|
-
exports.arraySum =
|
|
72
|
+
exports.arrayShuffleForce = Ii;
|
|
73
|
+
exports.arrayShuffleInPlace = nn;
|
|
74
|
+
exports.arraySorted = Tr;
|
|
75
|
+
exports.arraySortedNumbers = Ri;
|
|
76
|
+
exports.arraySum = $i;
|
|
77
77
|
exports.arraySymmetricDifference = Fi;
|
|
78
|
-
exports.arrayToggleInPlace =
|
|
79
|
-
exports.arrayUnion =
|
|
78
|
+
exports.arrayToggleInPlace = Pi;
|
|
79
|
+
exports.arrayUnion = br;
|
|
80
80
|
exports.arrayUnique = at;
|
|
81
|
-
exports.assert =
|
|
82
|
-
exports.assertCondition =
|
|
81
|
+
exports.assert = Zn;
|
|
82
|
+
exports.assertCondition = Pt;
|
|
83
83
|
exports.avg = xi;
|
|
84
84
|
exports.between = hi;
|
|
85
85
|
exports.bitfield = ai;
|
|
86
|
-
exports.blobToArrayBuffer =
|
|
86
|
+
exports.blobToArrayBuffer = dr;
|
|
87
87
|
exports.blobToDataUri = ms;
|
|
88
88
|
exports.blobToUint8Array = ui;
|
|
89
89
|
exports.browserSelectColorByName = He;
|
|
@@ -92,136 +92,136 @@ exports.cloneJsonObject = Ks;
|
|
|
92
92
|
exports.cloneObject = mt;
|
|
93
93
|
exports.cmp = st;
|
|
94
94
|
exports.composeOrderby = Ai;
|
|
95
|
-
exports.createArray =
|
|
95
|
+
exports.createArray = Vi;
|
|
96
96
|
exports.createBinaryStreamDecoder = si;
|
|
97
97
|
exports.createBinaryStreamEncoder = ii;
|
|
98
|
-
exports.createLocalChannelPair =
|
|
99
|
-
exports.createPromise =
|
|
100
|
-
exports.createPromiseProxy =
|
|
101
|
-
exports.csvParse =
|
|
98
|
+
exports.createLocalChannelPair = Vu;
|
|
99
|
+
exports.createPromise = pn;
|
|
100
|
+
exports.createPromiseProxy = Mn;
|
|
101
|
+
exports.csvParse = Yr;
|
|
102
102
|
exports.csvParseToObjects = tu;
|
|
103
103
|
exports.csvStringify = eu;
|
|
104
104
|
exports.dataUriToBlob = gs;
|
|
105
105
|
exports.dataUriToMimeType = ds;
|
|
106
106
|
exports.dataUriToUint8Array = ps;
|
|
107
|
-
exports.dateStringToDays =
|
|
108
|
-
exports.day =
|
|
109
|
-
exports.dayDay =
|
|
107
|
+
exports.dateStringToDays = $s;
|
|
108
|
+
exports.day = Os;
|
|
109
|
+
exports.dayDay = Pr;
|
|
110
110
|
exports.dayDiff = Cs;
|
|
111
111
|
exports.dayFromAny = bs;
|
|
112
112
|
exports.dayFromDate = ke;
|
|
113
113
|
exports.dayFromDateGMT = Ts;
|
|
114
114
|
exports.dayFromParts = gt;
|
|
115
|
-
exports.dayFromString =
|
|
116
|
-
exports.dayFromTimestamp =
|
|
117
|
-
exports.dayFromToday =
|
|
118
|
-
exports.dayIterator =
|
|
119
|
-
exports.dayMonth =
|
|
115
|
+
exports.dayFromString = fn;
|
|
116
|
+
exports.dayFromTimestamp = Sr;
|
|
117
|
+
exports.dayFromToday = ln;
|
|
118
|
+
exports.dayIterator = Us;
|
|
119
|
+
exports.dayMonth = un;
|
|
120
120
|
exports.dayMonthStart = Ls;
|
|
121
|
-
exports.dayOffset =
|
|
122
|
-
exports.dayRange =
|
|
123
|
-
exports.dayToDate =
|
|
121
|
+
exports.dayOffset = Ie;
|
|
122
|
+
exports.dayRange = vs;
|
|
123
|
+
exports.dayToDate = cn;
|
|
124
124
|
exports.dayToDateGMT = ws;
|
|
125
125
|
exports.dayToParts = xs;
|
|
126
|
-
exports.dayToString =
|
|
126
|
+
exports.dayToString = Rr;
|
|
127
127
|
exports.dayToTimestamp = pt;
|
|
128
128
|
exports.dayYear = dt;
|
|
129
129
|
exports.dayYearStart = As;
|
|
130
130
|
exports.debounce = Uc;
|
|
131
|
-
exports.decimal =
|
|
131
|
+
exports.decimal = Mr;
|
|
132
132
|
exports.decimalCentsPart = Hs;
|
|
133
|
-
exports.decimalFromCents =
|
|
134
|
-
exports.decimalToCents =
|
|
133
|
+
exports.decimalFromCents = js;
|
|
134
|
+
exports.decimalToCents = Vs;
|
|
135
135
|
exports.decodeBase16 = Gi;
|
|
136
|
-
exports.decodeBase32 =
|
|
136
|
+
exports.decodeBase32 = rn;
|
|
137
137
|
exports.decodeBase58 = Wi;
|
|
138
|
-
exports.decodeBase62 =
|
|
138
|
+
exports.decodeBase62 = on;
|
|
139
139
|
exports.decodeJson = oi;
|
|
140
|
-
exports.decrypt =
|
|
141
|
-
exports.deepEqual =
|
|
142
|
-
exports.deepMerge =
|
|
143
|
-
exports.deepStripUndefinedInPlace =
|
|
140
|
+
exports.decrypt = en;
|
|
141
|
+
exports.deepEqual = kr;
|
|
142
|
+
exports.deepMerge = Oe;
|
|
143
|
+
exports.deepStripUndefinedInPlace = Br;
|
|
144
144
|
exports.deriveKeyPbkdf2 = pi;
|
|
145
|
-
exports.detect =
|
|
146
|
-
exports.diffObjects =
|
|
145
|
+
exports.detect = zc;
|
|
146
|
+
exports.diffObjects = Or;
|
|
147
147
|
exports.digest = fi;
|
|
148
|
-
exports.duration =
|
|
148
|
+
exports.duration = Uu;
|
|
149
149
|
exports.empty = Zs;
|
|
150
150
|
exports.encodeBase16 = zi;
|
|
151
151
|
exports.encodeBase32 = ct;
|
|
152
152
|
exports.encodeBase58 = qi;
|
|
153
153
|
exports.encodeBase62 = lt;
|
|
154
154
|
exports.encodeJson = ri;
|
|
155
|
-
exports.encodeQuery =
|
|
156
|
-
exports.encrypt =
|
|
157
|
-
exports.endSortWeight =
|
|
155
|
+
exports.encodeQuery = An;
|
|
156
|
+
exports.encrypt = Qt;
|
|
157
|
+
exports.endSortWeight = Ln;
|
|
158
158
|
exports.ensureKey = Gs;
|
|
159
159
|
exports.ensureKeyAsync = qs;
|
|
160
|
-
exports.equalBinary =
|
|
161
|
-
exports.escapeHTML =
|
|
162
|
-
exports.escapeRegExp =
|
|
160
|
+
exports.equalBinary = kt;
|
|
161
|
+
exports.escapeHTML = xn;
|
|
162
|
+
exports.escapeRegExp = $e;
|
|
163
163
|
exports.estimateSizeForBase = Ji;
|
|
164
|
-
exports.fatal =
|
|
165
|
-
exports.fetchBasic =
|
|
164
|
+
exports.fatal = Jn;
|
|
165
|
+
exports.fetchBasic = $n;
|
|
166
166
|
exports.fetchJson = $c;
|
|
167
167
|
exports.fetchOptionsBasicAuth = mo;
|
|
168
|
-
exports.fetchOptionsFormURLEncoded =
|
|
168
|
+
exports.fetchOptionsFormURLEncoded = jc;
|
|
169
169
|
exports.fetchOptionsJson = Vc;
|
|
170
|
-
exports.fetchText =
|
|
170
|
+
exports.fetchText = _c;
|
|
171
171
|
exports.first = Ws;
|
|
172
172
|
exports.fixBrokenUth8String = cs;
|
|
173
173
|
exports.forEachDay = ks;
|
|
174
174
|
exports.forTimes = Qs;
|
|
175
|
-
exports.formatMessages =
|
|
175
|
+
exports.formatMessages = Er;
|
|
176
176
|
exports.formatMilliseconds = ht;
|
|
177
177
|
exports.fromBase64 = Te;
|
|
178
|
-
exports.fromBase64String =
|
|
178
|
+
exports.fromBase64String = jo;
|
|
179
179
|
exports.fromCamelCase = Xi;
|
|
180
|
-
exports.fromHex =
|
|
181
|
-
exports.getGlobal =
|
|
180
|
+
exports.fromHex = It;
|
|
181
|
+
exports.getGlobal = Nc;
|
|
182
182
|
exports.getGlobalContext = ee;
|
|
183
183
|
exports.getGlobalEmitter = Lu;
|
|
184
184
|
exports.getGlobalLogger = Ge;
|
|
185
|
-
exports.getGlobalLoggerIfExists =
|
|
186
|
-
exports.getNamespaceFilterString =
|
|
185
|
+
exports.getGlobalLoggerIfExists = Et;
|
|
186
|
+
exports.getNamespaceFilterString = Gn;
|
|
187
187
|
exports.getNavigator = yo;
|
|
188
188
|
exports.getPerformanceTimestamp = Un;
|
|
189
|
-
exports.getSecureRandom =
|
|
190
|
-
exports.getSecureRandomIfPossible =
|
|
189
|
+
exports.getSecureRandom = mr;
|
|
190
|
+
exports.getSecureRandomIfPossible = P;
|
|
191
191
|
exports.getTimestamp = Y;
|
|
192
|
-
exports.getWindow =
|
|
193
|
-
exports.gravatarURLByEmail =
|
|
192
|
+
exports.getWindow = _n;
|
|
193
|
+
exports.gravatarURLByEmail = Qc;
|
|
194
194
|
exports.immediate = Es;
|
|
195
195
|
exports.isArray = q;
|
|
196
|
-
exports.isBoolean =
|
|
197
|
-
exports.isBrowser =
|
|
196
|
+
exports.isBoolean = hn;
|
|
197
|
+
exports.isBrowser = vt;
|
|
198
198
|
exports.isEmpty = Ir;
|
|
199
|
-
exports.isEven =
|
|
199
|
+
exports.isEven = wn;
|
|
200
200
|
exports.isHalf = ye;
|
|
201
201
|
exports.isInteger = ra;
|
|
202
|
-
exports.isLocalHost =
|
|
202
|
+
exports.isLocalHost = Fc;
|
|
203
203
|
exports.isNotEmpty = ca;
|
|
204
204
|
exports.isNotNull = ua;
|
|
205
205
|
exports.isNull = sa;
|
|
206
206
|
exports.isNullOrUndefined = ia;
|
|
207
|
-
exports.isNumber =
|
|
207
|
+
exports.isNumber = yn;
|
|
208
208
|
exports.isObject = N;
|
|
209
209
|
exports.isPrime = wi;
|
|
210
210
|
exports.isPrimeRX = bi;
|
|
211
211
|
exports.isPrimitive = yt;
|
|
212
|
-
exports.isPromise =
|
|
212
|
+
exports.isPromise = I;
|
|
213
213
|
exports.isRecord = Be;
|
|
214
214
|
exports.isRecordPlain = na;
|
|
215
215
|
exports.isSafeInteger = oa;
|
|
216
|
-
exports.isString =
|
|
217
|
-
exports.isTimeout =
|
|
216
|
+
exports.isString = mn;
|
|
217
|
+
exports.isTimeout = Ss;
|
|
218
218
|
exports.isTruthy = fa;
|
|
219
219
|
exports.isUint8Array = aa;
|
|
220
220
|
exports.isValue = la;
|
|
221
|
-
exports.joinToUint8Array =
|
|
221
|
+
exports.joinToUint8Array = $o;
|
|
222
222
|
exports.jsonStringify = ko;
|
|
223
223
|
exports.jsonStringifySafe = M;
|
|
224
|
-
exports.jsonStringifySorted =
|
|
224
|
+
exports.jsonStringifySorted = Io;
|
|
225
225
|
exports.jsonToUint8Array = qe;
|
|
226
226
|
exports.last = Js;
|
|
227
227
|
exports.lazyListener = Au;
|
|
@@ -233,104 +233,105 @@ exports.listQuery = xa;
|
|
|
233
233
|
exports.memoize = Ys;
|
|
234
234
|
exports.memoizeAsync = Xs;
|
|
235
235
|
exports.moveSortWeight = Ha;
|
|
236
|
-
exports.noop =
|
|
237
|
-
exports.objectIsEmpty =
|
|
236
|
+
exports.noop = Zc;
|
|
237
|
+
exports.objectIsEmpty = Ua;
|
|
238
238
|
exports.objectMap = Ca;
|
|
239
|
-
exports.objectMergeDisposable =
|
|
239
|
+
exports.objectMergeDisposable = va;
|
|
240
240
|
exports.parseBasicAuth = go;
|
|
241
|
-
exports.parseDate =
|
|
241
|
+
exports.parseDate = vu;
|
|
242
242
|
exports.parseLogLevel = le;
|
|
243
|
-
exports.parseOrderby =
|
|
243
|
+
exports.parseOrderby = hr;
|
|
244
244
|
exports.parseQuery = Za;
|
|
245
245
|
exports.promisify = G;
|
|
246
|
-
exports.qid =
|
|
246
|
+
exports.qid = Ou;
|
|
247
247
|
exports.randomBoolean = gi;
|
|
248
248
|
exports.randomFloat = yi;
|
|
249
249
|
exports.randomInt = mi;
|
|
250
250
|
exports.randomUint8Array = ae;
|
|
251
251
|
exports.regExpEscape = Ya;
|
|
252
|
-
exports.regExpString =
|
|
252
|
+
exports.regExpString = Zr;
|
|
253
253
|
exports.renderMessages = us;
|
|
254
254
|
exports.roundDown = Ma;
|
|
255
255
|
exports.roundHalfAwayFromZero = Ba;
|
|
256
|
-
exports.roundHalfDown =
|
|
257
|
-
exports.roundHalfEven =
|
|
256
|
+
exports.roundHalfDown = Oa;
|
|
257
|
+
exports.roundHalfEven = $a;
|
|
258
258
|
exports.roundHalfOdd = ka;
|
|
259
259
|
exports.roundHalfTowardsZero = _a;
|
|
260
|
-
exports.roundHalfUp =
|
|
261
|
-
exports.roundUp =
|
|
260
|
+
exports.roundHalfUp = Ia;
|
|
261
|
+
exports.roundUp = Ra;
|
|
262
262
|
exports.seededRandom = Ti;
|
|
263
263
|
exports.setUuidDefaultEncoding = ku;
|
|
264
|
-
exports.size =
|
|
264
|
+
exports.size = gn;
|
|
265
265
|
exports.sleep = Fs;
|
|
266
|
-
exports.sortedItems =
|
|
266
|
+
exports.sortedItems = zr;
|
|
267
267
|
exports.sortedOrderby = Ci;
|
|
268
|
-
exports.startSortWeight =
|
|
268
|
+
exports.startSortWeight = Tn;
|
|
269
269
|
exports.stringToBoolean = ts;
|
|
270
270
|
exports.stringToFloat = rs;
|
|
271
271
|
exports.stringToInteger = ns;
|
|
272
272
|
exports.stringToUInt8Array = St;
|
|
273
|
-
exports.suid =
|
|
274
|
-
exports.suidBytes =
|
|
275
|
-
exports.suidBytesDate =
|
|
273
|
+
exports.suid = Ru;
|
|
274
|
+
exports.suidBytes = Fn;
|
|
275
|
+
exports.suidBytesDate = lo;
|
|
276
276
|
exports.suidDate = Mu;
|
|
277
|
-
exports.sum =
|
|
278
|
-
exports.throttle =
|
|
279
|
-
exports.timeout =
|
|
277
|
+
exports.sum = yr;
|
|
278
|
+
exports.throttle = vc;
|
|
279
|
+
exports.timeout = Ps;
|
|
280
280
|
exports.toBase64 = fe;
|
|
281
281
|
exports.toBase64Url = _o;
|
|
282
282
|
exports.toBool = as;
|
|
283
283
|
exports.toCamelCase = Ki;
|
|
284
|
-
exports.toCapitalize =
|
|
284
|
+
exports.toCapitalize = vr;
|
|
285
285
|
exports.toCapitalizeWords = Yi;
|
|
286
286
|
exports.toFloat = os;
|
|
287
|
-
exports.toHex =
|
|
288
|
-
exports.toHumanReadableUrl =
|
|
287
|
+
exports.toHex = Mt;
|
|
288
|
+
exports.toHumanReadableUrl = qr;
|
|
289
289
|
exports.toInt = is;
|
|
290
290
|
exports.toString = ss;
|
|
291
291
|
exports.toUint8Array = D;
|
|
292
|
-
exports.toValidFilename =
|
|
292
|
+
exports.toValidFilename = Pa;
|
|
293
293
|
exports.today = Bs;
|
|
294
|
-
exports.tryTimeout =
|
|
294
|
+
exports.tryTimeout = dn;
|
|
295
295
|
exports.uname = _;
|
|
296
296
|
exports.unescapeHTML = ya;
|
|
297
|
-
exports.urlBase64ToUint8Array =
|
|
297
|
+
exports.urlBase64ToUint8Array = Yc;
|
|
298
298
|
exports.useAsyncMutex = mu;
|
|
299
299
|
exports.useBase = J;
|
|
300
300
|
exports.useDefer = uu;
|
|
301
301
|
exports.useDispose = he;
|
|
302
302
|
exports.useDisposer = au;
|
|
303
303
|
exports.useEventListener = fu;
|
|
304
|
-
exports.useExitHandler =
|
|
304
|
+
exports.useExitHandler = Gc;
|
|
305
305
|
exports.useInterval = lu;
|
|
306
306
|
exports.useLevelFilter = te;
|
|
307
307
|
exports.useMessageHub = Yu;
|
|
308
308
|
exports.useMutex = gu;
|
|
309
|
-
exports.useNamespaceFilter =
|
|
310
|
-
exports.usePool =
|
|
309
|
+
exports.useNamespaceFilter = j;
|
|
310
|
+
exports.usePool = hc;
|
|
311
311
|
exports.usePubSub = rc;
|
|
312
312
|
exports.useRPC = ic;
|
|
313
|
+
exports.useRPCHub = sc;
|
|
313
314
|
exports.useSorted = Ga;
|
|
314
315
|
exports.useTimeout = cu;
|
|
315
316
|
exports.uuid = X;
|
|
316
|
-
exports.uuid32bit =
|
|
317
|
-
exports.uuidB32 =
|
|
318
|
-
exports.uuidB62 =
|
|
317
|
+
exports.uuid32bit = Iu;
|
|
318
|
+
exports.uuidB32 = no;
|
|
319
|
+
exports.uuidB62 = Qr;
|
|
319
320
|
exports.uuidBytes = bt;
|
|
320
|
-
exports.uuidDecode =
|
|
321
|
-
exports.uuidDecodeB32 =
|
|
322
|
-
exports.uuidDecodeB62 =
|
|
323
|
-
exports.uuidDecodeV4 =
|
|
324
|
-
exports.uuidEncode =
|
|
325
|
-
exports.uuidEncodeB32 =
|
|
326
|
-
exports.uuidEncodeB62 =
|
|
327
|
-
exports.uuidEncodeV4 =
|
|
321
|
+
exports.uuidDecode = Pn;
|
|
322
|
+
exports.uuidDecodeB32 = oo;
|
|
323
|
+
exports.uuidDecodeB62 = to;
|
|
324
|
+
exports.uuidDecodeV4 = uo;
|
|
325
|
+
exports.uuidEncode = fo;
|
|
326
|
+
exports.uuidEncodeB32 = ro;
|
|
327
|
+
exports.uuidEncodeB62 = eo;
|
|
328
|
+
exports.uuidEncodeV4 = ao;
|
|
328
329
|
exports.uuidIsValid = Bu;
|
|
329
|
-
exports.uuidv4 =
|
|
330
|
-
exports.valueToBoolean =
|
|
331
|
-
exports.valueToFloat =
|
|
332
|
-
exports.valueToInteger =
|
|
330
|
+
exports.uuidv4 = so;
|
|
331
|
+
exports.valueToBoolean = Ur;
|
|
332
|
+
exports.valueToFloat = Fr;
|
|
333
|
+
exports.valueToInteger = Dr;
|
|
333
334
|
exports.valueToString = ft;
|
|
334
|
-
exports.waitOn =
|
|
335
|
+
exports.waitOn = Rs;
|
|
335
336
|
//# sourceMappingURL=out.js.map
|
|
336
337
|
//# sourceMappingURL=index.browser.cjs.map
|