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AKC,UAAU,EAC1D,EACAH,EAAIU,UAAUiB,OAAS,WACnBzB,KAAKK,KAAO,GAAKL,KAAKC,UAAU,GAAKD,KAAKC,UAAU,EACxD,EACAH,EAAIU,UAAUkB,UAAY,WACtB1B,KAAKM,IAAM,GAAKN,KAAKC,UAAU,GAAKD,KAAKC,UAAU,EACvD,EACAH,EAAIU,UAAUK,UAAY,WACtB,OAAOb,KAAKG,MAAQ,IAAMH,KAAKI,OAAS,IAAMJ,KAAKK,IACvD,EACOP,CACX,CArJyB,GAsJzBH,EAAQ,EAAMG,6CCnQC,SAASqC,EAAQplB,GAG9B,OAAOolB,EAAU,mBAAqBC,QAAU,iBAAmBA,OAAOC,SAAW,SAAUtlB,GAC7F,cAAcA,CAChB,EAAI,SAAUA,GACZ,OAAOA,GAAK,mBAAqBqlB,QAAUrlB,EAAEuf,cAAgB8F,QAAUrlB,IAAMqlB,OAAO5B,UAAY,gBAAkBzjB,CACpH,EAAGolB,EAAQplB,EACb","sources":["../node_modules/fflate/esm/browser.js","../node_modules/fp-ts-contrib/es6/Zipper.js","../node_modules/html-to-image/src/apply-style.ts","../node_modules/html-to-image/src/clone-node.ts","../node_modules/html-to-image/src/clone-pseudos.ts","../node_modules/html-to-image/src/dataurl.ts","../node_modules/html-to-image/src/embed-images.ts","../node_modules/html-to-image/src/embed-resources.ts","../node_modules/html-to-image/src/embed-webfonts.ts","../node_modules/html-to-image/src/index.ts","../node_modules/html-to-image/src/mimes.ts","../node_modules/html-to-image/src/util.ts","../node_modules/moment/locale/ro.js","../node_modules/react-intl/lib/src/components/injectIntl.js","../node_modules/react-intl/lib/src/components/useIntl.js","../node_modules/romanian-personal-identity-code-validator/lib/index.js","../node_modules/@babel/runtime/helpers/esm/typeof.js"],"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// Much of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// Many optimizations have been made, so the bundle size is ultimately smaller but performance is similar.\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 u = ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([c], { type: 'text/javascript' })));\n var w = new Worker(u);\n w.onerror = function (e) { return cb(e.error, null); };\n w.onmessage = function (e) { return cb(null, e.data); };\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, u32 = Uint32Array;\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\n// see fleb note\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 u32(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, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\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[0], revfd = _b[1];\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 ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; 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 co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\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 / 8) >> 0) + (p & 7 && 1); };\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 var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\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 st.f = 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 throw 'unexpected EOF';\n break;\n }\n // ensure size\n if (noBuf)\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;\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 if (!noSt && pos + tl * (clb + 7) > tbts)\n break;\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 throw 'invalid block type';\n if (pos > tbts)\n throw 'unexpected EOF';\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 (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var mxa = lbt + dbt + 18;\n while (noSt || pos + mxa < tbts) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts)\n throw 'unexpected EOF';\n if (!c)\n throw 'invalid length/literal';\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n 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 throw 'invalid distance';\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 throw 'unexpected EOF';\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = pos, st.b = bt;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 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 [new u8(0), 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 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 [new u8(tr), 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 [cl.subarray(0, cli), 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[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\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[0], mlcb = _e[1];\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 (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 if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([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, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.floor(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\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 = new u16(32768), head = 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 u32(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 bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768\n var imod = i & 32767;\n // previous index with this value\n var 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) {\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 + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 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 + 32768) & 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 Uint32\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 pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst)\n pos = wfblk(w, pos, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new u32(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && 0xEDB88320) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = 0xFFFFFFFF;\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 ^ 0xFFFFFFFF; }\n };\n};\n// Alder32\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;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 5552, l);\n for (; i < e; ++i)\n n += d[i], m += n;\n n %= 65521, m %= 65521;\n }\n a = n, b = m;\n },\n d: function () { return ((a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8)) + ((a & 255) << 23) * 2; }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\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(/ /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, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n var _a;\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n ch[id] = wcln(fns[m], fnStr, td_1);\n }\n var td = mrg({}, ch[id][1]);\n return wk(ch[id][0] + ';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, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, hMap, max, bits, bits16, shft, slc, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, 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 [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\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 if (!opts.consume)\n dat = new u8(dat);\n w.postMessage([dat, opts], [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) {\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 {\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 (t)\n throw 'stream finished';\n if (!strm.ondata)\n throw 'no stream handler';\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] << 23) * 2; };\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 throw '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) + (2 * (d[l - 1] << 23));\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) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n throw 'invalid zlib data';\n if (d[1] & 32)\n throw 'invalid zlib data: preset dictionaries not supported';\n};\nfunction AsyncCmpStrm(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (!cb && typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, !f), 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.d)\n throw 'stream finished';\n if (!this.ondata)\n throw 'no stream handler';\n this.d = final;\n this.p(chunk, final || false);\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, AsyncCmpStrm.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 throw 'no callback';\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 if (opts === void 0) { opts = {}; }\n return dopt(data, opts, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n /**\n * Creates an inflation stream\n * @param cb The callback to call whenever data is inflated\n */\n function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }\n Inflate.prototype.e = function (c) {\n if (this.d)\n throw 'stream finished';\n if (!this.ondata)\n throw 'no stream handler';\n var l = this.p.length;\n var n = new u8(l + c.length);\n n.set(this.p), n.set(c, l), this.p = n;\n };\n Inflate.prototype.c = function (final) {\n this.d = this.s.i = final || false;\n var bts = this.s.b;\n var dt = inflt(this.p, this.o, this.s);\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 /**\n * Creates an asynchronous inflation stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncInflate(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, 0, function () {\n var strm = new Inflate();\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 throw 'no callback';\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n return inflt(data, out);\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 Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n this.c.p(c);\n this.l += c.length;\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\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, AsyncCmpStrm.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 throw 'no callback';\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 === void 0) { 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 GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n /**\n * Creates a GUNZIP stream\n * @param cb The callback to call whenever data is inflated\n */\n function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, 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 if (this.v) {\n var s = gzs(this.p);\n if (s >= this.p.length && !final)\n return;\n this.p = this.p.subarray(s), this.v = 0;\n }\n if (final) {\n if (this.p.length < 8)\n throw 'invalid gzip stream';\n this.p = this.p.subarray(0, -8);\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 Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous GUNZIP stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncGunzip(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, 0, function () {\n var strm = new Gunzip();\n onmessage = astrm(strm);\n }, 9);\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 throw 'no callback';\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\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 Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n this.c.p(c);\n var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\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, AsyncCmpStrm.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 throw 'no callback';\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 === void 0) { opts = {}; }\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 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 /**\n * Creates a Zlib decompression stream\n * @param cb The callback to call whenever data is inflated\n */\n function Unzlib(cb) {\n this.v = 1;\n Inflate.call(this, cb);\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 < 2 && !final)\n return;\n this.p = this.p.subarray(2), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n throw 'invalid zlib stream';\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 /**\n * Creates an asynchronous Zlib decompression stream\n * @param cb The callback to call whenever data is deflated\n */\n function AsyncUnzlib(cb) {\n this.ondata = cb;\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, 0, function () {\n var strm = new Unzlib();\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 throw 'no callback';\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n /**\n * Creates a decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = 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 throw 'no stream handler';\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_1 = this;\n var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(cb)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(cb)\n : new this.Z(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 /**\n * Creates an asynchronous decompression stream\n * @param cb The callback to call whenever data is decompressed\n */\n function AsyncDecompress(cb) {\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n this.ondata = 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 throw 'no callback';\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 out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, out)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, out)\n : unzlibSync(data, out);\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;\n if (val instanceof u8)\n t[n] = [val, o];\n else if (Array.isArray(val))\n t[n] = [val[0], mrg(o, val[1])];\n else\n fltn(val, n + '/', t, o);\n }\n};\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 var l = str.length;\n if (!latin1 && typeof TextEncoder != 'undefined')\n return new TextEncoder().encode(str);\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 var r = '';\n if (!latin1 && typeof TextDecoder != 'undefined')\n return new TextDecoder().decode(dat);\n for (var i = 0; i < dat.length;) {\n var c = dat[i++];\n if (c < 128 || latin1)\n r += String.fromCharCode(c);\n else if (c < 224)\n r += String.fromCharCode((c & 31) << 6 | (dat[i++] & 63));\n else if (c < 240)\n r += String.fromCharCode((c & 15) << 12 | (dat[i++] & 63) << 6 | (dat[i++] & 63));\n else\n c = ((c & 15) << 18 | (dat[i++] & 63) << 12 | (dat[i++] & 63) << 6 | (dat[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n return r;\n}\n;\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;\n var _a = z ? z64e(d, es) : [b4(d, b + 20), 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 [b4(d, b + 12), b4(d, b + 4), b4(d, b + 20)];\n};\n// write zip header\nvar wzh = function (d, b, c, cmp, su, fn, u, o, ce, t) {\n var fl = fn.length, l = cmp.length;\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b] = 20, b += 2;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (t == 8 && (o.level == 1 ? 6 : o.level < 6 ? 4 : o.level == 9 ? 2 : 0)), d[b++] = u && 8;\n d[b] = t, b += 2;\n var dt = new Date(o.mtime || Date.now()), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n throw 'date not in range 1980-2099';\n wbytes(d, b, ((y << 24) * 2) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1));\n b += 4;\n wbytes(d, b, c);\n wbytes(d, b + 4, l);\n wbytes(d, b + 8, su);\n wbytes(d, b + 12, fl), b += 16; // skip extra field, comment\n if (ce != null)\n wbytes(d, b += 10, ce), b += 4;\n d.set(fn, b);\n b += fl;\n if (ce == null)\n d.set(cmp, 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};\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n throw 'no callback';\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 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 wzh(out, tot, f.c, f.d, f.m, f.n, f.u, f.p, null, f.t);\n wzh(out, o, f.c, f.d, f.m, f.n, f.u, f.p, tot, f.t), o += 46 + f.n.length, tot += 30 + f.n.length + f.d.length;\n }\n catch (e) {\n return cb(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cb(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(), m = file.length;\n c.p(file);\n var n = strToU8(fn), s = n.length;\n var t = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cb(e, null);\n }\n else {\n var l = d.length;\n files[i] = {\n t: t,\n d: d,\n m: m,\n c: c.d(),\n u: fn.length != l,\n n: n,\n p: p\n };\n o += 30 + s + l;\n tot += 76 + 2 * s + l;\n if (!--lft)\n cbf();\n }\n };\n if (n.length > 65535)\n cbl('filename too long', null);\n if (!t)\n cbl(null, file);\n else if (m < 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 === void 0) { 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 t = p.level == 0 ? 0 : 8;\n var n = strToU8(fn), s = n.length;\n if (n.length > 65535)\n throw 'filename too long';\n var d = t ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push({\n t: t,\n d: d,\n m: file.length,\n c: c.d(),\n u: fn.length != s,\n n: n,\n o: o,\n p: p\n });\n o += 30 + s + l;\n tot += 76 + 2 * s + 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.c, f.d, f.m, f.n, f.u, f.p, null, f.t);\n wzh(out, o, f.c, f.d, f.m, f.n, f.u, f.p, f.o, f.t), o += 46 + f.n.length;\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Asynchronously decompresses a ZIP archive\n * @param data The raw compressed ZIP file\n * @param cb The callback to call with the decompressed files\n * @returns A function that can be used to immediately terminate the unzipping\n */\nexport function unzip(data, cb) {\n if (typeof cb != 'function')\n throw 'no callback';\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 e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cb('invalid zip file', null);\n return;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (!lft)\n cb(null, {});\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n throw 'invalid zip file';\n c = lft = b4(data, e + 32);\n o = b4(data, e + 48);\n }\n var _loop_2 = 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 cb(e, null);\n }\n else {\n files[fn] = d;\n if (!--lft)\n cb(null, files);\n }\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, 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('unknown compression type ' + c_1, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_2(i);\n }\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 * @returns The decompressed files\n */\nexport function unzipSync(data) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n throw 'invalid zip file';\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;\n if (z) {\n e = b4(data, e - 12);\n if (b4(data, e) != 0x6064B50)\n throw 'invalid zip file';\n c = b4(data, e + 32);\n o = b4(data, e + 48);\n }\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 (!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), new u8(su));\n else\n throw 'unknown compression type ' + c_2;\n }\n return files;\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as A from 'fp-ts/es6/Array';\nimport { decrement, increment, identity } from 'fp-ts/es6/function';\nimport * as NEA from 'fp-ts/es6/NonEmptyArray';\nimport * as O from 'fp-ts/es6/Option';\nimport { pipe } from 'fp-ts/es6/pipeable';\nimport * as RA from 'fp-ts/es6/ReadonlyArray';\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Creates a new zipper.\n *\n * @category constructors\n * @since 0.1.6\n */\nexport var make = function (lefts, focus, rights) { return ({\n lefts: lefts.slice(),\n focus: focus,\n rights: rights.slice()\n}); };\n/**\n * @category constructors\n * @since 0.1.23\n */\nexport var fromReadonlyArray = function (as, focusIndex) {\n if (focusIndex === void 0) { focusIndex = 0; }\n if (RA.isEmpty(as) || RA.isOutOfBound(focusIndex, as)) {\n return O.none;\n }\n else {\n return O.some(make(pipe(as.slice(), A.takeLeft(focusIndex)), as[focusIndex], pipe(as.slice(), A.dropLeft(focusIndex + 1))));\n }\n};\n/**\n * @category constructors\n * @since 0.1.6\n */\nexport var fromArray = fromReadonlyArray;\n/**\n * @category constructors\n * @since 0.1.23\n */\nexport var fromReadonlyNonEmptyArray = function (nea) {\n return make([], nea[0], nea.slice(1));\n};\n/**\n * @category constructors\n * @since 0.1.6\n */\nexport var fromNonEmptyArray = fromReadonlyNonEmptyArray;\n// -------------------------------------------------------------------------------------\n// destructors\n// -------------------------------------------------------------------------------------\n/**\n * @category destructors\n * @since 0.1.18\n */\nexport var isOutOfBound = function (index, fa) {\n return index < 0 || index >= length(fa);\n};\n/**\n * @category destructors\n * @since 0.1.6\n */\nexport var length = function (fa) { return fa.lefts.length + 1 + fa.rights.length; };\n/**\n * @category destructors\n * @since 0.1.23\n */\nexport var toNonEmptyArray = function (fa) {\n return pipe(NEA.of(fa.focus), function (as) { return NEA.concat(fa.lefts, as); }, function (as) { return NEA.concat(as, fa.rights); });\n};\n/**\n * @category destructors\n * @since 0.1.23\n */\nexport var toReadonlyNonEmptyArray = toNonEmptyArray;\n/**\n * @category destructors\n * @since 0.1.6\n * @deprecated Use the new {@link toNonEmptyArray} destructor instead.\n */\nexport var toArray = toNonEmptyArray;\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * Updates the focus of the zipper.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var update = function (a) { return function (fa) { return make(fa.lefts, a, fa.rights); }; };\n/**\n * Applies `f` to the focus and update with the result.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var modify = function (f) { return function (fa) { return pipe(fa, update(f(fa.focus))); }; };\n/**\n * Moves focus in the zipper, or `None` if there is no such element.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var move = function (f, fa) {\n var newIndex = f(fa.lefts.length);\n if (isOutOfBound(newIndex, fa)) {\n return O.none;\n }\n else {\n return fromArray(toNonEmptyArray(fa), newIndex);\n }\n};\n/**\n * Find the first index for which a predicate holds.\n *\n * @category utils\n * @since 0.1.24\n */\nexport var findIndex = function (predicate) { return function (fa) {\n return pipe(fa.lefts, RA.findIndex(predicate), O.alt(function () { return (predicate(fa.focus) ? O.some(fa.lefts.length) : O.none); }), O.alt(function () {\n return pipe(fa.rights, RA.findIndex(predicate), O.map(function (i) { return fa.lefts.length + 1 + i; }));\n }));\n}; };\n/**\n * Use a function to find and focus the first matching element in the array. If\n * no element matches, `None` is returned. If an element matches,\n * `Some>` is returned.\n *\n * @category combinators\n * @since 0.1.26\n */\nexport var moveByFindFirst = function (predicate) { return function (fa) {\n return pipe(fa, findIndex(predicate), O.chain(function (i) { return (i === fa.lefts.length ? O.some(fa) : move(function () { return i; }, fa)); }));\n}; };\n/**\n * Moves focus of the zipper up.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var up = function (fa) { return move(decrement, fa); };\n/**\n * Moves focus of the zipper down.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var down = function (fa) { return move(increment, fa); };\n/**\n * Moves focus to the start of the zipper.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var start = function (fa) {\n if (A.isEmpty(fa.lefts)) {\n return fa;\n }\n else {\n return make([], fa.lefts[0], A.snoc(pipe(fa.lefts, A.dropLeft(1)), fa.focus).concat(fa.rights));\n }\n};\n/**\n * Moves focus to the end of the zipper.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var end = function (fa) {\n var len = fa.rights.length;\n if (len === 0) {\n return fa;\n }\n else {\n return make(A.snoc(fa.lefts, fa.focus).concat(pipe(fa.rights, A.takeLeft(len - 1))), fa.rights[len - 1], []);\n }\n};\n/**\n * Inserts an element to the left of the focus and focuses on the new element.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var insertLeft = function (a) { return function (fa) {\n return make(fa.lefts, a, A.cons(fa.focus, fa.rights));\n}; };\n/**\n * Inserts an element to the right of the focus and focuses on the new element.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var insertRight = function (a) { return function (fa) {\n return make(A.snoc(fa.lefts, fa.focus), a, fa.rights);\n}; };\n/**\n * Deletes the element at focus and moves the focus to the left. If there is no element on the left,\n * the focus is moved to the right.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var deleteLeft = function (fa) {\n var len = fa.lefts.length;\n return fromArray(fa.lefts.concat(fa.rights), len > 0 ? len - 1 : 0);\n};\n/**\n * Deletes the element at focus and moves the focus to the right. If there is no element on the right,\n * the focus is moved to the left.\n *\n * @category combinators\n * @since 0.1.6\n */\nexport var deleteRight = function (fa) {\n var lenl = fa.lefts.length;\n var lenr = fa.rights.length;\n return fromArray(fa.lefts.concat(fa.rights), lenr > 0 ? lenl : lenl - 1);\n};\n// -------------------------------------------------------------------------------------\n// non-pipeables\n// -------------------------------------------------------------------------------------\nvar map_ = function (fa, f) { return make(fa.lefts.map(f), f(fa.focus), fa.rights.map(f)); };\nvar mapWithIndex_ = function (fa, f) {\n var l = fa.lefts.length;\n return make(fa.lefts.map(function (a, i) { return f(i, a); }), f(l, fa.focus), fa.rights.map(function (a, i) { return f(l + 1 + i, a); }));\n};\nvar ap_ = function (fab, fa) {\n return make(A.array.ap(fab.lefts, fa.lefts), fab.focus(fa.focus), A.array.ap(fab.rights, fa.rights));\n};\nvar extend_ = function (fa, f) {\n var lefts = fa.lefts.map(function (a, i) {\n return f(make(pipe(fa.lefts, A.takeLeft(i)), a, A.snoc(pipe(fa.lefts, A.dropLeft(i + 1)), fa.focus).concat(fa.rights)));\n });\n var rights = fa.rights.map(function (a, i) {\n return f(make(A.snoc(fa.lefts, fa.focus).concat(pipe(fa.rights, A.takeLeft(i))), a, pipe(fa.rights, A.dropLeft(i + 1))));\n });\n return make(lefts, f(fa), rights);\n};\nvar reduce_ = function (fa, b, f) { return fa.rights.reduce(f, f(fa.lefts.reduce(f, b), fa.focus)); };\nvar reduceRight_ = function (fa, b, f) {\n var rights = fa.rights.reduceRight(function (acc, a) { return f(a, acc); }, b);\n var focus = f(fa.focus, rights);\n return fa.lefts.reduceRight(function (acc, a) { return f(a, acc); }, focus);\n};\nvar foldMap_ = function (M) { return function (fa, f) {\n var lefts = fa.lefts.reduce(function (acc, a) { return M.concat(acc, f(a)); }, M.empty);\n var rights = fa.rights.reduce(function (acc, a) { return M.concat(acc, f(a)); }, M.empty);\n return M.concat(M.concat(lefts, f(fa.focus)), rights);\n}; };\n// TODO: add pipeable traverse fp-ts version >= 2.6.3\nvar traverse_ = function (F) {\n var traverseF = A.array.traverse(F);\n return function (ta, f) {\n return F.ap(F.ap(F.map(traverseF(ta.lefts, f), function (lefts) { return function (focus) { return function (rights) { return make(lefts, focus, rights); }; }; }), f(ta.focus)), traverseF(ta.rights, f));\n };\n};\n// -------------------------------------------------------------------------------------\n// pipeables\n// -------------------------------------------------------------------------------------\n/**\n * @category Functor\n * @since 0.1.18\n */\nexport var map = function (f) { return function (fa) { return map_(fa, f); }; };\n/**\n * @category FunctorWithIndex\n * @since 0.1.18\n */\nexport var mapWithIndex = function (f) { return function (fa) {\n return mapWithIndex_(fa, f);\n}; };\n/**\n * @category Apply\n * @since 0.1.18\n */\nexport var ap = function (fa) { return function (fab) { return ap_(fab, fa); }; };\n/**\n * @category Apply\n * @since 0.1.18\n */\nexport var apFirst = function (fb) { return function (fa) {\n return pipe(fa, map(function (a) { return function (_) { return a; }; }), ap(fb));\n}; };\n/**\n * @category Apply\n * @since 0.1.18\n */\nexport var apSecond = function (fb) { return function (fa) {\n return pipe(fa, map(function () { return function (b) { return b; }; }), ap(fb));\n}; };\n/**\n * @category Applicative\n * @since 0.1.6\n */\nexport var of = function (focus) { return make([], focus, []); };\n/**\n * @category Extend\n * @since 0.1.18\n */\nexport var extend = function (f) { return function (wa) { return extend_(wa, f); }; };\n/**\n * @category Extend\n * @since 0.1.18\n */\nexport var duplicate = extend(identity);\n/**\n * @category Foldable\n * @since 0.1.18\n */\nexport var foldMap = function (M) { return function (f) { return function (fa) {\n return foldMap_(M)(fa, f);\n}; }; };\n/**\n * @category Foldable\n * @since 0.1.18\n */\nexport var reduce = function (b, f) { return function (fa) { return reduce_(fa, b, f); }; };\n/**\n * @category Foldable\n * @since 0.1.18\n */\nexport var reduceRight = function (b, f) { return function (fa) {\n return reduceRight_(fa, b, f);\n}; };\n/**\n * @category Traversable\n * @since 0.1.18\n */\nexport var sequence = function (F) {\n var sequenceF = A.array.sequence(F);\n return function (ta) {\n return F.ap(F.ap(F.map(sequenceF(ta.lefts), function (lefts) { return function (focus) { return function (rights) { return make(lefts, focus, rights); }; }; }), ta.focus), sequenceF(ta.rights));\n };\n};\n/**\n * @category Comonad\n * @since 0.1.18\n */\nexport var extract = function (fa) { return fa.focus; };\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @category instances\n * @since 0.1.6\n */\nexport var URI = 'Zipper';\n/**\n * @category instances\n * @since 0.1.6\n */\nexport var getShow = function (S) {\n var SA = A.getShow(S);\n return {\n show: function (fa) { return \"Zipper(\".concat(SA.show(fa.lefts), \", \").concat(S.show(fa.focus), \", \").concat(SA.show(fa.rights), \")\"); }\n };\n};\n/**\n * @category instances\n * @since 0.1.6\n */\nexport var getSemigroup = function (S) { return ({\n concat: function (x, y) { return make(x.lefts.concat(y.lefts), S.concat(x.focus, y.focus), x.rights.concat(y.rights)); }\n}); };\n/**\n * @category instances\n * @since 0.1.6\n */\nexport var getMonoid = function (M) { return (__assign(__assign({}, getSemigroup(M)), { empty: make([], M.empty, []) })); };\n/**\n * @category instances\n * @since 0.1.18\n */\nexport var Functor = {\n URI: URI,\n map: map_\n};\n/**\n * @category instances\n * @since 0.1.18\n */\nexport var FunctorWithIndex = {\n URI: URI,\n map: map_,\n mapWithIndex: mapWithIndex_\n};\n/**\n * @category instances\n * @since 0.1.18\n */\nexport var Applicative = {\n URI: URI,\n map: map_,\n ap: ap_,\n of: of\n};\n/**\n * @category instances\n * @since 0.1.18\n */\nexport var Apply = {\n URI: URI,\n map: map_,\n ap: ap_\n};\n/**\n * @category instances\n * @since 0.1.18\n */\nexport var Foldable = {\n URI: URI,\n foldMap: foldMap_,\n reduce: reduce_,\n reduceRight: reduceRight_\n};\n/**\n * @category instances\n * @since 0.1.18\n */\nexport var Traversable = {\n URI: URI,\n map: map_,\n foldMap: foldMap_,\n reduce: reduce_,\n reduceRight: reduceRight_,\n traverse: traverse_,\n sequence: sequence\n};\n/**\n * @category instances\n * @since 0.1.18\n */\nexport var Comonad = {\n URI: URI,\n map: map_,\n extend: extend_,\n extract: extract\n};\n/**\n * @category instances\n * @since 0.1.6\n */\nexport var zipper = {\n URI: URI,\n map: map_,\n of: of,\n ap: ap_,\n extend: extend_,\n extract: extract,\n reduce: reduce_,\n reduceRight: reduceRight_,\n foldMap: foldMap_,\n traverse: traverse_,\n sequence: sequence,\n mapWithIndex: mapWithIndex_\n};\n","import { Options } from './types'\n\nexport function applyStyle(\n node: T,\n options: Options,\n): T {\n const { style } = node\n\n if (options.backgroundColor) {\n style.backgroundColor = options.backgroundColor\n }\n\n if (options.width) {\n style.width = `${options.width}px`\n }\n\n if (options.height) {\n style.height = `${options.height}px`\n }\n\n const manual = options.style\n if (manual != null) {\n Object.keys(manual).forEach((key: any) => {\n style[key] = manual[key] as string\n })\n }\n\n return node\n}\n","import type { Options } from './types'\nimport { clonePseudoElements } from './clone-pseudos'\nimport { createImage, toArray, isInstanceOfElement } from './util'\nimport { getMimeType } from './mimes'\nimport { resourceToDataURL } from './dataurl'\n\nasync function cloneCanvasElement(canvas: HTMLCanvasElement) {\n const dataURL = canvas.toDataURL()\n if (dataURL === 'data:,') {\n return canvas.cloneNode(false) as HTMLCanvasElement\n }\n return createImage(dataURL)\n}\n\nasync function cloneVideoElement(video: HTMLVideoElement, options: Options) {\n if (video.currentSrc) {\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n canvas.width = video.clientWidth\n canvas.height = video.clientHeight\n ctx?.drawImage(video, 0, 0, canvas.width, canvas.height)\n const dataURL = canvas.toDataURL()\n return createImage(dataURL)\n }\n\n const poster = video.poster\n const contentType = getMimeType(poster)\n const dataURL = await resourceToDataURL(poster, contentType, options)\n return createImage(dataURL)\n}\n\nasync function cloneIFrameElement(iframe: HTMLIFrameElement) {\n try {\n if (iframe?.contentDocument?.body) {\n return (await cloneNode(\n iframe.contentDocument.body,\n {},\n true,\n )) as HTMLBodyElement\n }\n } catch {\n // Failed to clone iframe\n }\n\n return iframe.cloneNode(false) as HTMLIFrameElement\n}\n\nasync function cloneSingleNode(\n node: T,\n options: Options,\n): Promise {\n if (isInstanceOfElement(node, HTMLCanvasElement)) {\n return cloneCanvasElement(node)\n }\n\n if (isInstanceOfElement(node, HTMLVideoElement)) {\n return cloneVideoElement(node, options)\n }\n\n if (isInstanceOfElement(node, HTMLIFrameElement)) {\n return cloneIFrameElement(node)\n }\n\n return node.cloneNode(false) as T\n}\n\nconst isSlotElement = (node: HTMLElement): node is HTMLSlotElement =>\n node.tagName != null && node.tagName.toUpperCase() === 'SLOT'\n\nasync function cloneChildren(\n nativeNode: T,\n clonedNode: T,\n options: Options,\n): Promise {\n let children: T[] = []\n\n if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {\n children = toArray(nativeNode.assignedNodes())\n } else if (\n isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n nativeNode.contentDocument?.body\n ) {\n children = toArray(nativeNode.contentDocument.body.childNodes)\n } else {\n children = toArray((nativeNode.shadowRoot ?? nativeNode).childNodes)\n }\n\n if (\n children.length === 0 ||\n isInstanceOfElement(nativeNode, HTMLVideoElement)\n ) {\n return clonedNode\n }\n\n await children.reduce(\n (deferred, child) =>\n deferred\n .then(() => cloneNode(child, options))\n .then((clonedChild: HTMLElement | null) => {\n if (clonedChild) {\n clonedNode.appendChild(clonedChild)\n }\n }),\n Promise.resolve(),\n )\n\n return clonedNode\n}\n\nfunction cloneCSSStyle(nativeNode: T, clonedNode: T) {\n const targetStyle = clonedNode.style\n if (!targetStyle) {\n return\n }\n\n const sourceStyle = window.getComputedStyle(nativeNode)\n if (sourceStyle.cssText) {\n targetStyle.cssText = sourceStyle.cssText\n targetStyle.transformOrigin = sourceStyle.transformOrigin\n } else {\n toArray(sourceStyle).forEach((name) => {\n let value = sourceStyle.getPropertyValue(name)\n if (name === 'font-size' && value.endsWith('px')) {\n const reducedFont =\n Math.floor(parseFloat(value.substring(0, value.length - 2))) - 0.1\n value = `${reducedFont}px`\n }\n\n if (\n isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n name === 'display' &&\n value === 'inline'\n ) {\n value = 'block'\n }\n \n if (name === 'd' && clonedNode.getAttribute('d')) {\n value = `path(${clonedNode.getAttribute('d')})`\n }\n \n targetStyle.setProperty(\n name,\n value,\n sourceStyle.getPropertyPriority(name),\n )\n })\n }\n}\n\nfunction cloneInputValue(nativeNode: T, clonedNode: T) {\n if (isInstanceOfElement(nativeNode, HTMLTextAreaElement)) {\n clonedNode.innerHTML = nativeNode.value\n }\n\n if (isInstanceOfElement(nativeNode, HTMLInputElement)) {\n clonedNode.setAttribute('value', nativeNode.value)\n }\n}\n\nfunction cloneSelectValue(nativeNode: T, clonedNode: T) {\n if (isInstanceOfElement(nativeNode, HTMLSelectElement)) {\n const clonedSelect = clonedNode as any as HTMLSelectElement\n const selectedOption = Array.from(clonedSelect.children).find(\n (child) => nativeNode.value === child.getAttribute('value'),\n )\n\n if (selectedOption) {\n selectedOption.setAttribute('selected', '')\n }\n }\n}\n\nfunction decorate(nativeNode: T, clonedNode: T): T {\n if (isInstanceOfElement(clonedNode, Element)) {\n cloneCSSStyle(nativeNode, clonedNode)\n clonePseudoElements(nativeNode, clonedNode)\n cloneInputValue(nativeNode, clonedNode)\n cloneSelectValue(nativeNode, clonedNode)\n }\n\n return clonedNode\n}\n\nasync function ensureSVGSymbols(\n clone: T,\n options: Options,\n) {\n const uses = clone.querySelectorAll ? clone.querySelectorAll('use') : []\n if (uses.length === 0) {\n return clone\n }\n\n const processedDefs: { [key: string]: HTMLElement } = {}\n for (let i = 0; i < uses.length; i++) {\n const use = uses[i]\n const id = use.getAttribute('xlink:href')\n if (id) {\n const exist = clone.querySelector(id)\n const definition = document.querySelector(id) as HTMLElement\n if (!exist && definition && !processedDefs[id]) {\n // eslint-disable-next-line no-await-in-loop\n processedDefs[id] = (await cloneNode(definition, options, true))!\n }\n }\n }\n\n const nodes = Object.values(processedDefs)\n if (nodes.length) {\n const ns = 'http://www.w3.org/1999/xhtml'\n const svg = document.createElementNS(ns, 'svg')\n svg.setAttribute('xmlns', ns)\n svg.style.position = 'absolute'\n svg.style.width = '0'\n svg.style.height = '0'\n svg.style.overflow = 'hidden'\n svg.style.display = 'none'\n\n const defs = document.createElementNS(ns, 'defs')\n svg.appendChild(defs)\n\n for (let i = 0; i < nodes.length; i++) {\n defs.appendChild(nodes[i])\n }\n\n clone.appendChild(svg)\n }\n\n return clone\n}\n\nexport async function cloneNode(\n node: T,\n options: Options,\n isRoot?: boolean,\n): Promise {\n if (!isRoot && options.filter && !options.filter(node)) {\n return null\n }\n\n return Promise.resolve(node)\n .then((clonedNode) => cloneSingleNode(clonedNode, options) as Promise)\n .then((clonedNode) => cloneChildren(node, clonedNode, options))\n .then((clonedNode) => decorate(node, clonedNode))\n .then((clonedNode) => ensureSVGSymbols(clonedNode, options))\n}\n","import { uuid, toArray } from './util'\n\ntype Pseudo = ':before' | ':after'\n\nfunction formatCSSText(style: CSSStyleDeclaration) {\n const content = style.getPropertyValue('content')\n return `${style.cssText} content: '${content.replace(/'|\"/g, '')}';`\n}\n\nfunction formatCSSProperties(style: CSSStyleDeclaration) {\n return toArray(style)\n .map((name) => {\n const value = style.getPropertyValue(name)\n const priority = style.getPropertyPriority(name)\n\n return `${name}: ${value}${priority ? ' !important' : ''};`\n })\n .join(' ')\n}\n\nfunction getPseudoElementStyle(\n className: string,\n pseudo: Pseudo,\n style: CSSStyleDeclaration,\n): Text {\n const selector = `.${className}:${pseudo}`\n const cssText = style.cssText\n ? formatCSSText(style)\n : formatCSSProperties(style)\n\n return document.createTextNode(`${selector}{${cssText}}`)\n}\n\nfunction clonePseudoElement(\n nativeNode: T,\n clonedNode: T,\n pseudo: Pseudo,\n) {\n const style = window.getComputedStyle(nativeNode, pseudo)\n const content = style.getPropertyValue('content')\n if (content === '' || content === 'none') {\n return\n }\n\n const className = uuid()\n try {\n clonedNode.className = `${clonedNode.className} ${className}`\n } catch (err) {\n return\n }\n\n const styleElement = document.createElement('style')\n styleElement.appendChild(getPseudoElementStyle(className, pseudo, style))\n clonedNode.appendChild(styleElement)\n}\n\nexport function clonePseudoElements(\n nativeNode: T,\n clonedNode: T,\n) {\n clonePseudoElement(nativeNode, clonedNode, ':before')\n clonePseudoElement(nativeNode, clonedNode, ':after')\n}\n","import { Options } from './types'\n\nfunction getContentFromDataUrl(dataURL: string) {\n return dataURL.split(/,/)[1]\n}\n\nexport function isDataUrl(url: string) {\n return url.search(/^(data:)/) !== -1\n}\n\nexport function makeDataUrl(content: string, mimeType: string) {\n return `data:${mimeType};base64,${content}`\n}\n\nexport async function fetchAsDataURL(\n url: string,\n init: RequestInit | undefined,\n process: (data: { result: string; res: Response }) => T,\n): Promise {\n const res = await fetch(url, init)\n if (res.status === 404) {\n throw new Error(`Resource \"${res.url}\" not found`)\n }\n const blob = await res.blob()\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onerror = reject\n reader.onloadend = () => {\n try {\n resolve(process({ res, result: reader.result as string }))\n } catch (error) {\n reject(error)\n }\n }\n\n reader.readAsDataURL(blob)\n })\n}\n\nconst cache: { [url: string]: string } = {}\n\nfunction getCacheKey(\n url: string,\n contentType: string | undefined,\n includeQueryParams: boolean | undefined,\n) {\n let key = url.replace(/\\?.*/, '')\n\n if (includeQueryParams) {\n key = url\n }\n\n // font resource\n if (/ttf|otf|eot|woff2?/i.test(key)) {\n key = key.replace(/.*\\//, '')\n }\n\n return contentType ? `[${contentType}]${key}` : key\n}\n\nexport async function resourceToDataURL(\n resourceUrl: string,\n contentType: string | undefined,\n options: Options,\n) {\n const cacheKey = getCacheKey(\n resourceUrl,\n contentType,\n options.includeQueryParams,\n )\n\n if (cache[cacheKey] != null) {\n return cache[cacheKey]\n }\n\n // ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache\n if (options.cacheBust) {\n // eslint-disable-next-line no-param-reassign\n resourceUrl += (/\\?/.test(resourceUrl) ? '&' : '?') + new Date().getTime()\n }\n\n let dataURL: string\n try {\n const content = await fetchAsDataURL(\n resourceUrl,\n options.fetchRequestInit,\n ({ res, result }) => {\n if (!contentType) {\n // eslint-disable-next-line no-param-reassign\n contentType = res.headers.get('Content-Type') || ''\n }\n return getContentFromDataUrl(result)\n },\n )\n dataURL = makeDataUrl(content, contentType!)\n } catch (error) {\n dataURL = options.imagePlaceholder || ''\n\n let msg = `Failed to fetch resource: ${resourceUrl}`\n if (error) {\n msg = typeof error === 'string' ? error : error.message\n }\n\n if (msg) {\n console.warn(msg)\n }\n }\n\n cache[cacheKey] = dataURL\n return dataURL\n}\n","import { Options } from './types'\nimport { embedResources } from './embed-resources'\nimport { toArray, isInstanceOfElement } from './util'\nimport { isDataUrl, resourceToDataURL } from './dataurl'\nimport { getMimeType } from './mimes'\n\nasync function embedProp(\n propName: string,\n node: HTMLElement,\n options: Options,\n) {\n const propValue = node.style?.getPropertyValue(propName)\n if (propValue) {\n const cssString = await embedResources(propValue, null, options)\n node.style.setProperty(\n propName,\n cssString,\n node.style.getPropertyPriority(propName),\n )\n return true\n }\n return false\n}\n\nasync function embedBackground(\n clonedNode: T,\n options: Options,\n) {\n if (!(await embedProp('background', clonedNode, options))) {\n await embedProp('background-image', clonedNode, options)\n }\n if (!(await embedProp('mask', clonedNode, options))) {\n await embedProp('mask-image', clonedNode, options)\n }\n}\n\nasync function embedImageNode(\n clonedNode: T,\n options: Options,\n) {\n const isImageElement = isInstanceOfElement(clonedNode, HTMLImageElement)\n\n if (\n !(isImageElement && !isDataUrl(clonedNode.src)) &&\n !(\n isInstanceOfElement(clonedNode, SVGImageElement) &&\n !isDataUrl(clonedNode.href.baseVal)\n )\n ) {\n return\n }\n\n const url = isImageElement ? clonedNode.src : clonedNode.href.baseVal\n\n const dataURL = await resourceToDataURL(url, getMimeType(url), options)\n await new Promise((resolve, reject) => {\n clonedNode.onload = resolve\n clonedNode.onerror = reject\n\n const image = clonedNode as HTMLImageElement\n if (image.decode) {\n image.decode = resolve as any\n }\n\n if (image.loading === 'lazy') {\n image.loading = 'eager'\n }\n\n if (isImageElement) {\n clonedNode.srcset = ''\n clonedNode.src = dataURL\n } else {\n clonedNode.href.baseVal = dataURL\n }\n })\n}\n\nasync function embedChildren(\n clonedNode: T,\n options: Options,\n) {\n const children = toArray(clonedNode.childNodes)\n const deferreds = children.map((child) => embedImages(child, options))\n await Promise.all(deferreds).then(() => clonedNode)\n}\n\nexport async function embedImages(\n clonedNode: T,\n options: Options,\n) {\n if (isInstanceOfElement(clonedNode, Element)) {\n await embedBackground(clonedNode, options)\n await embedImageNode(clonedNode, options)\n await embedChildren(clonedNode, options)\n }\n}\n","import { Options } from './types'\nimport { resolveUrl } from './util'\nimport { getMimeType } from './mimes'\nimport { isDataUrl, makeDataUrl, resourceToDataURL } from './dataurl'\n\nconst URL_REGEX = /url\\((['\"]?)([^'\"]+?)\\1\\)/g\nconst URL_WITH_FORMAT_REGEX = /url\\([^)]+\\)\\s*format\\(([\"']?)([^\"']+)\\1\\)/g\nconst FONT_SRC_REGEX = /src:\\s*(?:url\\([^)]+\\)\\s*format\\([^)]+\\)[,;]\\s*)+/g\n\nfunction toRegex(url: string): RegExp {\n // eslint-disable-next-line no-useless-escape\n const escaped = url.replace(/([.*+?^${}()|\\[\\]\\/\\\\])/g, '\\\\$1')\n return new RegExp(`(url\\\\(['\"]?)(${escaped})(['\"]?\\\\))`, 'g')\n}\n\nexport function parseURLs(cssText: string): string[] {\n const urls: string[] = []\n\n cssText.replace(URL_REGEX, (raw, quotation, url) => {\n urls.push(url)\n return raw\n })\n\n return urls.filter((url) => !isDataUrl(url))\n}\n\nexport async function embed(\n cssText: string,\n resourceURL: string,\n baseURL: string | null,\n options: Options,\n getContentFromUrl?: (url: string) => Promise,\n): Promise {\n try {\n const resolvedURL = baseURL ? resolveUrl(resourceURL, baseURL) : resourceURL\n const contentType = getMimeType(resourceURL)\n let dataURL: string\n if (getContentFromUrl) {\n const content = await getContentFromUrl(resolvedURL)\n dataURL = makeDataUrl(content, contentType)\n } else {\n dataURL = await resourceToDataURL(resolvedURL, contentType, options)\n }\n return cssText.replace(toRegex(resourceURL), `$1${dataURL}$3`)\n } catch (error) {\n // pass\n }\n return cssText\n}\n\nfunction filterPreferredFontFormat(\n str: string,\n { preferredFontFormat }: Options,\n): string {\n return !preferredFontFormat\n ? str\n : str.replace(FONT_SRC_REGEX, (match: string) => {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const [src, , format] = URL_WITH_FORMAT_REGEX.exec(match) || []\n if (!format) {\n return ''\n }\n\n if (format === preferredFontFormat) {\n return `src: ${src};`\n }\n }\n })\n}\n\nexport function shouldEmbed(url: string): boolean {\n return url.search(URL_REGEX) !== -1\n}\n\nexport async function embedResources(\n cssText: string,\n baseUrl: string | null,\n options: Options,\n): Promise {\n if (!shouldEmbed(cssText)) {\n return cssText\n }\n\n const filteredCSSText = filterPreferredFontFormat(cssText, options)\n const urls = parseURLs(filteredCSSText)\n return urls.reduce(\n (deferred, url) =>\n deferred.then((css) => embed(css, url, baseUrl, options)),\n Promise.resolve(filteredCSSText),\n )\n}\n","import type { Options } from './types'\nimport { toArray } from './util'\nimport { fetchAsDataURL } from './dataurl'\nimport { shouldEmbed, embedResources } from './embed-resources'\n\ninterface Metadata {\n url: string\n cssText: string\n}\n\nconst cssFetchCache: { [href: string]: Metadata } = {}\n\nasync function fetchCSS(url: string) {\n let cache = cssFetchCache[url]\n if (cache != null) {\n return cache\n }\n\n const res = await fetch(url)\n const cssText = await res.text()\n cache = { url, cssText }\n\n cssFetchCache[url] = cache\n\n return cache\n}\n\nasync function embedFonts(data: Metadata, options: Options): Promise {\n let cssText = data.cssText\n const regexUrl = /url\\([\"']?([^\"')]+)[\"']?\\)/g\n const fontLocs = cssText.match(/url\\([^)]+\\)/g) || []\n const loadFonts = fontLocs.map(async (loc: string) => {\n let url = loc.replace(regexUrl, '$1')\n if (!url.startsWith('https://')) {\n url = new URL(url, data.url).href\n }\n\n return fetchAsDataURL<[string, string]>(\n url,\n options.fetchRequestInit,\n ({ result }) => {\n cssText = cssText.replace(loc, `url(${result})`)\n return [loc, result]\n },\n )\n })\n\n return Promise.all(loadFonts).then(() => cssText)\n}\n\nfunction parseCSS(source: string) {\n if (source == null) {\n return []\n }\n\n const result: string[] = []\n const commentsRegex = /(\\/\\*[\\s\\S]*?\\*\\/)/gi\n // strip out comments\n let cssText = source.replace(commentsRegex, '')\n\n // eslint-disable-next-line prefer-regex-literals\n const keyframesRegex = new RegExp(\n '((@.*?keyframes [\\\\s\\\\S]*?){([\\\\s\\\\S]*?}\\\\s*?)})',\n 'gi',\n )\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const matches = keyframesRegex.exec(cssText)\n if (matches === null) {\n break\n }\n result.push(matches[0])\n }\n cssText = cssText.replace(keyframesRegex, '')\n\n const importRegex = /@import[\\s\\S]*?url\\([^)]*\\)[\\s\\S]*?;/gi\n // to match css & media queries together\n const combinedCSSRegex =\n '((\\\\s*?(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)?\\\\s*?@media[\\\\s\\\\S]' +\n '*?){([\\\\s\\\\S]*?)}\\\\s*?})|(([\\\\s\\\\S]*?){([\\\\s\\\\S]*?)})'\n // unified regex\n const unifiedRegex = new RegExp(combinedCSSRegex, 'gi')\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let matches = importRegex.exec(cssText)\n if (matches === null) {\n matches = unifiedRegex.exec(cssText)\n if (matches === null) {\n break\n } else {\n importRegex.lastIndex = unifiedRegex.lastIndex\n }\n } else {\n unifiedRegex.lastIndex = importRegex.lastIndex\n }\n result.push(matches[0])\n }\n\n return result\n}\n\nasync function getCSSRules(\n styleSheets: CSSStyleSheet[],\n options: Options,\n): Promise {\n const ret: CSSStyleRule[] = []\n const deferreds: Promise[] = []\n\n // First loop inlines imports\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item, index) => {\n if (item.type === CSSRule.IMPORT_RULE) {\n let importIndex = index + 1\n const url = (item as CSSImportRule).href\n const deferred = fetchCSS(url)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) =>\n parseCSS(cssText).forEach((rule) => {\n try {\n sheet.insertRule(\n rule,\n rule.startsWith('@import')\n ? (importIndex += 1)\n : sheet.cssRules.length,\n )\n } catch (error) {\n console.error('Error inserting rule from remote css', {\n rule,\n error,\n })\n }\n }),\n )\n .catch((e) => {\n console.error('Error loading remote css', e.toString())\n })\n\n deferreds.push(deferred)\n }\n })\n } catch (e) {\n const inline =\n styleSheets.find((a) => a.href == null) || document.styleSheets[0]\n if (sheet.href != null) {\n deferreds.push(\n fetchCSS(sheet.href)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) =>\n parseCSS(cssText).forEach((rule) => {\n inline.insertRule(rule, sheet.cssRules.length)\n }),\n )\n .catch((err: unknown) => {\n console.error('Error loading remote stylesheet', err)\n }),\n )\n }\n console.error('Error inlining remote css file', e)\n }\n }\n })\n\n return Promise.all(deferreds).then(() => {\n // Second loop parses rules\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item) => {\n ret.push(item)\n })\n } catch (e) {\n console.error(`Error while reading CSS rules from ${sheet.href}`, e)\n }\n }\n })\n\n return ret\n })\n}\n\nfunction getWebFontRules(cssRules: CSSStyleRule[]): CSSStyleRule[] {\n return cssRules\n .filter((rule) => rule.type === CSSRule.FONT_FACE_RULE)\n .filter((rule) => shouldEmbed(rule.style.getPropertyValue('src')))\n}\n\nasync function parseWebFontRules(\n node: T,\n options: Options,\n) {\n if (node.ownerDocument == null) {\n throw new Error('Provided element is not within a Document')\n }\n\n const styleSheets = toArray(node.ownerDocument.styleSheets)\n const cssRules = await getCSSRules(styleSheets, options)\n\n return getWebFontRules(cssRules)\n}\n\nexport async function getWebFontCSS(\n node: T,\n options: Options,\n): Promise {\n const rules = await parseWebFontRules(node, options)\n const cssTexts = await Promise.all(\n rules.map((rule) => {\n const baseUrl = rule.parentStyleSheet ? rule.parentStyleSheet.href : null\n return embedResources(rule.cssText, baseUrl, options)\n }),\n )\n\n return cssTexts.join('\\n')\n}\n\nexport async function embedWebFonts(\n clonedNode: T,\n options: Options,\n) {\n const cssText =\n options.fontEmbedCSS != null\n ? options.fontEmbedCSS\n : options.skipFonts\n ? null\n : await getWebFontCSS(clonedNode, options)\n\n if (cssText) {\n const styleNode = document.createElement('style')\n const sytleContent = document.createTextNode(cssText)\n\n styleNode.appendChild(sytleContent)\n\n if (clonedNode.firstChild) {\n clonedNode.insertBefore(styleNode, clonedNode.firstChild)\n } else {\n clonedNode.appendChild(styleNode)\n }\n }\n}\n","import { Options } from './types'\nimport { cloneNode } from './clone-node'\nimport { embedImages } from './embed-images'\nimport { applyStyle } from './apply-style'\nimport { embedWebFonts, getWebFontCSS } from './embed-webfonts'\nimport {\n getImageSize,\n getPixelRatio,\n createImage,\n canvasToBlob,\n nodeToDataURL,\n checkCanvasDimensions,\n} from './util'\n\nexport async function toSvg(\n node: T,\n options: Options = {},\n): Promise {\n const { width, height } = getImageSize(node, options)\n const clonedNode = (await cloneNode(node, options, true)) as HTMLElement\n await embedWebFonts(clonedNode, options)\n await embedImages(clonedNode, options)\n applyStyle(clonedNode, options)\n const datauri = await nodeToDataURL(clonedNode, width, height)\n return datauri\n}\n\nexport async function toCanvas(\n node: T,\n options: Options = {},\n): Promise {\n const { width, height } = getImageSize(node, options)\n const svg = await toSvg(node, options)\n const img = await createImage(svg)\n\n const canvas = document.createElement('canvas')\n const context = canvas.getContext('2d')!\n const ratio = options.pixelRatio || getPixelRatio()\n const canvasWidth = options.canvasWidth || width\n const canvasHeight = options.canvasHeight || height\n\n canvas.width = canvasWidth * ratio\n canvas.height = canvasHeight * ratio\n\n if (!options.skipAutoScale) {\n checkCanvasDimensions(canvas)\n }\n canvas.style.width = `${canvasWidth}`\n canvas.style.height = `${canvasHeight}`\n\n if (options.backgroundColor) {\n context.fillStyle = options.backgroundColor\n context.fillRect(0, 0, canvas.width, canvas.height)\n }\n\n context.drawImage(img, 0, 0, canvas.width, canvas.height)\n\n return canvas\n}\n\nexport async function toPixelData(\n node: T,\n options: Options = {},\n): Promise {\n const { width, height } = getImageSize(node, options)\n const canvas = await toCanvas(node, options)\n const ctx = canvas.getContext('2d')!\n return ctx.getImageData(0, 0, width, height).data\n}\n\nexport async function toPng(\n node: T,\n options: Options = {},\n): Promise {\n const canvas = await toCanvas(node, options)\n return canvas.toDataURL()\n}\n\nexport async function toJpeg(\n node: T,\n options: Options = {},\n): Promise {\n const canvas = await toCanvas(node, options)\n return canvas.toDataURL('image/jpeg', options.quality || 1)\n}\n\nexport async function toBlob(\n node: T,\n options: Options = {},\n): Promise {\n const canvas = await toCanvas(node, options)\n const blob = await canvasToBlob(canvas)\n return blob\n}\n\nexport async function getFontEmbedCSS(\n node: T,\n options: Options = {},\n): Promise {\n return getWebFontCSS(node, options)\n}\n","const WOFF = 'application/font-woff'\nconst JPEG = 'image/jpeg'\nconst mimes: { [key: string]: string } = {\n woff: WOFF,\n woff2: WOFF,\n ttf: 'application/font-truetype',\n eot: 'application/vnd.ms-fontobject',\n png: 'image/png',\n jpg: JPEG,\n jpeg: JPEG,\n gif: 'image/gif',\n tiff: 'image/tiff',\n svg: 'image/svg+xml',\n webp: 'image/webp',\n}\n\nfunction getExtension(url: string): string {\n const match = /\\.([^./]*?)$/g.exec(url)\n return match ? match[1] : ''\n}\n\nexport function getMimeType(url: string): string {\n const extension = getExtension(url).toLowerCase()\n return mimes[extension] || ''\n}\n","import type { Options } from './types'\n\nexport function resolveUrl(url: string, baseUrl: string | null): string {\n // url is absolute already\n if (url.match(/^[a-z]+:\\/\\//i)) {\n return url\n }\n\n // url is absolute already, without protocol\n if (url.match(/^\\/\\//)) {\n return window.location.protocol + url\n }\n\n // dataURI, mailto:, tel:, etc.\n if (url.match(/^[a-z]+:/i)) {\n return url\n }\n\n const doc = document.implementation.createHTMLDocument()\n const base = doc.createElement('base')\n const a = doc.createElement('a')\n\n doc.head.appendChild(base)\n doc.body.appendChild(a)\n\n if (baseUrl) {\n base.href = baseUrl\n }\n\n a.href = url\n\n return a.href\n}\n\nexport const uuid = (() => {\n // generate uuid for className of pseudo elements.\n // We should not use GUIDs, otherwise pseudo elements sometimes cannot be captured.\n let counter = 0\n\n // ref: http://stackoverflow.com/a/6248722/2519373\n const random = () =>\n // eslint-disable-next-line no-bitwise\n `0000${((Math.random() * 36 ** 4) << 0).toString(36)}`.slice(-4)\n\n return () => {\n counter += 1\n return `u${random()}${counter}`\n }\n})()\n\nexport function delay(ms: number) {\n return (args: T) =>\n new Promise((resolve) => {\n setTimeout(() => resolve(args), ms)\n })\n}\n\nexport function toArray(arrayLike: any): T[] {\n const arr: T[] = []\n\n for (let i = 0, l = arrayLike.length; i < l; i++) {\n arr.push(arrayLike[i])\n }\n\n return arr\n}\n\nfunction px(node: HTMLElement, styleProperty: string) {\n const win = node.ownerDocument.defaultView || window\n const val = win.getComputedStyle(node).getPropertyValue(styleProperty)\n return val ? parseFloat(val.replace('px', '')) : 0\n}\n\nfunction getNodeWidth(node: HTMLElement) {\n const leftBorder = px(node, 'border-left-width')\n const rightBorder = px(node, 'border-right-width')\n return node.clientWidth + leftBorder + rightBorder\n}\n\nfunction getNodeHeight(node: HTMLElement) {\n const topBorder = px(node, 'border-top-width')\n const bottomBorder = px(node, 'border-bottom-width')\n return node.clientHeight + topBorder + bottomBorder\n}\n\nexport function getImageSize(targetNode: HTMLElement, options: Options = {}) {\n const width = options.width || getNodeWidth(targetNode)\n const height = options.height || getNodeHeight(targetNode)\n\n return { width, height }\n}\n\nexport function getPixelRatio() {\n let ratio\n\n let FINAL_PROCESS\n try {\n FINAL_PROCESS = process\n } catch (e) {\n // pass\n }\n\n const val =\n FINAL_PROCESS && FINAL_PROCESS.env\n ? FINAL_PROCESS.env.devicePixelRatio\n : null\n if (val) {\n ratio = parseInt(val, 10)\n if (Number.isNaN(ratio)) {\n ratio = 1\n }\n }\n return ratio || window.devicePixelRatio || 1\n}\n\n// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size\nconst canvasDimensionLimit = 16384\n\nexport function checkCanvasDimensions(canvas: HTMLCanvasElement) {\n if (\n canvas.width > canvasDimensionLimit ||\n canvas.height > canvasDimensionLimit\n ) {\n if (\n canvas.width > canvasDimensionLimit &&\n canvas.height > canvasDimensionLimit\n ) {\n if (canvas.width > canvas.height) {\n canvas.height *= canvasDimensionLimit / canvas.width\n canvas.width = canvasDimensionLimit\n } else {\n canvas.width *= canvasDimensionLimit / canvas.height\n canvas.height = canvasDimensionLimit\n }\n } else if (canvas.width > canvasDimensionLimit) {\n canvas.height *= canvasDimensionLimit / canvas.width\n canvas.width = canvasDimensionLimit\n } else {\n canvas.width *= canvasDimensionLimit / canvas.height\n canvas.height = canvasDimensionLimit\n }\n }\n}\n\nexport function canvasToBlob(\n canvas: HTMLCanvasElement,\n options: Options = {},\n): Promise {\n if (canvas.toBlob) {\n return new Promise((resolve) => {\n canvas.toBlob(\n resolve,\n options.type ? options.type : 'image/png',\n options.quality ? options.quality : 1,\n )\n })\n }\n\n return new Promise((resolve) => {\n const binaryString = window.atob(\n canvas\n .toDataURL(\n options.type ? options.type : undefined,\n options.quality ? options.quality : undefined,\n )\n .split(',')[1],\n )\n const len = binaryString.length\n const binaryArray = new Uint8Array(len)\n\n for (let i = 0; i < len; i += 1) {\n binaryArray[i] = binaryString.charCodeAt(i)\n }\n\n resolve(\n new Blob([binaryArray], {\n type: options.type ? options.type : 'image/png',\n }),\n )\n })\n}\n\nexport function createImage(url: string): Promise {\n return new Promise((resolve, reject) => {\n const img = new Image()\n img.decode = () => resolve(img) as any\n img.onload = () => resolve(img)\n img.onerror = reject\n img.crossOrigin = 'anonymous'\n img.decoding = 'async'\n img.src = url\n })\n}\n\nexport async function svgToDataURL(svg: SVGElement): Promise {\n return Promise.resolve()\n .then(() => new XMLSerializer().serializeToString(svg))\n .then(encodeURIComponent)\n .then((html) => `data:image/svg+xml;charset=utf-8,${html}`)\n}\n\nexport async function nodeToDataURL(\n node: HTMLElement,\n width: number,\n height: number,\n): Promise {\n const xmlns = 'http://www.w3.org/2000/svg'\n const svg = document.createElementNS(xmlns, 'svg')\n const foreignObject = document.createElementNS(xmlns, 'foreignObject')\n\n svg.setAttribute('width', `${width}`)\n svg.setAttribute('height', `${height}`)\n svg.setAttribute('viewBox', `0 0 ${width} ${height}`)\n\n foreignObject.setAttribute('width', '100%')\n foreignObject.setAttribute('height', '100%')\n foreignObject.setAttribute('x', '0')\n foreignObject.setAttribute('y', '0')\n foreignObject.setAttribute('externalResourcesRequired', 'true')\n\n svg.appendChild(foreignObject)\n foreignObject.appendChild(node)\n return svgToDataURL(svg)\n}\n\nexport const isInstanceOfElement = <\n T extends typeof Element | typeof HTMLElement | typeof SVGImageElement,\n>(\n node: Element | HTMLElement | SVGImageElement,\n instance: T,\n): node is T['prototype'] => {\n if (node instanceof instance) return true\n\n const nodePrototype = Object.getPrototypeOf(node)\n\n if (nodePrototype === null) return false\n\n return (\n nodePrototype.constructor.name === instance.name ||\n isInstanceOfElement(nodePrototype, instance)\n )\n}\n","//! moment.js locale configuration\n//! locale : Romanian [ro]\n//! author : Vlad Gurdiga : https://github.com/gurdiga\n//! author : Valentin Agachi : https://github.com/avaly\n//! author : Emanuel Cepoi : https://github.com/cepem\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n function relativeTimeWithPlural(number, withoutSuffix, key) {\n var format = {\n ss: 'secunde',\n mm: 'minute',\n hh: 'ore',\n dd: 'zile',\n ww: 'săptămâni',\n MM: 'luni',\n yy: 'ani',\n },\n separator = ' ';\n if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {\n separator = ' de ';\n }\n return number + separator + format[key];\n }\n\n var ro = moment.defineLocale('ro', {\n months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(\n '_'\n ),\n monthsShort:\n 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),\n weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),\n weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY H:mm',\n LLLL: 'dddd, D MMMM YYYY H:mm',\n },\n calendar: {\n sameDay: '[azi la] LT',\n nextDay: '[mâine la] LT',\n nextWeek: 'dddd [la] LT',\n lastDay: '[ieri la] LT',\n lastWeek: '[fosta] dddd [la] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'peste %s',\n past: '%s în urmă',\n s: 'câteva secunde',\n ss: relativeTimeWithPlural,\n m: 'un minut',\n mm: relativeTimeWithPlural,\n h: 'o oră',\n hh: relativeTimeWithPlural,\n d: 'o zi',\n dd: relativeTimeWithPlural,\n w: 'o săptămână',\n ww: relativeTimeWithPlural,\n M: 'o lună',\n MM: relativeTimeWithPlural,\n y: 'un an',\n yy: relativeTimeWithPlural,\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7, // The week that contains Jan 7th is the first week of the year.\n },\n });\n\n return ro;\n\n})));\n","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { invariantIntlContext } from '../utils';\nfunction getDisplayName(Component) {\n return Component.displayName || Component.name || 'Component';\n}\n// TODO: We should provide initial value here\nvar IntlContext = React.createContext(null);\nvar IntlConsumer = IntlContext.Consumer, IntlProvider = IntlContext.Provider;\nexport var Provider = IntlProvider;\nexport var Context = IntlContext;\nexport default function injectIntl(WrappedComponent, options) {\n var _a = options || {}, _b = _a.intlPropName, intlPropName = _b === void 0 ? 'intl' : _b, _c = _a.forwardRef, forwardRef = _c === void 0 ? false : _c, _d = _a.enforceContext, enforceContext = _d === void 0 ? true : _d;\n var WithIntl = function (props) { return (React.createElement(IntlConsumer, null, function (intl) {\n var _a;\n if (enforceContext) {\n invariantIntlContext(intl);\n }\n var intlProp = (_a = {}, _a[intlPropName] = intl, _a);\n return (React.createElement(WrappedComponent, __assign({}, props, intlProp, { ref: forwardRef ? props.forwardedRef : null })));\n })); };\n WithIntl.displayName = \"injectIntl(\".concat(getDisplayName(WrappedComponent), \")\");\n WithIntl.WrappedComponent = WrappedComponent;\n if (forwardRef) {\n return hoistNonReactStatics(React.forwardRef(function (props, ref) { return (React.createElement(WithIntl, __assign({}, props, { forwardedRef: ref }))); }), WrappedComponent);\n }\n return hoistNonReactStatics(WithIntl, WrappedComponent);\n}\n","import * as React from 'react';\nimport { Context } from './injectIntl';\nimport { invariantIntlContext } from '../utils';\nexport default function useIntl() {\n var intl = React.useContext(Context);\n invariantIntlContext(intl);\n return intl;\n}\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.CNP = void 0;\r\nvar moment = require(\"moment/moment\");\r\nvar controlKey = [2, 7, 9, 1, 4, 6, 3, 5, 8, 2, 7, 9];\r\nvar countyCode = {\r\n '01': 'Alba',\r\n '02': 'Arad',\r\n '03': 'Argeș',\r\n '04': 'Bacău',\r\n '05': 'Bihor',\r\n '06': 'Bistrița-Năsăud',\r\n '07': 'Botoșani',\r\n '08': 'Brașov',\r\n '09': 'Brăila',\r\n '10': 'Buzău',\r\n '11': 'Caraș-Severin',\r\n '12': 'Cluj',\r\n '13': 'Constanța',\r\n '14': 'Covasna',\r\n '15': 'Dambovița',\r\n '16': 'Dolj',\r\n '17': 'Galați',\r\n '18': 'Gorj',\r\n '19': 'Harghita',\r\n '20': 'Hunedoara',\r\n '21': 'Ialomița',\r\n '22': 'Iași',\r\n '23': 'Ilfov',\r\n '24': 'Maramureș',\r\n '25': 'Mehedinți',\r\n '26': 'Mureș',\r\n '27': 'Neamț',\r\n '28': 'Olt',\r\n '29': 'Prahova',\r\n '30': 'Satu Mare',\r\n '31': 'Sălaj',\r\n '32': 'Sibiu',\r\n '33': 'Suceava',\r\n '34': 'Teleorman',\r\n '35': 'Timiș',\r\n '36': 'Tulcea',\r\n '37': 'Vaslui',\r\n '38': 'Vâlcea',\r\n '39': 'Vrancea',\r\n '40': 'București',\r\n '41': 'București - Sector 1',\r\n '42': 'București - Sector 2',\r\n '43': 'București - Sector 3',\r\n '44': 'București - Sector 4',\r\n '45': 'București - Sector 5',\r\n '46': 'București - Sector 6',\r\n '51': 'Calarași',\r\n '52': 'Giurgiu',\r\n '47': 'București - Sector 7(desfiintat)',\r\n '48': 'București - Sector 8(desfiintat)',\r\n '80': 'CNP obtinut in strainate',\r\n};\r\n/**\r\n * Class CNP - Validation for Romanian Social Security Number (CNP)\r\n *\r\n * Valid format: (string of 13 numbers:\r\n * |S|YY|MM|DD|CC|XXX|C|\r\n * where :\r\n * |S| - Gender number (Male/Women) for:\r\n * 1/2 - romanian citizen born between 1900.01.01 and 1999.12.31\r\n * 3/4 - romanian citizen born between 1800.01.01 and 1899.12.31\r\n * 5/6 - romanian citizen born between 2000.01.01 and 2099.12.31\r\n * 7/8 - residents\r\n * 9 - people with foreign citizenship\r\n *\r\n * |YY| - year of birth - 00 - 99 - [are valid years only the range 1800-2099]\r\n * |MM| - birth month - 01 - 12\r\n * |DD| - birthday - 01 - 28/29/30/31\r\n * |CC| - county code - for a valid value check CNP::$countyCode\r\n * |XXX|- the serial number assigned to the person - 000 - 999\r\n * |C| - check Digit\r\n *\r\n * @see https://ro.wikipedia.org/wiki/Cod_numeric_personal\r\n * @author Niku Alcea \r\n *\r\n * How to install it?\r\n *\r\n * ```\r\n * npm i --save romanian-personal-identity-code-validator\r\n * ```\r\n *\r\n * How to use it?\r\n *\r\n * ```js\r\n * let cnp = new CNP('123');\r\n * // or use a setter\r\n * cnp.cnp = '1234';\r\n *\r\n * if (cnp.isValid()) {\r\n * // extract information from an valid CNP\r\n * console.log(cnp.getBirthDate()); // default format 'YYYY-MM-DD'\r\n * console.log(cnp.getBirthDate('YYYY')); // or only the year\r\n * console.log(cnp.getBirthPlace());\r\n * console.log(cnp.getGender()); // default male | female\r\n * console.log(cnp.getGender('M', 'F')); // or set a custom value M | F\r\n * console.log(cnp.hasIdentityCard()); // if the age is grater than 14 years\r\n * console.log(cnp.getSerialNumberFromCNP());\r\n * }\r\n *\r\n * ```\r\n * @classdesc - Atention class validate if CNP format if valid! Class can return true evan that CNP do not exist!\r\n * eg: 6990504015905 is valid but this CNP do not exist in reality (date of birth for this CNP is 2099-05-04)!\r\n */\r\nvar CNP = /** @class */ (function () {\r\n function CNP(cnp) {\r\n if (cnp === void 0) { cnp = ''; }\r\n this._cnpArray = [];\r\n this._isValid = false;\r\n this._year = 0;\r\n this._month = '';\r\n this._day = '';\r\n this._cc = '';\r\n this.init(cnp);\r\n }\r\n Object.defineProperty(CNP.prototype, \"cnp\", {\r\n get: function () {\r\n if (!this._isValid) {\r\n return 'Invalid CNP';\r\n }\r\n return this._cnpArray.join('');\r\n },\r\n set: function (cnp) {\r\n this.init(cnp);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n CNP.prototype.isValid = function () {\r\n return this._isValid;\r\n };\r\n CNP.prototype.getBirthDate = function (format) {\r\n if (format === void 0) { format = 'YYYY-MM-DD'; }\r\n if (!this._isValid) {\r\n return 'Invalid date';\r\n }\r\n return moment(this.dateInput()).format(format);\r\n };\r\n CNP.prototype.getBirthPlace = function () {\r\n if (!this._isValid) {\r\n return null;\r\n }\r\n return countyCode[this._cc];\r\n };\r\n CNP.prototype.getGender = function (m, f) {\r\n if (m === void 0) { m = 'male'; }\r\n if (f === void 0) { f = 'female'; }\r\n var gender = '';\r\n if (this._isValid) {\r\n if ([1, 3, 5, 7].indexOf(this._cnpArray[0]) !== -1) {\r\n gender = m;\r\n }\r\n if ([2, 4, 6, 8].indexOf(this._cnpArray[0]) !== -1) {\r\n gender = f;\r\n }\r\n }\r\n return gender;\r\n };\r\n CNP.prototype.hasIdentityCard = function () {\r\n if (!this._isValid) {\r\n return false;\r\n }\r\n var birthDate = moment(this.dateInput(), 'YYYY-MM-DD');\r\n return Math.floor(moment(new Date()).diff(birthDate, 'years', true)) > 14;\r\n };\r\n CNP.prototype.getSerialNumberFromCNP = function () {\r\n return this._isValid ? \"\" + this._cnpArray[9] + this._cnpArray[10] + this._cnpArray[11] : '';\r\n };\r\n CNP.prototype.init = function (cnp) {\r\n if (cnp.length !== 13) {\r\n this._isValid = false;\r\n }\r\n else {\r\n this._cnpArray = cnp\r\n .split('')\r\n .map(function (x) {\r\n return parseInt(x, 10);\r\n })\r\n .filter(function (x) { return !Number.isNaN(x); });\r\n this._isValid = this.validateCnp();\r\n }\r\n };\r\n CNP.prototype.validateCnp = function () {\r\n this.setYear();\r\n this.setMonth();\r\n this.setDay();\r\n this.setCounty();\r\n return this.checkDate() && this.checkCounty() && this.checkHash();\r\n };\r\n CNP.prototype.checkDate = function () {\r\n var format = 'YYYY-MM-DD';\r\n var date = moment(this.dateInput(), format, true);\r\n var min = moment('1800-01-01', format);\r\n var max = moment('2099-12-31', format);\r\n return date.isValid() && date.isBetween(min, max);\r\n };\r\n CNP.prototype.checkCounty = function () {\r\n return countyCode.hasOwnProperty(this._cc);\r\n };\r\n CNP.prototype.checkHash = function () {\r\n var hashSum = 0;\r\n for (var i = 0; i < 12; i++) {\r\n hashSum += this._cnpArray[i] * controlKey[i];\r\n }\r\n hashSum = hashSum % 11;\r\n if (hashSum === 10) {\r\n hashSum = 1;\r\n }\r\n return hashSum === this._cnpArray[12];\r\n };\r\n CNP.prototype.setYear = function () {\r\n this._year = 0;\r\n var year = this._cnpArray[1] * 10 + this._cnpArray[2];\r\n switch (this._cnpArray[0]) {\r\n // romanian citizen born between 1900.01.01 and 1999.12.31\r\n case 1:\r\n case 2:\r\n this._year = year + 1900;\r\n break;\r\n // romanian citizen born between 1800.01.01 and 1899.12.31\r\n case 3:\r\n case 4:\r\n this._year = year + 1800;\r\n break;\r\n // romanian citizen born between 2000.01.01 and 2099.12.31\r\n case 5:\r\n case 6:\r\n this._year = year + 2000;\r\n break;\r\n // residents (7&8) && people with foreign citizenship (9)\r\n case 7:\r\n case 8:\r\n case 9:\r\n this._year = year + 2000;\r\n if (year > +moment().format('YY')) {\r\n this._year -= 100;\r\n }\r\n break;\r\n }\r\n };\r\n CNP.prototype.setMonth = function () {\r\n this._month = \"\" + this._cnpArray[3] + this._cnpArray[4];\r\n };\r\n CNP.prototype.setDay = function () {\r\n this._day = \"\" + this._cnpArray[5] + this._cnpArray[6];\r\n };\r\n CNP.prototype.setCounty = function () {\r\n this._cc = \"\" + this._cnpArray[7] + this._cnpArray[8];\r\n };\r\n CNP.prototype.dateInput = function () {\r\n return this._year + \"-\" + this._month + \"-\" + this._day;\r\n };\r\n return CNP;\r\n}());\r\nexports.CNP = CNP;\r\n","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}"],"names":["u8","Uint8Array","u16","Uint16Array","u32","Uint32Array","fleb","fdeb","clim","freb","eb","start","b","i","r","j","_a","fl","revfl","_b","fd","revfd","rev","x","hMap","cd","mb","s","length","l","co","le","rvb","sv","r_1","v","m","flt","fdt","flm","flrm","fdm","fdrm","max","a","bits","d","p","o","bits16","shft","slc","e","n","set","subarray","inflt","dat","buf","st","sl","noBuf","noSt","cbuf","bl","nbuf","Math","final","f","pos","bt","lm","dm","lbt","dbt","tbts","type","t","hLit","hcLen","tl","ldt","clt","clb","clbmsk","clm","c","lt","dt","lms","dms","mxa","sym","add","dsym","end","wbits","wbits16","hTree","push","t2","slice","sort","i0","i1","i2","maxSym","tr","mbt","ln","lft","cst","i2_1","i2_2","i2_3","lc","cl","cli","cln","cls","w","clen","cf","wfblk","out","wblk","syms","lf","df","li","bs","dlt","mlb","ddt","mdb","_c","lclt","nlc","_d","lcdt","ndc","lcfreq","_e","lct","mlcb","nlcc","ll","dl","flen","ftlen","dtlen","llm","lcts","it","clct","len","dst","deo","et","adler","min","dopt","opt","pre","post","lvl","plvl","lst","floor","msk_1","prev","head","bs1_1","ceil","bs2_1","hsh","lc_1","wi","hv","imod","pimod","rem","ch_1","dif","maxn","maxd","ml","nl","mmd","md","ti","lin","din","dflt","level","mem","log","wbytes","zlh","lv","zlv","zlibSync","data","opts","unzlibSync","make","lefts","focus","rights","fromNonEmptyArray","nea","identity","applyStyle","node","options","style","backgroundColor","width","concat","height","manual","Object","keys","forEach","key","isSlotElement","tagName","toUpperCase","async","cloneNode","isRoot","filter","Promise","resolve","then","clonedNode","isInstanceOfElement","HTMLCanvasElement","canvas","dataURL","toDataURL","createImage","cloneCanvasElement","HTMLVideoElement","video","currentSrc","document","createElement","ctx","getContext","clientWidth","clientHeight","drawImage","poster","contentType","getMimeType","resourceToDataURL","cloneVideoElement","HTMLIFrameElement","iframe","contentDocument","body","cloneIFrameElement","cloneSingleNode","nativeNode","children","assignedNodes","toArray","childNodes","shadowRoot","reduce","deferred","child","clonedChild","appendChild","cloneChildren","Element","targetStyle","sourceStyle","window","getComputedStyle","cssText","transformOrigin","name","value","getPropertyValue","endsWith","reducedFont","parseFloat","substring","getAttribute","setProperty","getPropertyPriority","cloneCSSStyle","clonePseudoElements","HTMLTextAreaElement","innerHTML","HTMLInputElement","setAttribute","cloneInputValue","HTMLSelectElement","clonedSelect","selectedOption","Array","from","find","cloneSelectValue","decorate","clone","uses","querySelectorAll","processedDefs","id","exist","querySelector","definition","nodes","values","ns","svg","createElementNS","position","overflow","display","defs","ensureSVGSymbols","clonePseudoElement","pseudo","content","className","uuid","err","styleElement","selector","replace","formatCSSText","map","priority","join","formatCSSProperties","createTextNode","getPseudoElementStyle","isDataUrl","url","search","makeDataUrl","mimeType","fetchAsDataURL","init","process","res","fetch","status","Error","blob","reject","reader","FileReader","onerror","onloadend","result","error","readAsDataURL","cache","resourceUrl","cacheKey","includeQueryParams","test","getCacheKey","cacheBust","Date","getTime","fetchRequestInit","_ref","headers","get","split","getContentFromDataUrl","imagePlaceholder","msg","message","console","warn","embedProp","propName","propValue","cssString","embedResources","embedImages","embedBackground","isImageElement","HTMLImageElement","src","SVGImageElement","href","baseVal","onload","image","decode","loading","srcset","embedImageNode","deferreds","all","embedChildren","URL_REGEX","URL_WITH_FORMAT_REGEX","FONT_SRC_REGEX","shouldEmbed","baseUrl","filteredCSSText","str","preferredFontFormat","match","format","exec","filterPreferredFontFormat","urls","raw","quotation","parseURLs","css","resourceURL","baseURL","getContentFromUrl","resolvedURL","resolveUrl","escaped","RegExp","toRegex","embed","cssFetchCache","fetchCSS","text","embedFonts","regexUrl","loadFonts","loc","startsWith","URL","parseCSS","source","keyframesRegex","matches","importRegex","unifiedRegex","lastIndex","embedWebFonts","fontEmbedCSS","skipFonts","rules","ownerDocument","styleSheets","cssRules","ret","sheet","item","index","CSSRule","IMPORT_RULE","importIndex","metadata","rule","insertRule","catch","toString","inline","getCSSRules","FONT_FACE_RULE","getWebFontRules","parseWebFontRules","parentStyleSheet","getWebFontCSS","styleNode","sytleContent","firstChild","insertBefore","toSvg","arguments","undefined","getImageSize","nodeToDataURL","toCanvas","img","context","ratio","pixelRatio","getPixelRatio","canvasWidth","canvasHeight","skipAutoScale","checkCanvasDimensions","fillStyle","fillRect","WOFF","JPEG","mimes","woff","woff2","ttf","eot","png","jpg","jpeg","gif","tiff","webp","extension","getExtension","toLowerCase","location","protocol","doc","implementation","createHTMLDocument","base","counter","random","arrayLike","arr","px","styleProperty","val","defaultView","targetNode","leftBorder","rightBorder","getNodeWidth","topBorder","bottomBorder","getNodeHeight","FINAL_PROCESS","env","devicePixelRatio","parseInt","Number","isNaN","canvasDimensionLimit","Image","crossOrigin","decoding","xmlns","foreignObject","XMLSerializer","serializeToString","encodeURIComponent","html","svgToDataURL","instance","nodePrototype","getPrototypeOf","constructor","moment","relativeTimeWithPlural","number","withoutSuffix","separator","ss","mm","hh","dd","ww","MM","yy","defineLocale","months","monthsShort","monthsParseExact","weekdays","weekdaysShort","weekdaysMin","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","h","M","y","week","dow","doy","factory","require","IntlContext","React","Provider","Consumer","Context","useIntl","intl","invariantIntlContext","exports","controlKey","countyCode","CNP","cnp","this","_cnpArray","_isValid","_year","_month","_day","_cc","defineProperty","prototype","enumerable","configurable","isValid","getBirthDate","dateInput","getBirthPlace","getGender","gender","indexOf","hasIdentityCard","birthDate","diff","getSerialNumberFromCNP","validateCnp","setYear","setMonth","setDay","setCounty","checkDate","checkCounty","checkHash","date","isBetween","hasOwnProperty","hashSum","year","_typeof","Symbol","iterator"],"sourceRoot":""}