@builder.io/sdk-vue
Version:
Builder.io SDK for Vue
1,264 lines • 270 kB
JavaScript
import { defineComponent as B, openBlock as v, createElementBlock as w, Fragment as z, createBlock as U, resolveDynamicComponent as dt, mergeProps as q, toHandlers as ye, withCtx as me, renderSlot as pe, resolveComponent as W, createTextVNode as Xo, toDisplayString as Ut, defineAsyncComponent as st, createVNode as ee, renderList as ve, createCommentVNode as F, h as Mr, createElementVNode as Ge, normalizeStyle as Pe, normalizeClass as gt, markRaw as Yo } from "vue";
const Qo = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), Zo = (e) => typeof e == "string" && Qo.has(e.toLowerCase());
function de(e = {}, t, n) {
const r = {};
for (const o in e) {
if (!e[o] || n && !o.startsWith(t))
continue;
const i = n ? o.replace(t, "") : o;
r[i] = e[o];
}
return r;
}
const ei = B({
name: "dynamic-renderer",
props: ["TagName", "attributes", "actionAttributes"],
data() {
return { isEmptyElement: Zo };
}
}), j = (e, t) => {
const n = e.__vccOpts || e;
for (const [r, o] of t)
n[r] = o;
return n;
};
function ti(e, t, n, r, o, i) {
return e.isEmptyElement(e.TagName) ? (v(), U(dt(e.TagName), q({ key: 1 }, e.attributes, ye(e.actionAttributes)), null, 16)) : (v(), w(z, { key: 0 }, [
typeof e.TagName == "string" ? (v(), U(dt(e.TagName), q({ key: 0 }, e.attributes, ye(e.actionAttributes)), {
default: me(() => [
pe(e.$slots, "default")
]),
_: 3
}, 16)) : (v(), U(dt(e.TagName), q({ key: 1 }, e.attributes, ye(e.actionAttributes)), {
default: me(() => [
pe(e.$slots, "default")
]),
_: 3
}, 16))
], 64));
}
const En = /* @__PURE__ */ j(ei, [["render", ti]]), Zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: En
}, Symbol.toStringTag, { value: "Module" })), G = "vue", Oe = () => {
switch (G) {
case "react":
case "reactNative":
case "rsc":
return "className";
case "svelte":
case "vue":
case "solid":
case "qwik":
case "angular":
return "class";
}
}, ni = B({
name: "builder-button",
components: { DynamicRenderer: En },
props: [
"attributes",
"link",
"openLinkInNewTab",
"builderLinkComponent",
"text"
],
data() {
return { filterAttrs: de };
},
methods: {
attrs() {
return {
...de(this.attributes, "v-on:", !1),
[Oe()]: `${this.link ? "" : "builder-button"} ${this.attributes[Oe()] || ""}`,
...this.link ? {
href: this.link,
target: this.openLinkInNewTab ? "_blank" : void 0,
role: "link"
} : {
role: "button"
}
};
}
}
});
function ri(e, t, n, r, o, i) {
const s = W("DynamicRenderer");
return v(), U(s, {
attributes: e.attrs(),
TagName: e.link ? e.builderLinkComponent || "a" : "button",
actionAttributes: e.filterAttrs(e.attributes, "v-on:", !0)
}, {
default: me(() => [
Xo(Ut(e.text), 1)
]),
_: 1
}, 8, ["attributes", "TagName", "actionAttributes"]);
}
const oi = /* @__PURE__ */ j(ni, [["render", ri]]), ii = Symbol(), yn = {
Builder: {
content: null,
context: {},
localState: void 0,
rootSetState() {
},
rootState: {},
apiKey: null,
apiVersion: void 0,
componentInfos: {},
inheritedStyles: {},
BlocksWrapper: "div",
BlocksWrapperProps: {},
nonce: "",
model: ""
},
key: ii
}, si = Symbol(), Hr = {
Components: { registeredComponents: {} },
key: si
}, Pt = "[Builder.io]: ", ue = {
log: (...e) => console.log(Pt, ...e),
error: (...e) => console.error(Pt, ...e),
warn: (...e) => console.warn(Pt, ...e),
debug: (...e) => console.debug(Pt, ...e)
}, Kr = (e, t, n) => {
const r = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((o, i) => o != null ? o[i] : o, e);
return r === void 0 || r === e ? n : r;
};
function M() {
return typeof window < "u" && typeof document < "u";
}
const ai = (e) => {
const t = {};
return e.forEach((n, r) => {
t[r] = n;
}), t;
}, zr = (e) => e instanceof URLSearchParams ? ai(e) : e, qr = (e) => typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : new URLSearchParams(e).toString();
function li() {
return M() && window.self !== window.top;
}
function oe(e) {
return li() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
qr(e || window.location.search).indexOf("builder.frameEditing=") !== -1;
}
const ui = () => {
if (M()) {
const e = new URL(location.href);
return e.pathname === "" && (e.pathname = "/"), e;
} else
return console.warn("Cannot get location for tracking in non-browser environment"), null;
}, ci = () => typeof navigator == "object" && navigator.userAgent || "", Gr = () => {
const e = ci(), t = {
Android() {
return e.match(/Android/i);
},
BlackBerry() {
return e.match(/BlackBerry/i);
},
iOS() {
return e.match(/iPhone|iPod/i);
},
Opera() {
return e.match(/Opera Mini/i);
},
Windows() {
return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
},
any() {
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || G === "reactNative";
}
}, n = e.match(/Tablet|iPad/i), r = ui();
return {
urlPath: r == null ? void 0 : r.pathname,
host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
device: n ? "tablet" : t.any() ? "mobile" : "desktop"
};
}, _r = ({
builder: e,
context: t,
event: n,
state: r
}) => Object.entries({
state: r,
Builder: e,
// legacy
builder: e,
context: t,
event: n
}), pi = () => ({
isEditing: oe(),
isBrowser: M(),
isServer: !M(),
getUserAttributes: () => Gr()
}), di = (e, {
isExpression: t = !0
}) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e;
function In({
rootState: e,
localState: t,
rootSetState: n
}) {
return new Proxy(e, {
get: (r, o) => {
if (t && o in t)
return t[o];
const i = r[o];
return typeof i == "object" && i !== null ? In({
rootState: i,
localState: void 0,
rootSetState: n ? (s) => {
r[o] = s, n(r);
} : void 0
}) : i;
},
set: (r, o, i) => {
if (t && o in t)
throw new Error("Writing to local state is not allowed as it is read-only.");
return r[o] = i, n == null || n(r), !0;
}
});
}
const hi = ({
code: e,
builder: t,
context: n,
event: r,
localState: o,
rootSetState: i,
rootState: s
}) => {
const u = _r({
builder: t,
context: n,
event: r,
state: In({
rootState: s,
localState: o,
rootSetState: i
})
});
return new Function(...u.map(([c]) => c), e)(...u.map(([, c]) => c));
};
var V, fi = function(e) {
function t(a) {
return 48 > a ? a === 36 : 58 > a ? !0 : 65 > a ? !1 : 91 > a ? !0 : 97 > a ? a === 95 : 123 > a ? !0 : 170 <= a && _o.test(String.fromCharCode(a));
}
function n(a) {
return 65 > a ? a === 36 : 91 > a ? !0 : 97 > a ? a === 95 : 123 > a ? !0 : 170 <= a && Tr.test(String.fromCharCode(a));
}
function r(a, l) {
for (var p = k, h = 1, P = 0; ; ) {
$t.lastIndex = P;
var Q = $t.exec(p);
if (Q && Q.index < a)
++h, P = Q.index + Q[0].length;
else
break;
}
throw p = {
line: h,
ab: a - P
}, l += " (" + p.line + ":" + p.ab + ")", l = new SyntaxError(l), l.j = a, l.X = p, l.o = d, l;
}
function o(a) {
a = a.split(" ");
for (var l = /* @__PURE__ */ Object.create(null), p = 0; p < a.length; p++)
l[a[p]] = !0;
return function(h) {
return l[h] || !1;
};
}
function i() {
this.line = Ve, this.ab = d - ke;
}
function s(a, l) {
Fe = d, O.C && (Yt = new i()), $ = a, c(), he = l, tt = a.m;
}
function u() {
for (var a = d, l = O.va && O.C && new i(), p = k.charCodeAt(d += 2); d < Le && p !== 10 && p !== 13 && p !== 8232 && p !== 8233; )
++d, p = k.charCodeAt(d);
O.va && O.va(!1, k.slice(a + 2, d), a, d, l, O.C && new i());
}
function c() {
for (; d < Le; ) {
var a = k.charCodeAt(d);
if (a === 32)
++d;
else if (a === 13)
++d, a = k.charCodeAt(d), a === 10 && ++d, O.C && (++Ve, ke = d);
else if (a === 10 || a === 8232 || a === 8233)
++d, O.C && (++Ve, ke = d);
else if (8 < a && 14 > a)
++d;
else if (a === 47)
if (a = k.charCodeAt(d + 1), a === 42) {
a = void 0;
var l = O.va && O.C && new i(), p = d, h = k.indexOf("*/", d += 2);
if (h === -1 && r(d - 2, "Unterminated comment"), d = h + 2, O.C)
for ($t.lastIndex = p; (a = $t.exec(k)) && a.index < d; )
++Ve, ke = a.index + a[0].length;
O.va && O.va(!0, k.slice(p + 2, h), p, d, l, O.C && new i());
} else if (a === 47)
u();
else
break;
else if (a === 160)
++d;
else if (5760 <= a && Go.test(String.fromCharCode(a)))
++d;
else
break;
}
}
function f(a) {
switch (a) {
case 46:
a = k.charCodeAt(d + 1), 48 <= a && 57 >= a ? A(!0) : (++d, s(gr));
return;
case 40:
return ++d, s(Ce);
case 41:
return ++d, s(ge);
case 59:
return ++d, s(we);
case 44:
return ++d, s($e);
case 91:
return ++d, s(ln);
case 93:
return ++d, s(un);
case 123:
return ++d, s(ot);
case 125:
return ++d, s(He);
case 58:
return ++d, s(it);
case 63:
return ++d, s(yr);
case 48:
if (a = k.charCodeAt(d + 1), a === 120 || a === 88) {
d += 2, a = S(16), a === null && r(Y + 2, "Expected hexadecimal number"), n(k.charCodeAt(d)) && r(d, "Identifier directly after number"), s(rt, a);
return;
}
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
return A(!1);
case 34:
case 39:
d++;
for (var l = ""; ; ) {
d >= Le && r(Y, "Unterminated string constant");
var p = k.charCodeAt(d);
if (p === a) {
++d, s(It, l);
break;
}
if (p === 92) {
p = k.charCodeAt(++d);
var h = /^[0-7]+/.exec(k.slice(d, d + 3));
for (h && (h = h[0]); h && 255 < parseInt(h, 8); )
h = h.slice(0, -1);
if (h === "0" && (h = null), ++d, h)
ce && r(d - 2, "Octal literal in strict mode"), l += String.fromCharCode(parseInt(h, 8)), d += h.length - 1;
else
switch (p) {
case 110:
l += `
`;
break;
case 114:
l += "\r";
break;
case 120:
l += String.fromCharCode(x(2));
break;
case 117:
l += String.fromCharCode(x(4));
break;
case 85:
l += String.fromCharCode(x(8));
break;
case 116:
l += " ";
break;
case 98:
l += "\b";
break;
case 118:
l += "\v";
break;
case 102:
l += "\f";
break;
case 48:
l += "\0";
break;
case 13:
k.charCodeAt(d) === 10 && ++d;
case 10:
O.C && (ke = d, ++Ve);
break;
default:
l += String.fromCharCode(p);
}
} else
p !== 13 && p !== 10 && p !== 8232 && p !== 8233 || r(Y, "Unterminated string constant"), l += String.fromCharCode(p), ++d;
}
return;
case 47:
a = k.charCodeAt(d + 1), tt ? (++d, m()) : a === 61 ? b(De, 2) : b(vr, 1);
return;
case 37:
case 42:
k.charCodeAt(d + 1) === 61 ? b(De, 2) : b(Ko, 1);
return;
case 124:
case 38:
l = k.charCodeAt(d + 1), l === a ? b(a === 124 ? kr : Cr, 2) : l === 61 ? b(De, 2) : b(a === 124 ? Do : Wo, 1);
return;
case 94:
k.charCodeAt(d + 1) === 61 ? b(De, 2) : b(Uo, 1);
return;
case 43:
case 45:
l = k.charCodeAt(d + 1), l === a ? l === 45 && k.charCodeAt(d + 2) === 62 && xt.test(k.slice(xe, d)) ? (d += 3, u(), c(), y()) : b(Vo, 2) : l === 61 ? b(De, 2) : b(Ho, 1);
return;
case 60:
case 62:
l = k.charCodeAt(d + 1), p = 1, l === a ? (p = a === 62 && k.charCodeAt(d + 2) === 62 ? 3 : 2, k.charCodeAt(d + p) === 61 ? b(De, p + 1) : b(Mo, p)) : l === 33 && a === 60 && k.charCodeAt(d + 2) === 45 && k.charCodeAt(d + 3) === 45 ? (d += 4, u(), c(), y()) : (l === 61 && (p = k.charCodeAt(d + 2) === 61 ? 3 : 2), b(Fo, p));
return;
case 61:
case 33:
k.charCodeAt(d + 1) === 61 ? b(Lo, k.charCodeAt(d + 2) === 61 ? 3 : 2) : b(a === 61 ? br : Sr, 1);
return;
case 126:
return b(Sr, 1);
}
return !1;
}
function y(a) {
if (a ? d = Y + 1 : Y = d, O.C && (Xt = new i()), a)
return m();
if (d >= Le)
return s(en);
if (a = k.charCodeAt(d), n(a) || a === 92)
return te();
if (f(a) === !1) {
if (a = String.fromCharCode(a), a === "\\" || Tr.test(a))
return te();
r(d, "Unexpected character '" + a + "'");
}
}
function b(a, l) {
var p = k.slice(d, d + l);
d += l, s(a, p);
}
function m() {
for (var a, l, p = d; ; ) {
d >= Le && r(p, "Unterminated regexp");
var h = k.charAt(d);
if (xt.test(h) && r(p, "Unterminated regexp"), a)
a = !1;
else {
if (h === "[")
l = !0;
else if (h === "]" && l)
l = !1;
else if (h === "/" && !l)
break;
a = h === "\\";
}
++d;
}
a = k.slice(p, d), ++d, (l = H()) && !/^[gmi]*$/.test(l) && r(p, "Invalid regexp flag");
try {
var P = new RegExp(a, l);
} catch (Q) {
throw Q instanceof SyntaxError && r(p, Q.message), Q;
}
s(Yn, P);
}
function S(a, l) {
for (var p = d, h = 0, P = l === void 0 ? 1 / 0 : l, Q = 0; Q < P; ++Q) {
var se = k.charCodeAt(d);
if (se = 97 <= se ? se - 97 + 10 : 65 <= se ? se - 65 + 10 : 48 <= se && 57 >= se ? se - 48 : 1 / 0, se >= a)
break;
++d, h = h * a + se;
}
return d === p || l !== void 0 && d - p !== l ? null : h;
}
function A(a) {
var l = d, p = !1, h = k.charCodeAt(d) === 48;
a || S(10) !== null || r(l, "Invalid number"), k.charCodeAt(d) === 46 && (++d, S(10), p = !0), a = k.charCodeAt(d), (a === 69 || a === 101) && (a = k.charCodeAt(++d), a !== 43 && a !== 45 || ++d, S(10) === null && r(l, "Invalid number"), p = !0), n(k.charCodeAt(d)) && r(d, "Identifier directly after number"), a = k.slice(l, d);
var P;
p ? P = parseFloat(a) : h && a.length !== 1 ? /[89]/.test(a) || ce ? r(l, "Invalid number") : P = parseInt(a, 8) : P = parseInt(a, 10), s(rt, P);
}
function x(a) {
return a = S(16, a), a === null && r(Y, "Bad character escape sequence"), a;
}
function H() {
Ke = !1;
for (var a, l = !0, p = d; ; ) {
var h = k.charCodeAt(d);
if (t(h))
Ke && (a += k.charAt(d)), ++d;
else if (h === 92) {
Ke || (a = k.slice(p, d)), Ke = !0, k.charCodeAt(++d) !== 117 && r(d, "Expecting Unicode escape sequence \\uXXXX"), ++d, h = x(4);
var P = String.fromCharCode(h);
P || r(d - 1, "Invalid Unicode escape"), (l ? n(h) : t(h)) || r(d - 4, "Invalid Unicode escape"), a += P;
} else
break;
l = !1;
}
return Ke ? a : k.slice(p, d);
}
function te() {
var a = H(), l = Me;
!Ke && qo(a) && (l = jo[a]), s(l, a);
}
function E() {
Qt = Y, xe = Fe, Zt = Yt, y();
}
function D(a) {
if (ce = a, d = Y, O.C)
for (; d < ke; )
ke = k.lastIndexOf(`
`, ke - 2) + 1, --Ve;
c(), y();
}
function ie() {
this.type = null, this.start = Y, this.end = null;
}
function Ae() {
this.start = Xt, this.end = null, Jt && (this.source = Jt);
}
function K() {
var a = new ie();
return O.C && (a.X = new Ae()), O.vb && (a.sourceFile = O.vb), O.Xa && (a.j = [Y, 0]), a;
}
function _(a) {
var l = new ie();
return l.start = a.start, O.C && (l.X = new Ae(), l.X.start = a.X.start), O.Xa && (l.j = [a.j[0], 0]), l;
}
function R(a, l) {
return a.type = l, a.end = xe, O.C && (a.X.end = Zt), O.Xa && (a.j[1] = xe), a;
}
function We(a) {
return a.type === "ExpressionStatement" && a.la.type === "Literal" && a.la.value === "use strict";
}
function L(a) {
return $ === a ? (E(), !0) : !1;
}
function wt() {
return !O.fc && ($ === en || $ === He || xt.test(k.slice(xe, Y)));
}
function je() {
L(we) || wt() || be();
}
function J(a) {
$ === a ? E() : be();
}
function be() {
r(Y, "Unexpected token");
}
function Tt(a) {
a.type !== "Identifier" && a.type !== "MemberExpression" && r(a.start, "Assigning to rvalue"), ce && a.type === "Identifier" && At(a.name) && r(a.start, "Assigning to " + a.name + " in strict mode");
}
function fe() {
($ === vr || $ === De && he === "/=") && y(!0);
var a = $, l = K();
switch (a) {
case tn:
case Zn:
E();
var p = a === tn;
L(we) || wt() ? l.label = null : $ !== Me ? be() : (l.label = Se(), je());
for (var h = 0; h < X.length; ++h) {
var P = X[h];
if ((l.label === null || P.name === l.label.name) && (P.kind !== null && (p || P.kind === "loop") || l.label && p))
break;
}
return h === X.length && r(l.start, "Unsyntactic " + a.l), R(l, p ? "BreakStatement" : "ContinueStatement");
case er:
return E(), je(), R(l, "DebuggerStatement");
case nr:
return E(), X.push(cn), l.body = fe(), X.pop(), J(an), l.test = Qe(), je(), R(l, "DoWhileStatement");
case ir:
return E(), X.push(cn), J(Ce), $ === we ? Ht(l, null) : $ === sn ? (a = K(), E(), Jn(a, !0), R(a, "VariableDeclaration"), a.fa.length === 1 && L(Rt) ? _n(l, a) : Ht(l, a)) : (a = re(!1, !0), L(Rt) ? (Tt(a), _n(l, a)) : Ht(l, a));
case rn:
return E(), Gt(l, !0);
case sr:
return E(), l.test = Qe(), l.da = fe(), l.alternate = L(rr) ? fe() : null, R(l, "IfStatement");
case ar:
return nt || O.Ib || r(Y, "'return' outside of function"), E(), L(we) || wt() ? l.K = null : (l.K = re(), je()), R(l, "ReturnStatement");
case on:
for (E(), l.Qb = Qe(), l.tb = [], J(ot), X.push(Jo); $ !== He; )
$ === nn || $ === tr ? (a = $ === nn, h && R(h, "SwitchCase"), l.tb.push(h = K()), h.da = [], E(), a ? h.test = re() : (p && r(Qt, "Multiple default clauses"), p = !0, h.test = null), J(it)) : (h || be(), h.da.push(fe()));
return h && R(h, "SwitchCase"), E(), X.pop(), R(l, "SwitchStatement");
case lr:
return E(), xt.test(k.slice(xe, Y)) && r(xe, "Illegal newline after throw"), l.K = re(), je(), R(l, "ThrowStatement");
case ur:
return E(), l.block = Ze(), l.Ea = null, $ === Qn && (a = K(), E(), J(Ce), a.Ua = Se(), ce && At(a.Ua.name) && r(a.Ua.start, "Binding " + a.Ua.name + " in strict mode"), J(ge), a.body = Ze(), l.Ea = R(a, "CatchClause")), l.fb = L(or) ? Ze() : null, l.Ea || l.fb || r(l.start, "Missing catch or finally clause"), R(l, "TryStatement");
case sn:
return E(), Jn(l), je(), R(l, "VariableDeclaration");
case an:
return E(), l.test = Qe(), X.push(cn), l.body = fe(), X.pop(), R(l, "WhileStatement");
case cr:
return ce && r(Y, "'with' in strict mode"), E(), l.object = Qe(), l.body = fe(), R(l, "WithStatement");
case ot:
return Ze();
case we:
return E(), R(l, "EmptyStatement");
default:
if (p = he, P = re(), a === Me && P.type === "Identifier" && L(it)) {
for (h = 0; h < X.length; ++h)
X[h].name === p && r(P.start, "Label '" + p + "' is already declared");
return X.push({
name: p,
kind: $.W ? "loop" : $ === on ? "switch" : null
}), l.body = fe(), X.pop(), l.label = P, R(l, "LabeledStatement");
}
return l.la = P, je(), R(l, "ExpressionStatement");
}
}
function Qe() {
J(Ce);
var a = re();
return J(ge), a;
}
function Ze(a) {
var l = K(), p = !0, h = !1;
for (l.body = [], J(ot); !L(He); ) {
var P = fe();
if (l.body.push(P), p && a && We(P)) {
var Q = h;
D(h = !0);
}
p = !1;
}
return h && !Q && D(!1), R(l, "BlockStatement");
}
function Ht(a, l) {
return a.ua = l, J(we), a.test = $ === we ? null : re(), J(we), a.update = $ === ge ? null : re(), J(ge), a.body = fe(), X.pop(), R(a, "ForStatement");
}
function _n(a, l) {
return a.left = l, a.right = re(), J(ge), a.body = fe(), X.pop(), R(a, "ForInStatement");
}
function Jn(a, l) {
for (a.fa = [], a.kind = "var"; ; ) {
var p = K();
if (p.id = Se(), ce && At(p.id.name) && r(p.id.start, "Binding " + p.id.name + " in strict mode"), p.ua = L(br) ? re(!0, l) : null, a.fa.push(R(p, "VariableDeclarator")), !L($e))
break;
}
}
function re(a, l) {
var p = Kt(l);
if (!a && $ === $e) {
for (a = _(p), a.xb = [p]; L($e); )
a.xb.push(Kt(l));
return R(a, "SequenceExpression");
}
return p;
}
function Kt(a) {
var l = zt(qt(), -1, a);
if (L(yr)) {
var p = _(l);
p.test = l, p.da = re(!0), J(it), p.alternate = re(!0, a), l = R(p, "ConditionalExpression");
}
return $.Cb ? (p = _(l), p.operator = he, p.left = l, E(), p.right = Kt(a), Tt(l), R(p, "AssignmentExpression")) : l;
}
function zt(a, l, p) {
var h = $.L;
if (h !== null && (!p || $ !== Rt) && h > l) {
var P = _(a);
return P.left = a, P.operator = he, a = $, E(), P.right = zt(qt(), h, p), h = R(P, a === kr || a === Cr ? "LogicalExpression" : "BinaryExpression"), zt(h, l, p);
}
return a;
}
function qt() {
if ($.prefix) {
var a = K(), l = $.$b;
return a.operator = he, tt = a.prefix = !0, E(), a.K = qt(), l ? Tt(a.K) : ce && a.operator === "delete" && a.K.type === "Identifier" && r(a.start, "Deleting local variable in strict mode"), R(a, l ? "UpdateExpression" : "UnaryExpression");
}
for (l = et(Et()); $.cc && !wt(); )
a = _(l), a.operator = he, a.prefix = !1, a.K = l, Tt(l), E(), l = R(a, "UpdateExpression");
return l;
}
function et(a, l) {
if (L(gr)) {
var p = _(a);
return p.object = a, p.Wa = Se(!0), p.bb = !1, et(R(p, "MemberExpression"), l);
}
return L(ln) ? (p = _(a), p.object = a, p.Wa = re(), p.bb = !0, J(un), et(R(p, "MemberExpression"), l)) : !l && L(Ce) ? (p = _(a), p.callee = a, p.arguments = _t(ge, !1), et(R(p, "CallExpression"), l)) : a;
}
function Et() {
switch ($) {
case dr:
var a = K();
return E(), R(a, "ThisExpression");
case Me:
return Se();
case rt:
case It:
case Yn:
return a = K(), a.value = he, a.raw = k.slice(Y, Fe), E(), R(a, "Literal");
case hr:
case fr:
case mr:
return a = K(), a.value = $.$a, a.raw = $.l, E(), R(a, "Literal");
case Ce:
a = Xt;
var l = Y;
E();
var p = re();
return p.start = l, p.end = Fe, O.C && (p.X.start = a, p.X.end = Yt), O.Xa && (p.j = [l, Fe]), J(ge), p;
case ln:
return a = K(), E(), a.elements = _t(un, !0, !0), R(a, "ArrayExpression");
case ot:
for (a = K(), l = !0, p = !1, a.h = [], E(); !L(He); ) {
if (l)
l = !1;
else if (J($e), O.sb && L(He))
break;
var h = {
key: $ === rt || $ === It ? Et() : Se(!0)
}, P = !1;
if (L(it)) {
h.value = re(!0);
var Q = h.kind = "init";
} else
h.key.type !== "Identifier" || h.key.name !== "get" && h.key.name !== "set" ? be() : (P = p = !0, Q = h.kind = h.key.name, h.key = $ === rt || $ === It ? Et() : Se(!0), $ !== Ce && be(), h.value = Gt(K(), !1));
if (h.key.type === "Identifier" && (ce || p))
for (var se = 0; se < a.h.length; ++se) {
var ze = a.h[se];
if (ze.key.name === h.key.name) {
var pn = Q === ze.kind || P && ze.kind === "init" || Q === "init" && (ze.kind === "get" || ze.kind === "set");
pn && !ce && Q === "init" && ze.kind === "init" && (pn = !1), pn && r(h.key.start, "Redefinition of property");
}
}
a.h.push(h);
}
return R(a, "ObjectExpression");
case rn:
return a = K(), E(), Gt(a, !1);
case pr:
return a = K(), E(), a.callee = et(Et(), !0), a.arguments = L(Ce) ? _t(ge, !1) : Bo, R(a, "NewExpression");
}
be();
}
function Gt(a, l) {
$ === Me ? a.id = Se() : l ? be() : a.id = null, a.oa = [];
var p = !0;
for (J(Ce); !L(ge); )
p ? p = !1 : J($e), a.oa.push(Se());
p = nt;
var h = X;
if (nt = !0, X = [], a.body = Ze(!0), nt = p, X = h, ce || a.body.body.length && We(a.body.body[0])) {
for (p = a.id ? -1 : 0; p < a.oa.length; ++p)
if (h = 0 > p ? a.id : a.oa[p], (wr(h.name) || At(h.name)) && r(h.start, "Defining '" + h.name + "' in strict mode"), 0 <= p)
for (var P = 0; P < p; ++P)
h.name === a.oa[P].name && r(h.start, "Argument name clash in strict mode");
}
return R(a, l ? "FunctionDeclaration" : "FunctionExpression");
}
function _t(a, l, p) {
for (var h = [], P = !0; !L(a); ) {
if (P)
P = !1;
else if (J($e), l && O.sb && L(a))
break;
h.push(p && $ === $e ? null : re(!0));
}
return h;
}
function Se(a) {
var l = K();
return a && O.yb === "everywhere" && (a = !1), $ === Me ? (!a && (O.yb && zo(he) || ce && wr(he)) && k.slice(Y, Fe).indexOf("\\") === -1 && r(Y, "The keyword '" + he + "' is reserved"), l.name = he) : a && $.l ? l.name = $.l : be(), tt = !1, E(), R(l, "Identifier");
}
e.version = "0.5.0";
var O, k = "", Le, Jt;
e.parse = function(a, l) {
k = String(a), Le = k.length, O = l || {};
for (var p in Xn)
Object.prototype.hasOwnProperty.call(O, p) || (O[p] = Xn[p]);
for (Jt = O.sourceFile, Ve = 1, d = ke = 0, tt = !0, c(), p = O.dc, Qt = xe = d, O.C && (Zt = new i()), nt = ce = !1, X = [], y(), a = p || K(), l = !0, p || (a.body = []); $ !== en; )
p = fe(), a.body.push(p), l && We(p) && D(!0), l = !1;
return R(a, "Program");
};
var Xn = {
fc: !1,
sb: !0,
yb: !1,
Ib: !1,
C: !1,
va: null,
Xa: !1,
dc: null,
sourceFile: null,
vb: null
}, d = 0, Y = 0, Fe = 0, Xt, Yt, $, he, tt, Ve, ke, Qt = 0, xe = 0, Zt, nt, X, ce, Bo = [], rt = {
type: "num"
}, Yn = {
type: "regexp"
}, It = {
type: "string"
}, Me = {
type: "name"
}, en = {
type: "eof"
}, tn = {
l: "break"
}, nn = {
l: "case",
m: !0
}, Qn = {
l: "catch"
}, Zn = {
l: "continue"
}, er = {
l: "debugger"
}, tr = {
l: "default"
}, nr = {
l: "do",
W: !0
}, rr = {
l: "else",
m: !0
}, or = {
l: "finally"
}, ir = {
l: "for",
W: !0
}, rn = {
l: "function"
}, sr = {
l: "if"
}, ar = {
l: "return",
m: !0
}, on = {
l: "switch"
}, lr = {
l: "throw",
m: !0
}, ur = {
l: "try"
}, sn = {
l: "var"
}, an = {
l: "while",
W: !0
}, cr = {
l: "with"
}, pr = {
l: "new",
m: !0
}, dr = {
l: "this"
}, hr = {
l: "null",
$a: null
}, fr = {
l: "true",
$a: !0
}, mr = {
l: "false",
$a: !1
}, Rt = {
l: "in",
L: 7,
m: !0
}, jo = {
break: tn,
case: nn,
catch: Qn,
continue: Zn,
debugger: er,
default: tr,
do: nr,
else: rr,
finally: or,
for: ir,
function: rn,
if: sr,
return: ar,
switch: on,
throw: lr,
try: ur,
var: sn,
while: an,
with: cr,
null: hr,
true: fr,
false: mr,
new: pr,
in: Rt,
instanceof: {
l: "instanceof",
L: 7,
m: !0
},
this: dr,
typeof: {
l: "typeof",
prefix: !0,
m: !0
},
void: {
l: "void",
prefix: !0,
m: !0
},
delete: {
l: "delete",
prefix: !0,
m: !0
}
}, ln = {
type: "[",
m: !0
}, un = {
type: "]"
}, ot = {
type: "{",
m: !0
}, He = {
type: "}"
}, Ce = {
type: "(",
m: !0
}, ge = {
type: ")"
}, $e = {
type: ",",
m: !0
}, we = {
type: ";",
m: !0
}, it = {
type: ":",
m: !0
}, gr = {
type: "."
}, yr = {
type: "?",
m: !0
}, vr = {
L: 10,
m: !0
}, br = {
Cb: !0,
m: !0
}, De = {
Cb: !0,
m: !0
}, Vo = {
cc: !0,
prefix: !0,
$b: !0
}, Sr = {
prefix: !0,
m: !0
}, kr = {
L: 1,
m: !0
}, Cr = {
L: 2,
m: !0
}, Do = {
L: 3,
m: !0
}, Uo = {
L: 4,
m: !0
}, Wo = {
L: 5,
m: !0
}, Lo = {
L: 6,
m: !0
}, Fo = {
L: 7,
m: !0
}, Mo = {
L: 8,
m: !0
}, Ho = {
L: 9,
prefix: !0,
m: !0
}, Ko = {
L: 10,
m: !0
}, zo = o("class enum extends super const export import"), wr = o("implements interface let package private protected public static yield"), At = o("eval arguments"), qo = o("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"), Go = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/, Tr = RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"), _o = RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]"), xt = /[\n\r\u2028\u2029]/, $t = /\r\n|[\n\r\u2028\u2029]/g, Ke, cn = {
kind: "loop"
}, Jo = {
kind: "switch"
};
}, vn = vn = typeof globalThis > "u" ? void 0 : globalThis;
fi(vn.j || (vn.j = {}));
function g(e, t) {
typeof e == "string" && (e = _e(e, "code"));
var n = e.constructor;
this.ya = function() {
return new n({
options: {}
});
};
var r = this.ya(), o;
for (o in e)
r[o] = o === "body" ? e[o].slice() : e[o];
this.ra = r, this.ca = [], this.qb = t, this.za = !1, this.ba = [], this.Ya = 0, this.rb = /* @__PURE__ */ Object.create(null), e = /^step([A-Z]\w*)$/;
var i, s;
for (s in this)
typeof this[s] == "function" && (i = s.match(e)) && (this.rb[i[1]] = this[s].bind(this));
this.N = Sn(this, this.ra, null), this.Na = this.N.object, this.ra = _e(this.ba.join(`
`), "polyfills"), this.ba = void 0, Wt(this.ra), i = new T(this.ra, this.N), i.done = !1, this.o = [i], this.Eb(), this.value = void 0, this.ra = r, i = new T(this.ra, this.N), i.done = !1, this.o.length = 0, this.o[0] = i;
}
var Er = {
C: !0,
kc: 5
}, Rn = {
configurable: !0,
enumerable: !0,
writable: !1
}, C = {
configurable: !0,
enumerable: !1,
writable: !0
}, le = {
configurable: !0,
enumerable: !1,
writable: !1
}, at = {
configurable: !1,
enumerable: !1,
writable: !1
}, Ir = {
configurable: !1,
enumerable: !0,
writable: !0
}, Jr = {
STEP_ERROR: !0
}, Ye = {
SCOPE_REFERENCE: !0
}, yt = {
VALUE_IN_DESCRIPTOR: !0
}, qe = {
REGEXP_TIMEOUT: !0
}, Rr = [], Ee = null, ht = null, Ne = typeof globalThis > "u" ? void 0 : globalThis, mi = ["onmessage = function(e) {", "var result;", "var data = e.data;", "switch (data[0]) {", "case 'split':", "result = data[1].split(data[2], data[3]);", "break;", "case 'match':", "result = data[1].match(data[2]);", "break;", "case 'search':", "result = data[1].search(data[2]);", "break;", "case 'replace':", "result = data[1].replace(data[2], data[3]);", "break;", "case 'exec':", "var regexp = data[1];", "regexp.lastIndex = data[2];", "result = [regexp.exec(data[3]), data[1].lastIndex];", "break;", "default:", "throw Error('Unknown RegExp operation: ' + data[0]);", "}", "postMessage(result);", "close();", "};"];
function An(e) {
var t = e >>> 0;
return t === Number(e) ? t : NaN;
}
function ft(e) {
var t = e >>> 0;
return String(t) === String(e) && t !== 4294967295 ? t : NaN;
}
function Wt(e, t, n) {
t ? e.start = t : delete e.start, n ? e.end = n : delete e.end;
for (var r in e)
if (r !== "loc" && e.hasOwnProperty(r)) {
var o = e[r];
o && typeof o == "object" && Wt(o, t, n);
}
}
g.prototype.REGEXP_MODE = 2;
g.prototype.REGEXP_THREAD_TIMEOUT = 1e3;
g.prototype.POLYFILL_TIMEOUT = 1e3;
V = g.prototype;
V.P = !1;
V.Ka = !1;
V.Kb = 0;
V.ic = 0;
function _e(e, t) {
var n = {}, r;
for (r in Er)
n[r] = Er[r];
return n.sourceFile = t, Ne.j.parse(e, n);
}
V.Jb = function(e) {
var t = this.o[0];
if (!t || t.node.type !== "Program")
throw Error("Expecting original AST to start with a Program node");
if (typeof e == "string" && (e = _e(e, "appendCode" + this.Kb++)), !e || e.type !== "Program")
throw Error("Expecting new AST to start with a Program node");
vt(this, e, t.scope), Array.prototype.push.apply(t.node.body, e.body), t.node.body.jb = null, t.done = !1;
};
V.lb = function() {
var e = this.o, t;
do {
var n = e[e.length - 1];
if (this.za)
break;
if (!n || n.node.type === "Program" && n.done) {
if (!this.ca.length)
return !1;
if (n = this.ca[0], !n || n.time > Date.now())
n = null;
else {
this.ca.shift(), 0 <= n.interval && Qr(this, n, n.interval);
var r = new T(n.node, n.scope);
n.zb && (r.ia = 2, r.B = this.Na, r.U = n.zb, r.Qa = !0, r.F = n.Lb), n = r;
}
if (!n)
break;
}
r = n.node;
var o = ht;
ht = this;
try {
var i = this.rb[r.type](e, n, r);
} catch (s) {
if (s !== Jr)
throw this.value !== s && (this.value = void 0), s;
} finally {
ht = o;
}
if (i && e.push(i), this.P)
throw this.value = void 0, Error("Getter not supported in this context");
if (this.Ka)
throw this.value = void 0, Error("Setter not supported in this context");
t || r.end || (t = Date.now() + this.POLYFILL_TIMEOUT);
} while (!r.end && t > Date.now());
return !0;
};
V.Eb = function() {
for (; !this.za && this.lb(); )
;
return this.za;
};
function gi(e, t) {
e.g(t, "NaN", NaN, at), e.g(t, "Infinity", 1 / 0, at), e.g(t, "undefined", void 0, at), e.g(t, "window", t, Rn), e.g(t, "this", t, at), e.g(t, "self", t), e.M = new N(null), e.Z = new N(e.M), yi(e, t), vi(e, t), t.xa = e.M, e.g(t, "constructor", e.v, C), bi(e, t), Si(e, t), ki(e, t), Ci(e, t), wi(e, t), Ti(e, t), Ei(e, t), Ii(e, t), Ri(e, t);
var n = e.i(function() {
throw EvalError("Can't happen");
}, !1);
n.eval = !0, e.g(t, "eval", n, C), e.g(t, "parseInt", e.i(parseInt, !1), C), e.g(t, "parseFloat", e.i(parseFloat, !1), C), e.g(t, "isNaN", e.i(isNaN, !1), C), e.g(t, "isFinite", e.i(isFinite, !1), C);
for (var r = [[escape, "escape"], [unescape, "unescape"], [decodeURI, "decodeURI"], [decodeURIComponent, "decodeURIComponent"], [encodeURI, "encodeURI"], [encodeURIComponent, "encodeURIComponent"]], o = 0; o < r.length; o++)
n = /* @__PURE__ */ function(i) {
return function(s) {
try {
return i(s);
} catch (u) {
I(e, e.Gb, u.message);
}
};
}(r[o][0]), e.g(t, r[o][1], e.i(n, !1), C);
n = function(i) {
return Ar(e, !1, arguments);
}, e.g(t, "setTimeout", e.i(n, !1), C), n = function(i) {
return Ar(e, !0, arguments);
}, e.g(t, "setInterval", e.i(n, !1), C), n = function(i) {
xr(e, i);
}, e.g(t, "clearTimeout", e.i(n, !1), C), n = function(i) {
xr(e, i);
}, e.g(t, "clearInterval", e.i(n, !1), C), e.OBJECT = e.v, e.OBJECT_PROTO = e.M, e.FUNCTION = e.O, e.FUNCTION_PROTO = e.Z, e.ARRAY = e.qa, e.ARRAY_PROTO = e.La, e.REGEXP = e.I, e.REGEXP_PROTO = e.Ma, e.DATE = e.$, e.DATE_PROTO = e.nb, e.qb && e.qb(e, t);
}
V.Wb = 0;
function yi(e, t) {
var n = /^[A-Za-z_$][\w$]*$/, r = function(o) {
var i = arguments.length ? String(arguments[arguments.length - 1]) : "", s = Array.prototype.slice.call(arguments, 0, -1).join(",").trim();
if (s) {
s = s.split(/\s*,\s*/);
for (var u = 0; u < s.length; u++) {
var c = s[u];
n.test(c) || I(e, e.T, "Invalid function argument: " + c);
}
s = s.join(", ");
}
try {
var f = _e("(function(" + s + ") {" + i + "})", "function" + e.Wb++);
} catch (y) {
I(e, e.T, "Invalid code: " + y.message);
}
return f.body.length !== 1 && I(e, e.T, "Invalid code in function body"), Pn(e, f.body[0].la, e.N, "anonymous");
};
e.O = e.i(r, !0), e.g(t, "Function", e.O, C), e.g(e.O, "prototype", e.Z, C), e.g(e.Z, "constructor", e.O, C), e.Z.Ta = function() {
}, e.Z.Ta.id = e.Ya++, e.Z.Ab = !0, e.g(e.Z, "length", 0, le), e.Z.H = "Function", r = function(o, i) {
var s = e.o[e.o.length - 1];
s.U = this, s.B = o, s.F = [], i != null && (i instanceof N ? s.F = Xr(e, i) : I(e, e.j, "CreateListFromArrayLike called on non-object")), s.eb = !1;
}, Z(e, e.O, "apply", r), r = function(o) {
var i = e.o[e.o.length - 1];
i.U = this, i.B = o, i.F = [];
for (var s = 1; s < arguments.length; s++)
i.F.push(arguments[s]);
i.eb = !1;
}, Z(e, e.O, "call", r), e.ba.push("Object.defineProperty(Function.prototype, 'bind',", "{configurable: true, writable: true, value:", "function bind(oThis) {", "if (typeof this !== 'function') {", "throw TypeError('What is trying to be bound is not callable');", "}", "var aArgs = Array.prototype.slice.call(arguments, 1),", "fToBind = this,", "fNOP = function() {},", "fBound = function() {", "return fToBind.apply(this instanceof fNOP", "? this", ": oThis,", "aArgs.concat(Array.prototype.slice.call(arguments)));", "};", "if (this.prototype) {", "fNOP.prototype = this.prototype;", "}", "fBound.prototype = new fNOP();", "return fBound;", "}", "});", ""), r = function() {
return String(this);
}, Z(e, e.O, "toString", r), e.g(e.O, "toString", e.i(r, !1), C), r = function() {
return this.valueOf();
}, Z(e, e.O, "valueOf", r), e.g(e.O, "valueOf", e.i(r, !1), C);
}
function vi(e, t) {
function n(o) {
o != null || I(e, e.j, "Cannot convert '" + o + "' to object");
}
var r = function(o) {
if (o == null)
return Re(e) ? this : e.s(e.M);
if (!(o instanceof N)) {
var i = e.s(Ie(e, o));
return i.data = o, i;
}
return o;
};
e.v = e.i(r, !0), e.g(e.v, "prototype", e.M, C), e.g(e.M, "constructor", e.v, C), e.g(t, "Object", e.v, C), r = function(o) {
return n(o), Te(e, Object.getOwnPropertyNames(o instanceof N ? o.h : o));
}, e.g(e.v, "getOwnPropertyNames", e.i(r, !1), C), r = function(o) {
return n(o), o instanceof N && (o = o.h), Te(e, Object.keys(o));
}, e.g(e.v, "keys", e.i(r, !1), C), r = function(o) {
return o === null ? e.s(null) : (o instanceof N || I(e, e.j, "Object prototype may only be an Object or null, not " + o), e.s(o));
}, e.g(e.v, "create", e.i(r, !1), C), e.ba.push("(function() {", "var create_ = Object.create;", "Object.create = function create(proto, props) {", "var obj = create_(proto);", "props && Object.defineProperties(obj, props);", "return obj;", "};", "})();", ""), r = function(o, i, s) {
return i = String(i), o instanceof N || I(e, e.j, "Object.defineProperty called on non-object: " + o), s instanceof N || I(e, e.j, "Property description must be an object"), !o.preventExtensions || i in o.h || I(e, e.j, "Can't define property '" + i + "', object is not extensible"), e.g(o, i, yt, s.h), o;
}, e.g(e.v, "defineProperty", e.i(r, !1), C), e.ba.push("(function() {", "var defineProperty_ = Object.defineProperty;", "Object.defineProperty = function defineProperty(obj, prop, d1) {", "var d2 = {};", "if ('configurable' in d1) d2.configurable = d1.configurable;", "if ('enumerable' in d1) d2.enumerable = d1.enumerable;", "if ('writable' in d1) d2.writable = d1.writable;", "if ('value' in d1) d2.value = d1.value;", "if ('get' in d1) d2.get = d1.get;", "if ('set' in d1) d2.set = d1.set;", "return defineProperty_(obj, prop, d2);", "};", "})();", "Object.defineProperty(Object, 'defineProperties',", "{configurable: true, writable: true, value:", "function defineProperties(obj, props) {", "var keys = Object.keys(props);", "for (var i = 0; i < keys.length; i++) {", "Object.defineProperty(obj, keys[i], props[keys[i]]);", "}", "return obj;", "}", "});", ""), r = function(o, i) {
if (o instanceof N || I(e, e.j, "Object.getOwnPropertyDescriptor called on non-object: " + o), i = String(i), i in o.h) {
var s = Object.getOwnPropertyDescriptor(o.h, i), u = o.V[i];
return o = o.Y[i], i = e.s(e.M), u || o ? (e.g(i, "get", u), e.g(i, "set", o)) : (e.g(i, "value", s.value), e.g(i, "writable", s.writable)), e.g(i, "configurable", s.configurable), e.g(i, "enumerable", s.enumerable), i;
}
}, e.g(e.v, "getOwnPropertyDescriptor", e.i(r, !1), C), r = function(o) {
return n(o), Ie(e, o);
}, e.g(e.v, "getPrototypeOf", e.i(r, !1), C), r = function(o) {
return !!o && !o.preventExtensions;
}, e.g(e.v, "isExtensible", e.i(r, !1), C), r = function(o) {
return o instanceof N && (o.preventExtensions = !0), o;
}, e.g(e.v, "preventExtensions", e.i(r, !1), C), Z(e, e.v, "toString", N.prototype.toString), Z(e, e.v, "toLocaleString", N.prototype.toString), Z(e, e.v, "valueOf", N.prototype.valueOf), r = function(o) {
return n(this), this instanceof N ? String(o) in this.h : this.hasOwnProperty(o);
}, Z(e, e.v, "hasOwnProperty", r), r = function(o) {
return n(this), this instanceof N ? Object.prototype.propertyIsEnumerable.call(this.h, o) : this.propertyIsEnumerable(o);
}, Z(e, e.v, "propertyIsEnumerable", r), r = function(o) {
for (; ; ) {
if (o = Ie(e, o), !o)
return !1;
if (o === this)
return !0;
}
}, Z(e, e.v, "isPrototypeOf", r);
}
function bi(e, t) {
var n = function(r) {
var o = Re(e) ? this : Je(e), i = arguments[0];
if (arguments.length === 1 && typeof i == "number")
isNaN(An(i)) && I(e, e.ob, "Invalid array length: " + i), o.h.length = i;
else {
for (i = 0; i < arguments.length; i++)
o.h[i] = arguments[i];
o.h.length = i;
}
return o;
};
e.qa = e.i(n, !0), e.La = e.qa.h.prototype, e.g(t, "Array", e.qa, C), n = function(r) {
return r && r.H === "Array";
}, e.g(e.qa, "isArray", e.i(n, !1), C), e.g(e.La, "length", 0, {
configurable: !1,
enumerable: !1,
writable: !0
}), e.La.H = "Array", e.ba.push("(function() {", "function createArrayMethod_(f) {", "Object.defineProperty(Array.prototype, f.name,", "{configurable: true, writable: true, value: f});", "}", "createArrayMethod_(", "function pop() {", "if (!this) throw TypeError();", "var o = Object(this), len = o.length >>> 0;", "if (!len || len < 0) {", "o.length = 0;", "return undefined;", "}", "len--;", "var x = o[len];", "delete o[len];", "o.length = len;", "return x;", "}", ");", "createArrayMethod_(", "function push(var_args) {", "if (!this) throw TypeError();", "var o = Object(this), len = o.length >>> 0;", "for (var i = 0; i < arguments.length; i++) {", "o[len] = arguments[i];", "len++;", "}", "o.length = len;", "return len;", "}", ");", "createArrayMethod_(", "function shift() {", "if (!this) throw TypeError();", "var o = Object(this), len = o.length >>> 0;", "if (!len || len < 0) {", "o.length = 0;", "return undefined;", "}", "var value = o[0];", "for (var i = 0; i < len - 1; i++) {", "if ((i + 1) in o) {", "o[i] = o[i + 1];", "} else {", "delete o[i];", "}", "}", "delete o[i];", "o.length = len - 1;", "return value;", "}", ");", "createArrayMethod_(", "function unshift(var_args) {", "if (!this) throw TypeError();", "var o = Object(this), len = o.length >>> 0;", "if (!len || len < 0) {", "len = 0;", "}", "for (var i = len - 1; i >= 0; i--) {", "if (i in o) {", "o[i + arguments.length] = o[i];", "} else {", "delete o[i + arguments.length];", "}", "}", "for (var i = 0; i < arguments.length; i++) {", "o[i] = arguments[i];", "}", "return (o.length = len + arguments.length);", "}", ");", "createArrayMethod_(", "function reverse() {", "if (!this) throw TypeError();", "var o = Object(this), len = o.length >>> 0;", "if (!len || len < 2) {", "return o;", "}", "for (var i = 0; i < len / 2 - 0.5; i++) {", "var x = o[i];", "var hasX = i in o;", "if ((len - i - 1) in o) {", "o[i] = o[len - i - 1];", "} else {", "delete o[i];", "}", "if (hasX) {", "o[len - i - 1] = x;", "} else {", "delete o[len - i - 1];", "}", "}", "return o;", "}", ");", "createArrayMethod_(", "function indexOf(searchElement, fromIndex) {", "if (!this) throw TypeError();", "var o = Object(this), len = o.length >>> 0;", "var n = fromIndex | 0;", "if (!len || n >= len) {", "return -1;", "}", "var i = Math.max(n >= 0 ? n : len - Math.abs(n), 0);", "while (i < len) {", "if (i in o && o[i] === searchElement) {", "return i;", "}", "i++;", "}", "return -1;", "}", ");", "createArrayMethod_(", "function lastIndexOf(searchElement, fromIndex) {", "if (!this) throw TypeError();", "var o = Object(this), len = o.length >>> 0;", "if (!len) {", "return -1;", "}", "var n = len - 1;", "if (arguments.length > 1) {", "n = fromIndex | 0;", "if (n) {", "n = (n > 0 || -1) * Math.floor(Math.abs(n));", "}", "}", "var i = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n);", "while (i >= 0) {", "if (i in o && o[i] === searchElement) {", "return i;", "}", "i--;", "}", "return -1;", "}", ");", "createArrayMethod_(", "function slice(start, end) {", "if (!this) throw TypeError();", "var o = Object(this), len = o.length >>> 0;", "start |= 0;", "start = (start >= 0) ? start : Math.max(0, len + start);", "if (typeof end !== 'undefined') {", "if (end !== Infinity) {", "end |= 0;", "}", "if (end < 0) {", "end = len + end;", "} else {", "end = Math.min(end, len);", "}", "} else {", "end = len;", "}", "var size = end - start;", "var cloned = new Array(size);", "for (var i = 0; i < size; i++) {", "if ((start + i) in o) {", "cloned[i] = o[start + i];", "}", "}", "return cloned;", "}", ");", "createArrayMethod_(", "function splice(start, deleteCount, var_args) {", "if (!this) throw TypeError();", "var o = Object(this), len = o.length >>> 0;", "start |= 0;", "if (start < 0) {", "start = Math.max(len + start, 0);", "} else {", "start = Math.min(start, len);", "}", "if (arguments.length < 1) {", "deleteCount = len - start;", "} else {", "deleteCount |= 0;", "deleteCount = Math.max(0, Math.min(deleteCount, len - start));", "}", "var removed = [];", "for (var i = start; i < start + deleteCount; i++) {", "if (i in o) {", "removed.push(o[i]);", "} else {", "removed.length++;", "}", "if ((i + deleteCount) in o) {", "o[i] = o[i + deleteCount];", "} else {", "delete o[i];", "}", "}", "for (var i = start + deleteCount; i < len - deleteCount; i++) {", "if ((i + deleteCount) in o) {", "o[i]