zeed 0.7.96 → 0.7.97

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.
@@ -1,2 +1,2 @@
1
- import{a as Fe,b as Ge,c as He,d as Ie,e as Je,f as Ke,g as Le,h as Me,i as Ne,j as Oe,k as Pe,l as Qe,m as Re,n as Se,o as Te}from"./chunk-ADCVWBB3.js";import{$ as uo,$a as ur,$b as ye,A as V,Aa as Wo,Ab as Zr,B as W,Ba as Xo,Bb as _r,C as X,Ca as Yo,Cb as $r,D as Y,Da as Zo,Db as oe,E as Z,Ea as _o,Eb as re,F as _,Fa as $o,Fb as ee,G as $,Ga as or,Gb as fe,H as oo,Ha as rr,Hb as me,I as ro,Ia as er,Ib as pe,J as eo,Ja as fr,Jb as te,K as fo,Ka as mr,Kb as xe,L as mo,La as pr,Lb as ae,M as po,Ma as tr,Mb as be,N as to,Na as xr,Nb as ce,O as xo,Oa as ar,Ob as de,P as ao,Pa as br,Pb as ge,Q as bo,Qa as cr,Qb as he,R as co,Ra as dr,Rb as ie,S as go,Sa as gr,Sb as je,T as ho,Ta as hr,Tb as ke,U as io,Ua as ir,Ub as le,V as jo,Va as jr,Vb as ne,W as ko,Wa as kr,Wb as qe,X as lo,Xa as lr,Xb as se,Y as no,Ya as nr,Yb as ue,Z as qo,Za as qr,Zb as ve,_ as so,_a as sr,_b as we,a as u,aa as vo,ab as vr,ac as ze,b as v,ba as wo,bb as wr,bc as Ae,c as w,ca as yo,cb as yr,cc as Be,d as y,da as zo,db as zr,dc as Ce,e as z,ea as Ao,eb as Ar,ec as De,f as A,fa as Bo,fb as Br,fc as Ee,g as B,ga as Co,gb as Cr,h as C,ha as Do,hb as Dr,i as D,ia as Eo,ib as Er,j as E,ja as Fo,jb as Fr,k as F,ka as Go,kb as Gr,l as G,la as Ho,lb as Hr,m as H,ma as Io,mb as Ir,n as I,na as Jo,nb as Jr,o as J,oa as Ko,ob as Kr,p as K,pa as Lo,pb as Lr,q as L,qa as Mo,qb as Mr,r as M,ra as No,rb as Qr,s as N,sa as Oo,sb as Rr,t as O,ta as Po,tb as Sr,u as P,ua as Qo,ub as Tr,v as Q,va as Ro,vb as Ur,w as R,wa as So,wb as Vr,x as S,xa as To,xb as Wr,y as T,ya as Uo,yb as Xr,z as U,za as Vo,zb as Yr}from"./chunk-LUHXAZ6G.js";import{A as Pr,d as o,e as r,f as e,g as f,h as m,i as p,j as t,k as x,l as a,m as b,n as c,o as d,p as g,q as h,r as i,s as j,t as k,u as l,v as n,w as q,x as s,y as Nr,z as Or}from"./chunk-LNZLD7Y3.js";export{fe as Channel,xe as CryptoEncoder,No as Currency,tr as DAY_MS,xr as Day,$r as Emitter,Je as FileStorage,te as JsonEncoder,me as LocalChannel,j as LogLevel,k as LogLevelAlias,s as Logger,n as LoggerConsoleHandler,l as LoggerContext,Ke as LoggerFileHandler,Te as LoggerNodeHandler,Ce as MemStorage,ce as PubSub,Be as SerialQueue,D as Uint8ArrayToJson,v as Uint8ArrayToString,Y as arrayEmptyInPlace,W as arrayFilterInPlace,R as arrayFlatten,S as arrayIntersection,$ as arrayIsEqual,mo as arrayMax,po as arrayMin,P as arrayMinus,fo as arrayRandomElement,U as arrayRemoveElement,V as arraySetElement,ro as arrayShuffle,eo as arrayShuffleForce,oo as arrayShuffleInPlace,Z as arraySorted,_ as arraySortedNumbers,T as arraySymmetricDifference,X as arrayToggleInPlace,Q as arrayUnion,O as arrayUnique,kr as between,Fr as cloneJsonObject,Er as cloneObject,M as cmp,Qe as colorString,Re as colorStringList,L as composeOrderby,to as createArray,ae as createPromiseProxy,J as csv,Mo as currency,cr as day,Ee as debounce,bo as decodeBase16,go as decodeBase32,io as decodeBase58,ko as decodeBase62,no as decodeBase64,I as decrypt,c as deepEqual,d as deepMerge,G as deriveKeyPbkdf2,ve as detect,F as digest,Dr as empty,ao as encodeBase16,co as encodeBase32,ho as encodeBase58,jo as encodeBase62,lo as encodeBase64,zr as encodeQuery,H as encrypt,sr as endSortWeight,B as equalBinary,dr as escapeHTML,nr as escapeRegExp,pe as fakeWorkerPair,ie as fetchBasic,je as fetchJson,ke as fetchOptionsFormURLEncoded,le as fetchOptionsJson,ne as fetchText,Lo as fixBrokenUth8String,ar as forEachDay,Jo as formatMessages,Or as formatMilliseconds,vo as fromCamelCase,ue as getGlobal,q as getGlobalContext,oe as getGlobalEmitter,g as getNamespaceFilterString,se as getNavigator,Me as getSourceLocation,Oe as getSourceLocationByPrecedingPattern,Ne as getStack,Le as getStackLlocationList,Nr as getTimestamp,qe as getWindow,Zo as immediate,e as isArray,a as isBoolean,we as isBrowser,Po as isEven,Oo as isHalf,t as isInteger,Mr as isLocalHost,b as isNullOrUndefined,p as isNumber,o as isObject,r as isPrimitive,mr as isPromise,f as isRecord,x as isSafeInteger,m as isString,Pe as isTTY,rr as isTimeout,wo as jsonStringify,C as jsonToUint8Array,Cr as last,ee as lazyListener,wr as linkifyPlainText,Se as loggerStackTraceDebug,re as messages,ur as moveSortWeight,Pr as parseDate,K as parseOrderby,Ar as parseQuery,ye as platform,pr as promisify,Vr as qid,hr as randomBoolean,jr as randomFloat,ir as randomInt,E as randomUint8Array,Ko as renderMessages,Ro as roundDown,Uo as roundHalfAwayFromZero,Vo as roundHalfDown,Wo as roundHalfEven,To as roundHalfOdd,Xo as roundHalfTowardsZero,So as roundHalfUp,Qo as roundUp,Ie as setupEnv,Br as size,Yo as sleep,vr as sortedItems,N as sortedOrderby,qr as startSortWeight,yo as stringToBoolean,Ao as stringToFloat,zo as stringToInteger,Fe as stringToPath,u as stringToUInt8Array,Yr as suid,Xr as suidBytes,_r as suidBytesDate,Zr as suidDate,De as throttle,$o as timeout,_o as timeoutReached,or as timoutError,z as toBase64,A as toBase64Url,Io as toBool,qo as toCamelCase,so as toCapitalize,uo as toCapitalizeWords,Fo as toFloat,y as toHex,yr as toHumanReadableUrl,Go as toInt,He as toPath,Ho as toString,w as toUint8Array,lr as toValidFilename,br as today,er as tryTimeout,Ur as uname,gr as unescapeHTML,he as useAsyncMutex,xo as useBase,Ir as useDefer,Gr as useDispose,Hr as useDisposer,Lr as useEventListener,ze as useExitHandler,Kr as useInterval,i as useLevelFilter,be as useMessageHub,ge as useMutex,h as useNamespaceFilter,Ae as usePool,de as usePubSub,Jr as useTimeout,Sr as uuid,Rr as uuid32bit,Tr as uuidB32,Qr as uuidBytes,Wr as uuidv4,Bo as valueToBoolean,Do as valueToFloat,Co as valueToInteger,Ge as valueToPath,Eo as valueToString,fr as waitOn};
1
+ import{a as Fe,b as Ge,c as He,d as Ie,e as Je,f as Ke,g as Le,h as Me,i as Ne,j as Oe,k as Pe,l as Qe,m as Re,n as Se,o as Te}from"./chunk-7YV5VFZP.js";import{$ as uo,$a as ur,$b as ye,A as V,Aa as Wo,Ab as Zr,B as W,Ba as Xo,Bb as _r,C as X,Ca as Yo,Cb as $r,D as Y,Da as Zo,Db as oe,E as Z,Ea as _o,Eb as re,F as _,Fa as $o,Fb as ee,G as $,Ga as or,Gb as fe,H as oo,Ha as rr,Hb as me,I as ro,Ia as er,Ib as pe,J as eo,Ja as fr,Jb as te,K as fo,Ka as mr,Kb as xe,L as mo,La as pr,Lb as ae,M as po,Ma as tr,Mb as be,N as to,Na as xr,Nb as ce,O as xo,Oa as ar,Ob as de,P as ao,Pa as br,Pb as ge,Q as bo,Qa as cr,Qb as he,R as co,Ra as dr,Rb as ie,S as go,Sa as gr,Sb as je,T as ho,Ta as hr,Tb as ke,U as io,Ua as ir,Ub as le,V as jo,Va as jr,Vb as ne,W as ko,Wa as kr,Wb as qe,X as lo,Xa as lr,Xb as se,Y as no,Ya as nr,Yb as ue,Z as qo,Za as qr,Zb as ve,_ as so,_a as sr,_b as we,a as u,aa as vo,ab as vr,ac as ze,b as v,ba as wo,bb as wr,bc as Ae,c as w,ca as yo,cb as yr,cc as Be,d as y,da as zo,db as zr,dc as Ce,e as z,ea as Ao,eb as Ar,ec as De,f as A,fa as Bo,fb as Br,fc as Ee,g as B,ga as Co,gb as Cr,h as C,ha as Do,hb as Dr,i as D,ia as Eo,ib as Er,j as E,ja as Fo,jb as Fr,k as F,ka as Go,kb as Gr,l as G,la as Ho,lb as Hr,m as H,ma as Io,mb as Ir,n as I,na as Jo,nb as Jr,o as J,oa as Ko,ob as Kr,p as K,pa as Lo,pb as Lr,q as L,qa as Mo,qb as Mr,r as M,ra as No,rb as Qr,s as N,sa as Oo,sb as Rr,t as O,ta as Po,tb as Sr,u as P,ua as Qo,ub as Tr,v as Q,va as Ro,vb as Ur,w as R,wa as So,wb as Vr,x as S,xa as To,xb as Wr,y as T,ya as Uo,yb as Xr,z as U,za as Vo,zb as Yr}from"./chunk-BHQJ5YK3.js";import{A as Pr,d as o,e as r,f as e,g as f,h as m,i as p,j as t,k as x,l as a,m as b,n as c,o as d,p as g,q as h,r as i,s as j,t as k,u as l,v as n,w as q,x as s,y as Nr,z as Or}from"./chunk-LNZLD7Y3.js";export{fe as Channel,xe as CryptoEncoder,No as Currency,tr as DAY_MS,xr as Day,$r as Emitter,Je as FileStorage,te as JsonEncoder,me as LocalChannel,j as LogLevel,k as LogLevelAlias,s as Logger,n as LoggerConsoleHandler,l as LoggerContext,Ke as LoggerFileHandler,Te as LoggerNodeHandler,Ce as MemStorage,ce as PubSub,Be as SerialQueue,D as Uint8ArrayToJson,v as Uint8ArrayToString,Y as arrayEmptyInPlace,W as arrayFilterInPlace,R as arrayFlatten,S as arrayIntersection,$ as arrayIsEqual,mo as arrayMax,po as arrayMin,P as arrayMinus,fo as arrayRandomElement,U as arrayRemoveElement,V as arraySetElement,ro as arrayShuffle,eo as arrayShuffleForce,oo as arrayShuffleInPlace,Z as arraySorted,_ as arraySortedNumbers,T as arraySymmetricDifference,X as arrayToggleInPlace,Q as arrayUnion,O as arrayUnique,kr as between,Fr as cloneJsonObject,Er as cloneObject,M as cmp,Qe as colorString,Re as colorStringList,L as composeOrderby,to as createArray,ae as createPromiseProxy,J as csv,Mo as currency,cr as day,Ee as debounce,bo as decodeBase16,go as decodeBase32,io as decodeBase58,ko as decodeBase62,no as decodeBase64,I as decrypt,c as deepEqual,d as deepMerge,G as deriveKeyPbkdf2,ve as detect,F as digest,Dr as empty,ao as encodeBase16,co as encodeBase32,ho as encodeBase58,jo as encodeBase62,lo as encodeBase64,zr as encodeQuery,H as encrypt,sr as endSortWeight,B as equalBinary,dr as escapeHTML,nr as escapeRegExp,pe as fakeWorkerPair,ie as fetchBasic,je as fetchJson,ke as fetchOptionsFormURLEncoded,le as fetchOptionsJson,ne as fetchText,Lo as fixBrokenUth8String,ar as forEachDay,Jo as formatMessages,Or as formatMilliseconds,vo as fromCamelCase,ue as getGlobal,q as getGlobalContext,oe as getGlobalEmitter,g as getNamespaceFilterString,se as getNavigator,Me as getSourceLocation,Oe as getSourceLocationByPrecedingPattern,Ne as getStack,Le as getStackLlocationList,Nr as getTimestamp,qe as getWindow,Zo as immediate,e as isArray,a as isBoolean,we as isBrowser,Po as isEven,Oo as isHalf,t as isInteger,Mr as isLocalHost,b as isNullOrUndefined,p as isNumber,o as isObject,r as isPrimitive,mr as isPromise,f as isRecord,x as isSafeInteger,m as isString,Pe as isTTY,rr as isTimeout,wo as jsonStringify,C as jsonToUint8Array,Cr as last,ee as lazyListener,wr as linkifyPlainText,Se as loggerStackTraceDebug,re as messages,ur as moveSortWeight,Pr as parseDate,K as parseOrderby,Ar as parseQuery,ye as platform,pr as promisify,Vr as qid,hr as randomBoolean,jr as randomFloat,ir as randomInt,E as randomUint8Array,Ko as renderMessages,Ro as roundDown,Uo as roundHalfAwayFromZero,Vo as roundHalfDown,Wo as roundHalfEven,To as roundHalfOdd,Xo as roundHalfTowardsZero,So as roundHalfUp,Qo as roundUp,Ie as setupEnv,Br as size,Yo as sleep,vr as sortedItems,N as sortedOrderby,qr as startSortWeight,yo as stringToBoolean,Ao as stringToFloat,zo as stringToInteger,Fe as stringToPath,u as stringToUInt8Array,Yr as suid,Xr as suidBytes,_r as suidBytesDate,Zr as suidDate,De as throttle,$o as timeout,_o as timeoutReached,or as timoutError,z as toBase64,A as toBase64Url,Io as toBool,qo as toCamelCase,so as toCapitalize,uo as toCapitalizeWords,Fo as toFloat,y as toHex,yr as toHumanReadableUrl,Go as toInt,He as toPath,Ho as toString,w as toUint8Array,lr as toValidFilename,br as today,er as tryTimeout,Ur as uname,gr as unescapeHTML,he as useAsyncMutex,xo as useBase,Ir as useDefer,Gr as useDispose,Hr as useDisposer,Lr as useEventListener,ze as useExitHandler,Kr as useInterval,i as useLevelFilter,be as useMessageHub,ge as useMutex,h as useNamespaceFilter,Ae as usePool,de as usePubSub,Jr as useTimeout,Sr as uuid,Rr as uuid32bit,Tr as uuidB32,Qr as uuidBytes,Wr as uuidv4,Bo as valueToBoolean,Do as valueToFloat,Co as valueToInteger,Ge as valueToPath,Eo as valueToString,fr as waitOn};
2
2
  //# sourceMappingURL=index.node.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zeed",
