UNPKG

sparkloop

Version:

SparkLoop Official Script

1,020 lines (1,015 loc) 193 kB
// Property of SparkLoop Enterprises Ltd (sparkloop.app). var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // app/javascript/script/flash.js var create, success, warning, error, message; var init_flash = __esm({ "app/javascript/script/flash.js"() { create = (header, body, type = "default") => { const item = document.createElement("li"); item.classList.add("sl-popup-item"); item.setAttribute("data-type", type); if (type != "default") { const icon = document.createElement("div"); icon.classList.add("sl-popup-icon"); icon.classList.add(`sl-popup-${type}-icon`); item.appendChild(icon); } const close = document.createElement("div"); close.classList.add("sl-popup-close"); item.appendChild(close); close.addEventListener("click", () => item.remove()); const text_container = document.createElement("div"); text_container.classList.add("sl-popup-text-container"); const item_header = document.createElement("h3"); item_header.innerText = header; text_container.appendChild(item_header); const item_body = document.createElement("p"); item_body.innerHTML = body; text_container.appendChild(item_body); item.appendChild(text_container); if (document.getElementById("sl-popup-container")) { const container = document.getElementById("sl-popup-container"); container.appendChild(item); } else { const container = document.createElement("ul"); container.id = "sl-popup-container"; container.appendChild(item); const body2 = document.getElementsByTagName("body")[0]; body2.appendChild(container); } }; success = (header, body) => { create(header, body, "success"); }; warning = (header, body) => { create(header, body, "warning"); }; error = (header, body) => { create(header, body, "error"); }; message = (header, body) => { create(header, body); }; } }); // node_modules/js-cookie/dist/js.cookie.mjs function assign(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { target[key] = source[key]; } } return target; } function init(converter, defaultAttributes) { function set(key, value, attributes) { if (typeof document === "undefined") { return; } attributes = assign({}, defaultAttributes, attributes); if (typeof attributes.expires === "number") { attributes.expires = new Date(Date.now() + attributes.expires * 864e5); } if (attributes.expires) { attributes.expires = attributes.expires.toUTCString(); } key = encodeURIComponent(key).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape); var stringifiedAttributes = ""; for (var attributeName in attributes) { if (!attributes[attributeName]) { continue; } stringifiedAttributes += "; " + attributeName; if (attributes[attributeName] === true) { continue; } stringifiedAttributes += "=" + attributes[attributeName].split(";")[0]; } return document.cookie = key + "=" + converter.write(value, key) + stringifiedAttributes; } function get(key) { if (typeof document === "undefined" || arguments.length && !key) { return; } var cookies = document.cookie ? document.cookie.split("; ") : []; var jar = {}; for (var i = 0; i < cookies.length; i++) { var parts = cookies[i].split("="); var value = parts.slice(1).join("="); try { var foundKey = decodeURIComponent(parts[0]); jar[foundKey] = converter.read(value, foundKey); if (key === foundKey) { break; } } catch (e3) { } } return key ? jar[key] : jar; } return Object.create( { set, get, remove: function(key, attributes) { set( key, "", assign({}, attributes, { expires: -1 }) ); }, withAttributes: function(attributes) { return init(this.converter, assign({}, this.attributes, attributes)); }, withConverter: function(converter2) { return init(assign({}, this.converter, converter2), this.attributes); } }, { attributes: { value: Object.freeze(defaultAttributes) }, converter: { value: Object.freeze(converter) } } ); } var defaultConverter, api, js_cookie_default; var init_js_cookie = __esm({ "node_modules/js-cookie/dist/js.cookie.mjs"() { defaultConverter = { read: function(value) { if (value[0] === '"') { value = value.slice(1, -1); } return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent); }, write: function(value) { return encodeURIComponent(value).replace( /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent ); } }; api = init(defaultConverter, { path: "/" }); js_cookie_default = api; } }); // node_modules/@thumbmarkjs/thumbmarkjs/dist/thumbmark.esm.js function s(e3) { let t3 = 0; for (let n3 = 0; n3 < e3.length; ++n3) t3 += Math.abs(e3[n3]); return t3; } function c(e3, t3, n3) { let o2 = []; for (let t4 = 0; t4 < e3[0].data.length; t4++) { let n4 = []; for (let o3 = 0; o3 < e3.length; o3++) n4.push(e3[o3].data[t4]); o2.push(l(n4)); } const r3 = new Uint8ClampedArray(o2); return new ImageData(r3, t3, n3); } function l(e3) { if (0 === e3.length) return 0; const t3 = {}; for (const n4 of e3) t3[n4] = (t3[n4] || 0) + 1; let n3 = e3[0]; for (const e4 in t3) t3[e4] > t3[n3] && (n3 = parseInt(e4, 10)); return n3; } function u(e3) { return e3 ^= e3 >>> 16, e3 = Math.imul(e3, 2246822507), e3 ^= e3 >>> 13, e3 = Math.imul(e3, 3266489909), (e3 ^= e3 >>> 16) >>> 0; } function d(e3, t3) { return e3 << t3 | e3 >>> 32 - t3; } function h(e3, t3 = 0) { var n3; if (t3 = t3 ? 0 | t3 : 0, "string" == typeof e3 && (n3 = e3, e3 = new TextEncoder().encode(n3).buffer), !(e3 instanceof ArrayBuffer)) throw new TypeError("Expected key to be ArrayBuffer or string"); const o2 = new Uint32Array([t3, t3, t3, t3]); !function(e4, t4) { const n4 = e4.byteLength / 16 | 0, o3 = new Uint32Array(e4, 0, 4 * n4); for (let e5 = 0; e5 < n4; e5++) { const n5 = o3.subarray(4 * e5, 4 * (e5 + 1)); n5[0] = Math.imul(n5[0], m[0]), n5[0] = d(n5[0], 15), n5[0] = Math.imul(n5[0], m[1]), t4[0] = t4[0] ^ n5[0], t4[0] = d(t4[0], 19), t4[0] = t4[0] + t4[1], t4[0] = Math.imul(t4[0], 5) + 1444728091, n5[1] = Math.imul(n5[1], m[1]), n5[1] = d(n5[1], 16), n5[1] = Math.imul(n5[1], m[2]), t4[1] = t4[1] ^ n5[1], t4[1] = d(t4[1], 17), t4[1] = t4[1] + t4[2], t4[1] = Math.imul(t4[1], 5) + 197830471, n5[2] = Math.imul(n5[2], m[2]), n5[2] = d(n5[2], 17), n5[2] = Math.imul(n5[2], m[3]), t4[2] = t4[2] ^ n5[2], t4[2] = d(t4[2], 15), t4[2] = t4[2] + t4[3], t4[2] = Math.imul(t4[2], 5) + 2530024501, n5[3] = Math.imul(n5[3], m[3]), n5[3] = d(n5[3], 18), n5[3] = Math.imul(n5[3], m[0]), t4[3] = t4[3] ^ n5[3], t4[3] = d(t4[3], 13), t4[3] = t4[3] + t4[0], t4[3] = Math.imul(t4[3], 5) + 850148119; } }(e3, o2), function(e4, t4) { const n4 = e4.byteLength / 16 | 0, o3 = e4.byteLength % 16, r4 = new Uint32Array(4), i = new Uint8Array(e4, 16 * n4, o3); switch (o3) { case 15: r4[3] = r4[3] ^ i[14] << 16; case 14: r4[3] = r4[3] ^ i[13] << 8; case 13: r4[3] = r4[3] ^ i[12], r4[3] = Math.imul(r4[3], m[3]), r4[3] = d(r4[3], 18), r4[3] = Math.imul(r4[3], m[0]), t4[3] = t4[3] ^ r4[3]; case 12: r4[2] = r4[2] ^ i[11] << 24; case 11: r4[2] = r4[2] ^ i[10] << 16; case 10: r4[2] = r4[2] ^ i[9] << 8; case 9: r4[2] = r4[2] ^ i[8], r4[2] = Math.imul(r4[2], m[2]), r4[2] = d(r4[2], 17), r4[2] = Math.imul(r4[2], m[3]), t4[2] = t4[2] ^ r4[2]; case 8: r4[1] = r4[1] ^ i[7] << 24; case 7: r4[1] = r4[1] ^ i[6] << 16; case 6: r4[1] = r4[1] ^ i[5] << 8; case 5: r4[1] = r4[1] ^ i[4], r4[1] = Math.imul(r4[1], m[1]), r4[1] = d(r4[1], 16), r4[1] = Math.imul(r4[1], m[2]), t4[1] = t4[1] ^ r4[1]; case 4: r4[0] = r4[0] ^ i[3] << 24; case 3: r4[0] = r4[0] ^ i[2] << 16; case 2: r4[0] = r4[0] ^ i[1] << 8; case 1: r4[0] = r4[0] ^ i[0], r4[0] = Math.imul(r4[0], m[0]), r4[0] = d(r4[0], 15), r4[0] = Math.imul(r4[0], m[1]), t4[0] = t4[0] ^ r4[0]; } }(e3, o2), function(e4, t4) { t4[0] = t4[0] ^ e4.byteLength, t4[1] = t4[1] ^ e4.byteLength, t4[2] = t4[2] ^ e4.byteLength, t4[3] = t4[3] ^ e4.byteLength, t4[0] = t4[0] + t4[1] | 0, t4[0] = t4[0] + t4[2] | 0, t4[0] = t4[0] + t4[3] | 0, t4[1] = t4[1] + t4[0] | 0, t4[2] = t4[2] + t4[0] | 0, t4[3] = t4[3] + t4[0] | 0, t4[0] = u(t4[0]), t4[1] = u(t4[1]), t4[2] = u(t4[2]), t4[3] = u(t4[3]), t4[0] = t4[0] + t4[1] | 0, t4[0] = t4[0] + t4[2] | 0, t4[0] = t4[0] + t4[3] | 0, t4[1] = t4[1] + t4[0] | 0, t4[2] = t4[2] + t4[0] | 0, t4[3] = t4[3] + t4[0] | 0; }(e3, o2); const r3 = new Uint8Array(o2.buffer); return Array.from(r3).map((e4) => e4.toString(16).padStart(2, "0")).join(""); } async function f(e3) { for (var t3; !document.body; ) await g(50); const n3 = document.createElement("iframe"); n3.setAttribute("frameBorder", "0"); const o2 = n3.style; o2.setProperty("position", "fixed"), o2.setProperty("display", "block", "important"), o2.setProperty("visibility", "visible"), o2.setProperty("border", "0"), o2.setProperty("opacity", "0"), n3.src = "about:blank", document.body.appendChild(n3); const r3 = n3.contentDocument || (null === (t3 = n3.contentWindow) || void 0 === t3 ? void 0 : t3.document); if (!r3) throw new Error("Iframe document is not accessible"); e3({ iframe: r3 }), setTimeout(() => { document.body.removeChild(n3); }, 0); } function g(e3, t3) { return new Promise((n3) => setTimeout(n3, e3, t3)); } function y(e3, t3) { if (!e3) throw new Error("Canvas context not supported"); return e3.font = `72px ${t3}`, e3.measureText("WwMmLli0Oo").width; } function S() { var e3; const t3 = document.createElement("canvas"), n3 = null !== (e3 = t3.getContext("webgl")) && void 0 !== e3 ? e3 : t3.getContext("experimental-webgl"); if (n3 && "getParameter" in n3) try { const e4 = (n3.getParameter(n3.VENDOR) || "").toString(), t4 = (n3.getParameter(n3.RENDERER) || "").toString(); let o2 = { vendor: e4, renderer: t4, version: (n3.getParameter(n3.VERSION) || "").toString(), shadingLanguageVersion: (n3.getParameter(n3.SHADING_LANGUAGE_VERSION) || "").toString() }; if (!t4.length || !e4.length) { const e5 = n3.getExtension("WEBGL_debug_renderer_info"); if (e5) { const t5 = (n3.getParameter(e5.UNMASKED_VENDOR_WEBGL) || "").toString(), r3 = (n3.getParameter(e5.UNMASKED_RENDERER_WEBGL) || "").toString(); t5 && (o2.vendorUnmasked = t5), r3 && (o2.rendererUnmasked = r3); } } return o2; } catch (e4) { } return "undefined"; } function b() { const e3 = new Float32Array(1), t3 = new Uint8Array(e3.buffer); return e3[0] = 1 / 0, e3[0] = e3[0] - e3[0], t3[3]; } function P(e3, t3) { const n3 = {}; return t3.forEach((t4) => { const o2 = function(e4) { if (0 === e4.length) return null; const t5 = {}; e4.forEach((e5) => { const n5 = String(e5); t5[n5] = (t5[n5] || 0) + 1; }); let n4 = e4[0], o3 = 1; return Object.keys(t5).forEach((e5) => { t5[e5] > o3 && (n4 = e5, o3 = t5[e5]); }), n4; }(e3.map((e4) => t4 in e4 ? e4[t4] : void 0).filter((e4) => void 0 !== e4)); o2 && (n3[t4] = o2); }), n3; } function x() { var e3, t3, n3, o2, r3, i; if ("undefined" == typeof navigator) return { name: "unknown", version: "unknown" }; const a2 = navigator.userAgent, s2 = [/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/, /(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/, /(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/, /Opera[\s\/](?<version>\d+(?:\.\d+)+)/, /Opera Mini\/(?<version>\d+(?:\.\d+)+)/, /Opera Mobi\/(?<version>\d+(?:\.\d+)+)/, /(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/, /(?<name>Brave)\/(?<version>\d+(?:\.\d+)+)/, /(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/, /(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/, /(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/, /(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/, /Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/, /(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/, /(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/], c2 = { edg: "Edge", edga: "Edge", edgios: "Edge", opr: "Opera", opx: "Opera", crios: "Chrome", fxios: "Firefox", samsung: "SamsungBrowser", vivaldi: "Vivaldi", brave: "Brave" }; for (const l2 of s2) { const s3 = a2.match(l2); if (s3) { let a3 = null === (e3 = s3.groups) || void 0 === e3 ? void 0 : e3.name, u2 = (null === (t3 = s3.groups) || void 0 === t3 ? void 0 : t3.version) || (null === (n3 = s3.groups) || void 0 === n3 ? void 0 : n3.version1) || (null === (o2 = s3.groups) || void 0 === o2 ? void 0 : o2.version2); if (a3 || !(null === (r3 = s3.groups) || void 0 === r3 ? void 0 : r3.version1) && !(null === (i = s3.groups) || void 0 === i ? void 0 : i.version2) || (a3 = "Safari"), !a3 && l2.source.includes("Opera Mini") && (a3 = "Opera Mini"), !a3 && l2.source.includes("Opera Mobi") && (a3 = "Opera Mobi"), !a3 && l2.source.includes("Opera") && (a3 = "Opera"), !a3 && s3[1] && (a3 = s3[1]), !u2 && s3[2] && (u2 = s3[2]), a3) { return { name: c2[a3.toLowerCase()] || a3, version: u2 || "unknown" }; } } } return { name: "unknown", version: "unknown" }; } function C() { if ("undefined" == typeof navigator || !navigator.userAgent) return false; const e3 = navigator.userAgent; return /Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(e3) && !/iPad/i.test(e3); } function A() { let e3 = []; const t3 = { "prefers-contrast": ["high", "more", "low", "less", "forced", "no-preference"], "any-hover": ["hover", "none"], "any-pointer": ["none", "coarse", "fine"], pointer: ["none", "coarse", "fine"], hover: ["hover", "none"], update: ["fast", "slow"], "inverted-colors": ["inverted", "none"], "prefers-reduced-motion": ["reduce", "no-preference"], "prefers-reduced-transparency": ["reduce", "no-preference"], scripting: ["none", "initial-only", "enabled"], "forced-colors": ["active", "none"] }; return Object.keys(t3).forEach((n3) => { t3[n3].forEach((t4) => { matchMedia(`(${n3}: ${t4})`).matches && e3.push(`${n3}: ${t4}`); }); }), e3; } function _() { if ("https:" === window.location.protocol && "function" == typeof window.ApplePaySession) try { const e3 = window.ApplePaySession.supportsVersion; for (let t3 = 15; t3 > 0; t3--) if (e3(t3)) return t3; } catch (e3) { return 0; } return 0; } function k(e3) { const t3 = []; return function e4(n3) { if (n3 && n3.toJSON && "function" == typeof n3.toJSON && (n3 = n3.toJSON()), void 0 === n3) return; if ("number" == typeof n3) return isFinite(n3) ? "" + n3 : "null"; if ("object" != typeof n3) return JSON.stringify(n3); let o2, r3; if (Array.isArray(n3)) { for (r3 = "[", o2 = 0; o2 < n3.length; o2++) o2 && (r3 += ","), r3 += e4(n3[o2]) || "null"; return r3 + "]"; } if (null === n3) return "null"; if (-1 !== t3.indexOf(n3)) throw new TypeError("Converting circular structure to JSON"); const i = t3.push(n3) - 1, a2 = Object.keys(n3).sort(); for (r3 = "", o2 = 0; o2 < a2.length; o2++) { const t4 = a2[o2], i2 = e4(n3[t4]); i2 && (r3 && (r3 += ","), r3 += JSON.stringify(t4) + ":" + i2); } return t3.splice(i, 1), "{" + r3 + "}"; }(e3) || ""; } function D(e3, t3) { return `<math><mrow>${t3}</mrow></math>`; } function N() { let e3 = "<mo>\u220F</mo>"; return O.forEach((t3, n3) => { const o2 = 2 * n3, r3 = L.slice(o2, o2 + 2); 2 === r3.length && (e3 += `<mmultiscripts><mi>${t3}</mi><none/><mi>${r3[1]}</mi><mprescripts></mprescripts><mi>${r3[0]}</mi><none/></mmultiscripts>`); }), D(0, `<munderover><mmultiscripts>${e3}</mmultiscripts></munderover>`); } function B() { const e3 = []; return O.forEach((t3, n3) => { const o2 = 2 * n3, r3 = L.slice(o2, o2 + 2); 2 === r3.length && e3.push(D(0, `<mmultiscripts><mi>${t3}</mi><none/><mi>${r3[1]}</mi><mprescripts></mprescripts><mi>${r3[0]}</mi><none/></mmultiscripts>`)); }), e3; } function H(e3, t3) { var n3; let o2 = x(); if ("unknown" === o2.name && e3.system && "object" == typeof e3.system && !Array.isArray(e3.system)) { const t4 = e3.system.browser; if (t4 && "object" == typeof t4 && !Array.isArray(t4)) { const e4 = t4; o2 = { name: e4.name || "unknown", version: e4.version || "unknown" }; } } const r3 = o2.name.toLowerCase(), i = o2.version.split(".")[0] || "0", s2 = parseInt(i, 10), c2 = [...(null == t3 ? void 0 : t3.exclude) || []], l2 = (null == t3 ? void 0 : t3.stabilize) || [], u2 = (null == t3 ? void 0 : t3.include) || []; for (const e4 of l2) { const t4 = a[e4]; if (t4) for (const e5 of t4) { const t5 = !("browsers" in e5), o3 = !t5 && (null === (n3 = e5.browsers) || void 0 === n3 ? void 0 : n3.some((e6) => { const t6 = e6.match(/(.+?)(>=)(\d+)/); if (t6) { const [, e7, , n4] = t6, o4 = parseInt(n4, 10); return r3 === e7 && s2 >= o4; } return r3 === e6; })); (t5 || o3) && c2.push(...e5.exclude); } } return function e4(t4, n4 = "") { const o3 = {}; for (const [r4, i2] of Object.entries(t4)) { const t5 = n4 ? `${n4}.${r4}` : r4; if ("object" != typeof i2 || Array.isArray(i2) || null === i2) { const e5 = c2.some((e6) => t5.startsWith(e6)), n5 = u2.some((e6) => t5.startsWith(e6)); e5 && !n5 || (o3[r4] = i2); } else { const n5 = e4(i2, t5); Object.keys(n5).length > 0 && (o3[r4] = n5); } } return o3; }(e3); } function z(e3) { return e3.storage_property_name ? e3.storage_property_name : e3.property_name_factory(G); } function K(e3, t3) { try { localStorage.setItem(z(t3), e3); } catch (e4) { } } function q(e3) { try { const t3 = localStorage.getItem(e3.property_name_factory(Y2)), n3 = JSON.parse(t3); return n3 || {}; } catch (e4) { } return {}; } function X(t3) { return t3.cache_lifetime_in_ms > e ? Date.now() + e : Date.now() + t3.cache_lifetime_in_ms; } async function te(e3) { var t3; const r3 = { ...o, ...e3 }, i = r3.logging && !sessionStorage.getItem("_tmjs_l") && Math.random() < 1e-4, a2 = { ...$, ...F }, { elapsed: s2, resolvedComponents: c2 } = await ne(a2, r3); let l2 = {}, u2 = {}; if (i || r3.experimental) { const { elapsed: e4, resolvedComponents: t4 } = await ne(V, r3); l2 = t4, u2 = e4; } const m2 = r3.api_key ? ee(r3, c2) : null; let d2 = null; if (m2) try { d2 = await m2; } catch (e4) { if (e4 instanceof Error && "INVALID_API_KEY" === e4.message) return { error: "Invalid API key or quota exceeded", components: {}, info: {}, version: "1.6.0", thumbmark: "" }; throw e4; } const p2 = { ...s2, ...u2 }, f2 = r3.performance ? { elapsed: p2 } : {}, g2 = H((null == d2 ? void 0 : d2.components) || {}, r3), w2 = { ...c2, ...g2 }, v2 = (null == d2 ? void 0 : d2.info) || { uniqueness: { score: "api only" } }; console.log(d2); const y2 = null !== (t3 = null == d2 ? void 0 : d2.thumbmark) && void 0 !== t3 ? t3 : h(k(w2)); i && async function(e4, t4, o2, r4 = {}) { var i2; const a3 = `${n}/log`, s3 = { thumbmark: e4, components: t4, experimental: r4, version: "1.6.0", options: o2, path: null === (i2 = null === window || void 0 === window ? void 0 : window.location) || void 0 === i2 ? void 0 : i2.pathname }; sessionStorage.setItem("_tmjs_l", "1"); try { await fetch(a3, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(s3) }); } catch (e5) { } }(y2, w2, r3, l2).catch(() => { }); return { ...(null == d2 ? void 0 : d2.visitorId) && { visitorId: d2.visitorId }, thumbmark: y2, components: w2, info: v2, version: "1.6.0", ...f2, ...Object.keys(l2).length > 0 && r3.experimental && { experimental: l2 } }; } async function ne(e3, t3) { const n3 = { ...o, ...t3 }, r3 = Object.entries(e3).filter(([e4]) => { var t4; return !(null === (t4 = null == n3 ? void 0 : n3.exclude) || void 0 === t4 ? void 0 : t4.includes(e4)); }).filter(([e4]) => { var t4, o2, r4, i2; return (null === (t4 = null == n3 ? void 0 : n3.include) || void 0 === t4 ? void 0 : t4.some((e5) => e5.includes("."))) ? null === (o2 = null == n3 ? void 0 : n3.include) || void 0 === o2 ? void 0 : o2.some((t5) => t5.startsWith(e4)) : 0 === (null === (r4 = null == n3 ? void 0 : n3.include) || void 0 === r4 ? void 0 : r4.length) || (null === (i2 = null == n3 ? void 0 : n3.include) || void 0 === i2 ? void 0 : i2.includes(e4)); }), i = r3.map(([e4]) => e4), a2 = r3.map(([e4, n4]) => n4(t3)), s2 = await function(e4, t4, n4) { return Promise.all(e4.map((e5) => { const o2 = performance.now(); return Promise.race([e5.then((e6) => ({ value: e6, elapsed: performance.now() - o2 })), (r4 = t4, i2 = n4, new Promise((e6) => { setTimeout(() => e6(i2), r4); })).then((e6) => ({ value: e6, elapsed: performance.now() - o2 }))]); var r4, i2; })); }(a2, (null == n3 ? void 0 : n3.timeout) || 5e3, j), c2 = {}, l2 = {}; s2.forEach((e4, t4) => { var n4; null != e4.value && (l2[i[t4]] = e4.value, c2[i[t4]] = null !== (n4 = e4.elapsed) && void 0 !== n4 ? n4 : 0); }); const u2 = H(l2, n3); return { elapsed: c2, resolvedComponents: u2 }; } var e, t, n, o, r, a, m, p, w, v, E, M, I, T, R, O, L, $, V, F, j, U, G, J, Y2, Z, Q, ee, ae; var init_thumbmark_esm = __esm({ "node_modules/@thumbmarkjs/thumbmarkjs/dist/thumbmark.esm.js"() { e = 2592e5; t = "thumbmark"; n = "https://api.thumbmarkjs.com"; o = { exclude: [], include: [], stabilize: ["private", "iframe"], logging: true, timeout: 5e3, cache_api_call: true, cache_lifetime_in_ms: 0, performance: false, experimental: false, property_name_factory: (e3) => `${t}_${e3}` }; r = { ...o }; a = { private: [{ exclude: ["canvas"], browsers: ["firefox", "safari>=17", "brave"] }, { exclude: ["audio"], browsers: ["samsungbrowser", "safari"] }, { exclude: ["fonts"], browsers: ["firefox"] }, { exclude: ["audio.sampleHash", "hardware.deviceMemory", "header.acceptLanguage.q", "system.hardwareConcurrency", "plugins"], browsers: ["brave"] }, { exclude: ["tls.extensions"], browsers: ["firefox", "chrome", "safari"] }, { exclude: ["header.acceptLanguage"], browsers: ["edge", "chrome"] }], iframe: [{ exclude: ["system.applePayVersion", "system.cookieEnabled"], browsers: ["safari"] }, { exclude: ["permissions"] }], vpn: [{ exclude: ["ip"] }] }; m = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]); p = 280; w = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"]; v = ["monospace", "sans-serif", "serif"]; E = (e3, t3, n3, o2) => { const r3 = (n3 - t3) / o2; let i = 0; for (let n4 = 0; n4 < o2; n4++) { i += e3(t3 + (n4 + 0.5) * r3); } return i * r3; }; M = ["accelerometer", "accessibility", "accessibility-events", "ambient-light-sensor", "background-fetch", "background-sync", "bluetooth", "camera", "clipboard-read", "clipboard-write", "device-info", "display-capture", "gyroscope", "geolocation", "local-fonts", "magnetometer", "microphone", "midi", "nfc", "notifications", "payment-handler", "persistent-storage", "push", "speaker", "storage-access", "top-level-storage-access", "window-management", "query"]; I = "SamsungBrowser" !== x().name ? 1 : 3; R = null; O = ["\u{1D504}", "\u{1D505}", "\u212D", "\u{1D507}", "\u{1D508}", "\u{1D509}", "\u{1D538}", "\u{1D539}", "\u2102", "\u{1D53B}", "\u{1D53C}", "\u{1D53D}"]; L = ["\u03B2", "\u03C8", "\u03BB", "\u03B5", "\u03B6", "\u03B1", "\u03BE", "\u03BC", "\u03C1", "\u03C6", "\u03BA", "\u03C4", "\u03B7", "\u03C3", "\u03B9", "\u03C9", "\u03B3", "\u03BD", "\u03C7", "\u03B4", "\u03B8", "\u03C0", "\u03C5", "\u03BF"]; $ = { audio: async function() { return async function() { return new Promise((e3, t3) => { try { const t4 = 44100, n3 = 5e3, o2 = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, n3, t4), r3 = o2.createBufferSource(), i = o2.createOscillator(); i.frequency.value = 1e3; const a2 = o2.createDynamicsCompressor(); let c2; a2.threshold.value = -50, a2.knee.value = 40, a2.ratio.value = 12, a2.attack.value = 0, a2.release.value = 0.2, i.connect(a2), a2.connect(o2.destination), i.start(), o2.oncomplete = (t5) => { c2 = t5.renderedBuffer.getChannelData(0), e3({ sampleHash: s(c2), maxChannels: o2.destination.maxChannelCount, channelCountMode: r3.channelCountMode }); }, o2.startRendering(); } catch (e4) { console.error("Error creating audio fingerprint:", e4), t3(e4); } }); }(); }, canvas: async function() { return new Promise((e3) => { const t3 = Array.from({ length: 3 }, () => function() { const e4 = document.createElement("canvas"), t4 = e4.getContext("2d"); if (!t4) return new ImageData(1, 1); e4.width = p, e4.height = 20; const n3 = t4.createLinearGradient(0, 0, e4.width, e4.height); n3.addColorStop(0, "red"), n3.addColorStop(1 / 6, "orange"), n3.addColorStop(2 / 6, "yellow"), n3.addColorStop(0.5, "green"), n3.addColorStop(4 / 6, "blue"), n3.addColorStop(5 / 6, "indigo"), n3.addColorStop(1, "violet"), t4.fillStyle = n3, t4.fillRect(0, 0, e4.width, e4.height); const o2 = "Random Text WMwmil10Oo"; t4.font = "23.123px Arial", t4.fillStyle = "black", t4.fillText(o2, -5, 15), t4.fillStyle = "rgba(0, 0, 255, 0.5)", t4.fillText(o2, -3.3, 17.7), t4.beginPath(), t4.moveTo(0, 0), t4.lineTo(2 * e4.width / 7, e4.height), t4.strokeStyle = "white", t4.lineWidth = 2, t4.stroke(); const r3 = t4.getImageData(0, 0, e4.width, e4.height); return r3; }()); e3({ commonPixelsHash: h(c(t3, p, 20).data.toString()).toString() }); }); }, fonts: async function(e3) { return new Promise((e4, t3) => { try { f(async ({ iframe: t4 }) => { const n3 = t4.createElement("canvas").getContext("2d"), o2 = v.map((e5) => y(n3, e5)); let r3 = {}; w.forEach((e5) => { const t5 = y(n3, e5); o2.includes(t5) || (r3[e5] = t5); }), e4(r3); }); } catch (e5) { t3({ error: "unsupported" }); } }); }, hardware: function() { return new Promise((e3, t3) => { const n3 = void 0 !== navigator.deviceMemory ? navigator.deviceMemory : 0, o2 = window.performance && window.performance.memory ? window.performance.memory : 0; e3({ videocard: S(), architecture: b(), deviceMemory: n3.toString() || "undefined", jsHeapSizeLimit: o2.jsHeapSizeLimit || 0 }); }); }, locales: function() { return new Promise((e3) => { e3({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone }); }); }, math: function() { return new Promise((e3) => { e3({ acos: Math.acos(0.5), asin: E(Math.asin, -1, 1, 97), cos: E(Math.cos, 0, Math.PI, 97), largeCos: Math.cos(1e20), largeSin: Math.sin(1e20), largeTan: Math.tan(1e20), sin: E(Math.sin, -Math.PI, Math.PI, 97), tan: E(Math.tan, 0, 2 * Math.PI, 97) }); }); }, permissions: async function(e3) { const t3 = (null == e3 ? void 0 : e3.permissions_to_check) || M; return P(await Promise.all(Array.from({ length: 3 }, () => async function(e4) { const t4 = {}; for (const n3 of e4) try { const e5 = await navigator.permissions.query({ name: n3 }); t4[n3] = e5.state.toString(); } catch (e5) { } return t4; }(t3))), t3); }, plugins: async function() { const e3 = []; if (navigator.plugins) for (let t3 = 0; t3 < navigator.plugins.length; t3++) { const n3 = navigator.plugins[t3]; e3.push([n3.name, n3.filename, n3.description].join("|")); } return new Promise((t3) => { t3({ plugins: e3 }); }); }, screen: function() { return new Promise((e3) => { const t3 = { is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: A() }; C() && navigator.maxTouchPoints > 0 && (t3.resolution = function() { const e4 = window.screen.width, t4 = window.screen.height, n3 = Math.max(e4, t4).toString(), o2 = Math.min(e4, t4).toString(); return `${n3}x${o2}`; }()), e3(t3); }); }, system: function() { return new Promise((e3) => { const t3 = x(); e3({ platform: window.navigator.platform, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: t3.name, version: t3.version }, mobile: C(), applePayVersion: _(), cookieEnabled: window.navigator.cookieEnabled }); }); }, webgl: async function() { "undefined" != typeof document && (T = document.createElement("canvas"), T.width = 200, T.height = 100, R = T.getContext("webgl")); try { if (!R) throw new Error("WebGL not supported"); const e3 = Array.from({ length: I }, () => function() { try { if (!R) throw new Error("WebGL not supported"); const e4 = "\n attribute vec2 position;\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n }\n ", t3 = "\n precision mediump float;\n void main() {\n gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color\n }\n ", n3 = R.createShader(R.VERTEX_SHADER), o2 = R.createShader(R.FRAGMENT_SHADER); if (!n3 || !o2) throw new Error("Failed to create shaders"); if (R.shaderSource(n3, e4), R.shaderSource(o2, t3), R.compileShader(n3), !R.getShaderParameter(n3, R.COMPILE_STATUS)) throw new Error("Vertex shader compilation failed: " + R.getShaderInfoLog(n3)); if (R.compileShader(o2), !R.getShaderParameter(o2, R.COMPILE_STATUS)) throw new Error("Fragment shader compilation failed: " + R.getShaderInfoLog(o2)); const r3 = R.createProgram(); if (!r3) throw new Error("Failed to create shader program"); if (R.attachShader(r3, n3), R.attachShader(r3, o2), R.linkProgram(r3), !R.getProgramParameter(r3, R.LINK_STATUS)) throw new Error("Shader program linking failed: " + R.getProgramInfoLog(r3)); R.useProgram(r3); const i = 137, a2 = new Float32Array(4 * i), s2 = 2 * Math.PI / i; for (let e5 = 0; e5 < i; e5++) { const t4 = e5 * s2; a2[4 * e5] = 0, a2[4 * e5 + 1] = 0, a2[4 * e5 + 2] = Math.cos(t4) * (T.width / 2), a2[4 * e5 + 3] = Math.sin(t4) * (T.height / 2); } const c2 = R.createBuffer(); R.bindBuffer(R.ARRAY_BUFFER, c2), R.bufferData(R.ARRAY_BUFFER, a2, R.STATIC_DRAW); const l2 = R.getAttribLocation(r3, "position"); R.enableVertexAttribArray(l2), R.vertexAttribPointer(l2, 2, R.FLOAT, false, 0, 0), R.viewport(0, 0, T.width, T.height), R.clearColor(0, 0, 0, 1), R.clear(R.COLOR_BUFFER_BIT), R.drawArrays(R.LINES, 0, 2 * i); const u2 = new Uint8ClampedArray(T.width * T.height * 4); R.readPixels(0, 0, T.width, T.height, R.RGBA, R.UNSIGNED_BYTE, u2); return new ImageData(u2, T.width, T.height); } catch (e4) { return new ImageData(1, 1); } finally { R && (R.bindBuffer(R.ARRAY_BUFFER, null), R.useProgram(null), R.viewport(0, 0, R.drawingBufferWidth, R.drawingBufferHeight), R.clearColor(0, 0, 0, 0)); } }()); return { commonPixelsHash: h(c(e3, T.width, T.height).data.toString()).toString() }; } catch (e3) { return { webgl: "unsupported" }; } } }; V = { webrtc: async function() { return new Promise((e3) => { try { const t3 = window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection; if (!t3) return void e3({ supported: false, error: "WebRTC not supported" }); const n3 = new t3({ iceCandidatePoolSize: 1, iceServers: [] }); n3.createDataChannel(""); (async () => { try { const t4 = { offerToReceiveAudio: true, offerToReceiveVideo: true }, o2 = await n3.createOffer(t4); await n3.setLocalDescription(o2); const r3 = o2.sdp || "", i = [...new Set((r3.match(/extmap:\d+ [^\n\r]+/g) || []).map((e4) => e4.replace(/extmap:\d+ /, "")))].sort(), a2 = (e4) => { const t5 = r3.match(new RegExp(`m=${e4} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`)); return t5 ? t5[1].split(" ") : []; }, s2 = (e4, t5) => t5.map((t6) => { const n4 = new RegExp(`(rtpmap|fmtp|rtcp-fb):${t6} (.+)`, "g"), o3 = [...r3.matchAll(n4)]; if (!o3.length) return null; const i2 = {}; return o3.forEach((t7) => { const [n5, o4, r4] = t7, a3 = r4.split("/"); "rtpmap" === o4 ? (i2.mimeType = `${e4}/${a3[0]}`, i2.clockRate = +a3[1], "audio" === e4 && (i2.channels = +a3[2] || 1)) : "rtcp-fb" === o4 ? (i2.feedbackSupport = i2.feedbackSupport || [], i2.feedbackSupport.push(r4)) : "fmtp" === o4 && (i2.sdpFmtpLine = r4); }), i2; }).filter(Boolean), c2 = s2("audio", a2("audio")), l2 = s2("video", a2("video")), u2 = { audio: { count: c2.length, hash: h(k(c2)) }, video: { count: l2.length, hash: h(k(l2)) }, extensionsHash: h(k(i)) }, m2 = await new Promise((e4) => { const t5 = setTimeout(() => { n3.removeEventListener("icecandidate", o3), n3.close(), e4({ supported: true, ...u2, timeout: true }); }, 3e3), o3 = (r4) => { const i2 = r4.candidate; i2 && i2.candidate && (clearTimeout(t5), n3.removeEventListener("icecandidate", o3), n3.close(), e4({ supported: true, ...u2, candidateType: i2.type || "" })); }; n3.addEventListener("icecandidate", o3); }); e3({ details: m2, hash: h(k(m2)) }); } catch (t4) { n3.close(), e3({ supported: true, error: `WebRTC offer failed: ${t4.message}` }); } })(); } catch (t3) { e3({ supported: false, error: `WebRTC error: ${t3.message}` }); } }); }, mathml: async function() { return new Promise((e3) => { try { f(async ({ iframe: t3 }) => { try { if (!function(e4) { try { const t4 = e4.createElement("math"); t4.innerHTML = "<mrow><mi>x</mi></mrow>", t4.style.position = "absolute", t4.style.visibility = "hidden", e4.body.appendChild(t4); const n4 = t4.getBoundingClientRect(); return e4.body.removeChild(t4), n4.width > 0 && n4.height > 0; } catch (e5) { return false; } }(t3)) return void e3({ supported: false, error: "MathML not supported" }); const n3 = [D("integral", "<msubsup><mo>\u222B</mo><mi>a</mi><mi>b</mi></msubsup><mfrac><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mrow><mi>g</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mfrac><mi>dx</mi>"), D("fraction", "<mfrac><mrow><mi>\u03C0</mi><mo>\xD7</mo><msup><mi>r</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><mi>\u03C3</mi></mrow></mfrac>"), D("matrix", "<mo>[</mo><mtable><mtr><mtd><mi>\u03B1</mi></mtd><mtd><mi>\u03B2</mi></mtd></mtr><mtr><mtd><mi>\u03B3</mi></mtd><mtd><mi>\u03B4</mi></mtd></mtr></mtable><mo>]</mo>"), N(), ...B()], o2 = []; let r3 = ""; n3.forEach((e4, n4) => { const i2 = function(e5, t4) { try { const n5 = t4.createElement("math"); n5.innerHTML = e5.replace(/<\/?math>/g, ""), n5.style.whiteSpace = "nowrap", n5.style.position = "absolute", n5.style.visibility = "hidden", n5.style.top = "-9999px", t4.body.appendChild(n5); const o3 = n5.getBoundingClientRect(), r4 = (t4.defaultView || window).getComputedStyle(n5), i3 = { dimensions: { width: o3.width, height: o3.height }, fontInfo: { fontFamily: r4.fontFamily, fontSize: r4.fontSize, fontWeight: r4.fontWeight, fontStyle: r4.fontStyle, lineHeight: r4.lineHeight, fontVariant: r4.fontVariant || "normal", fontStretch: r4.fontStretch || "normal", fontSizeAdjust: r4.fontSizeAdjust || "none", textRendering: r4.textRendering || "auto", fontFeatureSettings: r4.fontFeatureSettings || "normal", fontVariantNumeric: r4.fontVariantNumeric || "normal", fontKerning: r4.fontKerning || "auto" } }; return t4.body.removeChild(n5), i3; } catch (e6) { return { error: e6.message }; } }(e4, t3); o2.push({ width: i2.dimensions.width, height: i2.dimensions.height }), 0 === n4 && i2.fontInfo && (r3 = h(k(i2.fontInfo))); }); const i = { fontStyleHash: r3, dimensions: o2 }; e3({ details: i, hash: h(k(i)) }); } catch (t4) { e3({ supported: false, error: `MathML error: ${t4.message}` }); } }); } catch (t3) { e3({ supported: false, error: `MathML error: ${t3.message}` }); } }); }, speech: async function() { return new Promise((e3) => { try { if ("undefined" == typeof window || !window.speechSynthesis || "function" != typeof window.speechSynthesis.getVoices) return void e3({ supported: false, error: "Speech Synthesis API not supported" }); let t3 = false, n3 = null; const o2 = (o3) => { if (!t3) { t3 = true, n3 && clearTimeout(n3); try { const t4 = o3.map((e4) => { const t5 = (e5) => e5.replace(/\\/g, "\\\\").replace(/,/g, "\\,"); return [t5(e4.voiceURI || ""), t5(e4.name || ""), t5(e4.lang || ""), e4.localService ? "1" : "0", e4.default ? "1" : "0"].join(","); }); t4.sort(); const n4 = { voiceCount: o3.length, voicesHash: h(k(t4)) }; e3({ details: n4, hash: h(k(n4)) }); } catch (t4) { e3({ supported: true, error: `Voice processing failed: ${t4.message}` }); } } }, r3 = window.speechSynthesis.getVoices(); if (r3.length > 0) return void o2(r3); n3 = setTimeout(() => { const e4 = window.speechSynthesis.getVoices(); o2(e4); }, 800); const i = () => { window.speechSynthesis.removeEventListener("voiceschanged", i); const e4 = window.speechSynthesis.getVoices(); o2(e4); }; window.speechSynthesis.addEventListener("voiceschanged", i); } catch (t3) { e3({ supported: false, error: `Speech Synthesis error: ${t3.message}` }); } }); } }; F = {}; j = { timeout: "true" }; U = (e3, t3, n3) => { F[e3] = t3; }; G = "visitor_id"; J = `${t}_${G}`; Y2 = "cache"; Z = null; Q = null; ee = (e3, t3) => { if (e3.cache_api_call) { if (Q) return Promise.resolve(Q); const t4 = function(e4) { const t5 = q(e4); if (t5 && t5.apiResponse && t5.apiResponseExpiry && Date.now() <= t5.apiResponseExpiry) return t5.apiResponse; return; }(e3); if (t4) return Promise.resolve(t4); } if (Z) return Z; const o2 = `${e3.api_endpoint || n}/thumbmark`, r3 = function(e4) { try { const t4 = z(e4); let n3 = localStorage.getItem(t4); return n3 || t4 === J || (n3 = localStorage.getItem(J), n3 && K(n3, e4)), n3; } catch (e5) { return null; } }(e3), i = { components: t3, options: e3, clientHash: h(k(t3)), version: "1.6.0" }; r3 && (i.visitorId = r3); const a2 = fetch(o2, { method: "POST", headers: { "x-api-key": e3.api_key, Authorization: "custom-authorized", "Content-Type": "application/json" }, body: JSON.stringify(i) }).then((e4) => { if (!e4.ok) { if (403 === e4.status) throw new Error("INVALID_API_KEY"); throw new Error(`HTTP error! status: ${e4.status}`); } return e4.json(); }).then((t4) => (t4.visitorId && t4.visitorId !== r3 && K(t4.visitorId, e3), Q = t4, function(e4, t5) { if (!e4.cache_api_call || !e4.cache_lifetime_in_ms) return; !function(e5, t6) { const n3 = { ...q(e5), ...t6 }; try { localStorage.setItem(e5.property_name_factory(Y2), JSON.stringify(n3)); } catch (e6) { } }(e4, { apiResponseExpiry: X(e4), apiResponse: t5 }); }(e3, t4), Z = null, t4)).catch((e4) => { if (console.error("Error fetching pro data", e4), Z = null, "INVALID_API_KEY" === e4.message) throw e4; return null; }), s2 = e3.timeout || 5e3, c2 = new Promise((e4) => { setTimeout(() => { e4({ info: { timed_out: true }, version: "1.6.0" }); }, s2); }); return Z = Promise.race([a2, c2]), Z; }; ae = class { constructor(e3) { this.options = { ...o, ...e3 }; } async get(e3) { return te({ ...this.options, ...e3 }); } getVersion() { return "1.6.0"; } includeComponent(e3, t3) { U(e3, t3); } }; } }); // app/javascript/script/utils.js var getUrlParam, sanitisedCurrentUrl, wildcardToRegExp, regExpEscape, triggerEvent, isVerificationMode, getReferrerParam, isCampaignVerification, isUpscribeVerification, isPartnerProgramVerification, isTestMode, isDebugMode, isPartnerMode, isHostedReferralHubPage, isHostedUpscribePage, globalConfig, visitorData, subscriberData, retrieveReferrerCode, retrieveUpscribeSettings, subscriberFormData, showFlashMessages, showTestModeBanner, widgetsAllowed, storeCookie, calculateFingerprint, setDefaultCssVariables, loadCustomCSS, loadStylesheet, preloadAsset, copyToClipboard, detectEmailInForm, detectSubmitButtonInForm, isGravityFormsWithoutEmail, isKitNativeForm, numberWithCommas, createElement, poweredByLink, proxyComponents, generateUuidV7; var init_utils = __esm({ "app/javascript/script/utils.js"() { init_flash(); init_js_cookie(); init_thumbmark_esm(); getUrlParam = (param) => { const urlParams = new URLSearchParams(window.location.search); return urlParams.get(param); }; sanitisedCurrentUrl = () => { const currentUrl = window.location.origin + window.location.pathname; return currentUrl.replace(/\/$/, ""); }; wildcardToRegExp = (s2) => { return new RegExp("^" + s2.split(/\*+/).map(regExpEscape).join(".*") + "$"); }; regExpEscape = (s2) => { return s2.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); }; triggerEvent = (name) => { const event = new Event(`sl:${name}`); document.dispatchEvent(event); }; isVerificationMode = () => { return !!getUrlParam("SLVerifyInstall"); }; getReferrerParam = () => { return getUrlParam("rh_ref") || getUrlParam("rh_partner"); }; isCampaignVerification = () => { return isVerificationMode() && getUrlParam("SLVerifyInstall").includes("MF"); }; isUpscribeVerification = () => { return isVerificationMode() && getUrlParam("SLVerifyInstall").includes("upscribe"); }; isPartnerProgramVerification = () => { return isVerificationMode() && getUrlParam("SLVerifyInstall").includes("partner_program"); }; isTestMode = () => { return window.SL.config.test_mode || getUrlParam("test_mode") == "true"; }; isDebugMode = () => { return getUrlParam("debug") == "true"; }; isPartnerMode = () => { return getUrlParam("partner_mode") == "true"; }; isHostedReferralHubPage = () => { return window.location.hostname === "referralhub.page"; }; isHostedUpscribePage = () => { return window.location.hostname === "upscribe.page"; }; globalConfig = () => { return window.SL.config || {}; }; visitorData = (attrs = {}) => { let visitor = window.SL.visitor || {}; if (Object.keys(attrs).length) { visitor = Object.assign(visitor, attrs); } ; window.SL.visitor = visitor; return window.SL.visitor; }; subscriberData = (attrs = null) => { let visitor = visitorData(); if (attrs && Object.keys(visitor).length) { visitor.subscriber = attrs; triggerEvent("subscriber-updated"); } ; return visitor.subscriber; }; retrieveReferrerCode = () => { return isVerificationMode() ? getUrlParam("rh_ref") : visitorData().referrer; }; retrieveUpscribeSettings = (upscribe_id = null) => { const upscribes = globalConfig().widgets.upscribes; const upscribeSettings = upscribe_id ? upscribes.find((upscribe) => upscribe.uuid == upscribe_id) : upscribes[0]; return upscribeSettings; }; subscriberFormData = () => { const visitor = visitorData(); return { uuid: globalConfig().uuid, referrer_code: retrieveReferrerCode(), campaign_id: visitor.campaign, utm_source: visitor.utm_source, utm_campaign: visitor.utm_campaign, origin: visitor.origin, email: visitor.email }; }; showFlashMessages = () => { return getUrlParam("flash_messages") == "true"; }; showTestModeBanner = () => { if (isTestMode() && showFlashMessages()) { message("TEST MODE ENABLED", "You're currently in test mode. No data will be stored while in test mode"); } }; widgetsAllowed = () => { return window.SLConfig.plan != "lite_v3" || isTestMode() || isHostedReferralHubPage(); }; storeCookie = (name, value, days = 30) => { if (isVerificationMode() || isTestMode()) { return false; } const rootDomain = window.location.hostname.replace("www.", ""); if (value) { js_cookie_def