zeed 0.9.2 → 0.9.4

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,12 +1,12 @@
1
- "use strict";var me=Object.defineProperty;var _n=Object.getOwnPropertyDescriptor;var Nn=Object.getOwnPropertyNames;var Gn=Object.prototype.hasOwnProperty;var r=(e,t)=>me(e,"name",{value:t,configurable:!0});var Vn=(e,t)=>{for(var n in t)me(e,n,{get:t[n],enumerable:!0})},qn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Nn(t))!Gn.call(e,i)&&i!==n&&me(e,i,{get:()=>t[i],enumerable:!(o=_n(t,i))||o.enumerable});return e};var Jn=e=>qn(me({},"__esModule",{value:!0}),e);var Ls={};Vn(Ls,{CRYPTO_DEFAULT_ALG:()=>Te,CRYPTO_DEFAULT_DERIVE_ALG:()=>Xe,CRYPTO_DEFAULT_DERIVE_ITERATIONS:()=>Bt,CRYPTO_DEFAULT_HASH_ALG:()=>et,Channel:()=>le,CryptoEncoder:()=>je,DAY_MS:()=>De,Day:()=>C,Emitter:()=>M,JsonEncoder:()=>_,LocalChannel:()=>ne,LocalStorage:()=>_e,LogLevel:()=>B,LogLevelAlias:()=>Ne,Logger:()=>A,LoggerBrowserHandler:()=>Et,LoggerBrowserSetupDebugFactory:()=>Pt,LoggerConsoleHandler:()=>ie,LoggerContext:()=>Ge,LoggerMemoryHandler:()=>Wi,MemStorage:()=>ze,NoopEncoder:()=>Be,PoolTaskIdConflictResolution:()=>Pn,PoolTaskState:()=>En,PubSub:()=>fe,SerialQueue:()=>Oe,Uint8ArrayToHexDump:()=>Qe,Uint8ArrayToJson:()=>be,Uint8ArrayToString:()=>Je,XRX:()=>Re,_decodeUtf8Polyfill:()=>$t,_encodeUtf8Polyfill:()=>It,activateConsoleDebug:()=>Ts,arrayAvg:()=>Dr,arrayBatches:()=>Sr,arrayEmptyInPlace:()=>br,arrayFilterInPlace:()=>Ae,arrayFlatten:()=>W,arrayIntersection:()=>Gt,arrayIsEqual:()=>qt,arrayMax:()=>Ar,arrayMin:()=>Cr,arrayMinus:()=>_t,arrayRandomElement:()=>vr,arrayRemoveElement:()=>yr,arraySetElement:()=>hr,arrayShuffle:()=>Tr,arrayShuffleForce:()=>Lr,arrayShuffleInPlace:()=>ot,arraySorted:()=>Vt,arraySortedNumbers:()=>wr,arraySum:()=>Fr,arraySymmetricDifference:()=>mr,arrayToggleInPlace:()=>xr,arrayUnion:()=>Nt,arrayUnique:()=>ve,avg:()=>cr,between:()=>ur,cloneJsonObject:()=>ci,cloneObject:()=>Me,cmp:()=>Le,composeOrderby:()=>dr,createArray:()=>Er,createLocalChannelPair:()=>Zi,createPromise:()=>ct,createPromiseProxy:()=>Ct,csvParse:()=>dn,csvParseToObjects:()=>bi,csvStringify:()=>xi,dateStringToDays:()=>xo,day:()=>ho,dayDay:()=>Xt,dayDiff:()=>so,dayFromAny:()=>to,dayFromDate:()=>ae,dayFromDateGMT:()=>ro,dayFromParts:()=>Ee,dayFromString:()=>ut,dayFromTimestamp:()=>en,dayFromToday:()=>at,dayIterator:()=>uo,dayMonth:()=>it,dayMonthStart:()=>oo,dayOffset:()=>se,dayRange:()=>ao,dayToDate:()=>st,dayToDateGMT:()=>no,dayToParts:()=>eo,dayToString:()=>tn,dayToTimestamp:()=>Fe,dayYear:()=>Se,dayYearStart:()=>io,debounce:()=>qi,decimal:()=>rn,decimalCentsPart:()=>To,decimalFromCents:()=>bo,decimalToCents:()=>wo,decodeBase16:()=>$r,decodeBase32:()=>kr,decodeBase58:()=>Br,decodeBase62:()=>Hr,decrypt:()=>nt,deepEqual:()=>on,deepMerge:()=>ce,deepStripUndefinedInPlace:()=>sn,deriveKeyPbkdf2:()=>or,detect:()=>In,digest:()=>rr,empty:()=>ui,encodeBase16:()=>Ir,encodeBase32:()=>Rr,encodeBase58:()=>Or,encodeBase62:()=>jr,encodeQuery:()=>bt,encrypt:()=>tt,endSortWeight:()=>xt,ensureKey:()=>oi,ensureKeyAsync:()=>ii,equalBinary:()=>Ye,escapeHTML:()=>gt,escapeRegExp:()=>mt,estimateSizeForBase:()=>zr,fetchBasic:()=>Dt,fetchJson:()=>ts,fetchOptionsBasicAuth:()=>Un,fetchOptionsFormURLEncoded:()=>rs,fetchOptionsJson:()=>os,fetchText:()=>ns,fixBrokenUth8String:()=>Xr,forEachDay:()=>mo,forTimes:()=>pi,formatMessages:()=>Qt,formatMilliseconds:()=>wt,fromBase64:()=>Ot,fromBase64String:()=>nr,fromCamelCase:()=>Gr,fromHex:()=>Ze,getGlobal:()=>is,getGlobalContext:()=>K,getGlobalEmitter:()=>Ei,getGlobalLogger:()=>Rt,getNamespaceFilterString:()=>Mt,getNavigator:()=>kn,getSecureRandom:()=>jt,getSecureRandomIfPossible:()=>F,getTimestamp:()=>ee,getWindow:()=>St,gravatarURLByEmail:()=>ds,immediate:()=>lo,isArray:()=>O,isBoolean:()=>dt,isBrowser:()=>He,isEven:()=>yt,isHalf:()=>Q,isInteger:()=>Co,isLocalHost:()=>Ji,isNotNull:()=>Po,isNull:()=>So,isNullOrUndefined:()=>Do,isNumber:()=>Ao,isObject:()=>$,isPrime:()=>fr,isPrimeRX:()=>lr,isPrimitive:()=>Pe,isPromise:()=>P,isRecord:()=>ue,isRecordPlain:()=>Lo,isSafeInteger:()=>Fo,isString:()=>vo,isTimeout:()=>po,isUint8Array:()=>Eo,isValue:()=>Mo,joinToUint8Array:()=>er,jsonStringify:()=>Xn,jsonStringifySafe:()=>S,jsonStringifySorted:()=>Yn,jsonToUint8Array:()=>xe,last:()=>ai,lazyListener:()=>Mi,linkifyPlainText:()=>ni,listDistinctUnion:()=>Io,listGroupBy:()=>ko,listOfKey:()=>$o,listQuery:()=>Uo,memoize:()=>li,memoizeAsync:()=>fi,messages:()=>Pi,moveSortWeight:()=>Xo,noop:()=>us,objectIsEmpty:()=>jo,objectMap:()=>Oo,objectMergeDisposable:()=>Bo,parseBasicAuth:()=>Rn,parseDate:()=>Ri,parseLogLevel:()=>Y,parseOrderby:()=>zt,parseQuery:()=>ri,platform:()=>ss,promisify:()=>I,qid:()=>Ni,randomBoolean:()=>ir,randomFloat:()=>ar,randomInt:()=>sr,randomUint8Array:()=>J,regExpEscape:()=>yi,regExpString:()=>pn,renderMessages:()=>Qr,roundDown:()=>qo,roundHalfAwayFromZero:()=>Zo,roundHalfDown:()=>Ko,roundHalfEven:()=>Yo,roundHalfOdd:()=>Wo,roundHalfTowardsZero:()=>Qo,roundHalfUp:()=>Jo,roundUp:()=>Vo,seededRandom:()=>pr,selectColor:()=>de,setUuidDefaultEncoding:()=>Hi,setupBrowserLog:()=>zn,size:()=>si,sleep:()=>co,sortedItems:()=>cn,sortedOrderby:()=>gr,startSortWeight:()=>ht,stringToBoolean:()=>Vr,stringToFloat:()=>Jr,stringToInteger:()=>qr,stringToUInt8Array:()=>qe,suid:()=>Oi,suidBytes:()=>Lt,suidBytesDate:()=>Fn,suidDate:()=>Bi,sum:()=>Ht,supportsColors:()=>pe,throttle:()=>Vi,timeout:()=>fo,timeoutReached:()=>lt,timoutError:()=>ft,toBase64:()=>Ke,toBase64Url:()=>tr,toBool:()=>Yr,toCamelCase:()=>_r,toCapitalize:()=>Jt,toCapitalizeWords:()=>Nr,toFloat:()=>Wr,toHex:()=>We,toHumanReadableUrl:()=>ln,toInt:()=>Zr,toString:()=>Kr,toUint8Array:()=>E,toValidFilename:()=>No,today:()=>yo,tryTimeout:()=>pt,uname:()=>z,unescapeHTML:()=>Ro,urlBase64ToUint8Array:()=>ls,useAsyncMutex:()=>Si,useBase:()=>j,useDefer:()=>vi,useDispose:()=>Ue,useDisposer:()=>Li,useEventListener:()=>Fi,useExitHandler:()=>as,useInterval:()=>Ci,useLevelFilter:()=>V,useMessageHub:()=>Ki,useMutex:()=>Di,useNamespaceFilter:()=>U,usePool:()=>Gi,usePubSub:()=>Yi,useRPC:()=>es,useSorted:()=>ei,useTimeout:()=>Ai,uuid:()=>H,uuid32bit:()=>ji,uuidB32:()=>bn,uuidB62:()=>yn,uuidBytes:()=>Ie,uuidDecode:()=>At,uuidDecodeB32:()=>Tn,uuidDecodeB62:()=>xn,uuidDecodeV4:()=>An,uuidEncode:()=>Sn,uuidEncodeB32:()=>wn,uuidEncodeB62:()=>hn,uuidEncodeV4:()=>vn,uuidIsValid:()=>zi,uuidv4:()=>Ln,valueToBoolean:()=>Zt,valueToFloat:()=>Yt,valueToInteger:()=>Kt,valueToString:()=>Ce,waitOn:()=>go});module.exports=Jn(Ls);function Wn(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}r(Wn,"_global");function K(){let e=Wn();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}r(K,"getGlobalContext");function Mt(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}r(Mt,"getNamespaceFilterString");var Zn=Mt(typeof process<"u"?process.env.ZEED??process.env.DEBUG:typeof localStorage<"u"?localStorage.zeed??localStorage.debug:"*");function U(e=Zn){let t,n=[],o=[];if(!e)t=r(function(i){return!1},"fn");else if(e==="*")t=r(function(i){return!0},"fn");else{let i,s=e.split(/[\s,]+/),u=s.length;for(i=0;i<u;i++){if(!s[i])continue;let a=s[i].replace(/\*/g,".*?");a[0]==="-"?n.push(new RegExp(`^${a.substr(1)}$`)):o.push(new RegExp(`^${a}$`))}t=r(function(a){if(n.length===0&&o.length===0)return!0;let f,g;for(f=0,g=n.length;f<g;f++)if(n[f].test(a))return!1;for(f=0,g=o.length;f<g;f++)if(o[f].test(a))return!0;return!1},"fn")}return t.accept=o,t.reject=n,t.filter=e,t}r(U,"useNamespaceFilter");var Kn=typeof process<"u"?process.env.ZEED_LEVEL??process.env.LEVEL??process.env.DEBUG_LEVEL:typeof localStorage<"u"?localStorage.zeed_level??localStorage.level??localStorage.debug_level:void 0;function Y(e){if(e===!1)return 1/0;if(typeof e=="number")return e;if(typeof e=="string"){let t=Ne[e.toLocaleLowerCase().trim()];if(t!=null)return t}return-1}r(Y,"parseLogLevel");function V(e=Kn){let t=Y(e);return n=>n>=t}r(V,"useLevelFilter");function ie(e={}){let{level:t=void 0,filter:n=void 0}=e,o=U(n),i=V(t);return s=>{if(!i(s.level)||!o(s.name))return;let u=s.name?`[${s.name}]`:"";switch(s.level){case 1:console.info(`I|* ${u}`,...s.messages);break;case 2:console.warn(`W|** ${u}`,...s.messages);break;case 3:console.error(`E|*** ${u}`,...s.messages);break;default:console.debug(`D| ${u}`,...s.messages);break}}}r(ie,"LoggerConsoleHandler");var B=(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))(B||{}),Ne={"*":-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 Ge(e=""){let t=[ie()],n=r(f=>!0,"logCheckNamespace"),o=!1,i=u,s=!1;function u(f="",g){let h=Y(g??-1);function x(w,T){return h<=w?T:()=>{}}r(x,"defineForLogLevel");let b=x(0,(...w)=>{v({name:f,messages:w,level:0})});b.label=f,b.extend=function(w){return i(f?`${f}:${w}`:w)};let v=r(w=>{if(n(f))for(let T of t)T&&T(w)},"emit");return b.debug=x(0,(...w)=>{v({name:f,messages:w,level:0})}),b.info=x(1,(...w)=>{v({name:f,messages:w,level:1})}),b.warn=x(2,(...w)=>{v({name:f,messages:w,level:2})}),b.error=x(3,(...w)=>{v({name:f,messages:w,level:3})}),b.fatal=x(4,(...w)=>{throw v({name:f,messages:w,level:4}),new Error(`${w.map(String).join(" ")}`)}),b.assert=x(4,(w,...T)=>{w||b.fatal(...T)}),b}r(u,"LoggerBaseFactory");function a(f="",g){let h=i(f,g);return s&&h.debug(`+++ init of logger "${f}" on level "${B[h.level]}".`),h}return r(a,"Logger"),a.registerHandler=function(f){t.push(f)},a.setFilter=function(f){n=U(f)},a.setLock=(f=!0)=>o=f,a.setDebug=(f=!0)=>s=f,a.setHandlers=function(f=[]){i!==u&&(i=u),!o&&(t=[...f].filter(g=>typeof g=="function"))},a.level=-1,a.setLogLevel=function(f=-1){o||(a.level=f)},a.setFactory=function(f){o||(i=f)},a}r(Ge,"LoggerContext");var q;function Ve(){let e=Ge();return e.setHandlers([ie()]),e}r(Ve,"getLoggerContext");function Rt(){if(q==null)try{let e=K();e!=null?e?.logger==null?(q=Ve(),e.logger=q):q=e.logger:q=Ve()}catch{q=Ve()}return q}r(Rt,"getGlobalLogger");var A=Rt();var Ut=r((e,t)=>t instanceof Object&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,o)=>(n[o]=t[o],n),{}):t,"_sortedReplacer");function Yn(e,t=void 0){return JSON.stringify(e,Ut,t)}r(Yn,"jsonStringifySorted");function Qn(e,t){let n=[],o=[];return t==null&&(t=r(function(i,s){return n[0]===s?"[Circular ~]":`[Circular ~.${o.slice(0,n.indexOf(s)).join(".")}]`},"cycleReplacer")),function(i,s){if(n.length>0){let u=n.indexOf(this);~u?n.splice(u+1):n.push(this),~u?o.splice(u,1/0,i):o.push(i),~n.indexOf(s)&&(s=t?.call(this,i,s))}else n.push(s);s=Ut(i,s);try{return e==null?s:e.call(this,i,s)}catch{}return String(s)}}r(Qn,"serializer");function S(e,t,n,o){return JSON.stringify(e,Qn(t,o),n)}r(S,"jsonStringifySafe");var Xn=S;var kt=A("zeed:bin","error");function It(e){let t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let i=0;i<n;i++)o[i]=t.codePointAt(i)||0;return o}r(It,"_encodeUtf8Polyfill");function $t(e){let t=e.length,n="",o=0;for(;t>0;){let i=t<1e4?t:1e4,s=e.subarray(o,o+i);o+=i,n+=String.fromCodePoint.apply(null,s),t-=i}return decodeURIComponent(escape(n))}r($t,"_decodeUtf8Polyfill");var ye;function qe(e){if(ye==null&&(ye=It,typeof TextEncoder<"u")){let t=new TextEncoder;ye=r(n=>t.encode(n),"_textEncoder")}return ye(e.normalize("NFC"))}r(qe,"stringToUInt8Array");var he;function Je(e){if(he==null&&(he=$t,typeof TextDecoder<"u")){let t=new TextDecoder("utf-8",{ignoreBOM:!0});he=r(n=>t.decode(n),"_textDecoder")}return he(e).normalize("NFC")}r(Je,"Uint8ArrayToString");function E(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?qe(e):e.length?new Uint8Array(e):e}r(E,"toUint8Array");function er(...e){let t=0,n=e.flat(1).map(s=>{let u=E(s);return t+=u.length,u}),o=new Uint8Array(t),i=0;for(let s of n)o.set(s,i),i+=s.length;return o}r(er,"joinToUint8Array");function We(e){if(typeof Buffer<"u")return Buffer.from(E(e)).toString("hex");let t="0123456789abcdef",n="";for(let o of[...E(e)])n+=t[o>>4]+t[o&15];return n}r(We,"toHex");function Ze(e){return Uint8Array.from(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}r(Ze,"fromHex");function Ke(e,t=!1){let n=E(e),o="";if(typeof Buffer<"u")o=Buffer.from(n).toString("base64");else{let i="";for(let s=0;s<n.byteLength;s++)i+=String.fromCharCode(n[s]);o=btoa(i)}return t?o.replaceAll("=",""):o}r(Ke,"toBase64");function tr(e){let t=E(e);if(typeof Buffer<"u")return Buffer.from(t).toString("base64url").replaceAll("=","");let n="";for(let o=0;o<t.byteLength;o++)n+=String.fromCharCode(t[o]);return btoa(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}r(tr,"toBase64Url");function Ot(e){if(e=e.replaceAll("-","+").replaceAll("_","/"),typeof Buffer<"u"){let o=Buffer.from(e,"base64");return new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}r(Ot,"fromBase64");function nr(e){return Je(Ot(e))}r(nr,"fromBase64String");function Ye(e,t){if(e.byteLength!==t.byteLength)return!1;let n=E(e),o=E(t);for(let i=0;i<n.length;i++)if(n[i]!==o[i])return!1;return!0}r(Ye,"equalBinary");function xe(e){try{return qe(S(e))}catch(t){throw kt.warn("jsonToUint8Array",e),t}}r(xe,"jsonToUint8Array");function be(e){try{return JSON.parse(Je(e))}catch(t){throw kt.warn("Uint8ArrayToJson",e),t}}r(be,"Uint8ArrayToJson");function Qe(e,t){if(typeof e!="string")if(e instanceof ArrayBuffer&&e.byteLength!==void 0)e=String.fromCharCode.apply(String,[].slice.call(new Uint8Array(e)));else if(Array.isArray(e))e=String.fromCharCode.apply(String,e);else if(e.constructor===Uint8Array)e=String.fromCharCode.apply(String,[].slice.call(e));else return!1;t=t||16;let n=[],o="0123456789ABCDEF";for(let i=0;i<e.length;i+=t){let s=e.slice(i,Math.min(i+t,e.length)),u=`0000${i.toString(16)}`.slice(-4),a=s.split("").map(g=>{let h=g.charCodeAt(0);return` ${o[(240&h)>>4]}${o[15&h]}`}).join("");a+=" ".repeat(t-s.length);let f=s.replace(/[\x00-\x1F\x20]/g,".");f+=" ".repeat(t-s.length),n.push(`${u} ${a} ${f}`)}return n.join(`
2
- `)}r(Qe,"Uint8ArrayToHexDump");function J(e=16){let t=new Uint8Array(e);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let n=0;n<e;n++)t[n]=Math.floor(Math.random()*256);return t}r(J,"randomUint8Array");var et="SHA-256",Te="AES-GCM",Xe="PBKDF2",Bt=1e5;async function rr(e,t=et){return E(await crypto.subtle.digest(t,E(e)))}r(rr,"digest");async function or(e,t={}){let n=E(e),o=await crypto.subtle.importKey("raw",n,Xe,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:Xe,salt:t.salt?E(t.salt):new Uint8Array(0),iterations:t.iterations??Bt,hash:et},o,{name:Te,length:256},!0,["encrypt","decrypt"])}r(or,"deriveKeyPbkdf2");var we=new Uint8Array([1,1]);async function tt(e,t){let n=J(12),o=await crypto.subtle.encrypt({name:Te,iv:n},t,e),i=new Uint8Array(o),s=we.length+n.length+i.length,u=new Uint8Array(s),a=0;return u.set(we,a),a+=we.length,u.set(n,a),a+=n.length,u.set(i,a),u}r(tt,"encrypt");async function nt(e,t){let n=e.subarray(0,2);if(!Ye(n,we))return Promise.reject(new Error(`Unknown magic ${n}`));let o=e.subarray(2,2+12),i=e.subarray(2+12,e.length),s=await crypto.subtle.decrypt({name:Te,iv:o},t,i);return new Uint8Array(s)}r(nt,"decrypt");function jt(){return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}r(jt,"getSecureRandom");function F(){return typeof crypto<"u"?jt():Math.random()}r(F,"getSecureRandomIfPossible");function ir(e=.25){return F()<e}r(ir,"randomBoolean");function sr(e=100,t=0){return t+Math.floor(F()*(e-t))}r(sr,"randomInt");function ar(e=100,t=0){return t+F()*(e-t)}r(ar,"randomFloat");function ur(e,t,n){return Math.max(e,Math.min(n,t))}r(ur,"between");function Ht(e){return e.reduce((t,n)=>t+n,0)}r(Ht,"sum");function cr(e){return Ht(e)/e.length}r(cr,"avg");function lr(e){return!/^1?$|^(11+?)\1+$/.test("1".repeat(e))}r(lr,"isPrimeRX");function fr(e){for(let t=2;t<e;t++)if(e%t===0)return!1;return e>1}r(fr,"isPrime");var rt=6;function pr(e=0,t=1,n){rt=((n??rt)*9301+49297)%233280;let o=rt/233280;return t+o*(e-t)}r(pr,"seededRandom");function zt(e=""){let[t="",n="asc"]=e.split(" ");return n=n.toLowerCase(),{field:t,orderby:n,asc:n!=="desc",desc:n==="desc"}}r(zt,"parseOrderby");function dr(e,t=!0){return`${e} ${t?"asc":"desc"}`}r(dr,"composeOrderby");function Le(e,t,n=!0){let o=e||0,i=t||0;return o>i?n?1:-1:o<i?n?-1:1:0}r(Le,"cmp");function gr(e,...t){if(t.length>0){let n=t.map(zt),o=Array.from(e);return o.sort((i,s)=>{for(let{field:u,asc:a}of n){let f=Le(i[u],s[u],a);if(f!==0)return f}return 0}),o}return e}r(gr,"sortedOrderby");function ve(e){return e.filter((t,n)=>e.indexOf(t)===n)}r(ve,"arrayUnique");function _t(e,t){return ve(e.filter(n=>!t.includes(n)))}r(_t,"arrayMinus");function Nt(...e){return ve(e.reduce((t=[],n)=>t.concat(n),[]))}r(Nt,"arrayUnion");function W(...e){return e.flat(1/0)}r(W,"arrayFlatten");function Gt(e,t){return ve(e).filter(n=>t.includes(n))}r(Gt,"arrayIntersection");function mr(e,t){return _t(Nt(e,t),Gt(e,t))}r(mr,"arraySymmetricDifference");function yr(e,t){if(e&&Array.isArray(e)){let n;for(;(n=e.indexOf(t))!==-1;)e.splice(n,1);return e}return[]}r(yr,"arrayRemoveElement");function hr(e,t){return e.includes(t)||e.push(t),e}r(hr,"arraySetElement");function Ae(e,t){return e.splice(0,e.length,...e.filter(t)),e}r(Ae,"arrayFilterInPlace");function xr(e,t){let n=e.findIndex(o=>o===t);return n>=0?e.splice(n,1):e.push(t),e}r(xr,"arrayToggleInPlace");function br(e){return e.splice(0,e.length),e}r(br,"arrayEmptyInPlace");function Vt(e,t=Le){return Array.from(e).sort(t)}r(Vt,"arraySorted");function wr(e){return Vt(e,(t,n)=>t-n)}r(wr,"arraySortedNumbers");function qt(e,t){return e.length===t.length&&e.every((n,o)=>n===t[o])}r(qt,"arrayIsEqual");function ot(e){return e.sort(()=>F()>.5?1:-1),e}r(ot,"arrayShuffleInPlace");function Tr(e){return ot(Array.from(e))}r(Tr,"arrayShuffle");function Lr(e){for(;e.length>1;){let t=Array.from(e);if(ot(t),!qt(e,t))return t}return e}r(Lr,"arrayShuffleForce");function vr(e){return e[Math.floor(F()*e.length)]}r(vr,"arrayRandomElement");function Ar(...e){return W(e).reduce((t,n)=>t!=null?n>t?n:t:n,void 0)}r(Ar,"arrayMax");function Cr(...e){return W(e).reduce((t,n)=>t!=null?n<t?n:t:n,void 0)}r(Cr,"arrayMin");function Fr(...e){return W(e).reduce((t,n)=>t+n,0)}r(Fr,"arraySum");function Dr(...e){let t=W(e);return t.reduce((n,o)=>n+o,0)/t.length}r(Dr,"arrayAvg");function Sr(e,t){let n=[],o=0,i=e.length;for(;o<i;)n.push(e.slice(o,o+=t));return n}r(Sr,"arrayBatches");function Er(e=0,t){if(e<=0)return[];let n=new Array(e);for(let o=0;o<e;o++)n[o]=t instanceof Function?t(o):t;return n}r(Er,"createArray");var Pr=A("zeed:basex","error"),Mr={2:"01",8:"01234567",11:"0123456789a",16:"0123456789abcdef",32:"0123456789abcdefghjkmnpqrtuvwxyz","32-crockford":"0123456789ABCDEFGHJKMNPQRSTVWXYZ","32-geohash":"0123456789bcdefghjkmnpqrstuvwxyz","32-agnoster":"0123456789abcdefghjkmnpqrtuvwxyz","32-rfc":"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567","32-hex":"0123456789ABCDEFGHIJKLMNOPQRSTUV","32-zbase":"ybndrfg8ejkmcpqxot1uwisza345h769",36:"0123456789abcdefghijklmnopqrstuvwxyz",58:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",62:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","64-url":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",66:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~",85:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"};function j(e){let t=Mr[String(e)];if(!t)if(typeof e=="string")t=e;else throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let n=new Uint8Array(256);for(let g=0;g<n.length;g++)n[g]=255;for(let g=0;g<t.length;g++){let h=t.charAt(g),x=h.charCodeAt(0);if(n[x]!==255)throw new TypeError(`${h} is ambiguous`);n[x]=g}let o=t.length,i=t.charAt(0),s=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function a(g,h=-1){let x=E(g);if(x.byteLength===0)return"";let b=0,v=0,w=x.byteLength;for(;v!==w&&x[v]===0;)v++;let T=(w-v)*u+1>>>0,L=new Uint8Array(T);for(;v!==w;){let c=x[v],l=0;for(let d=T-1;(c!==0||l<b)&&d!==-1;d--,l++)c+=256*L[d]>>>0,L[d]=c%o>>>0,c=c/o>>>0;if(c!==0)throw Pr.warn("Non-zero carry",x,h,l,T),new Error("Non-zero carry");b=l,v++}let y=T-b;for(;y!==T&&L[y]===0;)y++;let p="";for(;y<T;++y)p+=t.charAt(L[y]);return h>0?p.padStart(h,i):p}r(a,"encode");function f(g,h=-1){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;g=g.replace(/\s+/gi,"");let x=0,b=0;for(;g[x]===i;)x++;let v=(g.length-x)*s+1>>>0,w=new Uint8Array(v);for(;g[x];){let L=n[g.charCodeAt(x)];if(L===255)throw new Error(`Unsupported character "${g[x]}"`);let y=0;for(let p=v-1;(L!==0||y<b)&&p!==-1;p--,y++)L+=o*w[p]>>>0,w[p]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");b=y,x++}let T=v-b;for(;T!==v&&w[T]===0;)T++;return h>0?new Uint8Array([...new Uint8Array(h-w.length+T),...w.slice(T)]):w.slice(T)}return r(f,"decode"),{encode:a,decode:f}}r(j,"useBase");var{encode:Rr,decode:Ur}=j(32);function kr(e){return Ur(e.toLocaleLowerCase().replaceAll("l","1").replaceAll("s","5").replaceAll("o","0").replaceAll("i","1"))}r(kr,"decodeBase32");var{encode:Ir,decode:$r}=j(16),{encode:Or,decode:Br}=j(58),{encode:jr,decode:Hr}=j(62);function zr(e,t){return Math.ceil(e*(Math.log(256)/Math.log(t)))}r(zr,"estimateSizeForBase");var _r=r(e=>(e.length>0&&(/^[A-Z0-9_\-\ ]*$/g.test(e)&&(e=e.toLowerCase()),e=e.replace(/^[-_\ ]+/gi,"").replace(/[-_\ ]+$/gi,"").replace(/[-_\ ]+([a-z0-9])/gi,(t,n)=>n.toUpperCase()),e=e[0].toLowerCase()+e.substring(1)),e),"toCamelCase");function Jt(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}r(Jt,"toCapitalize");function Nr(e){return e.replace(/\w\S*/g,Jt)}r(Nr,"toCapitalizeWords");function Gr(e,t="-"){return t=typeof t>"u"?"_":t,e.replace(/([a-z\d])([A-Z])/g,`$1${t}$2`).replace(/([A-Z]+)([A-Z][a-z\d]+)/g,`$1${t}$2`).toLowerCase()}r(Gr,"fromCamelCase");var Wt=["1","true","yes","y","on"];function Vr(e,t=!1){return e==null||typeof e!="string"?t:Wt.includes(String(e).trim().toLowerCase())}r(Vr,"stringToBoolean");function qr(e,t=0){return e==null||typeof e!="string"?t:parseInt(e.trim(),10)??t}r(qr,"stringToInteger");function Jr(e,t=0){return e==null||typeof e!="string"?t:parseFloat(e.trim())??t}r(Jr,"stringToFloat");function Zt(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:Wt.includes(String(e).trim().toLowerCase())}r(Zt,"valueToBoolean");function Kt(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseInt(String(e).trim(),10)??t}r(Kt,"valueToInteger");function Yt(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseFloat(String(e).trim())??t}r(Yt,"valueToFloat");function Ce(e,t=""){return e==null?t:String(e)??t}r(Ce,"valueToString");var Wr=Yt,Zr=Kt,Kr=Ce,Yr=Zt;function Qt(e,t={}){let{trace:n=!0,pretty:o=!0}=t;return e.map(i=>{if(i&&typeof i=="object"){if(o&&(i instanceof Uint8Array||i instanceof ArrayBuffer))return`
3
- ${Qe(i)}
1
+ "use strict";var ye=Object.defineProperty;var Gn=Object.getOwnPropertyDescriptor;var Vn=Object.getOwnPropertyNames;var qn=Object.prototype.hasOwnProperty;var r=(e,t)=>ye(e,"name",{value:t,configurable:!0});var Jn=(e,t)=>{for(var n in t)ye(e,n,{get:t[n],enumerable:!0})},Wn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Vn(t))!qn.call(e,i)&&i!==n&&ye(e,i,{get:()=>t[i],enumerable:!(o=Gn(t,i))||o.enumerable});return e};var Zn=e=>Wn(ye({},"__esModule",{value:!0}),e);var vs={};Jn(vs,{CRYPTO_DEFAULT_ALG:()=>Le,CRYPTO_DEFAULT_DERIVE_ALG:()=>tt,CRYPTO_DEFAULT_DERIVE_ITERATIONS:()=>jt,CRYPTO_DEFAULT_HASH_ALG:()=>nt,Channel:()=>fe,CryptoEncoder:()=>je,DAY_MS:()=>Ee,Day:()=>A,Emitter:()=>D,JsonEncoder:()=>z,LocalChannel:()=>te,LocalStorage:()=>Ge,LogLevel:()=>B,LogLevelAlias:()=>Ve,Logger:()=>C,LoggerBrowserHandler:()=>Ut,LoggerBrowserSetupDebugFactory:()=>Mt,LoggerConsoleHandler:()=>se,LoggerContext:()=>qe,LoggerMemoryHandler:()=>ts,MemStorage:()=>Ne,NoopEncoder:()=>_e,PoolTaskIdConflictResolution:()=>Rn,PoolTaskState:()=>Mn,Progress:()=>ne,PubSub:()=>de,SerialQueue:()=>He,Uint8ArrayToHexDump:()=>et,Uint8ArrayToJson:()=>we,Uint8ArrayToString:()=>Ze,XRX:()=>ke,_decodeUtf8Polyfill:()=>Bt,_encodeUtf8Polyfill:()=>Ot,activateConsoleDebug:()=>Ls,arrayAvg:()=>Pr,arrayBatches:()=>Er,arrayEmptyInPlace:()=>wr,arrayFilterInPlace:()=>Fe,arrayFlatten:()=>W,arrayIntersection:()=>qt,arrayIsEqual:()=>Wt,arrayMax:()=>Ar,arrayMin:()=>Fr,arrayMinus:()=>Gt,arrayRandomElement:()=>Cr,arrayRemoveElement:()=>Ae,arraySetElement:()=>xr,arrayShuffle:()=>Lr,arrayShuffleForce:()=>vr,arrayShuffleInPlace:()=>st,arraySorted:()=>Jt,arraySortedNumbers:()=>Tr,arraySum:()=>Dr,arraySymmetricDifference:()=>hr,arrayToggleInPlace:()=>br,arrayUnion:()=>Vt,arrayUnique:()=>Ce,avg:()=>fr,between:()=>lr,cloneJsonObject:()=>li,cloneObject:()=>Re,cmp:()=>ve,composeOrderby:()=>mr,createArray:()=>Sr,createLocalChannelPair:()=>Vi,createPromise:()=>ft,createPromiseProxy:()=>Dt,csvParse:()=>mn,csvParseToObjects:()=>wi,csvStringify:()=>bi,dateStringToDays:()=>bo,day:()=>xo,dayDay:()=>tn,dayDiff:()=>ao,dayFromAny:()=>no,dayFromDate:()=>ue,dayFromDateGMT:()=>oo,dayFromParts:()=>Ue,dayFromString:()=>lt,dayFromTimestamp:()=>nn,dayFromToday:()=>ct,dayIterator:()=>co,dayMonth:()=>at,dayMonthStart:()=>io,dayOffset:()=>ae,dayRange:()=>uo,dayToDate:()=>ut,dayToDateGMT:()=>ro,dayToParts:()=>to,dayToString:()=>rn,dayToTimestamp:()=>Pe,dayYear:()=>Se,dayYearStart:()=>so,debounce:()=>Xi,decimal:()=>sn,decimalCentsPart:()=>Lo,decimalFromCents:()=>wo,decimalToCents:()=>To,decodeBase16:()=>Or,decodeBase32:()=>Ir,decodeBase58:()=>_r,decodeBase62:()=>Hr,decrypt:()=>ot,deepEqual:()=>an,deepMerge:()=>le,deepStripUndefinedInPlace:()=>un,deriveKeyPbkdf2:()=>sr,detect:()=>On,digest:()=>ir,empty:()=>ci,encodeBase16:()=>$r,encodeBase32:()=>Rr,encodeBase58:()=>Br,encodeBase62:()=>jr,encodeQuery:()=>Tt,encrypt:()=>rt,endSortWeight:()=>wt,ensureKey:()=>ii,ensureKeyAsync:()=>si,equalBinary:()=>Xe,escapeHTML:()=>yt,escapeRegExp:()=>ht,estimateSizeForBase:()=>zr,fetchBasic:()=>Et,fetchJson:()=>ns,fetchOptionsBasicAuth:()=>In,fetchOptionsFormURLEncoded:()=>os,fetchOptionsJson:()=>is,fetchText:()=>rs,fixBrokenUth8String:()=>eo,forEachDay:()=>yo,forTimes:()=>pi,formatMessages:()=>en,formatMilliseconds:()=>Lt,fromBase64:()=>_t,fromBase64String:()=>or,fromCamelCase:()=>Vr,fromHex:()=>Ye,getGlobal:()=>ss,getGlobalContext:()=>K,getGlobalEmitter:()=>Si,getGlobalLogger:()=>kt,getNamespaceFilterString:()=>Rt,getNavigator:()=>$n,getSecureRandom:()=>Ht,getSecureRandomIfPossible:()=>F,getTimestamp:()=>ee,getWindow:()=>St,gravatarURLByEmail:()=>gs,immediate:()=>fo,isArray:()=>O,isBoolean:()=>mt,isBrowser:()=>ze,isEven:()=>xt,isHalf:()=>Q,isInteger:()=>Fo,isLocalHost:()=>es,isNotNull:()=>Uo,isNull:()=>Eo,isNullOrUndefined:()=>Po,isNumber:()=>Ao,isObject:()=>$,isPrime:()=>pr,isPrimeRX:()=>dr,isPrimitive:()=>Me,isPromise:()=>U,isRecord:()=>ce,isRecordPlain:()=>vo,isSafeInteger:()=>Do,isString:()=>Co,isTimeout:()=>go,isUint8Array:()=>So,isValue:()=>Mo,joinToUint8Array:()=>nr,jsonStringify:()=>tr,jsonStringifySafe:()=>E,jsonStringifySorted:()=>Xn,jsonToUint8Array:()=>be,last:()=>ui,lazyListener:()=>Mi,linkifyPlainText:()=>ri,listDistinctUnion:()=>$o,listGroupBy:()=>Io,listOfKey:()=>Oo,listQuery:()=>ko,memoize:()=>fi,memoizeAsync:()=>di,messages:()=>Ui,moveSortWeight:()=>ei,noop:()=>cs,objectIsEmpty:()=>jo,objectMap:()=>Bo,objectMergeDisposable:()=>_o,parseBasicAuth:()=>kn,parseDate:()=>Ri,parseLogLevel:()=>Y,parseOrderby:()=>Nt,parseQuery:()=>oi,platform:()=>as,promisify:()=>I,qid:()=>Gi,randomBoolean:()=>ar,randomFloat:()=>cr,randomInt:()=>ur,randomUint8Array:()=>J,regExpEscape:()=>hi,regExpString:()=>gn,renderMessages:()=>Xr,roundDown:()=>Jo,roundHalfAwayFromZero:()=>Ko,roundHalfDown:()=>Yo,roundHalfEven:()=>Qo,roundHalfOdd:()=>Zo,roundHalfTowardsZero:()=>Xo,roundHalfUp:()=>Wo,roundUp:()=>qo,seededRandom:()=>gr,selectColor:()=>ge,setUuidDefaultEncoding:()=>Hi,setupBrowserLog:()=>Nn,size:()=>ai,sleep:()=>lo,sortedItems:()=>fn,sortedOrderby:()=>yr,startSortWeight:()=>bt,stringToBoolean:()=>qr,stringToFloat:()=>Wr,stringToInteger:()=>Jr,stringToUInt8Array:()=>We,suid:()=>Bi,suidBytes:()=>Ct,suidBytesDate:()=>Pn,suidDate:()=>_i,sum:()=>zt,supportsColors:()=>pe,throttle:()=>Qi,timeout:()=>po,timeoutReached:()=>dt,timoutError:()=>pt,toBase64:()=>Qe,toBase64Url:()=>rr,toBool:()=>Qr,toCamelCase:()=>Nr,toCapitalize:()=>Zt,toCapitalizeWords:()=>Gr,toFloat:()=>Zr,toHex:()=>Ke,toHumanReadableUrl:()=>dn,toInt:()=>Kr,toString:()=>Yr,toUint8Array:()=>S,toValidFilename:()=>Go,today:()=>ho,tryTimeout:()=>gt,uname:()=>H,unescapeHTML:()=>Ro,urlBase64ToUint8Array:()=>fs,useAsyncMutex:()=>Ei,useBase:()=>_,useDefer:()=>Ci,useDispose:()=>Ie,useDisposer:()=>vi,useEventListener:()=>Di,useExitHandler:()=>us,useInterval:()=>Fi,useLevelFilter:()=>V,useMessageHub:()=>qi,useMutex:()=>Pi,useNamespaceFilter:()=>R,usePool:()=>Yi,usePubSub:()=>Ji,useRPC:()=>Ki,useSorted:()=>ti,useTimeout:()=>Ai,uuid:()=>j,uuid32bit:()=>ji,uuidB32:()=>Tn,uuidB62:()=>xn,uuidBytes:()=>Oe,uuidDecode:()=>Ft,uuidDecodeB32:()=>vn,uuidDecodeB62:()=>wn,uuidDecodeV4:()=>Fn,uuidEncode:()=>Sn,uuidEncodeB32:()=>Ln,uuidEncodeB62:()=>bn,uuidEncodeV4:()=>An,uuidIsValid:()=>zi,uuidv4:()=>Cn,valueToBoolean:()=>Yt,valueToFloat:()=>Xt,valueToInteger:()=>Qt,valueToString:()=>De,waitOn:()=>mo});module.exports=Zn(vs);function Kn(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}r(Kn,"_global");function K(){let e=Kn();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}r(K,"getGlobalContext");function Rt(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}r(Rt,"getNamespaceFilterString");var Yn=Rt(typeof process<"u"?process.env.ZEED??process.env.DEBUG:typeof localStorage<"u"?localStorage.zeed??localStorage.debug:"*");function R(e=Yn){let t,n=[],o=[];if(!e)t=r(function(i){return!1},"fn");else if(e==="*")t=r(function(i){return!0},"fn");else{let i,s=e.split(/[\s,]+/),u=s.length;for(i=0;i<u;i++){if(!s[i])continue;let a=s[i].replace(/\*/g,".*?");a[0]==="-"?n.push(new RegExp(`^${a.substr(1)}$`)):o.push(new RegExp(`^${a}$`))}t=r(function(a){if(n.length===0&&o.length===0)return!0;let d,g;for(d=0,g=n.length;d<g;d++)if(n[d].test(a))return!1;for(d=0,g=o.length;d<g;d++)if(o[d].test(a))return!0;return!1},"fn")}return t.accept=o,t.reject=n,t.filter=e,t}r(R,"useNamespaceFilter");var Qn=typeof process<"u"?process.env.ZEED_LEVEL??process.env.LEVEL??process.env.DEBUG_LEVEL:typeof localStorage<"u"?localStorage.zeed_level??localStorage.level??localStorage.debug_level:void 0;function Y(e){if(e===!1)return 1/0;if(typeof e=="number")return e;if(typeof e=="string"){let t=Ve[e.toLocaleLowerCase().trim()];if(t!=null)return t}return-1}r(Y,"parseLogLevel");function V(e=Qn){let t=Y(e);return n=>n>=t}r(V,"useLevelFilter");function se(e={}){let{level:t=void 0,filter:n=void 0}=e,o=R(n),i=V(t);return s=>{if(!i(s.level)||!o(s.name))return;let u=s.name?`[${s.name}]`:"";switch(s.level){case 1:console.info(`I|* ${u}`,...s.messages);break;case 2:console.warn(`W|** ${u}`,...s.messages);break;case 3:console.error(`E|*** ${u}`,...s.messages);break;default:console.debug(`D| ${u}`,...s.messages);break}}}r(se,"LoggerConsoleHandler");var B=(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))(B||{}),Ve={"*":-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 qe(e=""){let t=[se()],n=r(d=>!0,"logCheckNamespace"),o=!1,i=u,s=!1;function u(d="",g){let h=Y(g??-1);function x(w,T){return h<=w?T:()=>{}}r(x,"defineForLogLevel");let b=x(0,(...w)=>{v({name:d,messages:w,level:0})});b.label=d,b.extend=function(w){return i(d?`${d}:${w}`:w)};let v=r(w=>{if(n(d))for(let T of t)T&&T(w)},"emit");return b.debug=x(0,(...w)=>{v({name:d,messages:w,level:0})}),b.info=x(1,(...w)=>{v({name:d,messages:w,level:1})}),b.warn=x(2,(...w)=>{v({name:d,messages:w,level:2})}),b.error=x(3,(...w)=>{v({name:d,messages:w,level:3})}),b.fatal=x(4,(...w)=>{throw v({name:d,messages:w,level:4}),new Error(`${w.map(String).join(" ")}`)}),b.assert=x(4,(w,...T)=>{w||b.fatal(...T)}),b}r(u,"LoggerBaseFactory");function a(d="",g){let h=i(d,g);return s&&h.debug(`+++ init of logger "${d}" on level "${B[h.level]}".`),h}return r(a,"Logger"),a.registerHandler=function(d){t.push(d)},a.setFilter=function(d){n=R(d)},a.setLock=(d=!0)=>o=d,a.setDebug=(d=!0)=>s=d,a.setHandlers=function(d=[]){i!==u&&(i=u),!o&&(t=[...d].filter(g=>typeof g=="function"))},a.level=-1,a.setLogLevel=function(d=-1){o||(a.level=d)},a.setFactory=function(d){o||(i=d)},a}r(qe,"LoggerContext");var q;function Je(){let e=qe();return e.setHandlers([se()]),e}r(Je,"getLoggerContext");function kt(){if(q==null)try{let e=K();e!=null?e?.logger==null?(q=Je(),e.logger=q):q=e.logger:q=Je()}catch{q=Je()}return q}r(kt,"getGlobalLogger");var C=kt();var It=r((e,t)=>t instanceof Object&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,o)=>(n[o]=t[o],n),{}):t,"_sortedReplacer");function Xn(e,t=void 0){return JSON.stringify(e,It,t)}r(Xn,"jsonStringifySorted");function er(e,t){let n=[],o=[];return t==null&&(t=r(function(i,s){return n[0]===s?"[Circular ~]":`[Circular ~.${o.slice(0,n.indexOf(s)).join(".")}]`},"cycleReplacer")),function(i,s){if(n.length>0){let u=n.indexOf(this);~u?n.splice(u+1):n.push(this),~u?o.splice(u,1/0,i):o.push(i),~n.indexOf(s)&&(s=t?.call(this,i,s))}else n.push(s);s=It(i,s);try{return e==null?s:e.call(this,i,s)}catch{}return String(s)}}r(er,"serializer");function E(e,t,n,o){return JSON.stringify(e,er(t,o),n)}r(E,"jsonStringifySafe");var tr=E;var $t=C("zeed:bin","error");function Ot(e){let t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let i=0;i<n;i++)o[i]=t.codePointAt(i)||0;return o}r(Ot,"_encodeUtf8Polyfill");function Bt(e){let t=e.length,n="",o=0;for(;t>0;){let i=t<1e4?t:1e4,s=e.subarray(o,o+i);o+=i,n+=String.fromCodePoint.apply(null,s),t-=i}return decodeURIComponent(escape(n))}r(Bt,"_decodeUtf8Polyfill");var he;function We(e){if(he==null&&(he=Ot,typeof TextEncoder<"u")){let t=new TextEncoder;he=r(n=>t.encode(n),"_textEncoder")}return he(e.normalize("NFC"))}r(We,"stringToUInt8Array");var xe;function Ze(e){if(xe==null&&(xe=Bt,typeof TextDecoder<"u")){let t=new TextDecoder("utf-8",{ignoreBOM:!0});xe=r(n=>t.decode(n),"_textDecoder")}return xe(e).normalize("NFC")}r(Ze,"Uint8ArrayToString");function S(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?We(e):e.length?new Uint8Array(e):e}r(S,"toUint8Array");function nr(...e){let t=0,n=e.flat(1).map(s=>{let u=S(s);return t+=u.length,u}),o=new Uint8Array(t),i=0;for(let s of n)o.set(s,i),i+=s.length;return o}r(nr,"joinToUint8Array");function Ke(e){if(typeof Buffer<"u")return Buffer.from(S(e)).toString("hex");let t="0123456789abcdef",n="";for(let o of[...S(e)])n+=t[o>>4]+t[o&15];return n}r(Ke,"toHex");function Ye(e){return Uint8Array.from(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}r(Ye,"fromHex");function Qe(e,t=!1){let n=S(e),o="";if(typeof Buffer<"u")o=Buffer.from(n).toString("base64");else{let i="";for(let s=0;s<n.byteLength;s++)i+=String.fromCharCode(n[s]);o=btoa(i)}return t?o.replaceAll("=",""):o}r(Qe,"toBase64");function rr(e){let t=S(e);if(typeof Buffer<"u")return Buffer.from(t).toString("base64url").replaceAll("=","");let n="";for(let o=0;o<t.byteLength;o++)n+=String.fromCharCode(t[o]);return btoa(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}r(rr,"toBase64Url");function _t(e){if(e=e.replaceAll("-","+").replaceAll("_","/"),typeof Buffer<"u"){let o=Buffer.from(e,"base64");return new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}r(_t,"fromBase64");function or(e){return Ze(_t(e))}r(or,"fromBase64String");function Xe(e,t){if(e.byteLength!==t.byteLength)return!1;let n=S(e),o=S(t);for(let i=0;i<n.length;i++)if(n[i]!==o[i])return!1;return!0}r(Xe,"equalBinary");function be(e){try{return We(E(e))}catch(t){throw $t.warn("jsonToUint8Array",e),t}}r(be,"jsonToUint8Array");function we(e){try{return JSON.parse(Ze(e))}catch(t){throw $t.warn("Uint8ArrayToJson",e),t}}r(we,"Uint8ArrayToJson");function et(e,t){if(typeof e!="string")if(e instanceof ArrayBuffer&&e.byteLength!==void 0)e=String.fromCharCode.apply(String,[].slice.call(new Uint8Array(e)));else if(Array.isArray(e))e=String.fromCharCode.apply(String,e);else if(e.constructor===Uint8Array)e=String.fromCharCode.apply(String,[].slice.call(e));else return!1;t=t||16;let n=[],o="0123456789ABCDEF";for(let i=0;i<e.length;i+=t){let s=e.slice(i,Math.min(i+t,e.length)),u=`0000${i.toString(16)}`.slice(-4),a=s.split("").map(g=>{let h=g.charCodeAt(0);return` ${o[(240&h)>>4]}${o[15&h]}`}).join("");a+=" ".repeat(t-s.length);let d=s.replace(/[\x00-\x1F\x20]/g,".");d+=" ".repeat(t-s.length),n.push(`${u} ${a} ${d}`)}return n.join(`
2
+ `)}r(et,"Uint8ArrayToHexDump");function J(e=16){let t=new Uint8Array(e);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let n=0;n<e;n++)t[n]=Math.floor(Math.random()*256);return t}r(J,"randomUint8Array");var nt="SHA-256",Le="AES-GCM",tt="PBKDF2",jt=1e5;async function ir(e,t=nt){return S(await crypto.subtle.digest(t,S(e)))}r(ir,"digest");async function sr(e,t={}){let n=S(e),o=await crypto.subtle.importKey("raw",n,tt,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:tt,salt:t.salt?S(t.salt):new Uint8Array(0),iterations:t.iterations??jt,hash:nt},o,{name:Le,length:256},!0,["encrypt","decrypt"])}r(sr,"deriveKeyPbkdf2");var Te=new Uint8Array([1,1]);async function rt(e,t){let n=J(12),o=await crypto.subtle.encrypt({name:Le,iv:n},t,e),i=new Uint8Array(o),s=Te.length+n.length+i.length,u=new Uint8Array(s),a=0;return u.set(Te,a),a+=Te.length,u.set(n,a),a+=n.length,u.set(i,a),u}r(rt,"encrypt");async function ot(e,t){let n=e.subarray(0,2);if(!Xe(n,Te))return Promise.reject(new Error(`Unknown magic ${n}`));let o=e.subarray(2,2+12),i=e.subarray(2+12,e.length),s=await crypto.subtle.decrypt({name:Le,iv:o},t,i);return new Uint8Array(s)}r(ot,"decrypt");function Ht(){return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}r(Ht,"getSecureRandom");function F(){return typeof crypto<"u"?Ht():Math.random()}r(F,"getSecureRandomIfPossible");function ar(e=.25){return F()<e}r(ar,"randomBoolean");function ur(e=100,t=0){return t+Math.floor(F()*(e-t))}r(ur,"randomInt");function cr(e=100,t=0){return t+F()*(e-t)}r(cr,"randomFloat");function lr(e,t,n){return Math.max(e,Math.min(n,t))}r(lr,"between");function zt(e){return e.reduce((t,n)=>t+n,0)}r(zt,"sum");function fr(e){return zt(e)/e.length}r(fr,"avg");function dr(e){return!/^1?$|^(11+?)\1+$/.test("1".repeat(e))}r(dr,"isPrimeRX");function pr(e){for(let t=2;t<e;t++)if(e%t===0)return!1;return e>1}r(pr,"isPrime");var it=6;function gr(e=0,t=1,n){it=((n??it)*9301+49297)%233280;let o=it/233280;return t+o*(e-t)}r(gr,"seededRandom");function Nt(e=""){let[t="",n="asc"]=e.split(" ");return n=n.toLowerCase(),{field:t,orderby:n,asc:n!=="desc",desc:n==="desc"}}r(Nt,"parseOrderby");function mr(e,t=!0){return`${e} ${t?"asc":"desc"}`}r(mr,"composeOrderby");function ve(e,t,n=!0){let o=e||0,i=t||0;return o>i?n?1:-1:o<i?n?-1:1:0}r(ve,"cmp");function yr(e,...t){if(t.length>0){let n=t.map(Nt),o=Array.from(e);return o.sort((i,s)=>{for(let{field:u,asc:a}of n){let d=ve(i[u],s[u],a);if(d!==0)return d}return 0}),o}return e}r(yr,"sortedOrderby");function Ce(e){return e.filter((t,n)=>e.indexOf(t)===n)}r(Ce,"arrayUnique");function Gt(e,t){return Ce(e.filter(n=>!t.includes(n)))}r(Gt,"arrayMinus");function Vt(...e){return Ce(e.reduce((t=[],n)=>t.concat(n),[]))}r(Vt,"arrayUnion");function W(...e){return e.flat(1/0)}r(W,"arrayFlatten");function qt(e,t){return Ce(e).filter(n=>t.includes(n))}r(qt,"arrayIntersection");function hr(e,t){return Gt(Vt(e,t),qt(e,t))}r(hr,"arraySymmetricDifference");function Ae(e,t){if(e&&Array.isArray(e)){let n;for(;(n=e.indexOf(t))!==-1;)e.splice(n,1);return e}return[]}r(Ae,"arrayRemoveElement");function xr(e,t){return e.includes(t)||e.push(t),e}r(xr,"arraySetElement");function Fe(e,t){return e.splice(0,e.length,...e.filter(t)),e}r(Fe,"arrayFilterInPlace");function br(e,t){let n=e.findIndex(o=>o===t);return n>=0?e.splice(n,1):e.push(t),e}r(br,"arrayToggleInPlace");function wr(e){return e.splice(0,e.length),e}r(wr,"arrayEmptyInPlace");function Jt(e,t=ve){return Array.from(e).sort(t)}r(Jt,"arraySorted");function Tr(e){return Jt(e,(t,n)=>t-n)}r(Tr,"arraySortedNumbers");function Wt(e,t){return e.length===t.length&&e.every((n,o)=>n===t[o])}r(Wt,"arrayIsEqual");function st(e){return e.sort(()=>F()>.5?1:-1),e}r(st,"arrayShuffleInPlace");function Lr(e){return st(Array.from(e))}r(Lr,"arrayShuffle");function vr(e){for(;e.length>1;){let t=Array.from(e);if(st(t),!Wt(e,t))return t}return e}r(vr,"arrayShuffleForce");function Cr(e){return e[Math.floor(F()*e.length)]}r(Cr,"arrayRandomElement");function Ar(...e){return W(e).reduce((t,n)=>t!=null?n>t?n:t:n,void 0)}r(Ar,"arrayMax");function Fr(...e){return W(e).reduce((t,n)=>t!=null?n<t?n:t:n,void 0)}r(Fr,"arrayMin");function Dr(...e){return W(e).reduce((t,n)=>t+n,0)}r(Dr,"arraySum");function Pr(...e){let t=W(e);return t.reduce((n,o)=>n+o,0)/t.length}r(Pr,"arrayAvg");function Er(e,t){let n=[],o=0,i=e.length;for(;o<i;)n.push(e.slice(o,o+=t));return n}r(Er,"arrayBatches");function Sr(e=0,t){if(e<=0)return[];let n=new Array(e);for(let o=0;o<e;o++)n[o]=t instanceof Function?t(o):t;return n}r(Sr,"createArray");var Ur=C("zeed:basex","error"),Mr={2:"01",8:"01234567",11:"0123456789a",16:"0123456789abcdef",32:"0123456789abcdefghjkmnpqrtuvwxyz","32-crockford":"0123456789ABCDEFGHJKMNPQRSTVWXYZ","32-geohash":"0123456789bcdefghjkmnpqrstuvwxyz","32-agnoster":"0123456789abcdefghjkmnpqrtuvwxyz","32-rfc":"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567","32-hex":"0123456789ABCDEFGHIJKLMNOPQRSTUV","32-zbase":"ybndrfg8ejkmcpqxot1uwisza345h769",36:"0123456789abcdefghijklmnopqrstuvwxyz",58:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",62:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","64-url":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",66:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~",85:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"};function _(e){let t=Mr[String(e)];if(!t)if(typeof e=="string")t=e;else throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let n=new Uint8Array(256);for(let g=0;g<n.length;g++)n[g]=255;for(let g=0;g<t.length;g++){let h=t.charAt(g),x=h.charCodeAt(0);if(n[x]!==255)throw new TypeError(`${h} is ambiguous`);n[x]=g}let o=t.length,i=t.charAt(0),s=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function a(g,h=-1){let x=S(g);if(x.byteLength===0)return"";let b=0,v=0,w=x.byteLength;for(;v!==w&&x[v]===0;)v++;let T=(w-v)*u+1>>>0,L=new Uint8Array(T);for(;v!==w;){let c=x[v],l=0;for(let f=T-1;(c!==0||l<b)&&f!==-1;f--,l++)c+=256*L[f]>>>0,L[f]=c%o>>>0,c=c/o>>>0;if(c!==0)throw Ur.warn("Non-zero carry",x,h,l,T),new Error("Non-zero carry");b=l,v++}let y=T-b;for(;y!==T&&L[y]===0;)y++;let p="";for(;y<T;++y)p+=t.charAt(L[y]);return h>0?p.padStart(h,i):p}r(a,"encode");function d(g,h=-1){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;g=g.replace(/\s+/gi,"");let x=0,b=0;for(;g[x]===i;)x++;let v=(g.length-x)*s+1>>>0,w=new Uint8Array(v);for(;g[x];){let L=n[g.charCodeAt(x)];if(L===255)throw new Error(`Unsupported character "${g[x]}"`);let y=0;for(let p=v-1;(L!==0||y<b)&&p!==-1;p--,y++)L+=o*w[p]>>>0,w[p]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");b=y,x++}let T=v-b;for(;T!==v&&w[T]===0;)T++;return h>0?new Uint8Array([...new Uint8Array(h-w.length+T),...w.slice(T)]):w.slice(T)}return r(d,"decode"),{encode:a,decode:d}}r(_,"useBase");var{encode:Rr,decode:kr}=_(32);function Ir(e){return kr(e.toLocaleLowerCase().replaceAll("l","1").replaceAll("s","5").replaceAll("o","0").replaceAll("i","1"))}r(Ir,"decodeBase32");var{encode:$r,decode:Or}=_(16),{encode:Br,decode:_r}=_(58),{encode:jr,decode:Hr}=_(62);function zr(e,t){return Math.ceil(e*(Math.log(256)/Math.log(t)))}r(zr,"estimateSizeForBase");var Nr=r(e=>(e.length>0&&(/^[A-Z0-9_\-\ ]*$/g.test(e)&&(e=e.toLowerCase()),e=e.replace(/^[-_\ ]+/gi,"").replace(/[-_\ ]+$/gi,"").replace(/[-_\ ]+([a-z0-9])/gi,(t,n)=>n.toUpperCase()),e=e[0].toLowerCase()+e.substring(1)),e),"toCamelCase");function Zt(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}r(Zt,"toCapitalize");function Gr(e){return e.replace(/\w\S*/g,Zt)}r(Gr,"toCapitalizeWords");function Vr(e,t="-"){return t=typeof t>"u"?"_":t,e.replace(/([a-z\d])([A-Z])/g,`$1${t}$2`).replace(/([A-Z]+)([A-Z][a-z\d]+)/g,`$1${t}$2`).toLowerCase()}r(Vr,"fromCamelCase");var Kt=["1","true","yes","y","on"];function qr(e,t=!1){return e==null||typeof e!="string"?t:Kt.includes(String(e).trim().toLowerCase())}r(qr,"stringToBoolean");function Jr(e,t=0){return e==null||typeof e!="string"?t:parseInt(e.trim(),10)??t}r(Jr,"stringToInteger");function Wr(e,t=0){return e==null||typeof e!="string"?t:parseFloat(e.trim())??t}r(Wr,"stringToFloat");function Yt(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:Kt.includes(String(e).trim().toLowerCase())}r(Yt,"valueToBoolean");function Qt(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseInt(String(e).trim(),10)??t}r(Qt,"valueToInteger");function Xt(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseFloat(String(e).trim())??t}r(Xt,"valueToFloat");function De(e,t=""){return e==null?t:String(e)??t}r(De,"valueToString");var Zr=Xt,Kr=Qt,Yr=De,Qr=Yt;function en(e,t={}){let{trace:n=!0,pretty:o=!0}=t;return e.map(i=>{if(i&&typeof i=="object"){if(o&&(i instanceof Uint8Array||i instanceof ArrayBuffer))return`
3
+ ${et(i)}
4
4
  `;if(i instanceof Error)return n?`${i.name||"Error"}: ${i.message}
5
- ${i.stack}`:`${i.name||"Error"}: ${i.message}`;try{return o?JSON.stringify(i,null,2):JSON.stringify(i)}catch{}}return String(i)})}r(Qt,"formatMessages");function Qr(e,t={}){return Qt(e,t).join(" ")}r(Qr,"renderMessages");function Xr(e){try{return decodeURIComponent(escape(e))}catch{}return e}r(Xr,"fixBrokenUth8String");var De=864e5;function Se(e){return Math.floor(e/1e4)}r(Se,"dayYear");function it(e){return Math.floor(e/100%100)}r(it,"dayMonth");function Xt(e){return Math.floor(e%100)}r(Xt,"dayDay");function eo(e){return[Se(e),it(e),Xt(e)]}r(eo,"dayToParts");function st(e,t=!1){return t?new Date(`${tn(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}r(st,"dayToDate");function at(){return ae(new Date)}r(at,"dayFromToday");function to(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return ut(e);if(Array.isArray(e)&&e.length===3){let[n,o,i]=e;return Ee(n,o,i)}else if(e instanceof Date)return ae(e,t)}r(to,"dayFromAny");function no(e){return st(e,!0)}r(no,"dayToDateGMT");function ae(e,t=!1){return t?ut(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}r(ae,"dayFromDate");function ro(e){return ae(e,!0)}r(ro,"dayFromDateGMT");function Fe(e,t=!0){return st(e,t).getTime()}r(Fe,"dayToTimestamp");function en(e,t=!0){return ae(new Date(e),t)}r(en,"dayFromTimestamp");function tn(e,t="-"){let n=String(e);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}r(tn,"dayToString");function Ee(e,t=1,n=1){if(!(t<1||t>12||n<1||n>31))return e*1e4+t*100+n}r(Ee,"dayFromParts");function ut(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return+t}r(ut,"dayFromString");function oo(e,t=0){let n=Se(e),o=it(e);return t!==0&&(o+=t,n+=Math.floor((o-1)/12),o=Math.floor((o-1)%12)+1,o===0&&(o=12)),Ee(n,o,1)}r(oo,"dayMonthStart");function io(e,t=0){let n=Se(e);return Ee(n+t,1,1)}r(io,"dayYearStart");function se(e,t){return en(Fe(e)+t*864e5)}r(se,"dayOffset");function so(e,t){return Math.round((Fe(t)-Fe(e))/864e5)}r(so,"dayDiff");function ao(e,t){let n=[];for(t==null&&(t=at()),e<0&&(e=se(t,e+1));e<=t;)n.push(e),e=se(e,1);return n}r(ao,"dayRange");function*uo(e,t){let n=[];for(t==null&&(t=at()),e<0&&(e=se(t,e+1));e<=t;)yield e,e=se(e,1);return n}r(uo,"dayIterator");var nn=A("zeed:promise","error");function ct(){let e,t;return[new Promise((o,i)=>{e=o,t=i}),e,t]}r(ct,"createPromise");async function co(e){return new Promise(t=>setTimeout(t,e))}r(co,"sleep");async function lo(){return new Promise(e=>setTimeout(e,0))}r(lo,"immediate");var lt=Symbol("timeout");async function fo(e,t,n=lt){return new Promise(async(o,i)=>{let s=!1,u=setTimeout(()=>{s=!0,o(n)},t);try{let a=await e;clearTimeout(u),s||o(a)}catch(a){clearTimeout(u),s||i(a)}})}r(fo,"timeout");var ft=new Error("Timeout reached");function po(e){return e===lt||e===ft}r(po,"isTimeout");async function pt(e,t){return t<=0?await e:new Promise(async(n,o)=>{let i=!1,s=setTimeout(()=>{i=!0,o(ft)},t);try{let u=await e;clearTimeout(s),i||n(u)}catch(u){clearTimeout(s),i||o(u)}})}r(pt,"tryTimeout");function go(e,t,n=1e3){return new Promise((o,i)=>{let s=r(f=>{a&&(clearTimeout(a),u(),o(f))},"fn"),u=r(()=>{a=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):nn.warn("No remove listener method found for",e,t)},"done"),a=setTimeout(()=>{u(),i(new Error("Did not response in time"))},n);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):nn.warn("No listener method found for",e)})}r(go,"waitOn");function P(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}r(P,"isPromise");function I(e){return Promise.resolve(e)}r(I,"promisify");var C=class{get value(){return this.days}constructor(t){if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=C.from(t)?.days),t==null){let n=new Date;this.days=n.getFullYear()*1e4+(n.getMonth()+1)*100+n.getDate()}else this.days=t}static fromNumber(t){return new C(t)}static fromString(t){return C.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,n=!1){return n?C.fromString(t.toISOString().substr(0,10)):C.from(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return C.fromDate(t,!0)}static from(t,n=!1){if(typeof t=="number")return t<100?void 0:new C(t);if(typeof t=="string")return C.fromString(t);if(Array.isArray(t)&&t.length===3){let[o,i=1,s=1]=t;return i<1||i>12||s<1||s>31?void 0:new C(o*1e4+i*100+s)}else{if(t instanceof Date)return C.fromDate(t,n);if(t instanceof C)return t}}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let n=String(this.days);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}toDate(t=!1){return t?new Date(`${this.toString()}T00:00:00.000Z`):new Date(this.days/1e4,this.days/100%100-1,this.days%100)}toDateGMT(){return this.toDate(!0)}get year(){return Math.floor(this.days/1e4)}get month(){return Math.floor(this.days/100%100)}get day(){return Math.floor(this.days%100)}dayOffset(t){return C.fromDateGMT(new Date(this.toDateGMT().getTime()+t*864e5))}monthStart(){return C.from([this.year,this.month,1])}yearStart(){return C.from([this.year,1,1])}monthOffset(t){let n=this.month+t,o=Math.floor((n-1)%12)+1;o===0&&(o=12);let i=Math.floor((n-1)/12);return C.from([this.year+i,o,this.day])}daysUntil(t){return Math.round((new C(t)?.toDateGMT().getTime()-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};r(C,"Day");async function mo(e,t,n){let o=C.from(e),i=C.from(t);for(;o&&i&&o?.days<=i?.days;){let s=n(o);P(s)&&await s,o=o.dayOffset(1)}}r(mo,"forEachDay");function yo(){return new C}r(yo,"today");function ho(e){return new C(e)}r(ho,"day");function xo(e){return C.fromDate(new Date(e)).days}r(xo,"dateStringToDays");function rn(e,t=2){return+(+e).toFixed(t)}r(rn,"decimal");function bo(e,t=2){return+(+e/10**t).toFixed(t)}r(bo,"decimalFromCents");function wo(e,t=2){return Math.round(+e*10**t)}r(wo,"decimalToCents");function To(e,t=2){return t*(rn(e,t)%1)}r(To,"decimalCentsPart");function $(e){return e!=null&&typeof e=="object"}r($,"isObject");function Pe(e){return Object(e)!==e}r(Pe,"isPrimitive");function O(e){return Array.isArray(e)}r(O,"isArray");function ue(e){return $(e)&&!O(e)}r(ue,"isRecord");function Lo(e){return e?.constructor===Object}r(Lo,"isRecordPlain");function vo(e){return typeof e=="string"}r(vo,"isString");function Ao(e){return typeof e=="number"}r(Ao,"isNumber");function Co(e){return typeof e=="number"&&Number.isInteger(e)}r(Co,"isInteger");function Fo(e){return typeof e=="number"&&Number.isSafeInteger(e)}r(Fo,"isSafeInteger");function dt(e){return typeof e=="boolean"}r(dt,"isBoolean");function Do(e){return e==null}r(Do,"isNullOrUndefined");function So(e){return e==null}r(So,"isNull");function Eo(e){return $(e)&&e.constructor.name==="Uint8Array"}r(Eo,"isUint8Array");function Po(e){return e!=null}r(Po,"isNotNull");function Mo(e){return e!=null&&e!==!1&&e!==!0}r(Mo,"isValue");function on(e,t,n=new WeakSet){if(e===t)return!0;if(n.has(t)||(Pe(t)||n.add(t),!(e instanceof Object)||!(t instanceof Object))||e.constructor!==t.constructor||e.length!==t.length)return!1;for(let o in e){if(!e.hasOwnProperty(o))continue;if(!t.hasOwnProperty(o))return!1;let i=e[o],s=t[o];if(!on(i,s,n))return!1}for(let o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}r(on,"deepEqual");function sn(e,t=new WeakSet){if(t.has(e))return"[Circular ~]";if(Pe(e)||t.add(e),ue(e)){for(let n in e)if(!!e.hasOwnProperty(n)){if(e[n]===void 0){delete e[n];continue}sn(e[n],t)}}else if(O(e))for(let n=e.length-1;n>=0;n--)e[n]===void 0&&e.splice(n,1);return e}r(sn,"deepStripUndefinedInPlace");function ce(e,...t){for(let n of t)$(e)||(e={}),!(n==null||!$(n))&&Object.keys(n).forEach(o=>{let i=e[o],s=n[o];Array.isArray(i)&&Array.isArray(s)?e[o]=i.concat(s):$(i)&&$(s)?e[o]=ce(Object.assign({},i),s):e[o]=s});return e}r(ce,"deepMerge");var gt=r(e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),"escapeHTML"),Ro=r(e=>e.replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&apos;/gi,"'").replace(/&amp;/gi,"&"),"unescapeHTML");function Uo(e,t,n=[]){return e.filter(o=>!t.some(i=>!i(o))).map(o=>{for(let i of n)o=i(o);return o}).filter(o=>o!=null)}r(Uo,"listQuery");function ko(e,t){return e.reduce((n,o)=>{let i=String(o[t]);return(n[i]=n[i]||[]).push(o),n},{})}r(ko,"listGroupBy");function Io(e,t){return Array.from(e.reduce((n,o)=>n.add(o[t]),new Set))}r(Io,"listDistinctUnion");function $o(e,t){return e.map(n=>n[t])}r($o,"listOfKey");function Oo(e,t){return $(e)?Object.fromEntries(Object.entries(e).map(([n,o])=>{let i=t(n,o);return O(i)&&i.length===2?i:[n,i]}).filter(n=>n!=null)):{}}r(Oo,"objectMap");function Bo(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}r(Bo,"objectMergeDisposable");function jo(e){return Object.keys(e).length<=0}r(jo,"objectIsEmpty");var an=/[\u0000-\u001F\u0080-\u009F]/g,Ho=/^\.+/,zo=/\.+$/;function un(){return/[<>:"/\\|?*\u0000-\u001F]/g}r(un,"filenameReservedRegex");function _o(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}r(_o,"windowsReservedNameRegex");function No(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(un().test(t)&&an.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(un(),t).replace(an,t).replace(Ho,t).replace(zo,""),e=_o().test(e)?e+t:e,e.slice(0,100)}r(No,"toValidFilename");var Go=/[\\\-\[\]\/{}()*+?.^$|]/g;function mt(e){return e?e instanceof RegExp?e.source:e.replace(Go,"\\$&"):""}r(mt,"escapeRegExp");var Q=r(e=>Math.abs(e)%1===.5,"isHalf"),yt=r(e=>e%2===0,"isEven"),Vo=r(e=>Math.ceil(e),"roundUp"),qo=r(e=>Math.floor(e),"roundDown"),Jo=r(e=>Math.round(e),"roundHalfUp"),Wo=r(e=>{let t=Math.round(e);return Q(e)&&yt(t)?t-1:t},"roundHalfOdd"),Zo=r(e=>Q(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),Ko=r(e=>Q(e)?Math.floor(e):Math.round(e),"roundHalfDown"),Yo=r(e=>{let t=Math.round(e);return Q(e)?yt(t)?t:t-1:t},"roundHalfEven"),Qo=r(e=>Q(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");function ht(e){return e.reduce((t,n)=>Math.min(t,n.sort_weight||0),0)-1-F()}r(ht,"startSortWeight");function xt(e){return e.reduce((t,n)=>Math.max(t,n.sort_weight||0),0)+1+F()}r(xt,"endSortWeight");function Xo(e,t,n){let o=n.length,i=e<t;if(o<=0||e>=o-1)return xt(n);if(e<=0)return ht(n);n=cn([...n]);let s=i?-1:0,u=n[e+s].sort_weight||0,f=(n[e+s+1].sort_weight||0)-u;if(f===0)return i?ht(n):xt(n);let g=u+f/2,h=f*.01*(F()-.5);return g+h}r(Xo,"moveSortWeight");function cn(e){return e.sort((t,n)=>(t.sort_weight||0)-(n.sort_weight||0)),e}r(cn,"sortedItems");function ei(e={}){let{getter:t=r(a=>a.sort,"getter")}=e;function n(a){return a.sort((f,g)=>(t(f)||0)-(t(g)||0)),a}r(n,"items");function o(a){return a.reduce((f,g)=>Math.min(f,t(g)||0),0)-1-F()}r(o,"start");function i(a){return a.reduce((f,g)=>Math.max(f,t(g)||0),0)+1+F()}r(i,"end");function s(a,f){a==null&&(a=(f??0)-1),f==null&&(f=(a??0)+1);let g=f-a,h=a+g/2,x=g*.01*(F()-.5);return h+x}r(s,"between");function u(a,f,g){let h=g.length,x=a<f;if(h<=0||a>=h-1)return i(g);if(a<=0)return o(g);g=n([...g]);let b=x?-1:0,v=t(g[a+b])||0,T=(t(g[a+b+1])||0)-v;if(T===0)return x?o(g):i(g);let L=v+T/2,y=T*.01*(F()-.5);return L+y}return r(u,"move"),{start:o,end:i,between:s,move:u,items:n}}r(ei,"useSorted");var ti=/((?:(?:(?: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 ni(e){return e.split(ti).map((t,n)=>{let o=gt(t);return n%2?`<a target="_blank" href="${o}">${ln(o)}</a>`:o}).join("")}r(ni,"linkifyPlainText");function ln(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}r(ln,"toHumanReadableUrl");function bt(e){let t=[];for(let[n,o]of Object.entries(e))if(o!=null){Array.isArray(o)||(o=[o]);for(let i of o)i!=null&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`)}return t.join("&")}r(bt,"encodeQuery");function ri(e){let t={},n=(e[0]==="?"?e.substr(1):e).split("&");for(let o=0;o<n.length;o++){let i=n[o].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}r(ri,"parseQuery");function oi(e,t,n){let o=e[t];return o===void 0&&(o=n(t,e),e[t]=o),o}r(oi,"ensureKey");async function ii(e,t,n){let o=e[t];return o===void 0&&(o=await n(t,e),e[t]=o),o}r(ii,"ensureKeyAsync");function si(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}r(si,"size");function ai(e){return e!=null&&e.length>0?e[e.length-1]:void 0}r(ai,"last");function ui(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:e?.size!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.warn("Failed to check if empty for",e,t)}return!0}r(ui,"empty");function Me(e){return Object(e)!==e?e:JSON.parse(S(e))}r(Me,"cloneObject");function ci(e){return Object(e)!==e?e:JSON.parse(S(e))}r(ci,"cloneJsonObject");function li(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let o=e(n);return t.set(n,o),o}}r(li,"memoize");function fi(e){let t=new Map;return async(...n)=>{let o=S(n);if(t.has(o))return t.get(o);let i=await e(...n);return t.set(o,i),i}}r(fi,"memoizeAsync");function pi(e,t){let n=[];for(let o=0;o<e;o++)n.push(t(o,e));return n}r(pi,"forTimes");var di=/\\\s|\s+|#[^\n]*\n?/gm,gi=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,fn=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm,mi=A("zeed:xrx","error");function pn(e){return typeof e=="string"?e:e.source||""}r(pn,"regExpString");function yi(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}r(yi,"regExpEscape");var Re=class{constructor(t,n){this.namedGroups={};this.names=[];let o=n??"",i;if(t instanceof RegExp?(n==null&&(o=t.flags),i=t.source):i=t,o&&o.includes("x")&&(o=o.replace("x",""),i=i.replace(di,a=>a[0]==="\\"?a:"")),!(t instanceof RegExp)){let a=0;i=i.replace(gi,(f,g)=>(a+=1,g?(g!=="index"&&g!=="length"&&!this.namedGroups[g]?this.namedGroups[g]=a:mi.error(`Unallowed or duplicate group name: ${g}`),"("):f)),this.names=Object.keys(this.namedGroups)}i=pn(i),fn.lastIndex=0;let u=fn.exec(i);u&&(this.lookBehind={rx:new RegExp(`${u[3]}$(?!\\s)`),expect:u?u[2]==="=":!u},i=i.substr(u[0].length)),this.rx=new RegExp(i,o)}get lastIndex(){return this.rx.lastIndex}set lastIndex(t){this.rx.lastIndex=t}_handleMatch(t){if(this.lookBehind){let n=t.input.slice(0,t.index);if(this.lookBehind.expect!==this.lookBehind.rx.test(n))return null}for(let n of this.names)t[n]=t[this.namedGroups[n]];return t}exec(t){let n;for(;n=this.rx.exec(t);)if(this.rx.lastIndex===n.index&&this.rx.lastIndex++,n=this._handleMatch(n),n!=null)return n}execAll(t){let n=[],o;for(this.rx.lastIndex=0;o=this.exec(t);)n.push(o);return this.rx.lastIndex=0,n}replace(t,n){let o=typeof n=="function"?n:()=>n;return t.replace(this.rx,i=>o(i))}};r(Re,"XRX");var hi=",";function xi(e,t={}){let{separator:n=hi}=t,o="";for(let i=0;i<e.length;i++)o+=`${e[i].map(s=>{if(s==null||s==="")return"";if(dt(s))return s?1:0;let u=String(s);return(ue(s)||O(s))&&(u=S(s)),u.includes('"')||u.includes(`
5
+ ${i.stack}`:`${i.name||"Error"}: ${i.message}`;try{return o?JSON.stringify(i,null,2):JSON.stringify(i)}catch{}}return String(i)})}r(en,"formatMessages");function Xr(e,t={}){return en(e,t).join(" ")}r(Xr,"renderMessages");function eo(e){try{return decodeURIComponent(escape(e))}catch{}return e}r(eo,"fixBrokenUth8String");var Ee=864e5;function Se(e){return Math.floor(e/1e4)}r(Se,"dayYear");function at(e){return Math.floor(e/100%100)}r(at,"dayMonth");function tn(e){return Math.floor(e%100)}r(tn,"dayDay");function to(e){return[Se(e),at(e),tn(e)]}r(to,"dayToParts");function ut(e,t=!1){return t?new Date(`${rn(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}r(ut,"dayToDate");function ct(){return ue(new Date)}r(ct,"dayFromToday");function no(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return lt(e);if(Array.isArray(e)&&e.length===3){let[n,o,i]=e;return Ue(n,o,i)}else if(e instanceof Date)return ue(e,t)}r(no,"dayFromAny");function ro(e){return ut(e,!0)}r(ro,"dayToDateGMT");function ue(e,t=!1){return t?lt(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}r(ue,"dayFromDate");function oo(e){return ue(e,!0)}r(oo,"dayFromDateGMT");function Pe(e,t=!0){return ut(e,t).getTime()}r(Pe,"dayToTimestamp");function nn(e,t=!0){return ue(new Date(e),t)}r(nn,"dayFromTimestamp");function rn(e,t="-"){let n=String(e);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}r(rn,"dayToString");function Ue(e,t=1,n=1){if(!(t<1||t>12||n<1||n>31))return e*1e4+t*100+n}r(Ue,"dayFromParts");function lt(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return+t}r(lt,"dayFromString");function io(e,t=0){let n=Se(e),o=at(e);return t!==0&&(o+=t,n+=Math.floor((o-1)/12),o=Math.floor((o-1)%12)+1,o===0&&(o=12)),Ue(n,o,1)}r(io,"dayMonthStart");function so(e,t=0){let n=Se(e);return Ue(n+t,1,1)}r(so,"dayYearStart");function ae(e,t){return nn(Pe(e)+t*864e5)}r(ae,"dayOffset");function ao(e,t){return Math.round((Pe(t)-Pe(e))/864e5)}r(ao,"dayDiff");function uo(e,t){let n=[];for(t==null&&(t=ct()),e<0&&(e=ae(t,e+1));e<=t;)n.push(e),e=ae(e,1);return n}r(uo,"dayRange");function*co(e,t){let n=[];for(t==null&&(t=ct()),e<0&&(e=ae(t,e+1));e<=t;)yield e,e=ae(e,1);return n}r(co,"dayIterator");var on=C("zeed:promise","error");function ft(){let e,t;return[new Promise((o,i)=>{e=o,t=i}),e,t]}r(ft,"createPromise");async function lo(e){return new Promise(t=>setTimeout(t,e))}r(lo,"sleep");async function fo(){return new Promise(e=>setTimeout(e,0))}r(fo,"immediate");var dt=Symbol("timeout");async function po(e,t,n=dt){return new Promise(async(o,i)=>{let s=!1,u=setTimeout(()=>{s=!0,o(n)},t);try{let a=await e;clearTimeout(u),s||o(a)}catch(a){clearTimeout(u),s||i(a)}})}r(po,"timeout");var pt=new Error("Timeout reached");function go(e){return e===dt||e===pt}r(go,"isTimeout");async function gt(e,t){return t<=0?await e:new Promise(async(n,o)=>{let i=!1,s=setTimeout(()=>{i=!0,o(pt)},t);try{let u=await e;clearTimeout(s),i||n(u)}catch(u){clearTimeout(s),i||o(u)}})}r(gt,"tryTimeout");function mo(e,t,n=1e3){return new Promise((o,i)=>{let s=r(d=>{a&&(clearTimeout(a),u(),o(d))},"fn"),u=r(()=>{a=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):on.warn("No remove listener method found for",e,t)},"done"),a=setTimeout(()=>{u(),i(new Error("Did not response in time"))},n);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):on.warn("No listener method found for",e)})}r(mo,"waitOn");function U(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}r(U,"isPromise");function I(e){return Promise.resolve(e)}r(I,"promisify");var A=class{get value(){return this.days}constructor(t){if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=A.from(t)?.days),t==null){let n=new Date;this.days=n.getFullYear()*1e4+(n.getMonth()+1)*100+n.getDate()}else this.days=t}static fromNumber(t){return new A(t)}static fromString(t){return A.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,n=!1){return n?A.fromString(t.toISOString().substr(0,10)):A.from(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return A.fromDate(t,!0)}static from(t,n=!1){if(typeof t=="number")return t<100?void 0:new A(t);if(typeof t=="string")return A.fromString(t);if(Array.isArray(t)&&t.length===3){let[o,i=1,s=1]=t;return i<1||i>12||s<1||s>31?void 0:new A(o*1e4+i*100+s)}else{if(t instanceof Date)return A.fromDate(t,n);if(t instanceof A)return t}}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let n=String(this.days);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}toDate(t=!1){return t?new Date(`${this.toString()}T00:00:00.000Z`):new Date(this.days/1e4,this.days/100%100-1,this.days%100)}toDateGMT(){return this.toDate(!0)}get year(){return Math.floor(this.days/1e4)}get month(){return Math.floor(this.days/100%100)}get day(){return Math.floor(this.days%100)}dayOffset(t){return A.fromDateGMT(new Date(this.toDateGMT().getTime()+t*864e5))}monthStart(){return A.from([this.year,this.month,1])}yearStart(){return A.from([this.year,1,1])}monthOffset(t){let n=this.month+t,o=Math.floor((n-1)%12)+1;o===0&&(o=12);let i=Math.floor((n-1)/12);return A.from([this.year+i,o,this.day])}daysUntil(t){return Math.round((new A(t)?.toDateGMT().getTime()-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};r(A,"Day");async function yo(e,t,n){let o=A.from(e),i=A.from(t);for(;o&&i&&o?.days<=i?.days;){let s=n(o);U(s)&&await s,o=o.dayOffset(1)}}r(yo,"forEachDay");function ho(){return new A}r(ho,"today");function xo(e){return new A(e)}r(xo,"day");function bo(e){return A.fromDate(new Date(e)).days}r(bo,"dateStringToDays");function sn(e,t=2){return+(+e).toFixed(t)}r(sn,"decimal");function wo(e,t=2){return+(+e/10**t).toFixed(t)}r(wo,"decimalFromCents");function To(e,t=2){return Math.round(+e*10**t)}r(To,"decimalToCents");function Lo(e,t=2){return t*(sn(e,t)%1)}r(Lo,"decimalCentsPart");function $(e){return e!=null&&typeof e=="object"}r($,"isObject");function Me(e){return Object(e)!==e}r(Me,"isPrimitive");function O(e){return Array.isArray(e)}r(O,"isArray");function ce(e){return $(e)&&!O(e)}r(ce,"isRecord");function vo(e){return e?.constructor===Object}r(vo,"isRecordPlain");function Co(e){return typeof e=="string"}r(Co,"isString");function Ao(e){return typeof e=="number"}r(Ao,"isNumber");function Fo(e){return typeof e=="number"&&Number.isInteger(e)}r(Fo,"isInteger");function Do(e){return typeof e=="number"&&Number.isSafeInteger(e)}r(Do,"isSafeInteger");function mt(e){return typeof e=="boolean"}r(mt,"isBoolean");function Po(e){return e==null}r(Po,"isNullOrUndefined");function Eo(e){return e==null}r(Eo,"isNull");function So(e){return $(e)&&e.constructor.name==="Uint8Array"}r(So,"isUint8Array");function Uo(e){return e!=null}r(Uo,"isNotNull");function Mo(e){return e!=null&&e!==!1&&e!==!0}r(Mo,"isValue");function an(e,t,n=new WeakSet){if(e===t)return!0;if(n.has(t)||(Me(t)||n.add(t),!(e instanceof Object)||!(t instanceof Object))||e.constructor!==t.constructor||e.length!==t.length)return!1;for(let o in e){if(!e.hasOwnProperty(o))continue;if(!t.hasOwnProperty(o))return!1;let i=e[o],s=t[o];if(!an(i,s,n))return!1}for(let o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}r(an,"deepEqual");function un(e,t=new WeakSet){if(t.has(e))return"[Circular ~]";if(Me(e)||t.add(e),ce(e)){for(let n in e)if(!!e.hasOwnProperty(n)){if(e[n]===void 0){delete e[n];continue}un(e[n],t)}}else if(O(e))for(let n=e.length-1;n>=0;n--)e[n]===void 0&&e.splice(n,1);return e}r(un,"deepStripUndefinedInPlace");function le(e,...t){for(let n of t)$(e)||(e={}),!(n==null||!$(n))&&Object.keys(n).forEach(o=>{let i=e[o],s=n[o];Array.isArray(i)&&Array.isArray(s)?e[o]=i.concat(s):$(i)&&$(s)?e[o]=le(Object.assign({},i),s):e[o]=s});return e}r(le,"deepMerge");var yt=r(e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),"escapeHTML"),Ro=r(e=>e.replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&apos;/gi,"'").replace(/&amp;/gi,"&"),"unescapeHTML");function ko(e,t,n=[]){return e.filter(o=>!t.some(i=>!i(o))).map(o=>{for(let i of n)o=i(o);return o}).filter(o=>o!=null)}r(ko,"listQuery");function Io(e,t){return e.reduce((n,o)=>{let i=String(o[t]);return(n[i]=n[i]||[]).push(o),n},{})}r(Io,"listGroupBy");function $o(e,t){return Array.from(e.reduce((n,o)=>n.add(o[t]),new Set))}r($o,"listDistinctUnion");function Oo(e,t){return e.map(n=>n[t])}r(Oo,"listOfKey");function Bo(e,t){return $(e)?Object.fromEntries(Object.entries(e).map(([n,o])=>{let i=t(n,o);return O(i)&&i.length===2?i:[n,i]}).filter(n=>n!=null)):{}}r(Bo,"objectMap");function _o(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}r(_o,"objectMergeDisposable");function jo(e){return Object.keys(e).length<=0}r(jo,"objectIsEmpty");var cn=/[\u0000-\u001F\u0080-\u009F]/g,Ho=/^\.+/,zo=/\.+$/;function ln(){return/[<>:"/\\|?*\u0000-\u001F]/g}r(ln,"filenameReservedRegex");function No(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}r(No,"windowsReservedNameRegex");function Go(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(ln().test(t)&&cn.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(ln(),t).replace(cn,t).replace(Ho,t).replace(zo,""),e=No().test(e)?e+t:e,e.slice(0,100)}r(Go,"toValidFilename");var Vo=/[\\\-\[\]\/{}()*+?.^$|]/g;function ht(e){return e?e instanceof RegExp?e.source:e.replace(Vo,"\\$&"):""}r(ht,"escapeRegExp");var Q=r(e=>Math.abs(e)%1===.5,"isHalf"),xt=r(e=>e%2===0,"isEven"),qo=r(e=>Math.ceil(e),"roundUp"),Jo=r(e=>Math.floor(e),"roundDown"),Wo=r(e=>Math.round(e),"roundHalfUp"),Zo=r(e=>{let t=Math.round(e);return Q(e)&&xt(t)?t-1:t},"roundHalfOdd"),Ko=r(e=>Q(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),Yo=r(e=>Q(e)?Math.floor(e):Math.round(e),"roundHalfDown"),Qo=r(e=>{let t=Math.round(e);return Q(e)?xt(t)?t:t-1:t},"roundHalfEven"),Xo=r(e=>Q(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");function bt(e){return e.reduce((t,n)=>Math.min(t,n.sort_weight||0),0)-1-F()}r(bt,"startSortWeight");function wt(e){return e.reduce((t,n)=>Math.max(t,n.sort_weight||0),0)+1+F()}r(wt,"endSortWeight");function ei(e,t,n){let o=n.length,i=e<t;if(o<=0||e>=o-1)return wt(n);if(e<=0)return bt(n);n=fn([...n]);let s=i?-1:0,u=n[e+s].sort_weight||0,d=(n[e+s+1].sort_weight||0)-u;if(d===0)return i?bt(n):wt(n);let g=u+d/2,h=d*.01*(F()-.5);return g+h}r(ei,"moveSortWeight");function fn(e){return e.sort((t,n)=>(t.sort_weight||0)-(n.sort_weight||0)),e}r(fn,"sortedItems");function ti(e={}){let{getter:t=r(a=>a.sort,"getter")}=e;function n(a){return a.sort((d,g)=>(t(d)||0)-(t(g)||0)),a}r(n,"items");function o(a){return a.reduce((d,g)=>Math.min(d,t(g)||0),0)-1-F()}r(o,"start");function i(a){return a.reduce((d,g)=>Math.max(d,t(g)||0),0)+1+F()}r(i,"end");function s(a,d){a==null&&(a=(d??0)-1),d==null&&(d=(a??0)+1);let g=d-a,h=a+g/2,x=g*.01*(F()-.5);return h+x}r(s,"between");function u(a,d,g){let h=g.length,x=a<d;if(h<=0||a>=h-1)return i(g);if(a<=0)return o(g);g=n([...g]);let b=x?-1:0,v=t(g[a+b])||0,T=(t(g[a+b+1])||0)-v;if(T===0)return x?o(g):i(g);let L=v+T/2,y=T*.01*(F()-.5);return L+y}return r(u,"move"),{start:o,end:i,between:s,move:u,items:n}}r(ti,"useSorted");var ni=/((?:(?:(?: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 ri(e){return e.split(ni).map((t,n)=>{let o=yt(t);return n%2?`<a target="_blank" href="${o}">${dn(o)}</a>`:o}).join("")}r(ri,"linkifyPlainText");function dn(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}r(dn,"toHumanReadableUrl");function Tt(e){let t=[];for(let[n,o]of Object.entries(e))if(o!=null){Array.isArray(o)||(o=[o]);for(let i of o)i!=null&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`)}return t.join("&")}r(Tt,"encodeQuery");function oi(e){let t={},n=(e[0]==="?"?e.substr(1):e).split("&");for(let o=0;o<n.length;o++){let i=n[o].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}r(oi,"parseQuery");function ii(e,t,n){let o=e[t];return o===void 0&&(o=n(t,e),e[t]=o),o}r(ii,"ensureKey");async function si(e,t,n){let o=e[t];return o===void 0&&(o=await n(t,e),e[t]=o),o}r(si,"ensureKeyAsync");function ai(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}r(ai,"size");function ui(e){return e!=null&&e.length>0?e[e.length-1]:void 0}r(ui,"last");function ci(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:e?.size!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.warn("Failed to check if empty for",e,t)}return!0}r(ci,"empty");function Re(e){return Object(e)!==e?e:JSON.parse(E(e))}r(Re,"cloneObject");function li(e){return Object(e)!==e?e:JSON.parse(E(e))}r(li,"cloneJsonObject");function fi(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let o=e(n);return t.set(n,o),o}}r(fi,"memoize");function di(e){let t=new Map;return async(...n)=>{let o=E(n);if(t.has(o))return t.get(o);let i=await e(...n);return t.set(o,i),i}}r(di,"memoizeAsync");function pi(e,t){let n=[];for(let o=0;o<e;o++)n.push(t(o,e));return n}r(pi,"forTimes");var gi=/\\\s|\s+|#[^\n]*\n?/gm,mi=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,pn=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm,yi=C("zeed:xrx","error");function gn(e){return typeof e=="string"?e:e.source||""}r(gn,"regExpString");function hi(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}r(hi,"regExpEscape");var ke=class{constructor(t,n){this.namedGroups={};this.names=[];let o=n??"",i;if(t instanceof RegExp?(n==null&&(o=t.flags),i=t.source):i=t,o&&o.includes("x")&&(o=o.replace("x",""),i=i.replace(gi,a=>a[0]==="\\"?a:"")),!(t instanceof RegExp)){let a=0;i=i.replace(mi,(d,g)=>(a+=1,g?(g!=="index"&&g!=="length"&&!this.namedGroups[g]?this.namedGroups[g]=a:yi.error(`Unallowed or duplicate group name: ${g}`),"("):d)),this.names=Object.keys(this.namedGroups)}i=gn(i),pn.lastIndex=0;let u=pn.exec(i);u&&(this.lookBehind={rx:new RegExp(`${u[3]}$(?!\\s)`),expect:u?u[2]==="=":!u},i=i.substr(u[0].length)),this.rx=new RegExp(i,o)}get lastIndex(){return this.rx.lastIndex}set lastIndex(t){this.rx.lastIndex=t}_handleMatch(t){if(this.lookBehind){let n=t.input.slice(0,t.index);if(this.lookBehind.expect!==this.lookBehind.rx.test(n))return null}for(let n of this.names)t[n]=t[this.namedGroups[n]];return t}exec(t){let n;for(;n=this.rx.exec(t);)if(this.rx.lastIndex===n.index&&this.rx.lastIndex++,n=this._handleMatch(n),n!=null)return n}execAll(t){let n=[],o;for(this.rx.lastIndex=0;o=this.exec(t);)n.push(o);return this.rx.lastIndex=0,n}replace(t,n){let o=typeof n=="function"?n:()=>n;return t.replace(this.rx,i=>o(i))}};r(ke,"XRX");var xi=",";function bi(e,t={}){let{separator:n=xi}=t,o="";for(let i=0;i<e.length;i++)o+=`${e[i].map(s=>{if(s==null||s==="")return"";if(mt(s))return s?1:0;let u=String(s);return(ce(s)||O(s))&&(u=E(s)),u.includes('"')||u.includes(`
6
6
  `)||u.includes(n)?`"${u.replace(/"/g,'""')}"`:u}).join(n)}
7
- `;return o}r(xi,"csvStringify");function dn(e,t={}){let n=/("((?:(?:[^"]*?)(?:"")?)*)"|([^,;\t\n]*))([,;\t]|\n|\r\n)/g;t.separator&&(n=new RegExp(n.source.replaceAll(",;\\t",mt(t.separator)),n.flags));let o=[],i=[],s,u=`${e.replaceAll(`\r
7
+ `;return o}r(bi,"csvStringify");function mn(e,t={}){let n=/("((?:(?:[^"]*?)(?:"")?)*)"|([^,;\t\n]*))([,;\t]|\n|\r\n)/g;t.separator&&(n=new RegExp(n.source.replaceAll(",;\\t",ht(t.separator)),n.flags));let o=[],i=[],s,u=`${e.replaceAll(`\r
8
8
  `,`
9
9
  `).trim()}
10
10
  `;for(;s=n.exec(u);){let a=s[2]??s[3]??"";a=a.replaceAll('""','"'),i.push(a),s[4]===`
11
- `&&(o.push(i),i=[])}return o}r(dn,"csvParse");function bi(e,t={}){let n=dn(e,t),o=n[0];return n.slice(1).map(i=>Object.fromEntries(i.map((s,u)=>[o[u],s])))}r(bi,"csvParseToObjects");var wi=A("zeed:dispose","error");async function Ti(e){typeof e=="function"?await I(e()):P(e)?await e:typeof e.dispose=="function"?await I(e.dispose()):P(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await I(e.cleanup()):P(e.cleanup)&&await e.cleanup}r(Ti,"callDisposer");function Ue(e){let{name:t}=typeof e=="string"?{name:e}:e??{},n=[],o=r(async u=>{u!=null&&n.includes(u)&&(Ae(n,a=>a!==u),await Ti(u))},"untrack"),i=r(async()=>{for(t&&wi.debug(`dispose ${t}: ${n.length} entries`);n.length>0;)await o(n[0])},"dispose"),s=r(u=>{if(u!=null)return n.unshift(u),()=>o(u)},"track");return Object.assign(i,{track:s,add:s,untrack:o,dispose:i,exec:i,getSize(){return n.length}})}r(Ue,"useDispose");var Li=Ue;function vi(e={}){let{mode:t="fifo"}=e,n=[],o=r(async(s=!1)=>{for(;n.length>0;){let u=n[0];if(Ae(n,a=>a!==u),typeof u=="function"){let a=u();if(P(a)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await a}}else if(P(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(o,{add:r(s=>{t==="lifo"?n.unshift(s):n.push(s)},"add"),exec:o,getSize(){return n.length}})}r(vi,"useDefer");function Ai(e,t=0){let n=setTimeout(e,t);return()=>{n&&(clearTimeout(n),n=void 0)}}r(Ai,"useTimeout");function Ci(e,t){let n=setInterval(e,t);return()=>{n&&(clearInterval(n),n=void 0)}}r(Ci,"useInterval");function Fi(e,t,n,...o){return e==null?()=>{}:(e.on?e.on(t,n,...o):e.addEventListener&&e.addEventListener(t,n,...o),()=>{e.off?e.off(t,n,...o):e.removeEventListener&&e.removeEventListener(t,n,...o)})}r(Fi,"useEventListener");function Di(){let e=!0;return(t,n)=>{let o=!1;if(e){e=!1;try{t(),o=!0}finally{e=!0}}else n!==void 0&&n();return o}}r(Di,"useMutex");function Si(){let e=!0;return async(t,n)=>{let o=!1;if(e){e=!1;try{let i=t();P(i)&&await i,o=!0}finally{e=!0}}else if(n!==void 0){let i=n();P(i)&&await i}return o}}r(Si,"useAsyncMutex");var X=A("zeed:emitter","error"),M=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.dispose=Ue();this.call=new Proxy({},{get:(t,n)=>async(...o)=>await this.emit(n,...o)})}async emit(t,...n){let o=!1;this.dispose.add(()=>{this.subscribers={},this.subscribersOnAny=[]});try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...n)),i.length>0){let s=i.map(u=>{try{return I(u(...n))}catch(a){X.warn("emit warning:",a)}return null}).filter(u=>u!=null);o=!0,await Promise.all(s)}}catch(i){X.error("emit exception",i)}return o}onAny(t){this.subscribersOnAny.push(t)}on(t,n){let o=this.subscribers[t]||[];return o.push(n),this.subscribers[t]=o,()=>{this.off(t,n)}}onCall(t){for(let[n,o]of Object.entries(t))this.on(n,o)}once(t,n){let o=r(async(...i)=>(this.off(t,o),await I(n(...i))),"onceListener");return this.on(t,o),()=>{this.off(t,n)}}off(t,n){return this.subscribers[t]=(this.subscribers[t]||[]).filter(o=>n&&o!==n),this}removeAllListeners(){return this.subscribers={},this}};r(M,"Emitter");function Ei(){let e=K().emitter;return e||(e=new M,K().emitter=e),e}r(Ei,"getGlobalEmitter");var Pi=new M;function Mi(e,t){let n=Math.round(F()*100),o=[],i,s=r((a,f)=>{let g={key:a,obj:f};o.push(g),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):X.error(n,"Cannot listen to key"):e.onAny?e.onAny((a,f)=>{s(a,f)}):X.error(n,"cannot listen to all for",e),r((a,f=!0)=>new Promise((g,h)=>{a||(a=t,a||o.length&&(a=o[0].key)),i=r(()=>{for(;o.length>0;){let x=o.shift();if(x.key===a)i=void 0,g(x.obj);else{if(f){X.warn(n,`Unhandled event ${a} with value: ${x.obj}`);continue}h(new Error(`Expected ${a}, but found ${x.key} with value=${x.obj}`)),X.error(n,`Unhandled event ${a} with value: ${x.obj}`)}break}},"lazyResolve"),i()}),"on")}r(Mi,"lazyListener");var ee=r(()=>Date.now(),"getTimestamp");function wt(e){return e>999?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}r(wt,"formatMilliseconds");function Ri(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let n=null;if(t.includes(":"))try{n=new Date(t)}catch{}if(!(n instanceof Date)){let o=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);o&&(n=new Date(+o[1],+o[2]-1,+o[3],12,0))}if(n instanceof Date)return n}}}r(Ri,"parseDate");var{encode:gn,decode:Ui}=j(62),{encode:mn,decode:ki}=j(32),ke=16;function Ie(){return J(ke)}r(Ie,"uuidBytes");function yn(e=Ie()){return gn(e,22)}r(yn,"uuidB62");function hn(e){return gn(e,22)}r(hn,"uuidEncodeB62");function xn(e){return Ui(e,ke)}r(xn,"uuidDecodeB62");function bn(e=Ie()){return mn(e,26)}r(bn,"uuidB32");function wn(e){return mn(e,26)}r(wn,"uuidEncodeB32");function Tn(e){return ki(e,ke)}r(Tn,"uuidDecodeB32");var Ii="10000000-1000-4000-8000-100000000000",Ln=typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID.bind(crypto):()=>Ii.replace(/[018]/g,e=>(e^J(1)[0]&15>>e/4).toString(16));function vn(e){let t=We(e);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}r(vn,"uuidEncodeV4");function An(e){return Ze(e.replaceAll("-",""))}r(An,"uuidDecodeV4");var Cn=16e11;function $i(e){let t=new Uint8Array([0,0,0,0,0,0]),n=t.length-1;for(let o=0;o<t.length;o++){let i=e&255;t[n-o]=i,e=(e-i)/256}return t}r($i,"longToByteArray");function Lt(){let e=ee()-Cn;return new Uint8Array([...$i(e),...J(10)])}r(Lt,"suidBytes");function Oi(){return Sn(Lt())}r(Oi,"suid");function Bi(e){return Fn(At(e))}r(Bi,"suidDate");function Fn(e){return new Date(Cn+e.slice(0,6).reduce((t,n)=>t*256+n,0))}r(Fn,"suidBytesDate");var ji=r(()=>new Uint32Array(J(4))[0],"uuid32bit"),vt={base62:{uuid:yn,uuidDecode:xn,uuidEncode:hn},base32:{uuid:bn,uuidDecode:Tn,uuidEncode:wn},uuidv4:{uuid:Ln,uuidDecode:An,uuidEncode:vn}},$e="base62",Dn=!1;function Hi(e,t=!1){$e=e,Dn=t}r(Hi,"setUuidDefaultEncoding");function H(){return vt[$e].uuid(Dn?Lt():Ie())}r(H,"uuid");function At(e){return vt[$e].uuidDecode(e)}r(At,"uuidDecode");function Sn(e){return vt[$e].uuidEncode(e)}r(Sn,"uuidEncode");function zi(e){try{return At(e).length===ke}catch{}return!1}r(zi,"uuidIsValid");var Tt={};function z(e="id"){return Tt[e]==null&&(Tt[e]=0),`${e}-${Tt[e]++}`}r(z,"uname");var _i=0;function Ni(){return`id-${_i++}`}r(Ni,"qid");var En=(o=>(o[o.waiting=0]="waiting",o[o.running=1]="running",o[o.finished=2]="finished",o))(En||{}),Pn=(o=>(o[o.replace=0]="replace",o[o.memoize=1]="memoize",o[o.error=2]="error",o))(Pn||{});function Gi(e={}){let{maxParallel:t=3}=e,n=new M,o=0,i=0,s=0,u=0,a={};async function f(){if(o>0){let[T,L]=ct();return n.once("didFinish",L),T}}r(f,"waitFinishAll");function g(){n.emit("didFinish"),o=0,i=0}r(g,"didFinish");function h(){let T=0,L=0;for(let{max:y,resolved:p,state:c}of Object.values(a))T+=y,L+=c===2?y:Math.min(y,p);n.emit("didUpdate",o,i,T,L)}r(h,"didUpdate");function x(){if(h(),o>0&&o===i&&g(),s>=t)return;let T=Object.values(a).filter(L=>L.state===0);if(T.length>0){let L;for(let y of T)y.group!=null&&Object.values(a).some(p=>p.state===1&&p.id!==y.id&&p.group===y.group)||(L==null||y.priority<L.priority)&&(L=y);if(L!=null){let y=L.id,p=L.done;L.state=1,++s,n.emit("didStart",y);let c=r(l=>{L&&(L.result=l,L.state=2,L.resolved=L.max),--s,++i,x()},"taskFinished");L.task(L).then(l=>{p(l),n.emit("didResolve",y,l),c(l)}).catch(l=>{p(),n.emit("didReject",y,l),c()})}}}r(x,"performNext");function b(T){let L=a[T];L&&L.state===0&&(a[T].state=2,++i,n.emit("didCancel",T),h())}r(b,"cancel");function v(){Object.keys(a).forEach(b)}r(v,"cancelAll");function w(T,L={}){let y,p=new Promise(l=>y=l),c=L.id??H();if(a[c]!=null){let l=L.idConflictResolution??1;if(l===0)b(c);else if(l===1){let d=a[c];return{id:c,promise:(async()=>{if(d.state===2)return a[c].result})(),dispose:()=>b(c),cancel:()=>b(c)}}else throw new Error(`Pool task with id=${c} already exists!`)}return a[c]={id:c,task:T,priority:++u,group:L.group,state:0,max:L.max??1,resolved:L.resolved??0,done:y,payload:L.payload,setMax(l){a[c].max=l,h()},setResolved(l){a[c].resolved=l,h()},incResolved(l=1){a[c].resolved+=l,h()}},++o,x(),{id:c,promise:p,dispose:()=>b(c),cancel:()=>b(c)}}return r(w,"enqueue"),{events:n,cancel:b,cancelAll:v,enqueue:w,dispose:v,waitFinishAll:f}}r(Gi,"usePool");var Oe=class extends M{constructor(n={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:o=z("queue"),logLevel:i}=n;this.name=o,this.log=A(`zeed:queue:${o}`,i??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.paused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.paused;){let n=this.queue.shift();if(this.log(`performNext => ${n?.name}`),n==null)break;this.countResolved===0&&this.emit("didStart",this.countMax);let{name:o,task:i,resolve:s}=n;this.currentTask=i();let u;try{this.log.info(`start task ${o}`),u=await this.currentTask,this.log(`finished task ${o} with result =`,u)}catch(a){this.log.warn("Error performing task",a)}s(u),this.currentTask=void 0,this.countResolved+=1,this.emit("didUpdate",this.countMax,this.countResolved)}for(this.queue.length===0&&(this.emit("didFinish"),this.countMax=0,this.countResolved=0);this.waitToFinish.length>0;)this.waitToFinish.shift()()}async enqueue(n,o={}){let{immediate:i=!1,name:s=z(this.name)}=o;return i?(this.log.info(`immediate execution ${s}`),await n()):(this.log(`enqueue ${s}`),new Promise(u=>{this.queue.push({name:s,task:n,resolve:u}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext()}))}async enqueueReentrant(n,o={}){return this.enqueue(n,{immediate:this.currentTask!=null,name:o.name})}async cancelAll(n=!0){this.log("cancelAll"),this.emit("didCancel");let o=this.queue.map(i=>i.resolve);this.queue=[],o.forEach(i=>i(void 0)),await this.wait()}async pause(){this.log("pause"),this.paused=!0,await this.wait()}resume(){this.log("resume"),this.paused=!1,this.performNext()}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.paused)))return new Promise(n=>{this.waitToFinish.push(n)})}get isPaused(){return this.paused}get hasTasks(){return this.queue.length!==0}};r(Oe,"SerialQueue");var te=!1,k=te?A("zeed:throttle","error"):()=>{};function Vi(e,t={}){let{delay:n=100,trailing:o=!0,leading:i=!0}=t,s=0,u=0,a=0,f,g=Date.now();function h(){return s?(clearTimeout(s),s=void 0,!0):!1}r(h,"clearExistingTimeout");function x(...b){let v=Date.now(),w=v-u;function T(){let y=Date.now();return`total ${(y-g).toFixed(1)}ms - elapsed ${(y-u).toFixed(1)}ms - visited ${a}x`}r(T,"debugElapsed");let L=r(()=>{a=0,u=Date.now(),e.apply(this,b)},"exec");if(f=L,w>n||!s){te&&k("elapsed",T()),i&&(w>n?(te&&k("\u{1F680} leading",T()),L()):++a);let y=w>n?n:n-w;k(`\u23F1 start timeout with ${y.toFixed(1)}ms`,T()),h(),u=v,s=setTimeout(()=>{te&&k("\u23F1 reached timeout",T()),s=0,o&&(!i||a>0)&&(te&&k("\u{1F680} trailing",T()),f?.())},y)}else++a,te&&k("visited",T())}return r(x,"wrapper"),x.cancel=h,x.stop=()=>{h()&&f&&f()},x.immediate=r(async function(...v){h(),u=Date.now(),e.apply(this,v)},"immediate"),x.dispose=()=>x.stop(),x}r(Vi,"throttle");function qi(e,t={}){let{delay:n=100}=t,o=0,i=!1,s;function u(){o&&(k("clear"),clearTimeout(o),o=0)}r(u,"clearExistingTimeout");async function a(){try{if(u(),s!=null){k("exec");let h=[...s];s=void 0,i=!0,await I(e(...h)),i=!1,k("exec done"),s!=null&&(u(),k("exec trigger next"),o=setTimeout(a,n))}}catch{}}r(a,"exec");function f(...h){s=[...h],u(),k("trigger"),i===!1&&(o=setTimeout(a,n))}r(f,"wrapper");async function g(...h){u(),s=[...h],await a()}return r(g,"immediate"),f.cancel=u,f.dispose=u,f.immediate=g,f}r(qi,"debounce");function Ji(e=globalThis?.location?.hostname??""){return["::ffff:127.0.0.1","localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}r(Ji,"isLocalHost");function Wi(e){let{level:t=void 0,filter:n=void 0,messages:o=[]}=e,i=U(n),s=V(t);return u=>{!s(u.level)||!i(u.name)||o.push(u)}}r(Wi,"LoggerMemoryHandler");var le=class extends M{constructor(){super(...arguments);this.id=H()}close(){this.dispose()}};r(le,"Channel");var ne=class extends le{constructor(){super(...arguments);this.isConnected=!0}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:H()})}};r(ne,"LocalChannel");function Zi(){let e=new ne,t=new ne;return e.other=t,t.other=e,[e,t]}r(Zi,"createLocalChannelPair");var Be=class{async encode(t){return t}async decode(t){return t}};r(Be,"NoopEncoder");var _=class{async encode(t){return xe(t)}async decode(t){return be(t)}};r(_,"JsonEncoder");var je=class{constructor(t){this.key=t}async encode(t){let n=xe(t);return await tt(n,this.key)}async decode(t){let n=await nt(t,this.key);return be(n)}};r(je,"CryptoEncoder");var Ct=r((e,t,n={})=>new Proxy(n,{get:(o,i)=>i in o?o[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function Ki(e={}){let{name:t=z("hub"),encoder:n=new _,retryAfter:o=1e3,ignoreUnhandled:i=!0,logLevel:s=!1}=e,u=A(t,s),a={},f,g=[],h,x={},b=r(()=>{clearTimeout(h)},"dispose"),v=r(async()=>{if(clearTimeout(h),f){if(f.isConnected)for(;g.length;){let y=g[0];try{f.postMessage(await n.encode(y)),g.shift()}catch(p){u.warn("postMessage",p);break}}g.length>0&&o>0&&(h=setTimeout(v,o))}},"postNext"),w=r(async y=>{u("enqueue postMessage",y),g.push(y),await v()},"postMessage"),T=r(async y=>{f=y,f.on("connect",v),f.on("message",async p=>{u("onmessage",typeof p);let{name:c,args:l,id:d,result:m,error:D}=await n.decode(p.data);if(c){u(`name ${c} id ${d}`);try{if(a[c]==null)throw new Error(`handler for ${c} was not found`);let R=a[c](...l);P(R)&&(R=await R),u(`result ${R}`),d&&await w({id:d,result:R})}catch(R){let G=R instanceof Error?R:new Error(Ce(R));u.warn("execution error",G.name),await w({id:d,error:{message:G.message,stack:G.stack,name:G.name}})}}else if(d)if(u(`response for id=${d}: result=${m}, error=${D}`),x[d]==null)m===void 0?u(`skip response for ${d}`):u.warn(`no response hook for ${d}`);else{let[R,G]=x[d];if(R&&G)if(delete x[d],D){let ge=new Error(D.message);ge.stack=D.stack,ge.name=D.name,u.warn("reject",ge.name),G(ge)}else u("resolve",m),R(m)}else i||u.warn("Unhandled message",p)}),await v()},"connect"),L=r(async(y,p,c={})=>{let{timeout:l=5e3}=c,d=H();return await w({name:y,args:p,id:d}),pt(new Promise((m,D)=>x[d]=[m,D]),l)},"fetchMessage");return e.channel&&T(e.channel),{dispose:b,connect:T,listen(y){Object.assign(a,y)},send(){return Ct(L,{},{options(y){return Ct(L,{...y})}})}}}r(Ki,"useMessageHub");var fe=class extends M{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:o,encoder:i=new _,channel:s,debug:u=!1}=n;this.channel=s,this.encoder=i,this.debug=u,this.name=o??this.channel.id??z("pubsub"),this.log=A(`${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 f=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${f?.event}, info=`,f):this.log(`channel message, event=${f?.event}`),f){let{event:g,args:h}=f;await this.emitSuper(g,...h)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(n,...o){return await super.emit(n,...o)}async emit(n,...o){try{if(this.debug?this.log(`emit(${String(n)})`,n):this.log(`emit(${String(n)})`,o.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let i=await this.encoder.encode({event:n,args:o});return this.channel.postMessage(i),!0}catch(i){this.log.warn(`emit(${String(n)})`,i)}return!1}};r(fe,"PubSub");function Yi(e){return new fe(e)}r(Yi,"usePubSub");var Qi=1;var Mn=r(e=>e,"defaultSerialize"),Xi=Mn;function es(e,t){let{post:n,on:o,eventNames:i=[],serialize:s=Mn,deserialize:u=Xi}=t,a=new Map;return o(async f=>{let g=u(f),[h,x,b,v]=g;if(h===1||h===2){let w,T;if(v!=null)try{let L=e[v];w=await L(...x)}catch(L){T=String(L)}else T="Method implementation missing";h===1&&b&&n(s(T?[4,T,b]:[3,w,b]))}else if(b){let w=a.get(b);w!=null&&(h===4?w.reject(x):w.resolve(x)),a.delete(b)}}),new Proxy({},{get(f,g){let h=r((...b)=>{n(s([2,b,null,g]))},"sendEvent");if(t.onlyEvents||i.includes(g))return h.asEvent=h,h;let x=r((...b)=>new Promise((v,w)=>{let T=Qi++;a.set(T,{resolve:v,reject:w}),n(s([1,b,T,g]))}),"sendCall");return x.asEvent=h,x}})}r(es,"useRPC");var re=A("zeed:network","error"),Ft={cache:"no-cache",redirect:"follow",headers:{}};function Rn(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[n,o]=t[1].split(":",2);return{url:e.replace(`${t[1]}@`,""),username:n,password:o}}}r(Rn,"parseBasicAuth");async function Dt(e,t={},n=fetch){try{O(t)&&(t=ce({},...W(t)));let o=Rn(String(e));o&&(e=o.url,t=ce({},t,Un(o.username,o.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let i=await n(String(e),t);if(i.status<400)return i;try{re.warn(`Fetch of ${String(e)} returned status=${i.status}. Options:`,t),re.warn(`Response: ${await i.text()}`)}catch(s){re.error("Exception:",s)}}catch(o){re.error("fetchBasic",o)}}r(Dt,"fetchBasic");async function ts(e,t={},n=fetch){try{let o=await Dt(e,[{method:"GET",headers:{Accept:"application/json"}},t],n);if(o)return await o.json()}catch(o){re.error("fetchJSON error:",o)}}r(ts,"fetchJson");async function ns(e,t={},n=fetch){try{let o=await Dt(e,[Ft,{method:"GET"},t],n);if(o)return await o.text()}catch(o){re.error("fetchHTML error:",o)}}r(ns,"fetchText");function rs(e,t="POST"){return{method:t,...Ft,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:bt(e)}}r(rs,"fetchOptionsFormURLEncoded");function os(e,t="POST"){return{method:t,...Ft,headers:{"Content-Type":"application/json; charset=utf-8"},body:S(e)}}r(os,"fetchOptionsJson");function Un(e,t){return{headers:{Authorization:`Basic ${Ke(`${e}:${t}`)}`}}}r(Un,"fetchOptionsBasicAuth");function St(){if(typeof window<"u")return window}r(St,"getWindow");function kn(){if(typeof navigator<"u")return navigator}r(kn,"getNavigator");function is(){return St()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}r(is,"getGlobal");var N=kn(),Z=St();function In(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,test:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){return e.ios=N?.platform?.match(/(iPhone|iPod|iPad)/i)!=null,e.macos=!!N?.platform?.startsWith("Mac"),e.windows=!!N?.platform?.startsWith("Win"),e.beaker=Z?.beaker!=null,e.electron=(N?.userAgent?.toLowerCase()?.indexOf(" electron/")||-1)>-1&&!e.beaker,e.wkwebview=Z?.webkit?.messageHandlers!=null,e.pwa=N?.serviceWorker!=null,e.pwaInstalled=N?.standalone||Z?.matchMedia?.("(display-mode: standalone)")?.matches,e.node=typeof process<"u"&&process?.release?.name==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,e.jest=typeof jest<"u"||typeof vitest<"u",e.test=e.jest,e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=Z&&"ontouchstart"in Z||(N?.maxTouchPoints||0)>1||N?.msPointerEnabled&&Z?.MSGesture||Z?.DocumentTouch&&document instanceof DocumentTouch,e}r(In,"detect");var He=r(()=>typeof window<"u"&&globalThis===window,"isBrowser"),ss=In();function as(e){He()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e)}r(as,"useExitHandler");var ze=class{constructor(t={}){this.store={}}setItem(t,n){this.store[t]=Me(n)}getItem(t){return Me(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};r(ze,"MemStorage");var us=r(()=>{},"noop");var cs=A("zeed:base64","error");function ls(e){try{let t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),o=window.atob(n),i=new Uint8Array(o.length);for(let s=0;s<o.length;++s)i[s]=o.charCodeAt(s);return i}catch(t){cs.error(t,e)}}r(ls,"urlBase64ToUint8Array");var fs=A("zeed:gravatar","error");function ps(e,t){let n="0123456789abcdef".split("");function o(y,p){let c=y[0],l=y[1],d=y[2],m=y[3];c=s(c,l,d,m,p[0],7,-680876936),m=s(m,c,l,d,p[1],12,-389564586),d=s(d,m,c,l,p[2],17,606105819),l=s(l,d,m,c,p[3],22,-1044525330),c=s(c,l,d,m,p[4],7,-176418897),m=s(m,c,l,d,p[5],12,1200080426),d=s(d,m,c,l,p[6],17,-1473231341),l=s(l,d,m,c,p[7],22,-45705983),c=s(c,l,d,m,p[8],7,1770035416),m=s(m,c,l,d,p[9],12,-1958414417),d=s(d,m,c,l,p[10],17,-42063),l=s(l,d,m,c,p[11],22,-1990404162),c=s(c,l,d,m,p[12],7,1804603682),m=s(m,c,l,d,p[13],12,-40341101),d=s(d,m,c,l,p[14],17,-1502002290),l=s(l,d,m,c,p[15],22,1236535329),c=u(c,l,d,m,p[1],5,-165796510),m=u(m,c,l,d,p[6],9,-1069501632),d=u(d,m,c,l,p[11],14,643717713),l=u(l,d,m,c,p[0],20,-373897302),c=u(c,l,d,m,p[5],5,-701558691),m=u(m,c,l,d,p[10],9,38016083),d=u(d,m,c,l,p[15],14,-660478335),l=u(l,d,m,c,p[4],20,-405537848),c=u(c,l,d,m,p[9],5,568446438),m=u(m,c,l,d,p[14],9,-1019803690),d=u(d,m,c,l,p[3],14,-187363961),l=u(l,d,m,c,p[8],20,1163531501),c=u(c,l,d,m,p[13],5,-1444681467),m=u(m,c,l,d,p[2],9,-51403784),d=u(d,m,c,l,p[7],14,1735328473),l=u(l,d,m,c,p[12],20,-1926607734),c=a(c,l,d,m,p[5],4,-378558),m=a(m,c,l,d,p[8],11,-2022574463),d=a(d,m,c,l,p[11],16,1839030562),l=a(l,d,m,c,p[14],23,-35309556),c=a(c,l,d,m,p[1],4,-1530992060),m=a(m,c,l,d,p[4],11,1272893353),d=a(d,m,c,l,p[7],16,-155497632),l=a(l,d,m,c,p[10],23,-1094730640),c=a(c,l,d,m,p[13],4,681279174),m=a(m,c,l,d,p[0],11,-358537222),d=a(d,m,c,l,p[3],16,-722521979),l=a(l,d,m,c,p[6],23,76029189),c=a(c,l,d,m,p[9],4,-640364487),m=a(m,c,l,d,p[12],11,-421815835),d=a(d,m,c,l,p[15],16,530742520),l=a(l,d,m,c,p[2],23,-995338651),c=f(c,l,d,m,p[0],6,-198630844),m=f(m,c,l,d,p[7],10,1126891415),d=f(d,m,c,l,p[14],15,-1416354905),l=f(l,d,m,c,p[5],21,-57434055),c=f(c,l,d,m,p[12],6,1700485571),m=f(m,c,l,d,p[3],10,-1894986606),d=f(d,m,c,l,p[10],15,-1051523),l=f(l,d,m,c,p[1],21,-2054922799),c=f(c,l,d,m,p[8],6,1873313359),m=f(m,c,l,d,p[15],10,-30611744),d=f(d,m,c,l,p[6],15,-1560198380),l=f(l,d,m,c,p[13],21,1309151649),c=f(c,l,d,m,p[4],6,-145523070),m=f(m,c,l,d,p[11],10,-1120210379),d=f(d,m,c,l,p[2],15,718787259),l=f(l,d,m,c,p[9],21,-343485551),y[0]=w(c,y[0]),y[1]=w(l,y[1]),y[2]=w(d,y[2]),y[3]=w(m,y[3])}r(o,"md5cycle");function i(y,p,c,l,d,m){return p=w(w(p,y),w(l,m)),w(p<<d|p>>>32-d,c)}r(i,"cmn");function s(y,p,c,l,d,m,D){return i(p&c|~p&l,y,p,d,m,D)}r(s,"ff");function u(y,p,c,l,d,m,D){return i(p&l|c&~l,y,p,d,m,D)}r(u,"gg");function a(y,p,c,l,d,m,D){return i(p^c^l,y,p,d,m,D)}r(a,"hh");function f(y,p,c,l,d,m,D){return i(c^(p|~l),y,p,d,m,D)}r(f,"ii");function g(y){let p=y.length,c=[1732584193,-271733879,-1732584194,271733878],l;for(l=64;l<=y.length;l+=64)o(c,h(y.substring(l-64,l)));y=y.substring(l-64);let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<y.length;l++)d[l>>2]|=y.charCodeAt(l)<<(l%4<<3);if(d[l>>2]|=128<<(l%4<<3),l>55)for(o(c,d),l=0;l<16;l++)d[l]=0;return d[14]=p*8,o(c,d),c}r(g,"md51");function h(y){let p=[],c;for(c=0;c<64;c+=4)p[c>>2]=y.charCodeAt(c)+(y.charCodeAt(c+1)<<8)+(y.charCodeAt(c+2)<<16)+(y.charCodeAt(c+3)<<24);return p}r(h,"md5blk");function x(y){let p="",c=0;for(;c<4;c++)p+=n[y>>c*8+4&15]+n[y>>c*8&15];return p}r(x,"rhex");function b(y){for(let p=0;p<y.length;p++)y[p]=x(y[p]);return y.join("")}r(b,"hex");function v(y){return b(g(y))}r(v,"md5");function w(y,p){return y+p&4294967295}r(w,"add32"),t=t||{};let T=[];t={size:t.size||"50",rating:t.rating||"g",secure:t.secure||location.protocol==="https:",backup:t.backup||""},e=e.trim().toLowerCase();let L=t.secure?"https://secure.gravatar.com/avatar/":"http://www.gravatar.com/avatar/";return t.rating&&T.push(`r=${t.rating}`),t.backup&&T.push(`d=${encodeURIComponent(t.backup)}`),t.size&&T.push(`s=${t.size}`),`${L+v(e)}?${T.join("&")}`}r(ps,"gravatar");function ds(e,t=""){try{return ps(e,{size:256,backup:"monsterid",secure:!0})}catch{return fs(`Gravatar issue: Did not find an image for ${e}`),t}}r(ds,"gravatarURLByEmail");var $n=A("zeed:localstorage","error"),_e=class{constructor(t){this.pretty=!1;$n.assert(t.name,"name required"),this.name=t.name,this.prefix=`${t.name}$`,this.objectToString=t.objectToString??(n=>this.pretty?S(n,null,2):S(n)),this.objectFromString=t.objectFromString??(n=>{try{return JSON.parse(n)}catch(o){$n.warn(`LocalStorage parse error '${o}' in`,n)}})}setItem(t,n){let o=this.objectToString(n);localStorage.setItem(`${this.prefix}${t}`,o)}getItem(t){let n=localStorage.getItem(`${this.prefix}${t}`);if(n!=null)return this.objectFromString(n)}removeItem(t){localStorage.removeItem(`${this.prefix}${t}`)}clear(){Object.keys(localStorage).filter(t=>t.startsWith(this.prefix)).forEach(t=>{localStorage.removeItem(t)})}allKeys(){let t=this.prefix.length;return Object.keys(localStorage).filter(n=>n.startsWith(this.prefix)).map(n=>n.substr(t))}};r(_e,"LocalStorage");var On=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function pe(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}r(pe,"supportsColors");function de(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return On[Math.abs(t)%On.length]}r(de,"selectColor");var jn='font-family: "JetBrains Mono", Menlo; font-size: 11px;',gs=`${jn}`,ms=`font-weight: 600; ${jn}`,ys=pe(),Bn={},hs=ee();function Et(e={}){let{filter:t=void 0,level:n=void 0,colors:o=!0,padding:i=16,time:s=!0}=e,u=U(t),a=V(n);return f=>{if(!a(f.level)||!u(f.name))return;let g=s?`+${wt(ee()-hs)}`:"",h=f.name||"",x=Bn[h||""];x==null&&(x={color:de(h)},Bn[h]=x);let b;switch(i>0&&(h=h.padEnd(16," ")),o&&ys?(b=[`%c${h}%c %s %c${g}`],b.push(`color:${x.color}; ${ms}`),b.push(gs),b.push(f.messages?.[0]??""),b.push(`color:${x.color};`),b.push(...f.messages.slice(1))):b=[h,...f.messages,`+${g}`],b=b.map(v=>v instanceof Uint8Array?`<Uint8Array size=${v.length}>`:v),f.level){case 1:e.levelHelper&&(b[0]=`I|* ${b[0]}`),console.info(...b);break;case 2:e.levelHelper&&(b[0]=`W|** ${b[0]}`),console.warn(...b);break;case 3:e.levelHelper&&(b[0]=`E|*** ${b[0]}`),console.error(...b);break;default:e.levelHelper&&(b[0]=`D| ${b[0]}`),console.debug(...b);break}}}r(Et,"LoggerBrowserHandler");var Hn='font-family: "JetBrains Mono", Menlo; font-size: 11px;',xs=`${Hn}`,bs=`font-weight: 600; ${Hn}`,ws=pe(),oe=r(()=>{},"noop");function Pt(e={}){let t=e.filter??localStorage.zeed??localStorage.debug;return r(function n(o="",i){let s,u=U(t),a=Y(i??-1);if(u(o)&&a!==1/0){let h=function(x,b){return a<=x?b:()=>{}};var f=h;r(h,"defineForLogLevel");let g=[];if(ws){let x=de(o);g.push(`%c${o.padEnd(16," ")}%c %s`),g.push(`color:${x}; ${bs}`),g.push(xs)}else g.push(`[${o}] %s`);s=h(0,console.debug.bind(console,...g)),s.debug=h(0,console.debug.bind(console,...g)),s.info=h(1,console.info.bind(console,...g)),s.warn=h(2,console.warn.bind(console,...g)),s.error=h(3,console.error.bind(console,...g)),s.fatal=h(4,(...x)=>{throw s.error(...x),new Error(`${x.map(String).join(" ")}`)}),s.assert=h(4,(x,...b)=>{(x==null||!x)&&s.fatal(...b)})}else s=r(()=>{},"log"),s.debug=oe,s.info=oe,s.warn=oe,s.error=oe,s.assert=oe,s.fatal=oe;return s.extend=g=>n(o?`${o}:${g}`:g),s.label=o,s},"LoggerBrowserDebugFactory")}r(Pt,"LoggerBrowserSetupDebugFactory");function Ts(e={}){console.info("activateConsoleDebug is activated by default in browsers")}r(Ts,"activateConsoleDebug");function zn(){He()&&(A.setHandlers([Et()]),A.setFactory(Pt({})))}r(zn,"setupBrowserLog");zn();0&&(module.exports={CRYPTO_DEFAULT_ALG,CRYPTO_DEFAULT_DERIVE_ALG,CRYPTO_DEFAULT_DERIVE_ITERATIONS,CRYPTO_DEFAULT_HASH_ALG,Channel,CryptoEncoder,DAY_MS,Day,Emitter,JsonEncoder,LocalChannel,LocalStorage,LogLevel,LogLevelAlias,Logger,LoggerBrowserHandler,LoggerBrowserSetupDebugFactory,LoggerConsoleHandler,LoggerContext,LoggerMemoryHandler,MemStorage,NoopEncoder,PoolTaskIdConflictResolution,PoolTaskState,PubSub,SerialQueue,Uint8ArrayToHexDump,Uint8ArrayToJson,Uint8ArrayToString,XRX,_decodeUtf8Polyfill,_encodeUtf8Polyfill,activateConsoleDebug,arrayAvg,arrayBatches,arrayEmptyInPlace,arrayFilterInPlace,arrayFlatten,arrayIntersection,arrayIsEqual,arrayMax,arrayMin,arrayMinus,arrayRandomElement,arrayRemoveElement,arraySetElement,arrayShuffle,arrayShuffleForce,arrayShuffleInPlace,arraySorted,arraySortedNumbers,arraySum,arraySymmetricDifference,arrayToggleInPlace,arrayUnion,arrayUnique,avg,between,cloneJsonObject,cloneObject,cmp,composeOrderby,createArray,createLocalChannelPair,createPromise,createPromiseProxy,csvParse,csvParseToObjects,csvStringify,dateStringToDays,day,dayDay,dayDiff,dayFromAny,dayFromDate,dayFromDateGMT,dayFromParts,dayFromString,dayFromTimestamp,dayFromToday,dayIterator,dayMonth,dayMonthStart,dayOffset,dayRange,dayToDate,dayToDateGMT,dayToParts,dayToString,dayToTimestamp,dayYear,dayYearStart,debounce,decimal,decimalCentsPart,decimalFromCents,decimalToCents,decodeBase16,decodeBase32,decodeBase58,decodeBase62,decrypt,deepEqual,deepMerge,deepStripUndefinedInPlace,deriveKeyPbkdf2,detect,digest,empty,encodeBase16,encodeBase32,encodeBase58,encodeBase62,encodeQuery,encrypt,endSortWeight,ensureKey,ensureKeyAsync,equalBinary,escapeHTML,escapeRegExp,estimateSizeForBase,fetchBasic,fetchJson,fetchOptionsBasicAuth,fetchOptionsFormURLEncoded,fetchOptionsJson,fetchText,fixBrokenUth8String,forEachDay,forTimes,formatMessages,formatMilliseconds,fromBase64,fromBase64String,fromCamelCase,fromHex,getGlobal,getGlobalContext,getGlobalEmitter,getGlobalLogger,getNamespaceFilterString,getNavigator,getSecureRandom,getSecureRandomIfPossible,getTimestamp,getWindow,gravatarURLByEmail,immediate,isArray,isBoolean,isBrowser,isEven,isHalf,isInteger,isLocalHost,isNotNull,isNull,isNullOrUndefined,isNumber,isObject,isPrime,isPrimeRX,isPrimitive,isPromise,isRecord,isRecordPlain,isSafeInteger,isString,isTimeout,isUint8Array,isValue,joinToUint8Array,jsonStringify,jsonStringifySafe,jsonStringifySorted,jsonToUint8Array,last,lazyListener,linkifyPlainText,listDistinctUnion,listGroupBy,listOfKey,listQuery,memoize,memoizeAsync,messages,moveSortWeight,noop,objectIsEmpty,objectMap,objectMergeDisposable,parseBasicAuth,parseDate,parseLogLevel,parseOrderby,parseQuery,platform,promisify,qid,randomBoolean,randomFloat,randomInt,randomUint8Array,regExpEscape,regExpString,renderMessages,roundDown,roundHalfAwayFromZero,roundHalfDown,roundHalfEven,roundHalfOdd,roundHalfTowardsZero,roundHalfUp,roundUp,seededRandom,selectColor,setUuidDefaultEncoding,setupBrowserLog,size,sleep,sortedItems,sortedOrderby,startSortWeight,stringToBoolean,stringToFloat,stringToInteger,stringToUInt8Array,suid,suidBytes,suidBytesDate,suidDate,sum,supportsColors,throttle,timeout,timeoutReached,timoutError,toBase64,toBase64Url,toBool,toCamelCase,toCapitalize,toCapitalizeWords,toFloat,toHex,toHumanReadableUrl,toInt,toString,toUint8Array,toValidFilename,today,tryTimeout,uname,unescapeHTML,urlBase64ToUint8Array,useAsyncMutex,useBase,useDefer,useDispose,useDisposer,useEventListener,useExitHandler,useInterval,useLevelFilter,useMessageHub,useMutex,useNamespaceFilter,usePool,usePubSub,useRPC,useSorted,useTimeout,uuid,uuid32bit,uuidB32,uuidB62,uuidBytes,uuidDecode,uuidDecodeB32,uuidDecodeB62,uuidDecodeV4,uuidEncode,uuidEncodeB32,uuidEncodeB62,uuidEncodeV4,uuidIsValid,uuidv4,valueToBoolean,valueToFloat,valueToInteger,valueToString,waitOn});
11
+ `&&(o.push(i),i=[])}return o}r(mn,"csvParse");function wi(e,t={}){let n=mn(e,t),o=n[0];return n.slice(1).map(i=>Object.fromEntries(i.map((s,u)=>[o[u],s])))}r(wi,"csvParseToObjects");var Ti=C("zeed:dispose","error");async function Li(e){typeof e=="function"?await I(e()):U(e)?await e:typeof e.dispose=="function"?await I(e.dispose()):U(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await I(e.cleanup()):U(e.cleanup)&&await e.cleanup}r(Li,"callDisposer");function Ie(e){let{name:t}=typeof e=="string"?{name:e}:e??{},n=[],o=r(async u=>{u!=null&&n.includes(u)&&(Fe(n,a=>a!==u),await Li(u))},"untrack"),i=r(async()=>{for(t&&Ti.debug(`dispose ${t}: ${n.length} entries`);n.length>0;)await o(n[0])},"dispose"),s=r(u=>{if(u!=null)return n.unshift(u),()=>o(u)},"track");return Object.assign(i,{track:s,add:s,untrack:o,dispose:i,exec:i,getSize(){return n.length},isDisposed(){return n.length<=0}})}r(Ie,"useDispose");var vi=Ie;function Ci(e={}){let{mode:t="fifo"}=e,n=[],o=r(async(s=!1)=>{for(;n.length>0;){let u=n[0];if(Fe(n,a=>a!==u),typeof u=="function"){let a=u();if(U(a)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await a}}else if(U(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(o,{add:r(s=>{t==="lifo"?n.unshift(s):n.push(s)},"add"),exec:o,getSize(){return n.length}})}r(Ci,"useDefer");function Ai(e,t=0){let n=setTimeout(e,t);return()=>{n&&(clearTimeout(n),n=void 0)}}r(Ai,"useTimeout");function Fi(e,t){let n=setInterval(e,t);return()=>{n&&(clearInterval(n),n=void 0)}}r(Fi,"useInterval");function Di(e,t,n,...o){return e==null?()=>{}:(e.on?e.on(t,n,...o):e.addEventListener&&e.addEventListener(t,n,...o),()=>{e.off?e.off(t,n,...o):e.removeEventListener&&e.removeEventListener(t,n,...o)})}r(Di,"useEventListener");function Pi(){let e=!0;return(t,n)=>{let o=!1;if(e){e=!1;try{t(),o=!0}finally{e=!0}}else n!==void 0&&n();return o}}r(Pi,"useMutex");function Ei(){let e=!0;return async(t,n)=>{let o=!1;if(e){e=!1;try{let i=t();U(i)&&await i,o=!0}finally{e=!0}}else if(n!==void 0){let i=n();U(i)&&await i}return o}}r(Ei,"useAsyncMutex");var X=C("zeed:emitter","error"),D=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.dispose=Ie();this.call=new Proxy({},{get:(t,n)=>async(...o)=>await this.emit(n,...o)})}async emit(t,...n){let o=!1;try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...n)),i.length>0){let s=i.map(u=>{try{return I(u(...n))}catch(a){X.warn("emit warning:",a)}return null}).filter(u=>u!=null);o=!0,await Promise.all(s)}}catch(i){X.error("emit exception",i)}return o}onAny(t){this.subscribersOnAny.push(t)}on(t,n){let o=this.subscribers[t]||[];return o.push(n),this.subscribers[t]=o,()=>{this.off(t,n)}}onCall(t){for(let[n,o]of Object.entries(t))this.on(n,o)}once(t,n){let o=r(async(...i)=>(this.off(t,o),await I(n(...i))),"onceListener");return this.on(t,o),()=>{this.off(t,n)}}off(t,n){return this.subscribers[t]=(this.subscribers[t]||[]).filter(o=>n&&o!==n),this}removeAllListeners(){return this.subscribers={},this}};r(D,"Emitter");function Si(){let e=K().emitter;return e||(e=new D,K().emitter=e),e}r(Si,"getGlobalEmitter");var Ui=new D;function Mi(e,t){let n=Math.round(F()*100),o=[],i,s=r((a,d)=>{let g={key:a,obj:d};o.push(g),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):X.error(n,"Cannot listen to key"):e.onAny?e.onAny((a,d)=>{s(a,d)}):X.error(n,"cannot listen to all for",e),r((a,d=!0)=>new Promise((g,h)=>{a||(a=t,a||o.length&&(a=o[0].key)),i=r(()=>{for(;o.length>0;){let x=o.shift();if(x.key===a)i=void 0,g(x.obj);else{if(d){X.warn(n,`Unhandled event ${a} with value: ${x.obj}`);continue}h(new Error(`Expected ${a}, but found ${x.key} with value=${x.obj}`)),X.error(n,`Unhandled event ${a} with value: ${x.obj}`)}break}},"lazyResolve"),i()}),"on")}r(Mi,"lazyListener");var ee=r(()=>Date.now(),"getTimestamp");function Lt(e){return e>999?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}r(Lt,"formatMilliseconds");function Ri(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let n=null;if(t.includes(":"))try{n=new Date(t)}catch{}if(!(n instanceof Date)){let o=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);o&&(n=new Date(+o[1],+o[2]-1,+o[3],12,0))}if(n instanceof Date)return n}}}r(Ri,"parseDate");var{encode:yn,decode:ki}=_(62),{encode:hn,decode:Ii}=_(32),$e=16;function Oe(){return J($e)}r(Oe,"uuidBytes");function xn(e=Oe()){return yn(e,22)}r(xn,"uuidB62");function bn(e){return yn(e,22)}r(bn,"uuidEncodeB62");function wn(e){return ki(e,$e)}r(wn,"uuidDecodeB62");function Tn(e=Oe()){return hn(e,26)}r(Tn,"uuidB32");function Ln(e){return hn(e,26)}r(Ln,"uuidEncodeB32");function vn(e){return Ii(e,$e)}r(vn,"uuidDecodeB32");var $i="10000000-1000-4000-8000-100000000000",Cn=typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID.bind(crypto):()=>$i.replace(/[018]/g,e=>(e^J(1)[0]&15>>e/4).toString(16));function An(e){let t=Ke(e);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}r(An,"uuidEncodeV4");function Fn(e){return Ye(e.replaceAll("-",""))}r(Fn,"uuidDecodeV4");var Dn=16e11;function Oi(e){let t=new Uint8Array([0,0,0,0,0,0]),n=t.length-1;for(let o=0;o<t.length;o++){let i=e&255;t[n-o]=i,e=(e-i)/256}return t}r(Oi,"longToByteArray");function Ct(){let e=ee()-Dn;return new Uint8Array([...Oi(e),...J(10)])}r(Ct,"suidBytes");function Bi(){return Sn(Ct())}r(Bi,"suid");function _i(e){return Pn(Ft(e))}r(_i,"suidDate");function Pn(e){return new Date(Dn+e.slice(0,6).reduce((t,n)=>t*256+n,0))}r(Pn,"suidBytesDate");var ji=r(()=>new Uint32Array(J(4))[0],"uuid32bit"),At={base62:{uuid:xn,uuidDecode:wn,uuidEncode:bn},base32:{uuid:Tn,uuidDecode:vn,uuidEncode:Ln},uuidv4:{uuid:Cn,uuidDecode:Fn,uuidEncode:An}},Be="base62",En=!1;function Hi(e,t=!1){Be=e,En=t}r(Hi,"setUuidDefaultEncoding");function j(){return At[Be].uuid(En?Ct():Oe())}r(j,"uuid");function Ft(e){return At[Be].uuidDecode(e)}r(Ft,"uuidDecode");function Sn(e){return At[Be].uuidEncode(e)}r(Sn,"uuidEncode");function zi(e){try{return Ft(e).length===$e}catch{}return!1}r(zi,"uuidIsValid");var vt={};function H(e="id"){return vt[e]==null&&(vt[e]=0),`${e}-${vt[e]++}`}r(H,"uname");var Ni=0;function Gi(){return`id-${Ni++}`}r(Gi,"qid");var fe=class extends D{constructor(){super(...arguments);this.id=j()}close(){this.dispose()}};r(fe,"Channel");var te=class extends fe{constructor(){super(...arguments);this.isConnected=!0}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:j()})}};r(te,"LocalChannel");function Vi(){let e=new te,t=new te;return e.other=t,t.other=e,[e,t]}r(Vi,"createLocalChannelPair");var _e=class{async encode(t){return t}async decode(t){return t}};r(_e,"NoopEncoder");var z=class{async encode(t){return be(t)}async decode(t){return we(t)}};r(z,"JsonEncoder");var je=class{constructor(t){this.key=t}async encode(t){let n=be(t);return await rt(n,this.key)}async decode(t){let n=await ot(t,this.key);return we(n)}};r(je,"CryptoEncoder");var Dt=r((e,t,n={})=>new Proxy(n,{get:(o,i)=>i in o?o[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function qi(e={}){let{name:t=H("hub"),encoder:n=new z,retryAfter:o=1e3,ignoreUnhandled:i=!0,logLevel:s=!1}=e,u=C(t,s),a={},d,g=[],h,x={},b=r(()=>{clearTimeout(h)},"dispose"),v=r(async()=>{if(clearTimeout(h),d){if(d.isConnected)for(;g.length;){let y=g[0];try{d.postMessage(await n.encode(y)),g.shift()}catch(p){u.warn("postMessage",p);break}}g.length>0&&o>0&&(h=setTimeout(v,o))}},"postNext"),w=r(async y=>{u("enqueue postMessage",y),g.push(y),await v()},"postMessage"),T=r(async y=>{d=y,d.on("connect",v),d.on("message",async p=>{u("onmessage",typeof p);let{name:c,args:l,id:f,result:m,error:P}=await n.decode(p.data);if(c){u(`name ${c} id ${f}`);try{if(a[c]==null)throw new Error(`handler for ${c} was not found`);let M=a[c](...l);U(M)&&(M=await M),u(`result ${M}`),f&&await w({id:f,result:M})}catch(M){let G=M instanceof Error?M:new Error(De(M));u.warn("execution error",G.name),await w({id:f,error:{message:G.message,stack:G.stack,name:G.name}})}}else if(f)if(u(`response for id=${f}: result=${m}, error=${P}`),x[f]==null)m===void 0?u(`skip response for ${f}`):u.warn(`no response hook for ${f}`);else{let[M,G]=x[f];if(M&&G)if(delete x[f],P){let me=new Error(P.message);me.stack=P.stack,me.name=P.name,u.warn("reject",me.name),G(me)}else u("resolve",m),M(m)}else i||u.warn("Unhandled message",p)}),await v()},"connect"),L=r(async(y,p,c={})=>{let{timeout:l=5e3}=c,f=j();return await w({name:y,args:p,id:f}),gt(new Promise((m,P)=>x[f]=[m,P]),l)},"fetchMessage");return e.channel&&T(e.channel),{dispose:b,connect:T,listen(y){Object.assign(a,y)},send(){return Dt(L,{},{options(y){return Dt(L,{...y})}})}}}r(qi,"useMessageHub");var de=class extends D{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:o,encoder:i=new z,channel:s,debug:u=!1}=n;this.channel=s,this.encoder=i,this.debug=u,this.name=o??this.channel.id??H("pubsub"),this.log=C(`${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 d=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${d?.event}, info=`,d):this.log(`channel message, event=${d?.event}`),d){let{event:g,args:h}=d;await this.emitSuper(g,...h)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(n,...o){return await super.emit(n,...o)}async emit(n,...o){try{if(this.debug?this.log(`emit(${String(n)})`,n):this.log(`emit(${String(n)})`,o.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let i=await this.encoder.encode({event:n,args:o});return this.channel.postMessage(i),!0}catch(i){this.log.warn(`emit(${String(n)})`,i)}return!1}};r(de,"PubSub");function Ji(e){return new de(e)}r(Ji,"usePubSub");var Wi=1;var Un=r(e=>e,"defaultSerialize"),Zi=Un;function Ki(e,t){let{post:n,on:o,eventNames:i=[],serialize:s=Un,deserialize:u=Zi}=t,a=new Map;return o(async d=>{let g=u(d),[h,x,b,v]=g;if(h===1||h===2){let w,T;if(v!=null)try{let L=e[v];w=await L(...x)}catch(L){T=String(L)}else T="Method implementation missing";h===1&&b&&n(s(T?[4,T,b]:[3,w,b]))}else if(b){let w=a.get(b);w!=null&&(h===4?w.reject(x):w.resolve(x)),a.delete(b)}}),new Proxy({},{get(d,g){let h=r((...b)=>{n(s([2,b,null,g]))},"sendEvent");if(t.onlyEvents||i.includes(g))return h.asEvent=h,h;let x=r((...b)=>new Promise((v,w)=>{let T=Wi++;a.set(T,{resolve:v,reject:w}),n(s([1,b,T,g]))}),"sendCall");return x.asEvent=h,x}})}r(Ki,"useRPC");var ne=class extends D{constructor(n={}){super();this._isCancelled=!1;this._children=[];this._totalUnits=n.totalUnits??0,this._completedUnits=n.completeUnits??0,this._isCancelable=n.isCancelable??!0,this.dispose.add(async()=>{for(let o of this._children)await o.dispose();await this.emit("progressDispose",this)})}update(){this.emit("progressChanged",this)}async cancel(){if(this._isCancelable&&!this.isCancelled){this._isCancelled=!0,await this.emit("progressCancelled",this);for(let n of this._children)await n.cancel()}}addChild(n){n.on("progressDispose",()=>{Ae(this._children,n)}),n.on("progressChanged",()=>{this.update()}),this._children.includes(n)||this._children.push(n),this.update()}removeChild(n){Ae(this._children,n),this.update()}getTotalUnits(){if(this.isIndeterminate())return 0;let n=this._totalUnits;for(let o of this._children)n+=o.getTotalUnits();return n}getCompletedUnits(){if(this.isIndeterminate())return 0;let n=this._completedUnits;for(let o of this._children)n+=o.getCompletedUnits();return n}isIndeterminate(){return this._totalUnits<=0}isCancelled(){return this._isCancelled}isFinished(){return this.dispose.isDisposed()||!this.isIndeterminate()&&this.getTotalUnits()<=this.getCompletedUnits()}getFraction(){return this.isIndeterminate()?0:Math.min(1,Math.max(0,this.getCompletedUnits()/this.getTotalUnits()))}getChildrenCount(){return this._children.length}setTotalUnit(n){this._totalUnits=n,this.update()}setCompletetedUnit(n){this._completedUnits=n,this.update()}incCompletedUnit(n=1){this._completedUnits+=n,this.update()}};r(ne,"Progress");var Mn=(o=>(o[o.waiting=0]="waiting",o[o.running=1]="running",o[o.finished=2]="finished",o))(Mn||{}),Rn=(o=>(o[o.replace=0]="replace",o[o.memoize=1]="memoize",o[o.error=2]="error",o))(Rn||{});function Yi(e={}){let{maxParallel:t=3}=e,n=new D,o=0,i=0,s=0,u=0,a={};async function d(){if(o>0){let[T,L]=ft();return n.once("didFinish",L),T}}r(d,"waitFinishAll");function g(){n.emit("didFinish"),o=0,i=0}r(g,"didFinish");function h(){let T=0,L=0;for(let{max:y,resolved:p,state:c}of Object.values(a))T+=y,L+=c===2?y:Math.min(y,p);n.emit("didUpdate",o,i,T,L)}r(h,"didUpdate");function x(){if(h(),o>0&&o===i&&g(),s>=t)return;let T=Object.values(a).filter(L=>L.state===0);if(T.length>0){let L;for(let y of T)y.group!=null&&Object.values(a).some(p=>p.state===1&&p.id!==y.id&&p.group===y.group)||(L==null||y.priority<L.priority)&&(L=y);if(L!=null){let y=L.id,p=L.done;L.state=1,++s,n.emit("didStart",y);let c=r(l=>{L&&(L.result=l,L.state=2,L.resolved=L.max),--s,++i,x()},"taskFinished");L.task(L).then(l=>{p(l),n.emit("didResolve",y,l),c(l)}).catch(l=>{p(),n.emit("didReject",y,l),c()})}}}r(x,"performNext");function b(T){let L=a[T];L&&L.state===0&&(a[T].state=2,++i,n.emit("didCancel",T),h())}r(b,"cancel");function v(){Object.keys(a).forEach(b)}r(v,"cancelAll");function w(T,L={}){let y,p=new Promise(f=>y=f),c=L.id??j();if(a[c]!=null){let f=L.idConflictResolution??1;if(f===0)b(c);else if(f===1){let m=a[c];return{id:c,promise:(async()=>{if(m.state===2)return a[c].result})(),dispose:()=>b(c),cancel:()=>b(c)}}else throw new Error(`Pool task with id=${c} already exists!`)}let l=new ne({totalUnits:L.max??1,completeUnits:L.resolved??0});return a[c]={id:c,task:T,priority:++u,group:L.group,state:0,max:L.max??1,resolved:L.resolved??0,done:y,payload:L.payload,progress:l,setMax(f){l.setTotalUnit(f),a[c].max=f,h()},setResolved(f){l.setCompletetedUnit(f),a[c].resolved=f,h()},incResolved(f=1){l.incCompletedUnit(f),a[c].resolved+=f,h()}},++o,x(),{id:c,promise:p,dispose:()=>b(c),cancel:()=>b(c)}}return r(w,"enqueue"),{events:n,cancel:b,cancelAll:v,enqueue:w,dispose:v,waitFinishAll:d}}r(Yi,"usePool");var He=class extends D{constructor(n={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:o=H("queue"),logLevel:i}=n;this.name=o,this.log=C(`zeed:queue:${o}`,i??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.paused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.paused;){let n=this.queue.shift();if(this.log(`performNext => ${n?.name}`),n==null)break;this.countResolved===0&&this.emit("didStart",this.countMax);let{name:o,task:i,resolve:s}=n;this.currentTask=i();let u;try{this.log.info(`start task ${o}`),u=await this.currentTask,this.log(`finished task ${o} with result =`,u)}catch(a){this.log.warn("Error performing task",a)}s(u),this.currentTask=void 0,this.countResolved+=1,this.emit("didUpdate",this.countMax,this.countResolved)}for(this.queue.length===0&&(this.emit("didFinish"),this.countMax=0,this.countResolved=0);this.waitToFinish.length>0;)this.waitToFinish.shift()()}async enqueue(n,o={}){let{immediate:i=!1,name:s=H(this.name)}=o;return i?(this.log.info(`immediate execution ${s}`),await n()):(this.log(`enqueue ${s}`),new Promise(u=>{this.queue.push({name:s,task:n,resolve:u}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext()}))}async enqueueReentrant(n,o={}){return this.enqueue(n,{immediate:this.currentTask!=null,name:o.name})}async cancelAll(n=!0){this.log("cancelAll"),this.emit("didCancel");let o=this.queue.map(i=>i.resolve);this.queue=[],o.forEach(i=>i(void 0)),await this.wait()}async pause(){this.log("pause"),this.paused=!0,await this.wait()}resume(){this.log("resume"),this.paused=!1,this.performNext()}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.paused)))return new Promise(n=>{this.waitToFinish.push(n)})}get isPaused(){return this.paused}get hasTasks(){return this.queue.length!==0}};r(He,"SerialQueue");var re=!1,k=re?C("zeed:throttle","error"):()=>{};function Qi(e,t={}){let{delay:n=100,trailing:o=!0,leading:i=!0}=t,s=0,u=0,a=0,d,g=Date.now();function h(){return s?(clearTimeout(s),s=void 0,!0):!1}r(h,"clearExistingTimeout");function x(...b){let v=Date.now(),w=v-u;function T(){let y=Date.now();return`total ${(y-g).toFixed(1)}ms - elapsed ${(y-u).toFixed(1)}ms - visited ${a}x`}r(T,"debugElapsed");let L=r(()=>{a=0,u=Date.now(),e.apply(this,b)},"exec");if(d=L,w>n||!s){re&&k("elapsed",T()),i&&(w>n?(re&&k("\u{1F680} leading",T()),L()):++a);let y=w>n?n:n-w;k(`\u23F1 start timeout with ${y.toFixed(1)}ms`,T()),h(),u=v,s=setTimeout(()=>{re&&k("\u23F1 reached timeout",T()),s=0,o&&(!i||a>0)&&(re&&k("\u{1F680} trailing",T()),d?.())},y)}else++a,re&&k("visited",T())}return r(x,"wrapper"),x.cancel=h,x.stop=()=>{h()&&d&&d()},x.immediate=r(async function(...v){h(),u=Date.now(),e.apply(this,v)},"immediate"),x.dispose=()=>x.stop(),x}r(Qi,"throttle");function Xi(e,t={}){let{delay:n=100}=t,o=0,i=!1,s;function u(){o&&(k("clear"),clearTimeout(o),o=0)}r(u,"clearExistingTimeout");async function a(){try{if(u(),s!=null){k("exec");let h=[...s];s=void 0,i=!0,await I(e(...h)),i=!1,k("exec done"),s!=null&&(u(),k("exec trigger next"),o=setTimeout(a,n))}}catch{}}r(a,"exec");function d(...h){s=[...h],u(),k("trigger"),i===!1&&(o=setTimeout(a,n))}r(d,"wrapper");async function g(...h){u(),s=[...h],await a()}return r(g,"immediate"),d.cancel=u,d.dispose=u,d.immediate=g,d}r(Xi,"debounce");function es(e=globalThis?.location?.hostname??""){return["::ffff:127.0.0.1","localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}r(es,"isLocalHost");function ts(e){let{level:t=void 0,filter:n=void 0,messages:o=[]}=e,i=R(n),s=V(t);return u=>{!s(u.level)||!i(u.name)||o.push(u)}}r(ts,"LoggerMemoryHandler");var oe=C("zeed:network","error"),Pt={cache:"no-cache",redirect:"follow",headers:{}};function kn(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[n,o]=t[1].split(":",2);return{url:e.replace(`${t[1]}@`,""),username:n,password:o}}}r(kn,"parseBasicAuth");async function Et(e,t={},n=fetch){try{O(t)&&(t=le({},...W(t)));let o=kn(String(e));o&&(e=o.url,t=le({},t,In(o.username,o.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let i=await n(String(e),t);if(i.status<400)return i;try{oe.warn(`Fetch of ${String(e)} returned status=${i.status}. Options:`,t),oe.warn(`Response: ${await i.text()}`)}catch(s){oe.error("Exception:",s)}}catch(o){oe.error("fetchBasic",o)}}r(Et,"fetchBasic");async function ns(e,t={},n=fetch){try{let o=await Et(e,[{method:"GET",headers:{Accept:"application/json"}},t],n);if(o)return await o.json()}catch(o){oe.error("fetchJSON error:",o)}}r(ns,"fetchJson");async function rs(e,t={},n=fetch){try{let o=await Et(e,[Pt,{method:"GET"},t],n);if(o)return await o.text()}catch(o){oe.error("fetchHTML error:",o)}}r(rs,"fetchText");function os(e,t="POST"){return{method:t,...Pt,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:Tt(e)}}r(os,"fetchOptionsFormURLEncoded");function is(e,t="POST"){return{method:t,...Pt,headers:{"Content-Type":"application/json; charset=utf-8"},body:E(e)}}r(is,"fetchOptionsJson");function In(e,t){return{headers:{Authorization:`Basic ${Qe(`${e}:${t}`)}`}}}r(In,"fetchOptionsBasicAuth");function St(){if(typeof window<"u")return window}r(St,"getWindow");function $n(){if(typeof navigator<"u")return navigator}r($n,"getNavigator");function ss(){return St()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}r(ss,"getGlobal");var N=$n(),Z=St();function On(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,test:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){return e.ios=N?.platform?.match(/(iPhone|iPod|iPad)/i)!=null,e.macos=!!N?.platform?.startsWith("Mac"),e.windows=!!N?.platform?.startsWith("Win"),e.beaker=Z?.beaker!=null,e.electron=(N?.userAgent?.toLowerCase()?.indexOf(" electron/")||-1)>-1&&!e.beaker,e.wkwebview=Z?.webkit?.messageHandlers!=null,e.pwa=N?.serviceWorker!=null,e.pwaInstalled=N?.standalone||Z?.matchMedia?.("(display-mode: standalone)")?.matches,e.node=typeof process<"u"&&process?.release?.name==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,e.jest=typeof jest<"u"||typeof vitest<"u",e.test=e.jest,e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=Z&&"ontouchstart"in Z||(N?.maxTouchPoints||0)>1||N?.msPointerEnabled&&Z?.MSGesture||Z?.DocumentTouch&&document instanceof DocumentTouch,e}r(On,"detect");var ze=r(()=>typeof window<"u"&&globalThis===window,"isBrowser"),as=On();function us(e){ze()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e)}r(us,"useExitHandler");var Ne=class{constructor(t={}){this.store={}}setItem(t,n){this.store[t]=Re(n)}getItem(t){return Re(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};r(Ne,"MemStorage");var cs=r(()=>{},"noop");var ls=C("zeed:base64","error");function fs(e){try{let t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),o=window.atob(n),i=new Uint8Array(o.length);for(let s=0;s<o.length;++s)i[s]=o.charCodeAt(s);return i}catch(t){ls.error(t,e)}}r(fs,"urlBase64ToUint8Array");var ds=C("zeed:gravatar","error");function ps(e,t){let n="0123456789abcdef".split("");function o(y,p){let c=y[0],l=y[1],f=y[2],m=y[3];c=s(c,l,f,m,p[0],7,-680876936),m=s(m,c,l,f,p[1],12,-389564586),f=s(f,m,c,l,p[2],17,606105819),l=s(l,f,m,c,p[3],22,-1044525330),c=s(c,l,f,m,p[4],7,-176418897),m=s(m,c,l,f,p[5],12,1200080426),f=s(f,m,c,l,p[6],17,-1473231341),l=s(l,f,m,c,p[7],22,-45705983),c=s(c,l,f,m,p[8],7,1770035416),m=s(m,c,l,f,p[9],12,-1958414417),f=s(f,m,c,l,p[10],17,-42063),l=s(l,f,m,c,p[11],22,-1990404162),c=s(c,l,f,m,p[12],7,1804603682),m=s(m,c,l,f,p[13],12,-40341101),f=s(f,m,c,l,p[14],17,-1502002290),l=s(l,f,m,c,p[15],22,1236535329),c=u(c,l,f,m,p[1],5,-165796510),m=u(m,c,l,f,p[6],9,-1069501632),f=u(f,m,c,l,p[11],14,643717713),l=u(l,f,m,c,p[0],20,-373897302),c=u(c,l,f,m,p[5],5,-701558691),m=u(m,c,l,f,p[10],9,38016083),f=u(f,m,c,l,p[15],14,-660478335),l=u(l,f,m,c,p[4],20,-405537848),c=u(c,l,f,m,p[9],5,568446438),m=u(m,c,l,f,p[14],9,-1019803690),f=u(f,m,c,l,p[3],14,-187363961),l=u(l,f,m,c,p[8],20,1163531501),c=u(c,l,f,m,p[13],5,-1444681467),m=u(m,c,l,f,p[2],9,-51403784),f=u(f,m,c,l,p[7],14,1735328473),l=u(l,f,m,c,p[12],20,-1926607734),c=a(c,l,f,m,p[5],4,-378558),m=a(m,c,l,f,p[8],11,-2022574463),f=a(f,m,c,l,p[11],16,1839030562),l=a(l,f,m,c,p[14],23,-35309556),c=a(c,l,f,m,p[1],4,-1530992060),m=a(m,c,l,f,p[4],11,1272893353),f=a(f,m,c,l,p[7],16,-155497632),l=a(l,f,m,c,p[10],23,-1094730640),c=a(c,l,f,m,p[13],4,681279174),m=a(m,c,l,f,p[0],11,-358537222),f=a(f,m,c,l,p[3],16,-722521979),l=a(l,f,m,c,p[6],23,76029189),c=a(c,l,f,m,p[9],4,-640364487),m=a(m,c,l,f,p[12],11,-421815835),f=a(f,m,c,l,p[15],16,530742520),l=a(l,f,m,c,p[2],23,-995338651),c=d(c,l,f,m,p[0],6,-198630844),m=d(m,c,l,f,p[7],10,1126891415),f=d(f,m,c,l,p[14],15,-1416354905),l=d(l,f,m,c,p[5],21,-57434055),c=d(c,l,f,m,p[12],6,1700485571),m=d(m,c,l,f,p[3],10,-1894986606),f=d(f,m,c,l,p[10],15,-1051523),l=d(l,f,m,c,p[1],21,-2054922799),c=d(c,l,f,m,p[8],6,1873313359),m=d(m,c,l,f,p[15],10,-30611744),f=d(f,m,c,l,p[6],15,-1560198380),l=d(l,f,m,c,p[13],21,1309151649),c=d(c,l,f,m,p[4],6,-145523070),m=d(m,c,l,f,p[11],10,-1120210379),f=d(f,m,c,l,p[2],15,718787259),l=d(l,f,m,c,p[9],21,-343485551),y[0]=w(c,y[0]),y[1]=w(l,y[1]),y[2]=w(f,y[2]),y[3]=w(m,y[3])}r(o,"md5cycle");function i(y,p,c,l,f,m){return p=w(w(p,y),w(l,m)),w(p<<f|p>>>32-f,c)}r(i,"cmn");function s(y,p,c,l,f,m,P){return i(p&c|~p&l,y,p,f,m,P)}r(s,"ff");function u(y,p,c,l,f,m,P){return i(p&l|c&~l,y,p,f,m,P)}r(u,"gg");function a(y,p,c,l,f,m,P){return i(p^c^l,y,p,f,m,P)}r(a,"hh");function d(y,p,c,l,f,m,P){return i(c^(p|~l),y,p,f,m,P)}r(d,"ii");function g(y){let p=y.length,c=[1732584193,-271733879,-1732584194,271733878],l;for(l=64;l<=y.length;l+=64)o(c,h(y.substring(l-64,l)));y=y.substring(l-64);let f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<y.length;l++)f[l>>2]|=y.charCodeAt(l)<<(l%4<<3);if(f[l>>2]|=128<<(l%4<<3),l>55)for(o(c,f),l=0;l<16;l++)f[l]=0;return f[14]=p*8,o(c,f),c}r(g,"md51");function h(y){let p=[],c;for(c=0;c<64;c+=4)p[c>>2]=y.charCodeAt(c)+(y.charCodeAt(c+1)<<8)+(y.charCodeAt(c+2)<<16)+(y.charCodeAt(c+3)<<24);return p}r(h,"md5blk");function x(y){let p="",c=0;for(;c<4;c++)p+=n[y>>c*8+4&15]+n[y>>c*8&15];return p}r(x,"rhex");function b(y){for(let p=0;p<y.length;p++)y[p]=x(y[p]);return y.join("")}r(b,"hex");function v(y){return b(g(y))}r(v,"md5");function w(y,p){return y+p&4294967295}r(w,"add32"),t=t||{};let T=[];t={size:t.size||"50",rating:t.rating||"g",secure:t.secure||location.protocol==="https:",backup:t.backup||""},e=e.trim().toLowerCase();let L=t.secure?"https://secure.gravatar.com/avatar/":"http://www.gravatar.com/avatar/";return t.rating&&T.push(`r=${t.rating}`),t.backup&&T.push(`d=${encodeURIComponent(t.backup)}`),t.size&&T.push(`s=${t.size}`),`${L+v(e)}?${T.join("&")}`}r(ps,"gravatar");function gs(e,t=""){try{return ps(e,{size:256,backup:"monsterid",secure:!0})}catch{return ds(`Gravatar issue: Did not find an image for ${e}`),t}}r(gs,"gravatarURLByEmail");var Bn=C("zeed:localstorage","error"),Ge=class{constructor(t){this.pretty=!1;Bn.assert(t.name,"name required"),this.name=t.name,this.prefix=`${t.name}$`,this.objectToString=t.objectToString??(n=>this.pretty?E(n,null,2):E(n)),this.objectFromString=t.objectFromString??(n=>{try{return JSON.parse(n)}catch(o){Bn.warn(`LocalStorage parse error '${o}' in`,n)}})}setItem(t,n){let o=this.objectToString(n);localStorage.setItem(`${this.prefix}${t}`,o)}getItem(t){let n=localStorage.getItem(`${this.prefix}${t}`);if(n!=null)return this.objectFromString(n)}removeItem(t){localStorage.removeItem(`${this.prefix}${t}`)}clear(){Object.keys(localStorage).filter(t=>t.startsWith(this.prefix)).forEach(t=>{localStorage.removeItem(t)})}allKeys(){let t=this.prefix.length;return Object.keys(localStorage).filter(n=>n.startsWith(this.prefix)).map(n=>n.substr(t))}};r(Ge,"LocalStorage");var _n=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function pe(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}r(pe,"supportsColors");function ge(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return _n[Math.abs(t)%_n.length]}r(ge,"selectColor");var Hn='font-family: "JetBrains Mono", Menlo; font-size: 11px;',ms=`${Hn}`,ys=`font-weight: 600; ${Hn}`,hs=pe(),jn={},xs=ee();function Ut(e={}){let{filter:t=void 0,level:n=void 0,colors:o=!0,padding:i=16,time:s=!0}=e,u=R(t),a=V(n);return d=>{if(!a(d.level)||!u(d.name))return;let g=s?`+${Lt(ee()-xs)}`:"",h=d.name||"",x=jn[h||""];x==null&&(x={color:ge(h)},jn[h]=x);let b;switch(i>0&&(h=h.padEnd(16," ")),o&&hs?(b=[`%c${h}%c %s %c${g}`],b.push(`color:${x.color}; ${ys}`),b.push(ms),b.push(d.messages?.[0]??""),b.push(`color:${x.color};`),b.push(...d.messages.slice(1))):b=[h,...d.messages,`+${g}`],b=b.map(v=>v instanceof Uint8Array?`<Uint8Array size=${v.length}>`:v),d.level){case 1:e.levelHelper&&(b[0]=`I|* ${b[0]}`),console.info(...b);break;case 2:e.levelHelper&&(b[0]=`W|** ${b[0]}`),console.warn(...b);break;case 3:e.levelHelper&&(b[0]=`E|*** ${b[0]}`),console.error(...b);break;default:e.levelHelper&&(b[0]=`D| ${b[0]}`),console.debug(...b);break}}}r(Ut,"LoggerBrowserHandler");var zn='font-family: "JetBrains Mono", Menlo; font-size: 11px;',bs=`${zn}`,ws=`font-weight: 600; ${zn}`,Ts=pe(),ie=r(()=>{},"noop");function Mt(e={}){let t=e.filter??localStorage.zeed??localStorage.debug;return r(function n(o="",i){let s,u=R(t),a=Y(i??-1);if(u(o)&&a!==1/0){let h=function(x,b){return a<=x?b:()=>{}};var d=h;r(h,"defineForLogLevel");let g=[];if(Ts){let x=ge(o);g.push(`%c${o.padEnd(16," ")}%c %s`),g.push(`color:${x}; ${ws}`),g.push(bs)}else g.push(`[${o}] %s`);s=h(0,console.debug.bind(console,...g)),s.debug=h(0,console.debug.bind(console,...g)),s.info=h(1,console.info.bind(console,...g)),s.warn=h(2,console.warn.bind(console,...g)),s.error=h(3,console.error.bind(console,...g)),s.fatal=h(4,(...x)=>{throw s.error(...x),new Error(`${x.map(String).join(" ")}`)}),s.assert=h(4,(x,...b)=>{(x==null||!x)&&s.fatal(...b)})}else s=r(()=>{},"log"),s.debug=ie,s.info=ie,s.warn=ie,s.error=ie,s.assert=ie,s.fatal=ie;return s.extend=g=>n(o?`${o}:${g}`:g),s.label=o,s},"LoggerBrowserDebugFactory")}r(Mt,"LoggerBrowserSetupDebugFactory");function Ls(e={}){console.info("activateConsoleDebug is activated by default in browsers")}r(Ls,"activateConsoleDebug");function Nn(){ze()&&(C.setHandlers([Ut()]),C.setFactory(Mt({})))}r(Nn,"setupBrowserLog");Nn();0&&(module.exports={CRYPTO_DEFAULT_ALG,CRYPTO_DEFAULT_DERIVE_ALG,CRYPTO_DEFAULT_DERIVE_ITERATIONS,CRYPTO_DEFAULT_HASH_ALG,Channel,CryptoEncoder,DAY_MS,Day,Emitter,JsonEncoder,LocalChannel,LocalStorage,LogLevel,LogLevelAlias,Logger,LoggerBrowserHandler,LoggerBrowserSetupDebugFactory,LoggerConsoleHandler,LoggerContext,LoggerMemoryHandler,MemStorage,NoopEncoder,PoolTaskIdConflictResolution,PoolTaskState,Progress,PubSub,SerialQueue,Uint8ArrayToHexDump,Uint8ArrayToJson,Uint8ArrayToString,XRX,_decodeUtf8Polyfill,_encodeUtf8Polyfill,activateConsoleDebug,arrayAvg,arrayBatches,arrayEmptyInPlace,arrayFilterInPlace,arrayFlatten,arrayIntersection,arrayIsEqual,arrayMax,arrayMin,arrayMinus,arrayRandomElement,arrayRemoveElement,arraySetElement,arrayShuffle,arrayShuffleForce,arrayShuffleInPlace,arraySorted,arraySortedNumbers,arraySum,arraySymmetricDifference,arrayToggleInPlace,arrayUnion,arrayUnique,avg,between,cloneJsonObject,cloneObject,cmp,composeOrderby,createArray,createLocalChannelPair,createPromise,createPromiseProxy,csvParse,csvParseToObjects,csvStringify,dateStringToDays,day,dayDay,dayDiff,dayFromAny,dayFromDate,dayFromDateGMT,dayFromParts,dayFromString,dayFromTimestamp,dayFromToday,dayIterator,dayMonth,dayMonthStart,dayOffset,dayRange,dayToDate,dayToDateGMT,dayToParts,dayToString,dayToTimestamp,dayYear,dayYearStart,debounce,decimal,decimalCentsPart,decimalFromCents,decimalToCents,decodeBase16,decodeBase32,decodeBase58,decodeBase62,decrypt,deepEqual,deepMerge,deepStripUndefinedInPlace,deriveKeyPbkdf2,detect,digest,empty,encodeBase16,encodeBase32,encodeBase58,encodeBase62,encodeQuery,encrypt,endSortWeight,ensureKey,ensureKeyAsync,equalBinary,escapeHTML,escapeRegExp,estimateSizeForBase,fetchBasic,fetchJson,fetchOptionsBasicAuth,fetchOptionsFormURLEncoded,fetchOptionsJson,fetchText,fixBrokenUth8String,forEachDay,forTimes,formatMessages,formatMilliseconds,fromBase64,fromBase64String,fromCamelCase,fromHex,getGlobal,getGlobalContext,getGlobalEmitter,getGlobalLogger,getNamespaceFilterString,getNavigator,getSecureRandom,getSecureRandomIfPossible,getTimestamp,getWindow,gravatarURLByEmail,immediate,isArray,isBoolean,isBrowser,isEven,isHalf,isInteger,isLocalHost,isNotNull,isNull,isNullOrUndefined,isNumber,isObject,isPrime,isPrimeRX,isPrimitive,isPromise,isRecord,isRecordPlain,isSafeInteger,isString,isTimeout,isUint8Array,isValue,joinToUint8Array,jsonStringify,jsonStringifySafe,jsonStringifySorted,jsonToUint8Array,last,lazyListener,linkifyPlainText,listDistinctUnion,listGroupBy,listOfKey,listQuery,memoize,memoizeAsync,messages,moveSortWeight,noop,objectIsEmpty,objectMap,objectMergeDisposable,parseBasicAuth,parseDate,parseLogLevel,parseOrderby,parseQuery,platform,promisify,qid,randomBoolean,randomFloat,randomInt,randomUint8Array,regExpEscape,regExpString,renderMessages,roundDown,roundHalfAwayFromZero,roundHalfDown,roundHalfEven,roundHalfOdd,roundHalfTowardsZero,roundHalfUp,roundUp,seededRandom,selectColor,setUuidDefaultEncoding,setupBrowserLog,size,sleep,sortedItems,sortedOrderby,startSortWeight,stringToBoolean,stringToFloat,stringToInteger,stringToUInt8Array,suid,suidBytes,suidBytesDate,suidDate,sum,supportsColors,throttle,timeout,timeoutReached,timoutError,toBase64,toBase64Url,toBool,toCamelCase,toCapitalize,toCapitalizeWords,toFloat,toHex,toHumanReadableUrl,toInt,toString,toUint8Array,toValidFilename,today,tryTimeout,uname,unescapeHTML,urlBase64ToUint8Array,useAsyncMutex,useBase,useDefer,useDispose,useDisposer,useEventListener,useExitHandler,useInterval,useLevelFilter,useMessageHub,useMutex,useNamespaceFilter,usePool,usePubSub,useRPC,useSorted,useTimeout,uuid,uuid32bit,uuidB32,uuidB62,uuidBytes,uuidDecode,uuidDecodeB32,uuidDecodeB62,uuidDecodeV4,uuidEncode,uuidEncodeB32,uuidEncodeB62,uuidEncodeV4,uuidIsValid,uuidv4,valueToBoolean,valueToFloat,valueToInteger,valueToString,waitOn});
12
12
  //# sourceMappingURL=index.browser.cjs.map