UNPKG

@easyflow/pixel

Version:

Easyflow client-side pixel SDK

1,095 lines 93.8 kB
var Qn = Object.defineProperty; var ea = (e, n, t) => n in e ? Qn(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t; var Z = (e, n, t) => ea(e, typeof n != "symbol" ? n + "" : n, t); var R = /* @__PURE__ */ ((e) => (e.CHECKOUT_INITIALIZED = "checkout-initialized", e.PURCHASE_COMPLETED = "purchase-completed", e.PURCHASE_FAILED = "purchase-failed", e.PURCHASE_BTN_CLICKED = "purchase-btn-clicked", e.PIX_SELECTED = "pix-selected", e.PIX_GENERATED = "pix-generated", e.PIX_EXPIRED = "pix-expired", e.PIX_COPIED = "pix-copied", e.CREDIT_CARD_SELECTED = "credit-card-selected", e.CREDIT_CARD_FORM_COMPLETED = "credit-card-form-completed", e.BANK_BILLET_SELECTED = "bank-slip-selected", e.BANK_BILLET_GENERATED = "bank-slip-form-completed", e.ADDRESS_FORM_COMPLETED = "address-form-completed", e.DELIVERY_ADDRESS_COMPLETED = "delivery-address-completed", e.COUPON_ADDED = "coupon-added", e.COUPON_BOX_CLICKED = "coupon-box-clicked", e.COUPON_FORM_COMPLETED = "coupon-form-completed", e.COUPON_APPLY_FAILED = "coupon-apply-failed", e.USER_FORM_COMPLETED = "user-form-completed", e.PRE_CHECKOUT_FORM_COMPLETED = "pre-checkout-form-completed", e))(R || {}); const ee = { UTM: "__easyflow_utms", SESSION_ID: "__easyflow_session_id", FINGERPRINT_ID: "__easyflow_fingerprint_id", EXTRAS_ID: "__easyflow_extras" }; function ta(e) { localStorage.setItem(ee.FINGERPRINT_ID, e); } function na() { try { return localStorage.getItem(ee.FINGERPRINT_ID); } catch { return null; } } function aa() { const e = performance.timing, n = {}; for (const t in e) { const a = e[t]; typeof a == "number" && (n[t] = a); } return n; } function ia() { return new Promise((e) => { const n = window.webkitRequestFileSystem; if (!n) return e(!1); n( window.TEMPORARY, 100, () => e(!1), () => e(!0) ); }); } function ra() { return new Promise((e) => { const n = document.createElement("div"); n.className = "adsbox", n.style.height = "1px", document.body.appendChild(n), setTimeout(() => { const t = n.offsetHeight === 0; document.body.removeChild(n), e(t); }, 100); }); } async function oa() { try { const [e, n] = await Promise.all([ ia(), ra() ]), t = { cookiesEnabled: navigator.cookieEnabled, doNotTrackEnable: navigator.doNotTrack === "1" || window.doNotTrack === "1", incognitoMode: e, adblockDetected: n }; localStorage.setItem(ee.EXTRAS_ID, JSON.stringify(t)); } catch (e) { console.error("Error saving extras to localStorage", e); } } function la() { const e = localStorage.getItem(ee.EXTRAS_ID); return e ? JSON.parse(e) : {}; } function fa() { var t; const e = new URLSearchParams(window.location.search), n = (a) => { const r = document.cookie.match(new RegExp("(^| )" + a + "=([^;]+)")); return r ? r[2] : void 0; }; return { session_id: localStorage.getItem(ee.SESSION_ID) || void 0, fingerprint_id: na() || void 0, fbp: n("_fbp"), fbc: n("_fbc"), gclid: e.get("gclid"), ttclid: e.get("ttclid"), user_agent: navigator.userAgent, language: navigator.language, platform: navigator.platform, screen_resolution: `${window.screen.width}x${window.screen.height}`, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, current_url: window.location.href, referer: document.referrer, document_title: document.title, cookies_enabled: navigator.cookieEnabled, hardware_concurrency: navigator.hardwareConcurrency, device_memory: navigator.deviceMemory, touch_support: "ontouchstart" in window || navigator.maxTouchPoints > 0, timestamp_client: (/* @__PURE__ */ new Date()).toISOString(), page_visibility: document.visibilityState, load_time_ms: (t = performance.timing) != null && t.loadEventEnd ? performance.timing.loadEventEnd - performance.timing.navigationStart : void 0 }; } const sa = [ "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content" ]; function _a() { try { const e = localStorage.getItem(ee.UTM); return e ? JSON.parse(e) : {}; } catch { return {}; } } function da() { const e = new URLSearchParams(window.location.search); if (!localStorage.getItem(ee.UTM)) { const t = {}; sa.forEach((a) => { const r = e.get(a); r && (t[a] = r); }), Object.keys(t).length > 0 && localStorage.setItem(ee.UTM, JSON.stringify(t)); } } function ca(e) { if (window.fbq) return; (function(t, a, r, i) { var o; if (t.fbq) return; const f = t.fbq = function() { f.callMethod ? f.callMethod.apply(f, arguments) : f.queue.push(arguments); }; t._fbq || (t._fbq = f), f.push = f, f.loaded = !0, f.version = "2.0", f.queue = []; const l = a.createElement(r); l.async = !0, l.src = i; const c = a.getElementsByTagName(r)[0]; (o = c.parentNode) == null || o.insertBefore(l, c); })(window, document, "script", "https://connect.facebook.net/en_US/fbevents.js"); const n = setInterval(() => { typeof window.fbq == "function" && (e.map((t) => t.code).forEach((t) => { window.fbq("init", t), window.fbq("trackSingle", t, "PageView"); }), clearInterval(n)); }, 500); } async function ha(e, n) { if (!e || typeof window.fbq != "function") return; const t = { ...e.data, ...n }; window.fbq("trackCustom", e.event, t || {}), console.log("Meta event sent:", e.event, t); } let It = !1; function ua(e) { var n; if (e != null && e.length) { if (!It) { const t = document.createElement("script"); t.async = !0, t.src = `https://www.googletagmanager.com/gtag/js?id=${e[0].code}`, document.head.appendChild(t), window.dataLayer = window.dataLayer || [], window.gtag = function() { window.dataLayer.push(arguments); }, window.gtag("js", /* @__PURE__ */ new Date()), It = !0; } for (const t of e) { const a = t.code, r = (n = t.metadata) == null ? void 0 : n["conversion-label"]; window.gtag("config", a, { send_page_view: !0, conversion_linker: !0, ...r && { conversion_label: r } }); } } } async function pa(e, n) { if (!e || typeof window.gtag != "function") return; const t = { ...e.data, ...n }; window.gtag("event", e.event, t || {}); } let Dt = !1; const _t = []; function ga(e) { var n, t, a, r; if (e != null && e.length) { Dt || (function(i, f, l) { var s; i[l] = i[l] || []; const c = f.createElement("script"); c.async = !0, c.src = "https://analytics.tiktok.com/i18n/pixel/events.js"; const o = f.getElementsByTagName("script")[0]; (s = o.parentNode) == null || s.insertBefore(c, o); }(window, document, "ttq"), Dt = !0); for (const i of e) { const f = i.code; _t.includes(f) || ((t = (n = window.ttq) == null ? void 0 : n.instance(f)) == null || t.init(f), (r = (a = window.ttq) == null ? void 0 : a.instance(f)) == null || r.track("PageView"), _t.push(f)); } } } async function wa(e, n) { if (!(!e || typeof window.ttq != "object")) for (const t of _t) { const a = window.ttq.instance(t); if (a) { const r = { ...e == null ? void 0 : e.data, ...n }; a.track(e == null ? void 0 : e.event, r || {}); } } } var N = /* @__PURE__ */ ((e) => (e.META = "meta", e.GOOGLE = "google", e.TIKTOK = "tiktok", e.EASYFLOW = "easyflow", e))(N || {}), wn = /* @__PURE__ */ ((e) => (e.meta = "fbq", e.google = "gtag", e.tiktok = "ttq", e.easyflow = "efp", e))(wn || {}); const ba = { [R.CHECKOUT_INITIALIZED]: { fbq: { event: "InitiateCheckout" }, gtag: { event: "begin_checkout" }, ttq: { event: "InitiateCheckout" } }, [R.PURCHASE_BTN_CLICKED]: { fbq: { event: "AddPaymentInfo" }, gtag: { event: "add_payment_info" }, ttq: { event: "AddPaymentInfo" } }, [R.PURCHASE_COMPLETED]: { fbq: { event: "Purchase" }, gtag: { event: "purchase" }, ttq: { event: "CompletePayment" } }, [R.PIX_SELECTED]: { fbq: { event: "CustomEvent", data: { payment_method: "pix" } }, gtag: { event: "select_payment_method", data: { method: "pix" } }, ttq: { event: "AddPaymentInfo", data: { payment_type: "pix" } } }, [R.PIX_GENERATED]: { fbq: { event: "CustomEvent", data: { payment_method: "pix", action: "generated" } }, gtag: { event: "generate_pix" }, ttq: { event: "CompletePayment", data: { method: "pix" } } }, [R.CREDIT_CARD_SELECTED]: { fbq: { event: "AddPaymentInfo", data: { method: "credit_card" } }, gtag: { event: "select_payment_method", data: { method: "credit_card" } }, ttq: { event: "AddPaymentInfo", data: { payment_type: "credit_card" } } }, [R.CREDIT_CARD_FORM_COMPLETED]: { fbq: { event: "CustomEvent", data: { form: "credit_card", status: "completed" } }, gtag: { event: "credit_card_form_completed" }, ttq: { event: "SubmitForm", data: { form_type: "credit_card" } } }, [R.BANK_BILLET_SELECTED]: { fbq: { event: "AddPaymentInfo", data: { method: "bank_slip" } }, gtag: { event: "select_payment_method", data: { method: "bank_slip" } }, ttq: { event: "AddPaymentInfo", data: { payment_type: "bank_slip" } } }, [R.BANK_BILLET_GENERATED]: { fbq: { event: "CustomEvent", data: { method: "bank_slip", action: "generated" } }, gtag: { event: "generate_bank_slip" }, ttq: { event: "CompletePayment", data: { method: "bank_slip" } } }, [R.USER_FORM_COMPLETED]: { fbq: { event: "Lead" }, gtag: { event: "generate_lead" }, ttq: { event: "SubmitForm", data: { form_type: "user_info" } } }, [R.ADDRESS_FORM_COMPLETED]: { fbq: { event: "CustomEvent", data: { form: "address" } }, gtag: { event: "form_completed", data: { form: "address" } }, ttq: { event: "SubmitForm", data: { form_type: "address" } } }, [R.DELIVERY_ADDRESS_COMPLETED]: { fbq: { event: "CustomEvent", data: { form: "delivery_address" } }, gtag: { event: "form_completed", data: { form: "delivery_address" } }, ttq: { event: "SubmitForm", data: { form_type: "delivery_address" } } }, [R.COUPON_ADDED]: { fbq: { event: "CustomEvent", data: { action: "coupon_added" } }, gtag: { event: "add_coupon" }, ttq: { event: "AddToCart", data: { coupon_applied: !0 } } }, [R.COUPON_BOX_CLICKED]: { fbq: { event: "CustomEvent", data: { action: "coupon_box_clicked" } }, gtag: { event: "coupon_box_clicked" }, ttq: { event: "ClickButton", data: { location: "coupon_box" } } }, [R.COUPON_FORM_COMPLETED]: { fbq: { event: "CustomEvent", data: { form: "coupon", status: "completed" } }, gtag: { event: "coupon_form_completed" }, ttq: { event: "SubmitForm", data: { form_type: "coupon" } } }, [R.COUPON_APPLY_FAILED]: { fbq: { event: "CustomEvent", data: { action: "coupon_apply_failed" } }, gtag: { event: "coupon_apply_failed" }, ttq: { event: "CustomEvent", data: { error_type: "coupon_apply_failed" } } }, [R.PIX_EXPIRED]: { fbq: { event: "CustomEvent", data: { pix: "expired" } }, gtag: { event: "pix_expired" }, ttq: { event: "CustomEvent", data: { pix: "expired" } } }, [R.PIX_COPIED]: { fbq: { event: "CustomEvent", data: { pix: "copied" } }, gtag: { event: "pix_copied" }, ttq: { event: "CopyText", data: { type: "pix_code" } } }, [R.PURCHASE_FAILED]: { fbq: { event: "CustomEvent", data: { status: "purchase_failed" } }, gtag: { event: "purchase_failed" }, ttq: { event: "CustomEvent", data: { status: "purchase_failed" } } }, [R.PRE_CHECKOUT_FORM_COMPLETED]: { fbq: { event: "CustomEvent", data: { action: "pre_checkout_form_completed" } }, gtag: { event: "pre_checkout_form_completed" }, ttq: { event: "CustomEvent", data: { error_type: "pre_checkout_form_completed" } } } }; function ma(e, n) { var a; const t = wn[e]; return ((a = ba[n]) == null ? void 0 : a[t]) || null; } /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ const va = 4, Rt = 0, Ot = 1, Ea = 2; function ue(e) { let n = e.length; for (; --n >= 0; ) e[n] = 0; } const xa = 0, bn = 1, ka = 2, ya = 3, Sa = 258, vt = 29, Oe = 256, ke = Oe + 1 + vt, de = 30, Et = 19, mn = 2 * ke + 1, ne = 15, Je = 16, Ta = 7, xt = 256, vn = 16, En = 17, xn = 18, dt = ( /* extra bits for each length code */ new Uint8Array([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]) ), He = ( /* extra bits for each distance code */ new Uint8Array([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]) ), Aa = ( /* extra bits for each bit length code */ new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]) ), kn = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Ia = 512, X = new Array((ke + 2) * 2); ue(X); const ve = new Array(de * 2); ue(ve); const ye = new Array(Ia); ue(ye); const Se = new Array(Sa - ya + 1); ue(Se); const kt = new Array(vt); ue(kt); const qe = new Array(de); ue(qe); function We(e, n, t, a, r) { this.static_tree = e, this.extra_bits = n, this.extra_base = t, this.elems = a, this.max_length = r, this.has_stree = e && e.length; } let yn, Sn, Tn; function Ve(e, n) { this.dyn_tree = e, this.max_code = 0, this.stat_desc = n; } const An = (e) => e < 256 ? ye[e] : ye[256 + (e >>> 7)], Te = (e, n) => { e.pending_buf[e.pending++] = n & 255, e.pending_buf[e.pending++] = n >>> 8 & 255; }, M = (e, n, t) => { e.bi_valid > Je - t ? (e.bi_buf |= n << e.bi_valid & 65535, Te(e, e.bi_buf), e.bi_buf = n >> Je - e.bi_valid, e.bi_valid += t - Je) : (e.bi_buf |= n << e.bi_valid & 65535, e.bi_valid += t); }, H = (e, n, t) => { M( e, t[n * 2], t[n * 2 + 1] /*.Len*/ ); }, In = (e, n) => { let t = 0; do t |= e & 1, e >>>= 1, t <<= 1; while (--n > 0); return t >>> 1; }, Da = (e) => { e.bi_valid === 16 ? (Te(e, e.bi_buf), e.bi_buf = 0, e.bi_valid = 0) : e.bi_valid >= 8 && (e.pending_buf[e.pending++] = e.bi_buf & 255, e.bi_buf >>= 8, e.bi_valid -= 8); }, Ra = (e, n) => { const t = n.dyn_tree, a = n.max_code, r = n.stat_desc.static_tree, i = n.stat_desc.has_stree, f = n.stat_desc.extra_bits, l = n.stat_desc.extra_base, c = n.stat_desc.max_length; let o, s, g, d, _, u, D = 0; for (d = 0; d <= ne; d++) e.bl_count[d] = 0; for (t[e.heap[e.heap_max] * 2 + 1] = 0, o = e.heap_max + 1; o < mn; o++) s = e.heap[o], d = t[t[s * 2 + 1] * 2 + 1] + 1, d > c && (d = c, D++), t[s * 2 + 1] = d, !(s > a) && (e.bl_count[d]++, _ = 0, s >= l && (_ = f[s - l]), u = t[s * 2], e.opt_len += u * (d + _), i && (e.static_len += u * (r[s * 2 + 1] + _))); if (D !== 0) { do { for (d = c - 1; e.bl_count[d] === 0; ) d--; e.bl_count[d]--, e.bl_count[d + 1] += 2, e.bl_count[c]--, D -= 2; } while (D > 0); for (d = c; d !== 0; d--) for (s = e.bl_count[d]; s !== 0; ) g = e.heap[--o], !(g > a) && (t[g * 2 + 1] !== d && (e.opt_len += (d - t[g * 2 + 1]) * t[g * 2], t[g * 2 + 1] = d), s--); } }, Dn = (e, n, t) => { const a = new Array(ne + 1); let r = 0, i, f; for (i = 1; i <= ne; i++) r = r + t[i - 1] << 1, a[i] = r; for (f = 0; f <= n; f++) { let l = e[f * 2 + 1]; l !== 0 && (e[f * 2] = In(a[l]++, l)); } }, Oa = () => { let e, n, t, a, r; const i = new Array(ne + 1); for (t = 0, a = 0; a < vt - 1; a++) for (kt[a] = t, e = 0; e < 1 << dt[a]; e++) Se[t++] = a; for (Se[t - 1] = a, r = 0, a = 0; a < 16; a++) for (qe[a] = r, e = 0; e < 1 << He[a]; e++) ye[r++] = a; for (r >>= 7; a < de; a++) for (qe[a] = r << 7, e = 0; e < 1 << He[a] - 7; e++) ye[256 + r++] = a; for (n = 0; n <= ne; n++) i[n] = 0; for (e = 0; e <= 143; ) X[e * 2 + 1] = 8, e++, i[8]++; for (; e <= 255; ) X[e * 2 + 1] = 9, e++, i[9]++; for (; e <= 279; ) X[e * 2 + 1] = 7, e++, i[7]++; for (; e <= 287; ) X[e * 2 + 1] = 8, e++, i[8]++; for (Dn(X, ke + 1, i), e = 0; e < de; e++) ve[e * 2 + 1] = 5, ve[e * 2] = In(e, 5); yn = new We(X, dt, Oe + 1, ke, ne), Sn = new We(ve, He, 0, de, ne), Tn = new We(new Array(0), Aa, 0, Et, Ta); }, Rn = (e) => { let n; for (n = 0; n < ke; n++) e.dyn_ltree[n * 2] = 0; for (n = 0; n < de; n++) e.dyn_dtree[n * 2] = 0; for (n = 0; n < Et; n++) e.bl_tree[n * 2] = 0; e.dyn_ltree[xt * 2] = 1, e.opt_len = e.static_len = 0, e.sym_next = e.matches = 0; }, On = (e) => { e.bi_valid > 8 ? Te(e, e.bi_buf) : e.bi_valid > 0 && (e.pending_buf[e.pending++] = e.bi_buf), e.bi_buf = 0, e.bi_valid = 0; }, Ct = (e, n, t, a) => { const r = n * 2, i = t * 2; return e[r] < e[i] || e[r] === e[i] && a[n] <= a[t]; }, Qe = (e, n, t) => { const a = e.heap[t]; let r = t << 1; for (; r <= e.heap_len && (r < e.heap_len && Ct(n, e.heap[r + 1], e.heap[r], e.depth) && r++, !Ct(n, a, e.heap[r], e.depth)); ) e.heap[t] = e.heap[r], t = r, r <<= 1; e.heap[t] = a; }, zt = (e, n, t) => { let a, r, i = 0, f, l; if (e.sym_next !== 0) do a = e.pending_buf[e.sym_buf + i++] & 255, a += (e.pending_buf[e.sym_buf + i++] & 255) << 8, r = e.pending_buf[e.sym_buf + i++], a === 0 ? H(e, r, n) : (f = Se[r], H(e, f + Oe + 1, n), l = dt[f], l !== 0 && (r -= kt[f], M(e, r, l)), a--, f = An(a), H(e, f, t), l = He[f], l !== 0 && (a -= qe[f], M(e, a, l))); while (i < e.sym_next); H(e, xt, n); }, ct = (e, n) => { const t = n.dyn_tree, a = n.stat_desc.static_tree, r = n.stat_desc.has_stree, i = n.stat_desc.elems; let f, l, c = -1, o; for (e.heap_len = 0, e.heap_max = mn, f = 0; f < i; f++) t[f * 2] !== 0 ? (e.heap[++e.heap_len] = c = f, e.depth[f] = 0) : t[f * 2 + 1] = 0; for (; e.heap_len < 2; ) o = e.heap[++e.heap_len] = c < 2 ? ++c : 0, t[o * 2] = 1, e.depth[o] = 0, e.opt_len--, r && (e.static_len -= a[o * 2 + 1]); for (n.max_code = c, f = e.heap_len >> 1; f >= 1; f--) Qe(e, t, f); o = i; do f = e.heap[ 1 /*SMALLEST*/ ], e.heap[ 1 /*SMALLEST*/ ] = e.heap[e.heap_len--], Qe( e, t, 1 /*SMALLEST*/ ), l = e.heap[ 1 /*SMALLEST*/ ], e.heap[--e.heap_max] = f, e.heap[--e.heap_max] = l, t[o * 2] = t[f * 2] + t[l * 2], e.depth[o] = (e.depth[f] >= e.depth[l] ? e.depth[f] : e.depth[l]) + 1, t[f * 2 + 1] = t[l * 2 + 1] = o, e.heap[ 1 /*SMALLEST*/ ] = o++, Qe( e, t, 1 /*SMALLEST*/ ); while (e.heap_len >= 2); e.heap[--e.heap_max] = e.heap[ 1 /*SMALLEST*/ ], Ra(e, n), Dn(t, c, e.bl_count); }, Lt = (e, n, t) => { let a, r = -1, i, f = n[0 * 2 + 1], l = 0, c = 7, o = 4; for (f === 0 && (c = 138, o = 3), n[(t + 1) * 2 + 1] = 65535, a = 0; a <= t; a++) i = f, f = n[(a + 1) * 2 + 1], !(++l < c && i === f) && (l < o ? e.bl_tree[i * 2] += l : i !== 0 ? (i !== r && e.bl_tree[i * 2]++, e.bl_tree[vn * 2]++) : l <= 10 ? e.bl_tree[En * 2]++ : e.bl_tree[xn * 2]++, l = 0, r = i, f === 0 ? (c = 138, o = 3) : i === f ? (c = 6, o = 3) : (c = 7, o = 4)); }, Nt = (e, n, t) => { let a, r = -1, i, f = n[0 * 2 + 1], l = 0, c = 7, o = 4; for (f === 0 && (c = 138, o = 3), a = 0; a <= t; a++) if (i = f, f = n[(a + 1) * 2 + 1], !(++l < c && i === f)) { if (l < o) do H(e, i, e.bl_tree); while (--l !== 0); else i !== 0 ? (i !== r && (H(e, i, e.bl_tree), l--), H(e, vn, e.bl_tree), M(e, l - 3, 2)) : l <= 10 ? (H(e, En, e.bl_tree), M(e, l - 3, 3)) : (H(e, xn, e.bl_tree), M(e, l - 11, 7)); l = 0, r = i, f === 0 ? (c = 138, o = 3) : i === f ? (c = 6, o = 3) : (c = 7, o = 4); } }, Ca = (e) => { let n; for (Lt(e, e.dyn_ltree, e.l_desc.max_code), Lt(e, e.dyn_dtree, e.d_desc.max_code), ct(e, e.bl_desc), n = Et - 1; n >= 3 && e.bl_tree[kn[n] * 2 + 1] === 0; n--) ; return e.opt_len += 3 * (n + 1) + 5 + 5 + 4, n; }, za = (e, n, t, a) => { let r; for (M(e, n - 257, 5), M(e, t - 1, 5), M(e, a - 4, 4), r = 0; r < a; r++) M(e, e.bl_tree[kn[r] * 2 + 1], 3); Nt(e, e.dyn_ltree, n - 1), Nt(e, e.dyn_dtree, t - 1); }, La = (e) => { let n = 4093624447, t; for (t = 0; t <= 31; t++, n >>>= 1) if (n & 1 && e.dyn_ltree[t * 2] !== 0) return Rt; if (e.dyn_ltree[9 * 2] !== 0 || e.dyn_ltree[10 * 2] !== 0 || e.dyn_ltree[13 * 2] !== 0) return Ot; for (t = 32; t < Oe; t++) if (e.dyn_ltree[t * 2] !== 0) return Ot; return Rt; }; let Mt = !1; const Na = (e) => { Mt || (Oa(), Mt = !0), e.l_desc = new Ve(e.dyn_ltree, yn), e.d_desc = new Ve(e.dyn_dtree, Sn), e.bl_desc = new Ve(e.bl_tree, Tn), e.bi_buf = 0, e.bi_valid = 0, Rn(e); }, Cn = (e, n, t, a) => { M(e, (xa << 1) + (a ? 1 : 0), 3), On(e), Te(e, t), Te(e, ~t), t && e.pending_buf.set(e.window.subarray(n, n + t), e.pending), e.pending += t; }, Ma = (e) => { M(e, bn << 1, 3), H(e, xt, X), Da(e); }, Za = (e, n, t, a) => { let r, i, f = 0; e.level > 0 ? (e.strm.data_type === Ea && (e.strm.data_type = La(e)), ct(e, e.l_desc), ct(e, e.d_desc), f = Ca(e), r = e.opt_len + 3 + 7 >>> 3, i = e.static_len + 3 + 7 >>> 3, i <= r && (r = i)) : r = i = t + 5, t + 4 <= r && n !== -1 ? Cn(e, n, t, a) : e.strategy === va || i === r ? (M(e, (bn << 1) + (a ? 1 : 0), 3), zt(e, X, ve)) : (M(e, (ka << 1) + (a ? 1 : 0), 3), za(e, e.l_desc.max_code + 1, e.d_desc.max_code + 1, f + 1), zt(e, e.dyn_ltree, e.dyn_dtree)), Rn(e), a && On(e); }, Fa = (e, n, t) => (e.pending_buf[e.sym_buf + e.sym_next++] = n, e.pending_buf[e.sym_buf + e.sym_next++] = n >> 8, e.pending_buf[e.sym_buf + e.sym_next++] = t, n === 0 ? e.dyn_ltree[t * 2]++ : (e.matches++, n--, e.dyn_ltree[(Se[t] + Oe + 1) * 2]++, e.dyn_dtree[An(n) * 2]++), e.sym_next === e.sym_end); var Ua = Na, $a = Cn, Pa = Za, Ba = Fa, Ha = Ma, qa = { _tr_init: Ua, _tr_stored_block: $a, _tr_flush_block: Pa, _tr_tally: Ba, _tr_align: Ha }; const Ka = (e, n, t, a) => { let r = e & 65535 | 0, i = e >>> 16 & 65535 | 0, f = 0; for (; t !== 0; ) { f = t > 2e3 ? 2e3 : t, t -= f; do r = r + n[a++] | 0, i = i + r | 0; while (--f); r %= 65521, i %= 65521; } return r | i << 16 | 0; }; var Ae = Ka; const Ga = () => { let e, n = []; for (var t = 0; t < 256; t++) { e = t; for (var a = 0; a < 8; a++) e = e & 1 ? 3988292384 ^ e >>> 1 : e >>> 1; n[t] = e; } return n; }, Xa = new Uint32Array(Ga()), Ya = (e, n, t, a) => { const r = Xa, i = a + t; e ^= -1; for (let f = a; f < i; f++) e = e >>> 8 ^ r[(e ^ n[f]) & 255]; return e ^ -1; }; var C = Ya, re = { 2: "need dictionary", /* Z_NEED_DICT 2 */ 1: "stream end", /* Z_STREAM_END 1 */ 0: "", /* Z_OK 0 */ "-1": "file error", /* Z_ERRNO (-1) */ "-2": "stream error", /* Z_STREAM_ERROR (-2) */ "-3": "data error", /* Z_DATA_ERROR (-3) */ "-4": "insufficient memory", /* Z_MEM_ERROR (-4) */ "-5": "buffer error", /* Z_BUF_ERROR (-5) */ "-6": "incompatible version" /* Z_VERSION_ERROR (-6) */ }, Ce = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, //Z_VERSION_ERROR: -6, /* compression levels */ Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, /* Possible values of the data_type field (though see inflate()) */ Z_BINARY: 0, Z_TEXT: 1, //Z_ASCII: 1, // = Z_TEXT (deprecated) Z_UNKNOWN: 2, /* The deflate compression method */ Z_DEFLATED: 8 //Z_NULL: null // Use -1 or null inline, depending on var type }; const { _tr_init: ja, _tr_stored_block: ht, _tr_flush_block: Ja, _tr_tally: W, _tr_align: Wa } = qa, { Z_NO_FLUSH: V, Z_PARTIAL_FLUSH: Va, Z_FULL_FLUSH: Qa, Z_FINISH: $, Z_BLOCK: Zt, Z_OK: z, Z_STREAM_END: Ft, Z_STREAM_ERROR: q, Z_DATA_ERROR: ei, Z_BUF_ERROR: et, Z_DEFAULT_COMPRESSION: ti, Z_FILTERED: ni, Z_HUFFMAN_ONLY: Fe, Z_RLE: ai, Z_FIXED: ii, Z_DEFAULT_STRATEGY: ri, Z_UNKNOWN: oi, Z_DEFLATED: Xe } = Ce, li = 9, fi = 15, si = 8, _i = 29, di = 256, ut = di + 1 + _i, ci = 30, hi = 19, ui = 2 * ut + 1, pi = 15, E = 3, J = 258, K = J + E + 1, gi = 32, ce = 42, yt = 57, pt = 69, gt = 73, wt = 91, bt = 103, ae = 113, be = 666, L = 1, pe = 2, oe = 3, ge = 4, wi = 3, ie = (e, n) => (e.msg = re[n], n), Ut = (e) => e * 2 - (e > 4 ? 9 : 0), j = (e) => { let n = e.length; for (; --n >= 0; ) e[n] = 0; }, bi = (e) => { let n, t, a, r = e.w_size; n = e.hash_size, a = n; do t = e.head[--a], e.head[a] = t >= r ? t - r : 0; while (--n); n = r, a = n; do t = e.prev[--a], e.prev[a] = t >= r ? t - r : 0; while (--n); }; let mi = (e, n, t) => (n << e.hash_shift ^ t) & e.hash_mask, Q = mi; const F = (e) => { const n = e.state; let t = n.pending; t > e.avail_out && (t = e.avail_out), t !== 0 && (e.output.set(n.pending_buf.subarray(n.pending_out, n.pending_out + t), e.next_out), e.next_out += t, n.pending_out += t, e.total_out += t, e.avail_out -= t, n.pending -= t, n.pending === 0 && (n.pending_out = 0)); }, U = (e, n) => { Ja(e, e.block_start >= 0 ? e.block_start : -1, e.strstart - e.block_start, n), e.block_start = e.strstart, F(e.strm); }, S = (e, n) => { e.pending_buf[e.pending++] = n; }, we = (e, n) => { e.pending_buf[e.pending++] = n >>> 8 & 255, e.pending_buf[e.pending++] = n & 255; }, mt = (e, n, t, a) => { let r = e.avail_in; return r > a && (r = a), r === 0 ? 0 : (e.avail_in -= r, n.set(e.input.subarray(e.next_in, e.next_in + r), t), e.state.wrap === 1 ? e.adler = Ae(e.adler, n, r, t) : e.state.wrap === 2 && (e.adler = C(e.adler, n, r, t)), e.next_in += r, e.total_in += r, r); }, zn = (e, n) => { let t = e.max_chain_length, a = e.strstart, r, i, f = e.prev_length, l = e.nice_match; const c = e.strstart > e.w_size - K ? e.strstart - (e.w_size - K) : 0, o = e.window, s = e.w_mask, g = e.prev, d = e.strstart + J; let _ = o[a + f - 1], u = o[a + f]; e.prev_length >= e.good_match && (t >>= 2), l > e.lookahead && (l = e.lookahead); do if (r = n, !(o[r + f] !== u || o[r + f - 1] !== _ || o[r] !== o[a] || o[++r] !== o[a + 1])) { a += 2, r++; do ; while (o[++a] === o[++r] && o[++a] === o[++r] && o[++a] === o[++r] && o[++a] === o[++r] && o[++a] === o[++r] && o[++a] === o[++r] && o[++a] === o[++r] && o[++a] === o[++r] && a < d); if (i = J - (d - a), a = d - J, i > f) { if (e.match_start = n, f = i, i >= l) break; _ = o[a + f - 1], u = o[a + f]; } } while ((n = g[n & s]) > c && --t !== 0); return f <= e.lookahead ? f : e.lookahead; }, he = (e) => { const n = e.w_size; let t, a, r; do { if (a = e.window_size - e.lookahead - e.strstart, e.strstart >= n + (n - K) && (e.window.set(e.window.subarray(n, n + n - a), 0), e.match_start -= n, e.strstart -= n, e.block_start -= n, e.insert > e.strstart && (e.insert = e.strstart), bi(e), a += n), e.strm.avail_in === 0) break; if (t = mt(e.strm, e.window, e.strstart + e.lookahead, a), e.lookahead += t, e.lookahead + e.insert >= E) for (r = e.strstart - e.insert, e.ins_h = e.window[r], e.ins_h = Q(e, e.ins_h, e.window[r + 1]); e.insert && (e.ins_h = Q(e, e.ins_h, e.window[r + E - 1]), e.prev[r & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = r, r++, e.insert--, !(e.lookahead + e.insert < E)); ) ; } while (e.lookahead < K && e.strm.avail_in !== 0); }, Ln = (e, n) => { let t = e.pending_buf_size - 5 > e.w_size ? e.w_size : e.pending_buf_size - 5, a, r, i, f = 0, l = e.strm.avail_in; do { if (a = 65535, i = e.bi_valid + 42 >> 3, e.strm.avail_out < i || (i = e.strm.avail_out - i, r = e.strstart - e.block_start, a > r + e.strm.avail_in && (a = r + e.strm.avail_in), a > i && (a = i), a < t && (a === 0 && n !== $ || n === V || a !== r + e.strm.avail_in))) break; f = n === $ && a === r + e.strm.avail_in ? 1 : 0, ht(e, 0, 0, f), e.pending_buf[e.pending - 4] = a, e.pending_buf[e.pending - 3] = a >> 8, e.pending_buf[e.pending - 2] = ~a, e.pending_buf[e.pending - 1] = ~a >> 8, F(e.strm), r && (r > a && (r = a), e.strm.output.set(e.window.subarray(e.block_start, e.block_start + r), e.strm.next_out), e.strm.next_out += r, e.strm.avail_out -= r, e.strm.total_out += r, e.block_start += r, a -= r), a && (mt(e.strm, e.strm.output, e.strm.next_out, a), e.strm.next_out += a, e.strm.avail_out -= a, e.strm.total_out += a); } while (f === 0); return l -= e.strm.avail_in, l && (l >= e.w_size ? (e.matches = 2, e.window.set(e.strm.input.subarray(e.strm.next_in - e.w_size, e.strm.next_in), 0), e.strstart = e.w_size, e.insert = e.strstart) : (e.window_size - e.strstart <= l && (e.strstart -= e.w_size, e.window.set(e.window.subarray(e.w_size, e.w_size + e.strstart), 0), e.matches < 2 && e.matches++, e.insert > e.strstart && (e.insert = e.strstart)), e.window.set(e.strm.input.subarray(e.strm.next_in - l, e.strm.next_in), e.strstart), e.strstart += l, e.insert += l > e.w_size - e.insert ? e.w_size - e.insert : l), e.block_start = e.strstart), e.high_water < e.strstart && (e.high_water = e.strstart), f ? ge : n !== V && n !== $ && e.strm.avail_in === 0 && e.strstart === e.block_start ? pe : (i = e.window_size - e.strstart, e.strm.avail_in > i && e.block_start >= e.w_size && (e.block_start -= e.w_size, e.strstart -= e.w_size, e.window.set(e.window.subarray(e.w_size, e.w_size + e.strstart), 0), e.matches < 2 && e.matches++, i += e.w_size, e.insert > e.strstart && (e.insert = e.strstart)), i > e.strm.avail_in && (i = e.strm.avail_in), i && (mt(e.strm, e.window, e.strstart, i), e.strstart += i, e.insert += i > e.w_size - e.insert ? e.w_size - e.insert : i), e.high_water < e.strstart && (e.high_water = e.strstart), i = e.bi_valid + 42 >> 3, i = e.pending_buf_size - i > 65535 ? 65535 : e.pending_buf_size - i, t = i > e.w_size ? e.w_size : i, r = e.strstart - e.block_start, (r >= t || (r || n === $) && n !== V && e.strm.avail_in === 0 && r <= i) && (a = r > i ? i : r, f = n === $ && e.strm.avail_in === 0 && a === r ? 1 : 0, ht(e, e.block_start, a, f), e.block_start += a, F(e.strm)), f ? oe : L); }, tt = (e, n) => { let t, a; for (; ; ) { if (e.lookahead < K) { if (he(e), e.lookahead < K && n === V) return L; if (e.lookahead === 0) break; } if (t = 0, e.lookahead >= E && (e.ins_h = Q(e, e.ins_h, e.window[e.strstart + E - 1]), t = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), t !== 0 && e.strstart - t <= e.w_size - K && (e.match_length = zn(e, t)), e.match_length >= E) if (a = W(e, e.strstart - e.match_start, e.match_length - E), e.lookahead -= e.match_length, e.match_length <= e.max_lazy_match && e.lookahead >= E) { e.match_length--; do e.strstart++, e.ins_h = Q(e, e.ins_h, e.window[e.strstart + E - 1]), t = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart; while (--e.match_length !== 0); e.strstart++; } else e.strstart += e.match_length, e.match_length = 0, e.ins_h = e.window[e.strstart], e.ins_h = Q(e, e.ins_h, e.window[e.strstart + 1]); else a = W(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++; if (a && (U(e, !1), e.strm.avail_out === 0)) return L; } return e.insert = e.strstart < E - 1 ? e.strstart : E - 1, n === $ ? (U(e, !0), e.strm.avail_out === 0 ? oe : ge) : e.sym_next && (U(e, !1), e.strm.avail_out === 0) ? L : pe; }, se = (e, n) => { let t, a, r; for (; ; ) { if (e.lookahead < K) { if (he(e), e.lookahead < K && n === V) return L; if (e.lookahead === 0) break; } if (t = 0, e.lookahead >= E && (e.ins_h = Q(e, e.ins_h, e.window[e.strstart + E - 1]), t = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), e.prev_length = e.match_length, e.prev_match = e.match_start, e.match_length = E - 1, t !== 0 && e.prev_length < e.max_lazy_match && e.strstart - t <= e.w_size - K && (e.match_length = zn(e, t), e.match_length <= 5 && (e.strategy === ni || e.match_length === E && e.strstart - e.match_start > 4096) && (e.match_length = E - 1)), e.prev_length >= E && e.match_length <= e.prev_length) { r = e.strstart + e.lookahead - E, a = W(e, e.strstart - 1 - e.prev_match, e.prev_length - E), e.lookahead -= e.prev_length - 1, e.prev_length -= 2; do ++e.strstart <= r && (e.ins_h = Q(e, e.ins_h, e.window[e.strstart + E - 1]), t = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart); while (--e.prev_length !== 0); if (e.match_available = 0, e.match_length = E - 1, e.strstart++, a && (U(e, !1), e.strm.avail_out === 0)) return L; } else if (e.match_available) { if (a = W(e, 0, e.window[e.strstart - 1]), a && U(e, !1), e.strstart++, e.lookahead--, e.strm.avail_out === 0) return L; } else e.match_available = 1, e.strstart++, e.lookahead--; } return e.match_available && (a = W(e, 0, e.window[e.strstart - 1]), e.match_available = 0), e.insert = e.strstart < E - 1 ? e.strstart : E - 1, n === $ ? (U(e, !0), e.strm.avail_out === 0 ? oe : ge) : e.sym_next && (U(e, !1), e.strm.avail_out === 0) ? L : pe; }, vi = (e, n) => { let t, a, r, i; const f = e.window; for (; ; ) { if (e.lookahead <= J) { if (he(e), e.lookahead <= J && n === V) return L; if (e.lookahead === 0) break; } if (e.match_length = 0, e.lookahead >= E && e.strstart > 0 && (r = e.strstart - 1, a = f[r], a === f[++r] && a === f[++r] && a === f[++r])) { i = e.strstart + J; do ; while (a === f[++r] && a === f[++r] && a === f[++r] && a === f[++r] && a === f[++r] && a === f[++r] && a === f[++r] && a === f[++r] && r < i); e.match_length = J - (i - r), e.match_length > e.lookahead && (e.match_length = e.lookahead); } if (e.match_length >= E ? (t = W(e, 1, e.match_length - E), e.lookahead -= e.match_length, e.strstart += e.match_length, e.match_length = 0) : (t = W(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++), t && (U(e, !1), e.strm.avail_out === 0)) return L; } return e.insert = 0, n === $ ? (U(e, !0), e.strm.avail_out === 0 ? oe : ge) : e.sym_next && (U(e, !1), e.strm.avail_out === 0) ? L : pe; }, Ei = (e, n) => { let t; for (; ; ) { if (e.lookahead === 0 && (he(e), e.lookahead === 0)) { if (n === V) return L; break; } if (e.match_length = 0, t = W(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++, t && (U(e, !1), e.strm.avail_out === 0)) return L; } return e.insert = 0, n === $ ? (U(e, !0), e.strm.avail_out === 0 ? oe : ge) : e.sym_next && (U(e, !1), e.strm.avail_out === 0) ? L : pe; }; function B(e, n, t, a, r) { this.good_length = e, this.max_lazy = n, this.nice_length = t, this.max_chain = a, this.func = r; } const me = [ /* good lazy nice chain */ new B(0, 0, 0, 0, Ln), /* 0 store only */ new B(4, 4, 8, 4, tt), /* 1 max speed, no lazy matches */ new B(4, 5, 16, 8, tt), /* 2 */ new B(4, 6, 32, 32, tt), /* 3 */ new B(4, 4, 16, 16, se), /* 4 lazy matches */ new B(8, 16, 32, 32, se), /* 5 */ new B(8, 16, 128, 128, se), /* 6 */ new B(8, 32, 128, 256, se), /* 7 */ new B(32, 128, 258, 1024, se), /* 8 */ new B(32, 258, 258, 4096, se) /* 9 max compression */ ], xi = (e) => { e.window_size = 2 * e.w_size, j(e.head), e.max_lazy_match = me[e.level].max_lazy, e.good_match = me[e.level].good_length, e.nice_match = me[e.level].nice_length, e.max_chain_length = me[e.level].max_chain, e.strstart = 0, e.block_start = 0, e.lookahead = 0, e.insert = 0, e.match_length = e.prev_length = E - 1, e.match_available = 0, e.ins_h = 0; }; function ki() { this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Xe, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new Uint16Array(ui * 2), this.dyn_dtree = new Uint16Array((2 * ci + 1) * 2), this.bl_tree = new Uint16Array((2 * hi + 1) * 2), j(this.dyn_ltree), j(this.dyn_dtree), j(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(pi + 1), this.heap = new Uint16Array(2 * ut + 1), j(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(2 * ut + 1), j(this.depth), this.sym_buf = 0, this.lit_bufsize = 0, this.sym_next = 0, this.sym_end = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; } const ze = (e) => { if (!e) return 1; const n = e.state; return !n || n.strm !== e || n.status !== ce && //#ifdef GZIP n.status !== yt && //#endif n.status !== pt && n.status !== gt && n.status !== wt && n.status !== bt && n.status !== ae && n.status !== be ? 1 : 0; }, Nn = (e) => { if (ze(e)) return ie(e, q); e.total_in = e.total_out = 0, e.data_type = oi; const n = e.state; return n.pending = 0, n.pending_out = 0, n.wrap < 0 && (n.wrap = -n.wrap), n.status = //#ifdef GZIP n.wrap === 2 ? yt : ( //#endif n.wrap ? ce : ae ), e.adler = n.wrap === 2 ? 0 : 1, n.last_flush = -2, ja(n), z; }, Mn = (e) => { const n = Nn(e); return n === z && xi(e.state), n; }, yi = (e, n) => ze(e) || e.state.wrap !== 2 ? q : (e.state.gzhead = n, z), Zn = (e, n, t, a, r, i) => { if (!e) return q; let f = 1; if (n === ti && (n = 6), a < 0 ? (f = 0, a = -a) : a > 15 && (f = 2, a -= 16), r < 1 || r > li || t !== Xe || a < 8 || a > 15 || n < 0 || n > 9 || i < 0 || i > ii || a === 8 && f !== 1) return ie(e, q); a === 8 && (a = 9); const l = new ki(); return e.state = l, l.strm = e, l.status = ce, l.wrap = f, l.gzhead = null, l.w_bits = a, l.w_size = 1 << l.w_bits, l.w_mask = l.w_size - 1, l.hash_bits = r + 7, l.hash_size = 1 << l.hash_bits, l.hash_mask = l.hash_size - 1, l.hash_shift = ~~((l.hash_bits + E - 1) / E), l.window = new Uint8Array(l.w_size * 2), l.head = new Uint16Array(l.hash_size), l.prev = new Uint16Array(l.w_size), l.lit_bufsize = 1 << r + 6, l.pending_buf_size = l.lit_bufsize * 4, l.pending_buf = new Uint8Array(l.pending_buf_size), l.sym_buf = l.lit_bufsize, l.sym_end = (l.lit_bufsize - 1) * 3, l.level = n, l.strategy = i, l.method = t, Mn(e); }, Si = (e, n) => Zn(e, n, Xe, fi, si, ri), Ti = (e, n) => { if (ze(e) || n > Zt || n < 0) return e ? ie(e, q) : q; const t = e.state; if (!e.output || e.avail_in !== 0 && !e.input || t.status === be && n !== $) return ie(e, e.avail_out === 0 ? et : q); const a = t.last_flush; if (t.last_flush = n, t.pending !== 0) { if (F(e), e.avail_out === 0) return t.last_flush = -1, z; } else if (e.avail_in === 0 && Ut(n) <= Ut(a) && n !== $) return ie(e, et); if (t.status === be && e.avail_in !== 0) return ie(e, et); if (t.status === ce && t.wrap === 0 && (t.status = ae), t.status === ce) { let r = Xe + (t.w_bits - 8 << 4) << 8, i = -1; if (t.strategy >= Fe || t.level < 2 ? i = 0 : t.level < 6 ? i = 1 : t.level === 6 ? i = 2 : i = 3, r |= i << 6, t.strstart !== 0 && (r |= gi), r += 31 - r % 31, we(t, r), t.strstart !== 0 && (we(t, e.adler >>> 16), we(t, e.adler & 65535)), e.adler = 1, t.status = ae, F(e), t.pending !== 0) return t.last_flush = -1, z; } if (t.status === yt) { if (e.adler = 0, S(t, 31), S(t, 139), S(t, 8), t.gzhead) S( t, (t.gzhead.text ? 1 : 0) + (t.gzhead.hcrc ? 2 : 0) + (t.gzhead.extra ? 4 : 0) + (t.gzhead.name ? 8 : 0) + (t.gzhead.comment ? 16 : 0) ), S(t, t.gzhead.time & 255), S(t, t.gzhead.time >> 8 & 255), S(t, t.gzhead.time >> 16 & 255), S(t, t.gzhead.time >> 24 & 255), S(t, t.level === 9 ? 2 : t.strategy >= Fe || t.level < 2 ? 4 : 0), S(t, t.gzhead.os & 255), t.gzhead.extra && t.gzhead.extra.length && (S(t, t.gzhead.extra.length & 255), S(t, t.gzhead.extra.length >> 8 & 255)), t.gzhead.hcrc && (e.adler = C(e.adler, t.pending_buf, t.pending, 0)), t.gzindex = 0, t.status = pt; else if (S(t, 0), S(t, 0), S(t, 0), S(t, 0), S(t, 0), S(t, t.level === 9 ? 2 : t.strategy >= Fe || t.level < 2 ? 4 : 0), S(t, wi), t.status = ae, F(e), t.pending !== 0) return t.last_flush = -1, z; } if (t.status === pt) { if (t.gzhead.extra) { let r = t.pending, i = (t.gzhead.extra.length & 65535) - t.gzindex; for (; t.pending + i > t.pending_buf_size; ) { let l = t.pending_buf_size - t.pending; if (t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex, t.gzindex + l), t.pending), t.pending = t.pending_buf_size, t.gzhead.hcrc && t.pending > r && (e.adler = C(e.adler, t.pending_buf, t.pending - r, r)), t.gzindex += l, F(e), t.pending !== 0) return t.last_flush = -1, z; r = 0, i -= l; } let f = new Uint8Array(t.gzhead.extra); t.pending_buf.set(f.subarray(t.gzindex, t.gzindex + i), t.pending), t.pending += i, t.gzhead.hcrc && t.pending > r && (e.adler = C(e.adler, t.pending_buf, t.pending - r, r)), t.gzindex = 0; } t.status = gt; } if (t.status === gt) { if (t.gzhead.name) { let r = t.pending, i; do { if (t.pending === t.pending_buf_size) { if (t.gzhead.hcrc && t.pending > r && (e.adler = C(e.adler, t.pending_buf, t.pending - r, r)), F(e), t.pending !== 0) return t.last_flush = -1, z; r = 0; } t.gzindex < t.gzhead.name.length ? i = t.gzhead.name.charCodeAt(t.gzindex++) & 255 : i = 0, S(t, i); } while (i !== 0); t.gzhead.hcrc && t.pending > r && (e.adler = C(e.adler, t.pending_buf, t.pending - r, r)), t.gzindex = 0; } t.status = wt; } if (t.status === wt) { if (t.gzhead.comment) { let r = t.pending, i; do { if (t.pending === t.pending_buf_size) { if (t.gzhead.hcrc && t.pending > r && (e.adler = C(e.adler, t.pending_buf, t.pending - r, r)), F(e), t.pending !== 0) return t.last_flush = -1, z; r = 0; } t.gzindex < t.gzhead.comment.length ? i = t.gzhead.comment.charCodeAt(t.gzindex++) & 255 : i = 0, S(t, i); } while (i !== 0); t.gzhead.hcrc && t.pending > r && (e.adler = C(e.adler, t.pending_buf, t.pending - r, r)); } t.status = bt; } if (t.status === bt) { if (t.gzhead.hcrc) { if (t.pending + 2 > t.pending_buf_size && (F(e), t.pending !== 0)) return t.last_flush = -1, z; S(t, e.adler & 255), S(t, e.adler >> 8 & 255), e.adler = 0; } if (t.status = ae, F(e), t.pending !== 0) return t.last_flush = -1, z; } if (e.avail_in !== 0 || t.lookahead !== 0 || n !== V && t.status !== be) { let r = t.level === 0 ? Ln(t, n) : t.strategy === Fe ? Ei(t, n) : t.strategy === ai ? vi(t, n) : me[t.level].func(t, n); if ((r === oe || r === ge) && (t.status = be), r === L || r === oe) return e.avail_out === 0 && (t.last_flush = -1), z; if (r === pe && (n === Va ? Wa(t) : n !== Zt && (ht(t, 0, 0, !1), n === Qa && (j(t.head), t.lookahead === 0 && (t.strstart = 0, t.block_start = 0, t.insert = 0))), F(e), e.avail_out === 0)) return t.last_flush = -1, z; } return n !== $ ? z : t.wrap <= 0 ? Ft : (t.wrap === 2 ? (S(t, e.adler & 255), S(t, e.adler >> 8 & 255), S(t, e.adler >> 16 & 255), S(t, e.adler >> 24 & 255), S(t, e.total_in & 255), S(t, e.total_in >> 8 & 255), S(t, e.total_in >> 16 & 255), S(t, e.total_in >> 24 & 255)) : (we(t, e.adler >>> 16), we(t, e.adler & 65535)), F(e), t.wrap > 0 && (t.wrap = -t.wrap), t.pending !== 0 ? z : Ft); }, Ai = (e) => { if (ze(e)) return q; const n = e.state.status; return e.state = null, n === ae ? ie(e, ei) : z; }, Ii = (e, n) => { let t = n.length; if (ze(e)) return q; const a = e.state, r = a.wrap; if (r === 2 || r === 1 && a.status !== ce || a.lookahead) return q; if (r === 1 && (e.adler = Ae(e.adler, n, t, 0)), a.wrap = 0, t >= a.w_size) { r === 0 && (j(a.head), a.strstart = 0, a.block_start = 0, a.insert = 0); let c = new Uint8Array(a.w_size); c.set(n.subarray(t - a.w_size, t), 0), n = c, t = a.w_size; } const i = e.avail_in, f = e.next_in, l = e.input; for (e.avail_in = t, e.next_in = 0, e.input = n, he(a); a.lookahead >= E; ) { let c = a.strstart, o = a.lookahead - (E - 1); do a.ins_h = Q(a, a.ins_h, a.window[c + E - 1]), a.prev[c & a.w_mask] = a.head[a.ins_h], a.head[a.ins_h] = c, c++; while (--o); a.strstart = c, a.lookahead = E - 1, he(a); } return a.strstart += a.lookahead, a.block_start = a.strstart, a.insert = a.lookahead, a.lookahead = 0, a.match_length = a.prev_length = E - 1, a.match_available = 0, e.next_in = f, e.input = l, e.avail_in = i, a.wrap = r, z; }; var Di = Si, Ri = Zn, Oi = Mn, Ci = Nn, zi = yi, Li = Ti, Ni = Ai, Mi = Ii, Zi = "pako deflate (from Nodeca project)", Ee = { deflateInit: Di, deflateInit2: Ri, deflateReset: Oi, deflateResetKeep: Ci, deflateSetHeader: zi, deflate: Li, deflateEnd: Ni, deflateSetDictionary: Mi, deflateInfo: Zi }; const Fi = (e, n) => Object.prototype.hasOwnProperty.call(e, n); var Ui = function(e) { const n = Array.prototype.slice.call(arguments, 1); for (; n.length; ) { const t = n.shift(); if (t) { if (typeof t != "object") throw new TypeError(t + "must be non-object"); for (const a in t) Fi(t, a) && (e[a] = t[a]); } } return e; }, $i = (e) => { let n = 0; for (let a = 0, r = e.length; a < r; a++) n += e[a].length; const t = new Uint8Array(n); for (let a = 0, r = 0, i = e.length; a < i; a++) { let f = e[a]; t.set(f, r), r += f.length; } return t; }, Ye = { assign: Ui, flattenChunks: $i }; let Fn = !0; try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch { Fn = !1; } const Ie = new Uint8Array(256); for (let e = 0; e < 256; e++) Ie[e] = e >= 252 ? 6 : e >= 248 ? 5 : e >= 240 ? 4 : e >= 224 ? 3 : e >= 192 ? 2 : 1; Ie[254] = Ie[254] = 1; var Pi = (e) => { if (typeof TextEncoder == "function" && TextEncoder.prototype.encode) return new TextEncoder().encode(e); let n, t, a, r, i, f = e.length, l = 0; for (r = 0; r < f; r++) t = e.charCodeAt(r), (t & 64512) === 55296 && r + 1 < f && (a = e.charCodeAt(r + 1), (a & 64512) === 56320 && (t = 65536 + (t - 55296 << 10) + (a - 56320), r++)), l += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4; for (n = new Uint8Array(l), i = 0, r = 0; i < l; r++) t = e.charCodeAt(r), (t & 64512) === 55296 && r + 1 < f && (a = e.charCodeAt(r + 1), (a & 64512) === 56320 && (t = 65536 + (t - 55296 << 10) + (a - 56320), r++)), t < 128 ? n[i++] = t : t < 2048 ? (n[i++] = 192 | t >>> 6, n[i++] = 128 | t & 63) : t < 65536 ? (n[i++] = 224 | t >>> 12, n[i++] = 128 | t >>> 6 & 63, n[i++] = 128 | t & 63) : (n[i++] = 240 | t >>> 18, n[i++] = 128 | t >>> 12 & 63, n[i++] = 128 | t >>> 6 & 63, n[i++] = 128 | t & 63); return n; }; const Bi = (e, n) => { if (n < 65534 && e.subarray && Fn) return String.fromCharCode.apply(null, e.length === n ? e : e.subarray(0, n)); let t = ""; for (let a = 0; a < n; a++) t += String.fromCharCode(e[a]); return t; }; var Hi = (e, n) => { const t = n || e.length; if (typeof TextDecoder == "function" && TextDecoder.prototype.decode) return new TextDecoder().decode(e.subarray(0, n)); let a, r; const i = new Array(t * 2); for (r = 0, a = 0; a < t; ) { let f = e[a++]; if (f < 128) { i[r++] = f; continue; } let l = Ie[f]; if (l > 4) { i[r++] = 65533, a += l - 1; continue; } for (f &= l === 2 ? 31 : l === 3 ? 15 : 7; l > 1 && a < t; ) f = f << 6 | e[a++] & 63, l--; if (l > 1) { i[r++] = 65533; continue; } f < 65536 ? i[r++] = f : (f -= 65536, i[r++] = 55296 | f >> 10 & 1023, i[r++] = 56320 | f & 1023); } return Bi(i, r); }, qi = (e, n) => { n = n || e.length, n > e.length && (n = e.length); let t = n - 1; for (; t >= 0 && (e[t] & 192) === 128; ) t--; return t < 0 || t === 0 ? n : t + Ie[e[t]] > n ? t : n; }, De = { string2buf: Pi, buf2string: Hi, utf8border: qi }; function Ki() { this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0; } var Un = Ki; const $n = Object.prototype.toString, { Z_NO_FLUSH: Gi, Z_SYNC_FLUSH: Xi, Z_FULL_FLUSH: Yi, Z_FINISH: ji, Z_OK: Ke, Z_STREAM_END: Ji, Z_DEFAULT_COMPRESSION: Wi, Z_DEFAULT_STRATEGY: Vi, Z_DEFLATED: Qi } = Ce; function Le(e) { this.options = Ye.assign({ level: Wi, method: Qi, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: Vi }, e || {}); let n = this.options; n.raw && n.windowBits > 0 ? n.windowBits = -n.windowBits : n.gzip && n.windowBits > 0 && n.windowBits < 16 && (n.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm =