zeed 0.8.21 → 0.8.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ACYVDJ4S.js → chunk-MH5BHV5A.js} +2 -2
- package/dist/chunk-MH5BHV5A.js.map +1 -0
- package/dist/index.all.d.ts +1 -1
- package/dist/index.browser.cjs +1 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.ts +2 -2
- package/dist/index.browser.js +1 -1
- package/dist/index.node.cjs +1 -1
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +2 -2
- package/dist/index.node.js +1 -1
- package/dist/index.node.js.map +1 -1
- package/dist/{uuid-f7f2f4f2.d.ts → uuid-fe843f65.d.ts} +1 -1
- package/package.json +4 -4
- package/dist/chunk-ACYVDJ4S.js.map +0 -1
package/dist/index.browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as Json, O as ObjectStorage, L as LogHandlerOptions, a as LogHandler, b as LoggerInterface, c as LogLevel } from './uuid-
|
|
2
|
-
export { dt as ArgumentsType, cl as AsyncMutex, cG as AsyncReturnType, V as BinInput, d1 as Channel, d0 as ChannelMessageEvent, df as CryptoEncoder, au as Currency, as as CurrencyInput, av as DAY_MS, aS as Day, ax as DayInput, aR as DayInputLegacy, aw as DayValue, aY as DecimalInput, aX as DecimalValue, d7 as DefaultListener, cb as Disposable, ca as Disposer, c9 as DisposerFunction, d8 as Emitter, d5 as EmitterAllHandler, d4 as EmitterHandler, dc as Encoder, J as Json, de as JsonEncoder, d6 as ListenerSignature, d2 as LocalChannel, a as LogHandler, L as LogHandlerOptions, c as LogLevel, cQ as LogLevelAlias, cR as LogLevelAliasKey, cS as LogLevelAliasType, cT as LogMessage, cP as Logger, cW as LoggerConsoleHandler, cV as LoggerContext, cU as LoggerContextInterface, b as LoggerInterface, c$ as LoggerMemoryHandler, dP as MemStorage, dO as MemStorageOptions, di as Message, dg as MessageAction, dm as MessageDefinitions, dn as MessageHub, dh as MessageResult, dk as MessagesDefaultMethods, dl as MessagesMethods, dj as MessagesOptions, ck as Mutex, dT as NestedArray, dd as NoopEncoder, O as ObjectStorage, cu as Pool, cq as PoolTask, cs as PoolTaskEvents, co as PoolTaskFn, cr as PoolTaskIdConflictResolution, cp as PoolTaskState, b6 as Primitive, dr as PubSub, dw as RPCFn, dv as RPCOptions, dx as RPCReturn, ao as RenderMessagesOptions, du as ReturnType, bE as RoundingMode, cJ as SerialQueue, bP as SortableItem, cI as TaskEvents, cH as TaskFn, a8 as Uint8ArrayToHexDump, a7 as Uint8ArrayToJson, Y as Uint8ArrayToString, cg as UseDefer, cd as UseDispose, c8 as XRX, W as _decodeUtf8Polyfill, _ as _encodeUtf8Polyfill, E as arrayAvg, F as arrayBatches, t as arrayEmptyInPlace, q as arrayFilterInPlace, l as arrayFlatten, m as arrayIntersection, w as arrayIsEqual, B as arrayMax, C as arrayMin, j as arrayMinus, A as arrayRandomElement, o as arrayRemoveElement, p as arraySetElement, y as arrayShuffle, z as arrayShuffleForce, x as arrayShuffleInPlace, u as arraySorted, v as arraySortedNumbers, D as arraySum, n as arraySymmetricDifference, s as arrayToggleInPlace, k as arrayUnion, i as arrayUnique, bs as avg, bq as between, c2 as cloneJsonObject, c1 as cloneObject, bA as cmp, bz as composeOrderby, G as createArray, d3 as createLocalChannelPair, cv as createPromise, dp as createPromiseProxy, h as csv, at as currency, aW as dateStringToDays, aV as day, aA as dayDay, aQ as dayDiff, aE as dayFromAny, aG as dayFromDate, aH as dayFromDateGMT, aL as dayFromParts, aM as dayFromString, aJ as dayFromTimestamp, aD as dayFromToday, az as dayMonth, aN as dayMonthStart, aP as dayOffset, aC as dayToDate, aF as dayToDateGMT, aB as dayToParts, aK as dayToString, aI as dayToTimestamp, ay as dayYear, aO as dayYearStart, cL as debounce, aZ as decimal, b0 as decimalCentsPart, a_ as decimalFromCents, a$ as decimalToCents, K as decodeBase16, N as decodeBase32, Q as decodeBase58, S as decodeBase62, U as decodeBase64, g as decrypt, b1 as deepEqual, b3 as deepMerge, b2 as deepStripUndefinedInPlace, e as deriveKeyPbkdf2, dK as detect, d as digest, c0 as empty, I as encodeBase16, M as encodeBase32, P as encodeBase58, R as encodeBase62, T as encodeBase64, bW as encodeQuery, f as encrypt, bR as endSortWeight, bY as ensureKey, bZ as ensureKeyAsync, a5 as equalBinary, b4 as escapeHTML, bD as escapeRegExp, dB as fetchBasic, dC as fetchJson, dG as fetchOptionsBasicAuth, dE as fetchOptionsFormURLEncoded, dF as fetchOptionsJson, dD as fetchText, ar as fixBrokenUth8String, aT as forEachDay, c5 as forTimes, ap as formatMessages, dR as formatMilliseconds, a4 as fromBase64, ac as fromCamelCase, a1 as fromHex, dJ as getGlobal, cM as getGlobalContext, d9 as getGlobalEmitter, cO as getGlobalLogger, cX as getNamespaceFilterString, dI as getNavigator, bl as getSecureRandom, bm as getSecureRandomIfPossible, dQ as getTimestamp, dH as getWindow, dz as httpMethod, cx as immediate, b9 as isArray, bf as isBoolean, dL as isBrowser, bG as isEven, bF as isHalf, bd as isInteger, cN as isLocalHost, bg as isNullOrUndefined, bc as isNumber, b7 as isObject, bu as isPrime, bt as isPrimeRX, b8 as isPrimitive, cE as isPromise, ba as isRecord, be as isSafeInteger, bb as isString, cB as isTimeout, bh as isUint8Array, $ as joinToUint8Array, bk as jsonStringify, bj as jsonStringifySafe, bi as jsonStringifySorted, a6 as jsonToUint8Array, b$ as last, db as lazyListener, bU as linkifyPlainText, c3 as memoize, c4 as memoizeAsync, da as messages, bS as moveSortWeight, bw as objectMap, bx as objectMergeDisposable, dA as parseBasicAuth, dS as parseDate, cZ as parseLogLevel, by as parseOrderby, bX as parseQuery, dM as platform, cF as promisify, e3 as qid, bn as randomBoolean, bp as randomFloat, bo as randomInt, r as randomUint8Array, c7 as regExpEscape, c6 as regExpString, aq as renderMessages, bI as roundDown, bL as roundHalfAwayFromZero, bM as roundHalfDown, bN as roundHalfEven, bK as roundHalfOdd, bO as roundHalfTowardsZero, bJ as roundHalfUp, bH as roundUp, bv as seededRandom, b_ as size, cw as sleep, bT as sortedItems, bB as sortedOrderby, bQ as startSortWeight, ad as stringToBoolean, af as stringToFloat, ae as stringToInteger, X as stringToUInt8Array, e6 as suid, e5 as suidBytes, e8 as suidBytesDate, e7 as suidDate, br as sum, cK as throttle, cz as timeout, cy as timeoutReached, cA as timoutError, a2 as toBase64, a3 as toBase64Url, an as toBool, a9 as toCamelCase, aa as toCapitalize, ab as toCapitalizeWords, ak as toFloat, a0 as toHex, bV as toHumanReadableUrl, al as toInt, am as toString, Z as toUint8Array, bC as toValidFilename, aU as today, cC as tryTimeout, e2 as uname, b5 as unescapeHTML, cn as useAsyncMutex, H as useBase, cf as useDefer, cc as useDispose, ce as useDisposer, cj as useEventListener, dN as useExitHandler, ci as useInterval, c_ as useLevelFilter, dq as useMessageHub, cm as useMutex, cY as useNamespaceFilter, ct as usePool, ds as usePubSub, dy as useRPC, ch as useTimeout, dW as uuid, e1 as uuid32Decode, e0 as uuid32Encode, dV as uuid32bit, d$ as uuidB32, dU as uuidBytes, dZ as uuidDecode, d_ as uuidDecodeV4, dX as uuidEncode, dY as uuidEncodeV4, e4 as uuidv4, ag as valueToBoolean, ai as valueToFloat, ah as valueToInteger, aj as valueToString, cD as waitOn } from './uuid-
|
|
1
|
+
import { J as Json, O as ObjectStorage, L as LogHandlerOptions, a as LogHandler, b as LoggerInterface, c as LogLevel } from './uuid-fe843f65.js';
|
|
2
|
+
export { dt as ArgumentsType, cl as AsyncMutex, cG as AsyncReturnType, V as BinInput, d1 as Channel, d0 as ChannelMessageEvent, df as CryptoEncoder, au as Currency, as as CurrencyInput, av as DAY_MS, aS as Day, ax as DayInput, aR as DayInputLegacy, aw as DayValue, aY as DecimalInput, aX as DecimalValue, d7 as DefaultListener, cb as Disposable, ca as Disposer, c9 as DisposerFunction, d8 as Emitter, d5 as EmitterAllHandler, d4 as EmitterHandler, dc as Encoder, J as Json, de as JsonEncoder, d6 as ListenerSignature, d2 as LocalChannel, a as LogHandler, L as LogHandlerOptions, c as LogLevel, cQ as LogLevelAlias, cR as LogLevelAliasKey, cS as LogLevelAliasType, cT as LogMessage, cP as Logger, cW as LoggerConsoleHandler, cV as LoggerContext, cU as LoggerContextInterface, b as LoggerInterface, c$ as LoggerMemoryHandler, dP as MemStorage, dO as MemStorageOptions, di as Message, dg as MessageAction, dm as MessageDefinitions, dn as MessageHub, dh as MessageResult, dk as MessagesDefaultMethods, dl as MessagesMethods, dj as MessagesOptions, ck as Mutex, dT as NestedArray, dd as NoopEncoder, O as ObjectStorage, cu as Pool, cq as PoolTask, cs as PoolTaskEvents, co as PoolTaskFn, cr as PoolTaskIdConflictResolution, cp as PoolTaskState, b6 as Primitive, dr as PubSub, dw as RPCFn, dv as RPCOptions, dx as RPCReturn, ao as RenderMessagesOptions, du as ReturnType, bE as RoundingMode, cJ as SerialQueue, bP as SortableItem, cI as TaskEvents, cH as TaskFn, a8 as Uint8ArrayToHexDump, a7 as Uint8ArrayToJson, Y as Uint8ArrayToString, cg as UseDefer, cd as UseDispose, c8 as XRX, W as _decodeUtf8Polyfill, _ as _encodeUtf8Polyfill, E as arrayAvg, F as arrayBatches, t as arrayEmptyInPlace, q as arrayFilterInPlace, l as arrayFlatten, m as arrayIntersection, w as arrayIsEqual, B as arrayMax, C as arrayMin, j as arrayMinus, A as arrayRandomElement, o as arrayRemoveElement, p as arraySetElement, y as arrayShuffle, z as arrayShuffleForce, x as arrayShuffleInPlace, u as arraySorted, v as arraySortedNumbers, D as arraySum, n as arraySymmetricDifference, s as arrayToggleInPlace, k as arrayUnion, i as arrayUnique, bs as avg, bq as between, c2 as cloneJsonObject, c1 as cloneObject, bA as cmp, bz as composeOrderby, G as createArray, d3 as createLocalChannelPair, cv as createPromise, dp as createPromiseProxy, h as csv, at as currency, aW as dateStringToDays, aV as day, aA as dayDay, aQ as dayDiff, aE as dayFromAny, aG as dayFromDate, aH as dayFromDateGMT, aL as dayFromParts, aM as dayFromString, aJ as dayFromTimestamp, aD as dayFromToday, az as dayMonth, aN as dayMonthStart, aP as dayOffset, aC as dayToDate, aF as dayToDateGMT, aB as dayToParts, aK as dayToString, aI as dayToTimestamp, ay as dayYear, aO as dayYearStart, cL as debounce, aZ as decimal, b0 as decimalCentsPart, a_ as decimalFromCents, a$ as decimalToCents, K as decodeBase16, N as decodeBase32, Q as decodeBase58, S as decodeBase62, U as decodeBase64, g as decrypt, b1 as deepEqual, b3 as deepMerge, b2 as deepStripUndefinedInPlace, e as deriveKeyPbkdf2, dK as detect, d as digest, c0 as empty, I as encodeBase16, M as encodeBase32, P as encodeBase58, R as encodeBase62, T as encodeBase64, bW as encodeQuery, f as encrypt, bR as endSortWeight, bY as ensureKey, bZ as ensureKeyAsync, a5 as equalBinary, b4 as escapeHTML, bD as escapeRegExp, dB as fetchBasic, dC as fetchJson, dG as fetchOptionsBasicAuth, dE as fetchOptionsFormURLEncoded, dF as fetchOptionsJson, dD as fetchText, ar as fixBrokenUth8String, aT as forEachDay, c5 as forTimes, ap as formatMessages, dR as formatMilliseconds, a4 as fromBase64, ac as fromCamelCase, a1 as fromHex, dJ as getGlobal, cM as getGlobalContext, d9 as getGlobalEmitter, cO as getGlobalLogger, cX as getNamespaceFilterString, dI as getNavigator, bl as getSecureRandom, bm as getSecureRandomIfPossible, dQ as getTimestamp, dH as getWindow, dz as httpMethod, cx as immediate, b9 as isArray, bf as isBoolean, dL as isBrowser, bG as isEven, bF as isHalf, bd as isInteger, cN as isLocalHost, bg as isNullOrUndefined, bc as isNumber, b7 as isObject, bu as isPrime, bt as isPrimeRX, b8 as isPrimitive, cE as isPromise, ba as isRecord, be as isSafeInteger, bb as isString, cB as isTimeout, bh as isUint8Array, $ as joinToUint8Array, bk as jsonStringify, bj as jsonStringifySafe, bi as jsonStringifySorted, a6 as jsonToUint8Array, b$ as last, db as lazyListener, bU as linkifyPlainText, c3 as memoize, c4 as memoizeAsync, da as messages, bS as moveSortWeight, bw as objectMap, bx as objectMergeDisposable, dA as parseBasicAuth, dS as parseDate, cZ as parseLogLevel, by as parseOrderby, bX as parseQuery, dM as platform, cF as promisify, e3 as qid, bn as randomBoolean, bp as randomFloat, bo as randomInt, r as randomUint8Array, c7 as regExpEscape, c6 as regExpString, aq as renderMessages, bI as roundDown, bL as roundHalfAwayFromZero, bM as roundHalfDown, bN as roundHalfEven, bK as roundHalfOdd, bO as roundHalfTowardsZero, bJ as roundHalfUp, bH as roundUp, bv as seededRandom, b_ as size, cw as sleep, bT as sortedItems, bB as sortedOrderby, bQ as startSortWeight, ad as stringToBoolean, af as stringToFloat, ae as stringToInteger, X as stringToUInt8Array, e6 as suid, e5 as suidBytes, e8 as suidBytesDate, e7 as suidDate, br as sum, cK as throttle, cz as timeout, cy as timeoutReached, cA as timoutError, a2 as toBase64, a3 as toBase64Url, an as toBool, a9 as toCamelCase, aa as toCapitalize, ab as toCapitalizeWords, ak as toFloat, a0 as toHex, bV as toHumanReadableUrl, al as toInt, am as toString, Z as toUint8Array, bC as toValidFilename, aU as today, cC as tryTimeout, e2 as uname, b5 as unescapeHTML, cn as useAsyncMutex, H as useBase, cf as useDefer, cc as useDispose, ce as useDisposer, cj as useEventListener, dN as useExitHandler, ci as useInterval, c_ as useLevelFilter, dq as useMessageHub, cm as useMutex, cY as useNamespaceFilter, ct as usePool, ds as usePubSub, dy as useRPC, ch as useTimeout, dW as uuid, e1 as uuid32Decode, e0 as uuid32Encode, dV as uuid32bit, d$ as uuidB32, dU as uuidBytes, dZ as uuidDecode, d_ as uuidDecodeV4, dX as uuidEncode, dY as uuidEncodeV4, e4 as uuidv4, ag as valueToBoolean, ai as valueToFloat, ah as valueToInteger, aj as valueToString, cD as waitOn } from './uuid-fe843f65.js';
|
|
3
3
|
|
|
4
4
|
declare function urlBase64ToUint8Array(base64String: string): Uint8Array | undefined;
|
|
5
5
|
|
package/dist/index.browser.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as Ke,$a as Kr,$b as Po,$c as Kn,A as ye,Aa as yr,Ab as vo,Ac as wn,Ad as yt,B as ve,Ba as vr,Bb as wo,Bc as Ln,Bd as vt,C as we,Ca as wr,Cb as Lo,Cc as xn,Cd as wt,D as Le,Da as Lr,Db as xo,Dc as $n,Dd as Lt,E as xe,Ea as xr,Eb as $o,Ec as Sn,Ed as xt,F as $e,Fa as $r,Fb as So,Fc as Hn,Fd as $t,G as Se,Ga as Sr,Gb as Ho,Gc as kn,Gd as St,H as He,Ha as Hr,Hb as ko,Hc as An,Hd as Ht,I as ke,Ia as kr,Ib as Ao,Ic as jn,Id as kt,J as Ae,Ja as Ar,Jb as jo,Jc as En,Jd as At,K as je,Ka as jr,Kb as Eo,Kc as In,Kd as jt,L as Ee,La as Er,Lb as Io,Lc as On,Ld as Et,M as Ie,Ma as Ir,Mb as Oo,Mc as Bn,Md as It,N as Oe,Na as Or,Nb as Bo,Nc as Tn,Nd as Ot,O as Be,Oa as Br,Ob as To,Oc as zn,Od as Bt,P as Te,Pa as Tr,Pb as zo,Pc as Dn,Pd as Tt,Q as ze,Qa as zr,Qb as Do,Qc as Nn,Qd as zt,R as De,Ra as Dr,Rb as No,Rc as qn,Rd as z,S as Ne,Sa as Nr,Sb as qo,Sc as Mn,Sd as Dt,T as qe,Ta as qr,Tb as Mo,Tc as Jn,Td as Nt,U as Me,Ua as Mr,Ub as Jo,Uc as Rn,Ud as qt,V as Je,Va as Jr,Vb as Ro,Vc as $,W as Re,Wa as Rr,Wb as Uo,Wc as j,X as Ue,Xa as Ur,Xb as Wo,Xc as Un,Y as We,Ya as Wr,Yb as _o,Yc as Wn,Z as _e,Za as _r,Zb as Go,Zc as _n,_ as Ge,_a as Gr,_b as Ko,_c as Gn,a as u,aa as Pe,ab as Pr,ac as Qo,ad as Pn,b as ee,ba as Qe,bb as Qr,bc as Vo,bd as Qn,c as re,ca as Ve,cb as Vr,cc as Xo,cd as Vn,d as oe,da as Xe,db as Xr,dc as Yo,dd as Xn,e as ne,ea as Ye,eb as Yr,ec as Zo,ed as Yn,f as te,fa as Ze,fb as Zr,fc as en,fd as Zn,g as se,ga as er,gb as eo,gc as rn,gd as et,h as ae,ha as rr,hb as ro,hc as on,hd as rt,i as ie,ia as or,ib as oo,ic as nn,id as ot,j as le,ja as nr,jb as no,jc as tn,jd as nt,k as ce,ka as tr,kb as to,kc as sn,kd as tt,l as ue,la as sr,lb as so,lc as an,ld as st,m as ge,ma as ar,mb as ao,mc as ln,md as at,n as I,na as ir,nb as io,nc as cn,nd as it,o as fe,oa as lr,ob as lo,oc as un,od as lt,p as Ce,pa as cr,pb as co,pc as gn,pd as ct,q as me,qa as ur,qb as uo,qc as fn,qd as ut,r as S,ra as gr,rb as go,rc as Cn,rd as gt,s as pe,sa as fr,sb as fo,sc as mn,sd as ft,t as A,ta as Cr,tb as Co,tc as pn,td as Ct,u as de,ua as mr,ub as mo,uc as dn,ud as mt,v as T,va as pr,vb as po,vc as bn,vd as pt,w as be,wa as dr,wb as bo,wc as Fn,wd as dt,x as Fe,xa as br,xb as Fo,xc as hn,xd as bt,y as he,ya as Fr,yb as ho,yc as yn,yd as Ft,z as w,za as hr,zb as yo,zc as vn,zd as ht}from"./chunk-ACYVDJ4S.js";var{error:K}=w("zeed:base64");function Jt(m){try{let l="=".repeat((4-m.length%4)%4),g=(m+l).replace(/-/g,"+").replace(/_/g,"/"),p=window.atob(g),a=new Uint8Array(p.length);for(let f=0;f<p.length;++f)a[f]=p.charCodeAt(f);return a}catch(l){K(l,m)}}u(Jt,"urlBase64ToUint8Array");var P=w("zeed:gravatar");function Q(m,b){function g(s,n){var r=s[0],e=s[1],o=s[2],t=s[3];r=a(r,e,o,t,n[0],7,-680876936),t=a(t,r,e,o,n[1],12,-389564586),o=a(o,t,r,e,n[2],17,606105819),e=a(e,o,t,r,n[3],22,-1044525330),r=a(r,e,o,t,n[4],7,-176418897),t=a(t,r,e,o,n[5],12,1200080426),o=a(o,t,r,e,n[6],17,-1473231341),e=a(e,o,t,r,n[7],22,-45705983),r=a(r,e,o,t,n[8],7,1770035416),t=a(t,r,e,o,n[9],12,-1958414417),o=a(o,t,r,e,n[10],17,-42063),e=a(e,o,t,r,n[11],22,-1990404162),r=a(r,e,o,t,n[12],7,1804603682),t=a(t,r,e,o,n[13],12,-40341101),o=a(o,t,r,e,n[14],17,-1502002290),e=a(e,o,t,r,n[15],22,1236535329),r=f(r,e,o,t,n[1],5,-165796510),t=f(t,r,e,o,n[6],9,-1069501632),o=f(o,t,r,e,n[11],14,643717713),e=f(e,o,t,r,n[0],20,-373897302),r=f(r,e,o,t,n[5],5,-701558691),t=f(t,r,e,o,n[10],9,38016083),o=f(o,t,r,e,n[15],14,-660478335),e=f(e,o,t,r,n[4],20,-405537848),r=f(r,e,o,t,n[9],5,568446438),t=f(t,r,e,o,n[14],9,-1019803690),o=f(o,t,r,e,n[3],14,-187363961),e=f(e,o,t,r,n[8],20,1163531501),r=f(r,e,o,t,n[13],5,-1444681467),t=f(t,r,e,o,n[2],9,-51403784),o=f(o,t,r,e,n[7],14,1735328473),e=f(e,o,t,r,n[12],20,-1926607734),r=i(r,e,o,t,n[5],4,-378558),t=i(t,r,e,o,n[8],11,-2022574463),o=i(o,t,r,e,n[11],16,1839030562),e=i(e,o,t,r,n[14],23,-35309556),r=i(r,e,o,t,n[1],4,-1530992060),t=i(t,r,e,o,n[4],11,1272893353),o=i(o,t,r,e,n[7],16,-155497632),e=i(e,o,t,r,n[10],23,-1094730640),r=i(r,e,o,t,n[13],4,681279174),t=i(t,r,e,o,n[0],11,-358537222),o=i(o,t,r,e,n[3],16,-722521979),e=i(e,o,t,r,n[6],23,76029189),r=i(r,e,o,t,n[9],4,-640364487),t=i(t,r,e,o,n[12],11,-421815835),o=i(o,t,r,e,n[15],16,530742520),e=i(e,o,t,r,n[2],23,-995338651),r=c(r,e,o,t,n[0],6,-198630844),t=c(t,r,e,o,n[7],10,1126891415),o=c(o,t,r,e,n[14],15,-1416354905),e=c(e,o,t,r,n[5],21,-57434055),r=c(r,e,o,t,n[12],6,1700485571),t=c(t,r,e,o,n[3],10,-1894986606),o=c(o,t,r,e,n[10],15,-1051523),e=c(e,o,t,r,n[1],21,-2054922799),r=c(r,e,o,t,n[8],6,1873313359),t=c(t,r,e,o,n[15],10,-30611744),o=c(o,t,r,e,n[6],15,-1560198380),e=c(e,o,t,r,n[13],21,1309151649),r=c(r,e,o,t,n[4],6,-145523070),t=c(t,r,e,o,n[11],10,-1120210379),o=c(o,t,r,e,n[2],15,718787259),e=c(e,o,t,r,n[9],21,-343485551),s[0]=y(r,s[0]),s[1]=y(e,s[1]),s[2]=y(o,s[2]),s[3]=y(t,s[3])}u(g,"md5cycle");function p(s,n,r,e,o,t){return n=y(y(n,s),y(e,t)),y(n<<o|n>>>32-o,r)}u(p,"cmn");function a(s,n,r,e,o,t,x){return p(n&r|~n&e,s,n,o,t,x)}u(a,"ff");function f(s,n,r,e,o,t,x){return p(n&e|r&~e,s,n,o,t,x)}u(f,"gg");function i(s,n,r,e,o,t,x){return p(n^r^e,s,n,o,t,x)}u(i,"hh");function c(s,n,r,e,o,t,x){return p(r^(n|~e),s,n,o,t,x)}u(c,"ii");function F(s){var n=s.length,r=[1732584193,-271733879,-1732584194,271733878],e;for(e=64;e<=s.length;e+=64)g(r,h(s.substring(e-64,e)));s=s.substring(e-64);var o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<s.length;e++)o[e>>2]|=s.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(g(r,o),e=0;e<16;e++)o[e]=0;return o[14]=n*8,g(r,o),r}u(F,"md51");function h(s){var n=[],r;for(r=0;r<64;r+=4)n[r>>2]=s.charCodeAt(r)+(s.charCodeAt(r+1)<<8)+(s.charCodeAt(r+2)<<16)+(s.charCodeAt(r+3)<<24);return n}u(h,"md5blk");function C(s){for(var n="",r=0;r<4;r++)n+=d[s>>r*8+4&15]+d[s>>r*8&15];return n}u(C,"rhex");function v(s){for(var n=0;n<s.length;n++)s[n]=C(s[n]);return s.join("")}u(v,"hex");function L(s){return v(F(s))}u(L,"md5");function y(s,n){return s+n&4294967295}u(y,"add32");var d="0123456789abcdef".split(""),b=b||{},B,k=[];return b={size:b.size||"50",rating:b.rating||"g",secure:b.secure||location.protocol==="https:",backup:b.backup||""},m=m.trim().toLowerCase(),B=b.secure?"https://secure.gravatar.com/avatar/":"http://www.gravatar.com/avatar/",b.rating&&k.push("r="+b.rating),b.backup&&k.push("d="+encodeURIComponent(b.backup)),b.size&&k.push("s="+b.size),B+L(m)+"?"+k.join("&")}u(Q,"gravatar");function Wt(m,l=""){try{return Q(m,{size:256,backup:"monsterid",secure:!0})}catch{return P("Gravatar issue: Did not find an image for "+m),l}}u(Wt,"gravatarURLByEmail");var D=w("zeed:localstorage"),O=class{constructor(l){this.pretty=!1;D.assert(l.name,"name required"),this.name=l.name,this.prefix=`${l.name}$`,this.objectToString=l.objectToString??(g=>this.pretty?JSON.stringify(g,null,2):JSON.stringify(g)),this.objectFromString=l.objectFromString??(g=>{try{return JSON.parse(g)}catch(p){D.warn(`LocalStorage parse error '${p}' in`,g)}})}setItem(l,g){let p=this.objectToString(g);localStorage.setItem(`${this.prefix}${l}`,p)}getItem(l){let g=localStorage.getItem(`${this.prefix}${l}`);if(g!=null)return this.objectFromString(g)}removeItem(l){localStorage.removeItem(`${this.prefix}${l}`)}clear(){Object.keys(localStorage).filter(l=>l.startsWith(this.prefix)).forEach(l=>{localStorage.removeItem(l)})}allKeys(){let l=this.prefix.length;return Object.keys(localStorage).filter(g=>g.startsWith(this.prefix)).map(g=>g.substr(l))}};u(O,"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 E(){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+)/)}u(E,"supportsColors");function H(m){let l=0;for(let g=0;g<m.length;g++)l=(l<<5)-l+m.charCodeAt(g),l|=0;return N[Math.abs(l)%N.length]}u(H,"selectColor");var M='font-family: "JetBrains Mono", Menlo; font-size: 11px;',J=`${M}`,R=`font-weight: 600; ${M}`,U=E(),q={},V=$();function W(m={}){let{filter:l=void 0,level:g=void 0,colors:p=!0,levelHelper:a=!1,nameBrackets:f=!0,padding:i=16}=m,c=S(l),F=A(g);return h=>{var b;if(!F(h.level)||!c(h.name))return;let C=$(),v=h.name||"",L=q[v||""];L==null&&(L={color:H(v)},q[v]=L);let y=j(C-V),d;switch(i>0&&(v=v.padEnd(16," ")),p&&U?(d=[`%c${v}%c %s %c+${y}`],d.push(`color:${L.color}; ${R}`),d.push(J),d.push(((b=h.messages)==null?void 0:b[0])??""),d.push(`color:${L.color};`),d.push(...h.messages.slice(1))):d=[v,...h.messages,`+${y}`],h.level){case 1:m.levelHelper&&(d[0]="I|* "+d[0]),console.info(...d);break;case 2:m.levelHelper&&(d[0]="W|** "+d[0]),console.warn(...d);break;case 3:m.levelHelper&&(d[0]="E|*** "+d[0]),console.error(...d);break;default:m.levelHelper&&(d[0]="D| "+d[0]),console.debug(...d);break}}}u(W,"LoggerBrowserHandler");function _(m={}){let l=m.filter??localStorage.zeed??localStorage.debug;return u(function g(p=""){let a;if(S(l)(p)){let i=[];if(U){let c=H(p);i.push(`%c${p.padEnd(16," ")}%c %s`),i.push(`color:${c}; ${R}`),i.push(J)}else i.push(`[${p}] %s`);a=console.debug.bind(console,...i),a.debug=console.debug.bind(console,...i),a.info=console.info.bind(console,...i),a.warn=console.warn.bind(console,...i),a.error=console.error.bind(console,...i),a.assert=console.assert.bind(console),a.assertEqual=function(c,F,...h){let C=I(c,F);C||a.assert(C,`Assert did fail. Expected ${F} got ${c}`,F,c,...h)},a.assertNotEqual=function(c,F,...h){let C=I(c,F);C&&a.assert(C,`Assert did fail. Expected ${F} not to be equal with ${c}`,F,c,...h)}}else{let i=u(()=>{},"noop");a=i,a.debug=i,a.info=i,a.warn=i,a.error=i,a.assert=i,a.assertEqual=i,a.assertNotEqual=i}return a.extend=i=>g(p?`${p}:${i}`:i),a.label=p,a},"LoggerBrowserDebugFactory")}u(_,"LoggerBrowserSetupDebugFactory");function ts(m={}){console.info("activateConsoleDebug is activated by default in browsers")}u(ts,"activateConsoleDebug");var G={},X=$(),Y=E();function Cs(m,l={}){let{filter:g=void 0}=l,p=S(g),a=A(m);return f=>{if(!a(f.level)||!p(f.name))return;let i=$(),c=f.name||"",F=G[c||""];F==null&&(F={color:H(c)},G[c]=F);let h=j(i-X),C;switch(l.colors&&Y?(C=l.nameBrackets?[`%c[${c}]`]:[`%c${c}`],C.push(`color:${F.color}`),C.push(...f.messages)):C=[c,...f.messages],C.push(`+${h}`),f.level){case 1:l.levelHelper&&(C[0]="I|* "+C[0]),console.info(...C);break;case 2:l.levelHelper&&(C[0]="W|** "+C[0]),console.warn(...C);break;case 3:l.levelHelper&&(C[0]="E|*** "+C[0]),console.error(...C);break;default:l.levelHelper&&(C[0]="D| "+C[0]),console.debug(...C);break}}}u(Cs,"LoggerBrowserClassicHandler");function Z(){z()&&(w.setHandlers([W()]),w.setFactory(_({})))}u(Z,"setupBrowserLog");Z();export{pt as Channel,yt as CryptoEncoder,so as Currency,ao as DAY_MS,No as Day,qn as Emitter,ht as JsonEncoder,dt as LocalChannel,O as LocalStorage,T as LogLevel,be as LogLevelAlias,w as Logger,Cs as LoggerBrowserClassicHandler,W as LoggerBrowserHandler,_ as LoggerBrowserSetupDebugFactory,de as LoggerConsoleHandler,Fe as LoggerContext,mt as LoggerMemoryHandler,qt as MemStorage,Ft as NoopEncoder,lt as PoolTaskIdConflictResolution,it as PoolTaskState,Lt as PubSub,ut as SerialQueue,Be as Uint8ArrayToHexDump,Oe as Uint8ArrayToJson,Le as Uint8ArrayToString,jn as XRX,ve as _decodeUtf8Polyfill,ye as _encodeUtf8Polyfill,ts as activateConsoleDebug,Lr as arrayAvg,xr as arrayBatches,fr as arrayEmptyInPlace,ur as arrayFilterInPlace,sr as arrayFlatten,ar as arrayIntersection,pr as arrayIsEqual,yr as arrayMax,vr as arrayMin,nr as arrayMinus,hr as arrayRandomElement,lr as arrayRemoveElement,cr as arraySetElement,br as arrayShuffle,Fr as arrayShuffleForce,dr as arrayShuffleInPlace,Cr as arraySorted,mr as arraySortedNumbers,wr as arraySum,ir as arraySymmetricDifference,gr as arrayToggleInPlace,tr as arrayUnion,or as arrayUnique,Pe as avg,Ge as between,xn as cloneJsonObject,Ln as cloneObject,er as cmp,Ze as composeOrderby,$r as createArray,bt as createLocalChannelPair,Ho as createPromise,vt as createPromiseProxy,Me as csv,to as currency,Ro as dateStringToDays,Jo as day,co as dayDay,So as dayDiff,Co as dayFromAny,po as dayFromDate,bo as dayFromDateGMT,vo as dayFromParts,wo as dayFromString,ho as dayFromTimestamp,fo as dayFromToday,lo as dayMonth,Lo as dayMonthStart,$o as dayOffset,go as dayToDate,mo as dayToDateGMT,uo as dayToParts,yo as dayToString,Fo as dayToTimestamp,io as dayYear,xo as dayYearStart,ft as debounce,Uo as decimal,Go as decimalCentsPart,Wo as decimalFromCents,_o as decimalToCents,kr as decodeBase16,jr as decodeBase32,Ir as decodeBase58,Br as decodeBase62,zr as decodeBase64,qe as decrypt,I as deepEqual,Ce as deepMerge,fe as deepStripUndefinedInPlace,De as deriveKeyPbkdf2,zt as detect,ze as digest,wn as empty,Hr as encodeBase16,Ar as encodeBase32,Er as encodeBase58,Or as encodeBase62,Tr as encodeBase64,dn as encodeQuery,Ne as encrypt,gn as endSortWeight,Fn as ensureKey,hn as ensureKeyAsync,Ee as equalBinary,Ko as escapeHTML,Yo as escapeRegExp,Ht as fetchBasic,kt as fetchJson,It as fetchOptionsBasicAuth,jt as fetchOptionsFormURLEncoded,Et as fetchOptionsJson,At as fetchText,no as fixBrokenUth8String,qo as forEachDay,Hn as forTimes,ro as formatMessages,j as formatMilliseconds,je as fromBase64,Mr as fromCamelCase,He as fromHex,Tt as getGlobal,ee as getGlobalContext,Mn as getGlobalEmitter,he as getGlobalLogger,me as getNamespaceFilterString,Bt as getNavigator,Je as getSecureRandom,Re as getSecureRandomIfPossible,$ as getTimestamp,Ot as getWindow,Wt as gravatarURLByEmail,Ao as immediate,ne as isArray,ce as isBoolean,z as isBrowser,en as isEven,Zo as isHalf,ie as isInteger,Ct as isLocalHost,ue as isNullOrUndefined,ae as isNumber,re as isObject,Ve as isPrime,Qe as isPrimeRX,oe as isPrimitive,zo as isPromise,te as isRecord,le as isSafeInteger,se as isString,Oo as isTimeout,ge as isUint8Array,$e as joinToUint8Array,Ur as jsonStringify,Rr as jsonStringifySafe,Jr as jsonStringifySorted,Ie as jsonToUint8Array,vn as last,Rn as lazyListener,mn as linkifyPlainText,$n as memoize,Sn as memoizeAsync,Jn as messages,fn as moveSortWeight,Qo as objectMap,Vo as objectMergeDisposable,St as parseBasicAuth,Un as parseDate,pe as parseLogLevel,Ye as parseOrderby,bn as parseQuery,Dt as platform,Do as promisify,rt as qid,Ue as randomBoolean,_e as randomFloat,We as randomInt,Te as randomUint8Array,An as regExpEscape,kn as regExpString,oo as renderMessages,on as roundDown,sn as roundHalfAwayFromZero,an as roundHalfDown,ln as roundHalfEven,tn as roundHalfOdd,cn as roundHalfTowardsZero,nn as roundHalfUp,rn as roundUp,Xe as seededRandom,H as selectColor,Z as setupBrowserLog,yn as size,ko as sleep,Cn as sortedItems,rr as sortedOrderby,un as startSortWeight,Wr as stringToBoolean,Gr as stringToFloat,_r as stringToInteger,we as stringToUInt8Array,tt as suid,nt as suidBytes,at as suidBytesDate,st as suidDate,Ke as sum,E as supportsColors,gt as throttle,Eo as timeout,jo as timeoutReached,Io as timoutError,ke as toBase64,Ae as toBase64Url,eo as toBool,Dr as toCamelCase,Nr as toCapitalize,qr as toCapitalizeWords,Xr as toFloat,Se as toHex,pn as toHumanReadableUrl,Yr as toInt,Zr as toString,xe as toUint8Array,Xo as toValidFilename,Mo as today,Bo as tryTimeout,et as uname,Po as unescapeHTML,Jt as urlBase64ToUint8Array,Nn as useAsyncMutex,Sr as useBase,On as useDefer,En as useDispose,In as useDisposer,zn as useEventListener,Nt as useExitHandler,Tn as useInterval,A as useLevelFilter,wt as useMessageHub,Dn as useMutex,S as useNamespaceFilter,ct as usePool,xt as usePubSub,$t as useRPC,Bn as useTimeout,Gn as uuid,Zn as uuid32Decode,Yn as uuid32Encode,_n as uuid32bit,Xn as uuidB32,Wn as uuidBytes,Qn as uuidDecode,Vn as uuidDecodeV4,Kn as uuidEncode,Pn as uuidEncodeV4,ot as uuidv4,Kr as valueToBoolean,Qr as valueToFloat,Pr as valueToInteger,Vr as valueToString,To as waitOn};
|
|
1
|
+
import{$ as Ke,$a as Kr,$b as Po,$c as Kn,A as ye,Aa as yr,Ab as vo,Ac as wn,Ad as yt,B as ve,Ba as vr,Bb as wo,Bc as Ln,Bd as vt,C as we,Ca as wr,Cb as Lo,Cc as xn,Cd as wt,D as Le,Da as Lr,Db as xo,Dc as $n,Dd as Lt,E as xe,Ea as xr,Eb as $o,Ec as Sn,Ed as xt,F as $e,Fa as $r,Fb as So,Fc as Hn,Fd as $t,G as Se,Ga as Sr,Gb as Ho,Gc as kn,Gd as St,H as He,Ha as Hr,Hb as ko,Hc as An,Hd as Ht,I as ke,Ia as kr,Ib as Ao,Ic as jn,Id as kt,J as Ae,Ja as Ar,Jb as jo,Jc as En,Jd as At,K as je,Ka as jr,Kb as Eo,Kc as In,Kd as jt,L as Ee,La as Er,Lb as Io,Lc as On,Ld as Et,M as Ie,Ma as Ir,Mb as Oo,Mc as Bn,Md as It,N as Oe,Na as Or,Nb as Bo,Nc as Tn,Nd as Ot,O as Be,Oa as Br,Ob as To,Oc as zn,Od as Bt,P as Te,Pa as Tr,Pb as zo,Pc as Dn,Pd as Tt,Q as ze,Qa as zr,Qb as Do,Qc as Nn,Qd as zt,R as De,Ra as Dr,Rb as No,Rc as qn,Rd as z,S as Ne,Sa as Nr,Sb as qo,Sc as Mn,Sd as Dt,T as qe,Ta as qr,Tb as Mo,Tc as Jn,Td as Nt,U as Me,Ua as Mr,Ub as Jo,Uc as Rn,Ud as qt,V as Je,Va as Jr,Vb as Ro,Vc as $,W as Re,Wa as Rr,Wb as Uo,Wc as j,X as Ue,Xa as Ur,Xb as Wo,Xc as Un,Y as We,Ya as Wr,Yb as _o,Yc as Wn,Z as _e,Za as _r,Zb as Go,Zc as _n,_ as Ge,_a as Gr,_b as Ko,_c as Gn,a as u,aa as Pe,ab as Pr,ac as Qo,ad as Pn,b as ee,ba as Qe,bb as Qr,bc as Vo,bd as Qn,c as re,ca as Ve,cb as Vr,cc as Xo,cd as Vn,d as oe,da as Xe,db as Xr,dc as Yo,dd as Xn,e as ne,ea as Ye,eb as Yr,ec as Zo,ed as Yn,f as te,fa as Ze,fb as Zr,fc as en,fd as Zn,g as se,ga as er,gb as eo,gc as rn,gd as et,h as ae,ha as rr,hb as ro,hc as on,hd as rt,i as ie,ia as or,ib as oo,ic as nn,id as ot,j as le,ja as nr,jb as no,jc as tn,jd as nt,k as ce,ka as tr,kb as to,kc as sn,kd as tt,l as ue,la as sr,lb as so,lc as an,ld as st,m as ge,ma as ar,mb as ao,mc as ln,md as at,n as I,na as ir,nb as io,nc as cn,nd as it,o as fe,oa as lr,ob as lo,oc as un,od as lt,p as Ce,pa as cr,pb as co,pc as gn,pd as ct,q as me,qa as ur,qb as uo,qc as fn,qd as ut,r as S,ra as gr,rb as go,rc as Cn,rd as gt,s as pe,sa as fr,sb as fo,sc as mn,sd as ft,t as A,ta as Cr,tb as Co,tc as pn,td as Ct,u as de,ua as mr,ub as mo,uc as dn,ud as mt,v as T,va as pr,vb as po,vc as bn,vd as pt,w as be,wa as dr,wb as bo,wc as Fn,wd as dt,x as Fe,xa as br,xb as Fo,xc as hn,xd as bt,y as he,ya as Fr,yb as ho,yc as yn,yd as Ft,z as w,za as hr,zb as yo,zc as vn,zd as ht}from"./chunk-MH5BHV5A.js";var{error:K}=w("zeed:base64");function Jt(m){try{let l="=".repeat((4-m.length%4)%4),g=(m+l).replace(/-/g,"+").replace(/_/g,"/"),p=window.atob(g),a=new Uint8Array(p.length);for(let f=0;f<p.length;++f)a[f]=p.charCodeAt(f);return a}catch(l){K(l,m)}}u(Jt,"urlBase64ToUint8Array");var P=w("zeed:gravatar");function Q(m,b){function g(s,n){var r=s[0],e=s[1],o=s[2],t=s[3];r=a(r,e,o,t,n[0],7,-680876936),t=a(t,r,e,o,n[1],12,-389564586),o=a(o,t,r,e,n[2],17,606105819),e=a(e,o,t,r,n[3],22,-1044525330),r=a(r,e,o,t,n[4],7,-176418897),t=a(t,r,e,o,n[5],12,1200080426),o=a(o,t,r,e,n[6],17,-1473231341),e=a(e,o,t,r,n[7],22,-45705983),r=a(r,e,o,t,n[8],7,1770035416),t=a(t,r,e,o,n[9],12,-1958414417),o=a(o,t,r,e,n[10],17,-42063),e=a(e,o,t,r,n[11],22,-1990404162),r=a(r,e,o,t,n[12],7,1804603682),t=a(t,r,e,o,n[13],12,-40341101),o=a(o,t,r,e,n[14],17,-1502002290),e=a(e,o,t,r,n[15],22,1236535329),r=f(r,e,o,t,n[1],5,-165796510),t=f(t,r,e,o,n[6],9,-1069501632),o=f(o,t,r,e,n[11],14,643717713),e=f(e,o,t,r,n[0],20,-373897302),r=f(r,e,o,t,n[5],5,-701558691),t=f(t,r,e,o,n[10],9,38016083),o=f(o,t,r,e,n[15],14,-660478335),e=f(e,o,t,r,n[4],20,-405537848),r=f(r,e,o,t,n[9],5,568446438),t=f(t,r,e,o,n[14],9,-1019803690),o=f(o,t,r,e,n[3],14,-187363961),e=f(e,o,t,r,n[8],20,1163531501),r=f(r,e,o,t,n[13],5,-1444681467),t=f(t,r,e,o,n[2],9,-51403784),o=f(o,t,r,e,n[7],14,1735328473),e=f(e,o,t,r,n[12],20,-1926607734),r=i(r,e,o,t,n[5],4,-378558),t=i(t,r,e,o,n[8],11,-2022574463),o=i(o,t,r,e,n[11],16,1839030562),e=i(e,o,t,r,n[14],23,-35309556),r=i(r,e,o,t,n[1],4,-1530992060),t=i(t,r,e,o,n[4],11,1272893353),o=i(o,t,r,e,n[7],16,-155497632),e=i(e,o,t,r,n[10],23,-1094730640),r=i(r,e,o,t,n[13],4,681279174),t=i(t,r,e,o,n[0],11,-358537222),o=i(o,t,r,e,n[3],16,-722521979),e=i(e,o,t,r,n[6],23,76029189),r=i(r,e,o,t,n[9],4,-640364487),t=i(t,r,e,o,n[12],11,-421815835),o=i(o,t,r,e,n[15],16,530742520),e=i(e,o,t,r,n[2],23,-995338651),r=c(r,e,o,t,n[0],6,-198630844),t=c(t,r,e,o,n[7],10,1126891415),o=c(o,t,r,e,n[14],15,-1416354905),e=c(e,o,t,r,n[5],21,-57434055),r=c(r,e,o,t,n[12],6,1700485571),t=c(t,r,e,o,n[3],10,-1894986606),o=c(o,t,r,e,n[10],15,-1051523),e=c(e,o,t,r,n[1],21,-2054922799),r=c(r,e,o,t,n[8],6,1873313359),t=c(t,r,e,o,n[15],10,-30611744),o=c(o,t,r,e,n[6],15,-1560198380),e=c(e,o,t,r,n[13],21,1309151649),r=c(r,e,o,t,n[4],6,-145523070),t=c(t,r,e,o,n[11],10,-1120210379),o=c(o,t,r,e,n[2],15,718787259),e=c(e,o,t,r,n[9],21,-343485551),s[0]=y(r,s[0]),s[1]=y(e,s[1]),s[2]=y(o,s[2]),s[3]=y(t,s[3])}u(g,"md5cycle");function p(s,n,r,e,o,t){return n=y(y(n,s),y(e,t)),y(n<<o|n>>>32-o,r)}u(p,"cmn");function a(s,n,r,e,o,t,x){return p(n&r|~n&e,s,n,o,t,x)}u(a,"ff");function f(s,n,r,e,o,t,x){return p(n&e|r&~e,s,n,o,t,x)}u(f,"gg");function i(s,n,r,e,o,t,x){return p(n^r^e,s,n,o,t,x)}u(i,"hh");function c(s,n,r,e,o,t,x){return p(r^(n|~e),s,n,o,t,x)}u(c,"ii");function F(s){var n=s.length,r=[1732584193,-271733879,-1732584194,271733878],e;for(e=64;e<=s.length;e+=64)g(r,h(s.substring(e-64,e)));s=s.substring(e-64);var o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<s.length;e++)o[e>>2]|=s.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(g(r,o),e=0;e<16;e++)o[e]=0;return o[14]=n*8,g(r,o),r}u(F,"md51");function h(s){var n=[],r;for(r=0;r<64;r+=4)n[r>>2]=s.charCodeAt(r)+(s.charCodeAt(r+1)<<8)+(s.charCodeAt(r+2)<<16)+(s.charCodeAt(r+3)<<24);return n}u(h,"md5blk");function C(s){for(var n="",r=0;r<4;r++)n+=d[s>>r*8+4&15]+d[s>>r*8&15];return n}u(C,"rhex");function v(s){for(var n=0;n<s.length;n++)s[n]=C(s[n]);return s.join("")}u(v,"hex");function L(s){return v(F(s))}u(L,"md5");function y(s,n){return s+n&4294967295}u(y,"add32");var d="0123456789abcdef".split(""),b=b||{},B,k=[];return b={size:b.size||"50",rating:b.rating||"g",secure:b.secure||location.protocol==="https:",backup:b.backup||""},m=m.trim().toLowerCase(),B=b.secure?"https://secure.gravatar.com/avatar/":"http://www.gravatar.com/avatar/",b.rating&&k.push("r="+b.rating),b.backup&&k.push("d="+encodeURIComponent(b.backup)),b.size&&k.push("s="+b.size),B+L(m)+"?"+k.join("&")}u(Q,"gravatar");function Wt(m,l=""){try{return Q(m,{size:256,backup:"monsterid",secure:!0})}catch{return P("Gravatar issue: Did not find an image for "+m),l}}u(Wt,"gravatarURLByEmail");var D=w("zeed:localstorage"),O=class{constructor(l){this.pretty=!1;D.assert(l.name,"name required"),this.name=l.name,this.prefix=`${l.name}$`,this.objectToString=l.objectToString??(g=>this.pretty?JSON.stringify(g,null,2):JSON.stringify(g)),this.objectFromString=l.objectFromString??(g=>{try{return JSON.parse(g)}catch(p){D.warn(`LocalStorage parse error '${p}' in`,g)}})}setItem(l,g){let p=this.objectToString(g);localStorage.setItem(`${this.prefix}${l}`,p)}getItem(l){let g=localStorage.getItem(`${this.prefix}${l}`);if(g!=null)return this.objectFromString(g)}removeItem(l){localStorage.removeItem(`${this.prefix}${l}`)}clear(){Object.keys(localStorage).filter(l=>l.startsWith(this.prefix)).forEach(l=>{localStorage.removeItem(l)})}allKeys(){let l=this.prefix.length;return Object.keys(localStorage).filter(g=>g.startsWith(this.prefix)).map(g=>g.substr(l))}};u(O,"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 E(){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+)/)}u(E,"supportsColors");function H(m){let l=0;for(let g=0;g<m.length;g++)l=(l<<5)-l+m.charCodeAt(g),l|=0;return N[Math.abs(l)%N.length]}u(H,"selectColor");var M='font-family: "JetBrains Mono", Menlo; font-size: 11px;',J=`${M}`,R=`font-weight: 600; ${M}`,U=E(),q={},V=$();function W(m={}){let{filter:l=void 0,level:g=void 0,colors:p=!0,levelHelper:a=!1,nameBrackets:f=!0,padding:i=16}=m,c=S(l),F=A(g);return h=>{var b;if(!F(h.level)||!c(h.name))return;let C=$(),v=h.name||"",L=q[v||""];L==null&&(L={color:H(v)},q[v]=L);let y=j(C-V),d;switch(i>0&&(v=v.padEnd(16," ")),p&&U?(d=[`%c${v}%c %s %c+${y}`],d.push(`color:${L.color}; ${R}`),d.push(J),d.push(((b=h.messages)==null?void 0:b[0])??""),d.push(`color:${L.color};`),d.push(...h.messages.slice(1))):d=[v,...h.messages,`+${y}`],h.level){case 1:m.levelHelper&&(d[0]="I|* "+d[0]),console.info(...d);break;case 2:m.levelHelper&&(d[0]="W|** "+d[0]),console.warn(...d);break;case 3:m.levelHelper&&(d[0]="E|*** "+d[0]),console.error(...d);break;default:m.levelHelper&&(d[0]="D| "+d[0]),console.debug(...d);break}}}u(W,"LoggerBrowserHandler");function _(m={}){let l=m.filter??localStorage.zeed??localStorage.debug;return u(function g(p=""){let a;if(S(l)(p)){let i=[];if(U){let c=H(p);i.push(`%c${p.padEnd(16," ")}%c %s`),i.push(`color:${c}; ${R}`),i.push(J)}else i.push(`[${p}] %s`);a=console.debug.bind(console,...i),a.debug=console.debug.bind(console,...i),a.info=console.info.bind(console,...i),a.warn=console.warn.bind(console,...i),a.error=console.error.bind(console,...i),a.assert=console.assert.bind(console),a.assertEqual=function(c,F,...h){let C=I(c,F);C||a.assert(C,`Assert did fail. Expected ${F} got ${c}`,F,c,...h)},a.assertNotEqual=function(c,F,...h){let C=I(c,F);C&&a.assert(C,`Assert did fail. Expected ${F} not to be equal with ${c}`,F,c,...h)}}else{let i=u(()=>{},"noop");a=i,a.debug=i,a.info=i,a.warn=i,a.error=i,a.assert=i,a.assertEqual=i,a.assertNotEqual=i}return a.extend=i=>g(p?`${p}:${i}`:i),a.label=p,a},"LoggerBrowserDebugFactory")}u(_,"LoggerBrowserSetupDebugFactory");function ts(m={}){console.info("activateConsoleDebug is activated by default in browsers")}u(ts,"activateConsoleDebug");var G={},X=$(),Y=E();function Cs(m,l={}){let{filter:g=void 0}=l,p=S(g),a=A(m);return f=>{if(!a(f.level)||!p(f.name))return;let i=$(),c=f.name||"",F=G[c||""];F==null&&(F={color:H(c)},G[c]=F);let h=j(i-X),C;switch(l.colors&&Y?(C=l.nameBrackets?[`%c[${c}]`]:[`%c${c}`],C.push(`color:${F.color}`),C.push(...f.messages)):C=[c,...f.messages],C.push(`+${h}`),f.level){case 1:l.levelHelper&&(C[0]="I|* "+C[0]),console.info(...C);break;case 2:l.levelHelper&&(C[0]="W|** "+C[0]),console.warn(...C);break;case 3:l.levelHelper&&(C[0]="E|*** "+C[0]),console.error(...C);break;default:l.levelHelper&&(C[0]="D| "+C[0]),console.debug(...C);break}}}u(Cs,"LoggerBrowserClassicHandler");function Z(){z()&&(w.setHandlers([W()]),w.setFactory(_({})))}u(Z,"setupBrowserLog");Z();export{pt as Channel,yt as CryptoEncoder,so as Currency,ao as DAY_MS,No as Day,qn as Emitter,ht as JsonEncoder,dt as LocalChannel,O as LocalStorage,T as LogLevel,be as LogLevelAlias,w as Logger,Cs as LoggerBrowserClassicHandler,W as LoggerBrowserHandler,_ as LoggerBrowserSetupDebugFactory,de as LoggerConsoleHandler,Fe as LoggerContext,mt as LoggerMemoryHandler,qt as MemStorage,Ft as NoopEncoder,lt as PoolTaskIdConflictResolution,it as PoolTaskState,Lt as PubSub,ut as SerialQueue,Be as Uint8ArrayToHexDump,Oe as Uint8ArrayToJson,Le as Uint8ArrayToString,jn as XRX,ve as _decodeUtf8Polyfill,ye as _encodeUtf8Polyfill,ts as activateConsoleDebug,Lr as arrayAvg,xr as arrayBatches,fr as arrayEmptyInPlace,ur as arrayFilterInPlace,sr as arrayFlatten,ar as arrayIntersection,pr as arrayIsEqual,yr as arrayMax,vr as arrayMin,nr as arrayMinus,hr as arrayRandomElement,lr as arrayRemoveElement,cr as arraySetElement,br as arrayShuffle,Fr as arrayShuffleForce,dr as arrayShuffleInPlace,Cr as arraySorted,mr as arraySortedNumbers,wr as arraySum,ir as arraySymmetricDifference,gr as arrayToggleInPlace,tr as arrayUnion,or as arrayUnique,Pe as avg,Ge as between,xn as cloneJsonObject,Ln as cloneObject,er as cmp,Ze as composeOrderby,$r as createArray,bt as createLocalChannelPair,Ho as createPromise,vt as createPromiseProxy,Me as csv,to as currency,Ro as dateStringToDays,Jo as day,co as dayDay,So as dayDiff,Co as dayFromAny,po as dayFromDate,bo as dayFromDateGMT,vo as dayFromParts,wo as dayFromString,ho as dayFromTimestamp,fo as dayFromToday,lo as dayMonth,Lo as dayMonthStart,$o as dayOffset,go as dayToDate,mo as dayToDateGMT,uo as dayToParts,yo as dayToString,Fo as dayToTimestamp,io as dayYear,xo as dayYearStart,ft as debounce,Uo as decimal,Go as decimalCentsPart,Wo as decimalFromCents,_o as decimalToCents,kr as decodeBase16,jr as decodeBase32,Ir as decodeBase58,Br as decodeBase62,zr as decodeBase64,qe as decrypt,I as deepEqual,Ce as deepMerge,fe as deepStripUndefinedInPlace,De as deriveKeyPbkdf2,zt as detect,ze as digest,wn as empty,Hr as encodeBase16,Ar as encodeBase32,Er as encodeBase58,Or as encodeBase62,Tr as encodeBase64,dn as encodeQuery,Ne as encrypt,gn as endSortWeight,Fn as ensureKey,hn as ensureKeyAsync,Ee as equalBinary,Ko as escapeHTML,Yo as escapeRegExp,Ht as fetchBasic,kt as fetchJson,It as fetchOptionsBasicAuth,jt as fetchOptionsFormURLEncoded,Et as fetchOptionsJson,At as fetchText,no as fixBrokenUth8String,qo as forEachDay,Hn as forTimes,ro as formatMessages,j as formatMilliseconds,je as fromBase64,Mr as fromCamelCase,He as fromHex,Tt as getGlobal,ee as getGlobalContext,Mn as getGlobalEmitter,he as getGlobalLogger,me as getNamespaceFilterString,Bt as getNavigator,Je as getSecureRandom,Re as getSecureRandomIfPossible,$ as getTimestamp,Ot as getWindow,Wt as gravatarURLByEmail,Ao as immediate,ne as isArray,ce as isBoolean,z as isBrowser,en as isEven,Zo as isHalf,ie as isInteger,Ct as isLocalHost,ue as isNullOrUndefined,ae as isNumber,re as isObject,Ve as isPrime,Qe as isPrimeRX,oe as isPrimitive,zo as isPromise,te as isRecord,le as isSafeInteger,se as isString,Oo as isTimeout,ge as isUint8Array,$e as joinToUint8Array,Ur as jsonStringify,Rr as jsonStringifySafe,Jr as jsonStringifySorted,Ie as jsonToUint8Array,vn as last,Rn as lazyListener,mn as linkifyPlainText,$n as memoize,Sn as memoizeAsync,Jn as messages,fn as moveSortWeight,Qo as objectMap,Vo as objectMergeDisposable,St as parseBasicAuth,Un as parseDate,pe as parseLogLevel,Ye as parseOrderby,bn as parseQuery,Dt as platform,Do as promisify,rt as qid,Ue as randomBoolean,_e as randomFloat,We as randomInt,Te as randomUint8Array,An as regExpEscape,kn as regExpString,oo as renderMessages,on as roundDown,sn as roundHalfAwayFromZero,an as roundHalfDown,ln as roundHalfEven,tn as roundHalfOdd,cn as roundHalfTowardsZero,nn as roundHalfUp,rn as roundUp,Xe as seededRandom,H as selectColor,Z as setupBrowserLog,yn as size,ko as sleep,Cn as sortedItems,rr as sortedOrderby,un as startSortWeight,Wr as stringToBoolean,Gr as stringToFloat,_r as stringToInteger,we as stringToUInt8Array,tt as suid,nt as suidBytes,at as suidBytesDate,st as suidDate,Ke as sum,E as supportsColors,gt as throttle,Eo as timeout,jo as timeoutReached,Io as timoutError,ke as toBase64,Ae as toBase64Url,eo as toBool,Dr as toCamelCase,Nr as toCapitalize,qr as toCapitalizeWords,Xr as toFloat,Se as toHex,pn as toHumanReadableUrl,Yr as toInt,Zr as toString,xe as toUint8Array,Xo as toValidFilename,Mo as today,Bo as tryTimeout,et as uname,Po as unescapeHTML,Jt as urlBase64ToUint8Array,Nn as useAsyncMutex,Sr as useBase,On as useDefer,En as useDispose,In as useDisposer,zn as useEventListener,Nt as useExitHandler,Tn as useInterval,A as useLevelFilter,wt as useMessageHub,Dn as useMutex,S as useNamespaceFilter,ct as usePool,xt as usePubSub,$t as useRPC,Bn as useTimeout,Gn as uuid,Zn as uuid32Decode,Yn as uuid32Encode,_n as uuid32bit,Xn as uuidB32,Wn as uuidBytes,Qn as uuidDecode,Vn as uuidDecodeV4,Kn as uuidEncode,Pn as uuidEncodeV4,ot as uuidv4,Kr as valueToBoolean,Qr as valueToFloat,Pr as valueToInteger,Vr as valueToString,To as waitOn};
|
|
2
2
|
//# sourceMappingURL=index.browser.js.map
|
package/dist/index.node.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
`;return r}o(In,"csv");function ir(){return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}o(ir,"getSecureRandom");function R(){return typeof crypto<"u"?ir():Math.random()}o(R,"getSecureRandomIfPossible");function Cn(e=.25){return R()<e}o(Cn,"randomBoolean");function kn(e=100,t=0){return t+Math.floor(R()*(e-t))}o(kn,"randomInt");function On(e=100,t=0){return t+R()*(e-t)}o(On,"randomFloat");function Fn(e,t,r){return Math.max(e,Math.min(r,t))}o(Fn,"between");function sr(e){return e.reduce((t,r)=>t+r,0)}o(sr,"sum");function $n(e){return sr(e)/e.length}o($n,"avg");function Bn(e){return!/^1?$|^(11+?)\1+$/.test("1".repeat(e))}o(Bn,"isPrimeRX");function Nn(e){for(var t=2;t<e;t++)if(e%t===0)return!1;return e>1}o(Nn,"isPrime");var mt=6;function Hn(e=0,t=1,r){mt=((r??mt)*9301+49297)%233280;let n=mt/233280;return t+n*(e-t)}o(Hn,"seededRandom");function ar(e=""){let[t="",r="asc"]=e.split(" ");return r=r.toLowerCase(),{field:t,orderby:r,asc:r!=="desc",desc:r==="desc"}}o(ar,"parseOrderby");function jn(e,t=!0){return`${e} ${t?"asc":"desc"}`}o(jn,"composeOrderby");function Re(e,t,r=!0){let n=e||0,i=t||0;return n>i?r?1:-1:n<i?r?-1:1:0}o(Re,"cmp");function Gn(e,...t){if(t.length>0){let r=t.map(ar),n=Array.from(e);return n.sort((i,s)=>{for(let{field:u,asc:a}of r){let l=Re(i[u],s[u],a);if(l!==0)return l}return 0}),n}return e}o(Gn,"sortedOrderby");function Ue(e){return e.filter((t,r)=>e.indexOf(t)===r)}o(Ue,"arrayUnique");function ur(e,t){return Ue(e.filter(r=>!t.includes(r)))}o(ur,"arrayMinus");function lr(...e){return Ue(e.reduce((t=[],r)=>t.concat(r),[]))}o(lr,"arrayUnion");function F(...e){return e.flat(1/0)}o(F,"arrayFlatten");function cr(e,t){return Ue(e).filter(r=>t.includes(r))}o(cr,"arrayIntersection");function zn(e,t){return ur(lr(e,t),cr(e,t))}o(zn,"arraySymmetricDifference");function Vn(e,t){if(e&&Array.isArray(e)){let r;for(;(r=e.indexOf(t))!==-1;)e.splice(r,1);return e}return[]}o(Vn,"arrayRemoveElement");function qn(e,t){return e.includes(t)||e.push(t),e}o(qn,"arraySetElement");function Ie(e,t){return e.splice(0,e.length,...e.filter(t)),e}o(Ie,"arrayFilterInPlace");function _n(e,t){let r=e.findIndex(n=>n===t);return r>=0?e.splice(r,1):e.push(t),e}o(_n,"arrayToggleInPlace");function Jn(e){return e.splice(0,e.length),e}o(Jn,"arrayEmptyInPlace");function fr(e,t=Re){return Array.from(e).sort(t)}o(fr,"arraySorted");function Wn(e){return fr(e,(t,r)=>t-r)}o(Wn,"arraySortedNumbers");function pr(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}o(pr,"arrayIsEqual");function yt(e){return e.sort(()=>R()>.5?1:-1),e}o(yt,"arrayShuffleInPlace");function Kn(e){return yt(Array.from(e))}o(Kn,"arrayShuffle");function Zn(e){for(;e.length>1;){let t=Array.from(e);if(yt(t),!pr(e,t))return t}return e}o(Zn,"arrayShuffleForce");function Yn(e){return e[Math.floor(R()*e.length)]}o(Yn,"arrayRandomElement");function Qn(...e){return F(e).reduce((t,r)=>t!=null?r>t?r:t:r,void 0)}o(Qn,"arrayMax");function Xn(...e){return F(e).reduce((t,r)=>t!=null?r<t?r:t:r,void 0)}o(Xn,"arrayMin");function eo(...e){return F(e).reduce((t,r)=>t+r,0)}o(eo,"arraySum");function to(...e){let t=F(e);return t.reduce((r,n)=>r+n,0)/t.length}o(to,"arrayAvg");function ro(e,t){let r=[],n=0,i=e.length;for(;n<i;)r.push(e.slice(n,n+=t));return r}o(ro,"arrayBatches");function no(e=0,t){if(e<=0)return[];let r=new Array(e);for(let n=0;n<e;n++)r[n]=t instanceof Function?t(n):t;return r}o(no,"createArray");var oo=L("zeed:basex"),io={2:"01",8:"01234567",11:"0123456789a",16:"0123456789abcdef",32:"0123456789ABCDEFGHJKMNPQRSTVWXYZ","32-rfc":"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567","32-hex":"0123456789ABCDEFGHIJKLMNOPQRSTUV","32-zbase":"ybndrfg8ejkmcpqxot1uwisza345h769",36:"0123456789abcdefghijklmnopqrstuvwxyz",58:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",62:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","64-url":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",66:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~",85:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"};function N(e){let t;if(typeof e=="string")t=e;else if(t=io[String(e)],t==null)throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let r=new Uint8Array(256);for(let c=0;c<r.length;c++)r[c]=255;for(let c=0;c<t.length;c++){let d=t.charAt(c),g=d.charCodeAt(0);if(r[g]!==255)throw new TypeError(d+" is ambiguous");r[g]=c}let n=t.length,i=t.charAt(0),s=Math.log(n)/Math.log(256),u=Math.log(256)/Math.log(n);function a(c,d=-1){let g=S(c);if(g.byteLength===0)return"";let f=0,m=0,b=g.byteLength;for(;m!==b&&g[m]===0;)m++;let y=(b-m)*u+1>>>0,p=new Uint8Array(y);for(;m!==b;){let x=g[m],v=0;for(let w=y-1;(x!==0||v<f)&&w!==-1;w--,v++)x+=256*p[w]>>>0,p[w]=x%n>>>0,x=x/n>>>0;if(x!==0)throw oo.warn("Non-zero carry",g,d,v,y),new Error("Non-zero carry");f=v,m++}let h=y-f;for(;h!==y&&p[h]===0;)h++;let T="";for(;h<y;++h)T+=t.charAt(p[h]);return d>0?T.padStart(d,i):T}o(a,"encode");function l(c,d=-1){if(typeof c!="string")throw new TypeError("Expected String");if(c.length===0)return new Uint8Array;c=c.replace(/\s+/gi,"");let g=0,f=0;for(;c[g]===i;)g++;let m=(c.length-g)*s+1>>>0,b=new Uint8Array(m);for(;c[g];){let p=r[c.charCodeAt(g)];if(p===255)throw new Error(`Unsupported character "${c[g]}"`);let h=0;for(let T=m-1;(p!==0||h<f)&&T!==-1;T--,h++)p+=n*b[T]>>>0,b[T]=p%256>>>0,p=p/256>>>0;if(p!==0)throw new Error("Non-zero carry");f=h,g++}let y=m-f;for(;y!==m&&b[y]===0;)y++;return d>0?new Uint8Array([...new Uint8Array(d-b.length+y),...b.slice(y)]):b.slice(y)}return o(l,"decode"),{encode:a,decode:l}}o(N,"useBase");var{encode:so,decode:ao}=N(16),{encode:uo,decode:lo}=N(32),{encode:co,decode:fo}=N(58),{encode:po,decode:go}=N(62),{encode:mo,decode:yo}=N(62);var ht=o(e=>(e.length>0&&(/^[A-Z0-9_\-\ ]*$/g.test(e)&&(e=e.toLowerCase()),e=e.replace(/^[-_\ ]+/gi,"").replace(/[-_\ ]+$/gi,"").replace(/[-_\ ]+([a-z0-9])/gi,(t,r)=>r.toUpperCase()),e=e[0].toLowerCase()+e.substring(1)),e),"toCamelCase");function dr(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}o(dr,"toCapitalize");function ho(e){return e.replace(/\w\S*/g,dr)}o(ho,"toCapitalizeWords");function xo(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()}o(xo,"fromCamelCase");var gr=o((e,t)=>t instanceof Object&&!(t instanceof Array)?Object.keys(t).sort().reduce((r,n)=>(r[n]=t[n],r),{}):t,"_sortedReplacer");function bo(e,t=void 0){return JSON.stringify(e,gr,t)}o(bo,"jsonStringifySorted");function To(e,t){var r=[],n=[];return t==null&&(t=o(function(i,s){return r[0]===s?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(s)).join(".")+"]"},"cycleReplacer")),function(i,s){if(r.length>0){var u=r.indexOf(this);~u?r.splice(u+1):r.push(this),~u?n.splice(u,1/0,i):n.push(i),~r.indexOf(s)&&(s=t==null?void 0:t.call(this,i,s))}else r.push(s);return s=gr(i,s),e==null?s:e.call(this,i,s)}}o(To,"serializer");function mr(e,t,r,n){return JSON.stringify(e,To(t,n),r)}o(mr,"jsonStringifySafe");var Ce=mr;var yr=["1","true","yes","y","on"];function wo(e,t=!1){return e==null||typeof e!="string"?t:yr.includes(String(e).trim().toLowerCase())}o(wo,"stringToBoolean");function Lo(e,t=0){return e==null||typeof e!="string"?t:parseInt(e.trim(),10)??t}o(Lo,"stringToInteger");function vo(e,t=0){return e==null||typeof e!="string"?t:parseFloat(e.trim())??t}o(vo,"stringToFloat");function ke(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:yr.includes(String(e).trim().toLowerCase())}o(ke,"valueToBoolean");function hr(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}o(hr,"valueToInteger");function xr(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseFloat(String(e).trim())??t}o(xr,"valueToFloat");function Oe(e,t=""){return e==null?t:String(e)??t}o(Oe,"valueToString");var Ao=xr,Eo=hr,Po=Oe,So=ke;function br(e,t={}){let{trace:r=!0,pretty:n=!0}=t;return e.map(i=>i&&typeof i=="object"?n&&(i instanceof Uint8Array||i instanceof ArrayBuffer)?`
|
|
5
5
|
`+ft(i)+`
|
|
6
6
|
`:i instanceof Error?r?`${i.name||"Error"}: ${i.message}
|
|
7
|
-
${i.stack}`:`${i.name||"Error"}: ${i.message}`:n?Ce(i,null,2):Ce(i):String(i))}o(br,"formatMessages");function de(e,t={}){return br(e,t).join(" ")}o(de,"renderMessages");function Do(e){try{return decodeURIComponent(escape(e))}catch{}return e}o(Do,"fixBrokenUth8String");var Mo={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:Co,fromCents:!1},Tr=o(e=>Math.round(e),"round"),xt=o(e=>Math.pow(10,e),"pow"),Ro=o((e,t)=>Tr(e/t)*t,"rounding"),Uo=/(\d)(?=(\d{3})+\b)/g,Io=/(\d)(?=(\d\d)+\d\b)/g;function G(e,t={}){return new k(e,t)}o(G,"currency");var ge=class{constructor(t,r={}){let n=Object.assign({},Mo,r),i=xt(n.precision??2),s=Fe(t,n);this.intValue=s,this.value=s/i,n.increment=n.increment||1/i,n.useVedic?n.groups=Io:n.groups=Uo,this._settings=n,this._precision=i}add(t){let{intValue:r,_settings:n,_precision:i}=this;return G((r+=Fe(t,n))/(n.fromCents?1:i),n)}subtract(t){let{intValue:r,_settings:n,_precision:i}=this;return G((r-=Fe(t,n))/(n.fromCents?1:i),n)}multiply(t){let{intValue:r,_settings:n,_precision:i}=this;return G((r*=t)/(n.fromCents?1:xt(i)),n)}divide(t){let{intValue:r,_settings:n}=this;return G(r/=Fe(t,n,!1),n)}distribute(t){let{intValue:r,_precision:n,_settings:i}=this,s=[],u=Math[r>=0?"floor":"ceil"](r/t),a=Math.abs(r-u*t),l=i.fromCents?1:n;for(;t!==0;t--){let c=G(u/l,i);a-- >0&&(c=c[r>=0?"add":"subtract"](1/l)),s.push(c)}return s}dollars(){return~~this.value}cents(){let{intValue:t,_precision:r}=this;return~~(t%r)}format(t){let{_settings:r}=this;return typeof t=="function"?t(this,r):r.format(this,Object.assign({},r,t))}toString(){let{intValue:t,_precision:r,_settings:n}=this;return Ro(t/r,n.increment).toFixed(n.precision)}toJSON(){return this.value}static sum(...t){return F(t).reduce((r,n)=>G(r).add(n),this.zero)}static avg(...t){let r=F(t);return r.reduce((n,i)=>G(n).add(i),this.zero).divide(r.length)}},k=ge;o(k,"Currency"),k.zero=new ge(0),k.one=new ge(1),k.hundred=new ge(100);function Fe(e,t,r=!0){let n=0,{decimal:i,errorOnInvalid:s,precision:u,fromCents:a}=t,l=xt(u),c=typeof e=="number";if(e instanceof k&&a)return e.intValue;if(c||e instanceof k)n=e instanceof k?e.value:e;else if(typeof e=="string"){let d=new RegExp("[^-\\d"+i+"]","g"),g=new RegExp("\\"+i,"g");n=e.replace(/\((.*)\)/,"-$1").replace(d,"").replace(g,"."),n=n||0}else{if(s)throw Error("Invalid Input");n=0}return a||(n*=l,n=n.toFixed(4)),r?Tr(n):n}o(Fe,"parse");function Co(e,t){let{pattern:r,negativePattern:n,symbol:i,separator:s,decimal:u,groups:a}=t,l=(""+e).replace(/^-/,"").split("."),c=l[0],d=l[1];return(e.value>=0?r:n).replace("!",i).replace("#",c.replace(a,"$1"+s)+(d?u+d:""))}o(Co,"format");var Be=864e5;function Ne(e){return Math.floor(e/1e4)}o(Ne,"dayYear");function bt(e){return Math.floor(e/100%100)}o(bt,"dayMonth");function wr(e){return Math.floor(e%100)}o(wr,"dayDay");function ko(e){return[Ne(e),bt(e),wr(e)]}o(ko,"dayToParts");function Tt(e,t=!1){return t?new Date(`${vr(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}o(Tt,"dayToDate");function Oo(){return me(new Date)}o(Oo,"dayFromToday");function Fo(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return wt(e);if(Array.isArray(e)&&e.length===3){let[r,n,i]=e;return He(r,n,i)}else if(e instanceof Date)return me(e,t)}o(Fo,"dayFromAny");function $o(e){return Tt(e,!0)}o($o,"dayToDateGMT");function me(e,t=!1){return t?wt(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}o(me,"dayFromDate");function Bo(e){return me(e,!0)}o(Bo,"dayFromDateGMT");function $e(e,t=!0){return Tt(e,t).getTime()}o($e,"dayToTimestamp");function Lr(e,t=!0){return me(new Date(e),t)}o(Lr,"dayFromTimestamp");function vr(e,t="-"){let r=String(e);return r.slice(0,4)+t+r.slice(4,6)+t+r.slice(6,8)}o(vr,"dayToString");function He(e,t=1,r=1){if(!(t<1||t>12||r<1||r>31))return e*1e4+t*100+r}o(He,"dayFromParts");function wt(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return+t}o(wt,"dayFromString");function No(e,t=0){let r=Ne(e),n=bt(e);return t!==0&&(n+=t,r+=Math.floor((n-1)/12),n=Math.floor((n-1)%12)+1,n===0&&(n=12)),He(r,n,1)}o(No,"dayMonthStart");function Ho(e,t=0){let r=Ne(e);return He(r+t,1,1)}o(Ho,"dayYearStart");function jo(e,t){return Lr($e(e)+t*864e5)}o(jo,"dayOffset");function Go(e,t){return Math.round(($e(t)-$e(e))/864e5)}o(Go,"dayDiff");var{warn:Ar}=L("zeed:promise");function Lt(){let e,t;return[new Promise((n,i)=>{e=n,t=i}),e,t]}o(Lt,"createPromise");async function zo(e){return new Promise(t=>setTimeout(t,e))}o(zo,"sleep");async function Vo(){return new Promise(e=>setTimeout(e,0))}o(Vo,"immediate");var vt=Symbol("timeout");async function qo(e,t,r=vt){return new Promise(async(n,i)=>{let s=!1,u=setTimeout(()=>{s=!0,n(r)},t);try{let a=await e;clearTimeout(u),s||n(a)}catch(a){clearTimeout(u),s||i(a)}})}o(qo,"timeout");var At=new Error("Timeout reached");function _o(e){return e===vt||e===At}o(_o,"isTimeout");async function Et(e,t){return t<=0?await e:new Promise(async(r,n)=>{let i=!1,s=setTimeout(()=>{i=!0,n(At)},t);try{let u=await e;clearTimeout(s),i||r(u)}catch(u){clearTimeout(s),i||n(u)}})}o(Et,"tryTimeout");function Jo(e,t,r=1e3){return new Promise((n,i)=>{let s=o(l=>{a&&(clearTimeout(a),u(),n(l))},"fn"),u=o(()=>{a=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):Ar("No remove listener method found for",e,t)},"done"),a=setTimeout(()=>{u(),i(new Error("Did not response in time"))},r);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):Ar("No listener method found for",e)})}o(Jo,"waitOn");function D(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}o(D,"isPromise");function z(e){return Promise.resolve(e)}o(z,"promisify");var A=class{get value(){return this.days}constructor(t){var r;if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=(r=A.from(t))==null?void 0:r.days),t==null){let n=new Date;this.days=n.getFullYear()*1e4+(n.getMonth()+1)*100+n.getDate()}else this.days=t}static fromNumber(t){return new A(t)}static fromString(t){return A.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,r=!1){return r?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,r=!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[n,i=1,s=1]=t;return i<1||i>12||s<1||s>31?void 0:new A(n*1e4+i*100+s)}else{if(t instanceof Date)return A.fromDate(t,r);if(t instanceof A)return t}}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let r=String(this.days);return r.slice(0,4)+t+r.slice(4,6)+t+r.slice(6,8)}toDate(t=!1){return t?new Date(`${this.toString()}T00:00:00.000Z`):new Date(this.days/1e4,this.days/100%100-1,this.days%100)}toDateGMT(){return this.toDate(!0)}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 r=this.month+t,n=Math.floor((r-1)%12)+1;n===0&&(n=12);let i=Math.floor((r-1)/12);return A.from([this.year+i,n,this.day])}daysUntil(t){var r;return Math.round((((r=new A(t))==null?void 0:r.toDateGMT().getTime())-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};o(A,"Day");async function Wo(e,t,r){let n=A.from(e),i=A.from(t);for(;n&&i&&(n==null?void 0:n.days)<=(i==null?void 0:i.days);){let s=r(n);D(s)&&await s,n=n.dayOffset(1)}}o(Wo,"forEachDay");function Ko(){return new A}o(Ko,"today");function Zo(e){return new A(e)}o(Zo,"day");function Yo(e){return A.fromDate(new Date(e)).days}o(Yo,"dateStringToDays");function Er(e,t=2){return+(+e).toFixed(t)}o(Er,"decimal");function Qo(e,t=2){return+(+e/Math.pow(10,t)).toFixed(t)}o(Qo,"decimalFromCents");function Xo(e,t=2){return Math.round(+e*Math.pow(10,t))}o(Xo,"decimalToCents");function ei(e,t=2){return t*(Er(e,t)%1)}o(ei,"decimalCentsPart");var Pt=o(e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),"escapeHTML"),ti=o(e=>e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),"unescapeHTML");function ri(e,t){return O(e)?Object.fromEntries(Object.entries(e).map(([r,n])=>{let i=t(r,n);return H(i)&&i.length===2?i:[r,i]}).filter(r=>r!=null)):{}}o(ri,"objectMap");function ni(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}o(ni,"objectMergeDisposable");var Pr=/[\u0000-\u001F\u0080-\u009F]/g,oi=/^\.+/,ii=/\.+$/;function Sr(){return/[<>:"/\\|?*\u0000-\u001F]/g}o(Sr,"filenameReservedRegex");function si(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}o(si,"windowsReservedNameRegex");function St(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(Sr().test(t)&&Pr.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(Sr(),t).replace(Pr,t).replace(oi,t).replace(ii,""),e=si().test(e)?e+t:e,e.slice(0,100)}o(St,"toValidFilename");var ai=/[\\\-\[\]\/{}()*+?.^$|]/g;function ui(e){return e?e instanceof RegExp?e.source:e.replace(ai,"\\$&"):""}o(ui,"escapeRegExp");var ee=o(e=>Math.abs(e)%1===.5,"isHalf"),Dt=o(e=>e%2===0,"isEven"),li=o(e=>Math.ceil(e),"roundUp"),ci=o(e=>Math.floor(e),"roundDown"),fi=o(e=>Math.round(e),"roundHalfUp"),pi=o(e=>{let t=Math.round(e);return ee(e)&&Dt(t)?t-1:t},"roundHalfOdd"),di=o(e=>ee(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),gi=o(e=>ee(e)?Math.floor(e):Math.round(e),"roundHalfDown"),mi=o(e=>{let t=Math.round(e);return ee(e)?Dt(t)?t:t-1:t},"roundHalfEven"),yi=o(e=>ee(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");function Mt(e){return e.reduce((t,r)=>Math.min(t,r.sort_weight||0),0)-1-R()}o(Mt,"startSortWeight");function Rt(e){return e.reduce((t,r)=>Math.max(t,r.sort_weight||0),0)+1+R()}o(Rt,"endSortWeight");function hi(e,t,r){let n=r.length,i=e<t;if(n<=0||e>=n-1)return Rt(r);if(e<=0)return Mt(r);r=Dr([...r]);let s=i?-1:0,u=r[e+s].sort_weight||0,l=(r[e+s+1].sort_weight||0)-u;if(l===0)return i?Mt(r):Rt(r);let c=u+l/2,d=l*.01*(R()-.5);return c+d}o(hi,"moveSortWeight");function Dr(e){return e.sort((t,r)=>(t.sort_weight||0)-(r.sort_weight||0)),e}o(Dr,"sortedItems");var xi=/((?:(?:(?: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 bi(e){return e.split(xi).map((t,r)=>{let n=Pt(t);return r%2?`<a target="_blank" href="${n}">${Mr(n)}</a>`:n}).join("")}o(bi,"linkifyPlainText");function Mr(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}o(Mr,"toHumanReadableUrl");function Ut(e){let t=[];for(let[r,n]of Object.entries(e))if(n!=null){Array.isArray(n)||(n=[n]);for(let i of n)i!=null&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(String(i)))}return t.join("&")}o(Ut,"encodeQuery");function Ti(e){let t={},r=(e[0]==="?"?e.substr(1):e).split("&");for(let n=0;n<r.length;n++){let i=r[n].split("="),s=decodeURIComponent(i[0]),u=decodeURIComponent(i[1]||"");t[s]!=null?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(u)):t[s]=u}return t}o(Ti,"parseQuery");function wi(e,t,r){let n=e[t];return n===void 0&&(n=r(t,e),e[t]=n),n}o(wi,"ensureKey");async function Li(e,t,r){let n=e[t];return n===void 0&&(n=await r(t,e),e[t]=n),n}o(Li,"ensureKeyAsync");function vi(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}o(vi,"size");function Ai(e){return e!=null&&e.length>0?e[e.length-1]:void 0}o(Ai,"last");function Ei(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:(e==null?void 0:e.size)!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.warn("Failed to check if empty for",e,t)}return!0}o(Ei,"empty");function Q(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(Q,"cloneObject");function Pi(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(Pi,"cloneJsonObject");function Si(e){let t=new Map;return r=>{if(t.has(r))return t.get(r);let n=e(r);return t.set(r,n),n}}o(Si,"memoize");function Di(e){let t=new Map;return async(...r)=>{let n=JSON.stringify(r);if(t.has(n))return t.get(n);let i=await e(...r);return t.set(n,i),i}}o(Di,"memoizeAsync");function Mi(e,t){let r=[];for(let n=0;n<e;n++)r.push(t(n,e));return r}o(Mi,"forTimes");var Ri=/\\\s|\s+|#[^\n]*\n?/gm,Ui=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,Rr=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm,Ii=L("zeed:xrx");function Ur(e){return typeof e=="string"?e:e.source||""}o(Ur,"regExpString");function Ci(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}o(Ci,"regExpEscape");var je=class{constructor(t,r){this.namedGroups={};this.names=[];let n=r??"",i;if(t instanceof RegExp?(r==null&&(n=t.flags),i=t.source):i=t,n&&n.indexOf("x")!==-1&&(n=n.replace("x",""),i=i.replace(Ri,a=>a[0]==="\\"?a:"")),!(t instanceof RegExp)){let a=0;i=i.replace(Ui,(l,c)=>(a+=1,c?(c!=="index"&&c!=="length"&&!this.namedGroups[c]?this.namedGroups[c]=a:Ii.error(`Unallowed or duplicate group name: ${c}`),"("):l)),this.names=Object.keys(this.namedGroups)}i=Ur(i),Rr.lastIndex=0;let u=Rr.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,n)}get lastIndex(){return this.rx.lastIndex}set lastIndex(t){this.rx.lastIndex=t}_handleMatch(t){if(this.lookBehind){let r=t.input.slice(0,t.index);if(this.lookBehind.expect!==this.lookBehind.rx.test(r))return null}for(let r of this.names)t[r]=t[this.namedGroups[r]];return t}exec(t){let r;for(;r=this.rx.exec(t);)if(this.rx.lastIndex===r.index&&this.rx.lastIndex++,r=this._handleMatch(r),r!=null)return r}execAll(t){let r=[],n;for(this.rx.lastIndex=0;n=this.exec(t);)r.push(n);return this.rx.lastIndex=0,r}replace(t,r){let n=typeof r=="function"?r:()=>r;return t.replace(this.rx,i=>n(i))}};o(je,"XRX");var ki=L("zeed:dispose");async function Oi(e){typeof e=="function"?await z(e()):D(e)?await e:typeof e.dispose=="function"?await z(e.dispose()):D(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await z(e.cleanup()):D(e.cleanup)&&await e.cleanup}o(Oi,"callDisposer");function Ge(e){let{name:t}=typeof e=="string"?{name:e}:e??{},r=[],n=o(async u=>{u!=null&&r.includes(u)&&(Ie(r,a=>a!==u),await Oi(u))},"untrack"),i=o(async()=>{for(t&&ki.debug(`dispose ${t}: ${r.length} entries`);r.length>0;)await n(r[0])},"dispose"),s=o(u=>{if(u!=null)return r.unshift(u),()=>n(u)},"track");return Object.assign(i,{track:s,add:s,untrack:n,dispose:i,exec:i,getSize(){return r.length}})}o(Ge,"useDispose");var Fi=Ge;function $i(e={}){let{mode:t="fifo"}=e,r=[],n=o(async(s=!1)=>{for(;r.length>0;){let u=r[0];if(Ie(r,a=>a!==u),typeof u=="function"){let a=u();if(D(a)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await a}}else if(D(u)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await u}else throw new Error(`Unhandled disposable: ${u}`)}},"exec");return Object.assign(n,{add:o(s=>{t==="lifo"?r.unshift(s):r.push(s)},"add"),exec:n,getSize(){return r.length}})}o($i,"useDefer");function Bi(e,t=0){let r=setTimeout(e,t);return()=>{r&&(clearTimeout(r),r=void 0)}}o(Bi,"useTimeout");function Ni(e,t){let r=setInterval(e,t);return()=>{r&&(clearInterval(r),r=void 0)}}o(Ni,"useInterval");function Hi(e,t,r,...n){return e==null?()=>{}:(e.on?e.on(t,r,...n):e.addEventListener&&e.addEventListener(t,r,...n),()=>{e.off?e.off(t,r,...n):e.removeEventListener&&e.removeEventListener(t,r,...n)})}o(Hi,"useEventListener");function ji(){let e=!0;return(t,r)=>{let n=!1;if(e){e=!1;try{t(),n=!0}finally{e=!0}}else r!==void 0&&r();return n}}o(ji,"useMutex");function Gi(){let e=!0;return async(t,r)=>{let n=!1;if(e){e=!1;try{let i=t();D(i)&&await i,n=!0}finally{e=!0}}else if(r!==void 0){let i=r();D(i)&&await i}return n}}o(Gi,"useAsyncMutex");var te=L("zeed:emitter"),M=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.dispose=Ge();this.call=new Proxy({},{get:(t,r)=>(...n)=>this.emit(r,...n)})}async emit(t,...r){let n=!1;this.dispose.add(()=>{this.subscribers={},this.subscribersOnAny=[]});try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...r)),i.length>0){let s=i.map(u=>{try{return z(u(...r))}catch(a){te.warn("emit warning:",a)}});n=!0,await Promise.all(s)}}catch(i){te.error("emit exception",i)}return n}onAny(t){this.subscribersOnAny.push(t)}on(t,r){let n=this.subscribers[t]||[];return n.push(r),this.subscribers[t]=n,()=>{this.off(t,r)}}onCall(t){for(let[r,n]of Object.entries(t))this.on(r,n)}once(t,r){let n=o(async(...i)=>(this.off(t,n),await z(r(...i))),"onceListener");return this.on(t,n),()=>{this.off(t,r)}}off(t,r){return this.subscribers[t]=(this.subscribers[t]||[]).filter(n=>r&&n!==r),this}removeAllListeners(){return this.subscribers={},this}};o(M,"Emitter");function zi(){let e=X().emitter;return e||(e=new M,X().emitter=e),e}o(zi,"getGlobalEmitter");var Vi=new M;function qi(e,t){let r=Math.round(R()*100);var n=[],i;let s=o((a,l)=>{let c={key:a,obj:l};n.push(c),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):te.error(r,"Cannot listen to key"):e.onAny?e.onAny((a,l)=>{s(a,l)}):te.error(r,"cannot listen to all for",e),o((a,l=!0)=>new Promise((c,d)=>{a||(a=t,a||n.length&&(a=n[0].key)),i=o(()=>{for(;n.length>0;){let g=n.shift();if(g.key===a)i=void 0,c(g.obj);else{if(l){te.warn(r,`Unhandled event ${a} with value: ${g.obj}`);continue}d(`Expected ${a}, but found ${g.key} with value=${g.obj}`),te.error(r,`Unhandled event ${a} with value: ${g.obj}`)}break}},"lazyResolve"),i()}),"on")}o(qi,"lazyListener");var re=o(()=>Date.now(),"getTimestamp");function It(e){return e>999?(e/1e3).toFixed(1)+"s":e.toFixed(2)+"ms"}o(It,"formatMilliseconds");function _i(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let r=null;if(t.includes(":"))try{r=new Date(t)}catch{}if(!(r instanceof Date)){let n=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);n&&(r=new Date(+n[1],+n[2]-1,+n[3],12,0))}if(r instanceof Date)return r}}}o(_i,"parseDate");var{encode:kt,decode:Ir}=N(62),{encode:Cr,decode:Ji}=N(32);function Ot(){return Y(16)}o(Ot,"uuidBytes");var Wi=o(()=>new Uint32Array(Y(4))[0],"uuid32bit");function V(){return kt(Ot(),22)}o(V,"uuid");function Ki(e){return kt(e,22)}o(Ki,"uuidEncode");function Zi(e){let t=at(e);return 1e7-1e3-4e3-8e3-1e11,`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}o(Zi,"uuidEncodeV4");function Yi(e){return Ir(e,16)}o(Yi,"uuidDecode");function Qi(e){return ut(e.replaceAll("-",""))}o(Qi,"uuidDecodeV4");function Xi(){return Cr(Ot(),26)}o(Xi,"uuidB32");function es(e){return Cr(e,26)}o(es,"uuid32Encode");function ts(e){return Ji(e,16)}o(ts,"uuid32Decode");var Ct={};function q(e="id"){return Ct[e]==null&&(Ct[e]=0),`${e}-${Ct[e]++}`}o(q,"uname");var rs=0;function ns(){return`id-${rs++}`}o(ns,"qid");var os="10000000-1000-4000-8000-100000000000",is=typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID():()=>os.replace(/[018]/g,e=>(e^Y(1)[0]&15>>e/4).toString(16)),kr=16e11;function ss(e){var t=new Uint8Array([0,0,0,0,0,0]);let r=t.length-1;for(var n=0;n<t.length;n++){var i=e&255;t[r-n]=i,e=(e-i)/256}return t}o(ss,"longToByteArray");function Or(){let e=re()-kr;return new Uint8Array([...ss(e),...Y(10)])}o(Or,"suidBytes");function as(){return kt(Or(),22)}o(as,"suid");function us(e){return Fr(Ir(e,16))}o(us,"suidDate");function Fr(e){return new Date(kr+e.slice(0,6).reduce((t,r)=>t*256+r,0))}o(Fr,"suidBytesDate");var $r=(n=>(n[n.waiting=0]="waiting",n[n.running=1]="running",n[n.finished=2]="finished",n))($r||{}),Br=(n=>(n[n.replace=0]="replace",n[n.memoize=1]="memoize",n[n.error=2]="error",n))(Br||{});function ls(e={}){let{maxParallel:t=3}=e,r=new M,n=0,i=0,s=0,u=0,a={};async function l(){if(n>0){let[y,p]=Lt();return r.once("didFinish",p),y}}o(l,"waitFinishAll");function c(){r.emit("didFinish"),n=0,i=0}o(c,"didFinish");function d(){let y=0,p=0;for(let{max:h,resolved:T,state:x}of Object.values(a))y+=h,p+=x===2?h:Math.min(h,T);r.emit("didUpdate",n,i,y,p)}o(d,"didUpdate");function g(){if(d(),n>0&&n===i&&c(),s>=t)return;let y=Object.values(a).filter(p=>p.state===0);if(y.length>0){let p;for(let h of y)h.group!=null&&Object.values(a).some(T=>T.state===1&&T.id!==h.id&&T.group===h.group)||(p==null||h.priority<p.priority)&&(p=h);if(p!=null){let h=p.id,T=p.done;p.state=1,++s,r.emit("didStart",h);let x=o(v=>{p&&(p.result=v,p.state=2,p.resolved=p.max),--s,++i,g()},"taskFinished");p.task(p).then(v=>{T(v),r.emit("didResolve",h,v),x(v)}).catch(v=>{T(),r.emit("didReject",h,v),x()})}}}o(g,"performNext");function f(y){let p=a[y];p&&p.state===0&&(a[y].state=2,++i,r.emit("didCancel",y),d())}o(f,"cancel");function m(){Object.keys(a).forEach(f)}o(m,"cancelAll");function b(y,p={}){let h,T=new Promise(v=>h=v),x=p.id??V();if(a[x]!=null){let v=p.idConflictResolution??1;if(v===0)f(x);else if(v===1){let w=a[x];return{id:x,promise:(async()=>{if(w.state===2)return a[x].result})(),dispose:()=>f(x),cancel:()=>f(x)}}else throw new Error(`Pool task with id=${x} already exists!`)}return a[x]={id:x,task:y,priority:++u,group:p.group,state:0,max:p.max??1,resolved:p.resolved??0,done:h,payload:p.payload,setMax(v){a[x].max=v,d()},setResolved(v){a[x].resolved=v,d()},incResolved(v=1){a[x].resolved+=v,d()}},++n,g(),{id:x,promise:T,dispose:()=>f(x),cancel:()=>f(x)}}return o(b,"enqueue"),{events:r,cancel:f,cancelAll:m,enqueue:b,dispose:m,waitFinishAll:l}}o(ls,"usePool");var ze=class extends M{constructor(r={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:n=q("queue"),logLevel:i}=r;this.name=n,this.log=L(`zeed:queue:${n}`,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 r=this.queue.shift();if(this.log(`performNext => ${r==null?void 0:r.name}`),r==null)break;this.countResolved===0&&this.emit("didStart",this.countMax);let{name:n,task:i,resolve:s}=r;this.currentTask=i();let u;try{this.log.info(`start task ${n}`),u=await this.currentTask,this.log(`finished task ${n} 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(r,n={}){let{immediate:i=!1,name:s=q(this.name)}=n;return i?(this.log.info(`immediate execution ${s}`),await r()):(this.log(`enqueue ${s}`),new Promise(u=>{this.queue.push({name:s,task:r,resolve:u}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext()}))}async enqueueReentrant(r,n={}){return this.enqueue(r,{immediate:this.currentTask!=null,name:n.name})}async cancelAll(r=!0){this.log("cancelAll"),this.emit("didCancel");let n=this.queue.map(i=>i.resolve);this.queue=[],n.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(r=>{this.waitToFinish.push(r)})}get isPaused(){return this.paused}get hasTasks(){return this.queue.length!==0}};o(ze,"SerialQueue");var oe=!1,ne=oe?L("zeed:throttle"):()=>{};function cs(e,t={}){let{delay:r=100,trailing:n=!0,leading:i=!0}=t,s=0,u=0,a=0,l,c=Date.now();function d(){s&&(clearTimeout(s),s=void 0)}o(d,"clearExistingTimeout");function g(...f){let m=Date.now(),b=this,y=m-u;function p(){let T=Date.now();return`total ${(T-c).toFixed(1)}ms - elapsed ${(T-u).toFixed(1)}ms - visited ${a}x`}o(p,"debugElapsed");function h(){a=0,u=Date.now(),e.apply(b,f)}if(o(h,"exec"),l=h,y>r||!s){oe&&ne("elapsed",p()),i&&(y>r?(oe&&ne("\u{1F680} leading",p()),h()):++a);let T=y>r?r:r-y;ne(`\u23F1 start timeout with ${T.toFixed(1)}ms`,p()),d(),u=m,s=setTimeout(()=>{oe&&ne("\u23F1 reached timeout",p()),s=0,n&&(!i||a>0)&&(oe&&ne("\u{1F680} trailing",p()),l==null||l())},T)}else++a,oe&&ne("visited",p())}return o(g,"wrapper"),g.cancel=d,g.dispose=d,g}o(cs,"throttle");function fs(e,t={}){let{delay:r=100}=t,n=0;function i(){n&&(clearTimeout(n),n=0)}o(i,"clearExistingTimeout");function s(...u){let a=this;i(),n=setTimeout(()=>{n=0,e.apply(a,u)},r)}return o(s,"wrapper"),s.cancel=i,s.dispose=i,s}o(fs,"debounce");function ps(e=(t=>(t=globalThis==null?void 0:globalThis.location)==null?void 0:t.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")}o(ps,"isLocalHost");function ds(e){let{level:t=void 0,filter:r=void 0,messages:n=[]}=e,i=C(r),s=B(t);return u=>{!s(u.level)||!i(u.name)||n.push(u)}}o(ds,"LoggerMemoryHandler");var ye=class extends M{constructor(){super(...arguments);this.id=V()}close(){this.dispose()}};o(ye,"Channel");var ie=class extends ye{constructor(){super(...arguments);this.isConnected=!0}postMessage(r){var n;(n=this.other)==null||n.emit("message",{data:r,origin:"local",lastEventId:V()})}};o(ie,"LocalChannel");function gs(){let e=new ie,t=new ie;return e.other=t,t.other=e,[e,t]}o(gs,"createLocalChannelPair");var Ve=class{async encode(t){return t}async decode(t){return t}};o(Ve,"NoopEncoder");var _=class{async encode(t){return Se(t)}async decode(t){return De(t)}};o(_,"JsonEncoder");var qe=class{constructor(t){this.key=t}async encode(t){let r=Se(t);return await dt(r,this.key)}async decode(t){let r=await gt(t,this.key);return De(r)}};o(qe,"CryptoEncoder");var Ft=o((e,t,r={})=>new Proxy(r,{get:(n,i)=>i in n?n[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function ms(e={}){let{name:t=q("hub"),encoder:r=new _,retryAfter:n=1e3,ignoreUnhandled:i=!0,logLevel:s=!1}=e,u=L(t,s),a={},l,c=[],d,g={},f=o(()=>{clearTimeout(d)},"dispose"),m=o(async()=>{if(clearTimeout(d),l){if(l.isConnected)for(;c.length;){let h=c[0];try{l.postMessage(await r.encode(h)),c.shift()}catch(T){u.warn("postMessage",T);break}}c.length>0&&n>0&&(d=setTimeout(m,n))}},"postNext"),b=o(async h=>{u("enqueue postMessage",h),c.push(h),await m()},"postMessage"),y=o(async h=>{l=h,l.on("connect",m),l.on("message",async T=>{u("onmessage",typeof T);let{name:x,args:v,id:w,result:J,error:W}=await r.decode(T.data);if(x){u(`name ${x} id ${w}`);try{if(a[x]==null)throw new Error(`handler for ${x} was not found`);let I=a[x](...v);D(I)&&(I=await I),u(`result ${I}`),w&&b({id:w,result:I})}catch(I){let K=I instanceof Error?I:new Error(Oe(I));u.warn("execution error",K.name),b({id:w,error:{message:K.message,stack:K.stack,name:K.name}})}}else if(w)if(u(`response for id=${w}: result=${J}, error=${W}`),g[w]==null)J===void 0?u(`skip response for ${w}`):u.warn(`no response hook for ${w}`);else{let[I,K]=g[w];if(I&&K)if(delete g[w],W){let Le=new Error(W.message);Le.stack=W.stack,Le.name=W.name,u.warn("reject",Le.name),K(Le)}else u("resolve",J),I(J)}else i||u.warn("Unhandled message",T)}),m()},"connect"),p=o(async(h,T,x={})=>{let{timeout:v=5e3}=x,w=V();return b({name:h,args:T,id:w}),Et(new Promise((J,W)=>g[w]=[J,W]),v)},"fetchMessage");return e.channel&&y(e.channel),{dispose:f,connect:y,listen(h){Object.assign(a,h)},send(){return Ft(p,{},{options(h){return Ft(p,{...h})}})}}}o(ms,"useMessageHub");var he=class extends M{constructor(r){super();this.publish=this.emit;this.subscribe=this.on;let{name:n,encoder:i=new _,channel:s,debug:u=!1}=r;this.channel=s,this.encoder=i,this.debug=u,this.name=n??this.channel.id??q("pubsub"),this.log=L(`${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 l=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${l==null?void 0:l.event}, info=`,l):this.log(`channel message, event=${l==null?void 0:l.event}`),l){let{event:c,args:d}=l;await this.emitSuper(c,...d)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(r,...n){return await super.emit(r,...n)}async emit(r,...n){try{if(this.debug?this.log(`emit(${String(r)})`,r):this.log(`emit(${String(r)})`,n.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let i=await this.encoder.encode({event:r,args:n});return this.channel.postMessage(i),!0}catch(i){this.log.warn(`emit(${String(r)})`,i)}return!1}};o(he,"PubSub");function ys(e){return new he(e)}o(ys,"usePubSub");var hs=1;var Nr=o(e=>e,"defaultSerialize"),xs=Nr;function bs(e,t){let{post:r,on:n,eventNames:i=[],serialize:s=Nr,deserialize:u=xs}=t,a=new Map;return n(async l=>{let c=u(l),[d,g,f,m]=c;if(d===1||d===2){let b,y;if(m!=null)try{b=await e[m](...g)}catch(p){y=String(p)}else y="Method implementation missing";d===1&&f&&r(s(y?[4,y,f]:[3,b,f]))}else if(f){let b=a.get(f);b!=null&&(d===4?b.reject(g):b.resolve(g)),a.delete(f)}}),new Proxy({},{get(l,c){let d=o((...f)=>{r(s([2,f,null,c]))},"sendEvent");if(t.onlyEvents||i.includes(c))return d.asEvent=d,d;let g=o((...f)=>new Promise((m,b)=>{let y=hs++;a.set(y,{resolve:m,reject:b}),r(s([1,f,y,c]))}),"sendCall");return g.asEvent=d,g}})}o(bs,"useRPC");var se=L("zeed:network"),$t={cache:"no-cache",redirect:"follow",headers:{}};function Hr(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[r,n]=t[1].split(":",2);return{url:e.replace(t[1]+"@",""),username:r,password:n}}}o(Hr,"parseBasicAuth");async function Bt(e,t={},r=fetch){try{H(t)&&(t=fe({},...F(t)));let n=Hr(String(e));n&&(e=n.url,t=fe({},t,jr(n.username,n.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let i=await r(String(e),t);if(i.status<400)return i;try{se.warn(`Fetch of ${e} with ${t} returned status=${i.status}`),se.warn(`Response: ${await i.text()}`)}catch(s){se.error("Exception:",s)}}catch(n){se.error("fetchBasic",n)}}o(Bt,"fetchBasic");async function Ts(e,t={},r=fetch){try{let n=await Bt(e,[{method:"GET",headers:{Accept:"application/json"}},t],r);if(n)return await n.json()}catch(n){se.error("fetchJSON error:",n)}}o(Ts,"fetchJson");async function ws(e,t={},r=fetch){try{let n=await Bt(e,[$t,{method:"GET"},t],r);if(n)return await n.text()}catch(n){se.error("fetchHTML error:",n)}}o(ws,"fetchText");function Ls(e,t="POST"){return{method:t,...$t,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:Ut(e)}}o(Ls,"fetchOptionsFormURLEncoded");function vs(e,t="POST"){return{method:t,...$t,headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(e)}}o(vs,"fetchOptionsJson");function jr(e,t){return{headers:{Authorization:"Basic "+lt(e+":"+t)}}}o(jr,"fetchOptionsBasicAuth");function Nt(){if(typeof window<"u")return window}o(Nt,"getWindow");function Gr(){if(typeof navigator<"u")return navigator}o(Gr,"getNavigator");function As(){return Nt()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}o(As,"getGlobal");var E=Gr(),P=Nt();function zr(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}){var t,r,n,i,s,u,a,l,c;return e.ios=((t=E==null?void 0:E.platform)==null?void 0:t.match(/(iPhone|iPod|iPad)/i))!=null,e.macos=!!((r=E==null?void 0:E.platform)!=null&&r.startsWith("Mac")),e.windows=!!((n=E==null?void 0:E.platform)!=null&&n.startsWith("Win")),e.beaker=(P==null?void 0:P.beaker)!=null,e.electron=(((s=(i=E==null?void 0:E.userAgent)==null?void 0:i.toLowerCase())==null?void 0:s.indexOf(" electron/"))||-1)>-1&&!e.beaker,e.wkwebview=((u=P==null?void 0:P.webkit)==null?void 0:u.messageHandlers)!=null,e.pwa=(E==null?void 0:E.serviceWorker)!=null,e.pwaInstalled=(E==null?void 0:E.standalone)||((l=(a=P==null?void 0:P.matchMedia)==null?void 0:a.call(P,"(display-mode: standalone)"))==null?void 0:l.matches),e.node=typeof process<"u"&&((c=process==null?void 0:process.release)==null?void 0:c.name)==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope<"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=P&&"ontouchstart"in P||((E==null?void 0:E.maxTouchPoints)||0)>1||(E==null?void 0:E.msPointerEnabled)&&(P==null?void 0:P.MSGesture)||(P==null?void 0:P.DocumentTouch)&&document instanceof DocumentTouch,e}o(zr,"detect");var Vr=o(()=>typeof window<"u"&&globalThis===window,"isBrowser"),Es=zr();function Ps(e){Vr()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e)}o(Ps,"useExitHandler");var Xl=L("zeed:memstorage"),_e=class{constructor(t={}){this.store={}}setItem(t,r){this.store[t]=Q(r)}getItem(t){if(this.store.hasOwnProperty(t))return Q(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};o(_e,"MemStorage");function Ss(e={}){let{args:t=process.argv.slice(1),alias:r={},normalize:n=ht,booleanArgs:i=[],listArgs:s=[],numberArgs:u=[]}=e,a=Object.entries(r).reduce((f,m)=>{let[b,y]=m;typeof y=="string"&&(y=[y]);for(let p of y)f[n(p)]=n(b);return f},{}),l={_:[]};function c(f,m){l[f]==null||typeof l[f]=="boolean"?l[f]=m:Array.isArray(l[f])?l[f].push(m):l[f]=[l[f],m]}o(c,"setOpt");let d=[...t],g;for(;g=d.shift();){let f;if(/^--?/.test(g)){let m=g.replace(/^--?/,"");if(g.includes("=")){let[b,y]=m.split("=",2);m=b.trim(),f=y.trim()}m=n(m),m=a[m]??m,i.includes(m)?c(m,!0):(f=f??d.shift()??"",u.includes(m)&&(f=Number(f??0)),s.includes(m)?Array.isArray(l[m])?l[m].push(f):l[m]=[f]:c(m,f))}else l._.push(g)}return l}o(Ss,"parseArgs");var qr=require("child_process");function Ds(e){return new Promise(async(t,r)=>{let n=(0,qr.spawn)("pbcopy");n.on("error",i=>r(i)),n.on("close",()=>t(e)),n.stdin.write(e),n.stdin.end()})}o(Ds,"pbcopy");var Je=tt(require("crypto"),1);try{Je.default&&Je.default.webcrypto&&typeof globalThis<"u"&&typeof globalThis.crypto>"u"&&(globalThis.crypto=Je.default.webcrypto)}catch(e){console.warn("Failed to polyfill webcrypto",e)}var xe=tt(require("fs"),1),Jr=require("path");var be=L("zeed:env"),Ms=`
|
|
7
|
+
${i.stack}`:`${i.name||"Error"}: ${i.message}`:n?Ce(i,null,2):Ce(i):String(i))}o(br,"formatMessages");function de(e,t={}){return br(e,t).join(" ")}o(de,"renderMessages");function Do(e){try{return decodeURIComponent(escape(e))}catch{}return e}o(Do,"fixBrokenUth8String");var Mo={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:Co,fromCents:!1},Tr=o(e=>Math.round(e),"round"),xt=o(e=>Math.pow(10,e),"pow"),Ro=o((e,t)=>Tr(e/t)*t,"rounding"),Uo=/(\d)(?=(\d{3})+\b)/g,Io=/(\d)(?=(\d\d)+\d\b)/g;function G(e,t={}){return new k(e,t)}o(G,"currency");var ge=class{constructor(t,r={}){let n=Object.assign({},Mo,r),i=xt(n.precision??2),s=Fe(t,n);this.intValue=s,this.value=s/i,n.increment=n.increment||1/i,n.useVedic?n.groups=Io:n.groups=Uo,this._settings=n,this._precision=i}add(t){let{intValue:r,_settings:n,_precision:i}=this;return G((r+=Fe(t,n))/(n.fromCents?1:i),n)}subtract(t){let{intValue:r,_settings:n,_precision:i}=this;return G((r-=Fe(t,n))/(n.fromCents?1:i),n)}multiply(t){let{intValue:r,_settings:n,_precision:i}=this;return G((r*=t)/(n.fromCents?1:xt(i)),n)}divide(t){let{intValue:r,_settings:n}=this;return G(r/=Fe(t,n,!1),n)}distribute(t){let{intValue:r,_precision:n,_settings:i}=this,s=[],u=Math[r>=0?"floor":"ceil"](r/t),a=Math.abs(r-u*t),l=i.fromCents?1:n;for(;t!==0;t--){let c=G(u/l,i);a-- >0&&(c=c[r>=0?"add":"subtract"](1/l)),s.push(c)}return s}dollars(){return~~this.value}cents(){let{intValue:t,_precision:r}=this;return~~(t%r)}format(t){let{_settings:r}=this;return typeof t=="function"?t(this,r):r.format(this,Object.assign({},r,t))}toString(){let{intValue:t,_precision:r,_settings:n}=this;return Ro(t/r,n.increment).toFixed(n.precision)}toJSON(){return this.value}static sum(...t){return F(t).reduce((r,n)=>G(r).add(n),this.zero)}static avg(...t){let r=F(t);return r.reduce((n,i)=>G(n).add(i),this.zero).divide(r.length)}},k=ge;o(k,"Currency"),k.zero=new ge(0),k.one=new ge(1),k.hundred=new ge(100);function Fe(e,t,r=!0){let n=0,{decimal:i,errorOnInvalid:s,precision:u,fromCents:a}=t,l=xt(u),c=typeof e=="number";if(e instanceof k&&a)return e.intValue;if(c||e instanceof k)n=e instanceof k?e.value:e;else if(typeof e=="string"){let d=new RegExp("[^-\\d"+i+"]","g"),g=new RegExp("\\"+i,"g");n=e.replace(/\((.*)\)/,"-$1").replace(d,"").replace(g,"."),n=n||0}else{if(s)throw Error("Invalid Input");n=0}return a||(n*=l,n=n.toFixed(4)),r?Tr(n):n}o(Fe,"parse");function Co(e,t){let{pattern:r,negativePattern:n,symbol:i,separator:s,decimal:u,groups:a}=t,l=(""+e).replace(/^-/,"").split("."),c=l[0],d=l[1];return(e.value>=0?r:n).replace("!",i).replace("#",c.replace(a,"$1"+s)+(d?u+d:""))}o(Co,"format");var Be=864e5;function Ne(e){return Math.floor(e/1e4)}o(Ne,"dayYear");function bt(e){return Math.floor(e/100%100)}o(bt,"dayMonth");function wr(e){return Math.floor(e%100)}o(wr,"dayDay");function ko(e){return[Ne(e),bt(e),wr(e)]}o(ko,"dayToParts");function Tt(e,t=!1){return t?new Date(`${vr(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}o(Tt,"dayToDate");function Oo(){return me(new Date)}o(Oo,"dayFromToday");function Fo(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return wt(e);if(Array.isArray(e)&&e.length===3){let[r,n,i]=e;return He(r,n,i)}else if(e instanceof Date)return me(e,t)}o(Fo,"dayFromAny");function $o(e){return Tt(e,!0)}o($o,"dayToDateGMT");function me(e,t=!1){return t?wt(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}o(me,"dayFromDate");function Bo(e){return me(e,!0)}o(Bo,"dayFromDateGMT");function $e(e,t=!0){return Tt(e,t).getTime()}o($e,"dayToTimestamp");function Lr(e,t=!0){return me(new Date(e),t)}o(Lr,"dayFromTimestamp");function vr(e,t="-"){let r=String(e);return r.slice(0,4)+t+r.slice(4,6)+t+r.slice(6,8)}o(vr,"dayToString");function He(e,t=1,r=1){if(!(t<1||t>12||r<1||r>31))return e*1e4+t*100+r}o(He,"dayFromParts");function wt(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return+t}o(wt,"dayFromString");function No(e,t=0){let r=Ne(e),n=bt(e);return t!==0&&(n+=t,r+=Math.floor((n-1)/12),n=Math.floor((n-1)%12)+1,n===0&&(n=12)),He(r,n,1)}o(No,"dayMonthStart");function Ho(e,t=0){let r=Ne(e);return He(r+t,1,1)}o(Ho,"dayYearStart");function jo(e,t){return Lr($e(e)+t*864e5)}o(jo,"dayOffset");function Go(e,t){return Math.round(($e(t)-$e(e))/864e5)}o(Go,"dayDiff");var{warn:Ar}=L("zeed:promise");function Lt(){let e,t;return[new Promise((n,i)=>{e=n,t=i}),e,t]}o(Lt,"createPromise");async function zo(e){return new Promise(t=>setTimeout(t,e))}o(zo,"sleep");async function Vo(){return new Promise(e=>setTimeout(e,0))}o(Vo,"immediate");var vt=Symbol("timeout");async function qo(e,t,r=vt){return new Promise(async(n,i)=>{let s=!1,u=setTimeout(()=>{s=!0,n(r)},t);try{let a=await e;clearTimeout(u),s||n(a)}catch(a){clearTimeout(u),s||i(a)}})}o(qo,"timeout");var At=new Error("Timeout reached");function _o(e){return e===vt||e===At}o(_o,"isTimeout");async function Et(e,t){return t<=0?await e:new Promise(async(r,n)=>{let i=!1,s=setTimeout(()=>{i=!0,n(At)},t);try{let u=await e;clearTimeout(s),i||r(u)}catch(u){clearTimeout(s),i||n(u)}})}o(Et,"tryTimeout");function Jo(e,t,r=1e3){return new Promise((n,i)=>{let s=o(l=>{a&&(clearTimeout(a),u(),n(l))},"fn"),u=o(()=>{a=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):Ar("No remove listener method found for",e,t)},"done"),a=setTimeout(()=>{u(),i(new Error("Did not response in time"))},r);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):Ar("No listener method found for",e)})}o(Jo,"waitOn");function D(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}o(D,"isPromise");function z(e){return Promise.resolve(e)}o(z,"promisify");var A=class{get value(){return this.days}constructor(t){var r;if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=(r=A.from(t))==null?void 0:r.days),t==null){let n=new Date;this.days=n.getFullYear()*1e4+(n.getMonth()+1)*100+n.getDate()}else this.days=t}static fromNumber(t){return new A(t)}static fromString(t){return A.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,r=!1){return r?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,r=!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[n,i=1,s=1]=t;return i<1||i>12||s<1||s>31?void 0:new A(n*1e4+i*100+s)}else{if(t instanceof Date)return A.fromDate(t,r);if(t instanceof A)return t}}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let r=String(this.days);return r.slice(0,4)+t+r.slice(4,6)+t+r.slice(6,8)}toDate(t=!1){return t?new Date(`${this.toString()}T00:00:00.000Z`):new Date(this.days/1e4,this.days/100%100-1,this.days%100)}toDateGMT(){return this.toDate(!0)}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 r=this.month+t,n=Math.floor((r-1)%12)+1;n===0&&(n=12);let i=Math.floor((r-1)/12);return A.from([this.year+i,n,this.day])}daysUntil(t){var r;return Math.round((((r=new A(t))==null?void 0:r.toDateGMT().getTime())-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};o(A,"Day");async function Wo(e,t,r){let n=A.from(e),i=A.from(t);for(;n&&i&&(n==null?void 0:n.days)<=(i==null?void 0:i.days);){let s=r(n);D(s)&&await s,n=n.dayOffset(1)}}o(Wo,"forEachDay");function Ko(){return new A}o(Ko,"today");function Zo(e){return new A(e)}o(Zo,"day");function Yo(e){return A.fromDate(new Date(e)).days}o(Yo,"dateStringToDays");function Er(e,t=2){return+(+e).toFixed(t)}o(Er,"decimal");function Qo(e,t=2){return+(+e/Math.pow(10,t)).toFixed(t)}o(Qo,"decimalFromCents");function Xo(e,t=2){return Math.round(+e*Math.pow(10,t))}o(Xo,"decimalToCents");function ei(e,t=2){return t*(Er(e,t)%1)}o(ei,"decimalCentsPart");var Pt=o(e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),"escapeHTML"),ti=o(e=>e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),"unescapeHTML");function ri(e,t){return O(e)?Object.fromEntries(Object.entries(e).map(([r,n])=>{let i=t(r,n);return H(i)&&i.length===2?i:[r,i]}).filter(r=>r!=null)):{}}o(ri,"objectMap");function ni(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}o(ni,"objectMergeDisposable");var Pr=/[\u0000-\u001F\u0080-\u009F]/g,oi=/^\.+/,ii=/\.+$/;function Sr(){return/[<>:"/\\|?*\u0000-\u001F]/g}o(Sr,"filenameReservedRegex");function si(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}o(si,"windowsReservedNameRegex");function St(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(Sr().test(t)&&Pr.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(Sr(),t).replace(Pr,t).replace(oi,t).replace(ii,""),e=si().test(e)?e+t:e,e.slice(0,100)}o(St,"toValidFilename");var ai=/[\\\-\[\]\/{}()*+?.^$|]/g;function ui(e){return e?e instanceof RegExp?e.source:e.replace(ai,"\\$&"):""}o(ui,"escapeRegExp");var ee=o(e=>Math.abs(e)%1===.5,"isHalf"),Dt=o(e=>e%2===0,"isEven"),li=o(e=>Math.ceil(e),"roundUp"),ci=o(e=>Math.floor(e),"roundDown"),fi=o(e=>Math.round(e),"roundHalfUp"),pi=o(e=>{let t=Math.round(e);return ee(e)&&Dt(t)?t-1:t},"roundHalfOdd"),di=o(e=>ee(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),gi=o(e=>ee(e)?Math.floor(e):Math.round(e),"roundHalfDown"),mi=o(e=>{let t=Math.round(e);return ee(e)?Dt(t)?t:t-1:t},"roundHalfEven"),yi=o(e=>ee(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");function Mt(e){return e.reduce((t,r)=>Math.min(t,r.sort_weight||0),0)-1-R()}o(Mt,"startSortWeight");function Rt(e){return e.reduce((t,r)=>Math.max(t,r.sort_weight||0),0)+1+R()}o(Rt,"endSortWeight");function hi(e,t,r){let n=r.length,i=e<t;if(n<=0||e>=n-1)return Rt(r);if(e<=0)return Mt(r);r=Dr([...r]);let s=i?-1:0,u=r[e+s].sort_weight||0,l=(r[e+s+1].sort_weight||0)-u;if(l===0)return i?Mt(r):Rt(r);let c=u+l/2,d=l*.01*(R()-.5);return c+d}o(hi,"moveSortWeight");function Dr(e){return e.sort((t,r)=>(t.sort_weight||0)-(r.sort_weight||0)),e}o(Dr,"sortedItems");var xi=/((?:(?:(?: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 bi(e){return e.split(xi).map((t,r)=>{let n=Pt(t);return r%2?`<a target="_blank" href="${n}">${Mr(n)}</a>`:n}).join("")}o(bi,"linkifyPlainText");function Mr(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}o(Mr,"toHumanReadableUrl");function Ut(e){let t=[];for(let[r,n]of Object.entries(e))if(n!=null){Array.isArray(n)||(n=[n]);for(let i of n)i!=null&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(String(i)))}return t.join("&")}o(Ut,"encodeQuery");function Ti(e){let t={},r=(e[0]==="?"?e.substr(1):e).split("&");for(let n=0;n<r.length;n++){let i=r[n].split("="),s=decodeURIComponent(i[0]),u=decodeURIComponent(i[1]||"");t[s]!=null?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(u)):t[s]=u}return t}o(Ti,"parseQuery");function wi(e,t,r){let n=e[t];return n===void 0&&(n=r(t,e),e[t]=n),n}o(wi,"ensureKey");async function Li(e,t,r){let n=e[t];return n===void 0&&(n=await r(t,e),e[t]=n),n}o(Li,"ensureKeyAsync");function vi(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}o(vi,"size");function Ai(e){return e!=null&&e.length>0?e[e.length-1]:void 0}o(Ai,"last");function Ei(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:(e==null?void 0:e.size)!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.warn("Failed to check if empty for",e,t)}return!0}o(Ei,"empty");function Q(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(Q,"cloneObject");function Pi(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(Pi,"cloneJsonObject");function Si(e){let t=new Map;return r=>{if(t.has(r))return t.get(r);let n=e(r);return t.set(r,n),n}}o(Si,"memoize");function Di(e){let t=new Map;return async(...r)=>{let n=JSON.stringify(r);if(t.has(n))return t.get(n);let i=await e(...r);return t.set(n,i),i}}o(Di,"memoizeAsync");function Mi(e,t){let r=[];for(let n=0;n<e;n++)r.push(t(n,e));return r}o(Mi,"forTimes");var Ri=/\\\s|\s+|#[^\n]*\n?/gm,Ui=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,Rr=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm,Ii=L("zeed:xrx");function Ur(e){return typeof e=="string"?e:e.source||""}o(Ur,"regExpString");function Ci(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}o(Ci,"regExpEscape");var je=class{constructor(t,r){this.namedGroups={};this.names=[];let n=r??"",i;if(t instanceof RegExp?(r==null&&(n=t.flags),i=t.source):i=t,n&&n.indexOf("x")!==-1&&(n=n.replace("x",""),i=i.replace(Ri,a=>a[0]==="\\"?a:"")),!(t instanceof RegExp)){let a=0;i=i.replace(Ui,(l,c)=>(a+=1,c?(c!=="index"&&c!=="length"&&!this.namedGroups[c]?this.namedGroups[c]=a:Ii.error(`Unallowed or duplicate group name: ${c}`),"("):l)),this.names=Object.keys(this.namedGroups)}i=Ur(i),Rr.lastIndex=0;let u=Rr.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,n)}get lastIndex(){return this.rx.lastIndex}set lastIndex(t){this.rx.lastIndex=t}_handleMatch(t){if(this.lookBehind){let r=t.input.slice(0,t.index);if(this.lookBehind.expect!==this.lookBehind.rx.test(r))return null}for(let r of this.names)t[r]=t[this.namedGroups[r]];return t}exec(t){let r;for(;r=this.rx.exec(t);)if(this.rx.lastIndex===r.index&&this.rx.lastIndex++,r=this._handleMatch(r),r!=null)return r}execAll(t){let r=[],n;for(this.rx.lastIndex=0;n=this.exec(t);)r.push(n);return this.rx.lastIndex=0,r}replace(t,r){let n=typeof r=="function"?r:()=>r;return t.replace(this.rx,i=>n(i))}};o(je,"XRX");var ki=L("zeed:dispose");async function Oi(e){typeof e=="function"?await z(e()):D(e)?await e:typeof e.dispose=="function"?await z(e.dispose()):D(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await z(e.cleanup()):D(e.cleanup)&&await e.cleanup}o(Oi,"callDisposer");function Ge(e){let{name:t}=typeof e=="string"?{name:e}:e??{},r=[],n=o(async u=>{u!=null&&r.includes(u)&&(Ie(r,a=>a!==u),await Oi(u))},"untrack"),i=o(async()=>{for(t&&ki.debug(`dispose ${t}: ${r.length} entries`);r.length>0;)await n(r[0])},"dispose"),s=o(u=>{if(u!=null)return r.unshift(u),()=>n(u)},"track");return Object.assign(i,{track:s,add:s,untrack:n,dispose:i,exec:i,getSize(){return r.length}})}o(Ge,"useDispose");var Fi=Ge;function $i(e={}){let{mode:t="fifo"}=e,r=[],n=o(async(s=!1)=>{for(;r.length>0;){let u=r[0];if(Ie(r,a=>a!==u),typeof u=="function"){let a=u();if(D(a)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await a}}else if(D(u)){if(s)throw new Error(`Expected sync only function, but found async: ${u}`);await u}else throw new Error(`Unhandled disposable: ${u}`)}},"exec");return Object.assign(n,{add:o(s=>{t==="lifo"?r.unshift(s):r.push(s)},"add"),exec:n,getSize(){return r.length}})}o($i,"useDefer");function Bi(e,t=0){let r=setTimeout(e,t);return()=>{r&&(clearTimeout(r),r=void 0)}}o(Bi,"useTimeout");function Ni(e,t){let r=setInterval(e,t);return()=>{r&&(clearInterval(r),r=void 0)}}o(Ni,"useInterval");function Hi(e,t,r,...n){return e==null?()=>{}:(e.on?e.on(t,r,...n):e.addEventListener&&e.addEventListener(t,r,...n),()=>{e.off?e.off(t,r,...n):e.removeEventListener&&e.removeEventListener(t,r,...n)})}o(Hi,"useEventListener");function ji(){let e=!0;return(t,r)=>{let n=!1;if(e){e=!1;try{t(),n=!0}finally{e=!0}}else r!==void 0&&r();return n}}o(ji,"useMutex");function Gi(){let e=!0;return async(t,r)=>{let n=!1;if(e){e=!1;try{let i=t();D(i)&&await i,n=!0}finally{e=!0}}else if(r!==void 0){let i=r();D(i)&&await i}return n}}o(Gi,"useAsyncMutex");var te=L("zeed:emitter"),M=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.dispose=Ge();this.call=new Proxy({},{get:(t,r)=>(...n)=>this.emit(r,...n)})}async emit(t,...r){let n=!1;this.dispose.add(()=>{this.subscribers={},this.subscribersOnAny=[]});try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...r)),i.length>0){let s=i.map(u=>{try{return z(u(...r))}catch(a){te.warn("emit warning:",a)}});n=!0,await Promise.all(s)}}catch(i){te.error("emit exception",i)}return n}onAny(t){this.subscribersOnAny.push(t)}on(t,r){let n=this.subscribers[t]||[];return n.push(r),this.subscribers[t]=n,()=>{this.off(t,r)}}onCall(t){for(let[r,n]of Object.entries(t))this.on(r,n)}once(t,r){let n=o(async(...i)=>(this.off(t,n),await z(r(...i))),"onceListener");return this.on(t,n),()=>{this.off(t,r)}}off(t,r){return this.subscribers[t]=(this.subscribers[t]||[]).filter(n=>r&&n!==r),this}removeAllListeners(){return this.subscribers={},this}};o(M,"Emitter");function zi(){let e=X().emitter;return e||(e=new M,X().emitter=e),e}o(zi,"getGlobalEmitter");var Vi=new M;function qi(e,t){let r=Math.round(R()*100);var n=[],i;let s=o((a,l)=>{let c={key:a,obj:l};n.push(c),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):te.error(r,"Cannot listen to key"):e.onAny?e.onAny((a,l)=>{s(a,l)}):te.error(r,"cannot listen to all for",e),o((a,l=!0)=>new Promise((c,d)=>{a||(a=t,a||n.length&&(a=n[0].key)),i=o(()=>{for(;n.length>0;){let g=n.shift();if(g.key===a)i=void 0,c(g.obj);else{if(l){te.warn(r,`Unhandled event ${a} with value: ${g.obj}`);continue}d(`Expected ${a}, but found ${g.key} with value=${g.obj}`),te.error(r,`Unhandled event ${a} with value: ${g.obj}`)}break}},"lazyResolve"),i()}),"on")}o(qi,"lazyListener");var re=o(()=>Date.now(),"getTimestamp");function It(e){return e>999?(e/1e3).toFixed(1)+"s":e.toFixed(2)+"ms"}o(It,"formatMilliseconds");function _i(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let r=null;if(t.includes(":"))try{r=new Date(t)}catch{}if(!(r instanceof Date)){let n=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);n&&(r=new Date(+n[1],+n[2]-1,+n[3],12,0))}if(r instanceof Date)return r}}}o(_i,"parseDate");var{encode:kt,decode:Ir}=N(62),{encode:Cr,decode:Ji}=N(32);function Ot(){return Y(16)}o(Ot,"uuidBytes");var Wi=o(()=>new Uint32Array(Y(4))[0],"uuid32bit");function V(){return kt(Ot(),22)}o(V,"uuid");function Ki(e){return kt(e,22)}o(Ki,"uuidEncode");function Zi(e){let t=at(e);return 1e7-1e3-4e3-8e3-1e11,`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}o(Zi,"uuidEncodeV4");function Yi(e){return Ir(e,16)}o(Yi,"uuidDecode");function Qi(e){return ut(e.replaceAll("-",""))}o(Qi,"uuidDecodeV4");function Xi(){return Cr(Ot(),26)}o(Xi,"uuidB32");function es(e){return Cr(e,26)}o(es,"uuid32Encode");function ts(e){return Ji(e,16)}o(ts,"uuid32Decode");var Ct={};function q(e="id"){return Ct[e]==null&&(Ct[e]=0),`${e}-${Ct[e]++}`}o(q,"uname");var rs=0;function ns(){return`id-${rs++}`}o(ns,"qid");var os="10000000-1000-4000-8000-100000000000",is=typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID.bind(crypto):()=>os.replace(/[018]/g,e=>(e^Y(1)[0]&15>>e/4).toString(16)),kr=16e11;function ss(e){var t=new Uint8Array([0,0,0,0,0,0]);let r=t.length-1;for(var n=0;n<t.length;n++){var i=e&255;t[r-n]=i,e=(e-i)/256}return t}o(ss,"longToByteArray");function Or(){let e=re()-kr;return new Uint8Array([...ss(e),...Y(10)])}o(Or,"suidBytes");function as(){return kt(Or(),22)}o(as,"suid");function us(e){return Fr(Ir(e,16))}o(us,"suidDate");function Fr(e){return new Date(kr+e.slice(0,6).reduce((t,r)=>t*256+r,0))}o(Fr,"suidBytesDate");var $r=(n=>(n[n.waiting=0]="waiting",n[n.running=1]="running",n[n.finished=2]="finished",n))($r||{}),Br=(n=>(n[n.replace=0]="replace",n[n.memoize=1]="memoize",n[n.error=2]="error",n))(Br||{});function ls(e={}){let{maxParallel:t=3}=e,r=new M,n=0,i=0,s=0,u=0,a={};async function l(){if(n>0){let[y,p]=Lt();return r.once("didFinish",p),y}}o(l,"waitFinishAll");function c(){r.emit("didFinish"),n=0,i=0}o(c,"didFinish");function d(){let y=0,p=0;for(let{max:h,resolved:T,state:x}of Object.values(a))y+=h,p+=x===2?h:Math.min(h,T);r.emit("didUpdate",n,i,y,p)}o(d,"didUpdate");function g(){if(d(),n>0&&n===i&&c(),s>=t)return;let y=Object.values(a).filter(p=>p.state===0);if(y.length>0){let p;for(let h of y)h.group!=null&&Object.values(a).some(T=>T.state===1&&T.id!==h.id&&T.group===h.group)||(p==null||h.priority<p.priority)&&(p=h);if(p!=null){let h=p.id,T=p.done;p.state=1,++s,r.emit("didStart",h);let x=o(v=>{p&&(p.result=v,p.state=2,p.resolved=p.max),--s,++i,g()},"taskFinished");p.task(p).then(v=>{T(v),r.emit("didResolve",h,v),x(v)}).catch(v=>{T(),r.emit("didReject",h,v),x()})}}}o(g,"performNext");function f(y){let p=a[y];p&&p.state===0&&(a[y].state=2,++i,r.emit("didCancel",y),d())}o(f,"cancel");function m(){Object.keys(a).forEach(f)}o(m,"cancelAll");function b(y,p={}){let h,T=new Promise(v=>h=v),x=p.id??V();if(a[x]!=null){let v=p.idConflictResolution??1;if(v===0)f(x);else if(v===1){let w=a[x];return{id:x,promise:(async()=>{if(w.state===2)return a[x].result})(),dispose:()=>f(x),cancel:()=>f(x)}}else throw new Error(`Pool task with id=${x} already exists!`)}return a[x]={id:x,task:y,priority:++u,group:p.group,state:0,max:p.max??1,resolved:p.resolved??0,done:h,payload:p.payload,setMax(v){a[x].max=v,d()},setResolved(v){a[x].resolved=v,d()},incResolved(v=1){a[x].resolved+=v,d()}},++n,g(),{id:x,promise:T,dispose:()=>f(x),cancel:()=>f(x)}}return o(b,"enqueue"),{events:r,cancel:f,cancelAll:m,enqueue:b,dispose:m,waitFinishAll:l}}o(ls,"usePool");var ze=class extends M{constructor(r={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:n=q("queue"),logLevel:i}=r;this.name=n,this.log=L(`zeed:queue:${n}`,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 r=this.queue.shift();if(this.log(`performNext => ${r==null?void 0:r.name}`),r==null)break;this.countResolved===0&&this.emit("didStart",this.countMax);let{name:n,task:i,resolve:s}=r;this.currentTask=i();let u;try{this.log.info(`start task ${n}`),u=await this.currentTask,this.log(`finished task ${n} 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(r,n={}){let{immediate:i=!1,name:s=q(this.name)}=n;return i?(this.log.info(`immediate execution ${s}`),await r()):(this.log(`enqueue ${s}`),new Promise(u=>{this.queue.push({name:s,task:r,resolve:u}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext()}))}async enqueueReentrant(r,n={}){return this.enqueue(r,{immediate:this.currentTask!=null,name:n.name})}async cancelAll(r=!0){this.log("cancelAll"),this.emit("didCancel");let n=this.queue.map(i=>i.resolve);this.queue=[],n.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(r=>{this.waitToFinish.push(r)})}get isPaused(){return this.paused}get hasTasks(){return this.queue.length!==0}};o(ze,"SerialQueue");var oe=!1,ne=oe?L("zeed:throttle"):()=>{};function cs(e,t={}){let{delay:r=100,trailing:n=!0,leading:i=!0}=t,s=0,u=0,a=0,l,c=Date.now();function d(){s&&(clearTimeout(s),s=void 0)}o(d,"clearExistingTimeout");function g(...f){let m=Date.now(),b=this,y=m-u;function p(){let T=Date.now();return`total ${(T-c).toFixed(1)}ms - elapsed ${(T-u).toFixed(1)}ms - visited ${a}x`}o(p,"debugElapsed");function h(){a=0,u=Date.now(),e.apply(b,f)}if(o(h,"exec"),l=h,y>r||!s){oe&&ne("elapsed",p()),i&&(y>r?(oe&&ne("\u{1F680} leading",p()),h()):++a);let T=y>r?r:r-y;ne(`\u23F1 start timeout with ${T.toFixed(1)}ms`,p()),d(),u=m,s=setTimeout(()=>{oe&&ne("\u23F1 reached timeout",p()),s=0,n&&(!i||a>0)&&(oe&&ne("\u{1F680} trailing",p()),l==null||l())},T)}else++a,oe&&ne("visited",p())}return o(g,"wrapper"),g.cancel=d,g.dispose=d,g}o(cs,"throttle");function fs(e,t={}){let{delay:r=100}=t,n=0;function i(){n&&(clearTimeout(n),n=0)}o(i,"clearExistingTimeout");function s(...u){let a=this;i(),n=setTimeout(()=>{n=0,e.apply(a,u)},r)}return o(s,"wrapper"),s.cancel=i,s.dispose=i,s}o(fs,"debounce");function ps(e=(t=>(t=globalThis==null?void 0:globalThis.location)==null?void 0:t.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")}o(ps,"isLocalHost");function ds(e){let{level:t=void 0,filter:r=void 0,messages:n=[]}=e,i=C(r),s=B(t);return u=>{!s(u.level)||!i(u.name)||n.push(u)}}o(ds,"LoggerMemoryHandler");var ye=class extends M{constructor(){super(...arguments);this.id=V()}close(){this.dispose()}};o(ye,"Channel");var ie=class extends ye{constructor(){super(...arguments);this.isConnected=!0}postMessage(r){var n;(n=this.other)==null||n.emit("message",{data:r,origin:"local",lastEventId:V()})}};o(ie,"LocalChannel");function gs(){let e=new ie,t=new ie;return e.other=t,t.other=e,[e,t]}o(gs,"createLocalChannelPair");var Ve=class{async encode(t){return t}async decode(t){return t}};o(Ve,"NoopEncoder");var _=class{async encode(t){return Se(t)}async decode(t){return De(t)}};o(_,"JsonEncoder");var qe=class{constructor(t){this.key=t}async encode(t){let r=Se(t);return await dt(r,this.key)}async decode(t){let r=await gt(t,this.key);return De(r)}};o(qe,"CryptoEncoder");var Ft=o((e,t,r={})=>new Proxy(r,{get:(n,i)=>i in n?n[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function ms(e={}){let{name:t=q("hub"),encoder:r=new _,retryAfter:n=1e3,ignoreUnhandled:i=!0,logLevel:s=!1}=e,u=L(t,s),a={},l,c=[],d,g={},f=o(()=>{clearTimeout(d)},"dispose"),m=o(async()=>{if(clearTimeout(d),l){if(l.isConnected)for(;c.length;){let h=c[0];try{l.postMessage(await r.encode(h)),c.shift()}catch(T){u.warn("postMessage",T);break}}c.length>0&&n>0&&(d=setTimeout(m,n))}},"postNext"),b=o(async h=>{u("enqueue postMessage",h),c.push(h),await m()},"postMessage"),y=o(async h=>{l=h,l.on("connect",m),l.on("message",async T=>{u("onmessage",typeof T);let{name:x,args:v,id:w,result:J,error:W}=await r.decode(T.data);if(x){u(`name ${x} id ${w}`);try{if(a[x]==null)throw new Error(`handler for ${x} was not found`);let I=a[x](...v);D(I)&&(I=await I),u(`result ${I}`),w&&b({id:w,result:I})}catch(I){let K=I instanceof Error?I:new Error(Oe(I));u.warn("execution error",K.name),b({id:w,error:{message:K.message,stack:K.stack,name:K.name}})}}else if(w)if(u(`response for id=${w}: result=${J}, error=${W}`),g[w]==null)J===void 0?u(`skip response for ${w}`):u.warn(`no response hook for ${w}`);else{let[I,K]=g[w];if(I&&K)if(delete g[w],W){let Le=new Error(W.message);Le.stack=W.stack,Le.name=W.name,u.warn("reject",Le.name),K(Le)}else u("resolve",J),I(J)}else i||u.warn("Unhandled message",T)}),m()},"connect"),p=o(async(h,T,x={})=>{let{timeout:v=5e3}=x,w=V();return b({name:h,args:T,id:w}),Et(new Promise((J,W)=>g[w]=[J,W]),v)},"fetchMessage");return e.channel&&y(e.channel),{dispose:f,connect:y,listen(h){Object.assign(a,h)},send(){return Ft(p,{},{options(h){return Ft(p,{...h})}})}}}o(ms,"useMessageHub");var he=class extends M{constructor(r){super();this.publish=this.emit;this.subscribe=this.on;let{name:n,encoder:i=new _,channel:s,debug:u=!1}=r;this.channel=s,this.encoder=i,this.debug=u,this.name=n??this.channel.id??q("pubsub"),this.log=L(`${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 l=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${l==null?void 0:l.event}, info=`,l):this.log(`channel message, event=${l==null?void 0:l.event}`),l){let{event:c,args:d}=l;await this.emitSuper(c,...d)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(r,...n){return await super.emit(r,...n)}async emit(r,...n){try{if(this.debug?this.log(`emit(${String(r)})`,r):this.log(`emit(${String(r)})`,n.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let i=await this.encoder.encode({event:r,args:n});return this.channel.postMessage(i),!0}catch(i){this.log.warn(`emit(${String(r)})`,i)}return!1}};o(he,"PubSub");function ys(e){return new he(e)}o(ys,"usePubSub");var hs=1;var Nr=o(e=>e,"defaultSerialize"),xs=Nr;function bs(e,t){let{post:r,on:n,eventNames:i=[],serialize:s=Nr,deserialize:u=xs}=t,a=new Map;return n(async l=>{let c=u(l),[d,g,f,m]=c;if(d===1||d===2){let b,y;if(m!=null)try{b=await e[m](...g)}catch(p){y=String(p)}else y="Method implementation missing";d===1&&f&&r(s(y?[4,y,f]:[3,b,f]))}else if(f){let b=a.get(f);b!=null&&(d===4?b.reject(g):b.resolve(g)),a.delete(f)}}),new Proxy({},{get(l,c){let d=o((...f)=>{r(s([2,f,null,c]))},"sendEvent");if(t.onlyEvents||i.includes(c))return d.asEvent=d,d;let g=o((...f)=>new Promise((m,b)=>{let y=hs++;a.set(y,{resolve:m,reject:b}),r(s([1,f,y,c]))}),"sendCall");return g.asEvent=d,g}})}o(bs,"useRPC");var se=L("zeed:network"),$t={cache:"no-cache",redirect:"follow",headers:{}};function Hr(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[r,n]=t[1].split(":",2);return{url:e.replace(t[1]+"@",""),username:r,password:n}}}o(Hr,"parseBasicAuth");async function Bt(e,t={},r=fetch){try{H(t)&&(t=fe({},...F(t)));let n=Hr(String(e));n&&(e=n.url,t=fe({},t,jr(n.username,n.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let i=await r(String(e),t);if(i.status<400)return i;try{se.warn(`Fetch of ${e} with ${t} returned status=${i.status}`),se.warn(`Response: ${await i.text()}`)}catch(s){se.error("Exception:",s)}}catch(n){se.error("fetchBasic",n)}}o(Bt,"fetchBasic");async function Ts(e,t={},r=fetch){try{let n=await Bt(e,[{method:"GET",headers:{Accept:"application/json"}},t],r);if(n)return await n.json()}catch(n){se.error("fetchJSON error:",n)}}o(Ts,"fetchJson");async function ws(e,t={},r=fetch){try{let n=await Bt(e,[$t,{method:"GET"},t],r);if(n)return await n.text()}catch(n){se.error("fetchHTML error:",n)}}o(ws,"fetchText");function Ls(e,t="POST"){return{method:t,...$t,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:Ut(e)}}o(Ls,"fetchOptionsFormURLEncoded");function vs(e,t="POST"){return{method:t,...$t,headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(e)}}o(vs,"fetchOptionsJson");function jr(e,t){return{headers:{Authorization:"Basic "+lt(e+":"+t)}}}o(jr,"fetchOptionsBasicAuth");function Nt(){if(typeof window<"u")return window}o(Nt,"getWindow");function Gr(){if(typeof navigator<"u")return navigator}o(Gr,"getNavigator");function As(){return Nt()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}o(As,"getGlobal");var E=Gr(),P=Nt();function zr(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}){var t,r,n,i,s,u,a,l,c;return e.ios=((t=E==null?void 0:E.platform)==null?void 0:t.match(/(iPhone|iPod|iPad)/i))!=null,e.macos=!!((r=E==null?void 0:E.platform)!=null&&r.startsWith("Mac")),e.windows=!!((n=E==null?void 0:E.platform)!=null&&n.startsWith("Win")),e.beaker=(P==null?void 0:P.beaker)!=null,e.electron=(((s=(i=E==null?void 0:E.userAgent)==null?void 0:i.toLowerCase())==null?void 0:s.indexOf(" electron/"))||-1)>-1&&!e.beaker,e.wkwebview=((u=P==null?void 0:P.webkit)==null?void 0:u.messageHandlers)!=null,e.pwa=(E==null?void 0:E.serviceWorker)!=null,e.pwaInstalled=(E==null?void 0:E.standalone)||((l=(a=P==null?void 0:P.matchMedia)==null?void 0:a.call(P,"(display-mode: standalone)"))==null?void 0:l.matches),e.node=typeof process<"u"&&((c=process==null?void 0:process.release)==null?void 0:c.name)==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope<"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=P&&"ontouchstart"in P||((E==null?void 0:E.maxTouchPoints)||0)>1||(E==null?void 0:E.msPointerEnabled)&&(P==null?void 0:P.MSGesture)||(P==null?void 0:P.DocumentTouch)&&document instanceof DocumentTouch,e}o(zr,"detect");var Vr=o(()=>typeof window<"u"&&globalThis===window,"isBrowser"),Es=zr();function Ps(e){Vr()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e)}o(Ps,"useExitHandler");var Xl=L("zeed:memstorage"),_e=class{constructor(t={}){this.store={}}setItem(t,r){this.store[t]=Q(r)}getItem(t){if(this.store.hasOwnProperty(t))return Q(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};o(_e,"MemStorage");function Ss(e={}){let{args:t=process.argv.slice(1),alias:r={},normalize:n=ht,booleanArgs:i=[],listArgs:s=[],numberArgs:u=[]}=e,a=Object.entries(r).reduce((f,m)=>{let[b,y]=m;typeof y=="string"&&(y=[y]);for(let p of y)f[n(p)]=n(b);return f},{}),l={_:[]};function c(f,m){l[f]==null||typeof l[f]=="boolean"?l[f]=m:Array.isArray(l[f])?l[f].push(m):l[f]=[l[f],m]}o(c,"setOpt");let d=[...t],g;for(;g=d.shift();){let f;if(/^--?/.test(g)){let m=g.replace(/^--?/,"");if(g.includes("=")){let[b,y]=m.split("=",2);m=b.trim(),f=y.trim()}m=n(m),m=a[m]??m,i.includes(m)?c(m,!0):(f=f??d.shift()??"",u.includes(m)&&(f=Number(f??0)),s.includes(m)?Array.isArray(l[m])?l[m].push(f):l[m]=[f]:c(m,f))}else l._.push(g)}return l}o(Ss,"parseArgs");var qr=require("child_process");function Ds(e){return new Promise(async(t,r)=>{let n=(0,qr.spawn)("pbcopy");n.on("error",i=>r(i)),n.on("close",()=>t(e)),n.stdin.write(e),n.stdin.end()})}o(Ds,"pbcopy");var Je=tt(require("crypto"),1);try{typeof globalThis<"u"&&typeof globalThis.crypto>"u"&&Je.default&&Je.default.webcrypto&&(globalThis.crypto=Je.default.webcrypto)}catch(e){console.warn("Failed to polyfill webcrypto",e)}var xe=tt(require("fs"),1),Jr=require("path");var be=L("zeed:env"),Ms=`
|
|
8
8
|
`,Rs=/^\s*([\w_.-]+)\s*=\s*(.*)?\s*$/,Us=/\\n/g,Is=/\n|\r|\r\n/;function _r(e,t={}){let r={};return String(e).split(Is).forEach(function(n,i){let s=n.match(Rs);if(s!=null){let u=s[1],a=s[2]||"",l=a.length-1,c=a[0]==='"'&&a[l]==='"';a[0]==="'"&&a[l]==="'"||c?(a=a.substring(1,l),c&&(a=a.replace(Us,Ms))):a=a.trim(),r[u]=a}else be.debug(`did not match key and value when parsing line ${i+1}: ${n}`)}),r}o(_r,"parse");function Wr(e,t="."){return(0,Jr.resolve)(process.cwd(),e??t)}o(Wr,"stringToPath");function Kr(e,t=""){return e==null&&(e=t),Wr(String(e).trim(),t)}o(Kr,"valueToPath");var We=Kr;function Cs(e,t=process.env){if(t[e]!=null)return t[e];e=e.toLowerCase();for(let[r,n]of Object.entries(t))if(r.toLowerCase()===e)return n}o(Cs,"getEnvVariableRelaxed");function ks(e={}){let t=(e==null?void 0:e.path)??We((e==null?void 0:e.filename)??".env"),r=(e==null?void 0:e.encoding)??"utf8",n=(e==null?void 0:e.debug)||!1;n!==!0&&(be.level=1/0);try{let i=xe.default.existsSync(t)?_r(xe.default.readFileSync(t,{encoding:r}),{debug:n}):{},s=xe.default.existsSync(t+".local")?_r(xe.default.readFileSync(t+".local",{encoding:r}),{debug:n}):{},u=Object.assign({},i,s),a=(e==null?void 0:e.env)??process.env;return Object.entries(u).forEach(([l,c])=>{typeof(e==null?void 0:e.prefix)=="string"&&(l=(e==null?void 0:e.prefix)+l),Object.prototype.hasOwnProperty.call(a,l)?be.debug(`"${l}" is already defined and will not be overwritten`):c!=null&&(be.info(`set env.${l} = ${c}`),a[l]=c)}),{parsed:u}}catch(i){return be.error(i),{error:i}}}o(ks,"setupEnv");var U=require("fs"),Te=require("path");var Zr=L("zeed:filestorage"),Ke=class{constructor(t={}){this.store={};this.fileKeys=void 0;this.pretty=!1;this.dirname=(0,Te.resolve)(process.cwd(),t.path||".fileStorage"),this.pretty=!!t.pretty,this.extension=t.extension??".json",t.extension&&!this.extension.startsWith(".")&&(this.extension="."+this.extension),this.extensionLength=this.extension.length,this.objectToString=t.objectToString??(r=>this.pretty?JSON.stringify(r,null,2):JSON.stringify(r)),this.objectFromString=t.objectFromString??(r=>{try{return JSON.parse(r)}catch(n){Zr.warn(`fileStorage parse error '${n}' in`,r)}}),this.keyToFilename=t.keyToFilename??St}setItem(t,r){this.store[t]=Q(r);try{let n=this.objectToString(r),i=this.getPath(t);(0,U.mkdirSync)((0,Te.dirname)(i),{recursive:!0}),(0,U.writeFileSync)(i,n,"utf8")}catch(n){Zr.error("setItem error",n)}}getPath(t){return(0,Te.resolve)(this.dirname,this.keyToFilename(t)+this.extension)}getBuffer(t){let r=this.getPath(t);return Buffer.from((0,U.readFileSync)(r))}getItem(t){let r=this.store[t];if(r!==null){if(r!=null)return Q(r);try{let n=this.getPath(t),i=(0,U.readFileSync)(n,"utf8");if(i!=null){let s=this.objectFromString(i);return this.store[t]=s,s}}catch{this.store[t]=null}}}removeItem(t){if(delete this.store[t],this.fileKeys!=null){let r=this.fileKeys.indexOf(t);r!==-1&&this.fileKeys.splice(r,1)}try{let r=this.getPath(t);(0,U.unlinkSync)(r)}catch{}}clear(){this.fileKeys=[],this.store={},(0,U.rmSync)(this.dirname,{recursive:!0,force:!0})}allKeys(){if(this.fileKeys==null)try{this.fileKeys=(0,U.readdirSync)(this.dirname,{withFileTypes:!0}).filter(r=>!r.isDirectory()&&r.name.endsWith(this.extension)).map(r=>r.name.slice(0,-this.extensionLength))||[]}catch{}let t=[...this.fileKeys||[]];for(let r of Object.keys(this.store))t.includes(r)||t.push(r);return t.sort(),t}};o(Ke,"FileStorage");var $=require("fs/promises"),ae=require("path");function Os(e){let t=(0,ae.normalize)(e),r=process.env.HOME;return r&&t.startsWith(r)?"~"+t.slice(r.length):t}o(Os,"toHumanReadableFilePath");async function Ze(e){try{await(0,$.stat)(e)}catch{return!1}return!0}o(Ze,"exists");async function Fs(...e){let t=(0,ae.join)(...e);return await Ze(t)||await(0,$.mkdir)(t,{recursive:!0}),t}o(Fs,"ensureFolder");async function $s(...e){let t=(0,ae.join)(...e);return await Ze(t)&&await(0,$.rm)(t,{recursive:!0}),t}o($s,"removeFolder");async function Bs(...e){let t=(0,ae.join)(...e);if(await Ze(t))return await(0,$.readFile)(t,"utf-8")}o(Bs,"readText");async function Ns(e,t){await(0,$.writeFile)(e,t,"utf-8")}o(Ns,"writeText");var Ye=require("fs"),Qe=require("path");var Yr={};function Ht(e,t={}){let{level:r=-1,filter:n="*"}=t;e=(0,Qe.resolve)(process.cwd(),e),(0,Ye.mkdirSync)((0,Qe.dirname)(e),{recursive:!0});var i=(0,Ye.createWriteStream)(e,{flags:"a"});let s=C(n),u=B(r);return a=>{if(!u(a.level)||!s(a.name))return;let l=new Date().toISOString(),c=a.name||"",d=Yr[c||""];d==null&&(Yr[c]=d);let g=[`[${c||"*"}]`,de(a.messages,{pretty:!1})];function f(...m){i.write(m.join(" ")+`
|
|
9
9
|
`)}switch(o(f,"write"),a.level){case 1:f(l,"I|* ",...g);break;case 2:f(l,"W|** ",...g);break;case 3:f(l,"E|***",...g);break;default:f(l,"D| ",...g);break}}}o(Ht,"LoggerFileHandler");var on=tt(require("tty"),1);var zt=require("path");function en(e){var t,r;return typeof e!="string"?[]:((r=(t=e==null?void 0:e.split(`
|
|
10
10
|
`))==null?void 0:t.map(n=>{let i=n.match(/^\s+at.*(\((.*)\)|file:\/\/(.*)$)|\s*at\s(\/.*)$/);if(i){let s=i[3]||i[2]||i[4];return s.endsWith(")")&&(s=s.slice(0,-1)),s}}))==null?void 0:r.filter(n=>n!=null))||[]}o(en,"getStackLlocationList");var jt=(0,zt.resolve)(process.cwd()),Qr,Xr,Gt=(Qr=process.env)!=null&&Qr.HOME?(0,zt.resolve)((Xr=process.env)==null?void 0:Xr.HOME):"";function tn(e){if(e.includes("/node_modules/"))return"";let t="file://";return e.startsWith(t)?e.substr(t.length):jt&&e.startsWith(jt)?e.substr(jt.length+1):(Gt&&e.startsWith(Gt)&&(e="~/"+e.substr(Gt.length+1)),e)}o(tn,"pathStripCwd");function Hs(e){let t=e.match(/^\s*at.*(\((.*)\)|file:\/\/(.*)$)|\s*at\s(\/.*)$/);if(t){let r=t[3]||t[2]||t[4];return r.endsWith(")")&&(r=r.slice(0,-1)),r}return""}o(Hs,"extractFileInfo");function Xe(e=2,t=!0){var i;let r=new Error().stack||"",n=(i=en(r))==null?void 0:i[e];return n&&t&&(n=tn(n)),n||""}o(Xe,"getSourceLocation");function Vt(){return new Error().stack||""}o(Vt,"getStack");function qt(e,t=!0){let r="",n=new Error().stack||"";if(typeof n=="string"){let i=n.split(`
|