import { S as openBlock, _ as createElementBlock, J as defineComponent, t as onMounted, m as watch, r as ref, aI as toRaw, v as watchEffect, l as shallowRef } from "./.pnpm.BW3P1y8f.js";
var e, t, n, r, o, i, a, s, u, l, c, d, f, p, h, g, v, m, y = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
function b(e5) {
return e5 && e5.__esModule && Object.prototype.hasOwnProperty.call(e5, "default") ? e5.default : e5;
}
function E(e5) {
if (Object.prototype.hasOwnProperty.call(e5, "__esModule")) return e5;
var t2 = e5.default;
if ("function" == typeof t2) {
var n2 = function e6() {
var n3 = false;
try {
n3 = this instanceof e6;
} catch {
}
return n3 ? Reflect.construct(t2, arguments, this.constructor) : t2.apply(this, arguments);
};
n2.prototype = t2.prototype;
} else n2 = {};
return Object.defineProperty(n2, "__esModule", { value: true }), Object.keys(e5).forEach(function(t3) {
var r2 = Object.getOwnPropertyDescriptor(e5, t3);
Object.defineProperty(n2, t3, r2.get ? r2 : { enumerable: true, get: function() {
return e5[t3];
} });
}), n2;
}
function w() {
return t ? e : (t = 1, e = function(e5) {
try {
return !!e5();
} catch (e6) {
return true;
}
});
}
function C() {
if (r) return n;
r = 1;
var e5 = w();
return n = !e5(function() {
var e6 = (function() {
}).bind();
return "function" != typeof e6 || e6.hasOwnProperty("prototype");
});
}
function D() {
if (i) return o;
i = 1;
var e5 = C(), t2 = Function.prototype, n2 = t2.call, r2 = e5 && t2.bind.bind(n2, n2);
return o = e5 ? r2 : function(e6) {
return function() {
return n2.apply(e6, arguments);
};
}, o;
}
function A() {
if (s) return a;
s = 1;
var e5 = D(), t2 = e5({}.toString), n2 = e5("".slice);
return a = function(e6) {
return n2(t2(e6), 8, -1);
};
}
function S() {
if (l) return u;
l = 1;
var e5 = D(), t2 = w(), n2 = A(), r2 = Object, o2 = e5("".split);
return u = t2(function() {
return !r2("z").propertyIsEnumerable(0);
}) ? function(e6) {
return "String" === n2(e6) ? o2(e6, "") : r2(e6);
} : r2;
}
function x() {
return d ? c : (d = 1, c = function(e5) {
return null == e5;
});
}
function O() {
if (p) return f;
p = 1;
var e5 = x(), t2 = TypeError;
return f = function(n2) {
if (e5(n2)) throw new t2("Can't call method on " + n2);
return n2;
};
}
function N() {
if (g) return h;
g = 1;
var e5 = S(), t2 = O();
return h = function(n2) {
return e5(t2(n2));
};
}
function B() {
if (m) return v;
m = 1;
var e5 = function(e6) {
return e6 && e6.Math === Math && e6;
};
return v = e5("object" == typeof globalThis && globalThis) || e5("object" == typeof window && window) || e5("object" == typeof self && self) || e5("object" == typeof y && y) || e5("object" == typeof v && v) || /* @__PURE__ */ (function() {
return this;
})() || Function("return this")();
}
var T, k, F, P, I, R, _, L, M, j, H, z, $, U, V, W, G, q, K, Y, X, Z, J, Q, ee, te, ne, re, oe, ie = { exports: {} };
function ae() {
return k ? T : (k = 1, T = false);
}
function se() {
if (P) return F;
P = 1;
var e5 = B(), t2 = Object.defineProperty;
return F = function(n2, r2) {
try {
t2(e5, n2, { value: r2, configurable: true, writable: true });
} catch (t3) {
e5[n2] = r2;
}
return r2;
};
}
function ue() {
if (I) return ie.exports;
I = 1;
var e5 = ae(), t2 = B(), n2 = se(), r2 = "__core-js_shared__", o2 = ie.exports = t2[r2] || n2(r2, {});
return (o2.versions || (o2.versions = [])).push({ version: "3.47.0", mode: e5 ? "pure" : "global", copyright: "© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)", license: "https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE", source: "https://github.com/zloirock/core-js" }), ie.exports;
}
function le() {
if (_) return R;
_ = 1;
var e5 = ue();
return R = function(t2, n2) {
return e5[t2] || (e5[t2] = n2 || {});
};
}
function ce() {
if (M) return L;
M = 1;
var e5 = O(), t2 = Object;
return L = function(n2) {
return t2(e5(n2));
};
}
function de() {
if (H) return j;
H = 1;
var e5 = D(), t2 = ce(), n2 = e5({}.hasOwnProperty);
return j = Object.hasOwn || function(e6, r2) {
return n2(t2(e6), r2);
};
}
function fe() {
if ($) return z;
$ = 1;
var e5 = D(), t2 = 0, n2 = Math.random(), r2 = e5(1.1.toString);
return z = function(e6) {
return "Symbol(" + (void 0 === e6 ? "" : e6) + ")_" + r2(++t2 + n2, 36);
};
}
function pe() {
if (G) return W;
G = 1;
var e5, t2, n2 = B(), r2 = (function() {
if (V) return U;
V = 1;
var e6 = B().navigator, t3 = e6 && e6.userAgent;
return U = t3 ? String(t3) : "";
})(), o2 = n2.process, i2 = n2.Deno, a2 = o2 && o2.versions || i2 && i2.version, s2 = a2 && a2.v8;
return s2 && (t2 = (e5 = s2.split("."))[0] > 0 && e5[0] < 4 ? 1 : +(e5[0] + e5[1])), !t2 && r2 && (!(e5 = r2.match(/Edge\/(\d+)/)) || e5[1] >= 74) && (e5 = r2.match(/Chrome\/(\d+)/)) && (t2 = +e5[1]), W = t2;
}
function he() {
if (K) return q;
K = 1;
var e5 = pe(), t2 = w(), n2 = B().String;
return q = !!Object.getOwnPropertySymbols && !t2(function() {
var t3 = Symbol("symbol detection");
return !n2(t3) || !(Object(t3) instanceof Symbol) || !Symbol.sham && e5 && e5 < 41;
}), q;
}
function ge() {
if (X) return Y;
X = 1;
var e5 = he();
return Y = e5 && !Symbol.sham && "symbol" == typeof Symbol.iterator;
}
function ve() {
if (J) return Z;
J = 1;
var e5 = B(), t2 = le(), n2 = de(), r2 = fe(), o2 = he(), i2 = ge(), a2 = e5.Symbol, s2 = t2("wks"), u2 = i2 ? a2.for || a2 : a2 && a2.withoutSetter || r2;
return Z = function(e6) {
return n2(s2, e6) || (s2[e6] = o2 && n2(a2, e6) ? a2[e6] : u2("Symbol." + e6)), s2[e6];
};
}
function me() {
if (ee) return Q;
ee = 1;
var e5 = "object" == typeof document && document.all;
return Q = void 0 === e5 && void 0 !== e5 ? function(t2) {
return "function" == typeof t2 || t2 === e5;
} : function(e6) {
return "function" == typeof e6;
};
}
function ye() {
if (ne) return te;
ne = 1;
var e5 = me();
return te = function(t2) {
return "object" == typeof t2 ? null !== t2 : e5(t2);
};
}
function be() {
if (oe) return re;
oe = 1;
var e5 = ye(), t2 = String, n2 = TypeError;
return re = function(r2) {
if (e5(r2)) return r2;
throw new n2(t2(r2) + " is not an object");
};
}
var Ee, we, Ce, De, Ae = {};
function Se() {
if (we) return Ee;
we = 1;
var e5 = w();
return Ee = !e5(function() {
return 7 !== Object.defineProperty({}, 1, { get: function() {
return 7;
} })[1];
});
}
function xe() {
if (De) return Ce;
De = 1;
var e5 = Se(), t2 = w();
return Ce = e5 && t2(function() {
return 42 !== Object.defineProperty(function() {
}, "prototype", { value: 42, writable: false }).prototype;
});
}
var Oe, Ne, Be, Te, ke, Fe, Pe, Ie, Re, _e, Le, Me, je, He, ze, $e, Ue, Ve, We, Ge, qe, Ke, Ye, Xe, Ze, Je, Qe, et, tt, nt, rt, ot, it, at, st, ut, lt, ct, dt, ft, pt, ht, gt, vt, mt, yt, bt, Et, wt, Ct, Dt, At, St, xt, Ot, Nt, Bt, Tt, kt, Ft, Pt, It, Rt, _t, Lt = {};
function Mt() {
if (Ne) return Oe;
Ne = 1;
var e5 = B(), t2 = ye(), n2 = e5.document, r2 = t2(n2) && t2(n2.createElement);
return Oe = function(e6) {
return r2 ? n2.createElement(e6) : {};
};
}
function jt() {
if (Te) return Be;
Te = 1;
var e5 = Se(), t2 = w(), n2 = Mt();
return Be = !e5 && !t2(function() {
return 7 !== Object.defineProperty(n2("div"), "a", { get: function() {
return 7;
} }).a;
});
}
function Ht() {
if (Fe) return ke;
Fe = 1;
var e5 = C(), t2 = Function.prototype.call;
return ke = e5 ? t2.bind(t2) : function() {
return t2.apply(t2, arguments);
}, ke;
}
function zt() {
if (Ie) return Pe;
Ie = 1;
var e5 = B(), t2 = me();
return Pe = function(n2, r2) {
return arguments.length < 2 ? (o2 = e5[n2], t2(o2) ? o2 : void 0) : e5[n2] && e5[n2][r2];
var o2;
}, Pe;
}
function $t() {
if (_e) return Re;
_e = 1;
var e5 = D();
return Re = e5({}.isPrototypeOf);
}
function Ut() {
if (Me) return Le;
Me = 1;
var e5 = zt(), t2 = me(), n2 = $t(), r2 = ge(), o2 = Object;
return Le = r2 ? function(e6) {
return "symbol" == typeof e6;
} : function(r3) {
var i2 = e5("Symbol");
return t2(i2) && n2(i2.prototype, o2(r3));
};
}
function Vt() {
if (He) return je;
He = 1;
var e5 = String;
return je = function(t2) {
try {
return e5(t2);
} catch (e6) {
return "Object";
}
};
}
function Wt() {
if ($e) return ze;
$e = 1;
var e5 = me(), t2 = Vt(), n2 = TypeError;
return ze = function(r2) {
if (e5(r2)) return r2;
throw new n2(t2(r2) + " is not a function");
};
}
function Gt() {
if (Ve) return Ue;
Ve = 1;
var e5 = Wt(), t2 = x();
return Ue = function(n2, r2) {
var o2 = n2[r2];
return t2(o2) ? void 0 : e5(o2);
}, Ue;
}
function qt() {
if (Ke) return qe;
Ke = 1;
var e5 = Ht(), t2 = ye(), n2 = Ut(), r2 = Gt(), o2 = (function() {
if (Ge) return We;
Ge = 1;
var e6 = Ht(), t3 = me(), n3 = ye(), r3 = TypeError;
return We = function(o3, i3) {
var a3, s3;
if ("string" === i3 && t3(a3 = o3.toString) && !n3(s3 = e6(a3, o3))) return s3;
if (t3(a3 = o3.valueOf) && !n3(s3 = e6(a3, o3))) return s3;
if ("string" !== i3 && t3(a3 = o3.toString) && !n3(s3 = e6(a3, o3))) return s3;
throw new r3("Can't convert object to primitive value");
}, We;
})(), i2 = ve(), a2 = TypeError, s2 = i2("toPrimitive");
return qe = function(i3, u2) {
if (!t2(i3) || n2(i3)) return i3;
var l2, c2 = r2(i3, s2);
if (c2) {
if (void 0 === u2 && (u2 = "default"), l2 = e5(c2, i3, u2), !t2(l2) || n2(l2)) return l2;
throw new a2("Can't convert object to primitive value");
}
return void 0 === u2 && (u2 = "number"), o2(i3, u2);
};
}
function Kt() {
if (Xe) return Ye;
Xe = 1;
var e5 = qt(), t2 = Ut();
return Ye = function(n2) {
var r2 = e5(n2, "string");
return t2(r2) ? r2 : r2 + "";
};
}
function Yt() {
if (Ze) return Lt;
Ze = 1;
var e5 = Se(), t2 = jt(), n2 = xe(), r2 = be(), o2 = Kt(), i2 = TypeError, a2 = Object.defineProperty, s2 = Object.getOwnPropertyDescriptor, u2 = "enumerable", l2 = "configurable", c2 = "writable";
return Lt.f = e5 ? n2 ? function(e6, t3, n3) {
if (r2(e6), t3 = o2(t3), r2(n3), "function" == typeof e6 && "prototype" === t3 && "value" in n3 && c2 in n3 && !n3[c2]) {
var i3 = s2(e6, t3);
i3 && i3[c2] && (e6[t3] = n3.value, n3 = { configurable: l2 in n3 ? n3[l2] : i3[l2], enumerable: u2 in n3 ? n3[u2] : i3[u2], writable: false });
}
return a2(e6, t3, n3);
} : a2 : function(e6, n3, s3) {
if (r2(e6), n3 = o2(n3), r2(s3), t2) try {
return a2(e6, n3, s3);
} catch (e7) {
}
if ("get" in s3 || "set" in s3) throw new i2("Accessors not supported");
return "value" in s3 && (e6[n3] = s3.value), e6;
}, Lt;
}
function Xt() {
if (tt) return et;
tt = 1;
var e5 = (function() {
if (Qe) return Je;
Qe = 1;
var e6 = Math.ceil, t2 = Math.floor;
return Je = Math.trunc || function(n2) {
var r2 = +n2;
return (r2 > 0 ? t2 : e6)(r2);
}, Je;
})();
return et = function(t2) {
var n2 = +t2;
return n2 != n2 || 0 === n2 ? 0 : e5(n2);
};
}
function Zt() {
if (it) return ot;
it = 1;
var e5 = Xt(), t2 = Math.min;
return ot = function(n2) {
var r2 = e5(n2);
return r2 > 0 ? t2(r2, 9007199254740991) : 0;
};
}
function Jt() {
if (st) return at;
st = 1;
var e5 = Zt();
return at = function(t2) {
return e5(t2.length);
};
}
function Qt() {
if (lt) return ut;
lt = 1;
var e5 = N(), t2 = (function() {
if (rt) return nt;
rt = 1;
var e6 = Xt(), t3 = Math.max, n3 = Math.min;
return nt = function(r3, o2) {
var i2 = e6(r3);
return i2 < 0 ? t3(i2 + o2, 0) : n3(i2, o2);
}, nt;
})(), n2 = Jt(), r2 = function(r3) {
return function(o2, i2, a2) {
var s2 = e5(o2), u2 = n2(s2);
if (0 === u2) return !r3 && -1;
var l2, c2 = t2(a2, u2);
if (r3 && i2 != i2) {
for (; u2 > c2; ) if ((l2 = s2[c2++]) != l2) return true;
} else for (; u2 > c2; c2++) if ((r3 || c2 in s2) && s2[c2] === i2) return r3 || c2 || 0;
return !r3 && -1;
};
};
return ut = { includes: r2(true), indexOf: r2(false) };
}
function en() {
return dt ? ct : (dt = 1, ct = {});
}
function tn() {
if (pt) return ft;
pt = 1;
var e5 = D(), t2 = de(), n2 = N(), r2 = Qt().indexOf, o2 = en(), i2 = e5([].push);
return ft = function(e6, a2) {
var s2, u2 = n2(e6), l2 = 0, c2 = [];
for (s2 in u2) !t2(o2, s2) && t2(u2, s2) && i2(c2, s2);
for (; a2.length > l2; ) t2(u2, s2 = a2[l2++]) && (~r2(c2, s2) || i2(c2, s2));
return c2;
}, ft;
}
function nn() {
return gt ? ht : (gt = 1, ht = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]);
}
function rn() {
if (yt) return Ae;
yt = 1;
var e5 = Se(), t2 = xe(), n2 = Yt(), r2 = be(), o2 = N(), i2 = (function() {
if (mt) return vt;
mt = 1;
var e6 = tn(), t3 = nn();
return vt = Object.keys || function(n3) {
return e6(n3, t3);
}, vt;
})();
return Ae.f = e5 && !t2 ? Object.defineProperties : function(e6, t3) {
r2(e6);
for (var a2, s2 = o2(t3), u2 = i2(t3), l2 = u2.length, c2 = 0; l2 > c2; ) n2.f(e6, a2 = u2[c2++], s2[a2]);
return e6;
}, Ae;
}
function on() {
if (Ct) return wt;
Ct = 1;
var e5 = le(), t2 = fe(), n2 = e5("keys");
return wt = function(e6) {
return n2[e6] || (n2[e6] = t2(e6));
};
}
function an() {
if (At) return Dt;
At = 1;
var e5, t2 = be(), n2 = rn(), r2 = nn(), o2 = en(), i2 = (function() {
if (Et) return bt;
Et = 1;
var e6 = zt();
return bt = e6("document", "documentElement");
})(), a2 = Mt(), s2 = on(), u2 = "prototype", l2 = "script", c2 = s2("IE_PROTO"), d2 = function() {
}, f2 = function(e6) {
return "<" + l2 + ">" + e6 + "" + l2 + ">";
}, p2 = function(e6) {
e6.write(f2("")), e6.close();
var t3 = e6.parentWindow.Object;
return e6 = null, t3;
}, h2 = function() {
try {
e5 = new ActiveXObject("htmlfile");
} catch (e6) {
}
var t3, n3, o3;
h2 = "undefined" != typeof document ? document.domain && e5 ? p2(e5) : (n3 = a2("iframe"), o3 = "java" + l2 + ":", n3.style.display = "none", i2.appendChild(n3), n3.src = String(o3), (t3 = n3.contentWindow.document).open(), t3.write(f2("document.F=Object")), t3.close(), t3.F) : p2(e5);
for (var s3 = r2.length; s3--; ) delete h2[u2][r2[s3]];
return h2();
};
return o2[c2] = true, Dt = Object.create || function(e6, r3) {
var o3;
return null !== e6 ? (d2[u2] = t2(e6), o3 = new d2(), d2[u2] = null, o3[c2] = e6) : o3 = h2(), void 0 === r3 ? o3 : n2.f(o3, r3);
}, Dt;
}
function sn() {
return Nt ? Ot : (Nt = 1, Ot = {});
}
function un() {
return Ft ? kt : (Ft = 1, kt = function(e5, t2) {
return { enumerable: !(1 & e5), configurable: !(2 & e5), writable: !(4 & e5), value: t2 };
});
}
function ln() {
if (It) return Pt;
It = 1;
var e5 = Se(), t2 = Yt(), n2 = un();
return Pt = e5 ? function(e6, r2, o2) {
return t2.f(e6, r2, n2(1, o2));
} : function(e6, t3, n3) {
return e6[t3] = n3, e6;
};
}
function cn() {
if (_t) return Rt;
_t = 1;
var e5, t2, n2, r2 = (function() {
if (Tt) return Bt;
Tt = 1;
var e6 = B(), t3 = me(), n3 = e6.WeakMap;
return Bt = t3(n3) && /native code/.test(String(n3));
})(), o2 = B(), i2 = ye(), a2 = ln(), s2 = de(), u2 = ue(), l2 = on(), c2 = en(), d2 = "Object already initialized", f2 = o2.TypeError, p2 = o2.WeakMap;
if (r2 || u2.state) {
var h2 = u2.state || (u2.state = new p2());
h2.get = h2.get, h2.has = h2.has, h2.set = h2.set, e5 = function(e6, t3) {
if (h2.has(e6)) throw new f2(d2);
return t3.facade = e6, h2.set(e6, t3), t3;
}, t2 = function(e6) {
return h2.get(e6) || {};
}, n2 = function(e6) {
return h2.has(e6);
};
} else {
var g2 = l2("state");
c2[g2] = true, e5 = function(e6, t3) {
if (s2(e6, g2)) throw new f2(d2);
return t3.facade = e6, a2(e6, g2, t3), t3;
}, t2 = function(e6) {
return s2(e6, g2) ? e6[g2] : {};
}, n2 = function(e6) {
return s2(e6, g2);
};
}
return Rt = { set: e5, get: t2, has: n2, enforce: function(r3) {
return n2(r3) ? t2(r3) : e5(r3, {});
}, getterFor: function(e6) {
return function(n3) {
var r3;
if (!i2(n3) || (r3 = t2(n3)).type !== e6) throw new f2("Incompatible receiver, " + e6 + " required");
return r3;
};
} };
}
var dn, fn, pn = {}, hn = {};
function gn() {
if (fn) return pn;
fn = 1;
var e5 = Se(), t2 = Ht(), n2 = (function() {
if (dn) return hn;
dn = 1;
var e6 = {}.propertyIsEnumerable, t3 = Object.getOwnPropertyDescriptor, n3 = t3 && !e6.call({ 1: 2 }, 1);
return hn.f = n3 ? function(e7) {
var n4 = t3(this, e7);
return !!n4 && n4.enumerable;
} : e6, hn;
})(), r2 = un(), o2 = N(), i2 = Kt(), a2 = de(), s2 = jt(), u2 = Object.getOwnPropertyDescriptor;
return pn.f = e5 ? u2 : function(e6, l2) {
if (e6 = o2(e6), l2 = i2(l2), s2) try {
return u2(e6, l2);
} catch (e7) {
}
if (a2(e6, l2)) return r2(!t2(n2.f, e6, l2), e6[l2]);
}, pn;
}
var vn, mn, yn, bn, En, wn, Cn, Dn = { exports: {} };
function An() {
if (mn) return vn;
mn = 1;
var e5 = Se(), t2 = de(), n2 = Function.prototype, r2 = e5 && Object.getOwnPropertyDescriptor, o2 = t2(n2, "name"), i2 = o2 && "something" === (function() {
}).name, a2 = o2 && (!e5 || e5 && r2(n2, "name").configurable);
return vn = { EXISTS: o2, PROPER: i2, CONFIGURABLE: a2 };
}
function Sn() {
if (bn) return yn;
bn = 1;
var e5 = D(), t2 = me(), n2 = ue(), r2 = e5(Function.toString);
return t2(n2.inspectSource) || (n2.inspectSource = function(e6) {
return r2(e6);
}), yn = n2.inspectSource;
}
function xn() {
if (En) return Dn.exports;
En = 1;
var e5 = D(), t2 = w(), n2 = me(), r2 = de(), o2 = Se(), i2 = An().CONFIGURABLE, a2 = Sn(), s2 = cn(), u2 = s2.enforce, l2 = s2.get, c2 = String, d2 = Object.defineProperty, f2 = e5("".slice), p2 = e5("".replace), h2 = e5([].join), g2 = o2 && !t2(function() {
return 8 !== d2(function() {
}, "length", { value: 8 }).length;
}), v2 = String(String).split("String"), m2 = Dn.exports = function(e6, t3, n3) {
"Symbol(" === f2(c2(t3), 0, 7) && (t3 = "[" + p2(c2(t3), /^Symbol\(([^)]*)\).*$/, "$1") + "]"), n3 && n3.getter && (t3 = "get " + t3), n3 && n3.setter && (t3 = "set " + t3), (!r2(e6, "name") || i2 && e6.name !== t3) && (o2 ? d2(e6, "name", { value: t3, configurable: true }) : e6.name = t3), g2 && n3 && r2(n3, "arity") && e6.length !== n3.arity && d2(e6, "length", { value: n3.arity });
try {
n3 && r2(n3, "constructor") && n3.constructor ? o2 && d2(e6, "prototype", { writable: false }) : e6.prototype && (e6.prototype = void 0);
} catch (e7) {
}
var a3 = u2(e6);
return r2(a3, "source") || (a3.source = h2(v2, "string" == typeof t3 ? t3 : "")), e6;
};
return Function.prototype.toString = m2(function() {
return n2(this) && l2(this).source || a2(this);
}, "toString"), Dn.exports;
}
function On() {
if (Cn) return wn;
Cn = 1;
var e5 = me(), t2 = Yt(), n2 = xn(), r2 = se();
return wn = function(o2, i2, a2, s2) {
s2 || (s2 = {});
var u2 = s2.enumerable, l2 = void 0 !== s2.name ? s2.name : i2;
if (e5(a2) && n2(a2, l2, s2), s2.global) u2 ? o2[i2] = a2 : r2(i2, a2);
else {
try {
s2.unsafe ? o2[i2] && (u2 = true) : delete o2[i2];
} catch (e6) {
}
u2 ? o2[i2] = a2 : t2.f(o2, i2, { value: a2, enumerable: false, configurable: !s2.nonConfigurable, writable: !s2.nonWritable });
}
return o2;
}, wn;
}
var Nn, Bn = {};
var Tn, kn, Fn, Pn, In, Rn, _n, Ln, Mn, jn, Hn, zn, $n, Un, Vn, Wn, Gn, qn, Kn, Yn, Xn, Zn, Jn, Qn, er, tr, nr, rr, or, ir, ar, sr, ur, lr = {};
function cr() {
if (Fn) return kn;
Fn = 1;
var e5 = zt(), t2 = D(), n2 = (function() {
if (Nn) return Bn;
Nn = 1;
var e6 = tn(), t3 = nn().concat("length", "prototype");
return Bn.f = Object.getOwnPropertyNames || function(n3) {
return e6(n3, t3);
}, Bn;
})(), r2 = (Tn || (Tn = 1, lr.f = Object.getOwnPropertySymbols), lr), o2 = be(), i2 = t2([].concat);
return kn = e5("Reflect", "ownKeys") || function(e6) {
var t3 = n2.f(o2(e6)), a2 = r2.f;
return a2 ? i2(t3, a2(e6)) : t3;
}, kn;
}
function dr() {
if (In) return Pn;
In = 1;
var e5 = de(), t2 = cr(), n2 = gn(), r2 = Yt();
return Pn = function(o2, i2, a2) {
for (var s2 = t2(i2), u2 = r2.f, l2 = n2.f, c2 = 0; c2 < s2.length; c2++) {
var d2 = s2[c2];
e5(o2, d2) || a2 && e5(a2, d2) || u2(o2, d2, l2(i2, d2));
}
}, Pn;
}
function fr() {
if (Mn) return Ln;
Mn = 1;
var e5 = B(), t2 = gn().f, n2 = ln(), r2 = On(), o2 = se(), i2 = dr(), a2 = (function() {
if (_n) return Rn;
_n = 1;
var e6 = w(), t3 = me(), n3 = /#|\.prototype\./, r3 = function(n4, r4) {
var u2 = i3[o3(n4)];
return u2 === s2 || u2 !== a3 && (t3(r4) ? e6(r4) : !!r4);
}, o3 = r3.normalize = function(e7) {
return String(e7).replace(n3, ".").toLowerCase();
}, i3 = r3.data = {}, a3 = r3.NATIVE = "N", s2 = r3.POLYFILL = "P";
return Rn = r3;
})();
return Ln = function(s2, u2) {
var l2, c2, d2, f2, p2, h2 = s2.target, g2 = s2.global, v2 = s2.stat;
if (l2 = g2 ? e5 : v2 ? e5[h2] || o2(h2, {}) : e5[h2] && e5[h2].prototype) for (c2 in u2) {
if (f2 = u2[c2], d2 = s2.dontCallGetSet ? (p2 = t2(l2, c2)) && p2.value : l2[c2], !a2(g2 ? c2 : h2 + (v2 ? "." : "#") + c2, s2.forced) && void 0 !== d2) {
if (typeof f2 == typeof d2) continue;
i2(f2, d2);
}
(s2.sham || d2 && d2.sham) && n2(f2, "sham", true), r2(l2, c2, f2, s2);
}
};
}
function pr() {
if ($n) return zn;
$n = 1;
var e5 = de(), t2 = me(), n2 = ce(), r2 = on(), o2 = (function() {
if (Hn) return jn;
Hn = 1;
var e6 = w();
return jn = !e6(function() {
function e7() {
}
return e7.prototype.constructor = null, Object.getPrototypeOf(new e7()) !== e7.prototype;
}), jn;
})(), i2 = r2("IE_PROTO"), a2 = Object, s2 = a2.prototype;
return zn = o2 ? a2.getPrototypeOf : function(r3) {
var o3 = n2(r3);
if (e5(o3, i2)) return o3[i2];
var u2 = o3.constructor;
return t2(u2) && o3 instanceof u2 ? u2.prototype : o3 instanceof a2 ? s2 : null;
}, zn;
}
function hr() {
if (Vn) return Un;
Vn = 1;
var e5, t2, n2, r2 = w(), o2 = me(), i2 = ye(), a2 = an(), s2 = pr(), u2 = On(), l2 = ve(), c2 = ae(), d2 = l2("iterator"), f2 = false;
return [].keys && ("next" in (n2 = [].keys()) ? (t2 = s2(s2(n2))) !== Object.prototype && (e5 = t2) : f2 = true), !i2(e5) || r2(function() {
var t3 = {};
return e5[d2].call(t3) !== t3;
}) ? e5 = {} : c2 && (e5 = a2(e5)), o2(e5[d2]) || u2(e5, d2, function() {
return this;
}), Un = { IteratorPrototype: e5, BUGGY_SAFARI_ITERATORS: f2 };
}
function gr() {
if (Gn) return Wn;
Gn = 1;
var e5 = Yt().f, t2 = de(), n2 = ve()("toStringTag");
return Wn = function(r2, o2, i2) {
r2 && !i2 && (r2 = r2.prototype), r2 && !t2(r2, n2) && e5(r2, n2, { configurable: true, value: o2 });
};
}
function vr() {
if (er) return Qn;
er = 1;
var e5 = (function() {
if (Jn) return Zn;
Jn = 1;
var e6 = ye();
return Zn = function(t3) {
return e6(t3) || null === t3;
};
})(), t2 = String, n2 = TypeError;
return Qn = function(r2) {
if (e5(r2)) return r2;
throw new n2("Can't set " + t2(r2) + " as a prototype");
};
}
function mr() {
if (nr) return tr;
nr = 1;
var e5 = (function() {
if (Xn) return Yn;
Xn = 1;
var e6 = D(), t3 = Wt();
return Yn = function(n3, r3, o2) {
try {
return e6(t3(Object.getOwnPropertyDescriptor(n3, r3)[o2]));
} catch (e7) {
}
};
})(), t2 = ye(), n2 = O(), r2 = vr();
return tr = Object.setPrototypeOf || ("__proto__" in {} ? (function() {
var o2, i2 = false, a2 = {};
try {
(o2 = e5(Object.prototype, "__proto__", "set"))(a2, []), i2 = a2 instanceof Array;
} catch (e6) {
}
return function(e6, a3) {
return n2(e6), r2(a3), t2(e6) ? (i2 ? o2(e6, a3) : e6.__proto__ = a3, e6) : e6;
};
})() : void 0), tr;
}
function yr() {
if (or) return rr;
or = 1;
var e5 = fr(), t2 = Ht(), n2 = ae(), r2 = An(), o2 = me(), i2 = (function() {
if (Kn) return qn;
Kn = 1;
var e6 = hr().IteratorPrototype, t3 = an(), n3 = un(), r3 = gr(), o3 = sn(), i3 = function() {
return this;
};
return qn = function(a3, s3, u3, l3) {
var c3 = s3 + " Iterator";
return a3.prototype = t3(e6, { next: n3(+!l3, u3) }), r3(a3, c3, false, true), o3[c3] = i3, a3;
}, qn;
})(), a2 = pr(), s2 = mr(), u2 = gr(), l2 = ln(), c2 = On(), d2 = ve(), f2 = sn(), p2 = hr(), h2 = r2.PROPER, g2 = r2.CONFIGURABLE, v2 = p2.IteratorPrototype, m2 = p2.BUGGY_SAFARI_ITERATORS, y2 = d2("iterator"), b2 = "keys", E2 = "values", w2 = "entries", C2 = function() {
return this;
};
return rr = function(r3, d3, p3, D2, A2, S2, x2) {
i2(p3, d3, D2);
var O2, N2, B2, T2 = function(e6) {
if (e6 === A2 && R2) return R2;
if (!m2 && e6 && e6 in P2) return P2[e6];
switch (e6) {
case b2:
case E2:
case w2:
return function() {
return new p3(this, e6);
};
}
return function() {
return new p3(this);
};
}, k2 = d3 + " Iterator", F2 = false, P2 = r3.prototype, I2 = P2[y2] || P2["@@iterator"] || A2 && P2[A2], R2 = !m2 && I2 || T2(A2), _2 = "Array" === d3 && P2.entries || I2;
if (_2 && (O2 = a2(_2.call(new r3()))) !== Object.prototype && O2.next && (n2 || a2(O2) === v2 || (s2 ? s2(O2, v2) : o2(O2[y2]) || c2(O2, y2, C2)), u2(O2, k2, true, true), n2 && (f2[k2] = C2)), h2 && A2 === E2 && I2 && I2.name !== E2 && (!n2 && g2 ? l2(P2, "name", E2) : (F2 = true, R2 = function() {
return t2(I2, this);
})), A2) if (N2 = { values: T2(E2), keys: S2 ? R2 : T2(b2), entries: T2(w2) }, x2) for (B2 in N2) (m2 || F2 || !(B2 in P2)) && c2(P2, B2, N2[B2]);
else e5({ target: d3, proto: true, forced: m2 || F2 }, N2);
return n2 && !x2 || P2[y2] === R2 || c2(P2, y2, R2, { name: A2 }), f2[d3] = R2, N2;
}, rr;
}
function br() {
return ar ? ir : (ar = 1, ir = function(e5, t2) {
return { value: e5, done: t2 };
});
}
function Er() {
if (ur) return sr;
ur = 1;
var e5 = N(), t2 = (function() {
if (xt) return St;
xt = 1;
var e6 = ve(), t3 = an(), n3 = Yt().f, r3 = e6("unscopables"), o3 = Array.prototype;
return void 0 === o3[r3] && n3(o3, r3, { configurable: true, value: t3(null) }), St = function(e7) {
o3[r3][e7] = true;
};
})(), n2 = sn(), r2 = cn(), o2 = Yt().f, i2 = yr(), a2 = br(), s2 = ae(), u2 = Se(), l2 = "Array Iterator", c2 = r2.set, d2 = r2.getterFor(l2);
sr = i2(Array, "Array", function(t3, n3) {
c2(this, { type: l2, target: e5(t3), index: 0, kind: n3 });
}, function() {
var e6 = d2(this), t3 = e6.target, n3 = e6.index++;
if (!t3 || n3 >= t3.length) return e6.target = null, a2(void 0, true);
switch (e6.kind) {
case "keys":
return a2(n3, false);
case "values":
return a2(t3[n3], false);
}
return a2([n3, t3[n3]], false);
}, "values");
var f2 = n2.Arguments = n2.Array;
if (t2("keys"), t2("values"), t2("entries"), !s2 && u2 && "values" !== f2.name) try {
o2(f2, "name", { value: "values" });
} catch (e6) {
}
return sr;
}
Er();
var wr, Cr, Dr, Ar, Sr, xr, Or, Nr = {};
function Br() {
if (Cr) return wr;
Cr = 1;
var e5 = {};
return e5[ve()("toStringTag")] = "z", wr = "[object z]" === String(e5);
}
function Tr() {
if (Ar) return Dr;
Ar = 1;
var e5 = Br(), t2 = me(), n2 = A(), r2 = ve()("toStringTag"), o2 = Object, i2 = "Arguments" === n2(/* @__PURE__ */ (function() {
return arguments;
})());
return Dr = e5 ? n2 : function(e6) {
var a2, s2, u2;
return void 0 === e6 ? "Undefined" : null === e6 ? "Null" : "string" == typeof (s2 = (function(e7, t3) {
try {
return e7[t3];
} catch (e8) {
}
})(a2 = o2(e6), r2)) ? s2 : i2 ? n2(a2) : "Object" === (u2 = n2(a2)) && t2(a2.callee) ? "Arguments" : u2;
}, Dr;
}
!(function() {
if (Or) return Nr;
Or = 1;
var e5 = Br(), t2 = On(), n2 = (function() {
if (xr) return Sr;
xr = 1;
var e6 = Br(), t3 = Tr();
return Sr = e6 ? {}.toString : function() {
return "[object " + t3(this) + "]";
};
})();
e5 || t2(Object.prototype, "toString", n2, { unsafe: true });
})();
var kr, Fr, Pr, Ir, Rr, _r, Lr, Mr, jr, Hr, zr, $r, Ur, Vr = {};
function Wr() {
if (Fr) return kr;
Fr = 1;
var e5 = Tr(), t2 = String;
return kr = function(n2) {
if ("Symbol" === e5(n2)) throw new TypeError("Cannot convert a Symbol value to a string");
return t2(n2);
};
}
function Gr() {
if (Ir) return Pr;
Ir = 1;
var e5 = be();
return Pr = function() {
var t2 = e5(this), n2 = "";
return t2.hasIndices && (n2 += "d"), t2.global && (n2 += "g"), t2.ignoreCase && (n2 += "i"), t2.multiline && (n2 += "m"), t2.dotAll && (n2 += "s"), t2.unicode && (n2 += "u"), t2.unicodeSets && (n2 += "v"), t2.sticky && (n2 += "y"), n2;
};
}
function qr() {
if ($r) return zr;
$r = 1;
var e5, t2, n2 = Ht(), r2 = D(), o2 = Wr(), i2 = Gr(), a2 = (function() {
if (_r) return Rr;
_r = 1;
var e6 = w(), t3 = B().RegExp, n3 = e6(function() {
var e7 = t3("a", "y");
return e7.lastIndex = 2, null !== e7.exec("abcd");
}), r3 = n3 || e6(function() {
return !t3("a", "y").sticky;
}), o3 = n3 || e6(function() {
var e7 = t3("^r", "gy");
return e7.lastIndex = 2, null !== e7.exec("str");
});
return Rr = { BROKEN_CARET: o3, MISSED_STICKY: r3, UNSUPPORTED_Y: n3 };
})(), s2 = le(), u2 = an(), l2 = cn().get, c2 = (function() {
if (Mr) return Lr;
Mr = 1;
var e6 = w(), t3 = B().RegExp;
return Lr = e6(function() {
var e7 = t3(".", "s");
return !(e7.dotAll && e7.test("\n") && "s" === e7.flags);
});
})(), d2 = (function() {
if (Hr) return jr;
Hr = 1;
var e6 = w(), t3 = B().RegExp;
return jr = e6(function() {
var e7 = t3("(?b)", "g");
return "b" !== e7.exec("b").groups.a || "bc" !== "b".replace(e7, "$c");
});
})(), f2 = s2("native-string-replace", String.prototype.replace), p2 = RegExp.prototype.exec, h2 = p2, g2 = r2("".charAt), v2 = r2("".indexOf), m2 = r2("".replace), y2 = r2("".slice), b2 = (t2 = /b*/g, n2(p2, e5 = /a/, "a"), n2(p2, t2, "a"), 0 !== e5.lastIndex || 0 !== t2.lastIndex), E2 = a2.BROKEN_CARET, C2 = void 0 !== /()??/.exec("")[1];
return (b2 || C2 || E2 || c2 || d2) && (h2 = function(e6) {
var t3, r3, a3, s3, c3, d3, w2, D2 = this, A2 = l2(D2), S2 = o2(e6), x2 = A2.raw;
if (x2) return x2.lastIndex = D2.lastIndex, t3 = n2(h2, x2, S2), D2.lastIndex = x2.lastIndex, t3;
var O2 = A2.groups, N2 = E2 && D2.sticky, B2 = n2(i2, D2), T2 = D2.source, k2 = 0, F2 = S2;
if (N2 && (B2 = m2(B2, "y", ""), -1 === v2(B2, "g") && (B2 += "g"), F2 = y2(S2, D2.lastIndex), D2.lastIndex > 0 && (!D2.multiline || D2.multiline && "\n" !== g2(S2, D2.lastIndex - 1)) && (T2 = "(?: " + T2 + ")", F2 = " " + F2, k2++), r3 = new RegExp("^(?:" + T2 + ")", B2)), C2 && (r3 = new RegExp("^" + T2 + "$(?!\\s)", B2)), b2 && (a3 = D2.lastIndex), s3 = n2(p2, N2 ? r3 : D2, F2), N2 ? s3 ? (s3.input = y2(s3.input, k2), s3[0] = y2(s3[0], k2), s3.index = D2.lastIndex, D2.lastIndex += s3[0].length) : D2.lastIndex = 0 : b2 && s3 && (D2.lastIndex = D2.global ? s3.index + s3[0].length : a3), C2 && s3 && s3.length > 1 && n2(f2, s3[0], r3, function() {
for (c3 = 1; c3 < arguments.length - 2; c3++) void 0 === arguments[c3] && (s3[c3] = void 0);
}), s3 && O2) for (s3.groups = d3 = u2(null), c3 = 0; c3 < O2.length; c3++) d3[(w2 = O2[c3])[0]] = s3[w2[1]];
return s3;
}), zr = h2;
}
function Kr() {
if (Ur) return Vr;
Ur = 1;
var e5 = fr(), t2 = qr();
return e5({ target: "RegExp", proto: true, forced: /./.exec !== t2 }, { exec: t2 }), Vr;
}
Kr();
var Yr, Xr, Zr, Jr = {};
function Qr() {
if (Xr) return Yr;
Xr = 1;
var e5 = D(), t2 = Xt(), n2 = Wr(), r2 = O(), o2 = e5("".charAt), i2 = e5("".charCodeAt), a2 = e5("".slice), s2 = function(e6) {
return function(s3, u2) {
var l2, c2, d2 = n2(r2(s3)), f2 = t2(u2), p2 = d2.length;
return f2 < 0 || f2 >= p2 ? e6 ? "" : void 0 : (l2 = i2(d2, f2)) < 55296 || l2 > 56319 || f2 + 1 === p2 || (c2 = i2(d2, f2 + 1)) < 56320 || c2 > 57343 ? e6 ? o2(d2, f2) : l2 : e6 ? a2(d2, f2, f2 + 2) : c2 - 56320 + (l2 - 55296 << 10) + 65536;
};
};
return Yr = { codeAt: s2(false), charAt: s2(true) };
}
!(function() {
if (Zr) return Jr;
Zr = 1;
var e5 = Qr().charAt, t2 = Wr(), n2 = cn(), r2 = yr(), o2 = br(), i2 = "String Iterator", a2 = n2.set, s2 = n2.getterFor(i2);
r2(String, "String", function(e6) {
a2(this, { type: i2, string: t2(e6), index: 0 });
}, function() {
var t3, n3 = s2(this), r3 = n3.string, i3 = n3.index;
return i3 >= r3.length ? o2(void 0, true) : (t3 = e5(r3, i3), n3.index += t3.length, o2(t3, false));
});
})();
var eo, to, no, ro, oo, io, ao, so, uo, lo, co, fo = {};
function po() {
if (ro) return no;
ro = 1;
var e5 = Qr().charAt;
return no = function(t2, n2, r2) {
return n2 + (r2 ? e5(t2, n2).length : 1);
}, no;
}
function ho() {
if (so) return ao;
so = 1;
var e5 = Ht(), t2 = de(), n2 = $t(), r2 = (function() {
if (io) return oo;
io = 1;
var e6 = B(), t3 = w(), n3 = e6.RegExp, r3 = !t3(function() {
var e7 = true;
try {
n3(".", "d");
} catch (t5) {
e7 = false;
}
var t4 = {}, r4 = "", o3 = e7 ? "dgimsy" : "gimsy", i3 = function(e8, n4) {
Object.defineProperty(t4, e8, { get: function() {
return r4 += n4, true;
} });
}, a2 = { dotAll: "s", global: "g", ignoreCase: "i", multiline: "m", sticky: "y" };
for (var s2 in e7 && (a2.hasIndices = "d"), a2) i3(s2, a2[s2]);
return Object.getOwnPropertyDescriptor(n3.prototype, "flags").get.call(t4) !== o3 || r4 !== o3;
});
return oo = { correct: r3 };
})(), o2 = Gr(), i2 = RegExp.prototype;
return ao = r2.correct ? function(e6) {
return e6.flags;
} : function(a2) {
return r2.correct || !n2(i2, a2) || t2(a2, "flags") ? a2.flags : e5(o2, a2);
};
}
!(function() {
if (co) return fo;
co = 1;
var e5 = Ht(), t2 = D(), n2 = (function() {
if (to) return eo;
to = 1, Kr();
var e6 = Ht(), t3 = On(), n3 = qr(), r3 = w(), o3 = ve(), i3 = ln(), a3 = o3("species"), s3 = RegExp.prototype;
return eo = function(u3, l3, c3, d3) {
var f3 = o3(u3), p2 = !r3(function() {
var e7 = {};
return e7[f3] = function() {
return 7;
}, 7 !== ""[u3](e7);
}), h2 = p2 && !r3(function() {
var e7 = false, t4 = /a/;
if ("split" === u3) {
var n4 = {};
n4[a3] = function() {
return t4;
}, (t4 = { constructor: n4, flags: "" })[f3] = /./[f3];
}
return t4.exec = function() {
return e7 = true, null;
}, t4[f3](""), !e7;
});
if (!p2 || !h2 || c3) {
var g2 = /./[f3], v2 = l3(f3, ""[u3], function(t4, r4, o4, i4, a4) {
var u4 = r4.exec;
return u4 === n3 || u4 === s3.exec ? p2 && !a4 ? { done: true, value: e6(g2, r4, o4, i4) } : { done: true, value: e6(t4, o4, r4, i4) } : { done: false };
});
t3(String.prototype, u3, v2[0]), t3(s3, f3, v2[1]);
}
d3 && i3(s3[f3], "sham", true);
}, eo;
})(), r2 = be(), o2 = ye(), i2 = Zt(), a2 = Wr(), s2 = O(), u2 = Gt(), l2 = po(), c2 = ho(), d2 = (function() {
if (lo) return uo;
lo = 1;
var e6 = Ht(), t3 = be(), n3 = me(), r3 = A(), o3 = qr(), i3 = TypeError;
return uo = function(a3, s3) {
var u3 = a3.exec;
if (n3(u3)) {
var l3 = e6(u3, a3, s3);
return null !== l3 && t3(l3), l3;
}
if ("RegExp" === r3(a3)) return e6(o3, a3, s3);
throw new i3("RegExp#exec called on incompatible receiver");
}, uo;
})(), f2 = t2("".indexOf);
n2("match", function(t3, n3, p2) {
return [function(n4) {
var r3 = s2(this), i3 = o2(n4) ? u2(n4, t3) : void 0;
return i3 ? e5(i3, n4, r3) : new RegExp(n4)[t3](a2(r3));
}, function(e6) {
var t4 = r2(this), o3 = a2(e6), s3 = p2(n3, t4, o3);
if (s3.done) return s3.value;
var u3 = a2(c2(t4));
if (-1 === f2(u3, "g")) return d2(t4, o3);
var h2 = -1 !== f2(u3, "u");
t4.lastIndex = 0;
for (var g2, v2 = [], m2 = 0; null !== (g2 = d2(t4, o3)); ) {
var y2 = a2(g2[0]);
v2[m2] = y2, "" === y2 && (t4.lastIndex = l2(o3, i2(t4.lastIndex), h2)), m2++;
}
return 0 === m2 ? null : v2;
}];
});
})();
var go, vo, mo, yo, bo, Eo, wo, Co, Do, Ao, So, xo, Oo, No, Bo, To, ko, Fo, Po, Io, Ro, _o, Lo, Mo, jo, Ho, zo, $o = {}, Uo = {};
function Vo() {
if (vo) return go;
vo = 1;
var e5 = ye(), t2 = ln();
return go = function(n2, r2) {
e5(r2) && "cause" in r2 && t2(n2, "cause", r2.cause);
}, go;
}
function Wo() {
if (Co) return wo;
Co = 1;
var e5 = ln(), t2 = (function() {
if (yo) return mo;
yo = 1;
var e6 = D(), t3 = Error, n3 = e6("".replace), r3 = String(new t3("zxcasd").stack), o2 = /\n\s*at [^:]*:[^\n]*/, i2 = o2.test(r3);
return mo = function(e7, r4) {
if (i2 && "string" == typeof e7 && !t3.prepareStackTrace) for (; r4--; ) e7 = n3(e7, o2, "");
return e7;
};
})(), n2 = (function() {
if (Eo) return bo;
Eo = 1;
var e6 = w(), t3 = un();
return bo = !e6(function() {
var e7 = new Error("a");
return !("stack" in e7) || (Object.defineProperty(e7, "stack", t3(1, 7)), 7 !== e7.stack);
});
})(), r2 = Error.captureStackTrace;
return wo = function(o2, i2, a2, s2) {
n2 && (r2 ? r2(o2, i2) : e5(o2, "stack", t2(a2, s2)));
}, wo;
}
function Go() {
if (xo) return So;
xo = 1;
var e5 = (function() {
if (Ao) return Do;
Ao = 1;
var e6 = A(), t3 = D();
return Do = function(n3) {
if ("Function" === e6(n3)) return t3(n3);
};
})(), t2 = Wt(), n2 = C(), r2 = e5(e5.bind);
return So = function(e6, o2) {
return t2(e6), void 0 === o2 ? e6 : n2 ? r2(e6, o2) : function() {
return e6.apply(o2, arguments);
};
}, So;
}
function qo() {
if (No) return Oo;
No = 1;
var e5 = ve(), t2 = sn(), n2 = e5("iterator"), r2 = Array.prototype;
return Oo = function(e6) {
return void 0 !== e6 && (t2.Array === e6 || r2[n2] === e6);
};
}
function Ko() {
if (To) return Bo;
To = 1;
var e5 = Tr(), t2 = Gt(), n2 = x(), r2 = sn(), o2 = ve()("iterator");
return Bo = function(i2) {
if (!n2(i2)) return t2(i2, o2) || t2(i2, "@@iterator") || r2[e5(i2)];
};
}
function Yo() {
if (Fo) return ko;
Fo = 1;
var e5 = Ht(), t2 = Wt(), n2 = be(), r2 = Vt(), o2 = Ko(), i2 = TypeError;
return ko = function(a2, s2) {
var u2 = arguments.length < 2 ? o2(a2) : s2;
if (t2(u2)) return n2(e5(u2, a2));
throw new i2(r2(a2) + " is not iterable");
}, ko;
}
function Xo() {
if (Io) return Po;
Io = 1;
var e5 = Ht(), t2 = be(), n2 = Gt();
return Po = function(r2, o2, i2) {
var a2, s2;
t2(r2);
try {
if (!(a2 = n2(r2, "return"))) {
if ("throw" === o2) throw i2;
return i2;
}
a2 = e5(a2, r2);
} catch (e6) {
s2 = true, a2 = e6;
}
if ("throw" === o2) throw i2;
if (s2) throw a2;
return t2(a2), i2;
}, Po;
}
function Zo() {
if (_o) return Ro;
_o = 1;
var e5 = Go(), t2 = Ht(), n2 = be(), r2 = Vt(), o2 = qo(), i2 = Jt(), a2 = $t(), s2 = Yo(), u2 = Ko(), l2 = Xo(), c2 = TypeError, d2 = function(e6, t3) {
this.stopped = e6, this.result = t3;
}, f2 = d2.prototype;
return Ro = function(p2, h2, g2) {
var v2, m2, y2, b2, E2, w2, C2, D2 = g2 && g2.that, A2 = !(!g2 || !g2.AS_ENTRIES), S2 = !(!g2 || !g2.IS_RECORD), x2 = !(!g2 || !g2.IS_ITERATOR), O2 = !(!g2 || !g2.INTERRUPTED), N2 = e5(h2, D2), B2 = function(e6) {
return v2 && l2(v2, "normal"), new d2(true, e6);
}, T2 = function(e6) {
return A2 ? (n2(e6), O2 ? N2(e6[0], e6[1], B2) : N2(e6[0], e6[1])) : O2 ? N2(e6, B2) : N2(e6);
};
if (S2) v2 = p2.iterator;
else if (x2) v2 = p2;
else {
if (!(m2 = u2(p2))) throw new c2(r2(p2) + " is not iterable");
if (o2(m2)) {
for (y2 = 0, b2 = i2(p2); b2 > y2; y2++) if ((E2 = T2(p2[y2])) && a2(f2, E2)) return E2;
return new d2(false);
}
v2 = s2(p2, m2);
}
for (w2 = S2 ? p2.next : v2.next; !(C2 = t2(w2, v2)).done; ) {
try {
E2 = T2(C2.value);
} catch (e6) {
l2(v2, "throw", e6);
}
if ("object" == typeof E2 && E2 && a2(f2, E2)) return E2;
}
return new d2(false);
}, Ro;
}
function Jo() {
if (Mo) return Lo;
Mo = 1;
var e5 = Wr();
return Lo = function(t2, n2) {
return void 0 === t2 ? arguments.length < 2 ? "" : n2 : e5(t2);
}, Lo;
}
function Qo() {
return Ho || (Ho = 1, (function() {
if (jo) return Uo;
jo = 1;
var e5 = fr(), t2 = $t(), n2 = pr(), r2 = mr(), o2 = dr(), i2 = an(), a2 = ln(), s2 = un(), u2 = Vo(), l2 = Wo(), c2 = Zo(), d2 = Jo(), f2 = ve()("toStringTag"), p2 = Error, h2 = [].push, g2 = function(e6, o3) {
var s3, m2 = t2(v2, this);
r2 ? s3 = r2(new p2(), m2 ? n2(this) : v2) : (s3 = m2 ? this : i2(v2), a2(s3, f2, "Error")), void 0 !== o3 && a2(s3, "message", d2(o3)), l2(s3, g2, s3.stack, 1), arguments.length > 2 && u2(s3, arguments[2]);
var y2 = [];
return c2(e6, h2, { that: y2 }), a2(s3, "errors", y2), s3;
};
r2 ? r2(g2, p2) : o2(g2, p2, { name: true });
var v2 = g2.prototype = i2(p2.prototype, { constructor: s2(1, g2), message: s2(1, ""), name: s2(1, "AggregateError") });
e5({ global: true, constructor: true, arity: 2 }, { AggregateError: g2 });
})()), $o;
}
zo || (zo = 1, Qo());
var ei, ti, ni = {};
ti || (ti = 1, (function() {
if (ei) return ni;
ei = 1;
var e5 = fr(), t2 = B();
e5({ global: true, forced: t2.globalThis !== t2 }, { globalThis: t2 });
})());
var ri, oi, ii, ai, si, ui, li = {};
function ci() {
return oi ? ri : (oi = 1, ri = { CSSRuleList: 0, CSSStyleDeclaration: 0, CSSValueList: 0, ClientRectList: 0, DOMRectList: 0, DOMStringList: 0, DOMTokenList: 1, DataTransferItemList: 0, FileList: 0, HTMLAllCollection: 0, HTMLCollection: 0, HTMLFormElement: 0, HTMLSelectElement: 0, MediaList: 0, MimeTypeArray: 0, NamedNodeMap: 0, NodeList: 1, PaintRequestList: 0, Plugin: 0, PluginArray: 0, SVGLengthList: 0, SVGNumberList: 0, SVGPathSegList: 0, SVGPointList: 0, SVGStringList: 0, SVGTransformList: 0, SourceBufferList: 0, StyleSheetList: 0, TextTrackCueList: 0, TextTrackList: 0, TouchList: 0 });
}
function di() {
if (ai) return ii;
ai = 1;
var e5 = Mt()("span").classList, t2 = e5 && e5.constructor && e5.constructor.prototype;
return ii = t2 === Object.prototype ? void 0 : t2;
}
if ((function() {
if (si) return li;
si = 1;
var e5 = B(), t2 = ci(), n2 = di(), r2 = Er(), o2 = ln(), i2 = gr(), a2 = ve()("iterator"), s2 = r2.values, u2 = function(e6, n3) {
if (e6) {
if (e6[a2] !== s2) try {
o2(e6, a2, s2);
} catch (t3) {
e6[a2] = s2;
}
if (i2(e6, n3, true), t2[n3]) {
for (var u3 in r2) if (e6[u3] !== r2[u3]) try {
o2(e6, u3, r2[u3]);
} catch (t3) {
e6[u3] = r2[u3];
}
}
}
};
for (var l2 in t2) u2(e5[l2] && e5[l2].prototype, l2);
u2(n2, "DOMTokenList");
})(), "undefined" == typeof global) {
if ("ActiveXObject" in window) {
console.error("抱歉,wangEditor V5+ 版本开始,不在支持 IE 浏览器\n Sorry, wangEditor V5+ versions do not support IE browser.");
}
fi(), pi();
} else global && (null === (ui = global.navigator) || void 0 === ui ? void 0 : ui.userAgent.match("QQBrowser")) && (fi(), pi());
function fi() {
"undefined" == typeof globalThis && (window.globalThis = window);
}
function pi() {
"undefined" == typeof AggregateError && (window.AggregateError = function(e5, t2) {
var n2 = new Error(t2);
return n2.errors = e5, n2;
});
}
var hi, gi, vi, mi, yi, bi, Ei, wi, Ci, Di, Ai, Si, xi, Oi, Ni, Bi, Ti = {};
function ki() {
if (gi) return hi;
gi = 1;
var e5 = function(e6) {
return e6 && e6.Math === Math && e6;
};
return hi = e5("object" == typeof globalThis && globalThis) || e5("object" == typeof window && window) || e5("object" == typeof self && self) || e5("object" == typeof y && y) || e5("object" == typeof hi && hi) || /* @__PURE__ */ (function() {
return this;
})() || Function("return this")();
}
function Fi() {
return mi ? vi : (mi = 1, vi = function(e5) {
try {
return !!e5();
} catch (e6) {
return true;
}
});
}
function Pi() {
return bi ? yi : (bi = 1, yi = !Fi()(function() {
var e5 = (function() {
}).bind();
return "function" != typeof e5 || e5.hasOwnProperty("prototype");
}));
}
function Ii() {
if (wi) return Ei;
wi = 1;
var e5 = Pi(), t2 = Function.prototype, n2 = t2.apply, r2 = t2.call;
return Ei = "object" == typeof Reflect && Reflect.apply || (e5 ? r2.bind(n2) : function() {
return r2.apply(n2, arguments);
}), Ei;
}
function Ri() {
if (Di) return Ci;
Di = 1;
var e5 = Pi(), t2 = Function.prototype, n2 = t2.call, r2 = e5 && t2.bind.bind(n2, n2);
return Ci = e5 ? r2 : function(e6) {
return function() {
return n2.apply(e6, arguments);
};
}, Ci;
}
function _i() {
if (Si) return Ai;
Si = 1;
var e5 = Ri(), t2 = e5({}.toString), n2 = e5("".slice);
return Ai = function(e6) {
return n2(t2(e6), 8, -1);
};
}
function Li() {
if (Oi) return xi;
Oi = 1;
var e5 = _i(), t2 = Ri();
return xi = function(n2) {
if ("Function" === e5(n2)) return t2(n2);
};
}
function Mi() {
if (Bi) return Ni;
Bi = 1;
var e5 = "object" == typeof document && document.all;
return Ni = void 0 === e5 && void 0 !== e5 ? function(t2) {
return "function" == typeof t2 || t2 === e5;
} : function(e6) {
return "function" == typeof e6;
};
}
var ji, Hi, zi, $i, Ui = {};
function Vi() {
return Hi ? ji : (Hi = 1, ji = !Fi()(function() {
return 7 !== Object.defineProperty({}, 1, { get: function() {
return 7;
} })[1];
}));
}
function Wi() {
if ($i) return zi;
$i = 1;
var e5 = Pi(), t2 = Function.prototype.call;
return zi = e5 ? t2.bind(t2) : function() {
return t2.apply(t2, arguments);
}, zi;
}
var Gi, qi, Ki, Yi, Xi, Zi, Ji, Qi, ea, ta, na, ra, oa, ia, aa, sa, ua, la, ca, da, fa, pa, ha, ga, va, ma, ya, ba, Ea, wa, Ca, Da, Aa, Sa, xa, Oa, Na, Ba = {};
function Ta() {
if (Gi) return Ba;
Gi = 1;
var e5 = {}.propertyIsEnumerable, t2 = Object.getOwnPropertyDescriptor, n2 = t2 && !e5.call({ 1: 2 }, 1);
return Ba.f = n2 ? function(e6) {
var n3 = t2(this, e6);
return !!n3 && n3.enumerable;
} : e5, Ba;
}
function ka() {
return Ki ? qi : (Ki = 1, qi = function(e5, t2) {
return { enumerable: !(1 & e5), configurable: !(2 & e5), writable: !(4 & e5), value: t2 };
});
}
function Fa() {
if (Xi) return Yi;
Xi = 1;
var e5 = Ri(), t2 = Fi(), n2 = _i(), r2 = Object, o2 = e5("".split);
return Yi = t2(function() {
return !r2("z").propertyIsEnumerable(0);
}) ? function(e6) {
return "String" === n2(e6) ? o2(e6, "") : r2(e6);
} : r2;
}
function Pa() {
return Ji ? Zi : (Ji = 1, Zi = function(e5) {
return null == e5;
});
}
function Ia() {
if (ea) return Qi;
ea = 1;
var e5 = Pa(), t2 = TypeError;
return Qi = function(n2) {
if (e5(n2)) throw new t2("Can't call method on " + n2);
return n2;
};
}
function Ra() {
if (na) return ta;
na = 1;
var e5 = Fa(), t2 = Ia();
return ta = function(n2) {
return e5(t2(n2));
};
}
function _a() {
if (oa) return ra;
oa = 1;
var e5 = Mi();
return ra = function(t2) {
return "object" == typeof t2 ? null !== t2 : e5(t2);
};
}
function La() {
return aa ? ia : (aa = 1, ia = {});
}
function Ma() {
if (ua) return sa;
ua = 1;
var e5 = La(), t2 = ki(), n2 = Mi(), r2 = function(e6) {
return n2(e6) ? e6 : void 0;
};
return sa = function(n3, o2) {
return arguments.length < 2 ? r2(e5[n3]) || r2(t2[n3]) : e5[n3] && e5[n3][o2] || t2[n3] && t2[n3][o2];
}, sa;
}
function ja() {
return ca ? la : (ca = 1, la = Ri()({}.isPrototypeOf));
}
function Ha() {
if (fa) return da;
fa = 1;
var e5 = ki().navigator, t2 = e5 && e5.userAgent;
return da = t2 ? String(t2) : "";
}
function za() {
if (ha) return pa;
ha = 1;
var e5, t2, n2 = ki(), r2 = Ha(), o2 = n2.process, i2 = n2.Deno, a2 = o2 && o2.versions || i2 && i2.version, s2 = a2 && a2.v8;
return s2 && (t2 = (e5 = s2.split("."))[0] > 0 && e5[0] < 4 ? 1 : +(e5[0] + e5[1])), !t2 && r2 && (!(e5 = r2.match(/Edge\/(\d+)/)) || e5[1] >= 74) && (e5 = r2.match(/Chrome\/(\d+)/)) && (t2 = +e5[1]), pa = t2;
}
function $a() {
if (va) return ga;
va = 1;
var e5 = za(), t2 = Fi(), n2 = ki().String;
return ga = !!Object.getOwnPropertySymbols && !t2(function() {
var t3 = Symbol("symbol detection");
return !n2(t3) || !(Object(t3) instanceof Symbol) || !Symbol.sham && e5 && e5 < 41;
}), ga;
}
function Ua() {
return ya ? ma : (ya = 1, ma = $a() && !Symbol.sham && "symbol" == typeof Symbol.iterator);
}
function Va() {
if (Ea) return ba;
Ea = 1;
var e5 = Ma(), t2 = Mi(), n2 = ja(), r2 = Object;
return ba = Ua() ? function(e6) {
return "symbol" == typeof e6;
} : function(o2) {
var i2 = e5("Symbol");
return t2(i2) && n2(i2.prototype, r2(o2));
};
}
function Wa() {
if (Ca) return wa;
Ca = 1;
var e5 = String;
return wa = function(t2) {
try {
return e5(t2);
} catch (e6) {
return "Object";
}
};
}
function Ga() {
if (Aa) return Da;
Aa = 1;
var e5 = Mi(), t2 = Wa(), n2 = TypeError;
return Da = function(r2) {
if (e5(r2)) return r2;
throw new n2(t2(r2) + " is not a function");
};
}
function qa() {
if (xa) return Sa;
xa = 1;
var e5 = Ga(), t2 = Pa();
return Sa = function(n2, r2) {
var o2 = n2[r2];
return t2(o2) ? void 0 : e5(o2);
}, Sa;
}
function Ka() {
if (Na) return Oa;
Na = 1;
var e5 = Wi(), t2 = Mi(), n2 = _a(), r2 = TypeError;
return Oa = function(o2, i2) {
var a2, s2;
if ("string" === i2 && t2(a2 = o2.toString) && !n2(s2 = e5(a2, o2))) return s2;
if (t2(a2 = o2.valueOf) && !n2(s2 = e5(a2, o2))) return s2;
if ("string" !== i2 && t2(a2 = o2.toString) && !n2(s2 = e5(a2, o2))) return s2;
throw new r2("Can't convert object to primitive value");
}, Oa;
}
var Ya, Xa, Za, Ja, Qa, es, ts, ns, rs, os, is, as, ss, us, ls, cs, ds, fs, ps, hs, gs, vs, ms, ys, bs, Es, ws, Cs, Ds = { exports: {} };
function As() {
return Xa ? Ya : (Xa = 1, Ya = true);
}
function Ss() {
if (Ja) return Za;
Ja = 1;
var e5 = ki(), t2 = Object.defineProperty;
return Za = function(n2, r2) {
try {
t2(e5, n2, { value: r2, configurable: true, writable: true });
} catch (t3) {
e5[n2] = r2;
}
return r2;
};
}
function xs() {
if (Qa) return Ds.exports;
Qa = 1;
var e5 = As(), t2 = ki(), n2 = Ss(), r2 = "__core-js_shared__", o2 = Ds.exports = t2[r2] || n2(r2, {});
return (o2.versions || (o2.versions = [])).push({ version: "3.47.0", mode: e5 ? "pure" : "global", copyright: "© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)", license: "https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE", source: "https://github.com/zloirock/core-js" }), Ds.exports;
}
function Os() {
if (ts) return es;
ts = 1;
var e5 = xs();
return es = function(t2, n2) {
return e5[t2] || (e5[t2] = n2 || {});
};
}
function Ns() {
if (rs) return ns;
rs = 1;
var e5 = Ia(), t2 = Object;
return ns = function(n2) {
return t2(e5(n2));
};
}
function Bs() {
if (is) return os;
is = 1;
var e5 = Ri(), t2 = Ns(), n2 = e5({}.hasOwnProperty);
return os = Object.hasOwn || function(e6, r2) {
return n2(t2(e6), r2);
};
}
function Ts() {
if (ss) return as;
ss = 1;
var e5 = Ri(), t2 = 0, n2 = Math.random(), r2 = e5(1.1.toString);
return as = function(e6) {
return "Symbol(" + (void 0 === e6 ? "" : e6) + ")_" + r2(++t2 + n2, 36);
};
}
function ks() {
if (ls) return us;
ls = 1;
var e5 = ki(), t2 = Os(), n2 = Bs(), r2 = Ts(), o2 = $a(), i2 = Ua(), a2 = e5.Symbol, s2 = t2("wks"), u2 = i2 ? a2.for || a2 : a2 && a2.withoutSetter || r2;
return us = function(e6) {
return n2(s2, e6) || (s2[e6] = o2 && n2(a2, e6) ? a2[e6] : u2("Symbol." + e6)), s2[e6];
};
}
function Fs() {
if (ds) return cs;
ds = 1;
var e5 = Wi(), t2 = _a(), n2 = Va(), r2 = qa(), o2 = Ka(), i2 = TypeError, a2 = ks()("toPrimitive");
return cs = function(s2, u2) {
if (!t2(s2) || n2(s2)) return s2;
var l2, c2 = r2(s2, a2);
if (c2) {
if (void 0 === u2 && (u2 = "default"), l2 = e5(c2, s2, u2), !t2(l2) || n2(l2)) return l2;
throw new i2("Can't convert object to primitive value");
}
return void 0 === u2 && (u2 = "number"), o2(s2, u2);
};
}
function Ps() {
if (ps) return fs;
ps = 1;
var e5 = Fs(), t2 = Va();
return fs = function(n2) {
var r2 = e5(n2, "string");
return t2(r2) ? r2 : r2 + "";
};
}
function Is() {
if (gs) return hs;
gs = 1;
var e5 = ki(), t2 = _a(), n2 = e5.document, r2 = t2(n2) && t2(n2.createElement);
return hs = function(e6) {
return r2 ? n2.createElement(e6) : {};
};
}
function Rs() {
if (ms) return vs;
ms = 1;
var e5 = Vi(), t2 = Fi(), n2 = Is();
return vs = !e5 && !t2(function() {
return 7 !== Object.defineProperty(n2("div"), "a", { get: function() {
return 7;
} }).a;
});
}
function _s() {
if (ys) return Ui;
ys = 1;
var e5 = Vi(), t2 = Wi(), n2 = Ta(), r2 = ka(), o2 = Ra(), i2 = Ps(), a2 = Bs(), s2 = Rs(), u2 = Object.getOwnPropertyDescriptor;
return Ui.f = e5 ? u2 : function(e6, l2) {
if (e6 = o2(e6), l2 = i2(l2), s2) try {
return u2(e6, l2);
} catch (e7) {
}
if (a2(e6, l2)) return r2(!t2(n2.f, e6, l2), e6[l2]);
}, Ui;
}
function Ls() {
if (Es) return bs;
Es = 1;
var e5 = Fi(), t2 = Mi(), n2 = /#|\.prototype\./, r2 = function(n3, r3) {
var u2 = i2[o2(n3)];
return u2 === s2 || u2 !== a2 && (t2(r3) ? e5(r3) : !!r3);
}, o2 = r2.normalize = function(e6) {
return String(e6).replace(n2, ".").toLowerCase();
}, i2 = r2.data = {}, a2 = r2.NATIVE = "N", s2 = r2.POLYFILL = "P";
return bs = r2;
}
function Ms() {
if (Cs) return ws;
Cs = 1;
var e5 = Li(), t2 = Ga(), n2 = Pi(), r2 = e5(e5.bind);
return ws = function(e6, o2) {
return t2(e6), void 0 === o2 ? e6 : n2 ? r2(e6, o2) : function() {
return e6.apply(o2, arguments);
};
}, ws;
}
var js, Hs, zs, $s, Us, Vs, Ws, Gs, qs, Ks, Ys, Xs, Zs, Js, Qs, eu, tu, nu, ru, ou, iu, au, su, uu, lu, cu, du, fu, pu, hu, gu, vu, mu, yu, bu, Eu, wu, Cu, Du = {};
function Au() {
return Hs ? js : (Hs = 1, js = Vi() && Fi()(function() {
return 42 !== Object.defineProperty(function() {
}, "prototype", { value: 42, writable: false }).prototype;
}));
}
function Su() {
if ($s) return zs;
$s = 1;
var e5 = _a(), t2 = String, n2 = TypeError;
return zs = function(r2) {
if (e5(r2)) return r2;
throw new n2(t2(r2) + " is not an object");
};
}
function xu() {
if (Us) return Du;
Us = 1;
var e5 = Vi(), t2 = Rs(), n2 = Au(), r2 = Su(), o2 = Ps(), i2 = TypeError, a2 = Object.defineProperty, s2 = Object.getOwnPropertyDescriptor, u2 = "enumerable", l2 = "configurable", c2 = "writable";
return Du.f = e5 ? n2 ? function(e6, t3, n3) {
if (r2(e6), t3 = o2(t3), r2(n3), "function" == typeof e6 && "prototype" === t3 && "value" in n3 && c2 in n3 && !n3[c2]) {
var i3 = s2(e6, t3);
i3 && i3[c2] && (e6[t3] = n3.value, n3 = { configurable: l2 in n3 ? n3[l2] : i3[l2], enumerable: u2 in n3 ? n3[u2] : i3[u2], writable: false });
}
return a2(e6, t3, n3);
} : a2 : function(e6, n3, s3) {
if (r2(e6), n3 = o2(n3), r2(s3), t2) try {
return a2(e6, n3, s3);
} catch (e7) {
}
if ("get" in s3 || "set" in s3) throw new i2("Accessors not supported");
return "value" in s3 && (e6[n3] = s3.value), e6;
}, Du;
}
function Ou() {
if (Ws) return Vs;
Ws = 1;
var e5 = Vi(), t2 = xu(), n2 = ka();
return Vs = e5 ? function(e6, r2, o2) {
return t2.f(e6, r2, n2(1, o2));
} : function(e6, t3, n3) {
return e6[t3] = n3, e6;
};
}
function Nu() {
if (qs) return Gs;
qs = 1;
var e5 = ki(), t2 = Ii(), n2 = Li(), r2 = Mi(), o2 = _s().f, i2 = Ls(), a2 = La(), s2 = Ms(), u2 = Ou(), l2 = Bs(), c2 = function(e6) {
var n3 = function(r3, o3, i3) {
if (this instanceof n3) {
switch (arguments.length) {
case 0:
return new e6();
case 1:
return new e6(r3);
case 2:
return new e6(r3, o3);
}
return new e6(r3, o3, i3);
}
return t2(e6, this, arguments);
};
return n3.prototype = e6.prototype, n3;
};
return Gs = function(t3, d2) {
var f2, p2, h2, g2, v2, m2, y2, b2, E2, w2 = t3.target, C2 = t3.global, D2 = t3.stat, A2 = t3.proto, S2 = C2 ? e5 : D2 ? e5[w2] : e5[w2] && e5[w2].prototype, x2 = C2 ? a2 : a2[w2] || u2(a2, w2, {})[w2], O2 = x2.prototype;
for (g2 in d2) p2 = !(f2 = i2(C2 ? g2 : w2 + (D2 ? "." : "#") + g2, t3.forced)) && S2 && l2(S2, g2), m2 = x2[g2], p2 && (y2 = t3.dontCallGetSet ? (E2 = o2(S2, g2)) && E2.value : S2[g2]), v2 = p2 && y2 ? y2 : d2[g2], (f2 || A2 || typeof m2 != typeof v2) && (b2 = t3.bind && p2 ? s2(v2, e5) : t3.wrap && p2 ? c2(v2) : A2 && r2(v2) ? n2(v2) : v2, (t3.sham || v2 && v2.sham || m2 && m2.sham) && u2(b2, "sham", true), u2(x2, g2, b2), A2 && (l2(a2, h2 = w2 + "Prototype") || u2(a2, h2, {}), u2(a2[h2], g2, v2), t3.real && O2 && (f2 || !O2[g2]) && u2(O2, g2, v2)));
};
}
function Bu() {
if (Ys) return Ks;
Ys = 1;
var e5 = _i();
return Ks = Array.isArray || function(t2) {
return "Array" === e5(t2);
};
}
function Tu() {
if (Zs) return Xs;
Zs = 1;
var e5 = Math.ceil, t2 = Math.floor;
return Xs = Math.trunc || function(n2) {
var r2 = +n2;
return (r2 > 0 ? t2 : e5)(r2);
}, Xs;
}
function ku() {
if (Qs) return Js;
Qs = 1;
var e5 = Tu();
return Js = function(t2) {
var n2 = +t2;
return n2 != n2 || 0 === n2 ? 0 : e5(n2);
};
}
function Fu() {
if (tu) return eu;
tu = 1;
var e5 = ku(), t2 = Math.min;
return eu = function(n2) {
var r2 = e5(n2);
return r2 > 0 ? t2(r2, 9007199254740991) : 0;
};
}
function Pu() {
if (ru) return nu;
ru = 1;
var e5 = Fu();
return nu = function(t2) {
return e5(t2.length);
};
}
function Iu() {
if (iu) return ou;
iu = 1;
var e5 = TypeError;
return ou = function(t2) {
if (t2 > 9007199254740991) throw e5("Maximum allowed index exceeded");
return t2;
};
}
function Ru() {
if (su) return au;
su = 1;
var e5 = Vi(), t2 = xu(), n2 = ka();
return au = function(r2, o2, i2) {
e5 ? t2.f(r2, o2, n2(0, i2)) : r2[o2] = i2;
};
}
function _u() {
if (lu) return uu;
lu = 1;
var e5 = {};
return e5[ks()("toStringTag")] = "z", uu = "[object z]" === String(e5);
}
function Lu() {
if (du) return cu;
du = 1;
var e5 = _u(), t2 = Mi(), n2 = _i(), r2 = ks()("toStringTag"), o2 = Object, i2 = "Arguments" === n2(/* @__PURE__ */ (function() {
return arguments;
})());
return cu = e5 ? n2 : function(e6) {
var a2, s2, u2;
return void 0 === e6 ? "Undefined" : null === e6 ? "Null" : "string" == typeof (s2 = (function(e7, t3) {
try {
return e7[t3];
} catch (e8) {
}
})(a2 = o2(e6), r2)) ? s2 : i2 ? n2(a2) : "Object" === (u2 = n2(a2)) && t2(a2.callee) ? "Arguments" : u2;
}, cu;
}
function Mu() {
if (pu) return fu;
pu = 1;
var e5 = Ri(), t2 = Mi(), n2 = xs(), r2 = e5(Function.toString);
return t2(n2.inspectSource) || (n2.inspectSource = function(e6) {
return r2(e6);
}), fu = n2.inspectSource;
}
function ju() {
if (gu) return hu;
gu = 1;
var e5 = Ri(), t2 = Fi(), n2 = Mi(), r2 = Lu(), o2 = Ma(), i2 = Mu(), a2 = function() {
}, s2 = o2("Reflect", "construct"), u2 = /^\s*(?:class|function)\b/, l2 = e5(u2.exec), c2 = !u2.test(a2), d2 = function(e6) {
if (!n2(e6)) return false;
try {
return s2(a2, [], e6), true;
} catch (e7) {
return false;
}
}, f2 = function(e6) {
if (!n2(e6)) return false;
switch (r2(e6)) {
case "AsyncFunction":
case "GeneratorFunction":
case "AsyncGeneratorFunction":
return false;
}
try {
return c2 || !!l2(u2, i2(e6));
} catch (e7) {
return true;
}
};
return f2.sham = true, hu = !s2 || t2(function() {
var e6;
return d2(d2.call) || !d2(Object) || !d2(function() {
e6 = true;
}) || e6;
}) ? f2 : d2;
}
function Hu() {
if (mu) return vu;
mu = 1;
var e5 = Bu(), t2 = ju(), n2 = _a(), r2 = ks()("species"), o2 = Array;
return vu = function(i2) {
var a2;
return e5(i2) && (a2 = i2.constructor, (t2(a2) && (a2 === o2 || e5(a2.prototype)) || n2(a2) && null === (a2 = a2[r2])) && (a2 = void 0)), void 0 === a2 ? o2 : a2;
}, vu;
}
function zu() {
if (bu) return yu;
bu = 1;
var e5 = Hu();
return yu = function(t2, n2) {
return new (e5(t2))(0 === n2 ? 0 : n2);
};
}
function $u() {
if (wu) return Eu;
wu = 1;
var e5 = Fi(), t2 = ks(), n2 = za(), r2 = t2("species");
return Eu = function(t3) {
return n2 >= 51 || !e5(function() {
var e6 = [];
return (e6.constructor = {})[r2] = function() {
return { foo: 1 };
}, 1 !== e6[t3](Boolean).foo;
});
}, Eu;
}
var Uu, Vu, Wu = {}, Gu = {};
function qu() {
if (Vu) return Uu;
Vu = 1;
var e5 = Lu(), t2 = String;
return Uu = function(n2) {
if ("Symbol" === e5(n2)) throw new TypeError("Cannot convert a Symbol value to a string");
return t2(n2);
};
}
var Ku, Yu, Xu, Zu, Ju, Qu, el, tl, nl, rl, ol, il, al, sl, ul, ll, cl, dl, fl, pl = {};
function hl() {
if (Yu) return Ku;
Yu = 1;
var e5 = ku(), t2 = Math.max, n2 = Math.min;
return Ku = function(r2, o2) {
var i2 = e5(r2);
return i2 < 0 ? t2(i2 + o2, 0) : n2(i2, o2);
}, Ku;
}
function gl() {
if (Zu) return Xu;
Zu = 1;
var e5 = Ra(), t2 = hl(), n2 = Pu(), r2 = function(r3) {
return function(o2, i2, a2) {
var s2 = e5(o2), u2 = n2(s2);
if (0 === u2) return !r3 && -1;
var l2, c2 = t2(a2, u2);
if (r3 && i2 != i2) {
for (; u2 > c2; ) if ((l2 = s2[c2++]) != l2) return true;
} else for (; u2 > c2; c2++) if ((r3 || c2 in s2) && s2[c2] === i2) return r3 || c2 || 0;
return !r3 && -1;
};
};
return Xu = { includes: r2(true), indexOf: r2(false) };
}
function vl() {
return Qu ? Ju : (Qu = 1, Ju = {});
}
function ml() {
if (tl) return el;
tl = 1;
var e5 = Ri(), t2 = Bs(), n2 = Ra(), r2 = gl().indexOf, o2 = vl(), i2 = e5([].push);
return el = function(e6, a2) {
var s2, u2 = n2(e6), l2 = 0, c2 = [];
for (s2 in u2) !t2(o2, s2) && t2(u2, s2) && i2(c2, s2);
for (; a2.length > l2; ) t2(u2, s2 = a2[l2++]) && (~r2(c2, s2) || i2(c2, s2));
return c2;
}, el;
}
function yl() {
return rl ? nl : (rl = 1, nl = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]);
}
function bl() {
if (il) return ol;
il = 1;
var e5 = ml(), t2 = yl();
return ol = Object.keys || function(n2) {
return e5(n2, t2);
}, ol;
}
function El() {
if (al) return pl;
al = 1;
var e5 = Vi(), t2 = Au(), n2 = xu(), r2 = Su(), o2 = Ra(), i2 = bl();
return pl.f = e5 && !t2 ? Object.defineProperties : function(e6, t3) {
r2(e6);
for (var a2, s2 = o2(t3), u2 = i2(t3), l2 = u2.length, c2 = 0; l2 > c2; ) n2.f(e6, a2 = u2[c2++], s2[a2]);
return e6;
}, pl;
}
function wl() {
return ul ? sl : (ul = 1, sl = Ma()("document", "documentElement"));
}
function Cl() {
if (cl) return ll;
cl = 1;
var e5 = Os(), t2 = Ts(), n2 = e5("keys");
return ll = function(e6) {
return n2[e6] || (n2[e6] = t2(e6));
};
}
function Dl() {
if (fl) return dl;
fl = 1;
var e5, t2 = Su(), n2 = El(), r2 = yl(), o2 = vl(), i2 = wl(), a2 = Is(), s2 = "prototype", u2 = "script", l2 = Cl()("IE_PROTO"), c2 = function() {
}, d2 = function(e6) {
return "<" + u2 + ">" + e6 + "" + u2 + ">";
}, f2 = function(e6) {
e6.write(d2("")), e6.close();
var t3 = e6.parentWindow.Object;
return e6 = null, t3;
}, p2 = function() {
try {
e5 = new ActiveXObject("htmlfile");
} catch (e6) {
}
var t3, n3, o3;
p2 = "undefined" != typeof document ? document.domain && e5 ? f2(e5) : (n3 = a2("iframe"), o3 = "java" + u2 + ":", n3.style.display = "none", i2.appendChild(n3), n3.src = String(o3), (t3 = n3.contentWindow.document).open(), t3.write(d2("document.F=Object")), t3.close(), t3.F) : f2(e5);
for (var l3 = r2.length; l3--; ) delete p2[s2][r2[l3]];
return p2();
};
return o2[l2] = true, dl = Object.create || function(e6, r3) {
var o3;
return null !== e6 ? (c2[s2] = t2(e6), o3 = new c2(), c2[s2] = null, o3[l2] = e6) : o3 = p2(), void 0 === r3 ? o3 : n2.f(o3, r3);
}, dl;
}
var Al, Sl = {};
function xl() {
if (Al) return Sl;
Al = 1;
var e5 = ml(), t2 = yl().concat("length", "prototype");
return Sl.f = Object.getOwnPropertyNames || function(n2) {
return e5(n2, t2);
}, Sl;
}
var Ol, Nl, Bl, Tl = {};
function kl() {
return Nl ? Ol : (Nl = 1, Ol = Ri()([].slice));
}
function Fl() {
if (Bl) return Tl;
Bl = 1;
var e5 = _i(), t2 = Ra(), n2 = xl().f, r2 = kl(), o2 = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
return Tl.f = function(i2) {
return o2 && "Window" === e5(i2) ? (function(e6) {
try {
return n2(e6);
} catch (e7) {
return r2(o2);
}
})(i2) : n2(t2(i2));
}, Tl;
}
var Pl, Il, Rl, _l, Ll, Ml = {};
function jl() {
return Pl || (Pl = 1, Ml.f = Object.getOwnPropertySymbols), Ml;
}
function Hl() {
if (Rl) return Il;
Rl = 1;
var e5 = Ou();
return Il = function(t2, n2, r2, o2) {
return o2 && o2.enumerable ? t2[n2] = r2 : e5(t2, n2, r2), t2;
};
}
function zl() {
if (Ll) return _l;
Ll = 1;
var e5 = xu();
return _l = function(t2, n2, r2) {
return e5.f(t2, n2, r2);
};
}
var $l, Ul, Vl, Wl, Gl, ql, Kl, Yl, Xl, Zl, Jl, Ql, ec, tc, nc, rc, oc = {};
function ic() {
if ($l) return oc;
$l = 1;
var e5 = ks();
return oc.f = e5, oc;
}
function ac() {
if (Vl) return Ul;
Vl = 1;
var e5 = La(), t2 = Bs(), n2 = ic(), r2 = xu().f;
return Ul = function(o2) {
var i2 = e5.Symbol || (e5.Symbol = {});
t2(i2, o2) || r2(i2, o2, { value: n2.f(o2) });
};
}
function sc() {
if (Gl) return Wl;
Gl = 1;
var e5 = Wi(), t2 = Ma(), n2 = ks(), r2 = Hl();
return Wl = function() {
var o2 = t2("Symbol"), i2 = o2 && o2.prototype, a2 = i2 && i2.valueOf, s2 = n2("toPrimitive");
i2 && !i2[s2] && r2(i2, s2, function(t3) {
return e5(a2, this);
}, { arity: 1 });
};
}
function uc() {
if (Kl) return ql;
Kl = 1;
var e5 = _u(), t2 = Lu();
return ql = e5 ? {}.toString : function() {
return "[object " + t2(this) + "]";
};
}
function lc() {
if (Xl) return Yl;
Xl = 1;
var e5 = _u(), t2 = xu().f, n2 = Ou(), r2 = Bs(), o2 = uc(), i2 = ks()("toStringTag");
return Yl = function(a2, s2, u2, l2) {
var c2 = u2 ? a2 : a2 && a2.prototype;
c2 && (r2(c2, i2) || t2(c2, i2, { configurable: true, value: s2 }), l2 && !e5 && n2(c2, "toString", o2));
};
}
function cc() {
if (Jl) return Zl;
Jl = 1;
var e5 = ki(), t2 = Mi(), n2 = e5.WeakMap;
return Zl = t2(n2) && /native code/.test(String(n2));
}
function dc() {
if (ec) return Ql;
ec = 1;
var e5, t2, n2, r2 = cc(), o2 = ki(), i2 = _a(), a2 = Ou(), s2 = Bs(), u2 = xs(), l2 = Cl(), c2 = vl(), d2 = "Object already initialized", f2 = o2.TypeError, p2 = o2.WeakMap;
if (r2 || u2.state) {
var h2 = u2.state || (u2.state = new p2());
h2.get = h2.get, h2.has = h2.has, h2.set = h2.set, e5 = function(e6, t3) {
if (h2.has(e6)) throw new f2(d2);
return t3.facade = e6, h2.set(e6, t3), t3;
}, t2 = function(e6) {
return h2.get(e6) || {};
}, n2 = function(e6) {
return h2.has(e6);
};
} else {
var g2 = l2("state");
c2[g2] = true, e5 = function(e6, t3) {
if (s2(e6, g2)) throw new f2(d2);
return t3.facade = e6, a2(e6, g2, t3), t3;
}, t2 = function(e6) {
return s2(e6, g2) ? e6[g2] : {};
}, n2 = function(e6) {
return s2(e6, g2);
};
}
return Ql = { set: e5, get: t2, has: n2, enforce: function(r3) {
return n2(r3) ? t2(r3) : e5(r3, {});
}, getterFor: function(e6) {
return function(n3) {
var r3;
if (!i2(n3) || (r3 = t2(n3)).type !== e6) throw new f2("Incompatible receiver, " + e6 + " required");
return r3;
};
} };
}
function fc() {
if (nc) return tc;
nc = 1;
var e5 = Ms(), t2 = Ri(), n2 = Fa(), r2 = Ns(), o2 = Pu(), i2 = zu(), a2 = t2([].push), s2 = function(t3) {
var s3 = 1 === t3, u2 = 2 === t3, l2 = 3 === t3, c2 = 4 === t3, d2 = 6 === t3, f2 = 7 === t3, p2 = 5 === t3 || d2;
return function(h2, g2, v2, m2) {
for (var y2, b2, E2 = r2(h2), w2 = n2(E2), C2 = o2(w2), D2 = e5(g2, v2), A2 = 0, S2 = m2 || i2, x2 = s3 ? S2(h2, C2) : u2 || f2 ? S2(h2, 0) : void 0; C2 > A2; A2++) if ((p2 || A2 in w2) && (b2 = D2(y2 = w2[A2], A2, E2), t3)) if (s3) x2[A2] = b2;
else if (b2) switch (t3) {
case 3:
return true;
case 5:
return y2;
case 6:
return A2;
case 2:
a2(x2, y2);
}
else switch (t3) {
case 4:
return false;
case 7:
a2(x2, y2);
}
return d2 ? -1 : l2 || c2 ? c2 : x2;
};
};
return tc = { forEach: s2(0), map: s2(1), filter: s2(2), some: s2(3), every: s2(4), find: s2(5), findIndex: s2(6), filterReject: s2(7) };
}
var pc, hc, gc, vc = {};
function mc() {
return hc ? pc : (hc = 1, pc = $a() && !!Symbol.for && !!Symbol.keyFor);
}
var yc, bc = {};
var Ec, wc, Cc, Dc, Ac, Sc, xc, Oc = {};
function Nc() {
if (wc) return Ec;
wc = 1;
var e5 = _a(), t2 = dc().get;
return Ec = function(n2) {
if (!e5(n2)) return false;
var r2 = t2(n2);
return !!r2 && "RawJSON" === r2.type;
}, Ec;
}
function Bc() {
if (Dc) return Cc;
Dc = 1;
var e5 = Ri(), t2 = Bs(), n2 = SyntaxError, r2 = parseInt, o2 = String.fromCharCode, i2 = e5("".charAt), a2 = e5("".slice), s2 = e5(/./.exec), u2 = { '\\"': '"', "\\\\": "\\", "\\/": "/", "\\b": "\b", "\\f": "\f", "\\n": "\n", "\\r": "\r", "\\t": " " }, l2 = /^[\da-f]{4}$/i, c2 = /^[\u0000-\u001F]$/;
return Cc = function(e6, d2) {
for (var f2 = true, p2 = ""; d2 < e6.length; ) {
var h2 = i2(e6, d2);
if ("\\" === h2) {
var g2 = a2(e6, d2, d2 + 2);
if (t2(u2, g2)) p2 += u2[g2], d2 += 2;
else {
if ("\\u" !== g2) throw new n2('Unknown escape sequence: "' + g2 + '"');
var v2 = a2(e6, d2 += 2, d2 + 4);
if (!s2(l2, v2)) throw new n2("Bad Unicode escape at: " + d2);
p2 += o2(r2(v2, 16)), d2 += 4;
}
} else {
if ('"' === h2) {
f2 = false, d2++;
break;
}
if (s2(c2, h2)) throw new n2("Bad control character in string literal at: " + d2);
p2 += h2, d2++;
}
}
if (f2) throw new n2("Unterminated string at: " + d2);
return { value: p2, end: d2 };
}, Cc;
}
function Tc() {
return Sc ? Ac : (Sc = 1, Ac = !Fi()(function() {
var e5 = "9007199254740993", t2 = JSON.rawJSON(e5);
return !JSON.isRawJSON(t2) || JSON.stringify(t2) !== e5;
}));
}
var kc, Fc, Pc = {};
function Ic() {
return Fc || (Fc = 1, (function() {
if (rc) return Gu;
rc = 1;
var e5 = Nu(), t2 = ki(), n2 = Wi(), r2 = Ri(), o2 = As(), i2 = Vi(), a2 = $a(), s2 = Fi(), u2 = Bs(), l2 = ja(), c2 = Su(), d2 = Ra(), f2 = Ps(), p2 = qu(), h2 = ka(), g2 = Dl(), v2 = bl(), m2 = xl(), y2 = Fl(), b2 = jl(), E2 = _s(), w2 = xu(), C2 = El(), D2 = Ta(), A2 = Hl(), S2 = zl(), x2 = Os(), O2 = Cl(), N2 = vl(), B2 = Ts(), T2 = ks(), k2 = ic(), F2 = ac(), P2 = sc(), I2 = lc(), R2 = dc(), _2 = fc().forEach, L2 = O2("hidden"), M2 = "Symbol", j2 = "prototype", H2 = R2.set, z2 = R2.getterFor(M2), $2 = Object[j2], U2 = t2.Symbol, V2 = U2 && U2[j2], W2 = t2.RangeError, G2 = t2.TypeError, q2 = t2.QObject, K2 = E2.f, Y2 = w2.f, X2 = y2.f, Z2 = D2.f, J2 = r2([].push), Q2 = x2("symbols"), ee2 = x2("op-symbols"), te2 = x2("wks"), ne2 = !q2 || !q2[j2] || !q2[j2].findChild, re2 = function(e6, t3, n3) {
var r3 = K2($2, t3);
r3 && delete $2[t3], Y2(e6, t3, n3), r3 && e6 !== $2 && Y2($2, t3, r3);
}, oe2 = i2 && s2(function() {
return 7 !== g2(Y2({}, "a", { get: function() {
return Y2(this, "a", { value: 7 }).a;
} })).a;
}) ? re2 : Y2, ie2 = function(e6, t3) {
var n3 = Q2[e6] = g2(V2);
return H2(n3, { type: M2, tag: e6, description: t3 }), i2 || (n3.description = t3), n3;
}, ae2 = function(e6, t3, n3) {
e6 === $2 && ae2(ee2, t3, n3), c2(e6);
var r3 = f2(t3);
return c2(n3), u2(Q2, r3) ? (n3.enumerable ? (u2(e6, L2) && e6[L2][r3] && (e6[L2][r3] = false), n3 = g2(n3, { enumerable: h2(0, false) })) : (u2(e6, L2) || Y2(e6, L2, h2(1, g2(null))), e6[L2][r3] = true), oe2(e6, r3, n3)) : Y2(e6, r3, n3);
}, se2 = function(e6, t3) {
c2(e6);
var r3 = d2(t3), o3 = v2(r3).concat(de2(r3));
return _2(o3, function(t4) {
i2 && !n2(ue2, r3, t4) || ae2(e6, t4, r3[t4]);
}), e6;
}, ue2 = function(e6) {
var t3 = f2(e6), r3 = n2(Z2, this, t3);
return !(this === $2 && u2(Q2, t3) && !u2(ee2, t3)) && (!(r3 || !u2(this, t3) || !u2(Q2, t3) || u2(this, L2) && this[L2][t3]) || r3);
}, le2 = function(e6, t3) {
var n3 = d2(e6), r3 = f2(t3);
if (n3 !== $2 || !u2(Q2, r3) || u2(ee2, r3)) {
var o3 = K2(n3, r3);
return !o3 || !u2(Q2, r3) || u2(n3, L2) && n3[L2][r3] || (o3.enumerable = true), o3;
}
}, ce2 = function(e6) {
var t3 = X2(d2(e6)), n3 = [];
return _2(t3, function(e7) {
u2(Q2, e7) || u2(N2, e7) || J2(n3, e7);
}), n3;
}, de2 = function(e6) {
var t3 = e6 === $2, n3 = X2(t3 ? ee2 : d2(e6)), r3 = [];
return _2(n3, function(e7) {
!u2(Q2, e7) || t3 && !u2($2, e7) || J2(r3, Q2[e7]);
}), r3;
};
a2 || (U2 = function() {
if (l2(V2, this)) throw new G2("Symbol is not a constructor");
var e6 = arguments.length && void 0 !== arguments[0] ? p2(arguments[0]) : void 0, r3 = B2(e6), o3 = function(e7) {
var i3 = void 0 === this ? t2 : this;
i3 === $2 && n2(o3, ee2, e7), u2(i3, L2) && u2(i3[L2], r3) && (i3[L2][r3] = false);
var a3 = h2(1, e7);
try {
oe2(i3, r3, a3);
} catch (e8) {
if (!(e8 instanceof W2)) throw e8;
re2(i3, r3, a3);
}
};
return i2 && ne2 && oe2($2, r3, { configurable: true, set: o3 }), ie2(r3, e6);
}, A2(V2 = U2[j2], "toString", function() {
return z2(this).tag;
}), A2(U2, "withoutSetter", function(e6) {
return ie2(B2(e6), e6);
}), D2.f = ue2, w2.f = ae2, C2.f = se2, E2.f = le2, m2.f = y2.f = ce2, b2.f = de2, k2.f = function(e6) {
return ie2(T2(e6), e6);
}, i2 && (S2(V2, "description", { configurable: true, get: function() {
return z2(this).description;
} }), o2 || A2($2, "propertyIsEnumerable", ue2, { unsafe: true }))), e5({ global: true, constructor: true, wrap: true, forced: !a2, sham: !a2 }, { Symbol: U2 }), _2(v2(te2), function(e6) {
F2(e6);
}), e5({ target: M2, stat: true, forced: !a2 }, { useSetter: function() {
ne2 = true;
}, useSimple: function() {
ne2 = false;
} }), e5({ target: "Object", stat: true, forced: !a2, sham: !i2 }, { create: function(e6, t3) {
return void 0 === t3 ? g2(e6) : se2(g2(e6), t3);
}, defineProperty: ae2, defineProperties: se2, getOwnPropertyDescriptor: le2 }), e5({ target: "Object", stat: true, forced: !a2 }, { getOwnPropertyNames: ce2 }), P2(), I2(U2, M2), N2[L2] = true;
})(), (function() {
if (gc) return vc;
gc = 1;
var e5 = Nu(), t2 = Ma(), n2 = Bs(), r2 = qu(), o2 = Os(), i2 = mc(), a2 = o2("string-to-symbol-registry"), s2 = o2("symbol-to-string-registry");
e5({ target: "Symbol", stat: true, forced: !i2 }, { for: function(e6) {
var o3 = r2(e6);
if (n2(a2, o3)) return a2[o3];
var i3 = t2("Symbol")(o3);
return a2[o3] = i3, s2[i3] = o3, i3;
} });
})(), (function() {
if (yc) return bc;
yc = 1;
var e5 = Nu(), t2 = Bs(), n2 = Va(), r2 = Wa(), o2 = Os(), i2 = mc(), a2 = o2("symbol-to-string-registry");
e5({ target: "Symbol", stat: true, forced: !i2 }, { keyFor: function(e6) {
if (!n2(e6)) throw new TypeError(r2(e6) + " is not a symbol");
if (t2(a2, e6)) return a2[e6];
} });
})(), (function() {
if (xc) return Oc;
xc = 1;
var e5 = Nu(), t2 = Ma(), n2 = Ii(), r2 = Wi(), o2 = Ri(), i2 = Fi(), a2 = Bu(), s2 = Mi(), u2 = Nc(), l2 = Va(), c2 = _i(), d2 = qu(), f2 = kl(), p2 = Bc(), h2 = Ts(), g2 = $a(), v2 = Tc(), m2 = String, y2 = t2("JSON", "stringify"), b2 = o2(/./.exec), E2 = o2("".charAt), w2 = o2("".charCodeAt), C2 = o2("".replace), D2 = o2("".slice), A2 = o2([].push), S2 = o2(1.1.toString), x2 = /[\uD800-\uDFFF]/g, O2 = /^[\uD800-\uDBFF]$/, N2 = /^[\uDC00-\uDFFF]$/, B2 = h2(), T2 = B2.length, k2 = !g2 || i2(function() {
var e6 = t2("Symbol")("stringify detection");
return "[null]" !== y2([e6]) || "{}" !== y2({ a: e6 }) || "{}" !== y2(Object(e6));
}), F2 = i2(function() {
return '"\\udf06\\ud834"' !== y2("\uDF06\uD834") || '"\\udead"' !== y2("\uDEAD");
}), P2 = k2 ? function(e6, t3) {
var o3 = f2(arguments), i3 = R2(t3);
if (s2(i3) || void 0 !== e6 && !l2(e6)) return o3[1] = function(e7, t4) {
if (s2(i3) && (t4 = r2(i3, this, m2(e7), t4)), !l2(t4)) return t4;
}, n2(y2, null, o3);
} : y2, I2 = function(e6, t3, n3) {
var r3 = E2(n3, t3 - 1), o3 = E2(n3, t3 + 1);
return b2(O2, e6) && !b2(N2, o3) || b2(N2, e6) && !b2(O2, r3) ? "\\u" + S2(w2(e6, 0), 16) : e6;
}, R2 = function(e6) {
if (s2(e6)) return e6;
if (a2(e6)) {
for (var t3 = e6.length, n3 = [], r3 = 0; r3 < t3; r3++) {
var o3 = e6[r3];
"string" == typeof o3 ? A2(n3, o3) : "number" != typeof o3 && "Number" !== c2(o3) && "String" !== c2(o3) || A2(n3, d2(o3));
}
var i3 = n3.length, u3 = true;
return function(e7, t4) {
if (u3) return u3 = false, t4;
if (a2(this)) return t4;
for (var r4 = 0; r4 < i3; r4++) if (n3[r4] === e7) return t4;
};
}
};
y2 && e5({ target: "JSON", stat: true, arity: 3, forced: k2 || F2 || !v2 }, { stringify: function(e6, t3, n3) {
var o3 = R2(t3), i3 = [], a3 = P2(e6, function(e7, t4) {
var n4 = s2(o3) ? r2(o3, this, m2(e7), t4) : t4;
return !v2 && u2(n4) ? B2 + (A2(i3, n4.rawJSON) - 1) : n4;
}, n3);
if ("string" != typeof a3) return a3;
if (F2 && (a3 = C2(a3, x2, I2)), v2) return a3;
for (var l3 = "", c3 = a3.length, d3 = 0; d3 < c3; d3++) {
var f3 = E2(a3, d3);
if ('"' === f3) {
var h3 = p2(a3, ++d3).end - 1, g3 = D2(a3, d3, h3);
l3 += D2(g3, 0, T2) === B2 ? i3[D2(g3, T2)] : '"' + g3 + '"', d3 = h3;
} else l3 += f3;
}
return l3;
} });
})(), (function() {
if (kc) return Pc;
kc = 1;
var e5 = Nu(), t2 = $a(), n2 = Fi(), r2 = jl(), o2 = Ns();
e5({ target: "Object", stat: true, forced: !t2 || n2(function() {
r2.f(1);
}) }, { getOwnPropertySymbols: function(e6) {
var t3 = r2.f;
return t3 ? t3(o2(e6)) : [];
} });
})()), Wu;
}
var Rc, _c = {};
function Lc() {
return Rc || (Rc = 1, ac()("asyncDispose")), _c;
}
var Mc;
var jc, Hc = {};
function zc() {
return jc || (jc = 1, ac()("dispose")), Hc;
}
var $c;
var Uc;
var Vc, Wc = {};
function Gc() {
return Vc || (Vc = 1, ac()("iterator")), Wc;
}
var qc;
var Kc;
var Yc;
var Xc;
var Zc;
var Jc;
var Qc, ed = {};
var td, nd = {};
var rd;
var od, id, ad, sd = {};
function ud() {
return ad ? id : (ad = 1, (function() {
if (Cu) return Ti;
Cu = 1;
var e5 = Nu(), t2 = Fi(), n2 = Bu(), r2 = _a(), o2 = Ns(), i2 = Pu(), a2 = Iu(), s2 = Ru(), u2 = zu(), l2 = $u(), c2 = ks(), d2 = za(), f2 = c2("isConcatSpreadable"), p2 = d2 >= 51 || !t2(function() {
var e6 = [];
return e6[f2] = false, e6.concat()[0] !== e6;
}), h2 = function(e6) {
if (!r2(e6)) return false;
var t3 = e6[f2];
return void 0 !== t3 ? !!t3 : n2(e6);
};
e5({ target: "Array", proto: true, arity: 1, forced: !p2 || !l2("concat") }, { concat: function(e6) {
var t3, n3, r3, l3, c3, d3 = o2(this), f3 = u2(d3, 0), p3 = 0;
for (t3 = -1, r3 = arguments.length; t3 < r3; t3++) if (h2(c3 = -1 === t3 ? d3 : arguments[t3])) for (l3 = i2(c3), a2(p3 + l3), n3 = 0; n3 < l3; n3++, p3++) n3 in c3 && s2(f3, p3, c3[n3]);
else a2(p3 + 1), s2(f3, p3++, c3);
return f3.length = p3, f3;
} });
})(), Ic(), Lc(), Mc || (Mc = 1, ac()("asyncIterator")), zc(), $c || ($c = 1, ac()("hasInstance")), Uc || (Uc = 1, ac()("isConcatSpreadable")), Gc(), qc || (qc = 1, ac()("match")), Kc || (Kc = 1, ac()("matchAll")), Yc || (Yc = 1, ac()("replace")), Xc || (Xc = 1, ac()("search")), Zc || (Zc = 1, ac()("species")), Jc || (Jc = 1, ac()("split")), (function() {
if (Qc) return ed;
Qc = 1;
var e5 = ac(), t2 = sc();
e5("toPrimitive"), t2();
})(), (function() {
if (td) return nd;
td = 1;
var e5 = Ma(), t2 = ac(), n2 = lc();
t2("toStringTag"), n2(e5("Symbol"), "Symbol");
})(), rd || (rd = 1, ac()("unscopables")), (function() {
if (od) return sd;
od = 1;
var e5 = ki();
lc()(e5.JSON, "JSON", true);
})(), id = La().Symbol);
}
var ld, cd, dd, fd, pd, hd, gd, vd, md, yd, bd, Ed, wd, Cd, Dd, Ad, Sd, xd, Od, Nd, Bd, Td, kd, Fd, Pd, Id, Rd, _d, Ld, Md, jd, Hd, zd, $d = {};
function Ud() {
return cd ? ld : (cd = 1, ld = function() {
});
}
function Vd() {
return fd ? dd : (fd = 1, dd = {});
}
function Wd() {
if (hd) return pd;
hd = 1;
var e5 = Vi(), t2 = Bs(), n2 = Function.prototype, r2 = e5 && Object.getOwnPropertyDescriptor, o2 = t2(n2, "name"), i2 = o2 && "something" === (function() {
}).name, a2 = o2 && (!e5 || e5 && r2(n2, "name").configurable);
return pd = { EXISTS: o2, PROPER: i2, CONFIGURABLE: a2 };
}
function Gd() {
return vd || (vd = 1, gd = !Fi()(function() {
function e5() {
}
return e5.prototype.constructor = null, Object.getPrototypeOf(new e5()) !== e5.prototype;
})), gd;
}
function qd() {
if (yd) return md;
yd = 1;
var e5 = Bs(), t2 = Mi(), n2 = Ns(), r2 = Cl(), o2 = Gd(), i2 = r2("IE_PROTO"), a2 = Object, s2 = a2.prototype;
return md = o2 ? a2.getPrototypeOf : function(r3) {
var o3 = n2(r3);
if (e5(o3, i2)) return o3[i2];
var u2 = o3.constructor;
return t2(u2) && o3 instanceof u2 ? u2.prototype : o3 instanceof a2 ? s2 : null;
}, md;
}
function Kd() {
if (Ed) return bd;
Ed = 1;
var e5, t2, n2, r2 = Fi(), o2 = Mi(), i2 = _a(), a2 = Dl(), s2 = qd(), u2 = Hl(), l2 = ks(), c2 = As(), d2 = l2("iterator"), f2 = false;
return [].keys && ("next" in (n2 = [].keys()) ? (t2 = s2(s2(n2))) !== Object.prototype && (e5 = t2) : f2 = true), !i2(e5) || r2(function() {
var t3 = {};
return e5[d2].call(t3) !== t3;
}) ? e5 = {} : c2 && (e5 = a2(e5)), o2(e5[d2]) || u2(e5, d2, function() {
return this;
}), bd = { IteratorPrototype: e5, BUGGY_SAFARI_ITERATORS: f2 };
}
function Yd() {
if (Cd) return wd;
Cd = 1;
var e5 = Kd().IteratorPrototype, t2 = Dl(), n2 = ka(), r2 = lc(), o2 = Vd(), i2 = function() {
return this;
};
return wd = function(a2, s2, u2, l2) {
var c2 = s2 + " Iterator";
return a2.prototype = t2(e5, { next: n2(+!l2, u2) }), r2(a2, c2, false, true), o2[c2] = i2, a2;
}, wd;
}
function Xd() {
if (Ad) return Dd;
Ad = 1;
var e5 = Ri(), t2 = Ga();
return Dd = function(n2, r2, o2) {
try {
return e5(t2(Object.getOwnPropertyDescriptor(n2, r2)[o2]));
} catch (e6) {
}
};
}
function Zd() {
if (xd) return Sd;
xd = 1;
var e5 = _a();
return Sd = function(t2) {
return e5(t2) || null === t2;
};
}
function Jd() {
if (Nd) return Od;
Nd = 1;
var e5 = Zd(), t2 = String, n2 = TypeError;
return Od = function(r2) {
if (e5(r2)) return r2;
throw new n2("Can't set " + t2(r2) + " as a prototype");
};
}
function Qd() {
if (Td) return Bd;
Td = 1;
var e5 = Xd(), t2 = _a(), n2 = Ia(), r2 = Jd();
return Bd = Object.setPrototypeOf || ("__proto__" in {} ? (function() {
var o2, i2 = false, a2 = {};
try {
(o2 = e5(Object.prototype, "__proto__", "set"))(a2, []), i2 = a2 instanceof Array;
} catch (e6) {
}
return function(e6, a3) {
return n2(e6), r2(a3), t2(e6) ? (i2 ? o2(e6, a3) : e6.__proto__ = a3, e6) : e6;
};
})() : void 0), Bd;
}
function ef() {
if (Fd) return kd;
Fd = 1;
var e5 = Nu(), t2 = Wi(), n2 = As(), r2 = Wd(), o2 = Mi(), i2 = Yd(), a2 = qd(), s2 = Qd(), u2 = lc(), l2 = Ou(), c2 = Hl(), d2 = ks(), f2 = Vd(), p2 = Kd(), h2 = r2.PROPER, g2 = r2.CONFIGURABLE, v2 = p2.IteratorPrototype, m2 = p2.BUGGY_SAFARI_ITERATORS, y2 = d2("iterator"), b2 = "keys", E2 = "values", w2 = "entries", C2 = function() {
return this;
};
return kd = function(r3, d3, p3, D2, A2, S2, x2) {
i2(p3, d3, D2);
var O2, N2, B2, T2 = function(e6) {
if (e6 === A2 && R2) return R2;
if (!m2 && e6 && e6 in P2) return P2[e6];
switch (e6) {
case b2:
case E2:
case w2:
return function() {
return new p3(this, e6);
};
}
return function() {
return new p3(this);
};
}, k2 = d3 + " Iterator", F2 = false, P2 = r3.prototype, I2 = P2[y2] || P2["@@iterator"] || A2 && P2[A2], R2 = !m2 && I2 || T2(A2), _2 = "Array" === d3 && P2.entries || I2;
if (_2 && (O2 = a2(_2.call(new r3()))) !== Object.prototype && O2.next && (n2 || a2(O2) === v2 || (s2 ? s2(O2, v2) : o2(O2[y2]) || c2(O2, y2, C2)), u2(O2, k2, true, true), n2 && (f2[k2] = C2)), h2 && A2 === E2 && I2 && I2.name !== E2 && (!n2 && g2 ? l2(P2, "name", E2) : (F2 = true, R2 = function() {
return t2(I2, this);
})), A2) if (N2 = { values: T2(E2), keys: S2 ? R2 : T2(b2), entries: T2(w2) }, x2) for (B2 in N2) (m2 || F2 || !(B2 in P2)) && c2(P2, B2, N2[B2]);
else e5({ target: d3, proto: true, forced: m2 || F2 }, N2);
return n2 && !x2 || P2[y2] === R2 || c2(P2, y2, R2, { name: A2 }), f2[d3] = R2, N2;
}, kd;
}
function tf() {
return Id ? Pd : (Id = 1, Pd = function(e5, t2) {
return { value: e5, done: t2 };
});
}
function nf() {
if (_d) return Rd;
_d = 1;
var e5 = Ra(), t2 = Ud(), n2 = Vd(), r2 = dc(), o2 = xu().f, i2 = ef(), a2 = tf(), s2 = As(), u2 = Vi(), l2 = "Array Iterator", c2 = r2.set, d2 = r2.getterFor(l2);
Rd = i2(Array, "Array", function(t3, n3) {
c2(this, { type: l2, target: e5(t3), index: 0, kind: n3 });
}, function() {
var e6 = d2(this), t3 = e6.target, n3 = e6.index++;
if (!t3 || n3 >= t3.length) return e6.target = null, a2(void 0, true);
switch (e6.kind) {
case "keys":
return a2(n3, false);
case "values":
return a2(t3[n3], false);
}
return a2([n3, t3[n3]], false);
}, "values");
var f2 = n2.Arguments = n2.Array;
if (t2("keys"), t2("values"), t2("entries"), !s2 && u2 && "values" !== f2.name) try {
o2(f2, "name", { value: "values" });
} catch (e6) {
}
return Rd;
}
function rf() {
return Md ? Ld : (Md = 1, Ld = { CSSRuleList: 0, CSSStyleDeclaration: 0, CSSValueList: 0, ClientRectList: 0, DOMRectList: 0, DOMStringList: 0, DOMTokenList: 1, DataTransferItemList: 0, FileList: 0, HTMLAllCollection: 0, HTMLCollection: 0, HTMLFormElement: 0, HTMLSelectElement: 0, MediaList: 0, MimeTypeArray: 0, NamedNodeMap: 0, NodeList: 1, PaintRequestList: 0, Plugin: 0, PluginArray: 0, SVGLengthList: 0, SVGNumberList: 0, SVGPathSegList: 0, SVGPointList: 0, SVGStringList: 0, SVGTransformList: 0, SourceBufferList: 0, StyleSheetList: 0, TextTrackCueList: 0, TextTrackList: 0, TouchList: 0 });
}
function of() {
if (jd) return $d;
jd = 1, nf();
var e5 = rf(), t2 = ki(), n2 = lc(), r2 = Vd();
for (var o2 in e5) n2(t2[o2], o2), r2[o2] = r2.Array;
return $d;
}
function af() {
if (zd) return Hd;
zd = 1;
var e5 = ud();
return of(), Hd = e5;
}
var sf, uf = {};
var lf;
var cf;
var df, ff, pf;
function hf() {
if (pf) return ff;
pf = 1;
var e5 = af();
return (function() {
if (sf) return uf;
sf = 1;
var e6 = ks(), t2 = xu().f, n2 = e6("metadata"), r2 = Function.prototype;
void 0 === r2[n2] && t2(r2, n2, { value: null });
})(), lf || (lf = 1, Lc()), cf || (cf = 1, zc()), df || (df = 1, ac()("metadata")), ff = e5;
}
var gf, vf, mf;
function yf() {
if (vf) return gf;
vf = 1;
var e5 = Ma(), t2 = Ri(), n2 = e5("Symbol"), r2 = n2.keyFor, o2 = t2(n2.prototype.valueOf);
return gf = n2.isRegisteredSymbol || function(e6) {
try {
return void 0 !== r2(o2(e6));
} catch (e7) {
return false;
}
};
}
var bf, Ef, wf;
function Cf() {
if (Ef) return bf;
Ef = 1;
for (var e5 = Os(), t2 = Ma(), n2 = Ri(), r2 = Va(), o2 = ks(), i2 = t2("Symbol"), a2 = i2.isWellKnownSymbol, s2 = t2("Object", "getOwnPropertyNames"), u2 = n2(i2.prototype.valueOf), l2 = e5("wks"), c2 = 0, d2 = s2(i2), f2 = d2.length; c2 < f2; c2++) try {
var p2 = d2[c2];
r2(i2[p2]) && o2(p2);
} catch (e6) {
}
return bf = function(e6) {
if (a2 && a2(e6)) return true;
try {
for (var t3 = u2(e6), n3 = 0, r3 = s2(l2), o3 = r3.length; n3 < o3; n3++) if (l2[r3[n3]] == t3) return true;
} catch (e7) {
}
return false;
}, bf;
}
var Df;
var Af;
var Sf;
var xf;
var Of;
var Nf;
var Bf;
var Tf, kf, Ff, Pf, If;
function Rf() {
if (Ff) return kf;
Ff = 1;
var e5 = hf();
return mf || (mf = 1, Nu()({ target: "Symbol", stat: true }, { isRegisteredSymbol: yf() })), wf || (wf = 1, Nu()({ target: "Symbol", stat: true, forced: true }, { isWellKnownSymbol: Cf() })), Df || (Df = 1, ac()("customMatcher")), Af || (Af = 1, ac()("observable")), Sf || (Sf = 1, Nu()({ target: "Symbol", stat: true, name: "isRegisteredSymbol" }, { isRegistered: yf() })), xf || (xf = 1, Nu()({ target: "Symbol", stat: true, name: "isWellKnownSymbol", forced: true }, { isWellKnown: Cf() })), Of || (Of = 1, ac()("matcher")), Nf || (Nf = 1, ac()("metadataKey")), Bf || (Bf = 1, ac()("patternMatch")), Tf || (Tf = 1, ac()("replaceAll")), kf = e5;
}
function _f() {
return If ? Pf : (If = 1, Pf = Rf());
}
var Lf, Mf, jf, Hf, zf, $f, Uf, Vf, Wf, Gf, qf, Kf, Yf, Xf = b(_f()), Zf = {};
function Jf() {
if (Mf) return Lf;
Mf = 1;
var e5 = Ri(), t2 = ku(), n2 = qu(), r2 = Ia(), o2 = e5("".charAt), i2 = e5("".charCodeAt), a2 = e5("".slice), s2 = function(e6) {
return function(s3, u2) {
var l2, c2, d2 = n2(r2(s3)), f2 = t2(u2), p2 = d2.length;
return f2 < 0 || f2 >= p2 ? e6 ? "" : void 0 : (l2 = i2(d2, f2)) < 55296 || l2 > 56319 || f2 + 1 === p2 || (c2 = i2(d2, f2 + 1)) < 56320 || c2 > 57343 ? e6 ? o2(d2, f2) : l2 : e6 ? a2(d2, f2, f2 + 2) : c2 - 56320 + (l2 - 55296 << 10) + 65536;
};
};
return Lf = { codeAt: s2(false), charAt: s2(true) };
}
function Qf() {
return zf ? Hf : (zf = 1, nf(), (function() {
if (jf) return Zf;
jf = 1;
var e5 = Jf().charAt, t2 = qu(), n2 = dc(), r2 = ef(), o2 = tf(), i2 = "String Iterator", a2 = n2.set, s2 = n2.getterFor(i2);
r2(String, "String", function(e6) {
a2(this, { type: i2, string: t2(e6), index: 0 });
}, function() {
var t3, n3 = s2(this), r3 = n3.string, i3 = n3.index;
return i3 >= r3.length ? o2(void 0, true) : (t3 = e5(r3, i3), n3.index += t3.length, o2(t3, false));
});
})(), Gc(), Hf = ic().f("iterator"));
}
function ep() {
if (Uf) return $f;
Uf = 1;
var e5 = Qf();
return of(), $f = e5;
}
function tp() {
return Wf ? Vf : (Wf = 1, Vf = ep());
}
function np() {
return qf ? Gf : (qf = 1, Gf = tp());
}
function rp() {
return Yf ? Kf : (Yf = 1, Kf = np());
}
var op = b(rp());
function ip(e5) {
return ip = "function" == typeof Xf && "symbol" == typeof op ? function(e6) {
return typeof e6;
} : function(e6) {
return e6 && "function" == typeof Xf && e6.constructor === Xf && e6 !== Xf.prototype ? "symbol" : typeof e6;
}, ip(e5);
}
var ap, sp = {};
if ((function() {
if (ap) return sp;
ap = 1;
var e5 = fr(), t2 = w(), n2 = N(), r2 = gn().f, o2 = Se();
e5({ target: "Object", stat: true, forced: !o2 || t2(function() {
r2(1);
}), sham: !o2 }, { getOwnPropertyDescriptor: function(e6, t3) {
return r2(n2(e6), t3);
} });
})(), "object" === ("undefined" == typeof global ? "undefined" : ip(global))) {
var up = Object.getOwnPropertyDescriptor(global, "window");
global.window && !up.set || (global.window = global, global.requestAnimationFrame = function() {
}, global.navigator = { userAgent: "" }, global.location = { hostname: "0.0.0.0", port: 0, protocol: "http:" }, global.btoa = function() {
}, global.crypto = { getRandomValues: function(e5) {
return nodeCrypto.randomFillSync(e5);
} }), null != global.document && null == global.document.getElementsByTagName && (global.document.getElementsByTagName = function() {
return [];
});
}
var lp = { transform(e5, t2) {
var { current: n2, affinity: r2 } = e5;
if (null != n2) {
var o2 = bp.transform(n2, t2, { affinity: r2 });
e5.current = o2, null == o2 && e5.unref();
}
} }, cp = { transform(e5, t2) {
var { current: n2, affinity: r2 } = e5;
if (null != n2) {
var o2 = yh.transform(n2, t2, { affinity: r2 });
e5.current = o2, null == o2 && e5.unref();
}
} }, dp = { transform(e5, t2) {
var { current: n2, affinity: r2 } = e5;
if (null != n2) {
var o2 = xp.transform(n2, t2, { affinity: r2 });
e5.current = o2, null == o2 && e5.unref();
}
} }, fp = /* @__PURE__ */ new WeakMap(), pp = /* @__PURE__ */ new WeakMap(), hp = /* @__PURE__ */ new WeakMap(), gp = /* @__PURE__ */ new WeakMap(), vp = /* @__PURE__ */ new WeakMap(), mp = /* @__PURE__ */ new WeakMap(), yp = /* @__PURE__ */ new WeakMap(), bp = { ancestors(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { reverse: n2 = false } = t2, r2 = bp.levels(e5, t2);
return r2 = n2 ? r2.slice(1) : r2.slice(0, -1);
}, common(e5, t2) {
for (var n2 = [], r2 = 0; r2 < e5.length && r2 < t2.length; r2++) {
var o2 = e5[r2];
if (o2 !== t2[r2]) break;
n2.push(o2);
}
return n2;
}, compare(e5, t2) {
for (var n2 = Math.min(e5.length, t2.length), r2 = 0; r2 < n2; r2++) {
if (e5[r2] < t2[r2]) return -1;
if (e5[r2] > t2[r2]) return 1;
}
return 0;
}, endsAfter(e5, t2) {
var n2 = e5.length - 1, r2 = e5.slice(0, n2), o2 = t2.slice(0, n2), i2 = e5[n2], a2 = t2[n2];
return bp.equals(r2, o2) && i2 > a2;
}, endsAt(e5, t2) {
var n2 = e5.length, r2 = e5.slice(0, n2), o2 = t2.slice(0, n2);
return bp.equals(r2, o2);
}, endsBefore(e5, t2) {
var n2 = e5.length - 1, r2 = e5.slice(0, n2), o2 = t2.slice(0, n2), i2 = e5[n2], a2 = t2[n2];
return bp.equals(r2, o2) && i2 < a2;
}, equals: (e5, t2) => e5.length === t2.length && e5.every((e6, n2) => e6 === t2[n2]), hasPrevious: (e5) => e5[e5.length - 1] > 0, isAfter: (e5, t2) => 1 === bp.compare(e5, t2), isAncestor: (e5, t2) => e5.length < t2.length && 0 === bp.compare(e5, t2), isBefore: (e5, t2) => -1 === bp.compare(e5, t2), isChild: (e5, t2) => e5.length === t2.length + 1 && 0 === bp.compare(e5, t2), isCommon: (e5, t2) => e5.length <= t2.length && 0 === bp.compare(e5, t2), isDescendant: (e5, t2) => e5.length > t2.length && 0 === bp.compare(e5, t2), isParent: (e5, t2) => e5.length + 1 === t2.length && 0 === bp.compare(e5, t2), isPath: (e5) => Array.isArray(e5) && e5.every((e6) => "number" == typeof e6), isSibling(e5, t2) {
if (e5.length !== t2.length) return false;
var n2 = e5.slice(0, -1), r2 = t2.slice(0, -1);
return e5[e5.length - 1] !== t2[t2.length - 1] && bp.equals(n2, r2);
}, levels(e5) {
for (var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { reverse: n2 = false } = t2, r2 = [], o2 = 0; o2 <= e5.length; o2++) r2.push(e5.slice(0, o2));
return n2 && r2.reverse(), r2;
}, next(e5) {
if (0 === e5.length) throw new Error("Cannot get the next path of a root path [".concat(e5, "], because it has no next index."));
var t2 = e5[e5.length - 1];
return e5.slice(0, -1).concat(t2 + 1);
}, operationCanTransformPath(e5) {
switch (e5.type) {
case "insert_node":
case "remove_node":
case "merge_node":
case "split_node":
case "move_node":
return true;
default:
return false;
}
}, parent(e5) {
if (0 === e5.length) throw new Error("Cannot get the parent path of the root path [".concat(e5, "]."));
return e5.slice(0, -1);
}, previous(e5) {
if (0 === e5.length) throw new Error("Cannot get the previous path of a root path [".concat(e5, "], because it has no previous index."));
var t2 = e5[e5.length - 1];
if (t2 <= 0) throw new Error("Cannot get the previous path of a first child path [".concat(e5, "] because it would result in a negative index."));
return e5.slice(0, -1).concat(t2 - 1);
}, relative(e5, t2) {
if (!bp.isAncestor(t2, e5) && !bp.equals(e5, t2)) throw new Error("Cannot get the relative path of [".concat(e5, "] inside ancestor [").concat(t2, "], because it is not above or equal to the path."));
return e5.slice(t2.length);
}, transform(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
if (!e5) return null;
var r2 = [...e5], { affinity: o2 = "forward" } = n2;
if (0 === e5.length) return r2;
switch (t2.type) {
case "insert_node":
var { path: i2 } = t2;
(bp.equals(i2, r2) || bp.endsBefore(i2, r2) || bp.isAncestor(i2, r2)) && (r2[i2.length - 1] += 1);
break;
case "remove_node":
var { path: a2 } = t2;
if (bp.equals(a2, r2) || bp.isAncestor(a2, r2)) return null;
bp.endsBefore(a2, r2) && (r2[a2.length - 1] -= 1);
break;
case "merge_node":
var { path: s2, position: u2 } = t2;
bp.equals(s2, r2) || bp.endsBefore(s2, r2) ? r2[s2.length - 1] -= 1 : bp.isAncestor(s2, r2) && (r2[s2.length - 1] -= 1, r2[s2.length] += u2);
break;
case "split_node":
var { path: l2, position: c2 } = t2;
if (bp.equals(l2, r2)) {
if ("forward" === o2) r2[r2.length - 1] += 1;
else if ("backward" !== o2) return null;
} else bp.endsBefore(l2, r2) ? r2[l2.length - 1] += 1 : bp.isAncestor(l2, r2) && e5[l2.length] >= c2 && (r2[l2.length - 1] += 1, r2[l2.length] -= c2);
break;
case "move_node":
var { path: d2, newPath: f2 } = t2;
if (bp.equals(d2, f2)) return r2;
if (bp.isAncestor(d2, r2) || bp.equals(d2, r2)) {
var p2 = f2.slice();
return bp.endsBefore(d2, f2) && d2.length < f2.length && (p2[d2.length - 1] -= 1), p2.concat(r2.slice(d2.length));
}
bp.isSibling(d2, f2) && (bp.isAncestor(f2, r2) || bp.equals(f2, r2)) ? bp.endsBefore(d2, r2) ? r2[d2.length - 1] -= 1 : r2[d2.length - 1] += 1 : bp.endsBefore(f2, r2) || bp.equals(f2, r2) || bp.isAncestor(f2, r2) ? (bp.endsBefore(d2, r2) && (r2[d2.length - 1] -= 1), r2[f2.length - 1] += 1) : bp.endsBefore(d2, r2) && (bp.equals(f2, r2) && (r2[f2.length - 1] += 1), r2[d2.length - 1] -= 1);
}
return r2;
} };
function Ep(e5) {
return Ep = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e6) {
return typeof e6;
} : function(e6) {
return e6 && "function" == typeof Symbol && e6.constructor === Symbol && e6 !== Symbol.prototype ? "symbol" : typeof e6;
}, Ep(e5);
}
function wp(e5) {
var t2 = (function(e6, t3) {
if ("object" !== Ep(e6) || null === e6) return e6;
var n2 = e6[Symbol.toPrimitive];
if (void 0 !== n2) {
var r2 = n2.call(e6, t3);
if ("object" !== Ep(r2)) return r2;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === t3 ? String : Number)(e6);
})(e5, "string");
return "symbol" === Ep(t2) ? t2 : String(t2);
}
function Cp(e5, t2, n2) {
return (t2 = wp(t2)) in e5 ? Object.defineProperty(e5, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e5[t2] = n2, e5;
}
function Dp(e5, t2) {
if (null == e5) return {};
var n2, r2, o2 = (function(e6, t3) {
if (null == e6) return {};
var n3, r3, o3 = {}, i3 = Object.keys(e6);
for (r3 = 0; r3 < i3.length; r3++) n3 = i3[r3], t3.indexOf(n3) >= 0 || (o3[n3] = e6[n3]);
return o3;
})(e5, t2);
if (Object.getOwnPropertySymbols) {
var i2 = Object.getOwnPropertySymbols(e5);
for (r2 = 0; r2 < i2.length; r2++) n2 = i2[r2], t2.indexOf(n2) >= 0 || Object.prototype.propertyIsEnumerable.call(e5, n2) && (o2[n2] = e5[n2]);
}
return o2;
}
var Ap = ["anchor", "focus"];
function Sp(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
var xp = { edges(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { reverse: n2 = false } = t2, { anchor: r2, focus: o2 } = e5;
return xp.isBackward(e5) === n2 ? [r2, o2] : [o2, r2];
}, end(e5) {
var [, t2] = xp.edges(e5);
return t2;
}, equals: (e5, t2) => yh.equals(e5.anchor, t2.anchor) && yh.equals(e5.focus, t2.focus), surrounds(e5, t2) {
var n2 = xp.intersection(e5, t2);
return !!n2 && xp.equals(n2, t2);
}, includes(e5, t2) {
if (gh.isRange(t2)) {
if (xp.includes(e5, t2.anchor) || xp.includes(e5, t2.focus)) return true;
var [n2, r2] = xp.edges(e5), [o2, i2] = xp.edges(t2);
return yh.isBefore(n2, o2) && yh.isAfter(r2, i2);
}
var [a2, s2] = xp.edges(e5), u2 = false, l2 = false;
return gh.isPoint(t2) ? (u2 = yh.compare(t2, a2) >= 0, l2 = yh.compare(t2, s2) <= 0) : (u2 = bp.compare(t2, a2.path) >= 0, l2 = bp.compare(t2, s2.path) <= 0), u2 && l2;
}, intersection(e5, t2) {
var n2 = Dp(e5, Ap), [r2, o2] = xp.edges(e5), [i2, a2] = xp.edges(t2), s2 = yh.isBefore(r2, i2) ? i2 : r2, u2 = yh.isBefore(o2, a2) ? o2 : a2;
return yh.isBefore(u2, s2) ? null : (function(e6) {
for (var t3 = 1; t3 < arguments.length; t3++) {
var n3 = null != arguments[t3] ? arguments[t3] : {};
t3 % 2 ? Sp(Object(n3), true).forEach(function(t4) {
Cp(e6, t4, n3[t4]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n3)) : Sp(Object(n3)).forEach(function(t4) {
Object.defineProperty(e6, t4, Object.getOwnPropertyDescriptor(n3, t4));
});
}
return e6;
})({ anchor: s2, focus: u2 }, n2);
}, isBackward(e5) {
var { anchor: t2, focus: n2 } = e5;
return yh.isAfter(t2, n2);
}, isCollapsed(e5) {
var { anchor: t2, focus: n2 } = e5;
return yh.equals(t2, n2);
}, isExpanded: (e5) => !xp.isCollapsed(e5), isForward: (e5) => !xp.isBackward(e5), isRange: (e5) => Mp(e5) && yh.isPoint(e5.anchor) && yh.isPoint(e5.focus), *points(e5) {
yield [e5.anchor, "anchor"], yield [e5.focus, "focus"];
}, start(e5) {
var [t2] = xp.edges(e5);
return t2;
}, transform(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
if (null === e5) return null;
var r2, o2, { affinity: i2 = "inward" } = n2;
if ("inward" === i2) {
var a2 = xp.isCollapsed(e5);
xp.isForward(e5) ? (r2 = "forward", o2 = a2 ? r2 : "backward") : (r2 = "backward", o2 = a2 ? r2 : "forward");
} else "outward" === i2 ? xp.isForward(e5) ? (r2 = "backward", o2 = "forward") : (r2 = "forward", o2 = "backward") : (r2 = i2, o2 = i2);
var s2 = yh.transform(e5.anchor, t2, { affinity: r2 }), u2 = yh.transform(e5.focus, t2, { affinity: o2 });
return s2 && u2 ? { anchor: s2, focus: u2 } : null;
} }, Op = function(e5) {
var { deep: t2 = false } = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return !!Mp(e5) && ("function" != typeof e5.apply && (t2 ? Pp.isNodeList(e5.children) : Array.isArray(e5.children)));
}, Np = { isAncestor(e5) {
var { deep: t2 = false } = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return Mp(e5) && Pp.isNodeList(e5.children, { deep: t2 });
}, isElement: Op, isElementList(e5) {
var { deep: t2 = false } = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return Array.isArray(e5) && e5.every((e6) => Np.isElement(e6, { deep: t2 }));
}, isElementProps: (e5) => void 0 !== e5.children, isElementType: function(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "type";
return Op(e5) && e5[n2] === t2;
}, matches(e5, t2) {
for (var n2 in t2) if ("children" !== n2 && e5[n2] !== t2[n2]) return false;
return true;
} }, Bp = ["text"], Tp = ["children"];
function kp(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function Fp(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? kp(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : kp(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
var Pp = { ancestor(e5, t2) {
var n2 = Pp.get(e5, t2);
if (Pp.isText(n2)) throw new Error("Cannot get the ancestor node at path [".concat(t2, "] because it refers to a text node instead: ").concat(Eh.stringify(n2)));
return n2;
}, ancestors(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
return (function* () {
for (var r2 of bp.ancestors(t2, n2)) {
var o2 = [Pp.ancestor(e5, r2), r2];
yield o2;
}
})();
}, child(e5, t2) {
if (Pp.isText(e5)) throw new Error("Cannot get the child of a text node: ".concat(Eh.stringify(e5)));
var n2 = e5.children[t2];
if (null == n2) throw new Error("Cannot get child at index `".concat(t2, "` in node: ").concat(Eh.stringify(e5)));
return n2;
}, children(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
return (function* () {
for (var { reverse: r2 = false } = n2, o2 = Pp.ancestor(e5, t2), { children: i2 } = o2, a2 = r2 ? i2.length - 1 : 0; r2 ? a2 >= 0 : a2 < i2.length; ) {
var s2 = Pp.child(o2, a2), u2 = t2.concat(a2);
yield [s2, u2], a2 = r2 ? a2 - 1 : a2 + 1;
}
})();
}, common(e5, t2, n2) {
var r2 = bp.common(t2, n2);
return [Pp.get(e5, r2), r2];
}, descendant(e5, t2) {
var n2 = Pp.get(e5, t2);
if (Pp.isEditor(n2)) throw new Error("Cannot get the descendant node at path [".concat(t2, "] because it refers to the root editor node instead: ").concat(Eh.stringify(n2)));
return n2;
}, descendants(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return (function* () {
for (var [n2, r2] of Pp.nodes(e5, t2)) 0 !== r2.length && (yield [n2, r2]);
})();
}, elements(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return (function* () {
for (var [n2, r2] of Pp.nodes(e5, t2)) Pp.isElement(n2) && (yield [n2, r2]);
})();
}, extractProps: (e5) => Pp.isText(e5) ? Dp(e5, Bp) : Dp(e5, Tp), first(e5, t2) {
for (var n2 = t2.slice(), r2 = Pp.get(e5, n2); r2 && !Pp.isText(r2) && 0 !== r2.children.length; ) r2 = r2.children[0], n2.push(0);
return [r2, n2];
}, fragment(e5, t2) {
var n2 = { children: e5.children }, [r2, o2] = xp.edges(t2), i2 = Pp.nodes(n2, { reverse: true, pass: (e6) => {
var [, n3] = e6;
return !xp.includes(t2, n3);
} }), a2 = function() {
if (!xp.includes(t2, s2)) {
var e6 = s2[s2.length - 1];
Fh(n2, bp.parent(s2), (t3) => Th(t3, e6, 1));
}
bp.equals(s2, o2.path) && Ph(n2, s2, (e7) => {
var t3 = e7.text.slice(0, o2.offset);
return Fp(Fp({}, e7), {}, { text: t3 });
}), bp.equals(s2, r2.path) && Ph(n2, s2, (e7) => {
var t3 = e7.text.slice(r2.offset);
return Fp(Fp({}, e7), {}, { text: t3 });
});
};
for (var [, s2] of i2) a2();
return n2.children;
}, get(e5, t2) {
var n2 = Pp.getIf(e5, t2);
if (void 0 === n2) throw new Error("Cannot find a descendant at path [".concat(t2, "] in node: ").concat(Eh.stringify(e5)));
return n2;
}, getIf(e5, t2) {
for (var n2 = e5, r2 = 0; r2 < t2.length; r2++) {
var o2 = t2[r2];
if (Pp.isText(n2) || !n2.children[o2]) return;
n2 = n2.children[o2];
}
return n2;
}, has(e5, t2) {
for (var n2 = e5, r2 = 0; r2 < t2.length; r2++) {
var o2 = t2[r2];
if (Pp.isText(n2) || !n2.children[o2]) return false;
n2 = n2.children[o2];
}
return true;
}, isAncestor: (e5) => !Pp.isText(e5), isEditor: (e5) => "function" == typeof e5.apply, isElement: (e5) => Array.isArray(e5.children) && "function" != typeof e5.apply, isNode(e5) {
var { deep: t2 = false } = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return Sh.isText(e5) || Np.isElement(e5, { deep: t2 }) || hh.isEditor(e5, { deep: t2 });
}, isNodeList(e5) {
var { deep: t2 = false } = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return Array.isArray(e5) && e5.every((e6) => Pp.isNode(e6, { deep: t2 }));
}, isText: (e5) => "string" == typeof e5.text, last(e5, t2) {
for (var n2 = t2.slice(), r2 = Pp.get(e5, n2); r2 && !Pp.isText(r2) && 0 !== r2.children.length; ) {
var o2 = r2.children.length - 1;
r2 = r2.children[o2], n2.push(o2);
}
return [r2, n2];
}, leaf(e5, t2) {
var n2 = Pp.get(e5, t2);
if (!Pp.isText(n2)) throw new Error("Cannot get the leaf node at path [".concat(t2, "] because it refers to a non-leaf node: ").concat(Eh.stringify(n2)));
return n2;
}, levels(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
return (function* () {
for (var r2 of bp.levels(t2, n2)) {
var o2 = Pp.get(e5, r2);
yield [o2, r2];
}
})();
}, matches: (e5, t2) => Pp.isElement(e5) && Np.isElementProps(t2) && Np.matches(e5, t2) || Pp.isText(e5) && Sh.isTextProps(t2) && Sh.matches(e5, t2), nodes(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return (function* () {
for (var { pass: n2, reverse: r2 = false } = t2, { from: o2 = [], to: i2 } = t2, a2 = /* @__PURE__ */ new Set(), s2 = [], u2 = e5; !i2 || !(r2 ? bp.isBefore(s2, i2) : bp.isAfter(s2, i2)); ) if (a2.has(u2) || (yield [u2, s2]), a2.has(u2) || Pp.isText(u2) || 0 === u2.children.length || null != n2 && false !== n2([u2, s2])) {
if (0 === s2.length) break;
if (!r2) {
var l2 = bp.next(s2);
if (Pp.has(e5, l2)) {
s2 = l2, u2 = Pp.get(e5, s2);
continue;
}
}
if (r2 && 0 !== s2[s2.length - 1]) s2 = bp.previous(s2), u2 = Pp.get(e5, s2);
else s2 = bp.parent(s2), u2 = Pp.get(e5, s2), a2.add(u2);
} else {
a2.add(u2);
var c2 = r2 ? u2.children.length - 1 : 0;
bp.isAncestor(s2, o2) && (c2 = o2[s2.length]), s2 = s2.concat(c2), u2 = Pp.get(e5, s2);
}
})();
}, parent(e5, t2) {
var n2 = bp.parent(t2), r2 = Pp.get(e5, n2);
if (Pp.isText(r2)) throw new Error("Cannot get the parent of path [".concat(t2, "] because it does not exist in the root."));
return r2;
}, string: (e5) => Pp.isText(e5) ? e5.text : e5.children.map(Pp.string).join(""), texts(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return (function* () {
for (var [n2, r2] of Pp.nodes(e5, t2)) Pp.isText(n2) && (yield [n2, r2]);
})();
} };
function Ip(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function Rp(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? Ip(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : Ip(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
var _p, Lp = { isNodeOperation: (e5) => Lp.isOperation(e5) && e5.type.endsWith("_node"), isOperation(e5) {
if (!Mp(e5)) return false;
switch (e5.type) {
case "insert_node":
case "remove_node":
return bp.isPath(e5.path) && Pp.isNode(e5.node);
case "insert_text":
case "remove_text":
return "number" == typeof e5.offset && "string" == typeof e5.text && bp.isPath(e5.path);
case "merge_node":
return "number" == typeof e5.position && bp.isPath(e5.path) && Mp(e5.properties);
case "move_node":
return bp.isPath(e5.path) && bp.isPath(e5.newPath);
case "set_node":
return bp.isPath(e5.path) && Mp(e5.properties) && Mp(e5.newProperties);
case "set_selection":
return null === e5.properties && xp.isRange(e5.newProperties) || null === e5.newProperties && xp.isRange(e5.properties) || Mp(e5.properties) && Mp(e5.newProperties);
case "split_node":
return bp.isPath(e5.path) && "number" == typeof e5.position && Mp(e5.properties);
default:
return false;
}
}, isOperationList: (e5) => Array.isArray(e5) && e5.every((e6) => Lp.isOperation(e6)), isSelectionOperation: (e5) => Lp.isOperation(e5) && e5.type.endsWith("_selection"), isTextOperation: (e5) => Lp.isOperation(e5) && e5.type.endsWith("_text"), inverse(e5) {
switch (e5.type) {
case "insert_node":
return Rp(Rp({}, e5), {}, { type: "remove_node" });
case "insert_text":
return Rp(Rp({}, e5), {}, { type: "remove_text" });
case "merge_node":
return Rp(Rp({}, e5), {}, { type: "split_node", path: bp.previous(e5.path) });
case "move_node":
var { newPath: t2, path: n2 } = e5;
if (bp.equals(t2, n2)) return e5;
if (bp.isSibling(n2, t2)) return Rp(Rp({}, e5), {}, { path: t2, newPath: n2 });
var r2 = bp.transform(n2, e5), o2 = bp.transform(bp.next(n2), e5);
return Rp(Rp({}, e5), {}, { path: r2, newPath: o2 });
case "remove_node":
return Rp(Rp({}, e5), {}, { type: "insert_node" });
case "remove_text":
return Rp(Rp({}, e5), {}, { type: "insert_text" });
case "set_node":
var { properties: i2, newProperties: a2 } = e5;
return Rp(Rp({}, e5), {}, { properties: a2, newProperties: i2 });
case "set_selection":
var { properties: s2, newProperties: u2 } = e5;
return Rp(Rp({}, e5), {}, null == s2 ? { properties: u2, newProperties: null } : null == u2 ? { properties: null, newProperties: s2 } : { properties: u2, newProperties: s2 });
case "split_node":
return Rp(Rp({}, e5), {}, { type: "merge_node", path: bp.next(e5.path) });
}
} }, Mp = (e5) => "object" == typeof e5 && null !== e5, jp = (e5, t2) => {
for (var n2 in e5) {
var r2 = e5[n2], o2 = t2[n2];
if (Array.isArray(r2) && Array.isArray(o2)) {
if (r2.length !== o2.length) return false;
for (var i2 = 0; i2 < r2.length; i2++) if (r2[i2] !== o2[i2]) return false;
} else if (Mp(r2) && Mp(o2)) {
if (!jp(r2, o2)) return false;
} else if (r2 !== o2) return false;
}
for (var a2 in t2) if (void 0 === e5[a2] && void 0 !== t2[a2]) return false;
return true;
}, Hp = (e5) => e5.selection ? e5.selection : e5.children.length > 0 ? hh.end(e5, []) : [0], zp = (e5, t2) => {
var [n2] = hh.node(e5, t2);
return (e6) => e6 === n2;
}, $p = function(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n2 = !t2, r2 = t2 ? Kp(e5) : e5, o2 = _p.None, i2 = _p.None, a2 = 0, s2 = null;
for (var u2 of r2) {
var l2 = u2.codePointAt(0);
if (!l2) break;
var c2 = ah(u2, l2);
if ([o2, i2] = n2 ? [i2, c2] : [c2, o2], sh(o2, _p.ZWJ) && sh(i2, _p.ExtPict) && !dh(n2 ? e5.substring(0, a2) : e5.substring(0, e5.length - a2))) break;
if (sh(o2, _p.RI) && sh(i2, _p.RI) && !(s2 = null !== s2 ? !s2 : !!n2 || ph(e5.substring(0, e5.length - a2)))) break;
if (o2 !== _p.None && i2 !== _p.None && lh(o2, i2)) break;
a2 += u2.length;
}
return a2 || 1;
}, Up = /\s/, Vp = /[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/, Wp = /['\u2018\u2019]/, Gp = (e5, t2, n2) => {
if (n2) {
var r2 = e5.length - t2;
return [e5.slice(r2, e5.length), e5.slice(0, r2)];
}
return [e5.slice(0, t2), e5.slice(t2)];
}, qp = function e2(t2, n2) {
var r2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
if (Up.test(t2)) return false;
if (Wp.test(t2)) {
var o2 = $p(n2, r2), [i2, a2] = Gp(n2, o2, r2);
if (e2(i2, a2, r2)) return true;
}
return !Vp.test(t2);
}, Kp = function* (e5) {
for (var t2 = e5.length - 1, n2 = 0; n2 < e5.length; n2++) {
var r2 = e5.charAt(t2 - n2);
if (Xp(r2.charCodeAt(0))) {
var o2 = e5.charAt(t2 - n2 - 1);
if (Yp(o2.charCodeAt(0))) {
yield o2 + r2, n2++;
continue;
}
}
yield r2;
}
}, Yp = (e5) => e5 >= 55296 && e5 <= 56319, Xp = (e5) => e5 >= 56320 && e5 <= 57343;
!(function(e5) {
e5[e5.None = 0] = "None", e5[e5.Extend = 1] = "Extend", e5[e5.ZWJ = 2] = "ZWJ", e5[e5.RI = 4] = "RI", e5[e5.Prepend = 8] = "Prepend", e5[e5.SpacingMark = 16] = "SpacingMark", e5[e5.L = 32] = "L", e5[e5.V = 64] = "V", e5[e5.T = 128] = "T", e5[e5.LV = 256] = "LV", e5[e5.LVT = 512] = "LVT", e5[e5.ExtPict = 1024] = "ExtPict", e5[e5.Any = 2048] = "Any";
})(_p || (_p = {}));
var Zp = /^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/, Jp = /^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/, Qp = /^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/, eh = /^[\u1100-\u115F\uA960-\uA97C]$/, th = /^[\u1160-\u11A7\uD7B0-\uD7C6]$/, nh = /^[\u11A8-\u11FF\uD7CB-\uD7FB]$/, rh = /^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/, oh = /^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/, ih = /^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/, ah = (e5, t2) => {
var n2 = _p.Any;
return -1 !== e5.search(Zp) && (n2 |= _p.Extend), 8205 === t2 && (n2 |= _p.ZWJ), t2 >= 127462 && t2 <= 127487 && (n2 |= _p.RI), -1 !== e5.search(Jp) && (n2 |= _p.Prepend), -1 !== e5.search(Qp) && (n2 |= _p.SpacingMark), -1 !== e5.search(eh) && (n2 |= _p.L), -1 !== e5.search(th) && (n2 |= _p.V), -1 !== e5.search(nh) && (n2 |= _p.T), -1 !== e5.search(rh) && (n2 |= _p.LV), -1 !== e5.search(oh) && (n2 |= _p.LVT), -1 !== e5.search(ih) && (n2 |= _p.ExtPict), n2;
};
function sh(e5, t2) {
return 0 !== (e5 & t2);
}
var uh = [[_p.L, _p.L | _p.V | _p.LV | _p.LVT], [_p.LV | _p.V, _p.V | _p.T], [_p.LVT | _p.T, _p.T], [_p.Any, _p.Extend | _p.ZWJ], [_p.Any, _p.SpacingMark], [_p.Prepend, _p.Any], [_p.ZWJ, _p.ExtPict], [_p.RI, _p.RI]];
function lh(e5, t2) {
return -1 === uh.findIndex((n2) => sh(e5, n2[0]) && sh(t2, n2[1]));
}
var ch = /(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/, dh = (e5) => -1 !== e5.search(ch), fh = /(?:\uD83C[\uDDE6-\uDDFF])+$/g, ph = (e5) => {
var t2 = e5.match(fh);
return null !== t2 && t2[0].length / 2 % 2 == 1;
}, hh = { above: (e5, t2) => e5.above(t2), addMark(e5, t2, n2) {
e5.addMark(t2, n2);
}, after: (e5, t2, n2) => e5.after(t2, n2), before: (e5, t2, n2) => e5.before(t2, n2), deleteBackward(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { unit: n2 = "character" } = t2;
e5.deleteBackward(n2);
}, deleteForward(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { unit: n2 = "character" } = t2;
e5.deleteForward(n2);
}, deleteFragment(e5, t2) {
e5.deleteFragment(t2);
}, edges: (e5, t2) => e5.edges(t2), elementReadOnly(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return e5.elementReadOnly(t2);
}, end: (e5, t2) => e5.end(t2), first: (e5, t2) => e5.first(t2), fragment: (e5, t2) => e5.fragment(t2), hasBlocks: (e5, t2) => e5.hasBlocks(t2), hasInlines: (e5, t2) => e5.hasInlines(t2), hasPath: (e5, t2) => e5.hasPath(t2), hasTexts: (e5, t2) => e5.hasTexts(t2), insertBreak(e5) {
e5.insertBreak();
}, insertFragment(e5, t2, n2) {
e5.insertFragment(t2, n2);
}, insertNode(e5, t2) {
e5.insertNode(t2);
}, insertSoftBreak(e5) {
e5.insertSoftBreak();
}, insertText(e5, t2) {
e5.insertText(t2);
}, isBlock: (e5, t2) => e5.isBlock(t2), isEdge: (e5, t2, n2) => e5.isEdge(t2, n2), isEditor: function(e5) {
var { deep: t2 = false } = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
if (!Mp(e5)) return false;
var n2 = "function" == typeof e5.above && "function" == typeof e5.addMark && "function" == typeof e5.after && "function" == typeof e5.apply && "function" == typeof e5.before && "function" == typeof e5.collapse && "function" == typeof e5.delete && "function" == typeof e5.deleteBackward && "function" == typeof e5.deleteForward && "function" == typeof e5.deleteFragment && "function" == typeof e5.deselect && "function" == typeof e5.edges && "function" == typeof e5.elementReadOnly && "function" == typeof e5.end && "function" == typeof e5.first && "function" == typeof e5.fragment && "function" == typeof e5.getDirtyPaths && "function" == typeof e5.getFragment && "function" == typeof e5.getMarks && "function" == typeof e5.hasBlocks && "function" == typeof e5.hasInlines && "function" == typeof e5.hasPath && "function" == typeof e5.hasTexts && "function" == typeof e5.insertBreak && "function" == typeof e5.insertFragment && "function" == typeof e5.insertNode && "function" == typeof e5.insertNodes && "function" == typeof e5.insertSoftBreak && "function" == typeof e5.insertText && "function" == typeof e5.isBlock && "function" == typeof e5.isEdge && "function" == typeof e5.isElementReadOnly && "function" == typeof e5.isEmpty && "function" == typeof e5.isEnd && "function" == typeof e5.isInline && "function" == typeof e5.isNormalizing && "function" == typeof e5.isSelectable && "function" == typeof e5.isStart && "function" == typeof e5.isVoid && "function" == typeof e5.last && "function" == typeof e5.leaf && "function" == typeof e5.levels && "function" == typeof e5.liftNodes && "function" == typeof e5.markableVoid && "function" == typeof e5.mergeNodes && "function" == typeof e5.move && "function" == typeof e5.moveNodes && "function" == typeof e5.next && "function" == typeof e5.node && "function" == typeof e5.nodes && "function" == typeof e5.normalize && "function" == typeof e5.normalizeNode && "function" == typeof e5.onChange && "function" == typeof e5.parent && "function" == typeof e5.path && "function" == typeof e5.pathRef && "function" == typeof e5.pathRefs && "function" == typeof e5.point && "function" == typeof e5.pointRef && "function" == typeof e5.pointRefs && "function" == typeof e5.positions && "function" == typeof e5.previous && "function" == typeof e5.range && "function" == typeof e5.rangeRef && "function" == typeof e5.rangeRefs && "function" == typeof e5.removeMark && "function" == typeof e5.removeNodes && "function" == typeof e5.select && "function" == typeof e5.setNodes && "function" == typeof e5.setNormalizing && "function" == typeof e5.setPoint && "function" == typeof e5.setSelection && "function" == typeof e5.shouldMergeNodesRemovePrevNode && "function" == typeof e5.shouldNormalize && "function" == typeof e5.splitNodes && "function" == typeof e5.start && "function" == typeof e5.string && "function" == typeof e5.unhangRange && "function" == typeof e5.unsetNodes && "function" == typeof e5.unwrapNodes && "function" == typeof e5.void && "function" == typeof e5.withoutNormalizing && "function" == typeof e5.wrapNodes && (null === e5.marks || Mp(e5.marks)) && (null === e5.selection || xp.isRange(e5.selection)) && (t2 ? Pp.isNodeList(e5.children) && Lp.isOperationList(e5.operations) : Array.isArray(e5.children) && Array.isArray(e5.operations));
return n2;
}, isElementReadOnly: (e5, t2) => e5.isElementReadOnly(t2), isEmpty: (e5, t2) => e5.isEmpty(t2), isEnd: (e5, t2, n2) => e5.isEnd(t2, n2), isInline: (e5, t2) => e5.isInline(t2), isNormalizing: (e5) => e5.isNormalizing(), isSelectable: (e5, t2) => e5.isSelectable(t2), isStart: (e5, t2, n2) => e5.isStart(t2, n2), isVoid: (e5, t2) => e5.isVoid(t2), last: (e5, t2) => e5.last(t2), leaf: (e5, t2, n2) => e5.leaf(t2, n2), levels: (e5, t2) => e5.levels(t2), marks: (e5) => e5.getMarks(), next: (e5, t2) => e5.next(t2), node: (e5, t2, n2) => e5.node(t2, n2), nodes: (e5, t2) => e5.nodes(t2), normalize(e5, t2) {
e5.normalize(t2);
}, parent: (e5, t2, n2) => e5.parent(t2, n2), path: (e5, t2, n2) => e5.path(t2, n2), pathRef: (e5, t2, n2) => e5.pathRef(t2, n2), pathRefs: (e5) => e5.pathRefs(), point: (e5, t2, n2) => e5.point(t2, n2), pointRef: (e5, t2, n2) => e5.pointRef(t2, n2), pointRefs: (e5) => e5.pointRefs(), positions: (e5, t2) => e5.positions(t2), previous: (e5, t2) => e5.previous(t2), range: (e5, t2, n2) => e5.range(t2, n2), rangeRef: (e5, t2, n2) => e5.rangeRef(t2, n2), rangeRefs: (e5) => e5.rangeRefs(), removeMark(e5, t2) {
e5.removeMark(t2);
}, setNormalizing(e5, t2) {
e5.setNormalizing(t2);
}, start: (e5, t2) => e5.start(t2), string: (e5, t2, n2) => e5.string(t2, n2), unhangRange: (e5, t2, n2) => e5.unhangRange(t2, n2), void: (e5, t2) => e5.void(t2), withoutNormalizing(e5, t2) {
e5.withoutNormalizing(t2);
}, shouldMergeNodesRemovePrevNode: (e5, t2, n2) => e5.shouldMergeNodesRemovePrevNode(t2, n2) }, gh = { isLocation: (e5) => bp.isPath(e5) || yh.isPoint(e5) || xp.isRange(e5), isPath: (e5) => Array.isArray(e5), isPoint: (e5) => "offset" in e5, isRange: (e5) => "anchor" in e5, isSpan: (e5) => Array.isArray(e5) && Array.isArray(e5[0]) };
function vh(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function mh(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? vh(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : vh(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
var yh = { compare(e5, t2) {
var n2 = bp.compare(e5.path, t2.path);
return 0 === n2 ? e5.offset < t2.offset ? -1 : e5.offset > t2.offset ? 1 : 0 : n2;
}, isAfter: (e5, t2) => 1 === yh.compare(e5, t2), isBefore: (e5, t2) => -1 === yh.compare(e5, t2), equals: (e5, t2) => e5.offset === t2.offset && bp.equals(e5.path, t2.path), isPoint: (e5) => Mp(e5) && "number" == typeof e5.offset && bp.isPath(e5.path), transform(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
if (null === e5) return null;
var { affinity: r2 = "forward" } = n2, { path: o2, offset: i2 } = e5;
switch (t2.type) {
case "insert_node":
case "move_node":
o2 = bp.transform(o2, t2, n2);
break;
case "insert_text":
bp.equals(t2.path, o2) && (t2.offset < i2 || t2.offset === i2 && "forward" === r2) && (i2 += t2.text.length);
break;
case "merge_node":
bp.equals(t2.path, o2) && (i2 += t2.position), o2 = bp.transform(o2, t2, n2);
break;
case "remove_text":
bp.equals(t2.path, o2) && t2.offset <= i2 && (i2 -= Math.min(i2 - t2.offset, t2.text.length));
break;
case "remove_node":
if (bp.equals(t2.path, o2) || bp.isAncestor(t2.path, o2)) return null;
o2 = bp.transform(o2, t2, n2);
break;
case "split_node":
if (bp.equals(t2.path, o2)) {
if (t2.position === i2 && null == r2) return null;
(t2.position < i2 || t2.position === i2 && "forward" === r2) && (i2 -= t2.position, o2 = bp.transform(o2, t2, mh(mh({}, n2), {}, { affinity: "forward" })));
} else o2 = bp.transform(o2, t2, n2);
break;
default:
return e5;
}
return { path: o2, offset: i2 };
} }, bh = void 0, Eh = { setScrubber(e5) {
bh = e5;
}, stringify: (e5) => JSON.stringify(e5, bh) }, wh = ["text"], Ch = ["anchor", "focus", "merge"];
function Dh(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function Ah(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? Dh(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : Dh(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
var Sh = { equals(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { loose: r2 = false } = n2;
function o2(e6) {
return Dp(e6, wh);
}
return jp(r2 ? o2(e5) : e5, r2 ? o2(t2) : t2);
}, isText: (e5) => Mp(e5) && "string" == typeof e5.text, isTextList: (e5) => Array.isArray(e5) && e5.every((e6) => Sh.isText(e6)), isTextProps: (e5) => void 0 !== e5.text, matches(e5, t2) {
for (var n2 in t2) if ("text" !== n2 && (!e5.hasOwnProperty(n2) || e5[n2] !== t2[n2])) return false;
return true;
}, decorations(e5, t2) {
var n2 = [{ leaf: Ah({}, e5) }];
for (var r2 of t2) {
var { anchor: o2, focus: i2, merge: a2 } = r2, s2 = Dp(r2, Ch), [u2, l2] = xp.edges(r2), c2 = [], d2 = 0, f2 = u2.offset, p2 = l2.offset, h2 = null != a2 ? a2 : Object.assign;
for (var { leaf: g2 } of n2) {
var { length: v2 } = g2.text, m2 = d2;
if (d2 += v2, f2 <= m2 && d2 <= p2) h2(g2, s2), c2.push({ leaf: g2 });
else if (f2 !== p2 && (f2 === d2 || p2 === m2) || f2 > d2 || p2 < m2 || p2 === m2 && 0 !== m2) c2.push({ leaf: g2 });
else {
var y2 = g2, b2 = void 0, E2 = void 0;
if (p2 < d2) {
var w2 = p2 - m2;
E2 = { leaf: Ah(Ah({}, y2), {}, { text: y2.text.slice(w2) }) }, y2 = Ah(Ah({}, y2), {}, { text: y2.text.slice(0, w2) });
}
if (f2 > m2) {
var C2 = f2 - m2;
b2 = { leaf: Ah(Ah({}, y2), {}, { text: y2.text.slice(0, C2) }) }, y2 = Ah(Ah({}, y2), {}, { text: y2.text.slice(C2) });
}
h2(y2, s2), b2 && c2.push(b2), c2.push({ leaf: y2 }), E2 && c2.push(E2);
}
}
n2 = c2;
}
if (n2.length > 1) {
var D2 = 0;
for (var [A2, S2] of n2.entries()) {
var x2 = D2, O2 = x2 + S2.leaf.text.length, N2 = { start: x2, end: O2 };
0 === A2 && (N2.isFirst = true), A2 === n2.length - 1 && (N2.isLast = true), S2.position = N2, D2 = O2;
}
}
return n2;
} };
function xh(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function Oh(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? xh(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : xh(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
var Nh = function(e5, t2) {
for (var n2 = arguments.length, r2 = new Array(n2 > 2 ? n2 - 2 : 0), o2 = 2; o2 < n2; o2++) r2[o2 - 2] = arguments[o2];
return [...e5.slice(0, t2), ...r2, ...e5.slice(t2)];
}, Bh = function(e5, t2, n2) {
for (var r2 = arguments.length, o2 = new Array(r2 > 3 ? r2 - 3 : 0), i2 = 3; i2 < r2; i2++) o2[i2 - 3] = arguments[i2];
return [...e5.slice(0, t2), ...o2, ...e5.slice(t2 + n2)];
}, Th = Bh, kh = (e5, t2, n2) => {
if (0 === t2.length) throw new Error("Cannot modify the editor");
for (var r2 = Pp.get(e5, t2), o2 = t2.slice(), i2 = n2(r2); o2.length > 1; ) {
var a2 = o2.pop(), s2 = Pp.get(e5, o2);
i2 = Oh(Oh({}, s2), {}, { children: Bh(s2.children, a2, 1, i2) });
}
var u2 = o2.pop();
e5.children = Bh(e5.children, u2, 1, i2);
}, Fh = (e5, t2, n2) => {
0 === t2.length ? e5.children = n2(e5.children) : kh(e5, t2, (e6) => {
if (Pp.isText(e6)) throw new Error("Cannot get the element at path [".concat(t2, "] because it refers to a leaf node: ").concat(Eh.stringify(e6)));
return Oh(Oh({}, e6), {}, { children: n2(e6.children) });
});
}, Ph = (e5, t2, n2) => kh(e5, t2, (e6) => {
if (!Pp.isText(e6)) throw new Error("Cannot get the leaf node at path [".concat(t2, "] because it refers to a non-leaf node: ").concat(Eh.stringify(e6)));
return n2(e6);
});
function Ih(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function Rh(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? Ih(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : Ih(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
var _h = { transform(e5, t2) {
var n2 = false;
switch (t2.type) {
case "insert_node":
var { path: r2, node: o2 } = t2;
Fh(e5, bp.parent(r2), (e6) => {
var t3 = r2[r2.length - 1];
if (t3 > e6.length) throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r2, "] because the destination is past the end of the node."));
return Nh(e6, t3, o2);
}), n2 = true;
break;
case "insert_text":
var { path: i2, offset: a2, text: s2 } = t2;
if (0 === s2.length) break;
Ph(e5, i2, (e6) => {
var t3 = e6.text.slice(0, a2), n3 = e6.text.slice(a2);
return Rh(Rh({}, e6), {}, { text: t3 + s2 + n3 });
}), n2 = true;
break;
case "merge_node":
var { path: u2 } = t2, l2 = u2[u2.length - 1], c2 = bp.previous(u2), d2 = c2[c2.length - 1];
Fh(e5, bp.parent(u2), (e6) => {
var t3, n3 = e6[l2], r3 = e6[d2];
if (Pp.isText(n3) && Pp.isText(r3)) t3 = Rh(Rh({}, r3), {}, { text: r3.text + n3.text });
else {
if (!Pp.isElement(n3) || !Pp.isElement(r3)) throw new Error('Cannot apply a "merge_node" operation at path ['.concat(u2, "] to nodes of different interfaces: ").concat(Eh.stringify(n3), " ").concat(Eh.stringify(r3)));
t3 = Rh(Rh({}, r3), {}, { children: r3.children.concat(n3.children) });
}
return Bh(e6, d2, 2, t3);
}), n2 = true;
break;
case "move_node":
var { path: f2, newPath: p2 } = t2, h2 = f2[f2.length - 1];
if (bp.isAncestor(f2, p2)) throw new Error("Cannot move a path [".concat(f2, "] to new path [").concat(p2, "] because the destination is inside itself."));
var g2 = Pp.get(e5, f2);
Fh(e5, bp.parent(f2), (e6) => Th(e6, h2, 1));
var v2 = bp.transform(f2, t2), m2 = v2[v2.length - 1];
Fh(e5, bp.parent(v2), (e6) => Nh(e6, m2, g2)), n2 = true;
break;
case "remove_node":
var { path: y2 } = t2, b2 = y2[y2.length - 1];
if (Fh(e5, bp.parent(y2), (e6) => Th(e6, b2, 1)), e5.selection) {
var E2 = Rh({}, e5.selection);
for (var [w2, C2] of xp.points(E2)) {
var D2 = yh.transform(w2, t2);
if (null != E2 && null != D2) E2[C2] = D2;
else {
var A2 = void 0, S2 = void 0;
for (var [x2, O2] of Pp.texts(e5)) {
if (-1 !== bp.compare(O2, y2)) {
S2 = [x2, O2];
break;
}
A2 = [x2, O2];
}
var N2 = false;
A2 && S2 && (N2 = !bp.isSibling(A2[1], y2) && (!!bp.equals(S2[1], y2) || bp.common(A2[1], y2).length < bp.common(S2[1], y2).length)), A2 && !N2 ? E2[C2] = { path: A2[1], offset: A2[0].text.length } : S2 ? E2[C2] = { path: S2[1], offset: 0 } : E2 = null;
}
}
E2 && xp.equals(E2, e5.selection) || (e5.selection = E2);
}
break;
case "remove_text":
var { path: B2, offset: T2, text: k2 } = t2;
if (0 === k2.length) break;
Ph(e5, B2, (e6) => {
var t3 = e6.text.slice(0, T2), n3 = e6.text.slice(T2 + k2.length);
return Rh(Rh({}, e6), {}, { text: t3 + n3 });
}), n2 = true;
break;
case "set_node":
var { path: F2, properties: P2, newProperties: I2 } = t2;
if (0 === F2.length) throw new Error("Cannot set properties on the root node!");
kh(e5, F2, (e6) => {
var t3 = Rh({}, e6);
for (var n3 in I2) {
if ("children" === n3 || "text" === n3) throw new Error('Cannot set the "'.concat(n3, '" property of nodes!'));
var r3 = I2[n3];
null == r3 ? delete t3[n3] : t3[n3] = r3;
}
for (var o3 in P2) I2.hasOwnProperty(o3) || delete t3[o3];
return t3;
});
break;
case "set_selection":
var { newProperties: R2 } = t2;
if (null == R2) {
e5.selection = null;
break;
}
if (null == e5.selection) {
if (!R2.anchor || !R2.focus) throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Eh.stringify(R2), " when there is no current selection."));
e5.selection = Rh({}, R2);
break;
}
var _2 = Rh({}, e5.selection);
for (var L2 in R2) {
var M2 = R2[L2];
if (null == M2) {
if ("anchor" === L2 || "focus" === L2) throw new Error('Cannot remove the "'.concat(L2, '" selection property'));
delete _2[L2];
} else _2[L2] = M2;
}
e5.selection = _2;
break;
case "split_node":
var { path: j2, position: H2, properties: z2 } = t2, $2 = j2[j2.length - 1];
if (0 === j2.length) throw new Error('Cannot apply a "split_node" operation at path ['.concat(j2, "] because the root node cannot be split."));
Fh(e5, bp.parent(j2), (e6) => {
var t3, n3, r3 = e6[$2];
if (Pp.isText(r3)) {
var o3 = r3.text.slice(0, H2), i3 = r3.text.slice(H2);
t3 = Rh(Rh({}, r3), {}, { text: o3 }), n3 = Rh(Rh({}, z2), {}, { text: i3 });
} else {
var a3 = r3.children.slice(0, H2), s3 = r3.children.slice(H2);
t3 = Rh(Rh({}, r3), {}, { children: a3 }), n3 = Rh(Rh({}, z2), {}, { children: s3 });
}
return Bh(e6, $2, 1, t3, n3);
}), n2 = true;
}
if (n2 && e5.selection) {
var U2 = Rh({}, e5.selection);
for (var [V2, W2] of xp.points(U2)) U2[W2] = yh.transform(V2, t2);
xp.equals(U2, e5.selection) || (e5.selection = U2);
}
} }, Lh = { insertNodes(e5, t2, n2) {
e5.insertNodes(t2, n2);
}, liftNodes(e5, t2) {
e5.liftNodes(t2);
}, mergeNodes(e5, t2) {
e5.mergeNodes(t2);
}, moveNodes(e5, t2) {
e5.moveNodes(t2);
}, removeNodes(e5, t2) {
e5.removeNodes(t2);
}, setNodes(e5, t2, n2) {
e5.setNodes(t2, n2);
}, splitNodes(e5, t2) {
e5.splitNodes(t2);
}, unsetNodes(e5, t2, n2) {
e5.unsetNodes(t2, n2);
}, unwrapNodes(e5, t2) {
e5.unwrapNodes(t2);
}, wrapNodes(e5, t2, n2) {
e5.wrapNodes(t2, n2);
} }, Mh = { collapse(e5, t2) {
e5.collapse(t2);
}, deselect(e5) {
e5.deselect();
}, move(e5, t2) {
e5.move(t2);
}, select(e5, t2) {
e5.select(t2);
}, setPoint(e5, t2, n2) {
e5.setPoint(t2, n2);
}, setSelection(e5, t2) {
e5.setSelection(t2);
} }, jh = { delete(e5, t2) {
e5.delete(t2);
}, insertFragment(e5, t2, n2) {
e5.insertFragment(t2, n2);
}, insertText(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
hh.withoutNormalizing(e5, () => {
var { voids: r2 = false } = n2, { at: o2 = Hp(e5) } = n2;
if (gh.isPath(o2) && (o2 = hh.range(e5, o2)), gh.isRange(o2)) if (xp.isCollapsed(o2)) o2 = o2.anchor;
else {
var i2 = xp.end(o2);
if (!r2 && hh.void(e5, { at: i2 })) return;
var a2 = xp.start(o2), s2 = hh.pointRef(e5, a2), u2 = hh.pointRef(e5, i2);
$h.delete(e5, { at: o2, voids: r2 });
var l2 = s2.unref(), c2 = u2.unref();
o2 = l2 || c2, $h.setSelection(e5, { anchor: o2, focus: o2 });
}
if (!(!r2 && hh.void(e5, { at: o2 }) || hh.elementReadOnly(e5, { at: o2 }))) {
var { path: d2, offset: f2 } = o2;
t2.length > 0 && e5.apply({ type: "insert_text", path: d2, offset: f2, text: t2 });
}
});
} };
function Hh(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function zh(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? Hh(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : Hh(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
var $h = zh(zh(zh(zh({}, _h), Lh), Mh), jh), Uh = /* @__PURE__ */ new WeakMap();
function Vh(e5, t2, n2) {
var r2, o2, i2 = fp.get(e5) || [], a2 = pp.get(e5) || /* @__PURE__ */ new Set(), s2 = (e6) => {
if (e6) {
var t3 = e6.join(",");
o2.has(t3) || (o2.add(t3), r2.push(e6));
}
};
if (n2) for (var u2 of (r2 = [], o2 = /* @__PURE__ */ new Set(), i2)) {
s2(n2(u2));
}
else r2 = i2, o2 = a2;
for (var l2 of t2) s2(l2);
fp.set(e5, r2), pp.set(e5, o2);
}
var Wh = (e5, t2) => {
for (var n2 of hh.pathRefs(e5)) lp.transform(n2, t2);
for (var r2 of hh.pointRefs(e5)) cp.transform(r2, t2);
for (var o2 of hh.rangeRefs(e5)) dp.transform(o2, t2);
if (!((e6) => Uh.get(e6) || false)(e5)) {
var i2 = bp.operationCanTransformPath(t2) ? (e6) => bp.transform(e6, t2) : void 0;
Vh(e5, e5.getDirtyPaths(t2), i2);
}
$h.transform(e5, t2), e5.operations.push(t2), hh.normalize(e5, { operation: t2 }), "set_selection" === t2.type && (e5.marks = null), hp.get(e5) || (hp.set(e5, true), Promise.resolve().then(() => {
hp.set(e5, false), e5.onChange({ operation: t2 }), e5.operations = [];
}));
};
function Gh(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function qh(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? Gh(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : Gh(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
function Kh(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function Yh(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? Kh(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : Kh(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
function Xh(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function Zh(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? Xh(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : Xh(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
function Jh(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function Qh(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? Jh(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : Jh(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
function eg(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function tg(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? eg(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : eg(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
function ng(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
var rg = function(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { selection: r2, marks: o2 } = e5;
if (r2) {
if (o2) {
var i2 = (function(e6) {
for (var t3 = 1; t3 < arguments.length; t3++) {
var n3 = null != arguments[t3] ? arguments[t3] : {};
t3 % 2 ? ng(Object(n3), true).forEach(function(t4) {
Cp(e6, t4, n3[t4]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n3)) : ng(Object(n3)).forEach(function(t4) {
Object.defineProperty(e6, t4, Object.getOwnPropertyDescriptor(n3, t4));
});
}
return e6;
})({ text: t2 }, o2);
$h.insertNodes(e5, i2, { at: n2.at, voids: n2.voids });
} else $h.insertText(e5, t2, n2);
e5.marks = null;
}
};
var og = ["text"], ig = ["text"];
var ag = function(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { force: n2 = false, operation: r2 } = t2, o2 = (e6) => fp.get(e6) || [], i2 = (e6) => {
var t3 = o2(e6).pop(), n3 = t3.join(",");
return ((e7) => pp.get(e7) || /* @__PURE__ */ new Set())(e6).delete(n3), t3;
};
if (hh.isNormalizing(e5)) {
if (n2) {
var a2 = Array.from(Pp.nodes(e5), (e6) => {
var [, t3] = e6;
return t3;
}), s2 = new Set(a2.map((e6) => e6.join(",")));
fp.set(e5, a2), pp.set(e5, s2);
}
0 !== o2(e5).length && hh.withoutNormalizing(e5, () => {
for (var t3 of o2(e5)) if (Pp.has(e5, t3)) {
var n3 = hh.node(e5, t3), [a3, s3] = n3;
Pp.isElement(a3) && 0 === a3.children.length && e5.normalizeNode(n3, { operation: r2 });
}
for (var u2 = o2(e5), l2 = u2.length, c2 = 0; 0 !== u2.length; ) {
if (!e5.shouldNormalize({ dirtyPaths: u2, iteration: c2, initialDirtyPathsLength: l2, operation: r2 })) return;
var d2 = i2(e5);
if (Pp.has(e5, d2)) {
var f2 = hh.node(e5, d2);
e5.normalizeNode(f2, { operation: r2 });
}
c2++, u2 = o2(e5);
}
});
}
};
function sg(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return (function* () {
var { at: n2 = e5.selection, unit: r2 = "offset", reverse: o2 = false, voids: i2 = false } = t2;
if (n2) {
var a2 = hh.range(e5, n2), [s2, u2] = xp.edges(a2), l2 = o2 ? u2 : s2, c2 = false, d2 = "", f2 = 0, p2 = 0, h2 = 0, g2 = [], v2 = function* (t3) {
var n3 = g2.some((e6) => bp.isAncestor(e6, t3));
function* a3(e6) {
n3 || (yield e6);
}
if (Pp.isElement(m2)) {
if (!e5.isSelectable(m2)) {
if (g2.push(t3), o2) return bp.hasPrevious(t3) && (yield* a3(hh.end(e5, bp.previous(t3)))), 0;
var v3 = bp.next(t3);
return hh.hasPath(e5, v3) && (yield* a3(hh.start(e5, v3))), 0;
}
if (!i2 && (e5.isVoid(m2) || e5.isElementReadOnly(m2))) return yield* a3(hh.start(e5, t3)), 0;
if (e5.isInline(m2)) return 0;
if (hh.hasInlines(e5, m2)) {
var y3 = bp.isAncestor(t3, u2.path) ? u2 : hh.end(e5, t3), E2 = bp.isAncestor(t3, s2.path) ? s2 : hh.start(e5, t3);
d2 = hh.string(e5, { anchor: E2, focus: y3 }, { voids: i2 }), c2 = true;
}
}
if (Pp.isText(m2)) {
var w2 = bp.equals(t3, l2.path);
for (w2 ? (p2 = o2 ? l2.offset : m2.text.length - l2.offset, h2 = l2.offset) : (p2 = m2.text.length, h2 = o2 ? p2 : 0), (w2 || c2 || "offset" === r2) && (yield* a3({ path: t3, offset: h2 }), c2 = false); ; ) {
if (0 === f2) {
if ("" === d2) break;
f2 = b2(d2, r2, o2), d2 = Gp(d2, f2, o2)[1];
}
if (h2 = o2 ? h2 - f2 : h2 + f2, (p2 -= f2) < 0) {
f2 = -p2;
break;
}
f2 = 0, yield* a3({ path: t3, offset: h2 });
}
}
};
for (var [m2, y2] of hh.nodes(e5, { at: n2, reverse: o2, voids: i2 })) yield* v2(y2);
}
function b2(e6, t3, n3) {
return "character" === t3 ? $p(e6, n3) : "word" === t3 ? (function(e7) {
for (var t4 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n4 = 0, r3 = false; e7.length > 0; ) {
var o3 = $p(e7, t4), [i3, a3] = Gp(e7, o3, t4);
if (qp(i3, a3, t4)) r3 = true, n4 += o3;
else {
if (r3) break;
n4 += o3;
}
e7 = a3;
}
return n4;
})(e6, n3) : "line" === t3 || "block" === t3 ? e6.length : 1;
}
})();
}
function ug(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
var lg = (e5, t2) => {
var { selection: n2 } = e5;
if (n2) {
var r2 = (t3, n3) => {
if (!Pp.isText(t3)) return false;
var [r3, o3] = hh.parent(e5, n3);
return !e5.isVoid(r3) || e5.markableVoid(r3);
}, o2 = xp.isExpanded(n2), i2 = false;
if (!o2) {
var [a2, s2] = hh.node(e5, n2);
if (a2 && r2(a2, s2)) {
var [u2] = hh.parent(e5, s2);
i2 = u2 && e5.markableVoid(u2);
}
}
if (o2 || i2) $h.unsetNodes(e5, t2, { match: r2, split: true, voids: true });
else {
var l2 = (function(e6) {
for (var t3 = 1; t3 < arguments.length; t3++) {
var n3 = null != arguments[t3] ? arguments[t3] : {};
t3 % 2 ? ug(Object(n3), true).forEach(function(t4) {
Cp(e6, t4, n3[t4]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e6, Object.getOwnPropertyDescriptors(n3)) : ug(Object(n3)).forEach(function(t4) {
Object.defineProperty(e6, t4, Object.getOwnPropertyDescriptor(n3, t4));
});
}
return e6;
})({}, hh.marks(e5) || {});
delete l2[t2], e5.marks = l2, hp.get(e5) || e5.onChange();
}
}
};
function cg(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function dg(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? cg(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : cg(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
var fg = function(e5, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
hh.withoutNormalizing(e5, () => {
var { hanging: r2 = false, voids: o2 = false, mode: i2 = "lowest", batchDirty: a2 = true } = n2, { at: s2, match: u2, select: l2 } = n2;
if (Pp.isNode(t2) && (t2 = [t2]), 0 !== t2.length) {
var [c2] = t2;
if (s2 || (s2 = Hp(e5), false !== l2 && (l2 = true)), null == l2 && (l2 = false), gh.isRange(s2)) if (r2 || (s2 = hh.unhangRange(e5, s2, { voids: o2 })), xp.isCollapsed(s2)) s2 = s2.anchor;
else {
var [, d2] = xp.edges(s2), f2 = hh.pointRef(e5, d2);
$h.delete(e5, { at: s2 }), s2 = f2.unref();
}
if (gh.isPoint(s2)) {
null == u2 && (u2 = Pp.isText(c2) ? (e6) => Pp.isText(e6) : e5.isInline(c2) ? (t3) => Pp.isText(t3) || hh.isInline(e5, t3) : (t3) => Pp.isElement(t3) && hh.isBlock(e5, t3));
var [p2] = hh.nodes(e5, { at: s2.path, match: u2, mode: i2, voids: o2 });
if (!p2) return;
var [, h2] = p2, g2 = hh.pathRef(e5, h2), v2 = hh.isEnd(e5, s2, h2);
$h.splitNodes(e5, { at: s2, match: u2, mode: i2, voids: o2 });
var m2 = g2.unref();
s2 = v2 ? bp.next(m2) : m2;
}
var y2 = bp.parent(s2), b2 = s2[s2.length - 1];
if (o2 || !hh.void(e5, { at: y2 })) {
if (a2) {
var E2 = [], w2 = bp.levels(y2);
((e6, t3, n3) => {
var r3 = Uh.get(e6) || false;
Uh.set(e6, true);
try {
t3(), n3();
} finally {
Uh.set(e6, r3);
}
})(e5, () => {
var n3 = function() {
var t3 = y2.concat(b2);
b2++;
var n4 = { type: "insert_node", path: t3, node: r3 };
e5.apply(n4), s2 = bp.next(s2), E2.push(n4), Pp.isText(r3) ? w2.push(t3) : w2.push(...Array.from(Pp.nodes(r3), (e6) => {
var [, n5] = e6;
return t3.concat(n5);
}));
};
for (var r3 of t2) n3();
}, () => {
Vh(e5, w2, (e6) => {
var t3 = e6;
for (var n3 of E2) if (bp.operationCanTransformPath(n3) && !(t3 = bp.transform(t3, n3))) return null;
return t3;
});
});
} else for (var C2 of t2) {
var D2 = y2.concat(b2);
b2++, e5.apply({ type: "insert_node", path: D2, node: C2 }), s2 = bp.next(s2);
}
if (s2 = bp.previous(s2), l2) {
var A2 = hh.end(e5, s2);
A2 && $h.select(e5, A2);
}
}
}
});
}, pg = ["text"], hg = ["children"], gg = (e5, t2) => t2 !== e5 && (Pp.isText(t2) || hh.isVoid(e5, t2) || 1 === t2.children.length && gg(e5, t2.children[0])), vg = function(e5) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
hh.withoutNormalizing(e5, () => {
var { mode: n2 = "lowest", voids: r2 = false } = t2, { match: o2, at: i2 = e5.selection, height: a2 = 0, always: s2 = false } = t2;
if (i2 && (null == o2 && (o2 = (t3) => Pp.isElement(t3) && hh.isBlock(e5, t3)), !gh.isRange(i2) || (i2 = ((e6, t3) => {
if (xp.isCollapsed(t3)) return t3.anchor;
var [, n3] = xp.edges(t3), r3 = hh.pointRef(e6, n3);
return $h.delete(e6, { at: t3 }), r3.unref();
})(e5, i2), i2))) {
if (gh.isPath(i2)) {
var u2 = i2, l2 = hh.point(e5, u2), [c2] = hh.parent(e5, u2);
o2 = (e6) => e6 === c2, a2 = l2.path.length - u2.length + 1, i2 = l2, s2 = true;
}
var d2, f2 = hh.pointRef(e5, i2, { affinity: "backward" });
try {
var [p2] = hh.nodes(e5, { at: i2, match: o2, mode: n2, voids: r2 });
if (!p2) return;
var h2 = hh.void(e5, { at: i2, mode: "highest" });
if (!r2 && h2) {
var [g2, v2] = h2;
if (e5.isInline(g2)) {
var m2 = hh.after(e5, v2);
if (!m2) {
var y2 = bp.next(v2);
$h.insertNodes(e5, { text: "" }, { at: y2, voids: r2 }), m2 = hh.point(e5, y2);
}
i2 = m2, s2 = true;
}
a2 = i2.path.length - v2.length + 1, s2 = true;
}
d2 = hh.pointRef(e5, i2);
var b2 = i2.path.length - a2, [, E2] = p2, w2 = i2.path.slice(0, b2), C2 = 0 === a2 ? i2.offset : i2.path[b2] + 0;
for (var [D2, A2] of hh.levels(e5, { at: w2, reverse: true, voids: r2 })) {
var S2 = false;
if (A2.length < E2.length || 0 === A2.length || !r2 && Pp.isElement(D2) && hh.isVoid(e5, D2)) break;
var x2 = f2.current, O2 = hh.isEnd(e5, x2, A2);
if (s2 || !f2 || !hh.isEdge(e5, x2, A2)) {
S2 = true;
var N2 = Pp.extractProps(D2);
e5.apply({ type: "split_node", path: A2, position: C2, properties: N2 });
}
C2 = A2[A2.length - 1] + (S2 || O2 ? 1 : 0);
}
if (null == t2.at) {
var B2 = d2.current || hh.end(e5, []);
$h.select(e5, B2);
}
} finally {
var T2;
f2.unref(), null === (T2 = d2) || void 0 === T2 || T2.unref();
}
}
});
};
function mg(e5, t2) {
var n2 = Object.keys(e5);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e5);
t2 && (r2 = r2.filter(function(t3) {
return Object.getOwnPropertyDescriptor(e5, t3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function yg(e5) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = null != arguments[t2] ? arguments[t2] : {};
t2 % 2 ? mg(Object(n2), true).forEach(function(t3) {
Cp(e5, t3, n2[t3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e5, Object.getOwnPropertyDescriptors(n2)) : mg(Object(n2)).forEach(function(t3) {
Object.defineProperty(e5, t3, Object.getOwnPropertyDescriptor(n2, t3));
});
}
return e5;
}
var bg = () => {
var e5 = { children: [], operations: [], selection: null, marks: null, isElementReadOnly: () => false, isInline: () => false, isSelectable: () => true, isVoid: () => false, markableVoid: () => false, onChange: () => {
}, apply: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return Wh(e5, ...n2);
}, addMark: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3, n3) => {
var { selection: r3 } = e6;
if (r3) {
var o2 = (t4, n4) => {
if (!Pp.isText(t4)) return false;
var [r4, o3] = hh.parent(e6, n4);
return !e6.isVoid(r4) || e6.markableVoid(r4);
}, i2 = xp.isExpanded(r3), a2 = false;
if (!i2) {
var [s2, u2] = hh.node(e6, r3);
if (s2 && o2(s2, u2)) {
var [l2] = hh.parent(e6, u2);
a2 = l2 && e6.markableVoid(l2);
}
}
if (i2 || a2) $h.setNodes(e6, { [t3]: n3 }, { match: o2, split: true, voids: true });
else {
var c2 = qh(qh({}, hh.marks(e6) || {}), {}, { [t3]: n3 });
e6.marks = c2, hp.get(e6) || e6.onChange();
}
}
})(e5, ...n2);
}, deleteBackward: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var { selection: n3 } = e6;
n3 && xp.isCollapsed(n3) && $h.delete(e6, { unit: t3, reverse: true });
})(e5, ...n2);
}, deleteForward: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var { selection: n3 } = e6;
n3 && xp.isCollapsed(n3) && $h.delete(e6, { unit: t3 });
})(e5, ...n2);
}, deleteFragment: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var { direction: t3 = "forward" } = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { selection: n3 } = e6;
n3 && xp.isExpanded(n3) && $h.delete(e6, { reverse: "backward" === t3 });
})(e5, ...n2);
}, getFragment: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6) => {
var { selection: t3 } = e6;
return t3 ? Pp.fragment(e6, t3) : [];
})(e5, ...n2);
}, insertBreak: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6) => {
$h.splitNodes(e6, { always: true });
})(e5, ...n2);
}, insertSoftBreak: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6) => {
$h.splitNodes(e6, { always: true });
})(e5, ...n2);
}, insertFragment: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
hh.withoutNormalizing(e6, () => {
var { hanging: r3 = false, voids: o2 = false } = n3, { at: i2 = Hp(e6), batchDirty: a2 = true } = n3;
if (t3.length) {
if (gh.isRange(i2)) if (r3 || (i2 = hh.unhangRange(e6, i2, { voids: o2 })), xp.isCollapsed(i2)) i2 = i2.anchor;
else {
var [, s2] = xp.edges(i2);
if (!o2 && hh.void(e6, { at: s2 })) return;
var u2 = hh.pointRef(e6, s2);
$h.delete(e6, { at: i2 }), i2 = u2.unref();
}
else gh.isPath(i2) && (i2 = hh.start(e6, i2));
if (o2 || !hh.void(e6, { at: i2 })) {
var l2 = hh.above(e6, { at: i2, match: (t4) => Pp.isElement(t4) && hh.isInline(e6, t4), mode: "highest", voids: o2 });
if (l2) {
var [, c2] = l2;
hh.isEnd(e6, i2, c2) ? i2 = hh.after(e6, c2) : hh.isStart(e6, i2, c2) && (i2 = hh.before(e6, c2));
}
var d2 = hh.above(e6, { match: (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4), at: i2, voids: o2 }), [, f2] = d2, p2 = hh.isStart(e6, i2, f2), h2 = hh.isEnd(e6, i2, f2), g2 = p2 && h2, [, v2] = Pp.first({ children: t3 }, []), [, m2] = Pp.last({ children: t3 }, []), y2 = (t4) => {
var [n4, r4] = t4;
return !(0 === r4.length || !g2 && (!p2 && bp.isAncestor(r4, v2) && Pp.isElement(n4) && !e6.isVoid(n4) && !e6.isInline(n4) || !h2 && bp.isAncestor(r4, m2) && Pp.isElement(n4) && !e6.isVoid(n4) && !e6.isInline(n4)));
}, b2 = true, E2 = [], w2 = [], C2 = [];
for (var D2 of Pp.nodes({ children: t3 }, { pass: y2 })) {
var [A2, S2] = D2;
b2 && Pp.isElement(A2) && !e6.isInline(A2) && !bp.isAncestor(S2, v2) && (b2 = false), y2(D2) && (Pp.isElement(A2) && !e6.isInline(A2) ? (b2 = false, w2.push(A2)) : b2 ? E2.push(A2) : C2.push(A2));
}
var [x2] = hh.nodes(e6, { at: i2, match: (t4) => Pp.isText(t4) || hh.isInline(e6, t4), mode: "highest", voids: o2 }), [, O2] = x2, N2 = hh.isStart(e6, i2, O2), B2 = hh.isEnd(e6, i2, O2), T2 = hh.pathRef(e6, h2 && !C2.length ? bp.next(f2) : f2), k2 = hh.pathRef(e6, B2 ? bp.next(O2) : O2), F2 = C2.length > 0;
$h.splitNodes(e6, { at: i2, match: (t4) => F2 ? Pp.isElement(t4) && hh.isBlock(e6, t4) : Pp.isText(t4) || hh.isInline(e6, t4), mode: F2 ? "lowest" : "highest", always: F2 && (!p2 || E2.length > 0) && (!h2 || C2.length > 0), voids: o2 });
var P2, I2 = hh.pathRef(e6, !N2 || N2 && B2 ? bp.next(O2) : O2);
if ($h.insertNodes(e6, E2, { at: I2.current, match: (t4) => Pp.isText(t4) || hh.isInline(e6, t4), mode: "highest", voids: o2, batchDirty: a2 }), g2 && !E2.length && w2.length && !C2.length && $h.delete(e6, { at: f2, voids: o2 }), $h.insertNodes(e6, w2, { at: T2.current, match: (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4), mode: "lowest", voids: o2, batchDirty: a2 }), $h.insertNodes(e6, C2, { at: k2.current, match: (t4) => Pp.isText(t4) || hh.isInline(e6, t4), mode: "highest", voids: o2, batchDirty: a2 }), !n3.at && (C2.length > 0 && k2.current ? P2 = bp.previous(k2.current) : w2.length > 0 && T2.current ? P2 = bp.previous(T2.current) : I2.current && (P2 = bp.previous(I2.current)), P2)) {
var R2 = hh.end(e6, P2);
$h.select(e6, R2);
}
I2.unref(), T2.unref(), k2.unref();
}
}
});
})(e5, ...n2);
}, insertNode: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3, n3) => {
$h.insertNodes(e6, t3, n3);
})(e5, ...n2);
}, insertText: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return rg(e5, ...n2);
}, normalizeNode: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3, n3) => {
var [r3, o2] = t3;
if (!Pp.isText(r3)) {
"children" in r3 || (r3.children = []);
var i2 = r3;
if (i2 !== e6 && 0 === i2.children.length && ($h.insertNodes(e6, { text: "" }, { at: o2.concat(0), voids: true }), i2 = Pp.get(e6, o2)), i2 !== e6 && (e6.isInline(i2) || Pp.isText(i2.children[0]) || e6.isInline(i2.children[0]))) for (var a2 = 0; a2 < i2.children.length; a2++) {
var s2 = i2.children[a2], u2 = i2.children[a2 - 1];
Pp.isText(s2) ? null != u2 && Pp.isText(u2) && ("" === s2.text ? ($h.removeNodes(e6, { at: o2.concat(a2), voids: true }), i2 = Pp.get(e6, o2), a2--) : "" === u2.text ? ($h.removeNodes(e6, { at: o2.concat(a2 - 1), voids: true }), i2 = Pp.get(e6, o2), a2--) : Sh.equals(s2, u2, { loose: true }) && ($h.mergeNodes(e6, { at: o2.concat(a2), voids: true }), i2 = Pp.get(e6, o2), a2--)) : e6.isInline(s2) ? (null != u2 && Pp.isText(u2) || ($h.insertNodes(e6, { text: "" }, { at: o2.concat(a2), voids: true }), i2 = Pp.get(e6, o2), a2++), a2 === i2.children.length - 1 && ($h.insertNodes(e6, { text: "" }, { at: o2.concat(a2 + 1), voids: true }), i2 = Pp.get(e6, o2), a2++)) : ($h.unwrapNodes(e6, { at: o2.concat(a2), voids: true }), i2 = Pp.get(e6, o2), a2--);
}
else for (var l2 = 0; l2 < i2.children.length; l2++) {
var c2 = i2.children[l2];
(Pp.isText(c2) || e6.isInline(c2)) && (null != n3 && n3.fallbackElement ? $h.wrapNodes(e6, n3.fallbackElement(), { at: o2.concat(l2), voids: true }) : $h.removeNodes(e6, { at: o2.concat(l2), voids: true }), i2 = Pp.get(e6, o2), l2--);
}
}
})(e5, ...n2);
}, removeMark: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return lg(e5, ...n2);
}, getDirtyPaths: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
switch (t3.type) {
case "insert_text":
case "remove_text":
case "set_node":
var { path: n3 } = t3;
return bp.levels(n3);
case "insert_node":
var { node: r3, path: o2 } = t3, i2 = bp.levels(o2), a2 = Pp.isText(r3) ? [] : Array.from(Pp.nodes(r3), (e7) => {
var [, t4] = e7;
return o2.concat(t4);
});
return [...i2, ...a2];
case "merge_node":
var { path: s2 } = t3;
return [...bp.ancestors(s2), bp.previous(s2)];
case "move_node":
var { path: u2, newPath: l2 } = t3;
if (bp.equals(u2, l2)) return [];
var c2 = [], d2 = [];
for (var f2 of bp.ancestors(u2)) {
var p2 = bp.transform(f2, t3);
c2.push(p2);
}
for (var h2 of bp.ancestors(l2)) {
var g2 = bp.transform(h2, t3);
d2.push(g2);
}
var v2 = d2[d2.length - 1], m2 = l2[l2.length - 1], y2 = v2.concat(m2);
return [...c2, ...d2, y2];
case "remove_node":
var { path: b2 } = t3;
return [...bp.ancestors(b2)];
case "split_node":
var { path: E2 } = t3;
return [...bp.levels(E2), bp.next(E2)];
default:
return [];
}
})(e5, ...n2);
}, shouldNormalize: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var { iteration: n3, initialDirtyPathsLength: r3 } = t3, o2 = 42 * r3;
if (n3 > o2) throw new Error("Could not completely normalize the editor after ".concat(o2, " iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));
return true;
})(e5, ...n2);
}, above: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { voids: n3 = false, mode: r3 = "lowest", at: o2 = e6.selection, match: i2 } = t3;
if (o2) {
var a2 = hh.path(e6, o2);
if (!gh.isRange(o2) || bp.equals(o2.focus.path, o2.anchor.path)) {
if (0 === a2.length) return;
a2 = bp.parent(a2);
}
var s2 = "lowest" === r3, [u2] = hh.levels(e6, { at: a2, voids: n3, match: i2, reverse: s2 });
return u2;
}
})(e5, ...n2);
}, after: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3, r3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, o2 = { anchor: hh.point(e6, t3, { edge: "end" }), focus: hh.end(e6, []) }, { distance: i2 = 1 } = r3, a2 = 0;
for (var s2 of hh.positions(e6, Yh(Yh({}, r3), {}, { at: o2 }))) {
if (a2 > i2) break;
0 !== a2 && (n3 = s2), a2++;
}
return n3;
})(e5, ...n2);
}, before: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3, r3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, o2 = { anchor: hh.start(e6, []), focus: hh.point(e6, t3, { edge: "start" }) }, { distance: i2 = 1 } = r3, a2 = 0;
for (var s2 of hh.positions(e6, Zh(Zh({}, r3), {}, { at: o2, reverse: true }))) {
if (a2 > i2) break;
0 !== a2 && (n3 = s2), a2++;
}
return n3;
})(e5, ...n2);
}, collapse: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { edge: n3 = "anchor" } = t3, { selection: r3 } = e6;
if (r3) {
if ("anchor" === n3) $h.select(e6, r3.anchor);
else if ("focus" === n3) $h.select(e6, r3.focus);
else if ("start" === n3) {
var [o2] = xp.edges(r3);
$h.select(e6, o2);
} else if ("end" === n3) {
var [, i2] = xp.edges(r3);
$h.select(e6, i2);
}
}
})(e5, ...n2);
}, delete: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
hh.withoutNormalizing(e6, () => {
var n3, r3, { reverse: o2 = false, unit: i2 = "character", distance: a2 = 1, voids: s2 = false } = t3, { at: u2 = e6.selection, hanging: l2 = false } = t3;
if (u2) {
var c2 = false;
if (gh.isRange(u2) && xp.isCollapsed(u2) && (c2 = true, u2 = u2.anchor), gh.isPoint(u2)) {
var d2 = hh.void(e6, { at: u2, mode: "highest" });
if (!s2 && d2) {
var [, f2] = d2;
u2 = f2;
} else {
var p2 = { unit: i2, distance: a2 };
u2 = { anchor: u2, focus: o2 ? hh.before(e6, u2, p2) || hh.start(e6, []) : hh.after(e6, u2, p2) || hh.end(e6, []) }, l2 = true;
}
}
if (gh.isPath(u2)) $h.removeNodes(e6, { at: u2, voids: s2 });
else if (!xp.isCollapsed(u2)) {
if (!l2) {
var [, h2] = xp.edges(u2), g2 = hh.end(e6, []);
yh.equals(h2, g2) || (u2 = hh.unhangRange(e6, u2, { voids: s2 }));
}
var [v2, m2] = xp.edges(u2), y2 = hh.above(e6, { match: (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4), at: v2, voids: s2 }), b2 = hh.above(e6, { match: (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4), at: m2, voids: s2 }), E2 = y2 && b2 && !bp.equals(y2[1], b2[1]), w2 = bp.equals(v2.path, m2.path), C2 = s2 ? null : null !== (n3 = hh.void(e6, { at: v2, mode: "highest" })) && void 0 !== n3 ? n3 : hh.elementReadOnly(e6, { at: v2, mode: "highest" }), D2 = s2 ? null : null !== (r3 = hh.void(e6, { at: m2, mode: "highest" })) && void 0 !== r3 ? r3 : hh.elementReadOnly(e6, { at: m2, mode: "highest" });
if (C2) {
var A2 = hh.before(e6, v2);
A2 && y2 && bp.isAncestor(y2[1], A2.path) && (v2 = A2);
}
if (D2) {
var S2 = hh.after(e6, m2);
S2 && b2 && bp.isAncestor(b2[1], S2.path) && (m2 = S2);
}
var x2, O2 = [];
for (var N2 of hh.nodes(e6, { at: u2, voids: s2 })) {
var [B2, T2] = N2;
x2 && 0 === bp.compare(T2, x2) || (!s2 && Pp.isElement(B2) && (hh.isVoid(e6, B2) || hh.isElementReadOnly(e6, B2)) || !bp.isCommon(T2, v2.path) && !bp.isCommon(T2, m2.path)) && (O2.push(N2), x2 = T2);
}
var k2 = Array.from(O2, (t4) => {
var [, n4] = t4;
return hh.pathRef(e6, n4);
}), F2 = hh.pointRef(e6, v2), P2 = hh.pointRef(e6, m2), I2 = "";
if (!w2 && !C2) {
var R2 = F2.current, [_2] = hh.leaf(e6, R2), { path: L2 } = R2, { offset: M2 } = v2, j2 = _2.text.slice(M2);
j2.length > 0 && (e6.apply({ type: "remove_text", path: L2, offset: M2, text: j2 }), I2 = j2);
}
if (k2.reverse().map((e7) => e7.unref()).filter((e7) => null !== e7).forEach((t4) => $h.removeNodes(e6, { at: t4, voids: s2 })), !D2) {
var H2 = P2.current, [z2] = hh.leaf(e6, H2), { path: $2 } = H2, U2 = w2 ? v2.offset : 0, V2 = z2.text.slice(U2, m2.offset);
V2.length > 0 && (e6.apply({ type: "remove_text", path: $2, offset: U2, text: V2 }), I2 = V2);
}
!w2 && E2 && P2.current && F2.current && $h.mergeNodes(e6, { at: P2.current, hanging: true, voids: s2 }), c2 && o2 && "character" === i2 && I2.length > 1 && I2.match(/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/) && $h.insertText(e6, I2.slice(0, I2.length - a2));
var W2 = F2.unref(), G2 = P2.unref(), q2 = o2 ? W2 || G2 : G2 || W2;
null == t3.at && q2 && $h.select(e6, q2);
}
}
});
})(e5, ...n2);
}, deselect: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6) => {
var { selection: t3 } = e6;
t3 && e6.apply({ type: "set_selection", properties: t3, newProperties: null });
})(e5, ...n2);
}, edges: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => [hh.start(e6, t3), hh.end(e6, t3)])(e5, ...n2);
}, elementReadOnly: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return hh.above(e6, Qh(Qh({}, t3), {}, { match: (t4) => Pp.isElement(t4) && hh.isElementReadOnly(e6, t4) }));
})(e5, ...n2);
}, end: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => hh.point(e6, t3, { edge: "end" }))(e5, ...n2);
}, first: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var n3 = hh.path(e6, t3, { edge: "start" });
return hh.node(e6, n3);
})(e5, ...n2);
}, fragment: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var n3 = hh.range(e6, t3);
return Pp.fragment(e6, n3);
})(e5, ...n2);
}, getMarks: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var { marks: t3, selection: n3 } = e6;
if (!n3) return null;
var { anchor: r3, focus: o2 } = n3;
if (t3) return t3;
if (xp.isExpanded(n3)) {
if (xp.isBackward(n3) && ([o2, r3] = [r3, o2]), hh.isEnd(e6, r3, r3.path)) {
var i2 = hh.after(e6, r3);
i2 && (r3 = i2);
}
var [a2] = hh.nodes(e6, { match: Pp.isText, at: { anchor: r3, focus: o2 } });
if (a2) {
var [s2] = a2;
return Dp(s2, og);
}
return {};
}
var { path: u2 } = r3, [l2] = hh.leaf(e6, u2);
if (0 === r3.offset) {
var c2 = hh.previous(e6, { at: u2, match: Pp.isText }), d2 = hh.above(e6, { match: (t4) => Pp.isElement(t4) && hh.isVoid(e6, t4) && e6.markableVoid(t4) });
if (!d2) {
var f2 = hh.above(e6, { match: (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4) });
if (c2 && f2) {
var [p2, h2] = c2, [, g2] = f2;
bp.isAncestor(g2, h2) && (l2 = p2);
}
}
}
return Dp(l2, ig);
})(e5, ...n2);
}, hasBlocks: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => t3.children.some((t4) => Pp.isElement(t4) && hh.isBlock(e6, t4)))(e5, ...n2);
}, hasInlines: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => t3.children.some((t4) => Pp.isText(t4) || hh.isInline(e6, t4)))(e5, ...n2);
}, hasPath: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => Pp.has(e6, t3))(e5, ...n2);
}, hasTexts: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => t3.children.every((e7) => Pp.isText(e7)))(e5, ...n2);
}, insertNodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return fg(e5, ...n2);
}, isBlock: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => !e6.isInline(t3))(e5, ...n2);
}, isEdge: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3, n3) => hh.isStart(e6, t3, n3) || hh.isEnd(e6, t3, n3))(e5, ...n2);
}, isEmpty: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var { children: n3 } = t3, [r3] = n3;
return 0 === n3.length || 1 === n3.length && Pp.isText(r3) && "" === r3.text && !e6.isVoid(t3);
})(e5, ...n2);
}, isEnd: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3, n3) => {
var r3 = hh.end(e6, n3);
return yh.equals(t3, r3);
})(e5, ...n2);
}, isNormalizing: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6) => {
var t3 = gp.get(e6);
return void 0 === t3 || t3;
})(e5, ...n2);
}, isStart: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3, n3) => {
if (0 !== t3.offset) return false;
var r3 = hh.start(e6, n3);
return yh.equals(t3, r3);
})(e5, ...n2);
}, last: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var n3 = hh.path(e6, t3, { edge: "end" });
return hh.node(e6, n3);
})(e5, ...n2);
}, leaf: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r3 = hh.path(e6, t3, n3);
return [Pp.leaf(e6, r3), r3];
})(e5, ...n2);
}, levels: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return (function* () {
var { at: n3 = e6.selection, reverse: r3 = false, voids: o2 = false } = t3, { match: i2 } = t3;
if (null == i2 && (i2 = () => true), n3) {
var a2 = [], s2 = hh.path(e6, n3);
for (var [u2, l2] of Pp.levels(e6, s2)) if (i2(u2, l2) && (a2.push([u2, l2]), !o2 && Pp.isElement(u2) && hh.isVoid(e6, u2))) break;
r3 && a2.reverse(), yield* a2;
}
})();
})(e5, ...n2);
}, liftNodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
hh.withoutNormalizing(e6, () => {
var { at: n3 = e6.selection, mode: r3 = "lowest", voids: o2 = false } = t3, { match: i2 } = t3;
if (n3) {
null == i2 && (i2 = gh.isPath(n3) ? zp(e6, n3) : (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4));
var a2 = hh.nodes(e6, { at: n3, match: i2, mode: r3, voids: o2 }), s2 = Array.from(a2, (t4) => {
var [, n4] = t4;
return hh.pathRef(e6, n4);
});
for (var u2 of s2) {
var l2 = u2.unref();
if (l2.length < 2) throw new Error("Cannot lift node at a path [".concat(l2, "] because it has a depth of less than `2`."));
var c2 = hh.node(e6, bp.parent(l2)), [d2, f2] = c2, p2 = l2[l2.length - 1], { length: h2 } = d2.children;
if (1 === h2) {
var g2 = bp.next(f2);
$h.moveNodes(e6, { at: l2, to: g2, voids: o2 }), $h.removeNodes(e6, { at: f2, voids: o2 });
} else if (0 === p2) $h.moveNodes(e6, { at: l2, to: f2, voids: o2 });
else if (p2 === h2 - 1) {
var v2 = bp.next(f2);
$h.moveNodes(e6, { at: l2, to: v2, voids: o2 });
} else {
var m2 = bp.next(l2), y2 = bp.next(f2);
$h.splitNodes(e6, { at: m2, voids: o2 }), $h.moveNodes(e6, { at: l2, to: y2, voids: o2 });
}
}
}
});
})(e5, ...n2);
}, mergeNodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
hh.withoutNormalizing(e6, () => {
var { match: n3, at: r3 = e6.selection } = t3, { hanging: o2 = false, voids: i2 = false, mode: a2 = "lowest" } = t3;
if (r3) {
if (null == n3) if (gh.isPath(r3)) {
var [s2] = hh.parent(e6, r3);
n3 = (e7) => s2.children.includes(e7);
} else n3 = (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4);
if (!o2 && gh.isRange(r3) && (r3 = hh.unhangRange(e6, r3, { voids: i2 })), gh.isRange(r3)) if (xp.isCollapsed(r3)) r3 = r3.anchor;
else {
var [, u2] = xp.edges(r3), l2 = hh.pointRef(e6, u2);
$h.delete(e6, { at: r3 }), r3 = l2.unref(), null == t3.at && $h.select(e6, r3);
}
var [c2] = hh.nodes(e6, { at: r3, match: n3, voids: i2, mode: a2 }), d2 = hh.previous(e6, { at: r3, match: n3, voids: i2, mode: a2 });
if (c2 && d2) {
var [f2, p2] = c2, [h2, g2] = d2;
if (0 !== p2.length && 0 !== g2.length) {
var v2, m2, y2 = bp.next(g2), b2 = bp.common(p2, g2), E2 = bp.isSibling(p2, g2), w2 = Array.from(hh.levels(e6, { at: p2 }), (e7) => {
var [t4] = e7;
return t4;
}).slice(b2.length).slice(0, -1), C2 = hh.above(e6, { at: p2, mode: "highest", match: (t4) => w2.includes(t4) && gg(e6, t4) }), D2 = C2 && hh.pathRef(e6, C2[1]);
if (Pp.isText(f2) && Pp.isText(h2)) {
var A2 = Dp(f2, pg);
m2 = h2.text.length, v2 = A2;
} else {
if (!Pp.isElement(f2) || !Pp.isElement(h2)) throw new Error("Cannot merge the node at path [".concat(p2, "] with the previous sibling because it is not the same kind: ").concat(Eh.stringify(f2), " ").concat(Eh.stringify(h2)));
A2 = Dp(f2, hg), m2 = h2.children.length, v2 = A2;
}
E2 || $h.moveNodes(e6, { at: p2, to: y2, voids: i2 }), D2 && $h.removeNodes(e6, { at: D2.current, voids: i2 }), hh.shouldMergeNodesRemovePrevNode(e6, d2, c2) ? $h.removeNodes(e6, { at: g2, voids: i2 }) : e6.apply({ type: "merge_node", path: y2, position: m2, properties: v2 }), D2 && D2.unref();
}
}
}
});
})(e5, ...n2);
}, move: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { selection: n3 } = e6, { distance: r3 = 1, unit: o2 = "character", reverse: i2 = false } = t3, { edge: a2 = null } = t3;
if (n3) {
"start" === a2 && (a2 = xp.isBackward(n3) ? "focus" : "anchor"), "end" === a2 && (a2 = xp.isBackward(n3) ? "anchor" : "focus");
var { anchor: s2, focus: u2 } = n3, l2 = { distance: r3, unit: o2 }, c2 = {};
if (null == a2 || "anchor" === a2) {
var d2 = i2 ? hh.before(e6, s2, l2) : hh.after(e6, s2, l2);
d2 && (c2.anchor = d2);
}
if (null == a2 || "focus" === a2) {
var f2 = i2 ? hh.before(e6, u2, l2) : hh.after(e6, u2, l2);
f2 && (c2.focus = f2);
}
$h.setSelection(e6, c2);
}
})(e5, ...n2);
}, moveNodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
hh.withoutNormalizing(e6, () => {
var { to: n3, at: r3 = e6.selection, mode: o2 = "lowest", voids: i2 = false } = t3, { match: a2 } = t3;
if (r3) {
null == a2 && (a2 = gh.isPath(r3) ? zp(e6, r3) : (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4));
var s2 = hh.pathRef(e6, n3), u2 = hh.nodes(e6, { at: r3, match: a2, mode: o2, voids: i2 }), l2 = Array.from(u2, (t4) => {
var [, n4] = t4;
return hh.pathRef(e6, n4);
});
for (var c2 of l2) {
var d2 = c2.unref(), f2 = s2.current;
0 !== d2.length && e6.apply({ type: "move_node", path: d2, newPath: f2 }), s2.current && bp.isSibling(f2, d2) && bp.isAfter(f2, d2) && (s2.current = bp.next(s2.current));
}
s2.unref();
}
});
})(e5, ...n2);
}, next: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { mode: n3 = "lowest", voids: r3 = false } = t3, { match: o2, at: i2 = e6.selection } = t3;
if (i2) {
var a2 = hh.after(e6, i2, { voids: r3 });
if (a2) {
var [, s2] = hh.last(e6, []), u2 = [a2.path, s2];
if (gh.isPath(i2) && 0 === i2.length) throw new Error("Cannot get the next node from the root node!");
if (null == o2) if (gh.isPath(i2)) {
var [l2] = hh.parent(e6, i2);
o2 = (e7) => l2.children.includes(e7);
} else o2 = () => true;
var [c2] = hh.nodes(e6, { at: u2, match: o2, mode: n3, voids: r3 });
return c2;
}
}
})(e5, ...n2);
}, node: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r3 = hh.path(e6, t3, n3), o2 = Pp.get(e6, r3);
return [o2, r3];
})(e5, ...n2);
}, nodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return (function* () {
var { at: n3 = e6.selection, mode: r3 = "all", universal: o2 = false, reverse: i2 = false, voids: a2 = false, pass: s2 } = t3, { match: u2 } = t3;
if (u2 || (u2 = () => true), n3) {
var l2, c2;
if (gh.isSpan(n3)) l2 = n3[0], c2 = n3[1];
else {
var d2 = hh.path(e6, n3, { edge: "start" }), f2 = hh.path(e6, n3, { edge: "end" });
l2 = i2 ? f2 : d2, c2 = i2 ? d2 : f2;
}
var p2, h2 = Pp.nodes(e6, { reverse: i2, from: l2, to: c2, pass: (t4) => {
var [n4, r4] = t4;
return !(!s2 || !s2([n4, r4])) || !!Pp.isElement(n4) && !(a2 || !hh.isVoid(e6, n4) && !hh.isElementReadOnly(e6, n4));
} }), g2 = [];
for (var [v2, m2] of h2) {
var y2 = p2 && 0 === bp.compare(m2, p2[1]);
if ("highest" !== r3 || !y2) {
if (u2(v2, m2)) if ("lowest" === r3 && y2) p2 = [v2, m2];
else {
var b2 = "lowest" === r3 ? p2 : [v2, m2];
b2 && (o2 ? g2.push(b2) : yield b2), p2 = [v2, m2];
}
else if (o2 && !y2 && Pp.isText(v2)) return;
}
}
"lowest" === r3 && p2 && (o2 ? g2.push(p2) : yield p2), o2 && (yield* g2);
}
})();
})(e5, ...n2);
}, normalize: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ag(e5, ...n2);
}, parent: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r3 = hh.path(e6, t3, n3), o2 = bp.parent(r3);
return hh.node(e6, o2);
})(e5, ...n2);
}, path: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { depth: r3, edge: o2 } = n3;
if (gh.isPath(t3)) {
if ("start" === o2) {
var [, i2] = Pp.first(e6, t3);
t3 = i2;
} else if ("end" === o2) {
var [, a2] = Pp.last(e6, t3);
t3 = a2;
}
}
return gh.isRange(t3) && (t3 = "start" === o2 ? xp.start(t3) : "end" === o2 ? xp.end(t3) : bp.common(t3.anchor.path, t3.focus.path)), gh.isPoint(t3) && (t3 = t3.path), null != r3 && (t3 = t3.slice(0, r3)), t3;
})(e5, ...n2);
}, pathRef: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { affinity: r3 = "forward" } = n3, o2 = { current: t3, affinity: r3, unref() {
var { current: t4 } = o2;
return hh.pathRefs(e6).delete(o2), o2.current = null, t4;
} };
return hh.pathRefs(e6).add(o2), o2;
})(e5, ...n2);
}, pathRefs: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6) => {
var t3 = vp.get(e6);
return t3 || (t3 = /* @__PURE__ */ new Set(), vp.set(e6, t3)), t3;
})(e5, ...n2);
}, point: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { edge: r3 = "start" } = n3;
if (gh.isPath(t3)) {
var o2;
if ("end" === r3) {
var [, i2] = Pp.last(e6, t3);
o2 = i2;
} else {
var [, a2] = Pp.first(e6, t3);
o2 = a2;
}
var s2 = Pp.get(e6, o2);
if (!Pp.isText(s2)) throw new Error("Cannot get the ".concat(r3, " point in the node at path [").concat(t3, "] because it has no ").concat(r3, " text node."));
return { path: o2, offset: "end" === r3 ? s2.text.length : 0 };
}
if (gh.isRange(t3)) {
var [u2, l2] = xp.edges(t3);
return "start" === r3 ? u2 : l2;
}
return t3;
})(e5, ...n2);
}, pointRef: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { affinity: r3 = "forward" } = n3, o2 = { current: t3, affinity: r3, unref() {
var { current: t4 } = o2;
return hh.pointRefs(e6).delete(o2), o2.current = null, t4;
} };
return hh.pointRefs(e6).add(o2), o2;
})(e5, ...n2);
}, pointRefs: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6) => {
var t3 = mp.get(e6);
return t3 || (t3 = /* @__PURE__ */ new Set(), mp.set(e6, t3)), t3;
})(e5, ...n2);
}, positions: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return sg(e5, ...n2);
}, previous: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, { mode: n3 = "lowest", voids: r3 = false } = t3, { match: o2, at: i2 = e6.selection } = t3;
if (i2) {
var a2 = hh.before(e6, i2, { voids: r3 });
if (a2) {
var [, s2] = hh.first(e6, []), u2 = [a2.path, s2];
if (gh.isPath(i2) && 0 === i2.length) throw new Error("Cannot get the previous node from the root node!");
if (null == o2) if (gh.isPath(i2)) {
var [l2] = hh.parent(e6, i2);
o2 = (e7) => l2.children.includes(e7);
} else o2 = () => true;
var [c2] = hh.nodes(e6, { reverse: true, at: u2, match: o2, mode: n3, voids: r3 });
return c2;
}
}
})(e5, ...n2);
}, range: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3, n3) => gh.isRange(t3) && !n3 ? t3 : { anchor: hh.start(e6, t3), focus: hh.end(e6, n3 || t3) })(e5, ...n2);
}, rangeRef: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { affinity: r3 = "forward" } = n3, o2 = { current: t3, affinity: r3, unref() {
var { current: t4 } = o2;
return hh.rangeRefs(e6).delete(o2), o2.current = null, t4;
} };
return hh.rangeRefs(e6).add(o2), o2;
})(e5, ...n2);
}, rangeRefs: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6) => {
var t3 = yp.get(e6);
return t3 || (t3 = /* @__PURE__ */ new Set(), yp.set(e6, t3)), t3;
})(e5, ...n2);
}, removeNodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
hh.withoutNormalizing(e6, () => {
var { hanging: n3 = false, voids: r3 = false, mode: o2 = "lowest" } = t3, { at: i2 = e6.selection, match: a2 } = t3;
if (i2) {
null == a2 && (a2 = gh.isPath(i2) ? zp(e6, i2) : (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4)), !n3 && gh.isRange(i2) && (i2 = hh.unhangRange(e6, i2, { voids: r3 }));
var s2 = hh.nodes(e6, { at: i2, match: a2, mode: o2, voids: r3 }), u2 = Array.from(s2, (t4) => {
var [, n4] = t4;
return hh.pathRef(e6, n4);
});
for (var l2 of u2) {
var c2 = l2.unref();
if (c2) {
var [d2] = hh.node(e6, c2);
e6.apply({ type: "remove_node", path: c2, node: d2 });
}
}
}
});
})(e5, ...n2);
}, select: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var { selection: n3 } = e6;
if (t3 = hh.range(e6, t3), n3) $h.setSelection(e6, t3);
else {
if (!gh.isRange(t3)) throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Eh.stringify(t3)));
e6.apply({ type: "set_selection", properties: n3, newProperties: t3 });
}
})(e5, ...n2);
}, setNodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
hh.withoutNormalizing(e6, () => {
var { match: r3, at: o2 = e6.selection, compare: i2, merge: a2 } = n3, { hanging: s2 = false, mode: u2 = "lowest", split: l2 = false, voids: c2 = false } = n3;
if (o2) {
if (null == r3 && (r3 = gh.isPath(o2) ? zp(e6, o2) : (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4)), !s2 && gh.isRange(o2) && (o2 = hh.unhangRange(e6, o2, { voids: c2 })), l2 && gh.isRange(o2)) {
if (xp.isCollapsed(o2) && hh.leaf(e6, o2.anchor)[0].text.length > 0) return;
var d2 = hh.rangeRef(e6, o2, { affinity: "inward" }), [f2, p2] = xp.edges(o2), h2 = "lowest" === u2 ? "lowest" : "highest", g2 = hh.isEnd(e6, p2, p2.path);
$h.splitNodes(e6, { at: p2, match: r3, mode: h2, voids: c2, always: !g2 });
var v2 = hh.isStart(e6, f2, f2.path);
$h.splitNodes(e6, { at: f2, match: r3, mode: h2, voids: c2, always: !v2 }), o2 = d2.unref(), null == n3.at && $h.select(e6, o2);
}
for (var [m2, y2] of (i2 || (i2 = (e7, t4) => e7 !== t4), hh.nodes(e6, { at: o2, match: r3, mode: u2, voids: c2 }))) {
var b2 = {}, E2 = {};
if (0 !== y2.length) {
var w2 = false;
for (var C2 in t3) "children" !== C2 && "text" !== C2 && i2(t3[C2], m2[C2]) && (w2 = true, m2.hasOwnProperty(C2) && (b2[C2] = m2[C2]), a2 ? null != t3[C2] && (E2[C2] = a2(m2[C2], t3[C2])) : null != t3[C2] && (E2[C2] = t3[C2]));
w2 && e6.apply({ type: "set_node", path: y2, properties: b2, newProperties: E2 });
}
}
}
});
})(e5, ...n2);
}, setNormalizing: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
gp.set(e6, t3);
})(e5, ...n2);
}, setPoint: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { selection: r3 } = e6, { edge: o2 = "both" } = n3;
if (r3) {
"start" === o2 && (o2 = xp.isBackward(r3) ? "focus" : "anchor"), "end" === o2 && (o2 = xp.isBackward(r3) ? "anchor" : "focus");
var { anchor: i2, focus: a2 } = r3, s2 = "anchor" === o2 ? i2 : a2;
$h.setSelection(e6, { ["anchor" === o2 ? "anchor" : "focus"]: dg(dg({}, s2), t3) });
}
})(e5, ...n2);
}, setSelection: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var { selection: n3 } = e6, r3 = {}, o2 = {};
if (n3) {
for (var i2 in t3) ("anchor" === i2 && null != t3.anchor && !yh.equals(t3.anchor, n3.anchor) || "focus" === i2 && null != t3.focus && !yh.equals(t3.focus, n3.focus) || "anchor" !== i2 && "focus" !== i2 && t3[i2] !== n3[i2]) && (r3[i2] = n3[i2], o2[i2] = t3[i2]);
Object.keys(r3).length > 0 && e6.apply({ type: "set_selection", properties: r3, newProperties: o2 });
}
})(e5, ...n2);
}, splitNodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return vg(e5, ...n2);
}, start: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => hh.point(e6, t3, { edge: "start" }))(e5, ...n2);
}, string: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { voids: r3 = false } = n3, o2 = hh.range(e6, t3), [i2, a2] = xp.edges(o2), s2 = "";
for (var [u2, l2] of hh.nodes(e6, { at: o2, match: Pp.isText, voids: r3 })) {
var c2 = u2.text;
bp.equals(l2, a2.path) && (c2 = c2.slice(0, a2.offset)), bp.equals(l2, i2.path) && (c2 = c2.slice(i2.offset)), s2 += c2;
}
return s2;
})(e5, ...n2);
}, unhangRange: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, { voids: r3 = false } = n3, [o2, i2] = xp.edges(t3);
if (0 !== o2.offset || 0 !== i2.offset || xp.isCollapsed(t3) || bp.hasPrevious(i2.path)) return t3;
var a2 = hh.above(e6, { at: i2, match: (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4), voids: r3 }), s2 = a2 ? a2[1] : [], u2 = { anchor: hh.start(e6, o2), focus: i2 }, l2 = true;
for (var [c2, d2] of hh.nodes(e6, { at: u2, match: Pp.isText, reverse: true, voids: r3 })) if (l2) l2 = false;
else if ("" !== c2.text || bp.isBefore(d2, s2)) {
i2 = { path: d2, offset: c2.text.length };
break;
}
return { anchor: o2, focus: i2 };
})(e5, ...n2);
}, unsetNodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
Array.isArray(t3) || (t3 = [t3]);
var r3 = {};
for (var o2 of t3) r3[o2] = null;
$h.setNodes(e6, r3, n3);
})(e5, ...n2);
}, unwrapNodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
hh.withoutNormalizing(e6, () => {
var { mode: n3 = "lowest", split: r3 = false, voids: o2 = false } = t3, { at: i2 = e6.selection, match: a2 } = t3;
if (i2) {
null == a2 && (a2 = gh.isPath(i2) ? zp(e6, i2) : (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4)), gh.isPath(i2) && (i2 = hh.range(e6, i2));
var s2 = gh.isRange(i2) ? hh.rangeRef(e6, i2) : null, u2 = hh.nodes(e6, { at: i2, match: a2, mode: n3, voids: o2 }), l2 = Array.from(u2, (t4) => {
var [, n4] = t4;
return hh.pathRef(e6, n4);
}).reverse(), c2 = function() {
var t4 = d2.unref(), [n4] = hh.node(e6, t4), i3 = hh.range(e6, t4);
r3 && s2 && (i3 = xp.intersection(s2.current, i3)), $h.liftNodes(e6, { at: i3, match: (e7) => !Pp.isText(n4) && n4.children.includes(e7), voids: o2 });
};
for (var d2 of l2) c2();
s2 && s2.unref();
}
});
})(e5, ...n2);
}, void: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return hh.above(e6, tg(tg({}, t3), {}, { match: (t4) => Pp.isElement(t4) && hh.isVoid(e6, t4) }));
})(e5, ...n2);
}, withoutNormalizing: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var n3 = hh.isNormalizing(e6);
hh.setNormalizing(e6, false);
try {
t3();
} finally {
hh.setNormalizing(e6, n3);
}
hh.normalize(e6);
})(e5, ...n2);
}, wrapNodes: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return (function(e6, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
hh.withoutNormalizing(e6, () => {
var { mode: r3 = "lowest", split: o2 = false, voids: i2 = false } = n3, { match: a2, at: s2 = e6.selection } = n3;
if (s2) {
if (null == a2 && (a2 = gh.isPath(s2) ? zp(e6, s2) : e6.isInline(t3) ? (t4) => Pp.isElement(t4) && hh.isInline(e6, t4) || Pp.isText(t4) : (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4)), o2 && gh.isRange(s2)) {
var [u2, l2] = xp.edges(s2), c2 = hh.rangeRef(e6, s2, { affinity: "inward" }), d2 = (t4) => {
var n4 = hh.above(e6, { at: t4, match: (t5) => Pp.isElement(t5) && hh.isBlock(e6, t5) });
return n4 && hh.isEdge(e6, t4, n4[1]);
};
$h.splitNodes(e6, { at: l2, match: a2, voids: i2, always: !d2(l2) }), $h.splitNodes(e6, { at: u2, match: a2, voids: i2, always: !d2(u2) }), s2 = c2.unref(), null == n3.at && $h.select(e6, s2);
}
var f2 = Array.from(hh.nodes(e6, { at: s2, match: e6.isInline(t3) ? (t4) => Pp.isElement(t4) && hh.isBlock(e6, t4) : (e7) => Pp.isEditor(e7), mode: "lowest", voids: i2 })), p2 = function() {
var n4 = gh.isRange(s2) ? xp.intersection(s2, hh.range(e6, h2)) : s2;
if (!n4) return 0;
var o3 = Array.from(hh.nodes(e6, { at: n4, match: a2, mode: r3, voids: i2 }));
if (o3.length > 0) {
var [u3] = o3, l3 = o3[o3.length - 1], [, c3] = u3, [, d3] = l3;
if (0 === c3.length && 0 === d3.length) return 0;
var f3 = bp.equals(c3, d3) ? bp.parent(c3) : bp.common(c3, d3), p3 = hh.range(e6, c3, d3), g2 = hh.node(e6, f3), [v2] = g2, m2 = f3.length + 1, y2 = bp.next(d3.slice(0, m2)), b2 = yg(yg({}, t3), {}, { children: [] });
$h.insertNodes(e6, b2, { at: y2, voids: i2 }), $h.moveNodes(e6, { at: p3, match: (e7) => !Pp.isText(v2) && v2.children.includes(e7), to: y2.concat(0), voids: i2 });
}
};
for (var [, h2] of f2) p2();
}
});
})(e5, ...n2);
}, shouldMergeNodesRemovePrevNode: function() {
for (var t2 = arguments.length, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) n2[r2] = arguments[r2];
return ((e6, t3) => {
var [n3, r3] = t3;
return Pp.isElement(n3) && hh.isEmpty(e6, n3) || Pp.isText(n3) && "" === n3.text && 0 !== r3[r3.length - 1];
})(e5, ...n2);
} };
return e5;
}, Eg = { isHistory: (e5) => Mp(e5) && Array.isArray(e5.redos) && Array.isArray(e5.undos) && (0 === e5.redos.length || Lp.isOperationList(e5.redos[0].operations)) && (0 === e5.undos.length || Lp.isOperationList(e5.undos[0].operations)) }, wg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), Dg = /* @__PURE__ */ new WeakMap(), Ag = { isHistoryEditor: (e5) => Eg.isHistory(e5.history) && hh.isEditor(e5), isMerging: (e5) => Cg.get(e5), isSplittingOnce: (e5) => Dg.get(e5), setSplittingOnce(e5, t2) {
Dg.set(e5, t2);
}, isSaving: (e5) => wg.get(e5), redo(e5) {
e5.redo();
}, undo(e5) {
e5.undo();
}, withMerging(e5, t2) {
var n2 = Ag.isMerging(e5);
Cg.set(e5, true), t2(), Cg.set(e5, n2);
}, withNewBatch(e5, t2) {
var n2 = Ag.isMerging(e5);
Cg.set(e5, true), Dg.set(e5, true), t2(), Cg.set(e5, n2), Dg.delete(e5);
}, withoutMerging(e5, t2) {
var n2 = Ag.isMerging(e5);
Cg.set(e5, false), t2(), Cg.set(e5, n2);
}, withoutSaving(e5, t2) {
var n2 = Ag.isSaving(e5);
wg.set(e5, false);
try {
t2();
} finally {
wg.set(e5, n2);
}
} }, Sg = (e5) => {
var t2 = e5, { apply: n2 } = t2;
return t2.history = { undos: [], redos: [] }, t2.redo = () => {
var { history: e6 } = t2, { redos: n3 } = e6;
if (n3.length > 0) {
var r2 = n3[n3.length - 1];
r2.selectionBefore && $h.setSelection(t2, r2.selectionBefore), Ag.withoutSaving(t2, () => {
hh.withoutNormalizing(t2, () => {
for (var e7 of r2.operations) t2.apply(e7);
});
}), e6.redos.pop(), t2.writeHistory("undos", r2);
}
}, t2.undo = () => {
var { history: e6 } = t2, { undos: n3 } = e6;
if (n3.length > 0) {
var r2 = n3[n3.length - 1];
Ag.withoutSaving(t2, () => {
hh.withoutNormalizing(t2, () => {
var e7 = r2.operations.map(Lp.inverse).reverse();
for (var n4 of e7) t2.apply(n4);
r2.selectionBefore && $h.setSelection(t2, r2.selectionBefore);
});
}), t2.writeHistory("redos", r2), e6.undos.pop();
}
}, t2.apply = (e6) => {
var { operations: r2, history: o2 } = t2, { undos: i2 } = o2, a2 = i2[i2.length - 1], s2 = a2 && a2.operations[a2.operations.length - 1], u2 = Ag.isSaving(t2), l2 = Ag.isMerging(t2);
if (null == u2 && (u2 = Og(e6)), u2) {
if (null == l2 && (l2 = null != a2 && (!!r2.includes(s2) || xg(e6, s2))), Ag.isSplittingOnce(t2) && (l2 = false, Ag.setSplittingOnce(t2, void 0)), a2 && l2) a2.operations.push(e6);
else {
var c2 = { operations: [e6], selectionBefore: t2.selection };
t2.writeHistory("undos", c2);
}
for (; i2.length > 100; ) i2.shift();
o2.redos = [];
}
n2(e6);
}, t2.writeHistory = (e6, n3) => {
t2.history[e6].push(n3);
}, t2;
}, xg = (e5, t2) => !(!t2 || "insert_text" !== e5.type || "insert_text" !== t2.type || e5.offset !== t2.offset + t2.text.length || !bp.equals(e5.path, t2.path)) || !(!t2 || "remove_text" !== e5.type || "remove_text" !== t2.type || e5.offset + e5.text.length !== t2.offset || !bp.equals(e5.path, t2.path)), Og = (e5, t2) => "set_selection" !== e5.type, Ng = function(e5, t2) {
return Ng = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e6, t3) {
e6.__proto__ = t3;
} || function(e6, t3) {
for (var n2 in t3) Object.prototype.hasOwnProperty.call(t3, n2) && (e6[n2] = t3[n2]);
}, Ng(e5, t2);
};
function Bg(e5, t2) {
if ("function" != typeof t2 && null !== t2) throw new TypeError("Class extends value " + String(t2) + " is not a constructor or null");
function n2() {
this.constructor = e5;
}
Ng(e5, t2), e5.prototype = null === t2 ? Object.create(t2) : (n2.prototype = t2.prototype, new n2());
}
var Tg = function() {
return Tg = Object.assign || function(e5) {
for (var t2, n2 = 1, r2 = arguments.length; n2 < r2; n2++) for (var o2 in t2 = arguments[n2]) Object.prototype.hasOwnProperty.call(t2, o2) && (e5[o2] = t2[o2]);
return e5;
}, Tg.apply(this, arguments);
};
function kg(e5, t2, n2, r2) {
return new (n2 || (n2 = Promise))(function(o2, i2) {
function a2(e6) {
try {
u2(r2.next(e6));
} catch (e7) {
i2(e7);
}
}
function s2(e6) {
try {
u2(r2.throw(e6));
} catch (e7) {
i2(e7);
}
}
function u2(e6) {
var t3;
e6.done ? o2(e6.value) : (t3 = e6.value, t3 instanceof n2 ? t3 : new n2(function(e7) {
e7(t3);
})).then(a2, s2);
}
u2((r2 = r2.apply(e5, t2 || [])).next());
});
}
function Fg(e5, t2) {
var n2, r2, o2, i2 = { label: 0, sent: function() {
if (1 & o2[0]) throw o2[1];
return o2[1];
}, trys: [], ops: [] }, a2 = Object.create(("function" == typeof Iterator ? Iterator : Object).prototype);
return a2.next = s2(0), a2.throw = s2(1), a2.return = s2(2), "function" == typeof Symbol && (a2[Symbol.iterator] = function() {
return this;
}), a2;
function s2(s3) {
return function(u2) {
return (function(s4) {
if (n2) throw new TypeError("Generator is already executing.");
for (; a2 && (a2 = 0, s4[0] && (i2 = 0)), i2; ) try {
if (n2 = 1, r2 && (o2 = 2 & s4[0] ? r2.return : s4[0] ? r2.throw || ((o2 = r2.return) && o2.call(r2), 0) : r2.next) && !(o2 = o2.call(r2, s4[1])).done) return o2;
switch (r2 = 0, o2 && (s4 = [2 & s4[0], o2.value]), s4[0]) {
case 0:
case 1:
o2 = s4;
break;
case 4:
return i2.label++, { value: s4[1], done: false };
case 5:
i2.label++, r2 = s4[1], s4 = [0];
continue;
case 7:
s4 = i2.ops.pop(), i2.trys.pop();
continue;
default:
if (!(o2 = i2.trys, (o2 = o2.length > 0 && o2[o2.length - 1]) || 6 !== s4[0] && 2 !== s4[0])) {
i2 = 0;
continue;
}
if (3 === s4[0] && (!o2 || s4[1] > o2[0] && s4[1] < o2[3])) {
i2.label = s4[1];
break;
}
if (6 === s4[0] && i2.label < o2[1]) {
i2.label = o2[1], o2 = s4;
break;
}
if (o2 && i2.label < o2[2]) {
i2.label = o2[2], i2.ops.push(s4);
break;
}
o2[2] && i2.ops.pop(), i2.trys.pop();
continue;
}
s4 = t2.call(e5, i2);
} catch (e6) {
s4 = [6, e6], r2 = 0;
} finally {
n2 = o2 = 0;
}
if (5 & s4[0]) throw s4[1];
return { value: s4[0] ? s4[1] : void 0, done: true };
})([s3, u2]);
};
}
}
function Pg(e5) {
var t2 = "function" == typeof Symbol && Symbol.iterator, n2 = t2 && e5[t2], r2 = 0;
if (n2) return n2.call(e5);
if (e5 && "number" == typeof e5.length) return { next: function() {
return e5 && r2 >= e5.length && (e5 = void 0), { value: e5 && e5[r2++], done: !e5 };
} };
throw new TypeError(t2 ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function Ig(e5, t2) {
var n2 = "function" == typeof Symbol && e5[Symbol.iterator];
if (!n2) return e5;
var r2, o2, i2 = n2.call(e5), a2 = [];
try {
for (; (void 0 === t2 || t2-- > 0) && !(r2 = i2.next()).done; ) a2.push(r2.value);
} catch (e6) {
o2 = { error: e6 };
} finally {
try {
r2 && !r2.done && (n2 = i2.return) && n2.call(i2);
} finally {
if (o2) throw o2.error;
}
}
return a2;
}
function Rg(e5, t2, n2) {
if (2 === arguments.length) for (var r2, o2 = 0, i2 = t2.length; o2 < i2; o2++) !r2 && o2 in t2 || (r2 || (r2 = Array.prototype.slice.call(t2, 0, o2)), r2[o2] = t2[o2]);
return e5.concat(r2 || Array.prototype.slice.call(t2));
}
function _g(e5) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var t2, n2 = e5[Symbol.asyncIterator];
return n2 ? n2.call(e5) : (e5 = Pg(e5), t2 = {}, r2("next"), r2("throw"), r2("return"), t2[Symbol.asyncIterator] = function() {
return this;
}, t2);
function r2(n3) {
t2[n3] = e5[n3] && function(t3) {
return new Promise(function(r3, o2) {
(function(e6, t4, n4, r4) {
Promise.resolve(r4).then(function(t5) {
e6({ value: t5, done: n4 });
}, t4);
})(r3, o2, (t3 = e5[n3](t3)).done, t3.value);
});
};
}
}
"function" == typeof SuppressedError && SuppressedError;
var Lg, Mg = { exports: {} };
var jg, Hg, zg = (Lg || (Lg = 1, (function(e5, t2) {
var n2 = "__lodash_hash_undefined__", r2 = 9007199254740991, o2 = "[object Arguments]", i2 = "[object Boolean]", a2 = "[object Date]", s2 = "[object Function]", u2 = "[object GeneratorFunction]", l2 = "[object Map]", c2 = "[object Number]", d2 = "[object Object]", f2 = "[object Promise]", p2 = "[object RegExp]", h2 = "[object Set]", g2 = "[object String]", v2 = "[object Symbol]", m2 = "[object WeakMap]", b2 = "[object ArrayBuffer]", E2 = "[object DataView]", w2 = "[object Float32Array]", C2 = "[object Float64Array]", D2 = "[object Int8Array]", A2 = "[object Int16Array]", S2 = "[object Int32Array]", x2 = "[object Uint8Array]", O2 = "[object Uint8ClampedArray]", N2 = "[object Uint16Array]", B2 = "[object Uint32Array]", T2 = /\w*$/, k2 = /^\[object .+?Constructor\]$/, F2 = /^(?:0|[1-9]\d*)$/, P2 = {};
P2[o2] = P2["[object Array]"] = P2[b2] = P2[E2] = P2[i2] = P2[a2] = P2[w2] = P2[C2] = P2[D2] = P2[A2] = P2[S2] = P2[l2] = P2[c2] = P2[d2] = P2[p2] = P2[h2] = P2[g2] = P2[v2] = P2[x2] = P2[O2] = P2[N2] = P2[B2] = true, P2["[object Error]"] = P2[s2] = P2[m2] = false;
var I2 = "object" == typeof y && y && y.Object === Object && y, R2 = "object" == typeof self && self && self.Object === Object && self, _2 = I2 || R2 || Function("return this")(), L2 = t2 && !t2.nodeType && t2, M2 = L2 && e5 && !e5.nodeType && e5, j2 = M2 && M2.exports === L2;
function H2(e6, t3) {
return e6.set(t3[0], t3[1]), e6;
}
function z2(e6, t3) {
return e6.add(t3), e6;
}
function $2(e6, t3, n3, r3) {
for (var o3 = -1, i3 = e6 ? e6.length : 0; ++o3 < i3; ) n3 = t3(n3, e6[o3], o3, e6);
return n3;
}
function U2(e6) {
var t3 = false;
if (null != e6 && "function" != typeof e6.toString) try {
t3 = !!(e6 + "");
} catch (e7) {
}
return t3;
}
function V2(e6) {
var t3 = -1, n3 = Array(e6.size);
return e6.forEach(function(e7, r3) {
n3[++t3] = [r3, e7];
}), n3;
}
function W2(e6, t3) {
return function(n3) {
return e6(t3(n3));
};
}
function G2(e6) {
var t3 = -1, n3 = Array(e6.size);
return e6.forEach(function(e7) {
n3[++t3] = e7;
}), n3;
}
var q2 = Array.prototype, K2 = Function.prototype, Y2 = Object.prototype, X2 = _2["__core-js_shared__"], Z2 = (function() {
var e6 = /[^.]+$/.exec(X2 && X2.keys && X2.keys.IE_PROTO || "");
return e6 ? "Symbol(src)_1." + e6 : "";
})(), J2 = K2.toString, Q2 = Y2.hasOwnProperty, ee2 = Y2.toString, te2 = RegExp("^" + J2.call(Q2).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), ne2 = j2 ? _2.Buffer : void 0, re2 = _2.Symbol, oe2 = _2.Uint8Array, ie2 = W2(Object.getPrototypeOf, Object), ae2 = Object.create, se2 = Y2.propertyIsEnumerable, ue2 = q2.splice, le2 = Object.getOwnPropertySymbols, ce2 = ne2 ? ne2.isBuffer : void 0, de2 = W2(Object.keys, Object), fe2 = Le2(_2, "DataView"), pe2 = Le2(_2, "Map"), he2 = Le2(_2, "Promise"), ge2 = Le2(_2, "Set"), ve2 = Le2(_2, "WeakMap"), me2 = Le2(Object, "create"), ye2 = $e2(fe2), be2 = $e2(pe2), Ee2 = $e2(he2), we2 = $e2(ge2), Ce2 = $e2(ve2), De2 = re2 ? re2.prototype : void 0, Ae2 = De2 ? De2.valueOf : void 0;
function Se2(e6) {
var t3 = -1, n3 = e6 ? e6.length : 0;
for (this.clear(); ++t3 < n3; ) {
var r3 = e6[t3];
this.set(r3[0], r3[1]);
}
}
function xe2(e6) {
var t3 = -1, n3 = e6 ? e6.length : 0;
for (this.clear(); ++t3 < n3; ) {
var r3 = e6[t3];
this.set(r3[0], r3[1]);
}
}
function Oe2(e6) {
var t3 = -1, n3 = e6 ? e6.length : 0;
for (this.clear(); ++t3 < n3; ) {
var r3 = e6[t3];
this.set(r3[0], r3[1]);
}
}
function Ne2(e6) {
this.__data__ = new xe2(e6);
}
function Be2(e6, t3) {
var n3 = Ve2(e6) || (function(e7) {
return (function(e8) {
return /* @__PURE__ */ (function(e9) {
return !!e9 && "object" == typeof e9;
})(e8) && We2(e8);
})(e7) && Q2.call(e7, "callee") && (!se2.call(e7, "callee") || ee2.call(e7) == o2);
})(e6) ? (function(e7, t4) {
for (var n4 = -1, r4 = Array(e7); ++n4 < e7; ) r4[n4] = t4(n4);
return r4;
})(e6.length, String) : [], r3 = n3.length, i3 = !!r3;
for (var a3 in e6) !Q2.call(e6, a3) || i3 && ("length" == a3 || He2(a3, r3)) || n3.push(a3);
return n3;
}
function Te2(e6, t3, n3) {
var r3 = e6[t3];
Q2.call(e6, t3) && Ue2(r3, n3) && (void 0 !== n3 || t3 in e6) || (e6[t3] = n3);
}
function ke2(e6, t3) {
for (var n3 = e6.length; n3--; ) if (Ue2(e6[n3][0], t3)) return n3;
return -1;
}
function Fe2(e6, t3, n3, r3, f3, m3, y2) {
var k3;
if (r3 && (k3 = m3 ? r3(e6, f3, m3, y2) : r3(e6)), void 0 !== k3) return k3;
if (!Ke2(e6)) return e6;
var F3 = Ve2(e6);
if (F3) {
if (k3 = (function(e7) {
var t4 = e7.length, n4 = e7.constructor(t4);
return t4 && "string" == typeof e7[0] && Q2.call(e7, "index") && (n4.index = e7.index, n4.input = e7.input), n4;
})(e6), !t3) return (function(e7, t4) {
var n4 = -1, r4 = e7.length;
for (t4 || (t4 = Array(r4)); ++n4 < r4; ) t4[n4] = e7[n4];
return t4;
})(e6, k3);
} else {
var I3 = je2(e6), R3 = I3 == s2 || I3 == u2;
if (Ge2(e6)) return (function(e7, t4) {
if (t4) return e7.slice();
var n4 = new e7.constructor(e7.length);
return e7.copy(n4), n4;
})(e6, t3);
if (I3 == d2 || I3 == o2 || R3 && !m3) {
if (U2(e6)) return m3 ? e6 : {};
if (k3 = (function(e7) {
return "function" != typeof e7.constructor || ze2(e7) ? {} : Ke2(t4 = ie2(e7)) ? ae2(t4) : {};
var t4;
})(R3 ? {} : e6), !t3) return (function(e7, t4) {
return Re2(e7, Me2(e7), t4);
})(e6, (function(e7, t4) {
return e7 && Re2(t4, Ye2(t4), e7);
})(k3, e6));
} else {
if (!P2[I3]) return m3 ? e6 : {};
k3 = (function(e7, t4, n4, r4) {
var o3 = e7.constructor;
switch (t4) {
case b2:
return Ie2(e7);
case i2:
case a2:
return new o3(+e7);
case E2:
return (function(e8, t5) {
var n5 = t5 ? Ie2(e8.buffer) : e8.buffer;
return new e8.constructor(n5, e8.byteOffset, e8.byteLength);
})(e7, r4);
case w2:
case C2:
case D2:
case A2:
case S2:
case x2:
case O2:
case N2:
case B2:
return (function(e8, t5) {
var n5 = t5 ? Ie2(e8.buffer) : e8.buffer;
return new e8.constructor(n5, e8.byteOffset, e8.length);
})(e7, r4);
case l2:
return (function(e8, t5, n5) {
var r5 = t5 ? n5(V2(e8), true) : V2(e8);
return $2(r5, H2, new e8.constructor());
})(e7, r4, n4);
case c2:
case g2:
return new o3(e7);
case p2:
return (function(e8) {
var t5 = new e8.constructor(e8.source, T2.exec(e8));
return t5.lastIndex = e8.lastIndex, t5;
})(e7);
case h2:
return (function(e8, t5, n5) {
var r5 = t5 ? n5(G2(e8), true) : G2(e8);
return $2(r5, z2, new e8.constructor());
})(e7, r4, n4);
case v2:
return (function(e8) {
return Ae2 ? Object(Ae2.call(e8)) : {};
})(e7);
}
})(e6, I3, Fe2, t3);
}
}
y2 || (y2 = new Ne2());
var _3 = y2.get(e6);
if (_3) return _3;
if (y2.set(e6, k3), !F3) var L3 = n3 ? (function(e7) {
return (function(e8, t4, n4) {
var r4 = t4(e8);
return Ve2(e8) ? r4 : (function(e9, t5) {
for (var n5 = -1, r5 = t5.length, o3 = e9.length; ++n5 < r5; ) e9[o3 + n5] = t5[n5];
return e9;
})(r4, n4(e8));
})(e7, Ye2, Me2);
})(e6) : Ye2(e6);
return (function(e7, t4) {
for (var n4 = -1, r4 = e7 ? e7.length : 0; ++n4 < r4 && false !== t4(e7[n4], n4, e7); ) ;
})(L3 || e6, function(o3, i3) {
L3 && (o3 = e6[i3 = o3]), Te2(k3, i3, Fe2(o3, t3, n3, r3, i3, e6, y2));
}), k3;
}
function Pe2(e6) {
return !(!Ke2(e6) || (t3 = e6, Z2 && Z2 in t3)) && (qe2(e6) || U2(e6) ? te2 : k2).test($e2(e6));
var t3;
}
function Ie2(e6) {
var t3 = new e6.constructor(e6.byteLength);
return new oe2(t3).set(new oe2(e6)), t3;
}
function Re2(e6, t3, n3, r3) {
n3 || (n3 = {});
for (var o3 = -1, i3 = t3.length; ++o3 < i3; ) {
var a3 = t3[o3];
Te2(n3, a3, e6[a3]);
}
return n3;
}
function _e2(e6, t3) {
var n3, r3, o3 = e6.__data__;
return ("string" == (r3 = typeof (n3 = t3)) || "number" == r3 || "symbol" == r3 || "boolean" == r3 ? "__proto__" !== n3 : null === n3) ? o3["string" == typeof t3 ? "string" : "hash"] : o3.map;
}
function Le2(e6, t3) {
var n3 = (function(e7, t4) {
return null == e7 ? void 0 : e7[t4];
})(e6, t3);
return Pe2(n3) ? n3 : void 0;
}
Se2.prototype.clear = function() {
this.__data__ = me2 ? me2(null) : {};
}, Se2.prototype.delete = function(e6) {
return this.has(e6) && delete this.__data__[e6];
}, Se2.prototype.get = function(e6) {
var t3 = this.__data__;
if (me2) {
var r3 = t3[e6];
return r3 === n2 ? void 0 : r3;
}
return Q2.call(t3, e6) ? t3[e6] : void 0;
}, Se2.prototype.has = function(e6) {
var t3 = this.__data__;
return me2 ? void 0 !== t3[e6] : Q2.call(t3, e6);
}, Se2.prototype.set = function(e6, t3) {
return this.__data__[e6] = me2 && void 0 === t3 ? n2 : t3, this;
}, xe2.prototype.clear = function() {
this.__data__ = [];
}, xe2.prototype.delete = function(e6) {
var t3 = this.__data__, n3 = ke2(t3, e6);
return !(n3 < 0 || (n3 == t3.length - 1 ? t3.pop() : ue2.call(t3, n3, 1), 0));
}, xe2.prototype.get = function(e6) {
var t3 = this.__data__, n3 = ke2(t3, e6);
return n3 < 0 ? void 0 : t3[n3][1];
}, xe2.prototype.has = function(e6) {
return ke2(this.__data__, e6) > -1;
}, xe2.prototype.set = function(e6, t3) {
var n3 = this.__data__, r3 = ke2(n3, e6);
return r3 < 0 ? n3.push([e6, t3]) : n3[r3][1] = t3, this;
}, Oe2.prototype.clear = function() {
this.__data__ = { hash: new Se2(), map: new (pe2 || xe2)(), string: new Se2() };
}, Oe2.prototype.delete = function(e6) {
return _e2(this, e6).delete(e6);
}, Oe2.prototype.get = function(e6) {
return _e2(this, e6).get(e6);
}, Oe2.prototype.has = function(e6) {
return _e2(this, e6).has(e6);
}, Oe2.prototype.set = function(e6, t3) {
return _e2(this, e6).set(e6, t3), this;
}, Ne2.prototype.clear = function() {
this.__data__ = new xe2();
}, Ne2.prototype.delete = function(e6) {
return this.__data__.delete(e6);
}, Ne2.prototype.get = function(e6) {
return this.__data__.get(e6);
}, Ne2.prototype.has = function(e6) {
return this.__data__.has(e6);
}, Ne2.prototype.set = function(e6, t3) {
var n3 = this.__data__;
if (n3 instanceof xe2) {
var r3 = n3.__data__;
if (!pe2 || r3.length < 199) return r3.push([e6, t3]), this;
n3 = this.__data__ = new Oe2(r3);
}
return n3.set(e6, t3), this;
};
var Me2 = le2 ? W2(le2, Object) : function() {
return [];
}, je2 = function(e6) {
return ee2.call(e6);
};
function He2(e6, t3) {
return !!(t3 = null == t3 ? r2 : t3) && ("number" == typeof e6 || F2.test(e6)) && e6 > -1 && e6 % 1 == 0 && e6 < t3;
}
function ze2(e6) {
var t3 = e6 && e6.constructor;
return e6 === ("function" == typeof t3 && t3.prototype || Y2);
}
function $e2(e6) {
if (null != e6) {
try {
return J2.call(e6);
} catch (e7) {
}
try {
return e6 + "";
} catch (e7) {
}
}
return "";
}
function Ue2(e6, t3) {
return e6 === t3 || e6 != e6 && t3 != t3;
}
(fe2 && je2(new fe2(new ArrayBuffer(1))) != E2 || pe2 && je2(new pe2()) != l2 || he2 && je2(he2.resolve()) != f2 || ge2 && je2(new ge2()) != h2 || ve2 && je2(new ve2()) != m2) && (je2 = function(e6) {
var t3 = ee2.call(e6), n3 = t3 == d2 ? e6.constructor : void 0, r3 = n3 ? $e2(n3) : void 0;
if (r3) switch (r3) {
case ye2:
return E2;
case be2:
return l2;
case Ee2:
return f2;
case we2:
return h2;
case Ce2:
return m2;
}
return t3;
});
var Ve2 = Array.isArray;
function We2(e6) {
return null != e6 && (function(e7) {
return "number" == typeof e7 && e7 > -1 && e7 % 1 == 0 && e7 <= r2;
})(e6.length) && !qe2(e6);
}
var Ge2 = ce2 || function() {
return false;
};
function qe2(e6) {
var t3 = Ke2(e6) ? ee2.call(e6) : "";
return t3 == s2 || t3 == u2;
}
function Ke2(e6) {
var t3 = typeof e6;
return !!e6 && ("object" == t3 || "function" == t3);
}
function Ye2(e6) {
return We2(e6) ? Be2(e6) : (function(e7) {
if (!ze2(e7)) return de2(e7);
var t3 = [];
for (var n3 in Object(e7)) Q2.call(e7, n3) && "constructor" != n3 && t3.push(n3);
return t3;
})(e6);
}
e5.exports = function(e6) {
return Fe2(e6, true, true);
};
})(Mg, Mg.exports)), Mg.exports), $g = b(zg);
var Ug = (function() {
if (Hg) return jg;
Hg = 1;
var e5 = 9007199254740991, t2 = "[object Arguments]", n2 = "[object Function]", r2 = "[object GeneratorFunction]", o2 = /^(?:0|[1-9]\d*)$/;
function i2(e6, t3) {
for (var n3 = -1, r3 = e6 ? e6.length : 0; ++n3 < r3 && false !== t3(e6[n3], n3, e6); ) ;
return e6;
}
var a2, s2, u2 = Object.prototype, l2 = u2.hasOwnProperty, c2 = u2.toString, d2 = u2.propertyIsEnumerable, f2 = (a2 = Object.keys, s2 = Object, function(e6) {
return a2(s2(e6));
});
function p2(e6, n3) {
var r3 = b2(e6) || (function(e7) {
return (function(e8) {
return /* @__PURE__ */ (function(e9) {
return !!e9 && "object" == typeof e9;
})(e8) && E2(e8);
})(e7) && l2.call(e7, "callee") && (!d2.call(e7, "callee") || c2.call(e7) == t2);
})(e6) ? (function(e7, t3) {
for (var n4 = -1, r4 = Array(e7); ++n4 < e7; ) r4[n4] = t3(n4);
return r4;
})(e6.length, String) : [], o3 = r3.length, i3 = !!o3;
for (var a3 in e6) !l2.call(e6, a3) || i3 && ("length" == a3 || y2(a3, o3)) || r3.push(a3);
return r3;
}
var h2, g2 = (h2 = function(e6, t3) {
return e6 && v2(e6, t3, w2);
}, function(e6, t3) {
if (null == e6) return e6;
if (!E2(e6)) return h2(e6, t3);
for (var n3 = e6.length, r3 = -1, o3 = Object(e6); ++r3 < n3 && false !== t3(o3[r3], r3, o3); ) ;
return e6;
}), v2 = function(e6, t3, n3) {
for (var r3 = -1, o3 = Object(e6), i3 = n3(e6), a3 = i3.length; a3--; ) {
var s3 = i3[++r3];
if (false === t3(o3[s3], s3, o3)) break;
}
return e6;
};
function m2(e6) {
if (n3 = (t3 = e6) && t3.constructor, r3 = "function" == typeof n3 && n3.prototype || u2, t3 !== r3) return f2(e6);
var t3, n3, r3, o3 = [];
for (var i3 in Object(e6)) l2.call(e6, i3) && "constructor" != i3 && o3.push(i3);
return o3;
}
function y2(t3, n3) {
return !!(n3 = null == n3 ? e5 : n3) && ("number" == typeof t3 || o2.test(t3)) && t3 > -1 && t3 % 1 == 0 && t3 < n3;
}
var b2 = Array.isArray;
function E2(t3) {
return null != t3 && (function(t4) {
return "number" == typeof t4 && t4 > -1 && t4 % 1 == 0 && t4 <= e5;
})(t3.length) && !(function(e6) {
var t4 = (function(e7) {
var t5 = typeof e7;
return !!e7 && ("object" == t5 || "function" == t5);
})(e6) ? c2.call(e6) : "";
return t4 == n2 || t4 == r2;
})(t3);
}
function w2(e6) {
return E2(e6) ? p2(e6) : m2(e6);
}
function C2(e6) {
return e6;
}
return jg = function(e6, t3) {
return (b2(e6) ? i2 : g2)(e6, "function" == typeof t3 ? t3 : C2);
};
})(), Vg = b(Ug), Wg = /* @__PURE__ */ new Set(["base", "embed", "math", "meta", "object", "script", "svg", "template"]), Gg = /* @__PURE__ */ new Set(["href", "poster", "src", "xlink:href"]), qg = ["java", "script:"].join("");
function Kg(e5, t2, n2) {
var r2 = (function(e6) {
return Array.from(e6).filter(function(e7) {
return e7 > " ";
}).join("").toLowerCase();
})(n2);
return !r2 || !r2.startsWith(qg) && !r2.startsWith("vbscript:") && (!r2.startsWith("data:") || "href" !== t2 && "xlink:href" !== t2 && (("img" === e5 || "poster" === t2) && r2.startsWith("data:image/")));
}
function Yg(e5) {
if (void 0 === e5 && (e5 = ""), !e5) return "";
var t2 = new DOMParser().parseFromString(e5, "text/html");
return Array.from(t2.body.querySelectorAll("*")).forEach(function(e6) {
var t3 = e6.tagName.toLowerCase();
Wg.has(t3) ? e6.remove() : Array.from(e6.attributes).forEach(function(n2) {
var r2 = n2.name.toLowerCase(), o2 = n2.value || "";
("srcdoc" === r2 || r2.startsWith("on") || Gg.has(r2) && !Kg(t3, r2, o2)) && e6.removeAttribute(n2.name);
});
}), t2.body.innerHTML;
}
var Xg = {};
var Zg = "created", Jg = "destroyed", Qg = "change", ev = "scroll", tv = "fullscreen", nv = "unFullScreen", rv = "modalOrPanelShow", ov = "modalOrPanelHide", iv = {};
function av(e5, t2) {
var n2 = e5.key, r2 = e5.factory, o2 = e5.config, i2 = Tg(Tg({}, o2), t2 || {});
if (null != iv[n2]) throw new Error("Duplicated key '".concat(n2, "' in menu items"));
iv[n2] = r2, (function(e6, t3) {
null != t3 && (Xg[e6] = t3);
})(n2, i2);
}
var sv = /* @__PURE__ */ new WeakMap(), uv = /* @__PURE__ */ new WeakMap(), lv = /* @__PURE__ */ new WeakMap(), cv = /* @__PURE__ */ new WeakMap(), dv = /* @__PURE__ */ new WeakMap(), fv = /* @__PURE__ */ new WeakMap(), pv = /* @__PURE__ */ new WeakMap(), hv = /* @__PURE__ */ new WeakMap(), gv = /* @__PURE__ */ new WeakMap(), vv = /* @__PURE__ */ new WeakMap(), mv = /* @__PURE__ */ new WeakMap(), yv = /* @__PURE__ */ new WeakMap(), bv = /* @__PURE__ */ new WeakMap(), Ev = /* @__PURE__ */ new WeakMap(), wv = /* @__PURE__ */ new WeakMap(), Cv = /* @__PURE__ */ new WeakMap(), Dv = /* @__PURE__ */ new WeakMap(), Av = /* @__PURE__ */ new WeakMap(), Sv = /* @__PURE__ */ new WeakMap(), xv = /* @__PURE__ */ new WeakMap(), Ov = /* @__PURE__ */ new WeakMap(), Nv = /* @__PURE__ */ new WeakMap(), Bv = /* @__PURE__ */ new WeakMap(), Tv = /* @__PURE__ */ new WeakMap(), kv = /* @__PURE__ */ new WeakMap(), Fv = /* @__PURE__ */ new WeakMap(), Pv = /* @__PURE__ */ new WeakMap(), Iv = /* @__PURE__ */ new WeakMap(), Rv = /* @__PURE__ */ new WeakMap(), _v = function(e5) {
var t2 = e5;
return t2.getAllMenuKeys = function() {
var e6 = [];
for (var t3 in iv) e6.push(t3);
return e6;
}, t2.getConfig = function() {
var e6 = vv.get(t2);
if (null == e6) throw new Error("Can not get editor config");
return e6;
}, t2.getMenuConfig = function(e6) {
var n2 = t2.getConfig().MENU_CONF;
return (void 0 === n2 ? {} : n2)[e6] || {};
}, t2.alert = function(e6, n2) {
void 0 === n2 && (n2 = "info");
var r2 = t2.getConfig().customAlert;
r2 && r2(e6, n2);
}, t2;
}, Lv = /* @__PURE__ */ new Set(["doctype", "!doctype", "meta", "script", "style", "link", "frame", "iframe", "title", "svg"]);
function Mv(e5) {
return null !== e5 && "object" == typeof e5 && "constructor" in e5 && e5.constructor === Object;
}
function jv(e5 = {}, t2 = {}) {
Object.keys(t2).forEach((n2) => {
void 0 === e5[n2] ? e5[n2] = t2[n2] : Mv(t2[n2]) && Mv(e5[n2]) && Object.keys(t2[n2]).length > 0 && jv(e5[n2], t2[n2]);
});
}
const Hv = { body: {}, addEventListener() {
}, removeEventListener() {
}, activeElement: { blur() {
}, nodeName: "" }, querySelector: () => null, querySelectorAll: () => [], getElementById: () => null, createEvent: () => ({ initEvent() {
} }), createElement: () => ({ children: [], childNodes: [], style: {}, setAttribute() {
}, getElementsByTagName: () => [] }), createElementNS: () => ({}), importNode: () => null, location: { hash: "", host: "", hostname: "", href: "", origin: "", pathname: "", protocol: "", search: "" } };
function zv() {
const e5 = "undefined" != typeof document ? document : {};
return jv(e5, Hv), e5;
}
const $v = { document: Hv, navigator: { userAgent: "" }, location: { hash: "", host: "", hostname: "", href: "", origin: "", pathname: "", protocol: "", search: "" }, history: { replaceState() {
}, pushState() {
}, go() {
}, back() {
} }, CustomEvent: function() {
return this;
}, addEventListener() {
}, removeEventListener() {
}, getComputedStyle: () => ({ getPropertyValue: () => "" }), Image() {
}, Date() {
}, screen: {}, setTimeout() {
}, clearTimeout() {
}, matchMedia: () => ({}), requestAnimationFrame: (e5) => "undefined" == typeof setTimeout ? (e5(), null) : setTimeout(e5, 0), cancelAnimationFrame(e5) {
"undefined" != typeof setTimeout && clearTimeout(e5);
} };
function Uv() {
const e5 = "undefined" != typeof window ? window : {};
return jv(e5, $v), e5;
}
class Vv extends Array {
constructor(e5) {
"number" == typeof e5 ? super(e5) : (super(...e5 || []), (function(e6) {
const t2 = e6.__proto__;
Object.defineProperty(e6, "__proto__", { get: () => t2, set(e7) {
t2.__proto__ = e7;
} });
})(this));
}
}
function Wv(e5 = []) {
const t2 = [];
return e5.forEach((e6) => {
Array.isArray(e6) ? t2.push(...Wv(e6)) : t2.push(e6);
}), t2;
}
function Gv(e5, t2) {
return Array.prototype.filter.call(e5, t2);
}
function qv(e5) {
return e5.toLowerCase().replace(/-(.)/g, (e6, t2) => t2.toUpperCase());
}
function Kv(e5, t2) {
const n2 = Uv(), r2 = zv();
let o2 = [];
if (!t2 && e5 instanceof Vv) return e5;
if (!e5) return new Vv(o2);
if ("string" == typeof e5) {
const n3 = e5.trim();
if (n3.indexOf("<") >= 0 && n3.indexOf(">") >= 0) {
let e6 = "div";
0 === n3.indexOf(" e6.split(" ")));
return this.forEach((e6) => {
e6.classList.add(...t2);
}), this;
}
function Xv(...e5) {
const t2 = Wv(e5.map((e6) => e6.split(" ")));
return this.forEach((e6) => {
e6.classList.remove(...t2);
}), this;
}
function Zv(...e5) {
const t2 = Wv(e5.map((e6) => e6.split(" ")));
return Gv(this, (e6) => t2.filter((t3) => e6.classList.contains(t3)).length > 0).length > 0;
}
function Jv(e5, t2) {
if (1 === arguments.length && "string" == typeof e5) return this[0] ? this[0].getAttribute(e5) : void 0;
for (let n2 = 0; n2 < this.length; n2 += 1) if (2 === arguments.length) this[n2].setAttribute(e5, t2);
else for (const t3 in e5) this[n2][t3] = e5[t3], this[n2].setAttribute(t3, e5[t3]);
return this;
}
function Qv(e5) {
for (let t2 = 0; t2 < this.length; t2 += 1) this[t2].removeAttribute(e5);
return this;
}
function em(e5, t2) {
let n2;
if (void 0 === t2) {
if (n2 = this[0], !n2) return;
if (n2.dom7ElementDataStorage && e5 in n2.dom7ElementDataStorage) return n2.dom7ElementDataStorage[e5];
const t3 = n2.getAttribute(`data-${e5}`);
return t3 || void 0;
}
for (let r2 = 0; r2 < this.length; r2 += 1) n2 = this[r2], n2.dom7ElementDataStorage || (n2.dom7ElementDataStorage = {}), n2.dom7ElementDataStorage[e5] = t2;
return this;
}
function tm() {
const e5 = this[0];
if (!e5) return;
const t2 = {};
if (e5.dataset) for (const n2 in e5.dataset) t2[n2] = e5.dataset[n2];
else for (let n2 = 0; n2 < e5.attributes.length; n2 += 1) {
const r2 = e5.attributes[n2];
r2.name.indexOf("data-") >= 0 && (t2[qv(r2.name.split("data-")[1])] = r2.value);
}
for (const e6 in t2) "false" === t2[e6] ? t2[e6] = false : "true" === t2[e6] ? t2[e6] = true : parseFloat(t2[e6]) === 1 * t2[e6] && (t2[e6] *= 1);
return t2;
}
function nm(e5) {
if (void 0 === e5) {
const e6 = this[0];
if (!e6) return;
if (e6.multiple && "select" === e6.nodeName.toLowerCase()) {
const t2 = [];
for (let n2 = 0; n2 < e6.selectedOptions.length; n2 += 1) t2.push(e6.selectedOptions[n2].value);
return t2;
}
return e6.value;
}
for (let t2 = 0; t2 < this.length; t2 += 1) {
const n2 = this[t2];
if (Array.isArray(e5) && n2.multiple && "select" === n2.nodeName.toLowerCase()) for (let t3 = 0; t3 < n2.options.length; t3 += 1) n2.options[t3].selected = e5.indexOf(n2.options[t3].value) >= 0;
else n2.value = e5;
}
return this;
}
function rm(...e5) {
let [t2, n2, r2, o2] = e5;
function i2(e6) {
const t3 = e6.target;
if (!t3) return;
const o3 = e6.target.dom7EventData || [];
if (o3.indexOf(e6) < 0 && o3.unshift(e6), Kv(t3).is(n2)) r2.apply(t3, o3);
else {
const e7 = Kv(t3).parents();
for (let t4 = 0; t4 < e7.length; t4 += 1) Kv(e7[t4]).is(n2) && r2.apply(e7[t4], o3);
}
}
function a2(e6) {
const t3 = e6 && e6.target && e6.target.dom7EventData || [];
t3.indexOf(e6) < 0 && t3.unshift(e6), r2.apply(this, t3);
}
"function" == typeof e5[1] && ([t2, r2, o2] = e5, n2 = void 0), o2 || (o2 = false);
const s2 = t2.split(" ");
let u2;
for (let e6 = 0; e6 < this.length; e6 += 1) {
const t3 = this[e6];
if (n2) for (u2 = 0; u2 < s2.length; u2 += 1) {
const e7 = s2[u2];
t3.dom7LiveListeners || (t3.dom7LiveListeners = {}), t3.dom7LiveListeners[e7] || (t3.dom7LiveListeners[e7] = []), t3.dom7LiveListeners[e7].push({ listener: r2, proxyListener: i2 }), t3.addEventListener(e7, i2, o2);
}
else for (u2 = 0; u2 < s2.length; u2 += 1) {
const e7 = s2[u2];
t3.dom7Listeners || (t3.dom7Listeners = {}), t3.dom7Listeners[e7] || (t3.dom7Listeners[e7] = []), t3.dom7Listeners[e7].push({ listener: r2, proxyListener: a2 }), t3.addEventListener(e7, a2, o2);
}
}
return this;
}
function om(...e5) {
let [t2, n2, r2, o2] = e5;
"function" == typeof e5[1] && ([t2, r2, o2] = e5, n2 = void 0), o2 || (o2 = false);
const i2 = t2.split(" ");
for (let e6 = 0; e6 < i2.length; e6 += 1) {
const t3 = i2[e6];
for (let e7 = 0; e7 < this.length; e7 += 1) {
const i3 = this[e7];
let a2;
if (!n2 && i3.dom7Listeners ? a2 = i3.dom7Listeners[t3] : n2 && i3.dom7LiveListeners && (a2 = i3.dom7LiveListeners[t3]), a2 && a2.length) for (let e8 = a2.length - 1; e8 >= 0; e8 -= 1) {
const n3 = a2[e8];
r2 && n3.listener === r2 || r2 && n3.listener && n3.listener.dom7proxy && n3.listener.dom7proxy === r2 ? (i3.removeEventListener(t3, n3.proxyListener, o2), a2.splice(e8, 1)) : r2 || (i3.removeEventListener(t3, n3.proxyListener, o2), a2.splice(e8, 1));
}
}
}
return this;
}
function im() {
const e5 = Uv();
return this[0] === e5 ? e5.innerWidth : this.length > 0 ? parseFloat(this.css("width")) : null;
}
function am() {
const e5 = Uv();
return this[0] === e5 ? e5.innerHeight : this.length > 0 ? parseFloat(this.css("height")) : null;
}
function sm() {
if (this.length > 0) {
const e5 = Uv(), t2 = zv(), n2 = this[0], r2 = n2.getBoundingClientRect(), o2 = t2.body, i2 = n2.clientTop || o2.clientTop || 0, a2 = n2.clientLeft || o2.clientLeft || 0, s2 = n2 === e5 ? e5.scrollY : n2.scrollTop, u2 = n2 === e5 ? e5.scrollX : n2.scrollLeft;
return { top: r2.top + s2 - i2, left: r2.left + u2 - a2 };
}
return null;
}
function um() {
for (let e5 = 0; e5 < this.length; e5 += 1) this[e5].style.display = "none";
return this;
}
function lm() {
const e5 = Uv();
for (let t2 = 0; t2 < this.length; t2 += 1) {
const n2 = this[t2];
"none" === n2.style.display && (n2.style.display = ""), "none" === e5.getComputedStyle(n2, null).getPropertyValue("display") && (n2.style.display = "block");
}
return this;
}
function cm(e5, t2) {
const n2 = Uv();
let r2;
if (1 === arguments.length) {
if ("string" != typeof e5) {
for (r2 = 0; r2 < this.length; r2 += 1) for (const t3 in e5) this[r2].style[t3] = e5[t3];
return this;
}
if (this[0]) return n2.getComputedStyle(this[0], null).getPropertyValue(e5);
}
if (2 === arguments.length && "string" == typeof e5) {
for (r2 = 0; r2 < this.length; r2 += 1) this[r2].style[e5] = t2;
return this;
}
return this;
}
function dm(e5) {
return e5 ? (this.forEach((t2, n2) => {
e5.apply(t2, [t2, n2]);
}), this) : this;
}
function fm(e5) {
return Kv(Gv(this, e5));
}
function pm(e5) {
if (void 0 === e5) return this[0] ? this[0].innerHTML : null;
for (let t2 = 0; t2 < this.length; t2 += 1) this[t2].innerHTML = e5;
return this;
}
function hm(e5) {
if (void 0 === e5) return this[0] ? this[0].textContent.trim() : null;
for (let t2 = 0; t2 < this.length; t2 += 1) this[t2].textContent = e5;
return this;
}
function gm(e5) {
const t2 = Uv(), n2 = zv(), r2 = this[0];
let o2, i2;
if (!r2 || void 0 === e5) return false;
if ("string" == typeof e5) {
if (r2.matches) return r2.matches(e5);
if (r2.webkitMatchesSelector) return r2.webkitMatchesSelector(e5);
if (r2.msMatchesSelector) return r2.msMatchesSelector(e5);
for (o2 = Kv(e5), i2 = 0; i2 < o2.length; i2 += 1) if (o2[i2] === r2) return true;
return false;
}
if (e5 === n2) return r2 === n2;
if (e5 === t2) return r2 === t2;
if (e5.nodeType || e5 instanceof Vv) {
for (o2 = e5.nodeType ? [e5] : e5, i2 = 0; i2 < o2.length; i2 += 1) if (o2[i2] === r2) return true;
return false;
}
return false;
}
function vm(...e5) {
let t2;
const n2 = zv();
for (let r2 = 0; r2 < e5.length; r2 += 1) {
t2 = e5[r2];
for (let e6 = 0; e6 < this.length; e6 += 1) if ("string" == typeof t2) {
const r3 = n2.createElement("div");
for (r3.innerHTML = t2; r3.firstChild; ) this[e6].appendChild(r3.firstChild);
} else if (t2 instanceof Vv) for (let n3 = 0; n3 < t2.length; n3 += 1) this[e6].appendChild(t2[n3]);
else this[e6].appendChild(t2);
}
return this;
}
function mm(e5) {
const t2 = zv();
let n2, r2;
for (n2 = 0; n2 < this.length; n2 += 1) if ("string" == typeof e5) {
const o2 = t2.createElement("div");
for (o2.innerHTML = e5, r2 = o2.childNodes.length - 1; r2 >= 0; r2 -= 1) this[n2].insertBefore(o2.childNodes[r2], this[n2].childNodes[0]);
} else if (e5 instanceof Vv) for (r2 = 0; r2 < e5.length; r2 += 1) this[n2].insertBefore(e5[r2], this[n2].childNodes[0]);
else this[n2].insertBefore(e5, this[n2].childNodes[0]);
return this;
}
function ym(e5) {
const t2 = [];
for (let n2 = 0; n2 < this.length; n2 += 1) null !== this[n2].parentNode && (e5 ? Kv(this[n2].parentNode).is(e5) && t2.push(this[n2].parentNode) : t2.push(this[n2].parentNode));
return Kv(t2);
}
function bm(e5) {
const t2 = [];
for (let n2 = 0; n2 < this.length; n2 += 1) {
let r2 = this[n2].parentNode;
for (; r2; ) e5 ? Kv(r2).is(e5) && t2.push(r2) : t2.push(r2), r2 = r2.parentNode;
}
return Kv(t2);
}
function Em(e5) {
const t2 = [];
for (let n2 = 0; n2 < this.length; n2 += 1) {
const r2 = this[n2].querySelectorAll(e5);
for (let e6 = 0; e6 < r2.length; e6 += 1) t2.push(r2[e6]);
}
return Kv(t2);
}
function wm(e5) {
const t2 = [];
for (let n2 = 0; n2 < this.length; n2 += 1) {
const r2 = this[n2].children;
for (let n3 = 0; n3 < r2.length; n3 += 1) e5 && !Kv(r2[n3]).is(e5) || t2.push(r2[n3]);
}
return Kv(t2);
}
function Cm() {
for (let e5 = 0; e5 < this.length; e5 += 1) this[e5].parentNode && this[e5].parentNode.removeChild(this[e5]);
return this;
}
function Dm() {
for (let e5 = 0; e5 < this.length; e5 += 1) {
const t2 = this[e5];
if (1 === t2.nodeType) {
for (let e6 = 0; e6 < t2.childNodes.length; e6 += 1) t2.childNodes[e6].parentNode && t2.childNodes[e6].parentNode.removeChild(t2.childNodes[e6]);
t2.textContent = "";
}
}
return this;
}
Kv.fn = Vv.prototype;
const Am = "resize scroll".split(" ");
function Sm(e5) {
return function(...t2) {
if (void 0 === t2[0]) {
for (let t3 = 0; t3 < this.length; t3 += 1) Am.indexOf(e5) < 0 && (e5 in this[t3] ? this[t3][e5]() : Kv(this[t3]).trigger(e5));
return this;
}
return this.on(e5, ...t2);
};
}
const xm = Sm("click"), Om = Sm("focus"), Nm = ["area", "base", "basefont", "bgsound", "br", "col", "command", "embed", "frame", "hr", "image", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
let Bm = (e5 = 21) => {
let t2 = "", n2 = crypto.getRandomValues(new Uint8Array(e5 |= 0));
for (; e5--; ) t2 += "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63 & n2[e5]];
return t2;
};
function Tm(e5) {
Promise.resolve().then(e5);
}
function km(e5) {
return e5.replace(/ /g, " ").replace(/</g, "<").replace(/>/g, ">").replace(/®/g, "®").replace(/©/g, "©").replace(/™/g, "™").replace(/"/g, '"');
}
var Fm, Pm = function(e5) {
return Object.prototype.toString.call(e5);
}, Im = globalThis.Node;
cm && (Kv.fn.css = cm), vm && (Kv.fn.append = vm), Yv && (Kv.fn.addClass = Yv), Xv && (Kv.fn.removeClass = Xv), Zv && (Kv.fn.hasClass = Zv), rm && (Kv.fn.on = rm), Om && (Kv.fn.focus = Om), Jv && (Kv.fn.attr = Jv), Qv && (Kv.fn.removeAttr = Qv), um && (Kv.fn.hide = um), lm && (Kv.fn.show = lm), sm && (Kv.fn.offset = sm), im && (Kv.fn.width = im), am && (Kv.fn.height = am), ym && (Kv.fn.parent = ym), bm && (Kv.fn.parents = bm), gm && (Kv.fn.is = gm), tm && (Kv.fn.dataset = tm), nm && (Kv.fn.val = nm), hm && (Kv.fn.text = hm), pm && (Kv.fn.html = pm), wm && (Kv.fn.children = wm), Cm && (Kv.fn.remove = Cm), Em && (Kv.fn.find = Em), dm && (Kv.fn.each = dm), Dm && (Kv.fn.empty = Dm), (function(e5) {
e5[e5.ELEMENT_NODE = 1] = "ELEMENT_NODE", e5[e5.TEXT_NODE = 3] = "TEXT_NODE", e5[e5.CDATA_SECTION_NODE = 4] = "CDATA_SECTION_NODE", e5[e5.PROCESSING_INSTRUCTION_NODE = 7] = "PROCESSING_INSTRUCTION_NODE", e5[e5.COMMENT_NODE = 8] = "COMMENT_NODE", e5[e5.DOCUMENT_NODE = 9] = "DOCUMENT_NODE", e5[e5.DOCUMENT_TYPE_NODE = 10] = "DOCUMENT_TYPE_NODE", e5[e5.DOCUMENT_FRAGMENT_NODE = 11] = "DOCUMENT_FRAGMENT_NODE";
})(Fm || (Fm = {}));
var Rm = /\[object HTML([A-Z][a-z]*)*Element\]/, _m = function(e5) {
return Rm.test(Pm(e5));
}, Lm = function(e5) {
return null != e5 && "number" == typeof e5.nodeType;
}, Mm = function(e5) {
return Lm(e5) && e5.nodeType === Fm.COMMENT_NODE;
}, jm = function(e5) {
return Lm(e5) && e5.nodeType === Fm.ELEMENT_NODE;
}, Hm = function(e5) {
return "[object Selection]" === Pm(e5);
}, zm = function(e5) {
return Lm(e5) && e5.nodeType === Fm.TEXT_NODE;
}, $m = function(e5) {
var t2, n2, r2;
return null !== (t2 = window && window.document.getElementById(e5)) && void 0 !== t2 ? t2 : window && (null === (r2 = null === (n2 = window.document.activeElement) || void 0 === n2 ? void 0 : n2.shadowRoot) || void 0 === r2 ? void 0 : r2.getElementById(e5)) || null;
}, Um = function(e5, t2, n2) {
for (var r2 = e5.childNodes, o2 = r2[t2], i2 = t2, a2 = false, s2 = false; (Mm(o2) || jm(o2) && 0 === o2.childNodes.length || jm(o2) && "false" === o2.getAttribute("contenteditable")) && (!a2 || !s2); ) i2 >= r2.length ? (a2 = true, i2 = t2 - 1, n2 = "backward") : i2 < 0 ? (s2 = true, i2 = t2 + 1, n2 = "forward") : (o2 = r2[i2], t2 = i2, i2 += "forward" === n2 ? 1 : -1);
return [o2, t2];
}, Vm = function(e5, t2, n2) {
return Ig(Um(e5, t2, n2), 1)[0];
}, Wm = function(e5) {
var t2, n2, r2 = "";
if (zm(e5) && e5.nodeValue) return e5.nodeValue;
if (jm(e5)) {
try {
for (var o2 = Pg(Array.from(e5.childNodes)), i2 = o2.next(); !i2.done; i2 = o2.next()) {
var a2 = i2.value;
r2 += Wm(a2);
}
} catch (e6) {
t2 = { error: e6 };
} finally {
try {
i2 && !i2.done && (n2 = o2.return) && n2.call(o2);
} finally {
if (t2) throw t2.error;
}
}
var s2 = getComputedStyle(e5).getPropertyValue("display");
"block" !== s2 && "list" !== s2 && "table-row" !== s2 && "BR" !== e5.tagName || (r2 += "\n");
}
return r2;
};
function Gm(e5, t2) {
if (!_m(e5) || "true" !== e5.dataset.slateVoid) for (var n2 = e5.childNodes, r2 = n2.length; r2 -= 1; ) {
var o2 = n2[r2], i2 = o2.nodeType;
zm(o2) ? t2(o2, e5) : [Fm.ELEMENT_NODE, Fm.DOCUMENT_NODE, Fm.DOCUMENT_FRAGMENT_NODE].includes(i2) && Gm(o2, t2);
}
}
function qm(e5) {
if (0 === e5.length) return "";
var t2 = e5[0];
return t2.nodeType !== Fm.ELEMENT_NODE ? "" : t2.tagName.toLowerCase();
}
var Km = new RegExp(String.fromCharCode(160), "g");
function Ym(e5) {
return e5.replace(Km, " ");
}
var Xm = ["span", "b", "strong", "i", "em", "s", "strike", "u", "font", "sub", "sup"], Zm = [];
var Jm = [];
var Qm = {};
function ey(e5, t2) {
var n2 = e5.length;
if (n2) {
var r2 = e5[n2 - 1];
if (Sh.isText(r2)) {
var o2 = Object.keys(r2);
if (1 === o2.length && "text" === o2[0]) return r2.text += t2, true;
}
}
return false;
}
function ty(e5, t2, n2) {
return { type: "paragraph", children: [{ text: Kv(e5).text().replace(/\s+/gm, " ") }] };
}
function ny(e5, t2) {
var n2 = (function(e6, t3) {
var n3 = [];
if (null != e6.attr("data-w-e-is-void")) return n3;
var r3 = e6[0].childNodes;
return 1 === r3.length && "BR" === r3[0].nodeName ? (n3.push({ text: "" }), n3) : (r3.forEach(function(e7) {
if (jm(e7)) {
if ("BR" === e7.nodeName) return void (ey(n3, "\n") || n3.push({ text: "\n" }));
var r4 = sy(Kv(e7), t3);
Array.isArray(r4) ? r4.forEach(function(e8) {
return n3.push(e8);
}) : n3.push(r4);
} else if (zm(e7)) {
var o3 = e7.textContent || "";
if ("" === o3.trim() && o3.indexOf("\n") >= 0) return;
o3 && (o3 = Ym(o3), ey(n3, o3) || n3.push({ text: o3 }));
}
}), n3);
})(e5, t2), r2 = (function(e6) {
for (var t3 in Qm) if (e6[0].matches(t3)) return Qm[t3];
return ty;
})(e5), o2 = r2(e5[0], n2, t2);
return Array.isArray(o2) || (o2 = [o2]), o2.forEach(function(r3) {
hh.isVoid(t2, r3) || (0 === n2.length && (r3.children = [{ text: e5.text().replace(/\s+/gm, " ") }]), Jm.forEach(function(n3) {
r3 = n3(e5[0], r3, t2);
}));
}), o2;
}
function ry(e5, t2) {
0 === e5.parents("pre").length && (e5[0].innerHTML = e5[0].innerHTML.replace(/[\r\n\t]+/g, "").replace(/
/g, "\n"));
var n2 = e5[0].textContent || "", r2 = { text: n2 = Ym(n2 = km(n2)) };
return Jm.forEach(function(n3) {
r2 = n3(e5[0], r2, t2);
}), r2;
}
function oy(e5, t2) {
var n2 = { text: "" };
return Jm.forEach(function(r2) {
n2 = r2(e5[0], n2, t2);
}), n2;
}
function iy(e5, t2) {
var n2 = t2.parentElement;
return null == n2 ? e5 : (null == n2.closest("pre") && (e5 = e5.replace(/[\r\n\t]+/g, "")), e5 = Ym(e5 = km(e5)));
}
function ay(e5, t2, n2) {
var r2 = e5[0];
if (jm(r2)) {
var o2 = sy(e5, n2);
return delete t2.text, Array.isArray(o2) ? o2.map(function(e6) {
return Tg(Tg({}, t2), e6);
}) : [Tg(Tg({}, t2), o2)];
}
if (Mm(r2)) return null;
var i2 = zm(r2) ? { text: iy(r2.textContent || "", r2) } : ry(e5, n2);
return [Tg(Tg({}, t2), i2)];
}
function sy(e5, t2) {
Zm.forEach(function(t3) {
var n3 = t3.selector, r3 = t3.preParseHtml;
e5[0].matches(n3) && (e5 = Kv(r3(e5[0])));
});
var n2 = qm(e5);
if ("span" === n2) {
if (e5.attr("data-w-e-type")) return ny(e5, t2);
if ((o2 = Array.from(e5[0].childNodes)).some(function(e6) {
return !zm(e6) && !Mm(e6);
})) {
var r2 = oy(Kv(e5[0]), t2);
return o2.flatMap(function(e6) {
return ay(Kv(e6), r2, t2) || [];
});
}
return ry(e5, t2);
}
if ("code" === n2) return "pre" === qm(e5.parent()) ? ny(e5, t2) : ry(e5, t2);
if (Xm.includes(n2)) {
var o2;
if ((o2 = Array.from(e5[0].childNodes)).some(function(e6) {
return !zm(e6) && !Mm(e6);
})) {
var i2 = oy(Kv(e5[0]), t2);
return o2.flatMap(function(e6) {
return ay(Kv(e6), i2, t2) || [];
});
}
return ry(e5, t2);
}
return ny(e5, t2);
}
function uy(e5, t2, n2) {
var r2 = Kv(n2);
return !!r2.attr(t2) || (r2.attr(t2, "true"), e5.on(Jg, function() {
r2.removeAttr(t2);
}), false);
}
function ly(e5, t2) {
void 0 === t2 && (t2 = "");
var n2 = [], r2 = e5.getConfig().sanitizeHtml;
"" === t2 && (t2 = "
"), 0 !== t2.indexOf("<") && (t2 = t2.split(/\n/).map(function(e6) {
return "".concat(e6, "
");
}).join("")), t2 = r2 ? r2(t2) : t2;
var o2 = Kv("".concat(t2, "
"));
return Array.from(o2.children()).forEach(function(t3) {
var r3 = sy(Kv(t3), e5);
Array.isArray(r3) ? r3.forEach(function(e6) {
return n2.push(e6);
}) : n2.push(r3);
}), n2;
}
function cy(e5, t2) {
return "w-e-element-".concat(e5, "-").concat(t2);
}
var dy = [];
var fy, py, hy = {};
function gy(e5, t2, n2) {
var r2 = n2.isInline(e5) ? "span" : "div";
return "<".concat(r2, ">").concat(t2, "").concat(r2, ">");
}
function vy(e5, t2) {
var n2 = e5.type, r2 = void 0 === n2 ? "" : n2, o2 = e5.children, i2 = void 0 === o2 ? [] : o2, a2 = hh.isVoid(t2, e5), s2 = "";
a2 || (s2 = i2.map(function(e6) {
return ky(e6, t2);
}).join(""));
var u2 = (function(e6) {
return hy[e6] || gy;
})(r2), l2 = u2(e5, s2, t2), c2 = "";
if (c2 = "string" == typeof l2 ? l2 : l2.html || "", a2 || dy.forEach(function(n3) {
return c2 = n3(e5, c2, t2);
}), "string" == typeof l2) return c2;
var d2 = l2.prefix, f2 = void 0 === d2 ? "" : d2, p2 = l2.suffix, h2 = void 0 === p2 ? "" : p2;
return f2 && (c2 = f2 + c2), h2 && (c2 += h2), c2;
}
var my = (function() {
if (py) return fy;
py = 1;
var e5 = 9007199254740991, t2 = "[object Arguments]", n2 = "[object Map]", r2 = "[object Promise]", o2 = "[object Set]", i2 = "[object WeakMap]", a2 = "[object DataView]", s2 = /^\[object .+?Constructor\]$/, u2 = /^(?:0|[1-9]\d*)$/, l2 = "\\ud800-\\udfff", c2 = "\\u0300-\\u036f\\ufe20-\\ufe23", d2 = "\\u20d0-\\u20f0", f2 = "\\ufe0e\\ufe0f", p2 = "[" + l2 + "]", h2 = "[" + c2 + d2 + "]", g2 = "\\ud83c[\\udffb-\\udfff]", v2 = "[^" + l2 + "]", m2 = "(?:\\ud83c[\\udde6-\\uddff]){2}", b2 = "[\\ud800-\\udbff][\\udc00-\\udfff]", E2 = "\\u200d", w2 = "(?:" + h2 + "|" + g2 + ")?", C2 = "[" + f2 + "]?", D2 = C2 + w2 + ("(?:" + E2 + "(?:" + [v2, m2, b2].join("|") + ")" + C2 + w2 + ")*"), A2 = "(?:" + [v2 + h2 + "?", h2, m2, b2, p2].join("|") + ")", S2 = RegExp(g2 + "(?=" + g2 + ")|" + A2 + D2, "g"), x2 = RegExp("[" + E2 + l2 + c2 + d2 + f2 + "]"), O2 = "object" == typeof y && y && y.Object === Object && y, N2 = "object" == typeof self && self && self.Object === Object && self, B2 = O2 || N2 || Function("return this")();
function T2(e6, t3) {
return (function(e7, t4) {
for (var n3 = -1, r3 = e7 ? e7.length : 0, o3 = Array(r3); ++n3 < r3; ) o3[n3] = t4(e7[n3], n3, e7);
return o3;
})(t3, function(t4) {
return e6[t4];
});
}
function k2(e6) {
var t3 = -1, n3 = Array(e6.size);
return e6.forEach(function(e7, r3) {
n3[++t3] = [r3, e7];
}), n3;
}
function F2(e6) {
var t3 = -1, n3 = Array(e6.size);
return e6.forEach(function(e7) {
n3[++t3] = e7;
}), n3;
}
function P2(e6) {
return (function(e7) {
return x2.test(e7);
})(e6) ? (function(e7) {
return e7.match(S2) || [];
})(e6) : (function(e7) {
return e7.split("");
})(e6);
}
var I2, R2, _2 = Function.prototype, L2 = Object.prototype, M2 = B2["__core-js_shared__"], j2 = (function() {
var e6 = /[^.]+$/.exec(M2 && M2.keys && M2.keys.IE_PROTO || "");
return e6 ? "Symbol(src)_1." + e6 : "";
})(), H2 = _2.toString, z2 = L2.hasOwnProperty, $2 = L2.toString, U2 = RegExp("^" + H2.call(z2).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), V2 = B2.Symbol, W2 = V2 ? V2.iterator : void 0, G2 = L2.propertyIsEnumerable, q2 = (I2 = Object.keys, R2 = Object, function(e6) {
return I2(R2(e6));
}), K2 = se2(B2, "DataView"), Y2 = se2(B2, "Map"), X2 = se2(B2, "Promise"), Z2 = se2(B2, "Set"), J2 = se2(B2, "WeakMap"), Q2 = ce2(K2), ee2 = ce2(Y2), te2 = ce2(X2), ne2 = ce2(Z2), re2 = ce2(J2);
function oe2(e6, n3) {
var r3 = de2(e6) || (function(e7) {
return (function(e8) {
return ge2(e8) && fe2(e8);
})(e7) && z2.call(e7, "callee") && (!G2.call(e7, "callee") || $2.call(e7) == t2);
})(e6) ? (function(e7, t3) {
for (var n4 = -1, r4 = Array(e7); ++n4 < e7; ) r4[n4] = t3(n4);
return r4;
})(e6.length, String) : [], o3 = r3.length, i3 = !!o3;
for (var a3 in e6) !z2.call(e6, a3) || i3 && ("length" == a3 || le2(a3, o3)) || r3.push(a3);
return r3;
}
function ie2(e6) {
if (!he2(e6) || (function(e7) {
return !!j2 && j2 in e7;
})(e6)) return false;
var t3 = pe2(e6) || (function(e7) {
var t4 = false;
if (null != e7 && "function" != typeof e7.toString) try {
t4 = !!(e7 + "");
} catch (e8) {
}
return t4;
})(e6) ? U2 : s2;
return t3.test(ce2(e6));
}
function ae2(e6) {
if (n3 = (t3 = e6) && t3.constructor, r3 = "function" == typeof n3 && n3.prototype || L2, t3 !== r3) return q2(e6);
var t3, n3, r3, o3 = [];
for (var i3 in Object(e6)) z2.call(e6, i3) && "constructor" != i3 && o3.push(i3);
return o3;
}
function se2(e6, t3) {
var n3 = (function(e7, t4) {
return null == e7 ? void 0 : e7[t4];
})(e6, t3);
return ie2(n3) ? n3 : void 0;
}
var ue2 = function(e6) {
return $2.call(e6);
};
function le2(t3, n3) {
return !!(n3 = null == n3 ? e5 : n3) && ("number" == typeof t3 || u2.test(t3)) && t3 > -1 && t3 % 1 == 0 && t3 < n3;
}
function ce2(e6) {
if (null != e6) {
try {
return H2.call(e6);
} catch (e7) {
}
try {
return e6 + "";
} catch (e7) {
}
}
return "";
}
(K2 && ue2(new K2(new ArrayBuffer(1))) != a2 || Y2 && ue2(new Y2()) != n2 || X2 && ue2(X2.resolve()) != r2 || Z2 && ue2(new Z2()) != o2 || J2 && ue2(new J2()) != i2) && (ue2 = function(e6) {
var t3 = $2.call(e6), s3 = "[object Object]" == t3 ? e6.constructor : void 0, u3 = s3 ? ce2(s3) : void 0;
if (u3) switch (u3) {
case Q2:
return a2;
case ee2:
return n2;
case te2:
return r2;
case ne2:
return o2;
case re2:
return i2;
}
return t3;
});
var de2 = Array.isArray;
function fe2(t3) {
return null != t3 && (function(t4) {
return "number" == typeof t4 && t4 > -1 && t4 % 1 == 0 && t4 <= e5;
})(t3.length) && !pe2(t3);
}
function pe2(e6) {
var t3 = he2(e6) ? $2.call(e6) : "";
return "[object Function]" == t3 || "[object GeneratorFunction]" == t3;
}
function he2(e6) {
var t3 = typeof e6;
return !!e6 && ("object" == t3 || "function" == t3);
}
function ge2(e6) {
return !!e6 && "object" == typeof e6;
}
function ve2(e6) {
return e6 ? T2(e6, (function(e7) {
return fe2(e7) ? oe2(e7) : ae2(e7);
})(e6)) : [];
}
return fy = function(e6) {
if (!e6) return [];
if (fe2(e6)) return (function(e7) {
return "string" == typeof e7 || !de2(e7) && ge2(e7) && "[object String]" == $2.call(e7);
})(e6) ? P2(e6) : (function(e7, t4) {
var n3 = -1, r3 = e7.length;
for (t4 || (t4 = Array(r3)); ++n3 < r3; ) t4[n3] = e7[n3];
return t4;
})(e6);
if (W2 && e6[W2]) return (function(e7) {
for (var t4, n3 = []; !(t4 = e7.next()).done; ) n3.push(t4.value);
return n3;
})(e6[W2]());
var t3 = ue2(e6);
return (t3 == n2 ? k2 : t3 == o2 ? F2 : ve2)(e6);
}, fy;
})(), yy = b(my), by = 0, Ey = function() {
this.id = "".concat(by++);
}, wy = "undefined" != typeof navigator && /Mac OS X/.test(navigator.userAgent), Cy = "undefined" != typeof navigator && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Dy = "undefined" != typeof navigator && /^((?!chrome|android).)*safari/i.test(navigator.userAgent), Ay = "undefined" != typeof navigator && /Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent), Sy = "undefined" != typeof navigator && /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent), xy = "undefined" != typeof navigator && /Chrome/i.test(navigator.userAgent), Oy = !Sy && !Ay && "undefined" != typeof globalThis && globalThis.InputEvent && "function" == typeof globalThis.InputEvent.prototype.getTargetRanges, Ny = function(e5, t2) {
return Boolean(e5.compareDocumentPosition(t2) & Im.DOCUMENT_POSITION_PRECEDING);
}, By = function(e5, t2) {
return Boolean(e5.compareDocumentPosition(t2) & Im.DOCUMENT_POSITION_FOLLOWING);
}, Ty = { getWindow: function(e5) {
var t2 = Bv.get(e5);
if (!t2) throw new Error("Unable to find a host window element for this editor");
return t2;
}, findKey: function(e5, t2) {
var n2 = Nv.get(t2);
return n2 || (n2 = new Ey(), Nv.set(t2, n2)), n2;
}, setNewKey: function(e5) {
var t2 = new Ey();
Nv.set(e5, t2);
}, findPath: function(e5, t2) {
for (var n2 = [], r2 = t2; ; ) {
var o2 = Dv.get(r2);
if (null == o2) {
if (hh.isEditor(r2)) return n2;
break;
}
var i2 = Cv.get(r2);
if (null == i2) break;
n2.unshift(i2), r2 = o2;
}
throw new Error("Unable to find the path for Slate node: ".concat(JSON.stringify(t2)));
}, findDocumentOrShadowRoot: function(e5) {
if (e5.isDestroyed) return window.document;
var t2 = Ty.toDOMNode(e5, e5), n2 = t2.getRootNode();
return "[object HTMLDocument]" !== Pm(n2) && !(function(e6) {
return "[object ShadowRoot]" === Pm(e6);
})(n2) || null == Reflect.get(n2, "getSelection") ? t2.ownerDocument : n2;
}, getParentNode: function(e5, t2) {
return Dv.get(t2) || null;
}, getParentsNodes: function(e5, t2) {
for (var n2 = [], r2 = t2; r2 !== e5 && null != r2; ) {
var o2 = Ty.getParentNode(e5, r2);
if (null == o2) break;
n2.push(o2), r2 = o2;
}
return n2;
}, getTopNode: function(e5, t2) {
var n2 = [Ty.findPath(e5, t2)[0]];
return Pp.get(e5, n2);
}, toDOMNode: function(e5, t2) {
var n2;
if (hh.isEditor(t2)) n2 = Av.get(e5);
else {
var r2 = Ty.findKey(e5, t2);
n2 = xv.get(r2);
}
if (!n2) throw new Error("Cannot resolve a DOM node from Slate node: ".concat(JSON.stringify(t2)));
return n2;
}, hasDOMNode: function(e5, t2, n2) {
void 0 === n2 && (n2 = {});
var r2, o2 = n2.editable, i2 = void 0 !== o2 && o2, a2 = Ty.toDOMNode(e5, e5);
try {
r2 = jm(t2) ? t2 : t2.parentElement;
} catch (e6) {
if (e6 instanceof Error && !e6.message.includes('Permission denied to access property "nodeType"')) throw e6;
}
return !!r2 && (r2.closest("[data-slate-editor]") === a2 && (!i2 || r2.isContentEditable || r2.closest('[contenteditable="false"]') === a2 || !!r2.getAttribute("data-slate-zero-width")) || !!r2.getAttribute("data-slate-string"));
}, toDOMRange: function(e5, t2) {
var n2 = t2.anchor, r2 = t2.focus, o2 = xp.isBackward(t2), i2 = Ty.toDOMPoint(e5, n2), a2 = xp.isCollapsed(t2) ? i2 : Ty.toDOMPoint(e5, r2), s2 = Ty.getWindow(e5).document.createRange(), u2 = Ig(o2 ? a2 : i2, 2), l2 = u2[0], c2 = u2[1], d2 = Ig(o2 ? i2 : a2, 2), f2 = d2[0], p2 = d2[1], h2 = !!(jm(l2) ? l2 : l2.parentElement).getAttribute("data-slate-zero-width"), g2 = !!(jm(f2) ? f2 : f2.parentElement).getAttribute("data-slate-zero-width");
return s2.setStart(l2, h2 ? 1 : c2), s2.setEnd(f2, g2 ? 1 : p2), s2;
}, toDOMPoint: function(e5, t2) {
var n2, r2, o2, i2 = Ig(hh.node(e5, t2.path), 1)[0], a2 = Ty.toDOMNode(e5, i2);
hh.void(e5, { at: t2 }) && (t2 = { path: t2.path, offset: 0 });
var s2 = Array.from(a2.querySelectorAll("[data-slate-string], [data-slate-zero-width]")), u2 = 0;
try {
for (var l2 = Pg(s2), c2 = l2.next(); !c2.done; c2 = l2.next()) {
var d2 = c2.value, f2 = d2.childNodes[0];
if (null != f2 && null != f2.textContent) {
var p2 = f2.textContent.length, h2 = d2.getAttribute("data-slate-length"), g2 = u2 + (null == h2 ? p2 : parseInt(h2, 10));
if (t2.offset <= g2) {
o2 = [f2, Math.min(p2, Math.max(0, t2.offset - u2))];
break;
}
u2 = g2;
}
}
} catch (e6) {
n2 = { error: e6 };
} finally {
try {
c2 && !c2.done && (r2 = l2.return) && r2.call(l2);
} finally {
if (n2) throw n2.error;
}
}
if (!o2) throw new Error("Cannot resolve a DOM point from Slate point: ".concat(JSON.stringify(t2)));
return o2;
}, toSlateNode: function(e5, t2) {
var n2 = jm(t2) ? t2 : t2.parentElement;
n2 && !n2.hasAttribute("data-slate-node") && (n2 = n2.closest("[data-slate-node]"));
var r2 = n2 ? Sv.get(n2) : null;
if (!r2) throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n2));
return r2;
}, findEventRange: function(e5, t2) {
"nativeEvent" in t2 && (t2 = t2.nativeEvent);
var n2 = t2.clientX, r2 = t2.clientY, o2 = t2.target;
if (null == n2 || null == r2) throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t2));
var i2, a2 = Ty.toSlateNode(e5, t2.target), s2 = Ty.findPath(e5, a2);
if (Np.isElement(a2) && hh.isVoid(e5, a2)) {
var u2 = o2.getBoundingClientRect(), l2 = e5.isInline(a2) ? n2 - u2.left < u2.left + u2.width - n2 : r2 - u2.top < u2.top + u2.height - r2, c2 = hh.point(e5, s2, { edge: l2 ? "start" : "end" }), d2 = l2 ? hh.before(e5, c2) : hh.after(e5, c2);
if (d2) return hh.range(e5, d2);
}
var f2 = this.getWindow(e5).document;
if (f2.caretRangeFromPoint) i2 = f2.caretRangeFromPoint(n2, r2);
else {
var p2 = f2.caretPositionFromPoint(n2, r2);
p2 && ((i2 = f2.createRange()).setStart(p2.offsetNode, p2.offset), i2.setEnd(p2.offsetNode, p2.offset));
}
if (!i2) throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t2));
return Ty.toSlateRange(e5, i2, { exactMatch: false, suppressThrow: false });
}, toSlateRange: function(e5, t2, n2) {
var r2, o2, i2, a2, s2, u2 = n2.exactMatch, l2 = n2.suppressThrow;
if ((Hm(t2) ? t2.anchorNode : t2.startContainer) && (Hm(t2) ? (r2 = t2.anchorNode, o2 = t2.anchorOffset, i2 = t2.focusNode, a2 = t2.focusOffset, s2 = xy && window.document.activeElement && window.document.activeElement.shadowRoot ? t2.anchorNode === t2.focusNode && t2.anchorOffset === t2.focusOffset : t2.isCollapsed) : (r2 = t2.startContainer, o2 = t2.startOffset, i2 = t2.endContainer, a2 = t2.endOffset, s2 = t2.collapsed)), null == r2 || null == i2 || null == o2 || null == a2) throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t2));
var c2 = Ty.toSlatePoint(e5, [r2, o2], { exactMatch: u2, suppressThrow: l2 });
if (!c2) return null;
var d2 = s2 ? c2 : Ty.toSlatePoint(e5, [i2, a2], { exactMatch: u2, suppressThrow: l2, searchDirection: Ny(r2, i2) || r2 === i2 && a2 < o2 ? "forward" : "backward" });
if (!d2) return null;
var f2 = { anchor: c2, focus: d2 };
return xp.isExpanded(f2) && xp.isForward(f2) && jm(i2) && hh.void(e5, { at: f2.focus, mode: "highest" }) && (f2 = hh.unhangRange(e5, f2, { voids: true })), f2;
}, toSlatePoint: function(e5, t2, n2) {
var r2, o2, i2, a2 = n2.exactMatch, s2 = n2.suppressThrow, u2 = Ig(a2 ? t2 : (function(e6) {
var t3, n3 = Ig(e6, 2), r3 = n3[0], o3 = n3[1];
if (jm(r3) && r3.childNodes.length) {
var i3 = o3 === r3.childNodes.length, a3 = i3 ? o3 - 1 : o3;
for (r3 = (t3 = Ig(Um(r3, a3, i3 ? "backward" : "forward"), 2))[0], i3 = (a3 = t3[1]) < o3; jm(r3) && r3.childNodes.length; ) {
var s3 = i3 ? r3.childNodes.length - 1 : 0;
r3 = Vm(r3, s3, i3 ? "backward" : "forward");
}
o3 = i3 && null != r3.textContent ? r3.textContent.length : 0;
}
return [r3, o3];
})(t2), 2), l2 = u2[0], c2 = u2[1], d2 = l2.parentNode, f2 = n2.searchDirection, p2 = null, h2 = 0;
if (d2) {
var g2 = Ty.toDOMNode(e5, e5), v2 = d2.closest('[data-slate-void="true"]'), m2 = v2 && g2.contains(v2) ? v2 : null, y2 = d2.closest('[contenteditable="false"]'), b2 = y2 && g2.contains(y2) ? y2 : null, E2 = d2.closest("[data-slate-leaf]"), w2 = null, C2 = Ty.getWindow(e5);
if (E2 && C2.document.createRange) {
p2 = E2.closest('[data-slate-node="text"]');
var D2 = C2.document.createRange();
D2.setStart(p2, 0), D2.setEnd(l2, c2);
var A2 = D2.cloneContents();
Rg(Rg([], Ig(yy(A2.querySelectorAll("[data-slate-zero-width]"))), false), Ig(yy(A2.querySelectorAll("[contenteditable=false]"))), false).forEach(function(e6) {
e6.parentNode.removeChild(e6);
}), h2 = A2.textContent.length, w2 = p2;
} else if (m2) E2 = Array.from(m2.querySelectorAll("[data-slate-leaf]")).find(function(t3) {
return Ty.hasDOMNode(e5, t3);
}) || null, E2 ? (p2 = E2.closest('[data-slate-node="text"]'), h2 = (w2 = E2).textContent.length, w2.querySelectorAll("[data-slate-zero-width]").forEach(function(e6) {
h2 -= e6.textContent.length;
})) : h2 = 1;
else if (b2) {
var S2 = function(t3) {
return t3 ? Array.from(t3.querySelectorAll("[data-slate-leaf]")).filter(function(t4) {
return Ty.hasDOMNode(e5, t4);
}) : [];
}, x2 = b2.closest('[data-slate-node="element"]');
if ("backward" === f2 || !f2) for (var O2 = (B2 = Rg(Rg([], Ig(S2(null == x2 ? void 0 : x2.previousElementSibling)), false), Ig(S2(x2)), false)).length - 1; O2 >= 0; O2 -= 1) {
var N2 = B2[O2];
if (Ny(b2, N2)) {
E2 = N2, f2 = "backward";
break;
}
}
if (!(E2 || "forward" !== f2 && f2)) {
var B2 = Rg(Rg([], Ig(S2(x2)), false), Ig(S2(null == x2 ? void 0 : x2.nextElementSibling)), false);
try {
for (var T2 = Pg(B2), k2 = T2.next(); !k2.done; k2 = T2.next()) {
N2 = k2.value;
if (By(b2, N2)) {
E2 = N2, f2 = "forward";
break;
}
}
} catch (e6) {
r2 = { error: e6 };
} finally {
try {
k2 && !k2.done && (o2 = T2.return) && o2.call(T2);
} finally {
if (r2) throw r2.error;
}
}
}
E2 && (p2 = E2.closest('[data-slate-node="text"]'), w2 = E2, "forward" === f2 ? h2 = 0 : (h2 = w2.textContent.length, w2.querySelectorAll("[data-slate-zero-width]").forEach(function(e6) {
h2 -= e6.textContent.length;
})));
}
w2 && h2 === w2.textContent.length && (d2.hasAttribute("data-slate-zero-width") || Cy && (null === (i2 = w2.textContent) || void 0 === i2 ? void 0 : i2.endsWith("\n"))) && (h2 -= 1);
}
if (!p2) {
if (s2) return null;
throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t2));
}
var F2, P2 = Ty.toSlateNode(e5, p2);
try {
F2 = Ty.findPath(e5, P2);
} catch (e6) {
if (s2) return null;
throw e6;
}
return { path: F2, offset: h2 };
}, hasRange: function(e5, t2) {
var n2 = t2.anchor, r2 = t2.focus;
return hh.hasPath(e5, n2.path) && hh.hasPath(e5, r2.path);
}, getNodeType: function(e5) {
return Np.isElement(e5) ? e5.type : "";
}, checkNodeType: function(e5, t2) {
return this.getNodeType(e5) === t2;
}, getNodesStr: function(e5) {
return e5.map(function(e6) {
return Pp.string(e6);
}).join("");
}, getSelectedElems: function(e5) {
var t2, n2, r2 = [], o2 = hh.nodes(e5, { universal: true });
try {
for (var i2 = Pg(o2), a2 = i2.next(); !a2.done; a2 = i2.next()) {
var s2 = Ig(a2.value, 1)[0];
Np.isElement(s2) && r2.push(s2);
}
} catch (e6) {
t2 = { error: e6 };
} finally {
try {
a2 && !a2.done && (n2 = i2.return) && n2.call(i2);
} finally {
if (t2) throw t2.error;
}
}
return r2;
}, getSelectedNodeByType: function(e5, t2) {
var n2 = this, r2 = Ig(hh.nodes(e5, { match: function(e6) {
return n2.checkNodeType(e6, t2);
}, universal: true }), 1), o2 = r2[0];
return null == o2 ? null : o2[0];
}, getSelectedTextNode: function(e5) {
var t2 = Ig(hh.nodes(e5, { match: function(e6) {
return Sh.isText(e6);
}, universal: true }), 1), n2 = t2[0];
return null == n2 ? null : n2[0];
}, isNodeSelected: function(e5, t2) {
var n2 = Ig(hh.nodes(e5, { match: function(e6) {
return e6 === t2;
}, universal: true }), 1), r2 = n2[0];
return null != r2 && Ig(r2, 1)[0] === t2;
}, isSelectionAtLineEnd: function(e5, t2) {
var n2 = e5.selection;
return !!n2 && (hh.isEnd(e5, n2.anchor, t2) || hh.isEnd(e5, n2.focus, t2));
}, getTextarea: function(e5) {
var t2 = sv.get(e5);
if (null == t2) throw new Error("Cannot find textarea instance by editor");
return t2;
}, getToolbar: function(e5) {
return cv.get(e5) || null;
}, getHoverbar: function(e5) {
return fv.get(e5) || null;
}, normalizeContent: function(e5) {
e5.children.forEach(function(t2, n2) {
e5.normalizeNode([t2, [n2]]);
});
}, getLeftLengthOfMaxLength: function(e5) {
var t2 = e5.getConfig(), n2 = t2.maxLength, r2 = t2.onMaxLength;
if ("number" != typeof n2 || n2 <= 0) return 1 / 0;
var o2 = n2 - e5.getText().replace(/\r|\n|(\r\n)|(\n\r)/g, "").length;
return o2 <= 0 && r2 && r2(e5), o2;
}, cleanExposedTexNodeInSelectionBlock: function(e5) {
var t2, n2, r2, o2, i2 = Ty.getTextarea(e5).$textArea, a2 = null == i2 ? void 0 : i2[0].childNodes;
if (a2) try {
for (var s2 = Pg(Array.from(a2)), u2 = s2.next(); !u2.done; u2 = s2.next()) {
var l2 = u2.value;
if (!zm(l2)) break;
l2.remove();
}
} catch (e6) {
t2 = { error: e6 };
} finally {
try {
u2 && !u2.done && (n2 = s2.return) && n2.call(s2);
} finally {
if (t2) throw t2.error;
}
}
var c2 = hh.nodes(e5, { match: function(t3) {
return !(!Np.isElement(t3) || e5.isInline(t3));
}, universal: true });
try {
for (var d2 = Pg(c2), f2 = d2.next(); !f2.done; f2 = d2.next()) {
var p2 = f2.value;
if (null != p2) {
var h2 = p2[0];
Gm(Ty.toDOMNode(e5, h2), function(e6, t3) {
var n3 = Kv(t3);
n3.attr("data-slate-string") || n3.attr("data-slate-zero-width") || n3.attr("data-w-e-reserve") || t3.removeChild(e6);
});
}
}
} catch (e6) {
r2 = { error: e6 };
} finally {
try {
f2 && !f2.done && (o2 = d2.return) && o2.call(d2);
} finally {
if (r2) throw r2.error;
}
}
}, isLastNode: function(e5, t2) {
var n2 = e5.children || [];
return n2[n2.length - 1] === t2;
}, genEmptyParagraph: function() {
return { type: "paragraph", children: [{ text: "" }] };
}, isSelectedVoidNode: function(e5) {
var t2, n2, r2 = hh.nodes(e5, { match: function(t3) {
return e5.isVoid(t3);
} }), o2 = 0;
try {
for (var i2 = Pg(r2), a2 = i2.next(); !a2.done; a2 = i2.next()) {
a2.value && (o2 += 1);
}
} catch (e6) {
t2 = { error: e6 };
} finally {
try {
a2 && !a2.done && (n2 = i2.return) && n2.call(i2);
} finally {
if (t2) throw t2.error;
}
}
return o2 > 0;
}, isSelectedEmptyParagraph: function(e5) {
var t2 = e5.selection;
if (null == t2) return false;
if (xp.isExpanded(t2)) return false;
var n2 = Ty.getSelectedNodeByType(e5, "paragraph");
if (null === n2) return false;
var r2 = n2.children;
return 1 === r2.length && ("" === r2[0].text || void 0);
}, isEmptyPath: function(e5, t2) {
var n2 = hh.node(e5, t2);
if (null == n2) return false;
var r2 = Ig(n2, 1)[0].children;
if (1 === r2.length && "" === r2[0].text) return true;
return false;
} };
function ky(e5, t2) {
return Np.isElement(e5) ? vy(e5, t2) : (function(e6, t3) {
var n2 = e6.text;
if (null == n2) throw new Error("Current node is not slate Text ".concat(JSON.stringify(e6)));
var r2 = n2;
r2 = (function(e7) {
return e7.replace(/ {2}/g, " ").replace(//g, ">").replace(/®/g, "®").replace(/©/g, "©").replace(/™/g, "™");
})(r2);
var o2 = Ty.getParentsNodes(t3, e6).some(function(e7) {
return "pre" === Ty.getNodeType(e7);
});
if (o2 || (r2 = r2.replace(/\n\r|\r\n|\r|\n/g, "
")), o2 && (r2 = r2.replace(/ /g, " ")), "" === r2) {
var i2 = Ty.getParentNode(null, e6);
if (!i2 || 0 !== i2.children.length) return r2;
r2 = "
";
}
return dy.forEach(function(n3) {
return r2 = n3(e6, r2, t3);
}), r2;
})(e5, t2);
}
var Fy = function(e5, t2) {
var n2 = (t2.top + t2.bottom) / 2;
return e5.top <= n2 && e5.bottom >= n2;
}, Py = function(e5, t2, n2) {
var r2 = Ty.toDOMRange(e5, t2).getBoundingClientRect(), o2 = Ty.toDOMRange(e5, n2).getBoundingClientRect();
return Fy(r2, o2) && Fy(o2, r2);
}, Iy = function(e5, t2) {
var n2, r2, o2 = [];
try {
for (var i2 = Pg(hh.levels(e5, { at: t2 })), a2 = i2.next(); !a2.done; a2 = i2.next()) {
var s2 = Ig(a2.value, 2), u2 = s2[0], l2 = s2[1], c2 = Ty.findKey(e5, u2);
o2.push([l2, c2]);
}
} catch (e6) {
n2 = { error: e6 };
} finally {
try {
a2 && !a2.done && (r2 = i2.return) && r2.call(i2);
} finally {
if (n2) throw n2.error;
}
}
return o2;
};
function Ry(e5, t2) {
e5.isInline(t2) ? (e5.insertNode(t2), "link" === t2.type && e5.insertFragment([{ text: "" }])) : $h.insertNodes(e5, t2, { mode: "highest" });
}
var _y, Ly, My, jy, Hy, zy, $y, Uy, Vy, Wy, Gy, qy, Ky, Yy, Xy, Zy, Jy, Qy, eb, tb, nb, rb, ob, ib, ab, sb, ub, lb, cb, db, fb, pb, hb, gb, vb, mb, yb, bb, Eb, wb, Cb = function(e5) {
var t2 = e5, n2 = t2.onChange, r2 = t2.insertText, o2 = t2.apply, i2 = t2.deleteBackward, a2 = t2.deleteFragment;
return t2.insertText = function(e6) {
t2.getConfig().readOnly || r2(e6);
}, t2.apply = function(e6) {
var n3, r3, i3, a3, s2, u2, l2, c2, d2 = [];
switch (e6.type) {
case "insert_text":
case "remove_text":
case "set_node":
case "split_node":
d2.push.apply(d2, Rg([], Ig(Iy(t2, e6.path)), false));
break;
case "insert_node":
case "remove_node":
d2.push.apply(d2, Rg([], Ig(Iy(t2, bp.parent(e6.path))), false));
break;
case "merge_node":
var f2 = bp.previous(e6.path);
d2.push.apply(d2, Rg([], Ig(Iy(t2, f2)), false));
break;
case "move_node":
var p2 = bp.common(bp.parent(e6.path), bp.parent(e6.newPath));
d2.push.apply(d2, Rg([], Ig(Iy(t2, p2)), false));
break;
case "set_selection":
(null === (a3 = null === (i3 = e6.newProperties) || void 0 === i3 ? void 0 : i3.focus) || void 0 === a3 ? void 0 : a3.path) && (d2.push.apply(d2, Rg([], Ig(Iy(t2, null === (u2 = null === (s2 = e6.newProperties) || void 0 === s2 ? void 0 : s2.focus) || void 0 === u2 ? void 0 : u2.path)), false)), d2.push.apply(d2, Rg([], Ig(Iy(t2, null === (c2 = null === (l2 = e6.properties) || void 0 === l2 ? void 0 : l2.focus) || void 0 === c2 ? void 0 : c2.path)), false)));
}
o2(e6);
try {
for (var h2 = Pg(d2), g2 = h2.next(); !g2.done; g2 = h2.next()) {
var v2 = Ig(g2.value, 2), m2 = v2[0], y2 = v2[1], b2 = Ig(hh.node(t2, m2), 1)[0];
Nv.set(b2, y2), "type" in b2 && (Ev.has(b2) && Ev.delete(b2), wv.has(b2) && wv.delete(b2));
}
} catch (e7) {
n3 = { error: e7 };
} finally {
try {
g2 && !g2.done && (r3 = h2.return) && r3.call(h2);
} finally {
if (n3) throw n3.error;
}
}
}, t2.deleteBackward = function(n3) {
if ("line" !== n3) return i2(n3);
if (e5.selection && xp.isCollapsed(e5.selection)) {
var r3 = hh.above(e5, { match: function(t3) {
return Np.isElement(t3) && hh.isBlock(e5, t3);
}, at: e5.selection });
if (r3) {
var o3 = Ig(r3, 2)[1], a3 = hh.range(e5, o3, e5.selection.anchor), s2 = (function(e6, t3) {
var n4 = hh.range(e6, xp.end(t3)), r4 = Array.from(hh.positions(e6, { at: t3 })), o4 = 0, i3 = r4.length, a4 = Math.floor(i3 / 2);
if (Py(e6, hh.range(e6, r4[o4]), n4)) return hh.range(e6, r4[o4], n4);
if (r4.length < 2) return hh.range(e6, r4[r4.length - 1], n4);
for (; a4 !== r4.length && a4 !== o4; ) Py(e6, hh.range(e6, r4[a4]), n4) ? i3 = a4 : o4 = a4, a4 = Math.floor((o4 + i3) / 2);
return hh.range(e6, r4[i3], n4);
})(t2, a3);
xp.isCollapsed(s2) || $h.delete(e5, { at: s2 });
}
}
}, t2.deleteFragment = function(e6) {
var n3 = (function(e7) {
var t3 = e7.selection;
if (null == t3 || xp.isCollapsed(t3)) return false;
var n4 = Ig(xp.edges(t3), 2), r3 = n4[0], o3 = n4[1], i3 = Ig(hh.edges(e7, []), 2), a3 = i3[0], s2 = i3[1];
return yh.equals(r3, a3) && yh.equals(o3, s2);
})(t2);
a2(e6), n3 && (!(function(e7) {
var t3 = [{ type: "paragraph", children: [{ text: "" }] }];
hh.withoutNormalizing(e7, function() {
for (var n4 = e7.children.length - 1; n4 >= 0; n4 -= 1) $h.removeNodes(e7, { at: [n4] });
$h.insertNodes(e7, t3, { at: [0] });
});
})(t2), t2.children.length > 0 && $h.select(t2, hh.start(t2, [])));
}, t2.onChange = function() {
var e6 = t2.selection;
null != e6 && kv.set(t2, e6), t2.emit(Qg), n2();
}, t2.handleTab = function() {
t2.insertText(" ");
}, t2.getHtml = function() {
var e6 = t2.children, n3 = void 0 === e6 ? [] : e6, r3 = t2.getConfig().skipCacheTypes, o3 = void 0 === r3 ? ["list-item"] : r3;
return n3.map(function(e7) {
var n4 = Ty.getNodeType(e7);
if (o3.includes(n4)) return ky(e7, t2);
var r4 = wv.get(e7);
if (r4) return r4;
var i3 = ky(e7, t2);
return wv.set(e7, i3), i3;
}).join("");
}, t2.getText = function() {
var e6 = t2.children;
return (void 0 === e6 ? [] : e6).map(function(e7) {
return Pp.string(e7);
}).join("\n");
}, t2.getSelectionText = function() {
var n3 = t2.selection;
return null == n3 ? "" : hh.string(e5, n3);
}, t2.getElemsByType = function(e6, n3) {
var r3, o3;
void 0 === n3 && (n3 = false);
var i3 = [], a3 = hh.nodes(t2, { at: [], universal: true });
try {
for (var s2 = Pg(a3), u2 = s2.next(); !u2.done; u2 = s2.next()) {
var l2 = Ig(u2.value, 1)[0];
if (Np.isElement(l2)) {
if (n3 ? l2.type.indexOf(e6) >= 0 : l2.type === e6) {
var c2 = Ty.findKey(t2, l2), d2 = cy(l2.type, c2.id);
i3.push(Tg(Tg({}, l2), { id: d2 }));
}
}
}
} catch (e7) {
r3 = { error: e7 };
} finally {
try {
u2 && !u2.done && (o3 = s2.return) && o3.call(s2);
} finally {
if (r3) throw r3.error;
}
}
return i3;
}, t2.getElemsByTypePrefix = function(e6) {
return t2.getElemsByType(e6, true);
}, t2.isEmpty = function() {
var e6 = t2.children, n3 = void 0 === e6 ? [] : e6;
if (n3.length > 1) return false;
var r3 = n3[0];
if (null == r3) return true;
if (!Np.isElement(r3) || "paragraph" !== r3.type) return false;
var o3 = r3.children, i3 = void 0 === o3 ? [] : o3;
if (i3.length > 1) return false;
var a3 = i3[0];
return null == a3 || Sh.isText(a3) && "" === a3.text;
}, t2.clear = function() {
$h.delete(t2, { at: { anchor: hh.start(t2, []), focus: hh.end(t2, []) } }), 0 !== t2.children.length ? (function(e6) {
var t3 = e6.children[0];
if (1 === e6.children.length && Np.isElement(t3) && ("paragraph" !== t3.type || "" !== Pp.string(t3)) && "" === Pp.string(t3)) {
var n3 = [{ type: "paragraph", children: [{ text: "" }] }];
hh.withoutNormalizing(e6, function() {
$h.removeNodes(e6, { at: [0] }), $h.insertNodes(e6, n3, { at: [0] });
});
}
})(t2) : $h.insertNodes(t2, [{ type: "paragraph", children: [{ text: "" }] }]);
}, t2.getParentNode = function(e6) {
return Ty.getParentNode(t2, e6);
}, t2.dangerouslyInsertHtml = function(e6, n3) {
if (void 0 === e6 && (e6 = ""), void 0 === n3 && (n3 = false), e6) {
var r3 = document.createElement("div");
r3.innerHTML = e6;
var o3 = Array.from(r3.childNodes);
if (o3 = o3.filter(function(e7) {
var t3 = e7.nodeName;
return !!zm(e7) || !!jm(e7) && !Lv.has(t3.toLowerCase());
}), 0 !== o3.length) {
var i3 = t2.selection;
if (null != i3) {
var a3 = null;
if (Ty.isSelectedEmptyParagraph(t2) && !n3) a3 = [i3.focus.path[0]];
r3.setAttribute("hidden", "true"), document.body.appendChild(r3);
var s2 = 0;
o3.forEach(function(e7, n4) {
var r4 = e7.nodeName, i4 = e7.textContent, a4 = void 0 === i4 ? "" : i4;
if (zm(e7)) {
if (!a4 || !a4.trim()) return;
t2.insertNode({ text: a4 });
} else if ("BR" !== r4) {
var u2 = e7, l2 = false;
if (Xm.includes(r4.toLowerCase())) l2 = true;
else for (var c2 in Qm) if (u2.matches(c2)) {
l2 = true;
break;
}
if (l2) {
var d2 = sy(Kv(u2), t2);
return Array.isArray(d2) ? (d2.forEach(function(e8) {
return Ry(t2, e8);
}), s2 += 1) : (Ry(t2, d2), s2 += 1), void (Ty.isSelectedVoidNode(t2) && t2.move(1));
}
var f2 = window.getComputedStyle(u2).display;
if (!Ty.isSelectedEmptyParagraph(t2) && f2.indexOf("inline") < 0) {
if (n4 >= 1) (function(e8) {
return "matches" in e8 && /^[ou]l$/i.test(e8.tagName) && !e8.hasAttribute("data-w-e-type");
})(o3[n4 - 1]) && t2.insertBreak();
t2.insertBreak();
}
t2.dangerouslyInsertHtml(u2.innerHTML, true);
} else t2.insertText("\n");
}), s2 && a3 && Ty.isEmptyPath(t2, a3) && $h.removeNodes(t2, { at: a3 }), r3.remove();
}
}
}
}, t2.setHtml = function(e6) {
void 0 === e6 && (e6 = "");
var n3 = t2.isDisabled(), r3 = t2.isFocused(), o3 = JSON.stringify(t2.selection);
t2.enable(), kv.delete(t2), t2.focus(), t2.clear();
var i3 = ly(t2, null == e6 ? "" : e6);
if ($h.insertFragment(t2, i3), r3 || (t2.deselect(), t2.blur()), n3 && (t2.deselect(), t2.disable()), t2.isFocused()) try {
var a3 = JSON.parse(o3);
xp.isRange(a3) && Ty.hasRange(t2, a3) ? t2.select(a3) : t2.select(hh.start(t2, []));
} catch (e7) {
t2.select(hh.start(t2, []));
}
}, t2;
}, Db = 1, Ab = function(e5) {
var t2 = e5;
return t2.id = "wangEditor-".concat(Db), Db += 1, t2.isDestroyed = false, t2.isFullScreen = false, t2.focus = function(e6) {
if (Ty.toDOMNode(t2, t2).focus({ preventScroll: true }), Tv.set(t2, true), e6) {
var n2 = hh.end(t2, []);
$h.select(t2, n2);
} else {
var r2 = kv.get(t2);
r2 ? $h.select(t2, r2) : $h.select(t2, hh.start(t2, []));
}
}, t2.isFocused = function() {
return !!Tv.get(t2);
}, t2.blur = function() {
Ty.toDOMNode(t2, t2).blur(), $h.deselect(t2), Tv.set(t2, false);
}, t2.updateView = function() {
Ty.getTextarea(t2).changeViewState();
var e6 = Ty.getToolbar(t2);
e6 && e6.changeToolbarState();
var n2 = Ty.getHoverbar(t2);
n2 && n2.changeHoverbarState();
}, t2.destroy = function() {
if (!t2.isDestroyed) {
var e6 = Ty.getTextarea(t2);
e6.destroy(), sv.delete(t2), uv.delete(e6);
var n2 = Ty.getToolbar(t2);
n2 && (n2.destroy(), cv.delete(t2), lv.delete(n2));
var r2 = Ty.getHoverbar(t2);
r2 && (r2.destroy(), fv.delete(t2), dv.delete(r2)), t2.isDestroyed = true, t2.emit(Jg);
}
}, t2.scrollToElem = function(e6) {
if (!t2.getConfig().scroll) {
var n2 = "编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能";
return n2 += "\nYou has disabled editor scroll, please do this yourself", void console.warn(n2);
}
var r2 = Kv("#".concat(e6));
if (0 !== r2.length) {
var o2 = r2[0];
if (!Ty.hasDOMNode(t2, o2)) {
n2 = "Element (found by id is '".concat(e6, "') is not in editor DOM");
return n2 += "\n 通过 id '".concat(e6, "' 找到的 element 不在 editor DOM 之内"), void console.error(n2, o2);
}
var i2 = Ty.getTextarea(t2), a2 = i2.$textAreaContainer, s2 = i2.$scroll, u2 = r2.offset().top, l2 = a2.offset().top;
s2[0].scrollBy({ top: u2 - l2, behavior: "smooth" });
}
}, t2.showProgressBar = function(e6) {
e6 < 1 || Ty.getTextarea(t2).changeProgress(e6);
}, t2.hidePanelOrModal = function() {
var e6 = hv.get(t2);
null != e6 && e6.forEach(function(e7) {
return e7.hide();
});
}, t2.enable = function() {
t2.getConfig().readOnly = false, t2.updateView();
}, t2.disable = function() {
t2.getConfig().readOnly = true, t2.updateView();
}, t2.isDisabled = function() {
return t2.getConfig().readOnly;
}, t2.toDOMNode = function(e6) {
return Ty.toDOMNode(t2, e6);
}, t2.fullScreen = function() {
if (!t2.isFullScreen) {
var e6 = null, n2 = Ty.getToolbar(t2);
n2 && (e6 = n2.$box);
var r2 = Ty.getTextarea(t2).$box.parent();
if (e6 && e6.parent()[0] !== r2[0]) {
throw new Error("Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent\n不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致");
}
r2.addClass("w-e-full-screen-container");
var o2 = r2.css("z-index");
r2.attr("data-z-index", o2.toString()), t2.isFullScreen = true, t2.emit(tv);
}
}, t2.unFullScreen = function() {
if (t2.isFullScreen) {
var e6 = Ty.getTextarea(t2).$box.parent();
setTimeout(function() {
e6.removeClass("w-e-full-screen-container"), t2.isFullScreen = false, t2.emit(nv);
}, 200);
}
}, t2.getEditableContainer = function() {
return Ty.getTextarea(t2).$textAreaContainer[0];
}, t2;
}, Sb = { exports: {} }, xb = { exports: {} };
function Ob() {
if (Ly) return _y;
Ly = 1;
return _y = function(e5) {
return null != e5;
};
}
function Nb() {
if (zy) return Hy;
zy = 1;
var e5 = (function() {
if (jy) return My;
jy = 1;
var e6 = Ob(), t2 = { object: true, function: true, undefined: true };
return My = function(n2) {
return !!e6(n2) && hasOwnProperty.call(t2, typeof n2);
};
})();
return Hy = function(t2) {
if (!e5(t2)) return false;
try {
return !!t2.constructor && t2.constructor.prototype === t2;
} catch (e6) {
return false;
}
};
}
function Bb() {
if (Wy) return Vy;
Wy = 1;
var e5 = (function() {
if (Uy) return $y;
Uy = 1;
var e6 = Nb();
return $y = function(t3) {
if ("function" != typeof t3) return false;
if (!hasOwnProperty.call(t3, "length")) return false;
try {
if ("number" != typeof t3.length) return false;
if ("function" != typeof t3.call) return false;
if ("function" != typeof t3.apply) return false;
} catch (e7) {
return false;
}
return !e6(t3);
};
})(), t2 = /^\s*class[\s{/}]/, n2 = Function.prototype.toString;
return Vy = function(r2) {
return !!e5(r2) && !t2.test(n2.call(r2));
};
}
function Tb() {
if (Qy) return Jy;
Qy = 1;
var e5 = (Zy ? Xy : (Zy = 1, Xy = function() {
}))();
return Jy = function(t2) {
return t2 !== e5 && null !== t2;
}, Jy;
}
function kb() {
return rb || (rb = 1, nb = (Yy ? Ky : (Yy = 1, Ky = function() {
try {
return Object.keys("primitive"), true;
} catch (e5) {
return false;
}
}))() ? Object.keys : (function() {
if (tb) return eb;
tb = 1;
var e5 = Tb(), t2 = Object.keys;
return eb = function(n2) {
return t2(e5(n2) ? Object(n2) : n2);
};
})()), nb;
}
function Fb() {
if (sb) return ab;
sb = 1;
var e5 = kb(), t2 = (function() {
if (ib) return ob;
ib = 1;
var e6 = Tb();
return ob = function(t3) {
if (!e6(t3)) throw new TypeError("Cannot use null or undefined");
return t3;
};
})(), n2 = Math.max;
return ab = function(r2, o2) {
var i2, a2, s2, u2 = n2(arguments.length, 2);
for (r2 = Object(t2(r2)), s2 = function(e6) {
try {
r2[e6] = o2[e6];
} catch (e7) {
i2 || (i2 = e7);
}
}, a2 = 1; a2 < u2; ++a2) e5(o2 = arguments[a2]).forEach(s2);
if (void 0 !== i2) throw i2;
return r2;
}, ab;
}
function Pb() {
return lb ? ub : (lb = 1, ub = (qy || (qy = 1, Gy = function() {
var e5, t2 = Object.assign;
return "function" == typeof t2 && (t2(e5 = { foo: "raz" }, { bar: "dwa" }, { trzy: "trzy" }), e5.foo + e5.bar + e5.trzy === "razdwatrzy");
}), Gy)() ? Object.assign : Fb());
}
function Ib() {
return mb || (mb = 1, vb = (function() {
if (pb) return fb;
pb = 1;
var e5 = "razdwatrzy";
return fb = function() {
return "function" == typeof e5.contains && true === e5.contains("dwa") && false === e5.contains("foo");
};
})()() ? String.prototype.contains : (function() {
if (gb) return hb;
gb = 1;
var e5 = String.prototype.indexOf;
return hb = function(t2) {
return e5.call(this, t2, arguments[1]) > -1;
}, hb;
})()), vb;
}
function Rb() {
if (yb) return xb.exports;
yb = 1;
var e5 = Ob(), t2 = Bb(), n2 = Pb(), r2 = (function() {
if (db) return cb;
db = 1;
var e6 = Tb(), t3 = Array.prototype.forEach, n3 = Object.create;
return cb = function(r3) {
var o3 = n3(null);
return t3.call(arguments, function(t4) {
e6(t4) && (function(e7, t5) {
var n4;
for (n4 in e7) t5[n4] = e7[n4];
})(Object(t4), o3);
}), o3;
}, cb;
})(), o2 = Ib(), i2 = xb.exports = function(t3, i3) {
var a2, s2, u2, l2, c2;
return arguments.length < 2 || "string" != typeof t3 ? (l2 = i3, i3 = t3, t3 = null) : l2 = arguments[2], e5(t3) ? (a2 = o2.call(t3, "c"), s2 = o2.call(t3, "e"), u2 = o2.call(t3, "w")) : (a2 = u2 = true, s2 = false), c2 = { value: i3, configurable: a2, enumerable: s2, writable: u2 }, l2 ? n2(r2(l2), c2) : c2;
};
return i2.gs = function(i3, a2, s2) {
var u2, l2, c2, d2;
return "string" != typeof i3 ? (c2 = s2, s2 = a2, a2 = i3, i3 = null) : c2 = arguments[3], e5(a2) ? t2(a2) ? e5(s2) ? t2(s2) || (c2 = s2, s2 = void 0) : s2 = void 0 : (c2 = a2, a2 = s2 = void 0) : a2 = void 0, e5(i3) ? (u2 = o2.call(i3, "c"), l2 = o2.call(i3, "e")) : (u2 = true, l2 = false), d2 = { get: a2, set: s2, configurable: u2, enumerable: l2 }, c2 ? n2(r2(c2), d2) : d2;
}, xb.exports;
}
var _b = (wb || (wb = 1, (function(e5, t2) {
var n2, r2, o2, i2, a2, s2, u2, l2 = Rb(), c2 = Eb ? bb : (Eb = 1, bb = function(e6) {
if ("function" != typeof e6) throw new TypeError(e6 + " is not a function");
return e6;
}), d2 = Function.prototype.apply, f2 = Function.prototype.call, p2 = Object.create, h2 = Object.defineProperty, g2 = Object.defineProperties, v2 = Object.prototype.hasOwnProperty, m2 = { configurable: true, enumerable: false, writable: true };
n2 = function(e6, t3) {
var n3;
return c2(t3), v2.call(this, "__ee__") ? n3 = this.__ee__ : (n3 = m2.value = p2(null), h2(this, "__ee__", m2), m2.value = null), n3[e6] ? "object" == typeof n3[e6] ? n3[e6].push(t3) : n3[e6] = [n3[e6], t3] : n3[e6] = t3, this;
}, r2 = function(e6, t3) {
var r3, i3;
return c2(t3), i3 = this, n2.call(this, e6, r3 = function() {
o2.call(i3, e6, r3), d2.call(t3, this, arguments);
}), r3.__eeOnceListener__ = t3, this;
}, o2 = function(e6, t3) {
var n3, r3, o3, i3;
if (c2(t3), !v2.call(this, "__ee__")) return this;
if (!(n3 = this.__ee__)[e6]) return this;
if ("object" == typeof (r3 = n3[e6])) for (i3 = 0; o3 = r3[i3]; ++i3) o3 !== t3 && o3.__eeOnceListener__ !== t3 || (2 === r3.length ? n3[e6] = r3[i3 ? 0 : 1] : r3.splice(i3, 1));
else r3 !== t3 && r3.__eeOnceListener__ !== t3 || delete n3[e6];
return this;
}, i2 = function(e6) {
var t3, n3, r3, o3, i3;
if (v2.call(this, "__ee__") && (o3 = this.__ee__[e6])) if ("object" == typeof o3) {
for (n3 = arguments.length, i3 = new Array(n3 - 1), t3 = 1; t3 < n3; ++t3) i3[t3 - 1] = arguments[t3];
for (o3 = o3.slice(), t3 = 0; r3 = o3[t3]; ++t3) d2.call(r3, this, i3);
} else switch (arguments.length) {
case 1:
f2.call(o3, this);
break;
case 2:
f2.call(o3, this, arguments[1]);
break;
case 3:
f2.call(o3, this, arguments[1], arguments[2]);
break;
default:
for (n3 = arguments.length, i3 = new Array(n3 - 1), t3 = 1; t3 < n3; ++t3) i3[t3 - 1] = arguments[t3];
d2.call(o3, this, i3);
}
}, a2 = { on: n2, once: r2, off: o2, emit: i2 }, s2 = { on: l2(n2), once: l2(r2), off: l2(o2), emit: l2(i2) }, u2 = g2({}, s2), e5.exports = t2 = function(e6) {
return null == e6 ? p2(u2) : g2(Object(e6), s2);
}, t2.methods = a2;
})(Sb, Sb.exports)), Sb.exports), Lb = b(_b);
function Mb(e5) {
var t2 = Fv.get(e5);
return null == t2 && (t2 = Lb(), Fv.set(e5, t2)), t2;
}
var jb = /* @__PURE__ */ new WeakMap();
function Hb(e5, t2) {
var n2 = jb.get(e5);
null == n2 && (n2 = /* @__PURE__ */ new Set(), jb.set(e5, n2)), n2.add(t2);
}
var zb = function(e5) {
var t2 = e5;
return t2.on = function(e6, n2) {
var r2 = Mb(t2);
if (r2.on(e6, n2), "destroyed" === e6 && Hb(t2, n2), "destroyed" !== e6) {
var o2 = function() {
return r2.off(e6, n2);
};
r2.on("destroyed", o2), Hb(t2, o2);
}
}, t2.once = function(e6, n2) {
Mb(t2).once(e6, n2);
}, t2.off = function(e6, n2) {
Mb(t2).off(e6, n2);
}, t2.emit = function(e6) {
for (var n2 = [], r2 = 1; r2 < arguments.length; r2++) n2[r2 - 1] = arguments[r2];
var o2 = Mb(t2);
if (o2.emit.apply(o2, Rg([e6], Ig(n2), false)), "destroyed" === e6) {
var i2 = (function(e7) {
return jb.get(e7) || /* @__PURE__ */ new Set();
})(t2);
i2.forEach(function(e7) {
return o2.off("destroyed", e7);
}), (function(e7) {
jb.set(e7, /* @__PURE__ */ new Set());
})(t2);
}
}, t2;
};
var $b = function(e5) {
var t2 = e5;
return t2.setFragmentData = function(e6) {
var n2 = t2.selection;
if (n2) {
var r2 = Ig(xp.edges(n2), 2), o2 = r2[0], i2 = r2[1], a2 = hh.void(t2, { at: o2.path }), s2 = hh.void(t2, { at: i2.path });
if (!xp.isCollapsed(n2) || a2) {
var u2 = Ty.toDOMRange(t2, n2), l2 = u2.cloneContents(), c2 = l2.childNodes[0];
if (l2.childNodes.forEach(function(e7) {
e7.textContent && "" !== e7.textContent.trim() && (c2 = e7);
}), s2) {
var d2 = Ig(s2, 1)[0], f2 = u2.cloneRange(), p2 = Ty.toDOMNode(t2, d2);
f2.setEndAfter(p2), l2 = f2.cloneContents();
}
if (a2 && (c2 = l2.querySelector("[data-slate-spacer]")), Array.from(l2.querySelectorAll("[data-slate-zero-width]")).forEach(function(e7) {
var t3 = "n" === e7.getAttribute("data-slate-zero-width");
e7.textContent = t3 ? "\n" : "";
}), zm(c2)) {
var h2 = c2.ownerDocument.createElement("span");
h2.style.whiteSpace = "pre", h2.appendChild(c2), l2.appendChild(h2), c2 = h2;
}
var g2 = t2.getFragment(), v2 = JSON.stringify(g2), m2 = window.btoa(encodeURIComponent(v2));
c2.setAttribute("data-slate-fragment", m2), e6.setData("application/x-slate-fragment", m2);
var y2 = l2.ownerDocument.createElement("div");
return y2.appendChild(l2), y2.setAttribute("hidden", "true"), l2.ownerDocument.body.appendChild(y2), e6.setData("text/html", y2.innerHTML), e6.setData("text/plain", Wm(y2)), l2.ownerDocument.body.removeChild(y2), e6;
}
}
}, t2.insertData = function(e6) {
var n2 = e6.getData("application/x-slate-fragment");
if (n2) {
var r2 = decodeURIComponent(window.atob(n2)), o2 = JSON.parse(r2);
t2.insertFragment(o2);
} else {
var i2 = e6.getData("text/plain"), a2 = e6.getData("text/html");
if (a2) {
var s2 = t2.getConfig().sanitizeHtml;
t2.dangerouslyInsertHtml(s2 ? s2(a2) : a2);
} else if (i2) {
if (!/[\r\n]/.test(i2)) return void t2.insertText(i2);
var u2 = (function(e7) {
return e7.replace(/\n\r|\r\n|\r/g, "\n").split("\n").map(function(e8) {
return { type: "paragraph", children: [{ text: e8 }] };
});
})(i2);
t2.insertFragment(u2);
}
}
}, t2;
};
function Ub(e5) {
return e5.replace(/\n\r|\r\n|\r|\n/g, "").length;
}
function Vb(e5, t2) {
var n2, r2;
if (t2 <= 0) return "";
var o2 = t2, i2 = "";
try {
for (var a2 = Pg(e5), s2 = a2.next(); !s2.done; s2 = a2.next()) {
var u2 = s2.value;
if (/\r|\n/.test(u2)) i2 += u2;
else {
if (o2 <= 0) break;
i2 += u2, o2 -= 1;
}
}
} catch (e6) {
n2 = { error: e6 };
} finally {
try {
s2 && !s2.done && (r2 = a2.return) && r2.call(a2);
} finally {
if (n2) throw n2.error;
}
}
return i2;
}
var Wb = function(e5) {
var t2 = e5, n2 = t2.insertText, r2 = t2.insertNode, o2 = t2.insertFragment, i2 = t2.dangerouslyInsertHtml;
return t2.insertText = function(e6) {
if (t2.getConfig().maxLength) {
var r3 = Ty.getLeftLengthOfMaxLength(t2);
r3 <= 0 || (r3 < e6.length ? n2(e6.slice(0, r3)) : n2(e6));
} else n2(e6);
}, t2.insertNode = function(e6) {
if (t2.getConfig().maxLength) {
var n3 = Ty.getLeftLengthOfMaxLength(t2);
if (!(n3 <= 0)) n3 < Pp.string(e6).length || r2(e6);
} else r2(e6);
}, t2.insertFragment = function(e6) {
if (t2.getConfig().maxLength) {
if (e6.length > 0) {
var n3 = e6[0];
if (Ty.getLeftLengthOfMaxLength(t2) < Pp.string(n3).length) return;
o2([n3]);
for (var r3 = 1; r3 < e6.length; r3 += 1) t2.insertNode(e6[r3]);
}
} else o2(e6);
}, t2.dangerouslyInsertHtml = function(e6, n3) {
if (void 0 === e6 && (e6 = ""), void 0 === n3 && (n3 = false), e6) if (t2.getConfig().maxLength) {
var r3 = Ty.getLeftLengthOfMaxLength(t2);
if (!(r3 <= 0)) {
var o3 = (function(e7, t3) {
if (t3 <= 0) return "";
var n4 = document.createElement("div");
n4.innerHTML = e7;
var r4 = function(e8) {
e8.forEach(function(e9) {
return e9.remove();
});
}, o4 = function(e8) {
for (var n5 = Array.from(e8.childNodes), i3 = 0; i3 < n5.length; i3 += 1) {
var a2 = n5[i3];
if (zm(a2)) {
var s2 = a2.textContent || "", u2 = Ub(s2);
if (u2 <= t3) {
t3 -= u2;
continue;
}
return a2.textContent = Vb(s2, t3), t3 = 0, r4(n5.slice(i3 + 1)), false;
}
if (jm(a2)) {
if (Lv.has(a2.nodeName.toLowerCase())) {
a2.remove();
continue;
}
if (!o4(a2)) return r4(n5.slice(i3 + 1)), false;
} else a2.remove();
}
return t3 > 0;
};
return o4(n4), n4.innerHTML;
})(e6, r3);
o3 && i2(o3, n3);
}
} else i2(e6, n3);
}, t2;
};
function Gb(e5) {
var t2 = Ty.getTextarea(e5).$textAreaContainer, n2 = t2.width(), r2 = t2.height(), o2 = t2.offset();
return { top: o2.top, left: o2.left, width: n2, height: r2 };
}
function qb(e5) {
var t2 = { top: "0", left: "0" }, n2 = e5.selection;
if (null == n2) return t2;
var r2 = Gb(e5);
if (null == r2) return t2;
var o2 = r2.top, i2 = r2.left, a2 = r2.width, s2 = r2.height, u2 = Ty.toDOMRange(e5, n2).getClientRects(), l2 = u2 ? u2[0] : null;
if (null == l2) return t2;
var c2 = {}, d2 = l2.top - o2, f2 = l2.left - i2;
if (f2 > a2 / 2) {
var p2 = a2 - f2;
c2.right = "".concat(p2 + 5, "px");
} else c2.left = "".concat(f2 + 5, "px");
if (d2 > s2 / 2) {
var h2 = s2 - d2;
c2.bottom = "".concat(h2 + 5, "px");
} else {
var g2 = u2[u2.length - 1], v2 = g2.top - o2 + g2.height;
v2 < 0 && (v2 = 0), c2.top = "".concat(v2 + 5, "px");
}
return c2;
}
function Kb(e5, t2, n2) {
void 0 === n2 && (n2 = "modal");
var r2 = { top: "0", left: "0" };
if (null == e5.selection) return r2;
var o2 = Np.isElement(t2) && e5.isVoid(t2), i2 = Np.isElement(t2) && e5.isInline(t2), a2 = Ov.get(t2);
if (null == a2) return r2;
var s2 = a2.getBoundingClientRect(), u2 = s2.top, l2 = s2.left, c2 = s2.height, d2 = s2.width;
if (o2) {
var f2 = (function(e6) {
var t3 = [];
t3.push(e6);
for (var n3 = 0; t3.length > 0; ) {
var r3 = t3.pop();
if (null == r3) break;
if ((n3 += 1) > 1e4) break;
var o3 = r3.nodeName;
if (r3.nodeType === Fm.ELEMENT_NODE) {
var i3 = o3.toLowerCase();
if (Nm.includes(i3) || "iframe" === i3 || "video" === i3) return r3;
var a3 = r3.children || [], s3 = a3.length;
if (s3) for (var u3 = s3 - 1; u3 >= 0; u3 -= 1) t3.push(a3[u3]);
}
}
return null;
})(a2);
if (null != f2) {
var p2 = f2.getBoundingClientRect();
u2 = p2.top, c2 = p2.height;
}
}
var h2 = Gb(e5);
if (null == h2) return r2;
var g2 = h2.top, v2 = h2.left, m2 = h2.width, y2 = h2.height, b2 = {}, E2 = u2 - g2, w2 = l2 - v2;
if ("bar" === n2) return b2.left = "".concat(w2, "px"), E2 > 40 ? b2.bottom = "".concat(y2 - E2 + 5, "px") : b2.top = "".concat(E2 + c2 + 5, "px"), b2;
if ("modal" === n2) {
if (o2 ? i2 ? w2 > (m2 - d2) / 2 ? b2.right = "".concat(m2 - w2 + 5, "px") : b2.left = "".concat(w2 + d2 + 5, "px") : b2.left = "20px" : b2.left = "".concat(w2, "px"), o2) (C2 = E2) < 0 && (C2 = 0), b2.top = "".concat(C2, "px");
else if (E2 > (y2 - c2) / 2) b2.bottom = "".concat(y2 - E2 + 5, "px");
else {
var C2;
(C2 = E2 + c2) < 0 && (C2 = 0), b2.top = "".concat(C2 + 5, "px");
}
return b2;
}
throw new Error("type '".concat(n2, "' is invalid"));
}
function Yb(e5, t2) {
Tm(function() {
var n2 = Gb(e5);
if (null != n2) {
var r2, o2 = n2.top, i2 = n2.left, a2 = n2.width, s2 = n2.height, u2 = t2.offset(), l2 = u2.top, c2 = u2.left, d2 = t2.width(), f2 = t2.height(), p2 = l2 - o2, h2 = c2 - i2, g2 = t2.attr("style");
if (g2.indexOf("top") >= 0) {
if ((r2 = p2 + f2 - s2) > 0) {
var v2 = t2.css("top"), m2 = parseInt(v2.toString(), 10) - r2;
m2 < 0 && (m2 = 0), t2.css("top", "".concat(m2, "px"));
}
}
if (g2.indexOf("bottom") >= 0 && l2 < 0) {
var y2 = t2.css("bottom"), b2 = parseInt(y2.toString(), 10) - Math.abs(l2);
t2.css("bottom", "".concat(b2, "px"));
}
if (g2.indexOf("left") >= 0) {
if ((r2 = h2 + d2 - a2) > 0) {
var E2 = t2.css("left"), w2 = parseInt(E2.toString(), 10) - r2;
w2 < 0 && (w2 = 0), t2.css("left", "".concat(w2, "px"));
}
}
if (g2.indexOf("right") >= 0 && c2 < 0) {
var C2 = t2.css("right"), D2 = parseInt(C2.toString(), 10) - Math.abs(c2);
t2.css("right", "".concat(D2, "px"));
}
}
});
}
var Xb, Zb, Jb = function(e5) {
var t2 = e5, n2 = t2.select, r2 = t2.deselect, o2 = t2.move;
return t2.select = function(e6) {
n2(e6);
}, t2.deselect = function() {
var e6 = t2.selection, n3 = Ty.findDocumentOrShadowRoot(t2).getSelection();
n3 && n3.rangeCount > 0 && Ty.hasDOMNode(t2, n3.anchorNode) && Ty.hasDOMNode(t2, n3.focusNode) && n3.removeAllRanges(), e6 && r2();
}, t2.move = function(e6, t3) {
void 0 === t3 && (t3 = false), "number" == typeof e6 ? e6 && (e6 < 0 || o2({ distance: e6, unit: "character", reverse: t3 })) : o2(e6);
}, t2.moveReverse = function(e6) {
t2.move(e6, true);
}, t2.restoreSelection = function() {
var e6 = kv.get(t2);
null != e6 && (t2.focus(), n2(e6));
}, t2.getSelectionPosition = function() {
return qb(t2);
}, t2.getNodePosition = function(e6) {
return Kb(t2, e6);
}, t2.isSelectedAll = function() {
var e6 = t2.selection;
if (null == e6) return false;
var n3 = Ig(xp.edges(e6), 2), r3 = n3[0], o3 = n3[1], i2 = Ig(hh.edges(t2, []), 2), a2 = i2[0], s2 = i2[1];
return !(!yh.equals(r3, a2) || !yh.equals(o3, s2));
}, t2.selectAll = function() {
var e6 = hh.start(t2, []), r3 = hh.end(t2, []);
n2({ anchor: e6, focus: r3 });
}, t2;
};
var Qb = (function() {
if (Zb) return Xb;
Zb = 1;
var e5 = /^\s+|\s+$/g, t2 = /^[-+]0x[0-9a-f]+$/i, n2 = /^0b[01]+$/i, r2 = /^0o[0-7]+$/i, o2 = parseInt, i2 = "object" == typeof y && y && y.Object === Object && y, a2 = "object" == typeof self && self && self.Object === Object && self, s2 = i2 || a2 || Function("return this")(), u2 = Object.prototype.toString, l2 = Math.max, c2 = Math.min, d2 = function() {
return s2.Date.now();
};
function f2(e6) {
var t3 = typeof e6;
return !!e6 && ("object" == t3 || "function" == t3);
}
function p2(i3) {
if ("number" == typeof i3) return i3;
if ((function(e6) {
return "symbol" == typeof e6 || /* @__PURE__ */ (function(e7) {
return !!e7 && "object" == typeof e7;
})(e6) && "[object Symbol]" == u2.call(e6);
})(i3)) return NaN;
if (f2(i3)) {
var a3 = "function" == typeof i3.valueOf ? i3.valueOf() : i3;
i3 = f2(a3) ? a3 + "" : a3;
}
if ("string" != typeof i3) return 0 === i3 ? i3 : +i3;
i3 = i3.replace(e5, "");
var s3 = n2.test(i3);
return s3 || r2.test(i3) ? o2(i3.slice(2), s3 ? 2 : 8) : t2.test(i3) ? NaN : +i3;
}
return Xb = function(e6, t3, n3) {
var r3, o3, i3, a3, s3, u3, h2 = 0, g2 = false, v2 = false, m2 = true;
if ("function" != typeof e6) throw new TypeError("Expected a function");
function y2(t4) {
var n4 = r3, i4 = o3;
return r3 = o3 = void 0, h2 = t4, a3 = e6.apply(i4, n4);
}
function b2(e7) {
var n4 = e7 - u3;
return void 0 === u3 || n4 >= t3 || n4 < 0 || v2 && e7 - h2 >= i3;
}
function E2() {
var e7 = d2();
if (b2(e7)) return w2(e7);
s3 = setTimeout(E2, (function(e8) {
var n4 = t3 - (e8 - u3);
return v2 ? c2(n4, i3 - (e8 - h2)) : n4;
})(e7));
}
function w2(e7) {
return s3 = void 0, m2 && r3 ? y2(e7) : (r3 = o3 = void 0, a3);
}
function C2() {
var e7 = d2(), n4 = b2(e7);
if (r3 = arguments, o3 = this, u3 = e7, n4) {
if (void 0 === s3) return (function(e8) {
return h2 = e8, s3 = setTimeout(E2, t3), g2 ? y2(e8) : a3;
})(u3);
if (v2) return s3 = setTimeout(E2, t3), y2(u3);
}
return void 0 === s3 && (s3 = setTimeout(E2, t3)), a3;
}
return t3 = p2(t3) || 0, f2(n3) && (g2 = !!n3.leading, i3 = (v2 = "maxWait" in n3) ? l2(p2(n3.maxWait) || 0, t3) : i3, m2 = "trailing" in n3 ? !!n3.trailing : m2), C2.cancel = function() {
void 0 !== s3 && clearTimeout(s3), h2 = 0, r3 = u3 = o3 = s3 = void 0;
}, C2.flush = function() {
return void 0 === s3 ? a3 : w2(d2());
}, C2;
}, Xb;
})(), eE = b(Qb);
const tE = (e5) => "string" == typeof e5, nE = () => {
let e5, t2;
const n2 = new Promise((n3, r2) => {
e5 = n3, t2 = r2;
});
return n2.resolve = e5, n2.reject = t2, n2;
}, rE = (e5) => null == e5 ? "" : "" + e5, oE = /###/g, iE = (e5) => e5 && e5.indexOf("###") > -1 ? e5.replace(oE, ".") : e5, aE = (e5) => !e5 || tE(e5), sE = (e5, t2, n2) => {
const r2 = tE(t2) ? t2.split(".") : t2;
let o2 = 0;
for (; o2 < r2.length - 1; ) {
if (aE(e5)) return {};
const t3 = iE(r2[o2]);
!e5[t3] && n2 && (e5[t3] = new n2()), e5 = Object.prototype.hasOwnProperty.call(e5, t3) ? e5[t3] : {}, ++o2;
}
return aE(e5) ? {} : { obj: e5, k: iE(r2[o2]) };
}, uE = (e5, t2, n2) => {
const { obj: r2, k: o2 } = sE(e5, t2, Object);
if (void 0 !== r2 || 1 === t2.length) return void (r2[o2] = n2);
let i2 = t2[t2.length - 1], a2 = t2.slice(0, t2.length - 1), s2 = sE(e5, a2, Object);
for (; void 0 === s2.obj && a2.length; ) i2 = `${a2[a2.length - 1]}.${i2}`, a2 = a2.slice(0, a2.length - 1), s2 = sE(e5, a2, Object), s2 && s2.obj && void 0 !== s2.obj[`${s2.k}.${i2}`] && (s2.obj = void 0);
s2.obj[`${s2.k}.${i2}`] = n2;
}, lE = (e5, t2) => {
const { obj: n2, k: r2 } = sE(e5, t2);
if (n2) return n2[r2];
}, cE = (e5, t2, n2) => {
for (const r2 in t2) "__proto__" !== r2 && "constructor" !== r2 && (r2 in e5 ? tE(e5[r2]) || e5[r2] instanceof String || tE(t2[r2]) || t2[r2] instanceof String ? n2 && (e5[r2] = t2[r2]) : cE(e5[r2], t2[r2], n2) : e5[r2] = t2[r2]);
return e5;
}, dE = (e5) => e5.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
var fE = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/" };
const pE = (e5) => tE(e5) ? e5.replace(/[&<>"'\/]/g, (e6) => fE[e6]) : e5;
const hE = [" ", ",", "?", "!", ";"], gE = new class {
constructor(e5) {
this.capacity = e5, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
}
getRegExp(e5) {
const t2 = this.regExpMap.get(e5);
if (void 0 !== t2) return t2;
const n2 = new RegExp(e5);
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e5, n2), this.regExpQueue.push(e5), n2;
}
}(20), vE = function(e5, t2) {
let n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : ".";
if (!e5) return;
if (e5[t2]) return e5[t2];
const r2 = t2.split(n2);
let o2 = e5;
for (let e6 = 0; e6 < r2.length; ) {
if (!o2 || "object" != typeof o2) return;
let t3, i2 = "";
for (let a2 = e6; a2 < r2.length; ++a2) if (a2 !== e6 && (i2 += n2), i2 += r2[a2], t3 = o2[i2], void 0 !== t3) {
if (["string", "number", "boolean"].indexOf(typeof t3) > -1 && a2 < r2.length - 1) continue;
e6 += a2 - e6 + 1;
break;
}
o2 = t3;
}
return o2;
}, mE = (e5) => e5 && e5.replace("_", "-"), yE = { type: "logger", log(e5) {
this.output("log", e5);
}, warn(e5) {
this.output("warn", e5);
}, error(e5) {
this.output("error", e5);
}, output(e5, t2) {
console && console[e5] && console[e5].apply(console, t2);
} };
class bE {
constructor(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
this.init(e5, t2);
}
init(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
this.prefix = t2.prefix || "i18next:", this.logger = e5 || yE, this.options = t2, this.debug = t2.debug;
}
log() {
for (var e5 = arguments.length, t2 = new Array(e5), n2 = 0; n2 < e5; n2++) t2[n2] = arguments[n2];
return this.forward(t2, "log", "", true);
}
warn() {
for (var e5 = arguments.length, t2 = new Array(e5), n2 = 0; n2 < e5; n2++) t2[n2] = arguments[n2];
return this.forward(t2, "warn", "", true);
}
error() {
for (var e5 = arguments.length, t2 = new Array(e5), n2 = 0; n2 < e5; n2++) t2[n2] = arguments[n2];
return this.forward(t2, "error", "");
}
deprecate() {
for (var e5 = arguments.length, t2 = new Array(e5), n2 = 0; n2 < e5; n2++) t2[n2] = arguments[n2];
return this.forward(t2, "warn", "WARNING DEPRECATED: ", true);
}
forward(e5, t2, n2, r2) {
return r2 && !this.debug ? null : (tE(e5[0]) && (e5[0] = `${n2}${this.prefix} ${e5[0]}`), this.logger[t2](e5));
}
create(e5) {
return new bE(this.logger, { prefix: `${this.prefix}:${e5}:`, ...this.options });
}
clone(e5) {
return (e5 = e5 || this.options).prefix = e5.prefix || this.prefix, new bE(this.logger, e5);
}
}
var EE = new bE();
class wE {
constructor() {
this.observers = {};
}
on(e5, t2) {
return e5.split(" ").forEach((e6) => {
this.observers[e6] || (this.observers[e6] = /* @__PURE__ */ new Map());
const n2 = this.observers[e6].get(t2) || 0;
this.observers[e6].set(t2, n2 + 1);
}), this;
}
off(e5, t2) {
this.observers[e5] && (t2 ? this.observers[e5].delete(t2) : delete this.observers[e5]);
}
emit(e5) {
for (var t2 = arguments.length, n2 = new Array(t2 > 1 ? t2 - 1 : 0), r2 = 1; r2 < t2; r2++) n2[r2 - 1] = arguments[r2];
if (this.observers[e5]) {
Array.from(this.observers[e5].entries()).forEach((e6) => {
let [t3, r3] = e6;
for (let e7 = 0; e7 < r3; e7++) t3(...n2);
});
}
if (this.observers["*"]) {
Array.from(this.observers["*"].entries()).forEach((t3) => {
let [r3, o2] = t3;
for (let t4 = 0; t4 < o2; t4++) r3.apply(r3, [e5, ...n2]);
});
}
}
}
class CE extends wE {
constructor(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { ns: ["translation"], defaultNS: "translation" };
super(), this.data = e5 || {}, this.options = t2, void 0 === this.options.keySeparator && (this.options.keySeparator = "."), void 0 === this.options.ignoreJSONStructure && (this.options.ignoreJSONStructure = true);
}
addNamespaces(e5) {
this.options.ns.indexOf(e5) < 0 && this.options.ns.push(e5);
}
removeNamespaces(e5) {
const t2 = this.options.ns.indexOf(e5);
t2 > -1 && this.options.ns.splice(t2, 1);
}
getResource(e5, t2, n2) {
let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
const o2 = void 0 !== r2.keySeparator ? r2.keySeparator : this.options.keySeparator, i2 = void 0 !== r2.ignoreJSONStructure ? r2.ignoreJSONStructure : this.options.ignoreJSONStructure;
let a2;
e5.indexOf(".") > -1 ? a2 = e5.split(".") : (a2 = [e5, t2], n2 && (Array.isArray(n2) ? a2.push(...n2) : tE(n2) && o2 ? a2.push(...n2.split(o2)) : a2.push(n2)));
const s2 = lE(this.data, a2);
return !s2 && !t2 && !n2 && e5.indexOf(".") > -1 && (e5 = a2[0], t2 = a2[1], n2 = a2.slice(2).join(".")), !s2 && i2 && tE(n2) ? vE(this.data && this.data[e5] && this.data[e5][t2], n2, o2) : s2;
}
addResource(e5, t2, n2, r2) {
let o2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : { silent: false };
const i2 = void 0 !== o2.keySeparator ? o2.keySeparator : this.options.keySeparator;
let a2 = [e5, t2];
n2 && (a2 = a2.concat(i2 ? n2.split(i2) : n2)), e5.indexOf(".") > -1 && (a2 = e5.split("."), r2 = t2, t2 = a2[1]), this.addNamespaces(t2), uE(this.data, a2, r2), o2.silent || this.emit("added", e5, t2, n2, r2);
}
addResources(e5, t2, n2) {
let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : { silent: false };
for (const r3 in n2) (tE(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e5, t2, r3, n2[r3], { silent: true });
r2.silent || this.emit("added", e5, t2, n2);
}
addResourceBundle(e5, t2, n2, r2, o2) {
let i2 = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : { silent: false, skipCopy: false }, a2 = [e5, t2];
e5.indexOf(".") > -1 && (a2 = e5.split("."), r2 = n2, n2 = t2, t2 = a2[1]), this.addNamespaces(t2);
let s2 = lE(this.data, a2) || {};
i2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? cE(s2, n2, o2) : s2 = { ...s2, ...n2 }, uE(this.data, a2, s2), i2.silent || this.emit("added", e5, t2, n2);
}
removeResourceBundle(e5, t2) {
this.hasResourceBundle(e5, t2) && delete this.data[e5][t2], this.removeNamespaces(t2), this.emit("removed", e5, t2);
}
hasResourceBundle(e5, t2) {
return void 0 !== this.getResource(e5, t2);
}
getResourceBundle(e5, t2) {
return t2 || (t2 = this.options.defaultNS), "v1" === this.options.compatibilityAPI ? { ...this.getResource(e5, t2) } : this.getResource(e5, t2);
}
getDataByLanguage(e5) {
return this.data[e5];
}
hasLanguageSomeTranslations(e5) {
const t2 = this.getDataByLanguage(e5);
return !!(t2 && Object.keys(t2) || []).find((e6) => t2[e6] && Object.keys(t2[e6]).length > 0);
}
toJSON() {
return this.data;
}
}
var DE = { processors: {}, addPostProcessor(e5) {
this.processors[e5.name] = e5;
}, handle(e5, t2, n2, r2, o2) {
return e5.forEach((e6) => {
this.processors[e6] && (t2 = this.processors[e6].process(t2, n2, r2, o2));
}), t2;
} };
const AE = {};
class SE extends wE {
constructor(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
super(), ((e6, t3, n2) => {
e6.forEach((e7) => {
t3[e7] && (n2[e7] = t3[e7]);
});
})(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e5, this), this.options = t2, void 0 === this.options.keySeparator && (this.options.keySeparator = "."), this.logger = EE.create("translator");
}
changeLanguage(e5) {
e5 && (this.language = e5);
}
exists(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} };
if (null == e5) return false;
const n2 = this.resolve(e5, t2);
return n2 && void 0 !== n2.res;
}
extractFromKey(e5, t2) {
let n2 = void 0 !== t2.nsSeparator ? t2.nsSeparator : this.options.nsSeparator;
void 0 === n2 && (n2 = ":");
const r2 = void 0 !== t2.keySeparator ? t2.keySeparator : this.options.keySeparator;
let o2 = t2.ns || this.options.defaultNS || [];
const i2 = n2 && e5.indexOf(n2) > -1, a2 = !(this.options.userDefinedKeySeparator || t2.keySeparator || this.options.userDefinedNsSeparator || t2.nsSeparator || ((e6, t3, n3) => {
t3 = t3 || "", n3 = n3 || "";
const r3 = hE.filter((e7) => t3.indexOf(e7) < 0 && n3.indexOf(e7) < 0);
if (0 === r3.length) return true;
const o3 = gE.getRegExp(`(${r3.map((e7) => "?" === e7 ? "\\?" : e7).join("|")})`);
let i3 = !o3.test(e6);
if (!i3) {
const t4 = e6.indexOf(n3);
t4 > 0 && !o3.test(e6.substring(0, t4)) && (i3 = true);
}
return i3;
})(e5, n2, r2));
if (i2 && !a2) {
const t3 = e5.match(this.interpolator.nestingRegexp);
if (t3 && t3.length > 0) return { key: e5, namespaces: tE(o2) ? [o2] : o2 };
const i3 = e5.split(n2);
(n2 !== r2 || n2 === r2 && this.options.ns.indexOf(i3[0]) > -1) && (o2 = i3.shift()), e5 = i3.join(r2);
}
return { key: e5, namespaces: tE(o2) ? [o2] : o2 };
}
translate(e5, t2, n2) {
if ("object" != typeof t2 && this.options.overloadTranslationOptionHandler && (t2 = this.options.overloadTranslationOptionHandler(arguments)), "object" == typeof t2 && (t2 = { ...t2 }), t2 || (t2 = {}), null == e5) return "";
Array.isArray(e5) || (e5 = [String(e5)]);
const r2 = void 0 !== t2.returnDetails ? t2.returnDetails : this.options.returnDetails, o2 = void 0 !== t2.keySeparator ? t2.keySeparator : this.options.keySeparator, { key: i2, namespaces: a2 } = this.extractFromKey(e5[e5.length - 1], t2), s2 = a2[a2.length - 1], u2 = t2.lng || this.language, l2 = t2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
if (u2 && "cimode" === u2.toLowerCase()) {
if (l2) {
const e6 = t2.nsSeparator || this.options.nsSeparator;
return r2 ? { res: `${s2}${e6}${i2}`, usedKey: i2, exactUsedKey: i2, usedLng: u2, usedNS: s2, usedParams: this.getUsedParamsDetails(t2) } : `${s2}${e6}${i2}`;
}
return r2 ? { res: i2, usedKey: i2, exactUsedKey: i2, usedLng: u2, usedNS: s2, usedParams: this.getUsedParamsDetails(t2) } : i2;
}
const c2 = this.resolve(e5, t2);
let d2 = c2 && c2.res;
const f2 = c2 && c2.usedKey || i2, p2 = c2 && c2.exactUsedKey || i2, h2 = Object.prototype.toString.apply(d2), g2 = void 0 !== t2.joinArrays ? t2.joinArrays : this.options.joinArrays, v2 = !this.i18nFormat || this.i18nFormat.handleAsObject, m2 = !tE(d2) && "boolean" != typeof d2 && "number" != typeof d2;
if (!(v2 && d2 && m2 && ["[object Number]", "[object Function]", "[object RegExp]"].indexOf(h2) < 0) || tE(g2) && Array.isArray(d2)) if (v2 && tE(g2) && Array.isArray(d2)) d2 = d2.join(g2), d2 && (d2 = this.extendTranslation(d2, e5, t2, n2));
else {
let r3 = false, a3 = false;
const l3 = void 0 !== t2.count && !tE(t2.count), f3 = SE.hasDefaultValue(t2), p3 = l3 ? this.pluralResolver.getSuffix(u2, t2.count, t2) : "", h3 = t2.ordinal && l3 ? this.pluralResolver.getSuffix(u2, t2.count, { ordinal: false }) : "", g3 = l3 && !t2.ordinal && 0 === t2.count && this.pluralResolver.shouldUseIntlApi(), v3 = g3 && t2[`defaultValue${this.options.pluralSeparator}zero`] || t2[`defaultValue${p3}`] || t2[`defaultValue${h3}`] || t2.defaultValue;
!this.isValidLookup(d2) && f3 && (r3 = true, d2 = v3), this.isValidLookup(d2) || (a3 = true, d2 = i2);
const m3 = (t2.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && a3 ? void 0 : d2, y2 = f3 && v3 !== d2 && this.options.updateMissing;
if (a3 || r3 || y2) {
if (this.logger.log(y2 ? "updateKey" : "missingKey", u2, s2, i2, y2 ? v3 : d2), o2) {
const e7 = this.resolve(i2, { ...t2, keySeparator: false });
e7 && e7.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
}
let e6 = [];
const n3 = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t2.lng || this.language);
if ("fallback" === this.options.saveMissingTo && n3 && n3[0]) for (let t3 = 0; t3 < n3.length; t3++) e6.push(n3[t3]);
else "all" === this.options.saveMissingTo ? e6 = this.languageUtils.toResolveHierarchy(t2.lng || this.language) : e6.push(t2.lng || this.language);
const r4 = (e7, n4, r5) => {
const o3 = f3 && r5 !== d2 ? r5 : m3;
this.options.missingKeyHandler ? this.options.missingKeyHandler(e7, s2, n4, o3, y2, t2) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(e7, s2, n4, o3, y2, t2), this.emit("missingKey", e7, s2, n4, d2);
};
this.options.saveMissing && (this.options.saveMissingPlurals && l3 ? e6.forEach((e7) => {
const n4 = this.pluralResolver.getSuffixes(e7, t2);
g3 && t2[`defaultValue${this.options.pluralSeparator}zero`] && n4.indexOf(`${this.options.pluralSeparator}zero`) < 0 && n4.push(`${this.options.pluralSeparator}zero`), n4.forEach((n5) => {
r4([e7], i2 + n5, t2[`defaultValue${n5}`] || v3);
});
}) : r4(e6, i2, v3));
}
d2 = this.extendTranslation(d2, e5, t2, c2, n2), a3 && d2 === i2 && this.options.appendNamespaceToMissingKey && (d2 = `${s2}:${i2}`), (a3 || r3) && this.options.parseMissingKeyHandler && (d2 = "v1" !== this.options.compatibilityAPI ? this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${s2}:${i2}` : i2, r3 ? d2 : void 0) : this.options.parseMissingKeyHandler(d2));
}
else {
if (!t2.returnObjects && !this.options.returnObjects) {
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
const e6 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(f2, d2, { ...t2, ns: a2 }) : `key '${i2} (${this.language})' returned an object instead of string.`;
return r2 ? (c2.res = e6, c2.usedParams = this.getUsedParamsDetails(t2), c2) : e6;
}
if (o2) {
const e6 = Array.isArray(d2), n3 = e6 ? [] : {}, r3 = e6 ? p2 : f2;
for (const e7 in d2) if (Object.prototype.hasOwnProperty.call(d2, e7)) {
const i3 = `${r3}${o2}${e7}`;
n3[e7] = this.translate(i3, { ...t2, joinArrays: false, ns: a2 }), n3[e7] === i3 && (n3[e7] = d2[e7]);
}
d2 = n3;
}
}
return r2 ? (c2.res = d2, c2.usedParams = this.getUsedParamsDetails(t2), c2) : d2;
}
extendTranslation(e5, t2, n2, r2, o2) {
var i2 = this;
if (this.i18nFormat && this.i18nFormat.parse) e5 = this.i18nFormat.parse(e5, { ...this.options.interpolation.defaultVariables, ...n2 }, n2.lng || this.language || r2.usedLng, r2.usedNS, r2.usedKey, { resolved: r2 });
else if (!n2.skipInterpolation) {
n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } });
const a3 = tE(e5) && (n2 && n2.interpolation && void 0 !== n2.interpolation.skipOnVariables ? n2.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
let s3;
if (a3) {
const t3 = e5.match(this.interpolator.nestingRegexp);
s3 = t3 && t3.length;
}
let u2 = n2.replace && !tE(n2.replace) ? n2.replace : n2;
if (this.options.interpolation.defaultVariables && (u2 = { ...this.options.interpolation.defaultVariables, ...u2 }), e5 = this.interpolator.interpolate(e5, u2, n2.lng || this.language || r2.usedLng, n2), a3) {
const t3 = e5.match(this.interpolator.nestingRegexp);
s3 < (t3 && t3.length) && (n2.nest = false);
}
!n2.lng && "v1" !== this.options.compatibilityAPI && r2 && r2.res && (n2.lng = this.language || r2.usedLng), false !== n2.nest && (e5 = this.interpolator.nest(e5, function() {
for (var e6 = arguments.length, r3 = new Array(e6), a4 = 0; a4 < e6; a4++) r3[a4] = arguments[a4];
return o2 && o2[0] === r3[0] && !n2.context ? (i2.logger.warn(`It seems you are nesting recursively key: ${r3[0]} in key: ${t2[0]}`), null) : i2.translate(...r3, t2);
}, n2)), n2.interpolation && this.interpolator.reset();
}
const a2 = n2.postProcess || this.options.postProcess, s2 = tE(a2) ? [a2] : a2;
return null != e5 && s2 && s2.length && false !== n2.applyPostProcessor && (e5 = DE.handle(s2, e5, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e5;
}
resolve(e5) {
let t2, n2, r2, o2, i2, a2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return tE(e5) && (e5 = [e5]), e5.forEach((e6) => {
if (this.isValidLookup(t2)) return;
const s2 = this.extractFromKey(e6, a2), u2 = s2.key;
n2 = u2;
let l2 = s2.namespaces;
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
const c2 = void 0 !== a2.count && !tE(a2.count), d2 = c2 && !a2.ordinal && 0 === a2.count && this.pluralResolver.shouldUseIntlApi(), f2 = void 0 !== a2.context && (tE(a2.context) || "number" == typeof a2.context) && "" !== a2.context, p2 = a2.lngs ? a2.lngs : this.languageUtils.toResolveHierarchy(a2.lng || this.language, a2.fallbackLng);
l2.forEach((e7) => {
this.isValidLookup(t2) || (i2 = e7, !AE[`${p2[0]}-${e7}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(i2) && (AE[`${p2[0]}-${e7}`] = true, this.logger.warn(`key "${n2}" for languages "${p2.join(", ")}" won't get resolved as namespace "${i2}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), p2.forEach((n3) => {
if (this.isValidLookup(t2)) return;
o2 = n3;
const i3 = [u2];
if (this.i18nFormat && this.i18nFormat.addLookupKeys) this.i18nFormat.addLookupKeys(i3, u2, n3, e7, a2);
else {
let e8;
c2 && (e8 = this.pluralResolver.getSuffix(n3, a2.count, a2));
const t3 = `${this.options.pluralSeparator}zero`, r3 = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
if (c2 && (i3.push(u2 + e8), a2.ordinal && 0 === e8.indexOf(r3) && i3.push(u2 + e8.replace(r3, this.options.pluralSeparator)), d2 && i3.push(u2 + t3)), f2) {
const n4 = `${u2}${this.options.contextSeparator}${a2.context}`;
i3.push(n4), c2 && (i3.push(n4 + e8), a2.ordinal && 0 === e8.indexOf(r3) && i3.push(n4 + e8.replace(r3, this.options.pluralSeparator)), d2 && i3.push(n4 + t3));
}
}
let s3;
for (; s3 = i3.pop(); ) this.isValidLookup(t2) || (r2 = s3, t2 = this.getResource(n3, e7, s3, a2));
}));
});
}), { res: t2, usedKey: n2, exactUsedKey: r2, usedLng: o2, usedNS: i2 };
}
isValidLookup(e5) {
return !(void 0 === e5 || !this.options.returnNull && null === e5 || !this.options.returnEmptyString && "" === e5);
}
getResource(e5, t2, n2) {
let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e5, t2, n2, r2) : this.resourceStore.getResource(e5, t2, n2, r2);
}
getUsedParamsDetails() {
let e5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
const t2 = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], n2 = e5.replace && !tE(e5.replace);
let r2 = n2 ? e5.replace : e5;
if (n2 && void 0 !== e5.count && (r2.count = e5.count), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) {
r2 = { ...r2 };
for (const e6 of t2) delete r2[e6];
}
return r2;
}
static hasDefaultValue(e5) {
const t2 = "defaultValue";
for (const n2 in e5) if (Object.prototype.hasOwnProperty.call(e5, n2) && t2 === n2.substring(0, 12) && void 0 !== e5[n2]) return true;
return false;
}
}
const xE = (e5) => e5.charAt(0).toUpperCase() + e5.slice(1);
class OE {
constructor(e5) {
this.options = e5, this.supportedLngs = this.options.supportedLngs || false, this.logger = EE.create("languageUtils");
}
getScriptPartFromCode(e5) {
if (!(e5 = mE(e5)) || e5.indexOf("-") < 0) return null;
const t2 = e5.split("-");
return 2 === t2.length ? null : (t2.pop(), "x" === t2[t2.length - 1].toLowerCase() ? null : this.formatLanguageCode(t2.join("-")));
}
getLanguagePartFromCode(e5) {
if (!(e5 = mE(e5)) || e5.indexOf("-") < 0) return e5;
const t2 = e5.split("-");
return this.formatLanguageCode(t2[0]);
}
formatLanguageCode(e5) {
if (tE(e5) && e5.indexOf("-") > -1) {
if ("undefined" != typeof Intl && void 0 !== Intl.getCanonicalLocales) try {
let t3 = Intl.getCanonicalLocales(e5)[0];
if (t3 && this.options.lowerCaseLng && (t3 = t3.toLowerCase()), t3) return t3;
} catch (e6) {
}
const t2 = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
let n2 = e5.split("-");
return this.options.lowerCaseLng ? n2 = n2.map((e6) => e6.toLowerCase()) : 2 === n2.length ? (n2[0] = n2[0].toLowerCase(), n2[1] = n2[1].toUpperCase(), t2.indexOf(n2[1].toLowerCase()) > -1 && (n2[1] = xE(n2[1].toLowerCase()))) : 3 === n2.length && (n2[0] = n2[0].toLowerCase(), 2 === n2[1].length && (n2[1] = n2[1].toUpperCase()), "sgn" !== n2[0] && 2 === n2[2].length && (n2[2] = n2[2].toUpperCase()), t2.indexOf(n2[1].toLowerCase()) > -1 && (n2[1] = xE(n2[1].toLowerCase())), t2.indexOf(n2[2].toLowerCase()) > -1 && (n2[2] = xE(n2[2].toLowerCase()))), n2.join("-");
}
return this.options.cleanCode || this.options.lowerCaseLng ? e5.toLowerCase() : e5;
}
isSupportedCode(e5) {
return ("languageOnly" === this.options.load || this.options.nonExplicitSupportedLngs) && (e5 = this.getLanguagePartFromCode(e5)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e5) > -1;
}
getBestMatchFromCodes(e5) {
if (!e5) return null;
let t2;
return e5.forEach((e6) => {
if (t2) return;
const n2 = this.formatLanguageCode(e6);
this.options.supportedLngs && !this.isSupportedCode(n2) || (t2 = n2);
}), !t2 && this.options.supportedLngs && e5.forEach((e6) => {
if (t2) return;
const n2 = this.getLanguagePartFromCode(e6);
if (this.isSupportedCode(n2)) return t2 = n2;
t2 = this.options.supportedLngs.find((e7) => e7 === n2 ? e7 : e7.indexOf("-") < 0 && n2.indexOf("-") < 0 ? void 0 : e7.indexOf("-") > 0 && n2.indexOf("-") < 0 && e7.substring(0, e7.indexOf("-")) === n2 || 0 === e7.indexOf(n2) && n2.length > 1 ? e7 : void 0);
}), t2 || (t2 = this.getFallbackCodes(this.options.fallbackLng)[0]), t2;
}
getFallbackCodes(e5, t2) {
if (!e5) return [];
if ("function" == typeof e5 && (e5 = e5(t2)), tE(e5) && (e5 = [e5]), Array.isArray(e5)) return e5;
if (!t2) return e5.default || [];
let n2 = e5[t2];
return n2 || (n2 = e5[this.getScriptPartFromCode(t2)]), n2 || (n2 = e5[this.formatLanguageCode(t2)]), n2 || (n2 = e5[this.getLanguagePartFromCode(t2)]), n2 || (n2 = e5.default), n2 || [];
}
toResolveHierarchy(e5, t2) {
const n2 = this.getFallbackCodes(t2 || this.options.fallbackLng || [], e5), r2 = [], o2 = (e6) => {
e6 && (this.isSupportedCode(e6) ? r2.push(e6) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e6}`));
};
return tE(e5) && (e5.indexOf("-") > -1 || e5.indexOf("_") > -1) ? ("languageOnly" !== this.options.load && o2(this.formatLanguageCode(e5)), "languageOnly" !== this.options.load && "currentOnly" !== this.options.load && o2(this.getScriptPartFromCode(e5)), "currentOnly" !== this.options.load && o2(this.getLanguagePartFromCode(e5))) : tE(e5) && o2(this.formatLanguageCode(e5)), n2.forEach((e6) => {
r2.indexOf(e6) < 0 && o2(this.formatLanguageCode(e6));
}), r2;
}
}
let NE = [{ lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"], nr: [1, 2], fc: 1 }, { lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"], nr: [1, 2], fc: 2 }, { lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"], nr: [1], fc: 3 }, { lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"], nr: [1, 2, 5], fc: 4 }, { lngs: ["ar"], nr: [0, 1, 2, 3, 11, 100], fc: 5 }, { lngs: ["cs", "sk"], nr: [1, 2, 5], fc: 6 }, { lngs: ["csb", "pl"], nr: [1, 2, 5], fc: 7 }, { lngs: ["cy"], nr: [1, 2, 3, 8], fc: 8 }, { lngs: ["fr"], nr: [1, 2], fc: 9 }, { lngs: ["ga"], nr: [1, 2, 3, 7, 11], fc: 10 }, { lngs: ["gd"], nr: [1, 2, 3, 20], fc: 11 }, { lngs: ["is"], nr: [1, 2], fc: 12 }, { lngs: ["jv"], nr: [0, 1], fc: 13 }, { lngs: ["kw"], nr: [1, 2, 3, 4], fc: 14 }, { lngs: ["lt"], nr: [1, 2, 10], fc: 15 }, { lngs: ["lv"], nr: [1, 2, 0], fc: 16 }, { lngs: ["mk"], nr: [1, 2], fc: 17 }, { lngs: ["mnk"], nr: [0, 1, 2], fc: 18 }, { lngs: ["mt"], nr: [1, 2, 11, 20], fc: 19 }, { lngs: ["or"], nr: [2, 1], fc: 2 }, { lngs: ["ro"], nr: [1, 2, 20], fc: 20 }, { lngs: ["sl"], nr: [5, 1, 2, 3], fc: 21 }, { lngs: ["he", "iw"], nr: [1, 2, 20, 21], fc: 22 }], BE = { 1: (e5) => Number(e5 > 1), 2: (e5) => Number(1 != e5), 3: (e5) => 0, 4: (e5) => Number(e5 % 10 == 1 && e5 % 100 != 11 ? 0 : e5 % 10 >= 2 && e5 % 10 <= 4 && (e5 % 100 < 10 || e5 % 100 >= 20) ? 1 : 2), 5: (e5) => Number(0 == e5 ? 0 : 1 == e5 ? 1 : 2 == e5 ? 2 : e5 % 100 >= 3 && e5 % 100 <= 10 ? 3 : e5 % 100 >= 11 ? 4 : 5), 6: (e5) => Number(1 == e5 ? 0 : e5 >= 2 && e5 <= 4 ? 1 : 2), 7: (e5) => Number(1 == e5 ? 0 : e5 % 10 >= 2 && e5 % 10 <= 4 && (e5 % 100 < 10 || e5 % 100 >= 20) ? 1 : 2), 8: (e5) => Number(1 == e5 ? 0 : 2 == e5 ? 1 : 8 != e5 && 11 != e5 ? 2 : 3), 9: (e5) => Number(e5 >= 2), 10: (e5) => Number(1 == e5 ? 0 : 2 == e5 ? 1 : e5 < 7 ? 2 : e5 < 11 ? 3 : 4), 11: (e5) => Number(1 == e5 || 11 == e5 ? 0 : 2 == e5 || 12 == e5 ? 1 : e5 > 2 && e5 < 20 ? 2 : 3), 12: (e5) => Number(e5 % 10 != 1 || e5 % 100 == 11), 13: (e5) => Number(0 !== e5), 14: (e5) => Number(1 == e5 ? 0 : 2 == e5 ? 1 : 3 == e5 ? 2 : 3), 15: (e5) => Number(e5 % 10 == 1 && e5 % 100 != 11 ? 0 : e5 % 10 >= 2 && (e5 % 100 < 10 || e5 % 100 >= 20) ? 1 : 2), 16: (e5) => Number(e5 % 10 == 1 && e5 % 100 != 11 ? 0 : 0 !== e5 ? 1 : 2), 17: (e5) => Number(1 == e5 || e5 % 10 == 1 && e5 % 100 != 11 ? 0 : 1), 18: (e5) => Number(0 == e5 ? 0 : 1 == e5 ? 1 : 2), 19: (e5) => Number(1 == e5 ? 0 : 0 == e5 || e5 % 100 > 1 && e5 % 100 < 11 ? 1 : e5 % 100 > 10 && e5 % 100 < 20 ? 2 : 3), 20: (e5) => Number(1 == e5 ? 0 : 0 == e5 || e5 % 100 > 0 && e5 % 100 < 20 ? 1 : 2), 21: (e5) => Number(e5 % 100 == 1 ? 1 : e5 % 100 == 2 ? 2 : e5 % 100 == 3 || e5 % 100 == 4 ? 3 : 0), 22: (e5) => Number(1 == e5 ? 0 : 2 == e5 ? 1 : (e5 < 0 || e5 > 10) && e5 % 10 == 0 ? 2 : 3) };
const TE = ["v1", "v2", "v3"], kE = ["v4"], FE = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
class PE {
constructor(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
this.languageUtils = e5, this.options = t2, this.logger = EE.create("pluralResolver"), this.options.compatibilityJSON && !kE.includes(this.options.compatibilityJSON) || "undefined" != typeof Intl && Intl.PluralRules || (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = (() => {
const e6 = {};
return NE.forEach((t3) => {
t3.lngs.forEach((n2) => {
e6[n2] = { numbers: t3.nr, plurals: BE[t3.fc] };
});
}), e6;
})(), this.pluralRulesCache = {};
}
addRule(e5, t2) {
this.rules[e5] = t2;
}
clearCache() {
this.pluralRulesCache = {};
}
getRule(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
if (this.shouldUseIntlApi()) {
const n2 = mE("dev" === e5 ? "en" : e5), r2 = t2.ordinal ? "ordinal" : "cardinal", o2 = JSON.stringify({ cleanedCode: n2, type: r2 });
if (o2 in this.pluralRulesCache) return this.pluralRulesCache[o2];
let i2;
try {
i2 = new Intl.PluralRules(n2, { type: r2 });
} catch (n3) {
if (!e5.match(/-|_/)) return;
const r3 = this.languageUtils.getLanguagePartFromCode(e5);
i2 = this.getRule(r3, t2);
}
return this.pluralRulesCache[o2] = i2, i2;
}
return this.rules[e5] || this.rules[this.languageUtils.getLanguagePartFromCode(e5)];
}
needsPlural(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
const n2 = this.getRule(e5, t2);
return this.shouldUseIntlApi() ? n2 && n2.resolvedOptions().pluralCategories.length > 1 : n2 && n2.numbers.length > 1;
}
getPluralFormsOfKey(e5, t2) {
let n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
return this.getSuffixes(e5, n2).map((e6) => `${t2}${e6}`);
}
getSuffixes(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
const n2 = this.getRule(e5, t2);
return n2 ? this.shouldUseIntlApi() ? n2.resolvedOptions().pluralCategories.sort((e6, t3) => FE[e6] - FE[t3]).map((e6) => `${this.options.prepend}${t2.ordinal ? `ordinal${this.options.prepend}` : ""}${e6}`) : n2.numbers.map((n3) => this.getSuffix(e5, n3, t2)) : [];
}
getSuffix(e5, t2) {
let n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
const r2 = this.getRule(e5, n2);
return r2 ? this.shouldUseIntlApi() ? `${this.options.prepend}${n2.ordinal ? `ordinal${this.options.prepend}` : ""}${r2.select(t2)}` : this.getSuffixRetroCompatible(r2, t2) : (this.logger.warn(`no plural rule found for: ${e5}`), "");
}
getSuffixRetroCompatible(e5, t2) {
const n2 = e5.noAbs ? e5.plurals(t2) : e5.plurals(Math.abs(t2));
let r2 = e5.numbers[n2];
this.options.simplifyPluralSuffix && 2 === e5.numbers.length && 1 === e5.numbers[0] && (2 === r2 ? r2 = "plural" : 1 === r2 && (r2 = ""));
const o2 = () => this.options.prepend && r2.toString() ? this.options.prepend + r2.toString() : r2.toString();
return "v1" === this.options.compatibilityJSON ? 1 === r2 ? "" : "number" == typeof r2 ? `_plural_${r2.toString()}` : o2() : "v2" === this.options.compatibilityJSON || this.options.simplifyPluralSuffix && 2 === e5.numbers.length && 1 === e5.numbers[0] ? o2() : this.options.prepend && n2.toString() ? this.options.prepend + n2.toString() : n2.toString();
}
shouldUseIntlApi() {
return !TE.includes(this.options.compatibilityJSON);
}
}
const IE = function(e5, t2, n2) {
let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : ".", o2 = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4], i2 = ((e6, t3, n3) => {
const r3 = lE(e6, n3);
return void 0 !== r3 ? r3 : lE(t3, n3);
})(e5, t2, n2);
return !i2 && o2 && tE(n2) && (i2 = vE(e5, n2, r2), void 0 === i2 && (i2 = vE(t2, n2, r2))), i2;
}, RE = (e5) => e5.replace(/\$/g, "$$$$");
class _E {
constructor() {
let e5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
this.logger = EE.create("interpolator"), this.options = e5, this.format = e5.interpolation && e5.interpolation.format || ((e6) => e6), this.init(e5);
}
init() {
let e5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
e5.interpolation || (e5.interpolation = { escapeValue: true });
const { escape: t2, escapeValue: n2, useRawValueToEscape: r2, prefix: o2, prefixEscaped: i2, suffix: a2, suffixEscaped: s2, formatSeparator: u2, unescapeSuffix: l2, unescapePrefix: c2, nestingPrefix: d2, nestingPrefixEscaped: f2, nestingSuffix: p2, nestingSuffixEscaped: h2, nestingOptionsSeparator: g2, maxReplaces: v2, alwaysFormat: m2 } = e5.interpolation;
this.escape = void 0 !== t2 ? t2 : pE, this.escapeValue = void 0 === n2 || n2, this.useRawValueToEscape = void 0 !== r2 && r2, this.prefix = o2 ? dE(o2) : i2 || "{{", this.suffix = a2 ? dE(a2) : s2 || "}}", this.formatSeparator = u2 || ",", this.unescapePrefix = l2 ? "" : c2 || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l2 || "", this.nestingPrefix = d2 ? dE(d2) : f2 || dE("$t("), this.nestingSuffix = p2 ? dE(p2) : h2 || dE(")"), this.nestingOptionsSeparator = g2 || ",", this.maxReplaces = v2 || 1e3, this.alwaysFormat = void 0 !== m2 && m2, this.resetRegExp();
}
reset() {
this.options && this.init(this.options);
}
resetRegExp() {
const e5 = (e6, t2) => e6 && e6.source === t2 ? (e6.lastIndex = 0, e6) : new RegExp(t2, "g");
this.regexp = e5(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e5(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e5(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
}
interpolate(e5, t2, n2, r2) {
let o2, i2, a2;
const s2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u2 = (e6) => {
if (e6.indexOf(this.formatSeparator) < 0) {
const o4 = IE(t2, s2, e6, this.options.keySeparator, this.options.ignoreJSONStructure);
return this.alwaysFormat ? this.format(o4, void 0, n2, { ...r2, ...t2, interpolationkey: e6 }) : o4;
}
const o3 = e6.split(this.formatSeparator), i3 = o3.shift().trim(), a3 = o3.join(this.formatSeparator).trim();
return this.format(IE(t2, s2, i3, this.options.keySeparator, this.options.ignoreJSONStructure), a3, n2, { ...r2, ...t2, interpolationkey: i3 });
};
this.resetRegExp();
const l2 = r2 && r2.missingInterpolationHandler || this.options.missingInterpolationHandler, c2 = r2 && r2.interpolation && void 0 !== r2.interpolation.skipOnVariables ? r2.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables, d2 = [{ regex: this.regexpUnescape, safeValue: (e6) => RE(e6) }, { regex: this.regexp, safeValue: (e6) => this.escapeValue ? RE(this.escape(e6)) : RE(e6) }];
return d2.forEach((t3) => {
for (a2 = 0; o2 = t3.regex.exec(e5); ) {
const n3 = o2[1].trim();
if (i2 = u2(n3), void 0 === i2) if ("function" == typeof l2) {
const t4 = l2(e5, o2, r2);
i2 = tE(t4) ? t4 : "";
} else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) i2 = "";
else {
if (c2) {
i2 = o2[0];
continue;
}
this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e5}`), i2 = "";
}
else tE(i2) || this.useRawValueToEscape || (i2 = rE(i2));
const s3 = t3.safeValue(i2);
if (e5 = e5.replace(o2[0], s3), c2 ? (t3.regex.lastIndex += i2.length, t3.regex.lastIndex -= o2[0].length) : t3.regex.lastIndex = 0, a2++, a2 >= this.maxReplaces) break;
}
}), e5;
}
nest(e5, t2) {
let n2, r2, o2, i2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
const a2 = (e6, t3) => {
const n3 = this.nestingOptionsSeparator;
if (e6.indexOf(n3) < 0) return e6;
const r3 = e6.split(new RegExp(`${n3}[ ]*{`));
let i3 = `{${r3[1]}`;
e6 = r3[0], i3 = this.interpolate(i3, o2);
const a3 = i3.match(/'/g), s2 = i3.match(/"/g);
(a3 && a3.length % 2 == 0 && !s2 || s2.length % 2 != 0) && (i3 = i3.replace(/'/g, '"'));
try {
o2 = JSON.parse(i3), t3 && (o2 = { ...t3, ...o2 });
} catch (t4) {
return this.logger.warn(`failed parsing options string in nesting for key ${e6}`, t4), `${e6}${n3}${i3}`;
}
return o2.defaultValue && o2.defaultValue.indexOf(this.prefix) > -1 && delete o2.defaultValue, e6;
};
for (; n2 = this.nestingRegexp.exec(e5); ) {
let s2 = [];
o2 = { ...i2 }, o2 = o2.replace && !tE(o2.replace) ? o2.replace : o2, o2.applyPostProcessor = false, delete o2.defaultValue;
let u2 = false;
if (-1 !== n2[0].indexOf(this.formatSeparator) && !/{.*}/.test(n2[1])) {
const e6 = n2[1].split(this.formatSeparator).map((e7) => e7.trim());
n2[1] = e6.shift(), s2 = e6, u2 = true;
}
if (r2 = t2(a2.call(this, n2[1].trim(), o2), o2), r2 && n2[0] === e5 && !tE(r2)) return r2;
tE(r2) || (r2 = rE(r2)), r2 || (this.logger.warn(`missed to resolve ${n2[1]} for nesting ${e5}`), r2 = ""), u2 && (r2 = s2.reduce((e6, t3) => this.format(e6, t3, i2.lng, { ...i2, interpolationkey: n2[1].trim() }), r2.trim())), e5 = e5.replace(n2[0], r2), this.regexp.lastIndex = 0;
}
return e5;
}
}
const LE = (e5) => {
const t2 = {};
return (n2, r2, o2) => {
let i2 = o2;
o2 && o2.interpolationkey && o2.formatParams && o2.formatParams[o2.interpolationkey] && o2[o2.interpolationkey] && (i2 = { ...i2, [o2.interpolationkey]: void 0 });
const a2 = r2 + JSON.stringify(i2);
let s2 = t2[a2];
return s2 || (s2 = e5(mE(r2), o2), t2[a2] = s2), s2(n2);
};
};
class ME {
constructor() {
let e5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
this.logger = EE.create("formatter"), this.options = e5, this.formats = { number: LE((e6, t2) => {
const n2 = new Intl.NumberFormat(e6, { ...t2 });
return (e7) => n2.format(e7);
}), currency: LE((e6, t2) => {
const n2 = new Intl.NumberFormat(e6, { ...t2, style: "currency" });
return (e7) => n2.format(e7);
}), datetime: LE((e6, t2) => {
const n2 = new Intl.DateTimeFormat(e6, { ...t2 });
return (e7) => n2.format(e7);
}), relativetime: LE((e6, t2) => {
const n2 = new Intl.RelativeTimeFormat(e6, { ...t2 });
return (e7) => n2.format(e7, t2.range || "day");
}), list: LE((e6, t2) => {
const n2 = new Intl.ListFormat(e6, { ...t2 });
return (e7) => n2.format(e7);
}) }, this.init(e5);
}
init(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} };
this.formatSeparator = t2.interpolation.formatSeparator || ",";
}
add(e5, t2) {
this.formats[e5.toLowerCase().trim()] = t2;
}
addCached(e5, t2) {
this.formats[e5.toLowerCase().trim()] = LE(t2);
}
format(e5, t2, n2) {
let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
const o2 = t2.split(this.formatSeparator);
if (o2.length > 1 && o2[0].indexOf("(") > 1 && o2[0].indexOf(")") < 0 && o2.find((e6) => e6.indexOf(")") > -1)) {
const e6 = o2.findIndex((e7) => e7.indexOf(")") > -1);
o2[0] = [o2[0], ...o2.splice(1, e6)].join(this.formatSeparator);
}
const i2 = o2.reduce((e6, t3) => {
const { formatName: o3, formatOptions: i3 } = ((e7) => {
let t4 = e7.toLowerCase().trim();
const n3 = {};
if (e7.indexOf("(") > -1) {
const r3 = e7.split("(");
t4 = r3[0].toLowerCase().trim();
const o4 = r3[1].substring(0, r3[1].length - 1);
"currency" === t4 && o4.indexOf(":") < 0 ? n3.currency || (n3.currency = o4.trim()) : "relativetime" === t4 && o4.indexOf(":") < 0 ? n3.range || (n3.range = o4.trim()) : o4.split(";").forEach((e8) => {
if (e8) {
const [t5, ...r4] = e8.split(":"), o5 = r4.join(":").trim().replace(/^'+|'+$/g, ""), i4 = t5.trim();
n3[i4] || (n3[i4] = o5), "false" === o5 && (n3[i4] = false), "true" === o5 && (n3[i4] = true), isNaN(o5) || (n3[i4] = parseInt(o5, 10));
}
});
}
return { formatName: t4, formatOptions: n3 };
})(t3);
if (this.formats[o3]) {
let t4 = e6;
try {
const a2 = r2 && r2.formatParams && r2.formatParams[r2.interpolationkey] || {}, s2 = a2.locale || a2.lng || r2.locale || r2.lng || n2;
t4 = this.formats[o3](e6, s2, { ...i3, ...r2, ...a2 });
} catch (e7) {
this.logger.warn(e7);
}
return t4;
}
return this.logger.warn(`there was no format function for ${o3}`), e6;
}, e5);
return i2;
}
}
class jE extends wE {
constructor(e5, t2, n2) {
let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
super(), this.backend = e5, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = EE.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r2.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r2.maxRetries >= 0 ? r2.maxRetries : 5, this.retryTimeout = r2.retryTimeout >= 1 ? r2.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(n2, r2.backend, r2);
}
queueLoad(e5, t2, n2, r2) {
const o2 = {}, i2 = {}, a2 = {}, s2 = {};
return e5.forEach((e6) => {
let r3 = true;
t2.forEach((t3) => {
const a3 = `${e6}|${t3}`;
!n2.reload && this.store.hasResourceBundle(e6, t3) ? this.state[a3] = 2 : this.state[a3] < 0 || (1 === this.state[a3] ? void 0 === i2[a3] && (i2[a3] = true) : (this.state[a3] = 1, r3 = false, void 0 === i2[a3] && (i2[a3] = true), void 0 === o2[a3] && (o2[a3] = true), void 0 === s2[t3] && (s2[t3] = true)));
}), r3 || (a2[e6] = true);
}), (Object.keys(o2).length || Object.keys(i2).length) && this.queue.push({ pending: i2, pendingCount: Object.keys(i2).length, loaded: {}, errors: [], callback: r2 }), { toLoad: Object.keys(o2), pending: Object.keys(i2), toLoadLanguages: Object.keys(a2), toLoadNamespaces: Object.keys(s2) };
}
loaded(e5, t2, n2) {
const r2 = e5.split("|"), o2 = r2[0], i2 = r2[1];
t2 && this.emit("failedLoading", o2, i2, t2), !t2 && n2 && this.store.addResourceBundle(o2, i2, n2, void 0, void 0, { skipCopy: true }), this.state[e5] = t2 ? -1 : 2, t2 && n2 && (this.state[e5] = 0);
const a2 = {};
this.queue.forEach((n3) => {
((e6, t3, n4) => {
const { obj: r3, k: o3 } = sE(e6, t3, Object);
r3[o3] = r3[o3] || [], r3[o3].push(n4);
})(n3.loaded, [o2], i2), ((e6, t3) => {
void 0 !== e6.pending[t3] && (delete e6.pending[t3], e6.pendingCount--);
})(n3, e5), t2 && n3.errors.push(t2), 0 !== n3.pendingCount || n3.done || (Object.keys(n3.loaded).forEach((e6) => {
a2[e6] || (a2[e6] = {});
const t3 = n3.loaded[e6];
t3.length && t3.forEach((t4) => {
void 0 === a2[e6][t4] && (a2[e6][t4] = true);
});
}), n3.done = true, n3.errors.length ? n3.callback(n3.errors) : n3.callback());
}), this.emit("loaded", a2), this.queue = this.queue.filter((e6) => !e6.done);
}
read(e5, t2, n2) {
let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, o2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : this.retryTimeout, i2 = arguments.length > 5 ? arguments[5] : void 0;
if (!e5.length) return i2(null, {});
if (this.readingCalls >= this.maxParallelReads) return void this.waitingReads.push({ lng: e5, ns: t2, fcName: n2, tried: r2, wait: o2, callback: i2 });
this.readingCalls++;
const a2 = (a3, s3) => {
if (this.readingCalls--, this.waitingReads.length > 0) {
const e6 = this.waitingReads.shift();
this.read(e6.lng, e6.ns, e6.fcName, e6.tried, e6.wait, e6.callback);
}
a3 && s3 && r2 < this.maxRetries ? setTimeout(() => {
this.read.call(this, e5, t2, n2, r2 + 1, 2 * o2, i2);
}, o2) : i2(a3, s3);
}, s2 = this.backend[n2].bind(this.backend);
if (2 !== s2.length) return s2(e5, t2, a2);
try {
const n3 = s2(e5, t2);
n3 && "function" == typeof n3.then ? n3.then((e6) => a2(null, e6)).catch(a2) : a2(null, n3);
} catch (e6) {
a2(e6);
}
}
prepareLoading(e5, t2) {
let n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r2 = arguments.length > 3 ? arguments[3] : void 0;
if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r2 && r2();
tE(e5) && (e5 = this.languageUtils.toResolveHierarchy(e5)), tE(t2) && (t2 = [t2]);
const o2 = this.queueLoad(e5, t2, n2, r2);
if (!o2.toLoad.length) return o2.pending.length || r2(), null;
o2.toLoad.forEach((e6) => {
this.loadOne(e6);
});
}
load(e5, t2, n2) {
this.prepareLoading(e5, t2, {}, n2);
}
reload(e5, t2, n2) {
this.prepareLoading(e5, t2, { reload: true }, n2);
}
loadOne(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "";
const n2 = e5.split("|"), r2 = n2[0], o2 = n2[1];
this.read(r2, o2, "read", void 0, void 0, (n3, i2) => {
n3 && this.logger.warn(`${t2}loading namespace ${o2} for language ${r2} failed`, n3), !n3 && i2 && this.logger.log(`${t2}loaded namespace ${o2} for language ${r2}`, i2), this.loaded(e5, n3, i2);
});
}
saveMissing(e5, t2, n2, r2, o2) {
let i2 = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {}, a2 = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : () => {
};
if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(t2)) this.logger.warn(`did not save key "${n2}" as the namespace "${t2}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
else if (null != n2 && "" !== n2) {
if (this.backend && this.backend.create) {
const s2 = { ...i2, isUpdate: o2 }, u2 = this.backend.create.bind(this.backend);
if (u2.length < 6) try {
let o3;
o3 = 5 === u2.length ? u2(e5, t2, n2, r2, s2) : u2(e5, t2, n2, r2), o3 && "function" == typeof o3.then ? o3.then((e6) => a2(null, e6)).catch(a2) : a2(null, o3);
} catch (e6) {
a2(e6);
}
else u2(e5, t2, n2, r2, a2, s2);
}
e5 && e5[0] && this.store.addResource(e5[0], t2, n2, r2);
}
}
}
const HE = () => ({ debug: false, initImmediate: true, ns: ["translation"], defaultNS: ["translation"], fallbackLng: ["dev"], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: "all", preload: false, simplifyPluralSuffix: true, keySeparator: ".", nsSeparator: ":", pluralSeparator: "_", contextSeparator: "_", partialBundledLanguages: false, saveMissing: false, updateMissing: false, saveMissingTo: "fallback", saveMissingPlurals: true, missingKeyHandler: false, missingInterpolationHandler: false, postProcess: false, postProcessPassResolved: false, returnNull: false, returnEmptyString: true, returnObjects: false, joinArrays: false, returnedObjectHandler: false, parseMissingKeyHandler: false, appendNamespaceToMissingKey: false, appendNamespaceToCIMode: false, overloadTranslationOptionHandler: (e5) => {
let t2 = {};
if ("object" == typeof e5[1] && (t2 = e5[1]), tE(e5[1]) && (t2.defaultValue = e5[1]), tE(e5[2]) && (t2.tDescription = e5[2]), "object" == typeof e5[2] || "object" == typeof e5[3]) {
const n2 = e5[3] || e5[2];
Object.keys(n2).forEach((e6) => {
t2[e6] = n2[e6];
});
}
return t2;
}, interpolation: { escapeValue: true, format: (e5) => e5, prefix: "{{", suffix: "}}", formatSeparator: ",", unescapePrefix: "-", nestingPrefix: "$t(", nestingSuffix: ")", nestingOptionsSeparator: ",", maxReplaces: 1e3, skipOnVariables: true } }), zE = (e5) => (tE(e5.ns) && (e5.ns = [e5.ns]), tE(e5.fallbackLng) && (e5.fallbackLng = [e5.fallbackLng]), tE(e5.fallbackNS) && (e5.fallbackNS = [e5.fallbackNS]), e5.supportedLngs && e5.supportedLngs.indexOf("cimode") < 0 && (e5.supportedLngs = e5.supportedLngs.concat(["cimode"])), e5), $E = () => {
};
class UE extends wE {
constructor() {
let e5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t2 = arguments.length > 1 ? arguments[1] : void 0;
var n2;
if (super(), this.options = zE(e5), this.services = {}, this.logger = EE, this.modules = { external: [] }, n2 = this, Object.getOwnPropertyNames(Object.getPrototypeOf(n2)).forEach((e6) => {
"function" == typeof n2[e6] && (n2[e6] = n2[e6].bind(n2));
}), t2 && !this.isInitialized && !e5.isClone) {
if (!this.options.initImmediate) return this.init(e5, t2), this;
setTimeout(() => {
this.init(e5, t2);
}, 0);
}
}
init() {
var e5 = this;
let t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n2 = arguments.length > 1 ? arguments[1] : void 0;
this.isInitializing = true, "function" == typeof t2 && (n2 = t2, t2 = {}), !t2.defaultNS && false !== t2.defaultNS && t2.ns && (tE(t2.ns) ? t2.defaultNS = t2.ns : t2.ns.indexOf("translation") < 0 && (t2.defaultNS = t2.ns[0]));
const r2 = HE();
this.options = { ...r2, ...this.options, ...zE(t2) }, "v1" !== this.options.compatibilityAPI && (this.options.interpolation = { ...r2.interpolation, ...this.options.interpolation }), void 0 !== t2.keySeparator && (this.options.userDefinedKeySeparator = t2.keySeparator), void 0 !== t2.nsSeparator && (this.options.userDefinedNsSeparator = t2.nsSeparator);
const o2 = (e6) => e6 ? "function" == typeof e6 ? new e6() : e6 : null;
if (!this.options.isClone) {
let t3;
this.modules.logger ? EE.init(o2(this.modules.logger), this.options) : EE.init(null, this.options), this.modules.formatter ? t3 = this.modules.formatter : "undefined" != typeof Intl && (t3 = ME);
const n3 = new OE(this.options);
this.store = new CE(this.options.resources, this.options);
const i3 = this.services;
i3.logger = EE, i3.resourceStore = this.store, i3.languageUtils = n3, i3.pluralResolver = new PE(n3, { prepend: this.options.pluralSeparator, compatibilityJSON: this.options.compatibilityJSON, simplifyPluralSuffix: this.options.simplifyPluralSuffix }), !t3 || this.options.interpolation.format && this.options.interpolation.format !== r2.interpolation.format || (i3.formatter = o2(t3), i3.formatter.init(i3, this.options), this.options.interpolation.format = i3.formatter.format.bind(i3.formatter)), i3.interpolator = new _E(this.options), i3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i3.backendConnector = new jE(o2(this.modules.backend), i3.resourceStore, i3, this.options), i3.backendConnector.on("*", function(t4) {
for (var n4 = arguments.length, r3 = new Array(n4 > 1 ? n4 - 1 : 0), o3 = 1; o3 < n4; o3++) r3[o3 - 1] = arguments[o3];
e5.emit(t4, ...r3);
}), this.modules.languageDetector && (i3.languageDetector = o2(this.modules.languageDetector), i3.languageDetector.init && i3.languageDetector.init(i3, this.options.detection, this.options)), this.modules.i18nFormat && (i3.i18nFormat = o2(this.modules.i18nFormat), i3.i18nFormat.init && i3.i18nFormat.init(this)), this.translator = new SE(this.services, this.options), this.translator.on("*", function(t4) {
for (var n4 = arguments.length, r3 = new Array(n4 > 1 ? n4 - 1 : 0), o3 = 1; o3 < n4; o3++) r3[o3 - 1] = arguments[o3];
e5.emit(t4, ...r3);
}), this.modules.external.forEach((e6) => {
e6.init && e6.init(this);
});
}
if (this.format = this.options.interpolation.format, n2 || (n2 = $E), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
const e6 = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
e6.length > 0 && "dev" !== e6[0] && (this.options.lng = e6[0]);
}
this.services.languageDetector || this.options.lng || this.logger.warn("init: no languageDetector is used and no lng is defined");
["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((t3) => {
this[t3] = function() {
return e5.store[t3](...arguments);
};
});
["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((t3) => {
this[t3] = function() {
return e5.store[t3](...arguments), e5;
};
});
const i2 = nE(), a2 = () => {
const e6 = (e7, t3) => {
this.isInitializing = false, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = true, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), i2.resolve(t3), n2(e7, t3);
};
if (this.languages && "v1" !== this.options.compatibilityAPI && !this.isInitialized) return e6(null, this.t.bind(this));
this.changeLanguage(this.options.lng, e6);
};
return this.options.resources || !this.options.initImmediate ? a2() : setTimeout(a2, 0), i2;
}
loadResources(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : $E;
const n2 = tE(e5) ? e5 : this.language;
if ("function" == typeof e5 && (t2 = e5), !this.options.resources || this.options.partialBundledLanguages) {
if (n2 && "cimode" === n2.toLowerCase() && (!this.options.preload || 0 === this.options.preload.length)) return t2();
const e6 = [], r2 = (t3) => {
if (!t3) return;
if ("cimode" === t3) return;
this.services.languageUtils.toResolveHierarchy(t3).forEach((t4) => {
"cimode" !== t4 && e6.indexOf(t4) < 0 && e6.push(t4);
});
};
if (n2) r2(n2);
else {
this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e7) => r2(e7));
}
this.options.preload && this.options.preload.forEach((e7) => r2(e7)), this.services.backendConnector.load(e6, this.options.ns, (e7) => {
e7 || this.resolvedLanguage || !this.language || this.setResolvedLanguage(this.language), t2(e7);
});
} else t2(null);
}
reloadResources(e5, t2, n2) {
const r2 = nE();
return "function" == typeof e5 && (n2 = e5, e5 = void 0), "function" == typeof t2 && (n2 = t2, t2 = void 0), e5 || (e5 = this.languages), t2 || (t2 = this.options.ns), n2 || (n2 = $E), this.services.backendConnector.reload(e5, t2, (e6) => {
r2.resolve(), n2(e6);
}), r2;
}
use(e5) {
if (!e5) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
if (!e5.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
return "backend" === e5.type && (this.modules.backend = e5), ("logger" === e5.type || e5.log && e5.warn && e5.error) && (this.modules.logger = e5), "languageDetector" === e5.type && (this.modules.languageDetector = e5), "i18nFormat" === e5.type && (this.modules.i18nFormat = e5), "postProcessor" === e5.type && DE.addPostProcessor(e5), "formatter" === e5.type && (this.modules.formatter = e5), "3rdParty" === e5.type && this.modules.external.push(e5), this;
}
setResolvedLanguage(e5) {
if (e5 && this.languages && !(["cimode", "dev"].indexOf(e5) > -1)) for (let e6 = 0; e6 < this.languages.length; e6++) {
const t2 = this.languages[e6];
if (!(["cimode", "dev"].indexOf(t2) > -1) && this.store.hasLanguageSomeTranslations(t2)) {
this.resolvedLanguage = t2;
break;
}
}
}
changeLanguage(e5, t2) {
var n2 = this;
this.isLanguageChangingTo = e5;
const r2 = nE();
this.emit("languageChanging", e5);
const o2 = (e6) => {
this.language = e6, this.languages = this.services.languageUtils.toResolveHierarchy(e6), this.resolvedLanguage = void 0, this.setResolvedLanguage(e6);
}, i2 = (e6, i3) => {
i3 ? (o2(i3), this.translator.changeLanguage(i3), this.isLanguageChangingTo = void 0, this.emit("languageChanged", i3), this.logger.log("languageChanged", i3)) : this.isLanguageChangingTo = void 0, r2.resolve(function() {
return n2.t(...arguments);
}), t2 && t2(e6, function() {
return n2.t(...arguments);
});
}, a2 = (t3) => {
e5 || t3 || !this.services.languageDetector || (t3 = []);
const n3 = tE(t3) ? t3 : this.services.languageUtils.getBestMatchFromCodes(t3);
n3 && (this.language || o2(n3), this.translator.language || this.translator.changeLanguage(n3), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(n3)), this.loadResources(n3, (e6) => {
i2(e6, n3);
});
};
return e5 || !this.services.languageDetector || this.services.languageDetector.async ? !e5 && this.services.languageDetector && this.services.languageDetector.async ? 0 === this.services.languageDetector.detect.length ? this.services.languageDetector.detect().then(a2) : this.services.languageDetector.detect(a2) : a2(e5) : a2(this.services.languageDetector.detect()), r2;
}
getFixedT(e5, t2, n2) {
var r2 = this;
const o2 = function(e6, t3) {
let i2;
if ("object" != typeof t3) {
for (var a2 = arguments.length, s2 = new Array(a2 > 2 ? a2 - 2 : 0), u2 = 2; u2 < a2; u2++) s2[u2 - 2] = arguments[u2];
i2 = r2.options.overloadTranslationOptionHandler([e6, t3].concat(s2));
} else i2 = { ...t3 };
i2.lng = i2.lng || o2.lng, i2.lngs = i2.lngs || o2.lngs, i2.ns = i2.ns || o2.ns, "" !== i2.keyPrefix && (i2.keyPrefix = i2.keyPrefix || n2 || o2.keyPrefix);
const l2 = r2.options.keySeparator || ".";
let c2;
return c2 = i2.keyPrefix && Array.isArray(e6) ? e6.map((e7) => `${i2.keyPrefix}${l2}${e7}`) : i2.keyPrefix ? `${i2.keyPrefix}${l2}${e6}` : e6, r2.t(c2, i2);
};
return tE(e5) ? o2.lng = e5 : o2.lngs = e5, o2.ns = t2, o2.keyPrefix = n2, o2;
}
t() {
return this.translator && this.translator.translate(...arguments);
}
exists() {
return this.translator && this.translator.exists(...arguments);
}
setDefaultNamespace(e5) {
this.options.defaultNS = e5;
}
hasLoadedNamespace(e5) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), false;
if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), false;
const n2 = t2.lng || this.resolvedLanguage || this.languages[0], r2 = !!this.options && this.options.fallbackLng, o2 = this.languages[this.languages.length - 1];
if ("cimode" === n2.toLowerCase()) return true;
const i2 = (e6, t3) => {
const n3 = this.services.backendConnector.state[`${e6}|${t3}`];
return -1 === n3 || 0 === n3 || 2 === n3;
};
if (t2.precheck) {
const e6 = t2.precheck(this, i2);
if (void 0 !== e6) return e6;
}
return !!this.hasResourceBundle(n2, e5) || (!(this.services.backendConnector.backend && (!this.options.resources || this.options.partialBundledLanguages)) || !(!i2(n2, e5) || r2 && !i2(o2, e5)));
}
loadNamespaces(e5, t2) {
const n2 = nE();
return this.options.ns ? (tE(e5) && (e5 = [e5]), e5.forEach((e6) => {
this.options.ns.indexOf(e6) < 0 && this.options.ns.push(e6);
}), this.loadResources((e6) => {
n2.resolve(), t2 && t2(e6);
}), n2) : (t2 && t2(), Promise.resolve());
}
loadLanguages(e5, t2) {
const n2 = nE();
tE(e5) && (e5 = [e5]);
const r2 = this.options.preload || [], o2 = e5.filter((e6) => r2.indexOf(e6) < 0 && this.services.languageUtils.isSupportedCode(e6));
return o2.length ? (this.options.preload = r2.concat(o2), this.loadResources((e6) => {
n2.resolve(), t2 && t2(e6);
}), n2) : (t2 && t2(), Promise.resolve());
}
dir(e5) {
if (e5 || (e5 = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e5) return "rtl";
const t2 = this.services && this.services.languageUtils || new OE(HE());
return ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"].indexOf(t2.getLanguagePartFromCode(e5)) > -1 || e5.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
}
static createInstance() {
return new UE(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, arguments.length > 1 ? arguments[1] : void 0);
}
cloneInstance() {
let e5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : $E;
const n2 = e5.forkResourceStore;
n2 && delete e5.forkResourceStore;
const r2 = { ...this.options, ...e5, isClone: true }, o2 = new UE(r2);
void 0 === e5.debug && void 0 === e5.prefix || (o2.logger = o2.logger.clone(e5));
return ["store", "services", "language"].forEach((e6) => {
o2[e6] = this[e6];
}), o2.services = { ...this.services }, o2.services.utils = { hasLoadedNamespace: o2.hasLoadedNamespace.bind(o2) }, n2 && (o2.store = new CE(this.store.data, r2), o2.services.resourceStore = o2.store), o2.translator = new SE(o2.services, r2), o2.translator.on("*", function(e6) {
for (var t3 = arguments.length, n3 = new Array(t3 > 1 ? t3 - 1 : 0), r3 = 1; r3 < t3; r3++) n3[r3 - 1] = arguments[r3];
o2.emit(e6, ...n3);
}), o2.init(r2, t2), o2.translator.options = r2, o2.translator.backendConnector.services.utils = { hasLoadedNamespace: o2.hasLoadedNamespace.bind(o2) }, o2;
}
toJSON() {
return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
}
}
const VE = UE.createInstance();
VE.createInstance = UE.createInstance, VE.createInstance, VE.dir, VE.init, VE.loadResources, VE.reloadResources, VE.use, VE.changeLanguage, VE.getFixedT, VE.t, VE.exists, VE.setDefaultNamespace, VE.hasLoadedNamespace, VE.loadNamespaces, VE.loadLanguages;
var WE = "translation";
function GE(e5, t2) {
VE.addResourceBundle(e5, WE, t2, true, true);
}
function YE(e5) {
return VE.on("languageChanged", e5), function() {
return VE.off("languageChanged", e5);
};
}
VE.init({ lng: "zh-CN", resources: {} });
var XE = VE.t.bind(VE);
function ZE(e5) {
if (e5.removeAttr) {
e5.removeAttr("width"), e5.removeAttr("height"), e5.removeAttr("fill"), e5.removeAttr("class"), e5.removeAttr("t"), e5.removeAttr("p-id");
var t2 = e5.children();
t2.length && ZE(t2);
}
}
function JE() {
return Kv('');
}
function QE() {
return Kv('');
}
function ew(e5, t2, n2, r2, o2) {
if (void 0 === r2 && (r2 = ""), void 0 === o2 && (o2 = false), t2) {
if (r2) {
var i2 = wy ? "cmd" : "ctrl";
r2 = r2.replace("mod", i2);
}
if (o2) r2 && (e5.attr("data-tooltip", r2), e5.addClass("w-e-menu-tooltip-v5"), e5.addClass("tooltip-right"));
else {
var a2 = r2 ? "".concat(n2, "\n").concat(r2) : n2;
e5.attr("data-tooltip", a2), e5.addClass("w-e-menu-tooltip-v5");
}
}
}
var tw = (function() {
function e5(e6, t2, n2) {
void 0 === n2 && (n2 = false);
var r2 = this;
this.$elem = Kv(''), this.$button = Kv(''), this.disabled = false, this.menu = t2;
var o2 = t2.tag, i2 = t2.width;
if ("button" !== o2) throw new Error("Invalid tag '".concat(o2, "', expected 'button'"));
var a2 = t2.title, s2 = t2.hotkey, u2 = void 0 === s2 ? "" : s2, l2 = t2.iconSvg, c2 = void 0 === l2 ? "" : l2, d2 = this.$button;
if (c2) {
var f2 = Kv(c2);
ZE(f2), d2.append(f2);
} else d2.text(a2);
ew(d2, c2, a2, u2, n2), n2 && c2 && d2.append(Kv(''.concat(a2, ""))), i2 && d2.css("width", "".concat(i2, "px")), d2.attr("data-menu-key", e6), this.$elem.append(d2), Tm(function() {
return r2.init();
});
}
return e5.prototype.init = function() {
var e6 = this;
this.setActive(), this.setDisabled(), this.$button.on("click", function(t2) {
t2.preventDefault(), gw(e6).hidePanelOrModal(), e6.disabled || (e6.exec(), e6.onButtonClick());
});
}, e5.prototype.exec = function() {
var e6 = gw(this), t2 = this.menu, n2 = t2.getValue(e6);
t2.exec(e6, n2), this.changeMenuState();
}, e5.prototype.setActive = function() {
var e6 = gw(this), t2 = this.$button, n2 = "active";
this.menu.isActive(e6) ? t2.addClass(n2) : t2.removeClass(n2);
}, e5.prototype.setDisabled = function() {
var e6 = gw(this), t2 = this.$button, n2 = this.menu.isDisabled(e6);
(null == e6.selection || e6.isDisabled()) && (n2 = true), this.menu.alwaysEnable && (n2 = false);
var r2 = "disabled";
n2 ? t2.addClass(r2) : t2.removeClass(r2), this.disabled = n2;
}, e5.prototype.setIcon = function() {
var e6 = gw(this), t2 = this.$button;
if (this.menu.getIcon) {
var n2 = this.menu.getIcon(e6);
if (n2) {
t2.find("svg").remove();
var r2 = Kv(n2);
ZE(r2), t2.append(r2);
}
}
}, e5.prototype.setTooltip = function() {
var e6 = gw(this), t2 = this.$button;
if (this.menu.getTitle) {
var n2 = this.menu.getTitle(e6), r2 = this.menu.iconSvg;
n2 && r2 && ew(t2, r2, n2);
}
}, e5.prototype.changeMenuState = function() {
this.setActive(), this.setDisabled(), this.setIcon(), this.setTooltip();
}, e5;
})(), nw = (function(e5) {
function t2(t3, n2, r2) {
return void 0 === r2 && (r2 = false), e5.call(this, t3, n2, r2) || this;
}
return Bg(t2, e5), t2.prototype.onButtonClick = function() {
}, t2;
})(tw), rw = (function() {
function e5(e6) {
this.isShow = false, this.showTime = 0, this.record(e6);
}
return e5.prototype.record = function(e6) {
var t2 = hv.get(e6);
null == t2 && (t2 = /* @__PURE__ */ new Set(), hv.set(e6, t2)), t2.add(this), gv.set(this, e6);
}, e5.prototype.renderContent = function(e6) {
var t2 = this.$elem;
t2.empty(), t2.append(e6);
var n2 = this.genSelfElem();
n2 && t2.append(n2);
}, e5.prototype.appendTo = function(e6) {
var t2 = this.$elem;
e6.append(t2);
}, e5.prototype.show = function() {
if (!this.isShow) {
this.showTime = Date.now(), this.$elem.show(), this.isShow = true;
var e6 = gv.get(this);
e6 && e6.emit(rv, this);
}
}, e5.prototype.hide = function() {
if (this.isShow && !(Date.now() - this.showTime < 200)) {
this.$elem.hide(), this.isShow = false;
var e6 = gv.get(this);
e6 && e6.emit(ov);
}
}, e5;
})(), ow = (function(e5) {
function t2(t3) {
var n2 = e5.call(this, t3) || this;
return n2.type = "dropPanel", n2.$elem = Kv(''), n2;
}
return Bg(t2, e5), t2.prototype.genSelfElem = function() {
return null;
}, t2;
})(rw), iw = (function(e5) {
function t2(t3, n2, r2) {
void 0 === r2 && (r2 = false);
var o2 = e5.call(this, t3, n2, r2) || this;
if (o2.dropPanel = null, o2.menu = n2, n2.showDropPanel) {
var i2 = JE();
o2.$button.append(i2);
}
return o2;
}
return Bg(t2, e5), t2.prototype.onButtonClick = function() {
this.menu.showDropPanel && this.handleDropPanel();
}, t2.prototype.handleDropPanel = function() {
var e6 = this.menu;
if (null != e6.getPanelContentElem) {
var t3 = gw(this);
if (null == this.dropPanel) {
var n2 = new ow(t3), r2 = e6.getPanelContentElem(t3);
n2.renderContent(r2), n2.appendTo(this.$elem), n2.show(), this.dropPanel = n2;
} else {
var o2 = this.dropPanel;
if (o2.isShow) o2.hide();
else {
r2 = e6.getPanelContentElem(t3);
o2.renderContent(r2), o2.show();
}
}
var i2 = this.dropPanel;
if (i2.isShow) {
var a2 = this.$elem, s2 = a2.offset().left, u2 = a2.parents(".w-e-bar");
s2 - u2.offset().left >= u2.width() / 2 ? i2.$elem.css({ left: "none", right: "0" }) : i2.$elem.css({ left: "0", right: "none" });
}
}
}, t2;
})(tw), aw = (function(e5) {
function t2(t3, n2) {
void 0 === n2 && (n2 = 0);
var r2 = e5.call(this, t3) || this;
r2.type = "modal", r2.$elem = Kv(''), r2.width = 0, n2 && (r2.width = n2);
var o2 = r2.$elem;
return o2.on("click", function(e6) {
return e6.stopPropagation();
}), o2.on("keyup", function(e6) {
"Escape" === e6.code && (r2.hide(), t3.restoreSelection());
}), r2;
}
return Bg(t2, e5), t2.prototype.genSelfElem = function() {
var e6 = this, t3 = Kv(''.concat('', "")), n2 = gv.get(this);
return t3.on("click", function() {
e6.hide(), null == n2 || n2.restoreSelection();
}), t3;
}, t2.prototype.setStyle = function(e6) {
var t3 = this.width, n2 = this.$elem;
n2.attr("style", ""), t3 && n2.css("width", "".concat(t3, "px")), n2.css(e6);
}, t2;
})(rw);
function sw(e5, t2, n2) {
var r2 = Kv('');
r2.append("".concat(e5, ""));
var o2 = Kv(''));
return r2.append(o2), [r2[0], o2[0]];
}
function lw(e5, t2) {
var n2 = Kv(''), r2 = Kv('"));
return n2.append(r2), [n2[0], r2[0]];
}
var cw = (function(e5) {
function t2(t3, n2, r2) {
void 0 === r2 && (r2 = false);
var o2 = e5.call(this, t3, n2, r2) || this;
return o2.$body = Kv("body"), o2.modal = null, o2.menu = n2, o2;
}
return Bg(t2, e5), t2.prototype.onButtonClick = function() {
this.menu.showModal && this.handleModal();
}, t2.prototype.getPosition = function() {
var e6 = gw(this), t3 = this.menu.getModalPositionNode(e6);
return Np.isElement(t3) ? Kb(e6, t3, "modal") : qb(e6);
}, t2.prototype.handleModal = function() {
var e6 = gw(this), t3 = this.menu;
if (null == this.modal) {
var n2 = new aw(e6, t3.modalWidth);
this.renderAndShowModal(n2, true), this.modal = n2;
} else {
(n2 = this.modal).isShow ? n2.hide() : this.renderAndShowModal(n2, false);
}
}, t2.prototype.renderAndShowModal = function(e6, t3) {
void 0 === t3 && (t3 = false);
var n2 = gw(this), r2 = this.menu;
if (null != r2.getModalContentElem) {
var o2 = Ty.getTextarea(n2), i2 = Ty.getToolbar(n2), a2 = ((null == i2 ? void 0 : i2.getConfig()) || {}).modalAppendToBody, s2 = r2.getModalContentElem(n2);
if (e6.renderContent(s2), a2) e6.setStyle({ left: "0", right: "0" });
else {
var u2 = this.getPosition();
e6.setStyle(u2);
}
t3 && (a2 ? e6.appendTo(this.$body) : e6.appendTo(o2.$textAreaContainer)), e6.show(), a2 || Yb(n2, e6.$elem), setTimeout(function() {
n2.blur();
});
}
}, t2;
})(tw);
var dw = (function(e5) {
function t2(t3, n2) {
var r2 = e5.call(this, t3) || this;
return r2.type = "selectList", r2.$elem = Kv(''), n2 && r2.$elem.css("width", "".concat(n2, "px")), r2.$elem.on("click", function(e6) {
e6.stopPropagation();
}), r2;
}
return Bg(t2, e5), t2.prototype.renderList = function(e6) {
var t3 = this.$elem;
t3.empty();
var n2 = Kv("");
e6.forEach(function(e7) {
var t4 = e7.value, r2 = e7.text, o2 = e7.selected, i2 = e7.styleForRenderMenuList, a2 = Kv(''));
if (i2 && a2.css(i2), o2) {
var s2 = Kv('');
a2.append(s2), a2.addClass("selected");
}
a2.append(Kv('').concat(r2, ""))), a2.attr("title", r2), n2.append(a2);
}), t3.append(n2);
}, t2.prototype.genSelfElem = function() {
return null;
}, t2;
})(rw);
var fw = (function() {
function e5(e6, t2, n2) {
void 0 === n2 && (n2 = false);
var r2 = this;
this.$elem = Kv(''), this.$button = Kv(''), this.disabled = false, this.selectList = null;
var o2 = t2.tag, i2 = t2.title, a2 = t2.width, s2 = t2.iconSvg, u2 = void 0 === s2 ? "" : s2, l2 = t2.hotkey, c2 = void 0 === l2 ? "" : l2;
if ("select" !== o2) throw new Error("Invalid tag '".concat(o2, "', expected 'select'"));
var d2 = this.$button;
a2 && d2.css("width", "".concat(a2, "px")), d2.attr("data-menu-key", e6), ew(d2, u2, i2, c2, n2), this.$elem.append(d2), this.menu = t2, Tm(function() {
return r2.init();
});
}
return e5.prototype.init = function() {
var e6 = this;
this.setSelectedValue(), this.$button.on("click", function(t2) {
t2.preventDefault(), gw(e6).hidePanelOrModal(), e6.trigger();
});
}, e5.prototype.trigger = function() {
var e6 = this, t2 = gw(this);
if (!t2.isDisabled() && !this.disabled) {
var n2 = this.menu;
if (null == this.selectList) {
this.selectList = new dw(t2, n2.selectPanelWidth);
var r2 = this.selectList, o2 = n2.getOptions(t2);
r2.renderList(o2), r2.appendTo(this.$elem), r2.show(), r2.$elem.on("click", "li", function(t3) {
var n3 = t3.target;
if (null != n3) {
t3.preventDefault();
var r3 = Kv(n3).attr("data-value");
e6.onChange(r3);
}
});
} else {
if ((r2 = this.selectList).isShow) r2.hide();
else {
o2 = n2.getOptions(t2);
r2.renderList(o2), r2.show();
}
}
}
}, e5.prototype.onChange = function(e6) {
var t2 = gw(this), n2 = this.menu;
n2.exec && n2.exec(t2, e6);
}, e5.prototype.setSelectedValue = function() {
var e6 = gw(this), t2 = this.menu, n2 = t2.getValue(e6), r2 = (function(e7, t3) {
for (var n3 = e7.length, r3 = "", o3 = 0; o3 < n3; o3++) {
var i3 = e7[o3];
if (i3.value === t3) {
r3 = i3.text;
break;
}
}
return r3;
})(t2.getOptions(e6), n2.toString()), o2 = this.$button, i2 = JE();
o2.empty(), o2.text(r2), o2.append(i2);
}, e5.prototype.setDisabled = function() {
var e6 = gw(this), t2 = this.menu.isDisabled(e6), n2 = this.$button;
(null == e6.selection || e6.isDisabled()) && (t2 = true);
var r2 = "disabled";
t2 ? n2.addClass(r2) : n2.removeClass(r2), this.disabled = t2;
}, e5.prototype.changeMenuState = function() {
this.setSelectedValue(), this.setDisabled();
}, e5;
})(), pw = (function() {
function e5(e6) {
this.$elem = Kv(''), this.$container = Kv(''), this.$button = Kv('');
var t2 = e6.key, n2 = e6.iconSvg, r2 = e6.title, o2 = this.$elem, i2 = this.$button;
if (n2) {
var a2 = Kv(n2);
ZE(a2), i2.append(a2);
} else i2.text(r2);
i2.attr("data-menu-key", t2);
var s2 = JE();
i2.append(s2), o2.append(i2);
var u2 = this.$container;
o2.append(u2);
var l2 = this.createObserver();
this.observe(l2);
}
return e5.prototype.appendBarItem = function(e6) {
var t2 = e6.$elem;
this.$container.append(t2);
}, e5.prototype.observe = function(e6) {
var t2 = this.$container;
e6.observe(t2[0], { childList: true, subtree: true, attributes: true });
}, e5.prototype.createObserver = function() {
var e6 = this, t2 = this.$container, n2 = this.$button, r2 = new MutationObserver(function() {
var o2 = t2.find("button"), i2 = o2.length;
if (0 !== i2) {
var a2 = 0;
o2.each(function(e7) {
Kv(e7).hasClass("disabled") && a2++;
}), r2.disconnect(), a2 === i2 ? n2.addClass("disabled") : n2.removeClass("disabled"), e6.observe(r2);
}
});
return r2;
}, e5;
})(), hw = /* @__PURE__ */ new WeakMap();
function gw(e5) {
var t2 = pv.get(e5);
if (null == t2) throw new Error("Can not get editor instance");
return t2;
}
function vw(e5, t2, n2) {
void 0 === n2 && (n2 = false);
var r2 = hw.get(t2);
if (r2) return r2;
var o2 = t2.tag;
if ("button" === o2) {
var i2 = t2.showDropPanel, a2 = t2.showModal;
r2 = i2 ? new iw(e5, t2, n2) : a2 ? new cw(e5, t2, n2) : new nw(e5, t2, n2);
}
if ("select" === o2 && (r2 = new fw(e5, t2, n2)), null == r2) throw new Error("Invalid tag in menu ".concat(JSON.stringify(t2)));
return hw.set(t2, r2), r2;
}
function mw(e5, t2) {
var n2 = e5.selection;
return null != n2 && (!xp.isCollapsed(n2) && (!Ty.getSelectedElems(e5).some(function(t3) {
if (e5.isVoid(t3)) return true;
var n3 = t3.type;
return !!["pre", "code", "table"].includes(n3);
}) && !!Sh.isText(t2)));
}
var yw, bw, Ew = (function() {
function e5() {
var e6 = this;
this.$elem = Kv(''), this.menus = {}, this.hoverbarItems = [], this.prevSelectedNode = null, this.isShow = false, this.lngListen = function() {
}, this.changeHoverbarState = eE(function() {
var t2 = e6.isShow, n2 = e6.getSelectedNodeAndMenuKeys() || {}, r2 = n2.node, o2 = void 0 === r2 ? null : r2, i2 = n2.menuKeys, a2 = void 0 === i2 ? [] : i2, s2 = e6.getEditorInstance();
if (null != o2 && e6.changeItemsState(), o2 && Np.isElement(o2) && t2) {
var u2 = e6.isSamePath(o2, e6.prevSelectedNode);
if (!hh.isBlock(s2, o2) && u2) return;
}
e6.hideAndClean(), null != o2 && (e6.registerItems(a2), e6.setPosition(o2), e6.show()), e6.prevSelectedNode = o2;
}, 200), Tm(function() {
var t2 = e6.getEditorInstance(), n2 = e6.$elem;
n2.on("mousedown", function(e7) {
return e7.preventDefault();
}, { passive: false }), Ty.getTextarea(t2).$textAreaContainer.append(n2), t2.on(Qg, e6.changeHoverbarState);
var r2 = e6.hideAndClean.bind(e6);
t2.on(ev, r2), t2.on(tv, r2), t2.on(nv, r2);
}), this.lngListen = YE(function() {
e6.menus = {}, e6.hideAndClean(), e6.getEditorInstance().deselect();
});
}
return e5.prototype.getMenus = function() {
return this.menus;
}, e5.prototype.hideAndClean = function() {
var e6 = this.$elem;
e6.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"), this.hoverbarItems = [], e6.empty(), this.isShow = false;
}, e5.prototype.checkPositionBottom = function() {
var e6 = this.$elem, t2 = false, n2 = "undefined" != typeof window ? window.innerHeight : null;
n2 && n2 >= 360 && (n2 - e6[0].getBoundingClientRect().bottom < 360 && (t2 = true));
t2 ? e6.addClass("w-e-bar-bottom") : e6.removeClass("w-e-bar-bottom");
}, e5.prototype.show = function() {
this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"), this.isShow = true, this.checkPositionBottom();
}, e5.prototype.changeItemsState = function() {
var e6 = this;
Tm(function() {
e6.hoverbarItems.forEach(function(e7) {
e7.changeMenuState();
});
});
}, e5.prototype.registerItems = function(e6) {
var t2 = this, n2 = this.$elem;
e6.forEach(function(e7) {
if ("|" !== e7) t2.registerSingleItem(e7);
else {
var r2 = QE();
n2.append(r2);
}
});
}, e5.prototype.registerSingleItem = function(e6) {
var t2 = this.getEditorInstance(), n2 = this.menus, r2 = n2[e6];
if (null == r2) {
var o2 = iv[e6];
if (null == o2) throw new Error("Not found menu item factory by key '".concat(e6, "'"));
if ("function" != typeof o2) throw new Error("Menu item factory (key='".concat(e6, "') is not a function"));
r2 = o2(), n2[e6] = r2;
}
var i2 = t2.getMenuConfig(e6);
i2 && void 0 !== i2.iconSvg && (r2.iconSvg = i2.iconSvg);
var a2 = vw(e6, r2);
this.hoverbarItems.push(a2), pv.set(a2, t2), this.$elem.append(a2.$elem);
}, e5.prototype.setPosition = function(e6) {
var t2 = this.getEditorInstance(), n2 = this.$elem;
if (n2.attr("style", ""), Np.isElement(e6)) {
var r2 = Kb(t2, e6, "bar");
return n2.css(r2), void Yb(t2, n2);
}
if (Sh.isText(e6)) {
r2 = qb(t2);
return n2.css(r2), void Yb(t2, n2);
}
throw new Error("hoverbar.setPosition error, current selected node is not elem nor text");
}, e5.prototype.getSelectedNodeAndMenuKeys = function() {
var e6 = this.getEditorInstance();
if (null == e6.selection) return null;
var t2 = this.getHoverbarKeysConf(), n2 = null, r2 = [], o2 = function(o3) {
var i3 = t2[o3], a2 = i3.match, s2 = i3.menuKeys, u2 = void 0 === s2 ? [] : s2, l2 = a2 || function(e7, t3) {
return Ty.checkNodeType(t3, o3);
}, c2 = Ig(hh.nodes(e6, { match: function(t3) {
return l2(e6, t3);
}, universal: true }), 1), d2 = c2[0];
if (null != d2) return n2 = d2[0], r2 = u2, "break";
};
for (var i2 in t2) {
if ("break" === o2(i2)) break;
}
return null == n2 || 0 === r2.length ? null : { node: n2, menuKeys: r2 };
}, e5.prototype.getEditorInstance = function() {
var e6 = dv.get(this);
if (null == e6) throw new Error("Can not get editor instance");
return e6;
}, e5.prototype.getHoverbarKeysConf = function() {
var e6 = this.getEditorInstance().getConfig().hoverbarKeys, t2 = void 0 === e6 ? {} : e6, n2 = t2.text;
return n2 && null == n2.match && (n2.match = mw), t2;
}, e5.prototype.isSamePath = function(e6, t2) {
if (null == e6 || null == t2) return false;
var n2 = Ty.findPath(null, e6), r2 = Ty.findPath(null, t2);
return bp.equals(n2, r2);
}, e5.prototype.destroy = function() {
var e6;
this.changeHoverbarState.cancel(), this.$elem.remove(), null === (e6 = this.lngListen) || void 0 === e6 || e6.call(this), this.menus = {}, this.hoverbarItems = [], this.prevSelectedNode = null;
}, e5;
})();
function ww() {
if (bw) return yw;
bw = 1;
var e5 = "Expected a function", t2 = /^\s+|\s+$/g, n2 = /^[-+]0x[0-9a-f]+$/i, r2 = /^0b[01]+$/i, o2 = /^0o[0-7]+$/i, i2 = parseInt, a2 = "object" == typeof y && y && y.Object === Object && y, s2 = "object" == typeof self && self && self.Object === Object && self, u2 = a2 || s2 || Function("return this")(), l2 = Object.prototype.toString, c2 = Math.max, d2 = Math.min, f2 = function() {
return u2.Date.now();
};
function p2(t3, n3, r3) {
var o3, i3, a3, s3, u3, l3, p3 = 0, v2 = false, m2 = false, y2 = true;
if ("function" != typeof t3) throw new TypeError(e5);
function b2(e6) {
var n4 = o3, r4 = i3;
return o3 = i3 = void 0, p3 = e6, s3 = t3.apply(r4, n4);
}
function E2(e6) {
var t4 = e6 - l3;
return void 0 === l3 || t4 >= n3 || t4 < 0 || m2 && e6 - p3 >= a3;
}
function w2() {
var e6 = f2();
if (E2(e6)) return C2(e6);
u3 = setTimeout(w2, (function(e7) {
var t4 = n3 - (e7 - l3);
return m2 ? d2(t4, a3 - (e7 - p3)) : t4;
})(e6));
}
function C2(e6) {
return u3 = void 0, y2 && o3 ? b2(e6) : (o3 = i3 = void 0, s3);
}
function D2() {
var e6 = f2(), t4 = E2(e6);
if (o3 = arguments, i3 = this, l3 = e6, t4) {
if (void 0 === u3) return (function(e7) {
return p3 = e7, u3 = setTimeout(w2, n3), v2 ? b2(e7) : s3;
})(l3);
if (m2) return u3 = setTimeout(w2, n3), b2(l3);
}
return void 0 === u3 && (u3 = setTimeout(w2, n3)), s3;
}
return n3 = g2(n3) || 0, h2(r3) && (v2 = !!r3.leading, a3 = (m2 = "maxWait" in r3) ? c2(g2(r3.maxWait) || 0, n3) : a3, y2 = "trailing" in r3 ? !!r3.trailing : y2), D2.cancel = function() {
void 0 !== u3 && clearTimeout(u3), p3 = 0, o3 = l3 = i3 = u3 = void 0;
}, D2.flush = function() {
return void 0 === u3 ? s3 : C2(f2());
}, D2;
}
function h2(e6) {
var t3 = typeof e6;
return !!e6 && ("object" == t3 || "function" == t3);
}
function g2(e6) {
if ("number" == typeof e6) return e6;
if ((function(e7) {
return "symbol" == typeof e7 || /* @__PURE__ */ (function(e8) {
return !!e8 && "object" == typeof e8;
})(e7) && "[object Symbol]" == l2.call(e7);
})(e6)) return NaN;
if (h2(e6)) {
var a3 = "function" == typeof e6.valueOf ? e6.valueOf() : e6;
e6 = h2(a3) ? a3 + "" : a3;
}
if ("string" != typeof e6) return 0 === e6 ? e6 : +e6;
e6 = e6.replace(t2, "");
var s3 = r2.test(e6);
return s3 || o2.test(e6) ? i2(e6.slice(2), s3 ? 2 : 8) : n2.test(e6) ? NaN : +e6;
}
return yw = function(t3, n3, r3) {
var o3 = true, i3 = true;
if ("function" != typeof t3) throw new TypeError(e5);
return h2(r3) && (o3 = "leading" in r3 ? !!r3.leading : o3, i3 = "trailing" in r3 ? !!r3.trailing : i3), p2(t3, n3, { leading: o3, maxWait: n3, trailing: i3 });
};
}
var Cw = b(ww());
function Dw(e5, t2) {
return Lm(t2) && Ty.hasDOMNode(e5, t2, { editable: true });
}
function Aw(e5, t2) {
return Lm(t2) && Ty.hasDOMNode(e5, t2);
}
function Sw(e5, t2) {
return Dw(e5, t2) || (function(e6, t3) {
if (e6.getConfig().readOnly) return false;
var n2 = Aw(e6, t3) && Ty.toSlateNode(e6, t3);
return !!n2 && Np.isElement(n2) && hh.isVoid(e6, n2);
})(e5, t2);
}
const xw = (e5) => "object" == typeof e5 && null != e5 && 1 === e5.nodeType, Ow = (e5, t2) => (!t2 || "hidden" !== e5) && "visible" !== e5 && "clip" !== e5, Nw = (e5, t2) => {
if (e5.clientHeight < e5.scrollHeight || e5.clientWidth < e5.scrollWidth) {
const n2 = getComputedStyle(e5, null);
return Ow(n2.overflowY, t2) || Ow(n2.overflowX, t2) || ((e6) => {
const t3 = ((e7) => {
if (!e7.ownerDocument || !e7.ownerDocument.defaultView) return null;
try {
return e7.ownerDocument.defaultView.frameElement;
} catch (e8) {
return null;
}
})(e6);
return !!t3 && (t3.clientHeight < e6.scrollHeight || t3.clientWidth < e6.scrollWidth);
})(e5);
}
return false;
}, Bw = (e5, t2, n2, r2, o2, i2, a2, s2) => i2 < e5 && a2 > t2 || i2 > e5 && a2 < t2 ? 0 : i2 <= e5 && s2 <= n2 || a2 >= t2 && s2 >= n2 ? i2 - e5 - r2 : a2 > t2 && s2 < n2 || i2 < e5 && s2 > n2 ? a2 - t2 + o2 : 0, Tw = (e5) => {
const t2 = e5.parentElement;
return null == t2 ? e5.getRootNode().host || null : t2;
}, kw = (e5, t2) => {
var n2, r2, o2, i2;
if ("undefined" == typeof document) return [];
const { scrollMode: a2, block: s2, inline: u2, boundary: l2, skipOverflowHiddenElements: c2 } = t2, d2 = "function" == typeof l2 ? l2 : (e6) => e6 !== l2;
if (!xw(e5)) throw new TypeError("Invalid target");
const f2 = document.scrollingElement || document.documentElement, p2 = [];
let h2 = e5;
for (; xw(h2) && d2(h2); ) {
if (h2 = Tw(h2), h2 === f2) {
p2.push(h2);
break;
}
null != h2 && h2 === document.body && Nw(h2) && !Nw(document.documentElement) || null != h2 && Nw(h2, c2) && p2.push(h2);
}
const g2 = null != (r2 = null == (n2 = window.visualViewport) ? void 0 : n2.width) ? r2 : innerWidth, v2 = null != (i2 = null == (o2 = window.visualViewport) ? void 0 : o2.height) ? i2 : innerHeight, { scrollX: m2, scrollY: y2 } = window, { height: b2, width: E2, top: w2, right: C2, bottom: D2, left: A2 } = e5.getBoundingClientRect(), { top: S2, right: x2, bottom: O2, left: N2 } = ((e6) => {
const t3 = window.getComputedStyle(e6);
return { top: parseFloat(t3.scrollMarginTop) || 0, right: parseFloat(t3.scrollMarginRight) || 0, bottom: parseFloat(t3.scrollMarginBottom) || 0, left: parseFloat(t3.scrollMarginLeft) || 0 };
})(e5);
let B2 = "start" === s2 || "nearest" === s2 ? w2 - S2 : "end" === s2 ? D2 + O2 : w2 + b2 / 2 - S2 + O2, T2 = "center" === u2 ? A2 + E2 / 2 - N2 + x2 : "end" === u2 ? C2 + x2 : A2 - N2;
const k2 = [];
for (let e6 = 0; e6 < p2.length; e6++) {
const t3 = p2[e6], { height: n3, width: r3, top: o3, right: i3, bottom: l3, left: c3 } = t3.getBoundingClientRect();
if ("if-needed" === a2 && w2 >= 0 && A2 >= 0 && D2 <= v2 && C2 <= g2 && (t3 === f2 && !Nw(t3) || w2 >= o3 && D2 <= l3 && A2 >= c3 && C2 <= i3)) return k2;
const d3 = getComputedStyle(t3), h3 = parseInt(d3.borderLeftWidth, 10), S3 = parseInt(d3.borderTopWidth, 10), x3 = parseInt(d3.borderRightWidth, 10), O3 = parseInt(d3.borderBottomWidth, 10);
let N3 = 0, F2 = 0;
const P2 = "offsetWidth" in t3 ? t3.offsetWidth - t3.clientWidth - h3 - x3 : 0, I2 = "offsetHeight" in t3 ? t3.offsetHeight - t3.clientHeight - S3 - O3 : 0, R2 = "offsetWidth" in t3 ? 0 === t3.offsetWidth ? 0 : r3 / t3.offsetWidth : 0, _2 = "offsetHeight" in t3 ? 0 === t3.offsetHeight ? 0 : n3 / t3.offsetHeight : 0;
if (f2 === t3) N3 = "start" === s2 ? B2 : "end" === s2 ? B2 - v2 : "nearest" === s2 ? Bw(y2, y2 + v2, v2, S3, O3, y2 + B2, y2 + B2 + b2, b2) : B2 - v2 / 2, F2 = "start" === u2 ? T2 : "center" === u2 ? T2 - g2 / 2 : "end" === u2 ? T2 - g2 : Bw(m2, m2 + g2, g2, h3, x3, m2 + T2, m2 + T2 + E2, E2), N3 = Math.max(0, N3 + y2), F2 = Math.max(0, F2 + m2);
else {
N3 = "start" === s2 ? B2 - o3 - S3 : "end" === s2 ? B2 - l3 + O3 + I2 : "nearest" === s2 ? Bw(o3, l3, n3, S3, O3 + I2, B2, B2 + b2, b2) : B2 - (o3 + n3 / 2) + I2 / 2, F2 = "start" === u2 ? T2 - c3 - h3 : "center" === u2 ? T2 - (c3 + r3 / 2) + P2 / 2 : "end" === u2 ? T2 - i3 + x3 + P2 : Bw(c3, i3, r3, h3, x3 + P2, T2, T2 + E2, E2);
const { scrollLeft: e7, scrollTop: a3 } = t3;
N3 = 0 === _2 ? 0 : Math.max(0, Math.min(a3 + N3 / _2, t3.scrollHeight - n3 / _2 + I2)), F2 = 0 === R2 ? 0 : Math.max(0, Math.min(e7 + F2 / R2, t3.scrollWidth - r3 / R2 + P2)), B2 += a3 - N3, T2 += e7 - F2;
}
k2.push({ el: t3, top: N3, left: F2 });
}
return k2;
};
function Fw(e5, t2) {
if (!e5.isConnected || !((e6) => {
let t3 = e6;
for (; t3 && t3.parentNode; ) {
if (t3.parentNode === document) return true;
t3 = t3.parentNode instanceof ShadowRoot ? t3.parentNode.host : t3.parentNode;
}
return false;
})(e5)) return;
const n2 = ((e6) => {
const t3 = window.getComputedStyle(e6);
return { top: parseFloat(t3.scrollMarginTop) || 0, right: parseFloat(t3.scrollMarginRight) || 0, bottom: parseFloat(t3.scrollMarginBottom) || 0, left: parseFloat(t3.scrollMarginLeft) || 0 };
})(e5);
if (((e6) => "object" == typeof e6 && "function" == typeof e6.behavior)(t2)) return t2.behavior(kw(e5, t2));
const r2 = "boolean" == typeof t2 || null == t2 ? void 0 : t2.behavior;
for (const { el: o2, top: i2, left: a2 } of kw(e5, ((e6) => false === e6 ? { block: "end", inline: "nearest" } : ((e7) => e7 === Object(e7) && 0 !== Object.keys(e7).length)(e6) ? e6 : { block: "start", inline: "nearest" })(t2))) {
const e6 = i2 - n2.top + n2.bottom, t3 = a2 - n2.left + n2.right;
o2.scroll({ top: e6, left: t3, behavior: r2 });
}
}
function Pw(e5) {
null != e5.selection && (e5.selection = null, e5.onChange());
}
function Iw(e5, t2, n2) {
void 0 === n2 && (n2 = false);
var r2 = t2.selection, o2 = t2.getConfig(), i2 = Ty.findDocumentOrShadowRoot(t2).getSelection();
if (i2 && (!e5.isComposing || n2) && t2.isFocused()) {
var a2 = "None" !== i2.type;
if (r2 || a2) {
var s2 = Av.get(t2), u2 = false;
if (s2.contains(i2.anchorNode) && s2.contains(i2.focusNode) && (u2 = true), a2 && u2 && r2) {
var l2 = Ty.toSlateRange(t2, i2, { exactMatch: true, suppressThrow: true });
if (l2 && xp.equals(l2, r2)) {
var c2 = true;
if (xp.isCollapsed(r2)) {
var d2 = i2.anchorNode, f2 = i2.anchorOffset;
if (d2 === s2) {
var p2 = s2.childNodes, h2 = void 0;
(h2 = p2[f2]) && h2.matches("table") && (c2 = false), (h2 = p2[f2 - 1]) && h2.matches("table") && (c2 = false);
}
}
if (c2) return;
}
}
if (!r2 || Ty.hasRange(t2, r2)) {
e5.isUpdatingSelection = true;
var g2 = r2 && Ty.toDOMRange(t2, r2);
if (g2) {
xp.isBackward(r2) ? i2.setBaseAndExtent(g2.endContainer, g2.endOffset, g2.startContainer, g2.startOffset) : i2.setBaseAndExtent(g2.startContainer, g2.startOffset, g2.endContainer, g2.endOffset);
var v2 = g2.startContainer.parentElement;
if (!v2.closest("[data-slate-spacer]") && g2.getBoundingClientRect) {
var m2 = g2.getBoundingClientRect.bind(g2)();
0 === m2.top && 0 === m2.right && 0 === m2.bottom && 0 === m2.left && 0 === m2.height && 0 === m2.width || (v2.getBoundingClientRect = g2.getBoundingClientRect.bind(g2));
var y2 = document.body;
Fw(v2, { scrollMode: "if-needed", boundary: o2.scroll && s2.parentElement || y2, block: "end", behavior: "smooth" }), delete v2.getBoundingClientRect;
}
} else i2.removeAllRanges();
setTimeout(function() {
g2 && Cy && s2.focus(), e5.isUpdatingSelection = false;
});
} else t2.selection = Ty.toSlateRange(t2, i2, { exactMatch: false, suppressThrow: false });
}
}
}
var Rw = /* @__PURE__ */ new WeakMap(), _w = /* @__PURE__ */ new WeakMap();
var Lw, Mw = {};
var jw = (function() {
if (Lw) return Mw;
Lw = 1, Object.defineProperty(Mw, "__esModule", { value: true });
for (var e5 = "undefined" != typeof window && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform), t2 = { alt: "altKey", control: "ctrlKey", meta: "metaKey", shift: "shiftKey" }, n2 = { add: "+", break: "pause", cmd: "meta", command: "meta", ctl: "control", ctrl: "control", del: "delete", down: "arrowdown", esc: "escape", ins: "insert", left: "arrowleft", mod: e5 ? "meta" : "control", opt: "alt", option: "alt", return: "enter", right: "arrowright", space: " ", spacebar: " ", up: "arrowup", win: "meta", windows: "meta" }, r2 = { backspace: 8, tab: 9, enter: 13, shift: 16, control: 17, alt: 18, pause: 19, capslock: 20, escape: 27, " ": 32, pageup: 33, pagedown: 34, end: 35, home: 36, arrowleft: 37, arrowup: 38, arrowright: 39, arrowdown: 40, insert: 45, delete: 46, meta: 91, numlock: 144, scrolllock: 145, ";": 186, "=": 187, ",": 188, "-": 189, ".": 190, "/": 191, "`": 192, "[": 219, "\\": 220, "]": 221, "'": 222 }, o2 = 1; o2 < 20; o2++) r2["f" + o2] = 111 + o2;
function i2(e6, t3, n3) {
t3 && !("byKey" in t3) && (n3 = t3, t3 = null), Array.isArray(e6) || (e6 = [e6]);
var r3 = e6.map(function(e7) {
return a2(e7, t3);
}), o3 = function(e7) {
return r3.some(function(t4) {
return s2(t4, e7);
});
};
return null == n3 ? o3 : o3(n3);
}
function a2(e6, o3) {
var i3 = o3 && o3.byKey, a3 = {}, s3 = (e6 = e6.replace("++", "+add")).split("+"), c2 = s3.length;
for (var d2 in t2) a3[t2[d2]] = false;
var f2 = true, p2 = false, h2 = void 0;
try {
for (var g2, v2 = s3[Symbol.iterator](); !(f2 = (g2 = v2.next()).done); f2 = true) {
var m2 = g2.value, y2 = m2.endsWith("?") && m2.length > 1;
y2 && (m2 = m2.slice(0, -1));
var b2 = l2(m2), E2 = t2[b2];
if (m2.length > 1 && !E2 && !n2[m2] && !r2[b2]) throw new TypeError('Unknown modifier: "' + m2 + '"');
1 !== c2 && E2 || (i3 ? a3.key = b2 : a3.which = u2(m2)), E2 && (a3[E2] = !y2 || null);
}
} catch (e7) {
p2 = true, h2 = e7;
} finally {
try {
!f2 && v2.return && v2.return();
} finally {
if (p2) throw h2;
}
}
return a3;
}
function s2(e6, t3) {
for (var n3 in e6) {
var r3 = e6[n3], o3 = void 0;
if (null != r3 && ((null != (o3 = "key" === n3 && null != t3.key ? t3.key.toLowerCase() : "which" === n3 ? 91 === r3 && 93 === t3.which ? 91 : t3.which : t3[n3]) || false !== r3) && o3 !== r3)) return false;
}
return true;
}
function u2(e6) {
return e6 = l2(e6), r2[e6] || e6.toUpperCase().charCodeAt(0);
}
function l2(e6) {
return e6 = e6.toLowerCase(), e6 = n2[e6] || e6;
}
return Mw.default = i2, Mw.isHotkey = i2, Mw.isCodeHotkey = function(e6, t3) {
return i2(e6, t3);
}, Mw.isKeyHotkey = function(e6, t3) {
return i2(e6, { byKey: true }, t3);
}, Mw.parseHotkey = a2, Mw.compareHotkey = s2, Mw.toKeyCode = u2, Mw.toKeyName = l2, Mw;
})(), Hw = { bold: "mod+b", compose: ["down", "left", "right", "up", "backspace", "enter"], moveBackward: "left", moveForward: "right", moveWordBackward: "ctrl+left", moveWordForward: "ctrl+right", deleteBackward: "shift?+backspace", deleteForward: "shift?+delete", extendBackward: "shift+left", extendForward: "shift+right", italic: "mod+i", splitBlock: "shift?+enter", undo: "mod+z", tab: "tab", selectAll: "mod+a" }, zw = { moveLineBackward: "opt+up", moveLineForward: "opt+down", moveWordBackward: "opt+left", moveWordForward: "opt+right", deleteBackward: ["ctrl+backspace", "ctrl+h"], deleteForward: ["ctrl+delete", "ctrl+d"], deleteLineBackward: "cmd+shift?+backspace", deleteLineForward: ["cmd+shift?+delete", "ctrl+k"], deleteWordBackward: "opt+shift?+backspace", deleteWordForward: "opt+shift?+delete", extendLineBackward: "opt+shift+up", extendLineForward: "opt+shift+down", redo: "cmd+shift+z", transposeCharacter: "ctrl+t" }, $w = { deleteWordBackward: "ctrl+shift?+backspace", deleteWordForward: "ctrl+shift?+delete", redo: ["ctrl+y", "ctrl+shift+z"] }, Uw = function(e5) {
var t2 = Hw[e5], n2 = zw[e5], r2 = $w[e5], o2 = t2 && jw.isKeyHotkey(t2), i2 = n2 && jw.isKeyHotkey(n2), a2 = r2 && jw.isKeyHotkey(r2);
return function(e6) {
return !(!o2 || !o2(e6)) || (!!(wy && i2 && i2(e6)) || !(wy || !a2 || !a2(e6)));
};
}, Vw = { isBold: Uw("bold"), isCompose: Uw("compose"), isMoveBackward: Uw("moveBackward"), isMoveForward: Uw("moveForward"), isDeleteBackward: Uw("deleteBackward"), isDeleteForward: Uw("deleteForward"), isDeleteLineBackward: Uw("deleteLineBackward"), isDeleteLineForward: Uw("deleteLineForward"), isDeleteWordBackward: Uw("deleteWordBackward"), isDeleteWordForward: Uw("deleteWordForward"), isExtendBackward: Uw("extendBackward"), isExtendForward: Uw("extendForward"), isExtendLineBackward: Uw("extendLineBackward"), isExtendLineForward: Uw("extendLineForward"), isItalic: Uw("italic"), isMoveLineBackward: Uw("moveLineBackward"), isMoveLineForward: Uw("moveLineForward"), isMoveWordBackward: Uw("moveWordBackward"), isMoveWordForward: Uw("moveWordForward"), isRedo: Uw("redo"), isSplitBlock: Uw("splitBlock"), isTransposeCharacter: Uw("transposeCharacter"), isUndo: Uw("undo"), isTab: Uw("tab"), isSelectAll: Uw("selectAll") };
function Ww(e5) {
e5.preventDefault();
}
var Gw = { beforeinput: function(e5, t2, n2) {
var r2, o2 = e5, i2 = n2.getConfig().readOnly;
if (Oy && !i2 && Dw(n2, o2.target)) {
null === (r2 = t2.flushDOMSelectionChange) || void 0 === r2 || r2.call(t2);
var a2 = n2.selection, s2 = o2.inputType, u2 = o2.dataTransfer || o2.data || void 0;
if ("insertCompositionText" !== s2 && "deleteCompositionText" !== s2) {
if (o2.preventDefault(), !s2.startsWith("delete") || s2.startsWith("deleteBy")) {
var l2 = Ig(o2.getTargetRanges(), 1)[0];
if (l2) {
var c2 = Ty.toSlateRange(n2, l2, { exactMatch: false, suppressThrow: false });
a2 && xp.equals(a2, c2) || $h.select(n2, c2);
}
}
if (a2 && xp.isExpanded(a2)) {
var d2 = Ty.getSelectedElems(n2), f2 = "table" === d2[0].type, p2 = "table-cell" !== d2[d2.length - 1].type;
if (f2 && p2) return;
if (s2.startsWith("delete")) {
var h2 = s2.endsWith("Backward") ? "backward" : "forward";
return void hh.deleteFragment(n2, { direction: h2 });
}
}
switch (s2) {
case "deleteByComposition":
case "deleteByCut":
case "deleteByDrag":
hh.deleteFragment(n2);
break;
case "deleteContent":
case "deleteContentForward":
hh.deleteForward(n2);
break;
case "deleteContentBackward":
hh.deleteBackward(n2);
break;
case "deleteEntireSoftLine":
hh.deleteBackward(n2, { unit: "line" }), hh.deleteForward(n2, { unit: "line" });
break;
case "deleteHardLineBackward":
hh.deleteBackward(n2, { unit: "block" });
break;
case "deleteSoftLineBackward":
hh.deleteBackward(n2, { unit: "line" });
break;
case "deleteHardLineForward":
hh.deleteForward(n2, { unit: "block" });
break;
case "deleteSoftLineForward":
hh.deleteForward(n2, { unit: "line" });
break;
case "deleteWordBackward":
hh.deleteBackward(n2, { unit: "word" });
break;
case "deleteWordForward":
hh.deleteForward(n2, { unit: "word" });
break;
case "insertLineBreak":
case "insertParagraph":
hh.insertBreak(n2);
break;
case "insertFromDrop":
case "insertFromComposition":
case "insertFromPaste":
case "insertFromYank":
case "insertReplacementText":
case "insertText":
if ("insertFromComposition" === s2 && (t2.isComposing = false, Iv.set(n2, true)), "insertFromPaste" === s2 && !Pv.get(n2)) break;
"[object DataTransfer]" === Pm(u2) ? n2.insertData(u2) : "string" == typeof u2 && hh.insertText(n2, u2);
}
}
}
}, blur: function(e5, t2, n2) {
var r2 = e5, o2 = t2.isUpdatingSelection, i2 = t2.latestElement;
if (!n2.getConfig().readOnly && !o2 && Dw(n2, r2.target)) {
var a2 = Ty.findDocumentOrShadowRoot(n2);
if (i2 !== a2.activeElement) {
var s2 = r2.relatedTarget;
if (!(s2 === Ty.toDOMNode(n2, n2) || jm(s2) && s2.hasAttribute("data-slate-spacer"))) {
if (null != s2 && Lm(s2) && Ty.hasDOMNode(n2, s2)) {
var u2 = Ty.toSlateNode(n2, s2);
if (Np.isElement(u2) && !n2.isVoid(u2)) return;
}
if (Dy) {
var l2 = a2.getSelection();
null == l2 || l2.removeAllRanges();
}
Tv.delete(n2);
}
}
}
}, focus: function(e5, t2, n2) {
var r2 = Ty.toDOMNode(n2, n2), o2 = Ty.findDocumentOrShadowRoot(n2);
t2.latestElement = o2.activeElement, Cy && e5.target !== r2 ? r2.focus() : Tv.set(n2, true);
}, click: function(e5, t2, n2) {
if (!n2.getConfig().readOnly && Aw(n2, e5.target) && Lm(e5.target)) {
var r2 = Ty.toSlateNode(n2, e5.target), o2 = Ty.findPath(n2, r2);
if (hh.hasPath(n2, o2)) {
if (Pp.get(n2, o2) === r2) {
var i2 = hh.start(n2, o2), a2 = hh.end(n2, o2), s2 = hh.void(n2, { at: i2 }), u2 = hh.void(n2, { at: a2 });
if (s2 && u2 && bp.equals(s2[1], u2[1])) {
var l2 = hh.range(n2, i2);
$h.select(n2, l2);
}
}
}
}
}, compositionstart: function(e5, t2, n2) {
if (Dw(n2, e5.target)) {
Rv.delete(n2);
var r2 = n2.selection;
if (r2 && xp.isExpanded(r2) && (hh.deleteFragment(n2), Promise.resolve().then(function() {
Iw(t2, n2, true);
})), n2.selection) {
var o2 = Ty.toDOMRange(n2, n2.selection).startContainer, i2 = o2.textContent || "";
Rw.set(n2, i2), _w.set(n2, o2);
}
t2.isComposing = true, (function(e6, t3) {
var n3;
t3.getConfig().placeholder && t3.isEmpty() && e6.showPlaceholder && (null === (n3 = e6.$placeholder) || void 0 === n3 || n3.hide(), e6.showPlaceholder = false);
})(t2, n2);
}
}, compositionend: function(e5, t2, n2) {
var r2 = e5;
if (Dw(n2, r2.target)) {
t2.isComposing = false;
var o2 = true === Iv.get(n2);
o2 ? (Iv.delete(n2), Rv.delete(n2)) : Rv.delete(n2);
var i2 = n2.selection;
if (null != i2) {
(xy || Cy) && Ty.cleanExposedTexNodeInSelectionBlock(n2);
for (var a2 = xp.isBackward(i2) ? i2.focus : i2.anchor, s2 = Ig(hh.node(n2, [a2.path[0]]), 1)[0], u2 = 0; u2 < a2.path.length; u2 += 1) {
var l2 = Ig(hh.node(n2, a2.path.slice(0, u2 + 1)), 1)[0];
if (Np.isElement(l2) && ((Dy || Cy) && "link" === l2.type || "code" === l2.type)) {
Ty.setNewKey(s2);
break;
}
}
var c2 = r2.data;
if (c2 && !o2) {
if (n2.getConfig().maxLength) {
var d2 = Ty.getLeftLengthOfMaxLength(n2);
if (d2 < c2.length) {
var f2 = Ty.toDOMRange(n2, i2);
f2.startContainer.nodeType === Node.TEXT_NODE && (f2.startContainer.textContent = Rw.get(n2) || ""), d2 > 0 && hh.insertText(n2, c2.slice(0, d2)), t2.changeViewState();
} else hh.insertText(n2, c2);
} else {
var p2 = Ty.findDocumentOrShadowRoot(n2).getSelection();
p2 && (function(e6, t3) {
if (xp.isCollapsed(t3)) {
var n3 = t3.anchor, r3 = t3.focus;
if ([2, 3].includes(n3.path.length) && [2, 3].includes(r3.path.length) && (0 === n3.offset || 0 === r3.offset)) {
var o3 = hh.node(e6, n3.path), i3 = 0 === n3.offset ? n3.path : r3.path, a3 = [i3[0], i3[1] - 1];
if (0 === i3[1]) return false;
var s3 = hh.node(e6, a3);
if (Sh.isText(s3[0]) && Sh.isText(o3[0])) return true;
}
}
})(n2, i2) && (n2.selection = Ty.toSlateRange(n2, p2, { exactMatch: false, suppressThrow: false })), hh.insertText(n2, c2);
}
Dy || setTimeout(function() {
var e6 = n2.selection;
if (null != e6) {
var t3 = _w.get(n2);
if (null != t3) Ty.toDOMRange(n2, e6).startContainer !== t3 && (t3.textContent = Rw.get(n2) || "");
}
});
}
}
}
}, compositionupdate: function(e5, t2, n2) {
Dw(n2, e5.target) && (t2.isComposing = true);
}, keydown: function(e5, t2, n2) {
var r2 = e5, o2 = n2.selection;
if (!n2.getConfig().readOnly && !t2.isComposing && Dw(n2, r2.target)) {
if ((function(e6, t3) {
var n3 = cv.get(e6), r3 = n3 && n3.getMenus(), o3 = fv.get(e6), i3 = o3 && o3.getMenus(), a2 = Tg(Tg({}, r3), i3);
for (var s2 in a2) {
var u2 = a2[s2], l2 = u2.hotkey;
if (l2 && jw.isHotkey(l2, t3) && !u2.isDisabled(e6)) {
var c2 = u2.getValue(e6);
u2.exec(e6, c2);
}
}
})(n2, r2), Vw.isTab(r2)) return Ww(r2), void n2.handleTab();
if (Vw.isRedo(r2)) return Ww(r2), void ("function" == typeof n2.redo && n2.redo());
if (Vw.isUndo(r2)) return Ww(r2), void ("function" == typeof n2.undo && n2.undo());
if (Vw.isMoveLineBackward(r2)) return Ww(r2), void $h.move(n2, { unit: "line", reverse: true });
if (Vw.isMoveLineForward(r2)) return Ww(r2), void $h.move(n2, { unit: "line" });
if (Vw.isExtendLineBackward(r2)) return Ww(r2), void $h.move(n2, { unit: "line", edge: "focus", reverse: true });
if (Vw.isExtendLineForward(r2)) return Ww(r2), void $h.move(n2, { unit: "line", edge: "focus" });
if (Vw.isMoveBackward(r2)) return Ww(r2), void (o2 && xp.isCollapsed(o2) ? $h.move(n2, { reverse: true }) : $h.collapse(n2, { edge: "start" }));
if (Vw.isMoveForward(r2)) return Ww(r2), void (o2 && xp.isCollapsed(o2) ? $h.move(n2) : $h.collapse(n2, { edge: "end" }));
if (Vw.isMoveWordBackward(r2)) return Ww(r2), o2 && xp.isExpanded(o2) && $h.collapse(n2, { edge: "focus" }), void $h.move(n2, { unit: "word", reverse: true });
if (Vw.isMoveWordForward(r2)) return Ww(r2), o2 && xp.isExpanded(o2) && $h.collapse(n2, { edge: "focus" }), void $h.move(n2, { unit: "word" });
if (Vw.isSelectAll(r2)) return Ww(r2), void n2.selectAll();
if (Oy) {
if ((xy || Dy) && o2 && (Vw.isDeleteBackward(r2) || Vw.isDeleteForward(r2)) && xp.isCollapsed(o2)) {
var i2 = Pp.parent(n2, o2.anchor.path);
if (Np.isElement(i2) && hh.isVoid(n2, i2) && hh.isInline(n2, i2)) return r2.preventDefault(), void $h.delete(n2, { unit: "block" });
}
} else {
if (Vw.isBold(r2) || Vw.isItalic(r2) || Vw.isTransposeCharacter(r2)) return void Ww(r2);
if (Vw.isSplitBlock(r2)) return Ww(r2), void hh.insertBreak(n2);
if (Vw.isDeleteBackward(r2)) return Ww(r2), void (o2 && xp.isExpanded(o2) ? hh.deleteFragment(n2, { direction: "backward" }) : hh.deleteBackward(n2));
if (Vw.isDeleteForward(r2)) return Ww(r2), void (o2 && xp.isExpanded(o2) ? hh.deleteFragment(n2, { direction: "forward" }) : hh.deleteForward(n2));
if (Vw.isDeleteLineBackward(r2)) return Ww(r2), void (o2 && xp.isExpanded(o2) ? hh.deleteFragment(n2, { direction: "backward" }) : hh.deleteBackward(n2, { unit: "line" }));
if (Vw.isDeleteLineForward(r2)) return Ww(r2), void (o2 && xp.isExpanded(o2) ? hh.deleteFragment(n2, { direction: "forward" }) : hh.deleteForward(n2, { unit: "line" }));
if (Vw.isDeleteWordBackward(r2)) return Ww(r2), void (o2 && xp.isExpanded(o2) ? hh.deleteFragment(n2, { direction: "backward" }) : hh.deleteBackward(n2, { unit: "word" }));
if (Vw.isDeleteWordForward(r2)) return Ww(r2), void (o2 && xp.isExpanded(o2) ? hh.deleteFragment(n2, { direction: "forward" }) : hh.deleteForward(n2, { unit: "word" }));
}
}
}, keypress: function(e5, t2, n2) {
if (!Oy && !n2.getConfig().readOnly && Dw(n2, e5.target)) {
e5.preventDefault();
var r2 = e5.key;
hh.insertText(n2, r2);
}
}, copy: function(e5, t2, n2) {
var r2 = e5;
if (Dw(n2, r2.target)) {
n2.getConfig().readOnly || r2.preventDefault();
var o2 = r2.clipboardData;
if (null != o2) {
n2.setFragmentData(o2);
var i2 = n2.getConfig().customCopy;
i2 && i2(n2, r2);
}
}
}, cut: function(e5, t2, n2) {
var r2 = e5, o2 = n2.selection;
if (!n2.getConfig().readOnly && (r2.preventDefault(), Dw(n2, r2.target))) {
var i2 = r2.clipboardData;
if (null != i2 && (n2.setFragmentData(i2), o2)) if (xp.isExpanded(o2)) hh.deleteFragment(n2);
else {
var a2 = Pp.parent(n2, o2.anchor.path);
Np.isElement(a2) && hh.isVoid(n2, a2) && $h.delete(n2);
}
}
}, paste: function(e5, t2, n2) {
Pv.set(n2, true);
var r2 = e5;
if (!n2.getConfig().readOnly && Dw(n2, r2.target)) {
var o2 = n2.getConfig().customPaste;
if (o2) {
if (false === o2(n2, r2)) return Pv.set(n2, false), void r2.preventDefault();
}
if (Dy || !Oy || (function(e6) {
return e6.clipboardData && "" !== e6.clipboardData.getData("text/plain") && 1 === e6.clipboardData.types.length;
})(r2)) {
r2.preventDefault();
var i2 = r2.clipboardData;
null != i2 && n2.insertData(i2);
}
}
}, dragover: function(e5, t2, n2) {
if (Aw(n2, e5.target)) {
var r2 = Ty.toSlateNode(n2, e5.target);
Np.isElement(r2) && hh.isVoid(n2, r2) && e5.preventDefault();
}
}, dragstart: function(e5, t2, n2) {
var r2 = e5;
if (Aw(n2, r2.target) && !n2.getConfig().readOnly) {
var o2 = Ty.toSlateNode(n2, r2.target), i2 = Ty.findPath(n2, o2);
if (Np.isElement(o2) && hh.isVoid(n2, o2) || hh.void(n2, { at: i2, voids: true })) {
var a2 = hh.range(n2, i2);
$h.select(n2, a2);
}
var s2 = r2.dataTransfer;
if (null != s2) Ty.getSelectedNodeByType(n2, "table") || (t2.isDraggingInternally = true, n2.setFragmentData(s2));
}
}, dragend: function(e5, t2, n2) {
var r2 = e5;
n2.getConfig().readOnly || t2.isDraggingInternally && Aw(n2, r2.target) && (t2.isDraggingInternally = false);
}, drop: function(e5, t2, n2) {
var r2 = e5, o2 = r2.dataTransfer;
if (!n2.getConfig().readOnly && Aw(n2, r2.target) && null != o2 && !(Oy && Dy && o2.files.length > 0)) {
r2.preventDefault();
var i2 = n2.selection, a2 = Ty.findEventRange(n2, r2);
$h.select(n2, a2), t2.isDraggingInternally && (i2 && $h.delete(n2, { at: i2 }), t2.isDraggingInternally = false), n2.insertData(o2), n2.isFocused() || n2.focus();
}
} };
function qw(e5) {
if (Kw(e5)) {
for (; e5 && Kw(e5); ) {
e5 = Yw(e5).parent;
}
return null != e5 ? e5 : null;
}
return e5.parentNode;
}
function Kw(e5) {
return 11 === e5.nodeType;
}
function Yw(e5, t2) {
var n2, r2, o2;
const i2 = e5;
return null !== (n2 = i2.parent) && void 0 !== n2 || (i2.parent = null != t2 ? t2 : null), null !== (r2 = i2.firstChildNode) && void 0 !== r2 || (i2.firstChildNode = e5.firstChild), null !== (o2 = i2.lastChildNode) && void 0 !== o2 || (i2.lastChildNode = e5.lastChild), i2;
}
const Xw = { createElement: function(e5, t2) {
return document.createElement(e5, t2);
}, createElementNS: function(e5, t2, n2) {
return document.createElementNS(e5, t2, n2);
}, createTextNode: function(e5) {
return document.createTextNode(e5);
}, createDocumentFragment: function() {
return Yw(document.createDocumentFragment());
}, createComment: function(e5) {
return document.createComment(e5);
}, insertBefore: function(e5, t2, n2) {
if (Kw(e5)) {
let t3 = e5;
for (; t3 && Kw(t3); ) {
t3 = Yw(t3).parent;
}
e5 = null != t3 ? t3 : e5;
}
Kw(t2) && (t2 = Yw(t2, e5)), n2 && Kw(n2) && (n2 = Yw(n2).firstChildNode), e5.insertBefore(t2, n2);
}, removeChild: function(e5, t2) {
e5.removeChild(t2);
}, appendChild: function(e5, t2) {
Kw(t2) && (t2 = Yw(t2, e5)), e5.appendChild(t2);
}, parentNode: qw, nextSibling: function(e5) {
var t2;
if (Kw(e5)) {
const n2 = Yw(e5), r2 = qw(n2);
if (r2 && n2.lastChildNode) {
const e6 = Array.from(r2.childNodes), o2 = e6.indexOf(n2.lastChildNode);
return null !== (t2 = e6[o2 + 1]) && void 0 !== t2 ? t2 : null;
}
return null;
}
return e5.nextSibling;
}, tagName: function(e5) {
return e5.tagName;
}, setTextContent: function(e5, t2) {
e5.textContent = t2;
}, getTextContent: function(e5) {
return e5.textContent;
}, isElement: function(e5) {
return 1 === e5.nodeType;
}, isText: function(e5) {
return 3 === e5.nodeType;
}, isComment: function(e5) {
return 8 === e5.nodeType;
}, isDocumentFragment: Kw };
function Zw(e5, t2, n2, r2, o2) {
return { sel: e5, data: t2, children: n2, text: r2, elm: o2, key: void 0 === t2 ? void 0 : t2.key };
}
const Jw = Array.isArray;
function Qw(e5) {
return "string" == typeof e5 || "number" == typeof e5 || e5 instanceof String || e5 instanceof Number;
}
const eC = Zw("", {}, [], void 0, void 0);
function tC(e5, t2) {
var n2, r2;
const o2 = e5.key === t2.key, i2 = (null === (n2 = e5.data) || void 0 === n2 ? void 0 : n2.is) === (null === (r2 = t2.data) || void 0 === r2 ? void 0 : r2.is), a2 = e5.sel === t2.sel, s2 = !(!e5.sel && e5.sel === t2.sel) || typeof e5.text == typeof t2.text;
return a2 && o2 && i2 && s2;
}
function nC(e5, t2, n2) {
var r2;
const o2 = {};
for (let i2 = t2; i2 <= n2; ++i2) {
const t3 = null === (r2 = e5[i2]) || void 0 === r2 ? void 0 : r2.key;
void 0 !== t3 && (o2[t3] = i2);
}
return o2;
}
const rC = ["create", "update", "remove", "destroy", "pre", "post"];
function oC(e5, t2, n2) {
const r2 = { create: [], update: [], remove: [], destroy: [], pre: [], post: [] }, o2 = Xw;
for (const t3 of rC) for (const n3 of e5) {
const e6 = n3[t3];
void 0 !== e6 && r2[t3].push(e6);
}
function i2(e6) {
const t3 = e6.id ? "#" + e6.id : "", n3 = e6.getAttribute("class"), r3 = n3 ? "." + n3.split(" ").join(".") : "";
return Zw(o2.tagName(e6).toLowerCase() + t3 + r3, {}, [], void 0, e6);
}
function a2(e6) {
return Zw(void 0, {}, [], void 0, e6);
}
function s2(e6, t3) {
return function() {
if (0 === --t3) {
const t4 = o2.parentNode(e6);
null !== t4 && o2.removeChild(t4, e6);
}
};
}
function u2(e6, t3) {
var n3, i3, a3;
let s3;
const l3 = e6.data, c3 = null == l3 ? void 0 : l3.hook;
null === (n3 = null == c3 ? void 0 : c3.init) || void 0 === n3 || n3.call(c3, e6);
const d3 = e6.children, f3 = e6.sel;
if ("!" === f3) null !== (i3 = e6.text) && void 0 !== i3 || (e6.text = ""), e6.elm = o2.createComment(e6.text);
else if ("" === f3) e6.elm = o2.createTextNode(e6.text);
else if (void 0 !== f3) {
const n4 = f3.indexOf("#"), i4 = f3.indexOf(".", n4), p2 = n4 > 0 ? n4 : f3.length, h2 = i4 > 0 ? i4 : f3.length, g2 = -1 !== n4 || -1 !== i4 ? f3.slice(0, Math.min(p2, h2)) : f3, v2 = null == l3 ? void 0 : l3.ns, m2 = void 0 === v2 ? o2.createElement(g2, l3) : o2.createElementNS(v2, g2, l3);
for (e6.elm = m2, p2 < h2 && m2.setAttribute("id", f3.slice(p2 + 1, h2)), i4 > 0 && m2.setAttribute("class", f3.slice(h2 + 1).replace(/\./g, " ")), s3 = 0; s3 < r2.create.length; ++s3) r2.create[s3](eC, e6);
if (!Qw(e6.text) || Jw(d3) && 0 !== d3.length || o2.appendChild(m2, o2.createTextNode(e6.text)), Jw(d3)) for (s3 = 0; s3 < d3.length; ++s3) {
const e7 = d3[s3];
null != e7 && o2.appendChild(m2, u2(e7, t3));
}
void 0 !== c3 && (null === (a3 = c3.create) || void 0 === a3 || a3.call(c3, eC, e6), void 0 !== c3.insert && t3.push(e6));
} else e6.elm = o2.createTextNode(e6.text);
return e6.elm;
}
function l2(e6, t3, n3, r3, i3, a3) {
for (; r3 <= i3; ++r3) {
const i4 = n3[r3];
null != i4 && o2.insertBefore(e6, u2(i4, a3), t3);
}
}
function c2(e6) {
var t3, n3;
const o3 = e6.data;
if (void 0 !== o3) {
null === (n3 = null === (t3 = null == o3 ? void 0 : o3.hook) || void 0 === t3 ? void 0 : t3.destroy) || void 0 === n3 || n3.call(t3, e6);
for (let t4 = 0; t4 < r2.destroy.length; ++t4) r2.destroy[t4](e6);
if (void 0 !== e6.children) for (let t4 = 0; t4 < e6.children.length; ++t4) {
const n4 = e6.children[t4];
null != n4 && "string" != typeof n4 && c2(n4);
}
}
}
function d2(e6, t3, n3, i3) {
for (var a3, u3; n3 <= i3; ++n3) {
let i4;
const l3 = t3[n3];
if (null != l3) if (void 0 !== l3.sel) {
c2(l3), i4 = r2.remove.length + 1;
const e7 = s2(l3.elm, i4);
for (let t5 = 0; t5 < r2.remove.length; ++t5) r2.remove[t5](l3, e7);
const t4 = null === (u3 = null === (a3 = null == l3 ? void 0 : l3.data) || void 0 === a3 ? void 0 : a3.hook) || void 0 === u3 ? void 0 : u3.remove;
void 0 !== t4 ? t4(l3, e7) : e7();
} else l3.children ? (c2(l3), d2(e6, l3.children, 0, l3.children.length - 1)) : o2.removeChild(e6, l3.elm);
}
}
function f2(e6, t3, n3) {
var i3, a3, s3, c3, p2, h2, g2, v2;
const m2 = null === (i3 = t3.data) || void 0 === i3 ? void 0 : i3.hook;
null === (a3 = null == m2 ? void 0 : m2.prepatch) || void 0 === a3 || a3.call(m2, e6, t3);
const y2 = t3.elm = e6.elm;
if (e6 === t3) return;
if (void 0 !== t3.data || void 0 !== t3.text && t3.text !== e6.text) {
null !== (s3 = t3.data) && void 0 !== s3 || (t3.data = {}), null !== (c3 = e6.data) && void 0 !== c3 || (e6.data = {});
for (let n4 = 0; n4 < r2.update.length; ++n4) r2.update[n4](e6, t3);
null === (g2 = null === (h2 = null === (p2 = t3.data) || void 0 === p2 ? void 0 : p2.hook) || void 0 === h2 ? void 0 : h2.update) || void 0 === g2 || g2.call(h2, e6, t3);
}
const b2 = e6.children, E2 = t3.children;
void 0 === t3.text ? void 0 !== b2 && void 0 !== E2 ? b2 !== E2 && (function(e7, t4, n4, r3) {
let i4, a4, s4, c4, p3 = 0, h3 = 0, g3 = t4.length - 1, v3 = t4[0], m3 = t4[g3], y3 = n4.length - 1, b3 = n4[0], E3 = n4[y3];
for (; p3 <= g3 && h3 <= y3; ) null == v3 ? v3 = t4[++p3] : null == m3 ? m3 = t4[--g3] : null == b3 ? b3 = n4[++h3] : null == E3 ? E3 = n4[--y3] : tC(v3, b3) ? (f2(v3, b3, r3), v3 = t4[++p3], b3 = n4[++h3]) : tC(m3, E3) ? (f2(m3, E3, r3), m3 = t4[--g3], E3 = n4[--y3]) : tC(v3, E3) ? (f2(v3, E3, r3), o2.insertBefore(e7, v3.elm, o2.nextSibling(m3.elm)), v3 = t4[++p3], E3 = n4[--y3]) : tC(m3, b3) ? (f2(m3, b3, r3), o2.insertBefore(e7, m3.elm, v3.elm), m3 = t4[--g3], b3 = n4[++h3]) : (void 0 === i4 && (i4 = nC(t4, p3, g3)), a4 = i4[b3.key], void 0 === a4 ? (o2.insertBefore(e7, u2(b3, r3), v3.elm), b3 = n4[++h3]) : void 0 === i4[E3.key] ? (o2.insertBefore(e7, u2(E3, r3), o2.nextSibling(m3.elm)), E3 = n4[--y3]) : (s4 = t4[a4], s4.sel !== b3.sel ? o2.insertBefore(e7, u2(b3, r3), v3.elm) : (f2(s4, b3, r3), t4[a4] = void 0, o2.insertBefore(e7, s4.elm, v3.elm)), b3 = n4[++h3]));
h3 <= y3 && (c4 = null == n4[y3 + 1] ? null : n4[y3 + 1].elm, l2(e7, c4, n4, h3, y3, r3)), p3 <= g3 && d2(e7, t4, p3, g3);
})(y2, b2, E2, n3) : void 0 !== E2 ? (void 0 !== e6.text && o2.setTextContent(y2, ""), l2(y2, null, E2, 0, E2.length - 1, n3)) : void 0 !== b2 ? d2(y2, b2, 0, b2.length - 1) : void 0 !== e6.text && o2.setTextContent(y2, "") : e6.text !== t3.text && (void 0 !== b2 && d2(y2, b2, 0, b2.length - 1), o2.setTextContent(y2, t3.text)), null === (v2 = null == m2 ? void 0 : m2.postpatch) || void 0 === v2 || v2.call(m2, e6, t3);
}
return function(e6, t3) {
let n3, s3, l3;
const c3 = [];
for (n3 = 0; n3 < r2.pre.length; ++n3) r2.pre[n3]();
for (!(function(e7, t4) {
return e7.isElement(t4);
})(o2, e6) ? (function(e7, t4) {
return e7.isDocumentFragment(t4);
})(o2, e6) && (e6 = a2(e6)) : e6 = i2(e6), tC(e6, t3) ? f2(e6, t3, c3) : (s3 = e6.elm, l3 = o2.parentNode(s3), u2(t3, c3), null !== l3 && (o2.insertBefore(l3, t3.elm, o2.nextSibling(s3)), d2(l3, [e6], 0, 0))), n3 = 0; n3 < c3.length; ++n3) c3[n3].data.hook.insert(c3[n3]);
for (n3 = 0; n3 < r2.post.length; ++n3) r2.post[n3]();
return t3;
};
}
function iC(e5, t2, n2) {
if (e5.ns = "http://www.w3.org/2000/svg", "foreignObject" !== n2 && void 0 !== t2) for (let e6 = 0; e6 < t2.length; ++e6) {
const n3 = t2[e6];
if ("string" == typeof n3) continue;
const r2 = n3.data;
void 0 !== r2 && iC(r2, n3.children, n3.sel);
}
}
function aC(e5, t2, n2) {
let r2, o2, i2, a2 = {};
if (void 0 !== n2 ? (null !== t2 && (a2 = t2), Jw(n2) ? r2 = n2 : Qw(n2) ? o2 = n2.toString() : n2 && n2.sel && (r2 = [n2])) : null != t2 && (Jw(t2) ? r2 = t2 : Qw(t2) ? o2 = t2.toString() : t2 && t2.sel ? r2 = [t2] : a2 = t2), void 0 !== r2) for (i2 = 0; i2 < r2.length; ++i2) Qw(r2[i2]) && (r2[i2] = Zw(void 0, void 0, void 0, r2[i2], void 0));
return !e5.startsWith("svg") || 3 !== e5.length && "." !== e5[3] && "#" !== e5[3] || iC(a2, r2, e5), Zw(e5, a2, r2, o2, void 0);
}
function sC(e5, t2) {
let n2;
const r2 = t2.elm;
let o2 = e5.data.attrs, i2 = t2.data.attrs;
if ((o2 || i2) && o2 !== i2) {
for (n2 in o2 = o2 || {}, i2 = i2 || {}, i2) {
const e6 = i2[n2];
o2[n2] !== e6 && (true === e6 ? r2.setAttribute(n2, "") : false === e6 ? r2.removeAttribute(n2) : 120 !== n2.charCodeAt(0) ? r2.setAttribute(n2, e6) : 58 === n2.charCodeAt(3) ? r2.setAttributeNS("http://www.w3.org/XML/1998/namespace", n2, e6) : 58 === n2.charCodeAt(5) ? 109 === n2.charCodeAt(1) ? r2.setAttributeNS("http://www.w3.org/2000/xmlns/", n2, e6) : r2.setAttributeNS("http://www.w3.org/1999/xlink", n2, e6) : r2.setAttribute(n2, e6));
}
for (n2 in o2) n2 in i2 || r2.removeAttribute(n2);
}
}
const uC = { create: sC, update: sC };
function lC(e5, t2) {
let n2, r2;
const o2 = t2.elm;
let i2 = e5.data.class, a2 = t2.data.class;
if ((i2 || a2) && i2 !== a2) {
for (r2 in i2 = i2 || {}, a2 = a2 || {}, i2) i2[r2] && !Object.prototype.hasOwnProperty.call(a2, r2) && o2.classList.remove(r2);
for (r2 in a2) n2 = a2[r2], n2 !== i2[r2] && o2.classList[n2 ? "add" : "remove"](r2);
}
}
const cC = { create: lC, update: lC }, dC = /[A-Z]/g;
function fC(e5, t2) {
const n2 = t2.elm;
let r2, o2 = e5.data.dataset, i2 = t2.data.dataset;
if (!o2 && !i2) return;
if (o2 === i2) return;
o2 = o2 || {}, i2 = i2 || {};
const a2 = n2.dataset;
for (r2 in o2) r2 in i2 || (a2 ? r2 in a2 && delete a2[r2] : n2.removeAttribute("data-" + r2.replace(dC, "-$&").toLowerCase()));
for (r2 in i2) o2[r2] !== i2[r2] && (a2 ? a2[r2] = i2[r2] : n2.setAttribute("data-" + r2.replace(dC, "-$&").toLowerCase(), i2[r2]));
}
const pC = { create: fC, update: fC };
function hC(e5, t2, n2) {
if ("function" == typeof e5) e5.call(t2, n2, t2);
else if ("object" == typeof e5) for (let r2 = 0; r2 < e5.length; r2++) hC(e5[r2], t2, n2);
}
function gC(e5, t2) {
const n2 = e5.type, r2 = t2.data.on;
r2 && r2[n2] && hC(r2[n2], t2, e5);
}
function vC(e5, t2) {
const n2 = e5.data.on, r2 = e5.listener, o2 = e5.elm, i2 = t2 && t2.data.on, a2 = t2 && t2.elm;
let s2;
if (n2 !== i2) {
if (n2 && r2) if (i2) for (s2 in n2) i2[s2] || o2.removeEventListener(s2, r2, false);
else for (s2 in n2) o2.removeEventListener(s2, r2, false);
if (i2) {
const r3 = t2.listener = e5.listener || function e6(t3) {
gC(t3, e6.vnode);
};
if (r3.vnode = t2, n2) for (s2 in i2) n2[s2] || a2.addEventListener(s2, r3, false);
else for (s2 in i2) a2.addEventListener(s2, r3, false);
}
}
}
const mC = { create: vC, update: vC, destroy: vC };
function yC(e5, t2) {
let n2, r2, o2;
const i2 = t2.elm;
let a2 = e5.data.props, s2 = t2.data.props;
if ((a2 || s2) && a2 !== s2) for (n2 in a2 = a2 || {}, s2 = s2 || {}, s2) r2 = s2[n2], o2 = a2[n2], o2 === r2 || "value" === n2 && i2[n2] === r2 || (i2[n2] = r2);
}
const bC = { create: yC, update: yC }, EC = "function" == typeof (null === window || void 0 === window ? void 0 : window.requestAnimationFrame) ? window.requestAnimationFrame.bind(window) : setTimeout;
let wC = false;
function CC(e5, t2, n2) {
var r2;
r2 = () => {
e5[t2] = n2;
}, EC(() => {
EC(r2);
});
}
function DC(e5, t2) {
let n2, r2;
const o2 = t2.elm;
let i2 = e5.data.style, a2 = t2.data.style;
if (!i2 && !a2) return;
if (i2 === a2) return;
i2 = i2 || {}, a2 = a2 || {};
const s2 = "delayed" in i2;
for (r2 in i2) r2 in a2 || ("-" === r2[0] && "-" === r2[1] ? o2.style.removeProperty(r2) : o2.style[r2] = "");
for (r2 in a2) if (n2 = a2[r2], "delayed" === r2 && a2.delayed) for (const e6 in a2.delayed) n2 = a2.delayed[e6], s2 && n2 === i2.delayed[e6] || CC(o2.style, e6, n2);
else "remove" !== r2 && n2 !== i2[r2] && ("-" === r2[0] && "-" === r2[1] ? o2.style.setProperty(r2, n2) : o2.style[r2] = n2);
}
const AC = { pre: function() {
wC = false;
}, create: DC, update: DC, destroy: function(e5) {
let t2, n2;
const r2 = e5.elm, o2 = e5.data.style;
if (o2 && (t2 = o2.destroy)) for (n2 in t2) r2.style[n2] = t2[n2];
}, remove: function(e5, t2) {
const n2 = e5.data.style;
if (!n2 || !n2.remove) return void t2();
let r2;
wC || (e5.elm.offsetLeft, wC = true);
const o2 = e5.elm;
let i2 = 0;
const a2 = n2.remove;
let s2 = 0;
const u2 = [];
for (r2 in a2) u2.push(r2), o2.style[r2] = a2[r2];
const l2 = getComputedStyle(o2)["transition-property"].split(", ");
for (; i2 < l2.length; ++i2) -1 !== u2.indexOf(l2[i2]) && s2++;
o2.addEventListener("transitionend", (e6) => {
e6.target === o2 && --s2, 0 === s2 && t2();
});
} };
function SC(e5, t2) {
for (const n2 of e5) null != n2 && false !== n2 && "" !== n2 && (Array.isArray(n2) ? SC(n2, t2) : "string" == typeof n2 || "number" == typeof n2 || "boolean" == typeof n2 ? t2.push(Zw(void 0, void 0, void 0, String(n2), void 0)) : t2.push(n2));
return t2;
}
function xC(e5, t2, ...n2) {
const r2 = SC(n2, []);
return "function" == typeof e5 ? e5(t2, r2) : 1 === r2.length && !r2[0].sel && r2[0].text ? aC(e5, t2, r2[0].text) : aC(e5, t2, r2);
}
var OC = [];
var NC, BC, TC = {};
function kC(e5, t2, n2) {
return xC(n2.isInline(e5) ? "span" : "div", null, t2);
}
function FC(e5, t2) {
var n2, r2 = Ty.findKey(t2, e5), o2 = t2.isInline(e5), i2 = hh.isVoid(t2, e5), a2 = cy(e5.type, r2.id), s2 = { id: a2, key: r2.id, "data-slate-node": "element", "data-slate-inline": o2 }, u2 = e5.type, l2 = e5.children, c2 = void 0 === l2 ? [] : l2, d2 = (function(e6) {
return TC[e6] || kC;
})(u2);
n2 = i2 ? null : c2.map(function(n3, r3) {
return _C(n3, r3, e5, t2);
});
var f2 = d2(e5, n2, t2);
if (i2) {
s2["data-slate-void"] = true;
var p2 = o2 ? "span" : "div", h2 = Ig(Pp.texts(e5), 1), g2 = Ig(h2[0], 1)[0], v2 = xC(p2, { "data-slate-spacer": true, style: { height: "0", color: "transparent", outline: "none", position: "absolute" } }, _C(g2, 0, e5, t2));
f2 = xC(p2, { style: { position: "relative" } }, f2, v2), Cv.set(g2, 0), Dv.set(g2, e5);
}
return null == f2.data && (f2.data = {}), Object.assign(f2.data, s2), i2 || o2 || (f2 = (function(e6, t3, n3) {
var r3 = t3;
return OC.forEach(function(t4) {
r3 = t4(e6, r3, n3);
}), r3;
})(e5, f2, t2)), Tm(function() {
var t3 = $m(a2);
null != t3 && (xv.set(r2, t3), Ov.set(e5, t3), Sv.set(t3, e5));
}), f2;
}
function PC(e5, t2) {
return void 0 === t2 && (t2 = false), xC("span", { "data-slate-string": true }, t2 ? e5 + "\n" : e5);
}
function IC(e5, t2) {
return void 0 === e5 && (e5 = 0), void 0 === t2 && (t2 = false), xC("span", { "data-slate-zero-width": t2 ? "n" : "z", "data-slate-length": e5 }, "\uFEFF", t2 ? xC("br", null) : null);
}
function RC(e5, t2, n2) {
if (null == e5.text) throw new Error("Current node is not slate Text ".concat(JSON.stringify(e5)));
var r2 = Ty.findKey(n2, e5), o2 = n2.getConfig().decorate;
if (null == o2) throw new Error("Can not get config.decorate");
var i2, a2 = Ty.findPath(n2, e5), s2 = o2([e5, a2]), u2 = Sh.decorations(e5, s2), l2 = u2.map(function(r3) {
var o3, i3 = r3.leaf, a3 = r3.position, s3 = (function(e6, t3, n3, r4, o4) {
void 0 === t3 && (t3 = false);
var i4 = e6.text, a4 = Ty.findPath(o4, n3), s4 = bp.parent(a4);
if (hh.isEditor(r4)) throw new Error("Text node ".concat(JSON.stringify(n3), " parent is Editor"));
return o4.isVoid(r4) ? IC(Pp.string(r4).length) : "" !== i4 || r4.children[r4.children.length - 1] !== n3 || o4.isInline(r4) || "" !== hh.string(o4, s4) ? "" === i4 ? IC() : t3 && "\n" === i4.slice(-1) ? PC(i4, true) : PC(i4) : IC(0, true);
})(i3, null !== (o3 = null == a3 ? void 0 : a3.isLast) && void 0 !== o3 ? o3 : 1 === u2.length, e5, t2, n2);
return s3 = (function(e6, t3, n3) {
var r4 = t3;
return OC.forEach(function(t4) {
r4 = t4(e6, r4, n3);
}), r4;
})(i3, s3, n2), xC("span", { "data-slate-leaf": true }, s3);
}), c2 = (i2 = r2.id, "w-e-text-".concat(i2)), d2 = xC("span", { "data-slate-node": "text", id: c2, key: r2.id }, l2);
return Tm(function() {
var t3 = $m(c2);
null != t3 && (xv.set(r2, t3), Ov.set(e5, t3), Sv.set(t3, e5));
}), d2;
}
function _C(e5, t2, n2, r2) {
return Cv.set(e5, t2), Dv.set(e5, n2), Np.isElement(e5) ? FC(e5, r2) : RC(e5, n2, r2);
}
var LC = (function() {
if (BC) return NC;
BC = 1;
var e5, t2 = "[object Symbol]", n2 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, r2 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, o2 = "\\ud800-\\udfff", i2 = "\\u0300-\\u036f\\ufe20-\\ufe23", a2 = "\\u20d0-\\u20f0", s2 = "\\u2700-\\u27bf", u2 = "a-z\\xdf-\\xf6\\xf8-\\xff", l2 = "A-Z\\xc0-\\xd6\\xd8-\\xde", c2 = "\\ufe0e\\ufe0f", d2 = "\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", f2 = "['’]", p2 = "[" + o2 + "]", h2 = "[" + d2 + "]", g2 = "[" + i2 + a2 + "]", v2 = "\\d+", m2 = "[" + s2 + "]", b2 = "[" + u2 + "]", E2 = "[^" + o2 + d2 + v2 + s2 + u2 + l2 + "]", w2 = "\\ud83c[\\udffb-\\udfff]", C2 = "[^" + o2 + "]", D2 = "(?:\\ud83c[\\udde6-\\uddff]){2}", A2 = "[\\ud800-\\udbff][\\udc00-\\udfff]", S2 = "[" + l2 + "]", x2 = "\\u200d", O2 = "(?:" + b2 + "|" + E2 + ")", N2 = "(?:" + S2 + "|" + E2 + ")", B2 = "(?:['’](?:d|ll|m|re|s|t|ve))?", T2 = "(?:['’](?:D|LL|M|RE|S|T|VE))?", k2 = "(?:" + g2 + "|" + w2 + ")?", F2 = "[" + c2 + "]?", P2 = F2 + k2 + ("(?:" + x2 + "(?:" + [C2, D2, A2].join("|") + ")" + F2 + k2 + ")*"), I2 = "(?:" + [m2, D2, A2].join("|") + ")" + P2, R2 = "(?:" + [C2 + g2 + "?", g2, D2, A2, p2].join("|") + ")", _2 = RegExp(f2, "g"), L2 = RegExp(g2, "g"), M2 = RegExp(w2 + "(?=" + w2 + ")|" + R2 + P2, "g"), j2 = RegExp([S2 + "?" + b2 + "+" + B2 + "(?=" + [h2, S2, "$"].join("|") + ")", N2 + "+" + T2 + "(?=" + [h2, S2 + O2, "$"].join("|") + ")", S2 + "?" + O2 + "+" + B2, S2 + "+" + T2, v2, I2].join("|"), "g"), H2 = RegExp("[" + x2 + o2 + i2 + a2 + c2 + "]"), z2 = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, $2 = "object" == typeof y && y && y.Object === Object && y, U2 = "object" == typeof self && self && self.Object === Object && self, V2 = $2 || U2 || Function("return this")(), W2 = (e5 = { "À": "A", "Á": "A", "Â": "A", "Ã": "A", "Ä": "A", "Å": "A", "à": "a", "á": "a", "â": "a", "ã": "a", "ä": "a", "å": "a", "Ç": "C", "ç": "c", "Ð": "D", "ð": "d", "È": "E", "É": "E", "Ê": "E", "Ë": "E", "è": "e", "é": "e", "ê": "e", "ë": "e", "Ì": "I", "Í": "I", "Î": "I", "Ï": "I", "ì": "i", "í": "i", "î": "i", "ï": "i", "Ñ": "N", "ñ": "n", "Ò": "O", "Ó": "O", "Ô": "O", "Õ": "O", "Ö": "O", "Ø": "O", "ò": "o", "ó": "o", "ô": "o", "õ": "o", "ö": "o", "ø": "o", "Ù": "U", "Ú": "U", "Û": "U", "Ü": "U", "ù": "u", "ú": "u", "û": "u", "ü": "u", "Ý": "Y", "ý": "y", "ÿ": "y", "Æ": "Ae", "æ": "ae", "Þ": "Th", "þ": "th", "ß": "ss", "Ā": "A", "Ă": "A", "Ą": "A", "ā": "a", "ă": "a", "ą": "a", "Ć": "C", "Ĉ": "C", "Ċ": "C", "Č": "C", "ć": "c", "ĉ": "c", "ċ": "c", "č": "c", "Ď": "D", "Đ": "D", "ď": "d", "đ": "d", "Ē": "E", "Ĕ": "E", "Ė": "E", "Ę": "E", "Ě": "E", "ē": "e", "ĕ": "e", "ė": "e", "ę": "e", "ě": "e", "Ĝ": "G", "Ğ": "G", "Ġ": "G", "Ģ": "G", "ĝ": "g", "ğ": "g", "ġ": "g", "ģ": "g", "Ĥ": "H", "Ħ": "H", "ĥ": "h", "ħ": "h", "Ĩ": "I", "Ī": "I", "Ĭ": "I", "Į": "I", "İ": "I", "ĩ": "i", "ī": "i", "ĭ": "i", "į": "i", "ı": "i", "Ĵ": "J", "ĵ": "j", "Ķ": "K", "ķ": "k", "ĸ": "k", "Ĺ": "L", "Ļ": "L", "Ľ": "L", "Ŀ": "L", "Ł": "L", "ĺ": "l", "ļ": "l", "ľ": "l", "ŀ": "l", "ł": "l", "Ń": "N", "Ņ": "N", "Ň": "N", "Ŋ": "N", "ń": "n", "ņ": "n", "ň": "n", "ŋ": "n", "Ō": "O", "Ŏ": "O", "Ő": "O", "ō": "o", "ŏ": "o", "ő": "o", "Ŕ": "R", "Ŗ": "R", "Ř": "R", "ŕ": "r", "ŗ": "r", "ř": "r", "Ś": "S", "Ŝ": "S", "Ş": "S", "Š": "S", "ś": "s", "ŝ": "s", "ş": "s", "š": "s", "Ţ": "T", "Ť": "T", "Ŧ": "T", "ţ": "t", "ť": "t", "ŧ": "t", "Ũ": "U", "Ū": "U", "Ŭ": "U", "Ů": "U", "Ű": "U", "Ų": "U", "ũ": "u", "ū": "u", "ŭ": "u", "ů": "u", "ű": "u", "ų": "u", "Ŵ": "W", "ŵ": "w", "Ŷ": "Y", "ŷ": "y", "Ÿ": "Y", "Ź": "Z", "Ż": "Z", "Ž": "Z", "ź": "z", "ż": "z", "ž": "z", "IJ": "IJ", "ij": "ij", "Œ": "Oe", "œ": "oe", "ʼn": "'n", "ſ": "ss" }, function(t3) {
return null == e5 ? void 0 : e5[t3];
});
function G2(e6) {
return H2.test(e6);
}
function q2(e6) {
return G2(e6) ? (function(e7) {
return e7.match(M2) || [];
})(e6) : (function(e7) {
return e7.split("");
})(e6);
}
var K2 = Object.prototype.toString, Y2 = V2.Symbol, X2 = Y2 ? Y2.prototype : void 0, Z2 = X2 ? X2.toString : void 0;
function J2(e6) {
if ("string" == typeof e6) return e6;
if ((function(e7) {
return "symbol" == typeof e7 || /* @__PURE__ */ (function(e8) {
return !!e8 && "object" == typeof e8;
})(e7) && K2.call(e7) == t2;
})(e6)) return Z2 ? Z2.call(e6) : "";
var n3 = e6 + "";
return "0" == n3 && 1 / e6 == -1 / 0 ? "-0" : n3;
}
function Q2(e6, t3, n3) {
var r3 = e6.length;
return n3 = void 0 === n3 ? r3 : n3, !t3 && n3 >= r3 ? e6 : (function(e7, t4, n4) {
var r4 = -1, o3 = e7.length;
t4 < 0 && (t4 = -t4 > o3 ? 0 : o3 + t4), (n4 = n4 > o3 ? o3 : n4) < 0 && (n4 += o3), o3 = t4 > n4 ? 0 : n4 - t4 >>> 0, t4 >>>= 0;
for (var i3 = Array(o3); ++r4 < o3; ) i3[r4] = e7[r4 + t4];
return i3;
})(e6, t3, n3);
}
function ee2(e6) {
return null == e6 ? "" : J2(e6);
}
var te2, ne2, re2 = (te2 = function(e6, t3, n3) {
return t3 = t3.toLowerCase(), e6 + (n3 ? (function(e7) {
return oe2(ee2(e7).toLowerCase());
})(t3) : t3);
}, function(e6) {
return (function(e7, t3, n3) {
for (var r3 = -1, o3 = e7 ? e7.length : 0; ++r3 < o3; ) n3 = t3(n3, e7[r3], r3, e7);
return n3;
})((function(e7, t3) {
return e7 = ee2(e7), void 0 === t3 ? (function(e8) {
return z2.test(e8);
})(e7) ? (function(e8) {
return e8.match(j2) || [];
})(e7) : (function(e8) {
return e8.match(n2) || [];
})(e7) : e7.match(t3) || [];
})((function(e7) {
return (e7 = ee2(e7)) && e7.replace(r2, W2).replace(L2, "");
})(e6).replace(_2, "")), te2, "");
}), oe2 = (ne2 = "toUpperCase", function(e6) {
var t3 = G2(e6 = ee2(e6)) ? q2(e6) : void 0, n3 = t3 ? t3[0] : e6.charAt(0), r3 = t3 ? Q2(t3, 1).join("") : e6.slice(1);
return n3[ne2]() + r3;
});
return NC = re2;
})(), MC = b(LC);
var jC = ["props", "attrs", "style", "dataset", "on", "hook"];
function HC(e5) {
var t2 = e5.data, n2 = void 0 === t2 ? {} : t2, r2 = e5.children, o2 = void 0 === r2 ? [] : r2;
Object.keys(n2).forEach(function(t3) {
var r3, o3, i2 = n2[t3];
if ("key" !== t3) {
if (!jC.includes(t3)) {
if (t3.startsWith("data-")) {
var a2 = t3.slice(5);
return a2 = MC(a2), (function(e6, t4) {
null == e6.data && (e6.data = {});
var n3 = e6.data;
null == n3.dataset && (n3.dataset = {});
Object.assign(n3.dataset, t4);
})(e5, ((r3 = {})[a2] = i2, r3)), void delete n2[t3];
}
!(function(e6, t4) {
null == e6.data && (e6.data = {});
var n3 = e6.data;
null == n3.props && (n3.props = {});
Object.assign(n3.props, t4);
})(e5, (o3 = {}, o3[t3] = i2, o3)), delete n2[t3];
}
} else e5.key = i2;
}), o2.length > 0 && o2.forEach(function(e6) {
"string" != typeof e6 && HC(e6);
});
}
function zC(e5, t2) {
var n2, r2, o2 = e5.$scroll, i2 = (n2 = e5.id, "w-e-textarea-".concat(n2)), a2 = t2.getConfig(), s2 = a2.readOnly, u2 = a2.autoFocus, l2 = (function(e6, t3) {
return void 0 === t3 && (t3 = false), aC("div#".concat(e6), { props: { contentEditable: !t3 } });
})(i2, s2), c2 = t2.children || [];
l2.children = c2.map(function(e6, n3) {
if (Ev.has(e6)) {
var r3 = Ev.get(e6);
if (r3) {
var o3 = Ig(r3, 2), i3 = o3[0], a3 = o3[1];
if (a3) return i3 !== n3 && (Cv.set(e6, n3), Ev.set(e6, [n3, a3])), a3;
}
}
var s3 = _C(e6, n3, t2, t2);
HC(s3);
var u3 = t2.getConfig().skipCacheTypes, l3 = void 0 === u3 ? ["list-item"] : u3;
return Np.isElement(e6) && l3.includes(e6.type) || Ev.set(e6, [n3, s3]), s3;
});
var d2 = mv.get(e5);
if (null == d2 && (d2 = true), d2) {
var f2 = (function(e6) {
return Kv(''));
})(i2);
o2.append(f2), e5.$textArea = f2, r2 = f2[0], (h2 = oC([cC, bC, AC, pC, mC, uC]))(r2, l2), mv.set(e5, false), yv.set(e5, h2);
} else {
var p2 = bv.get(e5), h2 = yv.get(e5);
if (null == p2 || null == h2) return;
r2 = p2.elm, h2(p2, l2);
}
if (null != r2 || null != (r2 = $m(i2))) {
var g2;
if ((d2 ? u2 : t2.isFocused()) && r2.focus({ preventScroll: true }), d2) {
var v2 = (g2 = r2) && g2.ownerDocument && g2.ownerDocument.defaultView || null;
v2 && Bv.set(t2, v2);
}
Av.set(t2, r2), Ov.set(t2, r2), Sv.set(r2, t2), bv.set(e5, l2);
}
}
var $C = 1, UC = (function() {
function e5(e6) {
var t2 = this;
this.selectionChangeRoot = null, this.destroyed = false, this.id = $C++, this.$textArea = null, this.$progressBar = Kv(''), this.$maxLengthInfo = Kv(''), this.isComposing = false, this.isUpdatingSelection = false, this.isDraggingInternally = false, this.latestElement = null, this.showPlaceholder = false, this.$placeholder = null, this.latestEditorSelection = null, this.onDOMSelectionChange = Cw(function(e7) {
var n3 = jm(null == e7 ? void 0 : e7.target) ? e7.target : null, r3 = null == n3 ? void 0 : n3.tagName;
if ("INPUT" !== r3 && "TEXTAREA" !== r3) {
var o3 = t2.getActiveEditor();
null != o3 && (function(e8, t3) {
var n4 = e8.isComposing, r4 = e8.isUpdatingSelection, o4 = e8.isDraggingInternally, i2 = t3.getConfig();
if (!r4 && !o4) {
var a2 = Ty.findDocumentOrShadowRoot(t3), s2 = a2.activeElement, u2 = Ty.toDOMNode(t3, t3), l2 = a2.getSelection();
if (s2 !== u2) return Tv.delete(t3), void Pw(t3);
if (e8.latestElement = s2, Tv.set(t3, true), !l2) return Pw(t3);
var c2 = l2.anchorNode, d2 = l2.focusNode, f2 = Sw(t3, c2), p2 = Aw(t3, d2);
if (!n4) if (f2 && p2) {
var h2 = Ty.toSlateRange(t3, l2, { exactMatch: false, suppressThrow: true });
h2 && $h.select(t3, h2);
} else i2.readOnly && Pw(t3);
}
})(t2, o3);
}
}, 100);
var n2 = Kv(e6);
if (0 === n2.length) throw new Error("Cannot find textarea DOM by selector '".concat(e6, "'"));
this.$box = n2;
var r2 = Kv('');
r2.append(this.$progressBar), r2.append(this.$maxLengthInfo), n2.append(r2);
var o2 = Kv('');
r2.append(o2), this.$scroll = o2, this.$textAreaContainer = r2, Tm(function() {
var e7 = t2.getActiveEditor();
if (null != e7) {
t2.bindSelectionChange(e7), r2.on("click", function() {
return e7.hidePanelOrModal();
}), e7.on(Qg, t2.changeViewState.bind(t2));
var o3 = e7.getConfig(), i2 = o3.onChange, a2 = o3.scroll;
i2 && e7.on(Qg, function() {
return i2(e7);
}), a2 || (n2.css("position", "relative"), r2.addClass("no-scroll")), t2.onFocusAndOnBlur(), e7.on(Qg, t2.changeMaxLengthInfo.bind(t2)), t2.bindEvent();
}
});
}
return Object.defineProperty(e5.prototype, "editorInstance", { get: function() {
var e6 = uv.get(this);
if (null == e6) throw new Error("Can not get editor instance");
return e6;
}, enumerable: false, configurable: true }), e5.prototype.getActiveEditor = function() {
if (this.destroyed) return null;
var e6 = uv.get(this);
return null == e6 || e6.isDestroyed ? null : e6;
}, e5.prototype.bindSelectionChange = function(e6, t2) {
var n2 = this;
if (void 0 === t2 && (t2 = 5), null == this.selectionChangeRoot && !e6.isDestroyed) {
try {
var r2 = Ty.findDocumentOrShadowRoot(e6);
r2.addEventListener("selectionchange", this.onDOMSelectionChange), this.selectionChangeRoot = r2;
} catch (r3) {
if (t2 > 0) return void setTimeout(function() {
return n2.bindSelectionChange(e6, t2 - 1);
}, 0);
window.document.addEventListener("selectionchange", this.onDOMSelectionChange), this.selectionChangeRoot = window.document;
}
e6.on(Jg, function() {
var e7;
null === (e7 = n2.selectionChangeRoot) || void 0 === e7 || e7.removeEventListener("selectionchange", n2.onDOMSelectionChange), n2.selectionChangeRoot = null;
});
}
}, e5.prototype.flushDOMSelectionChange = function() {
this.onDOMSelectionChange.flush();
}, e5.prototype.bindEvent = function() {
var e6 = this, t2 = this.$textArea, n2 = this.$scroll, r2 = this.editorInstance;
null != t2 && (Vg(Gw, function(n3, o2) {
t2.on(o2, function(t3) {
n3(t3, e6, r2);
});
}), r2.getConfig().scroll && (n2.css("overflow-y", "auto"), n2.on("scroll", Cw(function() {
r2.emit(ev);
}, 100))));
}, e5.prototype.onFocusAndOnBlur = function() {
var e6 = this, t2 = this.getActiveEditor();
if (null != t2) {
var n2 = t2.getConfig(), r2 = n2.onBlur, o2 = n2.onFocus;
this.latestEditorSelection = t2.selection, t2.on(Qg, function() {
null == e6.latestEditorSelection && null != t2.selection ? setTimeout(function() {
e6.destroyed || t2.isDestroyed || o2 && o2(t2);
}) : null != e6.latestEditorSelection && null == t2.selection && setTimeout(function() {
e6.destroyed || t2.isDestroyed || r2 && r2(t2);
}), e6.latestEditorSelection = t2.selection;
});
}
}, e5.prototype.changeMaxLengthInfo = function() {
var e6 = this.getActiveEditor();
if (null != e6) {
var t2 = e6.getConfig().maxLength;
if (t2) {
var n2 = t2 - Ty.getLeftLengthOfMaxLength(e6);
this.$maxLengthInfo[0].innerHTML = "".concat(n2, "/").concat(t2);
}
}
}, e5.prototype.changeProgress = function(e6) {
var t2 = this.$progressBar;
t2.css("width", "".concat(e6, "%")), e6 >= 100 && setTimeout(function() {
t2.hide(), t2.css("width", "0"), t2.show();
}, 1e3);
}, e5.prototype.changeViewState = function() {
var e6 = this, t2 = this.getActiveEditor();
null != t2 && (zC(this, t2), (function(e7, t3) {
var n2, r2 = t3.getConfig().placeholder;
if (r2) {
var o2 = t3.isEmpty();
if (o2 && !e7.showPlaceholder && !e7.isComposing) {
if (null == e7.$placeholder) {
var i2 = Kv(''.concat(r2, "
"));
e7.$textAreaContainer.append(i2), e7.$placeholder = i2;
}
return e7.$placeholder.show(), void (e7.showPlaceholder = true);
}
!o2 && e7.showPlaceholder && (null === (n2 = e7.$placeholder) || void 0 === n2 || n2.hide(), e7.showPlaceholder = false);
}
})(this, t2), Tm(function() {
e6.destroyed || t2.isDestroyed || Iw(e6, t2);
}));
}, e5.prototype.destroy = function() {
var e6;
this.destroyed = true, this.onDOMSelectionChange.cancel(), null === (e6 = this.selectionChangeRoot) || void 0 === e6 || e6.removeEventListener("selectionchange", this.onDOMSelectionChange), this.selectionChangeRoot = null, this.$textAreaContainer.remove();
}, e5;
})();
function VC(e5, t2, n2, r2) {
if (Cv.set(e5, t2), Dv.set(e5, n2), Np.isElement(e5)) {
var o2 = e5.children;
if ((void 0 === o2 ? [] : o2).forEach(function(t3, n3) {
return VC(t3, n3, e5, r2);
}), hh.isVoid(r2, e5)) {
var i2 = Ig(Pp.texts(e5), 1), a2 = Ig(i2[0], 1)[0];
Cv.set(a2, 0), Dv.set(a2, e5);
}
}
}
function WC(e5) {
var t2 = e5.selector, n2 = void 0 === t2 ? "" : t2, r2 = e5.config, o2 = void 0 === r2 ? {} : r2, i2 = e5.content, a2 = e5.html, s2 = e5.plugins, u2 = void 0 === s2 ? [] : s2, l2 = (function(e6) {
return [$b, Ab, _v, Cb, Jb, zb, Wb, Sg].reduce(function(e7, t3) {
return t3(e7);
}, e6);
})(bg());
if (n2 && (function(e6, t3) {
return uy(e6, "data-w-e-textarea", t3);
})(l2, n2)) throw new Error("Repeated create editor by selector '".concat(n2, "'"));
var c2 = (function(e6) {
void 0 === e6 && (e6 = {});
var t3 = $g(Xg), n3 = {}, r3 = e6.MENU_CONF, o3 = void 0 === r3 ? {} : r3;
return Vg(t3, function(e7, t4) {
n3[t4] = Tg(Tg({}, e7), o3[t4] || {});
}), delete e6.MENU_CONF, Tg({ scroll: true, readOnly: false, autoFocus: true, decorate: function() {
return [];
}, maxLength: 0, MENU_CONF: n3, hoverbarKeys: {}, textStyleMode: "inline", classStylePolicy: "preserve-data", sanitizeHtml: Yg, customAlert: function(e7, t4) {
window.alert("".concat(t4, ":\n").concat(e7));
} }, e6);
})(o2);
vv.set(l2, c2);
var d2 = c2.hoverbarKeys, f2 = void 0 === d2 ? {} : d2;
if (u2.forEach(function(e6) {
l2 = e6(l2);
}), (function(e6, t3) {
var n3 = t3.html, r3 = t3.content;
null != n3 ? e6.children = ly(e6, n3) : r3 && r3.length && (e6.children = r3), 0 === e6.children.length && (e6.children = [{ type: "paragraph", children: [{ text: "" }] }]);
})(l2, { html: a2, content: i2 }), n2) {
var p2 = new UC(n2);
sv.set(l2, p2), uv.set(p2, l2), p2.changeViewState();
var h2 = void 0;
Object.keys(f2).length > 0 && (h2 = new Ew(), dv.set(h2, l2), fv.set(l2, h2)), l2.on(Qg, function() {
l2.hidePanelOrModal();
}), l2.on(ev, function() {
l2.hidePanelOrModal();
});
} else l2.children.forEach(function(e6, t3) {
return VC(e6, t3, l2, l2);
});
var g2 = c2.onCreated, v2 = c2.onDestroyed;
return g2 && l2.on(Zg, function() {
return g2(l2);
}), v2 && l2.on(Jg, function() {
return v2(l2);
}), Tm(function() {
return l2.emit(Zg);
}), l2;
}
var GC = (function() {
function e5(e6, t2) {
var n2 = this;
this.$toolbar = Kv(''), this.menus = {}, this.toolbarItems = [], this.config = {}, this.lngListen = function() {
}, this.syncToolbarState = function() {
n2.toolbarItems.forEach(function(e7) {
e7.changeMenuState();
});
}, this.changeToolbarState = eE(function() {
n2.syncToolbarState();
}, 200), this.config = t2;
var r2 = Kv(e6);
if (0 === r2.length) throw new Error("Cannot find toolbar DOM by selector '".concat(e6, "'"));
this.$box = r2;
var o2 = this.$toolbar;
o2.on("mousedown", function(e7) {
return e7.preventDefault();
}, { passive: false }), r2.append(o2), Tm(function() {
n2.initToolbar(), n2.lngListen = YE(function() {
return n2.initToolbar();
});
var e7 = n2.getEditorInstance();
e7.on(Qg, n2.changeToolbarState), e7.on(tv, n2.syncToolbarState), e7.on(nv, n2.syncToolbarState);
});
}
return e5.prototype.getMenus = function() {
return this.menus;
}, e5.prototype.getConfig = function() {
return this.config;
}, e5.prototype.initToolbar = function() {
this.menus = {};
var e6 = this.$toolbar;
null == e6 || e6.empty(), this.registerItems(), this.changeToolbarState();
}, e5.prototype.registerItems = function() {
var e6 = this, t2 = "", n2 = this.$toolbar, r2 = this.config, o2 = r2.toolbarKeys, i2 = void 0 === o2 ? [] : o2, a2 = r2.insertKeys, s2 = void 0 === a2 ? { index: 0, keys: [] } : a2, u2 = r2.excludeKeys, l2 = void 0 === u2 ? [] : u2, c2 = $g(i2), d2 = [];
d2 = Array.isArray(s2) ? s2 : [s2];
var f2 = 0;
d2.forEach(function(e7) {
var t3 = e7.index + f2;
if (e7.replaceFn && c2[t3]) {
var n3 = e7.replaceFn(c2[t3]);
if (!n3) throw new Error("This function needs to return the menu configuration:string | IMenuGroup");
c2[t3] = n3;
}
e7.keys.length > 0 && ("string" == typeof e7.keys && (e7.keys = [e7.keys]), e7.keys.forEach(function(e8, n4) {
c2.splice(t3 + n4, 0, e8);
}), f2 += e7.keys.length);
});
var p2 = c2.filter(function(e7) {
var t3 = "string" == typeof e7 ? e7 : e7.key;
return !l2.includes(t3);
}), h2 = p2.length;
p2.forEach(function(r3, o3) {
if ("|" === r3) {
if (0 === o3) return;
if (o3 + 1 === h2) return;
if ("|" === t2) return;
var i3 = QE();
return n2.append(i3), void (t2 = r3);
}
if ("string" == typeof r3) return e6.registerSingleItem(r3, e6), void (t2 = r3);
e6.registerGroup(r3), t2 = "group";
});
}, e5.prototype.registerGroup = function(e6) {
var t2 = this, n2 = this.$toolbar, r2 = (function(e7) {
return new pw(e7);
})(e6), o2 = e6.menuKeys, i2 = void 0 === o2 ? [] : o2, a2 = this.config.excludeKeys, s2 = void 0 === a2 ? [] : a2;
i2.forEach(function(e7) {
s2.includes(e7) || t2.registerSingleItem(e7, r2);
}), n2.append(r2.$elem);
}, e5.prototype.registerSingleItem = function(e6, t2) {
var n2 = this.getEditorInstance(), r2 = t2 instanceof pw, o2 = this.menus, i2 = o2[e6];
if (null == i2) {
var a2 = iv[e6];
if (null == a2) throw new Error("Not found menu item factory by key '".concat(e6, "'"));
if ("function" != typeof a2) throw new Error("Menu item factory (key='".concat(e6, "') is not a function"));
i2 = a2(), o2[e6] = i2;
} else console.warn("Duplicated toolbar menu key '".concat(e6, "'\n重复注册了菜单栏 menu '").concat(e6, "'"));
var s2 = n2.getMenuConfig(e6);
s2 && void 0 !== s2.iconSvg && (i2.iconSvg = s2.iconSvg);
var u2 = vw(e6, i2, r2);
(this.toolbarItems.push(u2), pv.set(u2, n2), r2) ? t2.appendBarItem(u2) : t2.$toolbar.append(u2.$elem);
}, e5.prototype.getEditorInstance = function() {
var e6 = lv.get(this);
if (null == e6) throw new Error("Can not get editor instance");
return e6;
}, e5.prototype.destroy = function() {
var e6;
this.$toolbar.remove(), null === (e6 = this.lngListen) || void 0 === e6 || e6.call(this), this.menus = {}, this.toolbarItems = [];
}, e5;
})();
function qC(e5, t2) {
if (null == e5) throw new Error("Cannot create toolbar, because editor is null");
var n2 = t2.selector, r2 = t2.config, o2 = void 0 === r2 ? {} : r2;
if ((function(e6, t3) {
return uy(e6, "data-w-e-toolbar", t3);
})(e5, n2)) throw new Error("Repeated create toolbar by selector '".concat(n2, "'"));
var i2 = Tg({ toolbarKeys: [], excludeKeys: [], insertKeys: { index: 0, keys: [] }, modalAppendToBody: false }, o2 || {}), a2 = new GC(n2, i2);
return lv.set(a2, e5), cv.set(e5, a2), a2;
}
function KC(e5) {
return e5 && "class" === e5.getConfig().textStyleMode ? "class" : "inline";
}
function YC(e5) {
if (!e5) return "preserve-data";
var t2 = e5.getConfig().classStylePolicy;
return "fallback-inline" === t2 ? "fallback-inline" : "strict" === t2 ? "strict" : "preserve-data";
}
function XC(e5, t2) {
var n2 = null == e5 ? void 0 : e5.getConfig().onClassStyleUnsupported;
n2 ? n2(t2) : console.warn(t2.message);
}
var ZC, JC, QC, eD, tD, nD = { exports: {} }, rD = {};
function oD() {
if (QC) return rD;
QC = 1, Object.defineProperty(rD, "__esModule", { value: true }), rD.justErrorsLogger = rD.debugLogger = void 0;
const e5 = (function() {
if (JC) return ZC;
function e6(e7) {
return e7 < 10 ? `0${e7}` : e7.toString();
}
return JC = 1, ZC = function() {
const t3 = /* @__PURE__ */ new Date();
return `${e6(t3.getHours())}:${e6(t3.getMinutes())}:${e6(t3.getSeconds())}`;
};
})(), t2 = { debug: () => {
}, warn: () => {
}, error: function() {
for (var t3 = arguments.length, n3 = new Array(t3), r2 = 0; r2 < t3; r2++) n3[r2] = arguments[r2];
return console.error(`[Uppy] [${e5()}]`, ...n3);
} };
rD.justErrorsLogger = t2;
const n2 = { debug: function() {
for (var t3 = arguments.length, n3 = new Array(t3), r2 = 0; r2 < t3; r2++) n3[r2] = arguments[r2];
return console.debug(`[Uppy] [${e5()}]`, ...n3);
}, warn: function() {
for (var t3 = arguments.length, n3 = new Array(t3), r2 = 0; r2 < t3; r2++) n3[r2] = arguments[r2];
return console.warn(`[Uppy] [${e5()}]`, ...n3);
}, error: function() {
for (var t3 = arguments.length, n3 = new Array(t3), r2 = 0; r2 < t3; r2++) n3[r2] = arguments[r2];
return console.error(`[Uppy] [${e5()}]`, ...n3);
} };
return rD.debugLogger = n2, rD;
}
function iD() {
if (tD) return eD;
tD = 1;
return eD = { nanoid: (e5 = 21) => {
let t2 = "", n2 = 0 | e5;
for (; n2--; ) t2 += "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64 * Math.random() | 0];
return t2;
}, customAlphabet: (e5, t2 = 21) => (n2 = t2) => {
let r2 = "", o2 = 0 | n2;
for (; o2--; ) r2 += e5[Math.random() * e5.length | 0];
return r2;
} }, eD;
}
var aD, sD, uD, lD, cD, dD, fD, pD, hD, gD, vD, mD, yD, bD, ED, wD, CD, DD, AD, SD, xD, OD, ND, BD, TD, kD, FD, PD, ID, RD, _D, LD = {};
function MD() {
return sD ? aD : (sD = 1, aD = function(e5) {
if ("number" != typeof e5 || isNaN(e5)) throw new TypeError("Expected a number, got " + typeof e5);
var t2 = e5 < 0, n2 = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
if (t2 && (e5 = -e5), e5 < 1) return (t2 ? "-" : "") + e5 + " B";
var r2 = Math.min(Math.floor(Math.log(e5) / Math.log(1024)), n2.length - 1);
e5 = Number(e5 / Math.pow(1024, r2));
var o2 = n2[r2];
return e5 >= 10 || e5 % 1 == 0 ? (t2 ? "-" : "") + e5.toFixed(0) + " " + o2 : (t2 ? "-" : "") + e5.toFixed(1) + " " + o2;
});
}
function jD() {
if (lD) return uD;
function e5(e6, t2) {
this.text = e6 = e6 || "", this.hasWild = ~e6.indexOf("*"), this.separator = t2, this.parts = e6.split(t2);
}
return lD = 1, e5.prototype.match = function(e6) {
var t2, n2, r2 = true, o2 = this.parts, i2 = o2.length;
if ("string" == typeof e6 || e6 instanceof String) if (this.hasWild || this.text == e6) {
for (n2 = (e6 || "").split(this.separator), t2 = 0; r2 && t2 < i2; t2++) "*" !== o2[t2] && (r2 = t2 < n2.length && o2[t2] === n2[t2]);
r2 = r2 && n2;
} else r2 = false;
else if ("function" == typeof e6.splice) for (r2 = [], t2 = e6.length; t2--; ) this.match(e6[t2]) && (r2[r2.length] = e6[t2]);
else if ("object" == typeof e6) for (var a2 in r2 = {}, e6) this.match(a2) && (r2[a2] = e6[a2]);
return r2;
}, uD = function(t2, n2, r2) {
var o2 = new e5(t2, r2 || /[\/\.]/);
return void 0 !== n2 ? o2.match(n2) : o2;
}, uD;
}
function HD() {
if (fD) return LD;
fD = 1, Object.defineProperty(LD, "__esModule", { value: true }), LD.defaultOptions = LD.RestrictionError = LD.Restricter = void 0;
const e5 = MD(), t2 = (function() {
if (dD) return cD;
dD = 1;
var e6 = jD(), t3 = /[\/\+\.]/;
return cD = function(n3, r2) {
function o2(r3) {
var o3 = e6(r3, n3, t3);
return o3 && o3.length >= 2;
}
return r2 ? o2(r2.split(";")[0]) : o2;
};
})();
LD.defaultOptions = { maxFileSize: null, minFileSize: null, maxTotalFileSize: null, maxNumberOfFiles: null, minNumberOfFiles: null, allowedFileTypes: null, requiredMetaFields: [] };
class n2 extends Error {
constructor() {
super(...arguments), this.isRestriction = true;
}
}
LD.RestrictionError = n2, "undefined" == typeof AggregateError && (globalThis.AggregateError = class extends Error {
constructor(e6, t3) {
super(t3), this.errors = e6;
}
});
return LD.Restricter = class {
constructor(e6, t3) {
this.i18n = t3, this.getOpts = () => {
const t4 = e6();
if (null != t4.restrictions.allowedFileTypes && !Array.isArray(t4.restrictions.allowedFileTypes)) throw new TypeError("`restrictions.allowedFileTypes` must be an array");
return t4;
};
}
validate(r2, o2) {
const { maxFileSize: i2, minFileSize: a2, maxTotalFileSize: s2, maxNumberOfFiles: u2, allowedFileTypes: l2 } = this.getOpts().restrictions;
if (u2) {
const e6 = o2.filter((e7) => !e7.isGhost);
if (e6.length + 1 > u2) throw new n2(`${this.i18n("youCanOnlyUploadX", { smart_count: u2 })}`);
}
if (l2) {
if (!l2.some((e6) => e6.includes("/") ? !!r2.type && t2(r2.type.replace(/;.*?$/, ""), e6) : !("." !== e6[0] || !r2.extension) && r2.extension.toLowerCase() === e6.slice(1).toLowerCase())) {
const e6 = l2.join(", ");
throw new n2(this.i18n("youCanOnlyUploadFileTypes", { types: e6 }));
}
}
if (s2 && null != r2.size) {
const t3 = o2.reduce((e6, t4) => e6 + t4.size, r2.size);
if (t3 > s2) throw new n2(this.i18n("exceedsSize", { size: e5(s2), file: r2.name }));
}
if (i2 && null != r2.size && r2.size > i2) throw new n2(this.i18n("exceedsSize", { size: e5(i2), file: r2.name }));
if (a2 && null != r2.size && r2.size < a2) throw new n2(this.i18n("inferiorSize", { size: e5(a2) }));
}
validateMinNumberOfFiles(e6) {
const { minNumberOfFiles: t3 } = this.getOpts().restrictions;
if (Object.keys(e6).length < t3) throw new n2(this.i18n("youHaveToAtLeastSelectX", { smart_count: t3 }));
}
getMissingRequiredMetaFields(e6) {
const t3 = new n2(this.i18n("missingRequiredMetaFieldOnFile", { fileName: e6.name })), { requiredMetaFields: r2 } = this.getOpts().restrictions, o2 = Object.prototype.hasOwnProperty, i2 = [];
for (const t4 of r2) o2.call(e6.meta, t4) && "" !== e6.meta[t4] || i2.push(t4);
return { missingFields: i2, error: t3 };
}
}, LD;
}
function zD() {
if (hD) return pD;
return hD = 1, pD = function(e5, t2) {
return Object.prototype.hasOwnProperty.call(e5, t2);
};
}
function $D() {
if (vD) return gD;
function e5(e6, t3) {
if (!Object.prototype.hasOwnProperty.call(e6, t3)) throw new TypeError("attempted to use private field on non-instance");
return e6;
}
vD = 1;
var t2 = 0;
function n2(e6) {
return "__private_" + t2++ + "_" + e6;
}
const r2 = zD();
function o2(e6, t3, n3) {
const r3 = [];
return e6.forEach((e7) => "string" != typeof e7 ? r3.push(e7) : t3[Symbol.split](e7).forEach((e8, t4, o3) => {
"" !== e8 && r3.push(e8), t4 < o3.length - 1 && r3.push(n3);
})), r3;
}
/**
* Takes a string with placeholder variables like `%{smart_count} file selected`
* and replaces it with values from options `{smart_count: 5}`
*
* @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
* taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
*
* @param {string} phrase that needs interpolation, with placeholders
* @param {object} options with values that will be used to replace placeholders
* @returns {any[]} interpolated
*/
function i2(e6, t3) {
const n3 = /\$/g;
let r3 = [e6];
if (null == t3) return r3;
for (const e7 of Object.keys(t3)) if ("_" !== e7) {
let i3 = t3[e7];
"string" == typeof i3 && (i3 = n3[Symbol.replace](i3, "$$$$")), r3 = o2(r3, new RegExp(`%\\{${e7}\\}`, "g"), i3);
}
return r3;
}
var a2 = n2("apply");
function s2(e6) {
if (null == e6 || !e6.strings) return;
const t3 = this.locale;
this.locale = { ...t3, strings: { ...t3.strings, ...e6.strings } }, this.locale.pluralize = e6.pluralize || t3.pluralize;
}
return gD = class {
constructor(t3) {
Object.defineProperty(this, a2, { value: s2 }), this.locale = { strings: {}, pluralize: (e6) => 1 === e6 ? 0 : 1 }, Array.isArray(t3) ? t3.forEach(e5(this, a2)[a2], this) : e5(this, a2)[a2](t3);
}
translate(e6, t3) {
return this.translateArray(e6, t3).join("");
}
translateArray(e6, t3) {
if (!r2(this.locale.strings, e6)) throw new Error(`missing string: ${e6}`);
const n3 = this.locale.strings[e6];
if ("object" == typeof n3) {
if (t3 && void 0 !== t3.smart_count) {
return i2(n3[this.locale.pluralize(t3.smart_count)], t3);
}
throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}");
}
return i2(n3, t3);
}
}, gD;
}
function UD() {
return yD || (yD = 1, mD = function() {
var e5 = {}, t2 = e5._fns = {};
return e5.emit = function(e6, n2, r2, o2, i2, a2, s2) {
var u2 = (function(e7) {
var n3 = t2[e7] ? t2[e7] : [], r3 = e7.indexOf(":"), o3 = -1 === r3 ? [e7] : [e7.substring(0, r3), e7.substring(r3 + 1)], i3 = Object.keys(t2), a3 = 0, s3 = i3.length;
for (; a3 < s3; a3++) {
var u3 = i3[a3];
if ("*" === u3 && (n3 = n3.concat(t2[u3])), 2 === o3.length && o3[0] === u3) {
n3 = n3.concat(t2[u3]);
break;
}
}
return n3;
})(e6);
u2.length && (function(e7, t3, n3) {
var r3 = 0, o3 = t3.length;
for (; r3 < o3 && t3[r3]; r3++) t3[r3].event = e7, t3[r3].apply(t3[r3], n3);
})(e6, u2, [n2, r2, o2, i2, a2, s2]);
}, e5.on = function(e6, n2) {
t2[e6] || (t2[e6] = []), t2[e6].push(n2);
}, e5.once = function(t3, n2) {
this.on(t3, function r2() {
n2.apply(this, arguments), e5.off(t3, r2);
});
}, e5.off = function(e6, t3) {
var n2 = [];
if (e6 && t3) for (var r2 = this._fns[e6], o2 = 0, i2 = r2 ? r2.length : 0; o2 < i2; o2++) r2[o2] !== t3 && n2.push(r2[o2]);
n2.length ? this._fns[e6] = n2 : delete this._fns[e6];
}, e5;
}), mD;
}
function VD() {
if (ED) return bD;
ED = 1;
var e5 = 0;
function t2(t3) {
return "__private_" + e5++ + "_" + t3;
}
var n2 = t2("publish");
class r2 {
constructor() {
Object.defineProperty(this, n2, { value: o2 }), this.state = {}, this.callbacks = [];
}
getState() {
return this.state;
}
setState(e6) {
const t3 = { ...this.state }, r3 = { ...this.state, ...e6 };
this.state = r3, (function(e7, t4) {
if (!Object.prototype.hasOwnProperty.call(e7, t4)) throw new TypeError("attempted to use private field on non-instance");
return e7;
})(this, n2)[n2](t3, r3, e6);
}
subscribe(e6) {
return this.callbacks.push(e6), () => {
this.callbacks.splice(this.callbacks.indexOf(e6), 1);
};
}
}
function o2() {
for (var e6 = arguments.length, t3 = new Array(e6), n3 = 0; n3 < e6; n3++) t3[n3] = arguments[n3];
this.callbacks.forEach((e7) => {
e7(...t3);
});
}
return r2.VERSION = "2.1.1", bD = function() {
return new r2();
};
}
function WD() {
if (CD) return wD;
return CD = 1, wD = function(e5) {
const t2 = e5.lastIndexOf(".");
return -1 === t2 || t2 === e5.length - 1 ? { name: e5, extension: void 0 } : { name: e5.slice(0, t2), extension: e5.slice(t2 + 1) };
};
}
function GD() {
return AD ? DD : (AD = 1, DD = { md: "text/markdown", markdown: "text/markdown", mp4: "video/mp4", mp3: "audio/mp3", svg: "image/svg+xml", jpg: "image/jpeg", png: "image/png", gif: "image/gif", heic: "image/heic", heif: "image/heif", yaml: "text/yaml", yml: "text/yaml", csv: "text/csv", tsv: "text/tab-separated-values", tab: "text/tab-separated-values", avi: "video/x-msvideo", mks: "video/x-matroska", mkv: "video/x-matroska", mov: "video/quicktime", dicom: "application/dicom", doc: "application/msword", docm: "application/vnd.ms-word.document.macroenabled.12", docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", dot: "application/msword", dotm: "application/vnd.ms-word.template.macroenabled.12", dotx: "application/vnd.openxmlformats-officedocument.wordprocessingml.template", xla: "application/vnd.ms-excel", xlam: "application/vnd.ms-excel.addin.macroenabled.12", xlc: "application/vnd.ms-excel", xlf: "application/x-xliff+xml", xlm: "application/vnd.ms-excel", xls: "application/vnd.ms-excel", xlsb: "application/vnd.ms-excel.sheet.binary.macroenabled.12", xlsm: "application/vnd.ms-excel.sheet.macroenabled.12", xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", xlt: "application/vnd.ms-excel", xltm: "application/vnd.ms-excel.template.macroenabled.12", xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template", xlw: "application/vnd.ms-excel", txt: "text/plain", text: "text/plain", conf: "text/plain", log: "text/plain", pdf: "application/pdf", zip: "application/zip", "7z": "application/x-7z-compressed", rar: "application/x-rar-compressed", tar: "application/x-tar", gz: "application/gzip", dmg: "application/x-apple-diskimage" });
}
function qD() {
if (_D) return RD;
_D = 1;
var e5 = iD(), t2 = oD(), n2 = HD();
let r2, o2;
function i2(e6, t3) {
if (!Object.prototype.hasOwnProperty.call(e6, t3)) throw new TypeError("attempted to use private field on non-instance");
return e6;
}
var a2 = 0;
function s2(e6) {
return "__private_" + a2++ + "_" + e6;
}
const u2 = $D(), l2 = UD(), c2 = ww(), d2 = VD(), f2 = (function() {
if (xD) return SD;
xD = 1;
const e6 = WD(), t3 = GD();
return SD = function(n3) {
var r3;
if (n3.type) return n3.type;
const o3 = n3.name ? null == (r3 = e6(n3.name).extension) ? void 0 : r3.toLowerCase() : null;
return o3 && o3 in t3 ? t3[o3] : "application/octet-stream";
};
})(), p2 = WD(), h2 = (function() {
if (ND) return OD;
function e6(e7) {
let t3 = "";
return e7.replace(/[^A-Z0-9]/gi, (e8) => (t3 += `-${(function(e9) {
return e9.charCodeAt(0).toString(32);
})(e8)}`, "/")) + t3;
}
return ND = 1, OD = function(t3) {
let n3 = "uppy";
return "string" == typeof t3.name && (n3 += `-${e6(t3.name.toLowerCase())}`), void 0 !== t3.type && (n3 += `-${t3.type}`), t3.meta && "string" == typeof t3.meta.relativePath && (n3 += `-${e6(t3.meta.relativePath.toLowerCase())}`), void 0 !== t3.data.size && (n3 += `-${t3.data.size}`), void 0 !== t3.data.lastModified && (n3 += `-${t3.data.lastModified}`), n3;
};
})(), g2 = (TD || (TD = 1, BD = function(e6) {
if (null == e6 && "undefined" != typeof navigator && (e6 = navigator.userAgent), !e6) return true;
const t3 = /Edge\/(\d+\.\d+)/.exec(e6);
if (!t3) return true;
const n3 = t3[1];
let [r3, o3] = n3.split(".");
return r3 = parseInt(r3, 10), o3 = parseInt(o3, 10), r3 < 15 || 15 === r3 && o3 < 15063 || r3 > 18 || 18 === r3 && o3 >= 18218;
}), BD), v2 = FD ? kD : (FD = 1, kD = function(e6, t3) {
return t3.name ? t3.name : "image" === e6.split("/")[0] ? `${e6.split("/")[0]}.${e6.split("/")[1]}` : "noname";
}), m2 = ID ? PD : (ID = 1, PD = { strings: { addBulkFilesFailed: { 0: "Failed to add %{smart_count} file due to an internal error", 1: "Failed to add %{smart_count} files due to internal errors" }, youCanOnlyUploadX: { 0: "You can only upload %{smart_count} file", 1: "You can only upload %{smart_count} files" }, youHaveToAtLeastSelectX: { 0: "You have to select at least %{smart_count} file", 1: "You have to select at least %{smart_count} files" }, exceedsSize: "%{file} exceeds maximum allowed size of %{size}", missingRequiredMetaField: "Missing required meta fields", missingRequiredMetaFieldOnFile: "Missing required meta fields in %{fileName}", inferiorSize: "This file is smaller than the allowed size of %{size}", youCanOnlyUploadFileTypes: "You can only upload: %{types}", noMoreFilesAllowed: "Cannot add more files", noDuplicates: "Cannot add the duplicate file '%{fileName}', it already exists", companionError: "Connection with Companion failed", authAborted: "Authentication aborted", companionUnauthorizeHint: "To unauthorize to your %{provider} account, please go to %{url}", failedToUpload: "Failed to upload %{file}", noInternetConnection: "No Internet connection", connectedToInternet: "Connected to the Internet", noFilesFound: "You have no files or folders here", selectX: { 0: "Select %{smart_count}", 1: "Select %{smart_count}" }, allFilesFromFolderNamed: "All files from folder %{name}", openFolderNamed: "Open folder %{name}", cancel: "Cancel", logOut: "Log out", filter: "Filter", resetFilter: "Reset filter", loading: "Loading...", authenticateWithTitle: "Please authenticate with %{pluginName} to select files", authenticateWith: "Connect to %{pluginName}", signInWithGoogle: "Sign in with Google", searchImages: "Search for images", enterTextToSearch: "Enter text to search for images", search: "Search", emptyFolderAdded: "No files were added from empty folder", folderAlreadyAdded: 'The folder "%{folder}" was already added', folderAdded: { 0: "Added %{smart_count} file from %{folder}", 1: "Added %{smart_count} files from %{folder}" } } });
var y2 = s2("plugins"), b2 = s2("restricter"), E2 = s2("storeUnsubscribe"), w2 = s2("emitter"), C2 = s2("preProcessors"), D2 = s2("uploaders"), A2 = s2("postProcessors"), S2 = s2("informAndEmit"), x2 = s2("checkRequiredMetaFieldsOnFile"), O2 = s2("checkRequiredMetaFields"), N2 = s2("assertNewUploadAllowed"), B2 = s2("checkAndCreateFileStateObject"), T2 = s2("startIfAutoProceed"), k2 = s2("addListeners"), F2 = s2("updateOnlineStatus"), P2 = s2("createUpload"), I2 = s2("getUpload"), R2 = s2("removeUpload"), _2 = s2("runUpload");
r2 = Symbol.for("uppy test: getPlugins"), o2 = Symbol.for("uppy test: createUpload");
class L2 {
constructor(e6) {
Object.defineProperty(this, _2, { value: K2 }), Object.defineProperty(this, R2, { value: q2 }), Object.defineProperty(this, I2, { value: G2 }), Object.defineProperty(this, P2, { value: W2 }), Object.defineProperty(this, k2, { value: V2 }), Object.defineProperty(this, T2, { value: U2 }), Object.defineProperty(this, B2, { value: $2 }), Object.defineProperty(this, N2, { value: z2 }), Object.defineProperty(this, O2, { value: H2 }), Object.defineProperty(this, x2, { value: j2 }), Object.defineProperty(this, S2, { value: M2 }), Object.defineProperty(this, y2, { writable: true, value: /* @__PURE__ */ Object.create(null) }), Object.defineProperty(this, b2, { writable: true, value: void 0 }), Object.defineProperty(this, E2, { writable: true, value: void 0 }), Object.defineProperty(this, w2, { writable: true, value: l2() }), Object.defineProperty(this, C2, { writable: true, value: /* @__PURE__ */ new Set() }), Object.defineProperty(this, D2, { writable: true, value: /* @__PURE__ */ new Set() }), Object.defineProperty(this, A2, { writable: true, value: /* @__PURE__ */ new Set() }), Object.defineProperty(this, F2, { writable: true, value: this.updateOnlineStatus.bind(this) }), this.defaultLocale = m2;
const r3 = { id: "uppy", autoProceed: false, allowMultipleUploads: true, allowMultipleUploadBatches: true, debug: false, restrictions: n2.defaultOptions, meta: {}, onBeforeFileAdded: (e7) => e7, onBeforeUpload: (e7) => e7, store: d2(), logger: t2.justErrorsLogger, infoTimeout: 5e3 };
this.opts = { ...r3, ...e6, restrictions: { ...r3.restrictions, ...e6 && e6.restrictions } }, e6 && e6.logger && e6.debug ? this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.", "warning") : e6 && e6.debug && (this.opts.logger = t2.debugLogger), this.log(`Using Core v${this.constructor.VERSION}`), this.i18nInit(), this.calculateProgress = c2(this.calculateProgress.bind(this), 500, { leading: true, trailing: true }), this.store = this.opts.store, this.setState({ plugins: {}, files: {}, currentUploads: {}, allowNewUpload: true, capabilities: { uploadProgress: g2(), individualCancellation: true, resumableUploads: false }, totalProgress: 0, meta: { ...this.opts.meta }, info: [], recoveredState: null }), i2(this, b2)[b2] = new n2.Restricter(() => this.opts, this.i18n), i2(this, E2)[E2] = this.store.subscribe((e7, t3, n3) => {
this.emit("state-update", e7, t3, n3), this.updateAll(t3);
}), this.opts.debug && "undefined" != typeof window && (window[this.opts.id] = this), i2(this, k2)[k2]();
}
emit(e6) {
for (var t3 = arguments.length, n3 = new Array(t3 > 1 ? t3 - 1 : 0), r3 = 1; r3 < t3; r3++) n3[r3 - 1] = arguments[r3];
i2(this, w2)[w2].emit(e6, ...n3);
}
on(e6, t3) {
return i2(this, w2)[w2].on(e6, t3), this;
}
once(e6, t3) {
return i2(this, w2)[w2].once(e6, t3), this;
}
off(e6, t3) {
return i2(this, w2)[w2].off(e6, t3), this;
}
updateAll(e6) {
this.iteratePlugins((t3) => {
t3.update(e6);
});
}
setState(e6) {
this.store.setState(e6);
}
getState() {
return this.store.getState();
}
get state() {
return this.getState();
}
setFileState(e6, t3) {
if (!this.getState().files[e6]) throw new Error(`Can’t set state for ${e6} (the file could have been removed)`);
this.setState({ files: { ...this.getState().files, [e6]: { ...this.getState().files[e6], ...t3 } } });
}
i18nInit() {
const e6 = new u2([this.defaultLocale, this.opts.locale]);
this.i18n = e6.translate.bind(e6), this.i18nArray = e6.translateArray.bind(e6), this.locale = e6.locale;
}
setOptions(e6) {
this.opts = { ...this.opts, ...e6, restrictions: { ...this.opts.restrictions, ...e6 && e6.restrictions } }, e6.meta && this.setMeta(e6.meta), this.i18nInit(), e6.locale && this.iteratePlugins((e7) => {
e7.setOptions();
}), this.setState();
}
resetProgress() {
const e6 = { percentage: 0, bytesUploaded: 0, uploadComplete: false, uploadStarted: null }, t3 = { ...this.getState().files }, n3 = {};
Object.keys(t3).forEach((r3) => {
const o3 = { ...t3[r3] };
o3.progress = { ...o3.progress, ...e6 }, n3[r3] = o3;
}), this.setState({ files: n3, totalProgress: 0 }), this.emit("reset-progress");
}
addPreProcessor(e6) {
i2(this, C2)[C2].add(e6);
}
removePreProcessor(e6) {
return i2(this, C2)[C2].delete(e6);
}
addPostProcessor(e6) {
i2(this, A2)[A2].add(e6);
}
removePostProcessor(e6) {
return i2(this, A2)[A2].delete(e6);
}
addUploader(e6) {
i2(this, D2)[D2].add(e6);
}
removeUploader(e6) {
return i2(this, D2)[D2].delete(e6);
}
setMeta(e6) {
const t3 = { ...this.getState().meta, ...e6 }, n3 = { ...this.getState().files };
Object.keys(n3).forEach((t4) => {
n3[t4] = { ...n3[t4], meta: { ...n3[t4].meta, ...e6 } };
}), this.log("Adding metadata:"), this.log(e6), this.setState({ meta: t3, files: n3 });
}
setFileMeta(e6, t3) {
const n3 = { ...this.getState().files };
if (!n3[e6]) return void this.log("Was trying to set metadata for a file that has been removed: ", e6);
const r3 = { ...n3[e6].meta, ...t3 };
n3[e6] = { ...n3[e6], meta: r3 }, this.setState({ files: n3 });
}
getFile(e6) {
return this.getState().files[e6];
}
getFiles() {
const { files: e6 } = this.getState();
return Object.values(e6);
}
getObjectOfFilesPerState() {
const { files: e6, totalProgress: t3, error: n3 } = this.getState(), r3 = Object.values(e6), o3 = r3.filter((e7) => {
let { progress: t4 } = e7;
return !t4.uploadComplete && t4.uploadStarted;
}), i3 = r3.filter((e7) => !e7.progress.uploadStarted), a3 = r3.filter((e7) => e7.progress.uploadStarted || e7.progress.preprocess || e7.progress.postprocess), s3 = r3.filter((e7) => e7.progress.uploadStarted), u3 = r3.filter((e7) => e7.isPaused), l3 = r3.filter((e7) => e7.progress.uploadComplete), c3 = r3.filter((e7) => e7.error), d3 = o3.filter((e7) => !e7.isPaused), f3 = r3.filter((e7) => e7.progress.preprocess || e7.progress.postprocess);
return { newFiles: i3, startedFiles: a3, uploadStartedFiles: s3, pausedFiles: u3, completeFiles: l3, erroredFiles: c3, inProgressFiles: o3, inProgressNotPausedFiles: d3, processingFiles: f3, isUploadStarted: s3.length > 0, isAllComplete: 100 === t3 && l3.length === r3.length && 0 === f3.length, isAllErrored: !!n3 && c3.length === r3.length, isAllPaused: 0 !== o3.length && u3.length === o3.length, isUploadInProgress: o3.length > 0, isSomeGhost: r3.some((e7) => e7.isGhost) };
}
validateRestrictions(e6, t3) {
void 0 === t3 && (t3 = this.getFiles());
try {
return i2(this, b2)[b2].validate(e6, t3), { result: true };
} catch (e7) {
return { result: false, reason: e7.message };
}
}
checkIfFileAlreadyExists(e6) {
const { files: t3 } = this.getState();
return !(!t3[e6] || t3[e6].isGhost);
}
addFile(e6) {
i2(this, N2)[N2](e6);
const { files: t3 } = this.getState();
let n3 = i2(this, B2)[B2](t3, e6);
return t3[n3.id] && t3[n3.id].isGhost && (n3 = { ...t3[n3.id], data: e6.data, isGhost: false }, this.log(`Replaced the blob in the restored ghost file: ${n3.name}, ${n3.id}`)), this.setState({ files: { ...t3, [n3.id]: n3 } }), this.emit("file-added", n3), this.emit("files-added", [n3]), this.log(`Added file: ${n3.name}, ${n3.id}, mime type: ${n3.type}`), i2(this, T2)[T2](), n3.id;
}
addFiles(e6) {
i2(this, N2)[N2]();
const t3 = { ...this.getState().files }, n3 = [], r3 = [];
for (let o3 = 0; o3 < e6.length; o3++) try {
let r4 = i2(this, B2)[B2](t3, e6[o3]);
t3[r4.id] && t3[r4.id].isGhost && (r4 = { ...t3[r4.id], data: e6[o3].data, isGhost: false }, this.log(`Replaced blob in a ghost file: ${r4.name}, ${r4.id}`)), t3[r4.id] = r4, n3.push(r4);
} catch (e7) {
e7.isRestriction || r3.push(e7);
}
if (this.setState({ files: t3 }), n3.forEach((e7) => {
this.emit("file-added", e7);
}), this.emit("files-added", n3), n3.length > 5 ? this.log(`Added batch of ${n3.length} files`) : Object.keys(n3).forEach((e7) => {
this.log(`Added file: ${n3[e7].name}
id: ${n3[e7].id}
type: ${n3[e7].type}`);
}), n3.length > 0 && i2(this, T2)[T2](), r3.length > 0) {
let e7 = "Multiple errors occurred while adding files:\n";
if (r3.forEach((t4) => {
e7 += `
* ${t4.message}`;
}), this.info({ message: this.i18n("addBulkFilesFailed", { smart_count: r3.length }), details: e7 }, "error", this.opts.infoTimeout), "function" == typeof AggregateError) throw new AggregateError(r3, e7);
{
const t4 = new Error(e7);
throw t4.errors = r3, t4;
}
}
}
removeFiles(e6, t3) {
const { files: n3, currentUploads: r3 } = this.getState(), o3 = { ...n3 }, i3 = { ...r3 }, a3 = /* @__PURE__ */ Object.create(null);
function s3(e7) {
return void 0 === a3[e7];
}
e6.forEach((e7) => {
n3[e7] && (a3[e7] = n3[e7], delete o3[e7]);
}), Object.keys(i3).forEach((e7) => {
const t4 = r3[e7].fileIDs.filter(s3);
if (0 === t4.length) return void delete i3[e7];
const { capabilities: n4 } = this.getState();
if (t4.length !== r3[e7].fileIDs.length && !n4.individualCancellation) throw new Error("individualCancellation is disabled");
i3[e7] = { ...r3[e7], fileIDs: t4 };
});
const u3 = { currentUploads: i3, files: o3 };
0 === Object.keys(o3).length && (u3.allowNewUpload = true, u3.error = null, u3.recoveredState = null), this.setState(u3), this.calculateTotalProgress();
const l3 = Object.keys(a3);
l3.forEach((e7) => {
this.emit("file-removed", a3[e7], t3);
}), l3.length > 5 ? this.log(`Removed ${l3.length} files`) : this.log(`Removed files: ${l3.join(", ")}`);
}
removeFile(e6, t3) {
void 0 === t3 && (t3 = null), this.removeFiles([e6], t3);
}
pauseResume(e6) {
if (!this.getState().capabilities.resumableUploads || this.getFile(e6).uploadComplete) return;
const t3 = !(this.getFile(e6).isPaused || false);
return this.setFileState(e6, { isPaused: t3 }), this.emit("upload-pause", e6, t3), t3;
}
pauseAll() {
const e6 = { ...this.getState().files };
Object.keys(e6).filter((t3) => !e6[t3].progress.uploadComplete && e6[t3].progress.uploadStarted).forEach((t3) => {
const n3 = { ...e6[t3], isPaused: true };
e6[t3] = n3;
}), this.setState({ files: e6 }), this.emit("pause-all");
}
resumeAll() {
const e6 = { ...this.getState().files };
Object.keys(e6).filter((t3) => !e6[t3].progress.uploadComplete && e6[t3].progress.uploadStarted).forEach((t3) => {
const n3 = { ...e6[t3], isPaused: false, error: null };
e6[t3] = n3;
}), this.setState({ files: e6 }), this.emit("resume-all");
}
retryAll() {
const e6 = { ...this.getState().files }, t3 = Object.keys(e6).filter((t4) => e6[t4].error);
if (t3.forEach((t4) => {
const n4 = { ...e6[t4], isPaused: false, error: null };
e6[t4] = n4;
}), this.setState({ files: e6, error: null }), this.emit("retry-all", t3), 0 === t3.length) return Promise.resolve({ successful: [], failed: [] });
const n3 = i2(this, P2)[P2](t3, { forceAllowNewUpload: true });
return i2(this, _2)[_2](n3);
}
cancelAll(e6) {
let { reason: t3 = "user" } = void 0 === e6 ? {} : e6;
if (this.emit("cancel-all", { reason: t3 }), "user" === t3) {
const { files: e7 } = this.getState(), t4 = Object.keys(e7);
t4.length && this.removeFiles(t4, "cancel-all"), this.setState({ totalProgress: 0, error: null, recoveredState: null });
}
}
retryUpload(e6) {
this.setFileState(e6, { error: null, isPaused: false }), this.emit("upload-retry", e6);
const t3 = i2(this, P2)[P2]([e6], { forceAllowNewUpload: true });
return i2(this, _2)[_2](t3);
}
reset() {
this.cancelAll(...arguments);
}
logout() {
this.iteratePlugins((e6) => {
e6.provider && e6.provider.logout && e6.provider.logout();
});
}
calculateProgress(e6, t3) {
if (null == e6 || !this.getFile(e6.id)) return void this.log(`Not setting progress for a file that has been removed: ${null == e6 ? void 0 : e6.id}`);
const n3 = Number.isFinite(t3.bytesTotal) && t3.bytesTotal > 0;
this.setFileState(e6.id, { progress: { ...this.getFile(e6.id).progress, bytesUploaded: t3.bytesUploaded, bytesTotal: t3.bytesTotal, percentage: n3 ? Math.round(t3.bytesUploaded / t3.bytesTotal * 100) : 0 } }), this.calculateTotalProgress();
}
calculateTotalProgress() {
const e6 = this.getFiles().filter((e7) => e7.progress.uploadStarted || e7.progress.preprocess || e7.progress.postprocess);
if (0 === e6.length) return this.emit("progress", 0), void this.setState({ totalProgress: 0 });
const t3 = e6.filter((e7) => null != e7.progress.bytesTotal), n3 = e6.filter((e7) => null == e7.progress.bytesTotal);
if (0 === t3.length) {
const t4 = 100 * e6.length, r4 = n3.reduce((e7, t5) => e7 + t5.progress.percentage, 0), o4 = Math.round(r4 / t4 * 100);
return void this.setState({ totalProgress: o4 });
}
let r3 = t3.reduce((e7, t4) => e7 + t4.progress.bytesTotal, 0);
const o3 = r3 / t3.length;
r3 += o3 * n3.length;
let i3 = 0;
t3.forEach((e7) => {
i3 += e7.progress.bytesUploaded;
}), n3.forEach((e7) => {
i3 += o3 * (e7.progress.percentage || 0) / 100;
});
let a3 = 0 === r3 ? 0 : Math.round(i3 / r3 * 100);
a3 > 100 && (a3 = 100), this.setState({ totalProgress: a3 }), this.emit("progress", a3);
}
updateOnlineStatus() {
void 0 === window.navigator.onLine || window.navigator.onLine ? (this.emit("is-online"), this.wasOffline && (this.emit("back-online"), this.info(this.i18n("connectedToInternet"), "success", 3e3), this.wasOffline = false)) : (this.emit("is-offline"), this.info(this.i18n("noInternetConnection"), "error", 0), this.wasOffline = true);
}
getID() {
return this.opts.id;
}
use(e6, t3) {
if ("function" != typeof e6) {
throw new TypeError(`Expected a plugin class, but got ${null === e6 ? "null" : typeof e6}. Please verify that the plugin was imported and spelled correctly.`);
}
const n3 = new e6(this, t3), r3 = n3.id;
if (!r3) throw new Error("Your plugin must have an id");
if (!n3.type) throw new Error("Your plugin must have a type");
const o3 = this.getPlugin(r3);
if (o3) {
const e7 = `Already found a plugin named '${o3.id}'. Tried to use: '${r3}'.
Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;
throw new Error(e7);
}
return e6.VERSION && this.log(`Using ${r3} v${e6.VERSION}`), n3.type in i2(this, y2)[y2] ? i2(this, y2)[y2][n3.type].push(n3) : i2(this, y2)[y2][n3.type] = [n3], n3.install(), this;
}
getPlugin(e6) {
for (const t3 of Object.values(i2(this, y2)[y2])) {
const n3 = t3.find((t4) => t4.id === e6);
if (null != n3) return n3;
}
}
[r2](e6) {
return i2(this, y2)[y2][e6];
}
iteratePlugins(e6) {
Object.values(i2(this, y2)[y2]).flat(1).forEach(e6);
}
removePlugin(e6) {
this.log(`Removing plugin ${e6.id}`), this.emit("plugin-remove", e6), e6.uninstall && e6.uninstall();
const t3 = i2(this, y2)[y2][e6.type], n3 = t3.findIndex((t4) => t4.id === e6.id);
-1 !== n3 && t3.splice(n3, 1);
const r3 = { plugins: { ...this.getState().plugins, [e6.id]: void 0 } };
this.setState(r3);
}
close(e6) {
let { reason: t3 } = void 0 === e6 ? {} : e6;
this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`), this.cancelAll({ reason: t3 }), i2(this, E2)[E2](), this.iteratePlugins((e7) => {
this.removePlugin(e7);
}), "undefined" != typeof window && window.removeEventListener && (window.removeEventListener("online", i2(this, F2)[F2]), window.removeEventListener("offline", i2(this, F2)[F2]));
}
hideInfo() {
const { info: e6 } = this.getState();
this.setState({ info: e6.slice(1) }), this.emit("info-hidden");
}
info(e6, t3, n3) {
void 0 === t3 && (t3 = "info"), void 0 === n3 && (n3 = 3e3);
const r3 = "object" == typeof e6;
this.setState({ info: [...this.getState().info, { type: t3, message: r3 ? e6.message : e6, details: r3 ? e6.details : null }] }), setTimeout(() => this.hideInfo(), n3), this.emit("info-visible");
}
log(e6, t3) {
const { logger: n3 } = this.opts;
switch (t3) {
case "error":
n3.error(e6);
break;
case "warning":
n3.warn(e6);
break;
default:
n3.debug(e6);
}
}
restore(e6) {
return this.log(`Core: attempting to restore upload "${e6}"`), this.getState().currentUploads[e6] ? i2(this, _2)[_2](e6) : (i2(this, R2)[R2](e6), Promise.reject(new Error("Nonexistent upload")));
}
[o2]() {
return i2(this, P2)[P2](...arguments);
}
addResultData(e6, t3) {
if (!i2(this, I2)[I2](e6)) return void this.log(`Not setting result for an upload that has been removed: ${e6}`);
const { currentUploads: n3 } = this.getState(), r3 = { ...n3[e6], result: { ...n3[e6].result, ...t3 } };
this.setState({ currentUploads: { ...n3, [e6]: r3 } });
}
upload() {
var e6;
null != (e6 = i2(this, y2)[y2].uploader) && e6.length || this.log("No uploader type plugins are used", "warning");
let { files: t3 } = this.getState();
const r3 = this.opts.onBeforeUpload(t3);
return false === r3 ? Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")) : (r3 && "object" == typeof r3 && (t3 = r3, this.setState({ files: t3 })), Promise.resolve().then(() => i2(this, b2)[b2].validateMinNumberOfFiles(t3)).catch((e7) => {
throw i2(this, S2)[S2](e7), e7;
}).then(() => {
if (!i2(this, O2)[O2](t3)) throw new n2.RestrictionError(this.i18n("missingRequiredMetaField"));
}).catch((e7) => {
throw e7;
}).then(() => {
const { currentUploads: e7 } = this.getState(), n3 = Object.values(e7).flatMap((e8) => e8.fileIDs), r4 = [];
Object.keys(t3).forEach((e8) => {
const t4 = this.getFile(e8);
t4.progress.uploadStarted || -1 !== n3.indexOf(e8) || r4.push(t4.id);
});
const o3 = i2(this, P2)[P2](r4);
return i2(this, _2)[_2](o3);
}).catch((e7) => {
throw this.emit("error", e7), this.log(e7, "error"), e7;
}));
}
}
function M2(e6, t3) {
const { message: n3, details: r3 = "" } = e6;
e6.isRestriction ? this.emit("restriction-failed", t3, e6) : this.emit("error", e6), this.info({ message: n3, details: r3 }, "error", this.opts.infoTimeout), this.log(`${n3} ${r3}`.trim(), "error");
}
function j2(e6) {
const { missingFields: t3, error: n3 } = i2(this, b2)[b2].getMissingRequiredMetaFields(e6);
return !(t3.length > 0) || (this.setFileState(e6.id, { missingRequiredMetaFields: t3 }), this.log(n3.message), this.emit("restriction-failed", e6, n3), false);
}
function H2(e6) {
let t3 = true;
for (const n3 of Object.values(e6)) i2(this, x2)[x2](n3) || (t3 = false);
return t3;
}
function z2(e6) {
const { allowNewUpload: t3 } = this.getState();
if (false === t3) {
const t4 = new n2.RestrictionError(this.i18n("noMoreFilesAllowed"));
throw i2(this, S2)[S2](t4, e6), t4;
}
}
function $2(e6, t3) {
const r3 = f2(t3), o3 = v2(r3, t3), a3 = p2(o3).extension, s3 = Boolean(t3.isRemote), u3 = h2({ ...t3, type: r3 });
if (this.checkIfFileAlreadyExists(u3)) {
const e7 = new n2.RestrictionError(this.i18n("noDuplicates", { fileName: o3 }));
throw i2(this, S2)[S2](e7, t3), e7;
}
const l3 = t3.meta || {};
l3.name = o3, l3.type = r3;
const c3 = Number.isFinite(t3.data.size) ? t3.data.size : null;
let d3 = { source: t3.source || "", id: u3, name: o3, extension: a3 || "", meta: { ...this.getState().meta, ...l3 }, type: r3, data: t3.data, progress: { percentage: 0, bytesUploaded: 0, bytesTotal: c3, uploadComplete: false, uploadStarted: null }, size: c3, isRemote: s3, remote: t3.remote || "", preview: t3.preview };
const g3 = this.opts.onBeforeFileAdded(d3, e6);
if (false === g3) {
const e7 = new n2.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");
throw this.emit("restriction-failed", t3, e7), e7;
}
"object" == typeof g3 && null !== g3 && (d3 = g3);
try {
const t4 = Object.keys(e6).map((t5) => e6[t5]);
i2(this, b2)[b2].validate(d3, t4);
} catch (e7) {
throw i2(this, S2)[S2](e7, d3), e7;
}
return d3;
}
function U2() {
this.opts.autoProceed && !this.scheduledAutoProceed && (this.scheduledAutoProceed = setTimeout(() => {
this.scheduledAutoProceed = null, this.upload().catch((e6) => {
e6.isRestriction || this.log(e6.stack || e6.message || e6);
});
}, 4));
}
function V2() {
const e6 = (e7, t3, n3) => {
let r3 = e7.message || "Unknown error";
e7.details && (r3 += ` ${e7.details}`), this.setState({ error: r3 }), null != t3 && t3.id in this.getState().files && this.setFileState(t3.id, { error: r3, response: n3 });
};
this.on("error", e6), this.on("upload-error", (t3, n3, r3) => {
if (e6(n3, t3, r3), "object" == typeof n3 && n3.message) {
const e7 = new Error(n3.message);
e7.details = n3.message, n3.details && (e7.details += ` ${n3.details}`), e7.message = this.i18n("failedToUpload", { file: null == t3 ? void 0 : t3.name }), i2(this, S2)[S2](e7);
} else i2(this, S2)[S2](n3);
}), this.on("upload", () => {
this.setState({ error: null });
}), this.on("upload-started", (e7) => {
null != e7 && this.getFile(e7.id) ? this.setFileState(e7.id, { progress: { uploadStarted: Date.now(), uploadComplete: false, percentage: 0, bytesUploaded: 0, bytesTotal: e7.size } }) : this.log(`Not setting progress for a file that has been removed: ${null == e7 ? void 0 : e7.id}`);
}), this.on("upload-progress", this.calculateProgress), this.on("upload-success", (e7, t3) => {
if (null == e7 || !this.getFile(e7.id)) return void this.log(`Not setting progress for a file that has been removed: ${null == e7 ? void 0 : e7.id}`);
const n3 = this.getFile(e7.id).progress;
this.setFileState(e7.id, { progress: { ...n3, postprocess: i2(this, A2)[A2].size > 0 ? { mode: "indeterminate" } : null, uploadComplete: true, percentage: 100, bytesUploaded: n3.bytesTotal }, response: t3, uploadURL: t3.uploadURL, isPaused: false }), null == e7.size && this.setFileState(e7.id, { size: t3.bytesUploaded || n3.bytesTotal }), this.calculateTotalProgress();
}), this.on("preprocess-progress", (e7, t3) => {
null != e7 && this.getFile(e7.id) ? this.setFileState(e7.id, { progress: { ...this.getFile(e7.id).progress, preprocess: t3 } }) : this.log(`Not setting progress for a file that has been removed: ${null == e7 ? void 0 : e7.id}`);
}), this.on("preprocess-complete", (e7) => {
if (null == e7 || !this.getFile(e7.id)) return void this.log(`Not setting progress for a file that has been removed: ${null == e7 ? void 0 : e7.id}`);
const t3 = { ...this.getState().files };
t3[e7.id] = { ...t3[e7.id], progress: { ...t3[e7.id].progress } }, delete t3[e7.id].progress.preprocess, this.setState({ files: t3 });
}), this.on("postprocess-progress", (e7, t3) => {
null != e7 && this.getFile(e7.id) ? this.setFileState(e7.id, { progress: { ...this.getState().files[e7.id].progress, postprocess: t3 } }) : this.log(`Not setting progress for a file that has been removed: ${null == e7 ? void 0 : e7.id}`);
}), this.on("postprocess-complete", (e7) => {
if (null == e7 || !this.getFile(e7.id)) return void this.log(`Not setting progress for a file that has been removed: ${null == e7 ? void 0 : e7.id}`);
const t3 = { ...this.getState().files };
t3[e7.id] = { ...t3[e7.id], progress: { ...t3[e7.id].progress } }, delete t3[e7.id].progress.postprocess, this.setState({ files: t3 });
}), this.on("restored", () => {
this.calculateTotalProgress();
}), this.on("dashboard:file-edit-complete", (e7) => {
e7 && i2(this, x2)[x2](e7);
}), "undefined" != typeof window && window.addEventListener && (window.addEventListener("online", i2(this, F2)[F2]), window.addEventListener("offline", i2(this, F2)[F2]), setTimeout(i2(this, F2)[F2], 3e3));
}
function W2(t3, n3) {
void 0 === n3 && (n3 = {});
const { forceAllowNewUpload: r3 = false } = n3, { allowNewUpload: o3, currentUploads: i3 } = this.getState();
if (!o3 && !r3) throw new Error("Cannot create a new upload: already uploading.");
const a3 = (0, e5.nanoid)();
return this.emit("upload", { id: a3, fileIDs: t3 }), this.setState({ allowNewUpload: false !== this.opts.allowMultipleUploadBatches && false !== this.opts.allowMultipleUploads, currentUploads: { ...i3, [a3]: { fileIDs: t3, step: 0, result: {} } } }), a3;
}
function G2(e6) {
const { currentUploads: t3 } = this.getState();
return t3[e6];
}
function q2(e6) {
const t3 = { ...this.getState().currentUploads };
delete t3[e6], this.setState({ currentUploads: t3 });
}
async function K2(e6) {
let { currentUploads: t3 } = this.getState(), n3 = t3[e6];
const r3 = n3.step || 0, o3 = [...i2(this, C2)[C2], ...i2(this, D2)[D2], ...i2(this, A2)[A2]];
try {
for (let i3 = r3; i3 < o3.length && n3; i3++) {
const r4 = o3[i3], a4 = { ...n3, step: i3 };
this.setState({ currentUploads: { ...t3, [e6]: a4 } }), await r4(a4.fileIDs, e6), t3 = this.getState().currentUploads, n3 = t3[e6];
}
} catch (t4) {
throw i2(this, R2)[R2](e6), t4;
}
if (n3) {
n3.fileIDs.forEach((e7) => {
const t4 = this.getFile(e7);
t4 && t4.progress.postprocess && this.emit("postprocess-complete", t4);
});
const r4 = n3.fileIDs.map((e7) => this.getFile(e7)), o4 = r4.filter((e7) => !e7.error), i3 = r4.filter((e7) => e7.error);
await this.addResultData(e6, { successful: o4, failed: i3, uploadID: e6 }), t3 = this.getState().currentUploads, n3 = t3[e6];
}
let a3;
return n3 && (a3 = n3.result, this.emit("complete", a3), i2(this, R2)[R2](e6)), null == a3 && this.log(`Not setting result for an upload that has been removed: ${e6}`), a3;
}
return L2.VERSION = "2.3.4", RD = L2;
}
var KD, YD, XD, ZD, JD, QD, eA, tA, nA, rA, oA, iA, aA, sA = {}, uA = [], lA = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, cA = Array.isArray;
function dA(e5, t2) {
for (var n2 in t2) e5[n2] = t2[n2];
return e5;
}
function fA(e5) {
e5 && e5.parentNode && e5.parentNode.removeChild(e5);
}
function pA(e5, t2, n2) {
var r2, o2, i2, a2 = {};
for (i2 in t2) "key" == i2 ? r2 = t2[i2] : "ref" == i2 ? o2 = t2[i2] : a2[i2] = t2[i2];
if (arguments.length > 2 && (a2.children = arguments.length > 3 ? KD.call(arguments, 2) : n2), "function" == typeof e5 && null != e5.defaultProps) for (i2 in e5.defaultProps) void 0 === a2[i2] && (a2[i2] = e5.defaultProps[i2]);
return hA(e5, a2, r2, o2, null);
}
function hA(e5, t2, n2, r2, o2) {
var i2 = { type: e5, props: t2, key: n2, ref: r2, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: null == o2 ? ++XD : o2, __i: -1, __u: 0 };
return null == o2 && null != YD.vnode && YD.vnode(i2), i2;
}
function gA(e5) {
return e5.children;
}
function vA(e5, t2) {
this.props = e5, this.context = t2;
}
function mA(e5, t2) {
if (null == t2) return e5.__ ? mA(e5.__, e5.__i + 1) : null;
for (var n2; t2 < e5.__k.length; t2++) if (null != (n2 = e5.__k[t2]) && null != n2.__e) return n2.__e;
return "function" == typeof e5.type ? mA(e5) : null;
}
function yA(e5) {
var t2, n2;
if (null != (e5 = e5.__) && null != e5.__c) {
for (e5.__e = e5.__c.base = null, t2 = 0; t2 < e5.__k.length; t2++) if (null != (n2 = e5.__k[t2]) && null != n2.__e) {
e5.__e = e5.__c.base = n2.__e;
break;
}
return yA(e5);
}
}
function bA(e5) {
(!e5.__d && (e5.__d = true) && JD.push(e5) && !EA.__r++ || QD != YD.debounceRendering) && ((QD = YD.debounceRendering) || eA)(EA);
}
function EA() {
for (var e5, t2, n2, r2, o2, i2, a2, s2 = 1; JD.length; ) JD.length > s2 && JD.sort(tA), e5 = JD.shift(), s2 = JD.length, e5.__d && (n2 = void 0, r2 = void 0, o2 = (r2 = (t2 = e5).__v).__e, i2 = [], a2 = [], t2.__P && ((n2 = dA({}, r2)).__v = r2.__v + 1, YD.vnode && YD.vnode(n2), NA(t2.__P, n2, r2, t2.__n, t2.__P.namespaceURI, 32 & r2.__u ? [o2] : null, i2, null == o2 ? mA(r2) : o2, !!(32 & r2.__u), a2), n2.__v = r2.__v, n2.__.__k[n2.__i] = n2, TA(i2, n2, a2), r2.__e = r2.__ = null, n2.__e != o2 && yA(n2)));
EA.__r = 0;
}
function wA(e5, t2, n2, r2, o2, i2, a2, s2, u2, l2, c2) {
var d2, f2, p2, h2, g2, v2, m2, y2 = r2 && r2.__k || uA, b2 = t2.length;
for (u2 = CA(n2, t2, y2, u2, b2), d2 = 0; d2 < b2; d2++) null != (p2 = n2.__k[d2]) && (f2 = -1 == p2.__i ? sA : y2[p2.__i] || sA, p2.__i = d2, v2 = NA(e5, p2, f2, o2, i2, a2, s2, u2, l2, c2), h2 = p2.__e, p2.ref && f2.ref != p2.ref && (f2.ref && PA(f2.ref, null, p2), c2.push(p2.ref, p2.__c || h2, p2)), null == g2 && null != h2 && (g2 = h2), (m2 = !!(4 & p2.__u)) || f2.__k === p2.__k ? u2 = DA(p2, u2, e5, m2) : "function" == typeof p2.type && void 0 !== v2 ? u2 = v2 : h2 && (u2 = h2.nextSibling), p2.__u &= -7);
return n2.__e = g2, u2;
}
function CA(e5, t2, n2, r2, o2) {
var i2, a2, s2, u2, l2, c2 = n2.length, d2 = c2, f2 = 0;
for (e5.__k = new Array(o2), i2 = 0; i2 < o2; i2++) null != (a2 = t2[i2]) && "boolean" != typeof a2 && "function" != typeof a2 ? (u2 = i2 + f2, (a2 = e5.__k[i2] = "string" == typeof a2 || "number" == typeof a2 || "bigint" == typeof a2 || a2.constructor == String ? hA(null, a2, null, null, null) : cA(a2) ? hA(gA, { children: a2 }, null, null, null) : null == a2.constructor && a2.__b > 0 ? hA(a2.type, a2.props, a2.key, a2.ref ? a2.ref : null, a2.__v) : a2).__ = e5, a2.__b = e5.__b + 1, s2 = null, -1 != (l2 = a2.__i = AA(a2, n2, u2, d2)) && (d2--, (s2 = n2[l2]) && (s2.__u |= 2)), null == s2 || null == s2.__v ? (-1 == l2 && (o2 > c2 ? f2-- : o2 < c2 && f2++), "function" != typeof a2.type && (a2.__u |= 4)) : l2 != u2 && (l2 == u2 - 1 ? f2-- : l2 == u2 + 1 ? f2++ : (l2 > u2 ? f2-- : f2++, a2.__u |= 4))) : e5.__k[i2] = null;
if (d2) for (i2 = 0; i2 < c2; i2++) null != (s2 = n2[i2]) && !(2 & s2.__u) && (s2.__e == r2 && (r2 = mA(s2)), IA(s2, s2));
return r2;
}
function DA(e5, t2, n2, r2) {
var o2, i2;
if ("function" == typeof e5.type) {
for (o2 = e5.__k, i2 = 0; o2 && i2 < o2.length; i2++) o2[i2] && (o2[i2].__ = e5, t2 = DA(o2[i2], t2, n2, r2));
return t2;
}
e5.__e != t2 && (r2 && (t2 && e5.type && !t2.parentNode && (t2 = mA(e5)), n2.insertBefore(e5.__e, t2 || null)), t2 = e5.__e);
do {
t2 = t2 && t2.nextSibling;
} while (null != t2 && 8 == t2.nodeType);
return t2;
}
function AA(e5, t2, n2, r2) {
var o2, i2, a2, s2 = e5.key, u2 = e5.type, l2 = t2[n2], c2 = null != l2 && !(2 & l2.__u);
if (null === l2 && null == e5.key || c2 && s2 == l2.key && u2 == l2.type) return n2;
if (r2 > (c2 ? 1 : 0)) {
for (o2 = n2 - 1, i2 = n2 + 1; o2 >= 0 || i2 < t2.length; ) if (null != (l2 = t2[a2 = o2 >= 0 ? o2-- : i2++]) && !(2 & l2.__u) && s2 == l2.key && u2 == l2.type) return a2;
}
return -1;
}
function SA(e5, t2, n2) {
"-" == t2[0] ? e5.setProperty(t2, null == n2 ? "" : n2) : e5[t2] = null == n2 ? "" : "number" != typeof n2 || lA.test(t2) ? n2 : n2 + "px";
}
function xA(e5, t2, n2, r2, o2) {
var i2, a2;
e: if ("style" == t2) if ("string" == typeof n2) e5.style.cssText = n2;
else {
if ("string" == typeof r2 && (e5.style.cssText = r2 = ""), r2) for (t2 in r2) n2 && t2 in n2 || SA(e5.style, t2, "");
if (n2) for (t2 in n2) r2 && n2[t2] == r2[t2] || SA(e5.style, t2, n2[t2]);
}
else if ("o" == t2[0] && "n" == t2[1]) i2 = t2 != (t2 = t2.replace(nA, "$1")), a2 = t2.toLowerCase(), t2 = a2 in e5 || "onFocusOut" == t2 || "onFocusIn" == t2 ? a2.slice(2) : t2.slice(2), e5.l || (e5.l = {}), e5.l[t2 + i2] = n2, n2 ? r2 ? n2.u = r2.u : (n2.u = rA, e5.addEventListener(t2, i2 ? iA : oA, i2)) : e5.removeEventListener(t2, i2 ? iA : oA, i2);
else {
if ("http://www.w3.org/2000/svg" == o2) t2 = t2.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
else if ("width" != t2 && "height" != t2 && "href" != t2 && "list" != t2 && "form" != t2 && "tabIndex" != t2 && "download" != t2 && "rowSpan" != t2 && "colSpan" != t2 && "role" != t2 && "popover" != t2 && t2 in e5) try {
e5[t2] = null == n2 ? "" : n2;
break e;
} catch (e6) {
}
"function" == typeof n2 || (null == n2 || false === n2 && "-" != t2[4] ? e5.removeAttribute(t2) : e5.setAttribute(t2, "popover" == t2 && 1 == n2 ? "" : n2));
}
}
function OA(e5) {
return function(t2) {
if (this.l) {
var n2 = this.l[t2.type + e5];
if (null == t2.t) t2.t = rA++;
else if (t2.t < n2.u) return;
return n2(YD.event ? YD.event(t2) : t2);
}
};
}
function NA(e5, t2, n2, r2, o2, i2, a2, s2, u2, l2) {
var c2, d2, f2, p2, h2, g2, v2, m2, y2, b2, E2, w2, C2, D2, A2, S2, x2, O2 = t2.type;
if (null != t2.constructor) return null;
128 & n2.__u && (u2 = !!(32 & n2.__u), i2 = [s2 = t2.__e = n2.__e]), (c2 = YD.__b) && c2(t2);
e: if ("function" == typeof O2) try {
if (m2 = t2.props, y2 = "prototype" in O2 && O2.prototype.render, b2 = (c2 = O2.contextType) && r2[c2.__c], E2 = c2 ? b2 ? b2.props.value : c2.__ : r2, n2.__c ? v2 = (d2 = t2.__c = n2.__c).__ = d2.__E : (y2 ? t2.__c = d2 = new O2(m2, E2) : (t2.__c = d2 = new vA(m2, E2), d2.constructor = O2, d2.render = RA), b2 && b2.sub(d2), d2.props = m2, d2.state || (d2.state = {}), d2.context = E2, d2.__n = r2, f2 = d2.__d = true, d2.__h = [], d2._sb = []), y2 && null == d2.__s && (d2.__s = d2.state), y2 && null != O2.getDerivedStateFromProps && (d2.__s == d2.state && (d2.__s = dA({}, d2.__s)), dA(d2.__s, O2.getDerivedStateFromProps(m2, d2.__s))), p2 = d2.props, h2 = d2.state, d2.__v = t2, f2) y2 && null == O2.getDerivedStateFromProps && null != d2.componentWillMount && d2.componentWillMount(), y2 && null != d2.componentDidMount && d2.__h.push(d2.componentDidMount);
else {
if (y2 && null == O2.getDerivedStateFromProps && m2 !== p2 && null != d2.componentWillReceiveProps && d2.componentWillReceiveProps(m2, E2), !d2.__e && null != d2.shouldComponentUpdate && false === d2.shouldComponentUpdate(m2, d2.__s, E2) || t2.__v == n2.__v) {
for (t2.__v != n2.__v && (d2.props = m2, d2.state = d2.__s, d2.__d = false), t2.__e = n2.__e, t2.__k = n2.__k, t2.__k.some(function(e6) {
e6 && (e6.__ = t2);
}), w2 = 0; w2 < d2._sb.length; w2++) d2.__h.push(d2._sb[w2]);
d2._sb = [], d2.__h.length && a2.push(d2);
break e;
}
null != d2.componentWillUpdate && d2.componentWillUpdate(m2, d2.__s, E2), y2 && null != d2.componentDidUpdate && d2.__h.push(function() {
d2.componentDidUpdate(p2, h2, g2);
});
}
if (d2.context = E2, d2.props = m2, d2.__P = e5, d2.__e = false, C2 = YD.__r, D2 = 0, y2) {
for (d2.state = d2.__s, d2.__d = false, C2 && C2(t2), c2 = d2.render(d2.props, d2.state, d2.context), A2 = 0; A2 < d2._sb.length; A2++) d2.__h.push(d2._sb[A2]);
d2._sb = [];
} else do {
d2.__d = false, C2 && C2(t2), c2 = d2.render(d2.props, d2.state, d2.context), d2.state = d2.__s;
} while (d2.__d && ++D2 < 25);
d2.state = d2.__s, null != d2.getChildContext && (r2 = dA(dA({}, r2), d2.getChildContext())), y2 && !f2 && null != d2.getSnapshotBeforeUpdate && (g2 = d2.getSnapshotBeforeUpdate(p2, h2)), S2 = c2, null != c2 && c2.type === gA && null == c2.key && (S2 = kA(c2.props.children)), s2 = wA(e5, cA(S2) ? S2 : [S2], t2, n2, r2, o2, i2, a2, s2, u2, l2), d2.base = t2.__e, t2.__u &= -161, d2.__h.length && a2.push(d2), v2 && (d2.__E = d2.__ = null);
} catch (e6) {
if (t2.__v = null, u2 || null != i2) if (e6.then) {
for (t2.__u |= u2 ? 160 : 128; s2 && 8 == s2.nodeType && s2.nextSibling; ) s2 = s2.nextSibling;
i2[i2.indexOf(s2)] = null, t2.__e = s2;
} else {
for (x2 = i2.length; x2--; ) fA(i2[x2]);
BA(t2);
}
else t2.__e = n2.__e, t2.__k = n2.__k, e6.then || BA(t2);
YD.__e(e6, t2, n2);
}
else null == i2 && t2.__v == n2.__v ? (t2.__k = n2.__k, t2.__e = n2.__e) : s2 = t2.__e = FA(n2.__e, t2, n2, r2, o2, i2, a2, u2, l2);
return (c2 = YD.diffed) && c2(t2), 128 & t2.__u ? void 0 : s2;
}
function BA(e5) {
e5 && e5.__c && (e5.__c.__e = true), e5 && e5.__k && e5.__k.forEach(BA);
}
function TA(e5, t2, n2) {
for (var r2 = 0; r2 < n2.length; r2++) PA(n2[r2], n2[++r2], n2[++r2]);
YD.__c && YD.__c(t2, e5), e5.some(function(t3) {
try {
e5 = t3.__h, t3.__h = [], e5.some(function(e6) {
e6.call(t3);
});
} catch (e6) {
YD.__e(e6, t3.__v);
}
});
}
function kA(e5) {
return "object" != typeof e5 || null == e5 || e5.__b && e5.__b > 0 ? e5 : cA(e5) ? e5.map(kA) : dA({}, e5);
}
function FA(e5, t2, n2, r2, o2, i2, a2, s2, u2) {
var l2, c2, d2, f2, p2, h2, g2, v2 = n2.props, m2 = t2.props, y2 = t2.type;
if ("svg" == y2 ? o2 = "http://www.w3.org/2000/svg" : "math" == y2 ? o2 = "http://www.w3.org/1998/Math/MathML" : o2 || (o2 = "http://www.w3.org/1999/xhtml"), null != i2) {
for (l2 = 0; l2 < i2.length; l2++) if ((p2 = i2[l2]) && "setAttribute" in p2 == !!y2 && (y2 ? p2.localName == y2 : 3 == p2.nodeType)) {
e5 = p2, i2[l2] = null;
break;
}
}
if (null == e5) {
if (null == y2) return document.createTextNode(m2);
e5 = document.createElementNS(o2, y2, m2.is && m2), s2 && (YD.__m && YD.__m(t2, i2), s2 = false), i2 = null;
}
if (null == y2) v2 === m2 || s2 && e5.data == m2 || (e5.data = m2);
else {
if (i2 = i2 && KD.call(e5.childNodes), v2 = n2.props || sA, !s2 && null != i2) for (v2 = {}, l2 = 0; l2 < e5.attributes.length; l2++) v2[(p2 = e5.attributes[l2]).name] = p2.value;
for (l2 in v2) if (p2 = v2[l2], "children" == l2) ;
else if ("dangerouslySetInnerHTML" == l2) d2 = p2;
else if (!(l2 in m2)) {
if ("value" == l2 && "defaultValue" in m2 || "checked" == l2 && "defaultChecked" in m2) continue;
xA(e5, l2, null, p2, o2);
}
for (l2 in m2) p2 = m2[l2], "children" == l2 ? f2 = p2 : "dangerouslySetInnerHTML" == l2 ? c2 = p2 : "value" == l2 ? h2 = p2 : "checked" == l2 ? g2 = p2 : s2 && "function" != typeof p2 || v2[l2] === p2 || xA(e5, l2, p2, v2[l2], o2);
if (c2) s2 || d2 && (c2.__html == d2.__html || c2.__html == e5.innerHTML) || (e5.innerHTML = c2.__html), t2.__k = [];
else if (d2 && (e5.innerHTML = ""), wA("template" == t2.type ? e5.content : e5, cA(f2) ? f2 : [f2], t2, n2, r2, "foreignObject" == y2 ? "http://www.w3.org/1999/xhtml" : o2, i2, a2, i2 ? i2[0] : n2.__k && mA(n2, 0), s2, u2), null != i2) for (l2 = i2.length; l2--; ) fA(i2[l2]);
s2 || (l2 = "value", "progress" == y2 && null == h2 ? e5.removeAttribute("value") : null != h2 && (h2 !== e5[l2] || "progress" == y2 && !h2 || "option" == y2 && h2 != v2[l2]) && xA(e5, l2, h2, v2[l2], o2), l2 = "checked", null != g2 && g2 != e5[l2] && xA(e5, l2, g2, v2[l2], o2));
}
return e5;
}
function PA(e5, t2, n2) {
try {
if ("function" == typeof e5) {
var r2 = "function" == typeof e5.__u;
r2 && e5.__u(), r2 && null == t2 || (e5.__u = e5(t2));
} else e5.current = t2;
} catch (e6) {
YD.__e(e6, n2);
}
}
function IA(e5, t2, n2) {
var r2, o2;
if (YD.unmount && YD.unmount(e5), (r2 = e5.ref) && (r2.current && r2.current != e5.__e || PA(r2, null, t2)), null != (r2 = e5.__c)) {
if (r2.componentWillUnmount) try {
r2.componentWillUnmount();
} catch (e6) {
YD.__e(e6, t2);
}
r2.base = r2.__P = null;
}
if (r2 = e5.__k) for (o2 = 0; o2 < r2.length; o2++) r2[o2] && IA(r2[o2], t2, n2 || "function" != typeof e5.type);
n2 || fA(e5.__e), e5.__c = e5.__ = e5.__e = void 0;
}
function RA(e5, t2, n2) {
return this.constructor(e5, n2);
}
function _A(e5, t2, n2) {
var r2, o2, i2, a2;
t2 == document && (t2 = document.documentElement), YD.__ && YD.__(e5, t2), o2 = (r2 = "function" == typeof n2) ? null : n2 && n2.__k || t2.__k, i2 = [], a2 = [], NA(t2, e5 = (!r2 && n2 || t2).__k = pA(gA, null, [e5]), o2 || sA, sA, t2.namespaceURI, !r2 && n2 ? [n2] : o2 ? null : t2.firstChild ? KD.call(t2.childNodes) : null, i2, !r2 && n2 ? n2 : o2 ? o2.__e : t2.firstChild, r2, a2), TA(i2, e5, a2);
}
KD = uA.slice, YD = { __e: function(e5, t2, n2, r2) {
for (var o2, i2, a2; t2 = t2.__; ) if ((o2 = t2.__c) && !o2.__) try {
if ((i2 = o2.constructor) && null != i2.getDerivedStateFromError && (o2.setState(i2.getDerivedStateFromError(e5)), a2 = o2.__d), null != o2.componentDidCatch && (o2.componentDidCatch(e5, r2 || {}), a2 = o2.__d), a2) return o2.__E = o2;
} catch (t3) {
e5 = t3;
}
throw e5;
} }, XD = 0, ZD = function(e5) {
return null != e5 && null == e5.constructor;
}, vA.prototype.setState = function(e5, t2) {
var n2;
n2 = null != this.__s && this.__s != this.state ? this.__s : this.__s = dA({}, this.state), "function" == typeof e5 && (e5 = e5(dA({}, n2), this.props)), e5 && dA(n2, e5), null != e5 && this.__v && (t2 && this._sb.push(t2), bA(this));
}, vA.prototype.forceUpdate = function(e5) {
this.__v && (this.__e = true, e5 && this.__h.push(e5), bA(this));
}, vA.prototype.render = gA, JD = [], eA = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, tA = function(e5, t2) {
return e5.__v.__b - t2.__v.__b;
}, EA.__r = 0, nA = /(PointerCapture)$|Capture$/i, rA = 0, oA = OA(false), iA = OA(true), aA = 0;
var LA, MA, jA, HA, zA, $A, UA, VA, WA, GA, qA, KA = Object.freeze({ __proto__: null, Component: vA, Fragment: gA, cloneElement: function(e5, t2, n2) {
var r2, o2, i2, a2, s2 = dA({}, e5.props);
for (i2 in e5.type && e5.type.defaultProps && (a2 = e5.type.defaultProps), t2) "key" == i2 ? r2 = t2[i2] : "ref" == i2 ? o2 = t2[i2] : s2[i2] = void 0 === t2[i2] && null != a2 ? a2[i2] : t2[i2];
return arguments.length > 2 && (s2.children = arguments.length > 3 ? KD.call(arguments, 2) : n2), hA(e5.type, s2, r2 || e5.key, o2 || e5.ref, null);
}, createContext: function(e5) {
function t2(e6) {
var n2, r2;
return this.getChildContext || (n2 = /* @__PURE__ */ new Set(), (r2 = {})[t2.__c] = this, this.getChildContext = function() {
return r2;
}, this.componentWillUnmount = function() {
n2 = null;
}, this.shouldComponentUpdate = function(e7) {
this.props.value != e7.value && n2.forEach(function(e8) {
e8.__e = true, bA(e8);
});
}, this.sub = function(e7) {
n2.add(e7);
var t3 = e7.componentWillUnmount;
e7.componentWillUnmount = function() {
n2 && n2.delete(e7), t3 && t3.call(e7);
};
}), e6.children;
}
return t2.__c = "__cC" + aA++, t2.__ = e5, t2.Provider = t2.__l = (t2.Consumer = function(e6, t3) {
return e6.children(t3);
}).contextType = t2, t2;
}, createElement: pA, createRef: function() {
return { current: null };
}, h: pA, hydrate: function e3(t2, n2) {
_A(t2, n2, e3);
}, get isValidElement() {
return ZD;
}, get options() {
return YD;
}, render: _A, toChildArray: function e4(t2, n2) {
return n2 = n2 || [], null == t2 || "boolean" == typeof t2 || (cA(t2) ? t2.some(function(t3) {
e4(t3, n2);
}) : n2.push(t2)), n2;
} }), YA = E(KA);
function XA() {
if (HA) return jA;
HA = 1;
const e5 = MA ? LA : (MA = 1, LA = function(e6) {
return (null == e6 ? void 0 : e6.nodeType) === Node.ELEMENT_NODE;
});
return jA = function(t2, n2) {
return void 0 === n2 && (n2 = document), "string" == typeof t2 ? n2.querySelector(t2) : e5(t2) ? t2 : null;
};
}
function ZA() {
if (VA) return UA;
VA = 1;
const e5 = $D();
return UA = class {
constructor(e6, t2) {
void 0 === t2 && (t2 = {}), this.uppy = e6, this.opts = t2;
}
getPluginState() {
const { plugins: e6 } = this.uppy.getState();
return e6[this.id] || {};
}
setPluginState(e6) {
const { plugins: t2 } = this.uppy.getState();
this.uppy.setState({ plugins: { ...t2, [this.id]: { ...t2[this.id], ...e6 } } });
}
setOptions(e6) {
this.opts = { ...this.opts, ...e6 }, this.setPluginState(), this.i18nInit();
}
i18nInit() {
const t2 = new e5([this.defaultLocale, this.uppy.locale, this.opts.locale]);
this.i18n = t2.translate.bind(t2), this.i18nArray = t2.translateArray.bind(t2), this.setPluginState();
}
addTarget() {
throw new Error("Extend the addTarget method to add your plugin to another plugin's target");
}
install() {
}
uninstall() {
}
render() {
throw new Error("Extend the render method to add your plugin to a DOM element");
}
update() {
}
afterUpdate() {
}
};
}
function JA() {
if (GA) return WA;
GA = 1;
var e5 = YA;
function t2(e6, t3) {
if (!Object.prototype.hasOwnProperty.call(e6, t3)) throw new TypeError("attempted to use private field on non-instance");
return e6;
}
var n2 = 0;
function r2(e6) {
return "__private_" + n2++ + "_" + e6;
}
const o2 = XA(), i2 = $A ? zA : ($A = 1, zA = function(e6) {
for (var t3; e6 && !e6.dir; ) e6 = e6.parentNode;
return null == (t3 = e6) ? void 0 : t3.dir;
}), a2 = ZA();
var s2 = r2("updateUI");
class u2 extends a2 {
constructor() {
super(...arguments), Object.defineProperty(this, s2, { writable: true, value: void 0 });
}
mount(n3, r3) {
const a3 = r3.id, l2 = o2(n3);
if (l2) {
this.isTargetDOMEl = true;
const r4 = document.createElement("div");
return r4.classList.add("uppy-Root"), t2(this, s2)[s2] = /* @__PURE__ */ (function(e6) {
let t3 = null, n4 = null;
return function() {
for (var r5 = arguments.length, o3 = new Array(r5), i3 = 0; i3 < r5; i3++) o3[i3] = arguments[i3];
return n4 = o3, t3 || (t3 = Promise.resolve().then(() => (t3 = null, e6(...n4)))), t3;
};
})((t3) => {
this.uppy.getPlugin(this.id) && ((0, e5.render)(this.render(t3), r4), this.afterUpdate());
}), this.uppy.log(`Installing ${a3} to a DOM element '${n3}'`), this.opts.replaceTargetContent && (l2.innerHTML = ""), (0, e5.render)(this.render(this.uppy.getState()), r4), this.el = r4, l2.appendChild(r4), r4.dir = this.opts.direction || i2(r4) || "ltr", this.onMount(), this.el;
}
let c2;
if ("object" == typeof n3 && n3 instanceof u2) c2 = n3;
else if ("function" == typeof n3) {
const e6 = n3;
this.uppy.iteratePlugins((t3) => {
t3 instanceof e6 && (c2 = t3);
});
}
if (c2) return this.uppy.log(`Installing ${a3} to ${c2.id}`), this.parent = c2, this.el = c2.addTarget(r3), this.onMount(), this.el;
this.uppy.log(`Not installing ${a3}`);
let d2 = `Invalid target option given to ${a3}.`;
throw d2 += "function" == typeof n3 ? " The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly." : "If you meant to target an HTML element, please make sure that the element exists. Check that the