{"version":3,"sources":["../../../node_modules/.pnpm/fflate@0.8.1/node_modules/fflate/esm/browser.js","../../../node_modules/.pnpm/valibot@0.13.1/node_modules/valibot/dist/index.js","../../../node_modules/.pnpm/@dotlottie+dotlottie-js@0.7.0/node_modules/node_modules/.pnpm/@rgba-image+copy@0.1.3/node_modules/@rgba-image/copy/src/index.ts","../../../node_modules/.pnpm/@dotlottie+dotlottie-js@0.7.0/node_modules/node_modules/.pnpm/@rgba-image+create-image@0.1.1/node_modules/@rgba-image/create-image/src/index.ts","../../../node_modules/.pnpm/@dotlottie+dotlottie-js@0.7.0/node_modules/node_modules/.pnpm/@rgba-image+lanczos@0.1.1/node_modules/@rgba-image/lanczos/src/filters.ts","../../../node_modules/.pnpm/@dotlottie+dotlottie-js@0.7.0/node_modules/node_modules/.pnpm/@rgba-image+lanczos@0.1.1/node_modules/@rgba-image/lanczos/src/convolve.ts","../../../node_modules/.pnpm/@dotlottie+dotlottie-js@0.7.0/node_modules/node_modules/.pnpm/@rgba-image+lanczos@0.1.1/node_modules/@rgba-image/lanczos/src/index.ts","../../../node_modules/.pnpm/@dotlottie+dotlottie-js@0.7.0/node_modules/@dotlottie/dotlottie-js/src/common/dotlottie-state-machine-common.ts","../../../node_modules/.pnpm/@dotlottie+dotlottie-js@0.7.0/node_modules/@dotlottie/dotlottie-js/src/common/dotlottie-state.ts","../../../node_modules/.pnpm/@dotlottie+dotlottie-js@0.7.0/node_modules/@dotlottie/dotlottie-js/src/common/manifest.ts","../../../node_modules/.pnpm/@dotlottie+dotlottie-js@0.7.0/node_modules/@dotlottie/dotlottie-js/src/common/utils.ts","../../../node_modules/.pnpm/@dotlottie+dotlottie-js@0.7.0/node_modules/@dotlottie/dotlottie-js/src/common/lottie-audio-common.ts","../../../node_modules/.pnpm/@preact+signals-core@1.4.0/node_modules/@preact/signals-core/src/index.ts","../../common/src/store.ts"],"names":["ch2","wk","c","id","msg","transfer","cb","w","e","d","ed","err","u","i","a","u8","O","H","i32","fleb","fdeb","clim","freb","start","r","b","n","j","_a","At","fl","$t","revfl","It","_e","bt","fd","_b","Jt","revfd","rev","_","R","x","ut","K","cd","mb","l","u16","s","le","co","rvb","o","sv","r_1","v","h","f","m","tt","flt","Wt","fdt","Gt","flrm","hMap","Zt","fdrm","st","N","p","bits16","Kt","shft","lt","slc","ec","ind","nt","inflt","dat","buf","dict","sl","dl","noBuf","resize","noSt","cbuf","bl","nbuf","final","pos","lm","dm","lbt","dbt","tbts","bits","type","hLit","hcLen","tl","ldt","V","clt","clb","max","q","clbmsk","clm","T","dt","Tt","y","E","g","t","M","S","me","dms","ve","lpos","vt","lms","sym","Z","add","Nt","Q","ot","dsym","gt","yt","$","Ht","end","jt","shift","dend","ye","Lt","et","we","mrg","Ae","k","wcln","Pt","fnStr","fn","ks","st_1","spInd","ch","cbfs","it","be","fns","init","td_1","td","ge","xe","inflateSync","pbf","gopt","xt","Qt","te","opts","wrkr","b2","P","F","b8","_t","b4","inflate","cbify","data","ev","wt","tds","dutf8","ze","Se","eb","latin1","W","zh","z","fnl","strFromU8","es","bs","z64e","sc","su","off","mt","kt","unzip","ee","term","files","cbd","tAll","lft","fltr","_loop_3","no","A","slzh","cbl","D","C","L","c_1","infl","Oe","flatten","arg1","re","issue","path","key","flatErrors","ValiError","Ne","symbol","getIssue","info","Le","executePipe","pipe","J","output","action","result","pipeInfo","getPipeInfo","parseInfo","issues","arg2","B","reason","validation","message","any","ne","input","arg3","getDefaultArgs","Y","getIssues","error","item","pathItem","boolean","ct","literal","literal2","Et","ae","cachedEntries","object2","value2","schema","wrapped","I","arg4","Ue","error2","string","BLOCKED_KEYS","Fe","Ot","valueResult","inputValue","inputKey","keyResult","getTupleArgs","Be","tuple","items","rest","zt","union","union2","ft","merge","schemas","X","schemas2","keys","object","ie","safeParse","se","maxValue","ht","minValue","requirement","Ve","St","Pe","fe","ke","Ce","qe","Re","$e","Je","He","exports","sx","source","dx","sy","sw","sh","sourceData","destData","dest","sourceY","destY","dy","sourceX","destX","sourceIndex","We","channels","fill","allZero","width","height","length","index","Ge","xPi","toFixedPoint","value","fixedFracBits","srcSize","destSize","scale","use2","scaleInverted","srcWindow","scaleClamped","maxFilterElementSize","packedFilter","packedFilterPtr","destPixel","sourcePixel","sourceLast","sourceFirst","floatFilter","filterElementSize","pixel","floatValue","filterValue","U","index2","filterValue2","total","filterTotal","fxpFilter","leftNotEmpty","rightNotEmpty","filterShift","filterSize","filters","srcOffset","dw","filterPtr","srcPtr","destOffset","Ke","convolve_1","require_convolve","xRatio","yRatio","filtersX","filters_1","Ze","tmp","filtersY","dh","croppedSource","croppedDest","lanczos22","copy_1","he","Ye","de","optional","number","PlayModeSchema","array","ManifestSchema","Xe","record","PlaybackOptionsSchema","omit","TransitionableSchema","StateTransitionOnClickSchema","StateTransitionOnEnterSchema","StateTransitionOnMouseEnterSchema","StateTransitionOnMouseLeaveSchema","StateTransitionOnCompleteSchema","StateTransitionOnShowSchema","G","DotLottieStateTransitionEventsSchema","ar","ir","StateTransitionOnAfterSchema","or","ur","rr","sr","DotLottieStatePlaybackSettingsSchema","nr","lr","tr","DotLottieStateSchema","DotLottieStateMachineSchema","DotLottieStateMachineDescriptorSchema","dr","MIME_TYPES","oe","MIME_CODES","pr","bytes","base64","withoutMeta","bufData","mimeType","dataArr","byte","Mt","DotLottieError","code","__publicField","pe","dataUrlFromU8","uint8Data","binaryString","getMimeTypeFromBase64","isImageAsset","asset","dotLottie","reject","resolve","unzipDotLottie","file","filter","mr","manifestFileName","unzippedManifest","vr","getManifest","manifest","Qe","manifestValidationResult","Yr","validateDotLottie","validationResult","yr","unzippedAudio","rt","name","audioPath","unzippedSingleAudio","gr","audioMap","animationData","pt","audioId","audioDataURL","animationId","isAudioAsset","unzippedImages","images","imagePath","unzippedImage","wr","imagesMap","imageId","getImages","imageDataURL","animationIdsSet","animations","getAnimation","Xr","unzipDotLottieFile","Dt","unzippedAnimation","animationsMap","inlineImageAssets","getTheme","Qr","themeId","unzippedTheme","getStateMachines","unzippedStates","statePath","getStateMachine","en","unzippedStateMachine","on","ln","cn","to","from","il","kr","VanilaConverter2","glayScaleCalculator","document2","hn","dn","pn","cycleDetected","Error","endBatch","batchDepth","hasError","batchedEffect","effect","batchIteration","next","_nextBatchedEffect","_flags","needsToRecompute","_callback","evalContext","globalVersion","signal","node","_node","_target","_version","_source","_prevSource","_sources","_nextSource","_prevTarget","_nextTarget","this","_targets","prototype","Signal","prev","subscribe","flag","valueOf","toString","toJSON","peek","Object","defineProperty","get","set","_value","_notify","target","_refresh","rollbackNode","head","_unsubscribe","_rollbackNode","Computed","compute","call","undefined","_globalVersion","prevContext","prepareSources","_compute","cleanupSources","OUTDATED","_subscribe","_cleanup","cleanup","cleanupEffect","disposeEffect","finish","_start","endEffect","bind","Effect","_dispose","initialState","state","callback","val"],"mappings":"AASA,IAAIA,GAAM,CAAC,EACPC,GAAM,SAAUC,EAAGC,EAAIC,EAAKC,EAAUC,EAAI,CAC1C,IAAIC,EAAI,IAAI,OAAOP,GAAIG,CAAE,IAAMH,GAAIG,CAAE,EAAI,IAAI,gBAAgB,IAAI,KAAK,CAClED,EAAI,iGACR,EAAG,CAAE,KAAM,iBAAkB,CAAC,CAAC,EAAE,EACjC,OAAAK,EAAE,UAAY,SAAUC,EAAG,CACvB,IAAIC,EAAID,EAAE,KAAME,EAAKD,EAAE,IACvB,GAAIC,EAAI,CACJ,IAAIC,EAAM,IAAI,MAAMD,EAAG,CAAC,CAAC,EACzBC,EAAI,KAAUD,EAAG,CAAC,EAClBC,EAAI,MAAQD,EAAG,CAAC,EAChBJ,EAAGK,EAAK,IAAI,CAChB,MAEIL,EAAG,KAAOM,CAClB,CACAL,EAAEM,EAAA,YAAiBR,EAAQS,CACpBP,EACXM,CAGIE,EAAKC,EAAA,WAAkBC,EAAA,YAAaC,GAAM,WAE1CC,GAAO,IAAOH,EAAC,CAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAA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,EAAKkC,EAAWC,OAIjB/jB,GAFA,aAKK8hB,KAAAA,EAAUqC,EAAS,QAAA,CA/sBV,EAgtBXvC,CAAAA,CAAAA,EAAKhB,GAAAA,UAGJA,EAAAA,UACAA,CAAAA,EAAAA,KACSgB,GAAAA,GACd6B,EAAe7B,KAtrBfvB,GAAAA,EAyrBA,KAAoBU,GACpBA,GAAAA,GAAAA,IAAca,EAAAA,GACPwC,IAAUC,EAAAA,KAAKzC,IACvB,EAEA0C,EAAOxC,OAAAA,EAAAA,KAAoB1b,GAAA,KAAA,KACpBwb,CAAAA,CAAAA,EAAKhB,GAAAA,UA9tBK,EAguBfgB,UACArB,CAAgBqB,EAAAA,KAIlB0C,IAAOxC,KAAAA,GAAUyC,EAAW,KAAA,EAAA1hB,GAAAA,GAC3B+e,KAAKhB,EApuBWhe,GAHD,UA0uBdqhB,EAAcrC,UAIhB,CAAA,KAASpB,GAAO4C,EACf,EAAA,KAAe,GAAIkB,GAAOlB,IAC1B,CAAA,EACC5C,SAIAzd,GAHQjD,EAAAA,CACR0gB,IAAAA,EAAAA,IAAO+D,GACDzkB,CACN,EAGD,GAAA,CAAAE,EAAOwgB,EAAO+D,CAASF,OACxB5hB,EC1vBO,CAAA,MAAAzC,EAAA,EACK,EAAAyC,CAAA,CAAA,OAEAzC,EAAA,EAAA,KAEHA,CAAA,CAAA,CAAA,IAAAyG,GAAA,KACL,CAAA,OAAK,WACL,YAAqB+d,EACvB,CAEO,KAAA,WACLxkB,EAAK,KAAA,OAAauG,GAAAvG,CAAK,CAAA,CAAA,SAAOA,EAC9B,CAAA,KAAK,WAAeykB,KAGf,OAAUC,MACf,KAAO,OAAK,MAAO1kB,CAAA,CAAA,UAA4B2kB,EAAK,CAAA,OAAK,KAAA,OAE7D,UAAAliB,GAAAzC,EAAAyC,EAAA,KAAA,UAAA,CAAA,CAAA,CAAA","sourcesContent":["// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new i32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return { b: b, r: r };\n};\nvar _a = freb(fleb, 2), fl = _a.b, revfl = _a.r;\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r;\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 1; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n return new u8(v.subarray(s, e));\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, st, buf, dict) {\n // source length dict length\n var sl = dat.length, dl = dict ? dict.length : 0;\n if (!sl || st.f && !st.l)\n return buf || new u8(0);\n var noBuf = !buf;\n // have to estimate size\n var resize = noBuf || st.i != 2;\n // no state\n var noSt = st.i;\n // Assumes roughly 33% compression ratio average\n if (noBuf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (resize)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17\n if (resize)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & (1 << b) - 1, pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (resize)\n cbuf(bt + 131072);\n var end = bt + add;\n if (bt < dt) {\n var shift = dl - dt, dend = Math.min(dt, end);\n if (shift + bt < 0)\n err(3);\n for (; bt < dend; ++bt)\n buf[bt] = dict[shift + bt];\n }\n for (; bt < end; ++bt)\n buf[bt] = buf[bt - dt];\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n // don't reallocate for streams or user buffers\n return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n d[o + 2] |= v >> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return { t: et, l: 0 };\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return { t: v, l: 1 };\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return { t: new u8(tr), l: mbt };\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return { c: cl.subarray(0, cli), n: s };\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l;\n var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l;\n var _c = lc(dlt), lclt = _c.c, nlc = _c.n;\n var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n ++lcfreq[lclt[i] & 31];\n for (var i = 0; i < lcdt.length; ++i)\n ++lcfreq[lcdt[i] & 31];\n var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];\n if (bs >= 0 && flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n var sym = syms[i];\n if (sym > 255) {\n var len = (sym >> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (sym >> 23) & 31), p += fleb[len];\n var dst = sym & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[sym]), p += ll[sym];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, st) {\n var s = st.z || dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var lst = st.l;\n var pos = (st.r || 0) & 7;\n if (lvl) {\n if (pos)\n w[0] = st.r >> 3;\n var opt = deo[lvl - 1];\n var n = opt >> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new i32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx blkpos\n var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0;\n for (; i + 2 < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = i - dif + j & 32767;\n var pti = prev[ti];\n var cd = ti - pti & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += imod - pimod & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one int32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n for (i = Math.max(i, wi); i < s; ++i) {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n if (!lst) {\n st.r = (pos & 7) | w[(pos / 8) | 0] << 3;\n // shft(pos) now 1 less if pos & 7 != 0\n pos -= 7;\n st.h = head, st.p = prev, st.i = i, st.w = wi;\n }\n }\n else {\n for (var i = st.w || 0; i < s + lst; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[(pos / 8) | 0] = lst;\n e = s;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n st.i = s;\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Adler32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n if (!st) {\n st = { l: 1 };\n if (opt.dictionary) {\n var dict = opt.dictionary.subarray(-32768);\n var newDat = new u8(dict.length + dat.length);\n newDat.set(dict);\n newDat.set(dat, dict.length);\n dat = newDat;\n st.w = dict.length;\n }\n }\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return fnStr;\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n fnStr = wcln(fns[i], fnStr, td_1);\n ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 };\n }\n var td = mrg({}, ch[id].e);\n return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; };\nvar bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zls]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get opts\nvar gopt = function (o) { return o && {\n out: o.size && new u8(o.size),\n dictionary: o.dictionary\n}; };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id, ext) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else if (!Array.isArray(dat))\n ext(dat);\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += (d[10] | d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32);\n c[1] |= 31 - ((c[0] << 8) | c[1]) % 31;\n if (o.dictionary) {\n var h = adler();\n h.p(o.dictionary);\n wbytes(c, 2, h.d());\n }\n};\n// zlib start\nvar zls = function (d, dict) {\n if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if ((d[1] >> 5 & 1) == +!dict)\n err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary');\n return (d[1] >> 3 & 4) + 2;\n};\nfunction StrmOpt(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n this.s = { l: 0, i: 32768, w: 32768, z: 32768 };\n // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev\n // 98304 = 32768 (lookback) + 65536 (common chunk size)\n this.b = new u8(98304);\n if (this.o.dictionary) {\n var dict = this.o.dictionary.subarray(-32768);\n this.b.set(dict, 32768 - dict.length);\n this.s.i = 32768 - dict.length;\n }\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, this.s), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n var endLen = chunk.length + this.s.z;\n if (endLen > this.b.length) {\n if (endLen > 2 * this.b.length - 32768) {\n var newBuf = new u8(endLen & -32768);\n newBuf.set(this.b.subarray(0, this.s.z));\n this.b = newBuf;\n }\n var split = this.b.length - this.s.z;\n if (split) {\n this.b.set(chunk.subarray(0, split), this.s.z);\n this.s.z = this.b.length;\n this.p(this.b, false);\n }\n this.b.set(this.b.subarray(-32768));\n this.b.set(chunk.subarray(split), 32768);\n this.s.z = chunk.length - split + 32768;\n this.s.i = 32766, this.s.w = 32768;\n }\n else {\n this.b.set(chunk, this.s.z);\n this.s.z += chunk.length;\n }\n this.s.l = final & 1;\n if (this.s.z > this.s.w + 8191 || final) {\n this.p(this.b, final || false);\n this.s.w = this.s.i, this.s.i -= 2;\n }\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n function Inflate(opts, cb) {\n // no StrmOpt here to avoid adding to workerizer\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);\n this.s = { i: 0, b: dict ? dict.length : 0 };\n this.o = new u8(32768);\n this.p = new u8(0);\n if (dict)\n this.o.set(dict);\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n if (!this.p.length)\n this.p = c;\n else if (c.length) {\n var n = new u8(this.p.length + c.length);\n n.set(this.p), n.set(c, this.p.length), this.p = n;\n }\n };\n Inflate.prototype.c = function (final) {\n this.s.i = +(this.d = final || false);\n var bts = this.s.b;\n var dt = inflt(this.p, this.s, this.o);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n function AsyncInflate(opts, cb) {\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Inflate(ev.data);\n onmessage = astrm(strm);\n }, 7);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, opts) {\n return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n this.l += chunk.length;\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming single or multi-member GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n function Gunzip(opts, cb) {\n this.v = 1;\n this.r = 0;\n Inflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n this.r += chunk.length;\n if (this.v) {\n var p = this.p.subarray(this.v - 1);\n var s = p.length > 3 ? gzs(p) : 4;\n if (s > p.length) {\n if (!final)\n return;\n }\n else if (this.v > 1 && this.onmember) {\n this.onmember(this.r - p.length);\n }\n this.p = p.subarray(s), this.v = 0;\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n // process concatenated GZIP\n if (this.s.f && !this.s.l) {\n this.v = shft(this.s.p) + 9;\n this.s = { i: 0 };\n this.o = new u8(0);\n if (this.p.length)\n this.push(new u8(0), final);\n }\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming single or multi-member GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n function AsyncGunzip(opts, cb) {\n var _this_1 = this;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gunzip(ev.data);\n strm.onmember = function (offset) { return postMessage(offset); };\n onmessage = astrm(strm);\n }, 9, function (offset) { return _this_1.onmember && _this_1.onmember(offset); });\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, opts) {\n var st = gzs(data);\n if (st + 8 > data.length)\n err(6, 'invalid gzip data');\n return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n function Unzlib(opts, cb) {\n Inflate.call(this, opts, cb);\n this.v = opts && opts.dictionary ? 2 : 1;\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 6 && !final)\n return;\n this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n function AsyncUnzlib(opts, cb) {\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Unzlib(ev.data);\n onmessage = astrm(strm);\n }, 11);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, opts) {\n return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n function Decompress(opts, cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.o = StrmOpt.call(this, opts, cb) || {};\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n var _this_2 = this;\n // enables reuse of this method by AsyncDecompress\n var cb = function () { _this_2.ondata.apply(_this_2, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(this.o, cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(this.o, cb)\n : new this.Z(this.o, cb);\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n function AsyncDecompress(opts, cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n Decompress.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, opts) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, opts)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, opts)\n : unzlibSync(data, opts);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return { s: r, r: slc(d, i - 1) };\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (final) {\n if (r.length)\n err(8);\n this.p = null;\n }\n else\n this.p = r;\n this.ondata(s, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td) {\n return td.decode(dat);\n }\n else {\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (r.length)\n err(8);\n return s;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this_1 = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this_1.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this_1.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this_1.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this_1.ondata(err, dat, final);\n _this_1.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this_1 = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this_1.d & 1))\n return;\n _this_1.u.splice(-1, 1);\n _this_1.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this_1 = this;\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this_1 = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this_1 = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this_1.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this_1.k[0] == chks_3 && _this_1.c)\n _this_1.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n if (sc < 320000) {\n try {\n cbl(null, inflateSync(infl, { out: new u8(su) }));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","// src/error/flatten/flatten.ts\nfunction flatten(arg1) {\n return (Array.isArray(arg1) ? arg1 : arg1.issues).reduce(\n (flatErrors, issue) => {\n if (issue.path) {\n const path = issue.path.map(({ key }) => key).join(\".\");\n flatErrors.nested[path] = [\n ...flatErrors.nested[path] || [],\n issue.message\n ];\n } else {\n flatErrors.root = [...flatErrors.root || [], issue.message];\n }\n return flatErrors;\n },\n { nested: {} }\n );\n}\n\n// src/error/ValiError/ValiError.ts\nvar ValiError = class extends Error {\n issues;\n /**\n * Creates a Valibot error with useful information.\n *\n * @param issues The error issues.\n */\n constructor(issues) {\n super(issues[0].message);\n this.name = \"ValiError\";\n this.issues = issues;\n }\n};\n\n// src/methods/brand/brand.ts\nvar symbol = Symbol(\"brand\");\nfunction brand(schema, name) {\n return schema;\n}\n\n// src/methods/coerce/coerce.ts\nfunction coerce(schema, action) {\n return {\n ...schema,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n return schema._parse(action(input), info);\n }\n };\n}\n\n// src/methods/coerce/coerceAsync.ts\nfunction coerceAsync(schema, action) {\n return {\n ...schema,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n return schema._parse(await action(input), info);\n }\n };\n}\n\n// src/methods/fallback/fallback.ts\nfunction fallback(schema, value2) {\n return {\n ...schema,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n const result = schema._parse(input, info);\n return {\n output: result.issues ? typeof value2 === \"function\" ? value2({\n input,\n issues: result.issues\n }) : value2 : result.output\n };\n }\n };\n}\n\n// src/methods/fallback/fallbackAsync.ts\nfunction fallbackAsync(schema, value2) {\n return {\n ...schema,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n const result = await schema._parse(input, info);\n return {\n output: result.issues ? typeof value2 === \"function\" ? value2({\n input,\n issues: result.issues\n }) : value2 : result.output\n };\n }\n };\n}\n\n// src/methods/is/is.ts\nfunction is(schema, input) {\n return !schema._parse(input, { abortEarly: true }).issues;\n}\n\n// src/utils/executePipe/utils/getIssue/getIssue.ts\nfunction getIssue(info, issue) {\n return {\n reason: info?.reason,\n validation: issue.validation,\n origin: info?.origin || \"value\",\n message: issue.message,\n input: issue.input,\n abortEarly: info?.abortEarly,\n abortPipeEarly: info?.abortPipeEarly\n };\n}\n\n// src/utils/executePipe/utils/getPipeInfo/getPipeInfo.ts\nfunction getPipeInfo(info, reason) {\n return {\n reason,\n origin: info?.origin,\n abortEarly: info?.abortEarly,\n abortPipeEarly: info?.abortPipeEarly\n };\n}\n\n// src/utils/executePipe/executePipe.ts\nfunction executePipe(input, pipe, parseInfo, reason) {\n if (!pipe || !pipe.length) {\n return { output: input };\n }\n let pipeInfo;\n let issues;\n let output = input;\n for (const action of pipe) {\n const result = action(output);\n if (result.issue) {\n pipeInfo = pipeInfo || getPipeInfo(parseInfo, reason);\n const issue = getIssue(pipeInfo, result.issue);\n issues ? issues.push(issue) : issues = [issue];\n if (pipeInfo.abortEarly || pipeInfo.abortPipeEarly) {\n break;\n }\n } else {\n output = result.output;\n }\n }\n return issues ? { issues } : { output };\n}\n\n// src/utils/executePipe/executePipeAsync.ts\nasync function executePipeAsync(input, pipe, parseInfo, reason) {\n if (!pipe || !pipe.length) {\n return { output: input };\n }\n let pipeInfo;\n let issues;\n let output = input;\n for (const action of pipe) {\n const result = await action(output);\n if (result.issue) {\n pipeInfo = pipeInfo || getPipeInfo(parseInfo, reason);\n const issue = getIssue(pipeInfo, result.issue);\n issues ? issues.push(issue) : issues = [issue];\n if (pipeInfo.abortEarly || pipeInfo.abortPipeEarly) {\n break;\n }\n } else {\n output = result.output;\n }\n }\n return issues ? { issues } : { output };\n}\n\n// src/utils/getDefaultArgs/getDefaultArgs.ts\nfunction getDefaultArgs(arg1, arg2) {\n return !arg1 || typeof arg1 === \"string\" ? [arg1, arg2] : [void 0, arg1];\n}\n\n// src/utils/getIssues/getIssues.ts\nfunction getIssues(info, reason, validation, message, input, issues) {\n return {\n issues: [\n {\n reason,\n validation,\n origin: info?.origin || \"value\",\n message,\n input,\n issues,\n abortEarly: info?.abortEarly,\n abortPipeEarly: info?.abortPipeEarly\n }\n ]\n };\n}\n\n// src/utils/isLuhnAlgo/isLuhnAlgo.ts\nfunction isLuhnAlgo(input) {\n const number2 = input.replace(/\\D/g, \"\");\n let length2 = number2.length;\n let bit = 1;\n let sum = 0;\n while (length2) {\n const value2 = +number2[--length2];\n bit ^= 1;\n sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value2] : value2;\n }\n return sum % 10 === 0;\n}\n\n// src/schemas/any/any.ts\nfunction any(pipe = []) {\n return {\n /**\n * The schema type.\n */\n schema: \"any\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n return executePipe(input, pipe, info, \"any\");\n }\n };\n}\n\n// src/schemas/any/anyAsync.ts\nfunction anyAsync(pipe = []) {\n return {\n /**\n * The schema type.\n */\n schema: \"any\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n return executePipeAsync(input, pipe, info, \"any\");\n }\n };\n}\n\n// src/schemas/array/array.ts\nfunction array(item, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n return {\n /**\n * The schema type.\n */\n schema: \"array\",\n /**\n * The array item schema.\n */\n array: { item },\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!Array.isArray(input)) {\n return getIssues(info, \"type\", \"array\", error || \"Invalid type\", input);\n }\n let issues;\n const output = [];\n for (let key = 0; key < input.length; key++) {\n const value2 = input[key];\n const result = item._parse(value2, info);\n if (result.issues) {\n const pathItem = {\n schema: \"array\",\n input,\n key,\n value: value2\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n break;\n }\n } else {\n output.push(result.output);\n }\n }\n return issues ? { issues } : executePipe(output, pipe, info, \"array\");\n }\n };\n}\n\n// src/schemas/array/arrayAsync.ts\nfunction arrayAsync(item, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n return {\n /**\n * The schema type.\n */\n schema: \"array\",\n /**\n * The array item schema.\n */\n array: { item },\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!Array.isArray(input)) {\n return getIssues(info, \"type\", \"array\", error || \"Invalid type\", input);\n }\n let issues;\n const output = [];\n await Promise.all(\n input.map(async (value2, key) => {\n if (!(info?.abortEarly && issues)) {\n const result = await item._parse(value2, info);\n if (!(info?.abortEarly && issues)) {\n if (result.issues) {\n const pathItem = {\n schema: \"array\",\n input,\n key,\n value: value2\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n throw null;\n }\n } else {\n output[key] = result.output;\n }\n }\n }\n })\n ).catch(() => null);\n return issues ? { issues } : executePipeAsync(output, pipe, info, \"array\");\n }\n };\n}\n\n// src/schemas/bigint/bigint.ts\nfunction bigint(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"bigint\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (typeof input !== \"bigint\") {\n return getIssues(\n info,\n \"type\",\n \"bigint\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipe(input, pipe, info, \"bigint\");\n }\n };\n}\n\n// src/schemas/bigint/bigintAsync.ts\nfunction bigintAsync(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"bigint\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (typeof input !== \"bigint\") {\n return getIssues(\n info,\n \"type\",\n \"bigint\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipeAsync(input, pipe, info, \"bigint\");\n }\n };\n}\n\n// src/schemas/blob/blob.ts\nfunction blob(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"blob\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!(input instanceof Blob)) {\n return getIssues(info, \"type\", \"blob\", error || \"Invalid type\", input);\n }\n return executePipe(input, pipe, info, \"blob\");\n }\n };\n}\n\n// src/schemas/blob/blobAsync.ts\nfunction blobAsync(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"blob\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!(input instanceof Blob)) {\n return getIssues(info, \"type\", \"blob\", error || \"Invalid type\", input);\n }\n return executePipeAsync(input, pipe, info, \"blob\");\n }\n };\n}\n\n// src/schemas/boolean/boolean.ts\nfunction boolean(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"boolean\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (typeof input !== \"boolean\") {\n return getIssues(\n info,\n \"type\",\n \"boolean\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipe(input, pipe, info, \"boolean\");\n }\n };\n}\n\n// src/schemas/boolean/booleanAsync.ts\nfunction booleanAsync(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"boolean\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (typeof input !== \"boolean\") {\n return getIssues(\n info,\n \"type\",\n \"boolean\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipeAsync(input, pipe, info, \"boolean\");\n }\n };\n}\n\n// src/schemas/date/date.ts\nfunction date(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"date\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!(input instanceof Date)) {\n return getIssues(info, \"type\", \"date\", error || \"Invalid type\", input);\n }\n return executePipe(input, pipe, info, \"date\");\n }\n };\n}\n\n// src/schemas/date/dateAsync.ts\nfunction dateAsync(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"date\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!(input instanceof Date)) {\n return getIssues(info, \"type\", \"date\", error || \"Invalid type\", input);\n }\n return executePipeAsync(input, pipe, info, \"date\");\n }\n };\n}\n\n// src/schemas/enumType/enumType.ts\nfunction enumType(enumValue, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"enum\",\n /**\n * The enum value.\n */\n enum: enumValue,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!enumValue.includes(input)) {\n return getIssues(info, \"type\", \"enum\", error || \"Invalid type\", input);\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/enumType/enumTypeAsync.ts\nfunction enumTypeAsync(enumValue, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"enum\",\n /**\n * The enum value.\n */\n enum: enumValue,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!enumValue.includes(input)) {\n return getIssues(info, \"type\", \"enum\", error || \"Invalid type\", input);\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/instance/instance.ts\nfunction instance(of, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n return {\n /**\n * The schema type.\n */\n schema: \"instance\",\n /**\n * The class of the instance.\n */\n class: of,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!(input instanceof of)) {\n return getIssues(\n info,\n \"type\",\n \"instance\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipe(input, pipe, info, \"instance\");\n }\n };\n}\n\n// src/schemas/instance/instanceAsync.ts\nfunction instanceAsync(of, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n return {\n /**\n * The schema type.\n */\n schema: \"instance\",\n /**\n * The class of the instance.\n */\n class: of,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!(input instanceof of)) {\n return getIssues(\n info,\n \"type\",\n \"instance\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipeAsync(input, pipe, info, \"instance\");\n }\n };\n}\n\n// src/schemas/literal/literal.ts\nfunction literal(literal2, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"literal\",\n /**\n * The literal value.\n */\n literal: literal2,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (input !== literal2) {\n return getIssues(\n info,\n \"type\",\n \"literal\",\n error || \"Invalid type\",\n input\n );\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/literal/literalAsync.ts\nfunction literalAsync(literal2, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"literal\",\n /**\n * The literal value.\n */\n literal: literal2,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (input !== literal2) {\n return getIssues(\n info,\n \"type\",\n \"literal\",\n error || \"Invalid type\",\n input\n );\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/map/map.ts\nfunction map(key, value2, arg3, arg4) {\n const [error, pipe] = getDefaultArgs(arg3, arg4);\n return {\n /**\n * The schema type.\n */\n schema: \"map\",\n /**\n * The map key and value schema.\n */\n map: { key, value: value2 },\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!(input instanceof Map)) {\n return getIssues(info, \"type\", \"map\", error || \"Invalid type\", input);\n }\n let issues;\n const output = /* @__PURE__ */ new Map();\n for (const [inputKey, inputValue] of input.entries()) {\n let pathItem;\n const keyResult = key._parse(inputKey, {\n origin: \"key\",\n abortEarly: info?.abortEarly,\n abortPipeEarly: info?.abortPipeEarly\n });\n if (keyResult.issues) {\n pathItem = {\n schema: \"map\",\n input,\n key: inputKey,\n value: inputValue\n };\n for (const issue of keyResult.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = keyResult.issues;\n }\n if (info?.abortEarly) {\n break;\n }\n }\n const valueResult = value2._parse(inputValue, info);\n if (valueResult.issues) {\n pathItem = pathItem || {\n schema: \"map\",\n input,\n key: inputKey,\n value: inputValue\n };\n for (const issue of valueResult.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = valueResult.issues;\n }\n if (info?.abortEarly) {\n break;\n }\n }\n if (!keyResult.issues && !valueResult.issues) {\n output.set(keyResult.output, valueResult.output);\n }\n }\n return issues ? { issues } : executePipe(output, pipe, info, \"map\");\n }\n };\n}\n\n// src/schemas/map/mapAsync.ts\nfunction mapAsync(key, value2, arg3, arg4) {\n const [error, pipe] = getDefaultArgs(arg3, arg4);\n return {\n /**\n * The schema type.\n */\n schema: \"map\",\n /**\n * The map key and value schema.\n */\n map: { key, value: value2 },\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!(input instanceof Map)) {\n return getIssues(info, \"type\", \"map\", error || \"Invalid type\", input);\n }\n const output = /* @__PURE__ */ new Map();\n let issues;\n await Promise.all(\n Array.from(input.entries()).map(async ([inputKey, inputValue]) => {\n let pathItem;\n const [keyResult, valueResult] = await Promise.all(\n [\n { schema: key, value: inputKey, origin: \"key\" },\n { schema: value2, value: inputValue, origin: \"value\" }\n ].map(async ({ schema, value: value3, origin }) => {\n if (!(info?.abortEarly && issues)) {\n const result = await schema._parse(value3, {\n origin,\n abortEarly: info?.abortEarly,\n abortPipeEarly: info?.abortPipeEarly\n });\n if (!(info?.abortEarly && issues)) {\n if (result.issues) {\n pathItem = pathItem || {\n schema: \"map\",\n input,\n key: inputKey,\n value: inputValue\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n throw null;\n }\n } else {\n return result;\n }\n }\n }\n })\n ).catch(() => []);\n if (keyResult && valueResult) {\n output.set(keyResult.output, valueResult.output);\n }\n })\n );\n return issues ? { issues } : executePipeAsync(input, pipe, info, \"map\");\n }\n };\n}\n\n// src/schemas/nan/nan.ts\nfunction nan(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"nan\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!Number.isNaN(input)) {\n return getIssues(info, \"type\", \"nan\", error || \"Invalid type\", input);\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/nan/nanAsync.ts\nfunction nanAsync(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"nan\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!Number.isNaN(input)) {\n return getIssues(info, \"type\", \"nan\", error || \"Invalid type\", input);\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/nativeEnum/nativeEnum.ts\nfunction nativeEnum(nativeEnum2, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"native_enum\",\n /**\n * The native enum value.\n */\n nativeEnum: nativeEnum2,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!Object.values(nativeEnum2).includes(input)) {\n return getIssues(\n info,\n \"type\",\n \"native_enum\",\n error || \"Invalid type\",\n input\n );\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/nativeEnum/nativeEnumAsync.ts\nfunction nativeEnumAsync(nativeEnum2, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"native_enum\",\n /**\n * The native enum value.\n */\n nativeEnum: nativeEnum2,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!Object.values(nativeEnum2).includes(input)) {\n return getIssues(\n info,\n \"type\",\n \"native_enum\",\n error || \"Invalid type\",\n input\n );\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/never/never.ts\nfunction never(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"never\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n return getIssues(info, \"type\", \"never\", error || \"Invalid type\", input);\n }\n };\n}\n\n// src/schemas/never/neverAsync.ts\nfunction neverAsync(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"never\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n return getIssues(info, \"type\", \"never\", error || \"Invalid type\", input);\n }\n };\n}\n\n// src/schemas/nonNullable/nonNullable.ts\nfunction nonNullable(wrapped, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"non_nullable\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (input === null) {\n return getIssues(\n info,\n \"type\",\n \"non_nullable\",\n error || \"Invalid type\",\n input\n );\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/nonNullable/nonNullableAsync.ts\nfunction nonNullableAsync(wrapped, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"non_nullable\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (input === null) {\n return getIssues(\n info,\n \"type\",\n \"non_nullable\",\n error || \"Invalid type\",\n input\n );\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/nonNullish/nonNullish.ts\nfunction nonNullish(wrapped, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"non_nullish\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (input === null || input === void 0) {\n return getIssues(\n info,\n \"type\",\n \"non_nullish\",\n error || \"Invalid type\",\n input\n );\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/nonNullish/nonNullishAsync.ts\nfunction nonNullishAsync(wrapped, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"non_nullish\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (input === null || input === void 0) {\n return getIssues(\n info,\n \"type\",\n \"non_nullish\",\n error || \"Invalid type\",\n input\n );\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/nonOptional/nonOptional.ts\nfunction nonOptional(wrapped, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"non_optional\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (input === void 0) {\n return getIssues(\n info,\n \"type\",\n \"non_optional\",\n error || \"Invalid type\",\n input\n );\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/nonOptional/nonOptionalAsync.ts\nfunction nonOptionalAsync(wrapped, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"non_optional\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (input === void 0) {\n return getIssues(\n info,\n \"type\",\n \"non_optional\",\n error || \"Invalid type\",\n input\n );\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/nullable/nullable.ts\nfunction nullable(wrapped) {\n return {\n /**\n * The schema type.\n */\n schema: \"nullable\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (input === null) {\n return { output: input };\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/nullable/nullableAsync.ts\nfunction nullableAsync(wrapped) {\n return {\n /**\n * The schema type.\n */\n schema: \"nullable\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (input === null) {\n return { output: input };\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/nullish/nullish.ts\nfunction nullish(wrapped) {\n return {\n /**\n * The schema type.\n */\n schema: \"nullish\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (input === null || input === void 0) {\n return { output: input };\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/nullish/nullishAsync.ts\nfunction nullishAsync(wrapped) {\n return {\n /**\n * The schema type.\n */\n schema: \"nullish\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (input === null || input === void 0) {\n return { output: input };\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/nullType/nullType.ts\nfunction nullType(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"null\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (input !== null) {\n return getIssues(info, \"type\", \"null\", error || \"Invalid type\", input);\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/nullType/nullTypeAsync.ts\nfunction nullTypeAsync(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"null\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (input !== null) {\n return getIssues(info, \"type\", \"null\", error || \"Invalid type\", input);\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/number/number.ts\nfunction number(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"number\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (typeof input !== \"number\") {\n return getIssues(\n info,\n \"type\",\n \"number\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipe(input, pipe, info, \"number\");\n }\n };\n}\n\n// src/schemas/number/numberAsync.ts\nfunction numberAsync(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"number\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (typeof input !== \"number\") {\n return getIssues(\n info,\n \"type\",\n \"number\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipeAsync(input, pipe, info, \"number\");\n }\n };\n}\n\n// src/schemas/object/object.ts\nfunction object(object2, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n let cachedEntries;\n return {\n /**\n * The schema type.\n */\n schema: \"object\",\n /**\n * The object schema.\n */\n object: object2,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!input || typeof input !== \"object\") {\n return getIssues(\n info,\n \"type\",\n \"object\",\n error || \"Invalid type\",\n input\n );\n }\n cachedEntries = cachedEntries || Object.entries(object2);\n let issues;\n const output = {};\n for (const [key, schema] of cachedEntries) {\n const value2 = input[key];\n const result = schema._parse(value2, info);\n if (result.issues) {\n const pathItem = {\n schema: \"object\",\n input,\n key,\n value: value2\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n break;\n }\n } else {\n output[key] = result.output;\n }\n }\n return issues ? { issues } : executePipe(\n output,\n pipe,\n info,\n \"object\"\n );\n }\n };\n}\n\n// src/schemas/object/objectAsync.ts\nfunction objectAsync(object2, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n let cachedEntries;\n return {\n /**\n * The schema type.\n */\n schema: \"object\",\n /**\n * The object schema.\n */\n object: object2,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!input || typeof input !== \"object\") {\n return getIssues(\n info,\n \"type\",\n \"object\",\n error || \"Invalid type\",\n input\n );\n }\n cachedEntries = cachedEntries || Object.entries(object2);\n let issues;\n const output = {};\n await Promise.all(\n cachedEntries.map(async ([key, schema]) => {\n if (!(info?.abortEarly && issues)) {\n const value2 = input[key];\n const result = await schema._parse(value2, info);\n if (!(info?.abortEarly && issues)) {\n if (result.issues) {\n const pathItem = {\n schema: \"object\",\n input,\n key,\n value: value2\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n throw null;\n }\n } else {\n output[key] = result.output;\n }\n }\n }\n })\n ).catch(() => null);\n return issues ? { issues } : executePipeAsync(\n output,\n pipe,\n info,\n \"object\"\n );\n }\n };\n}\n\n// src/schemas/optional/optional.ts\nfunction optional(wrapped) {\n return {\n /**\n * The schema type.\n */\n schema: \"optional\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (input === void 0) {\n return { output: input };\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/optional/optionalAsync.ts\nfunction optionalAsync(wrapped) {\n return {\n /**\n * The schema type.\n */\n schema: \"optional\",\n /**\n * The wrapped schema.\n */\n wrapped,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (input === void 0) {\n return { output: input };\n }\n return wrapped._parse(input, info);\n }\n };\n}\n\n// src/schemas/string/string.ts\nfunction string(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"string\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (typeof input !== \"string\") {\n return getIssues(\n info,\n \"type\",\n \"string\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipe(input, pipe, info, \"string\");\n }\n };\n}\n\n// src/schemas/string/stringAsync.ts\nfunction stringAsync(arg1, arg2) {\n const [error, pipe] = getDefaultArgs(arg1, arg2);\n return {\n /**\n * The schema type.\n */\n schema: \"string\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (typeof input !== \"string\") {\n return getIssues(\n info,\n \"type\",\n \"string\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipeAsync(input, pipe, info, \"string\");\n }\n };\n}\n\n// src/schemas/record/utils/getRecordArgs/getRecordArgs.ts\nfunction getRecordArgs(arg1, arg2, arg3, arg4) {\n if (typeof arg2 === \"object\" && !Array.isArray(arg2)) {\n const [error2, pipe2] = getDefaultArgs(arg3, arg4);\n return [arg1, arg2, error2, pipe2];\n }\n const [error, pipe] = getDefaultArgs(\n arg2,\n arg3\n );\n return [string(), arg1, error, pipe];\n}\n\n// src/schemas/record/values.ts\nvar BLOCKED_KEYS = [\"__proto__\", \"prototype\", \"constructor\"];\n\n// src/schemas/record/record.ts\nfunction record(arg1, arg2, arg3, arg4) {\n const [key, value2, error, pipe] = getRecordArgs(arg1, arg2, arg3, arg4);\n return {\n /**\n * The schema type.\n */\n schema: \"record\",\n /**\n * The record key and value schema.\n */\n record: { key, value: value2 },\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!input || typeof input !== \"object\") {\n return getIssues(\n info,\n \"type\",\n \"record\",\n error || \"Invalid type\",\n input\n );\n }\n let issues;\n const output = {};\n for (const [inputKey, inputValue] of Object.entries(input)) {\n if (!BLOCKED_KEYS.includes(inputKey)) {\n let pathItem;\n const keyResult = key._parse(inputKey, {\n origin: \"key\",\n abortEarly: info?.abortEarly,\n abortPipeEarly: info?.abortPipeEarly\n });\n if (keyResult.issues) {\n pathItem = {\n schema: \"record\",\n input,\n key: inputKey,\n value: inputValue\n };\n for (const issue of keyResult.issues) {\n issue.path = [pathItem];\n issues?.push(issue);\n }\n if (!issues) {\n issues = keyResult.issues;\n }\n if (info?.abortEarly) {\n break;\n }\n }\n const valueResult = value2._parse(inputValue, info);\n if (valueResult.issues) {\n pathItem = pathItem || {\n schema: \"record\",\n input,\n key: inputKey,\n value: inputValue\n };\n for (const issue of valueResult.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = valueResult.issues;\n }\n if (info?.abortEarly) {\n break;\n }\n }\n if (!keyResult.issues && !valueResult.issues) {\n output[keyResult.output] = valueResult.output;\n }\n }\n }\n return issues ? { issues } : executePipe(\n output,\n pipe,\n info,\n \"record\"\n );\n }\n };\n}\n\n// src/schemas/record/recordAsync.ts\nfunction recordAsync(arg1, arg2, arg3, arg4) {\n const [key, value2, error, pipe] = getRecordArgs(arg1, arg2, arg3, arg4);\n return {\n /**\n * The schema type.\n */\n schema: \"record\",\n /**\n * The record key and value schema.\n */\n record: { key, value: value2 },\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!input || typeof input !== \"object\") {\n return getIssues(\n info,\n \"type\",\n \"record\",\n error || \"Invalid type\",\n input\n );\n }\n let issues;\n const output = {};\n await Promise.all(\n // Note: `Object.entries(...)` converts each key to a string\n Object.entries(input).map(async ([inputKey, inputValue]) => {\n if (!BLOCKED_KEYS.includes(inputKey)) {\n let pathItem;\n const [keyResult, valueResult] = await Promise.all(\n [\n { schema: key, value: inputKey, origin: \"key\" },\n { schema: value2, value: inputValue, origin: \"value\" }\n ].map(async ({ schema, value: value3, origin }) => {\n if (!(info?.abortEarly && issues)) {\n const result = await schema._parse(value3, {\n origin,\n abortEarly: info?.abortEarly,\n abortPipeEarly: info?.abortPipeEarly\n });\n if (!(info?.abortEarly && issues)) {\n if (result.issues) {\n pathItem = pathItem || {\n schema: \"record\",\n input,\n key: inputKey,\n value: inputValue\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n throw null;\n }\n } else {\n return result;\n }\n }\n }\n })\n ).catch(() => []);\n if (keyResult && valueResult) {\n output[keyResult.output] = valueResult.output;\n }\n }\n })\n );\n return issues ? { issues } : executePipeAsync(\n output,\n pipe,\n info,\n \"record\"\n );\n }\n };\n}\n\n// src/schemas/recursive/recursive.ts\nfunction recursive(getter) {\n return {\n /**\n * The schema type.\n */\n schema: \"recursive\",\n /**\n * The schema getter.\n */\n getter,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n return getter()._parse(input, info);\n }\n };\n}\n\n// src/schemas/recursive/recursiveAsync.ts\nfunction recursiveAsync(getter) {\n return {\n /**\n * The schema type.\n */\n schema: \"recursive\",\n /**\n * The schema getter.\n */\n getter,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n return getter()._parse(input, info);\n }\n };\n}\n\n// src/schemas/set/set.ts\nfunction set(value2, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n return {\n /**\n * The schema type.\n */\n schema: \"set\",\n /**\n * The set value schema.\n */\n set: { value: value2 },\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!(input instanceof Set)) {\n return getIssues(info, \"type\", \"set\", error || \"Invalid type\", input);\n }\n let key = 0;\n let issues;\n const output = /* @__PURE__ */ new Set();\n for (const inputValue of input) {\n const result = value2._parse(inputValue, info);\n if (result.issues) {\n const pathItem = {\n schema: \"set\",\n input,\n key,\n value: inputValue\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n break;\n }\n } else {\n output.add(result.output);\n }\n key++;\n }\n return issues ? { issues } : executePipe(output, pipe, info, \"set\");\n }\n };\n}\n\n// src/schemas/set/setAsync.ts\nfunction setAsync(value2, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n return {\n /**\n * The schema type.\n */\n schema: \"set\",\n /**\n * The set value schema.\n */\n set: { value: value2 },\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!(input instanceof Set)) {\n return getIssues(info, \"type\", \"set\", error || \"Invalid type\", input);\n }\n let issues;\n const output = /* @__PURE__ */ new Set();\n await Promise.all(\n Array.from(input.values()).map(async (inputValue, key) => {\n if (!(info?.abortEarly && issues)) {\n const result = await value2._parse(inputValue, info);\n if (!(info?.abortEarly && issues)) {\n if (result.issues) {\n const pathItem = {\n schema: \"set\",\n input,\n key,\n value: inputValue\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n throw null;\n }\n } else {\n output.add(result.output);\n }\n }\n }\n })\n ).catch(() => null);\n return issues ? { issues } : executePipeAsync(input, pipe, info, \"set\");\n }\n };\n}\n\n// src/schemas/special/special.ts\nfunction special(check, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n return {\n /**\n * The schema type.\n */\n schema: \"special\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!check(input)) {\n return getIssues(\n info,\n \"type\",\n \"special\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipe(input, pipe, info, \"special\");\n }\n };\n}\n\n// src/schemas/special/specialAsync.ts\nfunction specialAsync(check, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n return {\n /**\n * The schema type.\n */\n schema: \"special\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!await check(input)) {\n return getIssues(\n info,\n \"type\",\n \"special\",\n error || \"Invalid type\",\n input\n );\n }\n return executePipeAsync(input, pipe, info, \"special\");\n }\n };\n}\n\n// src/schemas/symbol/symbol.ts\nfunction symbol2(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"symbol\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (typeof input !== \"symbol\") {\n return getIssues(\n info,\n \"type\",\n \"symbol\",\n error || \"Invalid type\",\n input\n );\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/symbol/symbolAsync.ts\nfunction symbolAsync(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"symbol\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (typeof input !== \"symbol\") {\n return getIssues(\n info,\n \"type\",\n \"symbol\",\n error || \"Invalid type\",\n input\n );\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/tuple/utils/getTupleArgs/getTupleArgs.ts\nfunction getTupleArgs(arg1, arg2, arg3) {\n if (typeof arg1 === \"object\" && !Array.isArray(arg1)) {\n const [error2, pipe2] = getDefaultArgs(arg2, arg3);\n return [arg1, error2, pipe2];\n }\n const [error, pipe] = getDefaultArgs(\n arg1,\n arg2\n );\n return [void 0, error, pipe];\n}\n\n// src/schemas/tuple/tuple.ts\nfunction tuple(items, arg2, arg3, arg4) {\n const [rest, error, pipe] = getTupleArgs(arg2, arg3, arg4);\n return {\n /**\n * The schema type.\n */\n schema: \"tuple\",\n /**\n * The tuple items and rest schema.\n */\n tuple: { items, rest },\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (!Array.isArray(input) || !rest && items.length !== input.length || rest && items.length > input.length) {\n return getIssues(info, \"type\", \"tuple\", error || \"Invalid type\", input);\n }\n let issues;\n const output = [];\n for (let key = 0; key < items.length; key++) {\n const value2 = input[key];\n const result = items[key]._parse(value2, info);\n if (result.issues) {\n const pathItem = {\n schema: \"tuple\",\n input,\n key,\n value: value2\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n break;\n }\n } else {\n output[key] = result.output;\n }\n }\n if (rest) {\n for (let key = items.length; key < input.length; key++) {\n const value2 = input[key];\n const result = rest._parse(value2, info);\n if (result.issues) {\n const pathItem = {\n schema: \"tuple\",\n input,\n key,\n value: value2\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n break;\n }\n } else {\n output[key] = result.output;\n }\n }\n }\n return issues ? { issues } : executePipe(\n output,\n pipe,\n info,\n \"tuple\"\n );\n }\n };\n}\n\n// src/schemas/tuple/tupleAsync.ts\nfunction tupleAsync(items, arg2, arg3, arg4) {\n const [rest, error, pipe] = getTupleArgs(arg2, arg3, arg4);\n return {\n /**\n * The schema type.\n */\n schema: \"tuple\",\n /**\n * The tuple items and rest schema.\n */\n tuple: { items, rest },\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (!Array.isArray(input) || !rest && items.length !== input.length || rest && items.length > input.length) {\n return getIssues(info, \"type\", \"tuple\", error || \"Invalid type\", input);\n }\n let issues;\n const output = [];\n await Promise.all([\n // Parse schema of each tuple item\n Promise.all(\n items.map(async (schema, key) => {\n if (!(info?.abortEarly && issues)) {\n const value2 = input[key];\n const result = await schema._parse(value2, info);\n if (!(info?.abortEarly && issues)) {\n if (result.issues) {\n const pathItem = {\n schema: \"tuple\",\n input,\n key,\n value: value2\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n throw null;\n }\n } else {\n output[key] = result.output;\n }\n }\n }\n })\n ),\n // If necessary parse schema of each rest item\n rest && Promise.all(\n input.slice(items.length).map(async (value2, index) => {\n if (!(info?.abortEarly && issues)) {\n const key = items.length + index;\n const result = await rest._parse(value2, info);\n if (!(info?.abortEarly && issues)) {\n if (result.issues) {\n const pathItem = {\n schema: \"tuple\",\n input,\n key,\n value: value2\n };\n for (const issue of result.issues) {\n if (issue.path) {\n issue.path.unshift(pathItem);\n } else {\n issue.path = [pathItem];\n }\n issues?.push(issue);\n }\n if (!issues) {\n issues = result.issues;\n }\n if (info?.abortEarly) {\n throw null;\n }\n } else {\n output[key] = result.output;\n }\n }\n }\n })\n )\n ]).catch(() => null);\n return issues ? { issues } : executePipeAsync(\n output,\n pipe,\n info,\n \"tuple\"\n );\n }\n };\n}\n\n// src/schemas/undefinedType/undefinedType.ts\nfunction undefinedType(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"undefined\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (typeof input !== \"undefined\") {\n return getIssues(\n info,\n \"type\",\n \"undefined\",\n error || \"Invalid type\",\n input\n );\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/undefinedType/undefinedTypeAsync.ts\nfunction undefinedTypeAsync(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"undefined\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (typeof input !== \"undefined\") {\n return getIssues(\n info,\n \"type\",\n \"undefined\",\n error || \"Invalid type\",\n input\n );\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/union/union.ts\nfunction union(union2, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"union\",\n /**\n * The union schema.\n */\n union: union2,\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n let issues;\n let output;\n for (const schema of union2) {\n const result = schema._parse(input, info);\n if (result.issues) {\n if (issues) {\n for (const issue of result.issues) {\n issues.push(issue);\n }\n } else {\n issues = result.issues;\n }\n } else {\n output = [result.output];\n break;\n }\n }\n return output ? { output: output[0] } : getIssues(\n info,\n \"type\",\n \"union\",\n error || \"Invalid type\",\n input,\n issues\n );\n }\n };\n}\n\n// src/schemas/union/unionAsync.ts\nfunction unionAsync(union2, error) {\n return {\n /**\n * The schema type.\n */\n schema: \"union\",\n /**\n * The union schema.\n */\n union: union2,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n let issues;\n let output;\n for (const schema of union2) {\n const result = await schema._parse(input, info);\n if (result.issues) {\n if (issues) {\n for (const issue of result.issues) {\n issues.push(issue);\n }\n } else {\n issues = result.issues;\n }\n } else {\n output = [result.output];\n break;\n }\n }\n return output ? { output: output[0] } : getIssues(\n info,\n \"type\",\n \"union\",\n error || \"Invalid type\",\n input,\n issues\n );\n }\n };\n}\n\n// src/schemas/unknown/unknown.ts\nfunction unknown(pipe = []) {\n return {\n /**\n * The schema type.\n */\n schema: \"unknown\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n return executePipe(input, pipe, info, \"unknown\");\n }\n };\n}\n\n// src/schemas/unknown/unknownAsync.ts\nfunction unknownAsync(pipe = []) {\n return {\n /**\n * The schema type.\n */\n schema: \"unknown\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n return executePipeAsync(input, pipe, info, \"unknown\");\n }\n };\n}\n\n// src/schemas/voidType/voidType.ts\nfunction voidType(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"void\",\n /**\n * Whether it's async.\n */\n async: false,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n if (typeof input !== \"undefined\") {\n return getIssues(info, \"type\", \"void\", error || \"Invalid type\", input);\n }\n return { output: input };\n }\n };\n}\n\n// src/schemas/voidType/voidTypeAsync.ts\nfunction voidTypeAsync(error) {\n return {\n /**\n * The schema type.\n */\n schema: \"void\",\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n if (typeof input !== \"undefined\") {\n return getIssues(info, \"type\", \"void\", error || \"Invalid type\", input);\n }\n return { output: input };\n }\n };\n}\n\n// src/methods/keyof/keyof.ts\nfunction keyof(schema) {\n return enumType(\n Object.keys(schema.object)\n );\n}\n\n// src/methods/merge/merge.ts\nfunction merge(schemas, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n return object(\n schemas.reduce(\n (object2, schemas2) => ({ ...object2, ...schemas2.object }),\n {}\n ),\n error,\n pipe\n );\n}\n\n// src/methods/merge/mergeAsync.ts\nfunction mergeAsync(schemas, arg2, arg3) {\n const [error, pipe] = getDefaultArgs(arg2, arg3);\n return objectAsync(\n schemas.reduce(\n (object2, schemas2) => ({ ...object2, ...schemas2.object }),\n {}\n ),\n error,\n pipe\n );\n}\n\n// src/methods/omit/omit.ts\nfunction omit(schema, keys, arg3, arg4) {\n const [error, pipe] = getDefaultArgs(arg3, arg4);\n return object(\n Object.entries(schema.object).reduce(\n (object2, [key, schema2]) => keys.includes(key) ? object2 : { ...object2, [key]: schema2 },\n {}\n ),\n error,\n pipe\n );\n}\n\n// src/methods/omit/omitAsync.ts\nfunction omitAsync(schema, keys, arg3, arg4) {\n const [error, pipe] = getDefaultArgs(arg3, arg4);\n return objectAsync(\n Object.entries(schema.object).reduce(\n (object2, [key, schema2]) => keys.includes(key) ? object2 : { ...object2, [key]: schema2 },\n {}\n ),\n error,\n pipe\n );\n}\n\n// src/methods/parse/parse.ts\nfunction parse(schema, input, info) {\n const result = schema._parse(input, info);\n if (result.issues) {\n throw new ValiError(result.issues);\n }\n return result.output;\n}\n\n// src/methods/parse/parseAsync.ts\nasync function parseAsync(schema, input, info) {\n const result = await schema._parse(input, info);\n if (result.issues) {\n throw new ValiError(result.issues);\n }\n return result.output;\n}\n\n// src/methods/partial/partial.ts\nfunction partial(schema, arg3, arg4) {\n const [error, pipe] = getDefaultArgs(arg3, arg4);\n return object(\n Object.entries(schema.object).reduce(\n (object2, [key, schema2]) => ({\n ...object2,\n [key]: optional(schema2)\n }),\n {}\n ),\n error,\n // @ts-ignore FIXME: Remove line once bug in TS is fixed\n pipe\n );\n}\n\n// src/methods/partial/partialAsync.ts\nfunction partialAsync(schema, arg3, arg4) {\n const [error, pipe] = getDefaultArgs(arg3, arg4);\n return objectAsync(\n Object.entries(schema.object).reduce(\n (object2, [key, schema2]) => ({\n ...object2,\n [key]: optionalAsync(schema2)\n }),\n {}\n ),\n error,\n // @ts-ignore FIXME: Remove line once bug in TS is fixed\n pipe\n );\n}\n\n// src/methods/pick/pick.ts\nfunction pick(schema, keys, arg3, arg4) {\n const [error, pipe] = getDefaultArgs(arg3, arg4);\n return object(\n Object.entries(schema.object).reduce(\n (object2, [key, schema2]) => keys.includes(key) ? { ...object2, [key]: schema2 } : object2,\n {}\n ),\n error,\n pipe\n );\n}\n\n// src/methods/pick/pickAsync.ts\nfunction pickAsync(schema, keys, arg3, arg4) {\n const [error, pipe] = getDefaultArgs(arg3, arg4);\n return objectAsync(\n Object.entries(schema.object).reduce(\n (object2, [key, schema2]) => keys.includes(key) ? { ...object2, [key]: schema2 } : object2,\n {}\n ),\n error,\n pipe\n );\n}\n\n// src/methods/required/required.ts\nfunction required(schema, arg3, arg4) {\n const [error, pipe] = getDefaultArgs(arg3, arg4);\n return object(\n Object.entries(schema.object).reduce(\n (object2, [key, schema2]) => ({\n ...object2,\n [key]: nonOptional(schema2)\n }),\n {}\n ),\n error,\n // @ts-ignore FIXME: Remove line once bug in TS is fixed\n pipe\n );\n}\n\n// src/methods/required/requiredAsync.ts\nfunction requiredAsync(schema, arg3, arg4) {\n const [error, pipe] = getDefaultArgs(arg3, arg4);\n return objectAsync(\n Object.entries(schema.object).reduce(\n (object2, [key, schema2]) => ({\n ...object2,\n [key]: nonOptionalAsync(schema2)\n }),\n {}\n ),\n error,\n // @ts-ignore FIXME: Remove line once bug in TS is fixed\n pipe\n );\n}\n\n// src/methods/safeParse/safeParse.ts\nfunction safeParse(schema, input, info) {\n const result = schema._parse(input, info);\n return result.issues ? {\n success: false,\n error: new ValiError(result.issues),\n issues: result.issues\n } : {\n success: true,\n data: result.output,\n output: result.output\n };\n}\n\n// src/methods/safeParse/safeParseAsync.ts\nasync function safeParseAsync(schema, input, info) {\n const result = await schema._parse(input, info);\n return result.issues ? {\n success: false,\n error: new ValiError(result.issues),\n issues: result.issues\n } : {\n success: true,\n data: result.output,\n output: result.output\n };\n}\n\n// src/methods/strict/strict.ts\nfunction strict(schema, error) {\n return {\n ...schema,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n const result = schema._parse(input, info);\n return !result.issues && // Check length of input and output keys\n Object.keys(input).length !== Object.keys(result.output).length ? getIssues(info, \"object\", \"strict\", error || \"Invalid keys\", input) : result;\n }\n };\n}\n\n// src/methods/strict/strictAsync.ts\nfunction strictAsync(schema, error) {\n return {\n ...schema,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n const result = await schema._parse(input, info);\n return !result.issues && // Check length of input and output keys\n Object.keys(input).length !== Object.keys(result.output).length ? getIssues(info, \"object\", \"strict\", error || \"Invalid keys\", input) : result;\n }\n };\n}\n\n// src/methods/transform/transform.ts\nfunction transform(schema, action) {\n return {\n ...schema,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n const result = schema._parse(input, info);\n return result.issues ? result : { output: action(result.output) };\n }\n };\n}\n\n// src/methods/transform/transformAsync.ts\nfunction transformAsync(schema, action) {\n return {\n ...schema,\n /**\n * Whether it's async.\n */\n async: true,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n async _parse(input, info) {\n const result = await schema._parse(input, info);\n return result.issues ? result : { output: await action(result.output) };\n }\n };\n}\n\n// src/methods/unwrap/unwrap.ts\nfunction unwrap(schema) {\n return schema.wrapped;\n}\n\n// src/methods/withDefault/withDefault.ts\nfunction withDefault(schema, value2) {\n return {\n ...schema,\n /**\n * Parses unknown input based on its schema.\n *\n * @param input The input to be parsed.\n * @param info The parse info.\n *\n * @returns The parsed output.\n */\n _parse(input, info) {\n return schema._parse(\n input === void 0 ? typeof value2 === \"function\" ? value2() : value2 : input,\n info\n );\n }\n };\n}\nvar useDefault = withDefault;\n\n// src/transformations/toCustom/toCustom.ts\nfunction toCustom(action) {\n return (input) => ({ output: action(input) });\n}\n\n// src/transformations/toCustom/toCustomAsync.ts\nfunction toCustomAsync(action) {\n return async (input) => ({\n output: await action(input)\n });\n}\n\n// src/transformations/toLowerCase/toLowerCase.ts\nfunction toLowerCase() {\n return (input) => ({\n output: input.toLocaleLowerCase()\n });\n}\n\n// src/transformations/toMaxValue/toMaxValue.ts\nfunction toMaxValue(requirement) {\n return (input) => ({\n output: input > requirement ? requirement : input\n });\n}\n\n// src/transformations/toMinValue/toMinValue.ts\nfunction toMinValue(requirement) {\n return (input) => ({\n output: input < requirement ? requirement : input\n });\n}\n\n// src/transformations/toTrimmed/toTrimmed.ts\nfunction toTrimmed() {\n return (input) => ({ output: input.trim() });\n}\n\n// src/transformations/toTrimmedEnd/toTrimmedEnd.ts\nfunction toTrimmedEnd() {\n return (input) => ({ output: input.trimEnd() });\n}\n\n// src/transformations/toTrimmedStart/toTrimmedStart.ts\nfunction toTrimmedStart() {\n return (input) => ({\n output: input.trimStart()\n });\n}\n\n// src/transformations/toUpperCase/toUpperCase.ts\nfunction toUpperCase() {\n return (input) => ({\n output: input.toUpperCase()\n });\n}\n\n// src/validations/bytes/bytes.ts\nfunction bytes(requirement, error) {\n return (input) => {\n if (new TextEncoder().encode(input).length !== requirement) {\n return {\n issue: {\n validation: \"bytes\",\n message: error || \"Invalid byte length\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/custom/custom.ts\nfunction custom(requirement, error) {\n return (input) => {\n if (!requirement(input)) {\n return {\n issue: {\n validation: \"custom\",\n message: error || \"Invalid input\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/custom/customAsync.ts\nfunction customAsync(requirement, error) {\n return async (input) => {\n if (!await requirement(input)) {\n return {\n issue: {\n validation: \"custom\",\n message: error || \"Invalid input\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/email/email.ts\nfunction email(error) {\n return (input) => {\n if (!/^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@(([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{2,})$/i.test(\n input\n )) {\n return {\n issue: {\n validation: \"email\",\n message: error || \"Invalid email\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/emoji/emoji.ts\nfunction emoji(error) {\n return (input) => {\n if (!/^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$/u.test(input)) {\n return {\n issue: {\n validation: \"emoji\",\n message: error || \"Invalid emoji\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/endsWith/endsWith.ts\nfunction endsWith(requirement, error) {\n return (input) => {\n if (!input.endsWith(requirement)) {\n return {\n issue: {\n validation: \"ends_with\",\n message: error || \"Invalid end\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/equal/equal.ts\nfunction equal(requirement, error) {\n return (input) => {\n if (input !== requirement) {\n return {\n issue: {\n validation: \"equal\",\n message: error || \"Invalid input\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/excludes/excludes.ts\nfunction excludes(requirement, error) {\n return (input) => {\n if (input.includes(requirement)) {\n return {\n issue: {\n validation: \"excludes\",\n message: error || \"Invalid content\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/finite/finite.ts\nfunction finite(error) {\n return (input) => {\n if (!Number.isFinite(input)) {\n return {\n issue: {\n validation: \"finite\",\n message: error || \"Invalid finite number\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/imei/imei.ts\nfunction imei(error) {\n return (input) => {\n if (!/^\\d{2}[ |/|-]?\\d{6}[ |/|-]?\\d{6}[ |/|-]?\\d$/.test(input) || !isLuhnAlgo(input)) {\n return {\n issue: {\n validation: \"imei\",\n message: error || \"Invalid IMEI\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/includes/includes.ts\nfunction includes(requirement, error) {\n return (input) => {\n if (!input.includes(requirement)) {\n return {\n issue: {\n validation: \"includes\",\n message: error || \"Invalid content\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/integer/integer.ts\nfunction integer(error) {\n return (input) => {\n if (!Number.isInteger(input)) {\n return {\n issue: {\n validation: \"integer\",\n message: error || \"Invalid integer\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/ip/ip.ts\nfunction ip(error) {\n return (input) => {\n if (!/^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$/.test(input) && !/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/.test(\n input\n )) {\n return {\n issue: {\n validation: \"ip\",\n message: error || \"Invalid IP\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/ipv4/ipv4.ts\nfunction ipv4(error) {\n return (input) => {\n if (!/^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$/.test(input)) {\n return {\n issue: {\n validation: \"ipv4\",\n message: error || \"Invalid IP v4\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/ipv6/ipv6.ts\nfunction ipv6(error) {\n return (input) => {\n if (!/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/.test(\n input\n )) {\n return {\n issue: {\n validation: \"ipv6\",\n message: error || \"Invalid IP v6\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/isoDate/isoDate.ts\nfunction isoDate(error) {\n return (input) => {\n if (!/^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])$/.test(input)) {\n return {\n issue: {\n validation: \"iso_date\",\n message: error || \"Invalid date\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/isoDateTime/isoDateTime.ts\nfunction isoDateTime(error) {\n return (input) => {\n if (!/^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])T(0[0-9]|1\\d|2[0-3]):[0-5]\\d$/.test(\n input\n )) {\n return {\n issue: {\n validation: \"iso_date_time\",\n message: error || \"Invalid datetime\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/isoTime/isoTime.ts\nfunction isoTime(error) {\n return (input) => {\n if (!/^(0[0-9]|1\\d|2[0-3]):[0-5]\\d$/.test(input)) {\n return {\n issue: {\n validation: \"iso_time\",\n message: error || \"Invalid time\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/isoTimeSecond/isoTimeSecond.ts\nfunction isoTimeSecond(error) {\n return (input) => {\n if (!/^(0[0-9]|1\\d|2[0-3]):[0-5]\\d:[0-5]\\d$/.test(input)) {\n return {\n issue: {\n validation: \"iso_time_second\",\n message: error || \"Invalid time\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/isoTimestamp/isoTimestamp.ts\nfunction isoTimestamp(error) {\n return (input) => {\n if (!/^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])T(0[0-9]|1\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}Z$/.test(\n input\n )) {\n return {\n issue: {\n validation: \"iso_timestamp\",\n message: error || \"Invalid timestamp\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/isoWeek/isoWeek.ts\nfunction isoWeek(error) {\n return (input) => {\n if (!/^\\d{4}-W(0[1-9]|[1-4]\\d|5[0-3])$/.test(input)) {\n return {\n issue: {\n validation: \"iso_week\",\n message: error || \"Invalid week\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/length/length.ts\nfunction length(requirement, error) {\n return (input) => {\n if (input.length !== requirement) {\n return {\n issue: {\n validation: \"length\",\n message: error || \"Invalid length\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/maxBytes/maxBytes.ts\nfunction maxBytes(requirement, error) {\n return (input) => {\n if (new TextEncoder().encode(input).length > requirement) {\n return {\n issue: {\n validation: \"max_bytes\",\n message: error || \"Invalid byte length\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/maxLength/maxLength.ts\nfunction maxLength(requirement, error) {\n return (input) => {\n if (input.length > requirement) {\n return {\n issue: {\n validation: \"max_length\",\n message: error || \"Invalid length\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/maxSize/maxSize.ts\nfunction maxSize(requirement, error) {\n return (input) => {\n if (input.size > requirement) {\n return {\n issue: {\n validation: \"max_size\",\n message: error || \"Invalid size\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/maxValue/maxValue.ts\nfunction maxValue(requirement, error) {\n return (input) => {\n if (input > requirement) {\n return {\n issue: {\n validation: \"max_value\",\n message: error || \"Invalid value\",\n input\n }\n };\n }\n return { output: input };\n };\n}\nvar maxRange = maxValue;\n\n// src/validations/minBytes/minBytes.ts\nfunction minBytes(requirement, error) {\n return (input) => {\n if (new TextEncoder().encode(input).length < requirement) {\n return {\n issue: {\n validation: \"min_bytes\",\n message: error || \"Invalid byte length\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/mimeType/mimeType.ts\nfunction mimeType(requirement, error) {\n return (input) => {\n if (!requirement.includes(input.type)) {\n return {\n issue: {\n validation: \"mime_type\",\n message: error || \"Invalid MIME type\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/minLength/minLength.ts\nfunction minLength(requirement, error) {\n return (input) => {\n if (input.length < requirement) {\n return {\n issue: {\n validation: \"min_length\",\n message: error || \"Invalid length\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/minSize/minSize.ts\nfunction minSize(requirement, error) {\n return (input) => {\n if (input.size < requirement) {\n return {\n issue: {\n validation: \"min_size\",\n message: error || \"Invalid size\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/minValue/minValue.ts\nfunction minValue(requirement, error) {\n return (input) => {\n if (input < requirement) {\n return {\n issue: {\n validation: \"min_value\",\n message: error || \"Invalid value\",\n input\n }\n };\n }\n return { output: input };\n };\n}\nvar minRange = minValue;\n\n// src/validations/multipleOf/multipleOf.ts\nfunction multipleOf(requirement, error) {\n return (input) => {\n if (input % requirement !== 0) {\n return {\n issue: {\n validation: \"multipleOf\",\n message: error || \"Invalid multiple\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/regex/regex.ts\nfunction regex(requirement, error) {\n return (input) => {\n if (!requirement.test(input)) {\n return {\n issue: {\n validation: \"regex\",\n message: error || \"Invalid regex\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/safeInteger/safeInteger.ts\nfunction safeInteger(error) {\n return (input) => {\n if (!Number.isSafeInteger(input)) {\n return {\n issue: {\n validation: \"safe_integer\",\n message: error || \"Invalid safe integer\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/size/size.ts\nfunction size(requirement, error) {\n return (input) => {\n if (input.size !== requirement) {\n return {\n issue: {\n validation: \"size\",\n message: error || \"Invalid size\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/startsWith/startsWith.ts\nfunction startsWith(requirement, error) {\n return (input) => {\n if (!input.startsWith(requirement)) {\n return {\n issue: {\n validation: \"starts_with\",\n message: error || \"Invalid start\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/url/url.ts\nfunction url(error) {\n return (input) => {\n try {\n new URL(input);\n return { output: input };\n } catch (_) {\n return {\n issue: {\n validation: \"url\",\n message: error || \"Invalid URL\",\n input\n }\n };\n }\n };\n}\n\n// src/validations/uuid/uuid.ts\nfunction uuid(error) {\n return (input) => {\n if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(\n input\n )) {\n return {\n issue: {\n validation: \"uuid\",\n message: error || \"Invalid UUID\",\n input\n }\n };\n }\n return { output: input };\n };\n}\n\n// src/validations/value/value.ts\nfunction value(requirement, error) {\n return (input) => {\n if (input !== requirement) {\n return {\n issue: {\n validation: \"value\",\n message: error || \"Invalid value\",\n input\n }\n };\n }\n return { output: input };\n };\n}\nexport {\n ValiError,\n any,\n anyAsync,\n array,\n arrayAsync,\n bigint,\n bigintAsync,\n blob,\n blobAsync,\n boolean,\n booleanAsync,\n brand,\n bytes,\n coerce,\n coerceAsync,\n custom,\n customAsync,\n date,\n dateAsync,\n email,\n emoji,\n endsWith,\n enumType,\n enumTypeAsync,\n equal,\n excludes,\n executePipe,\n executePipeAsync,\n fallback,\n fallbackAsync,\n finite,\n flatten,\n getDefaultArgs,\n getIssues,\n imei,\n includes,\n instance,\n instanceAsync,\n integer,\n ip,\n ipv4,\n ipv6,\n is,\n isLuhnAlgo,\n isoDate,\n isoDateTime,\n isoTime,\n isoTimeSecond,\n isoTimestamp,\n isoWeek,\n keyof,\n length,\n literal,\n literalAsync,\n map,\n mapAsync,\n maxBytes,\n maxLength,\n maxRange,\n maxSize,\n maxValue,\n merge,\n mergeAsync,\n mimeType,\n minBytes,\n minLength,\n minRange,\n minSize,\n minValue,\n multipleOf,\n nan,\n nanAsync,\n nativeEnum,\n nativeEnumAsync,\n never,\n neverAsync,\n nonNullable,\n nonNullableAsync,\n nonNullish,\n nonNullishAsync,\n nonOptional,\n nonOptionalAsync,\n nullType,\n nullTypeAsync,\n nullable,\n nullableAsync,\n nullish,\n nullishAsync,\n number,\n numberAsync,\n object,\n objectAsync,\n omit,\n omitAsync,\n optional,\n optionalAsync,\n parse,\n parseAsync,\n partial,\n partialAsync,\n pick,\n pickAsync,\n record,\n recordAsync,\n recursive,\n recursiveAsync,\n regex,\n required,\n requiredAsync,\n safeInteger,\n safeParse,\n safeParseAsync,\n set,\n setAsync,\n size,\n special,\n specialAsync,\n startsWith,\n strict,\n strictAsync,\n string,\n stringAsync,\n symbol2 as symbol,\n symbolAsync,\n toCustom,\n toCustomAsync,\n toLowerCase,\n toMaxValue,\n toMinValue,\n toTrimmed,\n toTrimmedEnd,\n toTrimmedStart,\n toUpperCase,\n transform,\n transformAsync,\n tuple,\n tupleAsync,\n undefinedType,\n undefinedTypeAsync,\n union,\n unionAsync,\n unknown,\n unknownAsync,\n unwrap,\n url,\n useDefault,\n uuid,\n value,\n voidType,\n voidTypeAsync,\n withDefault\n};\n",null,null,null,null,null,"/**\n * Copyright 2023 Design Barn Inc.\n */\n\nimport type { ZipOptions } from 'fflate';\nimport { safeParse, flatten } from 'valibot';\n\nimport {\n DotLottieStatesSchema,\n type DotLottieStates,\n type DotLottieStateMachineDescriptor,\n DotLottieStateMachineDescriptorSchema,\n} from './dotlottie-state';\nimport { DotLottieError, ErrorCodes, createError } from './utils';\n\nexport interface DotLottieStateMachineCommonOptions {\n descriptor: DotLottieStateMachineDescriptor;\n states: DotLottieStates;\n zipOptions?: ZipOptions;\n}\n\nexport class DotLottieStateMachineCommon {\n protected _descriptor: DotLottieStateMachineDescriptor;\n\n protected _zipOptions: ZipOptions;\n\n protected _states: DotLottieStates;\n\n public constructor(options: DotLottieStateMachineCommonOptions) {\n this._requireValidId(options.descriptor.id);\n this._requireValidStates(options.states);\n this._requireValidDescriptor(options.descriptor);\n\n this._descriptor = options.descriptor;\n\n this._zipOptions = options.zipOptions ?? {};\n\n this._states = options.states;\n }\n\n public get zipOptions(): ZipOptions {\n return this._zipOptions;\n }\n\n public set zipOptions(zipOptions: ZipOptions) {\n this._zipOptions = zipOptions;\n }\n\n public get id(): string {\n return this._descriptor.id;\n }\n\n public set id(id: string) {\n this._requireValidId(id);\n\n this._descriptor.id = id;\n }\n\n public get states(): DotLottieStates {\n return this._states;\n }\n\n public set states(states: DotLottieStates) {\n this._states = states;\n }\n\n public get initial(): string {\n return this._descriptor.initial;\n }\n\n public set initial(initial: string) {\n this._descriptor.initial = initial;\n }\n\n public get descriptor(): DotLottieStateMachineDescriptor {\n return this._descriptor;\n }\n\n public set descriptor(descriptor: DotLottieStateMachineDescriptor) {\n this._descriptor = descriptor;\n }\n\n public toString(): string {\n return JSON.stringify({\n descriptor: this._descriptor,\n states: this._states,\n });\n }\n\n protected _requireValidId(id: string | undefined): void {\n if (!id) {\n throw createError('Invalid id.');\n }\n }\n\n protected _requireValidDescriptor(descriptor: DotLottieStateMachineDescriptor): void {\n const result = safeParse(DotLottieStateMachineDescriptorSchema, descriptor);\n\n if (!result.success) {\n const error = `Invalid state machine declaration, ${JSON.stringify(flatten(result.error).nested, null, 2)}`;\n\n throw new DotLottieError(`Invalid descriptor: ${error}`, ErrorCodes.INVALID_STATEMACHINE);\n }\n }\n\n protected _requireValidStates(states: DotLottieStates): void {\n const result = safeParse(DotLottieStatesSchema, states);\n\n if (!result.success) {\n const error = `Invalid state machine declaration, ${JSON.stringify(flatten(result.error).nested, null, 2)}`;\n\n throw new DotLottieError(`Invalid states: ${error}`, ErrorCodes.INVALID_STATEMACHINE);\n }\n }\n}\n","/**\n * Copyright 2023 Design Barn Inc.\n */\n\nimport type { Output } from 'valibot';\nimport {\n merge,\n number,\n object,\n optional,\n string,\n union,\n omit,\n record,\n tuple,\n maxValue,\n minValue,\n array,\n} from 'valibot';\n\nimport { ManifestAnimationSchema } from './manifest';\n\nexport const PlaybackOptionsSchema = omit(ManifestAnimationSchema, ['id']);\n\nexport type PlaybackOptions = Output;\n\nexport const TransitionableSchema = object({\n state: string(),\n});\nexport type Transitionable = Output;\n\nexport const StateTransitionOnClickSchema = TransitionableSchema;\n\nexport type StateTransitionOnClick = Output;\n\nexport const StateTransitionOnAfterSchema = merge([TransitionableSchema, object({ ms: number() })]);\n\nexport type StateTransitionOnAfter = Output;\n\nexport const StateTransitionOnEnterSchema = merge([TransitionableSchema, object({ count: number() })]);\n\nexport type StateTransitionOnEnter = Output;\n\nexport const StateTransitionOnMouseEnterSchema = TransitionableSchema;\n\nexport type StateTransitionOnMouseEnter = Output;\n\nexport const StateTransitionOnMouseLeaveSchema = TransitionableSchema;\n\nexport type StateTransitionOnMouseLeave = Output;\n\nexport const StateTransitionOnCompleteSchema = TransitionableSchema;\n\nexport type StateTransitionOnComplete = Output;\n\nexport const StateTransitionOnShowSchema = merge([\n TransitionableSchema,\n object({ threshold: optional(array(number([minValue(0), maxValue(1)]))) }),\n]);\nexport type StateTransitionOnShow = Output;\n\nexport const DotLottieStateTransitionEventsSchema = object({\n onAfter: optional(StateTransitionOnAfterSchema),\n onClick: optional(StateTransitionOnClickSchema),\n onComplete: optional(StateTransitionOnCompleteSchema),\n onEnter: optional(StateTransitionOnEnterSchema),\n onMouseEnter: optional(StateTransitionOnMouseEnterSchema),\n onMouseLeave: optional(StateTransitionOnMouseLeaveSchema),\n onShow: optional(StateTransitionOnShowSchema),\n});\nexport type DotLottieStateTransitionEvents = Output;\n\nexport const DotLottieStatePlaybackSettingsSchema = merge([\n PlaybackOptionsSchema,\n object({\n playOnScroll: optional(tuple([number([minValue(0), maxValue(1)]), number([minValue(0), maxValue(1)])])),\n segments: optional(union([tuple([number(), number()]), string()])),\n }),\n]);\nexport type DotLottieStatePlaybackSettings = Output;\n\nexport const DotLottieStateSchema = merge([\n DotLottieStateTransitionEventsSchema,\n object({\n animationId: optional(string()),\n playbackSettings: DotLottieStatePlaybackSettingsSchema,\n }),\n]);\nexport type DotLottieState = Output;\n\nexport const DotLottieStatesSchema = record(string(), DotLottieStateSchema);\nexport type DotLottieStates = Output;\n\nexport const DotLottieStateMachineDescriptorSchema = object({\n id: string(),\n initial: string(),\n});\nexport type DotLottieStateMachineDescriptor = Output;\n\nexport const DotLottieStateMachineSchema = object({\n descriptor: DotLottieStateMachineDescriptorSchema,\n states: DotLottieStatesSchema,\n});\nexport type DotLottieStateMachine = Output;\n","/**\n * Copyright 2023 Design Barn Inc.\n */\n\nimport {\n object,\n type Output,\n string,\n array,\n boolean,\n number,\n union,\n optional,\n record,\n any,\n nativeEnum,\n literal,\n} from 'valibot';\n\nexport enum PlayMode {\n Bounce = 'bounce',\n Normal = 'normal',\n}\n\nexport const PlayModeSchema = nativeEnum(PlayMode);\n\nexport const ManifestAnimationSchema = object({\n autoplay: optional(boolean()),\n defaultTheme: optional(string()),\n direction: optional(union([literal(1), literal(-1)])),\n hover: optional(boolean()),\n id: string(),\n intermission: optional(number()),\n loop: optional(union([boolean(), number()])),\n playMode: optional(PlayModeSchema),\n speed: optional(number()),\n themeColor: optional(string()),\n});\nexport type ManifestAnimation = Output;\n\nexport const ManifestThemeSchema = object({\n animations: array(string()),\n id: string(),\n});\nexport type ManifestTheme = Output;\n\nexport const ManifestSchema = object({\n activeAnimationId: optional(string()),\n animations: array(ManifestAnimationSchema),\n author: optional(string()),\n custom: optional(record(string(), any())),\n description: optional(string()),\n generator: optional(string()),\n keywords: optional(string()),\n revision: optional(number()),\n themes: optional(array(ManifestThemeSchema)),\n states: optional(array(string())),\n version: optional(string()),\n});\n\nexport type Manifest = Output;\n","/**\n * Copyright 2023 Design Barn Inc.\n */\n\n/* eslint-disable guard-for-in */\n\nimport type { Animation as AnimationData, Asset } from '@lottiefiles/lottie-types';\nimport type { UnzipFileFilter, Unzipped } from 'fflate';\nimport { unzip as fflateUnzip, strFromU8 } from 'fflate';\nimport { flatten, safeParse } from 'valibot';\n\nimport type { LottieStateMachine } from '../lottie-state-machine';\n\nimport type { Manifest } from './manifest';\nimport { ManifestSchema } from './manifest';\n\nexport interface MimeTypes {\n [key: string]: string;\n}\n\nexport interface MimeCodes {\n [key: string]: number[];\n}\n\nexport const MIME_TYPES: MimeTypes = {\n jpeg: 'image/jpeg',\n png: 'image/png',\n gif: 'image/gif',\n bmp: 'image/bmp',\n svg: 'image/svg+xml',\n webp: 'image/webp',\n mpeg: 'audio/mpeg',\n mp3: 'audio/mp3',\n};\n\nexport const MIME_CODES: MimeCodes = {\n jpeg: [0xff, 0xd8, 0xff],\n png: [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a],\n gif: [0x47, 0x49, 0x46],\n bmp: [0x42, 0x4d],\n webp: [0x52, 0x49, 0x46, 0x46, 0x57, 0x45, 0x42, 0x50],\n svg: [0x3c, 0x3f, 0x78],\n mp3: [0x49, 0x44, 0x33, 0x3, 0x00, 0x00, 0x00, 0x00],\n mpeg: [0x49, 0x44, 0x33, 0x3, 0x00, 0x00, 0x00, 0x00],\n};\n\nexport interface MimeToExtension {\n [key: string]: string;\n}\n\nexport const MIME_TO_EXTENSION: MimeToExtension = {\n 'image/jpeg': 'jpeg',\n 'image/png': 'png',\n 'image/gif': 'gif',\n 'image/bmp': 'bmp',\n 'image/svg+xml': 'svg',\n 'image/webp': 'webp',\n 'audio/mpeg': 'mpeg',\n 'audio/mp3': 'mp3',\n};\n\n/**\n * Converts a base64 string into a Uint8Array.\n *\n * @remarks\n * This function accepts a base64 string and returns a Uint8Array containing the decoded bytes.\n *\n * @param base64String - The base64-encoded string to decode.\n * @returns A Uint8Array containing the decoded bytes.\n *\n * @example\n * ```typescript\n * const base64 = 'SGVsbG8gd29ybGQ=';\n * const array = base64ToUint8Array(base64);\n * ```\n *\n * @public\n */\nexport const base64ToUint8Array = (base64String: string): Uint8Array => {\n const withoutMeta = base64String.substring(base64String.indexOf(',') + 1);\n const binaryString =\n typeof window === 'undefined' ? Buffer.from(withoutMeta, 'base64').toString('binary') : atob(withoutMeta);\n\n const uint8Array = new Uint8Array(binaryString.length);\n\n for (let i = 0; i < binaryString.length; i += 1) {\n uint8Array[i] = binaryString.charCodeAt(i);\n }\n\n return uint8Array;\n};\n\n/**\n * Determines the MIME type from a base64-encoded string.\n *\n * @remarks\n * This function accepts a base64-encoded string and determines its MIME type by looking at the first few bytes.\n *\n * @param base64 - The base64-encoded string to analyze.\n * @returns The MIME type as a string, or null if the type cannot be determined.\n *\n * @example\n * ```typescript\n * const base64 = 'data:image/jpeg;base64,...';\n * const mimeType = getMimeTypeFromBase64(base64);\n * ```\n *\n * @public\n */\nexport const getMimeTypeFromBase64 = (base64: string): string | null | undefined => {\n let data: string | null = null;\n let bytes: number[] = [];\n\n if (!base64) return null;\n\n const withoutMeta = base64.substring(base64.indexOf(',') + 1);\n\n if (typeof window === 'undefined') {\n data = Buffer.from(withoutMeta, 'base64').toString('binary');\n } else {\n data = atob(withoutMeta);\n }\n\n const bufData = new Uint8Array(data.length);\n\n for (let i = 0; i < data.length; i += 1) {\n bufData[i] = data.charCodeAt(i);\n }\n\n bytes = Array.from(bufData.subarray(0, 8));\n for (const mimeType in MIME_CODES) {\n const dataArr = MIME_CODES[mimeType];\n\n if (dataArr && bytes.every((byte, index) => byte === dataArr[index])) {\n return MIME_TYPES[mimeType];\n }\n }\n\n return null;\n};\n\n/**\n * Determines the file extension from a base64-encoded string.\n *\n * @remarks\n * This function accepts a base64-encoded string and determines its file extension by examining the MIME type.\n *\n * @param base64 - The base64-encoded string to analyze.\n * @returns The file extension as a string, or 'png' if the extension cannot be determined.\n *\n * @example\n * ```typescript\n * const base64 = 'data:image/jpeg;base64,...';\n * const extension = getExtensionTypeFromBase64(base64);\n * ```\n *\n * @public\n */\nexport const getExtensionTypeFromBase64 = (base64: string): string | null => {\n const mimeType = getMimeTypeFromBase64(base64);\n\n if (!mimeType) {\n const ext = base64.split(';')[0]?.split('/')[1];\n\n if (ext) {\n return MIME_TO_EXTENSION[ext] || 'png';\n }\n\n return 'png';\n }\n\n return MIME_TO_EXTENSION[mimeType] || 'png';\n};\n\nexport enum ErrorCodes {\n ASSET_NOT_FOUND = 'ASSET_NOT_FOUND',\n INVALID_DOTLOTTIE = 'INVALID_DOTLOTTIE',\n INVALID_STATEMACHINE = 'INVALID_STATEMACHINE',\n INVALID_URL = 'INVALID_URL',\n}\n\nexport class DotLottieError extends Error {\n public code: ErrorCodes | undefined;\n\n public constructor(message: string, code?: ErrorCodes) {\n super(message);\n this.name = '[dotlottie-js]';\n this.code = code;\n }\n}\n\n/**\n * Creates an Error object with the specified message.\n *\n * @remarks\n * This function accepts a message string and constructs a new Error object prefixed with \"[dotlottie-js]: \".\n *\n * @deprecated\n * This function has been deprecated in favor of using the {@link DotLottieError} class directly.\n *\n * @param message - The error message to include in the Error object.\n * @returns An Error object with the specified message, prefixed with \"[dotlottie-js]: \".\n *\n * @example\n * ```typescript\n * const message = 'DotLottie not found';\n * const error = createError(message);\n * ```\n *\n * @public\n */\nexport const createError = (message: string): Error => {\n const error = new Error(`[dotlottie-js]: ${message}`);\n\n return error;\n};\n\n/**\n * Validates a given URL string.\n *\n * @remarks\n * This function accepts a URL string and checks whether it's a valid URL according to the URL constructor.\n * It returns `true` if the URL is valid, `false` otherwise.\n *\n * @param url - The URL string to validate.\n * @returns `true` if the URL is valid, `false` otherwise.\n *\n * @example\n * ```typescript\n * const url = 'https://example.com';\n * const isValid = isValidURL(url); // true\n * ```\n *\n * @public\n */\nexport const isValidURL = (url: string): boolean => {\n try {\n // eslint-disable-next-line no-new\n new URL(url);\n\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Creates a data URL from a Uint8Array.\n *\n * @remarks\n * This function accepts a Uint8Array and a file extension, then converts the Uint8Array into a base64 data URL string.\n * The mimeType is determined based on the provided file extension, or defaults to 'image/png' if the extension is not recognized.\n *\n * @param uint8Data - The Uint8Array containing the binary data.\n * @param fileExtension - The file extension used to determine the mimeType (e.g., 'png', 'jpeg').\n * @returns The data URL string.\n *\n * @example\n * ```typescript\n * const uint8Data = new Uint8Array(...);\n * const fileExtension = 'png';\n * const dataUrl = dataUrlFromU8(uint8Data, fileExtension);\n * ```\n */\nexport function dataUrlFromU8(uint8Data: Uint8Array): string {\n let base64: string;\n\n if (typeof window === 'undefined') {\n // Using Node.js Buffer for non-browser environments\n base64 = Buffer.from(uint8Data).toString('base64');\n } else {\n // Using window.btoa for browser environments\n const binaryString = Array.prototype.map.call(uint8Data, (byte: number) => String.fromCharCode(byte)).join('');\n\n base64 = window.btoa(binaryString);\n }\n\n const mimeType = getMimeTypeFromBase64(base64);\n\n return `data:${mimeType};base64,${base64}`;\n}\n\n/**\n * Checks if an asset is an image asset.\n *\n * @remarks\n * This function accepts an asset object and determines whether it represents an image asset.\n * It returns `true` if it's an image asset, `false` otherwise.\n *\n * @param asset - The asset object to check.\n * @returns `true` if it's an image asset, `false` otherwise.\n *\n * @example\n * ```typescript\n * const asset = { w: 100, h: 100, p: 'image.png' };\n * const isImage = isImageAsset(asset); // true\n * ```\n *\n * @public\n */\nexport function isImageAsset(asset: Asset.Value): asset is Asset.Image {\n return 'w' in asset && 'h' in asset && !('xt' in asset) && 'p' in asset;\n}\n\n/**\n * Checks if an asset is an audio asset.\n *\n * @remarks\n * This function accepts an asset object and determines whether it represents an audio asset.\n * It returns `true` if it's an audio asset, `false` otherwise.\n *\n * @param asset - The asset object to check.\n * @returns `true` if it's an audio asset, `false` otherwise.\n *\n * @example\n * ```typescript\n * const asset = { e: 0, u: 'music/', p: 'audio.mp3' };\n * const isAudio = isAudioAsset(asset); // true\n * ```\n *\n * @public\n */\nexport function isAudioAsset(asset: Asset.Value): asset is Asset.Image {\n return !('h' in asset) && !('w' in asset) && 'p' in asset && 'e' in asset && 'u' in asset && 'id' in asset;\n}\n\n/**\n * Unzips the .lottie file.\n *\n * @remarks\n * This function accepts a .lottie file as a Uint8Array and an optional filter function to refine the unzipping process.\n * It returns a Promise that resolves with the unzipped data.\n *\n * @param dotLottie - The .lottie data as a Uint8Array.\n * @param filter - The filter function to apply to the files. Defaults to a function that always returns true.\n * @returns A Promise that resolves with the unzipped data.\n * @throws {@link DotLottieError} if the .lottie data is not provided or is invalid.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const unzippedData = await unzipDotLottie(dotLottie);\n * ```\n *\n * @public\n */\nexport async function unzipDotLottie(\n dotLottie: Uint8Array | undefined,\n filter: UnzipFileFilter = (): boolean => true,\n): Promise {\n if (!(dotLottie instanceof Uint8Array)) {\n throw new DotLottieError('DotLottie not found', ErrorCodes.INVALID_DOTLOTTIE);\n }\n\n const unzipped = await new Promise((resolve, reject) => {\n fflateUnzip(dotLottie, { filter }, (err, data) => {\n if (err) {\n reject(err);\n }\n resolve(data);\n });\n });\n\n return unzipped;\n}\n\n/**\n * Unzips a specific file from a `.lottie` archive.\n *\n * @remarks\n * This function accepts a `.lottie` file as a `Uint8Array`, a path string representing the\n * target file to extract, and an optional filter function to further refine the extraction.\n * It returns a `Promise` that resolves to the unzipped `Uint8Array` of the target file.\n *\n * @param dotLottie - The `.lottie` file content as a `Uint8Array`.\n * @param path - The path of the target file within the `.lottie` archive to extract.\n * @param filter - An optional filter function to apply on the unzipping process.\n * Accepts a file object and returns a boolean indicating whether the file should be included.\n * @returns A `Promise` that resolves to the `Uint8Array` of the unzipped target file.\n *\n * @throws {@link DotLottieError} if the input is not a valid `.lottie` file or if the target file is not found.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const targetPath = 'images/image.png';\n * const unzippedFile = await unzipDotLottieFile(dotLottie, targetPath);\n * ```\n *\n * @public\n */\nexport async function unzipDotLottieFile(\n dotLottie: Uint8Array,\n path: string,\n filter?: UnzipFileFilter,\n): Promise {\n if (!(dotLottie instanceof Uint8Array)) {\n throw new DotLottieError('DotLottie not found', ErrorCodes.INVALID_DOTLOTTIE);\n }\n\n const unzipped = await unzipDotLottie(dotLottie, (file) => file.name === path && (!filter || filter(file)));\n\n return unzipped[path];\n}\n\n/**\n * Retrieves the manifest data from the given DotLottie object.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array and extracts the manifest data from it.\n * The manifest contains metadata information about the .lottie file, such as the list of animations, themes, and image assets.\n * It returns a Promise that resolves to the manifest data or `undefined` if the manifest is not found.\n *\n * @param dotLottie - The Uint8Array of DotLottie data.\n * @returns A Promise that resolves with the manifest data or `undefined` if not found.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const manifestData = await getManifest(dotLottie);\n * ```\n *\n * @public\n */\nexport async function getManifest(dotLottie: Uint8Array): Promise {\n const manifestFileName = 'manifest.json';\n\n const unzipped = await unzipDotLottie(dotLottie, (file) => file.name === manifestFileName);\n\n const unzippedManifest = unzipped[manifestFileName];\n\n if (typeof unzippedManifest === 'undefined') {\n return undefined;\n }\n\n return JSON.parse(strFromU8(unzippedManifest, false)) as Manifest;\n}\n\n/**\n * Validates the provided DotLottie data.\n *\n * @remarks\n * This function accepts a Uint8Array containing .lottie data and validates its structure and content.\n * It returns a Promise that resolves with an object containing a success boolean and an optional error string.\n *\n * @param dotLottie - The DotLottie data as a Uint8Array.\n * @returns A Promise that resolves with an object containing a success boolean and an optional error string.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const validationResult = await validateDotLottie(dotLottie);\n * ```\n *\n * @public\n */\nexport async function validateDotLottie(dotLottie: Uint8Array): Promise<{ error?: string; success: boolean }> {\n if (!(dotLottie instanceof Uint8Array)) {\n return { success: false, error: 'DotLottie not found' };\n }\n\n const manifest = await getManifest(dotLottie);\n\n if (typeof manifest === 'undefined') {\n return { success: false, error: 'Invalid .lottie file, manifest.json is missing' };\n }\n\n const manifestValidationResult = safeParse(ManifestSchema, manifest);\n\n if (!manifestValidationResult.success) {\n const error = `Invalid .lottie file, manifest.json structure is invalid, ${JSON.stringify(\n flatten(manifestValidationResult.error).nested,\n null,\n 2,\n )}`;\n\n return { success: false, error };\n }\n\n return { success: true };\n}\n\n/**\n * Loads a .lottie file from an ArrayBuffer.\n *\n * @remarks\n * This function takes an ArrayBuffer containing .lottie data and converts it into a Uint8Array.\n * It validates the data and returns a Promise that resolves with the DotLottie data as a Uint8Array.\n *\n * @param arrayBuffer - The ArrayBuffer containing .lottie data.\n * @returns A Promise that resolves with the DotLottie data as a Uint8Array.\n * @throws {@link DotLottieError} if the data is invalid.\n *\n * @example\n * ```typescript\n * const arrayBuffer = new ArrayBuffer(...);\n * const dotLottie = await loadFromArrayBuffer(arrayBuffer);\n * ```\n *\n * @public\n */\nexport async function loadFromArrayBuffer(arrayBuffer: ArrayBuffer): Promise {\n const dotLottie = new Uint8Array(arrayBuffer);\n\n const validationResult = await validateDotLottie(dotLottie);\n\n if (validationResult.error) {\n throw new DotLottieError(validationResult.error, ErrorCodes.INVALID_DOTLOTTIE);\n }\n\n return dotLottie;\n}\n\n/**\n * Loads a .lottie file from a given URL.\n *\n * @remarks\n * This function takes a URL string as input and fetches the .lottie file from the provided URL.\n * It returns a Promise that resolves with the DotLottie data as a Uint8Array.\n *\n * @param src - The URL source of the .lottie file.\n * @returns A Promise that resolves with the DotLottie data as a Uint8Array.\n * @throws {@link DotLottieError} if the URL is invalid or if the content type is incorrect.\n *\n * @example\n * ```typescript\n * const url = 'https://example.com/animation.lottie';\n * const dotLottie = await loadFromURL(url);\n * ```\n *\n * @public\n */\nexport async function loadFromURL(src: string): Promise {\n if (!isValidURL(src)) {\n throw new DotLottieError('Invalid url provided for .lottie file', ErrorCodes.INVALID_URL);\n }\n\n const response = await fetch(src);\n\n const arrayBuffer = await response.arrayBuffer();\n\n const contentType = response.headers.get('content-type');\n\n if (!contentType?.includes('application/zip')) {\n throw new DotLottieError(\n 'Invalid content type provided for .lottie file, expected application/zip',\n ErrorCodes.INVALID_DOTLOTTIE,\n );\n }\n\n const dotLottie = await loadFromArrayBuffer(arrayBuffer);\n\n return dotLottie;\n}\n\n/**\n * Retrieves an audio from the given DotLottie object by its filename.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array, the filename of the audio to retrieve, and an optional filter function.\n * It returns a Promise that resolves to the audio data URL or `undefined` if not found.\n *\n * @param dotLottie - The Uint8Array of DotLottie data.\n * @param filename - The filename of the image to get.\n * @param filter - An optional filter function to apply on the unzipping process.\n * @returns A Promise that resolves with the audio data URL or `undefined` if not found.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const filename = 'alarm.mp3';\n * const imageData = await getAudio(dotLottie, filename);\n * ```\n *\n * @public\n */\nexport async function getAudio(\n dotLottie: Uint8Array,\n filename: string,\n filter?: UnzipFileFilter,\n): Promise {\n const audioFilename = `audio/${filename}`;\n\n const unzipped = await unzipDotLottieFile(dotLottie, audioFilename, filter);\n\n if (typeof unzipped === 'undefined') {\n return undefined;\n }\n\n return dataUrlFromU8(unzipped);\n}\n\n/**\n * Retrieves all audio files from the given DotLottie object.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array and an optional filter function to further refine the extraction.\n * It returns a Promise that resolves to a record containing the audio data URLs mapped by their ID.\n *\n * @param dotLottie - The Uint8Array of DotLottie data.\n * @param filter - An optional filter function to apply on the unzipping process.\n * @returns A Promise that resolves to a record containing the audio data URLs mapped by their ID.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const allAudio = await getAllAudio(dotLottie);\n * ```\n *\n * @public\n */\nexport async function getAllAudio(dotLottie: Uint8Array, filter?: UnzipFileFilter): Promise> {\n const unzippedAudio = await unzipDotLottie(dotLottie, (file) => {\n const name = file.name.replace('audio/', '');\n\n return file.name.startsWith('audio/') && (!filter || filter({ ...file, name }));\n });\n\n const audio: Record = {};\n\n for (const audioPath in unzippedAudio) {\n const unzippedSingleAudio = unzippedAudio[audioPath];\n\n if (unzippedSingleAudio instanceof Uint8Array) {\n const audioId = audioPath.replace('audio/', '');\n\n audio[audioId] = dataUrlFromU8(unzippedSingleAudio);\n }\n }\n\n return audio;\n}\n\n/**\n * Inlines audio assets for the given animations within a DotLottie object.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array and a record containing the animations to process.\n * It identifies the audio used in the animations and replaces their references with the actual audio data.\n * This operation is performed asynchronously, and the function returns a Promise that resolves when the operation is complete.\n *\n * @param dotLottie - The DotLottie object containing the animations.\n * @param animations - A record containing the animations to process.\n * @returns A Promise that resolves when the operation is complete, returning nothing.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const animations = { animation1: {...}, animation2: {...} };\n * await inlineAudioAssets(dotLottie, animations);\n * ```\n *\n * @public\n */\nexport async function inlineAudioAssets(\n dotLottie: Uint8Array,\n animations: Record,\n): Promise {\n const audioMap = new Map>();\n\n for (const [animationId, animationData] of Object.entries(animations)) {\n for (const asset of animationData.assets || []) {\n if (isAudioAsset(asset)) {\n const audioId = asset.p;\n\n if (!audioMap.has(audioId)) {\n audioMap.set(audioId, new Set());\n }\n audioMap.get(audioId)?.add(animationId);\n }\n }\n }\n\n const unzippedAudio = await getAllAudio(dotLottie, (file) => audioMap.has(file.name));\n\n for (const [audioId, animationIdsSet] of audioMap) {\n const audioDataURL = unzippedAudio[audioId];\n\n if (audioDataURL) {\n for (const animationId of animationIdsSet) {\n const animationData = animations[animationId];\n\n for (const asset of animationData?.assets || []) {\n if (isAudioAsset(asset) && asset.p === audioId) {\n asset.p = audioDataURL;\n asset.u = '';\n asset.e = 1;\n }\n }\n }\n }\n }\n}\n\n/**\n * Retrieves an image from the given DotLottie object by its filename.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array, the filename of the image to retrieve, and an optional filter function.\n * It returns a Promise that resolves to the image data URL or `undefined` if not found.\n *\n * @param dotLottie - The Uint8Array of DotLottie data.\n * @param filename - The filename of the image to get.\n * @param filter - An optional filter function to apply on the unzipping process.\n * @returns A Promise that resolves with the image data URL or `undefined` if not found.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const filename = 'image.png';\n * const imageData = await getImage(dotLottie, filename);\n * ```\n *\n * @public\n */\nexport async function getImage(\n dotLottie: Uint8Array,\n filename: string,\n filter?: UnzipFileFilter,\n): Promise {\n const imageFilename = `images/${filename}`;\n\n const unzipped = await unzipDotLottieFile(dotLottie, imageFilename, filter);\n\n if (typeof unzipped === 'undefined') {\n return undefined;\n }\n\n return dataUrlFromU8(unzipped);\n}\n\n/**\n * Retrieves all images from the given DotLottie object.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array and an optional filter function to further refine the extraction.\n * It returns a Promise that resolves to a record containing the image data URLs mapped by their ID.\n *\n * @param dotLottie - The Uint8Array of DotLottie data.\n * @param filter - An optional filter function to apply on the unzipping process.\n * @returns A Promise that resolves to a record containing the image data URLs mapped by their ID.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const images = await getImages(dotLottie);\n * ```\n *\n * @public\n */\nexport async function getImages(dotLottie: Uint8Array, filter?: UnzipFileFilter): Promise> {\n const unzippedImages = await unzipDotLottie(dotLottie, (file) => {\n const name = file.name.replace('images/', '');\n\n return file.name.startsWith('images/') && (!filter || filter({ ...file, name }));\n });\n\n const images: Record = {};\n\n for (const imagePath in unzippedImages) {\n const unzippedImage = unzippedImages[imagePath];\n\n if (unzippedImage instanceof Uint8Array) {\n const imageId = imagePath.replace('images/', '');\n\n images[imageId] = dataUrlFromU8(unzippedImage);\n }\n }\n\n return images;\n}\n\n/**\n * Inlines image assets for the given animations within a DotLottie object.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array and a record containing the animations to process.\n * It identifies the images used in the animations and replaces their references with the actual image data.\n * This operation is performed asynchronously, and the function returns a Promise that resolves when the operation is complete.\n *\n * @param dotLottie - The DotLottie object containing the animations.\n * @param animations - A record containing the animations to process.\n * @returns A Promise that resolves when the operation is complete, returning nothing.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const animations = { animation1: {...}, animation2: {...} };\n * await inlineImageAssets(dotLottie, animations);\n * ```\n *\n * @public\n */\nexport async function inlineImageAssets(\n dotLottie: Uint8Array,\n animations: Record,\n): Promise {\n const imagesMap = new Map>();\n\n for (const [animationId, animationData] of Object.entries(animations)) {\n for (const asset of animationData.assets || []) {\n if (isImageAsset(asset)) {\n const imageId = asset.p;\n\n if (!imagesMap.has(imageId)) {\n imagesMap.set(imageId, new Set());\n }\n imagesMap.get(imageId)?.add(animationId);\n }\n }\n }\n\n const unzippedImages = await getImages(dotLottie, (file) => imagesMap.has(file.name));\n\n for (const [imageId, animationIdsSet] of imagesMap) {\n const imageDataURL = unzippedImages[imageId];\n\n if (imageDataURL) {\n for (const animationId of animationIdsSet) {\n const animationData = animations[animationId];\n\n for (const asset of animationData?.assets || []) {\n if (isImageAsset(asset) && asset.p === imageId) {\n asset.p = imageDataURL;\n asset.u = '';\n asset.e = 1;\n }\n }\n }\n }\n }\n}\n\n/**\n * Retrieves an animation from the given DotLottie object by its ID.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array, the animation ID to retrieve, and an optional inlineAssets option.\n * It returns a Promise that resolves to the animation data or `undefined` if not found.\n *\n * @param dotLottie - The Uint8Array of DotLottie data.\n * @param animationId - The animation ID to get.\n * @param options - An object containing an optional `inlineAssets` boolean to control whether image assets should be inlined.\n * @param filter - An optional function to filter the files to be unzipped.\n * @returns A Promise that resolves with the animation data or `undefined` if not found.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const animationId = 'example';\n * const animationData = await getAnimation(dotLottie, animationId, { inlineAssets: true });\n * ```\n *\n * @public\n */\nexport async function getAnimation(\n dotLottie: Uint8Array,\n animationId: string,\n { inlineAssets }: { inlineAssets?: boolean } = {},\n filter?: UnzipFileFilter,\n): Promise {\n const animationFilename = `animations/${animationId}.json`;\n\n const unzippedAnimation = await unzipDotLottieFile(dotLottie, animationFilename, filter);\n\n if (typeof unzippedAnimation === 'undefined') {\n return undefined;\n }\n\n const animationData = JSON.parse(strFromU8(unzippedAnimation, false)) as AnimationData;\n\n if (!inlineAssets) {\n return animationData;\n }\n\n const animationsMap = {\n [animationId]: animationData,\n };\n\n await inlineImageAssets(dotLottie, animationsMap);\n\n await inlineAudioAssets(dotLottie, animationsMap);\n\n return animationData;\n}\n\n/**\n * Retrieves the animations from the given DotLottie object, with optional filtering and asset inlining.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array, an optional inlineAssets option, and an optional filter function.\n * It returns a Promise that resolves to a record containing the animation data mapped by their ID.\n *\n * @param dotLottie - The Uint8Array of DotLottie data.\n * @param options - An object containing an optional `inlineAssets` boolean to control whether assets should be inlined.\n * @param filter - An optional function to filter the files to be unzipped.\n * @returns A Promise that resolves to a record containing the animation data mapped by their ID.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const animations = await getAnimations(dotLottie, { inlineAssets: true });\n * ```\n *\n * @public\n */\nexport async function getAnimations(\n dotLottie: Uint8Array,\n { inlineAssets }: { inlineAssets?: boolean } = {},\n filter?: UnzipFileFilter,\n): Promise> {\n const animationsMap: Record = {};\n const unzippedAnimations = await unzipDotLottie(dotLottie, (file) => {\n const filename = file.name.replace('animations/', '').replace('.json', '');\n\n return file.name.startsWith('animations/') && (!filter || filter({ ...file, name: filename }));\n });\n\n for (const animationPath in unzippedAnimations) {\n const data = unzippedAnimations[animationPath];\n\n if (data instanceof Uint8Array) {\n const animationId = animationPath.replace('animations/', '').replace('.json', '');\n const animationData = JSON.parse(strFromU8(data, false)) as AnimationData;\n\n animationsMap[animationId] = animationData;\n }\n }\n\n if (!inlineAssets) {\n return animationsMap;\n }\n\n await inlineImageAssets(dotLottie, animationsMap);\n\n return animationsMap;\n}\n\n/**\n * Retrieves the themes from the given DotLottie object.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array and an optional filter function to refine the extraction of themes.\n * It returns a Promise that resolves to a record containing the themes mapped by their ID.\n *\n * @param dotLottie - The DotLottie object containing the themes.\n * @param filter - An optional function to filter the files to be unzipped.\n * @returns A Promise that resolves to a record containing the themes mapped by their ID.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const themes = await getThemes(dotLottie);\n * ```\n */\nexport async function getThemes(\n dotLottie: Uint8Array,\n filter?: UnzipFileFilter,\n): Promise>> {\n const themesMap: Record> = {};\n\n const unzippedThemes = await unzipDotLottie(dotLottie, (file) => {\n const name = file.name.replace('themes/', '').replace('.json', '');\n\n return file.name.startsWith('themes/') && (!filter || filter({ ...file, name }));\n });\n\n for (const themePath in unzippedThemes) {\n const data = unzippedThemes[themePath];\n\n if (data instanceof Uint8Array) {\n const themeId = themePath.replace('themes/', '').replace('.json', '');\n\n themesMap[themeId] = JSON.parse(strFromU8(data, false));\n }\n }\n\n return themesMap;\n}\n\n/**\n * Retrieves a specific theme by ID from the given DotLottie object.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array, the theme ID to retrieve, and an optional filter function.\n * It returns a Promise that resolves to the theme as a string or `undefined` if not found.\n *\n * @param dotLottie - The DotLottie object containing the theme.\n * @param themeId - The ID of the theme to retrieve.\n * @param filter - An optional function to filter the files to be unzipped.\n * @returns A Promise that resolves to the theme as a string or `undefined` if not found.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const themeId = 'dark';\n * const theme = await getTheme(dotLottie, themeId);\n * ```\n */\nexport async function getTheme(\n dotLottie: Uint8Array,\n themeId: string,\n filter?: UnzipFileFilter,\n): Promise | undefined> {\n const themeFilename = `themes/${themeId}.json`;\n\n const unzippedTheme = await unzipDotLottieFile(dotLottie, themeFilename, filter);\n\n if (typeof unzippedTheme === 'undefined') {\n return undefined;\n }\n\n return JSON.parse(strFromU8(unzippedTheme, false));\n}\n\n/**\n * Retrieves the state machines from the given DotLottie object.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array and an optional filter function to refine the extraction of state machines.\n * It returns a Promise that resolves to a record containing the state machines mapped by their ID.\n *\n * @param dotLottie - The DotLottie object containing the state machines.\n * @param filter - An optional function to filter the files to be unzipped.\n * @returns A Promise that resolves to a record containing the state machines mapped by their ID.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const machines = await getStateMachines(dotLottie);\n * ```\n */\nexport async function getStateMachines(\n dotLottie: Uint8Array,\n filter?: UnzipFileFilter,\n): Promise> {\n const statesMap: Record = {};\n\n const unzippedStates = await unzipDotLottie(dotLottie, (file) => {\n const name = file.name.replace('states/', '').replace('.json', '');\n\n return file.name.startsWith('states/') && (!filter || filter({ ...file, name }));\n });\n\n for (const statePath in unzippedStates) {\n const data = unzippedStates[statePath];\n\n if (data instanceof Uint8Array) {\n const themeId = statePath.replace('states/', '').replace('.json', '');\n\n statesMap[themeId] = strFromU8(data, false);\n }\n }\n\n return statesMap;\n}\n\n/**\n * Retrieves a specific state machine by ID from the given DotLottie object.\n *\n * @remarks\n * This function accepts a DotLottie object as a Uint8Array, the state ID to retrieve, and an optional filter function.\n * It returns a Promise that resolves to the state machine as a string or `undefined` if not found.\n *\n * @param dotLottie - The DotLottie object containing the theme.\n * @param stateMachineId - The ID of the state machine to retrieve.\n * @param filter - An optional function to filter the files to be unzipped.\n * @returns A Promise that resolves to the state machine as a string or `undefined` if not found.\n *\n * @example\n * ```typescript\n * const dotLottie = new Uint8Array(...);\n * const stateMachineId = 'walk';\n * const stateMachine = await getState(dotLottie, stateMachineId);\n * ```\n */\nexport async function getStateMachine(\n dotLottie: Uint8Array,\n stateMachineId: string,\n filter?: UnzipFileFilter,\n): Promise {\n const stateMachineFilename = `states/${stateMachineId}.json`;\n\n const unzippedStateMachine = await unzipDotLottieFile(dotLottie, stateMachineFilename, filter);\n\n if (typeof unzippedStateMachine === 'undefined') {\n return undefined;\n }\n\n const stateMachine = JSON.parse(strFromU8(unzippedStateMachine, false)) as LottieStateMachine;\n\n return stateMachine;\n}\n","/**\n * Copyright 2023 Design Barn Inc.\n */\n\nimport type { ZipOptions } from 'fflate';\n\nimport type { LottieAnimationCommon } from './lottie-animation-common';\nimport { dataUrlFromU8, DotLottieError, ErrorCodes } from './utils';\n\nexport type AudioData = string | ArrayBuffer | Blob;\n\nexport interface AudioOptions {\n data?: AudioData;\n fileName: string;\n id: string;\n parentAnimations?: LottieAnimationCommon[];\n url?: string;\n zipOptions?: ZipOptions;\n}\n\nexport class LottieAudioCommon {\n protected _data?: AudioData;\n\n protected _id: string = '';\n\n protected _url?: string;\n\n protected _fileName: string = '';\n\n protected _parentAnimations: LottieAnimationCommon[];\n\n protected _zipOptions: ZipOptions;\n\n public constructor(options: AudioOptions) {\n this._requireValidId(options.id);\n this._requireValidFileName(options.fileName);\n\n this._zipOptions = options.zipOptions ?? {};\n\n if (options.data) {\n this._data = options.data;\n }\n\n if (options.id) {\n this._id = options.id;\n }\n\n if (options.url) {\n this._url = options.url;\n }\n\n if (options.fileName) {\n this._fileName = options.fileName;\n }\n\n this._parentAnimations = options.parentAnimations || [];\n }\n\n public get zipOptions(): ZipOptions {\n return this._zipOptions;\n }\n\n public set zipOptions(zipOptions: ZipOptions) {\n this._zipOptions = zipOptions;\n }\n\n public get fileName(): string {\n return this._fileName;\n }\n\n public set fileName(fileName: string) {\n if (!fileName) throw new DotLottieError('Invalid audio file name', ErrorCodes.ASSET_NOT_FOUND);\n this._fileName = fileName;\n }\n\n public get id(): string {\n return this._id;\n }\n\n public set id(id: string) {\n if (!id) throw new DotLottieError('Invalid audio id', ErrorCodes.ASSET_NOT_FOUND);\n this._id = id;\n }\n\n public get data(): AudioData | undefined {\n return this._data;\n }\n\n public set data(data: AudioData | undefined) {\n if (!data) {\n throw new DotLottieError('Invalid data');\n }\n\n this._data = data;\n }\n\n public get parentAnimations(): LottieAnimationCommon[] {\n return this._parentAnimations;\n }\n\n public set parentAnimations(parentAnimations: LottieAnimationCommon[]) {\n this._parentAnimations = parentAnimations;\n }\n\n public async toDataURL(): Promise {\n if (this._data && this._isDataURL(this._data)) return this.data as string;\n\n const arrayBuffer = await this.toArrayBuffer();\n\n return dataUrlFromU8(new Uint8Array(arrayBuffer));\n }\n\n /**\n * Renames the id and fileName to newName.\n * @param newName - A new id and filename for the audio.\n */\n public renameAudio(newName: string): void {\n this.id = newName;\n\n if (this.fileName) {\n let fileExt = this.fileName.split('.').pop();\n\n if (!fileExt) {\n fileExt = '.png';\n }\n // Default to png if the file extension isn't available\n this.fileName = `${newName}.${fileExt}`;\n }\n }\n\n public async toArrayBuffer(): Promise {\n const blob = await (await this.toBlob()).arrayBuffer();\n\n return blob;\n }\n\n public async toBlob(): Promise {\n if (!this._data && this._url) {\n this._data = await this._fromUrlToBlob(this._url);\n }\n\n if (!this._data) {\n throw new Error('Invalid data');\n }\n\n if (this._isDataURL(this._data)) {\n const data = this._data as string;\n\n const [header, base64] = data.split(',');\n\n // If the data doesnt contain the encoding URL, return it\n if ((!header || !base64) && data.length) {\n return new Blob([data]);\n }\n\n if (!header || !base64) {\n throw new Error('Invalid data');\n }\n\n // eslint-disable-next-line require-unicode-regexp\n const type = header.replace('data:', '').replace(/;base64$/, '');\n\n return new Blob([base64], { type });\n }\n\n if (this._isArrayBuffer(this._data)) {\n return new Blob([this._data]);\n }\n\n if (this._isBlob(this._data)) {\n return this._data as Blob;\n }\n\n throw new Error('Invalid data');\n }\n\n protected async _fromUrlToBlob(url: string): Promise {\n const response = await fetch(url);\n\n return response.blob();\n }\n\n protected _isArrayBuffer(data: AudioData): boolean {\n return data instanceof ArrayBuffer;\n }\n\n protected _isDataURL(data: AudioData): boolean {\n return typeof data === 'string' && data.startsWith('data:');\n }\n\n protected _isBlob(data: AudioData): boolean {\n return data instanceof Blob;\n }\n\n /**\n * Ensure that the provided id is a valid string.\n * The id must be a non-empty string, otherwise an error will be thrown.\n * @param id - The id to validate.\n * @throws Error - if the id is not a valid string.\n */\n private _requireValidId(id: string | undefined): asserts id is string {\n if (!id) throw new DotLottieError('Invalid audio id');\n }\n\n /**\n * Ensure that the provided fileName is a valid string.\n * The fileName must be a non-empty string, otherwise an error will be thrown.\n * @param fileName - The fileName to validate.\n * @throws Error - if the fileName is not a valid string.\n */\n private _requireValidFileName(fileName: string | undefined): asserts fileName is string {\n if (!fileName) throw new DotLottieError('Invalid audio fileName');\n }\n}\n","function cycleDetected(): never {\n\tthrow new Error(\"Cycle detected\");\n}\nfunction mutationDetected(): never {\n\tthrow new Error(\"Computed cannot have side-effects\");\n}\n\n// Flags for Computed and Effect.\nconst RUNNING = 1 << 0;\nconst NOTIFIED = 1 << 1;\nconst OUTDATED = 1 << 2;\nconst DISPOSED = 1 << 3;\nconst HAS_ERROR = 1 << 4;\nconst TRACKING = 1 << 5;\n\n// A linked list node used to track dependencies (sources) and dependents (targets).\n// Also used to remember the source's last version number that the target saw.\ntype Node = {\n\t// A source whose value the target depends on.\n\t_source: Signal;\n\t_prevSource?: Node;\n\t_nextSource?: Node;\n\n\t// A target that depends on the source and should be notified when the source changes.\n\t_target: Computed | Effect;\n\t_prevTarget?: Node;\n\t_nextTarget?: Node;\n\n\t// The version number of the source that target has last seen. We use version numbers\n\t// instead of storing the source value, because source values can take arbitrary amount\n\t// of memory, and computeds could hang on to them forever because they're lazily evaluated.\n\t// Use the special value -1 to mark potentially unused but recyclable nodes.\n\t_version: number;\n\n\t// Used to remember & roll back the source's previous `._node` value when entering &\n\t// exiting a new evaluation context.\n\t_rollbackNode?: Node;\n};\n\nfunction startBatch() {\n\tbatchDepth++;\n}\n\nfunction endBatch() {\n\tif (batchDepth > 1) {\n\t\tbatchDepth--;\n\t\treturn;\n\t}\n\n\tlet error: unknown;\n\tlet hasError = false;\n\n\twhile (batchedEffect !== undefined) {\n\t\tlet effect: Effect | undefined = batchedEffect;\n\t\tbatchedEffect = undefined;\n\n\t\tbatchIteration++;\n\n\t\twhile (effect !== undefined) {\n\t\t\tconst next: Effect | undefined = effect._nextBatchedEffect;\n\t\t\teffect._nextBatchedEffect = undefined;\n\t\t\teffect._flags &= ~NOTIFIED;\n\n\t\t\tif (!(effect._flags & DISPOSED) && needsToRecompute(effect)) {\n\t\t\t\ttry {\n\t\t\t\t\teffect._callback();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (!hasError) {\n\t\t\t\t\t\terror = err;\n\t\t\t\t\t\thasError = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\teffect = next;\n\t\t}\n\t}\n\tbatchIteration = 0;\n\tbatchDepth--;\n\n\tif (hasError) {\n\t\tthrow error;\n\t}\n}\n\nfunction batch(callback: () => T): T {\n\tif (batchDepth > 0) {\n\t\treturn callback();\n\t}\n\t/*@__INLINE__**/ startBatch();\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tendBatch();\n\t}\n}\n\n// Currently evaluated computed or effect.\nlet evalContext: Computed | Effect | undefined = undefined;\n\nlet untrackedDepth = 0;\n\nfunction untracked(callback: () => T): T {\n\tif (untrackedDepth > 0) {\n\t\treturn callback();\n\t}\n\tconst prevContext = evalContext;\n\tevalContext = undefined;\n\tuntrackedDepth++;\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tuntrackedDepth--;\n\t\tevalContext = prevContext;\n\t}\n}\n\n// Effects collected into a batch.\nlet batchedEffect: Effect | undefined = undefined;\nlet batchDepth = 0;\nlet batchIteration = 0;\n\n// A global version number for signals, used for fast-pathing repeated\n// computed.peek()/computed.value calls when nothing has changed globally.\nlet globalVersion = 0;\n\nfunction addDependency(signal: Signal): Node | undefined {\n\tif (evalContext === undefined) {\n\t\treturn undefined;\n\t}\n\n\tlet node = signal._node;\n\tif (node === undefined || node._target !== evalContext) {\n\t\t/**\n\t\t * `signal` is a new dependency. Create a new dependency node, and set it\n\t\t * as the tail of the current context's dependency list. e.g:\n\t\t *\n\t\t * { A <-> B }\n\t\t * ↑ ↑\n\t\t * tail node (new)\n\t\t * ↓\n\t\t * { A <-> B <-> C }\n\t\t * ↑\n\t\t * tail (evalContext._sources)\n\t\t */\n\t\tnode = {\n\t\t\t_version: 0,\n\t\t\t_source: signal,\n\t\t\t_prevSource: evalContext._sources,\n\t\t\t_nextSource: undefined,\n\t\t\t_target: evalContext,\n\t\t\t_prevTarget: undefined,\n\t\t\t_nextTarget: undefined,\n\t\t\t_rollbackNode: node,\n\t\t};\n\n\t\tif (evalContext._sources !== undefined) {\n\t\t\tevalContext._sources._nextSource = node;\n\t\t}\n\t\tevalContext._sources = node;\n\t\tsignal._node = node;\n\n\t\t// Subscribe to change notifications from this dependency if we're in an effect\n\t\t// OR evaluating a computed signal that in turn has subscribers.\n\t\tif (evalContext._flags & TRACKING) {\n\t\t\tsignal._subscribe(node);\n\t\t}\n\t\treturn node;\n\t} else if (node._version === -1) {\n\t\t// `signal` is an existing dependency from a previous evaluation. Reuse it.\n\t\tnode._version = 0;\n\n\t\t/**\n\t\t * If `node` is not already the current tail of the dependency list (i.e.\n\t\t * there is a next node in the list), then make the `node` the new tail. e.g:\n\t\t *\n\t\t * { A <-> B <-> C <-> D }\n\t\t * ↑ ↑\n\t\t * node ┌─── tail (evalContext._sources)\n\t\t * └─────│─────┐\n\t\t * ↓ ↓\n\t\t * { A <-> C <-> D <-> B }\n\t\t * ↑\n\t\t * tail (evalContext._sources)\n\t\t */\n\t\tif (node._nextSource !== undefined) {\n\t\t\tnode._nextSource._prevSource = node._prevSource;\n\n\t\t\tif (node._prevSource !== undefined) {\n\t\t\t\tnode._prevSource._nextSource = node._nextSource;\n\t\t\t}\n\n\t\t\tnode._prevSource = evalContext._sources;\n\t\t\tnode._nextSource = undefined;\n\n\t\t\tevalContext._sources!._nextSource = node;\n\t\t\tevalContext._sources = node;\n\t\t}\n\n\t\t// We can assume that the currently evaluated effect / computed signal is already\n\t\t// subscribed to change notifications from `signal` if needed.\n\t\treturn node;\n\t}\n\treturn undefined;\n}\n\n// @ts-ignore internal Signal is viewed as a function\ndeclare class Signal {\n\t/** @internal */\n\t_value: unknown;\n\n\t/**\n\t * @internal\n\t * Version numbers should always be >= 0, because the special value -1 is used\n\t * by Nodes to signify potentially unused but recyclable nodes.\n\t */\n\t_version: number;\n\n\t/** @internal */\n\t_node?: Node;\n\n\t/** @internal */\n\t_targets?: Node;\n\n\tconstructor(value?: T);\n\n\t/** @internal */\n\t_refresh(): boolean;\n\n\t/** @internal */\n\t_subscribe(node: Node): void;\n\n\t/** @internal */\n\t_unsubscribe(node: Node): void;\n\n\tsubscribe(fn: (value: T) => void): () => void;\n\n\tvalueOf(): T;\n\n\ttoString(): string;\n\n\ttoJSON(): T;\n\n\tpeek(): T;\n\n\tget value(): T;\n\tset value(value: T);\n}\n\n/** @internal */\n// @ts-ignore internal Signal is viewed as function\nfunction Signal(this: Signal, value?: unknown) {\n\tthis._value = value;\n\tthis._version = 0;\n\tthis._node = undefined;\n\tthis._targets = undefined;\n}\n\nSignal.prototype._refresh = function () {\n\treturn true;\n};\n\nSignal.prototype._subscribe = function (node) {\n\tif (this._targets !== node && node._prevTarget === undefined) {\n\t\tnode._nextTarget = this._targets;\n\t\tif (this._targets !== undefined) {\n\t\t\tthis._targets._prevTarget = node;\n\t\t}\n\t\tthis._targets = node;\n\t}\n};\n\nSignal.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the signal has any subscribers to begin with.\n\tif (this._targets !== undefined) {\n\t\tconst prev = node._prevTarget;\n\t\tconst next = node._nextTarget;\n\t\tif (prev !== undefined) {\n\t\t\tprev._nextTarget = next;\n\t\t\tnode._prevTarget = undefined;\n\t\t}\n\t\tif (next !== undefined) {\n\t\t\tnext._prevTarget = prev;\n\t\t\tnode._nextTarget = undefined;\n\t\t}\n\t\tif (node === this._targets) {\n\t\t\tthis._targets = next;\n\t\t}\n\t}\n};\n\nSignal.prototype.subscribe = function (fn) {\n\tconst signal = this;\n\treturn effect(function (this: Effect) {\n\t\tconst value = signal.value;\n\t\tconst flag = this._flags & TRACKING;\n\t\tthis._flags &= ~TRACKING;\n\t\ttry {\n\t\t\tfn(value);\n\t\t} finally {\n\t\t\tthis._flags |= flag;\n\t\t}\n\t});\n};\n\nSignal.prototype.valueOf = function () {\n\treturn this.value;\n};\n\nSignal.prototype.toString = function () {\n\treturn this.value + \"\";\n};\n\nSignal.prototype.toJSON = function () {\n\treturn this.value;\n};\n\nSignal.prototype.peek = function () {\n\treturn this._value;\n};\n\nObject.defineProperty(Signal.prototype, \"value\", {\n\tget() {\n\t\tconst node = addDependency(this);\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\treturn this._value;\n\t},\n\tset(this: Signal, value) {\n\t\tif (evalContext instanceof Computed) {\n\t\t\tmutationDetected();\n\t\t}\n\n\t\tif (value !== this._value) {\n\t\t\tif (batchIteration > 100) {\n\t\t\t\tcycleDetected();\n\t\t\t}\n\n\t\t\tthis._value = value;\n\t\t\tthis._version++;\n\t\t\tglobalVersion++;\n\n\t\t\t/**@__INLINE__*/ startBatch();\n\t\t\ttry {\n\t\t\t\tfor (\n\t\t\t\t\tlet node = this._targets;\n\t\t\t\t\tnode !== undefined;\n\t\t\t\t\tnode = node._nextTarget\n\t\t\t\t) {\n\t\t\t\t\tnode._target._notify();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tendBatch();\n\t\t\t}\n\t\t}\n\t},\n});\n\nfunction signal(value: T): Signal {\n\treturn new Signal(value);\n}\n\nfunction needsToRecompute(target: Computed | Effect): boolean {\n\t// Check the dependencies for changed values. The dependency list is already\n\t// in order of use. Therefore if multiple dependencies have changed values, only\n\t// the first used dependency is re-evaluated at this point.\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\t// If there's a new version of the dependency before or after refreshing,\n\t\t// or the dependency has something blocking it from refreshing at all (e.g. a\n\t\t// dependency cycle), then we need to recompute.\n\t\tif (\n\t\t\tnode._source._version !== node._version ||\n\t\t\t!node._source._refresh() ||\n\t\t\tnode._source._version !== node._version\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// If none of the dependencies have changed values since last recompute then\n\t// there's no need to recompute.\n\treturn false;\n}\n\nfunction prepareSources(target: Computed | Effect) {\n\t/**\n\t * 1. Mark all current sources as re-usable nodes (version: -1)\n\t * 2. Set a rollback node if the current node is being used in a different context\n\t * 3. Point 'target._sources' to the tail of the doubly-linked list, e.g:\n\t *\n\t * { undefined <- A <-> B <-> C -> undefined }\n\t * ↑ ↑\n\t * │ └──────┐\n\t * target._sources = A; (node is head) │\n\t * ↓ │\n\t * target._sources = C; (node is tail) ─┘\n\t */\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tconst rollbackNode = node._source._node;\n\t\tif (rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = rollbackNode;\n\t\t}\n\t\tnode._source._node = node;\n\t\tnode._version = -1;\n\n\t\tif (node._nextSource === undefined) {\n\t\t\ttarget._sources = node;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction cleanupSources(target: Computed | Effect) {\n\tlet node = target._sources;\n\tlet head = undefined;\n\n\t/**\n\t * At this point 'target._sources' points to the tail of the doubly-linked list.\n\t * It contains all existing sources + new sources in order of use.\n\t * Iterate backwards until we find the head node while dropping old dependencies.\n\t */\n\twhile (node !== undefined) {\n\t\tconst prev = node._prevSource;\n\n\t\t/**\n\t\t * The node was not re-used, unsubscribe from its change notifications and remove itself\n\t\t * from the doubly-linked list. e.g:\n\t\t *\n\t\t * { A <-> B <-> C }\n\t\t * ↓\n\t\t * { A <-> C }\n\t\t */\n\t\tif (node._version === -1) {\n\t\t\tnode._source._unsubscribe(node);\n\n\t\t\tif (prev !== undefined) {\n\t\t\t\tprev._nextSource = node._nextSource;\n\t\t\t}\n\t\t\tif (node._nextSource !== undefined) {\n\t\t\t\tnode._nextSource._prevSource = prev;\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * The new head is the last node seen which wasn't removed/unsubscribed\n\t\t\t * from the doubly-linked list. e.g:\n\t\t\t *\n\t\t\t * { A <-> B <-> C }\n\t\t\t * ↑ ↑ ↑\n\t\t\t * │ │ └ head = node\n\t\t\t * │ └ head = node\n\t\t\t * └ head = node\n\t\t\t */\n\t\t\thead = node;\n\t\t}\n\n\t\tnode._source._node = node._rollbackNode;\n\t\tif (node._rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = undefined;\n\t\t}\n\n\t\tnode = prev;\n\t}\n\n\ttarget._sources = head;\n}\n\ndeclare class Computed extends Signal {\n\t_compute: () => T;\n\t_sources?: Node;\n\t_globalVersion: number;\n\t_flags: number;\n\n\tconstructor(compute: () => T);\n\n\t_notify(): void;\n\tget value(): T;\n}\n\nfunction Computed(this: Computed, compute: () => unknown) {\n\tSignal.call(this, undefined);\n\n\tthis._compute = compute;\n\tthis._sources = undefined;\n\tthis._globalVersion = globalVersion - 1;\n\tthis._flags = OUTDATED;\n}\n\nComputed.prototype = new Signal() as Computed;\n\nComputed.prototype._refresh = function () {\n\tthis._flags &= ~NOTIFIED;\n\n\tif (this._flags & RUNNING) {\n\t\treturn false;\n\t}\n\n\t// If this computed signal has subscribed to updates from its dependencies\n\t// (TRACKING flag set) and none of them have notified about changes (OUTDATED\n\t// flag not set), then the computed value can't have changed.\n\tif ((this._flags & (OUTDATED | TRACKING)) === TRACKING) {\n\t\treturn true;\n\t}\n\tthis._flags &= ~OUTDATED;\n\n\tif (this._globalVersion === globalVersion) {\n\t\treturn true;\n\t}\n\tthis._globalVersion = globalVersion;\n\n\t// Mark this computed signal running before checking the dependencies for value\n\t// changes, so that the RUNNING flag can be used to notice cyclical dependencies.\n\tthis._flags |= RUNNING;\n\tif (this._version > 0 && !needsToRecompute(this)) {\n\t\tthis._flags &= ~RUNNING;\n\t\treturn true;\n\t}\n\n\tconst prevContext = evalContext;\n\ttry {\n\t\tprepareSources(this);\n\t\tevalContext = this;\n\t\tconst value = this._compute();\n\t\tif (\n\t\t\tthis._flags & HAS_ERROR ||\n\t\t\tthis._value !== value ||\n\t\t\tthis._version === 0\n\t\t) {\n\t\t\tthis._value = value;\n\t\t\tthis._flags &= ~HAS_ERROR;\n\t\t\tthis._version++;\n\t\t}\n\t} catch (err) {\n\t\tthis._value = err;\n\t\tthis._flags |= HAS_ERROR;\n\t\tthis._version++;\n\t}\n\tevalContext = prevContext;\n\tcleanupSources(this);\n\tthis._flags &= ~RUNNING;\n\treturn true;\n};\n\nComputed.prototype._subscribe = function (node) {\n\tif (this._targets === undefined) {\n\t\tthis._flags |= OUTDATED | TRACKING;\n\n\t\t// A computed signal subscribes lazily to its dependencies when the it\n\t\t// gets its first subscriber.\n\t\tfor (\n\t\t\tlet node = this._sources;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextSource\n\t\t) {\n\t\t\tnode._source._subscribe(node);\n\t\t}\n\t}\n\tSignal.prototype._subscribe.call(this, node);\n};\n\nComputed.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the computed signal has any subscribers.\n\tif (this._targets !== undefined) {\n\t\tSignal.prototype._unsubscribe.call(this, node);\n\n\t\t// Computed signal unsubscribes from its dependencies when it loses its last subscriber.\n\t\t// This makes it possible for unreferences subgraphs of computed signals to get garbage collected.\n\t\tif (this._targets === undefined) {\n\t\t\tthis._flags &= ~TRACKING;\n\n\t\t\tfor (\n\t\t\t\tlet node = this._sources;\n\t\t\t\tnode !== undefined;\n\t\t\t\tnode = node._nextSource\n\t\t\t) {\n\t\t\t\tnode._source._unsubscribe(node);\n\t\t\t}\n\t\t}\n\t}\n};\n\nComputed.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= OUTDATED | NOTIFIED;\n\n\t\tfor (\n\t\t\tlet node = this._targets;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextTarget\n\t\t) {\n\t\t\tnode._target._notify();\n\t\t}\n\t}\n};\n\nComputed.prototype.peek = function () {\n\tif (!this._refresh()) {\n\t\tcycleDetected();\n\t}\n\tif (this._flags & HAS_ERROR) {\n\t\tthrow this._value;\n\t}\n\treturn this._value;\n};\n\nObject.defineProperty(Computed.prototype, \"value\", {\n\tget() {\n\t\tif (this._flags & RUNNING) {\n\t\t\tcycleDetected();\n\t\t}\n\t\tconst node = addDependency(this);\n\t\tthis._refresh();\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\tif (this._flags & HAS_ERROR) {\n\t\t\tthrow this._value;\n\t\t}\n\t\treturn this._value;\n\t},\n});\n\ninterface ReadonlySignal extends Signal {\n\treadonly value: T;\n}\n\nfunction computed(compute: () => T): ReadonlySignal {\n\treturn new Computed(compute);\n}\n\nfunction cleanupEffect(effect: Effect) {\n\tconst cleanup = effect._cleanup;\n\teffect._cleanup = undefined;\n\n\tif (typeof cleanup === \"function\") {\n\t\t/*@__INLINE__**/ startBatch();\n\n\t\t// Run cleanup functions always outside of any context.\n\t\tconst prevContext = evalContext;\n\t\tevalContext = undefined;\n\t\ttry {\n\t\t\tcleanup();\n\t\t} catch (err) {\n\t\t\teffect._flags &= ~RUNNING;\n\t\t\teffect._flags |= DISPOSED;\n\t\t\tdisposeEffect(effect);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tevalContext = prevContext;\n\t\t\tendBatch();\n\t\t}\n\t}\n}\n\nfunction disposeEffect(effect: Effect) {\n\tfor (\n\t\tlet node = effect._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tnode._source._unsubscribe(node);\n\t}\n\teffect._compute = undefined;\n\teffect._sources = undefined;\n\n\tcleanupEffect(effect);\n}\n\nfunction endEffect(this: Effect, prevContext?: Computed | Effect) {\n\tif (evalContext !== this) {\n\t\tthrow new Error(\"Out-of-order effect\");\n\t}\n\tcleanupSources(this);\n\tevalContext = prevContext;\n\n\tthis._flags &= ~RUNNING;\n\tif (this._flags & DISPOSED) {\n\t\tdisposeEffect(this);\n\t}\n\tendBatch();\n}\n\ntype EffectCleanup = () => unknown;\ndeclare class Effect {\n\t_compute?: () => unknown | EffectCleanup;\n\t_cleanup?: () => unknown;\n\t_sources?: Node;\n\t_nextBatchedEffect?: Effect;\n\t_flags: number;\n\n\tconstructor(compute: () => unknown | EffectCleanup);\n\n\t_callback(): void;\n\t_start(): () => void;\n\t_notify(): void;\n\t_dispose(): void;\n}\n\nfunction Effect(this: Effect, compute: () => unknown | EffectCleanup) {\n\tthis._compute = compute;\n\tthis._cleanup = undefined;\n\tthis._sources = undefined;\n\tthis._nextBatchedEffect = undefined;\n\tthis._flags = TRACKING;\n}\n\nEffect.prototype._callback = function () {\n\tconst finish = this._start();\n\ttry {\n\t\tif (this._flags & DISPOSED) return;\n\t\tif (this._compute === undefined) return;\n\n\t\tconst cleanup = this._compute();\n\t\tif (typeof cleanup === \"function\") {\n\t\t\tthis._cleanup = cleanup as EffectCleanup;\n\t\t}\n\t} finally {\n\t\tfinish();\n\t}\n};\n\nEffect.prototype._start = function () {\n\tif (this._flags & RUNNING) {\n\t\tcycleDetected();\n\t}\n\tthis._flags |= RUNNING;\n\tthis._flags &= ~DISPOSED;\n\tcleanupEffect(this);\n\tprepareSources(this);\n\n\t/*@__INLINE__**/ startBatch();\n\tconst prevContext = evalContext;\n\tevalContext = this;\n\treturn endEffect.bind(this, prevContext);\n};\n\nEffect.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= NOTIFIED;\n\t\tthis._nextBatchedEffect = batchedEffect;\n\t\tbatchedEffect = this;\n\t}\n};\n\nEffect.prototype._dispose = function () {\n\tthis._flags |= DISPOSED;\n\n\tif (!(this._flags & RUNNING)) {\n\t\tdisposeEffect(this);\n\t}\n};\n\nfunction effect(compute: () => unknown | EffectCleanup): () => void {\n\tconst effect = new Effect(compute);\n\ttry {\n\t\teffect._callback();\n\t} catch (err) {\n\t\teffect._dispose();\n\t\tthrow err;\n\t}\n\t// Return a bound function instead of a wrapper like `() => effect._dispose()`,\n\t// because bound functions seem to be just as fast and take up a lot less memory.\n\treturn effect._dispose.bind(effect);\n}\n\nexport {\n\tsignal,\n\tcomputed,\n\teffect,\n\tbatch,\n\tSignal,\n\ttype ReadonlySignal,\n\tuntracked,\n};\n","/**\n * Copyright 2023 Design Barn Inc.\n */\n\nimport type { Signal } from '@preact/signals-core';\nimport { signal } from '@preact/signals-core';\n\nexport class Store {\n protected _state: Signal;\n\n protected _prevState: T;\n\n public constructor(initialState: T) {\n this._prevState = initialState;\n this._state = signal(initialState);\n }\n\n public setState(state: T): void {\n this._prevState = this._state.value;\n this._state.value = state;\n }\n\n public subscribe(callback: (value: T, prevValue: T) => void): () => void {\n return this._state.subscribe((val) => callback(val, this._prevState));\n }\n}\n"]}