3
- "version": "0.7.96",
3
+ "version": "0.7.97",
4
4
  "description": "🌱 Simple foundation library",
5
5
  "keywords": [
6
6
  "foundation",
@@ -1,5 +0,0 @@
1
- import{a as I,b as Q,c as o,s as be,w as ie,x as b,y as Te}from"./chunk-LNZLD7Y3.js";var we=b("bin"),Y;function Ae(e){return typeof TextEncoder=="undefined"?new Uint8Array:(Y!=null?Y:Y=new TextEncoder).encode(e.normalize("NFC"))}o(Ae,"stringToUInt8Array");var X;function et(e){return typeof TextDecoder=="undefined"?"":(X!=null?X:X=new TextDecoder("utf-8",{ignoreBOM:!0})).decode(e).normalize("NFC")}o(et,"Uint8ArrayToString");function U(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Ae(e):e.length?new Uint8Array(e):e}o(U,"toUint8Array");function Wt(e){if(typeof Buffer!="undefined")return Buffer.from(U(e)).toString("hex");let t="0123456789abcdef",r="";for(let n of[...U(e)])r+=t[n>>4]+t[n&15];return r}o(Wt,"toHex");function Qt(e){let t=U(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(Qt,"toBase64");function Vt(e){let t=U(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(Vt,"toBase64Url");function Me(e,t){if(e.byteLength!==t.byteLength)return!1;let r=U(e),n=U(t);for(let i=0;i<r.length;i++)if(r[i]!==n[i])return!1;return!0}o(Me,"equalBinary");function se(e){try{return Ae(JSON.stringify(e))}catch(t){throw we.warn("jsonToUint8Array",e),t}}o(se,"jsonToUint8Array");function ae(e){try{return JSON.parse(et(e))}catch(t){throw we.warn("Uint8ArrayToJson",e),t}}o(ae,"Uint8ArrayToJson");function H(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(H,"randomUint8Array");var Pe="SHA-256",ue="AES-GCM",Ee="PBKDF2";async function Yt(e,t=Pe){return await crypto.subtle.digest(t,U(e))}o(Yt,"digest");async function Xt(e,t={}){var i;let r=U(e),n=await crypto.subtle.importKey("raw",r,Ee,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:Ee,salt:t.salt?U(t.salt):new Uint8Array(0),iterations:(i=t.iterations)!=null?i:1e5,hash:Pe},n,{name:ue,length:256},!0,["encrypt","decrypt"])}o(Xt,"deriveKeyPbkdf2");var ee=new Uint8Array([1,1]);async function Le(e,t){let r=H(12),n=await crypto.subtle.encrypt({name:ue,iv:r},t,e),i=new Uint8Array(n),s=ee.length+r.length+i.length,u=new Uint8Array(s),a=0;return u.set(ee,a),a+=ee.length,u.set(r,a),a+=r.length,u.set(i,a),u}o(Le,"encrypt");async function Ce(e,t){let r=e.subarray(0,2);if(!Me(r,ee))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:ue,iv:n},t,i);return new Uint8Array(s)}o(Ce,"decrypt");var Ue=",",tt=!1,rt=!0;function nt(e){return/^([-+])?([0-9]+(\.[0-9]+)?|Infinity)$/.test(e)?Number(e):NaN}o(nt,"filterFloat");function ot(e){return rt&&e==null?"":tt?'="'+String(e).replace(/"/g,'""')+'"':!isNaN(nt(e))&&isFinite(e)?parseFloat(e):'"'+String(e).replace(/"/g,'""')+'"'}o(ot,"escape");function tr(e,t){let r="";t&&(r=t.join(Ue)+`\r
2
- `);for(let n=0;n<e.length;n++)r+=e[n].map(ot).join(Ue)+`\r
3
- `;return r}o(tr,"csv");function it(e=""){let[t="",r="asc"]=e.split(" ");return r=r.toLowerCase(),{field:t,orderby:r,asc:r!=="desc",desc:r==="desc"}}o(it,"parseOrderby");function nr(e,t=!0){return`${e} ${t?"asc":"desc"}`}o(nr,"composeOrderby");function ce(e,t,r=!0){let n=e||0,i=t||0;return n>i?r?1:-1:n<i?r?-1:1:0}o(ce,"cmp");function or(e,...t){if(t.length>0){let r=t.map(it),n=Array.from(e);return n.sort((i,s)=>{for(let{field:u,asc:a}of r){let c=ce(i[u],s[u],a);if(c!==0)return c}return 0}),n}return e}o(or,"sortedOrderby");function fe(e){return e.filter((t,r)=>e.indexOf(t)===r)}o(fe,"arrayUnique");function st(e,t){return fe(e.filter(r=>!t.includes(r)))}o(st,"arrayMinus");function at(...e){return fe(e.reduce((t=[],r)=>t.concat(r),[]))}o(at,"arrayUnion");function V(...e){return e.flat(1/0)}o(V,"arrayFlatten");function ut(e,t){return fe(e).filter(r=>t.includes(r))}o(ut,"arrayIntersection");function ar(e,t){return st(at(e,t),ut(e,t))}o(ar,"arraySymmetricDifference");function ur(e,t){if(e&&Array.isArray(e)){let r;for(;(r=e.indexOf(t))!==-1;)e.splice(r,1);return e}return[]}o(ur,"arrayRemoveElement");function cr(e,t){return e.includes(t)||e.push(t),e}o(cr,"arraySetElement");function le(e,t){return e.splice(0,e.length,...e.filter(t)),e}o(le,"arrayFilterInPlace");function fr(e,t){let r=e.findIndex(n=>n===t);return r>=0?e.splice(r,1):e.push(t),e}o(fr,"arrayToggleInPlace");function lr(e){return e.splice(0,e.length),e}o(lr,"arrayEmptyInPlace");function ct(e,t=ce){return Array.from(e).sort(t)}o(ct,"arraySorted");function pr(e){return ct(e,(t,r)=>t-r)}o(pr,"arraySortedNumbers");function ft(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}o(ft,"arrayIsEqual");function ke(e){return e.sort(()=>Math.random()>.5?1:-1),e}o(ke,"arrayShuffleInPlace");function dr(e){return ke(Array.from(e))}o(dr,"arrayShuffle");function mr(e){for(;e.length>1;){let t=Array.from(e);if(ke(t),!ft(e,t))return t}return e}o(mr,"arrayShuffleForce");function yr(e){return e[Math.floor(Math.random()*e.length)]}o(yr,"arrayRandomElement");function gr(...e){return V(e).reduce((t,r)=>t!=null?r>t?r:t:r,void 0)}o(gr,"arrayMax");function hr(...e){return V(e).reduce((t,r)=>t!=null?r<t?r:t:r,void 0)}o(hr,"arrayMin");function xr(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(xr,"createArray");var lt=b("zeed:basex"),pt={"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 O(e){let t;if(typeof e=="string")t=e;else if(t=pt[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 f=0;f<r.length;f++)r[f]=255;for(let f=0;f<t.length;f++){let d=t.charAt(f),m=d.charCodeAt(0);if(r[m]!==255)throw new TypeError(d+" is ambiguous");r[m]=f}let n=t.length,i=t.charAt(0),s=Math.log(n)/Math.log(256),u=Math.log(256)/Math.log(n);function a(f,d=-1){let m=U(f);if(m.byteLength===0)return"";let L=0,M=0,P=m.byteLength;for(;M!==P&&m[M]===0;)M++;let x=(P-M)*u+1>>>0,y=new Uint8Array(x);for(;M!==P;){let D=m[M],T=0;for(let k=x-1;(D!==0||T<L)&&k!==-1;k--,T++)D+=256*y[k]>>>0,y[k]=D%n>>>0,D=D/n>>>0;if(D!==0)throw lt.warn("Non-zero carry",m,d,T,x),new Error("Non-zero carry");L=T,M++}let g=x-L;for(;g!==x&&y[g]===0;)g++;let E="";for(;g<x;++g)E+=t.charAt(y[g]);return d>0?E.padStart(d,i):E}o(a,"encode");function c(f,d=-1){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;f=f.replace(/\s+/gi,"");let m=0,L=0;for(;f[m]===i;)m++;let M=(f.length-m)*s+1>>>0,P=new Uint8Array(M);for(;f[m];){let y=r[f.charCodeAt(m)];if(y===255)throw new Error(`Unsupported character "${f[m]}"`);let g=0;for(let E=M-1;(y!==0||g<L)&&E!==-1;E--,g++)y+=n*P[E]>>>0,P[E]=y%256>>>0,y=y/256>>>0;if(y!==0)throw new Error("Non-zero carry");L=g,m++}let x=M-L;for(;x!==M&&P[x]===0;)x++;return d>0?new Uint8Array([...new Uint8Array(d-P.length+x),...P.slice(x)]):P.slice(x)}return o(c,"decode"),{encode:a,decode:c}}o(O,"useBase");var{encode:Mr,decode:Pr}=O(16),{encode:Er,decode:Lr}=O(32),{encode:Cr,decode:Ur}=O(58),{encode:kr,decode:Dr}=O(62),{encode:Sr,decode:Ir}=O(62);var Fr=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 dt(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}o(dt,"toCapitalize");function Rr(e){return e.replace(/\w\S*/g,dt)}o(Rr,"toCapitalizeWords");function $r(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($r,"fromCamelCase");function mt(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 u=r.indexOf(this);~u?r.splice(u+1):r.push(this),~u?n.splice(u,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(mt,"serializer");function pe(e,t,r,n){return JSON.stringify(e,mt(t,n),r)}o(pe,"jsonStringify");var De=["1","true","yes","y","on"];function Nr(e,t=!1){return e==null||typeof e!="string"?t:De.includes(String(e).trim().toLowerCase())}o(Nr,"stringToBoolean");function zr(e,t=0){var r;return e==null||typeof e!="string"?t:(r=parseInt(e.trim(),10))!=null?r:t}o(zr,"stringToInteger");function Hr(e,t=0){var r;return e==null||typeof e!="string"?t:(r=parseFloat(e.trim()))!=null?r:t}o(Hr,"stringToFloat");function yt(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:De.includes(String(e).trim().toLowerCase())}o(yt,"valueToBoolean");function gt(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(gt,"valueToInteger");function ht(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(ht,"valueToFloat");function de(e,t=""){var r;return e==null?t:(r=String(e))!=null?r:t}o(de,"valueToString");var Jr=ht,qr=gt,Gr=de,jr=yt;function xt(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?pe(i,null,2):pe(i):String(i))}o(xt,"formatMessages");function Qr(e,t={}){return xt(e,t).join(" ")}o(Qr,"renderMessages");function Vr(e){try{return decodeURIComponent(escape(e))}catch{}return e}o(Vr,"fixBrokenUth8String");var bt={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:Mt,fromCents:!1},Se=o(e=>Math.round(e),"round"),me=o(e=>Math.pow(10,e),"pow"),Tt=o((e,t)=>Se(e/t)*t,"rounding"),wt=/(\d)(?=(\d{3})+\b)/g,At=/(\d)(?=(\d\d)+\d\b)/g;function B(e,t={}){return new F(e,t)}o(B,"currency");var re=class{constructor(t,r={}){var u;let n=Object.assign({},bt,r),i=me((u=n.precision)!=null?u:2),s=te(t,n);this.intValue=s,this.value=s/i,n.increment=n.increment||1/i,n.useVedic?n.groups=At:n.groups=wt,this._settings=n,this._precision=i}add(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r+=te(t,n))/(n.fromCents?1:i),n)}subtract(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r-=te(t,n))/(n.fromCents?1:i),n)}multiply(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r*=t)/(n.fromCents?1:me(i)),n)}divide(t){let{intValue:r,_settings:n}=this;return B(r/=te(t,n,!1),n)}distribute(t){let{intValue:r,_precision:n,_settings:i}=this,s=[],u=Math[r>=0?"floor":"ceil"](r/t),a=Math.abs(r-u*t),c=i.fromCents?1:n;for(;t!==0;t--){let f=B(u/c,i);a-- >0&&(f=f[r>=0?"add":"subtract"](1/c)),s.push(f)}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 Tt(t/r,n.increment).toFixed(n.precision)}toJSON(){return this.value}static sum(...t){return V(t).reduce((r,n)=>B(r).add(n),this.zero)}static avg(...t){let r=V(t);return r.reduce((n,i)=>B(n).add(i),this.zero).divide(r.length)}},F=re;o(F,"Currency"),F.zero=new re(0),F.one=new re(1);function te(e,t,r=!0){let n=0,{decimal:i,errorOnInvalid:s,precision:u,fromCents:a}=t,c=me(u),f=typeof e=="number";if(e instanceof F&&a)return e.intValue;if(f||e instanceof F)n=e instanceof F?e.value:e;else if(typeof e=="string"){let d=new RegExp("[^-\\d"+i+"]","g"),m=new RegExp("\\"+i,"g");n=e.replace(/\((.*)\)/,"-$1").replace(d,"").replace(m,"."),n=n||0}else{if(s)throw Error("Invalid Input");n=0}return a||(n*=c,n=n.toFixed(4)),r?Se(n):n}o(te,"parse");function Mt(e,t){let{pattern:r,negativePattern:n,symbol:i,separator:s,decimal:u,groups:a}=t,c=(""+e).replace(/^-/,"").split("."),f=c[0],d=c[1];return(e.value>=0?r:n).replace("!",i).replace("#",f.replace(a,"$1"+s)+(d?u+d:""))}o(Mt,"format");var _=o(e=>Math.abs(e)%1===.5,"isHalf"),Ie=o(e=>e%2===0,"isEven"),Kr=o(e=>Math.ceil(e),"roundUp"),Yr=o(e=>Math.floor(e),"roundDown"),Xr=o(e=>Math.round(e),"roundHalfUp"),en=o(e=>{let t=Math.round(e);return _(e)&&Ie(t)?t-1:t},"roundHalfOdd"),tn=o(e=>_(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),rn=o(e=>_(e)?Math.floor(e):Math.round(e),"roundHalfDown"),nn=o(e=>{let t=Math.round(e);return _(e)?Ie(t)?t:t-1:t},"roundHalfEven"),on=o(e=>_(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");var{warn:Oe}=b("zeed:promise");async function un(e){return new Promise(t=>setTimeout(t,e))}o(un,"sleep");async function cn(){return new Promise(e=>setTimeout(e,0))}o(cn,"immediate");var Fe=Symbol("timeout");async function fn(e,t,r=Fe){return new Promise(async(n,i)=>{let s=!1,u=setTimeout(()=>{s=!0,n(r)},t);try{let a=await e;clearTimeout(u),s||n(a)}catch(a){clearTimeout(u),s||i(a)}})}o(fn,"timeout");var Re=new Error("Timeout reached");function ln(e){return e===Fe||e===Re}o(ln,"isTimeout");async function $e(e,t){return t<=0?await e:new Promise(async(r,n)=>{let i=!1,s=setTimeout(()=>{i=!0,n(Re)},t);try{let u=await e;clearTimeout(s),i||r(u)}catch(u){clearTimeout(s),i||n(u)}})}o($e,"tryTimeout");function pn(e,t,r=1e3){return new Promise((n,i)=>{let s=o(c=>{a&&(clearTimeout(a),u(),n(c))},"fn"),u=o(()=>{a=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):Oe("No remove listener method found for",e,t)},"done"),a=setTimeout(()=>{u(),i(new Error("Did not response in time"))},r);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):Oe("No listener method found for",e)})}o(pn,"waitOn");function S(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}o(S,"isPromise");function N(e){return Promise.resolve(e)}o(N,"promisify");var ve=1e3*60*60*24,w=class{constructor(t){var r;if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=(r=w.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 w(t)}static fromString(t){return new w(+t.replace(/[^0-9]/g,""))}static fromDate(t,r=!1){return r?w.fromString(t.toISOString().substr(0,10)):new w(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return w.fromDate(t,!0)}static from(t,r=!1){if(typeof t=="number")return new w(t);if(typeof t=="string")return w.fromString(t);if(t instanceof Date)return w.fromDate(t,r);if(t instanceof w)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 w.fromDateGMT(new Date(this.toDateGMT().getTime()+t*ve))}daysUntil(t){var r;return Math.round((((r=new w(t))==null?void 0:r.toDateGMT().getTime())-this.toDateGMT().getTime())/ve)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};o(w,"Day");async function yn(e,t,r){let n=w.from(e),i=w.from(t);for(;n&&i&&(n==null?void 0:n.days)<=(i==null?void 0:i.days);){let s=r(n);S(s)&&await s,n=n.dayOffset(1)}}o(yn,"forEachDay");function gn(){return new w}o(gn,"today");function hn(e){return new w(e)}o(hn,"day");var Be=o(e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),"escapeHTML"),bn=o(e=>e.replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&apos;/gi,"'").replace(/&amp;/gi,"&"),"unescapeHTML");function wn(e=.25){return Math.random()<e}o(wn,"randomBoolean");function An(e=100,t=0){return t+Math.floor(Math.random()*(e-t))}o(An,"randomInt");function Mn(e=100,t=0){return t+Math.random()*(e-t)}o(Mn,"randomFloat");function Pn(e,t,r){return Math.max(e,Math.min(r,t))}o(Pn,"between");var Pt=100,Ne=/[\u0000-\u001F\u0080-\u009F]/g,Et=/^\.+/,Lt=/\.+$/;function ze(){return/[<>:"/\\|?*\u0000-\u001F]/g}o(ze,"filenameReservedRegex");function Ct(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}o(Ct,"windowsReservedNameRegex");function Ln(e){if(typeof e!="string")throw new TypeError("Expected a string");let t="_";if(ze().test(t)&&Ne.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(ze(),t).replace(Ne,t).replace(Et,t).replace(Lt,""),e=Ct().test(e)?e+t:e,e.slice(0,Pt)}o(Ln,"toValidFilename");var Ut=/[\\\-\[\]\/{}()*+?.^$|]/g;function Un(e){return e?e instanceof RegExp?e.source:e.replace(Ut,"\\$&"):""}o(Un,"escapeRegExp");function He(e){return e.reduce((t,r)=>Math.min(t,r.sort_weight||0),0)-1-Math.random()}o(He,"startSortWeight");function Je(e){return e.reduce((t,r)=>Math.max(t,r.sort_weight||0),0)+1+Math.random()}o(Je,"endSortWeight");function Dn(e,t,r){let n=r.length,i=e<t;if(n<=0||e>=n-1)return Je(r);if(e<=0)return He(r);r=kt([...r]);let s=i?-1:0,u=r[e+s].sort_weight||0,c=(r[e+s+1].sort_weight||0)-u;if(c===0)return i?He(r):Je(r);let f=u+c/2,d=c*.01*(Math.random()-.5);return f+d}o(Dn,"moveSortWeight");function kt(e){return e.sort((t,r)=>(t.sort_weight||0)-(r.sort_weight||0)),e}o(kt,"sortedItems");var Dt=/((?:(?:(?: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 On(e){return e.split(Dt).map((t,r)=>{let n=Be(t);return r%2?`<a target="_blank" href="${n}">${St(n)}</a>`:n}).join("")}o(On,"linkifyPlainText");function St(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}o(St,"toHumanReadableUrl");function qe(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(qe,"encodeQuery");function Fn(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]),u=decodeURIComponent(i[1]||"");t[s]!=null?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(u)):t[s]=u}return t}o(Fn,"parseQuery");function $n(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}o($n,"size");function vn(e){return e!=null&&e.length>0?e[e.length-1]:void 0}o(vn,"last");function Bn(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(Bn,"empty");function ye(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(ye,"cloneObject");function Nn(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(Nn,"cloneJsonObject");async function It(e){typeof e=="function"?await N(e()):S(e)?await e:typeof e.dispose=="function"?await N(e.dispose()):S(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await N(e.cleanup()):S(e.cleanup)&&await e.cleanup}o(It,"callDisposer");function Ot(){let e=[],t=o(async i=>{e.includes(i)&&(le(e,s=>s!==i),await It(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(Ot,"useDispose");var qn=Ot;function Gn(e={}){let{mode:t="fifo"}=e,r=[],n=o(async(s=!1)=>{for(;r.length>0;){let u=r[0];if(le(r,a=>a!==u),typeof u=="function"){let a=u();if(S(a)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await a}}else if(S(u)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await u}else throw new Error(`Unhandled disposable: ${u}`)}},"exec");return Object.assign(n,{add:o(s=>{t==="lifo"?r.unshift(s):r.push(s)},"add"),exec:n,getSize(){return r.length}})}o(Gn,"useDefer");function jn(e,t=0){let r=setTimeout(e,t);return()=>{r&&(clearTimeout(r),r=void 0)}}o(jn,"useTimeout");function Wn(e,t){let r=setInterval(e,t);return()=>{r&&(clearInterval(r),r=void 0)}}o(Wn,"useInterval");function Qn(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(Qn,"useEventListener");function _n(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(_n,"isLocalHost");var{encode:Ge,decode:Ft}=O(62),{encode:Rt}=O(32);function je(){return H(16)}o(je,"uuidBytes");var eo=o(()=>new Uint32Array(H(4))[0],"uuid32bit");function Z(){return Ge(je(),22)}o(Z,"uuid");function to(){return Rt(je(),26)}o(to,"uuidB32");var ge={};function z(e="id"){return ge[e]==null&&(ge[e]=0),`${e}-${ge[e]++}`}o(z,"uname");var $t=0;function ro(){return`id-${$t++}`}o(ro,"qid");var vt="10000000-1000-4000-8000-100000000000",no=o(()=>vt.replace(/[018]/g,e=>(e^H(1)[0]&15>>e/4).toString(16)),"uuidv4"),We=16e11;function Bt(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(Bt,"longToByteArray");function Nt(){let e=Te()-We;return new Uint8Array([...Bt(e),...H(10)])}o(Nt,"suidBytes");function oo(){return Ge(Nt(),22)}o(oo,"suid");function io(e){return zt(Ft(e,16))}o(io,"suidDate");function zt(e){return new Date(We+e.slice(0,6).reduce((t,r)=>t*256+r,0))}o(zt,"suidBytesDate");var J=b("zeed:emitter"),R=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(u=>{try{return N(u(...r))}catch(a){J.warn("emit warning:",a)}});n=!0,await Promise.all(s)}}catch(i){J.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 N(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(R,"Emitter");function fo(){let e=ie().emitter;return e||(e=new R,ie().emitter=e),e}o(fo,"getGlobalEmitter");var lo=new R;function po(e,t){let r=Math.round(Math.random()*100);var n=[],i;let s=o((a,c)=>{let f={key:a,obj:c};n.push(f),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):J.error(r,"Cannot listen to key"):e.onAny?e.onAny((a,c)=>{s(a,c)}):J.error(r,"cannot listen to all for",e),o((a,c=!0)=>new Promise((f,d)=>{a||(a=t,a||n.length&&(a=n[0].key)),i=o(()=>{for(;n.length>0;){let m=n.shift();if(m.key===a)i=void 0,f(m.obj);else{if(c){J.warn(r,`Unhandled event ${a} with value: ${m.obj}`);continue}d(`Expected ${a}, but found ${m.key} with value=${m.obj}`),J.error(r,`Unhandled event ${a} with value: ${m.obj}`)}break}},"lazyResolve"),i()}),"on")}o(po,"lazyListener");var he=class extends R{constructor(){super(...arguments);this.id=Z()}close(){}};o(he,"Channel");var ne=class extends he{constructor(){super(...arguments);this.isConnected=!0}postMessage(t){var r;(r=this.other)==null||r.emit("message",{data:t,origin:"local",lastEventId:Z()})}};o(ne,"LocalChannel");function ho(){let e=new ne,t=new ne;return e.other=t,t.other=e,[e,t]}o(ho,"fakeWorkerPair");var q=class{async encode(t){return se(t)}async decode(t){return ae(t)}};o(q,"JsonEncoder");var Qe=class{constructor(t){this.key=t}async encode(t){let r=se(t);return await Le(r,this.key)}async decode(t){let r=await Ce(t,this.key);return ae(r)}};o(Qe,"CryptoEncoder");var Ve=o((e,t,r={})=>new Proxy(r,{get:(n,i)=>i in n?n[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function Uo(e={}){let{name:t=z("hub"),encoder:r=new q,retryAfter:n=1e3,ignoreUnhandled:i=!0}=e,s=b(t),u={},a,c=[],f,d={},m=o(()=>{clearTimeout(f)},"dispose"),L=o(async()=>{if(clearTimeout(f),a){if(a.isConnected)for(;c.length;){let y=c[0];try{a.postMessage(await r.encode(y)),c.shift()}catch(g){s.warn("postMessage",g);break}}c.length>0&&n>0&&(f=setTimeout(L,n))}},"postNext"),M=o(async y=>{s("enqueue postMessage",y),c.push(y),await L()},"postMessage"),P=o(async y=>{a=y,a.on("connect",L),a.on("message",async g=>{s("onmessage",typeof g);let{name:E,args:D,id:T,result:k,error:$}=await r.decode(g.data);if(E){s(`name ${E} id ${T}`);try{if(u[E]==null)throw new Error(`handler for ${E} was not found`);let C=u[E](...D);S(C)&&(C=await C),s(`result ${C}`),T&&M({id:T,result:C})}catch(C){let v=C instanceof Error?C:new Error(de(C));s.warn("execution error",v.name),M({id:T,error:{message:v.message,stack:v.stack,name:v.name}})}}else if(T)if(s(`response for id=${T}: result=${k}, error=${$}`),d[T]==null)k===void 0?s(`skip response for ${T}`):s.warn(`no response hook for ${T}`);else{let[C,v]=d[T];if(C&&v)if(delete d[T],$){let K=new Error($.message);K.stack=$.stack,K.name=$.name,s.warn("reject",K.name),v(K)}else s("resolve",k),C(k)}else i||s.warn("Unhandled message",g)}),L()},"connect"),x=o(async(y,g,E={})=>{let{timeout:D=5e3}=E,T=Z();return M({name:y,args:g,id:T}),$e(new Promise((k,$)=>d[T]=[k,$]),D)},"fetchMessage");return e.channel&&P(e.channel),{dispose:m,connect:P,listen(y){Object.assign(u,y)},send(){return Ve(x,{},{options(y){return Ve(x,I({},y))}})}}}o(Uo,"useMessageHub");var xe=class extends R{constructor(t){super();this.publish=this.emit;this.subscribe=this.on;var u;let{name:r,encoder:n=new q,channel:i,debug:s=!1}=t;this.channel=i,this.encoder=n,this.debug=s,this.name=(u=r!=null?r:this.channel.id)!=null?u:z("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 c=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${c==null?void 0:c.event}, info=`,c):this.log(`channel message, event=${c==null?void 0:c.event}`),c){let{event:f,args:d}=c;await this.emitSuper(f,...d)}})}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(xe,"PubSub");function vo(e){return new xe(e)}o(vo,"usePubSub");import{isPromise as _e}from"util/types";function zo(){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(zo,"useMutex");function Ho(){let e=!0;return async(t,r)=>{let n=!1;if(e){e=!1;try{let i=t();_e(i)&&await i,n=!0}finally{e=!0}}else if(r!==void 0){let i=r();_e(i)&&await i}return n}}o(Ho,"useAsyncMutex");var G=b("network"),oe={cache:"no-cache",redirect:"follow"};async function Ze(e,t={},r=fetch){try{let n=await r(e,t);if(n.status<400)return n;try{G.warn(`Fetch of ${e} with ${t} returned status=${n.status}`),G.warn(`Response: ${await n.text()}`)}catch(i){G.error("Exception:",i)}}catch(n){G.error("fetchBasic",n)}}o(Ze,"fetchBasic");async function jo(e,t={},r=fetch){try{let n=await Ze(e,I(Q(I({method:"GET"},oe),{headers:{}}),t),r);if(n)return await n.json()}catch(n){G.error("fetchJSON error:",n)}}o(jo,"fetchJson");function Wo(e,t="POST"){return Q(I({method:t},oe),{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:qe(e)})}o(Wo,"fetchOptionsFormURLEncoded");function Qo(e,t="POST"){return Q(I({method:t},oe),{headers:{"Content-Type":"application/json; charset=utf-8",Accept:"application/json"},body:JSON.stringify(e)})}o(Qo,"fetchOptionsJson");async function Vo(e,t={},r=fetch){try{let n=await Ze(e,I(Q(I({method:"GET"},oe),{headers:{}}),t),r);if(n)return await n.text()}catch(n){G.error("fetchHTML error:",n)}}o(Vo,"fetchText");function Ke(){if(typeof window!="undefined")return window}o(Ke,"getWindow");function Ht(){if(typeof navigator!="undefined")return navigator}o(Ht,"getNavigator");function Zo(){var e;return((e=Ke())!=null?e:typeof WorkerGlobalScope!="undefined")?self:typeof global!="undefined"?global:Function("return this;")()}o(Zo,"getGlobal");var h=Ht(),A=Ke();function Jt(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,u,a,c,f;return e.ios=((t=h==null?void 0:h.platform)==null?void 0:t.match(/(iPhone|iPod|iPad)/i))!=null,e.macos=!!((r=h==null?void 0:h.platform)==null?void 0:r.startsWith("Mac")),e.windows=!!((n=h==null?void 0:h.platform)==null?void 0:n.startsWith("Win")),e.beaker=(A==null?void 0:A.beaker)!=null,e.electron=(((s=(i=h==null?void 0:h.userAgent)==null?void 0:i.toLowerCase())==null?void 0:s.indexOf(" electron/"))||-1)>-1&&!e.beaker,e.wkwebview=((u=A==null?void 0:A.webkit)==null?void 0:u.messageHandlers)!=null,e.pwa=(h==null?void 0:h.serviceWorker)!=null,e.pwaInstalled=(h==null?void 0:h.standalone)||((c=(a=A==null?void 0:A.matchMedia)==null?void 0:a.call(A,"(display-mode: standalone)"))==null?void 0:c.matches),e.node=typeof process!="undefined"&&((f=process==null?void 0:process.release)==null?void 0:f.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=A&&"ontouchstart"in A||((h==null?void 0:h.maxTouchPoints)||0)>1||(h==null?void 0:h.msPointerEnabled)&&(A==null?void 0:A.MSGesture)||(A==null?void 0:A.DocumentTouch)&&document instanceof DocumentTouch,e}o(Jt,"detect");var qt=o(()=>typeof window!="undefined"&&globalThis===window,"isBrowser"),Ko=Jt();function Yo(e){qt()?window.addEventListener("beforeunload",e):typeof process!="undefined"&&process.on("exit",()=>e)}o(Yo,"useExitHandler");function ei(e={}){let{maxParallel:t=3}=e,r=0,n=0,i={};function s(){if(r>=t)return;let a=Object.values(i).filter(c=>!c.running);if(a.length>0){let c;for(let f of a)(c==null||f.priority<c.priority)&&(c=f);c&&(c.running=!0,++r,c.task().then(f=>{(c==null?void 0:c.id)&&delete i[c.id],--r,s()}).catch(f=>{(c==null?void 0:c.id)&&delete i[c.id],--r,s()}))}}o(s,"performNext");function u(a){let c=i[a];c&&c.running!==!0&&delete i[a]}return o(u,"cancel"),{cancel:u,enqueue(a,c){return i[a]==null&&(i[a]={id:a,task:c,priority:++n,running:!1},s()),()=>u(a)}}}o(ei,"usePool");var Gt=b("zeed:queue"),Ye=class{constructor(t={}){this.queue=[];this.isPaused=!1;this.waitToFinish=[];let{name:r=z("queue"),logLevel:n}=t;this.name=r,this.log=b(`zeed:queue:${r}`),this.log.level=n!=null?n:be.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(u){Gt.warn("Error performing task",u)}i(s),this.currentTask=void 0}for(;this.waitToFinish.length>0;)this.waitToFinish.shift()()}async enqueue(t,r={}){let{immediate:n=!1,name:i=z(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(Ye,"SerialQueue");var ci=b("zeed:memstorage"),Xe=class{constructor(t={}){this.store={}}setItem(t,r){this.store[t]=ye(r)}getItem(t){if(this.store.hasOwnProperty(t))return ye(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};o(Xe,"MemStorage");var j=!1,W=j?b("zeed:throttle"):()=>{};function pi(e,t={}){let{delay:r=100,trailing:n=!0,leading:i=!0}=t,s=0,u=0,a=0,c=Date.now();function f(){s&&(clearTimeout(s),s=void 0)}o(f,"clearExistingTimeout");function d(...m){let L=Date.now(),M=this,P=L-u;function x(){let g=Date.now();return`total ${(g-c).toFixed(1)}ms - elapsed ${(g-u).toFixed(1)}ms - visited ${a}x`}o(x,"debugElapsed");function y(){a=0,u=Date.now(),e.apply(M,m)}if(o(y,"exec"),P>r||!s){j&&W("elapsed",x()),i&&(P>r?(j&&W("\u{1F680} leading",x()),y()):++a);let g=P>r?r:r-P;W(`\u23F1 start timeout with ${g.toFixed(1)}ms}`,x()),f(),u=L,s=setTimeout(()=>{j&&W("\u23F1 reached timeout",x()),s=0,n&&(!i||a>0)&&(j&&W("\u{1F680} trailing",x()),y())},g)}else++a,j&&W("visited",x())}return o(d,"wrapper"),d.cancel=f,d.dispose=f,d}o(pi,"throttle");function di(e,t={}){let{delay:r=100}=t,n=0;function i(){n&&(clearTimeout(n),n=0)}o(i,"clearExistingTimeout");function s(...u){let a=this;i(),n=setTimeout(()=>{n=0,e.apply(a,u)},r)}return o(s,"wrapper"),s.cancel=i,s.dispose=i,s}o(di,"debounce");export{Ae as a,et as b,U as c,Wt as d,Qt as e,Vt as f,Me as g,se as h,ae as i,H as j,Yt as k,Xt as l,Le as m,Ce as n,tr as o,it as p,nr as q,ce as r,or as s,fe as t,st as u,at as v,V as w,ut as x,ar as y,ur as z,cr as A,le as B,fr as C,lr as D,ct as E,pr as F,ft as G,ke as H,dr as I,mr as J,yr as K,gr as L,hr as M,xr as N,O,Mr as P,Pr as Q,Er as R,Lr as S,Cr as T,Ur as U,kr as V,Dr as W,Sr as X,Ir as Y,Fr as Z,dt as _,Rr as $,$r as aa,pe as ba,Nr as ca,zr as da,Hr as ea,yt as fa,gt as ga,ht as ha,de as ia,Jr as ja,qr as ka,Gr as la,jr as ma,xt as na,Qr as oa,Vr as pa,B as qa,F as ra,_ as sa,Ie as ta,Kr as ua,Yr as va,Xr as wa,en as xa,tn as ya,rn as za,nn as Aa,on as Ba,un as Ca,cn as Da,Fe as Ea,fn as Fa,Re as Ga,ln as Ha,$e as Ia,pn as Ja,S as Ka,N as La,ve as Ma,w as Na,yn as Oa,gn as Pa,hn as Qa,Be as Ra,bn as Sa,wn as Ta,An as Ua,Mn as Va,Pn as Wa,Ln as Xa,Un as Ya,He as Za,Je as _a,Dn as $a,kt as ab,On as bb,St as cb,qe as db,Fn as eb,$n as fb,vn as gb,Bn as hb,ye as ib,Nn as jb,Ot as kb,qn as lb,Gn as mb,jn as nb,Wn as ob,Qn as pb,_n as qb,je as rb,eo as sb,Z as tb,to as ub,z as vb,ro as wb,no as xb,Nt as yb,oo as zb,io as Ab,zt as Bb,R as Cb,fo as Db,lo as Eb,po as Fb,he as Gb,ne as Hb,ho as Ib,q as Jb,Qe as Kb,Ve as Lb,Uo as Mb,xe as Nb,vo as Ob,zo as Pb,Ho as Qb,Ze as Rb,jo as Sb,Wo as Tb,Qo as Ub,Vo as Vb,Ke as Wb,Ht as Xb,Zo as Yb,Jt as Zb,qt as _b,Ko as $b,Yo as ac,ei as bc,Ye as cc,Xe as dc,pi as ec,di as fc};
5
- //# sourceMappingURL=chunk-LUHXAZ6G.js.map