@divkitframework/visual-editor
Version:
Visual editor for DivKit
2,066 lines • 2.19 MB
JavaScript
var VN = Object.defineProperty;
var LN = (t, e, n) => e in t ? VN(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
var on = (t, e, n) => (LN(t, typeof e != "symbol" ? e + "" : e, n), n), kd = (t, e, n) => {
if (!e.has(t))
throw TypeError("Cannot " + n);
};
var io = (t, e, n) => (kd(t, e, "read from private field"), n ? n.call(t) : e.get(t)), nr = (t, e, n) => {
if (e.has(t))
throw TypeError("Cannot add the same private member more than once");
e instanceof WeakSet ? e.add(t) : e.set(t, n);
}, ta = (t, e, n, i) => (kd(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n);
var Ua = (t, e, n, i) => ({
set _(o) {
ta(t, e, o, n);
},
get _() {
return io(t, e, i);
}
}), wp = (t, e, n) => (kd(t, e, "access private method"), n);
function mn() {
}
const Mu = (t) => t;
function Is(t, e) {
for (const n in e)
t[n] = e[n];
return (
/** @type {T & S} */
t
);
}
function V1(t) {
return t();
}
function $p() {
return /* @__PURE__ */ Object.create(null);
}
function Jn(t) {
t.forEach(V1);
}
function Ko(t) {
return typeof t == "function";
}
function Qt(t, e) {
return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function";
}
let Tl;
function uc(t, e) {
return t === e ? !0 : (Tl || (Tl = document.createElement("a")), Tl.href = e, t === Tl.href);
}
function $l(t, e) {
return t != t ? e == e : t !== e;
}
function NN(t) {
return Object.keys(t).length === 0;
}
function Pu(t, ...e) {
if (t == null) {
for (const i of e)
i(void 0);
return mn;
}
const n = t.subscribe(...e);
return n.unsubscribe ? () => n.unsubscribe() : n;
}
function Cn(t) {
let e;
return Pu(t, (n) => e = n)(), e;
}
function Le(t, e, n) {
t.$$.on_destroy.push(Pu(e, n));
}
function Us(t, e, n, i) {
if (t) {
const o = L1(t, e, n, i);
return t[0](o);
}
}
function L1(t, e, n, i) {
return t[1] && i ? Is(n.ctx.slice(), t[1](i(e))) : n.ctx;
}
function Ws(t, e, n, i) {
if (t[2] && i) {
const o = t[2](i(n));
if (e.dirty === void 0)
return o;
if (typeof o == "object") {
const r = [], s = Math.max(e.dirty.length, o.length);
for (let a = 0; a < s; a += 1)
r[a] = e.dirty[a] | o[a];
return r;
}
return e.dirty | o;
}
return e.dirty;
}
function Zs(t, e, n, i, o, r) {
if (o) {
const s = L1(e, n, i, r);
t.p(s, o);
}
}
function Ks(t) {
if (t.ctx.length > 32) {
const e = [], n = t.ctx.length / 32;
for (let i = 0; i < n; i++)
e[i] = -1;
return e;
}
return -1;
}
function Vi(t, e, n) {
return t.set(n), e;
}
function N1(t) {
return t && Ko(t.destroy) ? t.destroy : mn;
}
function kp(t) {
const e = typeof t == "string" && t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);
return e ? [parseFloat(e[1]), e[2] || "px"] : [
/** @type {number} */
t,
"px"
];
}
const FN = ["", !0, 1, "true", "contenteditable"], F1 = typeof window < "u";
let q1 = F1 ? () => window.performance.now() : () => Date.now(), Iu = F1 ? (t) => requestAnimationFrame(t) : mn;
const fa = /* @__PURE__ */ new Set();
function R1(t) {
fa.forEach((e) => {
e.c(t) || (fa.delete(e), e.f());
}), fa.size !== 0 && Iu(R1);
}
function B1(t) {
let e;
return fa.size === 0 && Iu(R1), {
promise: new Promise((n) => {
fa.add(e = { c: t, f: n });
}),
abort() {
fa.delete(e);
}
};
}
const kl = typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : (
// @ts-ignore Node typings have this
global
);
function $(t, e) {
t.appendChild(e);
}
function H1(t) {
if (!t)
return document;
const e = t.getRootNode ? t.getRootNode() : t.ownerDocument;
return e && /** @type {ShadowRoot} */
e.host ? (
/** @type {ShadowRoot} */
e
) : t.ownerDocument;
}
function qN(t) {
const e = S("style");
return e.textContent = "/* empty */", RN(H1(t), e), e.sheet;
}
function RN(t, e) {
return $(
/** @type {Document} */
t.head || t,
e
), e.sheet;
}
function F(t, e, n) {
t.insertBefore(e, n || null);
}
function N(t) {
t.parentNode && t.parentNode.removeChild(t);
}
function Gi(t, e) {
for (let n = 0; n < t.length; n += 1)
t[n] && t[n].d(e);
}
function S(t) {
return document.createElement(t);
}
function qr(t) {
return document.createElementNS("http://www.w3.org/2000/svg", t);
}
function tt(t) {
return document.createTextNode(t);
}
function G() {
return tt(" ");
}
function Fn() {
return tt("");
}
function ae(t, e, n, i) {
return t.addEventListener(e, n, i), () => t.removeEventListener(e, n, i);
}
function Ii(t) {
return function(e) {
return e.preventDefault(), t.call(this, e);
};
}
function To(t) {
return function(e) {
return e.stopPropagation(), t.call(this, e);
};
}
function g(t, e, n) {
n == null ? t.removeAttribute(e) : t.getAttribute(e) !== n && t.setAttribute(e, n);
}
const BN = ["width", "height"];
function $a(t, e) {
const n = Object.getOwnPropertyDescriptors(t.__proto__);
for (const i in e)
e[i] == null ? t.removeAttribute(i) : i === "style" ? t.style.cssText = e[i] : i === "__value" ? t.value = t[i] = e[i] : n[i] && n[i].set && BN.indexOf(i) === -1 ? t[i] = e[i] : g(t, i, e[i]);
}
function HN(t, e) {
Object.keys(e).forEach((n) => {
JN(t, n, e[n]);
});
}
function JN(t, e, n) {
const i = e.toLowerCase();
i in t ? t[i] = typeof t[i] == "boolean" && n === "" ? !0 : n : e in t ? t[e] = typeof t[e] == "boolean" && n === "" ? !0 : n : g(t, e, n);
}
function pc(t) {
return /-/.test(t) ? HN : $a;
}
function J1(t) {
let e;
return {
/* push */
p(...n) {
e = n, e.forEach((i) => t.push(i));
},
/* remove */
r() {
e.forEach((n) => t.splice(t.indexOf(n), 1));
}
};
}
function xi(t) {
return t === "" ? null : +t;
}
function UN(t) {
return Array.from(t.childNodes);
}
function ut(t, e) {
e = "" + e, t.data !== e && (t.data = /** @type {string} */
e);
}
function U1(t, e) {
e = "" + e, t.wholeText !== e && (t.data = /** @type {string} */
e);
}
function WN(t, e, n) {
~FN.indexOf(n) ? U1(t, e) : ut(t, e);
}
function Xn(t, e) {
t.value = e ?? "";
}
function Te(t, e, n, i) {
n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, "");
}
function fc(t, e, n) {
for (let i = 0; i < t.options.length; i += 1) {
const o = t.options[i];
if (o.__value === e) {
o.selected = !0;
return;
}
}
(!n || e !== void 0) && (t.selectedIndex = -1);
}
function W1(t) {
const e = t.querySelector(":checked");
return e && e.__value;
}
let zl;
function ZN() {
if (zl === void 0) {
zl = !1;
try {
typeof window < "u" && window.parent && window.parent.document;
} catch {
zl = !0;
}
}
return zl;
}
function Du(t, e) {
getComputedStyle(t).position === "static" && (t.style.position = "relative");
const i = S("iframe");
i.setAttribute(
"style",
"display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"
), i.setAttribute("aria-hidden", "true"), i.tabIndex = -1;
const o = ZN();
let r;
return o ? (i.src = "data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>", r = ae(
window,
"message",
/** @param {MessageEvent} event */
(s) => {
s.source === i.contentWindow && e();
}
)) : (i.src = "about:blank", i.onload = () => {
r = ae(i.contentWindow, "resize", e), e();
}), $(t, i), () => {
(o || r && i.contentWindow) && r(), N(i);
};
}
function le(t, e, n) {
t.classList.toggle(e, !!n);
}
function Z1(t, e, { bubbles: n = !1, cancelable: i = !1 } = {}) {
return new CustomEvent(t, { detail: e, bubbles: n, cancelable: i });
}
class Vu {
constructor(e = !1) {
/**
* @private
* @default false
*/
on(this, "is_svg", !1);
/** parent for creating node */
on(this, "e");
/** html tag nodes */
on(this, "n");
/** target */
on(this, "t");
/** anchor */
on(this, "a");
this.is_svg = e, this.e = this.n = null;
}
/**
* @param {string} html
* @returns {void}
*/
c(e) {
this.h(e);
}
/**
* @param {string} html
* @param {HTMLElement | SVGElement} target
* @param {HTMLElement | SVGElement} anchor
* @returns {void}
*/
m(e, n, i = null) {
this.e || (this.is_svg ? this.e = qr(
/** @type {keyof SVGElementTagNameMap} */
n.nodeName
) : this.e = S(
/** @type {keyof HTMLElementTagNameMap} */
n.nodeType === 11 ? "TEMPLATE" : n.nodeName
), this.t = n.tagName !== "TEMPLATE" ? n : (
/** @type {HTMLTemplateElement} */
n.content
), this.c(e)), this.i(i);
}
/**
* @param {string} html
* @returns {void}
*/
h(e) {
this.e.innerHTML = e, this.n = Array.from(
this.e.nodeName === "TEMPLATE" ? this.e.content.childNodes : this.e.childNodes
);
}
/**
* @returns {void} */
i(e) {
for (let n = 0; n < this.n.length; n += 1)
F(this.t, this.n[n], e);
}
/**
* @param {string} html
* @returns {void}
*/
p(e) {
this.d(), this.h(e), this.i(this.a);
}
/**
* @returns {void} */
d() {
this.n.forEach(N);
}
}
function ka(t, e) {
return new t(e);
}
const _c = /* @__PURE__ */ new Map();
let mc = 0;
function KN(t) {
let e = 5381, n = t.length;
for (; n--; )
e = (e << 5) - e ^ t.charCodeAt(n);
return e >>> 0;
}
function YN(t, e) {
const n = { stylesheet: qN(e), rules: {} };
return _c.set(t, n), n;
}
function xd(t, e, n, i, o, r, s, a = 0) {
const l = 16.666 / i;
let c = `{
`;
for (let h = 0; h <= 1; h += l) {
const v = e + (n - e) * r(h);
c += h * 100 + `%{${s(v, 1 - v)}}
`;
}
const d = c + `100% {${s(n, 1 - n)}}
}`, u = `__svelte_${KN(d)}_${a}`, p = H1(t), { stylesheet: f, rules: _ } = _c.get(p) || YN(p, t);
_[u] || (_[u] = !0, f.insertRule(`@keyframes ${u} ${d}`, f.cssRules.length));
const m = t.style.animation || "";
return t.style.animation = `${m ? `${m}, ` : ""}${u} ${i}ms linear ${o}ms 1 both`, mc += 1, u;
}
function K1(t, e) {
const n = (t.style.animation || "").split(", "), i = n.filter(
e ? (r) => r.indexOf(e) < 0 : (r) => r.indexOf("__svelte") === -1
// remove all Svelte animations
), o = n.length - i.length;
o && (t.style.animation = i.join(", "), mc -= o, mc || GN());
}
function GN() {
Iu(() => {
mc || (_c.forEach((t) => {
const { ownerNode: e } = t.stylesheet;
e && N(e);
}), _c.clear());
});
}
function XN(t, e, n, i) {
if (!e)
return mn;
const o = t.getBoundingClientRect();
if (e.left === o.left && e.right === o.right && e.top === o.top && e.bottom === o.bottom)
return mn;
const {
delay: r = 0,
duration: s = 300,
easing: a = Mu,
// @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?
start: l = q1() + r,
// @ts-ignore todo:
end: c = l + s,
tick: d = mn,
css: u
} = n(t, { from: e, to: o }, i);
let p = !0, f = !1, _;
function m() {
u && (_ = xd(t, 0, 1, s, r, a, u)), r || (f = !0);
}
function h() {
u && K1(t, _), p = !1;
}
return B1((v) => {
if (!f && v >= l && (f = !0), f && v >= c && (d(1, 0), h()), !p)
return !1;
if (f) {
const y = v - l, b = 0 + 1 * a(y / s);
d(b, 1 - b);
}
return !0;
}), m(), d(0, 1), h;
}
function xN(t) {
const e = getComputedStyle(t);
if (e.position !== "absolute" && e.position !== "fixed") {
const { width: n, height: i } = e, o = t.getBoundingClientRect();
t.style.position = "absolute", t.style.width = n, t.style.height = i, Y1(t, o);
}
}
function Y1(t, e) {
const n = t.getBoundingClientRect();
if (e.left !== n.left || e.top !== n.top) {
const i = getComputedStyle(t), o = i.transform === "none" ? "" : i.transform;
t.style.transform = `${o} translate(${e.left - n.left}px, ${e.top - n.top}px)`;
}
}
let ol;
function Qa(t) {
ol = t;
}
function Oa() {
if (!ol)
throw new Error("Function called outside component initialization");
return ol;
}
function Gc(t) {
Oa().$$.on_mount.push(t);
}
function ms(t) {
Oa().$$.after_update.push(t);
}
function ss(t) {
Oa().$$.on_destroy.push(t);
}
function hi() {
const t = Oa();
return (e, n, { cancelable: i = !1 } = {}) => {
const o = t.$$.callbacks[e];
if (o) {
const r = Z1(
/** @type {string} */
e,
n,
{ cancelable: i }
);
return o.slice().forEach((s) => {
s.call(t, r);
}), !r.defaultPrevented;
}
return !0;
};
}
function gc(t, e) {
return Oa().$$.context.set(t, e), e;
}
function Ot(t) {
return Oa().$$.context.get(t);
}
function En(t, e) {
const n = t.$$.callbacks[e.type];
n && n.slice().forEach((i) => i.call(this, e));
}
const aa = [], ft = [];
let _a = [];
const Qd = [], G1 = /* @__PURE__ */ Promise.resolve();
let eu = !1;
function X1() {
eu || (eu = !0, G1.then(x1));
}
function jr() {
return X1(), G1;
}
function go(t) {
_a.push(t);
}
function ni(t) {
Qd.push(t);
}
const jd = /* @__PURE__ */ new Set();
let na = 0;
function x1() {
if (na !== 0)
return;
const t = ol;
do {
try {
for (; na < aa.length; ) {
const e = aa[na];
na++, Qa(e), QN(e.$$);
}
} catch (e) {
throw aa.length = 0, na = 0, e;
}
for (Qa(null), aa.length = 0, na = 0; ft.length; )
ft.pop()();
for (let e = 0; e < _a.length; e += 1) {
const n = _a[e];
jd.has(n) || (jd.add(n), n());
}
_a.length = 0;
} while (aa.length);
for (; Qd.length; )
Qd.pop()();
eu = !1, jd.clear(), Qa(t);
}
function QN(t) {
if (t.fragment !== null) {
t.update(), Jn(t.before_update);
const e = t.dirty;
t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(go);
}
}
function eF(t) {
const e = [], n = [];
_a.forEach((i) => t.indexOf(i) === -1 ? e.push(i) : n.push(i)), n.forEach((i) => i()), _a = e;
}
let Wa;
function tF() {
return Wa || (Wa = Promise.resolve(), Wa.then(() => {
Wa = null;
})), Wa;
}
function Sd(t, e, n) {
t.dispatchEvent(Z1(`${e ? "intro" : "outro"}${n}`));
}
const Wl = /* @__PURE__ */ new Set();
let is;
function Gt() {
is = {
r: 0,
c: [],
p: is
// parent group
};
}
function Xt() {
is.r || Jn(is.c), is = is.p;
}
function D(t, e) {
t && t.i && (Wl.delete(t), t.i(e));
}
function R(t, e, n, i) {
if (t && t.o) {
if (Wl.has(t))
return;
Wl.add(t), is.c.push(() => {
Wl.delete(t), i && (n && t.d(1), i());
}), t.o(e);
} else
i && i();
}
const nF = { duration: 0 };
function oo(t, e, n, i) {
let r = e(t, n, { direction: "both" }), s = i ? 0 : 1, a = null, l = null, c = null, d;
function u() {
c && K1(t, c);
}
function p(_, m) {
const h = (
/** @type {Program['d']} */
_.b - s
);
return m *= Math.abs(h), {
a: s,
b: _.b,
d: h,
duration: m,
start: _.start,
end: _.start + m,
group: _.group
};
}
function f(_) {
const {
delay: m = 0,
duration: h = 300,
easing: v = Mu,
tick: y = mn,
css: b
} = r || nF, w = {
start: q1() + m,
b: _
};
_ || (w.group = is, is.r += 1), "inert" in t && (_ ? d !== void 0 && (t.inert = d) : (d = /** @type {HTMLElement} */
t.inert, t.inert = !0)), a || l ? l = w : (b && (u(), c = xd(t, s, _, h, m, v, b)), _ && y(0, 1), a = p(w, h), go(() => Sd(t, _, "start")), B1((E) => {
if (l && E > l.start && (a = p(l, h), l = null, Sd(t, a.b, "start"), b && (u(), c = xd(
t,
s,
a.b,
a.duration,
0,
v,
r.css
))), a) {
if (E >= a.end)
y(s = a.b, 1 - s), Sd(t, a.b, "end"), l || (a.b ? u() : --a.group.r || Jn(a.group.c)), a = null;
else if (E >= a.start) {
const P = E - a.start;
s = a.a + a.d * v(P / a.duration), y(s, 1 - s);
}
}
return !!(a || l);
}));
}
return {
run(_) {
Ko(r) ? tF().then(() => {
r = r({ direction: _ ? "in" : "out" }), f(_);
}) : f(_);
},
end() {
u(), a = l = null;
}
};
}
function jn(t) {
return (t == null ? void 0 : t.length) !== void 0 ? t : Array.from(t);
}
function iF(t, e) {
t.d(1), e.delete(t.key);
}
function Ma(t, e) {
R(t, 1, 1, () => {
e.delete(t.key);
});
}
function oF(t, e) {
t.f(), Ma(t, e);
}
function Ys(t, e, n, i, o, r, s, a, l, c, d, u) {
let p = t.length, f = r.length, _ = p;
const m = {};
for (; _--; )
m[t[_].key] = _;
const h = [], v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), b = [];
for (_ = f; _--; ) {
const C = u(o, r, _), k = n(C);
let I = s.get(k);
I ? b.push(() => I.p(C, e)) : (I = c(k, C), I.c()), v.set(k, h[_] = I), k in m && y.set(k, Math.abs(_ - m[k]));
}
const w = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set();
function P(C) {
D(C, 1), C.m(a, d), s.set(C.key, C), d = C.first, f--;
}
for (; p && f; ) {
const C = h[f - 1], k = t[p - 1], I = C.key, j = k.key;
C === k ? (d = C.first, p--, f--) : v.has(j) ? !s.has(I) || w.has(I) ? P(C) : E.has(j) ? p-- : y.get(I) > y.get(j) ? (E.add(I), P(C)) : (w.add(j), p--) : (l(k, s), p--);
}
for (; p--; ) {
const C = t[p];
v.has(C.key) || l(C, s);
}
for (; f; )
P(h[f - 1]);
return Jn(b), h;
}
function rl(t, e) {
const n = {}, i = {}, o = { $$scope: 1 };
let r = t.length;
for (; r--; ) {
const s = t[r], a = e[r];
if (a) {
for (const l in s)
l in a || (i[l] = 1);
for (const l in a)
o[l] || (n[l] = a[l], o[l] = 1);
t[r] = a;
} else
for (const l in s)
o[l] = 1;
}
for (const s in i)
s in n || (n[s] = void 0);
return n;
}
function jp(t) {
return typeof t == "object" && t !== null ? t : {};
}
function Qn(t, e, n) {
const i = t.$$.props[e];
i !== void 0 && (t.$$.bound[i] = n, n(t.$$.ctx[i]));
}
function Pe(t) {
t && t.c();
}
function Oe(t, e, n) {
const { fragment: i, after_update: o } = t.$$;
i && i.m(e, n), go(() => {
const r = t.$$.on_mount.map(V1).filter(Ko);
t.$$.on_destroy ? t.$$.on_destroy.push(...r) : Jn(r), t.$$.on_mount = [];
}), o.forEach(go);
}
function Me(t, e) {
const n = t.$$;
n.fragment !== null && (eF(n.after_update), Jn(n.on_destroy), n.fragment && n.fragment.d(e), n.on_destroy = n.fragment = null, n.ctx = []);
}
function rF(t, e) {
t.$$.dirty[0] === -1 && (aa.push(t), X1(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
}
function an(t, e, n, i, o, r, s = null, a = [-1]) {
const l = ol;
Qa(t);
const c = t.$$ = {
fragment: null,
ctx: [],
// state
props: r,
update: mn,
not_equal: o,
bound: $p(),
// lifecycle
on_mount: [],
on_destroy: [],
on_disconnect: [],
before_update: [],
after_update: [],
context: new Map(e.context || (l ? l.$$.context : [])),
// everything else
callbacks: $p(),
dirty: a,
skip_bound: !1,
root: e.target || l.$$.root
};
s && s(c.root);
let d = !1;
if (c.ctx = n ? n(t, e.props || {}, (u, p, ...f) => {
const _ = f.length ? f[0] : p;
return c.ctx && o(c.ctx[u], c.ctx[u] = _) && (!c.skip_bound && c.bound[u] && c.bound[u](_), d && rF(t, u)), p;
}) : [], c.update(), d = !0, Jn(c.before_update), c.fragment = i ? i(c.ctx) : !1, e.target) {
if (e.hydrate) {
const u = UN(e.target);
c.fragment && c.fragment.l(u), u.forEach(N);
} else
c.fragment && c.fragment.c();
e.intro && D(t.$$.fragment), Oe(t, e.target, e.anchor), x1();
}
Qa(l);
}
class ln {
constructor() {
/**
* ### PRIVATE API
*
* Do not use, may change at any time
*
* @type {any}
*/
on(this, "$$");
/**
* ### PRIVATE API
*
* Do not use, may change at any time
*
* @type {any}
*/
on(this, "$$set");
}
/** @returns {void} */
$destroy() {
Me(this, 1), this.$destroy = mn;
}
/**
* @template {Extract<keyof Events, string>} K
* @param {K} type
* @param {((e: Events[K]) => void) | null | undefined} callback
* @returns {() => void}
*/
$on(e, n) {
if (!Ko(n))
return mn;
const i = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
return i.push(n), () => {
const o = i.indexOf(n);
o !== -1 && i.splice(o, 1);
};
}
/**
* @param {Partial<Props>} props
* @returns {void}
*/
$set(e) {
this.$$set && !NN(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
}
}
const sF = "4", ia = [];
function aF(t, e) {
return {
subscribe: zi(t, e).subscribe
};
}
function zi(t, e = mn) {
let n;
const i = /* @__PURE__ */ new Set();
function o(a) {
if (Qt(t, a) && (t = a, n)) {
const l = !ia.length;
for (const c of i)
c[1](), ia.push(c, t);
if (l) {
for (let c = 0; c < ia.length; c += 2)
ia[c][0](ia[c + 1]);
ia.length = 0;
}
}
}
function r(a) {
o(a(t));
}
function s(a, l = mn) {
const c = [a, l];
return i.add(c), i.size === 1 && (n = e(o, r) || mn), a(t), () => {
i.delete(c), i.size === 0 && n && (n(), n = null);
};
}
return { set: o, update: r, subscribe: s };
}
function Xr(t, e, n) {
const i = !Array.isArray(t), o = i ? [t] : t;
if (!o.every(Boolean))
throw new Error("derived() expects stores as input, got a falsy value");
const r = e.length < 2;
return aF(n, (s, a) => {
let l = !1;
const c = [];
let d = 0, u = mn;
const p = () => {
if (d)
return;
u();
const _ = e(i ? c[0] : c, s, a);
r ? s(_) : u = Ko(_) ? _ : mn;
}, f = o.map(
(_, m) => Pu(
_,
(h) => {
c[m] = h, d &= ~(1 << m), l && p();
},
() => {
d |= 1 << m;
}
)
);
return l = !0, p(), function() {
Jn(f), u(), l = !1;
};
});
}
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(sF);
function Sp(t, e, n) {
const i = t.slice();
return i[7] = e[n], i[8] = e, i[9] = n, i;
}
function Cp(t) {
let e, n, i;
function o(...r) {
return (
/*pointerdown_handler*/
t[5](
/*index*/
t[9],
...r
)
);
}
return {
c() {
e = S("div"), g(e, "class", "split-view__splitter svelte-1rid2da");
},
m(r, s) {
F(r, e, s), n || (i = [
ae(e, "pointerdown", Ii(o)),
ae(e, "dblclick", Ii(
/*onDoubleClick*/
t[4]
))
], n = !0);
},
p(r, s) {
t = r;
},
d(r) {
r && N(e), n = !1, Jn(i);
}
};
}
function Ep(t, e) {
let n, i, o, r, s, a = (
/*index*/
e[9]
), l, c = (
/*index*/
e[9] > 0 && Cp(e)
);
const d = [
/*item*/
e[7].props
];
var u = (
/*item*/
e[7].component
);
function p(m, h) {
let v = {};
for (let y = 0; y < d.length; y += 1)
v = Is(v, d[y]);
return h !== void 0 && h & /*components*/
1 && (v = Is(v, rl(d, [jp(
/*item*/
m[7].props
)]))), { props: v };
}
u && (r = ka(u, p(e)));
const f = () => (
/*div_binding*/
e[6](o, a)
), _ = () => (
/*div_binding*/
e[6](null, a)
);
return {
key: t,
first: null,
c() {
n = Fn(), c && c.c(), i = G(), o = S("div"), r && Pe(r.$$.fragment), s = G(), g(o, "class", "split-view__part svelte-1rid2da"), Te(
o,
"--grow",
/*item*/
e[7].weight
), Te(
o,
"min-width",
/*orientation*/
e[1] === "horizontal" ? `${/*item*/
e[7].minSize || da}px` : void 0
), Te(
o,
"min-height",
/*orientation*/
e[1] === "vertical" ? `${/*item*/
e[7].minSize || da}px` : void 0
), this.first = n;
},
m(m, h) {
F(m, n, h), c && c.m(m, h), F(m, i, h), F(m, o, h), r && Oe(r, o, null), $(o, s), f(), l = !0;
},
p(m, h) {
if (e = m, /*index*/
e[9] > 0 ? c ? c.p(e, h) : (c = Cp(e), c.c(), c.m(i.parentNode, i)) : c && (c.d(1), c = null), h & /*components*/
1 && u !== (u = /*item*/
e[7].component)) {
if (r) {
Gt();
const v = r;
R(v.$$.fragment, 1, 0, () => {
Me(v, 1);
}), Xt();
}
u ? (r = ka(u, p(e, h)), Pe(r.$$.fragment), D(r.$$.fragment, 1), Oe(r, o, s)) : r = null;
} else if (u) {
const v = h & /*components*/
1 ? rl(d, [jp(
/*item*/
e[7].props
)]) : {};
r.$set(v);
}
a !== /*index*/
e[9] && (_(), a = /*index*/
e[9], f()), h & /*components*/
1 && Te(
o,
"--grow",
/*item*/
e[7].weight
), h & /*orientation, components*/
3 && Te(
o,
"min-width",
/*orientation*/
e[1] === "horizontal" ? `${/*item*/
e[7].minSize || da}px` : void 0
), h & /*orientation, components*/
3 && Te(
o,
"min-height",
/*orientation*/
e[1] === "vertical" ? `${/*item*/
e[7].minSize || da}px` : void 0
);
},
i(m) {
l || (r && D(r.$$.fragment, m), l = !0);
},
o(m) {
r && R(r.$$.fragment, m), l = !1;
},
d(m) {
m && (N(n), N(i), N(o)), c && c.d(m), r && Me(r), _();
}
};
}
function lF(t) {
let e, n = [], i = /* @__PURE__ */ new Map(), o, r = jn(
/*components*/
t[0]
);
const s = (a) => (
/*item*/
a[7].key || /*index*/
a[9]
);
for (let a = 0; a < r.length; a += 1) {
let l = Sp(t, r, a), c = s(l);
i.set(c, n[a] = Ep(c, l));
}
return {
c() {
e = S("div");
for (let a = 0; a < n.length; a += 1)
n[a].c();
g(e, "class", "split-view svelte-1rid2da"), le(
e,
"split-view_vertical",
/*orientation*/
t[1] === "vertical"
);
},
m(a, l) {
F(a, e, l);
for (let c = 0; c < n.length; c += 1)
n[c] && n[c].m(e, null);
o = !0;
},
p(a, [l]) {
l & /*parts, components, orientation, MIN_SIZE, undefined, onPointerdown, onDoubleClick*/
31 && (r = jn(
/*components*/
a[0]
), Gt(), n = Ys(n, l, s, 1, a, r, i, e, Ma, Ep, null, Sp), Xt()), (!o || l & /*orientation*/
2) && le(
e,
"split-view_vertical",
/*orientation*/
a[1] === "vertical"
);
},
i(a) {
if (!o) {
for (let l = 0; l < r.length; l += 1)
D(n[l]);
o = !0;
}
},
o(a) {
for (let l = 0; l < n.length; l += 1)
R(n[l]);
o = !1;
},
d(a) {
a && N(e);
for (let l = 0; l < n.length; l += 1)
n[l].d();
}
};
}
const da = 300;
function cF(t, e, n) {
let { components: i } = e, { orientation: o = "horizontal" } = e, r = [];
function s(d, u) {
if (d.button !== 0)
return;
const p = o === "horizontal" ? "pageX" : "pageY", f = o === "horizontal" ? "offsetWidth" : "offsetHeight", _ = d[p], m = r.map((w) => w[f]), h = i[u].minSize ?? da, v = i[u + 1].minSize ?? da, y = (w) => {
w.preventDefault();
let E = w[p] - _;
m[u] + E < h && (E = h - m[u]), m[u + 1] - E < v && (E = m[u + 1] - v), r.forEach((P, C) => {
let k;
C === u ? k = m[C] + E : C === u + 1 && (k = m[C] - E), k ? P.style.flexBasis = `${k}px` : P.style.flexBasis = `${m[C]}px`;
});
}, b = () => {
window.removeEventListener("pointermove", y), window.removeEventListener("pointerup", b), window.removeEventListener("pointercancel", b);
};
window.addEventListener("pointermove", y), window.addEventListener("pointerup", b), window.addEventListener("pointercancel", b);
}
function a() {
r.forEach((d) => {
d.style.flexBasis = "";
});
}
const l = (d, u) => s(u, d - 1);
function c(d, u) {
ft[d ? "unshift" : "push"](() => {
r[u] = d, n(2, r);
});
}
return t.$$set = (d) => {
"components" in d && n(0, i = d.components), "orientation" in d && n(1, o = d.orientation);
}, [
i,
o,
r,
s,
a,
l,
c
];
}
class Q1 extends ln {
constructor(e) {
super(), an(this, e, cF, lF, Qt, { components: 0, orientation: 1 });
}
}
const di = Symbol("language");
function Lu(t) {
const e = t - 1;
return e * e * e + 1;
}
function Tp(t, { delay: e = 0, duration: n = 400, easing: i = Mu } = {}) {
const o = +getComputedStyle(t).opacity;
return {
delay: e,
duration: n,
easing: i,
css: (r) => `opacity: ${r * o}`
};
}
function gr(t, { delay: e = 0, duration: n = 400, easing: i = Lu, x: o = 0, y: r = 0, opacity: s = 0 } = {}) {
const a = getComputedStyle(t), l = +a.opacity, c = a.transform === "none" ? "" : a.transform, d = l * (1 - s), [u, p] = kp(o), [f, _] = kp(r);
return {
delay: e,
duration: n,
easing: i,
css: (m, h) => `
transform: ${c} translate(${(1 - m) * u}${p}, ${(1 - m) * f}${_});
opacity: ${l - d * h}`
};
}
function Yo(t, { delay: e = 0, duration: n = 400, easing: i = Lu, axis: o = "y" } = {}) {
const r = getComputedStyle(t), s = +r.opacity, a = o === "y" ? "height" : "width", l = parseFloat(r[a]), c = o === "y" ? ["top", "bottom"] : ["left", "right"], d = c.map(
(v) => `${v[0].toUpperCase()}${v.slice(1)}`
), u = parseFloat(r[`padding${d[0]}`]), p = parseFloat(r[`padding${d[1]}`]), f = parseFloat(r[`margin${d[0]}`]), _ = parseFloat(r[`margin${d[1]}`]), m = parseFloat(
r[`border${d[0]}Width`]
), h = parseFloat(
r[`border${d[1]}Width`]
);
return {
delay: e,
duration: n,
easing: i,
css: (v) => `overflow: hidden;opacity: ${Math.min(v * 20, 1) * s};${a}: ${v * l}px;padding-${c[0]}: ${v * u}px;padding-${c[1]}: ${v * p}px;margin-${c[0]}: ${v * f}px;margin-${c[1]}: ${v * _}px;border-${c[0]}-width: ${v * m}px;border-${c[1]}-width: ${v * h}px;`
};
}
const tu = /* @__PURE__ */ new Set();
function dF(t) {
if (t.defaultPrevented)
return;
const e = [];
for (const { shortcut: n, handler: i, prio: o } of tu)
n.isPressed(t) && e.push({ handler: i, prio: o });
e.sort((n, i) => {
if (n.prio) {
if (!i.prio)
return -1;
} else
return 1;
return i.prio - n.prio;
}), e.length && setTimeout(() => {
});
for (let n = 0; n < e.length; ++n) {
const { handler: i } = e[n];
if (i(t) !== !1) {
t.preventDefault();
break;
}
}
}
function uF(t, e, n) {
const i = { shortcut: t, handler: e, prio: n };
return tu.add(i), {
unbind: () => {
tu.delete(i);
}
};
}
function eb(t, e) {
const n = e.map((i) => uF(i[0], (o) => {
const r = !!t.closest("dialog"), s = !!document.querySelector("dialog");
if (r === s)
i[1](o);
else
return !1;
}, i[2]).unbind);
return {
destroy() {
for (const i of n)
i();
}
};
}
function ja(t) {
return t.charAt(0).toUpperCase() + t.substring(1);
}
const zp = /Mac OS/i.test(navigator.userAgent), xr = {
SHIFT: { val: 4, field: "shiftKey", str: "⇧" },
CTRL: { val: 1, field: "ctrlKey", str: "⌃" },
ALT: { val: 2, field: "altKey", str: "⌥" },
CMD: { val: 8, field: "metaKey", str: "⌘" }
}, hc = {
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
ESC: 27,
SPACE: 32,
HOME: 36,
END: 35,
PAGEUP: 33,
PAGEDOWN: 34,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
DELETE: 46,
A: 65,
B: 66,
C: 67,
D: 68,
E: 69,
F: 70,
G: 71,
H: 72,
I: 73,
J: 74,
K: 75,
L: 76,
M: 77,
N: 78,
O: 79,
P: 80,
S: 83,
T: 84,
U: 85,
V: 86,
X: 88,
Y: 89,
Z: 90,
1: 49,
2: 50,
3: 51,
"/": 191
}, pF = Object.keys(hc).reduce((t, e) => (t[hc[e]] = e, t), {}), us = class us {
constructor(e) {
on(this, "_parts");
on(this, "_strParts");
on(this, "_str");
e.includes(us.MAC_SPLITTER) && (e = e.split(us.MAC_SPLITTER)[zp ? 1 : 0].trim()), this._parts = [], this._strParts = [];
for (const n of e.split(us.SEVERAL_SPLITTER)) {
const i = n.trim();
this._parts.push(this._parse(i)), this._strParts.push(i.split("+"));
}
zp ? this._str = this._genMacStr() : this._str = e;
}
_parse(e) {
const n = e.split("+");
let i = 0, o;
for (const r of n) {
const s = r.toUpperCase();
if (!(s in xr) && !(s in hc))
throw new Error(`Unknown key ${e}`);
s in xr ? i += xr[s].val : o = hc[s];
}
if (!o)
throw new Error(`Incorrect shortcut ${e}`);
return { which: o, modifiers: i };
}
_genMacStr() {
return this._parts.map((e) => {
let n = "";
const i = e.modifiers;
for (const o in xr)
i & xr[o].val && (n += xr[o].str);
return n += ja(pF[e.which].toLowerCase()), n;
}).join(us.SEVERAL_SPLITTER);
}
toString() {
return this._str;
}
isPressed(e) {
for (const n of this._parts) {
if (e.which !== n.which)
continue;
let i = 0;
for (const o in xr)
e[xr[o].field] && (i += xr[o].val);
if (i === n.modifiers)
return !0;
}
return !1;
}
getList() {
return this._strParts;
}
};
on(us, "MAC_SPLITTER", ":"), on(us, "SEVERAL_SPLITTER", " / ");
let $i = us;
const tb = new $i("Esc"), Nu = new $i("Esc"), Fu = new $i("Enter"), fF = new $i("Ctrl+Enter : Cmd+Enter"), Ap = new $i("Up"), _F = new $i("Down"), mF = new $i("Left"), gF = new $i("Right"), hF = new $i("Up"), vF = new $i("Down"), bF = new $i("Left"), yF = new $i("Right"), Op = new $i("Shift+Up"), Mp = new $i("Shift+Down"), Pp = new $i("Shift+Left"), Ip = new $i("Shift+Right"), wF = new $i("Ctrl+Up"), $F = new $i("Ctrl+Down"), kF = new $i("Ctrl+Left"), jF = new $i("Ctrl+Right"), Dp = new $i("Ctrl+Shift+Up"), Vp = new $i("Ctrl+Shift+Down"), Lp = new $i("Ctrl+Shift+Left"), Np = new $i("Ctrl+Shift+Right"), qu = new $i("Delete / Backspace"), nb = new $i("Ctrl+Z : Cmd+Z"), ib = new $i("Ctrl+Y / Ctrl+Shift+Z : Cmd+Y / Cmd+Shift+Z"), ob = new $i("Ctrl+C : Cmd+C"), rb = new $i("Ctrl+V : Cmd+V"), SF = new $i("Up"), CF = new $i("Down"), EF = new $i("Left"), TF = new $i("Right"), zF = new $i("Up"), AF = new $i("Down"), OF = new $i("Left"), MF = new $i("Right"), sb = new $i("Up"), ab = new $i("Down"), PF = new $i("Home"), IF = new $i("End"), DF = new $i("Delete / Backspace"), Pn = Symbol("app");
function uo(t) {
return t.replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29");
}
function Fp(t) {
let e, n = `url(${uo(
/*item*/
t[0].icon
)})`;
return {
c() {
e = S("span"), g(e, "class", "menu-item__icon svelte-1o1lgms"), Te(e, "background-image", n);
},
m(i, o) {
F(i, e, o);
},
p(i, o) {
o & /*item*/
1 && n !== (n = `url(${uo(
/*item*/
i[0].icon
)})`) && Te(e, "background-image", n);
},
d(i) {
i && N(e);
}
};
}
function qp(t) {
let e;
return {
c() {
e = S("span"), g(e, "class", "menu-item__submenu-icon svelte-1o1lgms");
},
m(n, i) {
F(n, e, i);
},
d(n) {
n && N(e);
}
};
}
function VF(t) {
let e, n, i = (
/*item*/
t[0].text + ""
), o, r, s, a, l = (
/*item*/
t[0].icon && Fp(t)
), c = (
/*item*/
t[0].submenu && qp()
);
return {
c() {
e = S("li"), l && l.c(), n = G(), o = tt(i), r = G(), c && c.c(), g(e, "class", "menu-item svelte-1o1lgms"), le(
e,
"menu-item_icon",
/*item*/
t[0].icon
), le(
e,
"menu-item_enabled",
/*item*/
t[0].enabled !== !1
), le(
e,
"menu-item_selected",
/*selected*/
t[1]
);
},
m(d, u) {
F(d, e, u), l && l.m(e, null), $(e, n), $(e, o), $(e, r), c && c.m(e, null), t[5](e), s || (a = [
ae(e, "click", To(Ii(
/*click_handler*/
t[6]
))),
ae(e, "mouseenter", function() {
Ko(
/*item*/
t[0].submenu ? (
/*mouseenter_handler*/
t[7]
) : null
) && /*item*/
(t[0].submenu ? (
/*mouseenter_handler*/
t[7]
) : null).apply(this, arguments);
}),
ae(e, "mouseleave", function() {
Ko(
/*item*/
t[0].submenu ? (
/*mouseleave_handler*/
t[8]
) : null
) && /*item*/
(t[0].submenu ? (
/*mouseleave_handler*/
t[8]
) : null).apply(this, arguments);
})
], s = !0);
},
p(d, [u]) {
t = d, /*item*/
t[0].icon ? l ? l.p(t, u) : (l = Fp(t), l.c(), l.m(e, n)) : l && (l.d(1), l = null), u & /*item*/
1 && i !== (i = /*item*/
t[0].text + "") && ut(o, i), /*item*/
t[0].submenu ? c || (c = qp(), c.c(), c.m(e, null)) : c && (c.d(1), c = null), u & /*item*/
1 && le(
e,
"menu-item_icon",
/*item*/
t[0].icon
), u & /*item*/
1 && le(
e,
"menu-item_enabled",
/*item*/
t[0].enabled !== !1
), u & /*selected*/
2 && le(
e,
"menu-item_selected",
/*selected*/
t[1]
);
},
i: mn,
o: mn,
d(d) {
d && N(e), l && l.d(), c && c.d(), t[5](null), s = !1, Jn(a);
}
};
}
function LF(t, e, n) {
let { item: i } = e, { selected: o = !1 } = e;
const { contextMenu: r } = Ot(Pn);
let s;
const a = hi();
function l(p) {
ft[p ? "unshift" : "push"](() => {
s = p, n(2, s);
});
}
const c = () => {
var p;
i.enabled !== !1 && ((p = i.callback) == null ? void 0 : p.call(i)) !== !1 && r().hide();
}, d = () => {
a("showsubmenu", { elem: s });
}, u = () => {
a("hidesubmenu");
};
return t.$$set = (p) => {
"item" in p && n(0, i = p.item), "selected" in p && n(1, o = p.selected);
}, [
i,
o,
s,
r,
a,
l,
c,
d,
u
];
}
class lb extends ln {
constructor(e) {
super(), an(this, e, LF, VF, Qt, { item: 0, selected: 1 });
}
}
const { window: NF } = kl;
function Rp(t, e, n) {
const i = t.slice();
return i[27] = e[n], i;
}
function Bp(t, e, n) {
const i = t.slice();
return i[27] = e[n], i;
}
function Hp(t) {
var p;
let e, n, i, o, r, s, a, l = jn(
/*currentProps*/
t[1].items
), c = [];
for (let f = 0; f < l.length; f += 1)
c[f] = Jp(Bp(t, l, f));
const d = (f) => R(c[f], 1, 1, () => {
c[f] = null;
});
let u = (
/*submenu*/
((p = t[5]) == null ? void 0 : p.submenu) && Up(t)
);
return {
c() {
e = S("div"), n = S("ul");
for (let f = 0; f < c.length; f += 1)
c[f].c();
o = G(), u && u.c(), g(n, "class", "menu svelte-1306v9l"), Te(
n,
"left",
/*popupStyle*/
t[2].left
), Te(
n,
"top",
/*popupStyle*/
t[2].top
), Te(
n,
"width",
/*popupStyle*/
t[2].width
), Te(
n,
"height",
/*popupStyle*/
t[2].height
), g(e, "class", "menu-controller svelte-1306v9l");
},
m(f, _) {
F(f, e, _), $(e, n);
for (let m = 0; m < c.length; m += 1)
c[m] && c[m].m(n, null);
t[14](n), $(e, o), u && u.m(e, null), t[16](e), r = !0, s || (a = N1(eb.call(
null,
e,
/*SHORTCUTS*/
t[12]
)), s = !0);
},
p(f, _) {
var m;
if (_[0] & /*currentProps, submenu, showSubmenu, hideSubmenu*/
1570) {
l = jn(
/*currentProps*/
f[1].items
);
let h;
for (h = 0; h < l.length; h += 1) {
const v = Bp(f, l, h);
c[h] ? (c[h].p(v, _), D(c[h], 1)) : (c[h] = Jp(v), c[h].c(), D(c[h], 1), c[h].m(n, null));
}
for (Gt(), h = l.length; h < c.length; h += 1)
d(h);
Xt();
}
_[0] & /*popupStyle*/
4 && Te(
n,
"left",
/*popupStyle*/
f[2].left
), _[0] & /*popupStyle*/
4 && Te(
n,
"top",
/*popupStyle*/
f[2].top
), _[0] & /*popupStyle*/
4 && Te(
n,
"width",
/*popupStyle*/
f[2].width
), _[0] & /*popupStyle*/
4 && Te(
n,
"height",
/*popupStyle*/
f[2].height
), /*submenu*/
(m = f[5]) != null && m.submenu ? u ? (u.p(f, _), _[0] & /*submenu*/
32 && D(u, 1)) : (u = Up(f), u.c(), D(u, 1), u.m(e, null)) : u && (Gt(), R(u, 1, 1, () => {
u = null;
}), Xt());
},
i(f) {
if (!r) {
for (let _ = 0; _ < l.length; _ += 1)
D(c[_]);
f && go(() => {
r && (i || (i = oo(n, gr, { y: 10, duration: 150 }, !0)), i.run(1));
}), D(u), r = !0;
}
},
o(f) {
c = c.filter(Boolean);
for (let _ = 0; _ < c.length; _ += 1)
R(c[_]);
f && (i || (i = oo(n, gr, { y: 10, duration: 150 }, !1)), i.run(0)), R(u), r = !1;
},
d(f) {
f && N(e), Gi(c, f), t[14](null), f && i && i.end(), u && u.d(), t[16](null), s = !1, a();
}
};
}
function Jp(t) {
let e, n;
function i(...o) {
return (
/*showsubmenu_handler*/
t[13](
/*item*/
t[27],
...o
)
);
}
return e = new lb({
props: {
item: (
/*item*/
t[27]
),
selected: (
/*item*/
t[27] === /*submenu*/
t[5]
)
}
}), e.$on("showsubmenu", i), e.$on(
"hidesubmenu",
/*hideSubmenu*/
t[10]
), {
c() {
Pe(e.$$.fragment);
},
m(o, r) {
Oe(e, o, r), n = !0;
},
p(o, r) {
t = o;
const s = {};
r[0] & /*currentProps*/
2 && (s.item = /*item*/
t[27]), r[0] & /*currentProps, submenu*/
34 && (s.selected = /*item*/
t[27] === /*submenu*/
t[5]), e.$set(s);
},
i(o) {
n || (D(e.$$.fragment, o), n = !0);
},
o(o) {
R(e.$$.fragment, o), n = !1;
},
d(o) {
Me(e, o);
}
};
}
function Up(t) {
let e, n, i, o, r, s = jn(
/*submenu*/
t[5].submenu
), a = [];
for (let c = 0; c < s.length; c += 1)
a[c] = Wp(Rp(t, s, c));
const l = (c) => R(a[c], 1, 1, () => {
a[c] = null;
});
return {
c() {
e = S("ul");
for (let c = 0; c < a.length; c += 1)
a[c].c();
g(e, "class", "menu menu_submenu svelte-1306v9l"), Te(
e,
"left",
/*submenuStyle*/
t[6].left
), Te(
e,
"top",
/*submenuStyle*/
t[6].top
), Te(
e,
"width",
/*submenuStyle*/
t[6].width
), Te(
e,
"height",
/*submenuStyle*/
t[6].height
);
},
m(c, d) {
F(c, e, d);
for (let u = 0; u < a.length; u += 1)
a[u] && a[u].m(e, null);
t[15](e), i = !0, o || (r = [
ae(
e,
"mouseenter",
/*mouseenterSubmenu*/
t[11]
),
ae(
e,
"mouseleave",
/*hideSubmenu*/
t[10]
)
], o = !0);
},
p(c, d) {
if (d[0] & /*submenu*/
32) {
s = jn(
/*submenu*/
c[5].submenu
);
let u;
for (u = 0; u < s.length; u += 1) {
const p = Rp(c, s, u);
a[u] ? (a[u].p(p, d), D(a[u], 1)) : (a[u] = Wp(p), a[u].c(), D(a[u], 1), a[u].m(e, null));
}
for (Gt(), u = s.length; u < a.length; u += 1)
l(u);
Xt();
}
d[0] & /*submenuStyle*/
64 && Te(
e,
"left",
/*submenuStyle*/
c[6].left
), d[0] & /*submenuStyle*/
64 && Te(
e,
"top",
/*submenuStyle*/
c[6].top
), d[0] & /*submenuStyle*/
64 && Te(
e,
"width",
/*submenuStyle*/
c[6].width
), d[0] & /*submenuStyle*/
64 && Te(
e,
"height",
/*submenuStyle*/
c[6].height
);
},
i(c) {
if (!i) {
for (let d = 0; d < s.length; d += 1)
D(a[d]);
c && go(() => {
i && (n || (n = oo(e, gr, { y: 10, duration: 150 }, !0)), n.run(1));
}), i = !0;
}
},
o(c) {
a = a.filter(Boolean);
for (let d = 0; d < a.length; d += 1)
R(a[d]);
c && (n || (n = oo(e, gr, { y: 10, duration: 150 }, !1)), n.run(0)), i = !1;
},
d(c) {
c && N(e), Gi(a, c), t[15](null), c && n && n.end(), o = !1, Jn(r);
}
};
}
function Wp(t) {
let e, n;
return e = new lb({ props: { item: (
/*item*/
t[27]
) } }), {
c() {
Pe(e.$$.fragment);
},
m(i, o) {
Oe(e, i, o), n = !0;
},
p(i, o) {
const r = {};
o[0] & /*submenu*/
32 && (r.item = /*item*/
i[27]), e.$set(r);
},
i(i) {
n || (D(e.$$.fragment, i), n = !0);
},
o(i) {
R(e.$$.fragment, i), n = !1;
},
d(i) {
Me(e, i);
}
};
}
function FF(t) {
let e, n, i, o, r = (
/*shown*/
t[0] && /*currentProps*/
t[1] && Hp(t)
);
return {
c() {
r && r.c(), e = Fn();
},
m(s, a) {
r && r.m(s, a), F(s, e, a), n = !0, i || (o = ae(
NF,
"click",
/*onWindowClick*/
t[8]
), i = !0);
},
p(s, a) {
/*shown*/
s[0] && /*currentProps*/
s[1] ? r ? (r.p(s, a), a[0] & /*shown, currentProps*/
3 && D(r, 1)) : (r = Hp(s), r.c(), D(r, 1), r.m(e.parentNode, e)) : r && (Gt(), R(r, 1, 1, () => {
r = null;
}), Xt());
},
i(s) {
n || (D(r), n = !0);
},
o(s) {
R(r), n = !1;
},
d(s) {
s && N(e), r && r.d(s), i = !1, o();
}
};
}
function qF(t, e, n) {
const { setContextMenuApi: i } = Ot(Pn);
i({ toggle: v, hide: b });
let o = "", r = null, s, a, l = {}, c, d, u = null, p = {}, f, _, m, h;
function v(H) {
o ? b() : y(H);
}
function y(H) {
H.owner instanceof HTMLElement && (n(0, o = H.name || "<unknown>"), n(1, r = H), s = H.owner.getBoundingClientRect(), a = null, n(2, l = {}), n(6, p = {}));
}
function b() {
n(0, o = ""), n(1, r = null), n(5, u = null), _ = null;
}
function w(H) {
const Z = H.composedPath();
!Z.includes(d) && !(r != null && r.owner && Z.includes(r.owner)) && b();
}
function E(H, Z) {
h = H.getBoundingClientRect(), clearTimeout(f), n(5, u = Z), _ = null;
}
function P() {
clearTimeout(f), f = setTimeout(
() => {
n(5, u = null), _ = null;
},
300
);
}
function C() {
clearTimeout(f);
}
const k = [
[
tb,
() => {
if (o) {
b();
return;
}
return !1;
}
]
];
function I(H, Z, M) {
var ue, Ie;
const U = ((ue = r == null ? void 0 : r.offset) == null ? void 0 : ue.x) ?? -8, q = ((Ie = r == null ? void 0 : r.offset) == null ? void 0 : Ie.y) ?? 8, B = window.scrollY;
let Q = "auto", ke = "auto", x, W, ce = window.innerWidth, ne = window.innerHeight, pe = H.left + U, be = H.right + U, me = H.width;
pe < 0 && (pe = 0, me = be - pe), be > ce && (be = ce, me = be - pe);
let de = Z.width;
de > ce ? (de = ce, Q = de + "px") : de < me && me <= 500 && (de = me, Q = de + "px");
const at = M === "bottom" ? pe : pe + me;
at + de < ce ? x = at : be > de ? x = be - de : pe - (ce - de) < de - be ? x = ce - de : x = 0;
let ve = H.bottom + B + q;
ve > ne + B && (ve = ne + B);
let yt = Z.height;
yt > ne && (yt = ne, ke = ne + "px"), M === "bottom" ? ve + yt < ne + B ? W = ve : H.top + B + q > yt ? W = H.top + B + q - yt : W = 0 : M === "right" ? H.top + yt < ne + B ? W = H.top : ne > yt ? W = ne - yt : W = 0 : W = 0;
const $e = d.getBoundingClientRect();
return x -= $e.left, W -= $e.top, {
top: W + "px",
left: x + "px",
width: Q,
height: ke
};
}
ms(() => {
!a && c && d && (a = c.getBoundingClientRect(), n(2, l = I(s, a, "bottom"))), !_ && m && d && (_ = m.getBoundingClientRect(), n(6, p = I(h, _, "right")));
});
const j = (H, Z) => E(Z.detail.elem, H);
function O(H) {
ft[H ? "unshift" : "push"](() => {
c = H, n(3, c);
});
}
function A(H) {
ft[H ? "unshift" : "push"](() => {
m = H, n(7, m);
});
}
function z(H) {
ft[H ? "unshift" : "push"](() => {
d = H, n(4, d);
});
}
return [
o,
r,
l,
c,
d,
u,
p,
m,
w,
E,
P,
C,
k,
j,
O,
A,
z
];
}
class RF extends ln {
constructor(e) {
super(), an(this, e, qF, FF, Qt, {}, null, [-1, -1]);
}
}
function BF(t, e) {
let n = 0, i, o = !1;
return function() {
const r = Date.now();
return !n || Math.abs(r - n) > e ? (n = r, i = t.apply(this, arguments)) : (o || (o = !0, setTimeout(() => {
o = !1, i = t.apply(this, arguments);
}, e)), i);
};
}
const { window: Cd } = kl;
function Zp(t, e, n) {
const i = t.slice();
return i[32] = e[n], i;
}
function Kp(t) {
let e, n, i = `url(${uo(
/*icon*/
t[14]
)})`;
return {
c() {
e = S("div"), n = S("div"), g(n, "class", "select__icon svelte-13p4itq"), Te(n, "background-image", i), g(e, "class", "select__icon-wrapper svelte-13p4itq");
},
m(o, r) {
F(o, e, r), $(e, n);
},
p(o, r) {
r[0] & /*icon*/
16384 && i !== (i = `url(${uo(
/*icon*/
o[14]
)})`) && Te(n, "background-image", i);
},
d(o) {
o && N(e);
}
};
}
function Yp(t) {
let e, n, i, o, r, s = jn(
/*items*/
t[1]
), a = [];
for (let l