zeed 0.7.95 → 0.7.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-M7T7UAH7.js → chunk-DTCT2M2D.js} +2 -2
- package/dist/{chunk-M7T7UAH7.js.map → chunk-DTCT2M2D.js.map} +1 -1
- package/dist/chunk-G7UNQQAN.js +5 -0
- package/dist/chunk-G7UNQQAN.js.map +1 -0
- package/dist/{chunk-JL5GA55T.js → chunk-GLNZJHZB.js} +2 -2
- package/dist/{chunk-JL5GA55T.js.map → chunk-GLNZJHZB.js.map} +1 -1
- package/dist/chunk-JGD3KNXY.js +2 -0
- package/dist/{chunk-LNZLD7Y3.js.map → chunk-JGD3KNXY.js.map} +1 -1
- package/dist/chunk-Z5D3PV5I.js +7 -0
- package/dist/{chunk-PRTZGAJJ.js.map → chunk-Z5D3PV5I.js.map} +1 -1
- package/dist/index.all.cjs +8 -8
- package/dist/index.all.cjs.map +1 -1
- package/dist/index.all.d.ts +3 -3
- package/dist/index.all.js +1 -1
- package/dist/index.browser.cjs +4 -4
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.ts +2 -2
- package/dist/index.browser.js +1 -1
- package/dist/index.log.cjs +1 -1
- package/dist/index.log.cjs.map +1 -1
- package/dist/index.log.js +1 -1
- package/dist/index.node.cjs +8 -8
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +2 -2
- package/dist/index.node.js +1 -1
- package/dist/{log-colors-5cf23b92.d.ts → log-colors-a7617733.d.ts} +1 -1
- package/dist/{log-util-1e8a9b16.d.ts → log-util-4c3eadbf.d.ts} +1 -1
- package/dist/{uuid-1e3016ec.d.ts → uuid-7e83c0e5.d.ts} +5 -2
- package/package.json +1 -1
- package/dist/chunk-LNZLD7Y3.js +0 -2
- package/dist/chunk-M7FCO5WL.js +0 -5
- package/dist/chunk-M7FCO5WL.js.map +0 -1
- package/dist/chunk-PRTZGAJJ.js +0 -7
package/dist/index.node.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var Ir=Object.create;var _=Object.defineProperty,Or=Object.defineProperties,Ur=Object.getOwnPropertyDescriptor,Fr=Object.getOwnPropertyDescriptors,$r=Object.getOwnPropertyNames,Pt=Object.getOwnPropertySymbols,Rr=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable;var kt=(e,t,r)=>t in e?_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,U=(e,t)=>{for(var r in t||(t={}))Mt.call(t,r)&&kt(e,r,t[r]);if(Pt)for(var r of Pt(t))Nr.call(t,r)&&kt(e,r,t[r]);return e},ae=(e,t)=>Or(e,Fr(t)),Ct=e=>_(e,"__esModule",{value:!0}),o=(e,t)=>_(e,"name",{value:t,configurable:!0});var Br=(e,t)=>{for(var r in t)_(e,r,{get:t[r],enumerable:!0})},Dt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $r(t))!Mt.call(e,i)&&(r||i!=="default")&&_(e,i,{get:()=>t[i],enumerable:!(n=Ur(t,i))||n.enumerable});return e},O=(e,t)=>Dt(Ct(_(e!=null?Ir(Rr(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Hr=(e=>(t,r)=>e&&e.get(t)||(r=Dt(Ct({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Ai={};Br(Ai,{Channel:()=>ke,CryptoEncoder:()=>ut,Currency:()=>R,DAY_MS:()=>Xe,Day:()=>A,Emitter:()=>N,FileStorage:()=>yt,JsonEncoder:()=>W,LocalChannel:()=>fe,LogLevel:()=>L,LogLevelAlias:()=>Be,Logger:()=>b,LoggerConsoleHandler:()=>le,LoggerContext:()=>He,LoggerFileHandler:()=>ht,LoggerNodeHandler:()=>St,MemStorage:()=>gt,PubSub:()=>Ce,SerialQueue:()=>dt,Uint8ArrayToJson:()=>we,Uint8ArrayToString:()=>Gt,arrayEmptyInPlace:()=>gn,arrayFilterInPlace:()=>ve,arrayFlatten:()=>Y,arrayIntersection:()=>Vt,arrayIsEqual:()=>Qt,arrayMax:()=>bn,arrayMin:()=>wn,arrayMinus:()=>_t,arrayRandomElement:()=>xn,arrayRemoveElement:()=>fn,arraySetElement:()=>pn,arrayShuffle:()=>yn,arrayShuffleForce:()=>hn,arrayShuffleInPlace:()=>_e,arraySorted:()=>Kt,arraySortedNumbers:()=>mn,arraySymmetricDifference:()=>cn,arrayToggleInPlace:()=>dn,arrayUnion:()=>Zt,arrayUnique:()=>Ee,between:()=>xo,cloneJsonObject:()=>Io,cloneObject:()=>J,cmp:()=>Le,colorString:()=>se,colorStringList:()=>At,composeOrderby:()=>un,createArray:()=>Tn,createPromiseProxy:()=>lt,csv:()=>an,currency:()=>B,day:()=>po,debounce:()=>mi,decodeBase16:()=>An,decodeBase32:()=>Pn,decodeBase58:()=>kn,decodeBase62:()=>Dn,decodeBase64:()=>On,decrypt:()=>We,deepEqual:()=>ue,deepMerge:()=>Ot,deriveKeyPbkdf2:()=>tn,detect:()=>yr,digest:()=>en,empty:()=>Do,encodeBase16:()=>vn,encodeBase32:()=>Sn,encodeBase58:()=>Mn,encodeBase62:()=>Cn,encodeBase64:()=>In,encodeQuery:()=>ot,encrypt:()=>Je,endSortWeight:()=>nt,equalBinary:()=>ze,escapeHTML:()=>et,escapeRegExp:()=>vo,fakeWorkerPair:()=>ei,fetchBasic:()=>ft,fetchJson:()=>ii,fetchOptionsFormURLEncoded:()=>si,fetchOptionsJson:()=>ai,fetchText:()=>ui,fixBrokenUth8String:()=>Jn,forEachDay:()=>co,formatMessages:()=>nr,formatMilliseconds:()=>it,fromCamelCase:()=>$n,getGlobal:()=>li,getGlobalContext:()=>V,getGlobalEmitter:()=>Qo,getNamespaceFilterString:()=>Ut,getNavigator:()=>mr,getSourceLocation:()=>$e,getSourceLocationByPrecedingPattern:()=>Lt,getStack:()=>Tt,getStackLlocationList:()=>Er,getTimestamp:()=>ee,getWindow:()=>pt,immediate:()=>so,isArray:()=>It,isBoolean:()=>Wr,isBrowser:()=>hr,isEven:()=>Ve,isHalf:()=>X,isInteger:()=>qr,isLocalHost:()=>Bo,isNullOrUndefined:()=>_r,isNumber:()=>zr,isObject:()=>Z,isPrimitive:()=>Ne,isPromise:()=>I,isRecord:()=>jr,isSafeInteger:()=>Jr,isString:()=>Gr,isTTY:()=>Pr,isTimeout:()=>uo,jsonStringify:()=>Ae,jsonToUint8Array:()=>be,last:()=>Co,lazyListener:()=>Xo,linkifyPlainText:()=>Po,loggerStackTraceDebug:()=>Dr,messages:()=>Yo,moveSortWeight:()=>Ao,parseDate:()=>Ho,parseOrderby:()=>Wt,parseQuery:()=>Mo,platform:()=>ci,promisify:()=>H,qid:()=>Jo,randomBoolean:()=>mo,randomFloat:()=>ho,randomInt:()=>yo,randomUint8Array:()=>Q,renderMessages:()=>ce,roundDown:()=>Yn,roundHalfAwayFromZero:()=>to,roundHalfDown:()=>ro,roundHalfEven:()=>no,roundHalfOdd:()=>eo,roundHalfTowardsZero:()=>oo,roundHalfUp:()=>Xn,roundUp:()=>Qn,setupEnv:()=>wi,size:()=>ko,sleep:()=>io,sortedItems:()=>ur,sortedOrderby:()=>ln,startSortWeight:()=>rt,stringToBoolean:()=>Nn,stringToFloat:()=>Hn,stringToInteger:()=>Bn,stringToPath:()=>wr,stringToUInt8Array:()=>Ge,suid:()=>Vo,suidBytes:()=>dr,suidBytesDate:()=>gr,suidDate:()=>Ko,throttle:()=>gi,timeout:()=>ao,timeoutReached:()=>Ke,timoutError:()=>Qe,toBase64:()=>Yr,toBase64Url:()=>Xr,toBool:()=>qn,toCamelCase:()=>Un,toCapitalize:()=>Yt,toCapitalizeWords:()=>Fn,toFloat:()=>jn,toHex:()=>Qr,toHumanReadableUrl:()=>lr,toInt:()=>Gn,toPath:()=>Oe,toString:()=>zn,toUint8Array:()=>M,toValidFilename:()=>tt,today:()=>fo,tryTimeout:()=>Ye,uname:()=>j,unescapeHTML:()=>go,useAsyncMutex:()=>oi,useBase:()=>$,useDefer:()=>Fo,useDispose:()=>cr,useDisposer:()=>Uo,useEventListener:()=>No,useExitHandler:()=>fi,useInterval:()=>Ro,useLevelFilter:()=>q,useMessageHub:()=>ti,useMutex:()=>ni,useNamespaceFilter:()=>F,usePool:()=>pi,usePubSub:()=>ri,useTimeout:()=>$o,uuid:()=>te,uuidB32:()=>zo,uuidBytes:()=>st,uuidv4:()=>_o,valueToBoolean:()=>er,valueToFloat:()=>rr,valueToInteger:()=>tr,valueToPath:()=>Tr,valueToString:()=>Se,waitOn:()=>lo});function Z(e){return e!=null&&typeof e=="object"}o(Z,"isObject");function Ne(e){return Object(e)!==e}o(Ne,"isPrimitive");function It(e){return Array.isArray(e)}o(It,"isArray");function jr(e){return Z(e)&&!It(e)}o(jr,"isRecord");function Gr(e){return typeof e=="string"}o(Gr,"isString");function zr(e){return typeof e=="number"}o(zr,"isNumber");function qr(e){return typeof e=="number"&&Number.isInteger(e)}o(qr,"isInteger");function Jr(e){return typeof e=="number"&&Number.isSafeInteger(e)}o(Jr,"isSafeInteger");function Wr(e){return typeof e=="boolean"}o(Wr,"isBoolean");function _r(e){return e==null}o(_r,"isNullOrUndefined");function ue(e,t,r=new WeakSet){if(e===t||r.has(t))return!0;if(Ne(t)||r.add(t),!(e instanceof Object)||!(t instanceof Object)||e.constructor!==t.constructor||e.length!==t.length)return!1;for(let n in e){if(!e.hasOwnProperty(n))continue;if(!t.hasOwnProperty(n))return!1;let i=e[n],s=t[n];if(!ue(i,s,r))return!1}for(let n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}o(ue,"deepEqual");function Ot(e,...t){for(let r of t)Z(e)||(e={}),r!=null&&Object.keys(r).forEach(n=>{let i=e[n],s=r[n];Array.isArray(i)&&Array.isArray(s)?e[n]=i.concat(s):Z(i)&&Z(s)?e[n]=Ot(Object.assign({},i),s):e[n]=s});return e}o(Ot,"deepMerge");function Ut(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}o(Ut,"getNamespaceFilterString");var Ft,$t,Zr=Ut(typeof process!="undefined"?(Ft=process.env.ZEED)!=null?Ft:process.env.DEBUG:typeof localStorage!="undefined"?($t=localStorage.zeed)!=null?$t:localStorage.debug:"*");function F(e=Zr){let t,r=[],n=[];if(!e)t=o(function(i){return!1},"fn");else if(e==="*")t=o(function(i){return!0},"fn");else{let i,s=e.split(/[\s,]+/),l=s.length;for(i=0;i<l;i++){if(!s[i])continue;let a=s[i].replace(/\*/g,".*?");a[0]==="-"?r.push(new RegExp("^"+a.substr(1)+"$")):n.push(new RegExp("^"+a+"$"))}t=o(function(a){if(r.length===0&&n.length===0)return!0;let u,c;for(u=0,c=r.length;u<c;u++)if(r[u].test(a))return!1;for(u=0,c=n.length;u<c;u++)if(n[u].test(a))return!0;return!1},"fn")}return t.accept=n,t.reject=r,t.filter=e,t}o(F,"useNamespaceFilter");var Rt,Nt,Bt,Ht,Vr=typeof process!="undefined"?(Nt=(Rt=process.env.ZEED_LEVEL)!=null?Rt:process.env.LEVEL)!=null?Nt:process.env.DEBUG_LEVEL:typeof localStorage!="undefined"?(Ht=(Bt=localStorage.zeed_level)!=null?Bt:localStorage.level)!=null?Ht:localStorage.debug_level:void 0;function q(e=Vr){let t=L.all;if(typeof e=="string"){let r=Be[e.toLocaleLowerCase().trim()];r!=null&&(t=r)}else typeof e=="number"&&(t=e);return r=>r>=t}o(q,"useLevelFilter");var L=(a=>(a[a.all=-1]="all",a[a.debug=0]="debug",a[a.info=1]="info",a[a.warn=2]="warn",a[a.error=3]="error",a[a.fatal=4]="fatal",a[a.off=1/0]="off",a))(L||{}),Be={"*":-1,a:-1,all:-1,d:0,dbg:0,debug:0,i:1,inf:1,info:1,w:2,warn:2,warning:2,e:3,err:3,error:3,fatal:4,off:1/0,"-":1/0};function He(e=""){let t=[le()],r=2,n=o(u=>!0,"logCheckNamespace"),i=!1,s=l;function l(u=""){p.extend=function(f){return s(u?`${u}:${f}`:f)};let c=o(f=>{if(p.active===!0&&f.level>=a.level&&f.level>=p.level&&n(u))for(let m of t)m&&m(f)},"emit");function p(...f){c({name:u,messages:f,level:0})}return o(p,"log"),p.active=!0,p.level=-1,p.debug=function(...f){c({name:u,messages:f,level:0})},p.info=function(...f){c({name:u,messages:f,level:1})},p.warn=function(...f){c({name:u,messages:f,level:2})},p.error=function(...f){c({name:u,messages:f,level:3})},p.assert=function(f,...m){f||(typeof console!==void 0&&(console.assert?console.assert(f,...m):console.error(`Assert did fail with: ${f}`,...m)),c({name:u,messages:m||[`Assert did fail with: ${f}`],level:r}))},p.assertEqual=function(f,m,...y){let x=ue(f,m);x||p.assert(x,`Assert did fail. Expected ${m} got ${f}`,m,f,...y)},p.assertNotEqual=function(f,m,...y){let x=ue(f,m);x&&p.assert(x,`Assert did fail. Expected ${m} not to be equal with ${f}`,m,f,...y)},p}o(l,"LoggerBaseFactory");function a(u=""){return s(u)}return o(a,"Logger"),a.registerHandler=function(u){t.push(u)},a.setFilter=function(u){n=F(u)},a.setLock=(u=!0)=>i=u,a.setHandlers=function(u=[]){s!==l&&(s=l),!i&&(t=[...u].filter(c=>typeof c=="function"))},a.level=-1,a.setLogLevel=function(u=-1){i||(a.level=u)},a.setFactory=function(u){i||(s=u)},a}o(He,"LoggerContext");function le(e={}){let{level:t=void 0,filter:r=void 0,colors:n=!0,levelHelper:i=!1,nameBrackets:s=!0,padding:l=16}=e,a=F(r),u=q(t);return c=>{if(!u(c.level)||!a(c.name))return;let p=c.name?`[${c.name}]`:"";switch(c.level){case L.info:console.info(`I|* ${p}`,...c.messages);break;case L.warn:console.warn(`W|** ${p}`,...c.messages);break;case L.error:console.error(`E|*** ${p}`,...c.messages);break;default:console.debug(`D| ${p}`,...c.messages);break}}}o(le,"LoggerConsoleHandler");function Kr(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;if(typeof globalThis!="undefined")return globalThis;throw new Error("unable to locate global object")}o(Kr,"_global");function V(){let e=Kr();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}o(V,"getGlobalContext");var K;function je(){let e=He();return e.setHandlers([le()]),e}o(je,"getLoggerContext");try{let e=V();e!=null?(e==null?void 0:e.logger)==null?(K=je(),e.logger=K):K=e.logger:K=je()}catch{K=je()}var b=K;var jt=b("bin"),he;function Ge(e){return typeof TextEncoder=="undefined"?new Uint8Array:(he!=null?he:he=new TextEncoder).encode(e.normalize("NFC"))}o(Ge,"stringToUInt8Array");var xe;function Gt(e){return typeof TextDecoder=="undefined"?"":(xe!=null?xe:xe=new TextDecoder("utf-8",{ignoreBOM:!0})).decode(e).normalize("NFC")}o(Gt,"Uint8ArrayToString");function M(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Ge(e):e.length?new Uint8Array(e):e}o(M,"toUint8Array");function Qr(e){if(typeof Buffer!="undefined")return Buffer.from(M(e)).toString("hex");let t="0123456789abcdef",r="";for(let n of[...M(e)])r+=t[n>>4]+t[n&15];return r}o(Qr,"toHex");function Yr(e){let t=M(e);if(typeof Buffer!="undefined")return Buffer.from(t).toString("base64");let r="";for(let n=0;n<t.byteLength;n++)r+=String.fromCharCode(t[n]);return btoa(r)}o(Yr,"toBase64");function Xr(e){let t=M(e);if(typeof Buffer!="undefined")return Buffer.from(t).toString("base64url");let r="";for(let n=0;n<t.byteLength;n++)r+=String.fromCharCode(t[n]);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_")}o(Xr,"toBase64Url");function ze(e,t){if(e.byteLength!==t.byteLength)return!1;let r=M(e),n=M(t);for(let i=0;i<r.length;i++)if(r[i]!==n[i])return!1;return!0}o(ze,"equalBinary");function be(e){try{return Ge(JSON.stringify(e))}catch(t){throw jt.warn("jsonToUint8Array",e),t}}o(be,"jsonToUint8Array");function we(e){try{return JSON.parse(Gt(e))}catch(t){throw jt.warn("Uint8ArrayToJson",e),t}}o(we,"Uint8ArrayToJson");function Q(e=16){let t=new Uint8Array(e);if(typeof crypto!="undefined"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let r=0;r<e;r++)t[r]=Math.floor(Math.random()*256);return t}o(Q,"randomUint8Array");var zt="SHA-256",qe="AES-GCM",qt="PBKDF2";async function en(e,t=zt){return await crypto.subtle.digest(t,M(e))}o(en,"digest");async function tn(e,t={}){var i;let r=M(e),n=await crypto.subtle.importKey("raw",r,qt,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:qt,salt:t.salt?M(t.salt):new Uint8Array(0),iterations:(i=t.iterations)!=null?i:1e5,hash:zt},n,{name:qe,length:256},!0,["encrypt","decrypt"])}o(tn,"deriveKeyPbkdf2");var Te=new Uint8Array([1,1]);async function Je(e,t){let r=Q(12),n=await crypto.subtle.encrypt({name:qe,iv:r},t,e),i=new Uint8Array(n),s=Te.length+r.length+i.length,l=new Uint8Array(s),a=0;return l.set(Te,a),a+=Te.length,l.set(r,a),a+=r.length,l.set(i,a),l}o(Je,"encrypt");async function We(e,t){let r=e.subarray(0,2);if(!ze(r,Te))return Promise.reject(`Unknown magic ${r}`);let n=e.subarray(2,2+12),i=e.subarray(2+12,e.length),s=await crypto.subtle.decrypt({name:qe,iv:n},t,i);return new Uint8Array(s)}o(We,"decrypt");var Jt=",",rn=!1,nn=!0;function on(e){return/^([-+])?([0-9]+(\.[0-9]+)?|Infinity)$/.test(e)?Number(e):NaN}o(on,"filterFloat");function sn(e){return nn&&e==null?"":rn?'="'+String(e).replace(/"/g,'""')+'"':!isNaN(on(e))&&isFinite(e)?parseFloat(e):'"'+String(e).replace(/"/g,'""')+'"'}o(sn,"escape");function an(e,t){let r="";t&&(r=t.join(Jt)+`\r
|
|
1
|
+
var Ir=Object.create;var Z=Object.defineProperty,Ur=Object.defineProperties,Or=Object.getOwnPropertyDescriptor,Fr=Object.getOwnPropertyDescriptors,$r=Object.getOwnPropertyNames,Pt=Object.getOwnPropertySymbols,Rr=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable;var kt=(e,t,r)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,U=(e,t)=>{for(var r in t||(t={}))Mt.call(t,r)&&kt(e,r,t[r]);if(Pt)for(var r of Pt(t))Nr.call(t,r)&&kt(e,r,t[r]);return e},ae=(e,t)=>Ur(e,Fr(t)),Ct=e=>Z(e,"__esModule",{value:!0}),o=(e,t)=>Z(e,"name",{value:t,configurable:!0});var Br=(e,t)=>{for(var r in t)Z(e,r,{get:t[r],enumerable:!0})},Dt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $r(t))!Mt.call(e,i)&&(r||i!=="default")&&Z(e,i,{get:()=>t[i],enumerable:!(n=Or(t,i))||n.enumerable});return e},O=(e,t)=>Dt(Ct(Z(e!=null?Ir(Rr(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Hr=(e=>(t,r)=>e&&e.get(t)||(r=Dt(Ct({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Pi={};Br(Pi,{Channel:()=>ke,CryptoEncoder:()=>lt,Currency:()=>R,DAY_MS:()=>Xe,Day:()=>A,Emitter:()=>N,FileStorage:()=>yt,JsonEncoder:()=>_,LocalChannel:()=>fe,LogLevel:()=>L,LogLevelAlias:()=>Be,Logger:()=>b,LoggerConsoleHandler:()=>le,LoggerContext:()=>He,LoggerFileHandler:()=>ht,LoggerNodeHandler:()=>St,MemStorage:()=>gt,PubSub:()=>Ce,SerialQueue:()=>dt,Uint8ArrayToJson:()=>we,Uint8ArrayToString:()=>Gt,arrayEmptyInPlace:()=>gn,arrayFilterInPlace:()=>ve,arrayFlatten:()=>Y,arrayIntersection:()=>Vt,arrayIsEqual:()=>Qt,arrayMax:()=>bn,arrayMin:()=>wn,arrayMinus:()=>_t,arrayRandomElement:()=>xn,arrayRemoveElement:()=>fn,arraySetElement:()=>pn,arrayShuffle:()=>yn,arrayShuffleForce:()=>hn,arrayShuffleInPlace:()=>_e,arraySorted:()=>Kt,arraySortedNumbers:()=>mn,arraySymmetricDifference:()=>cn,arrayToggleInPlace:()=>dn,arrayUnion:()=>Zt,arrayUnique:()=>Ee,between:()=>xo,cloneJsonObject:()=>Io,cloneObject:()=>W,cmp:()=>Le,colorString:()=>se,colorStringList:()=>At,composeOrderby:()=>un,createArray:()=>Tn,createPromiseProxy:()=>ct,csv:()=>an,currency:()=>B,day:()=>po,debounce:()=>hi,decodeBase16:()=>An,decodeBase32:()=>Pn,decodeBase58:()=>kn,decodeBase62:()=>Dn,decodeBase64:()=>Un,decrypt:()=>We,deepEqual:()=>ue,deepMerge:()=>Ut,deriveKeyPbkdf2:()=>tn,detect:()=>yr,digest:()=>en,empty:()=>Do,encodeBase16:()=>vn,encodeBase32:()=>Sn,encodeBase58:()=>Mn,encodeBase62:()=>Cn,encodeBase64:()=>In,encodeQuery:()=>ot,encrypt:()=>Je,endSortWeight:()=>nt,equalBinary:()=>ze,escapeHTML:()=>et,escapeRegExp:()=>vo,fakeWorkerPair:()=>ri,fetchBasic:()=>ft,fetchJson:()=>ai,fetchOptionsFormURLEncoded:()=>ui,fetchOptionsJson:()=>li,fetchText:()=>ci,fixBrokenUth8String:()=>Jn,forEachDay:()=>co,formatMessages:()=>nr,formatMilliseconds:()=>it,fromCamelCase:()=>$n,getGlobal:()=>fi,getGlobalContext:()=>K,getGlobalEmitter:()=>Xo,getNamespaceFilterString:()=>Ot,getNavigator:()=>mr,getSourceLocation:()=>$e,getSourceLocationByPrecedingPattern:()=>Lt,getStack:()=>Tt,getStackLlocationList:()=>Er,getTimestamp:()=>ee,getWindow:()=>pt,immediate:()=>so,isArray:()=>It,isBoolean:()=>Wr,isBrowser:()=>hr,isEven:()=>Ve,isHalf:()=>X,isInteger:()=>qr,isLocalHost:()=>Bo,isNullOrUndefined:()=>_r,isNumber:()=>zr,isObject:()=>V,isPrimitive:()=>Ne,isPromise:()=>k,isRecord:()=>jr,isSafeInteger:()=>Jr,isString:()=>Gr,isTTY:()=>Pr,isTimeout:()=>uo,jsonStringify:()=>Ae,jsonToUint8Array:()=>be,last:()=>Co,lazyListener:()=>ti,linkifyPlainText:()=>Po,loggerStackTraceDebug:()=>Dr,messages:()=>ei,moveSortWeight:()=>Ao,parseDate:()=>Ho,parseOrderby:()=>Wt,parseQuery:()=>Mo,platform:()=>pi,promisify:()=>H,qid:()=>_o,randomBoolean:()=>mo,randomFloat:()=>ho,randomInt:()=>yo,randomUint8Array:()=>J,renderMessages:()=>ce,roundDown:()=>Yn,roundHalfAwayFromZero:()=>to,roundHalfDown:()=>ro,roundHalfEven:()=>no,roundHalfOdd:()=>eo,roundHalfTowardsZero:()=>oo,roundHalfUp:()=>Xn,roundUp:()=>Qn,setupEnv:()=>Li,size:()=>ko,sleep:()=>io,sortedItems:()=>ur,sortedOrderby:()=>ln,startSortWeight:()=>rt,stringToBoolean:()=>Nn,stringToFloat:()=>Hn,stringToInteger:()=>Bn,stringToPath:()=>wr,stringToUInt8Array:()=>Ge,suid:()=>Qo,suidBytes:()=>dr,suidBytesDate:()=>gr,suidDate:()=>Yo,throttle:()=>yi,timeout:()=>ao,timeoutReached:()=>Ke,timoutError:()=>Qe,toBase64:()=>Yr,toBase64Url:()=>Xr,toBool:()=>qn,toCamelCase:()=>On,toCapitalize:()=>Yt,toCapitalizeWords:()=>Fn,toFloat:()=>jn,toHex:()=>Qr,toHumanReadableUrl:()=>lr,toInt:()=>Gn,toPath:()=>Ue,toString:()=>zn,toUint8Array:()=>M,toValidFilename:()=>tt,today:()=>fo,tryTimeout:()=>Ye,uname:()=>j,unescapeHTML:()=>go,useAsyncMutex:()=>si,useBase:()=>$,useDefer:()=>Fo,useDispose:()=>cr,useDisposer:()=>Oo,useEventListener:()=>No,useExitHandler:()=>di,useInterval:()=>Ro,useLevelFilter:()=>q,useMessageHub:()=>ni,useMutex:()=>ii,useNamespaceFilter:()=>F,usePool:()=>gi,usePubSub:()=>oi,useTimeout:()=>$o,uuid:()=>te,uuid32bit:()=>Go,uuidB32:()=>Jo,uuidBytes:()=>at,uuidDecode:()=>qo,uuidEncode:()=>zo,uuidv4:()=>Vo,valueToBoolean:()=>er,valueToFloat:()=>rr,valueToInteger:()=>tr,valueToPath:()=>Tr,valueToString:()=>Se,waitOn:()=>lo});function V(e){return e!=null&&typeof e=="object"}o(V,"isObject");function Ne(e){return Object(e)!==e}o(Ne,"isPrimitive");function It(e){return Array.isArray(e)}o(It,"isArray");function jr(e){return V(e)&&!It(e)}o(jr,"isRecord");function Gr(e){return typeof e=="string"}o(Gr,"isString");function zr(e){return typeof e=="number"}o(zr,"isNumber");function qr(e){return typeof e=="number"&&Number.isInteger(e)}o(qr,"isInteger");function Jr(e){return typeof e=="number"&&Number.isSafeInteger(e)}o(Jr,"isSafeInteger");function Wr(e){return typeof e=="boolean"}o(Wr,"isBoolean");function _r(e){return e==null}o(_r,"isNullOrUndefined");function ue(e,t,r=new WeakSet){if(e===t||r.has(t))return!0;if(Ne(t)||r.add(t),!(e instanceof Object)||!(t instanceof Object)||e.constructor!==t.constructor||e.length!==t.length)return!1;for(let n in e){if(!e.hasOwnProperty(n))continue;if(!t.hasOwnProperty(n))return!1;let i=e[n],s=t[n];if(!ue(i,s,r))return!1}for(let n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}o(ue,"deepEqual");function Ut(e,...t){for(let r of t)V(e)||(e={}),r!=null&&Object.keys(r).forEach(n=>{let i=e[n],s=r[n];Array.isArray(i)&&Array.isArray(s)?e[n]=i.concat(s):V(i)&&V(s)?e[n]=Ut(Object.assign({},i),s):e[n]=s});return e}o(Ut,"deepMerge");function Ot(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}o(Ot,"getNamespaceFilterString");var Ft,$t,Zr=Ot(typeof process!="undefined"?(Ft=process.env.ZEED)!=null?Ft:process.env.DEBUG:typeof localStorage!="undefined"?($t=localStorage.zeed)!=null?$t:localStorage.debug:"*");function F(e=Zr){let t,r=[],n=[];if(!e)t=o(function(i){return!1},"fn");else if(e==="*")t=o(function(i){return!0},"fn");else{let i,s=e.split(/[\s,]+/),l=s.length;for(i=0;i<l;i++){if(!s[i])continue;let a=s[i].replace(/\*/g,".*?");a[0]==="-"?r.push(new RegExp("^"+a.substr(1)+"$")):n.push(new RegExp("^"+a+"$"))}t=o(function(a){if(r.length===0&&n.length===0)return!0;let u,c;for(u=0,c=r.length;u<c;u++)if(r[u].test(a))return!1;for(u=0,c=n.length;u<c;u++)if(n[u].test(a))return!0;return!1},"fn")}return t.accept=n,t.reject=r,t.filter=e,t}o(F,"useNamespaceFilter");var Rt,Nt,Bt,Ht,Vr=typeof process!="undefined"?(Nt=(Rt=process.env.ZEED_LEVEL)!=null?Rt:process.env.LEVEL)!=null?Nt:process.env.DEBUG_LEVEL:typeof localStorage!="undefined"?(Ht=(Bt=localStorage.zeed_level)!=null?Bt:localStorage.level)!=null?Ht:localStorage.debug_level:void 0;function q(e=Vr){let t=-1;if(typeof e=="string"){let r=Be[e.toLocaleLowerCase().trim()];r!=null&&(t=r)}else typeof e=="number"&&(t=e);return r=>r>=t}o(q,"useLevelFilter");var L=(a=>(a[a.all=-1]="all",a[a.debug=0]="debug",a[a.info=1]="info",a[a.warn=2]="warn",a[a.error=3]="error",a[a.fatal=4]="fatal",a[a.off=1/0]="off",a))(L||{}),Be={"*":-1,a:-1,all:-1,d:0,dbg:0,debug:0,i:1,inf:1,info:1,w:2,warn:2,warning:2,e:3,err:3,error:3,fatal:4,off:1/0,"-":1/0};function He(e=""){let t=[le()],r=2,n=o(u=>!0,"logCheckNamespace"),i=!1,s=l;function l(u=""){p.extend=function(f){return s(u?`${u}:${f}`:f)};let c=o(f=>{if(p.active===!0&&f.level>=a.level&&f.level>=p.level&&n(u))for(let m of t)m&&m(f)},"emit");function p(...f){c({name:u,messages:f,level:0})}return o(p,"log"),p.active=!0,p.level=-1,p.debug=function(...f){c({name:u,messages:f,level:0})},p.info=function(...f){c({name:u,messages:f,level:1})},p.warn=function(...f){c({name:u,messages:f,level:2})},p.error=function(...f){c({name:u,messages:f,level:3})},p.assert=function(f,...m){f||(typeof console!==void 0&&(console.assert?console.assert(f,...m):console.error(`Assert did fail with: ${f}`,...m)),c({name:u,messages:m||[`Assert did fail with: ${f}`],level:r}))},p.assertEqual=function(f,m,...y){let x=ue(f,m);x||p.assert(x,`Assert did fail. Expected ${m} got ${f}`,m,f,...y)},p.assertNotEqual=function(f,m,...y){let x=ue(f,m);x&&p.assert(x,`Assert did fail. Expected ${m} not to be equal with ${f}`,m,f,...y)},p}o(l,"LoggerBaseFactory");function a(u=""){return s(u)}return o(a,"Logger"),a.registerHandler=function(u){t.push(u)},a.setFilter=function(u){n=F(u)},a.setLock=(u=!0)=>i=u,a.setHandlers=function(u=[]){s!==l&&(s=l),!i&&(t=[...u].filter(c=>typeof c=="function"))},a.level=-1,a.setLogLevel=function(u=-1){i||(a.level=u)},a.setFactory=function(u){i||(s=u)},a}o(He,"LoggerContext");function le(e={}){let{level:t=void 0,filter:r=void 0,colors:n=!0,levelHelper:i=!1,nameBrackets:s=!0,padding:l=16}=e,a=F(r),u=q(t);return c=>{if(!u(c.level)||!a(c.name))return;let p=c.name?`[${c.name}]`:"";switch(c.level){case 1:console.info(`I|* ${p}`,...c.messages);break;case 2:console.warn(`W|** ${p}`,...c.messages);break;case 3:console.error(`E|*** ${p}`,...c.messages);break;default:console.debug(`D| ${p}`,...c.messages);break}}}o(le,"LoggerConsoleHandler");function Kr(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;if(typeof globalThis!="undefined")return globalThis;throw new Error("unable to locate global object")}o(Kr,"_global");function K(){let e=Kr();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}o(K,"getGlobalContext");var Q;function je(){let e=He();return e.setHandlers([le()]),e}o(je,"getLoggerContext");try{let e=K();e!=null?(e==null?void 0:e.logger)==null?(Q=je(),e.logger=Q):Q=e.logger:Q=je()}catch{Q=je()}var b=Q;var jt=b("bin"),he;function Ge(e){return typeof TextEncoder=="undefined"?new Uint8Array:(he!=null?he:he=new TextEncoder).encode(e.normalize("NFC"))}o(Ge,"stringToUInt8Array");var xe;function Gt(e){return typeof TextDecoder=="undefined"?"":(xe!=null?xe:xe=new TextDecoder("utf-8",{ignoreBOM:!0})).decode(e).normalize("NFC")}o(Gt,"Uint8ArrayToString");function M(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Ge(e):e.length?new Uint8Array(e):e}o(M,"toUint8Array");function Qr(e){if(typeof Buffer!="undefined")return Buffer.from(M(e)).toString("hex");let t="0123456789abcdef",r="";for(let n of[...M(e)])r+=t[n>>4]+t[n&15];return r}o(Qr,"toHex");function Yr(e){let t=M(e);if(typeof Buffer!="undefined")return Buffer.from(t).toString("base64");let r="";for(let n=0;n<t.byteLength;n++)r+=String.fromCharCode(t[n]);return btoa(r)}o(Yr,"toBase64");function Xr(e){let t=M(e);if(typeof Buffer!="undefined")return Buffer.from(t).toString("base64url");let r="";for(let n=0;n<t.byteLength;n++)r+=String.fromCharCode(t[n]);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_")}o(Xr,"toBase64Url");function ze(e,t){if(e.byteLength!==t.byteLength)return!1;let r=M(e),n=M(t);for(let i=0;i<r.length;i++)if(r[i]!==n[i])return!1;return!0}o(ze,"equalBinary");function be(e){try{return Ge(JSON.stringify(e))}catch(t){throw jt.warn("jsonToUint8Array",e),t}}o(be,"jsonToUint8Array");function we(e){try{return JSON.parse(Gt(e))}catch(t){throw jt.warn("Uint8ArrayToJson",e),t}}o(we,"Uint8ArrayToJson");function J(e=16){let t=new Uint8Array(e);if(typeof crypto!="undefined"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let r=0;r<e;r++)t[r]=Math.floor(Math.random()*256);return t}o(J,"randomUint8Array");var zt="SHA-256",qe="AES-GCM",qt="PBKDF2";async function en(e,t=zt){return M(await crypto.subtle.digest(t,M(e)))}o(en,"digest");async function tn(e,t={}){var i;let r=M(e),n=await crypto.subtle.importKey("raw",r,qt,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:qt,salt:t.salt?M(t.salt):new Uint8Array(0),iterations:(i=t.iterations)!=null?i:1e5,hash:zt},n,{name:qe,length:256},!0,["encrypt","decrypt"])}o(tn,"deriveKeyPbkdf2");var Te=new Uint8Array([1,1]);async function Je(e,t){let r=J(12),n=await crypto.subtle.encrypt({name:qe,iv:r},t,e),i=new Uint8Array(n),s=Te.length+r.length+i.length,l=new Uint8Array(s),a=0;return l.set(Te,a),a+=Te.length,l.set(r,a),a+=r.length,l.set(i,a),l}o(Je,"encrypt");async function We(e,t){let r=e.subarray(0,2);if(!ze(r,Te))return Promise.reject(`Unknown magic ${r}`);let n=e.subarray(2,2+12),i=e.subarray(2+12,e.length),s=await crypto.subtle.decrypt({name:qe,iv:n},t,i);return new Uint8Array(s)}o(We,"decrypt");var Jt=",",rn=!1,nn=!0;function on(e){return/^([-+])?([0-9]+(\.[0-9]+)?|Infinity)$/.test(e)?Number(e):NaN}o(on,"filterFloat");function sn(e){return nn&&e==null?"":rn?'="'+String(e).replace(/"/g,'""')+'"':!isNaN(on(e))&&isFinite(e)?parseFloat(e):'"'+String(e).replace(/"/g,'""')+'"'}o(sn,"escape");function an(e,t){let r="";t&&(r=t.join(Jt)+`\r
|
|
2
2
|
`);for(let n=0;n<e.length;n++)r+=e[n].map(sn).join(Jt)+`\r
|
|
3
|
-
`;return r}o(an,"csv");function Wt(e=""){let[t="",r="asc"]=e.split(" ");return r=r.toLowerCase(),{field:t,orderby:r,asc:r!=="desc",desc:r==="desc"}}o(Wt,"parseOrderby");function un(e,t=!0){return`${e} ${t?"asc":"desc"}`}o(un,"composeOrderby");function Le(e,t,r=!0){let n=e||0,i=t||0;return n>i?r?1:-1:n<i?r?-1:1:0}o(Le,"cmp");function ln(e,...t){if(t.length>0){let r=t.map(Wt),n=Array.from(e);return n.sort((i,s)=>{for(let{field:l,asc:a}of r){let u=Le(i[l],s[l],a);if(u!==0)return u}return 0}),n}return e}o(ln,"sortedOrderby");function Ee(e){return e.filter((t,r)=>e.indexOf(t)===r)}o(Ee,"arrayUnique");function _t(e,t){return Ee(e.filter(r=>!t.includes(r)))}o(_t,"arrayMinus");function Zt(...e){return Ee(e.reduce((t=[],r)=>t.concat(r),[]))}o(Zt,"arrayUnion");function Y(...e){return e.flat(1/0)}o(Y,"arrayFlatten");function Vt(e,t){return Ee(e).filter(r=>t.includes(r))}o(Vt,"arrayIntersection");function cn(e,t){return _t(Zt(e,t),Vt(e,t))}o(cn,"arraySymmetricDifference");function fn(e,t){if(e&&Array.isArray(e)){let r;for(;(r=e.indexOf(t))!==-1;)e.splice(r,1);return e}return[]}o(fn,"arrayRemoveElement");function pn(e,t){return e.includes(t)||e.push(t),e}o(pn,"arraySetElement");function ve(e,t){return e.splice(0,e.length,...e.filter(t)),e}o(ve,"arrayFilterInPlace");function dn(e,t){let r=e.findIndex(n=>n===t);return r>=0?e.splice(r,1):e.push(t),e}o(dn,"arrayToggleInPlace");function gn(e){return e.splice(0,e.length),e}o(gn,"arrayEmptyInPlace");function Kt(e,t=Le){return Array.from(e).sort(t)}o(Kt,"arraySorted");function mn(e){return Kt(e,(t,r)=>t-r)}o(mn,"arraySortedNumbers");function Qt(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}o(Qt,"arrayIsEqual");function _e(e){return e.sort(()=>Math.random()>.5?1:-1),e}o(_e,"arrayShuffleInPlace");function yn(e){return _e(Array.from(e))}o(yn,"arrayShuffle");function hn(e){for(;e.length>1;){let t=Array.from(e);if(_e(t),!Qt(e,t))return t}return e}o(hn,"arrayShuffleForce");function xn(e){return e[Math.floor(Math.random()*e.length)]}o(xn,"arrayRandomElement");function bn(...e){return Y(e).reduce((t,r)=>t!=null?r>t?r:t:r,void 0)}o(bn,"arrayMax");function wn(...e){return Y(e).reduce((t,r)=>t!=null?r<t?r:t:r,void 0)}o(wn,"arrayMin");function Tn(e=0,t){if(e<=0)return[];let r=new Array(e);for(let n=0;n<e;n++)r[n]=t instanceof Function?t(n):t;return r}o(Tn,"createArray");var Ln=b("zeed:basex"),En={"2":"01","8":"01234567","11":"0123456789a","16":"0123456789abcdef","32":"0123456789ABCDEFGHJKMNPQRSTVWXYZ","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 $(e){let t;if(typeof e=="string")t=e;else if(t=En[e.toString()],t==null)throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let r=new Uint8Array(256);for(let c=0;c<r.length;c++)r[c]=255;for(let c=0;c<t.length;c++){let p=t.charAt(c),f=p.charCodeAt(0);if(r[f]!==255)throw new TypeError(p+" is ambiguous");r[f]=c}let n=t.length,i=t.charAt(0),s=Math.log(n)/Math.log(256),l=Math.log(256)/Math.log(n);function a(c,p=-1){let f=M(c);if(f.byteLength===0)return"";let m=0,y=0,x=f.byteLength;for(;y!==x&&f[y]===0;)y++;let w=(x-y)*l+1>>>0,g=new Uint8Array(w);for(;y!==x;){let E=f[y],v=0;for(let
|
|
4
|
-
${i.stack}`:`${i.name||"Error"}: ${i.message}`:n?Ae(i,null,2):Ae(i):String(i))}o(nr,"formatMessages");function ce(e,t={}){return nr(e,t).join(" ")}o(ce,"renderMessages");function Jn(e){try{return decodeURIComponent(escape(e))}catch{}return e}o(Jn,"fixBrokenUth8String");var Wn={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:Kn,fromCents:!1},or=o(e=>Math.round(e),"round"),Ze=o(e=>Math.pow(10,e),"pow"),_n=o((e,t)=>or(e/t)*t,"rounding"),Zn=/(\d)(?=(\d{3})+\b)/g,Vn=/(\d)(?=(\d\d)+\d\b)/g;function B(e,t={}){return new R(e,t)}o(B,"currency");var Me=class{constructor(t,r={}){var l;let n=Object.assign({},Wn,r),i=Ze((l=n.precision)!=null?l:2),s=Pe(t,n);this.intValue=s,this.value=s/i,n.increment=n.increment||1/i,n.useVedic?n.groups=Vn:n.groups=Zn,this._settings=n,this._precision=i}add(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r+=Pe(t,n))/(n.fromCents?1:i),n)}subtract(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r-=Pe(t,n))/(n.fromCents?1:i),n)}multiply(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r*=t)/(n.fromCents?1:Ze(i)),n)}divide(t){let{intValue:r,_settings:n}=this;return B(r/=Pe(t,n,!1),n)}distribute(t){let{intValue:r,_precision:n,_settings:i}=this,s=[],l=Math[r>=0?"floor":"ceil"](r/t),a=Math.abs(r-l*t),u=i.fromCents?1:n;for(;t!==0;t--){let c=B(l/u,i);a-- >0&&(c=c[r>=0?"add":"subtract"](1/u)),s.push(c)}return s}dollars(){return~~this.value}cents(){let{intValue:t,_precision:r}=this;return~~(t%r)}format(t){let{_settings:r}=this;return typeof t=="function"?t(this,r):r.format(this,Object.assign({},r,t))}toString(){let{intValue:t,_precision:r,_settings:n}=this;return _n(t/r,n.increment).toFixed(n.precision)}toJSON(){return this.value}static sum(...t){return Y(t).reduce((r,n)=>B(r).add(n),this.zero)}static avg(...t){let r=Y(t);return r.reduce((n,i)=>B(n).add(i),this.zero).divide(r.length)}},R=Me;o(R,"Currency"),R.zero=new Me(0),R.one=new Me(1);function Pe(e,t,r=!0){let n=0,{decimal:i,errorOnInvalid:s,precision:l,fromCents:a}=t,u=Ze(l),c=typeof e=="number";if(e instanceof R&&a)return e.intValue;if(c||e instanceof R)n=e instanceof R?e.value:e;else if(typeof e=="string"){let p=new RegExp("[^-\\d"+i+"]","g"),f=new RegExp("\\"+i,"g");n=e.replace(/\((.*)\)/,"-$1").replace(p,"").replace(f,"."),n=n||0}else{if(s)throw Error("Invalid Input");n=0}return a||(n*=u,n=n.toFixed(4)),r?or(n):n}o(Pe,"parse");function Kn(e,t){let{pattern:r,negativePattern:n,symbol:i,separator:s,decimal:l,groups:a}=t,u=(""+e).replace(/^-/,"").split("."),c=u[0],p=u[1];return(e.value>=0?r:n).replace("!",i).replace("#",c.replace(a,"$1"+s)+(p?l+p:""))}o(Kn,"format");var X=o(e=>Math.abs(e)%1===.5,"isHalf"),Ve=o(e=>e%2===0,"isEven"),Qn=o(e=>Math.ceil(e),"roundUp"),Yn=o(e=>Math.floor(e),"roundDown"),Xn=o(e=>Math.round(e),"roundHalfUp"),eo=o(e=>{let t=Math.round(e);return X(e)&&Ve(t)?t-1:t},"roundHalfOdd"),to=o(e=>X(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),ro=o(e=>X(e)?Math.floor(e):Math.round(e),"roundHalfDown"),no=o(e=>{let t=Math.round(e);return X(e)?Ve(t)?t:t-1:t},"roundHalfEven"),oo=o(e=>X(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");var{warn:ir}=b("zeed:promise");async function io(e){return new Promise(t=>setTimeout(t,e))}o(io,"sleep");async function so(){return new Promise(e=>setTimeout(e,0))}o(so,"immediate");var Ke=Symbol("timeout");async function ao(e,t,r=Ke){return new Promise(async(n,i)=>{let s=!1,l=setTimeout(()=>{s=!0,n(r)},t);try{let a=await e;clearTimeout(l),s||n(a)}catch(a){clearTimeout(l),s||i(a)}})}o(ao,"timeout");var Qe=new Error("Timeout reached");function uo(e){return e===Ke||e===Qe}o(uo,"isTimeout");async function Ye(e,t){return t<=0?await e:new Promise(async(r,n)=>{let i=!1,s=setTimeout(()=>{i=!0,n(Qe)},t);try{let l=await e;clearTimeout(s),i||r(l)}catch(l){clearTimeout(s),i||n(l)}})}o(Ye,"tryTimeout");function lo(e,t,r=1e3){return new Promise((n,i)=>{let s=o(u=>{a&&(clearTimeout(a),l(),n(u))},"fn"),l=o(()=>{a=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):ir("No remove listener method found for",e,t)},"done"),a=setTimeout(()=>{l(),i(new Error("Did not response in time"))},r);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):ir("No listener method found for",e)})}o(lo,"waitOn");function I(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}o(I,"isPromise");function H(e){return Promise.resolve(e)}o(H,"promisify");var Xe=1e3*60*60*24,A=class{constructor(t){var r;if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=(r=A.from(t))==null?void 0:r.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 A(t)}static fromString(t){return new A(+t.replace(/[^0-9]/g,""))}static fromDate(t,r=!1){return r?A.fromString(t.toISOString().substr(0,10)):new A(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return A.fromDate(t,!0)}static from(t,r=!1){if(typeof t=="number")return new A(t);if(typeof t=="string")return A.fromString(t);if(t instanceof Date)return A.fromDate(t,r);if(t instanceof A)return t}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let r=String(this.days);return r.slice(0,4)+t+r.slice(4,6)+t+r.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)}dayOffset(t){return A.fromDateGMT(new Date(this.toDateGMT().getTime()+t*Xe))}daysUntil(t){var r;return Math.round((((r=new A(t))==null?void 0:r.toDateGMT().getTime())-this.toDateGMT().getTime())/Xe)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};o(A,"Day");async function co(e,t,r){let n=A.from(e),i=A.from(t);for(;n&&i&&(n==null?void 0:n.days)<=(i==null?void 0:i.days);){let s=r(n);I(s)&&await s,n=n.dayOffset(1)}}o(co,"forEachDay");function fo(){return new A}o(fo,"today");function po(e){return new A(e)}o(po,"day");var et=o(e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),"escapeHTML"),go=o(e=>e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),"unescapeHTML");function mo(e=.25){return Math.random()<e}o(mo,"randomBoolean");function yo(e=100,t=0){return t+Math.floor(Math.random()*(e-t))}o(yo,"randomInt");function ho(e=100,t=0){return t+Math.random()*(e-t)}o(ho,"randomFloat");function xo(e,t,r){return Math.max(e,Math.min(r,t))}o(xo,"between");var bo=100,sr=/[\u0000-\u001F\u0080-\u009F]/g,wo=/^\.+/,To=/\.+$/;function ar(){return/[<>:"/\\|?*\u0000-\u001F]/g}o(ar,"filenameReservedRegex");function Lo(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}o(Lo,"windowsReservedNameRegex");function tt(e){if(typeof e!="string")throw new TypeError("Expected a string");let t="_";if(ar().test(t)&&sr.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(ar(),t).replace(sr,t).replace(wo,t).replace(To,""),e=Lo().test(e)?e+t:e,e.slice(0,bo)}o(tt,"toValidFilename");var Eo=/[\\\-\[\]\/{}()*+?.^$|]/g;function vo(e){return e?e instanceof RegExp?e.source:e.replace(Eo,"\\$&"):""}o(vo,"escapeRegExp");function rt(e){return e.reduce((t,r)=>Math.min(t,r.sort_weight||0),0)-1-Math.random()}o(rt,"startSortWeight");function nt(e){return e.reduce((t,r)=>Math.max(t,r.sort_weight||0),0)+1+Math.random()}o(nt,"endSortWeight");function Ao(e,t,r){let n=r.length,i=e<t;if(n<=0||e>=n-1)return nt(r);if(e<=0)return rt(r);r=ur([...r]);let s=i?-1:0,l=r[e+s].sort_weight||0,u=(r[e+s+1].sort_weight||0)-l;if(u===0)return i?rt(r):nt(r);let c=l+u/2,p=u*.01*(Math.random()-.5);return c+p}o(Ao,"moveSortWeight");function ur(e){return e.sort((t,r)=>(t.sort_weight||0)-(r.sort_weight||0)),e}o(ur,"sortedItems");var So=/((?:(?:(?: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 Po(e){return e.split(So).map((t,r)=>{let n=et(t);return r%2?`<a target="_blank" href="${n}">${lr(n)}</a>`:n}).join("")}o(Po,"linkifyPlainText");function lr(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}o(lr,"toHumanReadableUrl");function ot(e){let t=[];for(let[r,n]of Object.entries(e))if(n!=null){Array.isArray(n)||(n=[n]);for(let i of n)i!=null&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(i.toString()||""))}return t.join("&")}o(ot,"encodeQuery");function Mo(e){let t={},r=(e[0]==="?"?e.substr(1):e).split("&");for(let n=0;n<r.length;n++){let i=r[n].split("="),s=decodeURIComponent(i[0]),l=decodeURIComponent(i[1]||"");t[s]!=null?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(l)):t[s]=l}return t}o(Mo,"parseQuery");function ko(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}o(ko,"size");function Co(e){return e!=null&&e.length>0?e[e.length-1]:void 0}o(Co,"last");function Do(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:(e==null?void 0:e.size)!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.error("Failed to check if empty for",e,t)}return!0}o(Do,"empty");function J(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(J,"cloneObject");function Io(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(Io,"cloneJsonObject");async function Oo(e){typeof e=="function"?await H(e()):I(e)?await e:typeof e.dispose=="function"?await H(e.dispose()):I(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await H(e.cleanup()):I(e.cleanup)&&await e.cleanup}o(Oo,"callDisposer");function cr(){let e=[],t=o(async i=>{e.includes(i)&&(ve(e,s=>s!==i),await Oo(i))},"untrack"),r=o(async()=>{for(;e.length>0;)await t(e[0])},"dispose"),n=o(i=>(e.unshift(i),()=>t(i)),"track");return Object.assign(r,{track:n,add:n,untrack:t,dispose:r,exec:r,getSize(){return e.length}})}o(cr,"useDispose");var Uo=cr;function Fo(e={}){let{mode:t="fifo"}=e,r=[],n=o(async(s=!1)=>{for(;r.length>0;){let l=r[0];if(ve(r,a=>a!==l),typeof l=="function"){let a=l();if(I(a)){if(s)throw new Error(`Expected sync only function, but found async: ${l}`);await a}}else if(I(l)){if(s)throw new Error(`Expected sync only function, but found async: ${l}`);await l}else throw new Error(`Unhandled disposable: ${l}`)}},"exec");return Object.assign(n,{add:o(s=>{t==="lifo"?r.unshift(s):r.push(s)},"add"),exec:n,getSize(){return r.length}})}o(Fo,"useDefer");function $o(e,t=0){let r=setTimeout(e,t);return()=>{r&&(clearTimeout(r),r=void 0)}}o($o,"useTimeout");function Ro(e,t){let r=setInterval(e,t);return()=>{r&&(clearInterval(r),r=void 0)}}o(Ro,"useInterval");function No(e,t,r,...n){return e==null?()=>{}:(e.on?e.on(t,r,...n):e.addEventListener&&e.addEventListener(t,r,...n),()=>{e.off?e.off(t,r,...n):e.removeEventListener&&e.removeEventListener(t,r,...n)})}o(No,"useEventListener");function Bo(e=window.location.hostname){return["localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}o(Bo,"isLocalHost");var ee=o(()=>typeof performance!="undefined"?performance.now():new Date().getTime(),"getTimestamp");function it(e){return e>999?(e/1e3).toFixed(1)+"s":e.toFixed(2)+"ms"}o(it,"formatMilliseconds");function Ho(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let r=null;if(t.includes(":"))try{r=new Date(t)}catch{}if(!(r instanceof Date)){let n=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);n&&(r=new Date(+n[1],+n[2]-1,+n[3],12,0))}if(r instanceof Date)return r}}}o(Ho,"parseDate");var{encode:fr,decode:jo}=$(62),{encode:Go}=$(32);function st(){return Q(16)}o(st,"uuidBytes");function te(){return fr(st(),22)}o(te,"uuid");function zo(){return Go(st(),26)}o(zo,"uuidB32");var at={};function j(e="id"){return at[e]==null&&(at[e]=0),`${e}-${at[e]++}`}o(j,"uname");var qo=0;function Jo(){return`id-${qo++}`}o(Jo,"qid");var Wo="10000000-1000-4000-8000-100000000000",_o=o(()=>Wo.replace(/[018]/g,e=>(e^Q(1)[0]&15>>e/4).toString(16)),"uuidv4"),pr=16e11;function Zo(e){var t=new Uint8Array([0,0,0,0,0,0]);let r=t.length-1;for(var n=0;n<t.length;n++){var i=e&255;t[r-n]=i,e=(e-i)/256}return t}o(Zo,"longToByteArray");function dr(){let e=ee()-pr;return new Uint8Array([...Zo(e),...Q(10)])}o(dr,"suidBytes");function Vo(){return fr(dr(),22)}o(Vo,"suid");function Ko(e){return gr(jo(e,16))}o(Ko,"suidDate");function gr(e){return new Date(pr+e.slice(0,6).reduce((t,r)=>t*256+r,0))}o(gr,"suidBytesDate");var re=b("zeed:emitter"),N=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.call=new Proxy({},{get:(t,r)=>(...n)=>this.emit(r,...n)})}async emit(t,...r){let n=!1;try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...r)),i.length>0){let s=i.map(l=>{try{return H(l(...r))}catch(a){re.warn("emit warning:",a)}});n=!0,await Promise.all(s)}}catch(i){re.error("emit exception",i)}return n}onAny(t){this.subscribersOnAny.push(t)}on(t,r){let n=this.subscribers[t]||[];return n.push(r),this.subscribers[t]=n,()=>{this.off(t,r)}}onCall(t){for(let[r,n]of Object.entries(t))this.on(r,n)}once(t,r){let n=o(async(...i)=>(this.off(t,n),await H(r(...i))),"onceListener");return this.on(t,n),()=>{this.off(t,r)}}off(t,r){return this.subscribers[t]=(this.subscribers[t]||[]).filter(n=>r&&n!==r),this}removeAllListeners(t){return this.subscribers={},this}dispose(){this.subscribers={},this.subscribersOnAny=[]}};o(N,"Emitter");function Qo(){let e=V().emitter;return e||(e=new N,V().emitter=e),e}o(Qo,"getGlobalEmitter");var Yo=new N;function Xo(e,t){let r=Math.round(Math.random()*100);var n=[],i;let s=o((a,u)=>{let c={key:a,obj:u};n.push(c),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):re.error(r,"Cannot listen to key"):e.onAny?e.onAny((a,u)=>{s(a,u)}):re.error(r,"cannot listen to all for",e),o((a,u=!0)=>new Promise((c,p)=>{a||(a=t,a||n.length&&(a=n[0].key)),i=o(()=>{for(;n.length>0;){let f=n.shift();if(f.key===a)i=void 0,c(f.obj);else{if(u){re.warn(r,`Unhandled event ${a} with value: ${f.obj}`);continue}p(`Expected ${a}, but found ${f.key} with value=${f.obj}`),re.error(r,`Unhandled event ${a} with value: ${f.obj}`)}break}},"lazyResolve"),i()}),"on")}o(Xo,"lazyListener");var ke=class extends N{constructor(){super(...arguments);this.id=te()}close(){}};o(ke,"Channel");var fe=class extends ke{constructor(){super(...arguments);this.isConnected=!0}postMessage(t){var r;(r=this.other)==null||r.emit("message",{data:t,origin:"local",lastEventId:te()})}};o(fe,"LocalChannel");function ei(){let e=new fe,t=new fe;return e.other=t,t.other=e,[e,t]}o(ei,"fakeWorkerPair");var W=class{async encode(t){return be(t)}async decode(t){return we(t)}};o(W,"JsonEncoder");var ut=class{constructor(t){this.key=t}async encode(t){let r=be(t);return await Je(r,this.key)}async decode(t){let r=await We(t,this.key);return we(r)}};o(ut,"CryptoEncoder");var lt=o((e,t,r={})=>new Proxy(r,{get:(n,i)=>i in n?n[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function ti(e={}){let{name:t=j("hub"),encoder:r=new W,retryAfter:n=1e3,ignoreUnhandled:i=!0}=e,s=b(t),l={},a,u=[],c,p={},f=o(()=>{clearTimeout(c)},"dispose"),m=o(async()=>{if(clearTimeout(c),a){if(a.isConnected)for(;u.length;){let g=u[0];try{a.postMessage(await r.encode(g)),u.shift()}catch(h){s.warn("postMessage",h);break}}u.length>0&&n>0&&(c=setTimeout(m,n))}},"postNext"),y=o(async g=>{s("enqueue postMessage",g),u.push(g),await m()},"postMessage"),x=o(async g=>{a=g,a.on("connect",m),a.on("message",async h=>{s("onmessage",typeof h);let{name:S,args:E,id:v,result:D,error:G}=await r.decode(h.data);if(S){s(`name ${S} id ${v}`);try{if(l[S]==null)throw new Error(`handler for ${S} was not found`);let C=l[S](...E);I(C)&&(C=await C),s(`result ${C}`),v&&y({id:v,result:C})}catch(C){let z=C instanceof Error?C:new Error(Se(C));s.warn("execution error",z.name),y({id:v,error:{message:z.message,stack:z.stack,name:z.name}})}}else if(v)if(s(`response for id=${v}: result=${D}, error=${G}`),p[v]==null)D===void 0?s(`skip response for ${v}`):s.warn(`no response hook for ${v}`);else{let[C,z]=p[v];if(C&&z)if(delete p[v],G){let ye=new Error(G.message);ye.stack=G.stack,ye.name=G.name,s.warn("reject",ye.name),z(ye)}else s("resolve",D),C(D)}else i||s.warn("Unhandled message",h)}),m()},"connect"),w=o(async(g,h,S={})=>{let{timeout:E=5e3}=S,v=te();return y({name:g,args:h,id:v}),Ye(new Promise((D,G)=>p[v]=[D,G]),E)},"fetchMessage");return e.channel&&x(e.channel),{dispose:f,connect:x,listen(g){Object.assign(l,g)},send(){return lt(w,{},{options(g){return lt(w,U({},g))}})}}}o(ti,"useMessageHub");var Ce=class extends N{constructor(t){super();this.publish=this.emit;this.subscribe=this.on;var l;let{name:r,encoder:n=new W,channel:i,debug:s=!1}=t;this.channel=i,this.encoder=n,this.debug=s,this.name=(l=r!=null?r:this.channel.id)!=null?l:j("pubsub"),this.log=b(`${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:a})=>{let u=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${u==null?void 0:u.event}, info=`,u):this.log(`channel message, event=${u==null?void 0:u.event}`),u){let{event:c,args:p}=u;await this.emitSuper(c,...p)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(t,...r){return await super.emit(t,...r)}async emit(t,...r){try{if(this.debug?this.log(`emit(${t})`,t):this.log(`emit(${t})`,r.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let n=await this.encoder.encode({event:t,args:r});return this.channel.postMessage(n),!0}catch(n){this.log.warn(`emit(${t})`,n)}return!1}};o(Ce,"PubSub");function ri(e){return new Ce(e)}o(ri,"usePubSub");var ct=O(require("util/types"),1);function ni(){let e=!0;return(t,r)=>{let n=!1;if(e){e=!1;try{t(),n=!0}finally{e=!0}}else r!==void 0&&r();return n}}o(ni,"useMutex");function oi(){let e=!0;return async(t,r)=>{let n=!1;if(e){e=!1;try{let i=t();(0,ct.isPromise)(i)&&await i,n=!0}finally{e=!0}}else if(r!==void 0){let i=r();(0,ct.isPromise)(i)&&await i}return n}}o(oi,"useAsyncMutex");var ne=b("network"),De={cache:"no-cache",redirect:"follow"};async function ft(e,t={},r=fetch){try{let n=await r(e,t);if(n.status<400)return n;try{ne.warn(`Fetch of ${e} with ${t} returned status=${n.status}`),ne.warn(`Response: ${await n.text()}`)}catch(i){ne.error("Exception:",i)}}catch(n){ne.error("fetchBasic",n)}}o(ft,"fetchBasic");async function ii(e,t={},r=fetch){try{let n=await ft(e,U(ae(U({method:"GET"},De),{headers:{}}),t),r);if(n)return await n.json()}catch(n){ne.error("fetchJSON error:",n)}}o(ii,"fetchJson");function si(e,t="POST"){return ae(U({method:t},De),{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:ot(e)})}o(si,"fetchOptionsFormURLEncoded");function ai(e,t="POST"){return ae(U({method:t},De),{headers:{"Content-Type":"application/json; charset=utf-8",Accept:"application/json"},body:JSON.stringify(e)})}o(ai,"fetchOptionsJson");async function ui(e,t={},r=fetch){try{let n=await ft(e,U(ae(U({method:"GET"},De),{headers:{}}),t),r);if(n)return await n.text()}catch(n){ne.error("fetchHTML error:",n)}}o(ui,"fetchText");function pt(){if(typeof window!="undefined")return window}o(pt,"getWindow");function mr(){if(typeof navigator!="undefined")return navigator}o(mr,"getNavigator");function li(){var e;return((e=pt())!=null?e:typeof WorkerGlobalScope!="undefined")?self:typeof global!="undefined"?global:Function("return this;")()}o(li,"getGlobal");var T=mr(),P=pt();function yr(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){var t,r,n,i,s,l,a,u,c;return e.ios=((t=T==null?void 0:T.platform)==null?void 0:t.match(/(iPhone|iPod|iPad)/i))!=null,e.macos=!!((r=T==null?void 0:T.platform)==null?void 0:r.startsWith("Mac")),e.windows=!!((n=T==null?void 0:T.platform)==null?void 0:n.startsWith("Win")),e.beaker=(P==null?void 0:P.beaker)!=null,e.electron=(((s=(i=T==null?void 0:T.userAgent)==null?void 0:i.toLowerCase())==null?void 0:s.indexOf(" electron/"))||-1)>-1&&!e.beaker,e.wkwebview=((l=P==null?void 0:P.webkit)==null?void 0:l.messageHandlers)!=null,e.pwa=(T==null?void 0:T.serviceWorker)!=null,e.pwaInstalled=(T==null?void 0:T.standalone)||((u=(a=P==null?void 0:P.matchMedia)==null?void 0:a.call(P,"(display-mode: standalone)"))==null?void 0:u.matches),e.node=typeof process!="undefined"&&((c=process==null?void 0:process.release)==null?void 0:c.name)==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope,e.jest=typeof jest!="undefined",e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=P&&"ontouchstart"in P||((T==null?void 0:T.maxTouchPoints)||0)>1||(T==null?void 0:T.msPointerEnabled)&&(P==null?void 0:P.MSGesture)||(P==null?void 0:P.DocumentTouch)&&document instanceof DocumentTouch,e}o(yr,"detect");var hr=o(()=>typeof window!="undefined"&&globalThis===window,"isBrowser"),ci=yr();function fi(e){hr()?window.addEventListener("beforeunload",e):typeof process!="undefined"&&process.on("exit",()=>e)}o(fi,"useExitHandler");function pi(e={}){let{maxParallel:t=3}=e,r=0,n=0,i={};function s(){if(r>=t)return;let a=Object.values(i).filter(u=>!u.running);if(a.length>0){let u;for(let c of a)(u==null||c.priority<u.priority)&&(u=c);u&&(u.running=!0,++r,u.task().then(c=>{(u==null?void 0:u.id)&&delete i[u.id],--r,s()}).catch(c=>{(u==null?void 0:u.id)&&delete i[u.id],--r,s()}))}}o(s,"performNext");function l(a){let u=i[a];u&&u.running!==!0&&delete i[a]}return o(l,"cancel"),{cancel:l,enqueue(a,u){return i[a]==null&&(i[a]={id:a,task:u,priority:++n,running:!1},s()),()=>l(a)}}}o(pi,"usePool");var di=b("zeed:queue"),dt=class{constructor(t={}){this.queue=[];this.isPaused=!1;this.waitToFinish=[];let{name:r=j("queue"),logLevel:n}=t;this.name=r,this.log=b(`zeed:queue:${r}`),this.log.level=n!=null?n:L.off}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.isPaused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.isPaused;){let t=this.queue.shift();if(this.log(`performNext => ${t==null?void 0:t.name}`),t==null)break;let{name:r,task:n,resolve:i}=t;this.currentTask=n();let s;try{this.log.info(`start task ${r}`),s=await this.currentTask,this.log(`finished task ${r} with result =`,s)}catch(l){di.warn("Error performing task",l)}i(s),this.currentTask=void 0}for(;this.waitToFinish.length>0;)this.waitToFinish.shift()()}async enqueue(t,r={}){let{immediate:n=!1,name:i=j(this.name)}=r;return n?(this.log.info(`immediate execution ${i}`),await t()):(this.log(`enqueue ${i}`),new Promise(s=>{this.queue.push({name:i,task:t,resolve:s}),this.performNext()}))}async enqueueReentrant(t,r={}){return this.enqueue(t,{immediate:this.currentTask!=null,name:r.name})}async cancelAll(t=!0){this.log("cancelAll");let r=this.queue.map(n=>n.resolve);this.queue=[],r.forEach(n=>n(void 0)),await this.wait()}async pause(){this.log("pause"),this.isPaused=!0,await this.wait()}resume(){this.log("resume"),this.isPaused=!1,this.performNext()}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.isPaused)))return new Promise(t=>{this.waitToFinish.push(t)})}};o(dt,"SerialQueue");var za=b("zeed:memstorage"),gt=class{constructor(t={}){this.store={}}setItem(t,r){this.store[t]=J(r)}getItem(t){if(this.store.hasOwnProperty(t))return J(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};o(gt,"MemStorage");var oe=!1,ie=oe?b("zeed:throttle"):()=>{};function gi(e,t={}){let{delay:r=100,trailing:n=!0,leading:i=!0}=t,s=0,l=0,a=0,u=Date.now();function c(){s&&(clearTimeout(s),s=void 0)}o(c,"clearExistingTimeout");function p(...f){let m=Date.now(),y=this,x=m-l;function w(){let h=Date.now();return`total ${(h-u).toFixed(1)}ms - elapsed ${(h-l).toFixed(1)}ms - visited ${a}x`}o(w,"debugElapsed");function g(){a=0,l=Date.now(),e.apply(y,f)}if(o(g,"exec"),x>r||!s){oe&&ie("elapsed",w()),i&&(x>r?(oe&&ie("\u{1F680} leading",w()),g()):++a);let h=x>r?r:r-x;ie(`\u23F1 start timeout with ${h.toFixed(1)}ms}`,w()),c(),l=m,s=setTimeout(()=>{oe&&ie("\u23F1 reached timeout",w()),s=0,n&&(!i||a>0)&&(oe&&ie("\u{1F680} trailing",w()),g())},h)}else++a,oe&&ie("visited",w())}return o(p,"wrapper"),p.cancel=c,p.dispose=c,p}o(gi,"throttle");function mi(e,t={}){let{delay:r=100}=t,n=0;function i(){n&&(clearTimeout(n),n=0)}o(i,"clearExistingTimeout");function s(...l){let a=this;i(),n=setTimeout(()=>{n=0,e.apply(a,l)},r)}return o(s,"wrapper"),s.cancel=i,s.dispose=i,s}o(mi,"debounce");var Ie=O(require("crypto"),1);try{Ie.default&&Ie.default.webcrypto&&typeof globalThis!="undefined"&&typeof globalThis.crypto=="undefined"&&(globalThis.crypto=Ie.default.webcrypto)}catch(e){console.warn("Failed to polyfill webcrypto",e)}var pe=O(require("fs"),1),xr=O(require("path"),1),de=b("zeed:env"),yi=`
|
|
5
|
-
`,
|
|
6
|
-
`)}switch(o(m,"write"),a.level){case
|
|
7
|
-
`))==null?void 0:t.map(n=>{let i=n.match(/^\s+at.*(\((.*)\)|file:\/\/(.*)$)/);if(i){let s=i[3]||i[2];return s.endsWith(")")&&(s=s.slice(0,-1)),s}}))==null?void 0:r.filter(n=>n!=null))||[]}o(Er,"getStackLlocationList");var bt=(0,xt.resolve)(process.cwd()),Ar,Sr,wt=((Ar=process.env)==null?void 0:Ar.HOME)?(0,xt.resolve)((Sr=process.env)==null?void 0:Sr.HOME):"";function vr(e){if(e.includes("/node_modules/"))return"";let t="file://";return e.startsWith(t)?e.substr(t.length):bt&&e.startsWith(bt)?e.substr(bt.length+1):(wt&&e.startsWith(wt)&&(e="~/"+e.substr(wt.length+1)),e)}o(vr,"pathStripCwd");function
|
|
8
|
-
`).map(l=>l.trim()),s=i.findIndex(l=>e.some(a=>l.startsWith(a)));r=i[s+1],r&&(r=
|
|
9
|
-
`)}o(Re,"log");var me={BOLD:"[1m",UNBOLD:"[2m",RED:"[31m",GREEN:"[32m",BLUE:"[34m",PURPLE:"[35m",GRAY:"[37m",ORANGE:"[38;5;208m",UNCOLOR:"[0m"};var Cr="[0m";function se(e,t){return`${t===8?me.ORANGE:"[3"+(t<8?t:"8;5;"+t)+"m"}${e}${Cr}`}o(se,"colorString");function At(e,t,r=!0){return e.map(n=>{if(typeof n!="string")return n;let i=t,s=Cr;return r&&(i=`${me.BOLD}${i}`,s=`${s}${me.BOLD}`),`${i}${n}${s}`})}o(At,"colorStringList");var Dr="loggerStackTraceDebug-7d38e5a9214b58d29734374cdb9521fd964d7485";function St(e={}){let{level:t=void 0,filter:r=void 0,colors:n=Pr(),levelHelper:i=!0,nameBrackets:s=!0,padding:l=0,fill:a=0,stack:u=!0}=e,c=F(r),p=q(t);return f=>{var S;if(!p(f.level)||!c(f.name))return;let m=ee(),y=f.name||"",x=kr[y||""];x==null&&(x={color:
|
|
3
|
+
`;return r}o(an,"csv");function Wt(e=""){let[t="",r="asc"]=e.split(" ");return r=r.toLowerCase(),{field:t,orderby:r,asc:r!=="desc",desc:r==="desc"}}o(Wt,"parseOrderby");function un(e,t=!0){return`${e} ${t?"asc":"desc"}`}o(un,"composeOrderby");function Le(e,t,r=!0){let n=e||0,i=t||0;return n>i?r?1:-1:n<i?r?-1:1:0}o(Le,"cmp");function ln(e,...t){if(t.length>0){let r=t.map(Wt),n=Array.from(e);return n.sort((i,s)=>{for(let{field:l,asc:a}of r){let u=Le(i[l],s[l],a);if(u!==0)return u}return 0}),n}return e}o(ln,"sortedOrderby");function Ee(e){return e.filter((t,r)=>e.indexOf(t)===r)}o(Ee,"arrayUnique");function _t(e,t){return Ee(e.filter(r=>!t.includes(r)))}o(_t,"arrayMinus");function Zt(...e){return Ee(e.reduce((t=[],r)=>t.concat(r),[]))}o(Zt,"arrayUnion");function Y(...e){return e.flat(1/0)}o(Y,"arrayFlatten");function Vt(e,t){return Ee(e).filter(r=>t.includes(r))}o(Vt,"arrayIntersection");function cn(e,t){return _t(Zt(e,t),Vt(e,t))}o(cn,"arraySymmetricDifference");function fn(e,t){if(e&&Array.isArray(e)){let r;for(;(r=e.indexOf(t))!==-1;)e.splice(r,1);return e}return[]}o(fn,"arrayRemoveElement");function pn(e,t){return e.includes(t)||e.push(t),e}o(pn,"arraySetElement");function ve(e,t){return e.splice(0,e.length,...e.filter(t)),e}o(ve,"arrayFilterInPlace");function dn(e,t){let r=e.findIndex(n=>n===t);return r>=0?e.splice(r,1):e.push(t),e}o(dn,"arrayToggleInPlace");function gn(e){return e.splice(0,e.length),e}o(gn,"arrayEmptyInPlace");function Kt(e,t=Le){return Array.from(e).sort(t)}o(Kt,"arraySorted");function mn(e){return Kt(e,(t,r)=>t-r)}o(mn,"arraySortedNumbers");function Qt(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}o(Qt,"arrayIsEqual");function _e(e){return e.sort(()=>Math.random()>.5?1:-1),e}o(_e,"arrayShuffleInPlace");function yn(e){return _e(Array.from(e))}o(yn,"arrayShuffle");function hn(e){for(;e.length>1;){let t=Array.from(e);if(_e(t),!Qt(e,t))return t}return e}o(hn,"arrayShuffleForce");function xn(e){return e[Math.floor(Math.random()*e.length)]}o(xn,"arrayRandomElement");function bn(...e){return Y(e).reduce((t,r)=>t!=null?r>t?r:t:r,void 0)}o(bn,"arrayMax");function wn(...e){return Y(e).reduce((t,r)=>t!=null?r<t?r:t:r,void 0)}o(wn,"arrayMin");function Tn(e=0,t){if(e<=0)return[];let r=new Array(e);for(let n=0;n<e;n++)r[n]=t instanceof Function?t(n):t;return r}o(Tn,"createArray");var Ln=b("zeed:basex"),En={"2":"01","8":"01234567","11":"0123456789a","16":"0123456789abcdef","32":"0123456789ABCDEFGHJKMNPQRSTVWXYZ","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 $(e){let t;if(typeof e=="string")t=e;else if(t=En[e.toString()],t==null)throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let r=new Uint8Array(256);for(let c=0;c<r.length;c++)r[c]=255;for(let c=0;c<t.length;c++){let p=t.charAt(c),f=p.charCodeAt(0);if(r[f]!==255)throw new TypeError(p+" is ambiguous");r[f]=c}let n=t.length,i=t.charAt(0),s=Math.log(n)/Math.log(256),l=Math.log(256)/Math.log(n);function a(c,p=-1){let f=M(c);if(f.byteLength===0)return"";let m=0,y=0,x=f.byteLength;for(;y!==x&&f[y]===0;)y++;let w=(x-y)*l+1>>>0,g=new Uint8Array(w);for(;y!==x;){let E=f[y],v=0;for(let I=w-1;(E!==0||v<m)&&I!==-1;I--,v++)E+=256*g[I]>>>0,g[I]=E%n>>>0,E=E/n>>>0;if(E!==0)throw Ln.warn("Non-zero carry",f,p,v,w),new Error("Non-zero carry");m=v,y++}let h=w-m;for(;h!==w&&g[h]===0;)h++;let S="";for(;h<w;++h)S+=t.charAt(g[h]);return p>0?S.padStart(p,i):S}o(a,"encode");function u(c,p=-1){if(typeof c!="string")throw new TypeError("Expected String");if(c.length===0)return new Uint8Array;c=c.replace(/\s+/gi,"");let f=0,m=0;for(;c[f]===i;)f++;let y=(c.length-f)*s+1>>>0,x=new Uint8Array(y);for(;c[f];){let g=r[c.charCodeAt(f)];if(g===255)throw new Error(`Unsupported character "${c[f]}"`);let h=0;for(let S=y-1;(g!==0||h<m)&&S!==-1;S--,h++)g+=n*x[S]>>>0,x[S]=g%256>>>0,g=g/256>>>0;if(g!==0)throw new Error("Non-zero carry");m=h,f++}let w=y-m;for(;w!==y&&x[w]===0;)w++;return p>0?new Uint8Array([...new Uint8Array(p-x.length+w),...x.slice(w)]):x.slice(w)}return o(u,"decode"),{encode:a,decode:u}}o($,"useBase");var{encode:vn,decode:An}=$(16),{encode:Sn,decode:Pn}=$(32),{encode:Mn,decode:kn}=$(58),{encode:Cn,decode:Dn}=$(62),{encode:In,decode:Un}=$(62);var On=o(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,r)=>r.toUpperCase()),e=e[0].toLowerCase()+e.substring(1)),e),"toCamelCase");function Yt(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}o(Yt,"toCapitalize");function Fn(e){return e.replace(/\w\S*/g,Yt)}o(Fn,"toCapitalizeWords");function $n(e,t="-"){return t=typeof t=="undefined"?"_":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()}o($n,"fromCamelCase");function Rn(e,t){var r=[],n=[];return t==null&&(t=o(function(i,s){return r[0]===s?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(s)).join(".")+"]"},"cycleReplacer")),function(i,s){if(r.length>0){var l=r.indexOf(this);~l?r.splice(l+1):r.push(this),~l?n.splice(l,1/0,i):n.push(i),~r.indexOf(s)&&(s=t==null?void 0:t.call(this,i,s))}else r.push(s);return e==null?s:e.call(this,i,s)}}o(Rn,"serializer");function Ae(e,t,r,n){return JSON.stringify(e,Rn(t,n),r)}o(Ae,"jsonStringify");var Xt=["1","true","yes","y","on"];function Nn(e,t=!1){return e==null||typeof e!="string"?t:Xt.includes(String(e).trim().toLowerCase())}o(Nn,"stringToBoolean");function Bn(e,t=0){var r;return e==null||typeof e!="string"?t:(r=parseInt(e.trim(),10))!=null?r:t}o(Bn,"stringToInteger");function Hn(e,t=0){var r;return e==null||typeof e!="string"?t:(r=parseFloat(e.trim()))!=null?r:t}o(Hn,"stringToFloat");function er(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:Xt.includes(String(e).trim().toLowerCase())}o(er,"valueToBoolean");function tr(e,t=0){var r;return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):(r=parseInt(String(e).trim(),10))!=null?r:t}o(tr,"valueToInteger");function rr(e,t=0){var r;return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):(r=parseFloat(String(e).trim()))!=null?r:t}o(rr,"valueToFloat");function Se(e,t=""){var r;return e==null?t:(r=String(e))!=null?r:t}o(Se,"valueToString");var jn=rr,Gn=tr,zn=Se,qn=er;function nr(e,t={}){let{trace:r=!0,pretty:n=!0}=t;return e.map(i=>i&&typeof i=="object"?i instanceof Error?r?`${i.name||"Error"}: ${i.message}
|
|
4
|
+
${i.stack}`:`${i.name||"Error"}: ${i.message}`:n?Ae(i,null,2):Ae(i):String(i))}o(nr,"formatMessages");function ce(e,t={}){return nr(e,t).join(" ")}o(ce,"renderMessages");function Jn(e){try{return decodeURIComponent(escape(e))}catch{}return e}o(Jn,"fixBrokenUth8String");var Wn={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:Kn,fromCents:!1},or=o(e=>Math.round(e),"round"),Ze=o(e=>Math.pow(10,e),"pow"),_n=o((e,t)=>or(e/t)*t,"rounding"),Zn=/(\d)(?=(\d{3})+\b)/g,Vn=/(\d)(?=(\d\d)+\d\b)/g;function B(e,t={}){return new R(e,t)}o(B,"currency");var Me=class{constructor(t,r={}){var l;let n=Object.assign({},Wn,r),i=Ze((l=n.precision)!=null?l:2),s=Pe(t,n);this.intValue=s,this.value=s/i,n.increment=n.increment||1/i,n.useVedic?n.groups=Vn:n.groups=Zn,this._settings=n,this._precision=i}add(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r+=Pe(t,n))/(n.fromCents?1:i),n)}subtract(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r-=Pe(t,n))/(n.fromCents?1:i),n)}multiply(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r*=t)/(n.fromCents?1:Ze(i)),n)}divide(t){let{intValue:r,_settings:n}=this;return B(r/=Pe(t,n,!1),n)}distribute(t){let{intValue:r,_precision:n,_settings:i}=this,s=[],l=Math[r>=0?"floor":"ceil"](r/t),a=Math.abs(r-l*t),u=i.fromCents?1:n;for(;t!==0;t--){let c=B(l/u,i);a-- >0&&(c=c[r>=0?"add":"subtract"](1/u)),s.push(c)}return s}dollars(){return~~this.value}cents(){let{intValue:t,_precision:r}=this;return~~(t%r)}format(t){let{_settings:r}=this;return typeof t=="function"?t(this,r):r.format(this,Object.assign({},r,t))}toString(){let{intValue:t,_precision:r,_settings:n}=this;return _n(t/r,n.increment).toFixed(n.precision)}toJSON(){return this.value}static sum(...t){return Y(t).reduce((r,n)=>B(r).add(n),this.zero)}static avg(...t){let r=Y(t);return r.reduce((n,i)=>B(n).add(i),this.zero).divide(r.length)}},R=Me;o(R,"Currency"),R.zero=new Me(0),R.one=new Me(1);function Pe(e,t,r=!0){let n=0,{decimal:i,errorOnInvalid:s,precision:l,fromCents:a}=t,u=Ze(l),c=typeof e=="number";if(e instanceof R&&a)return e.intValue;if(c||e instanceof R)n=e instanceof R?e.value:e;else if(typeof e=="string"){let p=new RegExp("[^-\\d"+i+"]","g"),f=new RegExp("\\"+i,"g");n=e.replace(/\((.*)\)/,"-$1").replace(p,"").replace(f,"."),n=n||0}else{if(s)throw Error("Invalid Input");n=0}return a||(n*=u,n=n.toFixed(4)),r?or(n):n}o(Pe,"parse");function Kn(e,t){let{pattern:r,negativePattern:n,symbol:i,separator:s,decimal:l,groups:a}=t,u=(""+e).replace(/^-/,"").split("."),c=u[0],p=u[1];return(e.value>=0?r:n).replace("!",i).replace("#",c.replace(a,"$1"+s)+(p?l+p:""))}o(Kn,"format");var X=o(e=>Math.abs(e)%1===.5,"isHalf"),Ve=o(e=>e%2===0,"isEven"),Qn=o(e=>Math.ceil(e),"roundUp"),Yn=o(e=>Math.floor(e),"roundDown"),Xn=o(e=>Math.round(e),"roundHalfUp"),eo=o(e=>{let t=Math.round(e);return X(e)&&Ve(t)?t-1:t},"roundHalfOdd"),to=o(e=>X(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),ro=o(e=>X(e)?Math.floor(e):Math.round(e),"roundHalfDown"),no=o(e=>{let t=Math.round(e);return X(e)?Ve(t)?t:t-1:t},"roundHalfEven"),oo=o(e=>X(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");var{warn:ir}=b("zeed:promise");async function io(e){return new Promise(t=>setTimeout(t,e))}o(io,"sleep");async function so(){return new Promise(e=>setTimeout(e,0))}o(so,"immediate");var Ke=Symbol("timeout");async function ao(e,t,r=Ke){return new Promise(async(n,i)=>{let s=!1,l=setTimeout(()=>{s=!0,n(r)},t);try{let a=await e;clearTimeout(l),s||n(a)}catch(a){clearTimeout(l),s||i(a)}})}o(ao,"timeout");var Qe=new Error("Timeout reached");function uo(e){return e===Ke||e===Qe}o(uo,"isTimeout");async function Ye(e,t){return t<=0?await e:new Promise(async(r,n)=>{let i=!1,s=setTimeout(()=>{i=!0,n(Qe)},t);try{let l=await e;clearTimeout(s),i||r(l)}catch(l){clearTimeout(s),i||n(l)}})}o(Ye,"tryTimeout");function lo(e,t,r=1e3){return new Promise((n,i)=>{let s=o(u=>{a&&(clearTimeout(a),l(),n(u))},"fn"),l=o(()=>{a=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):ir("No remove listener method found for",e,t)},"done"),a=setTimeout(()=>{l(),i(new Error("Did not response in time"))},r);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):ir("No listener method found for",e)})}o(lo,"waitOn");function k(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}o(k,"isPromise");function H(e){return Promise.resolve(e)}o(H,"promisify");var Xe=1e3*60*60*24,A=class{constructor(t){var r;if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=(r=A.from(t))==null?void 0:r.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 A(t)}static fromString(t){return new A(+t.replace(/[^0-9]/g,""))}static fromDate(t,r=!1){return r?A.fromString(t.toISOString().substr(0,10)):new A(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return A.fromDate(t,!0)}static from(t,r=!1){if(typeof t=="number")return new A(t);if(typeof t=="string")return A.fromString(t);if(t instanceof Date)return A.fromDate(t,r);if(t instanceof A)return t}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let r=String(this.days);return r.slice(0,4)+t+r.slice(4,6)+t+r.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)}dayOffset(t){return A.fromDateGMT(new Date(this.toDateGMT().getTime()+t*Xe))}daysUntil(t){var r;return Math.round((((r=new A(t))==null?void 0:r.toDateGMT().getTime())-this.toDateGMT().getTime())/Xe)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};o(A,"Day");async function co(e,t,r){let n=A.from(e),i=A.from(t);for(;n&&i&&(n==null?void 0:n.days)<=(i==null?void 0:i.days);){let s=r(n);k(s)&&await s,n=n.dayOffset(1)}}o(co,"forEachDay");function fo(){return new A}o(fo,"today");function po(e){return new A(e)}o(po,"day");var et=o(e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),"escapeHTML"),go=o(e=>e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),"unescapeHTML");function mo(e=.25){return Math.random()<e}o(mo,"randomBoolean");function yo(e=100,t=0){return t+Math.floor(Math.random()*(e-t))}o(yo,"randomInt");function ho(e=100,t=0){return t+Math.random()*(e-t)}o(ho,"randomFloat");function xo(e,t,r){return Math.max(e,Math.min(r,t))}o(xo,"between");var bo=100,sr=/[\u0000-\u001F\u0080-\u009F]/g,wo=/^\.+/,To=/\.+$/;function ar(){return/[<>:"/\\|?*\u0000-\u001F]/g}o(ar,"filenameReservedRegex");function Lo(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}o(Lo,"windowsReservedNameRegex");function tt(e){if(typeof e!="string")throw new TypeError("Expected a string");let t="_";if(ar().test(t)&&sr.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(ar(),t).replace(sr,t).replace(wo,t).replace(To,""),e=Lo().test(e)?e+t:e,e.slice(0,bo)}o(tt,"toValidFilename");var Eo=/[\\\-\[\]\/{}()*+?.^$|]/g;function vo(e){return e?e instanceof RegExp?e.source:e.replace(Eo,"\\$&"):""}o(vo,"escapeRegExp");function rt(e){return e.reduce((t,r)=>Math.min(t,r.sort_weight||0),0)-1-Math.random()}o(rt,"startSortWeight");function nt(e){return e.reduce((t,r)=>Math.max(t,r.sort_weight||0),0)+1+Math.random()}o(nt,"endSortWeight");function Ao(e,t,r){let n=r.length,i=e<t;if(n<=0||e>=n-1)return nt(r);if(e<=0)return rt(r);r=ur([...r]);let s=i?-1:0,l=r[e+s].sort_weight||0,u=(r[e+s+1].sort_weight||0)-l;if(u===0)return i?rt(r):nt(r);let c=l+u/2,p=u*.01*(Math.random()-.5);return c+p}o(Ao,"moveSortWeight");function ur(e){return e.sort((t,r)=>(t.sort_weight||0)-(r.sort_weight||0)),e}o(ur,"sortedItems");var So=/((?:(?:(?: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 Po(e){return e.split(So).map((t,r)=>{let n=et(t);return r%2?`<a target="_blank" href="${n}">${lr(n)}</a>`:n}).join("")}o(Po,"linkifyPlainText");function lr(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}o(lr,"toHumanReadableUrl");function ot(e){let t=[];for(let[r,n]of Object.entries(e))if(n!=null){Array.isArray(n)||(n=[n]);for(let i of n)i!=null&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(i.toString()||""))}return t.join("&")}o(ot,"encodeQuery");function Mo(e){let t={},r=(e[0]==="?"?e.substr(1):e).split("&");for(let n=0;n<r.length;n++){let i=r[n].split("="),s=decodeURIComponent(i[0]),l=decodeURIComponent(i[1]||"");t[s]!=null?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(l)):t[s]=l}return t}o(Mo,"parseQuery");function ko(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}o(ko,"size");function Co(e){return e!=null&&e.length>0?e[e.length-1]:void 0}o(Co,"last");function Do(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:(e==null?void 0:e.size)!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.error("Failed to check if empty for",e,t)}return!0}o(Do,"empty");function W(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(W,"cloneObject");function Io(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(Io,"cloneJsonObject");async function Uo(e){typeof e=="function"?await H(e()):k(e)?await e:typeof e.dispose=="function"?await H(e.dispose()):k(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await H(e.cleanup()):k(e.cleanup)&&await e.cleanup}o(Uo,"callDisposer");function cr(){let e=[],t=o(async i=>{e.includes(i)&&(ve(e,s=>s!==i),await Uo(i))},"untrack"),r=o(async()=>{for(;e.length>0;)await t(e[0])},"dispose"),n=o(i=>(e.unshift(i),()=>t(i)),"track");return Object.assign(r,{track:n,add:n,untrack:t,dispose:r,exec:r,getSize(){return e.length}})}o(cr,"useDispose");var Oo=cr;function Fo(e={}){let{mode:t="fifo"}=e,r=[],n=o(async(s=!1)=>{for(;r.length>0;){let l=r[0];if(ve(r,a=>a!==l),typeof l=="function"){let a=l();if(k(a)){if(s)throw new Error(`Expected sync only function, but found async: ${l}`);await a}}else if(k(l)){if(s)throw new Error(`Expected sync only function, but found async: ${l}`);await l}else throw new Error(`Unhandled disposable: ${l}`)}},"exec");return Object.assign(n,{add:o(s=>{t==="lifo"?r.unshift(s):r.push(s)},"add"),exec:n,getSize(){return r.length}})}o(Fo,"useDefer");function $o(e,t=0){let r=setTimeout(e,t);return()=>{r&&(clearTimeout(r),r=void 0)}}o($o,"useTimeout");function Ro(e,t){let r=setInterval(e,t);return()=>{r&&(clearInterval(r),r=void 0)}}o(Ro,"useInterval");function No(e,t,r,...n){return e==null?()=>{}:(e.on?e.on(t,r,...n):e.addEventListener&&e.addEventListener(t,r,...n),()=>{e.off?e.off(t,r,...n):e.removeEventListener&&e.removeEventListener(t,r,...n)})}o(No,"useEventListener");function Bo(e=(r=>(r=(t=>(t=globalThis==null?void 0:globalThis.location)==null?void 0:t.hostname)())!=null?r:"")()){return["localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}o(Bo,"isLocalHost");var ee=o(()=>Date.now(),"getTimestamp");function it(e){return e>999?(e/1e3).toFixed(1)+"s":e.toFixed(2)+"ms"}o(it,"formatMilliseconds");function Ho(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let r=null;if(t.includes(":"))try{r=new Date(t)}catch{}if(!(r instanceof Date)){let n=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);n&&(r=new Date(+n[1],+n[2]-1,+n[3],12,0))}if(r instanceof Date)return r}}}o(Ho,"parseDate");var{encode:st,decode:fr}=$(62),{encode:jo}=$(32);function at(){return J(16)}o(at,"uuidBytes");var Go=o(()=>new Uint32Array(J(4))[0],"uuid32bit");function te(){return st(at(),22)}o(te,"uuid");function zo(e){return st(e,22)}o(zo,"uuidEncode");function qo(e){return fr(e,16)}o(qo,"uuidDecode");function Jo(){return jo(at(),26)}o(Jo,"uuidB32");var ut={};function j(e="id"){return ut[e]==null&&(ut[e]=0),`${e}-${ut[e]++}`}o(j,"uname");var Wo=0;function _o(){return`id-${Wo++}`}o(_o,"qid");var Zo="10000000-1000-4000-8000-100000000000",Vo=o(()=>Zo.replace(/[018]/g,e=>(e^J(1)[0]&15>>e/4).toString(16)),"uuidv4"),pr=16e11;function Ko(e){var t=new Uint8Array([0,0,0,0,0,0]);let r=t.length-1;for(var n=0;n<t.length;n++){var i=e&255;t[r-n]=i,e=(e-i)/256}return t}o(Ko,"longToByteArray");function dr(){let e=ee()-pr;return new Uint8Array([...Ko(e),...J(10)])}o(dr,"suidBytes");function Qo(){return st(dr(),22)}o(Qo,"suid");function Yo(e){return gr(fr(e,16))}o(Yo,"suidDate");function gr(e){return new Date(pr+e.slice(0,6).reduce((t,r)=>t*256+r,0))}o(gr,"suidBytesDate");var re=b("zeed:emitter"),N=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.call=new Proxy({},{get:(t,r)=>(...n)=>this.emit(r,...n)})}async emit(t,...r){let n=!1;try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...r)),i.length>0){let s=i.map(l=>{try{return H(l(...r))}catch(a){re.warn("emit warning:",a)}});n=!0,await Promise.all(s)}}catch(i){re.error("emit exception",i)}return n}onAny(t){this.subscribersOnAny.push(t)}on(t,r){let n=this.subscribers[t]||[];return n.push(r),this.subscribers[t]=n,()=>{this.off(t,r)}}onCall(t){for(let[r,n]of Object.entries(t))this.on(r,n)}once(t,r){let n=o(async(...i)=>(this.off(t,n),await H(r(...i))),"onceListener");return this.on(t,n),()=>{this.off(t,r)}}off(t,r){return this.subscribers[t]=(this.subscribers[t]||[]).filter(n=>r&&n!==r),this}removeAllListeners(t){return this.subscribers={},this}dispose(){this.subscribers={},this.subscribersOnAny=[]}};o(N,"Emitter");function Xo(){let e=K().emitter;return e||(e=new N,K().emitter=e),e}o(Xo,"getGlobalEmitter");var ei=new N;function ti(e,t){let r=Math.round(Math.random()*100);var n=[],i;let s=o((a,u)=>{let c={key:a,obj:u};n.push(c),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):re.error(r,"Cannot listen to key"):e.onAny?e.onAny((a,u)=>{s(a,u)}):re.error(r,"cannot listen to all for",e),o((a,u=!0)=>new Promise((c,p)=>{a||(a=t,a||n.length&&(a=n[0].key)),i=o(()=>{for(;n.length>0;){let f=n.shift();if(f.key===a)i=void 0,c(f.obj);else{if(u){re.warn(r,`Unhandled event ${a} with value: ${f.obj}`);continue}p(`Expected ${a}, but found ${f.key} with value=${f.obj}`),re.error(r,`Unhandled event ${a} with value: ${f.obj}`)}break}},"lazyResolve"),i()}),"on")}o(ti,"lazyListener");var ke=class extends N{constructor(){super(...arguments);this.id=te()}close(){}};o(ke,"Channel");var fe=class extends ke{constructor(){super(...arguments);this.isConnected=!0}postMessage(t){var r;(r=this.other)==null||r.emit("message",{data:t,origin:"local",lastEventId:te()})}};o(fe,"LocalChannel");function ri(){let e=new fe,t=new fe;return e.other=t,t.other=e,[e,t]}o(ri,"fakeWorkerPair");var _=class{async encode(t){return be(t)}async decode(t){return we(t)}};o(_,"JsonEncoder");var lt=class{constructor(t){this.key=t}async encode(t){let r=be(t);return await Je(r,this.key)}async decode(t){let r=await We(t,this.key);return we(r)}};o(lt,"CryptoEncoder");var ct=o((e,t,r={})=>new Proxy(r,{get:(n,i)=>i in n?n[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function ni(e={}){let{name:t=j("hub"),encoder:r=new _,retryAfter:n=1e3,ignoreUnhandled:i=!0}=e,s=b(t),l={},a,u=[],c,p={},f=o(()=>{clearTimeout(c)},"dispose"),m=o(async()=>{if(clearTimeout(c),a){if(a.isConnected)for(;u.length;){let g=u[0];try{a.postMessage(await r.encode(g)),u.shift()}catch(h){s.warn("postMessage",h);break}}u.length>0&&n>0&&(c=setTimeout(m,n))}},"postNext"),y=o(async g=>{s("enqueue postMessage",g),u.push(g),await m()},"postMessage"),x=o(async g=>{a=g,a.on("connect",m),a.on("message",async h=>{s("onmessage",typeof h);let{name:S,args:E,id:v,result:I,error:G}=await r.decode(h.data);if(S){s(`name ${S} id ${v}`);try{if(l[S]==null)throw new Error(`handler for ${S} was not found`);let D=l[S](...E);k(D)&&(D=await D),s(`result ${D}`),v&&y({id:v,result:D})}catch(D){let z=D instanceof Error?D:new Error(Se(D));s.warn("execution error",z.name),y({id:v,error:{message:z.message,stack:z.stack,name:z.name}})}}else if(v)if(s(`response for id=${v}: result=${I}, error=${G}`),p[v]==null)I===void 0?s(`skip response for ${v}`):s.warn(`no response hook for ${v}`);else{let[D,z]=p[v];if(D&&z)if(delete p[v],G){let ye=new Error(G.message);ye.stack=G.stack,ye.name=G.name,s.warn("reject",ye.name),z(ye)}else s("resolve",I),D(I)}else i||s.warn("Unhandled message",h)}),m()},"connect"),w=o(async(g,h,S={})=>{let{timeout:E=5e3}=S,v=te();return y({name:g,args:h,id:v}),Ye(new Promise((I,G)=>p[v]=[I,G]),E)},"fetchMessage");return e.channel&&x(e.channel),{dispose:f,connect:x,listen(g){Object.assign(l,g)},send(){return ct(w,{},{options(g){return ct(w,U({},g))}})}}}o(ni,"useMessageHub");var Ce=class extends N{constructor(t){super();this.publish=this.emit;this.subscribe=this.on;var l;let{name:r,encoder:n=new _,channel:i,debug:s=!1}=t;this.channel=i,this.encoder=n,this.debug=s,this.name=(l=r!=null?r:this.channel.id)!=null?l:j("pubsub"),this.log=b(`${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:a})=>{let u=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${u==null?void 0:u.event}, info=`,u):this.log(`channel message, event=${u==null?void 0:u.event}`),u){let{event:c,args:p}=u;await this.emitSuper(c,...p)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(t,...r){return await super.emit(t,...r)}async emit(t,...r){try{if(this.debug?this.log(`emit(${t})`,t):this.log(`emit(${t})`,r.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let n=await this.encoder.encode({event:t,args:r});return this.channel.postMessage(n),!0}catch(n){this.log.warn(`emit(${t})`,n)}return!1}};o(Ce,"PubSub");function oi(e){return new Ce(e)}o(oi,"usePubSub");function ii(){let e=!0;return(t,r)=>{let n=!1;if(e){e=!1;try{t(),n=!0}finally{e=!0}}else r!==void 0&&r();return n}}o(ii,"useMutex");function si(){let e=!0;return async(t,r)=>{let n=!1;if(e){e=!1;try{let i=t();k(i)&&await i,n=!0}finally{e=!0}}else if(r!==void 0){let i=r();k(i)&&await i}return n}}o(si,"useAsyncMutex");var ne=b("network"),De={cache:"no-cache",redirect:"follow"};async function ft(e,t={},r=fetch){try{let n=await r(e,t);if(n.status<400)return n;try{ne.warn(`Fetch of ${e} with ${t} returned status=${n.status}`),ne.warn(`Response: ${await n.text()}`)}catch(i){ne.error("Exception:",i)}}catch(n){ne.error("fetchBasic",n)}}o(ft,"fetchBasic");async function ai(e,t={},r=fetch){try{let n=await ft(e,U(ae(U({method:"GET"},De),{headers:{}}),t),r);if(n)return await n.json()}catch(n){ne.error("fetchJSON error:",n)}}o(ai,"fetchJson");function ui(e,t="POST"){return ae(U({method:t},De),{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:ot(e)})}o(ui,"fetchOptionsFormURLEncoded");function li(e,t="POST"){return ae(U({method:t},De),{headers:{"Content-Type":"application/json; charset=utf-8",Accept:"application/json"},body:JSON.stringify(e)})}o(li,"fetchOptionsJson");async function ci(e,t={},r=fetch){try{let n=await ft(e,U(ae(U({method:"GET"},De),{headers:{}}),t),r);if(n)return await n.text()}catch(n){ne.error("fetchHTML error:",n)}}o(ci,"fetchText");function pt(){if(typeof window!="undefined")return window}o(pt,"getWindow");function mr(){if(typeof navigator!="undefined")return navigator}o(mr,"getNavigator");function fi(){var e;return((e=pt())!=null?e:typeof WorkerGlobalScope!="undefined")?self:typeof global!="undefined"?global:Function("return this;")()}o(fi,"getGlobal");var T=mr(),P=pt();function yr(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){var t,r,n,i,s,l,a,u,c;return e.ios=((t=T==null?void 0:T.platform)==null?void 0:t.match(/(iPhone|iPod|iPad)/i))!=null,e.macos=!!((r=T==null?void 0:T.platform)==null?void 0:r.startsWith("Mac")),e.windows=!!((n=T==null?void 0:T.platform)==null?void 0:n.startsWith("Win")),e.beaker=(P==null?void 0:P.beaker)!=null,e.electron=(((s=(i=T==null?void 0:T.userAgent)==null?void 0:i.toLowerCase())==null?void 0:s.indexOf(" electron/"))||-1)>-1&&!e.beaker,e.wkwebview=((l=P==null?void 0:P.webkit)==null?void 0:l.messageHandlers)!=null,e.pwa=(T==null?void 0:T.serviceWorker)!=null,e.pwaInstalled=(T==null?void 0:T.standalone)||((u=(a=P==null?void 0:P.matchMedia)==null?void 0:a.call(P,"(display-mode: standalone)"))==null?void 0:u.matches),e.node=typeof process!="undefined"&&((c=process==null?void 0:process.release)==null?void 0:c.name)==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope,e.jest=typeof jest!="undefined",e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=P&&"ontouchstart"in P||((T==null?void 0:T.maxTouchPoints)||0)>1||(T==null?void 0:T.msPointerEnabled)&&(P==null?void 0:P.MSGesture)||(P==null?void 0:P.DocumentTouch)&&document instanceof DocumentTouch,e}o(yr,"detect");var hr=o(()=>typeof window!="undefined"&&globalThis===window,"isBrowser"),pi=yr();function di(e){hr()?window.addEventListener("beforeunload",e):typeof process!="undefined"&&process.on("exit",()=>e)}o(di,"useExitHandler");function gi(e={}){let{maxParallel:t=3}=e,r=0,n=0,i={};function s(){if(r>=t)return;let a=Object.values(i).filter(u=>!u.running);if(a.length>0){let u;for(let c of a)(u==null||c.priority<u.priority)&&(u=c);u&&(u.running=!0,++r,u.task().then(c=>{(u==null?void 0:u.id)&&delete i[u.id],--r,s()}).catch(c=>{(u==null?void 0:u.id)&&delete i[u.id],--r,s()}))}}o(s,"performNext");function l(a){let u=i[a];u&&u.running!==!0&&delete i[a]}return o(l,"cancel"),{cancel:l,enqueue(a,u){return i[a]==null&&(i[a]={id:a,task:u,priority:++n,running:!1},s()),()=>l(a)}}}o(gi,"usePool");var mi=b("zeed:queue"),dt=class{constructor(t={}){this.queue=[];this.isPaused=!1;this.waitToFinish=[];let{name:r=j("queue"),logLevel:n}=t;this.name=r,this.log=b(`zeed:queue:${r}`),this.log.level=n!=null?n:1/0}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.isPaused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.isPaused;){let t=this.queue.shift();if(this.log(`performNext => ${t==null?void 0:t.name}`),t==null)break;let{name:r,task:n,resolve:i}=t;this.currentTask=n();let s;try{this.log.info(`start task ${r}`),s=await this.currentTask,this.log(`finished task ${r} with result =`,s)}catch(l){mi.warn("Error performing task",l)}i(s),this.currentTask=void 0}for(;this.waitToFinish.length>0;)this.waitToFinish.shift()()}async enqueue(t,r={}){let{immediate:n=!1,name:i=j(this.name)}=r;return n?(this.log.info(`immediate execution ${i}`),await t()):(this.log(`enqueue ${i}`),new Promise(s=>{this.queue.push({name:i,task:t,resolve:s}),this.performNext()}))}async enqueueReentrant(t,r={}){return this.enqueue(t,{immediate:this.currentTask!=null,name:r.name})}async cancelAll(t=!0){this.log("cancelAll");let r=this.queue.map(n=>n.resolve);this.queue=[],r.forEach(n=>n(void 0)),await this.wait()}async pause(){this.log("pause"),this.isPaused=!0,await this.wait()}resume(){this.log("resume"),this.isPaused=!1,this.performNext()}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.isPaused)))return new Promise(t=>{this.waitToFinish.push(t)})}};o(dt,"SerialQueue");var Wa=b("zeed:memstorage"),gt=class{constructor(t={}){this.store={}}setItem(t,r){this.store[t]=W(r)}getItem(t){if(this.store.hasOwnProperty(t))return W(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};o(gt,"MemStorage");var oe=!1,ie=oe?b("zeed:throttle"):()=>{};function yi(e,t={}){let{delay:r=100,trailing:n=!0,leading:i=!0}=t,s=0,l=0,a=0,u=Date.now();function c(){s&&(clearTimeout(s),s=void 0)}o(c,"clearExistingTimeout");function p(...f){let m=Date.now(),y=this,x=m-l;function w(){let h=Date.now();return`total ${(h-u).toFixed(1)}ms - elapsed ${(h-l).toFixed(1)}ms - visited ${a}x`}o(w,"debugElapsed");function g(){a=0,l=Date.now(),e.apply(y,f)}if(o(g,"exec"),x>r||!s){oe&&ie("elapsed",w()),i&&(x>r?(oe&&ie("\u{1F680} leading",w()),g()):++a);let h=x>r?r:r-x;ie(`\u23F1 start timeout with ${h.toFixed(1)}ms}`,w()),c(),l=m,s=setTimeout(()=>{oe&&ie("\u23F1 reached timeout",w()),s=0,n&&(!i||a>0)&&(oe&&ie("\u{1F680} trailing",w()),g())},h)}else++a,oe&&ie("visited",w())}return o(p,"wrapper"),p.cancel=c,p.dispose=c,p}o(yi,"throttle");function hi(e,t={}){let{delay:r=100}=t,n=0;function i(){n&&(clearTimeout(n),n=0)}o(i,"clearExistingTimeout");function s(...l){let a=this;i(),n=setTimeout(()=>{n=0,e.apply(a,l)},r)}return o(s,"wrapper"),s.cancel=i,s.dispose=i,s}o(hi,"debounce");var Ie=O(require("crypto"),1);try{Ie.default&&Ie.default.webcrypto&&typeof globalThis!="undefined"&&typeof globalThis.crypto=="undefined"&&(globalThis.crypto=Ie.default.webcrypto)}catch(e){console.warn("Failed to polyfill webcrypto",e)}var pe=O(require("fs"),1),xr=O(require("path"),1),de=b("zeed:env"),xi=`
|
|
5
|
+
`,bi=/^\s*([\w_.-]+)\s*=\s*(.*)?\s*$/,wi=/\\n/g,Ti=/\n|\r|\r\n/;function br(e,t={}){let r={};return e.toString().split(Ti).forEach(function(n,i){let s=n.match(bi);if(s!=null){let l=s[1],a=s[2]||"",u=a.length-1,c=a[0]==='"'&&a[u]==='"';a[0]==="'"&&a[u]==="'"||c?(a=a.substring(1,u),c&&(a=a.replace(wi,xi))):a=a.trim(),r[l]=a}else de.debug(`did not match key and value when parsing line ${i+1}: ${n}`)}),r}o(br,"parse");function wr(e,t="."){return(0,xr.resolve)(process.cwd(),e!=null?e:t)}o(wr,"stringToPath");function Tr(e,t=""){return e==null&&(e=t),wr(String(e).trim(),t)}o(Tr,"valueToPath");var Ue=Tr;function Li(e={}){var i,s,l,a;let t=(s=e==null?void 0:e.path)!=null?s:Ue((i=e==null?void 0:e.filename)!=null?i:".env"),r=(l=e==null?void 0:e.encoding)!=null?l:"utf8",n=(e==null?void 0:e.debug)||!1;n!==!0&&(de.level=1/0);try{let u=pe.default.existsSync(t)?br(pe.default.readFileSync(t,{encoding:r}),{debug:n}):{},c=pe.default.existsSync(t+".local")?br(pe.default.readFileSync(t+".local",{encoding:r}),{debug:n}):{},p=Object.assign({},u,c),f=(a=e==null?void 0:e.env)!=null?a:process.env;return Object.entries(p).forEach(([m,y])=>{typeof(e==null?void 0:e.prefix)=="string"&&(m=(e==null?void 0:e.prefix)+m),Object.prototype.hasOwnProperty.call(f,m)?de.debug(`"${m}" is already defined and will not be overwritten`):y!=null&&(de.info(`set env.${m} = ${y}`),f[m]=y)}),{parsed:p}}catch(u){return de.error(u),{error:u}}}o(Li,"setupEnv");var C=O(require("fs"),1),ge=O(require("path"),1);var mt=b("zeed:filestorage"),yt=class{constructor(t={}){this.store={};this.fileKeys=void 0;this.pretty=!1;var r,n,i,s;this.dirname=(0,ge.resolve)(process.cwd(),t.path||".fileStorage"),this.pretty=!!t.pretty,this.extension=(r=t.extension)!=null?r:".json",t.extension&&!this.extension.startsWith(".")&&(this.extension="."+this.extension),this.extensionLength=this.extension.length,this.objectToString=(n=t.objectToString)!=null?n:l=>this.pretty?JSON.stringify(l,null,2):JSON.stringify(l),this.objectFromString=(i=t.objectFromString)!=null?i:l=>{try{return JSON.parse(l)}catch(a){mt.warn(`fileStorage parse error '${a}' in`,l)}},this.keyToFilename=(s=t.keyToFilename)!=null?s:tt}setItem(t,r){this.store[t]=W(r);try{let n=this.objectToString(r),i=this.getPath(t);(0,C.mkdirSync)((0,ge.dirname)(i),{recursive:!0}),(0,C.writeFileSync)(i,n,"utf8")}catch(n){mt.error("setItem error",n)}}getPath(t){return(0,ge.resolve)(this.dirname,this.keyToFilename(t)+this.extension)}getBuffer(t){let r=this.getPath(t);return Buffer.from((0,C.readFileSync)(r))}getItem(t){let r=this.store[t];if(r!==null){if(r!=null)return W(r);try{let n=this.getPath(t),i=(0,C.readFileSync)(n,"utf8");if(i!=null){let s=this.objectFromString(i);return this.store[t]=s,s}}catch(n){mt.warn("getItem error",n),this.store[t]=null}}}removeItem(t){if(delete this.store[t],this.fileKeys!=null){let r=this.fileKeys.indexOf(t);r!==-1&&this.fileKeys.splice(r,1)}try{let r=this.getPath(t);(0,C.unlinkSync)(r)}catch{}}clear(){this.fileKeys=[],this.store={},(0,C.rmSync)(this.dirname,{recursive:!0,force:!0})}allKeys(){if(this.fileKeys==null)try{this.fileKeys=(0,C.readdirSync)(this.dirname,{withFileTypes:!0}).filter(r=>!r.isDirectory()&&r.name.endsWith(this.extension)).map(r=>r.name.slice(0,-this.extensionLength))||[]}catch{}let t=[...this.fileKeys||[]];for(let r of Object.keys(this.store))t.includes(r)||t.push(r);return t.sort(),t}};o(yt,"FileStorage");var Oe=O(require("fs"),1),Fe=O(require("path"),1);var Lr={};function ht(e,t={}){let{level:r=-1,filter:n="*"}=t;e=(0,Fe.resolve)(process.cwd(),e),(0,Oe.mkdirSync)((0,Fe.dirname)(e),{recursive:!0});var i=(0,Oe.createWriteStream)(e,{flags:"a"});let s=F(n),l=q(r);return a=>{if(!l(a.level)||!s(a.name))return;let u=new Date().toISOString(),c=a.name||"",p=Lr[c||""];p==null&&(Lr[c]=p);let f=[`[${c||"*"}]`,ce(a.messages,{pretty:!1})];function m(...y){i.write(y.join(" ")+`
|
|
6
|
+
`)}switch(o(m,"write"),a.level){case 1:m(u,"I|* ",...f);break;case 2:m(u,"W|** ",...f);break;case 3:m(u,"E|***",...f);break;default:m(u,"D| ",...f);break}}}o(ht,"LoggerFileHandler");var Et=O(require("tty"),1);var xt=O(require("path"),1);function Er(e){var t,r;return typeof e!="string"?[]:((r=(t=e==null?void 0:e.split(`
|
|
7
|
+
`))==null?void 0:t.map(n=>{let i=n.match(/^\s+at.*(\((.*)\)|file:\/\/(.*)$)/);if(i){let s=i[3]||i[2];return s.endsWith(")")&&(s=s.slice(0,-1)),s}}))==null?void 0:r.filter(n=>n!=null))||[]}o(Er,"getStackLlocationList");var bt=(0,xt.resolve)(process.cwd()),Ar,Sr,wt=((Ar=process.env)==null?void 0:Ar.HOME)?(0,xt.resolve)((Sr=process.env)==null?void 0:Sr.HOME):"";function vr(e){if(e.includes("/node_modules/"))return"";let t="file://";return e.startsWith(t)?e.substr(t.length):bt&&e.startsWith(bt)?e.substr(bt.length+1):(wt&&e.startsWith(wt)&&(e="~/"+e.substr(wt.length+1)),e)}o(vr,"pathStripCwd");function Ei(e){let t=e.match(/^\s*at.*(\((.*)\)|file:\/\/(.*)$)/);if(t){let r=t[3]||t[2];return r.endsWith(")")&&(r=r.slice(0,-1)),r}return""}o(Ei,"extractFileInfo");function $e(e=2,t=!0){var i;let r=new Error().stack||"",n=(i=Er(r))==null?void 0:i[e];return n&&t&&(n=vr(n)),n||""}o($e,"getSourceLocation");function Tt(){return new Error().stack||""}o(Tt,"getStack");function Lt(e,t=!0){let r="",n=new Error().stack||"";if(typeof n=="string"){let i=n.split(`
|
|
8
|
+
`).map(l=>l.trim()),s=i.findIndex(l=>e.some(a=>l.startsWith(a)));r=i[s+1],r&&(r=Ei(r)),r&&t&&(r=vr(r))}return r}o(Lt,"getSourceLocationByPrecedingPattern");function Pr(){try{return Et.default.isatty(process.stdout.fd)}catch{}return!1}o(Pr,"isTTY");var Mr=[6,2,3,4,5,1];function vi(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Mr[Math.abs(t)%Mr.length]}o(vi,"selectColor");var kr={},Ai=ee(),vt=Et.default.isatty(process.stderr.fd);function Re(...e){return process.stderr.write(ce(e)+`
|
|
9
|
+
`)}o(Re,"log");var me={BOLD:"[1m",UNBOLD:"[2m",RED:"[31m",GREEN:"[32m",BLUE:"[34m",PURPLE:"[35m",GRAY:"[37m",ORANGE:"[38;5;208m",UNCOLOR:"[0m"};var Cr="[0m";function se(e,t){return`${t===8?me.ORANGE:"[3"+(t<8?t:"8;5;"+t)+"m"}${e}${Cr}`}o(se,"colorString");function At(e,t,r=!0){return e.map(n=>{if(typeof n!="string")return n;let i=t,s=Cr;return r&&(i=`${me.BOLD}${i}`,s=`${s}${me.BOLD}`),`${i}${n}${s}`})}o(At,"colorStringList");var Dr="loggerStackTraceDebug-7d38e5a9214b58d29734374cdb9521fd964d7485";function St(e={}){let{level:t=void 0,filter:r=void 0,colors:n=Pr(),levelHelper:i=!0,nameBrackets:s=!0,padding:l=0,fill:a=0,stack:u=!0}=e,c=F(r),p=q(t);return f=>{var S;if(!p(f.level)||!c(f.name))return;let m=ee(),y=f.name||"",x=kr[y||""];x==null&&(x={color:vi(y)},kr[y]=x);let w=it(m-Ai),g,h=s?`[${y}]`:y;if(l>0&&(h=h.padStart(l," ")),a>0&&(h=h.padEnd(a," ")),n&&vt){let E=x.color;g=[se(h,E)+" | "],f.level===2?g.push(...At(f.messages,me.ORANGE)):f.level===3?g.push(...At(f.messages,me.RED)):g.push(...f.messages),g.push(se(`+${w}`,E))}else g=[h,...f.messages],g.push(`+${w}`);if(((S=f.messages)==null?void 0:S[0])===Dr&&console.log(Tt()),u){let E="";typeof u=="boolean"?(E=Lt(["at Function.","at null.log (","at log ("],!0),E||(E=$e(0,!0))):E=$e(typeof u=="number"?u:3,!0),E&&g.push(se(`(${E})`,7))}switch(f.level){case 1:i&&(g[0]="I|* "+g[0]),Re(...g);break;case 2:i&&(g[0]=(n&&vt?se("W|** ",8):"W|** ")+g[0]),Re(...g);break;case 3:i&&(g[0]=(n&&vt?se("E|*** ",1):"E|*** ")+g[0]),Re(...g);break;default:i&&(g[0]="D| "+g[0]),Re(...g);break}}}o(St,"LoggerNodeHandler");function Si(){var r;let e=[St({padding:32,nameBrackets:!1})],t=(r=process.env.ZEED_LOG)!=null?r:process.env.LOG;t&&e.unshift(ht(Ue(t))),b.setHandlers(e)}o(Si,"setupLogContextNode");Si();module.exports=Hr(Pi);0&&(module.exports={Channel,CryptoEncoder,Currency,DAY_MS,Day,Emitter,FileStorage,JsonEncoder,LocalChannel,LogLevel,LogLevelAlias,Logger,LoggerConsoleHandler,LoggerContext,LoggerFileHandler,LoggerNodeHandler,MemStorage,PubSub,SerialQueue,Uint8ArrayToJson,Uint8ArrayToString,arrayEmptyInPlace,arrayFilterInPlace,arrayFlatten,arrayIntersection,arrayIsEqual,arrayMax,arrayMin,arrayMinus,arrayRandomElement,arrayRemoveElement,arraySetElement,arrayShuffle,arrayShuffleForce,arrayShuffleInPlace,arraySorted,arraySortedNumbers,arraySymmetricDifference,arrayToggleInPlace,arrayUnion,arrayUnique,between,cloneJsonObject,cloneObject,cmp,colorString,colorStringList,composeOrderby,createArray,createPromiseProxy,csv,currency,day,debounce,decodeBase16,decodeBase32,decodeBase58,decodeBase62,decodeBase64,decrypt,deepEqual,deepMerge,deriveKeyPbkdf2,detect,digest,empty,encodeBase16,encodeBase32,encodeBase58,encodeBase62,encodeBase64,encodeQuery,encrypt,endSortWeight,equalBinary,escapeHTML,escapeRegExp,fakeWorkerPair,fetchBasic,fetchJson,fetchOptionsFormURLEncoded,fetchOptionsJson,fetchText,fixBrokenUth8String,forEachDay,formatMessages,formatMilliseconds,fromCamelCase,getGlobal,getGlobalContext,getGlobalEmitter,getNamespaceFilterString,getNavigator,getSourceLocation,getSourceLocationByPrecedingPattern,getStack,getStackLlocationList,getTimestamp,getWindow,immediate,isArray,isBoolean,isBrowser,isEven,isHalf,isInteger,isLocalHost,isNullOrUndefined,isNumber,isObject,isPrimitive,isPromise,isRecord,isSafeInteger,isString,isTTY,isTimeout,jsonStringify,jsonToUint8Array,last,lazyListener,linkifyPlainText,loggerStackTraceDebug,messages,moveSortWeight,parseDate,parseOrderby,parseQuery,platform,promisify,qid,randomBoolean,randomFloat,randomInt,randomUint8Array,renderMessages,roundDown,roundHalfAwayFromZero,roundHalfDown,roundHalfEven,roundHalfOdd,roundHalfTowardsZero,roundHalfUp,roundUp,setupEnv,size,sleep,sortedItems,sortedOrderby,startSortWeight,stringToBoolean,stringToFloat,stringToInteger,stringToPath,stringToUInt8Array,suid,suidBytes,suidBytesDate,suidDate,throttle,timeout,timeoutReached,timoutError,toBase64,toBase64Url,toBool,toCamelCase,toCapitalize,toCapitalizeWords,toFloat,toHex,toHumanReadableUrl,toInt,toPath,toString,toUint8Array,toValidFilename,today,tryTimeout,uname,unescapeHTML,useAsyncMutex,useBase,useDefer,useDispose,useDisposer,useEventListener,useExitHandler,useInterval,useLevelFilter,useMessageHub,useMutex,useNamespaceFilter,usePool,usePubSub,useTimeout,uuid,uuid32bit,uuidB32,uuidBytes,uuidDecode,uuidEncode,uuidv4,valueToBoolean,valueToFloat,valueToInteger,valueToPath,valueToString,waitOn});
|
|
10
10
|
//# sourceMappingURL=index.node.cjs.map
|