diff --git a/packages/ui/dist/index.js b/packages/ui/dist/index.js index 706c44a493bcf3f55dc03c36ff51292a3cdb3099..772844c4d9e046f3b1a567238d8bc712715760ce 100644 --- a/packages/ui/dist/index.js +++ b/packages/ui/dist/index.js @@ -1,7 +1,7 @@ const Uv = "5"; typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Uv); const dd = 1, fd = 2, hd = 4, Gv = 8, Jv = 16, Qv = 1, ep = 2, gd = 4, tp = 8, np = 16, vd = 1, rp = 2, pd = "[", Ds = "[!", yl = "]", Hr = {}, kt = Symbol(), op = "http://www.w3.org/1999/xhtml", ip = "http://www.w3.org/2000/svg", md = "@attach", ka = !1; -var Is = Array.isArray, sp = Array.prototype.indexOf, wl = Array.from, Gi = Object.keys, Ji = Object.defineProperty, jn = Object.getOwnPropertyDescriptor, yd = Object.getOwnPropertyDescriptors, wd = Object.prototype, ap = Array.prototype, Ms = Object.getPrototypeOf, Tu = Object.isExtensible; +var Is = Array.isArray, sp = Array.prototype.indexOf, wl = Array.from, Gi = Object.keys, Ji = Object.defineProperty, Xn = Object.getOwnPropertyDescriptor, yd = Object.getOwnPropertyDescriptors, wd = Object.prototype, ap = Array.prototype, Ms = Object.getPrototypeOf, Tu = Object.isExtensible; function Eo(t) { return typeof t == "function"; } @@ -20,7 +20,7 @@ function bd() { }); return { promise: n, resolve: t, reject: e }; } -function Lt(t, e, n = !1) { +function Ht(t, e, n = !1) { return t === void 0 ? n ? ( /** @type {() => V} */ e() @@ -39,7 +39,7 @@ function yo(t, e) { if (n.push(r), n.length === e) break; return n; } -const Et = 2, bl = 4, Ls = 8, xd = 1 << 24, ir = 16, sr = 32, xr = 64, Hs = 128, pn = 512, Dt = 1024, Zt = 2048, ar = 4096, jt = 8192, Un = 16384, Vs = 32768, er = 65536, Ou = 1 << 17, xl = 1 << 18, Wr = 1 << 19, _d = 1 << 20, Vr = 32768, Pa = 1 << 21, _l = 1 << 22, gr = 1 << 23, In = Symbol("$state"), Cl = Symbol("legacy props"), up = Symbol(""), Qr = new class extends Error { +const Et = 2, bl = 4, Ls = 8, xd = 1 << 24, ir = 16, sr = 32, xr = 64, Hs = 128, pn = 512, Dt = 1024, Zt = 2048, ar = 4096, Xt = 8192, Un = 16384, Vs = 32768, er = 65536, Ou = 1 << 17, xl = 1 << 18, Wr = 1 << 19, _d = 1 << 20, Vr = 32768, Pa = 1 << 21, _l = 1 << 22, gr = 1 << 23, In = Symbol("$state"), Cl = Symbol("legacy props"), up = Symbol(""), Qr = new class extends Error { name = "StaleReactionError"; message = "The reaction that called `getAbortSignal()` was re-run or destroyed"; }(), cp = 1, zs = 3, lr = 8; @@ -89,38 +89,38 @@ function Cp() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } let Ce = !1; -function Vt(t) { +function zt(t) { Ce = t; } -let Ie; +let Me; function ct(t) { if (t === null) throw oi(), Hr; - return Ie = t; + return Me = t; } function mn() { return ct( /** @type {TemplateNode} */ - /* @__PURE__ */ Gt(Ie) + /* @__PURE__ */ Gt(Me) ); } function W(t) { if (Ce) { - if (/* @__PURE__ */ Gt(Ie) !== null) + if (/* @__PURE__ */ Gt(Me) !== null) throw oi(), Hr; - Ie = t; + Me = t; } } function Se(t = 1) { if (Ce) { - for (var e = t, n = Ie; e--; ) + for (var e = t, n = Me; e--; ) n = /** @type {TemplateNode} */ /* @__PURE__ */ Gt(n); - Ie = n; + Me = n; } } function Qi(t = !0) { - for (var e = 0, n = Ie; ; ) { + for (var e = 0, n = Me; ; ) { if (n.nodeType === lr) { var r = ( /** @type {Comment} */ @@ -313,9 +313,9 @@ function Op() { Pd(); } function Nd(t) { - var e = Fe; + var e = Be; if (e === null) - return Ye.f |= gr, t; + return qe.f |= gr, t; if ((e.f & Vs) === 0) { if ((e.f & Hs) === 0) throw t; @@ -423,7 +423,7 @@ class fn { #s(e, n) { e.f ^= Dt; for (var r = e.first; r !== null; ) { - var o = r.f, i = (o & (sr | xr)) !== 0, s = i && (o & Dt) !== 0, a = s || (o & jt) !== 0 || this.skipped_effects.has(r); + var o = r.f, i = (o & (sr | xr)) !== 0, s = i && (o & Dt) !== 0, a = s || (o & Xt) !== 0 || this.skipped_effects.has(r); if ((r.f & Hs) !== 0 && r.b?.is_pending() && (n = { parent: n, effect: r, @@ -449,7 +449,7 @@ class fn { */ #l(e) { for (const n of e) - ((n.f & Zt) !== 0 ? this.#i : this.#a).push(n), this.#u(n.deps), It(n, Dt); + ((n.f & Zt) !== 0 ? this.#i : this.#a).push(n), this.#u(n.deps), Mt(n, Dt); } /** * @param {Value[] | null} deps @@ -557,9 +557,9 @@ class fn { } revive() { for (const e of this.#i) - It(e, Zt), Rr(e); + Mt(e, Zt), Rr(e); for (const e of this.#a) - It(e, ar), Rr(e); + Mt(e, ar), Rr(e); this.#i = [], this.#a = [], this.flush(); } /** @param {() => void} fn */ @@ -634,17 +634,17 @@ function Au(t) { if (e !== 0) { for (var n = 0; n < e; ) { var r = t[n++]; - if ((r.f & (Un | jt)) === 0 && si(r) && (Kn = /* @__PURE__ */ new Set(), Wo(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null && r.ac === null ? Ud(r) : r.fn = null), Kn?.size > 0)) { + if ((r.f & (Un | Xt)) === 0 && si(r) && (Kn = /* @__PURE__ */ new Set(), Wo(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null && r.ac === null ? Ud(r) : r.fn = null), Kn?.size > 0)) { vr.clear(); for (const o of Kn) { - if ((o.f & (Un | jt)) !== 0) continue; + if ((o.f & (Un | Xt)) !== 0) continue; const i = [o]; let s = o.parent; for (; s !== null; ) Kn.has(s) && (Kn.delete(s), i.push(s)), s = s.parent; for (let a = i.length - 1; a >= 0; a--) { const u = i[a]; - (u.f & (Un | jt)) === 0 && Wo(u); + (u.f & (Un | Xt)) === 0 && Wo(u); } } Kn.clear(); @@ -663,7 +663,7 @@ function Od(t, e, n, r) { e, n, r - ) : (i & (_l | ir)) !== 0 && (i & Zt) === 0 && Ad(o, e, r) && (It(o, Zt), Rr( + ) : (i & (_l | ir)) !== 0 && (i & Zt) === 0 && Ad(o, e, r) && (Mt(o, Zt), Rr( /** @type {Effect} */ o )); @@ -694,7 +694,7 @@ function Rr(t) { for (var e = Fs = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (Na && e === Fe && (n & ir) !== 0 && (n & xl) === 0) + if (Na && e === Be && (n & ir) !== 0 && (n & xl) === 0) return; if ((n & (xr | sr)) !== 0) { if ((n & Dt) === 0) return; @@ -706,7 +706,7 @@ function Rr(t) { function Zr(t) { let e = 0, n = tr(0), r; return () => { - $o() && (c(n), qr(() => (e === 0 && (r = it(() => t(() => Nn(n)))), e += 1, () => { + $o() && (c(n), Yr(() => (e === 0 && (r = it(() => t(() => Nn(n)))), e += 1, () => { _r(() => { e -= 1, e === 0 && (r?.(), r = void 0, Nn(n)); }); @@ -724,7 +724,7 @@ class Mp { /** @type {TemplateNode} */ #t; /** @type {TemplateNode | null} */ - #n = Ce ? Ie : null; + #n = Ce ? Me : null; /** @type {BoundaryProps} */ #r; /** @type {((anchor: Node) => void)} */ @@ -762,8 +762,8 @@ class Mp { */ constructor(e, n, r) { this.#t = e, this.#r = n, this.#o = r, this.parent = /** @type {Effect} */ - Fe.b, this.#e = !!this.#r.pending, this.#i = Cr(() => { - if (Fe.b = this, Ce) { + Be.b, this.#e = !!this.#r.pending, this.#i = Cr(() => { + if (Be.b = this, Ce) { const i = this.#n; mn(), /** @type {Comment} */ i.nodeType === lr && /** @type {Comment} */ @@ -780,7 +780,7 @@ class Mp { return () => { this.#c?.remove(); }; - }, Dp), Ce && (this.#t = Ie); + }, Dp), Ce && (this.#t = Me); } #p() { try { @@ -805,7 +805,7 @@ class Mp { } #m() { var e = this.#t; - return this.#e && (this.#c = Mt(), this.#t.before(this.#c), e = this.#c), e; + return this.#e && (this.#c = Lt(), this.#t.before(this.#c), e = this.#c), e; } /** * Returns `true` if the effect exists inside a boundary whose pending snippet is shown @@ -821,7 +821,7 @@ class Mp { * @param {() => Effect | null} fn */ #v(e) { - var n = Fe, r = Ye, o = nt; + var n = Be, r = qe, o = nt; rn(this.#i), $t(this.#i), io(this.#i.ctx); try { return e(); @@ -890,7 +890,7 @@ class Mp { this.#l = null; }), this.#e = this.has_pending_snippet(), this.#a = this.#v(() => (this.#g = !1, Bt(() => this.#o(this.#t)))), this.#f > 0 ? this.#b() : this.#e = !1; }; - var a = Ye; + var a = qe; try { $t(null), i = !0, n?.(e, s), i = !1; } catch (u) { @@ -957,7 +957,7 @@ function Ct(t, e, n, r, o, i = null) { s = Ce ? ct( /** @type {Comment | Text} */ /* @__PURE__ */ pt(h) - ) : h.appendChild(Mt()); + ) : h.appendChild(Lt()); } Ce && mn(); var p = null, m = /* @__PURE__ */ El(() => { @@ -976,21 +976,21 @@ function Ct(t, e, n, r, o, i = null) { let _ = !1; if (Ce) { var T = Cd(s) === Ds; - T !== (x === 0) && (s = Qi(), ct(s), Vt(!1), _ = !0); + T !== (x === 0) && (s = Qi(), ct(s), zt(!1), _ = !0); } - for (var I = /* @__PURE__ */ new Set(), B = ( + for (var I = /* @__PURE__ */ new Set(), F = ( /** @type {Batch} */ Qe ), $ = null, H = Bd(), N = 0; N < x; N += 1) { - Ce && Ie.nodeType === lr && /** @type {Comment} */ - Ie.data === yl && (s = /** @type {Comment} */ - Ie, _ = !0, Vt(!1)); + Ce && Me.nodeType === lr && /** @type {Comment} */ + Me.data === yl && (s = /** @type {Comment} */ + Me, _ = !0, zt(!1)); var k = y[N], D = r(k, N), P = w ? null : a.get(D); P ? (d && lo(P.v, k), f ? lo( /** @type {Value} */ P.i, N - ) : P.i = N, H && B.skipped_effects.delete(P.e)) : (P = Vp( + ) : P.i = N, H && F.skipped_effects.delete(P.e)) : (P = Vp( w ? s : null, $, k, @@ -1008,7 +1008,7 @@ function Ct(t, e, n, r, o, i = null) { effect: Bt(() => i(s)) }; else { - var A = document.createDocumentFragment(), R = Mt(); + var A = document.createDocumentFragment(), R = Lt(); A.append(R), p = { fragment: A, effect: Bt(() => i(R)) @@ -1017,14 +1017,14 @@ function Ct(t, e, n, r, o, i = null) { if (Ce && x > 0 && ct(Qi()), !w) if (H) { for (const [M, Y] of a) - I.has(M) || B.skipped_effects.add(Y.e); - B.oncommit(b), B.ondiscard(() => { + I.has(M) || F.skipped_effects.add(Y.e); + F.oncommit(b), F.ondiscard(() => { }); } else b(); - _ && Vt(!0), c(m); + _ && zt(!0), c(m); }), E = { effect: S, items: a, first: u }; - w = !1, Ce && (s = Ie); + w = !1, Ce && (s = Me); } function Hp(t, e, n, r, o) { var i = (r & Gv) !== 0, s = e.length, a = t.items, u = t.first, l, d = null, f, h = [], p = [], m, y, w, b; @@ -1040,7 +1040,7 @@ function Hp(t, e, n, r, o) { un(t, d, w), un(t, w, S), aa(w, S, n), d = w, h = [], p = [], u = d.next; continue; } - if ((w.e.f & jt) !== 0 && (Ol(w.e), i && (w.a?.unfix(), (f ??= /* @__PURE__ */ new Set()).delete(w))), w !== u) { + if ((w.e.f & Xt) !== 0 && (Ol(w.e), i && (w.a?.unfix(), (f ??= /* @__PURE__ */ new Set()).delete(w))), w !== u) { if (l !== void 0 && l.has(w)) { if (h.length < p.length) { var E = p[0], x; @@ -1056,7 +1056,7 @@ function Hp(t, e, n, r, o) { continue; } for (h = [], p = []; u !== null && u.k !== y; ) - (u.e.f & jt) === 0 && (l ??= /* @__PURE__ */ new Set()).add(u), p.push(u), u = u.next; + (u.e.f & Xt) === 0 && (l ??= /* @__PURE__ */ new Set()).add(u), p.push(u), u = u.next; if (u === null) continue; w = u; @@ -1065,18 +1065,18 @@ function Hp(t, e, n, r, o) { } let I = a.size > s; if (u !== null || l !== void 0) { - for (var B = l === void 0 ? [] : wl(l); u !== null; ) - (u.e.f & jt) === 0 && B.push(u), u = u.next; - var $ = B.length; + for (var F = l === void 0 ? [] : wl(l); u !== null; ) + (u.e.f & Xt) === 0 && F.push(u), u = u.next; + var $ = F.length; if (I = a.size - $ > s, $ > 0) { var H = (r & hd) !== 0 && s === 0 ? n : null; if (i) { for (b = 0; b < $; b += 1) - B[b].a?.measure(); + F[b].a?.measure(); for (b = 0; b < $; b += 1) - B[b].a?.fix(); + F[b].a?.fix(); } - Lp(t, B, H); + Lp(t, F, H); } } if (I) @@ -1103,7 +1103,7 @@ function Vp(t, e, n, r, o, i, s, a) { try { if (t === null) { var p = document.createDocumentFragment(); - p.append(t = Mt()); + p.append(t = Lt()); } return h.e = Bt(() => i( /** @type {Node} */ @@ -1144,7 +1144,7 @@ function Dd(t, e, n, r) { } var i = Qe, s = ( /** @type {Effect} */ - Fe + Be ), a = zp(); function u() { Promise.all(n.map((l) => /* @__PURE__ */ Rp(l))).then((l) => { @@ -1169,7 +1169,7 @@ function Dd(t, e, n, r) { }) : u(); } function zp() { - var t = Fe, e = Ye, n = nt, r = Qe; + var t = Be, e = qe, n = nt, r = Qe; return function(i = !0) { rn(t), $t(e), io(n), i && r?.activate(); }; @@ -1179,11 +1179,11 @@ function es() { } // @__NO_SIDE_EFFECTS__ function ii(t) { - var e = Et | Zt, n = Ye !== null && (Ye.f & Et) !== 0 ? ( + var e = Et | Zt, n = qe !== null && (qe.f & Et) !== 0 ? ( /** @type {Derived} */ - Ye + qe ) : null; - return Fe !== null && (Fe.f |= Wr), { + return Be !== null && (Be.f |= Wr), { ctx: nt, deps: null, effects: null, @@ -1197,7 +1197,7 @@ function ii(t) { kt ), wv: 0, - parent: n ?? Fe, + parent: n ?? Be, ac: null }; } @@ -1205,7 +1205,7 @@ function ii(t) { function Rp(t, e) { let n = ( /** @type {Effect | null} */ - Fe + Be ); n === null && dp(); var r = ( @@ -1218,8 +1218,8 @@ function Rp(t, e) { ), i = tr( /** @type {V} */ kt - ), s = !Ye, a = /* @__PURE__ */ new Map(); - return qp(() => { + ), s = !qe, a = /* @__PURE__ */ new Map(); + return Yp(() => { var u = bd(); o = u.promise; try { @@ -1296,7 +1296,7 @@ function Fp(t) { return null; } function Pl(t) { - var e, n = Fe; + var e, n = Be; rn(Fp(t)); try { t.f &= ~Vr, Id(t), e = of(t); @@ -1307,12 +1307,12 @@ function Pl(t) { } function Md(t) { var e = Pl(t); - if (t.equals(e) || (Qe?.is_fork || (t.v = e), t.wv = nf()), !Xr) + if (t.equals(e) || (Qe?.is_fork || (t.v = e), t.wv = nf()), !jr) if (tn !== null) ($o() || Qe?.is_fork) && tn.set(t, e); else { var n = (t.f & pn) === 0 ? ar : Dt; - It(t, n); + Mt(t, n); } } let Ta = /* @__PURE__ */ new Set(); @@ -1331,7 +1331,7 @@ function tr(t, e) { return n; } // @__NO_SIDE_EFFECTS__ -function ye(t, e) { +function me(t, e) { const n = tr(t); return ef(n), n; } @@ -1341,21 +1341,21 @@ function Hd(t, e = !1, n = !0) { return e || (r.equals = Ed), wo && n && nt !== null && nt.l !== null && (nt.l.s ??= []).push(r), r; } function K(t, e, n = !1) { - Ye !== null && // since we are untracking the function inside `$inspect.with` we need to add this check + qe !== null && // since we are untracking the function inside `$inspect.with` we need to add this check // to ensure we error if state is set inside an inspect effect - (!On || (Ye.f & Ou) !== 0) && bo() && (Ye.f & (Et | ir | _l | Ou)) !== 0 && !Gn?.includes(t) && bp(); + (!On || (qe.f & Ou) !== 0) && bo() && (qe.f & (Et | ir | _l | Ou)) !== 0 && !Gn?.includes(t) && bp(); let r = n ? ht(e) : e; return lo(t, r); } function lo(t, e) { if (!t.equals(e)) { var n = t.v; - Xr ? vr.set(t, e) : vr.set(t, n), t.v = e; + jr ? vr.set(t, e) : vr.set(t, n), t.v = e; var r = fn.ensure(); r.capture(t, n), (t.f & Et) !== 0 && ((t.f & Zt) !== 0 && Pl( /** @type {Derived} */ t - ), It(t, (t.f & pn) !== 0 ? Dt : ar)), t.wv = nf(), Vd(t, Zt), bo() && Fe !== null && (Fe.f & Dt) !== 0 && (Fe.f & (sr | xr)) === 0 && (Qt === null ? jp([t]) : Qt.push(t)), !r.is_fork && Ta.size > 0 && !Ld && Bp(); + ), Mt(t, (t.f & pn) !== 0 ? Dt : ar)), t.wv = nf(), Vd(t, Zt), bo() && Be !== null && (Be.f & Dt) !== 0 && (Be.f & (sr | xr)) === 0 && (Qt === null ? Xp([t]) : Qt.push(t)), !r.is_fork && Ta.size > 0 && !Ld && Bp(); } return e; } @@ -1366,7 +1366,7 @@ function Bp() { const e = Array.from(Ta); try { for (const n of e) - (n.f & Dt) !== 0 && It(n, ar), si(n) && Wo(n); + (n.f & Dt) !== 0 && Mt(n, ar), si(n) && Wo(n); } finally { ts(t); } @@ -1384,9 +1384,9 @@ function Vd(t, e) { if (n !== null) for (var r = bo(), o = n.length, i = 0; i < o; i++) { var s = n[i], a = s.f; - if (!(!r && s === Fe)) { + if (!(!r && s === Be)) { var u = (a & Zt) === 0; - if (u && It(s, e), (a & Et) !== 0) { + if (u && Mt(s, e), (a & Et) !== 0) { var l = ( /** @type {Derived} */ s @@ -1408,15 +1408,15 @@ function ht(t) { const e = Ms(t); if (e !== wd && e !== ap) return t; - var n = /* @__PURE__ */ new Map(), r = Is(t), o = /* @__PURE__ */ ye(0), i = Jn, s = (a) => { + var n = /* @__PURE__ */ new Map(), r = Is(t), o = /* @__PURE__ */ me(0), i = Jn, s = (a) => { if (Jn === i) return a(); - var u = Ye, l = Jn; + var u = qe, l = Jn; $t(null), Hu(i); var d = a(); return $t(u), Hu(l), d; }; - return r && n.set("length", /* @__PURE__ */ ye( + return r && n.set("length", /* @__PURE__ */ me( /** @type {any[]} */ t.length )), new Proxy( @@ -1427,7 +1427,7 @@ function ht(t) { (!("value" in l) || l.configurable === !1 || l.enumerable === !1 || l.writable === !1) && yp(); var d = n.get(u); return d === void 0 ? d = s(() => { - var f = /* @__PURE__ */ ye(l.value); + var f = /* @__PURE__ */ me(l.value); return n.set(u, f), f; }) : K(d, l.value, !0), !0; }, @@ -1435,7 +1435,7 @@ function ht(t) { var l = n.get(u); if (l === void 0) { if (u in a) { - const d = s(() => /* @__PURE__ */ ye(kt)); + const d = s(() => /* @__PURE__ */ me(kt)); n.set(u, d), Nn(o); } } else @@ -1446,8 +1446,8 @@ function ht(t) { if (u === In) return t; var d = n.get(u), f = u in a; - if (d === void 0 && (!f || jn(a, u)?.writable) && (d = s(() => { - var p = ht(f ? a[u] : kt), m = /* @__PURE__ */ ye(p); + if (d === void 0 && (!f || Xn(a, u)?.writable) && (d = s(() => { + var p = ht(f ? a[u] : kt), m = /* @__PURE__ */ me(p); return m; }), n.set(u, d)), d !== void 0) { var h = c(d); @@ -1476,9 +1476,9 @@ function ht(t) { if (u === In) return !0; var l = n.get(u), d = l !== void 0 && l.v !== kt || Reflect.has(a, u); - if (l !== void 0 || Fe !== null && (!d || jn(a, u)?.writable)) { + if (l !== void 0 || Be !== null && (!d || Xn(a, u)?.writable)) { l === void 0 && (l = s(() => { - var h = d ? ht(a[u]) : kt, p = /* @__PURE__ */ ye(h); + var h = d ? ht(a[u]) : kt, p = /* @__PURE__ */ me(h); return p; }), n.set(u, l)); var f = c(l); @@ -1493,10 +1493,10 @@ function ht(t) { for (var p = l; p < /** @type {Source} */ f.v; p += 1) { var m = n.get(p + ""); - m !== void 0 ? K(m, kt) : p in a && (m = s(() => /* @__PURE__ */ ye(kt)), n.set(p + "", m)); + m !== void 0 ? K(m, kt) : p in a && (m = s(() => /* @__PURE__ */ me(kt)), n.set(p + "", m)); } if (f === void 0) - (!h || jn(a, u)?.writable) && (f = s(() => /* @__PURE__ */ ye(void 0)), K(f, ht(l)), n.set(u, f)); + (!h || Xn(a, u)?.writable) && (f = s(() => /* @__PURE__ */ me(void 0)), K(f, ht(l)), n.set(u, f)); else { h = f.v !== kt; var y = s(() => ht(l)); @@ -1547,10 +1547,10 @@ function Oa() { if (Rt === void 0) { Rt = window, zd = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype, n = Text.prototype; - Rd = jn(e, "firstChild").get, Fd = jn(e, "nextSibling").get, Tu(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Tu(n) && (n.__t = void 0); + Rd = Xn(e, "firstChild").get, Fd = Xn(e, "nextSibling").get, Tu(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Tu(n) && (n.__t = void 0); } } -function Mt(t = "") { +function Lt(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ @@ -1566,12 +1566,12 @@ function Z(t, e) { return /* @__PURE__ */ pt(t); var n = ( /** @type {TemplateNode} */ - /* @__PURE__ */ pt(Ie) + /* @__PURE__ */ pt(Me) ); if (n === null) - n = Ie.appendChild(Mt()); + n = Me.appendChild(Lt()); else if (e && n.nodeType !== zs) { - var r = Mt(); + var r = Lt(); return n?.before(r), ct(r), r; } return ct(n), n; @@ -1587,21 +1587,21 @@ function J(t, e = !1) { ); return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Gt(n) : n; } - if (e && Ie?.nodeType !== zs) { - var r = Mt(); - return Ie?.before(r), ct(r), r; + if (e && Me?.nodeType !== zs) { + var r = Lt(); + return Me?.before(r), ct(r), r; } - return Ie; + return Me; } -function z(t, e = 1, n = !1) { - let r = Ce ? Ie : t; +function V(t, e = 1, n = !1) { + let r = Ce ? Me : t; for (var o; e--; ) o = r, r = /** @type {TemplateNode} */ /* @__PURE__ */ Gt(r); if (!Ce) return r; if (n && r?.nodeType !== zs) { - var i = Mt(); + var i = Lt(); return r === null ? o?.after(i) : r.before(i), ct(i), i; } return ct(r), /** @type {TemplateNode} */ @@ -1644,7 +1644,7 @@ function $d() { )); } function Bs(t) { - var e = Ye, n = Fe; + var e = qe, n = Be; $t(null), rn(null); try { return t(); @@ -1660,15 +1660,15 @@ function Kd(t, e, n, r = n) { } : t.__on_r = () => r(!0), $d(); } function Wd(t) { - Fe === null && (Ye === null && gp(), hp()), Xr && fp(); + Be === null && (qe === null && gp(), hp()), jr && fp(); } function Zp(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } function on(t, e, n) { - var r = Fe; - r !== null && (r.f & jt) !== 0 && (t |= jt); + var r = Be; + r !== null && (r.f & Xt) !== 0 && (t |= Xt); var o = { ctx: nt, deps: null, @@ -1696,28 +1696,28 @@ function on(t, e, n) { else e !== null && Rr(o); var i = o; if (n && i.deps === null && i.teardown === null && i.nodes_start === null && i.first === i.last && // either `null`, or a singular child - (i.f & Wr) === 0 && (i = i.first, (t & ir) !== 0 && (t & er) !== 0 && i !== null && (i.f |= er)), i !== null && (i.parent = r, r !== null && Zp(i, r), Ye !== null && (Ye.f & Et) !== 0 && (t & xr) === 0)) { + (i.f & Wr) === 0 && (i = i.first, (t & ir) !== 0 && (t & er) !== 0 && i !== null && (i.f |= er)), i !== null && (i.parent = r, r !== null && Zp(i, r), qe !== null && (qe.f & Et) !== 0 && (t & xr) === 0)) { var s = ( /** @type {Derived} */ - Ye + qe ); (s.effects ??= []).push(i); } return o; } function $o() { - return Ye !== null && !On; + return qe !== null && !On; } function $s(t) { const e = on(Ls, null, !1); - return It(e, Dt), e.teardown = t, e; + return Mt(e, Dt), e.teardown = t, e; } function He(t) { Wd(); var e = ( /** @type {Effect} */ - Fe.f - ), n = !Ye && (e & sr) !== 0 && (e & Vs) === 0; + Be.f + ), n = !qe && (e & sr) !== 0 && (e & Vs) === 0; if (n) { var r = ( /** @type {ComponentContext} */ @@ -1733,14 +1733,14 @@ function Zd(t) { function Ft(t) { return Wd(), on(Ls | _d, t, !0); } -function Yr(t) { +function qr(t) { fn.ensure(); const e = on(xr | Wr, t, !0); return () => { St(e); }; } -function Yp(t) { +function qp(t) { fn.ensure(); const e = on(xr | Wr, t, !0); return (n = {}) => new Promise((r) => { @@ -1752,13 +1752,13 @@ function Yp(t) { function xo(t) { return on(bl, t, !1); } -function qp(t) { +function Yp(t) { return on(_l | Wr, t, !0); } -function qr(t, e = 0) { +function Yr(t, e = 0) { return on(Ls | e, t, !0); } -function Te(t, e = [], n = [], r = []) { +function Oe(t, e = [], n = [], r = []) { Dd(r, e, n, (o) => { on(Ls, () => t(...o.map(c)), !0); }); @@ -1767,17 +1767,17 @@ function Cr(t, e = 0) { var n = on(ir | e, t, !0); return n; } -function Yd(t, e = 0) { +function qd(t, e = 0) { var n = on(xd | e, t, !0); return n; } function Bt(t) { return on(sr | Wr, t, !0); } -function qd(t) { +function Yd(t) { var e = t.teardown; if (e !== null) { - const n = Xr, r = Ye; + const n = jr, r = qe; Lu(!0), $t(null); try { e.call(null); @@ -1786,7 +1786,7 @@ function qd(t) { } } } -function Xd(t, e = !1) { +function jd(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { const o = n.ac; @@ -1797,7 +1797,7 @@ function Xd(t, e = !1) { (n.f & xr) !== 0 ? n.parent = null : St(n, e), n = r; } } -function Xp(t) { +function jp(t) { for (var e = t.first; e !== null; ) { var n = e.next; (e.f & sr) === 0 && St(e), e = n; @@ -1805,20 +1805,20 @@ function Xp(t) { } function St(t, e = !0) { var n = !1; - (e || (t.f & xl) !== 0) && t.nodes_start !== null && t.nodes_end !== null && (jd( + (e || (t.f & xl) !== 0) && t.nodes_start !== null && t.nodes_end !== null && (Xd( t.nodes_start, /** @type {TemplateNode} */ t.nodes_end - ), n = !0), Xd(t, e && !n), ns(t, 0), It(t, Un); + ), n = !0), jd(t, e && !n), ns(t, 0), Mt(t, Un); var r = t.transitions; if (r !== null) for (const i of r) i.stop(); - qd(t); + Yd(t); var o = t.parent; o !== null && o.first !== null && Ud(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = t.ac = null; } -function jd(t, e) { +function Xd(t, e) { for (; t !== null; ) { var n = t === e ? null : ( /** @type {TemplateNode} */ @@ -1847,8 +1847,8 @@ function Gd(t, e) { e(); } function Tl(t, e, n) { - if ((t.f & jt) === 0) { - if (t.f ^= jt, t.transitions !== null) + if ((t.f & Xt) === 0) { + if (t.f ^= Xt, t.transitions !== null) for (const s of t.transitions) (s.is_global || n) && e.push(s); for (var r = t.first; r !== null; ) { @@ -1864,8 +1864,8 @@ function Ol(t) { Jd(t, !0); } function Jd(t, e) { - if ((t.f & jt) !== 0) { - t.f ^= jt, (t.f & Dt) === 0 && (It(t, Zt), Rr(t)); + if ((t.f & Xt) !== 0) { + t.f ^= Xt, (t.f & Dt) === 0 && (Mt(t, Zt), Rr(t)); for (var n = t.first; n !== null; ) { var r = n.next, o = (n.f & er) !== 0 || (n.f & sr) !== 0; Jd(n, o ? e : !1), n = r; @@ -1888,24 +1888,24 @@ let pr = !1; function ts(t) { pr = t; } -let Xr = !1; +let jr = !1; function Lu(t) { - Xr = t; + jr = t; } -let Ye = null, On = !1; +let qe = null, On = !1; function $t(t) { - Ye = t; + qe = t; } -let Fe = null; +let Be = null; function rn(t) { - Fe = t; + Be = t; } let Gn = null; function ef(t) { - Ye !== null && (Gn === null ? Gn = [t] : Gn.push(t)); + qe !== null && (Gn === null ? Gn = [t] : Gn.push(t)); } -let Ht = null, qt = 0, Qt = null; -function jp(t) { +let Vt = null, Yt = 0, Qt = null; +function Xp(t) { Qt = t; } let tf = 1, Ko = 0, Jn = Ko; @@ -1935,7 +1935,7 @@ function si(t) { } (e & pn) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - tn === null && It(t, Dt); + tn === null && Mt(t, Dt); } return !1; } @@ -1949,16 +1949,16 @@ function rf(t, e, n = !0) { i, e, !1 - ) : e === i && (n ? It(i, Zt) : (i.f & Dt) !== 0 && It(i, ar), Rr( + ) : e === i && (n ? Mt(i, Zt) : (i.f & Dt) !== 0 && Mt(i, ar), Rr( /** @type {Effect} */ i )); } } function of(t) { - var e = Ht, n = qt, r = Qt, o = Ye, i = Gn, s = nt, a = On, u = Jn, l = t.f; - Ht = /** @type {null | Value[]} */ - null, qt = 0, Qt = null, Ye = (l & (sr | xr)) === 0 ? t : null, Gn = null, io(t.ctx), On = !1, Jn = ++Ko, t.ac !== null && (Bs(() => { + var e = Vt, n = Yt, r = Qt, o = qe, i = Gn, s = nt, a = On, u = Jn, l = t.f; + Vt = /** @type {null | Value[]} */ + null, Yt = 0, Qt = null, qe = (l & (sr | xr)) === 0 ? t : null, Gn = null, io(t.ctx), On = !1, Jn = ++Ko, t.ac !== null && (Bs(() => { t.ac.abort(Qr); }), t.ac = null); try { @@ -1967,17 +1967,17 @@ function of(t) { /** @type {Function} */ t.fn ), f = d(), h = t.deps; - if (Ht !== null) { + if (Vt !== null) { var p; - if (ns(t, qt), h !== null && qt > 0) - for (h.length = qt + Ht.length, p = 0; p < Ht.length; p++) - h[qt + p] = Ht[p]; + if (ns(t, Yt), h !== null && Yt > 0) + for (h.length = Yt + Vt.length, p = 0; p < Vt.length; p++) + h[Yt + p] = Vt[p]; else - t.deps = h = Ht; + t.deps = h = Vt; if (pr && $o() && (t.f & pn) !== 0) - for (p = qt; p < h.length; p++) + for (p = Yt; p < h.length; p++) (h[p].reactions ??= []).push(t); - } else h !== null && qt < h.length && (ns(t, qt), h.length = qt); + } else h !== null && Yt < h.length && (ns(t, Yt), h.length = Yt); if (bo() && Qt !== null && !On && h !== null && (t.f & (Et | ar | Zt)) === 0) for (p = 0; p < /** @type {Source[]} */ Qt.length; p++) @@ -1991,7 +1991,7 @@ function of(t) { } catch (m) { return Nd(m); } finally { - t.f ^= Pa, Ht = e, qt = n, Qt = r, Ye = o, Gn = i, io(s), On = a, Jn = u; + t.f ^= Pa, Vt = e, Yt = n, Qt = r, qe = o, Gn = i, io(s), On = a, Jn = u; } } function Up(t, e) { @@ -2006,7 +2006,7 @@ function Up(t, e) { n === null && (e.f & Et) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` // allows us to skip the expensive work of disconnecting and immediately reconnecting it - (Ht === null || !Ht.includes(e)) && (It(e, ar), (e.f & pn) !== 0 && (e.f ^= pn, e.f &= ~Vr), Id( + (Vt === null || !Vt.includes(e)) && (Mt(e, ar), (e.f & pn) !== 0 && (e.f ^= pn, e.f &= ~Vr), Id( /** @type {Derived} **/ e ), ns( @@ -2024,17 +2024,17 @@ function ns(t, e) { function Wo(t) { var e = t.f; if ((e & Un) === 0) { - It(t, Dt); - var n = Fe, r = pr; - Fe = t, pr = !0; + Mt(t, Dt); + var n = Be, r = pr; + Be = t, pr = !0; try { - (e & (ir | xd)) !== 0 ? Xp(t) : Xd(t), qd(t); + (e & (ir | xd)) !== 0 ? jp(t) : jd(t), Yd(t); var o = of(t); t.teardown = typeof o == "function" ? o : null, t.wv = tf; var i; ka && Sp && (t.f & Zt) !== 0 && t.deps; } finally { - pr = r, Fe = n; + pr = r, Be = n; } } } @@ -2043,20 +2043,20 @@ async function sf() { } function c(t) { var e = t.f, n = (e & Et) !== 0; - if (Ye !== null && !On) { - var r = Fe !== null && (Fe.f & Un) !== 0; + if (qe !== null && !On) { + var r = Be !== null && (Be.f & Un) !== 0; if (!r && !Gn?.includes(t)) { - var o = Ye.deps; - if ((Ye.f & Pa) !== 0) - t.rv < Ko && (t.rv = Ko, Ht === null && o !== null && o[qt] === t ? qt++ : Ht === null ? Ht = [t] : Ht.includes(t) || Ht.push(t)); + var o = qe.deps; + if ((qe.f & Pa) !== 0) + t.rv < Ko && (t.rv = Ko, Vt === null && o !== null && o[Yt] === t ? Yt++ : Vt === null ? Vt = [t] : Vt.includes(t) || Vt.push(t)); else { - (Ye.deps ??= []).push(t); + (qe.deps ??= []).push(t); var i = t.reactions; - i === null ? t.reactions = [Ye] : i.includes(Ye) || i.push(Ye); + i === null ? t.reactions = [qe] : i.includes(qe) || i.push(qe); } } } - if (Xr) { + if (jr) { if (vr.has(t)) return vr.get(t); if (n) { @@ -2104,7 +2104,7 @@ function it(t) { } } const Gp = -7169; -function It(t, e) { +function Mt(t, e) { t.f = t.f & Gp | e; } function Jp(t, e) { @@ -2211,7 +2211,7 @@ function Do(t) { return i || n; } }); - var d = Ye, f = Fe; + var d = qe, f = Be; $t(null), rn(null); try { for (var h, p = []; i !== null; ) { @@ -2249,16 +2249,16 @@ function Il(t) { function Wt(t, e) { var n = ( /** @type {Effect} */ - Fe + Be ); n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e); } // @__NO_SIDE_EFFECTS__ -function ne(t, e) { +function re(t, e) { var n = (e & vd) !== 0, r = (e & rp) !== 0, o, i = !t.startsWith(""); return () => { if (Ce) - return Wt(Ie, null), Ie; + return Wt(Me, null), Me; o === void 0 && (o = Il(i ? t : "" + t), n || (o = /** @type {Node} */ /* @__PURE__ */ pt(o))); var s = ( @@ -2284,7 +2284,7 @@ function Qp(t, e, n = "svg") { var r = !t.startsWith(""), o = (e & vd) !== 0, i = `<${n}>${r ? t : "" + t}`, s; return () => { if (Ce) - return Wt(Ie, null), Ie; + return Wt(Me, null), Me; if (!s) { var a = ( /** @type {DocumentFragment} */ @@ -2322,30 +2322,30 @@ function Qp(t, e, n = "svg") { }; } // @__NO_SIDE_EFFECTS__ -function _e(t, e) { +function xe(t, e) { return /* @__PURE__ */ Qp(t, e, "svg"); } -function Me(t = "") { +function Ie(t = "") { if (!Ce) { - var e = Mt(t + ""); + var e = Lt(t + ""); return Wt(e, e), e; } - var n = Ie; - return n.nodeType !== zs && (n.before(n = Mt()), ct(n)), Wt(n, n), n; + var n = Me; + return n.nodeType !== zs && (n.before(n = Lt()), ct(n)), Wt(n, n), n; } function de() { if (Ce) - return Wt(Ie, null), Ie; - var t = document.createDocumentFragment(), e = document.createComment(""), n = Mt(); + return Wt(Me, null), Me; + var t = document.createDocumentFragment(), e = document.createComment(""), n = Lt(); return t.append(e, n), Wt(e, n), t; } function O(t, e) { if (Ce) { var n = ( /** @type {Effect} */ - Fe + Be ); - ((n.f & Vs) === 0 || n.nodes_end === null) && (n.nodes_end = Ie), mn(); + ((n.f & Vs) === 0 || n.nodes_end === null) && (n.nodes_end = Me), mn(); return; } t !== null && t.before( @@ -2354,8 +2354,8 @@ function O(t, e) { ); } function ai() { - if (Ce && Ie && Ie.nodeType === lr && Ie.textContent?.startsWith("$")) { - const t = Ie.textContent.substring(1); + if (Ce && Me && Me.nodeType === lr && Me.textContent?.startsWith("$")) { + const t = Me.textContent.substring(1); return mn(), t; } return (window.__svelte ??= {}).uid ??= 1, `c${window.__svelte.uid++}`; @@ -2432,7 +2432,7 @@ function Ml(t, e) { } function u1(t, e) { Oa(), e.intro = e.intro ?? !1; - const n = e.target, r = Ce, o = Ie; + const n = e.target, r = Ce, o = Me; try { for (var i = ( /** @type {TemplateNode} */ @@ -2443,20 +2443,20 @@ function u1(t, e) { /* @__PURE__ */ Gt(i); if (!i) throw Hr; - Vt(!0), ct( + zt(!0), ct( /** @type {Comment} */ i ); const s = cf(t, { ...e, anchor: i }); - return Vt(!1), /** @type {Exports} */ + return zt(!1), /** @type {Exports} */ s; } catch (s) { if (s instanceof Error && s.message.split(` `).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s; - return s !== Hr && console.warn("Failed to hydrate: ", s), e.recover === !1 && pp(), Oa(), Nl(n), Vt(!1), Ml(t, e); + return s !== Hr && console.warn("Failed to hydrate: ", s), e.recover === !1 && pp(), Oa(), Nl(n), zt(!1), Ml(t, e); } finally { - Vt(r), ct(o); + zt(r), ct(o); } } const Ur = /* @__PURE__ */ new Map(); @@ -2475,8 +2475,8 @@ function cf(t, { target: e, anchor: n, props: r = {}, events: o, context: i, int } }; u(wl(uf)), Da.add(u); - var l = void 0, d = Yp(() => { - var f = n ?? e.appendChild(Mt()); + var l = void 0, d = qp(() => { + var f = n ?? e.appendChild(Lt()); return Ip( /** @type {TemplateNode} */ f, @@ -2497,8 +2497,8 @@ function cf(t, { target: e, anchor: n, props: r = {}, events: o, context: i, int /** @type {TemplateNode} */ h, null - ), l = t(h, r) || {}, Ce && (Fe.nodes_end = Ie, Ie === null || Ie.nodeType !== lr || /** @type {Comment} */ - Ie.data !== yl)) + ), l = t(h, r) || {}, Ce && (Be.nodes_end = Me, Me === null || Me.nodeType !== lr || /** @type {Comment} */ + Me.data !== yl)) throw oi(), Hr; i && ce(); } @@ -2591,7 +2591,7 @@ class li { const a = () => { if (Array.from(this.#e.values()).includes(i)) { var l = document.createDocumentFragment(); - Qd(s, l), l.append(Mt()), this.#n.set(i, { effect: s, fragment: l }); + Qd(s, l), l.append(Lt()), this.#n.set(i, { effect: s, fragment: l }); } else St(s); this.#r.delete(i), this.#t.delete(i); @@ -2621,7 +2621,7 @@ class li { ), o = Bd(); if (n && !this.#t.has(e) && !this.#n.has(e)) if (o) { - var i = document.createDocumentFragment(), s = Mt(); + var i = document.createDocumentFragment(), s = Lt(); i.append(s), this.#n.set(e, { effect: Bt(() => n(s)), fragment: i @@ -2638,10 +2638,10 @@ class li { a === e ? r.skipped_effects.delete(u.effect) : r.skipped_effects.add(u.effect); r.oncommit(this.#i), r.ondiscard(this.#a); } else - Ce && (this.anchor = Ie), this.#i(); + Ce && (this.anchor = Me), this.#i(); } } -function Oe(t, e, ...n) { +function Ae(t, e, ...n) { var r = new li(t); Cr(() => { const o = e() ?? null; @@ -2678,7 +2678,7 @@ function ie(t, e, n = !1) { const l = Cd(t) === Ds; if (s === l) { var u = Qi(); - ct(u), r.anchor = u, Vt(!1), r.ensure(s, a), Vt(!0); + ct(u), r.anchor = u, zt(!1), r.ensure(s, a), zt(!0); return; } } @@ -2704,7 +2704,7 @@ function h1(t, e) { Ce && ct( /** @type {TemplateNode} */ /* @__PURE__ */ pt(t) - ), qr(() => { + ), Yr(() => { var n = e(); for (var r in n) { var o = n[r]; @@ -2714,29 +2714,29 @@ function h1(t, e) { } function Ks(t, e, n = !1, r = !1, o = !1) { var i = t, s = ""; - Te(() => { + Oe(() => { var a = ( /** @type {Effect} */ - Fe + Be ); if (s === (s = e() ?? "")) { Ce && mn(); return; } - if (a.nodes_start !== null && (jd( + if (a.nodes_start !== null && (Xd( a.nodes_start, /** @type {TemplateNode} */ a.nodes_end ), a.nodes_start = a.nodes_end = null), s !== "") { if (Ce) { - Ie.data; + Me.data; for (var u = mn(), l = u; u !== null && (u.nodeType !== lr || /** @type {Comment} */ u.data !== ""); ) l = u, u = /** @type {TemplateNode} */ /* @__PURE__ */ Gt(u); if (u === null) throw oi(), Hr; - Wt(Ie, l), i = ct(u); + Wt(Me, l), i = ct(u); return; } var d = s + ""; @@ -2771,11 +2771,11 @@ function ff(t, e, n, r, o, i) { let s = Ce; Ce && mn(); var a = null; - Ce && Ie.nodeType === cp && (a = /** @type {Element} */ - Ie, mn()); + Ce && Me.nodeType === cp && (a = /** @type {Element} */ + Me, mn()); var u = ( /** @type {TemplateNode} */ - Ce ? Ie : t + Ce ? Me : t ), l = new li(u, !1); Cr(() => { const d = e() || null; @@ -2793,23 +2793,23 @@ function ff(t, e, n, r, o, i) { Ce && l1(d) && a.append(document.createComment("")); var p = ( /** @type {TemplateNode} */ - Ce ? /* @__PURE__ */ pt(a) : a.appendChild(Mt()) + Ce ? /* @__PURE__ */ pt(a) : a.appendChild(Lt()) ); - Ce && (p === null ? Vt(!1) : ct(p)), r(a, p); + Ce && (p === null ? zt(!1) : ct(p)), r(a, p); } - Fe.nodes_end = a, h.before(a); + Be.nodes_end = a, h.before(a); } Ce && ct(h); }), () => { }; }, er), $s(() => { - }), s && (Vt(!0), ct(u)); + }), s && (zt(!0), ct(u)); } function g1(t, e) { let n = null, r = Ce; var o; if (Ce) { - n = Ie; + n = Me; for (var i = ( /** @type {TemplateNode} */ /* @__PURE__ */ pt(document.head) @@ -2818,7 +2818,7 @@ function g1(t, e) { i = /** @type {TemplateNode} */ /* @__PURE__ */ Gt(i); if (i === null) - Vt(!1); + zt(!1); else { var s = ( /** @type {TemplateNode} */ @@ -2827,11 +2827,11 @@ function g1(t, e) { i.remove(), ct(s); } } - Ce || (o = document.head.appendChild(Mt())); + Ce || (o = document.head.appendChild(Lt())); try { Cr(() => e(o), xl); } finally { - r && (Vt(!0), ct( + r && (zt(!0), ct( /** @type {TemplateNode} */ n )); @@ -2864,7 +2864,7 @@ function At(t, e, n) { /** @type {any} */ {} ); - qr(() => { + Yr(() => { var s = n(); Al(s), o && kd(i, s) && (i = s, r.update(s)); }), o = !0; @@ -2878,7 +2878,7 @@ function At(t, e, n) { } function v1(t, e) { var n = void 0, r; - Yd(() => { + qd(() => { n !== (n = e()) && (r && (St(r), r = null), n && (r = Bt(() => { xo(() => ( /** @type {(node: Element) => void} */ @@ -2962,7 +2962,7 @@ function m1(t, e) { } return t == null ? null : String(t); } -function Yt(t, e, n, r, o, i) { +function qt(t, e, n, r, o, i) { var s = t.__className; if (Ce || s !== n || s === void 0) { var a = p1(n, r, i); @@ -3035,11 +3035,11 @@ function Qn(t) { if (!e) { if (e = !0, t.hasAttribute("value")) { var r = t.value; - Ne(t, "value", null), t.value = r; + Pe(t, "value", null), t.value = r; } if (t.hasAttribute("checked")) { var o = t.checked; - Ne(t, "checked", null), t.checked = o; + Pe(t, "checked", null), t.checked = o; } } }; @@ -3061,7 +3061,7 @@ function Ri(t, e) { function w1(t, e) { e ? t.hasAttribute("selected") || t.setAttribute("selected", "") : t.removeAttribute("selected"); } -function Ne(t, e, n, r) { +function Pe(t, e, n, r) { var o = Ws(t); Ce && (o[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === "LINK") || o[e] !== (o[e] = n) && (e === "loading" && (t[up] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && pf(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); } @@ -3075,7 +3075,7 @@ function b1(t, e, n, r, o = !1, i = !1) { } var u = Ws(t), l = u[gf], d = !u[vf]; let f = Ce && l; - f && Vt(!1); + f && zt(!1); var h = e || {}, p = t.tagName === "OPTION"; for (var m in e) m in n || (n[m] = null); @@ -3089,7 +3089,7 @@ function b1(t, e, n, r, o = !1, i = !1) { } if (T === "class") { var w = t.namespaceURI === "http://www.w3.org/1999/xhtml"; - Yt(t, w, I, r, e?.[fr], n[fr]), h[T] = I, h[fr] = n[fr]; + qt(t, w, I, r, e?.[fr], n[fr]), h[T] = I, h[fr] = n[fr]; continue; } if (T === "style") { @@ -3102,12 +3102,12 @@ function b1(t, e, n, r, o = !1, i = !1) { var S = T[0] + T[1]; if (S !== "$$") if (S === "on") { - const B = {}, $ = "$$" + T; + const F = {}, $ = "$$" + T; let H = T.slice(2); var E = n1(H); - if (e1(H) && (H = H.slice(0, -7), B.capture = !0), !E && b) { + if (e1(H) && (H = H.slice(0, -7), F.capture = !0), !E && b) { if (I != null) continue; - t.removeEventListener(H, h[$], B), h[$] = null; + t.removeEventListener(H, h[$], F), h[$] = null; } if (I != null) if (E) @@ -3116,11 +3116,11 @@ function b1(t, e, n, r, o = !1, i = !1) { let N = function(k) { h[T].call(this, k); }; - h[$] = Dl(H, t, N, B); + h[$] = Dl(H, t, N, F); } else E && (t[`__${H}`] = void 0); } else if (T === "style") - Ne(t, T, I); + Pe(t, T, I); else if (T === "autofocus") Kp( /** @type {HTMLElement} */ @@ -3141,30 +3141,30 @@ function b1(t, e, n, r, o = !1, i = !1) { var _ = x === "defaultValue" || x === "defaultChecked"; if (I == null && !l && !_) if (u[T] = null, x === "value" || x === "checked") { - let B = ( + let F = ( /** @type {HTMLInputElement} */ t ); const $ = e === void 0; if (x === "value") { - let H = B.defaultValue; - B.removeAttribute(x), B.defaultValue = H, B.value = B.__value = $ ? H : null; + let H = F.defaultValue; + F.removeAttribute(x), F.defaultValue = H, F.value = F.__value = $ ? H : null; } else { - let H = B.defaultChecked; - B.removeAttribute(x), B.defaultChecked = H, B.checked = $ ? H : !1; + let H = F.defaultChecked; + F.removeAttribute(x), F.defaultChecked = H, F.checked = $ ? H : !1; } } else t.removeAttribute(T); - else _ || y.includes(x) && (l || typeof I != "string") ? (t[x] = I, x in u && (u[x] = kt)) : typeof I != "function" && Ne(t, x, I); + else _ || y.includes(x) && (l || typeof I != "string") ? (t[x] = I, x in u && (u[x] = kt)) : typeof I != "function" && Pe(t, x, I); } } } - return f && Vt(!0), h; + return f && zt(!0), h; } function Ge(t, e, n = [], r = [], o = [], i, s = !1, a = !1) { Dd(o, n, r, (u) => { var l = void 0, d = {}, f = t.nodeName === "SELECT", h = !1; - if (Yd(() => { + if (qd(() => { var m = e(...u.map(c)), y = b1( t, l, @@ -3240,7 +3240,7 @@ function os(t, e, n = e) { // then use the updated value from the input instead. (Ce && t.defaultValue !== t.value || // If defaultValue is set, then value == defaultValue // TODO Svelte 6: remove input.value check and set to empty string? - it(e) == null && t.value) && (n(ca(t) ? da(t.value) : t.value), Qe !== null && r.add(Qe)), qr(() => { + it(e) == null && t.value) && (n(ca(t) ? da(t.value) : t.value), Qe !== null && r.add(Qe)), Yr(() => { var o = e(); if (t === document.activeElement) { var i = ( @@ -3265,7 +3265,7 @@ function x1(t, e, n = e) { n(t.files); }), // If we are hydrating and the value has since changed, // then use the updated value from the input instead. - Ce && t.files && n(t.files), qr(() => { + Ce && t.files && n(t.files), Yr(() => { t.files = e(); }); } @@ -3319,7 +3319,7 @@ function Ku(t, e) { function Nt(t = {}, e, n, r) { return xo(() => { var o, i; - return qr(() => { + return Yr(() => { o = i, i = [], it(() => { t !== n(...i) && (e(t, ...i), o && Ku(n(...o), t) && e(null, ...o)); }); @@ -3414,7 +3414,7 @@ const k1 = { }, set(t, e, n) { if (!(e in t.special)) { - var r = Fe; + var r = Be; try { rn(t.parent_effect), t.special[e] = v( { @@ -3462,7 +3462,7 @@ function Zu(t, e) { // seems likely that we can simplify `bind:this` instead parent_effect: ( /** @type {Effect} */ - Fe + Be ) }, k1 @@ -3481,7 +3481,7 @@ const E1 = { for (; r--; ) { let o = t.props[r]; Eo(o) && (o = o()); - const i = jn(o, e); + const i = Xn(o, e); if (i && i.set) return i.set(n), !0; } @@ -3492,7 +3492,7 @@ const E1 = { for (; n--; ) { let r = t.props[n]; if (Eo(r) && (r = r()), typeof r == "object" && r !== null && e in r) { - const o = jn(r, e); + const o = Xn(r, e); return o && !o.configurable && (o.configurable = !0), o; } } @@ -3531,7 +3531,7 @@ function v(t, e, n, r) { )), a), d; if (i) { var f = In in t || Cl in t; - d = jn(t, e)?.set ?? (f && e in t ? (E) => t[e] = E : void 0); + d = Xn(t, e)?.set ?? (f && e in t ? (E) => t[e] = E : void 0); } var h, p = !1; i ? [h, p] = C1(() => ( @@ -3568,7 +3568,7 @@ function v(t, e, n, r) { i && c(b); var S = ( /** @type {Effect} */ - Fe + Be ); return ( /** @type {() => V} */ @@ -3577,7 +3577,7 @@ function v(t, e, n, r) { const _ = x ? c(b) : o && i ? ht(E) : E; return K(b, _), w = !0, a !== void 0 && (a = _), E; } - return Xr && w || (S.f & Un) !== 0 ? b.v : c(b); + return jr && w || (S.f & Un) !== 0 ? b.v : c(b); } ); } @@ -3742,8 +3742,8 @@ typeof HTMLElement == "function" && (mf = class extends HTMLElement { $$slots: e, $$host: this } - }), this.$$me = Yr(() => { - qr(() => { + }), this.$$me = qr(() => { + Yr(() => { this.$$r = !0; for (const r of Gi(this.$$c)) { if (!this.$$p_d[r]?.reflect) continue; @@ -3850,7 +3850,7 @@ function se(t, e, n, r, o, i) { u = Fi(a, u, e), this.$$d[a] = u; var l = this.$$c; if (l) { - var d = jn(l, a)?.get; + var d = Xn(l, a)?.get; d ? l[a] = u : l.$set({ [a]: u }); } } @@ -3893,8 +3893,8 @@ Bi.prototype = Zs.prototype = { } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++i < s; ) - if (o = (t = r[i]).type) n[o] = Yu(n[o], t.name, e); - else if (e == null) for (o in n) n[o] = Yu(n[o], t.name, null); + if (o = (t = r[i]).type) n[o] = qu(n[o], t.name, e); + else if (e == null) for (o in n) n[o] = qu(n[o], t.name, null); return this; }, copy: function() { @@ -3917,7 +3917,7 @@ function D1(t, e) { if ((o = t[n]).name === e) return o.value; } -function Yu(t, e, n) { +function qu(t, e, n) { for (var r = 0, o = t.length; r < o; ++r) if (t[r].name === e) { t[r] = O1, t = t.slice(0, r).concat(t.slice(r + 1)); @@ -3926,16 +3926,16 @@ function Yu(t, e, n) { return n != null && t.push({ name: e, value: n }), t; } var La = "http://www.w3.org/1999/xhtml"; -const qu = { +const Yu = { svg: "http://www.w3.org/2000/svg", xhtml: La, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Ys(t) { +function qs(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), qu.hasOwnProperty(e) ? { space: qu[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Yu.hasOwnProperty(e) ? { space: Yu[e], local: t } : t; } function I1(t) { return function() { @@ -3949,7 +3949,7 @@ function M1(t) { }; } function yf(t) { - var e = Ys(t); + var e = qs(t); return (e.local ? M1 : I1)(e); } function L1() { @@ -4012,18 +4012,18 @@ function W1(t) { return this.select(t == null ? K1 : $1(typeof t == "function" ? t : xf(t))); } var Z1 = Array.prototype.filter; -function Y1() { +function q1() { return Array.from(this.children); } -function q1(t) { +function Y1(t) { return function() { return Z1.call(this.children, t); }; } -function X1(t) { - return this.selectAll(t == null ? Y1 : q1(typeof t == "function" ? t : xf(t))); -} function j1(t) { + return this.selectAll(t == null ? q1 : Y1(typeof t == "function" ? t : xf(t))); +} +function X1(t) { typeof t != "function" && (t = bf(t)); for (var e = this._groups, n = e.length, r = new Array(n), o = 0; o < n; ++o) for (var i = e[o], s = i.length, a = r[o] = [], u, l = 0; l < s; ++l) @@ -4193,7 +4193,7 @@ function bm(t, e) { }; } function xm(t, e) { - var n = Ys(t); + var n = qs(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); @@ -4341,27 +4341,27 @@ function Wm() { function Zm() { return this.each(Wm); } -function Ym(t) { +function qm(t) { var e = typeof t == "function" ? t : yf(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function qm() { +function Ym() { return null; } -function Xm(t, e) { - var n = typeof t == "function" ? t : yf(t), r = e == null ? qm : typeof e == "function" ? e : Vl(e); +function jm(t, e) { + var n = typeof t == "function" ? t : yf(t), r = e == null ? Ym : typeof e == "function" ? e : Vl(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function jm() { +function Xm() { var t = this.parentNode; t && t.removeChild(this); } function Um() { - return this.each(jm); + return this.each(Xm); } function Gm() { var t = this.cloneNode(!1), e = this.parentNode; @@ -4463,8 +4463,8 @@ Jt.prototype = ci.prototype = { select: H1, selectAll: F1, selectChild: W1, - selectChildren: X1, - filter: j1, + selectChildren: j1, + filter: X1, data: tm, enter: U1, exit: rm, @@ -4487,8 +4487,8 @@ Jt.prototype = ci.prototype = { html: Bm, raise: Km, lower: Zm, - append: Ym, - insert: Xm, + append: qm, + insert: jm, remove: Um, clone: Qm, datum: e0, @@ -4601,29 +4601,29 @@ function m0() { } function w(x, _) { if (t.call(this, x, _)) { - var T = x.changedTouches, I = e.call(this, x, _), B = T.length, $, H; - for ($ = 0; $ < B; ++$) + var T = x.changedTouches, I = e.call(this, x, _), F = T.length, $, H; + for ($ = 0; $ < F; ++$) (H = E(this, I, x, _, T[$].identifier, T[$])) && (fa(x), H("start", x, T[$])); } } function b(x) { - var _ = x.changedTouches, T = _.length, I, B; + var _ = x.changedTouches, T = _.length, I, F; for (I = 0; I < T; ++I) - (B = o[_[I].identifier]) && (no(x), B("drag", x, _[I])); + (F = o[_[I].identifier]) && (no(x), F("drag", x, _[I])); } function S(x) { - var _ = x.changedTouches, T = _.length, I, B; + var _ = x.changedTouches, T = _.length, I, F; for (d && clearTimeout(d), d = setTimeout(function() { d = null; }, 500), I = 0; I < T; ++I) - (B = o[_[I].identifier]) && (fa(x), B("end", x, _[I])); + (F = o[_[I].identifier]) && (fa(x), F("end", x, _[I])); } - function E(x, _, T, I, B, $) { + function E(x, _, T, I, F, $) { var H = i.copy(), N = cn($ || T, _), k, D, P; if ((P = n.call(x, new Ha("beforestart", { sourceEvent: T, target: h, - identifier: B, + identifier: F, active: s, x: N[0], y: N[1], @@ -4632,16 +4632,16 @@ function m0() { dispatch: H }), I)) != null) return k = P.x - N[0] || 0, D = P.y - N[1] || 0, function A(R, M, Y) { - var U = N, V; + var G = N, z; switch (R) { case "start": - o[B] = A, V = s++; + o[F] = A, z = s++; break; case "end": - delete o[B], --s; + delete o[F], --s; // falls through case "drag": - N = cn(Y || M, _), V = s; + N = cn(Y || M, _), z = s; break; } H.call( @@ -4651,12 +4651,12 @@ function m0() { sourceEvent: M, subject: P, target: h, - identifier: B, - active: V, + identifier: F, + active: z, x: N[0] + k, y: N[1] + D, - dx: N[0] - U[0], - dy: N[1] - U[1], + dx: N[0] - G[0], + dy: N[1] - G[1], dispatch: H }), I @@ -4688,7 +4688,7 @@ function Df(t, e) { } function di() { } -var Yo = 0.7, ss = 1 / Yo, ro = "\\s*([+-]?\\d+)\\s*", qo = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Mn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", y0 = /^#([0-9a-f]{3,8})$/, w0 = new RegExp(`^rgb\\(${ro},${ro},${ro}\\)$`), b0 = new RegExp(`^rgb\\(${Mn},${Mn},${Mn}\\)$`), x0 = new RegExp(`^rgba\\(${ro},${ro},${ro},${qo}\\)$`), _0 = new RegExp(`^rgba\\(${Mn},${Mn},${Mn},${qo}\\)$`), C0 = new RegExp(`^hsl\\(${qo},${Mn},${Mn}\\)$`), S0 = new RegExp(`^hsla\\(${qo},${Mn},${Mn},${qo}\\)$`), Xu = { +var qo = 0.7, ss = 1 / qo, ro = "\\s*([+-]?\\d+)\\s*", Yo = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Mn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", y0 = /^#([0-9a-f]{3,8})$/, w0 = new RegExp(`^rgb\\(${ro},${ro},${ro}\\)$`), b0 = new RegExp(`^rgb\\(${Mn},${Mn},${Mn}\\)$`), x0 = new RegExp(`^rgba\\(${ro},${ro},${ro},${Yo}\\)$`), _0 = new RegExp(`^rgba\\(${Mn},${Mn},${Mn},${Yo}\\)$`), C0 = new RegExp(`^hsl\\(${Yo},${Mn},${Mn}\\)$`), S0 = new RegExp(`^hsla\\(${Yo},${Mn},${Mn},${Yo}\\)$`), ju = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -4845,15 +4845,15 @@ Rl(di, Fr, { displayable() { return this.rgb().displayable(); }, - hex: ju, + hex: Xu, // Deprecated! Use color.formatHex. - formatHex: ju, + formatHex: Xu, formatHex8: k0, formatHsl: E0, formatRgb: Uu, toString: Uu }); -function ju() { +function Xu() { return this.rgb().formatHex(); } function k0() { @@ -4867,7 +4867,7 @@ function Uu() { } function Fr(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = y0.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Gu(e) : n === 3 ? new Kt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Ni(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Ni(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = w0.exec(t)) ? new Kt(e[1], e[2], e[3], 1) : (e = b0.exec(t)) ? new Kt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = x0.exec(t)) ? Ni(e[1], e[2], e[3], e[4]) : (e = _0.exec(t)) ? Ni(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = C0.exec(t)) ? ec(e[1], e[2] / 100, e[3] / 100, 1) : (e = S0.exec(t)) ? ec(e[1], e[2] / 100, e[3] / 100, e[4]) : Xu.hasOwnProperty(t) ? Gu(Xu[t]) : t === "transparent" ? new Kt(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = y0.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Gu(e) : n === 3 ? new Kt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Ni(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Ni(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = w0.exec(t)) ? new Kt(e[1], e[2], e[3], 1) : (e = b0.exec(t)) ? new Kt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = x0.exec(t)) ? Ni(e[1], e[2], e[3], e[4]) : (e = _0.exec(t)) ? Ni(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = C0.exec(t)) ? ec(e[1], e[2] / 100, e[3] / 100, 1) : (e = S0.exec(t)) ? ec(e[1], e[2] / 100, e[3] / 100, e[4]) : ju.hasOwnProperty(t) ? Gu(ju[t]) : t === "transparent" ? new Kt(NaN, NaN, NaN, 0) : null; } function Gu(t) { return new Kt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); @@ -4889,7 +4889,7 @@ Rl(Kt, Va, Df(di, { return t = t == null ? ss : Math.pow(ss, t), new Kt(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? Yo : Math.pow(Yo, t), new Kt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? qo : Math.pow(qo, t), new Kt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; @@ -4948,7 +4948,7 @@ Rl(dn, T0, Df(di, { return t = t == null ? ss : Math.pow(ss, t), new dn(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? Yo : Math.pow(Yo, t), new dn(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? qo : Math.pow(qo, t), new dn(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, o = 2 * n - r; @@ -5138,7 +5138,7 @@ function rc(t) { function Z0(t) { return ((t = Math.exp(t)) - 1 / t) / 2; } -function Y0(t) { +function q0(t) { return ((t = Math.exp(2 * t)) - 1) / (t + 1); } const $i = function t(e, n, r) { @@ -5155,11 +5155,11 @@ const $i = function t(e, n, r) { else { var S = Math.sqrt(y), E = (h * h - l * l + r * y) / (2 * l * n * S), x = (h * h - l * l - r * y) / (2 * h * n * S), _ = Math.log(Math.sqrt(E * E + 1) - E), T = Math.log(Math.sqrt(x * x + 1) - x); b = (T - _) / e, w = function(I) { - var B = I * b, $ = rc(_), H = l / (n * S) * ($ * Y0(e * B + _) - Z0(_)); + var F = I * b, $ = rc(_), H = l / (n * S) * ($ * q0(e * F + _) - Z0(_)); return [ a + H * p, u + H * m, - l * $ / rc(e * B + _) + l * $ / rc(e * F + _) ]; }; } @@ -5170,13 +5170,13 @@ const $i = function t(e, n, r) { return t(s, a, u); }, o; }(Math.SQRT2, 2, 4); -var co = 0, Io = 0, Po = 0, zf = 1e3, us, Mo, cs = 0, Br = 0, qs = 0, Xo = typeof performance == "object" && performance.now ? performance : Date, Rf = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var co = 0, Io = 0, Po = 0, zf = 1e3, us, Mo, cs = 0, Br = 0, Ys = 0, jo = typeof performance == "object" && performance.now ? performance : Date, Rf = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function Bl() { - return Br || (Rf(q0), Br = Xo.now() + qs); + return Br || (Rf(Y0), Br = jo.now() + Ys); } -function q0() { +function Y0() { Br = 0; } function ds() { @@ -5196,23 +5196,23 @@ function Ff(t, e, n) { var r = new ds(); return r.restart(t, e, n), r; } -function X0() { +function j0() { Bl(), ++co; for (var t = us, e; t; ) (e = Br - t._time) >= 0 && t._call.call(void 0, e), t = t._next; --co; } function oc() { - Br = (cs = Xo.now()) + qs, co = Io = 0; + Br = (cs = jo.now()) + Ys, co = Io = 0; try { - X0(); + j0(); } finally { co = 0, U0(), Br = 0; } } -function j0() { - var t = Xo.now(), e = t - cs; - e > zf && (qs -= e, cs = t); +function X0() { + var t = jo.now(), e = t - cs; + e > zf && (Ys -= e, cs = t); } function U0() { for (var t, e = us, n, r = 1 / 0; e; ) @@ -5223,7 +5223,7 @@ function Fa(t) { if (!co) { Io && (Io = clearTimeout(Io)); var e = t - Br; - e > 24 ? (t < 1 / 0 && (Io = setTimeout(oc, t - Xo.now() - qs)), Po && (Po = clearInterval(Po))) : (Po || (cs = Xo.now(), Po = setInterval(j0, zf)), co = 1, Rf(oc)); + e > 24 ? (t < 1 / 0 && (Io = setTimeout(oc, t - jo.now() - Ys)), Po && (Po = clearInterval(Po))) : (Po || (cs = jo.now(), Po = setInterval(X0, zf)), co = 1, Rf(oc)); } } function ic(t, e, n) { @@ -5233,7 +5233,7 @@ function ic(t, e, n) { }, e, n), r; } var G0 = Zs("start", "end", "cancel", "interrupt"), J0 = [], Bf = 0, sc = 1, Ba = 2, Ki = 3, ac = 4, $a = 5, Wi = 6; -function Xs(t, e, n, r, o, i) { +function js(t, e, n, r, o, i) { var s = t.__transition; if (!s) t.__transition = {}; else if (n in s) return; @@ -5414,7 +5414,7 @@ function uy(t, e, n) { }; } function cy(t, e) { - var n = Ys(t), r = n === "transform" ? K0 : $f; + var n = qs(t), r = n === "transform" ? K0 : $f; return this.attrTween(t, typeof e == "function" ? (n.local ? uy : ly)(n, r, Kl(this, "attr." + t, e)) : e == null ? (n.local ? iy : oy)(n) : (n.local ? ay : sy)(n, r, e)); } function dy(t, e) { @@ -5448,7 +5448,7 @@ function vy(t, e) { if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (e == null) return this.tween(n, null); if (typeof e != "function") throw new Error(); - var r = Ys(t); + var r = qs(t); return this.tween(n, (r.local ? hy : gy)(r, e)); } function py(t, e) { @@ -5548,7 +5548,7 @@ function Iy(t) { typeof t != "function" && (t = Vl(t)); for (var r = this._groups, o = r.length, i = new Array(o), s = 0; s < o; ++s) for (var a = r[s], u = a.length, l = i[s] = new Array(u), d, f, h = 0; h < u; ++h) - (d = a[h]) && (f = t.call(d, d.__data__, h, a)) && ("__data__" in d && (f.__data__ = d.__data__), l[h] = f, Xs(l[h], e, n, h, l, Cn(d, n))); + (d = a[h]) && (f = t.call(d, d.__data__, h, a)) && ("__data__" in d && (f.__data__ = d.__data__), l[h] = f, js(l[h], e, n, h, l, Cn(d, n))); return new nr(i, this._parents, e, n); } function My(t) { @@ -5558,7 +5558,7 @@ function My(t) { for (var u = r[a], l = u.length, d, f = 0; f < l; ++f) if (d = u[f]) { for (var h = t.call(d, d.__data__, f, u), p, m = Cn(d, n), y = 0, w = h.length; y < w; ++y) - (p = h[y]) && Xs(p, e, n, y, h, m); + (p = h[y]) && js(p, e, n, y, h, m); i.push(h), s.push(d); } return new nr(i, s, e, n); @@ -5629,25 +5629,25 @@ function Zy(t) { this.textContent = t; }; } -function Yy(t) { +function qy(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function qy(t) { - return this.tween("text", typeof t == "function" ? Yy(Kl(this, "text", t)) : Zy(t == null ? "" : t + "")); +function Yy(t) { + return this.tween("text", typeof t == "function" ? qy(Kl(this, "text", t)) : Zy(t == null ? "" : t + "")); } -function Xy(t) { +function jy(t) { return function(e) { this.textContent = t.call(this, e); }; } -function jy(t) { +function Xy(t) { var e, n; function r() { var o = t.apply(this, arguments); - return o !== n && (e = (n = o) && Xy(o)), e; + return o !== n && (e = (n = o) && jy(o)), e; } return r._value = t, r; } @@ -5656,14 +5656,14 @@ function Uy(t) { if (arguments.length < 1) return (e = this.tween(e)) && e._value; if (t == null) return this.tween(e, null); if (typeof t != "function") throw new Error(); - return this.tween(e, jy(t)); + return this.tween(e, Xy(t)); } function Gy() { for (var t = this._name, e = this._id, n = Wf(), r = this._groups, o = r.length, i = 0; i < o; ++i) for (var s = r[i], a = s.length, u, l = 0; l < a; ++l) if (u = s[l]) { var d = Cn(u, e); - Xs(u, t, n, l, s, { + js(u, t, n, l, s, { time: d.time + d.delay + d.duration, delay: 0, duration: d.duration, @@ -5713,7 +5713,7 @@ nr.prototype = { attrTween: vy, style: By, styleTween: Wy, - text: qy, + text: Yy, textTween: Uy, remove: Dy, tween: ry, @@ -5745,7 +5745,7 @@ function rw(t) { t instanceof nr ? (e = t._id, t = t._name) : (e = Wf(), (n = tw).time = Bl(), t = t == null ? null : t + ""); for (var r = this._groups, o = r.length, i = 0; i < o; ++i) for (var s = r[i], a = s.length, u, l = 0; l < a; ++l) - (u = s[l]) && Xs(u, t, e, l, s, n || nw(u, e)); + (u = s[l]) && js(u, t, e, l, s, n || nw(u, e)); return new nr(r, this._parents, t, e); } ci.prototype.interrupt = ey; @@ -5804,10 +5804,10 @@ Zn.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -var js = new Zn(1, 0, 0); +var Xs = new Zn(1, 0, 0); Zf.prototype = Zn.prototype; function Zf(t) { - for (; !t.__zoom; ) if (!(t = t.parentNode)) return js; + for (; !t.__zoom; ) if (!(t = t.parentNode)) return Xs; return t.__zoom; } function va(t) { @@ -5824,7 +5824,7 @@ function sw() { return t instanceof SVGElement ? (t = t.ownerSVGElement || t, t.hasAttribute("viewBox") ? (t = t.viewBox.baseVal, [[t.x, t.y], [t.x + t.width, t.y + t.height]]) : [[0, 0], [t.width.baseVal.value, t.height.baseVal.value]]) : [[0, 0], [t.clientWidth, t.clientHeight]]; } function lc() { - return this.__zoom || js; + return this.__zoom || Xs; } function aw(t) { return -t.deltaY * (t.deltaMode === 1 ? 0.05 : t.deltaMode ? 1 : 2e-3) * (t.ctrlKey ? 10 : 1); @@ -5839,10 +5839,10 @@ function uw(t, e, n) { s > i ? (i + s) / 2 : Math.min(0, i) || Math.max(0, s) ); } -function Yf() { +function qf() { var t = iw, e = sw, n = uw, r = aw, o = lw, i = [0, 1 / 0], s = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], a = 250, u = $i, l = Zs("start", "zoom", "end"), d, f, h, p = 500, m = 150, y = 0, w = 10; function b(P) { - P.property("__zoom", lc).on("wheel.zoom", B, { passive: !1 }).on("mousedown.zoom", $).on("dblclick.zoom", H).filter(o).on("touchstart.zoom", N).on("touchmove.zoom", k).on("touchend.zoom touchcancel.zoom", D).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); + P.property("__zoom", lc).on("wheel.zoom", F, { passive: !1 }).on("mousedown.zoom", $).on("dblclick.zoom", H).filter(o).on("touchstart.zoom", N).on("touchmove.zoom", k).on("touchend.zoom touchcancel.zoom", D).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); } b.transform = function(P, A, R, M) { var Y = P.selection ? P.selection() : P; @@ -5851,13 +5851,13 @@ function Yf() { }); }, b.scaleBy = function(P, A, R, M) { b.scaleTo(P, function() { - var Y = this.__zoom.k, U = typeof A == "function" ? A.apply(this, arguments) : A; - return Y * U; + var Y = this.__zoom.k, G = typeof A == "function" ? A.apply(this, arguments) : A; + return Y * G; }, R, M); }, b.scaleTo = function(P, A, R, M) { b.transform(P, function() { - var Y = e.apply(this, arguments), U = this.__zoom, V = R == null ? x(Y) : typeof R == "function" ? R.apply(this, arguments) : R, j = U.invert(V), q = typeof A == "function" ? A.apply(this, arguments) : A; - return n(E(S(U, q), V, j), Y, s); + var Y = e.apply(this, arguments), G = this.__zoom, z = R == null ? x(Y) : typeof R == "function" ? R.apply(this, arguments) : R, Q = G.invert(z), j = typeof A == "function" ? A.apply(this, arguments) : A; + return n(E(S(G, j), z, Q), Y, s); }, R, M); }, b.translateBy = function(P, A, R, M) { b.transform(P, function() { @@ -5868,11 +5868,11 @@ function Yf() { }, null, M); }, b.translateTo = function(P, A, R, M, Y) { b.transform(P, function() { - var U = e.apply(this, arguments), V = this.__zoom, j = M == null ? x(U) : typeof M == "function" ? M.apply(this, arguments) : M; - return n(js.translate(j[0], j[1]).scale(V.k).translate( + var G = e.apply(this, arguments), z = this.__zoom, Q = M == null ? x(G) : typeof M == "function" ? M.apply(this, arguments) : M; + return n(Xs.translate(Q[0], Q[1]).scale(z.k).translate( typeof A == "function" ? -A.apply(this, arguments) : -A, typeof R == "function" ? -R.apply(this, arguments) : -R - ), U, s); + ), G, s); }, M, Y); }; function S(P, A) { @@ -5891,14 +5891,14 @@ function Yf() { }).on("interrupt.zoom end.zoom", function() { T(this, arguments).event(M).end(); }).tween("zoom", function() { - var Y = this, U = arguments, V = T(Y, U).event(M), j = e.apply(Y, U), q = R == null ? x(j) : typeof R == "function" ? R.apply(Y, U) : R, F = Math.max(j[1][0] - j[0][0], j[1][1] - j[0][1]), Q = Y.__zoom, X = typeof A == "function" ? A.apply(Y, U) : A, re = u(Q.invert(q).concat(F / Q.k), X.invert(q).concat(F / X.k)); - return function(ee) { - if (ee === 1) ee = X; + var Y = this, G = arguments, z = T(Y, G).event(M), Q = e.apply(Y, G), j = R == null ? x(Q) : typeof R == "function" ? R.apply(Y, G) : R, B = Math.max(Q[1][0] - Q[0][0], Q[1][1] - Q[0][1]), te = Y.__zoom, q = typeof A == "function" ? A.apply(Y, G) : A, ee = u(te.invert(j).concat(B / te.k), q.invert(j).concat(B / q.k)); + return function(X) { + if (X === 1) X = q; else { - var L = re(ee), te = F / L[2]; - ee = new Zn(te, q[0] - L[0] * te, q[1] - L[1] * te); + var L = ee(X), ne = B / L[2]; + X = new Zn(ne, j[0] - L[0] * ne, j[1] - L[1] * ne); } - V.zoom(null, ee); + z.zoom(null, X); }; }); } @@ -5936,75 +5936,75 @@ function Yf() { ); } }; - function B(P, ...A) { + function F(P, ...A) { if (!t.apply(this, arguments)) return; - var R = T(this, A).event(P), M = this.__zoom, Y = Math.max(i[0], Math.min(i[1], M.k * Math.pow(2, r.apply(this, arguments)))), U = cn(P); + var R = T(this, A).event(P), M = this.__zoom, Y = Math.max(i[0], Math.min(i[1], M.k * Math.pow(2, r.apply(this, arguments)))), G = cn(P); if (R.wheel) - (R.mouse[0][0] !== U[0] || R.mouse[0][1] !== U[1]) && (R.mouse[1] = M.invert(R.mouse[0] = U)), clearTimeout(R.wheel); + (R.mouse[0][0] !== G[0] || R.mouse[0][1] !== G[1]) && (R.mouse[1] = M.invert(R.mouse[0] = G)), clearTimeout(R.wheel); else { if (M.k === Y) return; - R.mouse = [U, M.invert(U)], Zi(this), R.start(); + R.mouse = [G, M.invert(G)], Zi(this), R.start(); } - No(P), R.wheel = setTimeout(V, m), R.zoom("mouse", n(E(S(M, Y), R.mouse[0], R.mouse[1]), R.extent, s)); - function V() { + No(P), R.wheel = setTimeout(z, m), R.zoom("mouse", n(E(S(M, Y), R.mouse[0], R.mouse[1]), R.extent, s)); + function z() { R.wheel = null, R.end(); } } function $(P, ...A) { if (h || !t.apply(this, arguments)) return; - var R = P.currentTarget, M = T(this, A, !0).event(P), Y = nn(P.view).on("mousemove.zoom", q, !0).on("mouseup.zoom", F, !0), U = cn(P, R), V = P.clientX, j = P.clientY; - Of(P.view), va(P), M.mouse = [U, this.__zoom.invert(U)], Zi(this), M.start(); - function q(Q) { - if (No(Q), !M.moved) { - var X = Q.clientX - V, re = Q.clientY - j; - M.moved = X * X + re * re > y; + var R = P.currentTarget, M = T(this, A, !0).event(P), Y = nn(P.view).on("mousemove.zoom", j, !0).on("mouseup.zoom", B, !0), G = cn(P, R), z = P.clientX, Q = P.clientY; + Of(P.view), va(P), M.mouse = [G, this.__zoom.invert(G)], Zi(this), M.start(); + function j(te) { + if (No(te), !M.moved) { + var q = te.clientX - z, ee = te.clientY - Q; + M.moved = q * q + ee * ee > y; } - M.event(Q).zoom("mouse", n(E(M.that.__zoom, M.mouse[0] = cn(Q, R), M.mouse[1]), M.extent, s)); + M.event(te).zoom("mouse", n(E(M.that.__zoom, M.mouse[0] = cn(te, R), M.mouse[1]), M.extent, s)); } - function F(Q) { - Y.on("mousemove.zoom mouseup.zoom", null), Af(Q.view, M.moved), No(Q), M.event(Q).end(); + function B(te) { + Y.on("mousemove.zoom mouseup.zoom", null), Af(te.view, M.moved), No(te), M.event(te).end(); } } function H(P, ...A) { if (t.apply(this, arguments)) { - var R = this.__zoom, M = cn(P.changedTouches ? P.changedTouches[0] : P, this), Y = R.invert(M), U = R.k * (P.shiftKey ? 0.5 : 2), V = n(E(S(R, U), M, Y), e.apply(this, A), s); - No(P), a > 0 ? nn(this).transition().duration(a).call(_, V, M, P) : nn(this).call(b.transform, V, M, P); + var R = this.__zoom, M = cn(P.changedTouches ? P.changedTouches[0] : P, this), Y = R.invert(M), G = R.k * (P.shiftKey ? 0.5 : 2), z = n(E(S(R, G), M, Y), e.apply(this, A), s); + No(P), a > 0 ? nn(this).transition().duration(a).call(_, z, M, P) : nn(this).call(b.transform, z, M, P); } } function N(P, ...A) { if (t.apply(this, arguments)) { - var R = P.touches, M = R.length, Y = T(this, A, P.changedTouches.length === M).event(P), U, V, j, q; - for (va(P), V = 0; V < M; ++V) - j = R[V], q = cn(j, this), q = [q, this.__zoom.invert(q), j.identifier], Y.touch0 ? !Y.touch1 && Y.touch0[2] !== q[2] && (Y.touch1 = q, Y.taps = 0) : (Y.touch0 = q, U = !0, Y.taps = 1 + !!d); - d && (d = clearTimeout(d)), U && (Y.taps < 2 && (f = q[0], d = setTimeout(function() { + var R = P.touches, M = R.length, Y = T(this, A, P.changedTouches.length === M).event(P), G, z, Q, j; + for (va(P), z = 0; z < M; ++z) + Q = R[z], j = cn(Q, this), j = [j, this.__zoom.invert(j), Q.identifier], Y.touch0 ? !Y.touch1 && Y.touch0[2] !== j[2] && (Y.touch1 = j, Y.taps = 0) : (Y.touch0 = j, G = !0, Y.taps = 1 + !!d); + d && (d = clearTimeout(d)), G && (Y.taps < 2 && (f = j[0], d = setTimeout(function() { d = null; }, p)), Zi(this), Y.start()); } } function k(P, ...A) { if (this.__zooming) { - var R = T(this, A).event(P), M = P.changedTouches, Y = M.length, U, V, j, q; - for (No(P), U = 0; U < Y; ++U) - V = M[U], j = cn(V, this), R.touch0 && R.touch0[2] === V.identifier ? R.touch0[0] = j : R.touch1 && R.touch1[2] === V.identifier && (R.touch1[0] = j); - if (V = R.that.__zoom, R.touch1) { - var F = R.touch0[0], Q = R.touch0[1], X = R.touch1[0], re = R.touch1[1], ee = (ee = X[0] - F[0]) * ee + (ee = X[1] - F[1]) * ee, L = (L = re[0] - Q[0]) * L + (L = re[1] - Q[1]) * L; - V = S(V, Math.sqrt(ee / L)), j = [(F[0] + X[0]) / 2, (F[1] + X[1]) / 2], q = [(Q[0] + re[0]) / 2, (Q[1] + re[1]) / 2]; - } else if (R.touch0) j = R.touch0[0], q = R.touch0[1]; + var R = T(this, A).event(P), M = P.changedTouches, Y = M.length, G, z, Q, j; + for (No(P), G = 0; G < Y; ++G) + z = M[G], Q = cn(z, this), R.touch0 && R.touch0[2] === z.identifier ? R.touch0[0] = Q : R.touch1 && R.touch1[2] === z.identifier && (R.touch1[0] = Q); + if (z = R.that.__zoom, R.touch1) { + var B = R.touch0[0], te = R.touch0[1], q = R.touch1[0], ee = R.touch1[1], X = (X = q[0] - B[0]) * X + (X = q[1] - B[1]) * X, L = (L = ee[0] - te[0]) * L + (L = ee[1] - te[1]) * L; + z = S(z, Math.sqrt(X / L)), Q = [(B[0] + q[0]) / 2, (B[1] + q[1]) / 2], j = [(te[0] + ee[0]) / 2, (te[1] + ee[1]) / 2]; + } else if (R.touch0) Q = R.touch0[0], j = R.touch0[1]; else return; - R.zoom("touch", n(E(V, j, q), R.extent, s)); + R.zoom("touch", n(E(z, Q, j), R.extent, s)); } } function D(P, ...A) { if (this.__zooming) { - var R = T(this, A).event(P), M = P.changedTouches, Y = M.length, U, V; + var R = T(this, A).event(P), M = P.changedTouches, Y = M.length, G, z; for (va(P), h && clearTimeout(h), h = setTimeout(function() { h = null; - }, p), U = 0; U < Y; ++U) - V = M[U], R.touch0 && R.touch0[2] === V.identifier ? delete R.touch0 : R.touch1 && R.touch1[2] === V.identifier && delete R.touch1; + }, p), G = 0; G < Y; ++G) + z = M[G], R.touch0 && R.touch0[2] === z.identifier ? delete R.touch0 : R.touch1 && R.touch1[2] === z.identifier && delete R.touch1; if (R.touch1 && !R.touch0 && (R.touch0 = R.touch1, delete R.touch1), R.touch0) R.touch0[1] = this.__zoom.invert(R.touch0[0]); - else if (R.end(), R.taps === 2 && (V = cn(V, this), Math.hypot(f[0] - V[0], f[1] - V[1]) < w)) { - var j = nn(this).on("dblclick.zoom"); - j && j.apply(this, arguments); + else if (R.end(), R.taps === 2 && (z = cn(z, this), Math.hypot(f[0] - z[0], f[1] - z[1]) < w)) { + var Q = nn(this).on("dblclick.zoom"); + Q && Q.apply(this, arguments); } } } @@ -6035,7 +6035,7 @@ function Yf() { return arguments.length ? (w = +P, b) : w; }, b; } -const jo = { +const Xo = { error001: () => "[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001", error002: () => "It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.", error003: (t) => `Node type "${t}" not found. Using fallback type "default".`, @@ -6054,7 +6054,7 @@ const jo = { }, Ka = [ [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY] -], qf = ["Enter", " ", "Escape"], cw = { +], Yf = ["Enter", " ", "Escape"], cw = { "node.a11yDescription.default": "Press enter or space to select a node. Press delete to remove it and escape to cancel.", "node.a11yDescription.keyboardDisabled": "Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.", "node.a11yDescription.ariaLiveMessage": ({ direction: t, x: e, y: n }) => `Moved selected node ${t}. New position, x: ${e}, y: ${n}`, @@ -6136,7 +6136,7 @@ function cc(t, e, n) { function fw(t) { return t === null ? null : t ? "valid" : "invalid"; } -const Xf = (t) => "id" in t && "source" in t && "target" in t, hw = (t) => "id" in t && "position" in t && !("source" in t) && !("target" in t), Wl = (t) => "id" in t && "internals" in t && !("source" in t) && !("target" in t), fi = (t, e = [0, 0]) => { +const jf = (t) => "id" in t && "source" in t && "target" in t, hw = (t) => "id" in t && "position" in t && !("source" in t) && !("target" in t), Wl = (t) => "id" in t && "internals" in t && !("source" in t) && !("target" in t), fi = (t, e = [0, 0]) => { const { width: n, height: r } = kr(t), o = t.origin ?? e, i = n * o[0], s = r * o[1]; return { x: t.position.x - i, @@ -6187,19 +6187,19 @@ function pw(t, e) { async function mw({ nodes: t, width: e, height: n, panZoom: r, minZoom: o, maxZoom: i }, s) { if (t.size === 0) return Promise.resolve(!0); - const a = pw(t, s), u = hi(a), l = Yl(u, e, n, s?.minZoom ?? o, s?.maxZoom ?? i, s?.padding ?? 0.1); + const a = pw(t, s), u = hi(a), l = ql(u, e, n, s?.minZoom ?? o, s?.maxZoom ?? i, s?.padding ?? 0.1); return await r.setViewport(l, { duration: s?.duration, ease: s?.ease, interpolate: s?.interpolate }), Promise.resolve(!0); } -function jf({ nodeId: t, nextPosition: e, nodeLookup: n, nodeOrigin: r = [0, 0], nodeExtent: o, onError: i }) { +function Xf({ nodeId: t, nextPosition: e, nodeLookup: n, nodeOrigin: r = [0, 0], nodeExtent: o, onError: i }) { const s = n.get(t), a = s.parentId ? n.get(s.parentId) : void 0, { x: u, y: l } = a ? a.internals.positionAbsolute : { x: 0, y: 0 }, d = s.origin ?? r; let f = s.extent || o; if (s.extent === "parent" && !s.expandParent) if (!a) - i?.("005", jo.error005()); + i?.("005", Xo.error005()); else { const p = a.measured.width, m = a.measured.height; p && m && (f = [ @@ -6212,7 +6212,7 @@ function jf({ nodeId: t, nextPosition: e, nodeLookup: n, nodeOrigin: r = [0, 0], [s.extent[1][0] + u, s.extent[1][1] + l] ]); const h = vo(f) ? $r(e, f, s.measured) : e; - return (s.measured.width === void 0 || s.measured.height === void 0) && i?.("015", jo.error015()), { + return (s.measured.width === void 0 || s.measured.height === void 0) && i?.("015", Xo.error015()), { position: { x: h.x - u + (s.measured.width ?? 0) * d[0], y: h.y - l + (s.measured.height ?? 0) * d[1] @@ -6290,7 +6290,7 @@ const dc = (t, e, n) => t < e ? ho(Math.abs(t - e), 1, e) / e : t > n ? -ho(Math }, Jf = (t, e) => Gs(Us(Za(t), Za(e))), Go = (t, e) => { const n = Math.max(0, Math.min(t.x + t.width, e.x + e.width) - Math.max(t.x, e.x)), r = Math.max(0, Math.min(t.y + t.height, e.y + e.height) - Math.max(t.y, e.y)); return Math.ceil(n * r); -}, fc = (t) => Yn(t.width) && Yn(t.height) && Yn(t.x) && Yn(t.y), Yn = (t) => !isNaN(t) && isFinite(t), ww = (t, e) => { +}, fc = (t) => qn(t.width) && qn(t.height) && qn(t.x) && qn(t.y), qn = (t) => !isNaN(t) && isFinite(t), ww = (t, e) => { }, gi = (t, e = [1, 1]) => ({ x: e[0] * Math.round(t.x / e[0]), y: e[1] * Math.round(t.y / e[1]) @@ -6346,7 +6346,7 @@ function xw(t, e, n, r, o, i) { bottom: Math.floor(f) }; } -const Yl = (t, e, n, r, o, i) => { +const ql = (t, e, n, r, o, i) => { const s = bw(i, e, n), a = (e - s.x) / t.width, u = (n - s.y) / t.height, l = Math.min(a, u), d = ho(l, r, o), f = t.x + t.width / 2, h = t.y + t.height / 2, p = e / 2 - f * d, m = n / 2 - h * d, y = xw(t, p, m, d, e, n), w = { left: Math.min(y.left - s.left, 0), top: Math.min(y.top - s.top, 0), @@ -6496,7 +6496,7 @@ const Nw = ({ source: t, sourceHandle: e, target: n, targetHandle: r }) => `xy-e if (!t.source || !t.target) return e; let n; - return Xf(t) ? n = { ...t } : n = { + return jf(t) ? n = { ...t } : n = { ...t, id: Nw(t) }, Tw(n, e) ? e : (n.sourceHandle === null && delete n.sourceHandle, n.targetHandle === null && delete n.targetHandle, e.concat(n)); @@ -6552,8 +6552,8 @@ function Dw({ source: t, sourcePosition: e = ke.Bottom, target: n, targetPositio const k = h === "x" ? "y" : "x", D = a[h] === u[k], P = l[k] > d[k], A = l[k] < d[k]; (a[h] === 1 && (!D && P || D && A) || a[h] !== 1 && (!D && A || D && P)) && (m = h === "x" ? T : I); } - const B = { x: l.x + b.x, y: l.y + b.y }, $ = { x: d.x + S.x, y: d.y + S.y }, H = Math.max(Math.abs(B.x - m[0].x), Math.abs($.x - m[0].x)), N = Math.max(Math.abs(B.y - m[0].y), Math.abs($.y - m[0].y)); - H >= N ? (y = (B.x + $.x) / 2, w = m[0].y) : (y = m[0].x, w = (B.y + $.y) / 2); + const F = { x: l.x + b.x, y: l.y + b.y }, $ = { x: d.x + S.x, y: d.y + S.y }, H = Math.max(Math.abs(F.x - m[0].x), Math.abs($.x - m[0].x)), N = Math.max(Math.abs(F.y - m[0].y), Math.abs($.y - m[0].y)); + H >= N ? (y = (F.x + $.x) / 2, w = m[0].y) : (y = m[0].x, w = (F.y + $.y) / 2); } return [[ t, @@ -6574,7 +6574,7 @@ function Iw(t, e, n, r) { const a = t.x < n.x ? 1 : -1, u = t.y < n.y ? -1 : 1; return `L ${i},${s + o * u}Q ${i},${s} ${i + o * a},${s}`; } -function ql({ sourceX: t, sourceY: e, sourcePosition: n = ke.Bottom, targetX: r, targetY: o, targetPosition: i = ke.Top, borderRadius: s = 5, centerX: a, centerY: u, offset: l = 20, stepPosition: d = 0.5 }) { +function Yl({ sourceX: t, sourceY: e, sourcePosition: n = ke.Bottom, targetX: r, targetY: o, targetPosition: i = ke.Top, borderRadius: s = 5, centerX: a, centerY: u, offset: l = 20, stepPosition: d = 0.5 }) { const [f, h, p, m, y] = Dw({ source: { x: t, y: e }, sourcePosition: n, @@ -6602,7 +6602,7 @@ function Mw(t) { t.targetHandle ); if (!i || !s) - return t.onError?.("008", jo.error008(i ? "target" : "source", { + return t.onError?.("008", Xo.error008(i ? "target" : "source", { id: t.id, sourceHandle: t.sourceHandle, targetHandle: t.targetHandle @@ -6646,14 +6646,14 @@ function Jo(t, e, n = ke.Left, r = !1) { function wc(t, e) { return t && (e ? t.find((n) => n.id === e) : t[0]) || null; } -function Ya(t, e) { +function qa(t, e) { return t ? typeof t == "string" ? t : `${e ? `${e}__` : ""}${Object.keys(t).sort().map((r) => `${r}=${t[r]}`).join("&")}` : ""; } function Lw(t, { id: e, defaultColor: n, defaultMarkerStart: r, defaultMarkerEnd: o }) { const i = /* @__PURE__ */ new Set(); return t.reduce((s, a) => ([a.markerStart || r, a.markerEnd || o].forEach((u) => { if (u && typeof u == "object") { - const l = Ya(u, e); + const l = qa(u, e); i.has(l) || (s.push({ id: l, color: u.color || n, ...u }), i.add(l)); } }), s), []).sort((s, a) => s.id.localeCompare(a.id)); @@ -6684,23 +6684,23 @@ function Hw(t, e, n, r, o) { } return `translate(${s[0]}px, ${s[1]}px) translate(${a[0]}%, ${a[1]}%)`; } -const ah = 1e3, Vw = 10, Xl = { +const ah = 1e3, Vw = 10, jl = { nodeOrigin: [0, 0], nodeExtent: Ka, elevateNodesOnSelect: !0, defaults: {} }, zw = { - ...Xl, + ...jl, checkEquality: !0 }; -function jl(t, e) { +function Xl(t, e) { const n = { ...t }; for (const r in e) e[r] !== void 0 && (n[r] = e[r]); return n; } function Rw(t, e, n) { - const r = jl(Xl, n); + const r = Xl(jl, n); for (const o of t.values()) if (o.parentId) Ul(o, t, e, r); @@ -6732,7 +6732,7 @@ function Fw(t, e) { }; } function Bw(t, e, n, r) { - const o = jl(zw, r); + const o = Xl(zw, r); let i = { i: -1 }, s = t.length > 0; const a = new Map(e), u = o?.elevateNodesOnSelect ? ah : 0; e.clear(), n.clear(); @@ -6769,7 +6769,7 @@ function $w(t, e) { n ? n.set(t.id, t) : e.set(t.parentId, /* @__PURE__ */ new Map([[t.id, t]])); } function Ul(t, e, n, r, o) { - const { elevateNodesOnSelect: i, nodeOrigin: s, nodeExtent: a } = jl(Xl, r), u = t.parentId, l = e.get(u); + const { elevateNodesOnSelect: i, nodeOrigin: s, nodeExtent: a } = Xl(jl, r), u = t.parentId, l = e.get(u); if (!l) { console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`); return; @@ -6786,7 +6786,7 @@ function Ul(t, e, n, r, o) { }); } function lh(t, e) { - return (Yn(t.zIndex) ? t.zIndex : 0) + (t.selected ? e : 0); + return (qn(t.zIndex) ? t.zIndex : 0) + (t.selected ? e : 0); } function Kw(t, e, n, r, o) { const { x: i, y: s } = e.internals.positionAbsolute, a = kr(t), u = fi(t, n), l = vo(t.extent) ? $r(u, t.extent, a) : u; @@ -6891,7 +6891,7 @@ function Zw(t, e, n, r, o, i) { } return { changes: u, updatedInternals: a }; } -async function Yw({ delta: t, panZoom: e, transform: n, translateExtent: r, width: o, height: i }) { +async function qw({ delta: t, panZoom: e, transform: n, translateExtent: r, width: o, height: i }) { if (!e || !t.x && !t.y) return Promise.resolve(!1); const s = await e.setViewportConstrained({ @@ -6915,14 +6915,14 @@ function bc(t, e, n, r, o, i) { r.set(s, l.set(n, e)); } } -function qw(t, e, n) { +function Yw(t, e, n) { t.clear(), e.clear(); for (const r of n) { const { source: o, target: i, sourceHandle: s = null, targetHandle: a = null } = r, u = { edgeId: r.id, source: o, target: i, sourceHandle: s, targetHandle: a }, l = `${o}-${s}--${i}-${a}`, d = `${i}-${a}--${o}-${s}`; bc("source", u, d, t, o, s), bc("target", u, l, t, i, a), e.set(r.id, r); } } -function Xw(t, e) { +function jw(t, e) { if (t === null || e === null) return !1; const n = Array.isArray(t) ? t : [t], r = Array.isArray(e) ? e : [e]; @@ -6950,7 +6950,7 @@ function xc(t, e, n) { } while (r); return !1; } -function jw(t, e, n, r) { +function Xw(t, e, n, r) { const o = /* @__PURE__ */ new Map(); for (const [i, s] of t) if ((s.selected || s.id === r) && (!s.parentId || !uh(s, t)) && (s.draggable || e && typeof s.draggable > "u")) { @@ -7016,49 +7016,49 @@ function Gw({ onNodeMouseDown: t, getStoreItems: e, onDragStart: n, onDrag: r, o let i = { x: null, y: null }, s = 0, a = /* @__PURE__ */ new Map(), u = !1, l = { x: 0, y: 0 }, d = null, f = !1, h = null, p = !1, m = !1, y = null; function w({ noDragClassName: S, handleSelector: E, domNode: x, isSelectable: _, nodeId: T, nodeClickDistance: I = 0 }) { h = nn(x); - function B({ x: k, y: D }) { - const { nodeLookup: P, nodeExtent: A, snapGrid: R, snapToGrid: M, nodeOrigin: Y, onNodeDrag: U, onSelectionDrag: V, onError: j, updateNodePositions: q } = e(); + function F({ x: k, y: D }) { + const { nodeLookup: P, nodeExtent: A, snapGrid: R, snapToGrid: M, nodeOrigin: Y, onNodeDrag: G, onSelectionDrag: z, onError: Q, updateNodePositions: j } = e(); i = { x: k, y: D }; - let F = !1; - const Q = a.size > 1, X = Q && A ? Za(hi(a)) : null, re = Q && M ? Uw({ + let B = !1; + const te = a.size > 1, q = te && A ? Za(hi(a)) : null, ee = te && M ? Uw({ dragItems: a, snapGrid: R, x: k, y: D }) : null; - for (const [ee, L] of a) { - if (!P.has(ee)) + for (const [X, L] of a) { + if (!P.has(X)) continue; - let te = { x: k - L.distance.x, y: D - L.distance.y }; - M && (te = re ? { - x: Math.round(te.x + re.x), - y: Math.round(te.y + re.y) - } : gi(te, R)); - let ve = null; - if (Q && A && !L.extent && X) { - const { positionAbsolute: oe } = L.internals, fe = oe.x - X.x + A[0][0], we = oe.x + L.measured.width - X.x2 + A[1][0], xe = oe.y - X.y + A[0][1], pe = oe.y + L.measured.height - X.y2 + A[1][1]; - ve = [ - [fe, xe], - [we, pe] + let ne = { x: k - L.distance.x, y: D - L.distance.y }; + M && (ne = ee ? { + x: Math.round(ne.x + ee.x), + y: Math.round(ne.y + ee.y) + } : gi(ne, R)); + let fe = null; + if (te && A && !L.extent && q) { + const { positionAbsolute: oe } = L.internals, he = oe.x - q.x + A[0][0], we = oe.x + L.measured.width - q.x2 + A[1][0], _e = oe.y - q.y + A[0][1], ve = oe.y + L.measured.height - q.y2 + A[1][1]; + fe = [ + [he, _e], + [we, ve] ]; } - const { position: ae, positionAbsolute: le } = jf({ - nodeId: ee, - nextPosition: te, + const { position: le, positionAbsolute: ae } = Xf({ + nodeId: X, + nextPosition: ne, nodeLookup: P, - nodeExtent: ve || A, + nodeExtent: fe || A, nodeOrigin: Y, - onError: j + onError: Q }); - F = F || L.position.x !== ae.x || L.position.y !== ae.y, L.position = ae, L.internals.positionAbsolute = le; + B = B || L.position.x !== le.x || L.position.y !== le.y, L.position = le, L.internals.positionAbsolute = ae; } - if (m = m || F, !!F && (q(a, !0), y && (r || U || !T && V))) { - const [ee, L] = ma({ + if (m = m || B, !!B && (j(a, !0), y && (r || G || !T && z))) { + const [X, L] = ma({ nodeId: T, dragItems: a, nodeLookup: P }); - r?.(y, a, ee, L), U?.(y, ee, L), T || V?.(y, L); + r?.(y, a, X, L), G?.(y, X, L), T || z?.(y, L); } } async function $() { @@ -7070,33 +7070,33 @@ function Gw({ onNodeMouseDown: t, getStoreItems: e, onDragStart: n, onDrag: r, o return; } const [R, M] = Gf(l, d, P); - (R !== 0 || M !== 0) && (i.x = (i.x ?? 0) - R / k[2], i.y = (i.y ?? 0) - M / k[2], await D({ x: R, y: M }) && B(i)), s = requestAnimationFrame($); + (R !== 0 || M !== 0) && (i.x = (i.x ?? 0) - R / k[2], i.y = (i.y ?? 0) - M / k[2], await D({ x: R, y: M }) && F(i)), s = requestAnimationFrame($); } function H(k) { - const { nodeLookup: D, multiSelectionActive: P, nodesDraggable: A, transform: R, snapGrid: M, snapToGrid: Y, selectNodesOnDrag: U, onNodeDragStart: V, onSelectionDragStart: j, unselectNodesAndEdges: q } = e(); - f = !0, (!U || !_) && !P && T && (D.get(T)?.selected || q()), _ && U && T && t?.(T); - const F = pa(k.sourceEvent, { transform: R, snapGrid: M, snapToGrid: Y, containerBounds: d }); - if (i = F, a = jw(D, A, F, T), a.size > 0 && (n || V || !T && j)) { - const [Q, X] = ma({ + const { nodeLookup: D, multiSelectionActive: P, nodesDraggable: A, transform: R, snapGrid: M, snapToGrid: Y, selectNodesOnDrag: G, onNodeDragStart: z, onSelectionDragStart: Q, unselectNodesAndEdges: j } = e(); + f = !0, (!G || !_) && !P && T && (D.get(T)?.selected || j()), _ && G && T && t?.(T); + const B = pa(k.sourceEvent, { transform: R, snapGrid: M, snapToGrid: Y, containerBounds: d }); + if (i = B, a = Xw(D, A, B, T), a.size > 0 && (n || z || !T && Q)) { + const [te, q] = ma({ nodeId: T, dragItems: a, nodeLookup: D }); - n?.(k.sourceEvent, a, Q, X), V?.(k.sourceEvent, Q, X), T || j?.(k.sourceEvent, X); + n?.(k.sourceEvent, a, te, q), z?.(k.sourceEvent, te, q), T || Q?.(k.sourceEvent, q); } } const N = m0().clickDistance(I).on("start", (k) => { const { domNode: D, nodeDragThreshold: P, transform: A, snapGrid: R, snapToGrid: M } = e(); d = D?.getBoundingClientRect() || null, p = !1, m = !1, y = k.sourceEvent, P === 0 && H(k), i = pa(k.sourceEvent, { transform: A, snapGrid: R, snapToGrid: M, containerBounds: d }), l = hn(k.sourceEvent, d); }).on("drag", (k) => { - const { autoPanOnNodeDrag: D, transform: P, snapGrid: A, snapToGrid: R, nodeDragThreshold: M, nodeLookup: Y } = e(), U = pa(k.sourceEvent, { transform: P, snapGrid: A, snapToGrid: R, containerBounds: d }); + const { autoPanOnNodeDrag: D, transform: P, snapGrid: A, snapToGrid: R, nodeDragThreshold: M, nodeLookup: Y } = e(), G = pa(k.sourceEvent, { transform: P, snapGrid: A, snapToGrid: R, containerBounds: d }); if (y = k.sourceEvent, (k.sourceEvent.type === "touchmove" && k.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors T && !Y.has(T)) && (p = !0), !p) { if (!u && D && f && (u = !0, $()), !f) { - const V = hn(k.sourceEvent, d), j = V.x - l.x, q = V.y - l.y; - Math.sqrt(j * j + q * q) > M && H(k); + const z = hn(k.sourceEvent, d), Q = z.x - l.x, j = z.y - l.y; + Math.sqrt(Q * Q + j * j) > M && H(k); } - (i.x !== U.xSnapped || i.y !== U.ySnapped) && a && f && (l = hn(k.sourceEvent, d), B(U)); + (i.x !== G.xSnapped || i.y !== G.ySnapped) && a && f && (l = hn(k.sourceEvent, d), F(G)); } }).on("end", (k) => { if (!(!f || p) && (u = !1, f = !1, cancelAnimationFrame(s), a.size > 0)) { @@ -7172,60 +7172,60 @@ function t2(t, e) { return e ? n = !0 : t && !e && (n = !1), n; } const fh = () => !0; -function n2(t, { connectionMode: e, connectionRadius: n, handleId: r, nodeId: o, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: u, lib: l, autoPanOnConnect: d, flowId: f, panBy: h, cancelConnection: p, onConnectStart: m, onConnect: y, onConnectEnd: w, isValidConnection: b = fh, onReconnectEnd: S, updateConnection: E, getTransform: x, getFromHandle: _, autoPanSpeed: T, dragThreshold: I = 1, handleDomNode: B }) { +function n2(t, { connectionMode: e, connectionRadius: n, handleId: r, nodeId: o, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: u, lib: l, autoPanOnConnect: d, flowId: f, panBy: h, cancelConnection: p, onConnectStart: m, onConnect: y, onConnectEnd: w, isValidConnection: b = fh, onReconnectEnd: S, updateConnection: E, getTransform: x, getFromHandle: _, autoPanSpeed: T, dragThreshold: I = 1, handleDomNode: F }) { const $ = th(t.target); let H = 0, N; - const { x: k, y: D } = hn(t), P = dh(i, B), A = a?.getBoundingClientRect(); + const { x: k, y: D } = hn(t), P = dh(i, F), A = a?.getBoundingClientRect(); let R = !1; if (!A || !P) return; const M = ch(o, P, r, u, e); if (!M) return; - let Y = hn(t, A), U = !1, V = null, j = !1, q = null; - function F() { + let Y = hn(t, A), G = !1, z = null, Q = !1, j = null; + function B() { if (!d || !A) return; - const [ae, le] = Gf(Y, A, T); - h({ x: ae, y: le }), H = requestAnimationFrame(F); + const [le, ae] = Gf(Y, A, T); + h({ x: le, y: ae }), H = requestAnimationFrame(B); } - const Q = { + const te = { ...M, nodeId: o, type: P, position: M.position - }, X = u.get(o); - let ee = { + }, q = u.get(o); + let X = { inProgress: !0, isValid: null, - from: Jo(X, Q, ke.Left, !0), - fromHandle: Q, - fromPosition: Q.position, - fromNode: X, + from: Jo(q, te, ke.Left, !0), + fromHandle: te, + fromPosition: te.position, + fromNode: q, to: Y, toHandle: null, - toPosition: uc[Q.position], + toPosition: uc[te.position], toNode: null, pointer: Y }; function L() { - R = !0, E(ee), m?.(t, { nodeId: o, handleId: r, handleType: P }); + R = !0, E(X), m?.(t, { nodeId: o, handleId: r, handleType: P }); } I === 0 && L(); - function te(ae) { + function ne(le) { if (!R) { - const { x: we, y: xe } = hn(ae), pe = we - k, me = xe - D; - if (!(pe * pe + me * me > I * I)) + const { x: we, y: _e } = hn(le), ve = we - k, ye = _e - D; + if (!(ve * ve + ye * ye > I * I)) return; L(); } - if (!_() || !Q) { - ve(ae); + if (!_() || !te) { + fe(le); return; } - const le = x(); - Y = hn(ae, A), N = e2(vi(Y, le, !1, [1, 1]), n, u, Q), U || (F(), U = !0); - const oe = hh(ae, { + const ae = x(); + Y = hn(le, A), N = e2(vi(Y, ae, !1, [1, 1]), n, u, te), G || (B(), G = !0); + const oe = hh(le, { handle: N, connectionMode: e, fromNodeId: o, @@ -7237,33 +7237,33 @@ function n2(t, { connectionMode: e, connectionRadius: n, handleId: r, nodeId: o, flowId: f, nodeLookup: u }); - q = oe.handleDomNode, V = oe.connection, j = t2(!!N, oe.isValid); - const fe = { + j = oe.handleDomNode, z = oe.connection, Q = t2(!!N, oe.isValid); + const he = { // from stays the same - ...ee, - isValid: j, - to: oe.toHandle && j ? gs({ x: oe.toHandle.x, y: oe.toHandle.y }, le) : Y, + ...X, + isValid: Q, + to: oe.toHandle && Q ? gs({ x: oe.toHandle.x, y: oe.toHandle.y }, ae) : Y, toHandle: oe.toHandle, - toPosition: j && oe.toHandle ? oe.toHandle.position : uc[Q.position], + toPosition: Q && oe.toHandle ? oe.toHandle.position : uc[te.position], toNode: oe.toHandle ? u.get(oe.toHandle.nodeId) : null, pointer: Y }; - E(fe), ee = fe; + E(he), X = he; } - function ve(ae) { - if (!("touches" in ae && ae.touches.length > 0)) { + function fe(le) { + if (!("touches" in le && le.touches.length > 0)) { if (R) { - (N || q) && V && j && y?.(V); - const { inProgress: le, ...oe } = ee, fe = { + (N || j) && z && Q && y?.(z); + const { inProgress: ae, ...oe } = X, he = { ...oe, - toPosition: ee.toHandle ? ee.toPosition : null + toPosition: X.toHandle ? X.toPosition : null }; - w?.(ae, fe), i && S?.(ae, fe); + w?.(le, he), i && S?.(le, he); } - p(), cancelAnimationFrame(H), U = !1, j = !1, V = null, q = null, $.removeEventListener("mousemove", te), $.removeEventListener("mouseup", ve), $.removeEventListener("touchmove", te), $.removeEventListener("touchend", ve); + p(), cancelAnimationFrame(H), G = !1, Q = !1, z = null, j = null, $.removeEventListener("mousemove", ne), $.removeEventListener("mouseup", fe), $.removeEventListener("touchmove", ne), $.removeEventListener("touchend", fe); } } - $.addEventListener("mousemove", te), $.addEventListener("mouseup", ve), $.addEventListener("touchmove", te), $.addEventListener("touchend", ve); + $.addEventListener("mousemove", ne), $.addEventListener("mouseup", fe), $.addEventListener("touchmove", ne), $.addEventListener("touchend", fe); } function hh(t, { handle: e, connectionMode: n, fromNodeId: r, fromHandleId: o, fromType: i, doc: s, lib: a, flowId: u, isValidConnection: l = fh, nodeLookup: d }) { const f = i === "target", h = e ? s.querySelector(`.${a}-flow__handle[data-id="${u}-${e?.nodeId}-${e?.id}-${e?.type}"]`) : null, { x: p, y: m } = hn(t), y = s.elementFromPoint(p, m), w = y?.classList.contains(`${a}-flow__handle`) ? y : h, b = { @@ -7316,7 +7316,7 @@ function r2({ domNode: t, panZoom: e, getTransform: n, getViewScale: r }) { E.sourceEvent.clientY ?? E.sourceEvent.touches[0].clientY ], T = [_[0] - y[0], _[1] - y[1]]; y = _; - const I = r() * Math.max(x[2], Math.log(x[2])) * (p ? -1 : 1), B = { + const I = r() * Math.max(x[2], Math.log(x[2])) * (p ? -1 : 1), F = { x: x[0] - T[0] * I, y: x[1] - T[1] * I }, $ = [ @@ -7324,11 +7324,11 @@ function r2({ domNode: t, panZoom: e, getTransform: n, getViewScale: r }) { [u, l] ]; e.setViewportConstrained({ - x: B.x, - y: B.y, + x: F.x, + y: F.y, zoom: x[2] }, $, a); - }, S = Yf().on("start", w).on("zoom", f ? b : null).on("zoom.wheel", h ? m : null); + }, S = qf().on("start", w).on("zoom", f ? b : null).on("zoom.wheel", h ? m : null); o.call(S, {}); } function s() { @@ -7344,7 +7344,7 @@ const Js = (t) => ({ x: t.x, y: t.y, zoom: t.k -}), ya = ({ x: t, y: e, zoom: n }) => js.translate(t, e).scale(n), eo = (t, e) => t.target.closest(`.${e}`), gh = (t, e) => e === 2 && Array.isArray(t) && t.includes(2), o2 = (t) => ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2, wa = (t, e = 0, n = o2, r = () => { +}), ya = ({ x: t, y: e, zoom: n }) => Xs.translate(t, e).scale(n), eo = (t, e) => t.target.closest(`.${e}`), gh = (t, e) => e === 2 && Array.isArray(t) && t.includes(2), o2 = (t) => ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2, wa = (t, e = 0, n = o2, r = () => { }) => { const o = typeof e == "number" && e > 0; return o || r(), o ? t.transition().duration(e).ease(n).on("end", r) : t; @@ -7437,7 +7437,7 @@ function d2({ domNode: t, minZoom: e, maxZoom: n, translateExtent: r, viewport: timerId: void 0, panScrollTimeout: void 0, isPanScrolling: !1 - }, d = t.getBoundingClientRect(), f = Yf().scaleExtent([e, n]).translateExtent(r), h = nn(t).call(f); + }, d = t.getBoundingClientRect(), f = qf().scaleExtent([e, n]).translateExtent(r), h = nn(t).call(f); S({ x: o.x, y: o.y, @@ -7453,42 +7453,42 @@ function d2({ domNode: t, minZoom: e, maxZoom: n, translateExtent: r, viewport: f?.interpolate(k?.interpolate === "linear" ? Fo : $i).transform(wa(h, k?.duration, k?.ease, () => D(!0)), N); }) : Promise.resolve(!1); } - function w({ noWheelClassName: N, noPanClassName: k, onPaneContextMenu: D, userSelectionActive: P, panOnScroll: A, panOnDrag: R, panOnScrollMode: M, panOnScrollSpeed: Y, preventScrolling: U, zoomOnPinch: V, zoomOnScroll: j, zoomOnDoubleClick: q, zoomActivationKeyPressed: F, lib: Q, onTransformChange: X, connectionInProgress: re, paneClickDistance: ee, selectionOnDrag: L }) { + function w({ noWheelClassName: N, noPanClassName: k, onPaneContextMenu: D, userSelectionActive: P, panOnScroll: A, panOnDrag: R, panOnScrollMode: M, panOnScrollSpeed: Y, preventScrolling: G, zoomOnPinch: z, zoomOnScroll: Q, zoomOnDoubleClick: j, zoomActivationKeyPressed: B, lib: te, onTransformChange: q, connectionInProgress: ee, paneClickDistance: X, selectionOnDrag: L }) { P && !l.isZoomingOrPanning && b(); - const te = A && !F && !P; - f.clickDistance(L ? 1 / 0 : !Yn(ee) || ee < 0 ? 0 : ee); - const ve = te ? i2({ + const ne = A && !B && !P; + f.clickDistance(L ? 1 / 0 : !qn(X) || X < 0 ? 0 : X); + const fe = ne ? i2({ zoomPanValues: l, noWheelClassName: N, d3Selection: h, d3Zoom: f, panOnScrollMode: M, panOnScrollSpeed: Y, - zoomOnPinch: V, + zoomOnPinch: z, onPanZoomStart: s, onPanZoom: i, onPanZoomEnd: a }) : s2({ noWheelClassName: N, - preventScrolling: U, + preventScrolling: G, d3ZoomHandler: p }); - if (h.on("wheel.zoom", ve, { passive: !1 }), !P) { - const le = a2({ + if (h.on("wheel.zoom", fe, { passive: !1 }), !P) { + const ae = a2({ zoomPanValues: l, onDraggingChange: u, onPanZoomStart: s }); - f.on("start", le); + f.on("start", ae); const oe = l2({ zoomPanValues: l, panOnDrag: R, onPaneContextMenu: !!D, onPanZoom: i, - onTransformChange: X + onTransformChange: q }); f.on("zoom", oe); - const fe = u2({ + const he = u2({ zoomPanValues: l, panOnDrag: R, panOnScroll: A, @@ -7496,22 +7496,22 @@ function d2({ domNode: t, minZoom: e, maxZoom: n, translateExtent: r, viewport: onPanZoomEnd: a, onDraggingChange: u }); - f.on("end", fe); + f.on("end", he); } - const ae = c2({ - zoomActivationKeyPressed: F, + const le = c2({ + zoomActivationKeyPressed: B, panOnDrag: R, - zoomOnScroll: j, + zoomOnScroll: Q, panOnScroll: A, - zoomOnDoubleClick: q, - zoomOnPinch: V, + zoomOnDoubleClick: j, + zoomOnPinch: z, userSelectionActive: P, noPanClassName: k, noWheelClassName: N, - lib: Q, - connectionInProgress: re + lib: te, + connectionInProgress: ee }); - f.filter(ae), q ? h.on("dblclick.zoom", m) : h.on("dblclick.zoom", null); + f.filter(le), j ? h.on("dblclick.zoom", m) : h.on("dblclick.zoom", null); } function b() { f.on("zoom", null); @@ -7544,14 +7544,14 @@ function d2({ domNode: t, minZoom: e, maxZoom: n, translateExtent: r, viewport: f?.interpolate(k?.interpolate === "linear" ? Fo : $i).scaleBy(wa(h, k?.duration, k?.ease, () => D(!0)), N); }) : Promise.resolve(!1); } - function B(N) { + function F(N) { f?.scaleExtent(N); } function $(N) { f?.translateExtent(N); } function H(N) { - const k = !Yn(N) || N < 0 ? 0 : N; + const k = !qn(N) || N < 0 ? 0 : N; f?.clickDistance(k); } return { @@ -7562,7 +7562,7 @@ function d2({ domNode: t, minZoom: e, maxZoom: n, translateExtent: r, viewport: getViewport: _, scaleTo: T, scaleBy: I, - setScaleExtent: B, + setScaleExtent: F, setTranslateExtent: $, syncViewport: x, setClickDistance: H @@ -7572,7 +7572,7 @@ var Cc; (function(t) { t.Line = "line", t.Handle = "handle"; })(Cc || (Cc = {})); -var f2 = /* @__PURE__ */ ne("
"); +var f2 = /* @__PURE__ */ re("
"); function yr(t, e) { ue(e, !0); let n = v(e, "id", 7, null), r = v(e, "type", 7, "source"), o = v(e, "position", 23, () => ke.Top), i = v(e, "style", 7), s = v(e, "class", 7), a = v(e, "isConnectable", 7), u = v(e, "isConnectableStart", 7, !0), l = v(e, "isConnectableEnd", 7, !0), d = v(e, "isValidConnection", 7), f = v(e, "onconnect", 7), h = v(e, "ondisconnect", 7), p = v(e, "children", 7), m = /* @__PURE__ */ Le(e, [ @@ -7598,33 +7598,33 @@ function yr(t, e) { Ft(() => { if (f() || h()) { E.edges; - let V = E.connectionLookup.get(`${y}-${r()}${n() ? `-${n()}` : ""}`); - if (_ && !dw(V, _)) { - const j = V ?? /* @__PURE__ */ new Map(); - cc(_, j, h()), cc(j, _, f()); + let z = E.connectionLookup.get(`${y}-${r()}${n() ? `-${n()}` : ""}`); + if (_ && !dw(z, _)) { + const Q = z ?? /* @__PURE__ */ new Map(); + cc(_, Q, h()), cc(Q, _, f()); } - _ = new Map(V); + _ = new Map(z); } }); let T = /* @__PURE__ */ C(() => { if (!E.connection.inProgress) return [!1, !1, !1, !1, null]; - const { fromHandle: V, toHandle: j, isValid: q } = E.connection, F = V && V.nodeId === y && V.type === r() && V.id === n(), Q = j && j.nodeId === y && j.type === r() && j.id === n(), X = E.connectionMode === fo.Strict ? V?.type !== r() : y !== V?.nodeId || n() !== V?.id; + const { fromHandle: z, toHandle: Q, isValid: j } = E.connection, B = z && z.nodeId === y && z.type === r() && z.id === n(), te = Q && Q.nodeId === y && Q.type === r() && Q.id === n(), q = E.connectionMode === fo.Strict ? z?.type !== r() : y !== z?.nodeId || n() !== z?.id; return [ !0, - F, - Q, - X, - Q && q + B, + te, + q, + te && j ]; - }), I = /* @__PURE__ */ C(() => yo(c(T), 5)), B = /* @__PURE__ */ C(() => c(I)[0]), $ = /* @__PURE__ */ C(() => c(I)[1]), H = /* @__PURE__ */ C(() => c(I)[2]), N = /* @__PURE__ */ C(() => c(I)[3]), k = /* @__PURE__ */ C(() => c(I)[4]); - function D(V) { - const j = E.onbeforeconnect ? E.onbeforeconnect(V) : V; - j && (E.addEdge(j), E.onconnect?.(V)); - } - function P(V) { - const j = rh(V); - V.currentTarget && (j && V.button === 0 || !j) && _c.onPointerDown(V, { + }), I = /* @__PURE__ */ C(() => yo(c(T), 5)), F = /* @__PURE__ */ C(() => c(I)[0]), $ = /* @__PURE__ */ C(() => c(I)[1]), H = /* @__PURE__ */ C(() => c(I)[2]), N = /* @__PURE__ */ C(() => c(I)[3]), k = /* @__PURE__ */ C(() => c(I)[4]); + function D(z) { + const Q = E.onbeforeconnect ? E.onbeforeconnect(z) : z; + Q && (E.addEdge(Q), E.onconnect?.(z)); + } + function P(z) { + const Q = rh(z); + z.currentTarget && (Q && z.button === 0 || !Q) && _c.onPointerDown(z, { handleId: n(), nodeId: y, isTarget: c(b), @@ -7641,117 +7641,117 @@ function yr(t, e) { cancelConnection: E.cancelConnection, panBy: E.panBy, onConnect: D, - onConnectStart: (q, F) => { - E.onconnectstart?.(q, { - nodeId: F.nodeId, - handleId: F.handleId, - handleType: F.handleType + onConnectStart: (j, B) => { + E.onconnectstart?.(j, { + nodeId: B.nodeId, + handleId: B.handleId, + handleType: B.handleType }); }, - onConnectEnd: (q, F) => { - E.onconnectend?.(q, F); + onConnectEnd: (j, B) => { + E.onconnectend?.(j, B); }, getTransform: () => [E.viewport.x, E.viewport.y, E.viewport.zoom], getFromHandle: () => E.connection.fromHandle, dragThreshold: E.connectionDragThreshold, - handleDomNode: V.currentTarget + handleDomNode: z.currentTarget }); } - function A(V) { + function A(z) { if (!y || !E.clickConnectStartHandle && !u()) return; if (!E.clickConnectStartHandle) { - E.onclickconnectstart?.(V, { nodeId: y, handleId: n(), handleType: r() }), E.clickConnectStartHandle = { nodeId: y, type: r(), id: n() }; + E.onclickconnectstart?.(z, { nodeId: y, handleId: n(), handleType: r() }), E.clickConnectStartHandle = { nodeId: y, type: r(), id: n() }; return; } - const j = th(V.target), q = d() ?? E.isValidConnection, { connectionMode: F, clickConnectStartHandle: Q, flowId: X, nodeLookup: re } = E, { connection: ee, isValid: L } = _c.isValid(V, { + const Q = th(z.target), j = d() ?? E.isValidConnection, { connectionMode: B, clickConnectStartHandle: te, flowId: q, nodeLookup: ee } = E, { connection: X, isValid: L } = _c.isValid(z, { handle: { nodeId: y, id: n(), type: r() }, - connectionMode: F, - fromNodeId: Q.nodeId, - fromHandleId: Q.id ?? null, - fromType: Q.type, - isValidConnection: q, - flowId: X, - doc: j, + connectionMode: B, + fromNodeId: te.nodeId, + fromHandleId: te.id ?? null, + fromType: te.type, + isValidConnection: j, + flowId: q, + doc: Q, lib: "svelte", - nodeLookup: re + nodeLookup: ee }); - L && ee && D(ee); - const te = structuredClone(kl(E.connection)); - delete te.inProgress, te.toPosition = te.toHandle ? te.toHandle.position : null, E.onclickconnectend?.(V, te), E.clickConnectStartHandle = null; + L && X && D(X); + const ne = structuredClone(kl(E.connection)); + delete ne.inProgress, ne.toPosition = ne.toHandle ? ne.toHandle.position : null, E.onclickconnectend?.(z, ne), E.clickConnectStartHandle = null; } var R = { get id() { return n(); }, - set id(V = null) { - n(V), g(); + set id(z = null) { + n(z), g(); }, get type() { return r(); }, - set type(V = "source") { - r(V), g(); + set type(z = "source") { + r(z), g(); }, get position() { return o(); }, - set position(V = ke.Top) { - o(V), g(); + set position(z = ke.Top) { + o(z), g(); }, get style() { return i(); }, - set style(V) { - i(V), g(); + set style(z) { + i(z), g(); }, get class() { return s(); }, - set class(V) { - s(V), g(); + set class(z) { + s(z), g(); }, get isConnectable() { return a(); }, - set isConnectable(V) { - a(V), g(); + set isConnectable(z) { + a(z), g(); }, get isConnectableStart() { return u(); }, - set isConnectableStart(V = !0) { - u(V), g(); + set isConnectableStart(z = !0) { + u(z), g(); }, get isConnectableEnd() { return l(); }, - set isConnectableEnd(V = !0) { - l(V), g(); + set isConnectableEnd(z = !0) { + l(z), g(); }, get isValidConnection() { return d(); }, - set isValidConnection(V) { - d(V), g(); + set isValidConnection(z) { + d(z), g(); }, get onconnect() { return f(); }, - set onconnect(V) { - f(V), g(); + set onconnect(z) { + f(z), g(); }, get ondisconnect() { return h(); }, - set ondisconnect(V) { - h(V), g(); + set ondisconnect(z) { + h(z), g(); }, get children() { return p(); }, - set children(V) { - p(V), g(); + set children(z) { + p(z), g(); } }, M = f2(), Y = () => { }; @@ -7786,11 +7786,11 @@ function yr(t, e) { connectablestart: u(), connectableend: l(), connectable: c(S), - connectionindicator: c(S) && (!c(B) || c(N)) && (c(B) || E.clickConnectStartHandle ? l() : u()) + connectionindicator: c(S) && (!c(F) || c(N)) && (c(F) || E.clickConnectStartHandle ? l() : u()) } })); - var U = Z(M); - return Oe(U, () => p() ?? ze), W(M), O(t, M), ce(R); + var G = Z(M); + return Ae(G, () => p() ?? ze), W(M), O(t, M), ce(R); } se( yr, @@ -7812,7 +7812,7 @@ se( [], !0 ); -var h2 = /* @__PURE__ */ ne(" ", 1); +var h2 = /* @__PURE__ */ re(" ", 1); function Gl(t, e) { ue(e, !0); let n = v(e, "data", 7), r = v(e, "targetPosition", 23, () => ke.Top), o = v(e, "sourcePosition", 23, () => ke.Bottom); @@ -7842,16 +7842,16 @@ function Gl(t, e) { return r(); } }); - var u = z(a), l = z(u); + var u = V(a), l = V(u); return yr(l, { type: "source", get position() { return o(); } - }), Te(() => tt(u, ` ${n()?.label ?? ""} `)), O(t, s), ce(i); + }), Oe(() => tt(u, ` ${n()?.label ?? ""} `)), O(t, s), ce(i); } se(Gl, { data: {}, targetPosition: {}, sourcePosition: {} }, [], [], !0); -var g2 = /* @__PURE__ */ ne(" ", 1); +var g2 = /* @__PURE__ */ re(" ", 1); function ph(t, e) { ue(e, !0); let n = v(e, "data", 23, () => ({ label: "Node" })), r = v(e, "sourcePosition", 23, () => ke.Bottom); @@ -7870,16 +7870,16 @@ function ph(t, e) { } }; Se(); - var i = g2(), s = J(i), a = z(s); + var i = g2(), s = J(i), a = V(s); return yr(a, { type: "source", get position() { return r(); } - }), Te(() => tt(s, `${n()?.label ?? ""} `)), O(t, i), ce(o); + }), Oe(() => tt(s, `${n()?.label ?? ""} `)), O(t, i), ce(o); } se(ph, { data: {}, sourcePosition: {} }, [], [], !0); -var v2 = /* @__PURE__ */ ne(" ", 1); +var v2 = /* @__PURE__ */ re(" ", 1); function mh(t, e) { ue(e, !0); let n = v(e, "data", 23, () => ({ label: "Node" })), r = v(e, "targetPosition", 23, () => ke.Top); @@ -7898,13 +7898,13 @@ function mh(t, e) { } }; Se(); - var i = v2(), s = J(i), a = z(s); + var i = v2(), s = J(i), a = V(s); return yr(a, { type: "target", get position() { return r(); } - }), Te(() => tt(s, `${n()?.label ?? ""} `)), O(t, i), ce(o); + }), Oe(() => tt(s, `${n()?.label ?? ""} `)), O(t, i), ce(o); } se(mh, { data: {}, targetPosition: {} }, [], [], !0); function yh(t, e) { @@ -7919,7 +7919,7 @@ function ba(t, e, n) { function wh(t, e) { const n = /* @__PURE__ */ C(Sn), r = /* @__PURE__ */ C(() => c(n).domNode); let o; - return c(r) ? ba(t, c(r), e) : o = Yr(() => { + return c(r) ? ba(t, c(r), e) : o = qr(() => { He(() => { ba(t, c(r), e), o?.(); }); @@ -7933,9 +7933,9 @@ function wh(t, e) { }; } function bh() { - let t = /* @__PURE__ */ ye(typeof window > "u"); + let t = /* @__PURE__ */ me(typeof window > "u"); if (c(t)) { - const e = Yr(() => { + const e = qr(() => { He(() => { K(t, !1), e?.(); }); @@ -7947,7 +7947,7 @@ function bh() { } }; } -const Sc = (t) => hw(t), p2 = (t) => Xf(t); +const Sc = (t) => hw(t), p2 = (t) => jf(t); function Vn(t) { return t === void 0 ? void 0 : `${t}px`; } @@ -7957,10 +7957,10 @@ const vs = { ArrowLeft: { x: -1, y: 0 }, ArrowRight: { x: 1, y: 0 } }; -var m2 = /* @__PURE__ */ ne("
"); +var m2 = /* @__PURE__ */ re("
"); const y2 = { - hash: "svelte-1ix3cbb", - code: ".transparent.svelte-1ix3cbb {background:transparent;}" + hash: "svelte-19zgyl6", + code: ".transparent.svelte-19zgyl6 {background:transparent;}" }; function xh(t, e) { ue(e, !0), Je(t, y2); @@ -8060,10 +8060,10 @@ function xh(t, e) { ], void 0, void 0, - "svelte-1ix3cbb" + "svelte-19zgyl6" ); var b = Z(y); - return Oe(b, () => l() ?? ze), W(y), At(y, (S, E) => wh?.(S, E), () => "edge-labels"), O(t, y), ce(m); + return Ae(b, () => l() ?? ze), W(y), At(y, (S, E) => wh?.(S, E), () => "edge-labels"), O(t, y), ce(m); } se( xh, @@ -8081,7 +8081,7 @@ se( [], !0 ); -var w2 = /* @__PURE__ */ _e(""), b2 = /* @__PURE__ */ _e('', 1); +var w2 = /* @__PURE__ */ xe(""), b2 = /* @__PURE__ */ xe('', 1); function pi(t, e) { ue(e, !0); let n = v(e, "id", 7), r = v(e, "path", 7), o = v(e, "label", 7), i = v(e, "labelX", 7), s = v(e, "labelY", 7), a = v(e, "labelStyle", 7), u = v(e, "markerStart", 7), l = v(e, "markerEnd", 7), d = v(e, "style", 7), f = v(e, "interactionWidth", 7, 20), h = v(e, "class", 7), p = /* @__PURE__ */ Le(e, [ @@ -8168,7 +8168,7 @@ function pi(t, e) { set class(_) { h(_), g(); } - }, y = b2(), w = J(y), b = z(w); + }, y = b2(), w = J(y), b = V(w); { var S = (_) => { var T = w2(); @@ -8185,7 +8185,7 @@ function pi(t, e) { f() > 0 && _(S); }); } - var E = z(b); + var E = V(b); { var x = (_) => { xh(_, { @@ -8201,8 +8201,8 @@ function pi(t, e) { selectEdgeOnClick: !0, children: (T, I) => { Se(); - var B = Me(); - Te(() => tt(B, o())), O(T, B); + var F = Ie(); + Oe(() => tt(F, o())), O(T, F); }, $$slots: { default: !0 } }); @@ -8211,8 +8211,8 @@ function pi(t, e) { o() && _(x); }); } - return Te(() => { - Ne(w, "id", n()), Ne(w, "d", r()), Yt(w, 0, ur(["svelte-flow__edge-path", h()])), Ne(w, "marker-start", u()), Ne(w, "marker-end", l()), Pt(w, d()); + return Oe(() => { + Pe(w, "id", n()), Pe(w, "d", r()), qt(w, 0, ur(["svelte-flow__edge-path", h()])), Pe(w, "marker-start", u()), Pe(w, "marker-end", l()), Pt(w, d()); }), O(t, y), ce(m); } se( @@ -8388,7 +8388,7 @@ se( ); function _h(t, e) { ue(e, !0); - let n = v(e, "interactionWidth", 7), r = v(e, "label", 7), o = v(e, "labelStyle", 7), i = v(e, "style", 7), s = v(e, "markerEnd", 7), a = v(e, "markerStart", 7), u = v(e, "sourcePosition", 7), l = v(e, "sourceX", 7), d = v(e, "sourceY", 7), f = v(e, "targetPosition", 7), h = v(e, "targetX", 7), p = v(e, "targetY", 7), m = /* @__PURE__ */ C(() => ql({ + let n = v(e, "interactionWidth", 7), r = v(e, "label", 7), o = v(e, "labelStyle", 7), i = v(e, "style", 7), s = v(e, "markerEnd", 7), a = v(e, "markerStart", 7), u = v(e, "sourcePosition", 7), l = v(e, "sourceX", 7), d = v(e, "sourceY", 7), f = v(e, "targetPosition", 7), h = v(e, "targetX", 7), p = v(e, "targetY", 7), m = /* @__PURE__ */ C(() => Yl({ sourceX: l(), sourceY: d(), targetX: h(), @@ -8640,7 +8640,7 @@ se( ); function Sh(t, e) { ue(e, !0); - let n = v(e, "sourceX", 7), r = v(e, "sourceY", 7), o = v(e, "sourcePosition", 7), i = v(e, "targetX", 7), s = v(e, "targetY", 7), a = v(e, "targetPosition", 7), u = v(e, "label", 7), l = v(e, "labelStyle", 7), d = v(e, "markerStart", 7), f = v(e, "markerEnd", 7), h = v(e, "interactionWidth", 7), p = v(e, "style", 7), m = /* @__PURE__ */ C(() => ql({ + let n = v(e, "sourceX", 7), r = v(e, "sourceY", 7), o = v(e, "sourcePosition", 7), i = v(e, "targetX", 7), s = v(e, "targetY", 7), a = v(e, "targetPosition", 7), u = v(e, "label", 7), l = v(e, "labelStyle", 7), d = v(e, "markerStart", 7), f = v(e, "markerEnd", 7), h = v(e, "interactionWidth", 7), p = v(e, "style", 7), m = /* @__PURE__ */ C(() => Yl({ sourceX: n(), sourceY: r(), targetX: i(), @@ -8776,8 +8776,8 @@ se( class x2 extends Map { /** @type {Map>} */ #e = /* @__PURE__ */ new Map(); - #t = /* @__PURE__ */ ye(0); - #n = /* @__PURE__ */ ye(0); + #t = /* @__PURE__ */ me(0); + #n = /* @__PURE__ */ me(0); #r = Jn || -1; /** * @param {Iterable | null | undefined} [value] @@ -8799,7 +8799,7 @@ class x2 extends Map { * @returns {Source} */ #o(e) { - return Jn === this.#r ? /* @__PURE__ */ ye(e) : tr(e); + return Jn === this.#r ? /* @__PURE__ */ me(e) : tr(e); } /** @param {K} key */ has(e) { @@ -9002,7 +9002,7 @@ function E2(t, e, n, r, o, i) { const s = hi(i, { filter: (a) => !!((a.width || a.initialWidth) && (a.height || a.initialHeight)) }); - return Yl(s, r, o, 0.5, 2, 0.1); + return ql(s, r, o, 0.5, 2, 0.1); } else return n ?? { x: 0, y: 0, zoom: 1 }; } @@ -9015,28 +9015,28 @@ function P2(t) { set flowId(r) { K(this.#e, r); } - #t = /* @__PURE__ */ ye(null); + #t = /* @__PURE__ */ me(null); get domNode() { return c(this.#t); } set domNode(r) { K(this.#t, r); } - #n = /* @__PURE__ */ ye(null); + #n = /* @__PURE__ */ me(null); get panZoom() { return c(this.#n); } set panZoom(r) { K(this.#n, r); } - #r = /* @__PURE__ */ ye(t.width ?? 0); + #r = /* @__PURE__ */ me(t.width ?? 0); get width() { return c(this.#r); } set width(r) { K(this.#r, r); } - #o = /* @__PURE__ */ ye(t.height ?? 0); + #o = /* @__PURE__ */ me(t.height ?? 0); get height() { return c(this.#o); } @@ -9067,7 +9067,7 @@ function P2(t) { set viewportInitialized(r) { K(this.#a, r); } - #s = /* @__PURE__ */ C(() => (qw(this.connectionLookup, this.edgeLookup, t.edges), t.edges)); + #s = /* @__PURE__ */ C(() => (Yw(this.connectionLookup, this.edgeLookup, t.edges), t.edges)); get _edges() { return c(this.#s); } @@ -9295,63 +9295,63 @@ function P2(t) { set snapGrid(r) { K(this.#T, r); } - #O = /* @__PURE__ */ ye(!1); + #O = /* @__PURE__ */ me(!1); get dragging() { return c(this.#O); } set dragging(r) { K(this.#O, r); } - #A = /* @__PURE__ */ ye(null); + #A = /* @__PURE__ */ me(null); get selectionRect() { return c(this.#A); } set selectionRect(r) { K(this.#A, r); } - #D = /* @__PURE__ */ ye(!1); + #D = /* @__PURE__ */ me(!1); get selectionKeyPressed() { return c(this.#D); } set selectionKeyPressed(r) { K(this.#D, r); } - #I = /* @__PURE__ */ ye(!1); + #I = /* @__PURE__ */ me(!1); get multiselectionKeyPressed() { return c(this.#I); } set multiselectionKeyPressed(r) { K(this.#I, r); } - #M = /* @__PURE__ */ ye(!1); + #M = /* @__PURE__ */ me(!1); get deleteKeyPressed() { return c(this.#M); } set deleteKeyPressed(r) { K(this.#M, r); } - #L = /* @__PURE__ */ ye(!1); + #L = /* @__PURE__ */ me(!1); get panActivationKeyPressed() { return c(this.#L); } set panActivationKeyPressed(r) { K(this.#L, r); } - #H = /* @__PURE__ */ ye(!1); + #H = /* @__PURE__ */ me(!1); get zoomActivationKeyPressed() { return c(this.#H); } set zoomActivationKeyPressed(r) { K(this.#H, r); } - #V = /* @__PURE__ */ ye(null); + #V = /* @__PURE__ */ me(null); get selectionRectMode() { return c(this.#V); } set selectionRectMode(r) { K(this.#V, r); } - #z = /* @__PURE__ */ ye(""); + #z = /* @__PURE__ */ me(""); get ariaLiveMessage() { return c(this.#z); } @@ -9407,12 +9407,12 @@ function P2(t) { set ariaLabelConfig(r) { K(this.#Z, r); } - #Y = /* @__PURE__ */ ye(E2(this.nodesInitialized, t.props.fitView, t.props.initialViewport, this.width, this.height, this.nodeLookup)); + #q = /* @__PURE__ */ me(E2(this.nodesInitialized, t.props.fitView, t.props.initialViewport, this.width, this.height, this.nodeLookup)); get _viewport() { - return c(this.#Y); + return c(this.#q); } set _viewport(r) { - K(this.#Y, r); + K(this.#q, r); } get viewport() { return t.viewport ?? this._viewport; @@ -9420,32 +9420,32 @@ function P2(t) { set viewport(r) { t.viewport && (t.viewport = r), this._viewport = r; } - #q = /* @__PURE__ */ ye( + #Y = /* @__PURE__ */ me( // _connection is viewport independent and originating from XYHandle Wa ); get _connection() { - return c(this.#q); + return c(this.#Y); } set _connection(r) { - K(this.#q, r); + K(this.#Y, r); } - #X = /* @__PURE__ */ C(() => this._connection.inProgress ? { + #j = /* @__PURE__ */ C(() => this._connection.inProgress ? { ...this._connection, to: vi(this._connection.to, [this.viewport.x, this.viewport.y, this.viewport.zoom]) } : this._connection); get connection() { - return c(this.#X); + return c(this.#j); } set connection(r) { - K(this.#X, r); + K(this.#j, r); } - #j = /* @__PURE__ */ C(() => t.props.connectionMode ?? fo.Strict); + #X = /* @__PURE__ */ C(() => t.props.connectionMode ?? fo.Strict); get connectionMode() { - return c(this.#j); + return c(this.#X); } set connectionMode(r) { - K(this.#j, r); + K(this.#X, r); } #U = /* @__PURE__ */ C(() => t.props.connectionRadius ?? 20); get connectionRadius() { @@ -9592,7 +9592,7 @@ function P2(t) { set onclickconnectend(r) { K(this.#ve, r); } - #pe = /* @__PURE__ */ ye(null); + #pe = /* @__PURE__ */ me(null); get clickConnectStartHandle() { return c(this.#pe); } @@ -9769,7 +9769,7 @@ function Nh(t) { function E(N, k, D) { const P = e.nodeLookup.get(N); if (!P) { - console.warn("012", jo.error012(N)); + console.warn("012", Xo.error012(N)); return; } e.selectionRect = null, e.selectionRectMode = null, P.selected ? (k || P.selected && e.multiselectionKeyPressed) && (w({ nodes: [P], edges: [] }), requestAnimationFrame(() => D?.blur())) : b([N]); @@ -9777,35 +9777,35 @@ function Nh(t) { function x(N) { const k = e.edgeLookup.get(N); if (!k) { - console.warn("012", jo.error012(N)); + console.warn("012", Xo.error012(N)); return; } (k.selectable || e.elementsSelectable && typeof k.selectable > "u") && (e.selectionRect = null, e.selectionRectMode = null, k.selected ? k.selected && e.multiselectionKeyPressed && w({ nodes: [], edges: [k] }) : S([N])); } function _(N, k) { - const { nodeExtent: D, snapGrid: P, nodeOrigin: A, nodeLookup: R, nodesDraggable: M, onerror: Y } = e, U = /* @__PURE__ */ new Map(), V = P?.[0] ?? 5, j = P?.[1] ?? 5, q = N.x * V * k, F = N.y * j * k; - for (const Q of R.values()) { - if (!(Q.selected && (Q.draggable || M && typeof Q.draggable > "u"))) + const { nodeExtent: D, snapGrid: P, nodeOrigin: A, nodeLookup: R, nodesDraggable: M, onerror: Y } = e, G = /* @__PURE__ */ new Map(), z = P?.[0] ?? 5, Q = P?.[1] ?? 5, j = N.x * z * k, B = N.y * Q * k; + for (const te of R.values()) { + if (!(te.selected && (te.draggable || M && typeof te.draggable > "u"))) continue; - let re = { - x: Q.internals.positionAbsolute.x + q, - y: Q.internals.positionAbsolute.y + F + let ee = { + x: te.internals.positionAbsolute.x + j, + y: te.internals.positionAbsolute.y + B }; - P && (re = gi(re, P)); - const { position: ee, positionAbsolute: L } = jf({ - nodeId: Q.id, - nextPosition: re, + P && (ee = gi(ee, P)); + const { position: X, positionAbsolute: L } = Xf({ + nodeId: te.id, + nextPosition: ee, nodeLookup: R, nodeExtent: D, nodeOrigin: A, onError: Y }); - Q.position = ee, Q.internals.positionAbsolute = L, U.set(Q.id, Q); + te.position = X, te.internals.positionAbsolute = L, G.set(te.id, te); } - i(U); + i(G); } function T(N) { - return Yw({ + return qw({ delta: N, panZoom: e.panZoom, transform: [e.viewport.x, e.viewport.y, e.viewport.zoom], @@ -9817,7 +9817,7 @@ function Nh(t) { const I = (N) => { e._connection = { ...N }; }; - function B() { + function F() { e._connection = Wa; } function $() { @@ -9844,7 +9844,7 @@ function Nh(t) { moveSelectedNodes: _, panBy: T, updateConnection: I, - cancelConnection: B, + cancelConnection: F, reset: $ }); } @@ -9866,7 +9866,7 @@ function N2(t, e) { } }; } -var T2 = /* @__PURE__ */ ne('
'); +var T2 = /* @__PURE__ */ re('
'); function Th(t, e) { ue(e, !0); let n = v(e, "store", 15), r = v(e, "panOnScrollMode", 7), o = v(e, "preventScrolling", 7), i = v(e, "zoomOnScroll", 7), s = v(e, "zoomOnDoubleClick", 7), a = v(e, "zoomOnPinch", 7), u = v(e, "panOnDrag", 7), l = v(e, "panOnScroll", 7), d = v(e, "panOnScrollSpeed", 7), f = v(e, "paneClickDistance", 7), h = v(e, "selectionOnDrag", 7), p = v(e, "onmovestart", 7), m = v(e, "onmove", 7), y = v(e, "onmoveend", 7), w = v(e, "oninit", 7), b = v(e, "children", 7), S = /* @__PURE__ */ C(() => n().panActivationKeyPressed || u()), E = /* @__PURE__ */ C(() => n().panActivationKeyPressed || l()); @@ -9972,8 +9972,8 @@ function Th(t, e) { set children($) { b($), g(); } - }, I = T2(), B = Z(I); - return Oe(B, b), W(I), At(I, ($, H) => N2?.($, H), () => ({ + }, I = T2(), F = Z(I); + return Ae(F, b), W(I), At(I, ($, H) => N2?.($, H), () => ({ viewport: n().viewport, minZoom: n().minZoom, maxZoom: n().maxZoom, @@ -10052,7 +10052,7 @@ function Nc(t, e) { return !1; return !0; } -var O2 = /* @__PURE__ */ ne("
"); +var O2 = /* @__PURE__ */ re("
"); function Oh(t, e) { ue(e, !0); let n = v(e, "store", 15), r = v(e, "panOnDrag", 7, !0), o = v(e, "paneClickDistance", 7, 1), i = v(e, "selectionOnDrag", 7), s = v(e, "onpaneclick", 7), a = v(e, "onpanecontextmenu", 7), u = v(e, "onselectionstart", 7), l = v(e, "onselectionend", 7), d = v(e, "children", 7), f, h = null, p = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ C(() => n().panActivationKeyPressed || r()), w = /* @__PURE__ */ C(() => n().selectionKeyPressed || !!n().selectionRect || i() && c(y) !== !0), b = /* @__PURE__ */ C(() => n().elementsSelectable && (c(w) || n().selectionRectMode === "user")), S = !1; @@ -10062,30 +10062,30 @@ function Oh(t, e) { if (M || !c(w) || !Y || A.button !== 0 || !A.isPrimary) return; A.target?.setPointerCapture?.(A.pointerId), S = !1; - const { x: U, y: V } = hn(A, h); - n(n().selectionRect = { width: 0, height: 0, startX: U, startY: V, x: U, y: V }, !0), R || (A.stopPropagation(), A.preventDefault()); + const { x: G, y: z } = hn(A, h); + n(n().selectionRect = { width: 0, height: 0, startX: G, startY: z, x: G, y: z }, !0), R || (A.stopPropagation(), A.preventDefault()); } function x(A) { if (!c(w) || !h || !n().selectionRect) return; const R = hn(A, h), { startX: M = 0, startY: Y = 0 } = n().selectionRect; if (!S) { - const F = n().selectionKeyPressed ? 0 : o(); - if (Math.hypot(R.x - M, R.y - Y) <= F) + const B = n().selectionKeyPressed ? 0 : o(); + if (Math.hypot(R.x - M, R.y - Y) <= B) return; n().unselectNodesAndEdges(), u()?.(A); } S = !0; - const U = { + const G = { ...n().selectionRect, x: R.x < M ? R.x : M, y: R.y < Y ? R.y : Y, width: Math.abs(R.x - M), height: Math.abs(R.y - Y) - }, V = p, j = m; + }, z = p, Q = m; p = new Set(Zl( n().nodeLookup, - U, + G, [ n().viewport.x, n().viewport.y, @@ -10093,21 +10093,21 @@ function Oh(t, e) { ], n().selectionMode === fs.Partial, !0 - ).map((F) => F.id)); - const q = n().defaultEdgeOptions.selectable ?? !0; + ).map((B) => B.id)); + const j = n().defaultEdgeOptions.selectable ?? !0; m = /* @__PURE__ */ new Set(); - for (const F of p) { - const Q = n().connectionLookup.get(F); - if (Q) - for (const { edgeId: X } of Q.values()) { - const re = n().edgeLookup.get(X); - re && (re.selectable ?? q) && m.add(X); + for (const B of p) { + const te = n().connectionLookup.get(B); + if (te) + for (const { edgeId: q } of te.values()) { + const ee = n().edgeLookup.get(q); + ee && (ee.selectable ?? j) && m.add(q); } } - Nc(V, p) || n(n().nodes = n().nodes.map(Pc(p)), !0), Nc(j, m) || n(n().edges = n().edges.map(Pc(m)), !0), n(n().selectionRectMode = "user", !0), n(n().selectionRect = U, !0); + Nc(z, p) || n(n().nodes = n().nodes.map(Pc(p)), !0), Nc(Q, m) || n(n().edges = n().edges.map(Pc(m)), !0), n(n().selectionRectMode = "user", !0), n(n().selectionRect = G, !0); } function _(A) { - A.button === 0 && (A.target?.releasePointerCapture?.(A.pointerId), !S && A.target === f && B?.(A), n(n().selectionRect = null, !0), S && n(n().selectionRectMode = p.size > 0 ? "nodes" : null, !0), S && l()?.(A)); + A.button === 0 && (A.target?.releasePointerCapture?.(A.pointerId), !S && A.target === f && F?.(A), n(n().selectionRect = null, !0), S && n(n().selectionRectMode = p.size > 0 ? "nodes" : null, !0), S && l()?.(A)); } const T = (A) => { if (Array.isArray(c(y)) && c(y).includes(2)) { @@ -10118,7 +10118,7 @@ function Oh(t, e) { }, I = (A) => { S && (A.stopPropagation(), S = !1); }; - function B(A) { + function F(A) { if (S || n().connection.inProgress) { S = !1; return; @@ -10182,7 +10182,7 @@ function Oh(t, e) { } }, H = O2(); let N; - var k = /* @__PURE__ */ C(() => c(b) ? void 0 : Ec(B, f)); + var k = /* @__PURE__ */ C(() => c(b) ? void 0 : Ec(F, f)); H.__click = function(...A) { c(k)?.apply(this, A); }, H.__pointermove = function(...A) { @@ -10195,7 +10195,7 @@ function Oh(t, e) { c(D)?.apply(this, A); }; var P = Z(H); - return Oe(P, d), W(H), Nt(H, (A) => f = A, () => f), Te((A) => N = Yt(H, 1, "svelte-flow__pane svelte-flow__container", null, N, A), [ + return Ae(P, d), W(H), Nt(H, (A) => f = A, () => f), Oe((A) => N = qt(H, 1, "svelte-flow__pane svelte-flow__container", null, N, A), [ () => ({ draggable: r() === !0 || Array.isArray(r()) && r().includes(0), dragging: n().dragging, @@ -10235,7 +10235,7 @@ se( [], !0 ); -var A2 = /* @__PURE__ */ ne('
'); +var A2 = /* @__PURE__ */ re('
'); function Ah(t, e) { ue(e, !0); let n = v(e, "store", 15), r = v(e, "children", 7); @@ -10255,7 +10255,7 @@ function Ah(t, e) { }, i = A2(); let s; var a = Z(i); - return Oe(a, r), W(i), Te(() => s = Pt(i, "", s, { + return Ae(a, r), W(i), Oe(() => s = Pt(i, "", s, { transform: `translate(${n().viewport.x ?? ""}px, ${n().viewport.y ?? ""}px) scale(${n().viewport.zoom ?? ""})` })), O(t, i), ce(o); } @@ -10315,10 +10315,10 @@ function Dh(t, e) { } }; } -var D2 = /* @__PURE__ */ ne('
'), I2 = /* @__PURE__ */ ne('
', 1); +var D2 = /* @__PURE__ */ re('
'), I2 = /* @__PURE__ */ re('
', 1); const M2 = { - hash: "svelte-1u4lacj", - code: ".a11y-hidden.svelte-1u4lacj {display:none;}.a11y-live-msg.svelte-1u4lacj {position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(0px, 0px, 0px, 0px);clip-path:inset(100%);}" + hash: "svelte-1hjqgza", + code: ".a11y-hidden.svelte-1hjqgza {display:none;}.a11y-live-msg.svelte-1hjqgza {position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(0px, 0px, 0px, 0px);clip-path:inset(100%);}" }; function Ih(t, e) { ue(e, !0), Je(t, M2); @@ -10332,202 +10332,202 @@ function Ih(t, e) { } }, o = I2(), i = J(o), s = Z(i, !0); W(i); - var a = z(i, 2), u = Z(a, !0); + var a = V(i, 2), u = Z(a, !0); W(a); - var l = z(a, 2); + var l = V(a, 2); { var d = (f) => { var h = D2(), p = Z(h, !0); - W(h), Te(() => { - Ne(h, "id", `${L2}-${n().flowId}`), tt(p, n().ariaLiveMessage); + W(h), Oe(() => { + Pe(h, "id", `${L2}-${n().flowId}`), tt(p, n().ariaLiveMessage); }), O(f, h); }; ie(l, (f) => { n().disableKeyboardA11y || f(d); }); } - return Te(() => { - Ne(i, "id", `${Mh}-${n().flowId}`), tt(s, n().disableKeyboardA11y ? n().ariaLabelConfig["node.a11yDescription.default"] : n().ariaLabelConfig["node.a11yDescription.keyboardDisabled"]), Ne(a, "id", `${Lh}-${n().flowId}`), tt(u, n().ariaLabelConfig["edge.a11yDescription.default"]); + return Oe(() => { + Pe(i, "id", `${Mh}-${n().flowId}`), tt(s, n().disableKeyboardA11y ? n().ariaLabelConfig["node.a11yDescription.default"] : n().ariaLabelConfig["node.a11yDescription.keyboardDisabled"]), Pe(a, "id", `${Lh}-${n().flowId}`), tt(u, n().ariaLabelConfig["edge.a11yDescription.default"]); }), O(t, o), ce(r); } se(Ih, { store: {} }, [], [], !0); const Mh = "svelte-flow__node-desc", Lh = "svelte-flow__edge-desc", L2 = "svelte-flow__aria-live"; -var H2 = /* @__PURE__ */ ne("
"); +var H2 = /* @__PURE__ */ re("
"); function Hh(t, e) { ue(e, !0); - let n = v(e, "store", 15), r = v(e, "node", 7), o = v(e, "resizeObserver", 7), i = v(e, "nodeClickDistance", 7), s = v(e, "onnodeclick", 7), a = v(e, "onnodedrag", 7), u = v(e, "onnodedragstart", 7), l = v(e, "onnodedragstop", 7), d = v(e, "onnodepointerenter", 7), f = v(e, "onnodepointerleave", 7), h = v(e, "onnodepointermove", 7), p = v(e, "onnodecontextmenu", 7), m = /* @__PURE__ */ C(() => Lt(r().data, () => ({}), !0)), y = /* @__PURE__ */ C(() => Lt(r().selected, !1)), w = /* @__PURE__ */ C(() => r().draggable), b = /* @__PURE__ */ C(() => r().selectable), S = /* @__PURE__ */ C(() => Lt(r().deletable, !0)), E = /* @__PURE__ */ C(() => r().connectable), x = /* @__PURE__ */ C(() => r().focusable), _ = /* @__PURE__ */ C(() => Lt(r().hidden, !1)), T = /* @__PURE__ */ C(() => Lt(r().dragging, !1)), I = /* @__PURE__ */ C(() => Lt(r().style, "")), B = /* @__PURE__ */ C(() => r().class), $ = /* @__PURE__ */ C(() => Lt(r().type, "default")), H = /* @__PURE__ */ C(() => r().parentId), N = /* @__PURE__ */ C(() => r().sourcePosition), k = /* @__PURE__ */ C(() => r().targetPosition), D = /* @__PURE__ */ C(() => Lt(r().measured, () => ({ width: 0, height: 0 }), !0).width), P = /* @__PURE__ */ C(() => Lt(r().measured, () => ({ width: 0, height: 0 }), !0).height), A = /* @__PURE__ */ C(() => r().initialWidth), R = /* @__PURE__ */ C(() => r().initialHeight), M = /* @__PURE__ */ C(() => r().width), Y = /* @__PURE__ */ C(() => r().height), U = /* @__PURE__ */ C(() => r().dragHandle), V = /* @__PURE__ */ C(() => Lt(r().internals.z, 0)), j = /* @__PURE__ */ C(() => r().internals.positionAbsolute.x), q = /* @__PURE__ */ C(() => r().internals.positionAbsolute.y), F = /* @__PURE__ */ C(() => r().internals.userNode), { id: Q } = r(), X = /* @__PURE__ */ C(() => c(w) ?? n().nodesDraggable), re = /* @__PURE__ */ C(() => c(b) ?? n().elementsSelectable), ee = /* @__PURE__ */ C(() => c(E) ?? n().nodesConnectable), L = /* @__PURE__ */ C(() => Qf(r())), te = /* @__PURE__ */ C(() => !!r().internals.handleBounds), ve = /* @__PURE__ */ C(() => c(L) && c(te)), ae = /* @__PURE__ */ C(() => c(x) ?? n().nodesFocusable); - function le(he) { - return n().parentLookup.has(he); + let n = v(e, "store", 15), r = v(e, "node", 7), o = v(e, "resizeObserver", 7), i = v(e, "nodeClickDistance", 7), s = v(e, "onnodeclick", 7), a = v(e, "onnodedrag", 7), u = v(e, "onnodedragstart", 7), l = v(e, "onnodedragstop", 7), d = v(e, "onnodepointerenter", 7), f = v(e, "onnodepointerleave", 7), h = v(e, "onnodepointermove", 7), p = v(e, "onnodecontextmenu", 7), m = /* @__PURE__ */ C(() => Ht(r().data, () => ({}), !0)), y = /* @__PURE__ */ C(() => Ht(r().selected, !1)), w = /* @__PURE__ */ C(() => r().draggable), b = /* @__PURE__ */ C(() => r().selectable), S = /* @__PURE__ */ C(() => Ht(r().deletable, !0)), E = /* @__PURE__ */ C(() => r().connectable), x = /* @__PURE__ */ C(() => r().focusable), _ = /* @__PURE__ */ C(() => Ht(r().hidden, !1)), T = /* @__PURE__ */ C(() => Ht(r().dragging, !1)), I = /* @__PURE__ */ C(() => Ht(r().style, "")), F = /* @__PURE__ */ C(() => r().class), $ = /* @__PURE__ */ C(() => Ht(r().type, "default")), H = /* @__PURE__ */ C(() => r().parentId), N = /* @__PURE__ */ C(() => r().sourcePosition), k = /* @__PURE__ */ C(() => r().targetPosition), D = /* @__PURE__ */ C(() => Ht(r().measured, () => ({ width: 0, height: 0 }), !0).width), P = /* @__PURE__ */ C(() => Ht(r().measured, () => ({ width: 0, height: 0 }), !0).height), A = /* @__PURE__ */ C(() => r().initialWidth), R = /* @__PURE__ */ C(() => r().initialHeight), M = /* @__PURE__ */ C(() => r().width), Y = /* @__PURE__ */ C(() => r().height), G = /* @__PURE__ */ C(() => r().dragHandle), z = /* @__PURE__ */ C(() => Ht(r().internals.z, 0)), Q = /* @__PURE__ */ C(() => r().internals.positionAbsolute.x), j = /* @__PURE__ */ C(() => r().internals.positionAbsolute.y), B = /* @__PURE__ */ C(() => r().internals.userNode), { id: te } = r(), q = /* @__PURE__ */ C(() => c(w) ?? n().nodesDraggable), ee = /* @__PURE__ */ C(() => c(b) ?? n().elementsSelectable), X = /* @__PURE__ */ C(() => c(E) ?? n().nodesConnectable), L = /* @__PURE__ */ C(() => Qf(r())), ne = /* @__PURE__ */ C(() => !!r().internals.handleBounds), fe = /* @__PURE__ */ C(() => c(L) && c(ne)), le = /* @__PURE__ */ C(() => c(x) ?? n().nodesFocusable); + function ae(ge) { + return n().parentLookup.has(ge); } - let oe = /* @__PURE__ */ C(() => le(Q)), fe = /* @__PURE__ */ ye(null), we = null, xe = c($), pe = c(N), me = c(k), Ee = /* @__PURE__ */ C(() => n().nodeTypes[c($)] ?? Gl), G = /* @__PURE__ */ C(() => n().ariaLabelConfig); + let oe = /* @__PURE__ */ C(() => ae(te)), he = /* @__PURE__ */ me(null), we = null, _e = c($), ve = c(N), ye = c(k), Ne = /* @__PURE__ */ C(() => n().nodeTypes[c($)] ?? Gl), U = /* @__PURE__ */ C(() => n().ariaLabelConfig); zr("svelteflow__node_connectable", { get value() { - return c(ee); + return c(X); } - }), zr("svelteflow__node_id", Q); + }), zr("svelteflow__node_id", te); let be = /* @__PURE__ */ C(() => { - const he = c(D) === void 0 ? c(M) ?? c(A) : c(M), Ae = c(P) === void 0 ? c(Y) ?? c(R) : c(Y); - if (!(he === void 0 && Ae === void 0 && c(I) === void 0)) - return `${c(I)};${he ? `width:${Vn(he)};` : ""}${Ae ? `height:${Vn(Ae)};` : ""}`; + const ge = c(D) === void 0 ? c(M) ?? c(A) : c(M), De = c(P) === void 0 ? c(Y) ?? c(R) : c(Y); + if (!(ge === void 0 && De === void 0 && c(I) === void 0)) + return `${c(I)};${ge ? `width:${Vn(ge)};` : ""}${De ? `height:${Vn(De)};` : ""}`; }); He(() => { - (c($) !== xe || c(N) !== pe || c(k) !== me) && c(fe) !== null && requestAnimationFrame(() => { - c(fe) !== null && n().updateNodeInternals(/* @__PURE__ */ new Map([[Q, { id: Q, nodeElement: c(fe), force: !0 }]])); - }), xe = c($), pe = c(N), me = c(k); + (c($) !== _e || c(N) !== ve || c(k) !== ye) && c(he) !== null && requestAnimationFrame(() => { + c(he) !== null && n().updateNodeInternals(/* @__PURE__ */ new Map([[te, { id: te, nodeElement: c(he), force: !0 }]])); + }), _e = c($), ve = c(N), ye = c(k); }), He(() => { - o() && (!c(ve) || c(fe) !== we) && (we && o().unobserve(we), c(fe) && o().observe(c(fe)), we = c(fe)); + o() && (!c(fe) || c(he) !== we) && (we && o().unobserve(we), c(he) && o().observe(c(he)), we = c(he)); }), ui(() => { we && o()?.unobserve(we); }); - function De(he) { - c(re) && (!n().selectNodesOnDrag || !c(X) || n().nodeDragThreshold > 0) && n().handleNodeSelection(Q), s()?.({ node: c(F), event: he }); - } - function Pe(he) { - if (!(nh(he) || n().disableKeyboardA11y)) - if (qf.includes(he.key) && c(re)) { - const Ae = he.key === "Escape"; - n().handleNodeSelection(Q, Ae, c(fe)); - } else c(X) && r().selected && Object.prototype.hasOwnProperty.call(vs, he.key) && (he.preventDefault(), n( - n().ariaLiveMessage = c(G)["node.a11yDescription.ariaLiveMessage"]({ - direction: he.key.replace("Arrow", "").toLowerCase(), + function Te(ge) { + c(ee) && (!n().selectNodesOnDrag || !c(q) || n().nodeDragThreshold > 0) && n().handleNodeSelection(te), s()?.({ node: c(B), event: ge }); + } + function Ee(ge) { + if (!(nh(ge) || n().disableKeyboardA11y)) + if (Yf.includes(ge.key) && c(ee)) { + const De = ge.key === "Escape"; + n().handleNodeSelection(te, De, c(he)); + } else c(q) && r().selected && Object.prototype.hasOwnProperty.call(vs, ge.key) && (ge.preventDefault(), n( + n().ariaLiveMessage = c(U)["node.a11yDescription.ariaLiveMessage"]({ + direction: ge.key.replace("Arrow", "").toLowerCase(), x: ~~r().internals.positionAbsolute.x, y: ~~r().internals.positionAbsolute.y }), !0 - ), n().moveSelectedNodes(vs[he.key], he.shiftKey ? 4 : 1)); + ), n().moveSelectedNodes(vs[ge.key], ge.shiftKey ? 4 : 1)); } const Xe = () => { - if (n().disableKeyboardA11y || !n().autoPanOnNodeFocus || !c(fe)?.matches(":focus-visible")) + if (n().disableKeyboardA11y || !n().autoPanOnNodeFocus || !c(he)?.matches(":focus-visible")) return; - const { width: he, height: Ae, viewport: et } = n(); - Zl(/* @__PURE__ */ new Map([[Q, r()]]), { x: 0, y: 0, width: he, height: Ae }, [et.x, et.y, et.zoom], !0).length > 0 || n().setCenter(r().position.x + (r().measured.width ?? 0) / 2, r().position.y + (r().measured.height ?? 0) / 2, { zoom: et.zoom }); + const { width: ge, height: De, viewport: et } = n(); + Zl(/* @__PURE__ */ new Map([[te, r()]]), { x: 0, y: 0, width: ge, height: De }, [et.x, et.y, et.zoom], !0).length > 0 || n().setCenter(r().position.x + (r().measured.width ?? 0) / 2, r().position.y + (r().measured.height ?? 0) / 2, { zoom: et.zoom }); }; - var je = { + var Ue = { get store() { return n(); }, - set store(he) { - n(he), g(); + set store(ge) { + n(ge), g(); }, get node() { return r(); }, - set node(he) { - r(he), g(); + set node(ge) { + r(ge), g(); }, get resizeObserver() { return o(); }, - set resizeObserver(he) { - o(he), g(); + set resizeObserver(ge) { + o(ge), g(); }, get nodeClickDistance() { return i(); }, - set nodeClickDistance(he) { - i(he), g(); + set nodeClickDistance(ge) { + i(ge), g(); }, get onnodeclick() { return s(); }, - set onnodeclick(he) { - s(he), g(); + set onnodeclick(ge) { + s(ge), g(); }, get onnodedrag() { return a(); }, - set onnodedrag(he) { - a(he), g(); + set onnodedrag(ge) { + a(ge), g(); }, get onnodedragstart() { return u(); }, - set onnodedragstart(he) { - u(he), g(); + set onnodedragstart(ge) { + u(ge), g(); }, get onnodedragstop() { return l(); }, - set onnodedragstop(he) { - l(he), g(); + set onnodedragstop(ge) { + l(ge), g(); }, get onnodepointerenter() { return d(); }, - set onnodepointerenter(he) { - d(he), g(); + set onnodepointerenter(ge) { + d(ge), g(); }, get onnodepointerleave() { return f(); }, - set onnodepointerleave(he) { - f(he), g(); + set onnodepointerleave(ge) { + f(ge), g(); }, get onnodepointermove() { return h(); }, - set onnodepointermove(he) { - h(he), g(); + set onnodepointermove(ge) { + h(ge), g(); }, get onnodecontextmenu() { return p(); }, - set onnodecontextmenu(he) { - p(he), g(); + set onnodecontextmenu(ge) { + p(ge), g(); } - }, Ke = de(), rt = J(Ke); + }, We = de(), rt = J(We); { - var Tt = (he) => { - var Ae = H2(); - Ge(Ae, () => ({ - "data-id": Q, + var Tt = (ge) => { + var De = H2(); + Ge(De, () => ({ + "data-id": te, class: [ "svelte-flow__node", `svelte-flow__node-${c($)}`, - c(B) + c(F) ], style: c(be), - onclick: De, - onpointerenter: d() ? (Ze) => d()({ node: c(F), event: Ze }) : void 0, - onpointerleave: f() ? (Ze) => f()({ node: c(F), event: Ze }) : void 0, - onpointermove: h() ? (Ze) => h()({ node: c(F), event: Ze }) : void 0, - oncontextmenu: p() ? (Ze) => p()({ node: c(F), event: Ze }) : void 0, - onkeydown: c(ae) ? Pe : void 0, - onfocus: c(ae) ? Xe : void 0, - tabIndex: c(ae) ? 0 : void 0, - role: r().ariaRole ?? (c(ae) ? "group" : void 0), + onclick: Te, + onpointerenter: d() ? (Ze) => d()({ node: c(B), event: Ze }) : void 0, + onpointerleave: f() ? (Ze) => f()({ node: c(B), event: Ze }) : void 0, + onpointermove: h() ? (Ze) => h()({ node: c(B), event: Ze }) : void 0, + oncontextmenu: p() ? (Ze) => p()({ node: c(B), event: Ze }) : void 0, + onkeydown: c(le) ? Ee : void 0, + onfocus: c(le) ? Xe : void 0, + tabIndex: c(le) ? 0 : void 0, + role: r().ariaRole ?? (c(le) ? "group" : void 0), "aria-roledescription": "node", "aria-describedby": n().disableKeyboardA11y ? void 0 : `${Mh}-${n().flowId}`, ...r().domAttributes, [fr]: { dragging: c(T), selected: c(y), - draggable: c(X), - connectable: c(ee), - selectable: c(re), - nopan: c(X), + draggable: c(q), + connectable: c(X), + selectable: c(ee), + nopan: c(q), parent: c(oe) }, [Tn]: { - "z-index": c(V), - transform: `translate(${c(j) ?? ""}px, ${c(q) ?? ""}px)`, + "z-index": c(z), + transform: `translate(${c(Q) ?? ""}px, ${c(j) ?? ""}px)`, visibility: c(L) ? "visible" : "hidden" } })); - var et = Z(Ae); - xt(et, () => c(Ee), (Ze, at) => { + var et = Z(De); + xt(et, () => c(Ne), (Ze, at) => { at(Ze, { get data() { return c(m); }, get id() { - return Q; + return te; }, get selected() { return c(y); }, get selectable() { - return c(re); + return c(ee); }, get deletable() { return c(S); @@ -10539,16 +10539,16 @@ function Hh(t, e) { return c(k); }, get zIndex() { - return c(V); + return c(z); }, get dragging() { return c(T); }, get draggable() { - return c(X); + return c(q); }, get dragHandle() { - return c(U); + return c(G); }, get parentId() { return c(H); @@ -10557,13 +10557,13 @@ function Hh(t, e) { return c($); }, get isConnectable() { - return c(ee); + return c(X); }, get positionAbsoluteX() { - return c(j); + return c(Q); }, get positionAbsoluteY() { - return c(q); + return c(j); }, get width() { return c(M); @@ -10572,11 +10572,11 @@ function Hh(t, e) { return c(Y); } }); - }), W(Ae), At(Ae, (Ze, at) => Dh?.(Ze, at), () => ({ - nodeId: Q, - isSelectable: c(re), - disabled: !c(X), - handleSelector: c(U), + }), W(De), At(De, (Ze, at) => Dh?.(Ze, at), () => ({ + nodeId: te, + isSelectable: c(ee), + disabled: !c(q), + handleSelector: c(G), noDragClass: n().noDragClass, nodeClickDistance: i(), onNodeMouseDown: n().handleNodeSelection, @@ -10590,13 +10590,13 @@ function Hh(t, e) { l()?.({ event: Ze, targetNode: st, nodes: lt }); }, store: n() - })), Nt(Ae, (Ze) => K(fe, Ze), () => c(fe)), O(he, Ae); + })), Nt(De, (Ze) => K(he, Ze), () => c(he)), O(ge, De); }; - ie(rt, (he) => { - c(_) || he(Tt); + ie(rt, (ge) => { + c(_) || ge(Tt); }); } - return O(t, Ke), ce(je); + return O(t, We), ce(Ue); } se( Hh, @@ -10618,7 +10618,7 @@ se( [], !0 ); -var V2 = /* @__PURE__ */ ne('
'); +var V2 = /* @__PURE__ */ re('
'); function Vh(t, e) { ue(e, !0); let n = v(e, "store", 15), r = v(e, "nodeClickDistance", 7), o = v(e, "onnodeclick", 7), i = v(e, "onnodecontextmenu", 7), s = v(e, "onnodepointerenter", 7), a = v(e, "onnodepointermove", 7), u = v(e, "onnodepointerleave", 7), l = v(e, "onnodedrag", 7), d = v(e, "onnodedragstart", 7), f = v(e, "onnodedragstop", 7); @@ -10756,29 +10756,29 @@ se( [], !0 ); -var z2 = /* @__PURE__ */ _e(''); +var z2 = /* @__PURE__ */ xe(''); function zh(t, e) { ue(e, !0); const n = v(e, "edge", 7), r = v(e, "store", 15), o = v(e, "onedgeclick", 7), i = v(e, "onedgecontextmenu", 7), s = v(e, "onedgepointerenter", 7), a = v(e, "onedgepointerleave", 7); - let u = /* @__PURE__ */ C(() => n().source), l = /* @__PURE__ */ C(() => n().target), d = /* @__PURE__ */ C(() => n().sourceX), f = /* @__PURE__ */ C(() => n().sourceY), h = /* @__PURE__ */ C(() => n().targetX), p = /* @__PURE__ */ C(() => n().targetY), m = /* @__PURE__ */ C(() => n().sourcePosition), y = /* @__PURE__ */ C(() => n().targetPosition), w = /* @__PURE__ */ C(() => Lt(n().animated, !1)), b = /* @__PURE__ */ C(() => Lt(n().selected, !1)), S = /* @__PURE__ */ C(() => n().label), E = /* @__PURE__ */ C(() => n().labelStyle), x = /* @__PURE__ */ C(() => Lt(n().data, () => ({}), !0)), _ = /* @__PURE__ */ C(() => n().style), T = /* @__PURE__ */ C(() => n().interactionWidth), I = /* @__PURE__ */ C(() => Lt(n().type, "default")), B = /* @__PURE__ */ C(() => n().sourceHandle), $ = /* @__PURE__ */ C(() => n().targetHandle), H = /* @__PURE__ */ C(() => n().markerStart), N = /* @__PURE__ */ C(() => n().markerEnd), k = /* @__PURE__ */ C(() => n().selectable), D = /* @__PURE__ */ C(() => n().focusable), P = /* @__PURE__ */ C(() => Lt(n().deletable, !0)), A = /* @__PURE__ */ C(() => n().hidden), R = /* @__PURE__ */ C(() => n().zIndex), M = /* @__PURE__ */ C(() => n().class), Y = /* @__PURE__ */ C(() => n().ariaLabel), U = null; - const { id: V } = n(); - zr("svelteflow__edge_id", V); - let j = /* @__PURE__ */ C(() => c(k) ?? r().elementsSelectable), q = /* @__PURE__ */ C(() => c(D) ?? r().edgesFocusable), F = /* @__PURE__ */ C(() => r().edgeTypes[c(I)] ?? Jl), Q = /* @__PURE__ */ C(() => c(H) ? `url('#${Ya(c(H), r().flowId)}')` : void 0), X = /* @__PURE__ */ C(() => c(N) ? `url('#${Ya(c(N), r().flowId)}')` : void 0); - function re(oe) { - const fe = r().edgeLookup.get(V); - fe && (c(j) && r().handleEdgeSelection(V), o()?.({ event: oe, edge: fe })); - } - function ee(oe, fe) { - const we = r().edgeLookup.get(V); - we && fe({ event: oe, edge: we }); + let u = /* @__PURE__ */ C(() => n().source), l = /* @__PURE__ */ C(() => n().target), d = /* @__PURE__ */ C(() => n().sourceX), f = /* @__PURE__ */ C(() => n().sourceY), h = /* @__PURE__ */ C(() => n().targetX), p = /* @__PURE__ */ C(() => n().targetY), m = /* @__PURE__ */ C(() => n().sourcePosition), y = /* @__PURE__ */ C(() => n().targetPosition), w = /* @__PURE__ */ C(() => Ht(n().animated, !1)), b = /* @__PURE__ */ C(() => Ht(n().selected, !1)), S = /* @__PURE__ */ C(() => n().label), E = /* @__PURE__ */ C(() => n().labelStyle), x = /* @__PURE__ */ C(() => Ht(n().data, () => ({}), !0)), _ = /* @__PURE__ */ C(() => n().style), T = /* @__PURE__ */ C(() => n().interactionWidth), I = /* @__PURE__ */ C(() => Ht(n().type, "default")), F = /* @__PURE__ */ C(() => n().sourceHandle), $ = /* @__PURE__ */ C(() => n().targetHandle), H = /* @__PURE__ */ C(() => n().markerStart), N = /* @__PURE__ */ C(() => n().markerEnd), k = /* @__PURE__ */ C(() => n().selectable), D = /* @__PURE__ */ C(() => n().focusable), P = /* @__PURE__ */ C(() => Ht(n().deletable, !0)), A = /* @__PURE__ */ C(() => n().hidden), R = /* @__PURE__ */ C(() => n().zIndex), M = /* @__PURE__ */ C(() => n().class), Y = /* @__PURE__ */ C(() => n().ariaLabel), G = null; + const { id: z } = n(); + zr("svelteflow__edge_id", z); + let Q = /* @__PURE__ */ C(() => c(k) ?? r().elementsSelectable), j = /* @__PURE__ */ C(() => c(D) ?? r().edgesFocusable), B = /* @__PURE__ */ C(() => r().edgeTypes[c(I)] ?? Jl), te = /* @__PURE__ */ C(() => c(H) ? `url('#${qa(c(H), r().flowId)}')` : void 0), q = /* @__PURE__ */ C(() => c(N) ? `url('#${qa(c(N), r().flowId)}')` : void 0); + function ee(oe) { + const he = r().edgeLookup.get(z); + he && (c(Q) && r().handleEdgeSelection(z), o()?.({ event: oe, edge: he })); + } + function X(oe, he) { + const we = r().edgeLookup.get(z); + we && he({ event: oe, edge: we }); } function L(oe) { - if (!r().disableKeyboardA11y && qf.includes(oe.key) && c(j)) { - const { unselectNodesAndEdges: fe, addSelectedEdges: we } = r(); - oe.key === "Escape" ? (U?.blur(), fe({ edges: [n()] })) : we([V]); + if (!r().disableKeyboardA11y && Yf.includes(oe.key) && c(Q)) { + const { unselectNodesAndEdges: he, addSelectedEdges: we } = r(); + oe.key === "Escape" ? (G?.blur(), he({ edges: [n()] })) : we([z]); } } - var te = { + var ne = { get edge() { return n(); }, @@ -10815,43 +10815,43 @@ function zh(t, e) { set onedgepointerleave(oe) { a(oe), g(); } - }, ve = de(), ae = J(ve); + }, fe = de(), le = J(fe); { - var le = (oe) => { - var fe = z2(); + var ae = (oe) => { + var he = z2(); let we; - var xe = Z(fe); - Ge(xe, () => ({ + var _e = Z(he); + Ge(_e, () => ({ class: ["svelte-flow__edge", c(M)], - "data-id": V, - onclick: re, - oncontextmenu: i() ? (me) => { - ee(me, i()); + "data-id": z, + onclick: ee, + oncontextmenu: i() ? (ye) => { + X(ye, i()); } : void 0, - onpointerenter: s() ? (me) => { - ee(me, s()); + onpointerenter: s() ? (ye) => { + X(ye, s()); } : void 0, - onpointerleave: a() ? (me) => { - ee(me, a()); + onpointerleave: a() ? (ye) => { + X(ye, a()); } : void 0, "aria-label": c(Y) === null ? void 0 : c(Y) ? c(Y) : `Edge from ${c(u)} to ${c(l)}`, - "aria-describedby": c(q) ? `${Lh}-${r().flowId}` : void 0, - role: n().ariaRole ?? (c(q) ? "group" : "img"), + "aria-describedby": c(j) ? `${Lh}-${r().flowId}` : void 0, + role: n().ariaRole ?? (c(j) ? "group" : "img"), "aria-roledescription": "edge", - onkeydown: c(q) ? L : void 0, - tabindex: c(q) ? 0 : void 0, + onkeydown: c(j) ? L : void 0, + tabindex: c(j) ? 0 : void 0, ...n().domAttributes, [fr]: { animated: c(w), selected: c(b), - selectable: c(j) + selectable: c(Q) } })); - var pe = Z(xe); - xt(pe, () => c(F), (me, Ee) => { - Ee(me, { + var ve = Z(_e); + xt(ve, () => c(B), (ye, Ne) => { + Ne(ye, { get id() { - return V; + return z; }, get source() { return c(u); @@ -10899,7 +10899,7 @@ function zh(t, e) { return c(T); }, get selectable() { - return c(j); + return c(Q); }, get deletable() { return c(P); @@ -10908,25 +10908,25 @@ function zh(t, e) { return c(I); }, get sourceHandleId() { - return c(B); + return c(F); }, get targetHandleId() { return c($); }, get markerStart() { - return c(Q); + return c(te); }, get markerEnd() { - return c(X); + return c(q); } }); - }), W(xe), Nt(xe, (me) => U = me, () => U), W(fe), Te(() => we = Pt(fe, "", we, { "z-index": c(R) })), O(oe, fe); + }), W(_e), Nt(_e, (ye) => G = ye, () => G), W(he), Oe(() => we = Pt(he, "", we, { "z-index": c(R) })), O(oe, he); }; - ie(ae, (oe) => { - c(A) || oe(le); + ie(le, (oe) => { + c(A) || oe(ae); }); } - return O(t, ve), ce(te); + return O(t, fe), ce(ne); } se( zh, @@ -10943,7 +10943,7 @@ se( !0 ); kp(); -var R2 = /* @__PURE__ */ _e(""); +var R2 = /* @__PURE__ */ xe(""); function Rh(t, e) { ue(e, !1); const n = Sn(); @@ -10954,7 +10954,7 @@ function Rh(t, e) { }), W(r), O(t, r), ce(); } se(Rh, {}, [], [], !0); -var F2 = /* @__PURE__ */ _e(''), B2 = /* @__PURE__ */ _e(''), $2 = /* @__PURE__ */ _e(''); +var F2 = /* @__PURE__ */ xe(''), B2 = /* @__PURE__ */ xe(''), $2 = /* @__PURE__ */ xe(''); function Fh(t, e) { ue(e, !0); let n = v(e, "id", 7), r = v(e, "type", 7), o = v(e, "width", 7, 12.5), i = v(e, "height", 7, 12.5), s = v(e, "markerUnits", 7, "strokeWidth"), a = v(e, "orient", 7, "auto-start-reverse"), u = v(e, "color", 7, "none"), l = v(e, "strokeWidth", 7); @@ -11012,8 +11012,8 @@ function Fh(t, e) { var p = (y) => { var w = F2(); let b; - Te(() => { - Ne(w, "stroke-width", l()), b = Pt(w, "", b, { stroke: u() }); + Oe(() => { + Pe(w, "stroke-width", l()), b = Pt(w, "", b, { stroke: u() }); }), O(y, w); }, m = (y) => { var w = de(), b = J(w); @@ -11021,8 +11021,8 @@ function Fh(t, e) { var S = (E) => { var x = B2(); let _; - Te(() => { - Ne(x, "stroke-width", l()), _ = Pt(x, "", _, { stroke: u(), fill: u() }); + Oe(() => { + Pe(x, "stroke-width", l()), _ = Pt(x, "", _, { stroke: u(), fill: u() }); }), O(E, x); }; ie( @@ -11039,8 +11039,8 @@ function Fh(t, e) { r() === Uo.Arrow ? y(p) : y(m, !1); }); } - return W(f), Te(() => { - Ne(f, "id", n()), Ne(f, "markerWidth", `${o()}`), Ne(f, "markerHeight", `${i()}`), Ne(f, "markerUnits", s()), Ne(f, "orient", a()); + return W(f), Oe(() => { + Pe(f, "id", n()), Pe(f, "markerWidth", `${o()}`), Pe(f, "markerHeight", `${i()}`), Pe(f, "markerUnits", s()), Pe(f, "orient", a()); }), O(t, f), ce(d); } se( @@ -11059,7 +11059,7 @@ se( [], !0 ); -var K2 = /* @__PURE__ */ ne('
'); +var K2 = /* @__PURE__ */ re('
'); function Bh(t, e) { ue(e, !0); let n = v(e, "store", 15), r = v(e, "onedgeclick", 7), o = v(e, "onedgecontextmenu", 7), i = v(e, "onedgepointerenter", 7), s = v(e, "onedgepointerleave", 7); @@ -11096,7 +11096,7 @@ function Bh(t, e) { } }, u = K2(), l = Z(u), d = Z(l); Rh(d, {}), W(l); - var f = z(l, 2); + var f = V(l, 2); return Ct(f, 17, () => n().visible.edges.values(), (h) => h.id, (h, p) => { zh(h, { get edge() { @@ -11136,10 +11136,10 @@ se( [], !0 ); -var W2 = /* @__PURE__ */ ne('
'); +var W2 = /* @__PURE__ */ re('
'); const Z2 = { - hash: "svelte-qtk83j", - code: ".svelte-flow__selection.svelte-qtk83j {position:absolute;top:0;left:0;}" + hash: "svelte-vludwi", + code: ".svelte-flow__selection.svelte-vludwi {position:absolute;top:0;left:0;}" }; function Ql(t, e) { ue(e, !0), Je(t, Z2); @@ -11180,7 +11180,7 @@ function Ql(t, e) { var d = (f) => { var h = W2(); let p; - Te((m) => p = Pt(h, "", p, m), [ + Oe((m) => p = Pt(h, "", p, m), [ () => ({ width: typeof o() == "string" ? o() : Vn(o()), height: typeof i() == "string" ? i() : Vn(i()), @@ -11195,15 +11195,15 @@ function Ql(t, e) { return O(t, u), ce(a); } se(Ql, { x: {}, y: {}, width: {}, height: {}, isVisible: {} }, [], [], !0); -var Y2 = /* @__PURE__ */ ne("
"); -const q2 = { - hash: "svelte-c7g5lf", - code: `.svelte-flow__selection-wrapper.svelte-c7g5lf {position:absolute;top:0;left:0;z-index:2000;pointer-events:all;}.svelte-flow__selection-wrapper.svelte-c7g5lf:focus, - .svelte-flow__selection-wrapper.svelte-c7g5lf:focus-visible {outline:none;}` +var q2 = /* @__PURE__ */ re("
"); +const Y2 = { + hash: "svelte-1dj9ime", + code: `.svelte-flow__selection-wrapper.svelte-1dj9ime {position:absolute;top:0;left:0;z-index:2000;pointer-events:all;}.svelte-flow__selection-wrapper.svelte-1dj9ime:focus, + .svelte-flow__selection-wrapper.svelte-1dj9ime:focus-visible {outline:none;}` }; function $h(t, e) { - ue(e, !0), Je(t, q2); - let n = v(e, "store", 15), r = v(e, "onnodedrag", 7), o = v(e, "onnodedragstart", 7), i = v(e, "onnodedragstop", 7), s = v(e, "onselectionclick", 7), a = v(e, "onselectioncontextmenu", 7), u = /* @__PURE__ */ ye(void 0); + ue(e, !0), Je(t, Y2); + let n = v(e, "store", 15), r = v(e, "onnodedrag", 7), o = v(e, "onnodedragstart", 7), i = v(e, "onnodedragstop", 7), s = v(e, "onselectionclick", 7), a = v(e, "onselectioncontextmenu", 7), u = /* @__PURE__ */ me(void 0); He(() => { n().disableKeyboardA11y || c(u)?.focus({ preventScroll: !0 }); }); @@ -11267,7 +11267,7 @@ function $h(t, e) { }, m = de(), y = J(m); { var w = (b) => { - var S = Y2(); + var S = q2(); S.__contextmenu = d, S.__click = f, S.__keydown = function(..._) { (n().disableKeyboardA11y ? void 0 : h)?.apply(this, _); }; @@ -11276,18 +11276,18 @@ function $h(t, e) { Ql(x, { width: "100%", height: "100%", x: 0, y: 0 }), W(S), At(S, (_, T) => Dh?.(_, T), () => ({ disabled: !1, store: n(), - onDrag: (_, T, I, B) => { - r()?.({ event: _, targetNode: null, nodes: B }); + onDrag: (_, T, I, F) => { + r()?.({ event: _, targetNode: null, nodes: F }); }, - onDragStart: (_, T, I, B) => { - o()?.({ event: _, targetNode: null, nodes: B }); + onDragStart: (_, T, I, F) => { + o()?.({ event: _, targetNode: null, nodes: F }); }, - onDragStop: (_, T, I, B) => { - i()?.({ event: _, targetNode: null, nodes: B }); + onDragStop: (_, T, I, F) => { + i()?.({ event: _, targetNode: null, nodes: F }); } - })), Nt(S, (_) => K(u, _), () => c(u)), Te( + })), Nt(S, (_) => K(u, _), () => c(u)), Oe( (_) => { - Yt(S, 1, ur(["svelte-flow__selection-wrapper", n().noPanClass]), "svelte-c7g5lf"), Ne(S, "role", n().disableKeyboardA11y ? void 0 : "button"), Ne(S, "tabindex", n().disableKeyboardA11y ? void 0 : -1), E = Pt(S, "", E, _); + qt(S, 1, ur(["svelte-flow__selection-wrapper", n().noPanClass]), "svelte-1dj9ime"), Pe(S, "role", n().disableKeyboardA11y ? void 0 : "button"), Pe(S, "tabindex", n().disableKeyboardA11y ? void 0 : -1), E = Pt(S, "", E, _); }, [ () => ({ @@ -11299,7 +11299,7 @@ function $h(t, e) { ), O(b, S); }; ie(y, (b) => { - n().selectionRectMode === "nodes" && c(l) && Yn(c(l).x) && Yn(c(l).y) && b(w); + n().selectionRectMode === "nodes" && c(l) && qn(c(l).x) && qn(c(l).y) && b(w); }); } return O(t, m), ce(p); @@ -11319,7 +11319,7 @@ se( [], !0 ); -function X2(t) { +function j2(t) { switch (t) { case "ctrl": return 8; @@ -11353,7 +11353,7 @@ function En(t, e) { let E = !1; for (const x of S) if ((Array.isArray(x) ? x : [x]).reduce( - (T, I) => T | X2(I), + (T, I) => T | j2(I), 0 ) === l) { E = !0; @@ -11441,7 +11441,7 @@ function wt() { fitBounds: async (i, s) => { if (!c(t).panZoom) return Promise.resolve(!1); - const a = Yl(i, c(t).width, c(t).height, c(t).minZoom, c(t).maxZoom, s?.padding ?? 0.1); + const a = ql(i, c(t).width, c(t).height, c(t).minZoom, c(t).maxZoom, s?.padding ?? 0.1); return await c(t).panZoom.setViewport(a, { duration: s?.duration, ease: s?.ease, @@ -11650,7 +11650,7 @@ se( [], !0 ); -var j2 = /* @__PURE__ */ _e(''), U2 = /* @__PURE__ */ _e(''); +var X2 = /* @__PURE__ */ xe(''), U2 = /* @__PURE__ */ xe(''); function Wh(t, e) { ue(e, !0); let n = v(e, "store", 15), r = v(e, "type", 7), o = v(e, "containerStyle", 7), i = v(e, "style", 7), s = v(e, "LineComponent", 7), a = /* @__PURE__ */ C(() => { @@ -11675,7 +11675,7 @@ function Wh(t, e) { } case Wn.Step: case Wn.SmoothStep: { - const [p] = ql({ + const [p] = Yl({ ...h, borderRadius: r() === Wn.Step ? 0 : void 0 }); @@ -11725,18 +11725,18 @@ function Wh(t, e) { T(_, {}); }), O(S, E); }, b = (S) => { - var E = j2(); - Te(() => { - Ne(E, "d", c(a)), Pt(E, i()); + var E = X2(); + Oe(() => { + Pe(E, "d", c(a)), Pt(E, i()); }), O(S, E); }; ie(y, (S) => { s() ? S(w) : S(b, !1); }); } - W(m), W(p), Te( + W(m), W(p), Oe( (S) => { - Ne(p, "width", n().width), Ne(p, "height", n().height), Pt(p, o()), Yt(m, 0, S); + Pe(p, "width", n().width), Pe(p, "height", n().height), Pt(p, o()), qt(m, 0, S); }, [ () => ur([ @@ -11765,7 +11765,7 @@ se( [], !0 ); -var G2 = /* @__PURE__ */ ne("
"); +var G2 = /* @__PURE__ */ re("
"); function mi(t, e) { ue(e, !0); let n = v(e, "position", 7, "top-right"), r = v(e, "style", 7), o = v(e, "class", 7), i = v(e, "children", 7), s = /* @__PURE__ */ Le(e, [ @@ -11808,10 +11808,10 @@ function mi(t, e) { () => ["svelte-flow__panel", o(), ...c(a)] ]); var d = Z(l); - return Oe(d, () => i() ?? ze), W(l), O(t, l), ce(u); + return Ae(d, () => i() ?? ze), W(l), O(t, l), ce(u); } se(mi, { position: {}, style: {}, class: {}, children: {} }, [], [], !0); -var J2 = /* @__PURE__ */ ne('Svelte Flow'); +var J2 = /* @__PURE__ */ re('Svelte Flow'); function Zh(t, e) { ue(e, !0); let n = v(e, "proOptions", 7), r = v(e, "position", 7, "bottom-right"); @@ -11851,12 +11851,12 @@ function Zh(t, e) { return O(t, i), ce(o); } se(Zh, { proOptions: {}, position: {} }, [], [], !0); -var Q2 = /* @__PURE__ */ ne("
"); +var Q2 = /* @__PURE__ */ re("
"); const eb = { - hash: "svelte-15m40wc", - code: ".svelte-flow.svelte-15m40wc {width:100%;height:100%;overflow:hidden;position:relative;z-index:0;background-color:var(--background-color, var(--background-color-default));}:root {--background-color-default: #fff;--background-pattern-color-default: #ddd;--minimap-mask-color-default: rgb(240, 240, 240, 0.6);--minimap-mask-stroke-color-default: none;--minimap-mask-stroke-width-default: 1;--controls-button-background-color-default: #fefefe;--controls-button-background-color-hover-default: #f4f4f4;--controls-button-color-default: inherit;--controls-button-color-hover-default: inherit;--controls-button-border-color-default: #eee;}" + hash: "svelte-1148v31", + code: ".svelte-flow.svelte-1148v31 {width:100%;height:100%;overflow:hidden;position:relative;z-index:0;background-color:var(--background-color, var(--background-color-default));}:root {--background-color-default: #fff;--background-pattern-color-default: #ddd;--minimap-mask-color-default: rgb(240, 240, 240, 0.6);--minimap-mask-stroke-color-default: none;--minimap-mask-stroke-width-default: 1;--controls-button-background-color-default: #fefefe;--controls-button-background-color-hover-default: #f4f4f4;--controls-button-color-default: inherit;--controls-button-color-hover-default: inherit;--controls-button-border-color-default: #eee;}" }; -function Yh(t, e) { +function qh(t, e) { ue(e, !0), Je(t, eb); let n = v(e, "width", 7), r = v(e, "height", 7), o = v(e, "colorMode", 7), i = v(e, "domNode", 15), s = v(e, "clientWidth", 15), a = v(e, "clientHeight", 15), u = v(e, "children", 7), l = v(e, "rest", 7), d = /* @__PURE__ */ C(() => l().class), f = /* @__PURE__ */ C(() => Jp(l(), [ "id", @@ -11999,13 +11999,13 @@ function Yh(t, e) { ], void 0, void 0, - "svelte-15m40wc" + "svelte-1148v31" ); var y = Z(m); - return Oe(y, () => u() ?? ze), W(m), Nt(m, (w) => i(w), () => i()), $u(m, "clientHeight", a), $u(m, "clientWidth", s), O(t, m), ce(p); + return Ae(y, () => u() ?? ze), W(m), Nt(m, (w) => i(w), () => i()), $u(m, "clientHeight", a), $u(m, "clientWidth", s), O(t, m), ce(p); } se( - Yh, + qh, { width: {}, height: {}, @@ -12020,11 +12020,11 @@ se( [], !0 ); -var tb = /* @__PURE__ */ ne('
', 1), nb = /* @__PURE__ */ ne(" ", 1), rb = /* @__PURE__ */ ne(" ", 1); -function qh(t, e) { +var tb = /* @__PURE__ */ re('
', 1), nb = /* @__PURE__ */ re(" ", 1), rb = /* @__PURE__ */ re(" ", 1); +function Yh(t, e) { ue(e, !0); - let n = v(e, "width", 7), r = v(e, "height", 7), o = v(e, "proOptions", 7), i = v(e, "selectionKey", 7), s = v(e, "deleteKey", 7), a = v(e, "panActivationKey", 7), u = v(e, "multiSelectionKey", 7), l = v(e, "zoomActivationKey", 7), d = v(e, "paneClickDistance", 7, 1), f = v(e, "nodeClickDistance", 7, 1), h = v(e, "onmovestart", 7), p = v(e, "onmoveend", 7), m = v(e, "onmove", 7), y = v(e, "oninit", 7), w = v(e, "onnodeclick", 7), b = v(e, "onnodecontextmenu", 7), S = v(e, "onnodedrag", 7), E = v(e, "onnodedragstart", 7), x = v(e, "onnodedragstop", 7), _ = v(e, "onnodepointerenter", 7), T = v(e, "onnodepointermove", 7), I = v(e, "onnodepointerleave", 7), B = v(e, "onselectionclick", 7), $ = v(e, "onselectioncontextmenu", 7), H = v(e, "onselectionstart", 7), N = v(e, "onselectionend", 7), k = v(e, "onedgeclick", 7), D = v(e, "onedgecontextmenu", 7), P = v(e, "onedgepointerenter", 7), A = v(e, "onedgepointerleave", 7), R = v(e, "onpaneclick", 7), M = v(e, "onpanecontextmenu", 7), Y = v(e, "panOnScrollMode", 23, () => Lr.Free), U = v(e, "preventScrolling", 7, !0), V = v(e, "zoomOnScroll", 7, !0), j = v(e, "zoomOnDoubleClick", 7, !0), q = v(e, "zoomOnPinch", 7, !0), F = v(e, "panOnScroll", 7, !1), Q = v(e, "panOnScrollSpeed", 7, 0.5), X = v(e, "panOnDrag", 7, !0), re = v(e, "selectionOnDrag", 7, !1), ee = v(e, "connectionLineComponent", 7), L = v(e, "connectionLineStyle", 7), te = v(e, "connectionLineContainerStyle", 7), ve = v(e, "connectionLineType", 23, () => Wn.Bezier), ae = v(e, "attributionPosition", 7), le = v(e, "children", 7), oe = v(e, "nodes", 31, () => ht([])), fe = v(e, "edges", 31, () => ht([])), we = v(e, "viewport", 31, () => { - }), xe = /* @__PURE__ */ Le(e, [ + let n = v(e, "width", 7), r = v(e, "height", 7), o = v(e, "proOptions", 7), i = v(e, "selectionKey", 7), s = v(e, "deleteKey", 7), a = v(e, "panActivationKey", 7), u = v(e, "multiSelectionKey", 7), l = v(e, "zoomActivationKey", 7), d = v(e, "paneClickDistance", 7, 1), f = v(e, "nodeClickDistance", 7, 1), h = v(e, "onmovestart", 7), p = v(e, "onmoveend", 7), m = v(e, "onmove", 7), y = v(e, "oninit", 7), w = v(e, "onnodeclick", 7), b = v(e, "onnodecontextmenu", 7), S = v(e, "onnodedrag", 7), E = v(e, "onnodedragstart", 7), x = v(e, "onnodedragstop", 7), _ = v(e, "onnodepointerenter", 7), T = v(e, "onnodepointermove", 7), I = v(e, "onnodepointerleave", 7), F = v(e, "onselectionclick", 7), $ = v(e, "onselectioncontextmenu", 7), H = v(e, "onselectionstart", 7), N = v(e, "onselectionend", 7), k = v(e, "onedgeclick", 7), D = v(e, "onedgecontextmenu", 7), P = v(e, "onedgepointerenter", 7), A = v(e, "onedgepointerleave", 7), R = v(e, "onpaneclick", 7), M = v(e, "onpanecontextmenu", 7), Y = v(e, "panOnScrollMode", 23, () => Lr.Free), G = v(e, "preventScrolling", 7, !0), z = v(e, "zoomOnScroll", 7, !0), Q = v(e, "zoomOnDoubleClick", 7, !0), j = v(e, "zoomOnPinch", 7, !0), B = v(e, "panOnScroll", 7, !1), te = v(e, "panOnScrollSpeed", 7, 0.5), q = v(e, "panOnDrag", 7, !0), ee = v(e, "selectionOnDrag", 7, !1), X = v(e, "connectionLineComponent", 7), L = v(e, "connectionLineStyle", 7), ne = v(e, "connectionLineContainerStyle", 7), fe = v(e, "connectionLineType", 23, () => Wn.Bezier), le = v(e, "attributionPosition", 7), ae = v(e, "children", 7), oe = v(e, "nodes", 31, () => ht([])), he = v(e, "edges", 31, () => ht([])), we = v(e, "viewport", 31, () => { + }), _e = /* @__PURE__ */ Le(e, [ "$$slots", "$$events", "$$legacy", @@ -12079,348 +12079,348 @@ function qh(t, e) { "nodes", "edges", "viewport" - ]), pe = Nh({ - props: xe, + ]), ve = Nh({ + props: _e, width: n(), height: r(), get nodes() { return oe(); }, - set nodes(G) { - oe(G); + set nodes(U) { + oe(U); }, get edges() { - return fe(); + return he(); }, - set edges(G) { - fe(G); + set edges(U) { + he(U); }, get viewport() { return we(); }, - set viewport(G) { - we(G); + set viewport(U) { + we(U); } }); - const me = yn(ps); - me && me.setStore && me.setStore(pe), zr(ps, { + const ye = yn(ps); + ye && ye.setStore && ye.setStore(ve), zr(ps, { provider: !1, getStore() { - return pe; + return ve; } }), He(() => { - const G = { nodes: pe.selectedNodes, edges: pe.selectedEdges }; - it(() => e.onselectionchange)?.(G); - for (const Ue of pe.selectionChangeHandlers.values()) - Ue(G); + const U = { nodes: ve.selectedNodes, edges: ve.selectedEdges }; + it(() => e.onselectionchange)?.(U); + for (const Ye of ve.selectionChangeHandlers.values()) + Ye(U); }), ui(() => { - pe.reset(); + ve.reset(); }); - var Ee = { + var Ne = { get width() { return n(); }, - set width(G) { - n(G), g(); + set width(U) { + n(U), g(); }, get height() { return r(); }, - set height(G) { - r(G), g(); + set height(U) { + r(U), g(); }, get proOptions() { return o(); }, - set proOptions(G) { - o(G), g(); + set proOptions(U) { + o(U), g(); }, get selectionKey() { return i(); }, - set selectionKey(G) { - i(G), g(); + set selectionKey(U) { + i(U), g(); }, get deleteKey() { return s(); }, - set deleteKey(G) { - s(G), g(); + set deleteKey(U) { + s(U), g(); }, get panActivationKey() { return a(); }, - set panActivationKey(G) { - a(G), g(); + set panActivationKey(U) { + a(U), g(); }, get multiSelectionKey() { return u(); }, - set multiSelectionKey(G) { - u(G), g(); + set multiSelectionKey(U) { + u(U), g(); }, get zoomActivationKey() { return l(); }, - set zoomActivationKey(G) { - l(G), g(); + set zoomActivationKey(U) { + l(U), g(); }, get paneClickDistance() { return d(); }, - set paneClickDistance(G = 1) { - d(G), g(); + set paneClickDistance(U = 1) { + d(U), g(); }, get nodeClickDistance() { return f(); }, - set nodeClickDistance(G = 1) { - f(G), g(); + set nodeClickDistance(U = 1) { + f(U), g(); }, get onmovestart() { return h(); }, - set onmovestart(G) { - h(G), g(); + set onmovestart(U) { + h(U), g(); }, get onmoveend() { return p(); }, - set onmoveend(G) { - p(G), g(); + set onmoveend(U) { + p(U), g(); }, get onmove() { return m(); }, - set onmove(G) { - m(G), g(); + set onmove(U) { + m(U), g(); }, get oninit() { return y(); }, - set oninit(G) { - y(G), g(); + set oninit(U) { + y(U), g(); }, get onnodeclick() { return w(); }, - set onnodeclick(G) { - w(G), g(); + set onnodeclick(U) { + w(U), g(); }, get onnodecontextmenu() { return b(); }, - set onnodecontextmenu(G) { - b(G), g(); + set onnodecontextmenu(U) { + b(U), g(); }, get onnodedrag() { return S(); }, - set onnodedrag(G) { - S(G), g(); + set onnodedrag(U) { + S(U), g(); }, get onnodedragstart() { return E(); }, - set onnodedragstart(G) { - E(G), g(); + set onnodedragstart(U) { + E(U), g(); }, get onnodedragstop() { return x(); }, - set onnodedragstop(G) { - x(G), g(); + set onnodedragstop(U) { + x(U), g(); }, get onnodepointerenter() { return _(); }, - set onnodepointerenter(G) { - _(G), g(); + set onnodepointerenter(U) { + _(U), g(); }, get onnodepointermove() { return T(); }, - set onnodepointermove(G) { - T(G), g(); + set onnodepointermove(U) { + T(U), g(); }, get onnodepointerleave() { return I(); }, - set onnodepointerleave(G) { - I(G), g(); + set onnodepointerleave(U) { + I(U), g(); }, get onselectionclick() { - return B(); + return F(); }, - set onselectionclick(G) { - B(G), g(); + set onselectionclick(U) { + F(U), g(); }, get onselectioncontextmenu() { return $(); }, - set onselectioncontextmenu(G) { - $(G), g(); + set onselectioncontextmenu(U) { + $(U), g(); }, get onselectionstart() { return H(); }, - set onselectionstart(G) { - H(G), g(); + set onselectionstart(U) { + H(U), g(); }, get onselectionend() { return N(); }, - set onselectionend(G) { - N(G), g(); + set onselectionend(U) { + N(U), g(); }, get onedgeclick() { return k(); }, - set onedgeclick(G) { - k(G), g(); + set onedgeclick(U) { + k(U), g(); }, get onedgecontextmenu() { return D(); }, - set onedgecontextmenu(G) { - D(G), g(); + set onedgecontextmenu(U) { + D(U), g(); }, get onedgepointerenter() { return P(); }, - set onedgepointerenter(G) { - P(G), g(); + set onedgepointerenter(U) { + P(U), g(); }, get onedgepointerleave() { return A(); }, - set onedgepointerleave(G) { - A(G), g(); + set onedgepointerleave(U) { + A(U), g(); }, get onpaneclick() { return R(); }, - set onpaneclick(G) { - R(G), g(); + set onpaneclick(U) { + R(U), g(); }, get onpanecontextmenu() { return M(); }, - set onpanecontextmenu(G) { - M(G), g(); + set onpanecontextmenu(U) { + M(U), g(); }, get panOnScrollMode() { return Y(); }, - set panOnScrollMode(G = Lr.Free) { - Y(G), g(); + set panOnScrollMode(U = Lr.Free) { + Y(U), g(); }, get preventScrolling() { - return U(); + return G(); }, - set preventScrolling(G = !0) { - U(G), g(); + set preventScrolling(U = !0) { + G(U), g(); }, get zoomOnScroll() { - return V(); + return z(); }, - set zoomOnScroll(G = !0) { - V(G), g(); + set zoomOnScroll(U = !0) { + z(U), g(); }, get zoomOnDoubleClick() { - return j(); + return Q(); }, - set zoomOnDoubleClick(G = !0) { - j(G), g(); + set zoomOnDoubleClick(U = !0) { + Q(U), g(); }, get zoomOnPinch() { - return q(); + return j(); }, - set zoomOnPinch(G = !0) { - q(G), g(); + set zoomOnPinch(U = !0) { + j(U), g(); }, get panOnScroll() { - return F(); + return B(); }, - set panOnScroll(G = !1) { - F(G), g(); + set panOnScroll(U = !1) { + B(U), g(); }, get panOnScrollSpeed() { - return Q(); + return te(); }, - set panOnScrollSpeed(G = 0.5) { - Q(G), g(); + set panOnScrollSpeed(U = 0.5) { + te(U), g(); }, get panOnDrag() { - return X(); + return q(); }, - set panOnDrag(G = !0) { - X(G), g(); + set panOnDrag(U = !0) { + q(U), g(); }, get selectionOnDrag() { - return re(); + return ee(); }, - set selectionOnDrag(G = !1) { - re(G), g(); + set selectionOnDrag(U = !1) { + ee(U), g(); }, get connectionLineComponent() { - return ee(); + return X(); }, - set connectionLineComponent(G) { - ee(G), g(); + set connectionLineComponent(U) { + X(U), g(); }, get connectionLineStyle() { return L(); }, - set connectionLineStyle(G) { - L(G), g(); + set connectionLineStyle(U) { + L(U), g(); }, get connectionLineContainerStyle() { - return te(); + return ne(); }, - set connectionLineContainerStyle(G) { - te(G), g(); + set connectionLineContainerStyle(U) { + ne(U), g(); }, get connectionLineType() { - return ve(); + return fe(); }, - set connectionLineType(G = Wn.Bezier) { - ve(G), g(); + set connectionLineType(U = Wn.Bezier) { + fe(U), g(); }, get attributionPosition() { - return ae(); + return le(); }, - set attributionPosition(G) { - ae(G), g(); + set attributionPosition(U) { + le(U), g(); }, get children() { - return le(); + return ae(); }, - set children(G) { - le(G), g(); + set children(U) { + ae(U), g(); }, get nodes() { return oe(); }, - set nodes(G = []) { - oe(G), g(); + set nodes(U = []) { + oe(U), g(); }, get edges() { - return fe(); + return he(); }, - set edges(G = []) { - fe(G), g(); + set edges(U = []) { + he(U), g(); }, get viewport() { return we(); }, - set viewport(G = void 0) { - we(G), g(); + set viewport(U = void 0) { + we(U), g(); } }; - return Yh(t, { + return qh(t, { get colorMode() { - return pe.colorMode; + return ve.colorMode; }, get width() { return n(); @@ -12429,29 +12429,29 @@ function qh(t, e) { return r(); }, get rest() { - return xe; + return _e; }, get domNode() { - return pe.domNode; + return ve.domNode; }, - set domNode(G) { - pe.domNode = G; + set domNode(U) { + ve.domNode = U; }, get clientWidth() { - return pe.width; + return ve.width; }, - set clientWidth(G) { - pe.width = G; + set clientWidth(U) { + ve.width = U; }, get clientHeight() { - return pe.height; + return ve.height; }, - set clientHeight(G) { - pe.height = G; + set clientHeight(U) { + ve.height = U; }, - children: (G, Ue) => { - var be = rb(), De = J(be); - Kh(De, { + children: (U, Ye) => { + var be = rb(), Te = J(be); + Kh(Te, { get selectionKey() { return i(); }, @@ -12468,43 +12468,43 @@ function qh(t, e) { return l(); }, get store() { - return pe; + return ve; }, set store(rt) { - pe = rt; + ve = rt; } }); - var Pe = z(De, 2); - Th(Pe, { + var Ee = V(Te, 2); + Th(Ee, { get panOnScrollMode() { return Y(); }, get preventScrolling() { - return U(); + return G(); }, get zoomOnScroll() { - return V(); + return z(); }, get zoomOnDoubleClick() { - return j(); + return Q(); }, get zoomOnPinch() { - return q(); + return j(); }, get panOnScroll() { - return F(); + return B(); }, get panOnScrollSpeed() { - return Q(); + return te(); }, get panOnDrag() { - return X(); + return q(); }, get paneClickDistance() { return d(); }, get selectionOnDrag() { - return re(); + return ee(); }, get onmovestart() { return h(); @@ -12519,10 +12519,10 @@ function qh(t, e) { return y(); }, get store() { - return pe; + return ve; }, set store(rt) { - pe = rt; + ve = rt; }, children: (rt, Tt) => { Oh(rt, { @@ -12539,31 +12539,31 @@ function qh(t, e) { return N(); }, get panOnDrag() { - return X(); + return q(); }, get paneClickDistance() { return d(); }, get selectionOnDrag() { - return re(); + return ee(); }, get store() { - return pe; + return ve; }, - set store(he) { - pe = he; + set store(ge) { + ve = ge; }, - children: (he, Ae) => { + children: (ge, De) => { var et = nb(), Ze = J(et); Ah(Ze, { get store() { - return pe; + return ve; }, set store(st) { - pe = st; + ve = st; }, children: (st, lt) => { - var bt = tb(), ut = z(J(bt), 2); + var bt = tb(), ut = V(J(bt), 2); Bh(ut, { get onedgeclick() { return k(); @@ -12578,34 +12578,34 @@ function qh(t, e) { return A(); }, get store() { - return pe; + return ve; }, set store(an) { - pe = an; + ve = an; } }); - var ot = z(ut, 4); + var ot = V(ut, 4); Wh(ot, { get type() { - return ve(); + return fe(); }, get LineComponent() { - return ee(); + return X(); }, get containerStyle() { - return te(); + return ne(); }, get style() { return L(); }, get store() { - return pe; + return ve; }, set store(an) { - pe = an; + ve = an; } }); - var Ot = z(ot, 2); + var Ot = V(ot, 2); Vh(Ot, { get nodeClickDistance() { return f(); @@ -12635,16 +12635,16 @@ function qh(t, e) { return x(); }, get store() { - return pe; + return ve; }, set store(an) { - pe = an; + ve = an; } }); - var ko = z(Ot, 2); + var ko = V(Ot, 2); $h(ko, { get onselectionclick() { - return B(); + return F(); }, get onselectioncontextmenu() { return $(); @@ -12659,18 +12659,18 @@ function qh(t, e) { return x(); }, get store() { - return pe; + return ve; }, set store(an) { - pe = an; + ve = an; } }), Se(2), O(st, bt); }, $$slots: { default: !0 } }); - var at = z(Ze, 2); + var at = V(Ze, 2); { - let st = /* @__PURE__ */ C(() => !!(pe.selectionRect && pe.selectionRectMode === "user")), lt = /* @__PURE__ */ C(() => pe.selectionRect?.width), bt = /* @__PURE__ */ C(() => pe.selectionRect?.height), ut = /* @__PURE__ */ C(() => pe.selectionRect?.x), ot = /* @__PURE__ */ C(() => pe.selectionRect?.y); + let st = /* @__PURE__ */ C(() => !!(ve.selectionRect && ve.selectionRectMode === "user")), lt = /* @__PURE__ */ C(() => ve.selectionRect?.width), bt = /* @__PURE__ */ C(() => ve.selectionRect?.height), ut = /* @__PURE__ */ C(() => ve.selectionRect?.x), ot = /* @__PURE__ */ C(() => ve.selectionRect?.y); Ql(at, { get isVisible() { return c(st); @@ -12689,36 +12689,36 @@ function qh(t, e) { } }); } - O(he, et); + O(ge, et); }, $$slots: { default: !0 } }); }, $$slots: { default: !0 } }); - var Xe = z(Pe, 2); + var Xe = V(Ee, 2); Zh(Xe, { get proOptions() { return o(); }, get position() { - return ae(); + return le(); } }); - var je = z(Xe, 2); - Ih(je, { + var Ue = V(Xe, 2); + Ih(Ue, { get store() { - return pe; + return ve; } }); - var Ke = z(je, 2); - Oe(Ke, () => le() ?? ze), O(G, be); + var We = V(Ue, 2); + Ae(We, () => ae() ?? ze), O(U, be); }, $$slots: { default: !0 } - }), ce(Ee); + }), ce(Ne); } se( - qh, + Yh, { width: {}, height: {}, @@ -12775,9 +12775,9 @@ se( [], !0 ); -function Xh(t, e) { +function jh(t, e) { ue(e, !0); - let n = v(e, "children", 7), r = /* @__PURE__ */ ye(Nh({ props: {}, nodes: [], edges: [] })); + let n = v(e, "children", 7), r = /* @__PURE__ */ me(Nh({ props: {}, nodes: [], edges: [] })); zr(ps, { provider: !0, getStore() { @@ -12797,10 +12797,10 @@ function Xh(t, e) { n(a), g(); } }, i = de(), s = J(i); - return Oe(s, () => n() ?? ze), O(t, i), ce(o); + return Ae(s, () => n() ?? ze), O(t, i), ce(o); } -se(Xh, { children: {} }, [], [], !0); -var ob = /* @__PURE__ */ ne(""); +se(jh, { children: {} }, [], [], !0); +var ob = /* @__PURE__ */ re(""); function Lo(t, e) { ue(e, !0); let n = v(e, "class", 7), r = v(e, "bgColor", 7), o = v(e, "bgColorHover", 7), i = v(e, "color", 7), s = v(e, "colorHover", 7), a = v(e, "borderColor", 7), u = v(e, "onclick", 7), l = v(e, "children", 7), d = /* @__PURE__ */ Le(e, [ @@ -12881,7 +12881,7 @@ function Lo(t, e) { } })); var p = Z(h); - return Oe(p, () => l() ?? ze), W(h), O(t, h), ce(f); + return Ae(p, () => l() ?? ze), W(h), O(t, h), ce(f); } se( Lo, @@ -12899,37 +12899,37 @@ se( [], !0 ); -var ib = /* @__PURE__ */ _e(''); -function jh(t) { +var ib = /* @__PURE__ */ xe(''); +function Xh(t) { var e = ib(); O(t, e); } -se(jh, {}, [], [], !0); -var sb = /* @__PURE__ */ _e(''); +se(Xh, {}, [], [], !0); +var sb = /* @__PURE__ */ xe(''); function Uh(t) { var e = sb(); O(t, e); } se(Uh, {}, [], [], !0); -var ab = /* @__PURE__ */ _e(''); +var ab = /* @__PURE__ */ xe(''); function Gh(t) { var e = ab(); O(t, e); } se(Gh, {}, [], [], !0); -var lb = /* @__PURE__ */ _e(''); +var lb = /* @__PURE__ */ xe(''); function Jh(t) { var e = lb(); O(t, e); } se(Jh, {}, [], [], !0); -var ub = /* @__PURE__ */ _e(''); +var ub = /* @__PURE__ */ xe(''); function Qh(t) { var e = ub(); O(t, e); } se(Qh, {}, [], [], !0); -var cb = /* @__PURE__ */ ne(" ", 1), db = /* @__PURE__ */ ne(" ", 1); +var cb = /* @__PURE__ */ re(" ", 1), db = /* @__PURE__ */ re(" ", 1); function eg(t, e) { ue(e, !0); let n = v(e, "position", 7, "bottom-left"), r = v(e, "orientation", 7, "vertical"), o = v(e, "showZoom", 7, !0), i = v(e, "showFitView", 7, !0), s = v(e, "showLock", 7, !0), a = v(e, "style", 7), u = v(e, "class", 7), l = v(e, "buttonBgColor", 7), d = v(e, "buttonBgColorHover", 7), f = v(e, "buttonColor", 7), h = v(e, "buttonColorHover", 7), p = v(e, "buttonBorderColor", 7), m = v(e, "fitViewOptions", 7), y = v(e, "children", 7), w = v(e, "before", 7), b = v(e, "after", 7), S = /* @__PURE__ */ Le(e, [ @@ -12961,7 +12961,7 @@ function eg(t, e) { colorHover: h(), borderColor: p() }; - let _ = /* @__PURE__ */ C(() => c(E).nodesDraggable || c(E).nodesConnectable || c(E).elementsSelectable), T = /* @__PURE__ */ C(() => c(E).viewport.zoom <= c(E).minZoom), I = /* @__PURE__ */ C(() => c(E).viewport.zoom >= c(E).maxZoom), B = /* @__PURE__ */ C(() => c(E).ariaLabelConfig), $ = /* @__PURE__ */ C(() => r() === "horizontal" ? "horizontal" : "vertical"); + let _ = /* @__PURE__ */ C(() => c(E).nodesDraggable || c(E).nodesConnectable || c(E).elementsSelectable), T = /* @__PURE__ */ C(() => c(E).viewport.zoom <= c(E).minZoom), I = /* @__PURE__ */ C(() => c(E).viewport.zoom >= c(E).maxZoom), F = /* @__PURE__ */ C(() => c(E).ariaLabelConfig), $ = /* @__PURE__ */ C(() => r() === "horizontal" ? "horizontal" : "vertical"); const H = () => { c(E).zoomIn(); }, N = () => { @@ -13086,7 +13086,7 @@ function eg(t, e) { }, "data-testid": "svelte-flow__controls", get "aria-label"() { - return c(B)["controls.ariaLabel"]; + return c(F)["controls.ariaLabel"]; }, get style() { return a(); @@ -13095,29 +13095,29 @@ function eg(t, e) { () => S, { children: (R, M) => { - var Y = db(), U = J(Y); + var Y = db(), G = J(Y); { - var V = (ae) => { - var le = de(), oe = J(le); - Oe(oe, w), O(ae, le); + var z = (le) => { + var ae = de(), oe = J(ae); + Ae(oe, w), O(le, ae); }; - ie(U, (ae) => { - w() && ae(V); + ie(G, (le) => { + w() && le(z); }); } - var j = z(U, 2); + var Q = V(G, 2); { - var q = (ae) => { - var le = cb(), oe = J(le); + var j = (le) => { + var ae = cb(), oe = J(ae); Lo(oe, Ve( { onclick: H, class: "svelte-flow__controls-zoomin", get title() { - return c(B)["controls.zoomIn.ariaLabel"]; + return c(F)["controls.zoomIn.ariaLabel"]; }, get "aria-label"() { - return c(B)["controls.zoomIn.ariaLabel"]; + return c(F)["controls.zoomIn.ariaLabel"]; }, get disabled() { return c(I); @@ -13125,22 +13125,22 @@ function eg(t, e) { }, () => x, { - children: (we, xe) => { - jh(we); + children: (we, _e) => { + Xh(we); }, $$slots: { default: !0 } } )); - var fe = z(oe, 2); - Lo(fe, Ve( + var he = V(oe, 2); + Lo(he, Ve( { onclick: N, class: "svelte-flow__controls-zoomout", get title() { - return c(B)["controls.zoomOut.ariaLabel"]; + return c(F)["controls.zoomOut.ariaLabel"]; }, get "aria-label"() { - return c(B)["controls.zoomOut.ariaLabel"]; + return c(F)["controls.zoomOut.ariaLabel"]; }, get disabled() { return c(T); @@ -13148,100 +13148,100 @@ function eg(t, e) { }, () => x, { - children: (we, xe) => { + children: (we, _e) => { Uh(we); }, $$slots: { default: !0 } } - )), O(ae, le); + )), O(le, ae); }; - ie(j, (ae) => { - o() && ae(q); + ie(Q, (le) => { + o() && le(j); }); } - var F = z(j, 2); + var B = V(Q, 2); { - var Q = (ae) => { - Lo(ae, Ve( + var te = (le) => { + Lo(le, Ve( { class: "svelte-flow__controls-fitview", onclick: k, get title() { - return c(B)["controls.fitView.ariaLabel"]; + return c(F)["controls.fitView.ariaLabel"]; }, get "aria-label"() { - return c(B)["controls.fitView.ariaLabel"]; + return c(F)["controls.fitView.ariaLabel"]; } }, () => x, { - children: (le, oe) => { - Gh(le); + children: (ae, oe) => { + Gh(ae); }, $$slots: { default: !0 } } )); }; - ie(F, (ae) => { - i() && ae(Q); + ie(B, (le) => { + i() && le(te); }); } - var X = z(F, 2); + var q = V(B, 2); { - var re = (ae) => { - Lo(ae, Ve( + var ee = (le) => { + Lo(le, Ve( { class: "svelte-flow__controls-interactive", onclick: D, get title() { - return c(B)["controls.interactive.ariaLabel"]; + return c(F)["controls.interactive.ariaLabel"]; }, get "aria-label"() { - return c(B)["controls.interactive.ariaLabel"]; + return c(F)["controls.interactive.ariaLabel"]; } }, () => x, { - children: (le, oe) => { - var fe = de(), we = J(fe); + children: (ae, oe) => { + var he = de(), we = J(he); { - var xe = (me) => { - Qh(me); - }, pe = (me) => { - Jh(me); + var _e = (ye) => { + Qh(ye); + }, ve = (ye) => { + Jh(ye); }; - ie(we, (me) => { - c(_) ? me(xe) : me(pe, !1); + ie(we, (ye) => { + c(_) ? ye(_e) : ye(ve, !1); }); } - O(le, fe); + O(ae, he); }, $$slots: { default: !0 } } )); }; - ie(X, (ae) => { - s() && ae(re); + ie(q, (le) => { + s() && le(ee); }); } - var ee = z(X, 2); + var X = V(q, 2); { - var L = (ae) => { - var le = de(), oe = J(le); - Oe(oe, y), O(ae, le); + var L = (le) => { + var ae = de(), oe = J(ae); + Ae(oe, y), O(le, ae); }; - ie(ee, (ae) => { - y() && ae(L); + ie(X, (le) => { + y() && le(L); }); } - var te = z(ee, 2); + var ne = V(X, 2); { - var ve = (ae) => { - var le = de(), oe = J(le); - Oe(oe, b), O(ae, le); + var fe = (le) => { + var ae = de(), oe = J(ae); + Ae(oe, b), O(le, ae); }; - ie(te, (ae) => { - b() && ae(ve); + ie(ne, (le) => { + b() && le(fe); }); } O(R, Y); @@ -13276,11 +13276,11 @@ se( [], !0 ); -var qn; +var Yn; (function(t) { t.Lines = "lines", t.Dots = "dots", t.Cross = "cross"; -})(qn || (qn = {})); -var fb = /* @__PURE__ */ _e(""); +})(Yn || (Yn = {})); +var fb = /* @__PURE__ */ xe(""); function tg(t, e) { ue(e, !0); let n = v(e, "radius", 7), r = v(e, "class", 7); @@ -13298,12 +13298,12 @@ function tg(t, e) { r(s), g(); } }, i = fb(); - return Te(() => { - Ne(i, "cx", n()), Ne(i, "cy", n()), Ne(i, "r", n()), Yt(i, 0, ur(["svelte-flow__background-pattern", "dots", r()])); + return Oe(() => { + Pe(i, "cx", n()), Pe(i, "cy", n()), Pe(i, "r", n()), qt(i, 0, ur(["svelte-flow__background-pattern", "dots", r()])); }), O(t, i), ce(o); } se(tg, { radius: {}, class: {} }, [], [], !0); -var hb = /* @__PURE__ */ _e(""); +var hb = /* @__PURE__ */ xe(""); function ng(t, e) { ue(e, !0); let n = v(e, "lineWidth", 7), r = v(e, "dimensions", 7), o = v(e, "variant", 7), i = v(e, "class", 7); @@ -13333,20 +13333,20 @@ function ng(t, e) { i(u), g(); } }, a = hb(); - return Te(() => { - Ne(a, "stroke-width", n()), Ne(a, "d", `M${r()[0] / 2} 0 V${r()[1]} M0 ${r()[1] / 2} H${r()[0]}`), Yt(a, 0, ur(["svelte-flow__background-pattern", o(), i()])); + return Oe(() => { + Pe(a, "stroke-width", n()), Pe(a, "d", `M${r()[0] / 2} 0 V${r()[1]} M0 ${r()[1] / 2} H${r()[0]}`), qt(a, 0, ur(["svelte-flow__background-pattern", o(), i()])); }), O(t, a), ce(s); } se(ng, { lineWidth: {}, dimensions: {}, variant: {}, class: {} }, [], [], !0); const gb = { - [qn.Dots]: 1, - [qn.Lines]: 1, - [qn.Cross]: 6 + [Yn.Dots]: 1, + [Yn.Lines]: 1, + [Yn.Cross]: 6 }; -var vb = /* @__PURE__ */ _e(''); +var vb = /* @__PURE__ */ xe(''); function rg(t, e) { ue(e, !0); - let n = v(e, "id", 7), r = v(e, "variant", 23, () => qn.Dots), o = v(e, "gap", 7, 20), i = v(e, "size", 7), s = v(e, "lineWidth", 7, 1), a = v(e, "bgColor", 7), u = v(e, "patternColor", 7), l = v(e, "patternClass", 7), d = v(e, "class", 7), f = /* @__PURE__ */ C(Sn), h = /* @__PURE__ */ C(() => r() === qn.Dots), p = /* @__PURE__ */ C(() => r() === qn.Cross), m = /* @__PURE__ */ C(() => Array.isArray(o()) ? o() : [o(), o()]), y = /* @__PURE__ */ C(() => `background-pattern-${c(f).flowId}-${n() ?? ""}`), w = /* @__PURE__ */ C(() => [ + let n = v(e, "id", 7), r = v(e, "variant", 23, () => Yn.Dots), o = v(e, "gap", 7, 20), i = v(e, "size", 7), s = v(e, "lineWidth", 7, 1), a = v(e, "bgColor", 7), u = v(e, "patternColor", 7), l = v(e, "patternClass", 7), d = v(e, "class", 7), f = /* @__PURE__ */ C(Sn), h = /* @__PURE__ */ C(() => r() === Yn.Dots), p = /* @__PURE__ */ C(() => r() === Yn.Cross), m = /* @__PURE__ */ C(() => Array.isArray(o()) ? o() : [o(), o()]), y = /* @__PURE__ */ C(() => `background-pattern-${c(f).flowId}-${n() ?? ""}`), w = /* @__PURE__ */ C(() => [ c(m)[0] * c(f).viewport.zoom || 1, c(m)[1] * c(f).viewport.zoom || 1 ]), b = /* @__PURE__ */ C(() => (i() ?? gb[r()]) * c(f).viewport.zoom), S = /* @__PURE__ */ C(() => c(p) ? [c(b), c(b)] : c(w)), E = /* @__PURE__ */ C(() => c(h) ? [c(b) / 2, c(b) / 2] : [ @@ -13363,7 +13363,7 @@ function rg(t, e) { get variant() { return r(); }, - set variant(k = qn.Dots) { + set variant(k = Yn.Dots) { r(k), g(); }, get gap() { @@ -13410,7 +13410,7 @@ function rg(t, e) { } }, _ = vb(); let T; - var I = Z(_), B = Z(I); + var I = Z(_), F = Z(I); { var $ = (k) => { { @@ -13440,21 +13440,21 @@ function rg(t, e) { } }); }; - ie(B, (k) => { + ie(F, (k) => { c(h) ? k($) : k(H, !1); }); } W(I); - var N = z(I); - return W(_), Te(() => { - Yt(_, 0, ur([ + var N = V(I); + return W(_), Oe(() => { + qt(_, 0, ur([ "svelte-flow__background", "svelte-flow__container", d() ])), T = Pt(_, "", T, { "--xy-background-color-props": a(), "--xy-background-pattern-color-props": u() - }), Ne(I, "id", c(y)), Ne(I, "x", c(f).viewport.x % c(w)[0]), Ne(I, "y", c(f).viewport.y % c(w)[1]), Ne(I, "width", c(w)[0]), Ne(I, "height", c(w)[1]), Ne(I, "patternTransform", `translate(-${c(E)[0]},-${c(E)[1]})`), Ne(N, "fill", `url(#${c(y)})`); + }), Pe(I, "id", c(y)), Pe(I, "x", c(f).viewport.x % c(w)[0]), Pe(I, "y", c(f).viewport.y % c(w)[1]), Pe(I, "width", c(w)[0]), Pe(I, "height", c(w)[1]), Pe(I, "patternTransform", `translate(-${c(E)[0]},-${c(E)[1]})`), Pe(N, "fill", `url(#${c(y)})`); }), O(t, _), ce(x); } se( @@ -13474,7 +13474,7 @@ se( [], !0 ); -var pb = /* @__PURE__ */ _e(""); +var pb = /* @__PURE__ */ xe(""); function og(t, e) { ue(e, !0); let n = v(e, "id", 7), r = v(e, "x", 7), o = v(e, "y", 7), i = v(e, "width", 7), s = v(e, "height", 7), a = v(e, "borderRadius", 7, 5), u = v(e, "color", 7), l = v(e, "shapeRendering", 7), d = v(e, "strokeColor", 7), f = v(e, "strokeWidth", 7, 2), h = v(e, "selected", 7), p = v(e, "class", 7), m = v(e, "nodeComponent", 7); @@ -13562,8 +13562,8 @@ function og(t, e) { var S = (x) => { const _ = /* @__PURE__ */ C(m); var T = de(), I = J(T); - xt(I, () => c(_), (B, $) => { - $(B, { + xt(I, () => c(_), (F, $) => { + $(F, { get id() { return n(); }, @@ -13605,8 +13605,8 @@ function og(t, e) { }, E = (x) => { var _ = pb(); let T, I; - Te(() => { - T = Yt(_, 0, ur(["svelte-flow__minimap-node", p()]), null, T, { selected: h() }), Ne(_, "x", r()), Ne(_, "y", o()), Ne(_, "rx", a()), Ne(_, "ry", a()), Ne(_, "width", i()), Ne(_, "height", s()), Ne(_, "shape-rendering", l()), I = Pt(_, "", I, { + Oe(() => { + T = qt(_, 0, ur(["svelte-flow__minimap-node", p()]), null, T, { selected: h() }), Pe(_, "x", r()), Pe(_, "y", o()), Pe(_, "rx", a()), Pe(_, "ry", a()), Pe(_, "width", i()), Pe(_, "height", s()), Pe(_, "shape-rendering", l()), I = Pt(_, "", I, { fill: u(), stroke: d(), "stroke-width": f() @@ -13678,7 +13678,7 @@ function mb(t, e) { }; } const xa = (t) => t instanceof Function ? t : () => t; -var yb = /* @__PURE__ */ _e(" "), wb = /* @__PURE__ */ _e(''), bb = /* @__PURE__ */ ne('', 1); +var yb = /* @__PURE__ */ xe(" "), wb = /* @__PURE__ */ xe(''), bb = /* @__PURE__ */ re('', 1); function ig(t, e) { ue(e, !0); let n = v(e, "position", 7, "bottom-right"), r = v(e, "ariaLabel", 7), o = v(e, "nodeStrokeColor", 7, "transparent"), i = v(e, "nodeColor", 7), s = v(e, "nodeClass", 7, ""), a = v(e, "nodeBorderRadius", 7, 5), u = v(e, "nodeStrokeWidth", 7, 2), l = v(e, "nodeComponent", 7), d = v(e, "bgColor", 7), f = v(e, "maskColor", 7), h = v(e, "maskStrokeColor", 7), p = v(e, "maskStrokeWidth", 7), m = v(e, "width", 7, 200), y = v(e, "height", 7, 150), w = v(e, "pannable", 7, !0), b = v(e, "zoomable", 7, !0), S = v(e, "inversePan", 7), E = v(e, "zoomStep", 7), x = v(e, "class", 7), _ = /* @__PURE__ */ Le(e, [ @@ -13706,7 +13706,7 @@ function ig(t, e) { "zoomStep", "class" ]), T = /* @__PURE__ */ C(Sn), I = /* @__PURE__ */ C(() => c(T).ariaLabelConfig); - const B = i() === void 0 ? void 0 : xa(i()), $ = xa(o()), H = xa(s()), N = ( + const F = i() === void 0 ? void 0 : xa(i()), $ = xa(o()), H = xa(s()), N = ( // @ts-expect-error - TS doesn't know about chrome typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision" ); @@ -13715,193 +13715,193 @@ function ig(t, e) { y: -c(T).viewport.y / c(T).viewport.zoom, width: c(T).width / c(T).viewport.zoom, height: c(T).height / c(T).viewport.zoom - })), P = /* @__PURE__ */ C(() => Jf(hi(c(T).nodeLookup, { filter: (te) => !te.hidden }), c(D))), A = /* @__PURE__ */ C(() => c(P).width / m()), R = /* @__PURE__ */ C(() => c(P).height / y()), M = /* @__PURE__ */ C(() => Math.max(c(A), c(R))), Y = /* @__PURE__ */ C(() => c(M) * m()), U = /* @__PURE__ */ C(() => c(M) * y()), V = /* @__PURE__ */ C(() => 5 * c(M)), j = /* @__PURE__ */ C(() => c(P).x - (c(Y) - c(P).width) / 2 - c(V)), q = /* @__PURE__ */ C(() => c(P).y - (c(U) - c(P).height) / 2 - c(V)), F = /* @__PURE__ */ C(() => c(Y) + c(V) * 2), Q = /* @__PURE__ */ C(() => c(U) + c(V) * 2); - const X = () => c(M); - var re = { + })), P = /* @__PURE__ */ C(() => Jf(hi(c(T).nodeLookup, { filter: (ne) => !ne.hidden }), c(D))), A = /* @__PURE__ */ C(() => c(P).width / m()), R = /* @__PURE__ */ C(() => c(P).height / y()), M = /* @__PURE__ */ C(() => Math.max(c(A), c(R))), Y = /* @__PURE__ */ C(() => c(M) * m()), G = /* @__PURE__ */ C(() => c(M) * y()), z = /* @__PURE__ */ C(() => 5 * c(M)), Q = /* @__PURE__ */ C(() => c(P).x - (c(Y) - c(P).width) / 2 - c(z)), j = /* @__PURE__ */ C(() => c(P).y - (c(G) - c(P).height) / 2 - c(z)), B = /* @__PURE__ */ C(() => c(Y) + c(z) * 2), te = /* @__PURE__ */ C(() => c(G) + c(z) * 2); + const q = () => c(M); + var ee = { get position() { return n(); }, - set position(te = "bottom-right") { - n(te), g(); + set position(ne = "bottom-right") { + n(ne), g(); }, get ariaLabel() { return r(); }, - set ariaLabel(te) { - r(te), g(); + set ariaLabel(ne) { + r(ne), g(); }, get nodeStrokeColor() { return o(); }, - set nodeStrokeColor(te = "transparent") { - o(te), g(); + set nodeStrokeColor(ne = "transparent") { + o(ne), g(); }, get nodeColor() { return i(); }, - set nodeColor(te) { - i(te), g(); + set nodeColor(ne) { + i(ne), g(); }, get nodeClass() { return s(); }, - set nodeClass(te = "") { - s(te), g(); + set nodeClass(ne = "") { + s(ne), g(); }, get nodeBorderRadius() { return a(); }, - set nodeBorderRadius(te = 5) { - a(te), g(); + set nodeBorderRadius(ne = 5) { + a(ne), g(); }, get nodeStrokeWidth() { return u(); }, - set nodeStrokeWidth(te = 2) { - u(te), g(); + set nodeStrokeWidth(ne = 2) { + u(ne), g(); }, get nodeComponent() { return l(); }, - set nodeComponent(te) { - l(te), g(); + set nodeComponent(ne) { + l(ne), g(); }, get bgColor() { return d(); }, - set bgColor(te) { - d(te), g(); + set bgColor(ne) { + d(ne), g(); }, get maskColor() { return f(); }, - set maskColor(te) { - f(te), g(); + set maskColor(ne) { + f(ne), g(); }, get maskStrokeColor() { return h(); }, - set maskStrokeColor(te) { - h(te), g(); + set maskStrokeColor(ne) { + h(ne), g(); }, get maskStrokeWidth() { return p(); }, - set maskStrokeWidth(te) { - p(te), g(); + set maskStrokeWidth(ne) { + p(ne), g(); }, get width() { return m(); }, - set width(te = 200) { - m(te), g(); + set width(ne = 200) { + m(ne), g(); }, get height() { return y(); }, - set height(te = 150) { - y(te), g(); + set height(ne = 150) { + y(ne), g(); }, get pannable() { return w(); }, - set pannable(te = !0) { - w(te), g(); + set pannable(ne = !0) { + w(ne), g(); }, get zoomable() { return b(); }, - set zoomable(te = !0) { - b(te), g(); + set zoomable(ne = !0) { + b(ne), g(); }, get inversePan() { return S(); }, - set inversePan(te) { - S(te), g(); + set inversePan(ne) { + S(ne), g(); }, get zoomStep() { return E(); }, - set zoomStep(te) { - E(te), g(); + set zoomStep(ne) { + E(ne), g(); }, get class() { return x(); }, - set class(te) { - x(te), g(); + set class(ne) { + x(ne), g(); } - }, ee = bb(), L = J(ee); + }, X = bb(), L = J(X); { - let te = /* @__PURE__ */ C(() => ["svelte-flow__minimap", x()]); + let ne = /* @__PURE__ */ C(() => ["svelte-flow__minimap", x()]); h1(L, () => ({ "--xy-minimap-background-color-props": d() })), mi(L.lastChild, Ve( { get position() { return n(); }, get class() { - return c(te); + return c(ne); }, "data-testid": "svelte-flow__minimap" }, () => _, { - children: (ve, ae) => { - var le = de(), oe = J(le); + children: (fe, le) => { + var ae = de(), oe = J(ae); { - var fe = (we) => { - var xe = wb(); - let pe; - var me = Z(xe); + var he = (we) => { + var _e = wb(); + let ve; + var ye = Z(_e); { - var Ee = (be) => { - var De = yb(), Pe = Z(De, !0); - W(De), Te(() => { - Ne(De, "id", c(k)), tt(Pe, r() ?? c(I)["minimap.ariaLabel"]); - }), O(be, De); + var Ne = (be) => { + var Te = yb(), Ee = Z(Te, !0); + W(Te), Oe(() => { + Pe(Te, "id", c(k)), tt(Ee, r() ?? c(I)["minimap.ariaLabel"]); + }), O(be, Te); }; - ie(me, (be) => { - (r() ?? c(I)["minimap.ariaLabel"]) && be(Ee); + ie(ye, (be) => { + (r() ?? c(I)["minimap.ariaLabel"]) && be(Ne); }); } - var G = z(me); - Ct(G, 17, () => c(T).nodes, (be) => be.id, (be, De) => { - const Pe = /* @__PURE__ */ C(() => c(T).nodeLookup.get(c(De).id)); - var Xe = de(), je = J(Xe); + var U = V(ye); + Ct(U, 17, () => c(T).nodes, (be) => be.id, (be, Te) => { + const Ee = /* @__PURE__ */ C(() => c(T).nodeLookup.get(c(Te).id)); + var Xe = de(), Ue = J(Xe); { - var Ke = (rt) => { - const Tt = /* @__PURE__ */ C(() => kr(c(Pe))); + var We = (rt) => { + const Tt = /* @__PURE__ */ C(() => kr(c(Ee))); { - let he = /* @__PURE__ */ C(() => B?.(c(Pe))), Ae = /* @__PURE__ */ C(() => $(c(Pe))), et = /* @__PURE__ */ C(() => H(c(Pe))); + let ge = /* @__PURE__ */ C(() => F?.(c(Ee))), De = /* @__PURE__ */ C(() => $(c(Ee))), et = /* @__PURE__ */ C(() => H(c(Ee))); og(rt, Ve( { get id() { - return c(Pe).id; + return c(Ee).id; }, get x() { - return c(Pe).internals.positionAbsolute.x; + return c(Ee).internals.positionAbsolute.x; }, get y() { - return c(Pe).internals.positionAbsolute.y; + return c(Ee).internals.positionAbsolute.y; } }, () => c(Tt), { get selected() { - return c(Pe).selected; + return c(Ee).selected; }, get nodeComponent() { return l(); }, get color() { - return c(he); + return c(ge); }, get borderRadius() { return a(); }, get strokeColor() { - return c(Ae); + return c(De); }, get strokeWidth() { return u(); @@ -13916,17 +13916,17 @@ function ig(t, e) { )); } }; - ie(je, (rt) => { - c(Pe) && Qf(c(Pe)) && !c(Pe).hidden && rt(Ke); + ie(Ue, (rt) => { + c(Ee) && Qf(c(Ee)) && !c(Ee).hidden && rt(We); }); } O(be, Xe); }); - var Ue = z(G); - W(xe), At(xe, (be, De) => mb?.(be, De), () => ({ + var Ye = V(U); + W(_e), At(_e, (be, Te) => mb?.(be, Te), () => ({ store: c(T), panZoom: c(T).panZoom, - getViewScale: X, + getViewScale: q, translateExtent: c(T).translateExtent, width: c(T).width, height: c(T).height, @@ -13934,26 +13934,26 @@ function ig(t, e) { zoomStep: E(), pannable: w(), zoomable: b() - })), Te(() => { - Ne(xe, "width", m()), Ne(xe, "height", y()), Ne(xe, "viewBox", `${c(j) ?? ""} ${c(q) ?? ""} ${c(F) ?? ""} ${c(Q) ?? ""}`), Ne(xe, "aria-labelledby", c(k)), pe = Pt(xe, "", pe, { + })), Oe(() => { + Pe(_e, "width", m()), Pe(_e, "height", y()), Pe(_e, "viewBox", `${c(Q) ?? ""} ${c(j) ?? ""} ${c(B) ?? ""} ${c(te) ?? ""}`), Pe(_e, "aria-labelledby", c(k)), ve = Pt(_e, "", ve, { "--xy-minimap-mask-background-color-props": f(), "--xy-minimap-mask-stroke-color-props": h(), "--xy-minimap-mask-stroke-width-props": p() ? p() * c(M) : void 0 - }), Ne(Ue, "d", `M${c(j) - c(V)},${c(q) - c(V)}h${c(F) + c(V) * 2}v${c(Q) + c(V) * 2}h${-c(F) - c(V) * 2}z + }), Pe(Ye, "d", `M${c(Q) - c(z)},${c(j) - c(z)}h${c(B) + c(z) * 2}v${c(te) + c(z) * 2}h${-c(B) - c(z) * 2}z M${c(D).x ?? ""},${c(D).y ?? ""}h${c(D).width ?? ""}v${c(D).height ?? ""}h${-c(D).width}z`); - }), O(we, xe); + }), O(we, _e); }; ie(oe, (we) => { - c(T).panZoom && we(fe); + c(T).panZoom && we(he); }); } - O(ve, le); + O(fe, ae); }, $$slots: { default: !0 } } )), W(L); } - return O(t, ee), ce(re); + return O(t, X), ce(ee); } se( ig, @@ -13982,7 +13982,7 @@ se( [], !0 ); -var xb = /* @__PURE__ */ ne("
"); +var xb = /* @__PURE__ */ re("
"); function sg(t, e) { ue(e, !0); let n = v(e, "nodeId", 7), r = v(e, "position", 23, () => ke.Top), o = v(e, "align", 7, "center"), i = v(e, "offset", 7, 10), s = v(e, "isVisible", 7), a = v(e, "children", 7), u = /* @__PURE__ */ Le(e, [ @@ -14000,8 +14000,8 @@ function sg(t, e) { const l = Sn(), { getNodesBounds: d } = wt(), f = yn("svelteflow__node_id"); let h = /* @__PURE__ */ C(() => (l.nodes, (Array.isArray(n()) ? n() : [n() ?? f]).reduce( (T, I) => { - const B = l.nodeLookup.get(I); - return B && T.push(B), T; + const F = l.nodeLookup.get(I); + return F && T.push(F), T; }, [] ))), p = /* @__PURE__ */ C(() => { @@ -14051,14 +14051,14 @@ function sg(t, e) { var T = xb(); Ge( T, - (B, $) => ({ + (F, $) => ({ class: "svelte-flow__node-toolbar", - "data-id": B, + "data-id": F, ...u, [Tn]: $ }), [ - () => c(h).reduce((B, $) => `${B}${$.id} `, "").trim(), + () => c(h).reduce((F, $) => `${F}${$.id} `, "").trim(), () => ({ display: bh().value ? "none" : void 0, position: "absolute", @@ -14068,7 +14068,7 @@ function sg(t, e) { ] ); var I = Z(T); - Oe(I, () => a() ?? ze), W(T), At(T, (B, $) => wh?.(B, $), () => "root"), O(_, T); + Ae(I, () => a() ?? ze), W(T), At(T, (F, $) => wh?.(F, $), () => "root"), O(_, T); }; ie(E, (_) => { l.domNode && c(w) && c(h) && _(x); @@ -14100,7 +14100,7 @@ function cr(t) { const f = c(r).get(d)?.internals.userNode; f && a.push({ id: f.id, type: f.type, data: f.data }); } - return (!Xw(a, o) || i) && (o = a, i = !1), u ? o : o[0] ?? null; + return (!jw(a, o) || i) && (o = a, i = !1), u ? o : o[0] ?? null; }); return { get current() { @@ -14240,7 +14240,7 @@ class dg { #n; #r; #o; - #i = /* @__PURE__ */ ye(0); + #i = /* @__PURE__ */ me(0); constructor(e, n, r = {}) { const { storage: o = "local", @@ -14311,7 +14311,7 @@ function Db(t) { return mt.isBox(t) && nu in t; } function mt(t) { - let e = /* @__PURE__ */ ye(ht(t)); + let e = /* @__PURE__ */ me(ht(t)); return { [Qo]: !0, [nu]: !0, @@ -14377,8 +14377,8 @@ mt.readonly = Hb; mt.isBox = Ab; mt.isWritableBox = Db; var Ic = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, Vb = /\n/g, zb = /^\s*/, Rb = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, Fb = /^:\s*/, Bb = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, $b = /^[;\s]*/, Kb = /^\s+|\s+$/g, Wb = ` -`, Mc = "/", Lc = "*", Nr = "", Zb = "comment", Yb = "declaration"; -function qb(t, e) { +`, Mc = "/", Lc = "*", Nr = "", Zb = "comment", qb = "declaration"; +function Yb(t, e) { if (typeof t != "string") throw new TypeError("First argument must be a string"); if (!t) return []; @@ -14441,7 +14441,7 @@ function qb(t, e) { if (y) { if (f(), !u(Fb)) return a("property missing ':'"); var w = u(Bb), b = m({ - type: Yb, + type: qb, property: Hc(y[0].replace(Ic, Nr)), value: w ? Hc(w[0].replace(Ic, Nr)) : Nr }); @@ -14460,11 +14460,11 @@ function qb(t, e) { function Hc(t) { return t ? t.replace(Kb, Nr) : Nr; } -function Xb(t, e) { +function jb(t, e) { let n = null; if (!t || typeof t != "string") return n; - const r = qb(t), o = typeof e == "function"; + const r = Yb(t), o = typeof e == "function"; return r.forEach((i) => { if (i.type !== "declaration") return; @@ -14472,7 +14472,7 @@ function Xb(t, e) { o ? e(s, a, i) : a && (n = n || {}, n[s] = a); }), n; } -function jb(t, e) { +function Xb(t, e) { const n = RegExp(t, "g"); return (r) => { if (typeof r != "string") @@ -14480,7 +14480,7 @@ function jb(t, e) { return r.match(n) ? r.replace(n, e) : r; }; } -const Ub = jb(/[A-Z]/, (t) => `-${t.toLowerCase()}`); +const Ub = Xb(/[A-Z]/, (t) => `-${t.toLowerCase()}`); function Gb(t) { if (!t || typeof t != "object" || Array.isArray(t)) throw new TypeError(`expected an argument of type object, but got ${typeof t}`); @@ -14533,25 +14533,25 @@ let nx = class { }; new nx(); const Dr = mt("mode-watcher-mode"), Ir = mt("mode-watcher-theme"), rx = ["dark", "light", "system"]; -function qa(t) { +function Ya(t) { return typeof t != "string" ? !1 : rx.includes(t); } class ox { #e = "system"; #t = yi ? localStorage : fg; #n = this.#t.getItem(Dr.current); - #r = qa(this.#n) ? this.#n : this.#e; - #o = /* @__PURE__ */ ye(ht(this.#i())); + #r = Ya(this.#n) ? this.#n : this.#e; + #o = /* @__PURE__ */ me(ht(this.#i())); #i(e = this.#r) { return new dg(Dr.current, e, { serializer: { serialize: (n) => n, - deserialize: (n) => qa(n) ? n : this.#e + deserialize: (n) => Ya(n) ? n : this.#e } }); } constructor() { - Yr(() => tu.pre(() => Dr.current, (e, n) => { + qr(() => tu.pre(() => Dr.current, (e, n) => { const r = c(this.#o).current; K(this.#o, this.#i(r), !0), n && localStorage.removeItem(n); })); @@ -14566,7 +14566,7 @@ class ox { class ix { #e = void 0; #t = !0; - #n = /* @__PURE__ */ ye(ht(this.#e)); + #n = /* @__PURE__ */ me(ht(this.#e)); #r = typeof window < "u" && typeof window.matchMedia == "function" ? new kh("prefers-color-scheme: light") : { current: !1 }; query() { yi && K(this.#n, this.#r.current ? "light" : "dark", !0); @@ -14575,7 +14575,7 @@ class ix { this.#t = e; } constructor() { - Yr(() => { + qr(() => { Ft(() => { this.#t && this.query(); }); @@ -14585,12 +14585,12 @@ class ix { return c(this.#n); } } -const Xa = new ox(), ei = new ix(); +const ja = new ox(), ei = new ix(); class sx { #e = yi ? localStorage : fg; #t = this.#e.getItem(Ir.current); #n = this.#t === null || this.#t === void 0 ? "" : this.#t; - #r = /* @__PURE__ */ ye(ht(this.#o())); + #r = /* @__PURE__ */ me(ht(this.#o())); #o(e = this.#n) { return new dg(Ir.current, e, { serializer: { @@ -14600,7 +14600,7 @@ class sx { }); } constructor() { - Yr(() => tu.pre(() => Ir.current, (e, n) => { + qr(() => tu.pre(() => Ir.current, (e, n) => { const r = c(this.#r).current; K(this.#r, this.#o(r), !0), n && localStorage.removeItem(n); })); @@ -14620,7 +14620,7 @@ class sx { c(this.#r).current = e; } } -const Yi = new sx(); +const qi = new sx(); let Vc, zc, Rc = !1, To = null; function ax() { return To || (To = document.createElement("style"), To.appendChild(document.createTextNode(`* { @@ -14659,11 +14659,11 @@ function hg(t, e = !1) { t(), zc = window.setTimeout(i, 16); }, 16); } -const hr = mt(void 0), ms = mt(!0), ys = mt(!1), ja = mt([]), Ua = mt([]); +const hr = mt(void 0), ms = mt(!0), ys = mt(!1), Xa = mt([]), Ua = mt([]); function lx() { const t = /* @__PURE__ */ C(() => { if (!yi) return; - const e = Xa.current === "system" ? ei.current : Xa.current, n = Dc(ja.current), r = Dc(Ua.current); + const e = ja.current === "system" ? ei.current : ja.current, n = Dc(Xa.current), r = Dc(Ua.current); function o() { const i = document.documentElement, s = document.querySelector('meta[name="theme-color"]'); e === "light" ? (n.length && i.classList.remove(...n), r.length && i.classList.add(...r), i.style.colorScheme = "light", s && hr.current && s.setAttribute("content", hr.current.light)) : (r.length && i.classList.remove(...r), n.length && i.classList.add(...n), i.style.colorScheme = "dark", s && hr.current && s.setAttribute("content", hr.current.dark)); @@ -14678,11 +14678,11 @@ function lx() { } function ux() { const t = /* @__PURE__ */ C(() => { - if (Yi.current, !yi) return; + if (qi.current, !yi) return; function e() { - document.documentElement.setAttribute("data-theme", Yi.current); + document.documentElement.setAttribute("data-theme", qi.current); } - return ms.current ? hg(e, it(() => ys.current)) : e(), Yi.current; + return ms.current ? hg(e, it(() => ys.current)) : e(), qi.current; }); return { get current() { @@ -14692,10 +14692,10 @@ function ux() { } const cx = lx(), dx = ux(); function fx(t) { - Xa.current = t; + ja.current = t; } function hx(t) { - Yi.current = t; + qi.current = t; } function gx({ defaultMode: t = "system", themeColors: e, darkClassNames: n = ["dark"], lightClassNames: r = [], defaultTheme: o = "", modeStorageKey: i = "mode-watcher-mode", themeStorageKey: s = "mode-watcher-theme" }) { const a = document.documentElement, u = localStorage.getItem(i) ?? t, l = localStorage.getItem(s) ?? o, d = u === "light" || u === "system" && window.matchMedia("(prefers-color-scheme: light)").matches; @@ -14705,7 +14705,7 @@ function gx({ defaultMode: t = "system", themeColors: e, darkClassNames: n = ["d } l && (a.setAttribute("data-theme", l), localStorage.setItem(s, l)), localStorage.setItem(i, u); } -var vx = /* @__PURE__ */ ne(''); +var vx = /* @__PURE__ */ re(''); function gg(t, e) { ue(e, !0); let n = v(e, "themeColors", 7); @@ -14720,7 +14720,7 @@ function gg(t, e) { { var s = (a) => { var u = vx(); - Te(() => Ne(u, "content", n().dark)), O(a, u); + Oe(() => Pe(u, "content", n().dark)), O(a, u); }; ie(i, (a) => { n() && a(s); @@ -14729,7 +14729,7 @@ function gg(t, e) { return O(t, o), ce(r); } se(gg, { themeColors: {} }, [], [], !0); -var px = /* @__PURE__ */ ne(''), mx = /* @__PURE__ */ ne(" ", 1); +var px = /* @__PURE__ */ re(''), mx = /* @__PURE__ */ re(" ", 1); function vg(t, e) { ue(e, !0); let n = v(e, "trueNonce", 7, ""), r = v(e, "initConfig", 7), o = v(e, "themeColors", 7); @@ -14753,18 +14753,18 @@ function vg(t, e) { o(s), g(); } }; - return g1("1lz8xnp", (s) => { + return g1("1rw1464", (s) => { var a = mx(), u = J(a); { var l = (f) => { var h = px(); - Te(() => Ne(h, "content", o().dark)), O(f, h); + Oe(() => Pe(h, "content", o().dark)), O(f, h); }; ie(u, (f) => { o() && f(l); }); } - var d = z(u, 2); + var d = V(u, 2); Ks(d, () => `(` + gx.toString() + ")(" + JSON.stringify(r()) + ");<\/script>"), O(s, a); }), ce(i); } @@ -14772,14 +14772,14 @@ se(vg, { trueNonce: {}, initConfig: {}, themeColors: {} }, [], [], !0); function yx(t, e) { ue(e, !0); let n = v(e, "track", 7, !0), r = v(e, "defaultMode", 7, "system"), o = v(e, "themeColors", 7), i = v(e, "disableTransitions", 7, !0), s = v(e, "darkClassNames", 23, () => ["dark"]), a = v(e, "lightClassNames", 23, () => []), u = v(e, "defaultTheme", 7, ""), l = v(e, "nonce", 7, ""), d = v(e, "themeStorageKey", 7, "mode-watcher-theme"), f = v(e, "modeStorageKey", 7, "mode-watcher-mode"), h = v(e, "disableHeadScriptInjection", 7, !1), p = v(e, "synchronousModeChanges", 7, !1); - Dr.current = f(), Ir.current = d(), ja.current = s(), Ua.current = a(), ms.current = i(), hr.current = o(), ys.current = p(), Ft(() => { + Dr.current = f(), Ir.current = d(), Xa.current = s(), Ua.current = a(), ms.current = i(), hr.current = o(), ys.current = p(), Ft(() => { ys.current = p(); }), Ft(() => { ms.current = i(); }), Ft(() => { hr.current = o(); }), Ft(() => { - ja.current = s(); + Xa.current = s(); }), Ft(() => { Ua.current = a(); }), Ft(() => { @@ -14791,7 +14791,7 @@ function yx(t, e) { }), _n(() => { ei.tracking(n()), ei.query(); const _ = localStorage.getItem(Dr.current); - fx(qa(_) ? _ : r()); + fx(Ya(_) ? _ : r()); const T = localStorage.getItem(Ir.current); hx(T || u()); }); @@ -14924,7 +14924,7 @@ se( [], !0 ); -class B4 { +class $4 { options; rootEl; svelteFlowInstance; @@ -14979,7 +14979,7 @@ class B4 { } } const wx = () => { - let t = /* @__PURE__ */ ye([]), e = /* @__PURE__ */ ye([]), n = /* @__PURE__ */ ye({ x: 250, y: 100, zoom: 1 }); + let t = /* @__PURE__ */ me([]), e = /* @__PURE__ */ me([]), n = /* @__PURE__ */ me({ x: 250, y: 100, zoom: 1 }); return { // nodes: nodesInternal, // edges: edgesInternal, @@ -15035,7 +15035,7 @@ const wx = () => { K(e, c(e).map((i) => i.id === r ? { ...i, data: { ...i.data, ...o } } : i)); } }; -}, Be = wx(); +}, $e = wx(); function gn(...t) { return Ro(t); } @@ -15056,8 +15056,8 @@ const Fc = { "icon-sm": "tf-btn-icon-sm", "icon-lg": "tf-btn-icon-lg" }; -var bx = /* @__PURE__ */ ne(""), xx = /* @__PURE__ */ ne(""); -function $e(t, e) { +var bx = /* @__PURE__ */ re(""), xx = /* @__PURE__ */ re(""); +function Fe(t, e) { ue(e, !0); let n = v(e, "class", 7), r = v(e, "variant", 7, "outline"), o = v(e, "size", 7, "default"), i = v(e, "ref", 15, null), s = v(e, "href", 23, () => { }), a = v(e, "type", 7, "button"), u = v(e, "disabled", 7), l = v(e, "children", 7), d = v(e, "primary", 7), f = /* @__PURE__ */ Le(e, [ @@ -15151,7 +15151,7 @@ function $e(t, e) { ] ); var E = Z(S); - Oe(E, () => l() ?? ze), W(S), Nt(S, (x) => i(x), () => i()), O(b, S); + Ae(E, () => l() ?? ze), W(S), Nt(S, (x) => i(x), () => i()), O(b, S); }, w = (b) => { var S = xx(); Ge( @@ -15168,7 +15168,7 @@ function $e(t, e) { ] ); var E = Z(S); - Oe(E, () => l() ?? ze), W(S), Nt(S, (x) => i(x), () => i()), O(b, S); + Ae(E, () => l() ?? ze), W(S), Nt(S, (x) => i(x), () => i()), O(b, S); }; ie(m, (b) => { s() ? b(y) : b(w, !1); @@ -15177,7 +15177,7 @@ function $e(t, e) { return O(t, p), ce(h); } se( - $e, + Fe, { class: {}, variant: {}, @@ -15204,7 +15204,7 @@ function Ga(t) { return t == null || Cx.includes(typeof t) ? !0 : Array.isArray(t) ? t.every((e) => Ga(e)) : typeof t == "object" ? Object.getPrototypeOf(t) === Object.prototype : !1; } const ws = Symbol("box"), pg = Symbol("is-writable"); -function ge(t, e) { +function pe(t, e) { const n = /* @__PURE__ */ C(t); return e ? { [ws]: !0, @@ -15226,10 +15226,10 @@ function mg(t) { return wi(t) && ws in t; } function Sx(t) { - return mg(t) ? t : _x(t) ? ge(t) : An(t); + return mg(t) ? t : _x(t) ? pe(t) : An(t); } function An(t) { - let e = /* @__PURE__ */ ye(ht(t)); + let e = /* @__PURE__ */ me(ht(t)); return { [ws]: !0, [pg]: !0, @@ -15308,7 +15308,7 @@ function Ho(t) { } e[Tx(r)] = o; } - return Xb(t, n), e; + return jb(t, n), e; } function Bo(...t) { return (...e) => { @@ -15676,7 +15676,7 @@ class Zx { return c(this.#a); } } -class Yx { +class qx { #e = () => { }; #t = /* @__PURE__ */ C(() => this.#e()); @@ -15699,18 +15699,18 @@ function _o(t) { t(); }); } -function qx(t) { +function Yx(t) { He(() => it(() => t())); } -function Xx(t, e) { +function jx(t, e) { return setTimeout(e, t); } function bi(t) { sf().then(t); } -const jx = 1, Ux = 9, Gx = 11; +const Xx = 1, Ux = 9, Gx = 11; function Ja(t) { - return wi(t) && t.nodeType === jx && typeof t.nodeName == "string"; + return wi(t) && t.nodeType === Xx && typeof t.nodeName == "string"; } function _g(t) { return wi(t) && t.nodeType === Ux; @@ -15766,7 +15766,7 @@ class xi { K(this.#e, e); } constructor(e) { - typeof e == "function" ? this.element = ge(e) : this.element = e; + typeof e == "function" ? this.element = pe(e) : this.element = e; } getDocument = () => t_(this.root); getWindow = () => this.getDocument().defaultView ?? window; @@ -15826,7 +15826,7 @@ function ou(t) { getAttr: e.getAttr }; } -const Vo = "ArrowDown", Jr = "ArrowUp", Eg = "End", el = "Enter", i_ = "Escape", Pg = "Home", Ng = "PageDown", Tg = "PageUp", qi = " ", Wc = "Tab", Og = typeof document < "u", tl = s_(); +const Vo = "ArrowDown", Jr = "ArrowUp", Eg = "End", el = "Enter", i_ = "Escape", Pg = "Home", Ng = "PageDown", Tg = "PageUp", Yi = " ", Wc = "Tab", Og = typeof document < "u", tl = s_(); function s_() { return Og && window?.navigator?.userAgent && (/iP(ad|hone|od)/.test(window.navigator.userAgent) || // The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh. window?.navigator?.maxTouchPoints > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent)); @@ -15880,7 +15880,7 @@ class c_ { #e; #t; #n; - #r = /* @__PURE__ */ ye(!1); + #r = /* @__PURE__ */ me(!1); constructor(e) { this.#e = e, K(this.#r, e.open.current, !0), this.#t = e.enabled ?? !0, this.#n = new u_({ ref: this.#e.ref, afterTick: this.#e.open }), yt(() => this.#e.open.current, (n) => { n && K(this.#r, !0), this.#t && this.#n.run(() => { @@ -15910,7 +15910,7 @@ function Ag(t, e) { }, o = de(), i = J(o); return f1(i, n, (s) => { var a = de(), u = J(a); - Oe(u, () => n() ?? ze), O(s, a); + Ae(u, () => n() ?? ze), O(s, a); }), O(t, o), ce(r); } se(Ag, { children: {} }, [], [], !0); @@ -15930,7 +15930,7 @@ class h_ { } } function g_(t, e) { - return (n) => ge(() => { + return (n) => pe(() => { const o = n(e)?.current; if (o !== void 0) return o; @@ -15941,7 +15941,7 @@ function g_(t, e) { function v_(t, e) { return (n) => { const r = f_(); - return ge(() => { + return pe(() => { const o = n(); if (o !== void 0) return o; @@ -15997,7 +15997,7 @@ function rl(t, e) { { var m = (y) => { var w = de(), b = J(w); - Oe(b, () => r() ?? ze), O(y, w); + Ae(b, () => r() ?? ze), O(y, w); }; ie(p, (y) => { o() && y(m); @@ -16128,7 +16128,7 @@ var Mg = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] } } return i; -}, Yc = function(e) { +}, qc = function(e) { var n = e.getBoundingClientRect(), r = n.width, o = n.height; return r === 0 && o === 0; }, N_ = function(e, n) { @@ -16161,7 +16161,7 @@ var Mg = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] for (var u = e; e; ) { var l = e.parentElement, d = xs(e); if (l && !l.shadowRoot && o(l) === !0) - return Yc(e); + return qc(e); e.assignedSlot ? e = e.assignedSlot : !l && d !== e.ownerDocument ? e = d.host : e = l; } e = u; @@ -16171,7 +16171,7 @@ var Mg = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] if (r !== "legacy-full") return !0; } else if (r === "non-zero-area") - return Yc(e); + return qc(e); return !1; }, T_ = function(e) { if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName)) @@ -16190,7 +16190,7 @@ var Mg = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] }, Ss = function(e, n) { return !(n.disabled || x_(n) || N_(n, e) || // For a details element with a summary, the summary element gets the focus __(n) || T_(n)); -}, qc = function(e, n) { +}, Yc = function(e, n) { return !(E_(n) || zg(n) < 0 || !Ss(e, n)); }, O_ = function(e) { var n = parseInt(e.getAttribute("tabindex"), 10); @@ -16213,11 +16213,11 @@ var Mg = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] n = n || {}; var r; return n.getShadowRoot ? r = Cs([e], n.includeContainer, { - filter: qc.bind(null, n), + filter: Yc.bind(null, n), flatten: !1, getShadowRoot: n.getShadowRoot, shadowRootFilter: O_ - }) : r = Hg(e, n.includeContainer, qc.bind(null, n)), Fg(r); + }) : r = Hg(e, n.includeContainer, Yc.bind(null, n)), Fg(r); }, D_ = function(e, n) { n = n || {}; var r; @@ -16263,22 +16263,22 @@ function iu(t, e, n) { const m = t.filter((y) => y.toLowerCase().startsWith(r)); if (m.length > 0) { const y = n ? t.indexOf(n) : -1; - return Xc(m, Math.max(y, 0)).find((S) => S !== n) || n; + return jc(m, Math.max(y, 0)).find((S) => S !== n) || n; } } const i = e.length > 1 && Array.from(e).every((f) => f === e[0]) ? e[0] : e, s = i.toLowerCase(), a = n ? t.indexOf(n) : -1; - let u = Xc(t, Math.max(a, 0)); + let u = jc(t, Math.max(a, 0)); i.length === 1 && (u = u.filter((f) => f !== n)); const d = u.find((f) => f?.toLowerCase().startsWith(s)); return d !== n ? d : void 0; } -function Xc(t, e) { +function jc(t, e) { return t.map((n, r) => t[(e + r) % t.length]); } const R_ = { afterMs: 1e4, onChange: Re }; function Bg(t, e) { const { afterMs: n, onChange: r, getWindow: o } = { ...R_, ...e }; - let i = null, s = /* @__PURE__ */ ye(ht(t)); + let i = null, s = /* @__PURE__ */ me(ht(t)); function a() { return o().setTimeout( () => { @@ -16289,7 +16289,7 @@ function Bg(t, e) { } return He(() => () => { i && o().clearTimeout(i); - }), ge(() => c(s), (u) => { + }), pe(() => c(s), (u) => { K(s, u, !0), r?.(u), i && o().clearTimeout(i), i = a(); }); } @@ -16357,7 +16357,7 @@ class su { }; yt([() => this.opts.enabled.current, () => this.opts.ref.current], () => { if (!(!this.opts.enabled.current || !this.opts.ref.current)) - return Xx(1, () => { + return jx(1, () => { this.opts.ref.current && (globalThis.bitsDismissableLayers.set(this, this.#t), n(), n = this.#u()); }), r; }), _o(() => { @@ -16393,7 +16393,7 @@ class su { } #c = (e) => { let n = e; - n.defaultPrevented && (n = jc(e)), this.#e.current(e); + n.defaultPrevented && (n = Xc(e)), this.#e.current(e); }; #d = Zc( (e) => { @@ -16407,7 +16407,7 @@ class su { return; } let r = e; - if (r.defaultPrevented && (r = jc(r)), this.#t.current !== "close" && this.#t.current !== "defer-otherwise-close") { + if (r.defaultPrevented && (r = Xc(r)), this.#t.current !== "close" && this.#t.current !== "defer-otherwise-close") { this.#s(); return; } @@ -16465,7 +16465,7 @@ function Z_(t, e) { const o = !!e.closest(`[${$_}]`); return r && o ? !1 : Ig(n).documentElement.contains(n) && !Dg(e, n) && m_(t, e); } -function jc(t) { +function Xc(t) { const e = t.currentTarget, n = t.target; let r; t instanceof PointerEvent ? r = new PointerEvent(t.type, t) : r = new PointerEvent("pointerdown", t); @@ -16480,12 +16480,12 @@ function $g(t, e) { ue(e, !0); let n = v(e, "interactOutsideBehavior", 7, "close"), r = v(e, "onInteractOutside", 7, Re), o = v(e, "onFocusOutside", 7, Re), i = v(e, "id", 7), s = v(e, "children", 7), a = v(e, "enabled", 7), u = v(e, "isValidEvent", 7, () => !1), l = v(e, "ref", 7); const d = su.create({ - id: ge(() => i()), - interactOutsideBehavior: ge(() => n()), - onInteractOutside: ge(() => r()), - enabled: ge(() => a()), - onFocusOutside: ge(() => o()), - isValidEvent: ge(() => u()), + id: pe(() => i()), + interactOutsideBehavior: pe(() => n()), + onInteractOutside: pe(() => r()), + enabled: pe(() => a()), + onFocusOutside: pe(() => o()), + isValidEvent: pe(() => u()), ref: l() }); var f = { @@ -16538,7 +16538,7 @@ function $g(t, e) { l(m), g(); } }, h = de(), p = J(h); - return Oe(p, () => s() ?? ze, () => ({ props: d.props })), O(t, h), ce(f); + return Ae(p, () => s() ?? ze, () => ({ props: d.props })), O(t, h), ce(f); } se( $g, @@ -16572,14 +16572,14 @@ class au { } #e = () => gt(this.domContext.getDocument(), "keydown", this.#t, { passive: !1 }); #t = (e) => { - if (e.key !== i_ || !Y_(this)) return; + if (e.key !== i_ || !q_(this)) return; const n = new KeyboardEvent(e.type, e); e.preventDefault(); const r = this.opts.escapeKeydownBehavior.current; r !== "close" && r !== "defer-otherwise-close" || this.opts.onEscapeKeydown.current(n); }; } -function Y_(t) { +function q_(t) { const e = [...globalThis.bitsEscapeLayers], n = e.findLast(([o, { current: i }]) => i === "close" || i === "ignore"); if (n) return n[0] === t; const [r] = e[0]; @@ -16589,9 +16589,9 @@ function Kg(t, e) { ue(e, !0); let n = v(e, "escapeKeydownBehavior", 7, "close"), r = v(e, "onEscapeKeydown", 7, Re), o = v(e, "children", 7), i = v(e, "enabled", 7), s = v(e, "ref", 7); au.create({ - escapeKeydownBehavior: ge(() => n()), - onEscapeKeydown: ge(() => r()), - enabled: ge(() => i()), + escapeKeydownBehavior: pe(() => n()), + onEscapeKeydown: pe(() => r()), + enabled: pe(() => i()), ref: s() }); var a = { @@ -16626,7 +16626,7 @@ function Kg(t, e) { s(d), g(); } }, u = de(), l = J(u); - return Oe(l, () => o() ?? ze), O(t, u), ce(a); + return Ae(l, () => o() ?? ze), O(t, u), ce(a); } se( Kg, @@ -16792,11 +16792,11 @@ function Wg(t, e) { ue(e, !0); let n = v(e, "enabled", 7, !1), r = v(e, "trapFocus", 7, !1), o = v(e, "loop", 7, !1), i = v(e, "onCloseAutoFocus", 7, Re), s = v(e, "onOpenAutoFocus", 7, Re), a = v(e, "focusScope", 7), u = v(e, "ref", 7); const l = uu.use({ - enabled: ge(() => n()), - trap: ge(() => r()), + enabled: pe(() => n()), + trap: pe(() => r()), loop: o(), - onCloseAutoFocus: ge(() => i()), - onOpenAutoFocus: ge(() => s()), + onCloseAutoFocus: pe(() => i()), + onOpenAutoFocus: pe(() => s()), ref: u() }); var d = { @@ -16843,7 +16843,7 @@ function Wg(t, e) { u(p), g(); } }, f = de(), h = J(f); - return Oe(h, () => a() ?? ze, () => ({ props: l.props })), O(t, f), ce(d); + return Ae(h, () => a() ?? ze, () => ({ props: l.props })), O(t, f), ce(d); } se( Wg, @@ -16880,14 +16880,14 @@ class cu { } #n = (e) => { const n = this.opts.ref.current, r = e.target; - !nl(n) || !nl(r) || !this.opts.enabled.current || !X_(this) || !e_(n, r) || (this.opts.onPointerDown.current(e), !e.defaultPrevented && (this.#e = q_(n, this.domContext.getDocument().body))); + !nl(n) || !nl(r) || !this.opts.enabled.current || !j_(this) || !e_(n, r) || (this.opts.onPointerDown.current(e), !e.defaultPrevented && (this.#e = Y_(n, this.domContext.getDocument().body))); }; #r = () => { this.#e(), this.#e = Re; }; } const Uc = (t) => t.style.userSelect || t.style.webkitUserSelect; -function q_(t, e) { +function Y_(t, e) { const n = Uc(e), r = Uc(t); return Ii(e, "none"), Ii(t, "text"), () => { Ii(e, n), Ii(t, r); @@ -16896,7 +16896,7 @@ function q_(t, e) { function Ii(t, e) { t.style.userSelect = e, t.style.webkitUserSelect = e; } -function X_(t) { +function j_(t) { const e = [...globalThis.bitsTextSelectionLayers]; if (!e.length) return !1; const n = e.at(-1); @@ -16906,10 +16906,10 @@ function Zg(t, e) { ue(e, !0); let n = v(e, "preventOverflowTextSelection", 7, !0), r = v(e, "onPointerDown", 7, Re), o = v(e, "onPointerUp", 7, Re), i = v(e, "id", 7), s = v(e, "children", 7), a = v(e, "enabled", 7), u = v(e, "ref", 7); cu.create({ - id: ge(() => i()), - onPointerDown: ge(() => r()), - onPointerUp: ge(() => o()), - enabled: ge(() => a() && n()), + id: pe(() => i()), + onPointerDown: pe(() => r()), + onPointerUp: pe(() => o()), + enabled: pe(() => a() && n()), ref: u() }); var l = { @@ -16956,7 +16956,7 @@ function Zg(t, e) { u(h), g(); } }, d = de(), f = J(d); - return Oe(f, () => s() ?? ze), O(t, d), ce(l); + return Ae(f, () => s() ?? ze), O(t, d), ce(l); } se( Zg, @@ -16977,10 +16977,10 @@ globalThis.bitsIdCounter ??= { current: 0 }; function ks(t = "bits") { return globalThis.bitsIdCounter.current++, `${t}-${globalThis.bitsIdCounter.current}`; } -class j_ { +class X_ { #e; #t = 0; - #n = /* @__PURE__ */ ye(); + #n = /* @__PURE__ */ me(); #r; constructor(e) { this.#e = e; @@ -16989,22 +16989,22 @@ class j_ { this.#t -= 1, this.#r && this.#t <= 0 && (this.#r(), K(this.#n, void 0), this.#r = void 0); } get(...e) { - return this.#t += 1, c(this.#n) === void 0 && (this.#r = Yr(() => { + return this.#t += 1, c(this.#n) === void 0 && (this.#r = qr(() => { K(this.#n, this.#e(...e), !0); })), He(() => () => { this.#o(); }), c(this.#n); } } -const Xi = new x2(); -let Mi = /* @__PURE__ */ ye(null), _a = null, Oo = null, Ao = !1; -const Gc = ge(() => { - for (const t of Xi.values()) +const ji = new x2(); +let Mi = /* @__PURE__ */ me(null), _a = null, Oo = null, Ao = !1; +const Gc = pe(() => { + for (const t of ji.values()) if (t) return !0; return !1; }); let Ca = null; -const U_ = new j_(() => { +const U_ = new X_(() => { function t() { document.body.setAttribute("style", c(Mi) ?? ""), document.body.style.removeProperty("--scrollbar-width"), tl && _a?.(), K(Mi, null); } @@ -17014,12 +17014,12 @@ const U_ = new j_(() => { function n(o, i) { e(), Ao = !0, Ca = Date.now(); const s = Ca, a = () => { - Oo = null, Ca === s && (Yg(Xi) ? Ao = !1 : (Ao = !1, i())); + Oo = null, Ca === s && (qg(ji) ? Ao = !1 : (Ao = !1, i())); }, u = o === null ? 24 : o; Oo = window.setTimeout(a, u); } function r() { - c(Mi) === null && Xi.size === 0 && !Ao && K(Mi, document.body.getAttribute("style"), !0); + c(Mi) === null && ji.size === 0 && !Ao && K(Mi, document.body.getAttribute("style"), !0); } return yt(() => Gc.current, () => { if (!Gc.current) return; @@ -17042,7 +17042,7 @@ const U_ = new j_(() => { _a?.(); }), { get lockMap() { - return Xi; + return ji; }, resetBodyStyle: t, scheduleCleanupIfNoNewLocks: n, @@ -17057,8 +17057,8 @@ class G_ { #r; locked; constructor(e, n = () => null) { - this.#t = e, this.#n = n, this.#r = U_.get(), this.#r && (this.#r.cancelPendingCleanup(), this.#r.ensureInitialStyleCaptured(), this.#r.lockMap.set(this.#e, this.#t ?? !1), this.locked = ge(() => this.#r.lockMap.get(this.#e) ?? !1, (r) => this.#r.lockMap.set(this.#e, r)), _o(() => { - if (this.#r.lockMap.delete(this.#e), Yg(this.#r.lockMap)) return; + this.#t = e, this.#n = n, this.#r = U_.get(), this.#r && (this.#r.cancelPendingCleanup(), this.#r.ensureInitialStyleCaptured(), this.#r.lockMap.set(this.#e, this.#t ?? !1), this.locked = pe(() => this.#r.lockMap.get(this.#e) ?? !1, (r) => this.#r.lockMap.set(this.#e, r)), _o(() => { + if (this.#r.lockMap.delete(this.#e), qg(this.#r.lockMap)) return; const r = this.#n(); this.#r.scheduleCleanupIfNoNewLocks(r, () => { this.#r.resetBodyStyle(); @@ -17066,7 +17066,7 @@ class G_ { })); } } -function Yg(t) { +function qg(t) { for (const [e, n] of t) if (n) return !0; return !1; @@ -17095,10 +17095,10 @@ se(il, { preventScroll: {}, restoreScrollDelay: {} }, [], [], !0); const J_ = ou({ component: "checkbox", parts: ["root", "group", "group-label", "input"] -}), Q_ = new Er("Checkbox.Group"), qg = new Er("Checkbox.Root"); +}), Q_ = new Er("Checkbox.Group"), Yg = new Er("Checkbox.Root"); class du { static create(e, n = null) { - return qg.set(new du(e, n)); + return Yg.set(new du(e, n)); } opts; group; @@ -17150,7 +17150,7 @@ class du { e.preventDefault(), this.opts.type.current === "submit" && e.currentTarget.closest("form")?.requestSubmit(); return; } - e.key === qi && (e.preventDefault(), this.#o()); + e.key === Yi && (e.preventDefault(), this.#o()); } } #o() { @@ -17200,7 +17200,7 @@ class du { } class fu { static create() { - return new fu(qg.get()); + return new fu(Yg.get()); } root; #e = /* @__PURE__ */ C(() => this.root.group ? !!(this.root.opts.value.current !== void 0 && this.root.group.opts.value.current.includes(this.root.opts.value.current)) : this.root.opts.checked.current); @@ -17243,7 +17243,7 @@ class fu { function e7(t, e) { return e ? "indeterminate" : t ? "checked" : "unchecked"; } -var t7 = /* @__PURE__ */ ne(""), n7 = /* @__PURE__ */ ne(""); +var t7 = /* @__PURE__ */ re(""), n7 = /* @__PURE__ */ re(""); function hu(t, e) { ue(e, !0); let n = v(e, "value", 15), r = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host", "value"]); @@ -17275,7 +17275,7 @@ function hu(t, e) { return O(t, s), ce(i); } se(hu, { value: {} }, [], [], !0); -function Xg(t, e) { +function jg(t, e) { ue(e, !1); const n = fu.create(); Hl(); @@ -17290,9 +17290,9 @@ function Xg(t, e) { } O(t, r), ce(); } -se(Xg, {}, [], [], !0); -var r7 = /* @__PURE__ */ ne(""), o7 = /* @__PURE__ */ ne(" ", 1); -function jg(t, e) { +se(jg, {}, [], [], !0); +var r7 = /* @__PURE__ */ re(""), o7 = /* @__PURE__ */ re(" ", 1); +function Xg(t, e) { const n = ai(); ue(e, !0); let r = v(e, "checked", 15, !1), o = v(e, "ref", 15, null), i = v(e, "onCheckedChange", 7), s = v(e, "children", 7), a = v(e, "disabled", 7, !1), u = v(e, "required", 7, !1), l = v(e, "name", 23, () => { @@ -17322,20 +17322,20 @@ function jg(t, e) { }); const E = du.create( { - checked: ge(() => r(), (N) => { + checked: pe(() => r(), (N) => { r(N), i()?.(N); }), - disabled: ge(() => a() ?? !1), - required: ge(() => u()), - name: ge(() => l()), - value: ge(() => d()), - id: ge(() => f()), - ref: ge(() => o(), (N) => o(N)), - indeterminate: ge(() => h(), (N) => { + disabled: pe(() => a() ?? !1), + required: pe(() => u()), + name: pe(() => l()), + value: pe(() => d()), + id: pe(() => f()), + ref: pe(() => o(), (N) => o(N)), + indeterminate: pe(() => h(), (N) => { h(N), p()?.(N); }), - type: ge(() => y()), - readonly: ge(() => !!w()) + type: pe(() => y()), + readonly: pe(() => !!w()) }, S ), x = /* @__PURE__ */ C(() => Ln({ ...b }, E.props)); @@ -17426,28 +17426,28 @@ function jg(t, e) { } }, T = o7(), I = J(T); { - var B = (N) => { + var F = (N) => { var k = de(), D = J(k); { let P = /* @__PURE__ */ C(() => ({ props: c(x), ...E.snippetProps })); - Oe(D, m, () => c(P)); + Ae(D, m, () => c(P)); } O(N, k); }, $ = (N) => { var k = r7(); Ge(k, () => ({ ...c(x) })); var D = Z(k); - Oe(D, () => s() ?? ze, () => E.snippetProps), W(k), O(N, k); + Ae(D, () => s() ?? ze, () => E.snippetProps), W(k), O(N, k); }; ie(I, (N) => { - m() ? N(B) : N($, !1); + m() ? N(F) : N($, !1); }); } - var H = z(I, 2); - return Xg(H, {}), O(t, T), ce(_); + var H = V(I, 2); + return jg(H, {}), O(t, T), ce(_); } se( - jg, + Xg, { checked: {}, ref: {}, @@ -17468,7 +17468,7 @@ se( [], !0 ); -const i7 = ["top", "right", "bottom", "left"], wr = Math.min, Xt = Math.max, Es = Math.round, Li = Math.floor, Hn = (t) => ({ +const i7 = ["top", "right", "bottom", "left"], wr = Math.min, jt = Math.max, Es = Math.round, Li = Math.floor, Hn = (t) => ({ x: t, y: t }), s7 = { @@ -17481,7 +17481,7 @@ const i7 = ["top", "right", "bottom", "left"], wr = Math.min, Xt = Math.max, Es end: "start" }; function sl(t, e, n) { - return Xt(t, wr(e, n)); + return jt(t, wr(e, n)); } function rr(t, e) { return typeof t == "function" ? t(e) : t; @@ -17752,7 +17752,7 @@ const m7 = (t) => ({ }, p = pu(o), m = vu(p), y = await s.getDimensions(l), w = p === "y", b = w ? "top" : "left", S = w ? "bottom" : "right", E = w ? "clientHeight" : "clientWidth", x = i.reference[m] + i.reference[p] - h[p] - i.floating[m], _ = h[p] - i.reference[p], T = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l)); let I = T ? T[E] : 0; (!I || !await (s.isElement == null ? void 0 : s.isElement(T))) && (I = a.floating[E] || i.floating[m]); - const B = x / 2 - _ / 2, $ = I / 2 - y[m] / 2 - 1, H = wr(f[b], $), N = wr(f[S], $), k = H, D = I - y[m] - N, P = I / 2 - y[m] / 2 + B, A = sl(k, P, D), R = !u.arrow && Co(o) != null && P !== A && i.reference[m] / 2 - (P < k ? H : N) - y[m] / 2 < 0, M = R ? P < k ? P - k : P - D : 0; + const F = x / 2 - _ / 2, $ = I / 2 - y[m] / 2 - 1, H = wr(f[b], $), N = wr(f[S], $), k = H, D = I - y[m] - N, P = I / 2 - y[m] / 2 + F, A = sl(k, P, D), R = !u.arrow && Co(o) != null && P !== A && i.reference[m] / 2 - (P < k ? H : N) - y[m] / 2 < 0, M = R ? P < k ? P - k : P - D : 0; return { [p]: h[p] + M, data: { @@ -17791,11 +17791,11 @@ const m7 = (t) => ({ return {}; const b = or(o), S = Dn(a), E = or(a) === a, x = await (u.isRTL == null ? void 0 : u.isRTL(l.floating)), _ = h || (E || !y ? [Ps(a)] : c7(a)), T = m !== "none"; !h && T && _.push(...g7(a, y, m, x)); - const I = [a, ..._], B = await ti(e, w), $ = []; + const I = [a, ..._], F = await ti(e, w), $ = []; let H = ((r = i.flip) == null ? void 0 : r.overflows) || []; - if (d && $.push(B[b]), f) { + if (d && $.push(F[b]), f) { const P = u7(o, s, x); - $.push(B[P[0]], B[P[1]]); + $.push(F[P[0]], F[P[1]]); } if (H = [...H, { placement: o, @@ -17822,13 +17822,13 @@ const m7 = (t) => ({ var D; const M = (D = H.filter((Y) => { if (T) { - const U = Dn(Y.placement); - return U === S || // Create a bias to the `y` side axis due to horizontal + const G = Dn(Y.placement); + return G === S || // Create a bias to the `y` side axis due to horizontal // reading directions favoring greater width. - U === "y"; + G === "y"; } return !0; - }).map((Y) => [Y.placement, Y.overflows.filter((U) => U > 0).reduce((U, V) => U + V, 0)]).sort((Y, U) => Y[1] - U[1])[0]) == null ? void 0 : D[0]; + }).map((Y) => [Y.placement, Y.overflows.filter((G) => G > 0).reduce((G, z) => G + z, 0)]).sort((Y, G) => Y[1] - G[1])[0]) == null ? void 0 : D[0]; M && (R = M); break; } @@ -18069,14 +18069,14 @@ const x7 = function(t) { let w, b; f === "top" || f === "bottom" ? (w = f, b = h === (await (s.isRTL == null ? void 0 : s.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (b = f, w = h === "end" ? "top" : "bottom"); const S = y - d.top - d.bottom, E = m - d.left - d.right, x = wr(y - d[w], S), _ = wr(m - d[b], E), T = !e.middlewareData.shift; - let I = x, B = _; - if ((n = e.middlewareData.shift) != null && n.enabled.x && (B = E), (r = e.middlewareData.shift) != null && r.enabled.y && (I = S), T && !h) { - const H = Xt(d.left, 0), N = Xt(d.right, 0), k = Xt(d.top, 0), D = Xt(d.bottom, 0); - p ? B = m - 2 * (H !== 0 || N !== 0 ? H + N : Xt(d.left, d.right)) : I = y - 2 * (k !== 0 || D !== 0 ? k + D : Xt(d.top, d.bottom)); + let I = x, F = _; + if ((n = e.middlewareData.shift) != null && n.enabled.x && (F = E), (r = e.middlewareData.shift) != null && r.enabled.y && (I = S), T && !h) { + const H = jt(d.left, 0), N = jt(d.right, 0), k = jt(d.top, 0), D = jt(d.bottom, 0); + p ? F = m - 2 * (H !== 0 || N !== 0 ? H + N : jt(d.left, d.right)) : I = y - 2 * (k !== 0 || D !== 0 ? k + D : jt(d.top, d.bottom)); } await u({ ...e, - availableWidth: B, + availableWidth: F, availableHeight: I }); const $ = await s.getDimensions(a.floating); @@ -18305,10 +18305,10 @@ function V7(t) { return Array.from(t.getClientRects()); } function z7(t) { - const e = Bn(t), n = ta(t), r = t.ownerDocument.body, o = Xt(e.scrollWidth, e.clientWidth, r.scrollWidth, r.clientWidth), i = Xt(e.scrollHeight, e.clientHeight, r.scrollHeight, r.clientHeight); + const e = Bn(t), n = ta(t), r = t.ownerDocument.body, o = jt(e.scrollWidth, e.clientWidth, r.scrollWidth, r.clientWidth), i = jt(e.scrollHeight, e.clientHeight, r.scrollHeight, r.clientHeight); let s = -n.scrollLeft + na(t); const a = -n.scrollTop; - return bn(r).direction === "rtl" && (s += Xt(e.clientWidth, r.clientWidth) - o), { + return bn(r).direction === "rtl" && (s += jt(e.clientWidth, r.clientWidth) - o), { width: o, height: i, x: s, @@ -18391,7 +18391,7 @@ function K7(t) { } = t; const s = [...n === "clippingAncestors" ? ea(e) ? [] : $7(e, this._c) : [].concat(n), r], a = s[0], u = s.reduce((l, d) => { const f = id(e, d, o); - return l.top = Xt(f.top, l.top), l.right = wr(f.right, l.right), l.bottom = wr(f.bottom, l.bottom), l.left = Xt(f.left, l.left), l; + return l.top = jt(f.top, l.top), l.right = wr(f.right, l.right), l.bottom = wr(f.bottom, l.bottom), l.left = jt(f.left, l.left), l; }, id(e, a, o)); return { width: u.right - u.left, @@ -18463,7 +18463,7 @@ function ov(t, e) { r = sd(r, e); return r && mo(r) && Sa(r) && !mu(r) ? n : r || D7(t) || n; } -const Y7 = async function(t) { +const q7 = async function(t) { const e = this.getOffsetParent || ov, n = this.getDimensions, r = await n(t.floating); return { reference: Z7(t.reference, await e(t.floating), t.strategy), @@ -18475,25 +18475,25 @@ const Y7 = async function(t) { } }; }; -function q7(t) { +function Y7(t) { return bn(t).direction === "rtl"; } -const X7 = { +const j7 = { convertOffsetParentRelativeRectToViewportRelativeRect: H7, getDocumentElement: Bn, getClippingRect: K7, getOffsetParent: ov, - getElementRects: Y7, + getElementRects: q7, getClientRects: V7, getDimensions: W7, getScale: oo, isElement: wn, - isRTL: q7 + isRTL: Y7 }; function iv(t, e) { return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height; } -function j7(t, e) { +function X7(t, e) { let n = null, r; const o = Bn(t); function i() { @@ -18512,7 +18512,7 @@ function j7(t, e) { return; const m = Li(f), y = Li(o.clientWidth - (d + h)), w = Li(o.clientHeight - (f + p)), b = Li(d), E = { rootMargin: -m + "px " + -y + "px " + -w + "px " + -b + "px", - threshold: Xt(0, wr(1, u)) || 1 + threshold: jt(0, wr(1, u)) || 1 }; let x = !0; function _(T) { @@ -18553,7 +18553,7 @@ function U7(t, e, n, r) { passive: !0 }), i && b.addEventListener("resize", n); }); - const f = l && a ? j7(l, n) : null; + const f = l && a ? X7(l, n) : null; let h = -1, p = null; s && (p = new ResizeObserver((b) => { let [S] = b; @@ -18577,7 +18577,7 @@ function U7(t, e, n, r) { } const sv = x7, av = _7, lv = y7, G7 = S7, J7 = w7, uv = m7, Q7 = C7, cv = (t, e, n) => { const r = /* @__PURE__ */ new Map(), o = { - platform: X7, + platform: j7, ...n }, i = { ...o.platform, @@ -18609,9 +18609,9 @@ function e5(t) { } function t5(t) { const e = t.whileElementsMounted, n = /* @__PURE__ */ C(() => Pr(t.open) ?? !0), r = /* @__PURE__ */ C(() => Pr(t.middleware)), o = /* @__PURE__ */ C(() => Pr(t.transform) ?? !0), i = /* @__PURE__ */ C(() => Pr(t.placement) ?? "bottom"), s = /* @__PURE__ */ C(() => Pr(t.strategy) ?? "absolute"), a = /* @__PURE__ */ C(() => Pr(t.sideOffset) ?? 0), u = /* @__PURE__ */ C(() => Pr(t.alignOffset) ?? 0), l = t.reference; - let d = /* @__PURE__ */ ye(0), f = /* @__PURE__ */ ye(0); + let d = /* @__PURE__ */ me(0), f = /* @__PURE__ */ me(0); const h = An(null); - let p = /* @__PURE__ */ ye(ht(c(s))), m = /* @__PURE__ */ ye(ht(c(i))), y = /* @__PURE__ */ ye(ht({})), w = /* @__PURE__ */ ye(!1), b = !1, S = 0; + let p = /* @__PURE__ */ me(ht(c(s))), m = /* @__PURE__ */ me(ht(c(i))), y = /* @__PURE__ */ me(ht({})), w = /* @__PURE__ */ me(!1), b = !1, S = 0; const E = /* @__PURE__ */ C(() => { const H = h.current ? ad(h.current, c(d)) : c(d), N = h.current ? ad(h.current, c(f)) : c(f); return c(o) ? { @@ -18668,7 +18668,7 @@ function t5(t) { } c(n) && (l.current === null || h.current === null || (x = e(l.current, h.current, _))); } - function B() { + function F() { !c(n) && h.current === null && K(w, !1); } function $() { @@ -18699,7 +18699,7 @@ function t5(t) { } _(); } - }), He(B), He(() => T), { + }), He(F), He(() => T), { floating: h, reference: l, get strategy() { @@ -18782,10 +18782,10 @@ class Os { set detectOverflowOptions(e) { K(this.#l, e); } - #u = /* @__PURE__ */ ye(void 0); - #c = /* @__PURE__ */ ye(void 0); - #d = /* @__PURE__ */ ye(void 0); - #f = /* @__PURE__ */ ye(void 0); + #u = /* @__PURE__ */ me(void 0); + #c = /* @__PURE__ */ me(void 0); + #d = /* @__PURE__ */ me(void 0); + #f = /* @__PURE__ */ me(void 0); #g = /* @__PURE__ */ C(() => [ sv({ mainAxis: this.opts.sideOffset.current + c(this.#o), @@ -18857,7 +18857,7 @@ class Os { set cannotCenterArrow(e) { K(this.#m, e); } - #v = /* @__PURE__ */ ye(); + #v = /* @__PURE__ */ me(); get contentZIndex() { return c(this.#v); } @@ -19008,7 +19008,7 @@ function fv(t, e) { r(a), g(); } }, i = de(), s = J(i); - return Oe(s, () => n() ?? ze), O(t, i), ce(o); + return Ae(s, () => n() ?? ze), O(t, i), ce(o); } se(fv, { children: {}, tooltip: {} }, [], [], !0); class a5 { @@ -19049,21 +19049,21 @@ const l5 = [Vo, Tg, Pg], u5 = [Jr, Ng, Eg], c5 = [...l5, ...u5], d5 = ou({ }), Ci = new Er("Select.Root | Combobox.Root"), hv = new Er("Select.Content | Combobox.Content"); class gv { opts; - #e = /* @__PURE__ */ ye(!1); + #e = /* @__PURE__ */ me(!1); get touchedInput() { return c(this.#e); } set touchedInput(e) { K(this.#e, e, !0); } - #t = /* @__PURE__ */ ye(null); + #t = /* @__PURE__ */ me(null); get inputNode() { return c(this.#t); } set inputNode(e) { K(this.#t, e, !0); } - #n = /* @__PURE__ */ ye(null); + #n = /* @__PURE__ */ me(null); get contentNode() { return c(this.#n); } @@ -19071,28 +19071,28 @@ class gv { K(this.#n, e, !0); } contentPresence; - #r = /* @__PURE__ */ ye(null); + #r = /* @__PURE__ */ me(null); get viewportNode() { return c(this.#r); } set viewportNode(e) { K(this.#r, e, !0); } - #o = /* @__PURE__ */ ye(null); + #o = /* @__PURE__ */ me(null); get triggerNode() { return c(this.#o); } set triggerNode(e) { K(this.#o, e, !0); } - #i = /* @__PURE__ */ ye(""); + #i = /* @__PURE__ */ me(""); get valueId() { return c(this.#i); } set valueId(e) { K(this.#i, e, !0); } - #a = /* @__PURE__ */ ye(null); + #a = /* @__PURE__ */ me(null); get highlightedNode() { return c(this.#a); } @@ -19123,7 +19123,7 @@ class gv { set highlightedLabel(e) { K(this.#u, e); } - #c = /* @__PURE__ */ ye(!1); + #c = /* @__PURE__ */ me(!1); get contentIsPositioned() { return c(this.#c); } @@ -19135,7 +19135,7 @@ class gv { domContext = new xi(() => null); constructor(e) { this.opts = e, this.isCombobox = e.isCombobox, this.contentPresence = new c_({ - ref: ge(() => this.contentNode), + ref: pe(() => this.contentNode), open: this.opts.open, onComplete: () => { this.opts.onOpenChangeComplete.current(this.opts.open.current); @@ -19341,7 +19341,7 @@ class Cu { } onkeydown(e) { if (this.root.isUsingKeyboard = !0, (e.key === Jr || e.key === Vo) && e.preventDefault(), !this.root.opts.open.current) { - if (e.key === el || e.key === qi || e.key === Vo || e.key === Jr) + if (e.key === el || e.key === Yi || e.key === Vo || e.key === Jr) e.preventDefault(), this.root.handleOpen(); else if (!this.root.isMulti && this.root.dataTypeaheadEnabled) { this.#t.handleTypeaheadSearch(e.key); @@ -19366,7 +19366,7 @@ class Cu { if ((e.key === el || // if we're currently "typing ahead", we don't want to select the item // just yet as the item the user is trying to get to may have a space in it, // so we defer handling the close for this case until further down - e.key === qi && this.#e.search === "") && !e.isComposing && (e.preventDefault(), this.#o())) + e.key === Yi && this.#e.search === "") && !e.isComposing && (e.preventDefault(), this.#o())) return; if (e.key === Jr && e.altKey && this.root.handleClose(), c5.includes(e.key)) { e.preventDefault(); @@ -19376,7 +19376,7 @@ class Cu { this.root.setHighlightedNode(d); return; } - const n = e.ctrlKey || e.altKey || e.metaKey, r = e.key.length === 1, o = e.key === qi, i = this.root.getCandidateNodes(); + const n = e.ctrlKey || e.altKey || e.metaKey, r = e.key.length === 1, o = e.key === Yi, i = this.root.getCandidateNodes(); if (e.key !== Wc) { if (!n && (r || o)) { !this.#e.handleTypeaheadSearch(e.key, i) && o && (e.preventDefault(), this.#o()); @@ -19427,7 +19427,7 @@ class Su { opts; root; attachment; - #e = /* @__PURE__ */ ye(!1); + #e = /* @__PURE__ */ me(!1); get isPositioned() { return c(this.#e); } @@ -19530,8 +19530,8 @@ class ku { set isHighlighted(e) { K(this.#t, e); } - prevHighlighted = new Yx(() => this.isHighlighted); - #n = /* @__PURE__ */ ye(!1); + prevHighlighted = new qx(() => this.isHighlighted); + #n = /* @__PURE__ */ me(!1); get mounted() { return c(this.#n); } @@ -19651,7 +19651,7 @@ class Pu { content; root; attachment; - #e = /* @__PURE__ */ ye(0); + #e = /* @__PURE__ */ me(0); get prevScrollTop() { return c(this.#e); } @@ -19684,10 +19684,10 @@ class Pu { K(this.#t, e); } } -function ji(t, e) { +function Xi(t, e) { ue(e, !0); let n = v(e, "value", 15), r = v(e, "autocomplete", 7); - const o = Eu.create({ value: ge(() => n()) }); + const o = Eu.create({ value: pe(() => n()) }); var i = { get value() { return n(); @@ -19722,14 +19722,14 @@ function ji(t, e) { } return O(t, s), ce(i); } -se(ji, { value: {}, autocomplete: {} }, [], [], !0); +se(Xi, { value: {}, autocomplete: {} }, [], [], !0); function vv(t, e) { ue(e, !0); let n = v(e, "id", 7), r = v(e, "children", 7), o = v(e, "virtualEl", 7), i = v(e, "ref", 7), s = v(e, "tooltip", 7, !1); As.create( { - id: ge(() => n()), - virtualEl: ge(() => o()), + id: pe(() => n()), + virtualEl: pe(() => o()), ref: i() }, s() @@ -19766,7 +19766,7 @@ function vv(t, e) { s(d), g(); } }, u = de(), l = J(u); - return Oe(l, () => r() ?? ze), O(t, u), ce(a); + return Ae(l, () => r() ?? ze), O(t, u), ce(a); } se(vv, { id: {}, children: {}, virtualEl: {}, ref: {}, tooltip: {} }, [], [], !0); function pv(t, e) { @@ -19775,28 +19775,28 @@ function pv(t, e) { }), m = v(e, "sticky", 7, "partial"), y = v(e, "updatePositionStrategy", 7, "optimized"), w = v(e, "strategy", 7, "fixed"), b = v(e, "dir", 7, "ltr"), S = v(e, "style", 23, () => ({})), E = v(e, "wrapperId", 23, ks), x = v(e, "customAnchor", 7, null), _ = v(e, "enabled", 7), T = v(e, "tooltip", 7, !1); const I = Os.create( { - side: ge(() => r()), - sideOffset: ge(() => o()), - align: ge(() => i()), - alignOffset: ge(() => s()), - id: ge(() => a()), - arrowPadding: ge(() => u()), - avoidCollisions: ge(() => l()), - collisionBoundary: ge(() => d()), - collisionPadding: ge(() => f()), - hideWhenDetached: ge(() => h()), - onPlaced: ge(() => p()), - sticky: ge(() => m()), - updatePositionStrategy: ge(() => y()), - strategy: ge(() => w()), - dir: ge(() => b()), - style: ge(() => S()), - enabled: ge(() => _()), - wrapperId: ge(() => E()), - customAnchor: ge(() => x()) + side: pe(() => r()), + sideOffset: pe(() => o()), + align: pe(() => i()), + alignOffset: pe(() => s()), + id: pe(() => a()), + arrowPadding: pe(() => u()), + avoidCollisions: pe(() => l()), + collisionBoundary: pe(() => d()), + collisionPadding: pe(() => f()), + hideWhenDetached: pe(() => h()), + onPlaced: pe(() => p()), + sticky: pe(() => m()), + updatePositionStrategy: pe(() => y()), + strategy: pe(() => w()), + dir: pe(() => b()), + style: pe(() => S()), + enabled: pe(() => _()), + wrapperId: pe(() => E()), + customAnchor: pe(() => x()) }, T() - ), B = /* @__PURE__ */ C(() => Ln(I.wrapperProps, { style: { pointerEvents: "auto" } })); + ), F = /* @__PURE__ */ C(() => Ln(I.wrapperProps, { style: { pointerEvents: "auto" } })); var $ = { get content() { return n(); @@ -19926,7 +19926,7 @@ function pv(t, e) { T(k), g(); } }, H = de(), N = J(H); - return Oe(N, () => n() ?? ze, () => ({ props: I.props, wrapperProps: c(B) })), O(t, H), ce($); + return Ae(N, () => n() ?? ze, () => ({ props: I.props, wrapperProps: c(F) })), O(t, H), ce($); } se( pv, @@ -19977,7 +19977,7 @@ function mv(t, e) { r(a), g(); } }, i = de(), s = J(i); - return Oe(s, () => n() ?? ze, () => ({ props: {}, wrapperProps: {} })), O(t, i), ce(o); + return Ae(s, () => n() ?? ze, () => ({ props: {}, wrapperProps: {} })), O(t, i), ce(o); } se(mv, { content: {}, onPlaced: {} }, [], [], !0); function yv(t, e) { @@ -20041,10 +20041,10 @@ function yv(t, e) { return O(t, a), ce(s); } se(yv, { content: {}, isStatic: {}, onPlaced: {} }, [], [], !0); -var v5 = /* @__PURE__ */ ne(" ", 1); +var v5 = /* @__PURE__ */ re(" ", 1); function Nu(t, e) { ue(e, !0); - let n = v(e, "popper", 7), r = v(e, "onEscapeKeydown", 7), o = v(e, "escapeKeydownBehavior", 7), i = v(e, "preventOverflowTextSelection", 7), s = v(e, "id", 7), a = v(e, "onPointerDown", 7), u = v(e, "onPointerUp", 7), l = v(e, "side", 7), d = v(e, "sideOffset", 7), f = v(e, "align", 7), h = v(e, "alignOffset", 7), p = v(e, "arrowPadding", 7), m = v(e, "avoidCollisions", 7), y = v(e, "collisionBoundary", 7), w = v(e, "collisionPadding", 7), b = v(e, "sticky", 7), S = v(e, "hideWhenDetached", 7), E = v(e, "updatePositionStrategy", 7), x = v(e, "strategy", 7), _ = v(e, "dir", 7), T = v(e, "preventScroll", 7), I = v(e, "wrapperId", 7), B = v(e, "style", 7), $ = v(e, "onPlaced", 7), H = v(e, "onInteractOutside", 7), N = v(e, "onCloseAutoFocus", 7), k = v(e, "onOpenAutoFocus", 7), D = v(e, "onFocusOutside", 7), P = v(e, "interactOutsideBehavior", 7, "close"), A = v(e, "loop", 7), R = v(e, "trapFocus", 7, !0), M = v(e, "isValidEvent", 7, () => !1), Y = v(e, "customAnchor", 7, null), U = v(e, "isStatic", 7, !1), V = v(e, "enabled", 7), j = v(e, "ref", 7), q = v(e, "tooltip", 7, !1), F = v(e, "contentPointerEvents", 7, "auto"), Q = /* @__PURE__ */ Le(e, [ + let n = v(e, "popper", 7), r = v(e, "onEscapeKeydown", 7), o = v(e, "escapeKeydownBehavior", 7), i = v(e, "preventOverflowTextSelection", 7), s = v(e, "id", 7), a = v(e, "onPointerDown", 7), u = v(e, "onPointerUp", 7), l = v(e, "side", 7), d = v(e, "sideOffset", 7), f = v(e, "align", 7), h = v(e, "alignOffset", 7), p = v(e, "arrowPadding", 7), m = v(e, "avoidCollisions", 7), y = v(e, "collisionBoundary", 7), w = v(e, "collisionPadding", 7), b = v(e, "sticky", 7), S = v(e, "hideWhenDetached", 7), E = v(e, "updatePositionStrategy", 7), x = v(e, "strategy", 7), _ = v(e, "dir", 7), T = v(e, "preventScroll", 7), I = v(e, "wrapperId", 7), F = v(e, "style", 7), $ = v(e, "onPlaced", 7), H = v(e, "onInteractOutside", 7), N = v(e, "onCloseAutoFocus", 7), k = v(e, "onOpenAutoFocus", 7), D = v(e, "onFocusOutside", 7), P = v(e, "interactOutsideBehavior", 7, "close"), A = v(e, "loop", 7), R = v(e, "trapFocus", 7, !0), M = v(e, "isValidEvent", 7, () => !1), Y = v(e, "customAnchor", 7, null), G = v(e, "isStatic", 7, !1), z = v(e, "enabled", 7), Q = v(e, "ref", 7), j = v(e, "tooltip", 7, !1), B = v(e, "contentPointerEvents", 7, "auto"), te = /* @__PURE__ */ Le(e, [ "$$slots", "$$events", "$$legacy", @@ -20088,8 +20088,8 @@ function Nu(t, e) { "tooltip", "contentPointerEvents" ]); - const X = /* @__PURE__ */ C(() => T() ?? !0), re = /* @__PURE__ */ C(() => x() ?? (c(X) ? "fixed" : "absolute")); - var ee = { + const q = /* @__PURE__ */ C(() => T() ?? !0), ee = /* @__PURE__ */ C(() => x() ?? (c(q) ? "fixed" : "absolute")); + var X = { get popper() { return n(); }, @@ -20223,10 +20223,10 @@ function Nu(t, e) { I(L), g(); }, get style() { - return B(); + return F(); }, set style(L) { - B(L), g(); + F(L), g(); }, get onPlaced() { return $(); @@ -20289,39 +20289,39 @@ function Nu(t, e) { Y(L), g(); }, get isStatic() { - return U(); + return G(); }, set isStatic(L = !1) { - U(L), g(); + G(L), g(); }, get enabled() { - return V(); + return z(); }, set enabled(L) { - V(L), g(); + z(L), g(); }, get ref() { - return j(); + return Q(); }, set ref(L) { - j(L), g(); + Q(L), g(); }, get tooltip() { - return q(); + return j(); }, set tooltip(L = !1) { - q(L), g(); + j(L), g(); }, get contentPointerEvents() { - return F(); + return B(); }, set contentPointerEvents(L = "auto") { - F(L), g(); + B(L), g(); } }; return yv(t, { get isStatic() { - return U(); + return G(); }, get id() { return s(); @@ -20360,7 +20360,7 @@ function Nu(t, e) { return E(); }, get strategy() { - return c(re); + return c(ee); }, get dir() { return _(); @@ -20369,7 +20369,7 @@ function Nu(t, e) { return I(); }, get style() { - return B(); + return F(); }, get onPlaced() { return $(); @@ -20378,47 +20378,47 @@ function Nu(t, e) { return Y(); }, get enabled() { - return V(); + return z(); }, get tooltip() { - return q(); + return j(); }, - content: (te, ve) => { - let ae = () => ve?.().props, le = () => ve?.().wrapperProps; - var oe = v5(), fe = J(oe); + content: (ne, fe) => { + let le = () => fe?.().props, ae = () => fe?.().wrapperProps; + var oe = v5(), he = J(oe); { - var we = (me) => { - il(me, { + var we = (ye) => { + il(ye, { get preventScroll() { - return c(X); + return c(q); } }); - }, xe = (me) => { - var Ee = de(), G = J(Ee); + }, _e = (ye) => { + var Ne = de(), U = J(Ne); { - var Ue = (be) => { + var Ye = (be) => { il(be, { get preventScroll() { - return c(X); + return c(q); } }); }; ie( - G, + U, (be) => { - e.forceMount || be(Ue); + e.forceMount || be(Ye); }, !0 ); } - O(me, Ee); + O(ye, Ne); }; - ie(fe, (me) => { - e.forceMount && V() ? me(we) : me(xe, !1); + ie(he, (ye) => { + e.forceMount && z() ? ye(we) : ye(_e, !1); }); } - var pe = z(fe, 2); - Wg(pe, { + var ve = V(he, 2); + Wg(ve, { get onOpenAutoFocus() { return k(); }, @@ -20429,7 +20429,7 @@ function Nu(t, e) { return A(); }, get enabled() { - return V(); + return z(); }, get trapFocus() { return R(); @@ -20438,11 +20438,11 @@ function Nu(t, e) { return e.forceMount; }, get ref() { - return j(); + return Q(); }, - focusScope: (Ee, G) => { - let Ue = () => G?.().props; - Kg(Ee, { + focusScope: (Ne, U) => { + let Ye = () => U?.().props; + Kg(Ne, { get onEscapeKeydown() { return r(); }, @@ -20450,12 +20450,12 @@ function Nu(t, e) { return o(); }, get enabled() { - return V(); + return z(); }, get ref() { - return j(); + return Q(); }, - children: (be, De) => { + children: (be, Te) => { $g(be, { get id() { return s(); @@ -20473,13 +20473,13 @@ function Nu(t, e) { return M(); }, get enabled() { - return V(); + return z(); }, get ref() { - return j(); + return Q(); }, - children: (Xe, je) => { - let Ke = () => je?.().props; + children: (Xe, Ue) => { + let We = () => Ue?.().props; Zg(Xe, { get id() { return s(); @@ -20494,21 +20494,21 @@ function Nu(t, e) { return u(); }, get enabled() { - return V(); + return z(); }, get ref() { - return j(); + return Q(); }, children: (rt, Tt) => { - var he = de(), Ae = J(he); + var ge = de(), De = J(ge); { let et = /* @__PURE__ */ C(() => ({ - props: Ln(Q, ae(), Ke(), Ue(), { style: { pointerEvents: F() } }), - wrapperProps: le() + props: Ln(te, le(), We(), Ye(), { style: { pointerEvents: B() } }), + wrapperProps: ae() })); - Oe(Ae, () => n() ?? ze, () => c(et)); + Ae(De, () => n() ?? ze, () => c(et)); } - O(rt, he); + O(rt, ge); }, $$slots: { default: !0 } }); @@ -20520,10 +20520,10 @@ function Nu(t, e) { }); }, $$slots: { focusScope: !0 } - }), O(te, oe); + }), O(ne, oe); }, $$slots: { content: !0 } - }), ce(ee); + }), ce(X); } se( Nu, @@ -20573,7 +20573,7 @@ se( ); function wv(t, e) { ue(e, !0); - let n = v(e, "popper", 7), r = v(e, "open", 7), o = v(e, "onEscapeKeydown", 7), i = v(e, "escapeKeydownBehavior", 7), s = v(e, "preventOverflowTextSelection", 7), a = v(e, "id", 7), u = v(e, "onPointerDown", 7), l = v(e, "onPointerUp", 7), d = v(e, "side", 7), f = v(e, "sideOffset", 7), h = v(e, "align", 7), p = v(e, "alignOffset", 7), m = v(e, "arrowPadding", 7), y = v(e, "avoidCollisions", 7), w = v(e, "collisionBoundary", 7), b = v(e, "collisionPadding", 7), S = v(e, "sticky", 7), E = v(e, "hideWhenDetached", 7), x = v(e, "updatePositionStrategy", 7), _ = v(e, "strategy", 7), T = v(e, "dir", 7), I = v(e, "preventScroll", 7), B = v(e, "wrapperId", 7), $ = v(e, "style", 7), H = v(e, "onPlaced", 7), N = v(e, "onInteractOutside", 7), k = v(e, "onCloseAutoFocus", 7), D = v(e, "onOpenAutoFocus", 7), P = v(e, "onFocusOutside", 7), A = v(e, "interactOutsideBehavior", 7, "close"), R = v(e, "loop", 7), M = v(e, "trapFocus", 7, !0), Y = v(e, "isValidEvent", 7, () => !1), U = v(e, "customAnchor", 7, null), V = v(e, "isStatic", 7, !1), j = v(e, "ref", 7), q = v(e, "shouldRender", 7), F = /* @__PURE__ */ Le(e, [ + let n = v(e, "popper", 7), r = v(e, "open", 7), o = v(e, "onEscapeKeydown", 7), i = v(e, "escapeKeydownBehavior", 7), s = v(e, "preventOverflowTextSelection", 7), a = v(e, "id", 7), u = v(e, "onPointerDown", 7), l = v(e, "onPointerUp", 7), d = v(e, "side", 7), f = v(e, "sideOffset", 7), h = v(e, "align", 7), p = v(e, "alignOffset", 7), m = v(e, "arrowPadding", 7), y = v(e, "avoidCollisions", 7), w = v(e, "collisionBoundary", 7), b = v(e, "collisionPadding", 7), S = v(e, "sticky", 7), E = v(e, "hideWhenDetached", 7), x = v(e, "updatePositionStrategy", 7), _ = v(e, "strategy", 7), T = v(e, "dir", 7), I = v(e, "preventScroll", 7), F = v(e, "wrapperId", 7), $ = v(e, "style", 7), H = v(e, "onPlaced", 7), N = v(e, "onInteractOutside", 7), k = v(e, "onCloseAutoFocus", 7), D = v(e, "onOpenAutoFocus", 7), P = v(e, "onFocusOutside", 7), A = v(e, "interactOutsideBehavior", 7, "close"), R = v(e, "loop", 7), M = v(e, "trapFocus", 7, !0), Y = v(e, "isValidEvent", 7, () => !1), G = v(e, "customAnchor", 7, null), z = v(e, "isStatic", 7, !1), Q = v(e, "ref", 7), j = v(e, "shouldRender", 7), B = /* @__PURE__ */ Le(e, [ "$$slots", "$$events", "$$legacy", @@ -20616,7 +20616,7 @@ function wv(t, e) { "ref", "shouldRender" ]); - var Q = { + var te = { get popper() { return n(); }, @@ -20750,10 +20750,10 @@ function wv(t, e) { I(L), g(); }, get wrapperId() { - return B(); + return F(); }, set wrapperId(L) { - B(L), g(); + F(L), g(); }, get style() { return $(); @@ -20816,32 +20816,32 @@ function wv(t, e) { Y(L), g(); }, get customAnchor() { - return U(); + return G(); }, set customAnchor(L = null) { - U(L), g(); + G(L), g(); }, get isStatic() { - return V(); + return z(); }, set isStatic(L = !1) { - V(L), g(); + z(L), g(); }, get ref() { - return j(); + return Q(); }, set ref(L) { - j(L), g(); + Q(L), g(); }, get shouldRender() { - return q(); + return j(); }, set shouldRender(L) { - q(L), g(); + j(L), g(); } - }, X = de(), re = J(X); + }, q = de(), ee = J(q); { - var ee = (L) => { + var X = (L) => { Nu(L, Ve( { get popper() { @@ -20908,7 +20908,7 @@ function wv(t, e) { return I(); }, get wrapperId() { - return B(); + return F(); }, get style() { return $(); @@ -20917,10 +20917,10 @@ function wv(t, e) { return H(); }, get customAnchor() { - return U(); + return G(); }, get isStatic() { - return V(); + return z(); }, get enabled() { return r(); @@ -20951,17 +20951,17 @@ function wv(t, e) { }, forceMount: !1, get ref() { - return j(); + return Q(); } }, - () => F + () => B )); }; - ie(re, (L) => { - q() && L(ee); + ie(ee, (L) => { + j() && L(X); }); } - return O(t, X), ce(Q); + return O(t, q), ce(te); } se( wv, @@ -21010,7 +21010,7 @@ se( ); function bv(t, e) { ue(e, !0); - let n = v(e, "popper", 7), r = v(e, "onEscapeKeydown", 7), o = v(e, "escapeKeydownBehavior", 7), i = v(e, "preventOverflowTextSelection", 7), s = v(e, "id", 7), a = v(e, "onPointerDown", 7), u = v(e, "onPointerUp", 7), l = v(e, "side", 7), d = v(e, "sideOffset", 7), f = v(e, "align", 7), h = v(e, "alignOffset", 7), p = v(e, "arrowPadding", 7), m = v(e, "avoidCollisions", 7), y = v(e, "collisionBoundary", 7), w = v(e, "collisionPadding", 7), b = v(e, "sticky", 7), S = v(e, "hideWhenDetached", 7), E = v(e, "updatePositionStrategy", 7), x = v(e, "strategy", 7), _ = v(e, "dir", 7), T = v(e, "preventScroll", 7), I = v(e, "wrapperId", 7), B = v(e, "style", 7), $ = v(e, "onPlaced", 7), H = v(e, "onInteractOutside", 7), N = v(e, "onCloseAutoFocus", 7), k = v(e, "onOpenAutoFocus", 7), D = v(e, "onFocusOutside", 7), P = v(e, "interactOutsideBehavior", 7, "close"), A = v(e, "loop", 7), R = v(e, "trapFocus", 7, !0), M = v(e, "isValidEvent", 7, () => !1), Y = v(e, "customAnchor", 7, null), U = v(e, "isStatic", 7, !1), V = v(e, "enabled", 7), j = /* @__PURE__ */ Le(e, [ + let n = v(e, "popper", 7), r = v(e, "onEscapeKeydown", 7), o = v(e, "escapeKeydownBehavior", 7), i = v(e, "preventOverflowTextSelection", 7), s = v(e, "id", 7), a = v(e, "onPointerDown", 7), u = v(e, "onPointerUp", 7), l = v(e, "side", 7), d = v(e, "sideOffset", 7), f = v(e, "align", 7), h = v(e, "alignOffset", 7), p = v(e, "arrowPadding", 7), m = v(e, "avoidCollisions", 7), y = v(e, "collisionBoundary", 7), w = v(e, "collisionPadding", 7), b = v(e, "sticky", 7), S = v(e, "hideWhenDetached", 7), E = v(e, "updatePositionStrategy", 7), x = v(e, "strategy", 7), _ = v(e, "dir", 7), T = v(e, "preventScroll", 7), I = v(e, "wrapperId", 7), F = v(e, "style", 7), $ = v(e, "onPlaced", 7), H = v(e, "onInteractOutside", 7), N = v(e, "onCloseAutoFocus", 7), k = v(e, "onOpenAutoFocus", 7), D = v(e, "onFocusOutside", 7), P = v(e, "interactOutsideBehavior", 7, "close"), A = v(e, "loop", 7), R = v(e, "trapFocus", 7, !0), M = v(e, "isValidEvent", 7, () => !1), Y = v(e, "customAnchor", 7, null), G = v(e, "isStatic", 7, !1), z = v(e, "enabled", 7), Q = /* @__PURE__ */ Le(e, [ "$$slots", "$$events", "$$legacy", @@ -21051,216 +21051,216 @@ function bv(t, e) { "isStatic", "enabled" ]); - var q = { + var j = { get popper() { return n(); }, - set popper(F) { - n(F), g(); + set popper(B) { + n(B), g(); }, get onEscapeKeydown() { return r(); }, - set onEscapeKeydown(F) { - r(F), g(); + set onEscapeKeydown(B) { + r(B), g(); }, get escapeKeydownBehavior() { return o(); }, - set escapeKeydownBehavior(F) { - o(F), g(); + set escapeKeydownBehavior(B) { + o(B), g(); }, get preventOverflowTextSelection() { return i(); }, - set preventOverflowTextSelection(F) { - i(F), g(); + set preventOverflowTextSelection(B) { + i(B), g(); }, get id() { return s(); }, - set id(F) { - s(F), g(); + set id(B) { + s(B), g(); }, get onPointerDown() { return a(); }, - set onPointerDown(F) { - a(F), g(); + set onPointerDown(B) { + a(B), g(); }, get onPointerUp() { return u(); }, - set onPointerUp(F) { - u(F), g(); + set onPointerUp(B) { + u(B), g(); }, get side() { return l(); }, - set side(F) { - l(F), g(); + set side(B) { + l(B), g(); }, get sideOffset() { return d(); }, - set sideOffset(F) { - d(F), g(); + set sideOffset(B) { + d(B), g(); }, get align() { return f(); }, - set align(F) { - f(F), g(); + set align(B) { + f(B), g(); }, get alignOffset() { return h(); }, - set alignOffset(F) { - h(F), g(); + set alignOffset(B) { + h(B), g(); }, get arrowPadding() { return p(); }, - set arrowPadding(F) { - p(F), g(); + set arrowPadding(B) { + p(B), g(); }, get avoidCollisions() { return m(); }, - set avoidCollisions(F) { - m(F), g(); + set avoidCollisions(B) { + m(B), g(); }, get collisionBoundary() { return y(); }, - set collisionBoundary(F) { - y(F), g(); + set collisionBoundary(B) { + y(B), g(); }, get collisionPadding() { return w(); }, - set collisionPadding(F) { - w(F), g(); + set collisionPadding(B) { + w(B), g(); }, get sticky() { return b(); }, - set sticky(F) { - b(F), g(); + set sticky(B) { + b(B), g(); }, get hideWhenDetached() { return S(); }, - set hideWhenDetached(F) { - S(F), g(); + set hideWhenDetached(B) { + S(B), g(); }, get updatePositionStrategy() { return E(); }, - set updatePositionStrategy(F) { - E(F), g(); + set updatePositionStrategy(B) { + E(B), g(); }, get strategy() { return x(); }, - set strategy(F) { - x(F), g(); + set strategy(B) { + x(B), g(); }, get dir() { return _(); }, - set dir(F) { - _(F), g(); + set dir(B) { + _(B), g(); }, get preventScroll() { return T(); }, - set preventScroll(F) { - T(F), g(); + set preventScroll(B) { + T(B), g(); }, get wrapperId() { return I(); }, - set wrapperId(F) { - I(F), g(); + set wrapperId(B) { + I(B), g(); }, get style() { - return B(); + return F(); }, - set style(F) { - B(F), g(); + set style(B) { + F(B), g(); }, get onPlaced() { return $(); }, - set onPlaced(F) { - $(F), g(); + set onPlaced(B) { + $(B), g(); }, get onInteractOutside() { return H(); }, - set onInteractOutside(F) { - H(F), g(); + set onInteractOutside(B) { + H(B), g(); }, get onCloseAutoFocus() { return N(); }, - set onCloseAutoFocus(F) { - N(F), g(); + set onCloseAutoFocus(B) { + N(B), g(); }, get onOpenAutoFocus() { return k(); }, - set onOpenAutoFocus(F) { - k(F), g(); + set onOpenAutoFocus(B) { + k(B), g(); }, get onFocusOutside() { return D(); }, - set onFocusOutside(F) { - D(F), g(); + set onFocusOutside(B) { + D(B), g(); }, get interactOutsideBehavior() { return P(); }, - set interactOutsideBehavior(F = "close") { - P(F), g(); + set interactOutsideBehavior(B = "close") { + P(B), g(); }, get loop() { return A(); }, - set loop(F) { - A(F), g(); + set loop(B) { + A(B), g(); }, get trapFocus() { return R(); }, - set trapFocus(F = !0) { - R(F), g(); + set trapFocus(B = !0) { + R(B), g(); }, get isValidEvent() { return M(); }, - set isValidEvent(F = () => !1) { - M(F), g(); + set isValidEvent(B = () => !1) { + M(B), g(); }, get customAnchor() { return Y(); }, - set customAnchor(F = null) { - Y(F), g(); + set customAnchor(B = null) { + Y(B), g(); }, get isStatic() { - return U(); + return G(); }, - set isStatic(F = !1) { - U(F), g(); + set isStatic(B = !1) { + G(B), g(); }, get enabled() { - return V(); + return z(); }, - set enabled(F) { - V(F), g(); + set enabled(B) { + z(B), g(); } }; return Nu(t, Ve( @@ -21332,7 +21332,7 @@ function bv(t, e) { return I(); }, get style() { - return B(); + return F(); }, get onPlaced() { return $(); @@ -21341,10 +21341,10 @@ function bv(t, e) { return Y(); }, get isStatic() { - return U(); + return G(); }, get enabled() { - return V(); + return z(); }, get onInteractOutside() { return H(); @@ -21371,9 +21371,9 @@ function bv(t, e) { return D(); } }, - () => j, + () => Q, { forceMount: !0 } - )), ce(q); + )), ce(j); } se( bv, @@ -21418,7 +21418,7 @@ se( [], !0 ); -var p5 = /* @__PURE__ */ ne("
"), m5 = /* @__PURE__ */ ne("
"); +var p5 = /* @__PURE__ */ re("
"), m5 = /* @__PURE__ */ re("
"); function ul(t, e) { const n = ai(); ue(e, !0); @@ -21439,10 +21439,10 @@ function ul(t, e) { "style" ]); const m = Su.create({ - id: ge(() => r()), - ref: ge(() => o(), (_) => o(_)), - onInteractOutside: ge(() => a()), - onEscapeKeydown: ge(() => u()) + id: pe(() => r()), + ref: pe(() => o(), (_) => o(_)), + onInteractOutside: pe(() => a()), + onEscapeKeydown: pe(() => u()) }), y = /* @__PURE__ */ C(() => Ln(p, m.props)); var w = { get id() { @@ -21528,20 +21528,20 @@ function ul(t, e) { get shouldRender() { return m.shouldRender; }, - popper: (I, B) => { - let $ = () => B?.().props, H = () => B?.().wrapperProps; + popper: (I, F) => { + let $ = () => F?.().props, H = () => F?.().wrapperProps; const N = /* @__PURE__ */ C(() => Ln($(), { style: m.props.style }, { style: h() })); var k = de(), D = J(k); { var P = (R) => { var M = de(), Y = J(M); { - let U = /* @__PURE__ */ C(() => ({ + let G = /* @__PURE__ */ C(() => ({ props: c(N), wrapperProps: H(), ...m.snippetProps })); - Oe(Y, d, () => c(U)); + Ae(Y, d, () => c(G)); } O(R, M); }, A = (R) => { @@ -21549,8 +21549,8 @@ function ul(t, e) { Ge(M, () => ({ ...H() })); var Y = Z(M); Ge(Y, () => ({ ...c(N) })); - var U = Z(Y); - Oe(U, () => l() ?? ze), W(Y), W(M), O(R, M); + var G = Z(Y); + Ae(G, () => l() ?? ze), W(Y), W(M), O(R, M); }; ie(D, (R) => { d() ? R(P) : R(A, !1); @@ -21563,7 +21563,7 @@ function ul(t, e) { }, x = (_) => { var T = de(), I = J(T); { - var B = ($) => { + var F = ($) => { wv($, Ve(() => c(y), () => m.popperProps, { get ref() { return m.opts.ref; @@ -21589,27 +21589,27 @@ function ul(t, e) { const A = /* @__PURE__ */ C(() => Ln(D(), { style: m.props.style }, { style: h() })); var R = de(), M = J(R); { - var Y = (V) => { - var j = de(), q = J(j); + var Y = (z) => { + var Q = de(), j = J(Q); { - let F = /* @__PURE__ */ C(() => ({ + let B = /* @__PURE__ */ C(() => ({ props: c(A), wrapperProps: P(), ...m.snippetProps })); - Oe(q, d, () => c(F)); + Ae(j, d, () => c(B)); } - O(V, j); - }, U = (V) => { - var j = m5(); - Ge(j, () => ({ ...P() })); - var q = Z(j); - Ge(q, () => ({ ...c(A) })); - var F = Z(q); - Oe(F, () => l() ?? ze), W(q), W(j), O(V, j); + O(z, Q); + }, G = (z) => { + var Q = m5(); + Ge(Q, () => ({ ...P() })); + var j = Z(Q); + Ge(j, () => ({ ...c(A) })); + var B = Z(j); + Ae(B, () => l() ?? ze), W(j), W(Q), O(z, Q); }; - ie(M, (V) => { - d() ? V(Y) : V(U, !1); + ie(M, (z) => { + d() ? z(Y) : z(G, !1); }); } O(N, R); @@ -21620,7 +21620,7 @@ function ul(t, e) { ie( I, ($) => { - i() || $(B); + i() || $(F); }, !0 ); @@ -21654,7 +21654,7 @@ se( function xv(t, e) { ue(e, !0); let n = v(e, "mounted", 15, !1), r = v(e, "onMountedChange", 7, Re); - qx(() => (n(!0), r()(!0), () => { + Yx(() => (n(!0), r()(!0), () => { n(!1), r()(!1); })); var o = { @@ -21674,7 +21674,7 @@ function xv(t, e) { return ce(o); } se(xv, { mounted: {}, onMountedChange: {} }, [], [], !0); -var y5 = /* @__PURE__ */ ne("
"), w5 = /* @__PURE__ */ ne(" ", 1); +var y5 = /* @__PURE__ */ re("
"), w5 = /* @__PURE__ */ re(" ", 1); function cl(t, e) { const n = ai(); ue(e, !0); @@ -21694,13 +21694,13 @@ function cl(t, e) { "onUnhighlight" ]); const p = ku.create({ - id: ge(() => r()), - ref: ge(() => o(), (_) => o(_)), - value: ge(() => i()), - disabled: ge(() => a()), - label: ge(() => s()), - onHighlight: ge(() => d()), - onUnhighlight: ge(() => f()) + id: pe(() => r()), + ref: pe(() => o(), (_) => o(_)), + value: pe(() => i()), + disabled: pe(() => a()), + label: pe(() => s()), + onHighlight: pe(() => d()), + onUnhighlight: pe(() => f()) }), m = /* @__PURE__ */ C(() => Ln(h, p.props)); var y = { get id() { @@ -21762,21 +21762,21 @@ function cl(t, e) { var S = (_) => { var T = de(), I = J(T); { - let B = /* @__PURE__ */ C(() => ({ props: c(m), ...p.snippetProps })); - Oe(I, l, () => c(B)); + let F = /* @__PURE__ */ C(() => ({ props: c(m), ...p.snippetProps })); + Ae(I, l, () => c(F)); } O(_, T); }, E = (_) => { var T = y5(); Ge(T, () => ({ ...c(m) })); var I = Z(T); - Oe(I, () => u() ?? ze, () => p.snippetProps), W(T), O(_, T); + Ae(I, () => u() ?? ze, () => p.snippetProps), W(T), O(_, T); }; ie(b, (_) => { l() ? _(S) : _(E, !1); }); } - var x = z(b, 2); + var x = V(b, 2); return xv(x, { get mounted() { return p.mounted; @@ -21803,9 +21803,9 @@ se( [], !0 ); -var b5 = /* @__PURE__ */ ne("
"); +var b5 = /* @__PURE__ */ re("
"); const x5 = { - hash: "svelte-z03me6", + hash: "svelte-1a3sac3", code: ` /* Hide scrollbars cross browser and enable momentum scroll for touch devices */[data-select-viewport] {scrollbar-width:none !important;-ms-overflow-style:none !important;-webkit-overflow-scrolling:touch !important;}[data-combobox-viewport] {scrollbar-width:none !important;-ms-overflow-style:none !important;-webkit-overflow-scrolling:touch !important;}[data-combobox-viewport]::-webkit-scrollbar {display:none !important;}[data-select-viewport]::-webkit-scrollbar {display:none !important;}` }; @@ -21823,8 +21823,8 @@ function dl(t, e) { "child" ]); const u = Pu.create({ - id: ge(() => r()), - ref: ge(() => o(), (y) => o(y)) + id: pe(() => r()), + ref: pe(() => o(), (y) => o(y)) }), l = /* @__PURE__ */ C(() => Ln(a, u.props)); var d = { get id() { @@ -21855,12 +21855,12 @@ function dl(t, e) { { var p = (y) => { var w = de(), b = J(w); - Oe(b, s, () => ({ props: c(l) })), O(y, w); + Ae(b, s, () => ({ props: c(l) })), O(y, w); }, m = (y) => { var w = b5(); Ge(w, () => ({ ...c(l) })); var b = Z(w); - Oe(b, () => i() ?? ze), W(w), O(y, w); + Ae(b, () => i() ?? ze), W(w), O(y, w); }; ie(h, (y) => { s() ? y(p) : y(m, !1); @@ -21869,7 +21869,7 @@ function dl(t, e) { return O(t, f), ce(d); } se(dl, { id: {}, ref: {}, children: {}, child: {} }, [], [], !0); -var _5 = /* @__PURE__ */ ne(" ", 1); +var _5 = /* @__PURE__ */ re(" ", 1); function fl(t, e) { ue(e, !0); let n = v(e, "value", 15), r = v(e, "onValueChange", 7, Re), o = v(e, "name", 7, ""), i = v(e, "disabled", 7, !1), s = v(e, "type", 7), a = v(e, "open", 15, !1), u = v(e, "onOpenChange", 7, Re), l = v(e, "onOpenChangeComplete", 7, Re), d = v(e, "loop", 7, !1), f = v(e, "scrollAlignment", 7, "nearest"), h = v(e, "required", 7, !1), p = v(e, "items", 23, () => []), m = v(e, "allowDeselect", 7, !1), y = v(e, "autocomplete", 7), w = v(e, "children", 7); @@ -21879,25 +21879,25 @@ function fl(t, e) { b(), yt.pre(() => n(), () => { b(); }); - let S = /* @__PURE__ */ ye(""); + let S = /* @__PURE__ */ me(""); const E = g5.create({ type: s(), - value: ge(() => n(), (H) => { + value: pe(() => n(), (H) => { n(H), r()(H); }), - disabled: ge(() => i()), - required: ge(() => h()), - open: ge(() => a(), (H) => { + disabled: pe(() => i()), + required: pe(() => h()), + open: pe(() => a(), (H) => { a(H), u()(H); }), - loop: ge(() => d()), - scrollAlignment: ge(() => f()), - name: ge(() => o()), + loop: pe(() => d()), + scrollAlignment: pe(() => f()), + name: pe(() => o()), isCombobox: !1, - items: ge(() => p()), - allowDeselect: ge(() => m()), - inputValue: ge(() => c(S), (H) => K(S, H, !0)), - onOpenChangeComplete: ge(() => l()) + items: pe(() => p()), + allowDeselect: pe(() => m()), + inputValue: pe(() => c(S), (H) => K(S, H, !0)), + onOpenChangeComplete: pe(() => l()) }); var x = { get value() { @@ -21994,27 +21994,27 @@ function fl(t, e) { fv(T, { children: (H, N) => { var k = de(), D = J(k); - Oe(D, () => w() ?? ze), O(H, k); + Ae(D, () => w() ?? ze), O(H, k); }, $$slots: { default: !0 } }); - var I = z(T, 2); + var I = V(T, 2); { - var B = (H) => { + var F = (H) => { var N = de(), k = J(N); { var D = (A) => { - ji(A, { + Xi(A, { get autocomplete() { return y(); } }); }, P = (A) => { var R = de(), M = J(R); - Ct(M, 16, () => E.opts.value.current, (Y) => Y, (Y, U) => { - ji(Y, { + Ct(M, 16, () => E.opts.value.current, (Y) => Y, (Y, G) => { + Xi(Y, { get value() { - return U; + return G; }, get autocomplete() { return y(); @@ -22028,7 +22028,7 @@ function fl(t, e) { } O(H, N); }, $ = (H) => { - ji(H, { + Xi(H, { get autocomplete() { return y(); }, @@ -22041,7 +22041,7 @@ function fl(t, e) { }); }; ie(I, (H) => { - Array.isArray(E.opts.value.current) ? H(B) : H($, !1); + Array.isArray(E.opts.value.current) ? H(F) : H($, !1); }); } return O(t, _), ce(x); @@ -22069,7 +22069,7 @@ se( [], !0 ); -var C5 = /* @__PURE__ */ ne(""); +var C5 = /* @__PURE__ */ re(""); function hl(t, e) { const n = ai(); ue(e, !0); @@ -22085,8 +22085,8 @@ function hl(t, e) { "type" ]); const l = Cu.create({ - id: ge(() => r()), - ref: ge(() => o(), (m) => o(m)) + id: pe(() => r()), + ref: pe(() => o(), (m) => o(m)) }), d = /* @__PURE__ */ C(() => Ln(u, l.props, { type: a() })); var f = { get id() { @@ -22132,13 +22132,13 @@ function hl(t, e) { var S = de(), E = J(S); { var x = (T) => { - var I = de(), B = J(I); - Oe(B, i, () => ({ props: c(d) })), O(T, I); + var I = de(), F = J(I); + Ae(F, i, () => ({ props: c(d) })), O(T, I); }, _ = (T) => { var I = C5(); Ge(I, () => ({ ...c(d) })); - var B = Z(I); - Oe(B, () => s() ?? ze), W(I), O(T, I); + var F = Z(I); + Ae(F, () => s() ?? ze), W(I), O(T, I); }; ie(E, (T) => { i() ? T(x) : T(_, !1); @@ -22169,7 +22169,7 @@ const k5 = (t) => { return !1; }; const E5 = Symbol("lucide-context"), P5 = () => yn(E5); -var N5 = /* @__PURE__ */ _e(""); +var N5 = /* @__PURE__ */ xe(""); function ra(t, e) { ue(e, !0); const n = P5() ?? {}, r = v(e, "name", 7), o = v(e, "color", 23, () => n.color ?? "currentColor"), i = v(e, "size", 23, () => n.size ?? 24), s = v(e, "strokeWidth", 23, () => n.strokeWidth ?? 2), a = v(e, "absoluteStrokeWidth", 23, () => n.absoluteStrokeWidth ?? !1), u = v(e, "iconNode", 23, () => []), l = v(e, "children", 7), d = /* @__PURE__ */ Le(e, [ @@ -22255,12 +22255,12 @@ function ra(t, e) { var S = /* @__PURE__ */ C(() => yo(c(b), 2)); let E = () => c(S)[0], x = () => c(S)[1]; var _ = de(), T = J(_); - ff(T, E, !0, (I, B) => { + ff(T, E, !0, (I, F) => { Ge(I, () => ({ ...x() })); }), O(w, _); }); - var y = z(m); - return Oe(y, () => l() ?? ze), W(p), O(t, p), ce(h); + var y = V(m); + return Ae(y, () => l() ?? ze), W(p), O(t, p), ce(h); } se( ra, @@ -22287,7 +22287,7 @@ function _v(t, e) { }, children: (o, i) => { var s = de(), a = J(s); - Oe(a, () => e.children ?? ze), O(o, s); + Ae(a, () => e.children ?? ze), O(o, s); }, $$slots: { default: !0 } })), ce(); @@ -22303,13 +22303,13 @@ function Cv(t, e) { }, children: (o, i) => { var s = de(), a = J(s); - Oe(a, () => e.children ?? ze), O(o, s); + Ae(a, () => e.children ?? ze), O(o, s); }, $$slots: { default: !0 } })), ce(); } se(Cv, {}, [], [], !0); -var T5 = /* @__PURE__ */ ne('
'); +var T5 = /* @__PURE__ */ re('
'); function Sv(t, e) { ue(e, !0); let n = v(e, "ref", 15, null), r = v(e, "checked", 15, !1), o = v(e, "indeterminate", 15, !1), i = v(e, "class", 7), s = /* @__PURE__ */ Le(e, [ @@ -22358,13 +22358,13 @@ function Sv(t, e) { }, E = (x) => { var _ = de(), T = J(_); { - var I = (B) => { - Cv(B, {}); + var I = (F) => { + Cv(F, {}); }; ie( T, - (B) => { - y() && B(I); + (F) => { + y() && F(I); }, !0 ); @@ -22378,7 +22378,7 @@ function Sv(t, e) { W(w), O(h, w); }; let f = /* @__PURE__ */ C(() => gn("nopan nodrag tf-checkbox peer", i())); - xt(l, () => jg, (h, p) => { + xt(l, () => Xg, (h, p) => { p(h, Ve( { "data-slot": "checkbox", @@ -22415,7 +22415,7 @@ function Sv(t, e) { return O(t, u), ce(a); } se(Sv, { ref: {}, checked: {}, indeterminate: {}, class: {} }, [], [], !0); -var O5 = /* @__PURE__ */ ne('
'); +var O5 = /* @__PURE__ */ re('
'); const A5 = { hash: "svelte-1o3a23c", code: ".tf-chosen.svelte-1o3a23c {display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:5px;}" @@ -22478,7 +22478,7 @@ function kv(t, e) { ); var d = Z(l); Qn(d); - var f = z(d, 2); + var f = V(d, 2); ft(f, { get value() { return r(); @@ -22489,8 +22489,8 @@ function kv(t, e) { style: "flex-grow: 1;", disabled: !0 }); - var h = z(f, 2); - return $e(h, { + var h = V(f, 2); + return Fe(h, { variant: "outline", onclick: (p) => { s()?.(o(), r(), p); @@ -22498,11 +22498,11 @@ function kv(t, e) { style: "padding: 3px", children: (p, m) => { Se(); - var y = Me(); - Te(() => tt(y, i())), O(p, y); + var y = Ie(); + Oe(() => tt(y, i())), O(p, y); }, $$slots: { default: !0 } - }), W(l), Te(() => zi(d, o())), O(t, l), ce(u); + }), W(l), Oe(() => zi(d, o())), O(t, l), ce(u); } se( kv, @@ -22517,7 +22517,7 @@ se( [], !0 ); -var D5 = /* @__PURE__ */ ne(""), I5 = /* @__PURE__ */ ne(""); +var D5 = /* @__PURE__ */ re(""), I5 = /* @__PURE__ */ re(""); function ft(t, e) { ue(e, !0); let n = v(e, "ref", 15, null), r = v(e, "value", 15), o = v(e, "type", 7), i = v(e, "files", 15), s = v(e, "class", 7), a = v(e, "data-slot", 7, "input"), u = /* @__PURE__ */ Le(e, [ @@ -22625,8 +22625,8 @@ se( [], !0 ); -var M5 = /* @__PURE__ */ ne(""); -function qe(t, e) { +var M5 = /* @__PURE__ */ re(""); +function je(t, e) { ue(e, !0); let n = v(e, "ref", 15, null), r = v(e, "value", 15), o = v(e, "class", 7), i = v(e, "data-slot", 7, "textarea"), s = v(e, "height", 7), a = v(e, "autoHeight", 7, !0), u = v(e, "maxHeight", 7), l = v(e, "onHeightChange", 7), d = /* @__PURE__ */ Le(e, [ "$$slots", @@ -22736,7 +22736,7 @@ function qe(t, e) { ), Nt(y, (S) => f = S, () => f), os(y, r), O(t, y), ce(m); } se( - qe, + je, { ref: {}, value: {}, @@ -22751,7 +22751,7 @@ se( [], !0 ); -var L5 = /* @__PURE__ */ ne('
'), H5 = /* @__PURE__ */ ne("
"); +var L5 = /* @__PURE__ */ re('
'), H5 = /* @__PURE__ */ re("
"); function Ev(t, e) { const n = Zu(e, ["children", "$$slots", "$$events", "$$legacy", "$$host"]), r = Zu(n, ["items", "onChange", "activeIndex"]); ue(e, !1); @@ -22787,31 +22787,31 @@ function Ev(t, e) { class: `tf-tabs ${Al(r), it(() => r.class) ?? ""}` })), Ct(l, 5, o, ao, (d, f, h) => { var p = L5(); - Ne(p, "tabindex", h), p.__click = () => a(c(f), h), p.__keydown = (b) => { + Pe(p, "tabindex", h), p.__click = () => a(c(f), h), p.__keydown = (b) => { (b.key === "Enter" || b.key === " ") && (b.preventDefault(), a(c(f), h)); }; var m = Z(p); { var y = (b) => { - var S = Me(); - Te(() => tt(S, (c(f), it(() => c(f).label)))), O(b, S); + var S = Ie(); + Oe(() => tt(S, (c(f), it(() => c(f).label)))), O(b, S); }, w = (b) => { var S = de(), E = J(S); - Oe(E, () => (c(f), it(() => c(f).label) ?? ze)), O(b, S); + Ae(E, () => (c(f), it(() => c(f).label) ?? ze)), O(b, S); }; ie(m, (b) => { c(f), it(() => typeof c(f).label == "string") ? b(y) : b(w, !1); }); } - W(p), Te(() => Yt(p, 1, `tf-tabs-item ${h === s() ? "active" : ""}`)), O(d, p); + W(p), Oe(() => qt(p, 1, `tf-tabs-item ${h === s() ? "active" : ""}`)), O(d, p); }), W(l), O(t, l), ce(u); } Sr(["click", "keydown"]); se(Ev, { items: {}, onChange: {}, activeIndex: {} }, [], [], !0); -var V5 = /* @__PURE__ */ ne(''), z5 = /* @__PURE__ */ ne('
'), R5 = /* @__PURE__ */ ne('
'), F5 = /* @__PURE__ */ ne('
'), B5 = /* @__PURE__ */ ne("
"); +var V5 = /* @__PURE__ */ re(''), z5 = /* @__PURE__ */ re('
'), R5 = /* @__PURE__ */ re('
'), F5 = /* @__PURE__ */ re('
'), B5 = /* @__PURE__ */ re("
"); const $5 = { hash: "svelte-ynwjxt", - code: ` + code: `\r /* 定义旋转的 CSS 类 */.rotate-90.svelte-ynwjxt {transform:rotate(90deg);transition:transform 0.3s ease;}` }; function Pv(t, e) { @@ -22842,14 +22842,14 @@ function Pv(t, e) { }, a = B5(); return Ct(a, 21, n, ao, (u, l, d) => { var f = F5(), h = Z(f); - Ne(h, "tabindex", d), h.__click = () => i(c(l)), h.__keydown = (_) => { + Pe(h, "tabindex", d), h.__click = () => i(c(l)), h.__keydown = (_) => { (_.key === "Enter" || _.key === " ") && (_.preventDefault(), i(c(l))); }; var p = Z(h); { var m = (_) => { var T = V5(), I = Z(T); - Xn(I, { + jn(I, { get target() { return c(l).icon; } @@ -22859,19 +22859,19 @@ function Pv(t, e) { c(l).icon && _(m); }); } - var y = z(p, 2); - Xn(y, { + var y = V(p, 2); + jn(y, { get target() { return c(l).title; } }); - var w = z(y, 2); + var w = V(y, 2); W(h); - var b = z(h, 2); + var b = V(h, 2); { var S = (_) => { var T = z5(), I = Z(T); - Xn(I, { + jn(I, { get target() { return c(l).description; } @@ -22881,11 +22881,11 @@ function Pv(t, e) { c(l).description && _(S); }); } - var E = z(b, 2); + var E = V(b, 2); { var x = (_) => { var T = R5(), I = Z(T); - Xn(I, { + jn(I, { get target() { return c(l).content; } @@ -22895,16 +22895,16 @@ function Pv(t, e) { o().includes(c(l).key) && _(x); }); } - W(f), Te((_) => Yt(w, 1, `tf-collapse-item-title-arrow ${_ ?? ""}`, "svelte-ynwjxt"), [ + W(f), Oe((_) => qt(w, 1, `tf-collapse-item-title-arrow ${_ ?? ""}`, "svelte-ynwjxt"), [ () => o().includes(c(l).key) ? "rotate-90" : "" ]), O(u, f); - }), W(a), Te(() => { - Pt(a, e.style), Yt(a, 1, `tf-collapse ${e.class ?? ""}`, "svelte-ynwjxt"); + }), W(a), Oe(() => { + Pt(a, e.style), qt(a, 1, `tf-collapse ${e.class ?? ""}`, "svelte-ynwjxt"); }), O(t, a), ce(s); } Sr(["click", "keydown"]); se(Pv, { items: {}, onChange: {}, activeKeys: {} }, [], [], !0); -function Xn(t, e) { +function jn(t, e) { ue(e, !0); let n = v(e, "target", 7); typeof n() > "u" && n("undefined"); @@ -22919,7 +22919,7 @@ function Xn(t, e) { { var s = (u) => { var l = de(), d = J(l); - Oe(d, () => n() ?? ze), O(u, l); + Ae(d, () => n() ?? ze), O(u, l); }, a = (u) => { var l = de(), d = J(l); Ks(d, n), O(u, l); @@ -22930,7 +22930,7 @@ function Xn(t, e) { } return O(t, o), ce(r); } -se(Xn, { target: {} }, [], [], !0); +se(jn, { target: {} }, [], [], !0); function gl(t, e) { ue(e, !0); let n = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host"]); @@ -22941,14 +22941,14 @@ function gl(t, e) { }, children: (o, i) => { var s = de(), a = J(s); - Oe(a, () => e.children ?? ze), O(o, s); + Ae(a, () => e.children ?? ze), O(o, s); }, $$slots: { default: !0 } })), ce(); } se(gl, {}, [], [], !0); const vt = () => yn("svelteflow__node_id"), vn = () => yn("tinyflow_options"); -var K5 = /* @__PURE__ */ ne(','), W5 = /* @__PURE__ */ ne(" ", 1), Z5 = /* @__PURE__ */ ne(' '), Y5 = /* @__PURE__ */ ne(' ', 1), q5 = /* @__PURE__ */ ne('
暂无数据
'), X5 = /* @__PURE__ */ _e(''), j5 = /* @__PURE__ */ ne(''), U5 = /* @__PURE__ */ ne(''), G5 = /* @__PURE__ */ ne(' ', 1), J5 = /* @__PURE__ */ ne(" ", 1), Q5 = /* @__PURE__ */ ne(' '), eC = /* @__PURE__ */ ne(' ', 1), tC = /* @__PURE__ */ ne('
暂无数据
'), nC = /* @__PURE__ */ _e(''), rC = /* @__PURE__ */ ne(''), oC = /* @__PURE__ */ ne(''), iC = /* @__PURE__ */ ne(' ', 1), sC = /* @__PURE__ */ ne(" ", 1); +var K5 = /* @__PURE__ */ re(','), W5 = /* @__PURE__ */ re(" ", 1), Z5 = /* @__PURE__ */ re(' '), q5 = /* @__PURE__ */ re(' ', 1), Y5 = /* @__PURE__ */ re('
暂无数据
'), j5 = /* @__PURE__ */ xe(''), X5 = /* @__PURE__ */ re(''), U5 = /* @__PURE__ */ re(''), G5 = /* @__PURE__ */ re(' ', 1), J5 = /* @__PURE__ */ re(" ", 1), Q5 = /* @__PURE__ */ re(' '), eC = /* @__PURE__ */ re(' ', 1), tC = /* @__PURE__ */ re('
暂无数据
'), nC = /* @__PURE__ */ xe(''), rC = /* @__PURE__ */ re(''), oC = /* @__PURE__ */ re(''), iC = /* @__PURE__ */ re(' ', 1), sC = /* @__PURE__ */ re(" ", 1); function _t(t, e) { ue(e, !0); let n = v(e, "items", 7), r = v(e, "onSelect", 7), o = v(e, "value", 23, () => []), i = v(e, "defaultValue", 23, () => []), s = v(e, "expandAll", 7, !0), a = v(e, "multiple", 7, !1), u = v(e, "expandValue", 23, () => []), l = v(e, "placeholder", 7), d = v(e, "disabled", 7, !1), f = v(e, "class", 7), h = /* @__PURE__ */ Le(e, [ @@ -23063,7 +23063,7 @@ function _t(t, e) { set class(N) { f(N), g(); } - }, I = de(), B = J(I); + }, I = de(), F = J(I); { var $ = (N) => { var k = de(), D = J(k); @@ -23081,109 +23081,109 @@ function _t(t, e) { () => h, { children: (R, M) => { - var Y = J5(), U = J(Y); + var Y = J5(), G = J(Y); { - let j = /* @__PURE__ */ C(() => gn("nopan nodrag tf-select", d() && "tf-select-disabled", f())); - xt(U, () => hl, (q, F) => { - F(q, { + let Q = /* @__PURE__ */ C(() => gn("nopan nodrag tf-select", d() && "tf-select-disabled", f())); + xt(G, () => hl, (j, B) => { + B(j, { get class() { - return c(j); + return c(Q); }, get disabled() { return d(); }, - children: (Q, X) => { - var re = Y5(), ee = J(re), L = Z(ee); + children: (te, q) => { + var ee = q5(), X = J(ee), L = Z(X); { - var te = (le) => { - var oe = de(), fe = J(oe); - Ct(fe, 19, () => c(y), (we) => we.value, (we, xe, pe) => { - var me = W5(), Ee = J(me); - Xn(Ee, { + var ne = (ae) => { + var oe = de(), he = J(oe); + Ct(he, 19, () => c(y), (we) => we.value, (we, _e, ve) => { + var ye = W5(), Ne = J(ye); + jn(Ne, { get target() { - return c(xe).label; + return c(_e).label; } }); - var G = z(Ee, 2); + var U = V(Ne, 2); { - var Ue = (be) => { - var De = K5(); - O(be, De); + var Ye = (be) => { + var Te = K5(); + O(be, Te); }; - ie(G, (be) => { - c(pe) < c(y).length - 1 && be(Ue); + ie(U, (be) => { + c(ve) < c(y).length - 1 && be(Ye); }); } - O(we, me); - }), O(le, oe); - }, ve = (le) => { - var oe = Z5(), fe = Z(oe, !0); - W(oe), Te(() => tt(fe, l() ?? "")), O(le, oe); + O(we, ye); + }), O(ae, oe); + }, fe = (ae) => { + var oe = Z5(), he = Z(oe, !0); + W(oe), Oe(() => tt(he, l() ?? "")), O(ae, oe); }; - ie(L, (le) => { - c(y).length > 0 ? le(te) : le(ve, !1); + ie(L, (ae) => { + c(y).length > 0 ? ae(ne) : ae(fe, !1); }); } - W(ee); - var ae = z(ee, 2); - gl(ae, { class: "tf-select-heading-icon" }), O(Q, re); + W(X); + var le = V(X, 2); + gl(le, { class: "tf-select-heading-icon" }), O(te, ee); }, $$slots: { default: !0 } }); }); } - var V = z(U, 2); - xt(V, () => rl, (j, q) => { - q(j, { - children: (F, Q) => { - var X = de(), re = J(X); + var z = V(G, 2); + xt(z, () => rl, (Q, j) => { + j(Q, { + children: (B, te) => { + var q = de(), ee = J(q); { - let ee = /* @__PURE__ */ C(() => gn("nopan nodrag nowheel tf-root tf-select-content", p === "dark" && "dark")); - xt(re, () => ul, (L, te) => { - te(L, { + let X = /* @__PURE__ */ C(() => gn("nopan nodrag nowheel tf-root tf-select-content", p === "dark" && "dark")); + xt(ee, () => ul, (L, ne) => { + ne(L, { get class() { - return c(ee); + return c(X); }, - children: (ve, ae) => { - var le = de(), oe = J(le); - xt(oe, () => dl, (fe, we) => { - we(fe, { + children: (fe, le) => { + var ae = de(), oe = J(ae); + xt(oe, () => dl, (he, we) => { + we(he, { style: "padding: 4px;", - children: (xe, pe) => { - var me = de(), Ee = J(me); + children: (_e, ve) => { + var ye = de(), Ne = J(ye); { - var G = (be) => { - var De = q5(); - O(be, De); - }, Ue = (be) => { - var De = de(), Pe = J(De); - Ct(Pe, 19, () => c(x), ({ item: Xe, level: je }, Ke) => `${Ke}_${Xe.value}`, (Xe, je) => { - let Ke = () => c(je).item, rt = () => c(je).level; - const Tt = /* @__PURE__ */ C(() => Ke().children && Ke().children.length > 0), he = /* @__PURE__ */ C(() => _(Ke())); - var Ae = de(), et = J(Ae); + var U = (be) => { + var Te = Y5(); + O(be, Te); + }, Ye = (be) => { + var Te = de(), Ee = J(Te); + Ct(Ee, 19, () => c(x), ({ item: Xe, level: Ue }, We) => `${We}_${Xe.value}`, (Xe, Ue) => { + let We = () => c(Ue).item, rt = () => c(Ue).level; + const Tt = /* @__PURE__ */ C(() => We().children && We().children.length > 0), ge = /* @__PURE__ */ C(() => _(We())); + var De = de(), et = J(De); { const Ze = (st, lt) => { let bt = () => lt?.().selected; var ut = G5(), ot = J(ut), Ot = Z(ot); { var ko = (dt) => { - var ln = X5(); + var ln = j5(); O(dt, ln); }, an = (dt) => { - var ln = j5(); + var ln = X5(); O(dt, ln); }; ie(Ot, (dt) => { c(Tt) ? dt(ko) : dt(an, !1); }); } - var oa = z(Ot, 2); - Xn(oa, { + var oa = V(Ot, 2); + jn(oa, { get target() { - return Ke().label; + return We().label; } }), W(ot); - var ia = z(ot, 2); + var ia = V(ot, 2); { var sa = (dt) => { var ln = U5(); @@ -23199,39 +23199,39 @@ function _t(t, e) { xt(et, () => cl, (st, lt) => { lt(st, { get value() { - return c(he).value; + return c(ge).value; }, get label() { - return c(he).label; + return c(ge).label; }, class: "tf-select-option", get style() { return `padding-left: ${c(at) ?? ""}px`; }, - onclick: (bt) => S(bt, Ke()), + onclick: (bt) => S(bt, We()), children: Ze, $$slots: { default: !0 } }); }); } - O(Xe, Ae); - }), O(be, De); + O(Xe, De); + }), O(be, Te); }; - ie(Ee, (be) => { - c(x).length === 0 ? be(G) : be(Ue, !1); + ie(Ne, (be) => { + c(x).length === 0 ? be(U) : be(Ye, !1); }); } - O(xe, me); + O(_e, ye); }, $$slots: { default: !0 } }); - }), O(ve, le); + }), O(fe, ae); }, $$slots: { default: !0 } }); }); } - O(F, X); + O(B, q); }, $$slots: { default: !0 } }); @@ -23257,71 +23257,71 @@ function _t(t, e) { () => h, { children: (R, M) => { - var Y = sC(), U = J(Y); + var Y = sC(), G = J(Y); { - let j = /* @__PURE__ */ C(() => gn("nopan nodrag tf-select", d() && " tf-select-disabled", f())); - xt(U, () => hl, (q, F) => { - F(q, { + let Q = /* @__PURE__ */ C(() => gn("nopan nodrag tf-select", d() && " tf-select-disabled", f())); + xt(G, () => hl, (j, B) => { + B(j, { get class() { - return c(j); + return c(Q); }, get disabled() { return d(); }, - children: (Q, X) => { - var re = eC(), ee = J(re), L = Z(ee); + children: (te, q) => { + var ee = eC(), X = J(ee), L = Z(X); { - var te = (le) => { - Xn(le, { + var ne = (ae) => { + jn(ae, { get target() { return c(y)[0].label; } }); - }, ve = (le) => { - var oe = Q5(), fe = Z(oe, !0); - W(oe), Te(() => tt(fe, l() ?? "")), O(le, oe); + }, fe = (ae) => { + var oe = Q5(), he = Z(oe, !0); + W(oe), Oe(() => tt(he, l() ?? "")), O(ae, oe); }; - ie(L, (le) => { - c(y).length > 0 ? le(te) : le(ve, !1); + ie(L, (ae) => { + c(y).length > 0 ? ae(ne) : ae(fe, !1); }); } - W(ee); - var ae = z(ee, 2); - gl(ae, { class: "tf-select-icon" }), O(Q, re); + W(X); + var le = V(X, 2); + gl(le, { class: "tf-select-icon" }), O(te, ee); }, $$slots: { default: !0 } }); }); } - var V = z(U, 2); - xt(V, () => rl, (j, q) => { - q(j, { - children: (F, Q) => { - var X = de(), re = J(X); + var z = V(G, 2); + xt(z, () => rl, (Q, j) => { + j(Q, { + children: (B, te) => { + var q = de(), ee = J(q); { - let ee = /* @__PURE__ */ C(() => gn("nopan nodrag nowheel tf-root tf-select-content", p === "dark" && "dark")); - xt(re, () => ul, (L, te) => { - te(L, { + let X = /* @__PURE__ */ C(() => gn("nopan nodrag nowheel tf-root tf-select-content", p === "dark" && "dark")); + xt(ee, () => ul, (L, ne) => { + ne(L, { get class() { - return c(ee); + return c(X); }, - children: (ve, ae) => { - var le = de(), oe = J(le); - xt(oe, () => dl, (fe, we) => { - we(fe, { + children: (fe, le) => { + var ae = de(), oe = J(ae); + xt(oe, () => dl, (he, we) => { + we(he, { style: "padding: 4px;", - children: (xe, pe) => { - var me = de(), Ee = J(me); + children: (_e, ve) => { + var ye = de(), Ne = J(ye); { - var G = (be) => { - var De = tC(); - O(be, De); - }, Ue = (be) => { - var De = de(), Pe = J(De); - Ct(Pe, 19, () => c(x), ({ item: Xe, level: je }, Ke) => `${Ke}_${Xe.value}`, (Xe, je) => { - let Ke = () => c(je).item, rt = () => c(je).level; - const Tt = /* @__PURE__ */ C(() => Ke().children && Ke().children.length > 0), he = /* @__PURE__ */ C(() => _(Ke())); - var Ae = de(), et = J(Ae); + var U = (be) => { + var Te = tC(); + O(be, Te); + }, Ye = (be) => { + var Te = de(), Ee = J(Te); + Ct(Ee, 19, () => c(x), ({ item: Xe, level: Ue }, We) => `${We}_${Xe.value}`, (Xe, Ue) => { + let We = () => c(Ue).item, rt = () => c(Ue).level; + const Tt = /* @__PURE__ */ C(() => We().children && We().children.length > 0), ge = /* @__PURE__ */ C(() => _(We())); + var De = de(), et = J(De); { const Ze = (st, lt) => { let bt = () => lt?.().selected; @@ -23338,13 +23338,13 @@ function _t(t, e) { c(Tt) ? dt(ko) : dt(an, !1); }); } - var oa = z(Ot, 2); - Xn(oa, { + var oa = V(Ot, 2); + jn(oa, { get target() { - return Ke().label; + return We().label; } }), W(ot); - var ia = z(ot, 2); + var ia = V(ot, 2); { var sa = (dt) => { var ln = oC(); @@ -23360,39 +23360,39 @@ function _t(t, e) { xt(et, () => cl, (st, lt) => { lt(st, { get value() { - return c(he).value; + return c(ge).value; }, get label() { - return c(he).label; + return c(ge).label; }, class: "tf-select-option", get style() { return `padding-left: ${c(at) ?? ""}px`; }, - onclick: (bt) => S(bt, Ke()), + onclick: (bt) => S(bt, We()), children: Ze, $$slots: { default: !0 } }); }); } - O(Xe, Ae); - }), O(be, De); + O(Xe, De); + }), O(be, Te); }; - ie(Ee, (be) => { - c(x).length === 0 ? be(G) : be(Ue, !1); + ie(Ne, (be) => { + c(x).length === 0 ? be(U) : be(Ye, !1); }); } - O(xe, me); + O(_e, ye); }, $$slots: { default: !0 } }); - }), O(ve, le); + }), O(fe, ae); }, $$slots: { default: !0 } }); }); } - O(F, X); + O(B, q); }, $$slots: { default: !0 } }); @@ -23403,7 +23403,7 @@ function _t(t, e) { )); }), O(N, k); }; - ie(B, (N) => { + ie(F, (N) => { a() ? N($) : N(H, !1); }); } @@ -23519,8 +23519,8 @@ const aC = ({ } }; }; -var lC = /* @__PURE__ */ ne('
'); -function jr(t, e) { +var lC = /* @__PURE__ */ re('
'); +function Xr(t, e) { ue(e, !0); const n = v(e, "children", 7), r = v(e, "floating", 7), o = v(e, "placement", 7, "bottom"); let i, s, a; @@ -23556,12 +23556,12 @@ function jr(t, e) { o(y), g(); } }, d = lC(), f = Z(d), h = Z(f); - Oe(h, n), W(f), Nt(f, (y) => i = y, () => i); - var p = z(f, 2), m = Z(p); - return Oe(m, r), W(p), Nt(p, (y) => s = y, () => s), W(d), O(t, d), ce(l); + Ae(h, n), W(f), Nt(f, (y) => i = y, () => i); + var p = V(f, 2), m = Z(p); + return Ae(m, r), W(p), Nt(p, (y) => s = y, () => s), W(d), O(t, d), ce(l); } -se(jr, { children: {}, floating: {}, placement: {} }, [], ["hide"], !0); -function We(t, e) { +se(Xr, { children: {}, floating: {}, placement: {} }, [], ["hide"], !0); +function Ke(t, e) { ue(e, !0); const n = v(e, "children", 7), r = v(e, "level", 7, 1), o = v(e, "mt", 7), i = v(e, "mb", 7); var s = { @@ -23596,11 +23596,11 @@ function We(t, e) { style: `margin-top:${o() || "0"};margin-bottom:${i() || "0"}` })); var f = de(), h = J(f); - Oe(h, () => n() ?? ze), O(d, f); + Ae(h, () => n() ?? ze), O(d, f); }), O(t, a), ce(s); } -se(We, { children: {}, level: {}, mt: {}, mb: {} }, [], [], !0); -var uC = /* @__PURE__ */ _e(''); +se(Ke, { children: {}, level: {}, mt: {}, mb: {} }, [], [], !0); +var uC = /* @__PURE__ */ xe(''); const cC = { hash: "svelte-1q3h954", code: ".input-btn-more {border:1px solid transparent;padding:3px;&:hover {background:var(--tf-input);border:1px solid transparent;}}" @@ -23610,7 +23610,7 @@ function Si(t, e) { const n = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host"]); { let r = /* @__PURE__ */ C(() => gn("input-btn-more", e.class)); - $e(t, Ve( + Fe(t, Ve( { size: "icon-xs", get class() { @@ -23631,12 +23631,12 @@ function Si(t, e) { } se(Si, {}, [], [], !0); const dC = () => ({ deleteNode: (e) => { - Be.removeNode(e), Be.updateEdges((n) => n.filter((r) => r.source !== e && r.target !== e)); + $e.removeNode(e), $e.updateEdges((n) => n.filter((r) => r.source !== e && r.target !== e)); } }), xn = (t = 16) => { const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = new Uint8Array(t); return crypto.getRandomValues(n), Array.from(n, (r) => e[r % e.length]).join(""); }, Ui = (t) => JSON.parse(JSON.stringify(t)), fC = () => ({ copyNode: (e) => { - const n = Be.getNode(e); + const n = $e.getNode(e); if (n) { const r = { ...Ui(n), @@ -23646,10 +23646,10 @@ const dC = () => ({ deleteNode: (e) => { if (r.data?.parameters) for (let o of r.data.parameters) o.id = xn(), o.ref = void 0; - Be.updateNodes((o) => [...o.map((s) => ({ ...s, selected: !1 })), r]); + $e.updateNodes((o) => [...o.map((s) => ({ ...s, selected: !1 })), r]); } } }); -var hC = /* @__PURE__ */ _e(''), gC = /* @__PURE__ */ _e(''), vC = /* @__PURE__ */ _e(''), pC = /* @__PURE__ */ ne('
执行条件:
'), mC = /* @__PURE__ */ ne('
循环间隔时间(单位:毫秒):
最大循环次数(0 表示不限制):
退出条件:
', 1), yC = /* @__PURE__ */ ne('
错误重试间隔时间(单位:毫秒):
最大重试次数:
', 1), wC = /* @__PURE__ */ ne('
节点名称:
参数描述:
'), bC = /* @__PURE__ */ _e(''), xC = /* @__PURE__ */ ne('
'), _C = /* @__PURE__ */ ne('
TinyFlow.ai
', 1); +var hC = /* @__PURE__ */ xe(''), gC = /* @__PURE__ */ xe(''), vC = /* @__PURE__ */ xe(''), pC = /* @__PURE__ */ re('
执行条件:
'), mC = /* @__PURE__ */ re('
循环间隔时间(单位:毫秒):
最大循环次数(0 表示不限制):
退出条件:
', 1), yC = /* @__PURE__ */ re('
错误重试间隔时间(单位:毫秒):
最大重试次数:
', 1), wC = /* @__PURE__ */ re('
节点名称:
参数描述:
'), bC = /* @__PURE__ */ xe(''), xC = /* @__PURE__ */ re('
'), _C = /* @__PURE__ */ re('
TinyFlow.ai
', 1); const CC = { hash: "svelte-ana6zl", code: ".tf-node-toolbar.svelte-ana6zl {display:flex;gap:5px;padding:5px;border-radius:5px;background:var(--tf-background);border:1px solid var(--tf-border);box-shadow:0 0 5px rgba(0, 0, 0, 0.1);}.tf-node-toolbar-item {border:1px solid transparent;}.settings.svelte-ana6zl {display:flex;flex-direction:column;gap:10px;padding:10px;background:var(--tf-background);border:1px solid var(--tf-border);border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.settings.svelte-ana6zl .input-item:where(.svelte-ana6zl) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--tf-muted-foreground);}.settings.svelte-ana6zl .input-item-inline:where(.svelte-ana6zl) {display:flex;align-items:center;font-size:12px;color:var(--tf-muted-foreground);}" @@ -23670,186 +23670,186 @@ function sn(t, e) { _.onNodeExecute?.(b(r())); }; let I = vt(); - var B = { + var F = { get data() { return n(); }, - set data(V) { - n(V), g(); + set data(z) { + n(z), g(); }, get id() { return r(); }, - set id(V = "") { - r(V), g(); + set id(z = "") { + r(z), g(); }, get icon() { return o(); }, - set icon(V) { - o(V), g(); + set icon(z) { + o(z), g(); }, get handle() { return i(); }, - set handle(V) { - i(V), g(); + set handle(z) { + i(z), g(); }, get children() { return s(); }, - set children(V) { - s(V), g(); + set children(z) { + s(z), g(); }, get allowExecute() { return a(); }, - set allowExecute(V = !0) { - a(V), g(); + set allowExecute(z = !0) { + a(z), g(); }, get allowCopy() { return u(); }, - set allowCopy(V = !0) { - u(V), g(); + set allowCopy(z = !0) { + u(z), g(); }, get allowDelete() { return l(); }, - set allowDelete(V = !0) { - l(V), g(); + set allowDelete(z = !0) { + l(z), g(); }, get allowSetting() { return d(); }, - set allowSetting(V = !0) { - d(V), g(); + set allowSetting(z = !0) { + d(z), g(); }, get allowSettingOfCondition() { return f(); }, - set allowSettingOfCondition(V = !0) { - f(V), g(); + set allowSettingOfCondition(z = !0) { + f(z), g(); }, get showSourceHandle() { return h(); }, - set showSourceHandle(V = !0) { - h(V), g(); + set showSourceHandle(z = !0) { + h(z), g(); }, get showTargetHandle() { return p(); }, - set showTargetHandle(V = !0) { - p(V), g(); + set showTargetHandle(z = !0) { + p(z), g(); }, get onCollapse() { return m(); }, - set onCollapse(V) { - m(V), g(); + set onCollapse(z) { + m(z), g(); } }, $ = _C(), H = J($); { - var N = (V) => { - sg(V, { + var N = (z) => { + sg(z, { get position() { return ke.Top; }, align: "start", - children: (j, q) => { - var F = xC(), Q = Z(F); + children: (Q, j) => { + var B = xC(), te = Z(B); { - var X = (le) => { - $e(le, { + var q = (ae) => { + Fe(ae, { size: "icon", class: "tf-node-toolbar-item", onclick: () => { E(r()); }, - children: (oe, fe) => { + children: (oe, he) => { var we = hC(); O(oe, we); }, $$slots: { default: !0 } }); }; - ie(Q, (le) => { - l() && le(X); + ie(te, (ae) => { + l() && ae(q); }); } - var re = z(Q, 2); + var ee = V(te, 2); { - var ee = (le) => { - $e(le, { + var X = (ae) => { + Fe(ae, { size: "icon", class: "tf-node-toolbar-item", onclick: () => { x(r()); }, - children: (oe, fe) => { + children: (oe, he) => { var we = gC(); O(oe, we); }, $$slots: { default: !0 } }); }; - ie(re, (le) => { - u() && le(ee); + ie(ee, (ae) => { + u() && ae(X); }); } - var L = z(re, 2); + var L = V(ee, 2); { - var te = (le) => { - $e(le, { + var ne = (ae) => { + Fe(ae, { size: "icon", class: "tf-node-toolbar-item", onclick: T, - children: (oe, fe) => { + children: (oe, he) => { var we = vC(); O(oe, we); }, $$slots: { default: !0 } }); }; - ie(L, (le) => { - a() && le(te); + ie(L, (ae) => { + a() && ae(ne); }); } - var ve = z(L, 2); + var fe = V(L, 2); { - var ae = (le) => { - jr(le, { + var le = (ae) => { + Xr(ae, { placement: "bottom", - floating: (fe) => { - var we = wC(), xe = Z(we), pe = z(Z(xe)); - ft(pe, { + floating: (he) => { + var we = wC(), _e = Z(we), ve = V(Z(_e)); + ft(ve, { style: "width: 100%;", - onchange: (he) => { - const Ae = he.target.value; - w(I, { title: Ae }); + onchange: (ge) => { + const De = ge.target.value; + w(I, { title: De }); }, get value() { return n().title; } - }), W(xe); - var me = z(xe, 2), Ee = z(Z(me)); - qe(Ee, { + }), W(_e); + var ye = V(_e, 2), Ne = V(Z(ye)); + je(Ne, { rows: 3, style: "width: 100%;", - onchange: (he) => { - const Ae = he.target.value; - w(I, { description: Ae }); + onchange: (ge) => { + const De = ge.target.value; + w(I, { description: De }); }, get value() { return n().description; } - }), W(me); - var G = z(me, 2); + }), W(ye); + var U = V(ye, 2); { - var Ue = (he) => { - var Ae = pC(), et = z(Z(Ae)); - qe(et, { + var Ye = (ge) => { + var De = pC(), et = V(Z(De)); + je(et, { rows: 2, style: "width: 100%;", onchange: (Ze) => { @@ -23859,24 +23859,24 @@ function sn(t, e) { get value() { return n().condition; } - }), W(Ae), O(he, Ae); + }), W(De), O(ge, De); }; - ie(G, (he) => { - f() && he(Ue); + ie(U, (ge) => { + f() && ge(Ye); }); } - var be = z(G, 2), De = z(Z(be), 2); - Qn(De), De.__change = (he) => { - const Ae = he.target.checked; - w(I, { loopEnable: Ae }); + var be = V(U, 2), Te = V(Z(be), 2); + Qn(Te), Te.__change = (ge) => { + const De = ge.target.checked; + w(I, { loopEnable: De }); }, W(be); - var Pe = z(be, 2); + var Ee = V(be, 2); { - var Xe = (he) => { - var Ae = mC(), et = J(Ae), Ze = z(Z(et)); + var Xe = (ge) => { + var De = mC(), et = J(De), Ze = V(Z(et)); { let ut = /* @__PURE__ */ C(() => n().loopIntervalMs || "1000"); - qe(Ze, { + je(Ze, { rows: 1, style: "width: 100%;", onchange: (ot) => { @@ -23889,10 +23889,10 @@ function sn(t, e) { }); } W(et); - var at = z(et, 2), st = z(Z(at)); + var at = V(et, 2), st = V(Z(at)); { let ut = /* @__PURE__ */ C(() => n().maxLoopCount || "0"); - qe(st, { + je(st, { rows: 1, style: "width: 100%;", onchange: (ot) => { @@ -23905,8 +23905,8 @@ function sn(t, e) { }); } W(at); - var lt = z(at, 2), bt = z(Z(lt)); - qe(bt, { + var lt = V(at, 2), bt = V(Z(lt)); + je(bt, { rows: 2, style: "width: 100%;", onchange: (ut) => { @@ -23916,24 +23916,24 @@ function sn(t, e) { get value() { return n().loopBreakCondition; } - }), W(lt), O(he, Ae); + }), W(lt), O(ge, De); }; - ie(Pe, (he) => { - n().loopEnable && he(Xe); + ie(Ee, (ge) => { + n().loopEnable && ge(Xe); }); } - var je = z(Pe, 2), Ke = z(Z(je), 2); - Qn(Ke), Ke.__change = (he) => { - const Ae = he.target.checked; - w(I, { retryEnable: Ae }); - }, W(je); - var rt = z(je, 2); + var Ue = V(Ee, 2), We = V(Z(Ue), 2); + Qn(We), We.__change = (ge) => { + const De = ge.target.checked; + w(I, { retryEnable: De }); + }, W(Ue); + var rt = V(Ue, 2); { - var Tt = (he) => { - var Ae = yC(), et = J(Ae), Ze = z(Z(et)); + var Tt = (ge) => { + var De = yC(), et = J(De), Ze = V(Z(et)); { let ut = /* @__PURE__ */ C(() => n().retryIntervalMs || "1000"); - qe(Ze, { + je(Ze, { rows: 1, style: "width: 100%;", onchange: (ot) => { @@ -23946,10 +23946,10 @@ function sn(t, e) { }); } W(et); - var at = z(et, 2), st = z(Z(at)); + var at = V(et, 2), st = V(Z(at)); { let ut = /* @__PURE__ */ C(() => n().maxRetryCount || "3"); - qe(st, { + je(st, { rows: 1, style: "width: 100%;", onchange: (ot) => { @@ -23962,27 +23962,27 @@ function sn(t, e) { }); } W(at); - var lt = z(at, 2), bt = z(Z(lt), 2); + var lt = V(at, 2), bt = V(Z(lt), 2); Qn(bt), bt.__change = (ut) => { const ot = ut.target.checked; w(I, { resetRetryCountAfterNormal: ot }); - }, W(lt), Te(() => Ri(bt, !!n().resetRetryCountAfterNormal)), O(he, Ae); + }, W(lt), Oe(() => Ri(bt, !!n().resetRetryCountAfterNormal)), O(ge, De); }; - ie(rt, (he) => { - n().retryEnable && he(Tt); + ie(rt, (ge) => { + n().retryEnable && ge(Tt); }); } - W(we), Te(() => { - Ri(De, !!n().loopEnable), Ri(Ke, !!n().retryEnable); - }), O(fe, we); + W(we), Oe(() => { + Ri(Te, !!n().loopEnable), Ri(We, !!n().retryEnable); + }), O(he, we); }, - children: (fe, we) => { - $e(fe, { + children: (he, we) => { + Fe(he, { size: "icon", class: "tf-node-toolbar-item", - children: (xe, pe) => { - var me = bC(); - O(xe, me); + children: (_e, ve) => { + var ye = bC(); + O(_e, ye); }, $$slots: { default: !0 } }); @@ -23990,20 +23990,20 @@ function sn(t, e) { $$slots: { floating: !0, default: !0 } }); }; - ie(ve, (le) => { - d() && le(ae); + ie(fe, (ae) => { + d() && ae(le); }); } - W(F), O(j, F); + W(B), O(Q, B); }, $$slots: { default: !0 } }); }; - ie(H, (V) => { - (a() || u() || l()) && V(N); + ie(H, (z) => { + (a() || u() || l()) && z(N); }); } - var k = z(H, 2), D = z(Z(k), 2), P = Z(D); + var k = V(H, 2), D = V(Z(k), 2), P = Z(D); Pv(P, { get items() { return c(S); @@ -24011,14 +24011,14 @@ function sn(t, e) { get activeKeys() { return y; }, - onChange: (V, j) => { - w(r(), { expand: j?.includes("key") }), m()?.(j?.includes("key") ? "key" : ""); + onChange: (z, Q) => { + w(r(), { expand: Q?.includes("key") }), m()?.(Q?.includes("key") ? "key" : ""); } }), W(D), W(k); - var A = z(k, 2); + var A = V(k, 2); { - var R = (V) => { - yr(V, { + var R = (z) => { + yr(z, { type: "target", get position() { return ke.Left; @@ -24026,14 +24026,14 @@ function sn(t, e) { style: " left: -12px;top: 20px" }); }; - ie(A, (V) => { - p() && V(R); + ie(A, (z) => { + p() && z(R); }); } - var M = z(A, 2); + var M = V(A, 2); { - var Y = (V) => { - yr(V, { + var Y = (z) => { + yr(z, { type: "source", get position() { return ke.Right; @@ -24041,12 +24041,12 @@ function sn(t, e) { style: "right: -12px;top: 20px" }); }; - ie(M, (V) => { - h() && V(Y); + ie(M, (z) => { + h() && z(Y); }); } - var U = z(M, 2); - return Oe(U, () => i() ?? ze), O(t, $), ce(B); + var G = V(M, 2); + return Ae(G, () => i() ?? ze), O(t, $), ce(F); } Sr(["change"]); se( @@ -24070,7 +24070,7 @@ se( [], !0 ); -var SC = /* @__PURE__ */ ne('
数据选项:
'), kC = /* @__PURE__ */ ne('
数据类型:
输入方式:
数据标题:
数据描述:
占位符:
参数描述:
'), EC = /* @__PURE__ */ _e(''), PC = /* @__PURE__ */ ne('
', 1); +var SC = /* @__PURE__ */ re('
数据选项:
'), kC = /* @__PURE__ */ re('
数据类型:
输入方式:
数据标题:
数据描述:
占位符:
参数描述:
'), EC = /* @__PURE__ */ xe(''), PC = /* @__PURE__ */ re('
', 1); const NC = { hash: "svelte-n5iecj", code: ".input-item.svelte-n5iecj {display:flex;align-items:center;}.input-more-setting.svelte-n5iecj {display:flex;flex-direction:column;gap:10px;padding:10px;background:var(--tf-background);border:1px solid var(--tf-border);border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.input-more-setting.svelte-n5iecj .input-more-item:where(.svelte-n5iecj) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--tf-muted-foreground);}" @@ -24128,21 +24128,21 @@ function Nv(t, e) { placeholder: "请输入参数", oninput: h }), W(x); - var T = z(x, 2), I = Z(T); + var T = V(x, 2), I = Z(T); Sv(I, { get checked() { return c(s).required; }, onCheckedChange: p }), W(T); - var B = z(T, 2), $ = Z(B); + var F = V(T, 2), $ = Z(F); return Nt( - jr($, { + Xr($, { placement: "bottom", floating: (N) => { - var k = kC(), D = Z(k), P = z(Z(D)); + var k = kC(), D = Z(k), P = V(Z(D)); { - let te = /* @__PURE__ */ C(() => c(s).contentType ? [c(s).contentType] : []); + let ne = /* @__PURE__ */ C(() => c(s).contentType ? [c(s).contentType] : []); _t(P, { get items() { return eu; @@ -24150,15 +24150,15 @@ function Nv(t, e) { style: "width: 100%", defaultValue: ["text"], get value() { - return c(te); + return c(ne); }, onSelect: y }); } W(D); - var A = z(D, 2), R = z(Z(A)); + var A = V(D, 2), R = V(Z(A)); { - let te = /* @__PURE__ */ C(() => c(s).formType ? [c(s).formType] : []); + let ne = /* @__PURE__ */ C(() => c(s).formType ? [c(s).formType] : []); _t(R, { get items() { return c(a); @@ -24166,20 +24166,20 @@ function Nv(t, e) { style: "width: 100%", defaultValue: ["input"], get value() { - return c(te); + return c(ne); }, onSelect: m }); } W(A); - var M = z(A, 2); + var M = V(A, 2); { - var Y = (te) => { - var ve = SC(), ae = z(Z(ve)); + var Y = (ne) => { + var fe = SC(), le = V(Z(fe)); { - let le = /* @__PURE__ */ C(() => c(s).enums?.join(` + let ae = /* @__PURE__ */ C(() => c(s).enums?.join(` `)); - qe(ae, { + je(le, { rows: 3, style: "width: 100%;", onchange: (oe) => { @@ -24187,79 +24187,79 @@ function Nv(t, e) { `)); }, get value() { - return c(le); + return c(ae); }, placeholder: "一行一个选项" }); } - W(ve), O(te, ve); + W(fe), O(ne, fe); }; - ie(M, (te) => { - c(u) && (c(s).formType === "radio" || c(s).formType === "checkbox" || c(s).formType === "select") && te(Y); + ie(M, (ne) => { + c(u) && (c(s).formType === "radio" || c(s).formType === "checkbox" || c(s).formType === "select") && ne(Y); }); } - var U = z(M, 2), V = z(Z(U)); - qe(V, { + var G = V(M, 2), z = V(Z(G)); + je(z, { rows: 1, style: "width: 100%;", - onchange: (te) => { - f("formLabel", te); + onchange: (ne) => { + f("formLabel", ne); }, get value() { return c(s).formLabel; }, placeholder: "请输入数据标题" - }), W(U); - var j = z(U, 2), q = z(Z(j)); - qe(q, { + }), W(G); + var Q = V(G, 2), j = V(Z(Q)); + je(j, { rows: 2, style: "width: 100%;", - onchange: (te) => { - f("formDescription", te); + onchange: (ne) => { + f("formDescription", ne); }, get value() { return c(s).formDescription; }, placeholder: "请输入数据描述" - }), W(j); - var F = z(j, 2), Q = z(Z(F)); - qe(Q, { + }), W(Q); + var B = V(Q, 2), te = V(Z(B)); + je(te, { rows: 2, style: "width: 100%;", - onchange: (te) => { - f("formPlaceholder", te); + onchange: (ne) => { + f("formPlaceholder", ne); }, get value() { return c(s).formPlaceholder; }, placeholder: "请输入占位符" - }), W(F); - var X = z(F, 2), re = z(Z(X)); - qe(re, { + }), W(B); + var q = V(B, 2), ee = V(Z(q)); + je(ee, { rows: 3, style: "width: 100%;", - onchange: (te) => { - f("description", te); + onchange: (ne) => { + f("description", ne); }, get value() { return c(s).description; }, placeholder: "请输入参数描述" - }), W(X); - var ee = z(X, 2), L = Z(ee); - $e(L, { + }), W(q); + var X = V(q, 2), L = Z(X); + Fe(L, { variant: "destructive", onclick: b, - children: (te, ve) => { + children: (ne, fe) => { Se(); - var ae = Me("删除"); - O(te, ae); + var le = Ie("删除"); + O(ne, le); }, $$slots: { default: !0 } - }), W(ee), W(k), O(N, k); + }), W(X), W(k), O(N, k); }, children: (N, k) => { - $e(N, { + Fe(N, { size: "icon-xs", class: "input-btn-more", children: (D, P) => { @@ -24273,10 +24273,10 @@ function Nv(t, e) { }), (N) => w = N, () => w - ), W(B), O(t, E), ce(S); + ), W(F), O(t, E), ce(S); } se(Nv, { parameter: {}, index: {} }, [], [], !0); -var TC = /* @__PURE__ */ ne('
参数名称
必填
', 1), OC = /* @__PURE__ */ ne('
无输入参数
'), AC = /* @__PURE__ */ ne('
'); +var TC = /* @__PURE__ */ re('
参数名称
必填
', 1), OC = /* @__PURE__ */ re('
无输入参数
'), AC = /* @__PURE__ */ re('
'); const DC = { hash: "svelte-1yp5n1k", code: `.input-container.svelte-1yp5n1k {display:grid;grid-template-columns:80% 10% 10%;row-gap:5px;column-gap:3px;}.input-container.svelte-1yp5n1k .none-params:where(.svelte-1yp5n1k) {font-size:12px;background:var(--tf-secondary);height:20px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1; @@ -24295,7 +24295,7 @@ function Tv(t, e) { c(o).length !== 0 && l(a); }); } - var u = z(s, 2); + var u = V(s, 2); Ct( u, 19, @@ -24342,7 +24342,7 @@ const ri = (t) => (!t || t.length == 0 || t.forEach((e) => { } }; }; -var IC = /* @__PURE__ */ _e(''), MC = /* @__PURE__ */ _e(''), LC = /* @__PURE__ */ ne('
', 1); +var IC = /* @__PURE__ */ xe(''), MC = /* @__PURE__ */ xe(''), LC = /* @__PURE__ */ re('
', 1); const HC = { hash: "svelte-llt1qy", code: ".heading.svelte-llt1qy {display:flex;margin-bottom:10px;}.input-btn-more {border:1px solid transparent;padding:3px;}.input-btn-more:hover {background:var(--tf-muted);border:1px solid transparent;}" @@ -24371,17 +24371,17 @@ function Ov(t, e) { }, children: (u, l) => { var d = LC(), f = J(d), h = Z(f); - We(h, { + Ke(h, { level: 3, children: (y, w) => { Se(); - var b = Me("输入参数"); + var b = Ie("输入参数"); O(y, b); }, $$slots: { default: !0 } }); - var p = z(h, 2); - $e(p, { + var p = V(h, 2); + Fe(p, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", @@ -24394,7 +24394,7 @@ function Ov(t, e) { }, $$slots: { default: !0 } }), W(f); - var m = z(f, 2); + var m = V(f, 2); Tv(m, {}), O(u, d); }, $$slots: { icon: !0, default: !0 } @@ -24497,7 +24497,7 @@ const Av = (t, e, n) => { } }; }; -var zC = /* @__PURE__ */ ne('
数据类型:
'), RC = /* @__PURE__ */ ne('
数据选项:
'), FC = /* @__PURE__ */ ne('
输入方式:
数据标题:
数据描述:
占位符:
', 1), BC = /* @__PURE__ */ ne('
数据来源:
默认值:
'), $C = /* @__PURE__ */ ne('
', 1); +var zC = /* @__PURE__ */ re('
数据类型:
'), RC = /* @__PURE__ */ re('
数据选项:
'), FC = /* @__PURE__ */ re('
输入方式:
数据标题:
数据描述:
占位符:
', 1), BC = /* @__PURE__ */ re('
数据来源:
默认值:
'), $C = /* @__PURE__ */ re('
', 1); const KC = { hash: "svelte-jmeys3", code: ".input-item.svelte-jmeys3 {display:flex;align-items:center;}.input-more-setting.svelte-jmeys3 {display:flex;flex-direction:column;gap:10px;padding:10px;background:var(--tf-background);border:1px solid var(--tf-border);border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.input-more-setting.svelte-jmeys3 .input-more-item:where(.svelte-jmeys3) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--tf-muted-foreground);}" @@ -24512,13 +24512,13 @@ function Mv(t, e) { ...u?.current?.data?.[o()][r()] })), d = /* @__PURE__ */ C(() => ["text", "other"].includes(c(l).contentType || "text") ? ag : lg), f = /* @__PURE__ */ C(() => c(l).contentType === "text" || !c(l).contentType); const { updateNodeData: h } = wt(), p = (M, Y) => { - h(a, (U) => { - let V = U.data?.[o()]; - return V[r()] = { ...V[r()], [M]: Y }, { [o()]: V }; + h(a, (G) => { + let z = G.data?.[o()]; + return z[r()] = { ...z[r()], [M]: Y }, { [o()]: z }; }); }, m = (M, Y) => { - const U = Y.target.value; - p(M, U); + const G = Y.target.value; + p(M, G); }, y = (M) => { const Y = M.value; p("ref", Y); @@ -24572,7 +24572,7 @@ function Mv(t, e) { set showContentType(M = !1) { s(M), g(); } - }, B = $C(), $ = J(B), H = Z($); + }, F = $C(), $ = J(F), H = Z($); { let M = /* @__PURE__ */ C(() => c(l).nameDisabled === !0); ft(H, { @@ -24588,7 +24588,7 @@ function Mv(t, e) { }); } W($); - var N = z($, 2), k = Z(N); + var N = V($, 2), k = Z(N); { var D = (M) => { ft(M, { @@ -24599,44 +24599,44 @@ function Mv(t, e) { oninput: (Y) => m("value", Y) }); }, P = (M) => { - var Y = de(), U = J(Y); + var Y = de(), G = J(Y); { - var V = (q) => { + var z = (j) => { { - let F = /* @__PURE__ */ C(() => [c(l).ref]); - _t(q, { + let B = /* @__PURE__ */ C(() => [c(l).ref]); + _t(j, { get items() { return _.current; }, style: "width: 100%", defaultValue: ["ref"], get value() { - return c(F); + return c(B); }, expandAll: !0, onSelect: y }); } - }, j = (q) => { - var F = de(), Q = J(F); + }, Q = (j) => { + var B = de(), te = J(B); { - var X = (re) => { - ft(re, { placeholder: "在执行期间,由用户输入", disabled: !0 }); + var q = (ee) => { + ft(ee, { placeholder: "在执行期间,由用户输入", disabled: !0 }); }; ie( - Q, - (re) => { - c(l).refType === "form" && re(X); + te, + (ee) => { + c(l).refType === "form" && ee(q); }, !0 ); } - O(q, F); + O(j, B); }; ie( - U, - (q) => { - c(l).refType === "ref" ? q(V) : q(j, !1); + G, + (j) => { + c(l).refType === "ref" ? j(z) : j(Q, !1); }, !0 ); @@ -24648,34 +24648,34 @@ function Mv(t, e) { }); } W(N); - var A = z(N, 2), R = Z(A); + var A = V(N, 2), R = Z(A); return Nt( - jr(R, { + Xr(R, { placement: "bottom", floating: (Y) => { - var U = BC(), V = Z(U), j = z(Z(V)); + var G = BC(), z = Z(G), Q = V(Z(z)); { - let ve = /* @__PURE__ */ C(() => c(l).refType ? [c(l).refType] : []); - _t(j, { + let fe = /* @__PURE__ */ C(() => c(l).refType ? [c(l).refType] : []); + _t(Q, { get items() { return T; }, style: "width: 100%", defaultValue: ["ref"], get value() { - return c(ve); + return c(fe); }, onSelect: w }); } - W(V); - var q = z(V, 2); + W(z); + var j = V(z, 2); { - var F = (ve) => { - var ae = zC(), le = z(Z(ae)); + var B = (fe) => { + var le = zC(), ae = V(Z(le)); { let oe = /* @__PURE__ */ C(() => c(l).contentType ? [c(l).contentType] : []); - _t(le, { + _t(ae, { get items() { return eu; }, @@ -24687,18 +24687,18 @@ function Mv(t, e) { onSelect: b }); } - W(ae), O(ve, ae); + W(le), O(fe, le); }; - ie(q, (ve) => { - (s() || c(l).refType === "form") && ve(F); + ie(j, (fe) => { + (s() || c(l).refType === "form") && fe(B); }); } - var Q = z(q, 2); + var te = V(j, 2); { - var X = (ve) => { - var ae = FC(), le = J(ae), oe = z(Z(le)); + var q = (fe) => { + var le = FC(), ae = J(le), oe = V(Z(ae)); { - let Pe = /* @__PURE__ */ C(() => c(l).formType ? [c(l).formType] : []); + let Ee = /* @__PURE__ */ C(() => c(l).formType ? [c(l).formType] : []); _t(oe, { get items() { return c(d); @@ -24706,25 +24706,25 @@ function Mv(t, e) { style: "width: 100%", defaultValue: ["input"], get value() { - return c(Pe); + return c(Ee); }, onSelect: S }); } - W(le); - var fe = z(le, 2), we = z(Z(fe)); - Qn(we), we.__change = (Pe) => { - const Xe = Pe.target.checked; + W(ae); + var he = V(ae, 2), we = V(Z(he)); + Qn(we), we.__change = (Ee) => { + const Xe = Ee.target.checked; p("required", Xe); - }, W(fe); - var xe = z(fe, 2); + }, W(he); + var _e = V(he, 2); { - var pe = (Pe) => { - var Xe = RC(), je = z(Z(Xe)); + var ve = (Ee) => { + var Xe = RC(), Ue = V(Z(Xe)); { - let Ke = /* @__PURE__ */ C(() => c(l).enums?.join(` + let We = /* @__PURE__ */ C(() => c(l).enums?.join(` `)); - qe(je, { + je(Ue, { rows: 3, style: "width: 100%;", onchange: (rt) => { @@ -24732,90 +24732,90 @@ function Mv(t, e) { `)); }, get value() { - return c(Ke); + return c(We); }, placeholder: "一行一个选项" }); } - W(Xe), O(Pe, Xe); + W(Xe), O(Ee, Xe); }; - ie(xe, (Pe) => { - c(f) && (c(l).formType === "radio" || c(l).formType === "checkbox" || c(l).formType === "select") && Pe(pe); + ie(_e, (Ee) => { + c(f) && (c(l).formType === "radio" || c(l).formType === "checkbox" || c(l).formType === "select") && Ee(ve); }); } - var me = z(xe, 2), Ee = z(Z(me)); - qe(Ee, { + var ye = V(_e, 2), Ne = V(Z(ye)); + je(Ne, { rows: 1, placeholder: "请输入数据标题", style: "width: 100%;", - onchange: (Pe) => { - m("formLabel", Pe); + onchange: (Ee) => { + m("formLabel", Ee); }, get value() { return c(l).formLabel; } - }), W(me); - var G = z(me, 2), Ue = z(Z(G)); - qe(Ue, { + }), W(ye); + var U = V(ye, 2), Ye = V(Z(U)); + je(Ye, { rows: 2, placeholder: "请输入数据描述", style: "width: 100%;", - onchange: (Pe) => { - m("formDescription", Pe); + onchange: (Ee) => { + m("formDescription", Ee); }, get value() { return c(l).formDescription; } - }), W(G); - var be = z(G, 2), De = z(Z(be)); - qe(De, { + }), W(U); + var be = V(U, 2), Te = V(Z(be)); + je(Te, { rows: 2, placeholder: "请输入占位符内容", style: "width: 100%;", - onchange: (Pe) => { - m("formPlaceholder", Pe); + onchange: (Ee) => { + m("formPlaceholder", Ee); }, get value() { return c(l).formPlaceholder; } - }), W(be), Te(() => Ri(we, !!c(l).required)), O(ve, ae); + }), W(be), Oe(() => Ri(we, !!c(l).required)), O(fe, le); }; - ie(Q, (ve) => { - c(l).refType === "form" && ve(X); + ie(te, (fe) => { + c(l).refType === "form" && fe(q); }); } - var re = z(Q, 2), ee = z(Z(re)); - qe(ee, { + var ee = V(te, 2), X = V(Z(ee)); + je(X, { rows: 1, style: "width: 100%;", - onchange: (ve) => { - m("defaultValue", ve); + onchange: (fe) => { + m("defaultValue", fe); }, get value() { return c(l).defaultValue; }, placeholder: "请输入参数默认值" - }), W(re); - var L = z(re, 2), te = Z(L); - $e(te, { + }), W(ee); + var L = V(ee, 2), ne = Z(L); + Fe(ne, { variant: "destructive", onclick: x, - children: (ve, ae) => { + children: (fe, le) => { Se(); - var le = Me("删除"); - O(ve, le); + var ae = Ie("删除"); + O(fe, ae); }, $$slots: { default: !0 } - }), W(L), W(U), O(Y, U); + }), W(L), W(G), O(Y, G); }, - children: (Y, U) => { + children: (Y, G) => { Si(Y, {}); }, $$slots: { floating: !0, default: !0 } }), (Y) => E = Y, () => E - ), W(A), O(t, B), ce(I); + ), W(A), O(t, F), ce(I); } Sr(["change"]); se( @@ -24831,14 +24831,14 @@ se( [], !0 ); -var WC = /* @__PURE__ */ ne('
参数名称
参数值
', 1), ZC = /* @__PURE__ */ ne('
'), YC = /* @__PURE__ */ ne('
'); -const qC = { +var WC = /* @__PURE__ */ re('
参数名称
参数值
', 1), ZC = /* @__PURE__ */ re('
'), qC = /* @__PURE__ */ re('
'); +const YC = { hash: "svelte-32f1pk", code: `.input-container.svelte-32f1pk {display:grid;grid-template-columns:40% 50% 10%;row-gap:5px;column-gap:3px;}.input-container.svelte-32f1pk .none-params:where(.svelte-32f1pk) {font-size:12px;background:var(--tf-secondary);height:20px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1; /* 从第一列开始到最后一列结束 */}.input-container.svelte-32f1pk .input-header:where(.svelte-32f1pk) {font-size:12px;color:var(--tf-muted-foreground);}` }; -function zt(t, e) { - ue(e, !0), Je(t, qC); +function It(t, e) { + ue(e, !0), Je(t, YC); const n = v(e, "noneParameterText", 7, "无输入参数"), r = v(e, "dataKeyName", 7, "parameters"), o = v(e, "useChildrenOnly", 7), i = v(e, "showContentType", 7, !1); let s = vt(), a = cr(s), u = /* @__PURE__ */ C(() => [...a?.current?.data?.[r()] || []]); var l = { @@ -24866,7 +24866,7 @@ function zt(t, e) { set showContentType(m = !1) { i(m), g(); } - }, d = YC(), f = Z(d); + }, d = qC(), f = Z(d); { var h = (m) => { var y = WC(); @@ -24876,7 +24876,7 @@ function zt(t, e) { c(u).length !== 0 && m(h); }); } - var p = z(f, 2); + var p = V(f, 2); return Ct( p, 19, @@ -24903,12 +24903,12 @@ function zt(t, e) { }, (m) => { var y = ZC(), w = Z(y, !0); - W(y), Te(() => tt(w, n())), O(m, y); + W(y), Oe(() => tt(w, n())), O(m, y); } ), W(d), O(t, d), ce(l); } se( - zt, + It, { noneParameterText: {}, dataKeyName: {}, @@ -24919,7 +24919,7 @@ se( [], !0 ); -var XC = /* @__PURE__ */ _e(''), jC = /* @__PURE__ */ _e(''), UC = /* @__PURE__ */ ne('
', 1); +var jC = /* @__PURE__ */ xe(''), XC = /* @__PURE__ */ xe(''), UC = /* @__PURE__ */ re('
', 1); const GC = { hash: "svelte-1fiuxu3", code: ".heading.svelte-1fiuxu3 {display:flex;margin-bottom:10px;}" @@ -24946,22 +24946,22 @@ function Lv(t, e) { allowExecute: !1, showSourceHandle: !1, icon: (u) => { - var l = XC(); + var l = jC(); O(u, l); }, children: (u, l) => { var d = UC(), f = J(d), h = Z(f); - We(h, { + Ke(h, { level: 3, children: (y, w) => { Se(); - var b = Me("输出参数"); + var b = Ie("输出参数"); O(y, b); }, $$slots: { default: !0 } }); - var p = z(h, 2); - $e(p, { + var p = V(h, 2); + Fe(p, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", @@ -24969,13 +24969,13 @@ function Lv(t, e) { i(o, "outputDefs", { name: "output" }); }, children: (y, w) => { - var b = jC(); + var b = XC(); O(y, b); }, $$slots: { default: !0 } }), W(f); - var m = z(f, 2); - zt(m, { + var m = V(f, 2); + It(m, { noneParameterText: "无输出参数", dataKeyName: "outputDefs", showContentType: !0 @@ -24986,7 +24986,7 @@ function Lv(t, e) { )), ce(s); } se(Lv, { data: {} }, [], [], !0); -var JC = /* @__PURE__ */ _e(''), QC = /* @__PURE__ */ ne('
'), e3 = /* @__PURE__ */ ne('
默认值:
参数描述:
'), t3 = /* @__PURE__ */ ne('
', 1); +var JC = /* @__PURE__ */ xe(''), QC = /* @__PURE__ */ re('
'), e3 = /* @__PURE__ */ re('
默认值:
参数描述:
'), t3 = /* @__PURE__ */ re('
', 1); const n3 = { hash: "svelte-hwmib9", code: ".input-item.svelte-hwmib9 {display:flex;align-items:center;gap:2px;}.input-more-setting.svelte-hwmib9 {display:flex;flex-direction:column;gap:10px;padding:10px;background:var(--tf-background);border:1px solid var(--tf-border);border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.input-more-setting.svelte-hwmib9 .input-more-item:where(.svelte-hwmib9) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--tf-muted-foreground);}" @@ -25097,7 +25097,7 @@ function Hv(t, e) { }); } W(S); - var x = z(S, 2), _ = Z(x); + var x = V(S, 2), _ = Z(x); { let H = /* @__PURE__ */ C(() => c(u).dataTypeItems || _b), N = /* @__PURE__ */ C(() => c(u).dataType ? [c(u).dataType] : []), k = /* @__PURE__ */ C(() => c(u).dataTypeDisabled === !0); _t(_, { @@ -25115,10 +25115,10 @@ function Hv(t, e) { onSelect: h }); } - var T = z(_, 2); + var T = V(_, 2); { var I = (H) => { - $e(H, { + Fe(H, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", @@ -25135,58 +25135,58 @@ function Hv(t, e) { }); } W(x); - var B = z(x, 2), $ = Z(B); + var F = V(x, 2), $ = Z(F); return Nt( - jr($, { + Xr($, { placement: "bottom", floating: (N) => { - var k = e3(), D = Z(k), P = z(Z(D)); + var k = e3(), D = Z(k), P = V(Z(D)); { - let U = /* @__PURE__ */ C(() => c(u).defaultValue || ""); - qe(P, { + let G = /* @__PURE__ */ C(() => c(u).defaultValue || ""); + je(P, { rows: 1, style: "width: 100%;", get value() { - return c(U); + return c(G); }, - onchange: (V) => { - f("defaultValue", V); + onchange: (z) => { + f("defaultValue", z); } }); } W(D); - var A = z(D, 2), R = z(Z(A)); + var A = V(D, 2), R = V(Z(A)); { - let U = /* @__PURE__ */ C(() => c(u).description || ""); - qe(R, { + let G = /* @__PURE__ */ C(() => c(u).description || ""); + je(R, { rows: 3, style: "width: 100%;", get value() { - return c(U); + return c(G); }, - onchange: (V) => { - f("description", V); + onchange: (z) => { + f("description", z); } }); } W(A); - var M = z(A, 2); + var M = V(A, 2); { - var Y = (U) => { - var V = QC(), j = Z(V); - $e(j, { + var Y = (G) => { + var z = QC(), Q = Z(z); + Fe(Q, { variant: "destructive", onclick: m, - children: (q, F) => { + children: (j, B) => { Se(); - var Q = Me("删除"); - O(q, Q); + var te = Ie("删除"); + O(j, te); }, $$slots: { default: !0 } - }), W(V), O(U, V); + }), W(z), O(G, z); }; - ie(M, (U) => { - c(u).deleteDisabled !== !0 && U(Y); + ie(M, (G) => { + c(u).deleteDisabled !== !0 && G(Y); }); } W(k), O(N, k); @@ -25198,7 +25198,7 @@ function Hv(t, e) { }), (N) => p = N, () => p - ), W(B), O(t, b), ce(w); + ), W(F), O(t, b), ce(w); } se( Hv, @@ -25212,7 +25212,7 @@ se( [], !0 ); -var r3 = /* @__PURE__ */ ne(" ", 1), o3 = /* @__PURE__ */ ne('
'), i3 = /* @__PURE__ */ ne('
参数名称
参数类型
', 1), s3 = /* @__PURE__ */ ne('
'); +var r3 = /* @__PURE__ */ re(" ", 1), o3 = /* @__PURE__ */ re('
'), i3 = /* @__PURE__ */ re('
参数名称
参数类型
', 1), s3 = /* @__PURE__ */ re('
'); const a3 = { hash: "svelte-1oz5kx0", code: `.input-container.svelte-1oz5kx0 {display:grid;grid-template-columns:40% 50% 10%;row-gap:5px;column-gap:3px;}.input-container.svelte-1oz5kx0 .none-params:where(.svelte-1oz5kx0) {font-size:12px;background:var(--tf-secondary);height:40px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1; @@ -25246,7 +25246,7 @@ function dr(t, e) { } }); } - var B = z(I, 2); + var F = V(I, 2); { var $ = (H) => { { @@ -25254,7 +25254,7 @@ function dr(t, e) { n(H, () => c(x).children, () => c(N)); } }; - ie(B, (H) => { + ie(F, (H) => { c(x).children && H($); }); } @@ -25264,8 +25264,8 @@ function dr(t, e) { var x = de(), _ = J(x); { var T = (I) => { - var B = o3(), $ = Z(B, !0); - W(B), Te(() => tt($, r())), O(I, B); + var F = o3(), $ = Z(F, !0); + W(F), Oe(() => tt($, r())), O(I, F); }; ie(_, (I) => { w().length === 0 && I(T); @@ -25305,21 +25305,21 @@ function dr(t, e) { c(u).length !== 0 && m(h); }); } - var p = z(f, 2); + var p = V(f, 2); return n(p, () => c(u) || [], () => []), W(d), O(t, d), ce(l); } se(dr, { noneParameterText: {}, dataKeyName: {}, placeholder: {} }, [], [], !0); -var l3 = /* @__PURE__ */ _e(''), u3 = /* @__PURE__ */ _e(''), c3 = /* @__PURE__ */ _e(''), d3 = /* @__PURE__ */ ne('
采样参数
'), f3 = /* @__PURE__ */ ne('
JSON Schema
', 1), h3 = /* @__PURE__ */ ne('
模型
系统提示词
用户提示词
', 1); -const g3 = { +var l3 = /* @__PURE__ */ xe(''), u3 = /* @__PURE__ */ xe(''), c3 = /* @__PURE__ */ xe(''), d3 = /* @__PURE__ */ xe(''), f3 = /* @__PURE__ */ re('
采样参数
'), h3 = /* @__PURE__ */ re('
JSON Schema
', 1), g3 = /* @__PURE__ */ re('
模型
系统提示词
用户提示词
', 1); +const v3 = { hash: "svelte-j81vcl", - code: `.heading.svelte-j81vcl {display:flex;align-items:center;margin-bottom:10px;}.setting-title.svelte-j81vcl {font-size:12px;color:var(--tf-secondary-foreground);margin-bottom:4px;margin-top:10px;}.setting-item.svelte-j81vcl {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;} - + code: `.heading.svelte-j81vcl {display:flex;align-items:center;margin-bottom:10px;}.setting-title.svelte-j81vcl {font-size:12px;color:var(--tf-secondary-foreground);margin-bottom:4px;margin-top:10px;}.setting-item.svelte-j81vcl {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}\r +\r /* 新增样式 */.slider-container.svelte-j81vcl {width:100%;display:flex;flex-direction:column;gap:4px;}.slider-container.svelte-j81vcl span:where(.svelte-j81vcl) {font-size:12px;color:var(--tf-muted-foreground);display:flex;justify-content:space-between;align-items:center;}.llm-setting.svelte-j81vcl {width:200px;background:var(--tf-background);padding:10px;border-radius:5px;box-shadow:0 0 10px rgba(0, 0, 0, 0.1);border:1px solid var(--tf-border);}input[type='range'].svelte-j81vcl {width:100%;height:4px;background:var(--tf-muted);border-radius:2px;outline:none;-webkit-appearance:none;}input[type='range'].svelte-j81vcl::-webkit-slider-thumb {-webkit-appearance:none;width:14px;height:14px;background:var(--tf-primary);border-radius:50%;cursor:pointer;}` }; function Vv(t, e) { - ue(e, !0), Je(t, g3); + ue(e, !0), Je(t, v3); const n = v(e, "data", 7), r = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = vt(), { addParameter: i } = kn(), s = vn(); - let a = /* @__PURE__ */ ye(ht([])); + let a = /* @__PURE__ */ me(ht([])); _n(async () => { const f = await s.provider?.llm?.(); c(a).push(...f || []); @@ -25372,197 +25372,223 @@ function Vv(t, e) { O(h, p); }, children: (h, p) => { - var m = h3(), y = J(m), w = Z(y); - We(w, { + var m = g3(), y = J(m), w = Z(y); + Ke(w, { level: 3, - children: (j, q) => { + children: (q, ee) => { Se(); - var F = Me("输入参数"); - O(j, F); + var X = Ie("输入参数"); + O(q, X); }, $$slots: { default: !0 } }); - var b = z(w, 2); - $e(b, { + var b = V(w, 2); + Fe(b, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o); }, - children: (j, q) => { - var F = u3(); - O(j, F); + children: (q, ee) => { + var X = u3(); + O(q, X); }, $$slots: { default: !0 } }), W(y); - var S = z(y, 2); - zt(S, {}); - var E = z(S, 2), x = Z(E); - We(x, { + var S = V(y, 2); + It(S, {}); + var E = V(S, 2), x = Z(E); + Ke(x, { level: 3, - children: (j, q) => { + children: (q, ee) => { Se(); - var F = Me("图片识别"); - O(j, F); + var X = Ie("图片识别"); + O(q, X); }, $$slots: { default: !0 } }); - var _ = z(x, 2); - $e(_, { + var _ = V(x, 2); + Fe(_, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o, "images"); }, - children: (j, q) => { - var F = c3(); - O(j, F); + children: (q, ee) => { + var X = c3(); + O(q, X); }, $$slots: { default: !0 } }), W(E); - var T = z(E, 2); - zt(T, { dataKeyName: "images", noneParameterText: "无图片参数" }); - var I = z(T, 2); - We(I, { + var T = V(E, 2); + It(T, { dataKeyName: "images", noneParameterText: "无图片参数" }); + var I = V(T, 2), F = Z(I); + Ke(F, { + level: 3, + children: (q, ee) => { + Se(); + var X = Ie("视频识别"); + O(q, X); + }, + $$slots: { default: !0 } + }); + var $ = V(F, 2); + Fe($, { + size: "icon-xs", + class: "input-btn-more", + style: "margin-left: auto", + onclick: () => { + i(o, "videos"); + }, + children: (q, ee) => { + var X = d3(); + O(q, X); + }, + $$slots: { default: !0 } + }), W(I); + var H = V(I, 2); + It(H, { dataKeyName: "videos", noneParameterText: "无视频参数" }); + var N = V(H, 2); + Ke(N, { level: 3, mt: "10px", - children: (j, q) => { + children: (q, ee) => { Se(); - var F = Me("模型设置"); - O(j, F); + var X = Ie("模型设置"); + O(q, X); }, $$slots: { default: !0 } }); - var B = z(I, 4), $ = Z(B); + var k = V(N, 4), D = Z(k); { - let j = /* @__PURE__ */ C(() => n().llmId ? [n().llmId] : []); - _t($, { + let q = /* @__PURE__ */ C(() => n().llmId ? [n().llmId] : []); + _t(D, { get items() { return c(a); }, style: "width: 100%", placeholder: "请选择模型", - onSelect: (q) => { - const F = q.value; - u(o, () => ({ llmId: F })); + onSelect: (ee) => { + const X = ee.value; + u(o, () => ({ llmId: X })); }, get value() { - return c(j); + return c(q); } }); } - var H = z($, 2); - jr(H, { + var P = V(D, 2); + Xr(P, { placement: "bottom", - floating: (q) => { - var F = d3(), Q = z(Z(F), 2), X = Z(Q), re = Z(X), ee = Z(re); - W(re); - var L = z(re, 2); - Qn(L), L.__input = (Ee) => u(o, { temperature: parseFloat(Ee.target.value) }), W(X), W(Q); - var te = z(Q, 2), ve = Z(te), ae = Z(ve), le = Z(ae); - W(ae); - var oe = z(ae, 2); - Qn(oe), oe.__input = (Ee) => u(o, { topP: parseFloat(Ee.target.value) }), W(ve), W(te); - var fe = z(te, 2), we = Z(fe), xe = Z(we), pe = Z(xe); - W(xe); - var me = z(xe, 2); - Qn(me), me.__input = (Ee) => u(o, { topK: parseInt(Ee.target.value) }), W(we), W(fe), W(F), Te(() => { - tt(ee, `Temperature: ${n().temperature ?? 0.5 ?? ""}`), zi(L, n().temperature ?? 0.5), tt(le, `Top P: ${n().topP ?? 0.9 ?? ""}`), zi(oe, n().topP ?? 0.9), tt(pe, `Top K: ${n().topK ?? 50 ?? ""}`), zi(me, n().topK ?? 50); - }), O(q, F); + floating: (ee) => { + var X = f3(), L = V(Z(X), 2), ne = Z(L), fe = Z(ne), le = Z(fe); + W(fe); + var ae = V(fe, 2); + Qn(ae), ae.__input = (Te) => u(o, { temperature: parseFloat(Te.target.value) }), W(ne), W(L); + var oe = V(L, 2), he = Z(oe), we = Z(he), _e = Z(we); + W(we); + var ve = V(we, 2); + Qn(ve), ve.__input = (Te) => u(o, { topP: parseFloat(Te.target.value) }), W(he), W(oe); + var ye = V(oe, 2), Ne = Z(ye), U = Z(Ne), Ye = Z(U); + W(U); + var be = V(U, 2); + Qn(be), be.__input = (Te) => u(o, { topK: parseInt(Te.target.value) }), W(Ne), W(ye), W(X), Oe(() => { + tt(le, `Temperature: ${n().temperature ?? 0.5 ?? ""}`), zi(ae, n().temperature ?? 0.5), tt(_e, `Top P: ${n().topP ?? 0.9 ?? ""}`), zi(ve, n().topP ?? 0.9), tt(Ye, `Top K: ${n().topK ?? 50 ?? ""}`), zi(be, n().topK ?? 50); + }), O(ee, X); }, - children: (q, F) => { - Si(q, {}); + children: (ee, X) => { + Si(ee, {}); }, $$slots: { floating: !0, default: !0 } - }), W(B); - var N = z(B, 4), k = Z(N); + }), W(k); + var A = V(k, 4), R = Z(A); { - let j = /* @__PURE__ */ C(() => n().systemPrompt || ""); - qe(k, { + let q = /* @__PURE__ */ C(() => n().systemPrompt || ""); + je(R, { rows: 5, placeholder: "请输入系统提示词", style: "width: 100%", get value() { - return c(j); + return c(q); }, - oninput: (q) => { - u(o, { systemPrompt: q.target.value }); + oninput: (ee) => { + u(o, { systemPrompt: ee.target.value }); } }); } - W(N); - var D = z(N, 4), P = Z(D); + W(A); + var M = V(A, 4), Y = Z(M); { - let j = /* @__PURE__ */ C(() => n().userPrompt || ""); - qe(P, { + let q = /* @__PURE__ */ C(() => n().userPrompt || ""); + je(Y, { rows: 5, placeholder: "请输入用户提示词", style: "width: 100%", get value() { - return c(j); + return c(q); }, - oninput: (q) => { - u(o, { userPrompt: q.target.value }); + oninput: (ee) => { + u(o, { userPrompt: ee.target.value }); } }); } - W(D); - var A = z(D, 2); + W(M); + var G = V(M, 2); { - var R = (j) => { - var q = f3(), F = z(J(q), 2), Q = Z(F); + var z = (q) => { + var ee = h3(), X = V(J(ee), 2), L = Z(X); { - let X = /* @__PURE__ */ C(() => n().jsonSchema || ""); - qe(Q, { + let ne = /* @__PURE__ */ C(() => n().jsonSchema || ""); + je(L, { rows: 5, placeholder: "请输入 SON Schema", style: "width: 100%", get value() { - return c(X); + return c(ne); }, - oninput: (re) => { - u(o, { jsonSchema: re.target.value }); + oninput: (fe) => { + u(o, { jsonSchema: fe.target.value }); } }); } - W(F), O(j, q); + W(X), O(q, ee); }; - ie(A, (j) => { - n().outType === "json" && j(R); + ie(G, (q) => { + n().outType === "json" && q(z); }); } - var M = z(A, 2), Y = Z(M); - We(Y, { + var Q = V(G, 2), j = Z(Q); + Ke(j, { level: 3, - children: (j, q) => { + children: (q, ee) => { Se(); - var F = Me("输出参数"); - O(j, F); + var X = Ie("输出参数"); + O(q, X); }, $$slots: { default: !0 } }); - var U = z(Y, 2); + var B = V(j, 2); { - let j = /* @__PURE__ */ C(() => n().outType ? [n().outType] : []); - _t(U, { + let q = /* @__PURE__ */ C(() => n().outType ? [n().outType] : []); + _t(B, { class: "tf-select-xs", items: [ { label: "文本", value: "text" }, { label: "JSON", value: "json" } ], - onSelect: (q) => { - l(q.value); + onSelect: (ee) => { + l(ee.value); }, get value() { - return c(j); + return c(q); } }); } - W(M); - var V = z(M, 2); - dr(V, {}), O(h, m); + W(Q); + var te = V(Q, 2); + dr(te, {}), O(h, m); }, $$slots: { icon: !0, default: !0 } } @@ -25570,13 +25596,13 @@ function Vv(t, e) { } Sr(["input"]); se(Vv, { data: {} }, [], [], !0); -var v3 = /* @__PURE__ */ _e(''), p3 = /* @__PURE__ */ _e(''), m3 = /* @__PURE__ */ _e(''), y3 = /* @__PURE__ */ ne('
执行引擎
执行代码
', 1); -const w3 = { +var p3 = /* @__PURE__ */ xe(''), m3 = /* @__PURE__ */ xe(''), y3 = /* @__PURE__ */ xe(''), w3 = /* @__PURE__ */ re('
执行引擎
执行代码
', 1); +const b3 = { hash: "svelte-1wcsayx", code: ".heading.svelte-1wcsayx {display:flex;margin-bottom:10px;}.setting-title.svelte-1wcsayx {font-size:12px;color:var(--tf-secondary-foreground);margin-bottom:4px;margin-top:10px;}.setting-item.svelte-1wcsayx {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}" }; function zv(t, e) { - ue(e, !0), Je(t, w3); + ue(e, !0), Je(t, b3); const n = v(e, "data", 7), r = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host", "data"]); _n(() => { n().engine || s(o, () => ({ engine: "qlexpress" })); @@ -25603,22 +25629,22 @@ function zv(t, e) { () => r, { icon: (d) => { - var f = v3(); + var f = p3(); O(d, f); }, children: (d, f) => { - var h = y3(), p = J(h), m = Z(p); - We(m, { + var h = w3(), p = J(h), m = Z(p); + Ke(m, { level: 3, children: (H, N) => { Se(); - var k = Me("输入参数"); + var k = Ie("输入参数"); O(H, k); }, $$slots: { default: !0 } }); - var y = z(m, 2); - $e(y, { + var y = V(m, 2); + Fe(y, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", @@ -25626,25 +25652,25 @@ function zv(t, e) { i(o); }, children: (H, N) => { - var k = p3(); + var k = m3(); O(H, k); }, $$slots: { default: !0 } }), W(p); - var w = z(p, 2); - zt(w, {}); - var b = z(w, 2); - We(b, { + var w = V(p, 2); + It(w, {}); + var b = V(w, 2); + Ke(b, { level: 3, mt: "10px", children: (H, N) => { Se(); - var k = Me("代码"); + var k = Ie("代码"); O(H, k); }, $$slots: { default: !0 } }); - var S = z(b, 4), E = Z(S); + var S = V(b, 4), E = Z(S); { let H = /* @__PURE__ */ C(() => n().engine ? [n().engine] : ["qlexpress"]); _t(E, { @@ -25663,10 +25689,10 @@ function zv(t, e) { }); } W(S); - var x = z(S, 4), _ = Z(x); + var x = V(S, 4), _ = Z(x); { let H = /* @__PURE__ */ C(() => n().code || ""); - qe(_, { + je(_, { rows: 10, placeholder: "请输入执行代码,注:输出内容需添加到_result中,如:_result['key'] = value 或者 _result.key = value", style: "width: 100%", @@ -25679,19 +25705,19 @@ function zv(t, e) { }); } W(x); - var T = z(x, 2), I = Z(T); - We(I, { + var T = V(x, 2), I = Z(T); + Ke(I, { level: 3, mt: "10px", children: (H, N) => { Se(); - var k = Me("输出参数"); + var k = Ie("输出参数"); O(H, k); }, $$slots: { default: !0 } }); - var B = z(I, 2); - $e(B, { + var F = V(I, 2); + Fe(F, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", @@ -25699,12 +25725,12 @@ function zv(t, e) { i(o, "outputDefs"); }, children: (H, N) => { - var k = m3(); + var k = y3(); O(H, k); }, $$slots: { default: !0 } }), W(T); - var $ = z(T, 2); + var $ = V(T, 2); dr($, {}), O(d, h); }, $$slots: { icon: !0, default: !0 } @@ -25712,13 +25738,13 @@ function zv(t, e) { )), ce(u); } se(zv, { data: {} }, [], [], !0); -var b3 = /* @__PURE__ */ _e(''), x3 = /* @__PURE__ */ _e(''), _3 = /* @__PURE__ */ ne('
', 1); -const C3 = { +var x3 = /* @__PURE__ */ xe(''), _3 = /* @__PURE__ */ xe(''), C3 = /* @__PURE__ */ re('
', 1); +const S3 = { hash: "svelte-1lcrzpc", code: ".heading.svelte-1lcrzpc {display:flex;margin-bottom:10px;}.setting-item.svelte-1lcrzpc {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}" }; function Rv(t, e) { - ue(e, !0), Je(t, C3); + ue(e, !0), Je(t, S3); const n = v(e, "data", 7), r = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = vt(), { addParameter: i } = kn(), { updateNodeData: s } = wt(); He(() => { (!n().outputDefs || n().outputDefs.length === 0) && i(o, "outputDefs", { @@ -25745,22 +25771,22 @@ function Rv(t, e) { () => r, { icon: (l) => { - var d = b3(); + var d = x3(); O(l, d); }, children: (l, d) => { - var f = _3(), h = J(f), p = Z(h); - We(p, { + var f = C3(), h = J(f), p = Z(h); + Ke(p, { level: 3, children: (T, I) => { Se(); - var B = Me("输入参数"); - O(T, B); + var F = Ie("输入参数"); + O(T, F); }, $$slots: { default: !0 } }); - var m = z(p, 2); - $e(m, { + var m = V(p, 2); + Fe(m, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", @@ -25768,29 +25794,29 @@ function Rv(t, e) { i(o); }, children: (T, I) => { - var B = x3(); - O(T, B); + var F = _3(); + O(T, F); }, $$slots: { default: !0 } }), W(h); - var y = z(h, 2); - zt(y, {}); - var w = z(y, 2); - We(w, { + var y = V(h, 2); + It(y, {}); + var w = V(y, 2); + Ke(w, { level: 3, mt: "10px", mb: "10px", children: (T, I) => { Se(); - var B = Me("模板内容"); - O(T, B); + var F = Ie("模板内容"); + O(T, F); }, $$slots: { default: !0 } }); - var b = z(w, 2), S = Z(b); + var b = V(w, 2), S = Z(b); { let T = /* @__PURE__ */ C(() => n().template || ""); - qe(S, { + je(S, { rows: 10, placeholder: "请输入模板内容", style: "width: 100%", @@ -25803,18 +25829,18 @@ function Rv(t, e) { }); } W(b); - var E = z(b, 2), x = Z(E); - We(x, { + var E = V(b, 2), x = Z(E); + Ke(x, { level: 3, mt: "10px", children: (T, I) => { Se(); - var B = Me("输出参数"); - O(T, B); + var F = Ie("输出参数"); + O(T, F); }, $$slots: { default: !0 } }), W(E); - var _ = z(E, 2); + var _ = V(E, 2); dr(_, {}), O(l, f); }, $$slots: { icon: !0, default: !0 } @@ -25822,13 +25848,13 @@ function Rv(t, e) { )), ce(a); } se(Rv, { data: {} }, [], [], !0); -var S3 = /* @__PURE__ */ _e(''), k3 = /* @__PURE__ */ _e(''), E3 = /* @__PURE__ */ _e(''), P3 = /* @__PURE__ */ ne('
', 1), N3 = /* @__PURE__ */ _e(''), T3 = /* @__PURE__ */ ne('
', 1), O3 = /* @__PURE__ */ _e(''), A3 = /* @__PURE__ */ ne('
', 1), D3 = /* @__PURE__ */ ne('
'), I3 = /* @__PURE__ */ ne('
'), M3 = /* @__PURE__ */ _e(''), L3 = /* @__PURE__ */ ne('
', 1); -const H3 = { +var k3 = /* @__PURE__ */ xe(''), E3 = /* @__PURE__ */ xe(''), P3 = /* @__PURE__ */ xe(''), N3 = /* @__PURE__ */ re('
', 1), T3 = /* @__PURE__ */ xe(''), O3 = /* @__PURE__ */ re('
', 1), A3 = /* @__PURE__ */ xe(''), D3 = /* @__PURE__ */ re('
', 1), I3 = /* @__PURE__ */ re('
'), M3 = /* @__PURE__ */ re('
'), L3 = /* @__PURE__ */ xe(''), H3 = /* @__PURE__ */ re('
', 1); +const V3 = { hash: "svelte-19uflw6", code: ".heading.svelte-19uflw6 {display:flex;margin-bottom:10px;}.radio-group.svelte-19uflw6 {display:flex;margin:10px 0;flex-wrap:wrap;gap:8px;}.radio-group.svelte-19uflw6 label:where(.svelte-19uflw6) {display:flex;font-size:14px;box-sizing:border-box;gap:4px;}" }; function Fv(t, e) { - ue(e, !0), Je(t, H3); + ue(e, !0), Je(t, V3); const n = v(e, "data", 7), r = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host", "data"]); _n(() => { n().method || a(i, () => ({ method: "get" })), n().outputDefs || s(i, "outputDefs", [ @@ -25879,274 +25905,274 @@ function Fv(t, e) { () => r, { icon: (d) => { - var f = S3(); + var f = k3(); O(d, f); }, children: (d, f) => { - var h = L3(), p = J(h), m = Z(p); - We(m, { + var h = H3(), p = J(h), m = Z(p); + Ke(m, { level: 3, - children: (X, re) => { + children: (q, ee) => { Se(); - var ee = Me("输入参数"); - O(X, ee); + var X = Ie("输入参数"); + O(q, X); }, $$slots: { default: !0 } }); - var y = z(m, 2); - $e(y, { + var y = V(m, 2); + Fe(y, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", onclick: () => { s(i); }, - children: (X, re) => { - var ee = k3(); - O(X, ee); + children: (q, ee) => { + var X = E3(); + O(q, X); }, $$slots: { default: !0 } }), W(p); - var w = z(p, 2); - zt(w, {}); - var b = z(w, 2); - We(b, { + var w = V(p, 2); + It(w, {}); + var b = V(w, 2); + Ke(b, { level: 3, mt: "10px", - children: (X, re) => { + children: (q, ee) => { Se(); - var ee = Me("URL 地址"); - O(X, ee); + var X = Ie("URL 地址"); + O(q, X); }, $$slots: { default: !0 } }); - var S = z(b, 2), E = Z(S), x = Z(E); + var S = V(b, 2), E = Z(S), x = Z(E); { - let X = /* @__PURE__ */ C(() => n().method ? [n().method] : ["get"]); + let q = /* @__PURE__ */ C(() => n().method ? [n().method] : ["get"]); _t(x, { get items() { return o; }, style: "width: 100%", placeholder: "请选择请求方式", - onSelect: (re) => { - const ee = re.value; - a(i, () => ({ method: ee })); + onSelect: (ee) => { + const X = ee.value; + a(i, () => ({ method: X })); }, get value() { - return c(X); + return c(q); } }); } W(E); - var _ = z(E, 2), T = Z(_); + var _ = V(E, 2), T = Z(_); { - let X = /* @__PURE__ */ C(() => n().url || ""); + let q = /* @__PURE__ */ C(() => n().url || ""); ft(T, { placeholder: "请输入url", style: "width: 100%", - onchange: (re) => { - a(i, () => ({ url: re.target.value })); + onchange: (ee) => { + a(i, () => ({ url: ee.target.value })); }, get value() { - return c(X); + return c(q); } }); } W(_), W(S); - var I = z(S, 2), B = Z(I); - We(B, { + var I = V(S, 2), F = Z(I); + Ke(F, { level: 3, - children: (X, re) => { + children: (q, ee) => { Se(); - var ee = Me("Http 头信息"); - O(X, ee); + var X = Ie("Http 头信息"); + O(q, X); }, $$slots: { default: !0 } }); - var $ = z(B, 2); - $e($, { + var $ = V(F, 2); + Fe($, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", onclick: () => { s(i, "headers"); }, - children: (X, re) => { - var ee = E3(); - O(X, ee); + children: (q, ee) => { + var X = P3(); + O(q, X); }, $$slots: { default: !0 } }), W(I); - var H = z(I, 2); - zt(H, { dataKeyName: "headers" }); - var N = z(H, 2); + var H = V(I, 2); + It(H, { dataKeyName: "headers" }); + var N = V(H, 2); { - var k = (X) => { - var re = P3(), ee = J(re); - We(ee, { + var k = (q) => { + var ee = N3(), X = J(ee); + Ke(X, { level: 3, mt: "10px", - children: (Ee, G) => { + children: (Ne, U) => { Se(); - var Ue = Me("Body"); - O(Ee, Ue); + var Ye = Ie("Body"); + O(Ne, Ye); }, $$slots: { default: !0 } }); - var L = z(ee, 2), te = Z(L), ve = Z(te); + var L = V(X, 2), ne = Z(L), fe = Z(ne); { - let Ee = /* @__PURE__ */ C(() => !n().bodyType || n().bodyType === ""); - ft(ve, { + let Ne = /* @__PURE__ */ C(() => !n().bodyType || n().bodyType === ""); + ft(fe, { type: "radio", value: "", get checked() { - return c(Ee); + return c(Ne); }, - onchange: (G) => { - G.target?.checked && a(i, { bodyType: "" }); + onchange: (U) => { + U.target?.checked && a(i, { bodyType: "" }); } }); } - Se(), W(te); - var ae = z(te, 2), le = Z(ae); + Se(), W(ne); + var le = V(ne, 2), ae = Z(le); { - let Ee = /* @__PURE__ */ C(() => n().bodyType === "form-data"); - ft(le, { + let Ne = /* @__PURE__ */ C(() => n().bodyType === "form-data"); + ft(ae, { type: "radio", value: "form-data", get checked() { - return c(Ee); + return c(Ne); }, - onchange: (G) => { - G.target?.checked && a(i, { bodyType: "form-data" }); + onchange: (U) => { + U.target?.checked && a(i, { bodyType: "form-data" }); } }); } - Se(), W(ae); - var oe = z(ae, 2), fe = Z(oe); + Se(), W(le); + var oe = V(le, 2), he = Z(oe); { - let Ee = /* @__PURE__ */ C(() => n().bodyType === "x-www-form-urlencoded"); - ft(fe, { + let Ne = /* @__PURE__ */ C(() => n().bodyType === "x-www-form-urlencoded"); + ft(he, { type: "radio", value: "x-www-form-urlencoded", get checked() { - return c(Ee); + return c(Ne); }, - onchange: (G) => { - G.target?.checked && a(i, { bodyType: "x-www-form-urlencoded" }); + onchange: (U) => { + U.target?.checked && a(i, { bodyType: "x-www-form-urlencoded" }); } }); } Se(), W(oe); - var we = z(oe, 2), xe = Z(we); + var we = V(oe, 2), _e = Z(we); { - let Ee = /* @__PURE__ */ C(() => n().bodyType === "json"); - ft(xe, { + let Ne = /* @__PURE__ */ C(() => n().bodyType === "json"); + ft(_e, { type: "radio", value: "json", get checked() { - return c(Ee); + return c(Ne); }, - onchange: (G) => { - G.target?.checked && a(i, { bodyType: "json" }); + onchange: (U) => { + U.target?.checked && a(i, { bodyType: "json" }); } }); } Se(), W(we); - var pe = z(we, 2), me = Z(pe); + var ve = V(we, 2), ye = Z(ve); { - let Ee = /* @__PURE__ */ C(() => n().bodyType === "raw"); - ft(me, { + let Ne = /* @__PURE__ */ C(() => n().bodyType === "raw"); + ft(ye, { type: "radio", value: "raw", get checked() { - return c(Ee); + return c(Ne); }, - onchange: (G) => { - G.target?.checked && a(i, { bodyType: "raw" }); + onchange: (U) => { + U.target?.checked && a(i, { bodyType: "raw" }); } }); } - Se(), W(pe), W(L), O(X, re); + Se(), W(ve), W(L), O(q, ee); }; - ie(N, (X) => { - (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && X(k); + ie(N, (q) => { + (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && q(k); }); } - var D = z(N, 2); + var D = V(N, 2); { - var P = (X) => { - var re = T3(), ee = J(re), L = Z(ee); - We(L, { + var P = (q) => { + var ee = O3(), X = J(ee), L = Z(X); + Ke(L, { level: 3, - children: (ae, le) => { + children: (le, ae) => { Se(); - var oe = Me("参数"); - O(ae, oe); + var oe = Ie("参数"); + O(le, oe); }, $$slots: { default: !0 } }); - var te = z(L, 2); - $e(te, { + var ne = V(L, 2); + Fe(ne, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", onclick: () => { s(i, "formData"); }, - children: (ae, le) => { - var oe = N3(); - O(ae, oe); + children: (le, ae) => { + var oe = T3(); + O(le, oe); }, $$slots: { default: !0 } - }), W(ee); - var ve = z(ee, 2); - zt(ve, { dataKeyName: "formData" }), O(X, re); + }), W(X); + var fe = V(X, 2); + It(fe, { dataKeyName: "formData" }), O(q, ee); }; - ie(D, (X) => { - n().bodyType === "form-data" && (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && X(P); + ie(D, (q) => { + n().bodyType === "form-data" && (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && q(P); }); } - var A = z(D, 2); + var A = V(D, 2); { - var R = (X) => { - var re = A3(), ee = J(re), L = Z(ee); - We(L, { + var R = (q) => { + var ee = D3(), X = J(ee), L = Z(X); + Ke(L, { level: 3, - children: (ae, le) => { + children: (le, ae) => { Se(); - var oe = Me("Body 参数"); - O(ae, oe); + var oe = Ie("Body 参数"); + O(le, oe); }, $$slots: { default: !0 } }); - var te = z(L, 2); - $e(te, { + var ne = V(L, 2); + Fe(ne, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", onclick: () => { s(i, "formUrlencoded"); }, - children: (ae, le) => { - var oe = O3(); - O(ae, oe); + children: (le, ae) => { + var oe = A3(); + O(le, oe); }, $$slots: { default: !0 } - }), W(ee); - var ve = z(ee, 2); - zt(ve, { dataKeyName: "formUrlencoded" }), O(X, re); + }), W(X); + var fe = V(X, 2); + It(fe, { dataKeyName: "formUrlencoded" }), O(q, ee); }; - ie(A, (X) => { - n().bodyType === "x-www-form-urlencoded" && (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && X(R); + ie(A, (q) => { + n().bodyType === "x-www-form-urlencoded" && (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && q(R); }); } - var M = z(A, 2); + var M = V(A, 2); { - var Y = (X) => { - var re = D3(), ee = Z(re); - qe(ee, { + var Y = (q) => { + var ee = I3(), X = Z(ee); + je(X, { rows: 5, style: "width: 100%", placeholder: "请输入 json 信息", @@ -26156,17 +26182,17 @@ function Fv(t, e) { oninput: (L) => { a(i, { bodyJson: L.target.value }); } - }), W(re), O(X, re); + }), W(ee), O(q, ee); }; - ie(M, (X) => { - n().bodyType === "json" && (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && X(Y); + ie(M, (q) => { + n().bodyType === "json" && (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && q(Y); }); } - var U = z(M, 2); + var G = V(M, 2); { - var V = (X) => { - var re = I3(), ee = Z(re); - qe(ee, { + var z = (q) => { + var ee = M3(), X = Z(ee); + je(X, { rows: 5, style: "width: 100%", placeholder: "请输入请求信息", @@ -26176,54 +26202,54 @@ function Fv(t, e) { oninput: (L) => { a(i, { bodyRaw: L.target.value }); } - }), W(re), O(X, re); + }), W(ee), O(q, ee); }; - ie(U, (X) => { - n().bodyType === "raw" && (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && X(V); + ie(G, (q) => { + n().bodyType === "raw" && (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && q(z); }); } - var j = z(U, 2), q = Z(j); - We(q, { + var Q = V(G, 2), j = Z(Q); + Ke(j, { level: 3, mt: "10px", - children: (X, re) => { + children: (q, ee) => { Se(); - var ee = Me("输出参数"); - O(X, ee); + var X = Ie("输出参数"); + O(q, X); }, $$slots: { default: !0 } }); - var F = z(q, 2); - $e(F, { + var B = V(j, 2); + Fe(B, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", onclick: () => { s(i, "outputDefs"); }, - children: (X, re) => { - var ee = M3(); - O(X, ee); + children: (q, ee) => { + var X = L3(); + O(q, X); }, $$slots: { default: !0 } - }), W(j); - var Q = z(j, 2); - dr(Q, {}), O(d, h); + }), W(Q); + var te = V(Q, 2); + dr(te, {}), O(d, h); }, $$slots: { icon: !0, default: !0 } } )), ce(u); } se(Fv, { data: {} }, [], [], !0); -var V3 = /* @__PURE__ */ _e(''), z3 = /* @__PURE__ */ _e(''), R3 = /* @__PURE__ */ ne('
知识库
关键字
获取数据量
', 1); -const F3 = { +var z3 = /* @__PURE__ */ xe(''), R3 = /* @__PURE__ */ xe(''), F3 = /* @__PURE__ */ re('
知识库
关键字
获取数据量
', 1); +const B3 = { hash: "svelte-ddi5i", code: ".heading.svelte-ddi5i {display:flex;margin-bottom:10px;}.setting-title.svelte-ddi5i {font-size:12px;color:var(--tf-secondary-foreground);margin-bottom:4px;margin-top:10px;}.setting-item.svelte-ddi5i {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}" }; function Bv(t, e) { - ue(e, !0), Je(t, F3); + ue(e, !0), Je(t, B3); const n = v(e, "data", 7), r = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = vt(), { addParameter: i } = kn(), s = vn(); - let a = /* @__PURE__ */ ye(ht([])); + let a = /* @__PURE__ */ me(ht([])); _n(async () => { const d = await s.provider?.knowledge?.(); c(a).push(...d || []); @@ -26286,22 +26312,22 @@ function Bv(t, e) { () => r, { icon: (f) => { - var h = V3(); + var h = z3(); O(f, h); }, children: (f, h) => { - var p = R3(), m = J(p), y = Z(m); - We(y, { + var p = F3(), m = J(p), y = Z(m); + Ke(y, { level: 3, children: (k, D) => { Se(); - var P = Me("输入参数"); + var P = Ie("输入参数"); O(k, P); }, $$slots: { default: !0 } }); - var w = z(y, 2); - $e(w, { + var w = V(y, 2); + Fe(w, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", @@ -26309,25 +26335,25 @@ function Bv(t, e) { i(o); }, children: (k, D) => { - var P = z3(); + var P = R3(); O(k, P); }, $$slots: { default: !0 } }), W(m); - var b = z(m, 2); - zt(b, {}); - var S = z(b, 2); - We(S, { + var b = V(m, 2); + It(b, {}); + var S = V(b, 2); + Ke(S, { level: 3, mt: "10px", children: (k, D) => { Se(); - var P = Me("知识库设置"); + var P = Ie("知识库设置"); O(k, P); }, $$slots: { default: !0 } }); - var E = z(S, 4), x = Z(E); + var E = V(S, 4), x = Z(E); { let k = /* @__PURE__ */ C(() => n().knowledgeId ? [n().knowledgeId] : []); _t(x, { @@ -26346,7 +26372,7 @@ function Bv(t, e) { }); } W(E); - var _ = z(E, 4), T = Z(_); + var _ = V(E, 4), T = Z(_); ft(T, { placeholder: "请输入关键字", style: "width: 100%", @@ -26358,10 +26384,10 @@ function Bv(t, e) { u(o, () => ({ keyword: D })); } }), W(_); - var I = z(_, 4), B = Z(I); + var I = V(_, 4), F = Z(I); { let k = /* @__PURE__ */ C(() => n().limit || ""); - ft(B, { + ft(F, { placeholder: "搜索的数据条数", style: "width: 100%", onchange: (D) => { @@ -26374,18 +26400,18 @@ function Bv(t, e) { }); } W(I); - var $ = z(I, 2), H = Z($); - We(H, { + var $ = V(I, 2), H = Z($); + Ke(H, { level: 3, mt: "10px", children: (k, D) => { Se(); - var P = Me("输出参数"); + var P = Ie("输出参数"); O(k, P); }, $$slots: { default: !0 } }), W($); - var N = z($, 2); + var N = V($, 2); dr(N, {}), O(f, p); }, $$slots: { icon: !0, default: !0 } @@ -26393,15 +26419,15 @@ function Bv(t, e) { )), ce(l); } se(Bv, { data: {} }, [], [], !0); -var B3 = /* @__PURE__ */ _e(''), $3 = /* @__PURE__ */ _e(''), K3 = /* @__PURE__ */ ne('
搜索引擎
关键字
搜索数据量
', 1); -const W3 = { +var $3 = /* @__PURE__ */ xe(''), K3 = /* @__PURE__ */ xe(''), W3 = /* @__PURE__ */ re('
搜索引擎
关键字
搜索数据量
', 1); +const Z3 = { hash: "svelte-1qblm04", code: ".heading.svelte-1qblm04 {display:flex;margin-bottom:10px;}.setting-title.svelte-1qblm04 {font-size:12px;color:var(--tf-secondary-foreground);margin-bottom:4px;margin-top:10px;}.setting-item.svelte-1qblm04 {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}" }; function $v(t, e) { - ue(e, !0), Je(t, W3); + ue(e, !0), Je(t, Z3); const n = v(e, "data", 7), r = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = vt(), { addParameter: i } = kn(), s = vn(); - let a = /* @__PURE__ */ ye(ht([])); + let a = /* @__PURE__ */ me(ht([])); _n(async () => { const d = await s.provider?.searchEngine?.(); c(a).push(...d || []); @@ -26450,22 +26476,22 @@ function $v(t, e) { () => r, { icon: (f) => { - var h = B3(); + var h = $3(); O(f, h); }, children: (f, h) => { - var p = K3(), m = J(p), y = Z(m); - We(y, { + var p = W3(), m = J(p), y = Z(m); + Ke(y, { level: 3, children: (k, D) => { Se(); - var P = Me("输入参数"); + var P = Ie("输入参数"); O(k, P); }, $$slots: { default: !0 } }); - var w = z(y, 2); - $e(w, { + var w = V(y, 2); + Fe(w, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", @@ -26473,25 +26499,25 @@ function $v(t, e) { i(o); }, children: (k, D) => { - var P = $3(); + var P = K3(); O(k, P); }, $$slots: { default: !0 } }), W(m); - var b = z(m, 2); - zt(b, {}); - var S = z(b, 2); - We(S, { + var b = V(m, 2); + It(b, {}); + var S = V(b, 2); + Ke(S, { level: 3, mt: "10px", children: (k, D) => { Se(); - var P = Me("搜索引擎设置"); + var P = Ie("搜索引擎设置"); O(k, P); }, $$slots: { default: !0 } }); - var E = z(S, 4), x = Z(E); + var E = V(S, 4), x = Z(E); { let k = /* @__PURE__ */ C(() => n().engine ? [n().engine] : []); _t(x, { @@ -26510,7 +26536,7 @@ function $v(t, e) { }); } W(E); - var _ = z(E, 4), T = Z(_); + var _ = V(E, 4), T = Z(_); ft(T, { placeholder: "请输入关键字", style: "width: 100%", @@ -26522,8 +26548,8 @@ function $v(t, e) { u(o, () => ({ keyword: D })); } }), W(_); - var I = z(_, 4), B = Z(I); - ft(B, { + var I = V(_, 4), F = Z(I); + ft(F, { placeholder: "搜索的数据条数", style: "width: 100%", get value() { @@ -26534,18 +26560,18 @@ function $v(t, e) { u(o, () => ({ limit: D })); } }), W(I); - var $ = z(I, 2), H = Z($); - We(H, { + var $ = V(I, 2), H = Z($); + Ke(H, { level: 3, mt: "10px", children: (k, D) => { Se(); - var P = Me("输出参数"); + var P = Ie("输出参数"); O(k, P); }, $$slots: { default: !0 } }), W($); - var N = z($, 2); + var N = V($, 2); dr(N, {}), O(f, p); }, $$slots: { icon: !0, default: !0 } @@ -26553,7 +26579,7 @@ function $v(t, e) { )), ce(l); } se($v, { data: {} }, [], [], !0); -var Z3 = /* @__PURE__ */ _e(''), Y3 = /* @__PURE__ */ _e(''), q3 = /* @__PURE__ */ ne('
', 1); +var q3 = /* @__PURE__ */ xe(''), Y3 = /* @__PURE__ */ xe(''), j3 = /* @__PURE__ */ re('
', 1); const X3 = { hash: "svelte-1o34e8c", code: ".heading.svelte-1o34e8c {display:flex;margin:10px 0;align-items:center;}.loop_handle_wrapper::after {content:'循环体';width:100px;height:20px;background:var(--tf-primary);color:var(--tf-primary-foreground);display:flex;justify-content:center;align-items:center;}" @@ -26581,7 +26607,7 @@ function Kv(t, e) { () => r, { icon: (l) => { - var d = Z3(); + var d = q3(); O(l, d); }, handle: (l) => { @@ -26596,30 +26622,30 @@ function Kv(t, e) { }); }, children: (l, d) => { - var f = q3(), h = J(f), p = Z(h); - We(p, { + var f = j3(), h = J(f), p = Z(h); + Ke(p, { level: 3, children: (E, x) => { Se(); - var _ = Me("循环变量"); + var _ = Ie("循环变量"); O(E, _); }, $$slots: { default: !0 } }), W(h); - var m = z(h, 2); - zt(m, { dataKeyName: "loopVars" }); - var y = z(m, 2), w = Z(y); - We(w, { + var m = V(h, 2); + It(m, { dataKeyName: "loopVars" }); + var y = V(m, 2), w = Z(y); + Ke(w, { level: 3, children: (E, x) => { Se(); - var _ = Me("输出参数"); + var _ = Ie("输出参数"); O(E, _); }, $$slots: { default: !0 } }); - var b = z(w, 2); - $e(b, { + var b = V(w, 2); + Fe(b, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", @@ -26632,8 +26658,8 @@ function Kv(t, e) { }, $$slots: { default: !0 } }), W(y); - var S = z(y, 2); - zt(S, { + var S = V(y, 2); + It(S, { noneParameterText: "无输出参数", dataKeyName: "outputDefs", useChildrenOnly: !0 @@ -26644,13 +26670,13 @@ function Kv(t, e) { )), ce(s); } se(Kv, { data: {} }, [], [], !0); -var j3 = /* @__PURE__ */ ne('
数据类型:
确认方式:
数据标题:
数据描述:
'), U3 = /* @__PURE__ */ ne('
', 1); -const G3 = { +var U3 = /* @__PURE__ */ re('
数据类型:
确认方式:
数据标题:
数据描述:
'), G3 = /* @__PURE__ */ re('
', 1); +const J3 = { hash: "svelte-5x0hls", code: ".input-item.svelte-5x0hls {display:flex;align-items:center;}.input-more-setting.svelte-5x0hls {display:flex;flex-direction:column;gap:10px;padding:10px;background:var(--tf-background);border:1px solid var(--tf-border);border-radius:5px;width:200px;box-shadow:0 0 10px 2px rgba(0, 0, 0, 0.1);}.input-more-setting.svelte-5x0hls .input-more-item:where(.svelte-5x0hls) {display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--tf-muted-foreground);}" }; function Wv(t, e) { - ue(e, !0), Je(t, G3); + ue(e, !0), Je(t, J3); const n = v(e, "parameter", 7), r = v(e, "index", 7), o = v(e, "dataKeyName", 7), i = v(e, "useChildrenOnly", 7); let s = vt(), a = cr(s), u = /* @__PURE__ */ C(() => ({ ...n(), @@ -26707,7 +26733,7 @@ function Wv(t, e) { set useChildrenOnly(k) { i(k), g(); } - }, E = U3(), x = J(E), _ = Z(x); + }, E = G3(), x = J(E), _ = Z(x); { let k = /* @__PURE__ */ C(() => c(u).nameDisabled === !0); ft(_, { @@ -26723,9 +26749,9 @@ function Wv(t, e) { }); } W(x); - var T = z(x, 2), I = Z(T); + var T = V(x, 2), I = Z(T); { - var B = (k) => { + var F = (k) => { ft(k, { get value() { return c(u).value; @@ -26764,18 +26790,18 @@ function Wv(t, e) { O(k, D); }; ie(I, (k) => { - c(u).refType === "fixed" ? k(B) : k($, !1); + c(u).refType === "fixed" ? k(F) : k($, !1); }); } W(T); - var H = z(T, 2), N = Z(H); + var H = V(T, 2), N = Z(H); return Nt( - jr(N, { + Xr(N, { placement: "bottom", floating: (D) => { - var P = j3(), A = Z(P), R = z(Z(A)); + var P = U3(), A = Z(P), R = V(Z(A)); { - let X = /* @__PURE__ */ C(() => c(u).contentType ? [c(u).contentType] : []); + let q = /* @__PURE__ */ C(() => c(u).contentType ? [c(u).contentType] : []); _t(R, { get items() { return eu; @@ -26783,15 +26809,15 @@ function Wv(t, e) { style: "width: 100%", defaultValue: ["text"], get value() { - return c(X); + return c(q); }, onSelect: m }); } W(A); - var M = z(A, 2), Y = z(Z(M)); + var M = V(A, 2), Y = V(Z(M)); { - let X = /* @__PURE__ */ C(() => c(u).formType ? [c(u).formType] : []); + let q = /* @__PURE__ */ C(() => c(u).formType ? [c(u).formType] : []); _t(Y, { get items() { return Cb; @@ -26799,45 +26825,45 @@ function Wv(t, e) { style: "width: 100%", defaultValue: ["single"], get value() { - return c(X); + return c(q); }, onSelect: p }); } W(M); - var U = z(M, 2), V = z(Z(U)); - qe(V, { + var G = V(M, 2), z = V(Z(G)); + je(z, { rows: 1, style: "width: 100%;", - onchange: (X) => { - f("formLabel", X); + onchange: (q) => { + f("formLabel", q); }, get value() { return c(u).formLabel; } - }), W(U); - var j = z(U, 2), q = z(Z(j)); - qe(q, { + }), W(G); + var Q = V(G, 2), j = V(Z(Q)); + je(j, { rows: 2, style: "width: 100%;", - onchange: (X) => { - f("formDescription", X); + onchange: (q) => { + f("formDescription", q); }, get value() { return c(u).formDescription; } - }), W(j); - var F = z(j, 2), Q = Z(F); - $e(Q, { + }), W(Q); + var B = V(Q, 2), te = Z(B); + Fe(te, { variant: "destructive", onclick: w, - children: (X, re) => { + children: (q, ee) => { Se(); - var ee = Me("删除"); - O(X, ee); + var X = Ie("删除"); + O(q, X); }, $$slots: { default: !0 } - }), W(F), W(P), O(D, P); + }), W(B), W(P), O(D, P); }, children: (D, P) => { Si(D, {}); @@ -26860,14 +26886,14 @@ se( [], !0 ); -var J3 = /* @__PURE__ */ ne('
参数名称
参数值
', 1), Q3 = /* @__PURE__ */ ne('
'), e4 = /* @__PURE__ */ ne('
'); -const t4 = { +var Q3 = /* @__PURE__ */ re('
参数名称
参数值
', 1), e4 = /* @__PURE__ */ re('
'), t4 = /* @__PURE__ */ re('
'); +const n4 = { hash: "svelte-1fllp9b", code: `.input-container.svelte-1fllp9b {display:grid;grid-template-columns:40% 50% 10%;row-gap:5px;column-gap:3px;}.input-container.svelte-1fllp9b .none-params:where(.svelte-1fllp9b) {font-size:12px;background:var(--tf-secondary);height:20px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1; /* 从第一列开始到最后一列结束 */}.input-container.svelte-1fllp9b .input-header:where(.svelte-1fllp9b) {font-size:12px;color:var(--tf-muted-foreground);}` }; function Zv(t, e) { - ue(e, !0), Je(t, t4); + ue(e, !0), Je(t, n4); const n = v(e, "noneParameterText", 7, "无确认数据"), r = v(e, "dataKeyName", 7, "parameters"), o = v(e, "useChildrenOnly", 7); let i = vt(), s = cr(i), a = /* @__PURE__ */ C(() => [...s?.current?.data?.[r()] || []]); var u = { @@ -26889,17 +26915,17 @@ function Zv(t, e) { set useChildrenOnly(p) { o(p), g(); } - }, l = e4(), d = Z(l); + }, l = t4(), d = Z(l); { var f = (p) => { - var m = J3(); + var m = Q3(); Se(4), O(p, m); }; ie(d, (p) => { c(a).length !== 0 && p(f); }); } - var h = z(d, 2); + var h = V(d, 2); return Ct( h, 19, @@ -26922,8 +26948,8 @@ function Zv(t, e) { }); }, (p) => { - var m = Q3(), y = Z(m, !0); - W(m), Te(() => tt(y, n())), O(p, m); + var m = e4(), y = Z(m, !0); + W(m), Oe(() => tt(y, n())), O(p, m); } ), W(l), O(t, l), ce(u); } @@ -26947,13 +26973,13 @@ const vl = (t, e) => { return !0; } }; -var n4 = /* @__PURE__ */ _e(''), r4 = /* @__PURE__ */ _e(''), o4 = /* @__PURE__ */ ne('
消息内容
', 1); -const i4 = { +var r4 = /* @__PURE__ */ xe(''), o4 = /* @__PURE__ */ xe(''), i4 = /* @__PURE__ */ re('
消息内容
', 1); +const s4 = { hash: "svelte-8iukvu", code: ".heading.svelte-8iukvu {display:flex;margin-bottom:10px;}.setting-title.svelte-8iukvu {font-size:12px;color:var(--tf-secondary-foreground);margin-bottom:4px;margin-top:10px;}.setting-item.svelte-8iukvu {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}" }; -function Yv(t, e) { - ue(e, !0), Je(t, i4); +function qv(t, e) { + ue(e, !0), Je(t, s4); const n = v(e, "data", 7), r = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = vt(), { addParameter: i } = kn(), { updateNodeData: s } = wt(); He(() => { if (n().confirms) { @@ -26998,22 +27024,22 @@ function Yv(t, e) { () => r, { icon: (l) => { - var d = n4(); + var d = r4(); O(l, d); }, children: (l, d) => { - var f = o4(), h = J(f), p = Z(h); - We(p, { + var f = i4(), h = J(f), p = Z(h); + Ke(p, { level: 3, children: (T, I) => { Se(); - var B = Me("确认数据"); - O(T, B); + var F = Ie("确认数据"); + O(T, F); }, $$slots: { default: !0 } }); - var m = z(p, 2); - $e(m, { + var m = V(p, 2); + Fe(m, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", @@ -27021,28 +27047,28 @@ function Yv(t, e) { i(o, "confirms"); }, children: (T, I) => { - var B = r4(); - O(T, B); + var F = o4(); + O(T, F); }, $$slots: { default: !0 } }), W(h); - var y = z(h, 2); + var y = V(h, 2); Zv(y, { dataKeyName: "confirms", noneParameterText: "无确认数据" }); - var w = z(y, 2); - We(w, { + var w = V(y, 2); + Ke(w, { level: 3, mt: "10px", children: (T, I) => { Se(); - var B = Me("确认消息"); - O(T, B); + var F = Ie("确认消息"); + O(T, F); }, $$slots: { default: !0 } }); - var b = z(w, 4), S = Z(b); + var b = V(w, 4), S = Z(b); { let T = /* @__PURE__ */ C(() => n().message || ""); - qe(S, { + je(S, { rows: 5, placeholder: "请输入用户需要确认的消息内容", style: "width: 100%", @@ -27055,29 +27081,29 @@ function Yv(t, e) { }); } W(b); - var E = z(b, 2), x = Z(E); - We(x, { + var E = V(b, 2), x = Z(E); + Ke(x, { level: 3, mt: "10px", children: (T, I) => { Se(); - var B = Me("输出参数"); - O(T, B); + var F = Ie("输出参数"); + O(T, F); }, $$slots: { default: !0 } }), W(E); - var _ = z(E, 2); + var _ = V(E, 2); dr(_, { placeholder: "" }), O(l, f); }, $$slots: { icon: !0, default: !0 } } )), ce(a); } -se(Yv, { data: {} }, [], [], !0); -const s4 = { +se(qv, { data: {} }, [], [], !0); +const a4 = { startNode: Ov, codeNode: zv, - confirmNode: Yv, + confirmNode: qv, llmNode: Vv, templateNode: Rv, httpNode: Fv, @@ -27086,7 +27112,7 @@ const s4 = { loopNode: Kv, endNode: Lv }; -var a4 = /* @__PURE__ */ ne(" ", 1); +var l4 = /* @__PURE__ */ re(" ", 1); function pl(t, e) { ue(e, !0); const n = v(e, "icon", 7), r = v(e, "title", 7), o = v(e, "type", 7), i = v(e, "description", 7), s = v(e, "extra", 7), a = wt(), u = (f) => { @@ -27104,7 +27130,7 @@ function pl(t, e) { position: p, data: { title: r(), description: i(), ...s() } }; - Be.addNode(m), Be.selectNodeOnly(m.id); + $e.addNode(m), $e.selectNodeOnly(m.id); }; var d = { get icon() { @@ -27138,7 +27164,7 @@ function pl(t, e) { s(f), g(); } }; - return $e(t, { + return Fe(t, { draggable: !0, ondragstart: u, onclick: l, @@ -27146,19 +27172,19 @@ function pl(t, e) { return o(); }, children: (f, h) => { - var p = a4(), m = J(p); + var p = l4(), m = J(p); Ks(m, n); - var y = z(m); - Te(() => tt(y, ` ${r() ?? ""}`)), O(f, p); + var y = V(m); + Oe(() => tt(y, ` ${r() ?? ""}`)), O(f, p); }, $$slots: { default: !0 } }), ce(d); } se(pl, { icon: {}, title: {}, type: {}, description: {}, extra: {} }, [], [], !0); -var l4 = /* @__PURE__ */ _e(''), u4 = /* @__PURE__ */ _e(''), c4 = /* @__PURE__ */ ne('
'); -function qv(t, e) { +var u4 = /* @__PURE__ */ xe(''), c4 = /* @__PURE__ */ xe(''), d4 = /* @__PURE__ */ re('
'); +function Yv(t, e) { ue(e, !0); - let n = /* @__PURE__ */ ye("base"), r = /* @__PURE__ */ ye("show"); + let n = /* @__PURE__ */ me("base"), r = /* @__PURE__ */ me("show"); const o = [ { icon: '', @@ -27255,7 +27281,7 @@ function qv(t, e) { } } } - var l = c4(), d = Z(l), f = Z(d), h = Z(f); + var l = d4(), d = Z(l), f = Z(d), h = Z(f); Ev(h, { style: "width: 100%", get items() { @@ -27265,16 +27291,16 @@ function qv(t, e) { K(n, b.value.toString(), !0); } }), W(f); - var p = z(f, 2), m = Z(p); + var p = V(f, 2), m = Z(p); Ct(m, 21, () => o, ao, (b, S) => { pl(b, Ve(() => c(S))); }), W(m); - var y = z(m, 2); + var y = V(m, 2); Ct(y, 21, () => s, ao, (b, S) => { pl(b, Ve(() => c(S))); }), W(y), W(p), W(d); - var w = z(d, 2); - $e(w, { + var w = V(d, 2); + Fe(w, { size: "icon", variant: "outline", onclick: () => { @@ -27284,11 +27310,11 @@ function qv(t, e) { var E = de(), x = J(E); { var _ = (I) => { - var B = l4(); - O(I, B); + var F = u4(); + O(I, F); }, T = (I) => { - var B = u4(); - O(I, B); + var F = c4(); + O(I, F); }; ie(x, (I) => { c(r) === "show" ? I(_) : I(T, !1); @@ -27297,13 +27323,13 @@ function qv(t, e) { O(b, E); }, $$slots: { default: !0 } - }), W(l), Te(() => { - Yt(l, 1, `tf-toolbar ${c(r) ?? ""}`), Pt(m, `display: ${c(n) === "base" ? "flex" : "none"}`), Pt(y, `display: ${c(n) !== "base" ? "flex" : "none"}`); + }), W(l), Oe(() => { + qt(l, 1, `tf-toolbar ${c(r) ?? ""}`), Pt(m, `display: ${c(n) === "base" ? "flex" : "none"}`), Pt(y, `display: ${c(n) !== "base" ? "flex" : "none"}`); }), O(t, l), ce(); } -se(qv, {}, [], [], !0); -const d4 = () => ({ getNode: (e) => Be.getNode(e) }), f4 = () => ({ ensureParentInNodesBefore: (e, n) => { - Be.updateNodes((r) => { +se(Yv, {}, [], [], !0); +const f4 = () => ({ getNode: (e) => $e.getNode(e) }), h4 = () => ({ ensureParentInNodesBefore: (e, n) => { + $e.updateNodes((r) => { let o = -1; for (let a = 0; a < r.length; a++) if (r[a].id === e) { @@ -27325,16 +27351,16 @@ const d4 = () => ({ getNode: (e) => Be.getNode(e) }), f4 = () => ({ ensureParent r[a] = r[a - 1]; return r[i] = s, r; }); -} }), h4 = () => ({ getEdgesByTarget: (e) => Be.getEdges().filter((r) => r.target === e) }); -var g4 = /* @__PURE__ */ _e(''), v4 = /* @__PURE__ */ ne('
', 1), p4 = /* @__PURE__ */ ne('
', 1), m4 = /* @__PURE__ */ ne('
', 1), y4 = /* @__PURE__ */ ne('
', 1), w4 = /* @__PURE__ */ ne('
', 1), b4 = /* @__PURE__ */ ne('
', 1), x4 = /* @__PURE__ */ _e(''), _4 = /* @__PURE__ */ ne('
', 1), C4 = /* @__PURE__ */ ne("
", 1); -const S4 = { +} }), g4 = () => ({ getEdgesByTarget: (e) => $e.getEdges().filter((r) => r.target === e) }); +var v4 = /* @__PURE__ */ xe(''), p4 = /* @__PURE__ */ re('
', 1), m4 = /* @__PURE__ */ re('
', 1), y4 = /* @__PURE__ */ re('
', 1), w4 = /* @__PURE__ */ re('
', 1), b4 = /* @__PURE__ */ re('
', 1), x4 = /* @__PURE__ */ re('
', 1), _4 = /* @__PURE__ */ xe(''), C4 = /* @__PURE__ */ re('
', 1), S4 = /* @__PURE__ */ re("
", 1); +const k4 = { hash: "svelte-qt4m0r", - code: `.heading.svelte-qt4m0r {display:flex;align-items:center;margin-bottom:10px;}.setting-title.svelte-qt4m0r {font-size:12px;color:var(--tf-secondary-foreground);margin-bottom:4px;margin-top:10px;}.setting-item.svelte-qt4m0r {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;} - + code: `.heading.svelte-qt4m0r {display:flex;align-items:center;margin-bottom:10px;}.setting-title.svelte-qt4m0r {font-size:12px;color:var(--tf-secondary-foreground);margin-bottom:4px;margin-top:10px;}.setting-item.svelte-qt4m0r {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;}\r +\r /* 新增样式 */.slider-container.svelte-qt4m0r {width:100%;display:flex;flex-direction:column;gap:4px;}.slider-container.svelte-qt4m0r span:where(.svelte-qt4m0r) {font-size:12px;color:var(--tf-muted-foreground);display:flex;justify-content:space-between;align-items:center;}input[type='range'].svelte-qt4m0r {width:100%;height:4px;background:var(--tf-muted);border-radius:2px;outline:none;-webkit-appearance:none;}input[type='range'].svelte-qt4m0r::-webkit-slider-thumb {-webkit-appearance:none;width:14px;height:14px;background:var(--tf-primary);border-radius:50%;cursor:pointer;}` }; -function Xv(t, e) { - ue(e, !0), Je(t, S4); +function jv(t, e) { + ue(e, !0), Je(t, k4); const n = v(e, "data", 7), r = /* @__PURE__ */ Le(e, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = vt(), { addParameter: i } = kn(), s = wt(), { updateNodeData: a } = s, u = (b) => { a(o, b); }, l = (b, S) => { @@ -27380,62 +27406,62 @@ function Xv(t, e) { { icon: b, children: (E, x) => { - var _ = C4(), T = J(_); + var _ = S4(), T = J(_); { var I = (D) => { - var P = v4(), A = J(P), R = Z(A); - We(R, { + var P = p4(), A = J(P), R = Z(A); + Ke(R, { level: 3, - children: (V, j) => { + children: (z, Q) => { Se(); - var q = Me("输入参数"); - O(V, q); + var j = Ie("输入参数"); + O(z, j); }, $$slots: { default: !0 } }); - var M = z(R, 2); + var M = V(R, 2); { - var Y = (V) => { - $e(V, { + var Y = (z) => { + Fe(z, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o); }, - children: (j, q) => { - var F = g4(); - O(j, F); + children: (Q, j) => { + var B = v4(); + O(Q, B); }, $$slots: { default: !0 } }); }; - ie(M, (V) => { - p.parametersAddEnable !== !1 && V(Y); + ie(M, (z) => { + p.parametersAddEnable !== !1 && z(Y); }); } W(A); - var U = z(A, 2); - zt(U, {}), O(D, P); + var G = V(A, 2); + It(G, {}), O(D, P); }; ie(T, (D) => { p.parametersEnable !== !1 && D(I); }); } - var B = z(T, 2); + var F = V(T, 2); { var $ = (D) => { var P = de(), A = J(P); Ct(A, 17, () => m, ao, (R, M) => { - var Y = de(), U = J(Y); + var Y = de(), G = J(Y); { - var V = (q) => { - var F = p4(), Q = J(F), X = Z(Q, !0); - W(Q); - var re = z(Q, 2), ee = Z(re); + var z = (j) => { + var B = m4(), te = J(B), q = Z(te, !0); + W(te); + var ee = V(te, 2), X = Z(ee); { let L = /* @__PURE__ */ C(() => n()[c(M).name] || c(M).defaultValue); - ft(ee, Ve( + ft(X, Ve( { get placeholder() { return c(M).placeholder; @@ -27447,23 +27473,23 @@ function Xv(t, e) { }, () => c(M).attrs, { - onchange: (te) => { - l(c(M).name, te); + onchange: (ne) => { + l(c(M).name, ne); } } )); } - W(re), Te(() => tt(X, c(M).label)), O(q, F); - }, j = (q) => { - var F = de(), Q = J(F); + W(ee), Oe(() => tt(q, c(M).label)), O(j, B); + }, Q = (j) => { + var B = de(), te = J(B); { - var X = (ee) => { - var L = m4(), te = J(L), ve = Z(te, !0); - W(te); - var ae = z(te, 2), le = Z(ae); + var q = (X) => { + var L = y4(), ne = J(L), fe = Z(ne, !0); + W(ne); + var le = V(ne, 2), ae = Z(le); { let oe = /* @__PURE__ */ C(() => n()[c(M).name] || c(M).defaultValue); - qe(le, Ve( + je(ae, Ve( { rows: 3, get placeholder() { @@ -27476,76 +27502,76 @@ function Xv(t, e) { }, () => c(M).attrs, { - onchange: (fe) => { - l(c(M).name, fe); + onchange: (he) => { + l(c(M).name, he); } } )); } - W(ae), Te(() => tt(ve, c(M).label)), O(ee, L); - }, re = (ee) => { - var L = de(), te = J(L); + W(le), Oe(() => tt(fe, c(M).label)), O(X, L); + }, ee = (X) => { + var L = de(), ne = J(L); { - var ve = (le) => { - var oe = y4(), fe = J(oe), we = Z(fe, !0); - W(fe); - var xe = z(fe, 2), pe = Z(xe), me = Z(pe), Ee = Z(me); - W(me); - var G = z(me, 2), Ue = (be) => u({ [c(M).name]: parseFloat(be.target.value) }); + var fe = (ae) => { + var oe = w4(), he = J(oe), we = Z(he, !0); + W(he); + var _e = V(he, 2), ve = Z(_e), ye = Z(ve), Ne = Z(ye); + W(ye); + var U = V(ye, 2), Ye = (be) => u({ [c(M).name]: parseFloat(be.target.value) }); Ge( - G, + U, () => ({ class: "nodrag", type: "range", ...c(M).attrs, value: n()[c(M).name] ?? c(M).defaultValue, - oninput: Ue + oninput: Ye }), void 0, void 0, void 0, "svelte-qt4m0r", !0 - ), W(pe), W(xe), Te(() => { - tt(we, c(M).label), tt(Ee, `${c(M).description ?? ""}: ${n()[c(M).name] ?? c(M).defaultValue ?? ""}`); - }), O(le, oe); - }, ae = (le) => { - var oe = de(), fe = J(oe); + ), W(ve), W(_e), Oe(() => { + tt(we, c(M).label), tt(Ne, `${c(M).description ?? ""}: ${n()[c(M).name] ?? c(M).defaultValue ?? ""}`); + }), O(ae, oe); + }, le = (ae) => { + var oe = de(), he = J(oe); { - var we = (pe) => { - var me = w4(), Ee = J(me), G = Z(Ee, !0); - W(Ee); - var Ue = z(Ee, 2), be = Z(Ue); + var we = (ve) => { + var ye = b4(), Ne = J(ye), U = Z(Ne, !0); + W(Ne); + var Ye = V(Ne, 2), be = Z(Ye); { - let De = /* @__PURE__ */ C(() => c(M).options || []), Pe = /* @__PURE__ */ C(() => n()[c(M).name] ? [n()[c(M).name]] : [c(M).defaultValue]); + let Te = /* @__PURE__ */ C(() => c(M).options || []), Ee = /* @__PURE__ */ C(() => n()[c(M).name] ? [n()[c(M).name]] : [c(M).defaultValue]); _t(be, { get items() { - return c(De); + return c(Te); }, style: "width: 100%", get placeholder() { return c(M).placeholder; }, onSelect: (Xe) => { - const je = Xe.value; - u({ [c(M).name]: je }); + const Ue = Xe.value; + u({ [c(M).name]: Ue }); }, get value() { - return c(Pe); + return c(Ee); } }); } - W(Ue), Te(() => tt(G, c(M).label)), O(pe, me); - }, xe = (pe) => { - var me = de(), Ee = J(me); + W(Ye), Oe(() => tt(U, c(M).label)), O(ve, ye); + }, _e = (ve) => { + var ye = de(), Ne = J(ye); { - var G = (be) => { - var De = b4(), Pe = J(De), Xe = Z(Pe, !0); - W(Pe); - var je = z(Pe, 2), Ke = Z(je); + var U = (be) => { + var Te = x4(), Ee = J(Te), Xe = Z(Ee, !0); + W(Ee); + var Ue = V(Ee, 2), We = Z(Ue); { let rt = /* @__PURE__ */ C(() => c(M).chosen?.buttonText); - kv(Ke, { + kv(We, { style: "width: 100%", get placeholder() { return c(M).placeholder; @@ -27553,8 +27579,8 @@ function Xv(t, e) { get buttonText() { return c(rt); }, - onChosen: (Tt, he, Ae) => { - c(M).chosen?.onChosen?.(u, Tt, he, Ae); + onChosen: (Tt, ge, De) => { + c(M).chosen?.onChosen?.(u, Tt, ge, De); }, get value() { return n()[c(M).chosen?.valueDataKey || ""]; @@ -27564,128 +27590,128 @@ function Xv(t, e) { } }); } - W(je), Te(() => tt(Xe, c(M).label)), O(be, De); - }, Ue = (be) => { - var De = de(), Pe = J(De); + W(Ue), Oe(() => tt(Xe, c(M).label)), O(be, Te); + }, Ye = (be) => { + var Te = de(), Ee = J(Te); { - var Xe = (je) => { - We(je, Ve({ level: 3, mt: "10px" }, () => c(M).attrs, { - children: (Ke, rt) => { + var Xe = (Ue) => { + Ke(Ue, Ve({ level: 3, mt: "10px" }, () => c(M).attrs, { + children: (We, rt) => { Se(); - var Tt = Me(); - Te(() => tt(Tt, c(M).label)), O(Ke, Tt); + var Tt = Ie(); + Oe(() => tt(Tt, c(M).label)), O(We, Tt); }, $$slots: { default: !0 } })); }; ie( - Pe, - (je) => { - c(M).type === "heading" && je(Xe); + Ee, + (Ue) => { + c(M).type === "heading" && Ue(Xe); }, !0 ); } - O(be, De); + O(be, Te); }; ie( - Ee, + Ne, (be) => { - c(M).type === "chosen" ? be(G) : be(Ue, !1); + c(M).type === "chosen" ? be(U) : be(Ye, !1); }, !0 ); } - O(pe, me); + O(ve, ye); }; ie( - fe, - (pe) => { - c(M).type === "select" ? pe(we) : pe(xe, !1); + he, + (ve) => { + c(M).type === "select" ? ve(we) : ve(_e, !1); }, !0 ); } - O(le, oe); + O(ae, oe); }; ie( - te, - (le) => { - c(M).type === "slider" ? le(ve) : le(ae, !1); + ne, + (ae) => { + c(M).type === "slider" ? ae(fe) : ae(le, !1); }, !0 ); } - O(ee, L); + O(X, L); }; ie( - Q, - (ee) => { - c(M).type === "textarea" ? ee(X) : ee(re, !1); + te, + (X) => { + c(M).type === "textarea" ? X(q) : X(ee, !1); }, !0 ); } - O(q, F); + O(j, B); }; - ie(U, (q) => { - c(M).type === "input" ? q(V) : q(j, !1); + ie(G, (j) => { + c(M).type === "input" ? j(z) : j(Q, !1); }); } O(R, Y); }), O(D, P); }; - ie(B, (D) => { + ie(F, (D) => { m && D($); }); } - var H = z(B, 2); + var H = V(F, 2); Nt(H, (D) => y = D, () => y); - var N = z(H, 2); + var N = V(H, 2); { var k = (D) => { - var P = _4(), A = J(P), R = Z(A); - We(R, { + var P = C4(), A = J(P), R = Z(A); + Ke(R, { level: 3, mt: "10px", - children: (V, j) => { + children: (z, Q) => { Se(); - var q = Me("输出参数"); - O(V, q); + var j = Ie("输出参数"); + O(z, j); }, $$slots: { default: !0 } }); - var M = z(R, 2); + var M = V(R, 2); { - var Y = (V) => { - $e(V, { + var Y = (z) => { + Fe(z, { size: "icon-xs", class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o, "outputDefs"); }, - children: (j, q) => { - var F = x4(); - O(j, F); + children: (Q, j) => { + var B = _4(); + O(Q, B); }, $$slots: { default: !0 } }); }; - ie(M, (V) => { - p.outputDefsAddEnable !== !1 && V(Y); + ie(M, (z) => { + p.outputDefsAddEnable !== !1 && z(Y); }); } W(A); - var U = z(A, 2); - dr(U, {}), O(D, P); + var G = V(A, 2); + dr(G, {}), O(D, P); }; ie(N, (D) => { p.outputDefsEnable !== !1 && D(k); }); } - Te(() => { - Pt(H, p.rootStyle || ""), Yt(H, 1, ur(p.rootClass), "svelte-qt4m0r"); + Oe(() => { + Pt(H, p.rootStyle || ""), qt(H, 1, ur(p.rootClass), "svelte-qt4m0r"); }), O(E, _); }, $$slots: { icon: !0, default: !0 } @@ -27694,39 +27720,39 @@ function Xv(t, e) { } return ce(w); } -se(Xv, { data: {} }, [], [], !0); -const k4 = () => ({ updateEdgeData: (e, n, r) => { - const o = Be.getEdge(e); +se(jv, { data: {} }, [], [], !0); +const E4 = () => ({ updateEdgeData: (e, n, r) => { + const o = $e.getEdge(e); if (!o) return; const i = typeof n == "function" ? n(o) : n; - o.data = r?.replace ? i : { ...o.data, ...i }, Be.updateEdges((s) => s.map((a) => a.id === e ? o : a)); -} }), E4 = () => ({ deleteEdge: (e) => { - Be.removeEdge(e); -} }), P4 = () => { + o.data = r?.replace ? i : { ...o.data, ...i }, $e.updateEdges((s) => s.map((a) => a.id === e ? o : a)); +} }), P4 = () => ({ deleteEdge: (e) => { + $e.removeEdge(e); +} }), N4 = () => { const t = (n, r) => r.filter( // 排除循环节点的子节点,否则在多层循环嵌套时不正确 (o) => o.source === n && o.sourceHandle !== "loop_handle" ); return { getNodesFromSource: (n) => { - const r = Be.getEdges(), o = []; + const r = $e.getEdges(), o = []; let i = t(n, r); for (; i.length > 0; ) { const s = []; i.forEach((a) => { - o.push(Be.getNode(a.target)), s.push(...t(a.target, r)); + o.push($e.getNode(a.target)), s.push(...t(a.target, r)); }), i = s; } return o; } }; -}, N4 = () => ({ getNodeRelativePosition: (e) => { - let n = Be.getNode(e); +}, T4 = () => ({ getNodeRelativePosition: (e) => { + let n = $e.getNode(e); const r = { x: 0, y: 0 }; for (; n; ) - r.x += n.position.x, r.y += n.position.y, n.parentId ? n = Be.getNode(n.parentId) : n = void 0; + r.x += n.position.x, r.y += n.position.y, n.parentId ? n = $e.getNode(n.parentId) : n = void 0; return r; } }); -function T4(t) { +function O4(t) { const { id: e, type: n, position: r, data: o, parentId: i } = t; return { id: e, @@ -27737,7 +27763,7 @@ function T4(t) { ...i !== void 0 && { parentId: i } }; } -function O4(t) { +function A4(t) { const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(); for (const a of t) e.set(a.id, a), n.set(a.id, 0), a.parentId && (n.set(a.id, 1), r.has(a.parentId) || r.set(a.parentId, []), r.get(a.parentId).push(a.id)); @@ -27757,7 +27783,7 @@ function O4(t) { s.has(a.id) || i.push(a); return i; } -function A4(t) { +function D4(t) { const { id: e, source: n, target: r, sourceHandle: o, targetHandle: i, type: s, data: a } = t; return { id: e, @@ -27790,10 +27816,10 @@ function ml(t, e) { } return t; } -const D4 = () => (wt(), { copyHandler: async (n) => { - const r = Be.getNodes().filter((d) => d.selected); +const I4 = () => (wt(), { copyHandler: async (n) => { + const r = $e.getNodes().filter((d) => d.selected); if (r.length === 0) return; - const i = Be.getEdges().filter((d) => r.some((f) => f.id === d.source) && r.some((f) => f.id === d.target)), s = r.map(T4), a = i.map(A4), l = JSON.stringify({ + const i = $e.getEdges().filter((d) => r.some((f) => f.id === d.source) && r.some((f) => f.id === d.target)), s = r.map(O4), a = i.map(D4), l = JSON.stringify({ tinyflowNodes: s, tinyflowEdges: a, version: "1.0" @@ -27819,7 +27845,7 @@ const D4 = () => (wt(), { copyHandler: async (n) => { if (!o?.tinyflowNodes || !Array.isArray(o.tinyflowNodes)) return; n.preventDefault(); - const i = O4(o.tinyflowNodes), s = o.tinyflowEdges || [], a = /* @__PURE__ */ new Map(), u = []; + const i = A4(o.tinyflowNodes), s = o.tinyflowEdges || [], a = /* @__PURE__ */ new Map(), u = []; for (const d of i) { const f = `node_${xn()}`; a.set(d.id, f); @@ -27848,165 +27874,165 @@ const D4 = () => (wt(), { copyHandler: async (n) => { target: h }); } - Be.updateNodes((d) => [...d.map((h) => ({ ...h, selected: !1 })), ...u]), Be.updateEdges((d) => [...d.map((h) => ({ ...h, selected: !1 })), ...l]); + $e.updateNodes((d) => [...d.map((h) => ({ ...h, selected: !1 })), ...u]), $e.updateEdges((d) => [...d.map((h) => ({ ...h, selected: !1 })), ...l]); } }), cd = () => { const t = document.activeElement; return !t || !(t instanceof HTMLElement) ? !1 : t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t.isContentEditable; }; -var I4 = /* @__PURE__ */ ne('
边属性设置
边条件设置
'), M4 = /* @__PURE__ */ ne(" ", 1), L4 = /* @__PURE__ */ ne('
'); -const H4 = { +var M4 = /* @__PURE__ */ re('
边属性设置
边条件设置
'), L4 = /* @__PURE__ */ re(" ", 1), H4 = /* @__PURE__ */ re('
'); +const V4 = { hash: "svelte-woejl3", code: ".panel-content.svelte-woejl3 {padding:10px;background-color:var(--tf-background);border-radius:5px;box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);width:200px;border:1px solid var(--tf-border);}.setting-title.svelte-woejl3 {margin:10px 0;font-size:12px;color:var(--tf-muted-foreground);}.setting-item.svelte-woejl3 {display:flex;gap:5px;align-items:center;justify-content:end;}" }; -function jv(t, e) { - ue(e, !0), Je(t, H4); +function Xv(t, e) { + ue(e, !0), Je(t, V4); const n = v(e, "onInit", 7), r = wt(); n()(r); - let o = /* @__PURE__ */ ye(!1), i = /* @__PURE__ */ ye(null); - const { updateEdgeData: s } = k4(), a = (q) => { - q.preventDefault(), q.dataTransfer && (q.dataTransfer.dropEffect = "move"); - }, u = (q) => { - q.preventDefault(); - const F = r.screenToFlowPosition({ x: q.clientX - 250, y: q.clientY - 100 }), Q = q.dataTransfer?.getData("application/tinyflow"); - if (!Q) + let o = /* @__PURE__ */ me(!1), i = /* @__PURE__ */ me(null); + const { updateEdgeData: s } = E4(), a = (j) => { + j.preventDefault(), j.dataTransfer && (j.dataTransfer.dropEffect = "move"); + }, u = (j) => { + j.preventDefault(); + const B = r.screenToFlowPosition({ x: j.clientX - 250, y: j.clientY - 100 }), te = j.dataTransfer?.getData("application/tinyflow"); + if (!te) return; - const X = JSON.parse(Q), re = { id: `node_${xn()}`, position: F, data: {}, ...X }; - Be.addNode(re), Be.selectNodeOnly(re.id); - }, { getNode: l } = d4(), d = (q) => { - const F = l(q.source), Q = l(q.target); - if (q.sourceHandle === "loop_handle" || F.parentId) { - const X = r.getEdges(); - for (let re of X) - if (re.target === q.target) { - const ee = l(re.source); - if (q.sourceHandle === "loop_handle" && ee.parentId !== F.id || F.parentId && ee.parentId !== F.parentId) + const q = JSON.parse(te), ee = { id: `node_${xn()}`, position: B, data: {}, ...q }; + $e.addNode(ee), $e.selectNodeOnly(ee.id); + }, { getNode: l } = f4(), d = (j) => { + const B = l(j.source), te = l(j.target); + if (j.sourceHandle === "loop_handle" || B.parentId) { + const q = r.getEdges(); + for (let ee of q) + if (ee.target === j.target) { + const X = l(ee.source); + if (j.sourceHandle === "loop_handle" && X.parentId !== B.id || B.parentId && X.parentId !== B.parentId) return !1; } } - return !(!F.parentId && Q.parentId && Q.parentId !== F.id); - }, { getNodesFromSource: f } = P4(), { getNodeRelativePosition: h } = N4(), { ensureParentInNodesBefore: p } = f4(), m = (q, F) => { - if (!F.isValid) + return !(!B.parentId && te.parentId && te.parentId !== B.id); + }, { getNodesFromSource: f } = N4(), { getNodeRelativePosition: h } = T4(), { ensureParentInNodesBefore: p } = h4(), m = (j, B) => { + if (!B.isValid) return; - const Q = F.toNode; - if (Q.parentId) + const te = B.toNode; + if (te.parentId) return; - const X = F.fromNode, re = F.fromHandle, ee = { position: { ...Q.position } }; - if (re.id === "loop_handle" ? ee.parentId = X.id : X.parentId && (ee.parentId = X.parentId), ee.parentId) { - const { x: L, y: te } = h(ee.parentId); - ee.position = { x: Q.position.x - L, y: Q.position.y - te }, r.updateNode(Q.id, ee), f(Q.id).forEach((ae) => { - r.updateNode(ae.id, { - parentId: ee.parentId, - position: { x: ae.position.x - L, y: ae.position.y - te } + const q = B.fromNode, ee = B.fromHandle, X = { position: { ...te.position } }; + if (ee.id === "loop_handle" ? X.parentId = q.id : q.parentId && (X.parentId = q.parentId), X.parentId) { + const { x: L, y: ne } = h(X.parentId); + X.position = { x: te.position.x - L, y: te.position.y - ne }, r.updateNode(te.id, X), f(te.id).forEach((le) => { + r.updateNode(le.id, { + parentId: X.parentId, + position: { x: le.position.x - L, y: le.position.y - ne } }); - }), p(ee.parentId, Q.id); + }), p(X.parentId, te.id); } setTimeout(() => { - Be.getEdges().forEach((L) => { - L.target === Q.id && L.source == X.id && (K(o, !0), K(i, L, !0)); + $e.getEdges().forEach((L) => { + L.target === te.id && L.source == q.id && (K(o, !0), K(i, L, !0)); }); }); - }, { getEdgesByTarget: y } = h4(), w = (q) => { - q.edges.forEach((Q) => { - Q.id === c(i)?.id && (K(i, null), K(o, !1)); - const X = l(Q.target); - if (X && X.parentId) { - const re = y(Q.target), { x: ee, y: L } = h(X.parentId); - if (re.length === 0) - r.updateNode(X.id, { + }, { getEdgesByTarget: y } = g4(), w = (j) => { + j.edges.forEach((te) => { + te.id === c(i)?.id && (K(i, null), K(o, !1)); + const q = l(te.target); + if (q && q.parentId) { + const ee = y(te.target), { x: X, y: L } = h(q.parentId); + if (ee.length === 0) + r.updateNode(q.id, { parentId: void 0, - position: { x: X.position.x + ee, y: X.position.y + L } - }), f(X.id).forEach((ve) => { - r.updateNode(ve.id, { + position: { x: q.position.x + X, y: q.position.y + L } + }), f(q.id).forEach((fe) => { + r.updateNode(fe.id, { parentId: void 0, - position: { x: ve.position.x + ee, y: ve.position.y + L } + position: { x: fe.position.x + X, y: fe.position.y + L } }); }); else { - let te = !1; - for (let ve = 0; ve < re.length; ve++) { - const ae = re[ve], le = l(ae.source); - if (le.parentId || le.type === "loopNode") { - te = !0; + let ne = !1; + for (let fe = 0; fe < ee.length; fe++) { + const le = ee[fe], ae = l(le.source); + if (ae.parentId || ae.type === "loopNode") { + ne = !0; break; } } - te || (r.updateNode(X.id, { + ne || (r.updateNode(q.id, { parentId: void 0, - position: { x: X.position.x + ee, y: X.position.y + L } - }), f(X.id).forEach((ae) => { - r.updateNode(ae.id, { + position: { x: q.position.x + X, y: q.position.y + L } + }), f(q.id).forEach((le) => { + r.updateNode(le.id, { parentId: void 0, - position: { x: ae.position.x + ee, y: ae.position.y + L } + position: { x: le.position.x + X, y: le.position.y + L } }); })); } } }); - }, { deleteEdge: b } = E4(), S = (q, F) => { - }, E = (q) => { - }, { copyHandler: x, pasteHandler: _ } = D4(), T = (q) => { - cd() || document.getSelection()?.type !== "Range" && ((q.ctrlKey || q.metaKey) && q.key === "c" ? (q.preventDefault(), x(q)) : (q.ctrlKey || q.metaKey) && q.key === "a" && (q.preventDefault(), Be.updateNodes((F) => F.map((Q) => ({ ...Q, selected: !0 }))), Be.updateEdges((F) => F.map((Q) => ({ ...Q, selected: !0 }))))); - }, I = async (q) => { - cd() || _(q); + }, { deleteEdge: b } = P4(), S = (j, B) => { + }, E = (j) => { + }, { copyHandler: x, pasteHandler: _ } = I4(), T = (j) => { + cd() || document.getSelection()?.type !== "Range" && ((j.ctrlKey || j.metaKey) && j.key === "c" ? (j.preventDefault(), x(j)) : (j.ctrlKey || j.metaKey) && j.key === "a" && (j.preventDefault(), $e.updateNodes((B) => B.map((te) => ({ ...te, selected: !0 }))), $e.updateEdges((B) => B.map((te) => ({ ...te, selected: !0 }))))); + }, I = async (j) => { + cd() || _(j); }; _n(() => { window.addEventListener("keydown", T), window.addEventListener("paste", I); }), ui(() => { window.removeEventListener("keydown", T), window.removeEventListener("paste", I); }); - const B = () => { - const q = document.getSelection(); - q && q.removeAllRanges(); + const F = () => { + const j = document.getSelection(); + j && j.removeAllRanges(); }, $ = { // ...nodeTypes }, H = vn().customNodes; if (H) - for (let q of Object.keys(H)) - $[q] = Xv; + for (let j of Object.keys(H)) + $[j] = jv; const N = vn().onDataChange; He(() => { N?.({ - nodes: Be.getNodes(), - edges: Be.getEdges(), - viewport: Be.getViewport() + nodes: $e.getNodes(), + edges: $e.getEdges(), + viewport: $e.getViewport() }); }); var k = { get onInit() { return n(); }, - set onInit(q) { - n(q), g(); + set onInit(j) { + n(j), g(); } - }, D = L4(), P = Z(D), A = Be.getNodes, R = Be.setNodes, M = Be.getEdges, Y = Be.setEdges, U = Be.getViewport, V = Be.setViewport; + }, D = H4(), P = Z(D), A = $e.getNodes, R = $e.setNodes, M = $e.getEdges, Y = $e.setEdges, G = $e.getViewport, z = $e.setViewport; { - let q = /* @__PURE__ */ C(() => vn().defaultTheme ?? "system"), F = /* @__PURE__ */ C(() => ({ ...s4, ...$ })), Q = /* @__PURE__ */ C(() => ({ + let j = /* @__PURE__ */ C(() => vn().defaultTheme ?? "system"), B = /* @__PURE__ */ C(() => ({ ...a4, ...$ })), te = /* @__PURE__ */ C(() => ({ markerEnd: { type: Uo.ArrowClosed, width: 20, height: 20 } })); - qh(P, { + Yh(P, { get colorMode() { - return c(q); + return c(j); }, get nodeTypes() { - return c(F); + return c(B); }, get nodes() { return A(); }, - set nodes(X) { - R(X); + set nodes(q) { + R(q); }, get edges() { return M(); }, - set edges(X) { - Y(X); + set edges(q) { + Y(q); }, get viewport() { - return U(); + return G(); }, - set viewport(X) { - V(X); + set viewport(q) { + z(q); }, class: "tinyflow-logo", ondrop: u, @@ -28016,91 +28042,91 @@ function jv(t, e) { onconnectstart: S, onconnect: E, connectionRadius: 50, - onpaneclick: B, - onedgeclick: (X) => { - K(o, !0), K(i, X.edge, !0); + onpaneclick: F, + onedgeclick: (q) => { + K(o, !0), K(i, q.edge, !0); }, - onbeforeconnect: (X) => ({ ...X, id: xn() }), + onbeforeconnect: (q) => ({ ...q, id: xn() }), ondelete: w, - onclick: (X) => { - const re = X.target; - re.classList.contains("svelte-flow__edge-interaction") || re.classList.contains("panel-content") || re.closest(".panel-content") || (K(o, !1), K(i, null)); + onclick: (q) => { + const ee = q.target; + ee.classList.contains("svelte-flow__edge-interaction") || ee.classList.contains("panel-content") || ee.closest(".panel-content") || (K(o, !1), K(i, null)); }, get defaultEdgeOptions() { - return c(Q); + return c(te); }, - children: (X, re) => { - var ee = M4(), L = J(ee); + children: (q, ee) => { + var X = L4(), L = J(X); rg(L, {}); - var te = z(L, 2); - eg(te, {}); - var ve = z(te, 2); - ig(ve, {}); - var ae = z(ve, 2); + var ne = V(L, 2); + eg(ne, {}); + var fe = V(ne, 2); + ig(fe, {}); + var le = V(fe, 2); { - var le = (oe) => { + var ae = (oe) => { mi(oe, { - children: (fe, we) => { - var xe = I4(), pe = z(Z(xe), 4), me = Z(pe); + children: (he, we) => { + var _e = M4(), ve = V(Z(_e), 4), ye = Z(ve); { let be = /* @__PURE__ */ C(() => c(i)?.data?.condition); - qe(me, { + je(ye, { rows: 3, placeholder: "请输入边条件", style: "width: 100%", get value() { return c(be); }, - onchange: (De) => { - c(i) && s(c(i).id, { condition: De.target?.value }); + onchange: (Te) => { + c(i) && s(c(i).id, { condition: Te.target?.value }); } }); } - W(pe); - var Ee = z(pe, 2), G = Z(Ee); - $e(G, { + W(ve); + var Ne = V(ve, 2), U = Z(Ne); + Fe(U, { variant: "destructive", onclick: () => { b(c(i)?.id), K(o, !1); }, - children: (be, De) => { + children: (be, Te) => { Se(); - var Pe = Me("删除"); - O(be, Pe); + var Ee = Ie("删除"); + O(be, Ee); }, $$slots: { default: !0 } }); - var Ue = z(G, 2); - $e(Ue, { + var Ye = V(U, 2); + Fe(Ye, { variant: "default", onclick: () => { K(o, !1); }, - children: (be, De) => { + children: (be, Te) => { Se(); - var Pe = Me("保存"); - O(be, Pe); + var Ee = Ie("保存"); + O(be, Ee); }, $$slots: { default: !0 } - }), W(Ee), W(xe), O(fe, xe); + }), W(Ne), W(_e), O(he, _e); }, $$slots: { default: !0 } }); }; - ie(ae, (oe) => { - c(o) && oe(le); + ie(le, (oe) => { + c(o) && oe(ae); }); } - O(X, ee); + O(q, X); }, $$slots: { default: !0 } }); } - var j = z(P, 2); - return qv(j, {}), W(D), O(t, D), ce(k); + var Q = V(P, 2); + return Yv(Q, {}), W(D), O(t, D), ce(k); } -se(jv, { onInit: {} }, [], [], !0); -function V4(t, e) { +se(Xv, { onInit: {} }, [], [], !0); +function z4(t, e) { ue(e, !0); const n = v(e, "options", 7), r = v(e, "onInit", 7); let { data: o } = n(); @@ -28110,7 +28136,7 @@ function V4(t, e) { } catch { console.error("Invalid JSON data:", o); } - Be.init(o?.nodes || [], o?.edges || []), zr("tinyflow_options", n()); + $e.init(o?.nodes || [], o?.edges || []), zr("tinyflow_options", n()); var i = { get options() { return n(); @@ -28125,9 +28151,9 @@ function V4(t, e) { r(s), g(); } }; - return Xh(t, { + return jh(t, { children: (s, a) => { - jv(s, { + Xv(s, { get onInit() { return r(); } @@ -28136,8 +28162,8 @@ function V4(t, e) { $$slots: { default: !0 } }), ce(i); } -customElements.define("tinyflow-component", se(V4, { options: {}, onInit: {} }, [], [], !1)); +customElements.define("tinyflow-component", se(z4, { options: {}, onInit: {} }, [], [], !1)); export { - B4 as Tinyflow + $4 as Tinyflow }; //# sourceMappingURL=index.js.map diff --git a/packages/ui/dist/index.js.map b/packages/ui/dist/index.js.map index fb18eecfb5adf4c64480bd83f28b457f258df304..d7973a6540c32f65ea2f7763bbc9907f1cd84708 100644 --- a/packages/ui/dist/index.js.map +++ b/packages/ui/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/version.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/disclose-version.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/constants.js","../../../node_modules/.pnpm/esm-env@1.2.2/node_modules/esm-env/false.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/shared/utils.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/constants.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/shared/errors.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/errors.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/warnings.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/hydration.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/reactivity/equality.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/flags/index.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/shared/clone.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/context.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/task.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/error-handling.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/reactivity/batch.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/reactivity/create-subscriber.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/boundary.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/each.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/reactivity/async.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/reactivity/deriveds.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/reactivity/sources.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/proxy.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/operations.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/misc.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/reactivity/effects.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/runtime.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/events.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/reconciler.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/template.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/utils.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/render.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/branches.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/snippet.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/index-client.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/attachments/index.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/if.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/key.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/css-props.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/html.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/svelte-component.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/svelte-element.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/blocks/svelte-head.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/css.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/actions.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/attachments.js","../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/shared/attributes.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/class.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/style.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/bindings/select.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/attributes.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/bindings/input.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/reactivity/store.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/reactivity/props.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/legacy/legacy-client.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/client/dom/elements/custom-element.js","../../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/sourceEvent.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/pointer.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/noevent.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/nodrag.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/constant.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/event.js","../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/drag.js","../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js","../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/numberArray.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/array.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/date.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/object.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/value.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/zoom.js","../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js","../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js","../../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js","../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/constant.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/event.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/noevent.js","../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/zoom.js","../../../node_modules/.pnpm/@xyflow+system@0.0.73/node_modules/@xyflow/system/dist/esm/index.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/Handle/Handle.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/nodes/DefaultNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/nodes/InputNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/nodes/OutputNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/nodes/GroupNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/actions/portal/portal.svelte.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/actions/portal/utils.svelte.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/utils/index.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/EdgeLabel/EdgeLabel.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/edges/BaseEdge.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/edges/BezierEdge.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/edges/SmoothStepEdgeInternal.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/edges/StraightEdgeInternal.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/edges/StepEdgeInternal.svelte","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/reactivity/map.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/reactivity/reactive-value.js","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/reactivity/media-query.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/store/visibleElements.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/store/initial-store.svelte.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/hooks/useStore.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/store/index.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/actions/zoom/index.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/container/Zoom/Zoom.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/container/Pane/Pane.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/container/Viewport/Viewport.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/actions/drag/index.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/A11yDescriptions/A11yDescriptions.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/A11yDescriptions/index.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/NodeWrapper/NodeWrapper.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/container/NodeRenderer/NodeRenderer.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/EdgeWrapper/EdgeWrapper.svelte","../../../node_modules/.pnpm/svelte@5.45.2/node_modules/svelte/src/internal/flags/legacy.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/container/EdgeRenderer/MarkerDefinition/MarkerDefinition.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/container/EdgeRenderer/MarkerDefinition/Marker.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/container/EdgeRenderer/EdgeRenderer.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/Selection/Selection.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/NodeSelection/NodeSelection.svelte","../../../node_modules/.pnpm/@svelte-put+shortcut@4.1.0_svelte@5.45.2/node_modules/@svelte-put/shortcut/src/shortcut.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/hooks/useSvelteFlow.svelte.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/KeyHandler/KeyHandler.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/ConnectionLine/ConnectionLine.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/container/Panel/Panel.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/Attribution/Attribution.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/container/SvelteFlow/Wrapper.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/container/SvelteFlow/SvelteFlow.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/components/SvelteFlowProvider/SvelteFlowProvider.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/plugins/Controls/ControlButton.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/plugins/Controls/Controls.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/plugins/Background/types.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/plugins/Background/DotPattern.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/plugins/Background/LinePattern.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/plugins/Background/Background.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/plugins/Minimap/MinimapNode.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/plugins/Minimap/interactive.js","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/plugins/Minimap/Minimap.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/plugins/NodeToolbar/NodeToolbar.svelte","../../../node_modules/.pnpm/@xyflow+svelte@1.4.2_svelte@5.45.2/node_modules/@xyflow/svelte/dist/lib/hooks/useNodesData.svelte.js","../src/consts.ts","../../../node_modules/.pnpm/runed@0.25.0_svelte@5.45.2/node_modules/runed/dist/internal/configurable-globals.js","../../../node_modules/.pnpm/runed@0.25.0_svelte@5.45.2/node_modules/runed/dist/internal/utils/dom.js","../../../node_modules/.pnpm/runed@0.25.0_svelte@5.45.2/node_modules/runed/dist/utilities/active-element/active-element.svelte.js","../../../node_modules/.pnpm/runed@0.25.0_svelte@5.45.2/node_modules/runed/dist/utilities/watch/watch.svelte.js","../../../node_modules/.pnpm/runed@0.25.0_svelte@5.45.2/node_modules/runed/dist/utilities/persisted-state/persisted-state.svelte.js","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/utils.js","../../../node_modules/.pnpm/svelte-toolbelt@0.7.1_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/is.js","../../../node_modules/.pnpm/svelte-toolbelt@0.7.1_svelte@5.45.2/node_modules/svelte-toolbelt/dist/box/box.svelte.js","../../../node_modules/.pnpm/inline-style-parser@0.2.7/node_modules/inline-style-parser/esm/index.mjs","../../../node_modules/.pnpm/style-to-object@1.0.14/node_modules/style-to-object/esm/index.mjs","../../../node_modules/.pnpm/svelte-toolbelt@0.7.1_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/style-to-css.js","../../../node_modules/.pnpm/svelte-toolbelt@0.7.1_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/style.js","../../../node_modules/.pnpm/runed@0.23.4_svelte@5.45.2/node_modules/runed/dist/internal/configurable-globals.js","../../../node_modules/.pnpm/runed@0.23.4_svelte@5.45.2/node_modules/runed/dist/internal/utils/dom.js","../../../node_modules/.pnpm/runed@0.23.4_svelte@5.45.2/node_modules/runed/dist/utilities/active-element/active-element.svelte.js","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/storage-keys.svelte.js","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/modes.js","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/mode-states.svelte.js","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/theme-state.svelte.js","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/without-transition.js","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/states.svelte.js","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/mode.js","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/components/mode-watcher-lite.svelte","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/components/mode-watcher-full.svelte","../../../node_modules/.pnpm/mode-watcher@1.1.0_svelte@5.45.2/node_modules/mode-watcher/dist/components/mode-watcher.svelte","../src/Tinyflow.ts","../src/store/stores.svelte.ts","../src/components/utils/cn.ts","../src/components/base/button.svelte","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/is.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/box/box-extras.svelte.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/compose-handlers.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/strings.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/css-to-style-obj.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/execute-callbacks.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/style-to-css.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/style.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/event-list.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/merge-props.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/sr-only-styles.js","../../../node_modules/.pnpm/runed@0.35.1_svelte@5.45.2/node_modules/runed/dist/internal/configurable-globals.js","../../../node_modules/.pnpm/runed@0.35.1_svelte@5.45.2/node_modules/runed/dist/internal/utils/dom.js","../../../node_modules/.pnpm/runed@0.35.1_svelte@5.45.2/node_modules/runed/dist/utilities/active-element/active-element.svelte.js","../../../node_modules/.pnpm/runed@0.35.1_svelte@5.45.2/node_modules/runed/dist/internal/utils/is.js","../../../node_modules/.pnpm/runed@0.35.1_svelte@5.45.2/node_modules/runed/dist/utilities/context/context.js","../../../node_modules/.pnpm/runed@0.35.1_svelte@5.45.2/node_modules/runed/dist/utilities/watch/watch.svelte.js","../../../node_modules/.pnpm/runed@0.35.1_svelte@5.45.2/node_modules/runed/dist/internal/utils/get.js","../../../node_modules/.pnpm/runed@0.35.1_svelte@5.45.2/node_modules/runed/dist/utilities/element-size/element-size.svelte.js","../../../node_modules/.pnpm/runed@0.35.1_svelte@5.45.2/node_modules/runed/dist/utilities/previous/previous.svelte.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/on-destroy-effect.svelte.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/on-mount-effect.svelte.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/after-sleep.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/after-tick.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/dom.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/dom-context.svelte.js","../../../node_modules/.pnpm/svelte-toolbelt@0.10.6_svelte@5.45.2/node_modules/svelte-toolbelt/dist/utils/attach-ref.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/attrs.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/kbd-constants.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/is.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/animations-complete.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/presence-manager.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/noop.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/create-id.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/portal/portal-consumer.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/config/bits-config.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/config/prop-resolvers.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/portal/portal.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/debounce.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/elements.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/dom.js","../../../node_modules/.pnpm/tabbable@6.4.0/node_modules/tabbable/dist/index.esm.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/arrays.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/box-auto-reset.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/dom-typeahead.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/menu/menu.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/escape-layer/use-escape-layer.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/escape-layer/escape-layer.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/focus-scope/focus-scope-manager.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/focus-scope/focus-scope.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/focus-scope/focus-scope.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/use-id.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/shared-state.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/body-scroll-lock.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/scroll-lock/scroll-lock.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/checkbox/checkbox.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/hidden-input.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/checkbox/components/checkbox-input.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/checkbox/components/checkbox.svelte","../../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../node_modules/.pnpm/@floating-ui+core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/floating-svelte/floating-utils.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/floating-svelte/use-floating.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/internal/data-typeahead.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/select/select.svelte.js","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/select/components/select-hidden-input.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-content.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-content-static.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-content.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-layer-inner.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-layer.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-layer-force-mount.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/select/components/select-content.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/utilities/mounted.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/select/components/select-item.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/select/components/select-viewport.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/select/components/select.svelte","../../../node_modules/.pnpm/bits-ui@2.16.5_@internationalized+date@3.12.0_svelte@5.45.2/node_modules/bits-ui/dist/bits/select/components/select-trigger.svelte","../../../node_modules/.pnpm/@lucide+svelte@1.7.0_svelte@5.45.2/node_modules/@lucide/svelte/dist/defaultAttributes.js","../../../node_modules/.pnpm/@lucide+svelte@1.7.0_svelte@5.45.2/node_modules/@lucide/svelte/dist/utils/hasA11yProp.js","../../../node_modules/.pnpm/@lucide+svelte@1.7.0_svelte@5.45.2/node_modules/@lucide/svelte/dist/context.js","../../../node_modules/.pnpm/@lucide+svelte@1.7.0_svelte@5.45.2/node_modules/@lucide/svelte/dist/Icon.svelte","../../../node_modules/.pnpm/@lucide+svelte@1.7.0_svelte@5.45.2/node_modules/@lucide/svelte/dist/icons/check.svelte","../../../node_modules/.pnpm/@lucide+svelte@1.7.0_svelte@5.45.2/node_modules/@lucide/svelte/dist/icons/minus.svelte","../src/components/base/checkbox.svelte","../src/components/base/chosen.svelte","../src/components/base/input.svelte","../src/components/base/textarea.svelte","../src/components/base/tabs.svelte","../src/components/base/collapse.svelte","../src/components/base/render.svelte","../../../node_modules/.pnpm/@lucide+svelte@1.7.0_svelte@5.45.2/node_modules/@lucide/svelte/dist/icons/chevron-down.svelte","../src/components/utils/NodeUtils.ts","../src/components/base/select.svelte","../src/components/utils/createFloating.ts","../src/components/base/floating-trigger.svelte","../src/components/base/heading.svelte","../src/components/base/menu-button.svelte","../src/components/utils/useDeleteNode.svelte.ts","../src/components/utils/IdGen.ts","../src/components/utils/deepClone.ts","../src/components/utils/useCopyNode.svelte.ts","../src/components/core/NodeWrapper.svelte","../src/components/core/DefinedParameterItem.svelte","../src/components/core/DefinedParameterList.svelte","../src/components/utils/useAddParameter.svelte.ts","../src/components/nodes/StartNode.svelte","../src/components/utils/useRefOptions.svelte.ts","../src/components/core/RefParameterItem.svelte","../src/components/core/RefParameterList.svelte","../src/components/nodes/EndNode.svelte","../src/components/core/OutputDefItem.svelte","../src/components/core/OutputDefList.svelte","../src/components/nodes/LLMNode.svelte","../src/components/nodes/CodeNode.svelte","../src/components/nodes/TemplateNode.svelte","../src/components/nodes/HttpNode.svelte","../src/components/nodes/KnowledgeNode.svelte","../src/components/nodes/SearchEngineNode.svelte","../src/components/nodes/LoopNode.svelte","../src/components/core/ConfirmParameterItem.svelte","../src/components/core/ConfirmParameterList.svelte","../src/components/utils/deepEqual.ts","../src/components/nodes/ConfirmNode.svelte","../src/components/nodes/index.ts","../src/components/core/DraggableButton.svelte","../src/components/Toolbar.svelte","../src/components/utils/useGetNode.svelte.ts","../src/components/utils/useEnsureParentInNodesBefore.svelte.ts","../src/components/utils/useGetEdgesByTarget.svelte.ts","../src/components/nodes/CustomNode.svelte","../src/components/utils/useUpdateEdgeData.svelte.ts","../src/components/utils/useDeleteEdge.svelte.ts","../src/components/utils/useGetNodesFromSource.svelte.ts","../src/components/utils/useGetNodeRelativePosition.svelte.ts","../src/components/utils/useCopyPasteHandler.svelte.ts","../src/components/utils/isInEditableElement.ts","../src/components/TinyflowCore.svelte","../src/components/TinyflowComponent.svelte"],"sourcesContent":["// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n * @type {string}\n */\nexport const VERSION = '5.45.2';\nexport const PUBLIC_VERSION = '5';\n","import { PUBLIC_VERSION } from '../version.js';\n\nif (typeof window !== 'undefined') {\n\t// @ts-expect-error\n\t((window.__svelte ??= {}).v ??= new Set()).add(PUBLIC_VERSION);\n}\n","export const EACH_ITEM_REACTIVE = 1;\nexport const EACH_INDEX_REACTIVE = 1 << 1;\n/** See EachBlock interface metadata.is_controlled for an explanation what this is */\nexport const EACH_IS_CONTROLLED = 1 << 2;\nexport const EACH_IS_ANIMATED = 1 << 3;\nexport const EACH_ITEM_IMMUTABLE = 1 << 4;\n\nexport const PROPS_IS_IMMUTABLE = 1;\nexport const PROPS_IS_RUNES = 1 << 1;\nexport const PROPS_IS_UPDATED = 1 << 2;\nexport const PROPS_IS_BINDABLE = 1 << 3;\nexport const PROPS_IS_LAZY_INITIAL = 1 << 4;\n\nexport const TRANSITION_IN = 1;\nexport const TRANSITION_OUT = 1 << 1;\nexport const TRANSITION_GLOBAL = 1 << 2;\n\nexport const TEMPLATE_FRAGMENT = 1;\nexport const TEMPLATE_USE_IMPORT_NODE = 1 << 1;\nexport const TEMPLATE_USE_SVG = 1 << 2;\nexport const TEMPLATE_USE_MATHML = 1 << 3;\n\nexport const HYDRATION_START = '[';\n/** used to indicate that an `{:else}...` block was rendered */\nexport const HYDRATION_START_ELSE = '[!';\nexport const HYDRATION_END = ']';\nexport const HYDRATION_ERROR = {};\n\nexport const ELEMENT_IS_NAMESPACED = 1;\nexport const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;\nexport const ELEMENT_IS_INPUT = 1 << 2;\n\nexport const UNINITIALIZED = Symbol();\n\n// Dev-time component properties\nexport const FILENAME = Symbol('filename');\nexport const HMR = Symbol('hmr');\n\nexport const NAMESPACE_HTML = 'http://www.w3.org/1999/xhtml';\nexport const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';\nexport const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';\n\n// we use a list of ignorable runtime warnings because not every runtime warning\n// can be ignored and we want to keep the validation for svelte-ignore in place\nexport const IGNORABLE_RUNTIME_WARNINGS = /** @type {const} */ ([\n\t'await_waterfall',\n\t'await_reactivity_loss',\n\t'state_snapshot_uncloneable',\n\t'binding_property_non_reactive',\n\t'hydration_attribute_changed',\n\t'hydration_html_changed',\n\t'ownership_invalid_binding',\n\t'ownership_invalid_mutation'\n]);\n\n/**\n * Whitespace inside one of these elements will not result in\n * a whitespace node being created in any circumstances. (This\n * list is almost certainly very incomplete)\n * TODO this is currently unused\n */\nexport const ELEMENTS_WITHOUT_TEXT = ['audio', 'datalist', 'dl', 'optgroup', 'select', 'video'];\n\nexport const ATTACHMENT_KEY = '@attach';\n","export default false;\n","// Store the references to globals in case someone tries to monkey patch these, causing the below\n// to de-opt (this occurs often when using popular extensions).\nexport var is_array = Array.isArray;\nexport var index_of = Array.prototype.indexOf;\nexport var array_from = Array.from;\nexport var object_keys = Object.keys;\nexport var define_property = Object.defineProperty;\nexport var get_descriptor = Object.getOwnPropertyDescriptor;\nexport var get_descriptors = Object.getOwnPropertyDescriptors;\nexport var object_prototype = Object.prototype;\nexport var array_prototype = Array.prototype;\nexport var get_prototype_of = Object.getPrototypeOf;\nexport var is_extensible = Object.isExtensible;\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\nexport const noop = () => {};\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n\n/**\n * @template [T=any]\n * @param {any} value\n * @returns {value is PromiseLike}\n */\nexport function is_promise(value) {\n\treturn typeof value?.then === 'function';\n}\n\n/** @param {Function} fn */\nexport function run(fn) {\n\treturn fn();\n}\n\n/** @param {Array<() => void>} arr */\nexport function run_all(arr) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tarr[i]();\n\t}\n}\n\n/**\n * TODO replace with Promise.withResolvers once supported widely enough\n * @template [T=void]\n */\nexport function deferred() {\n\t/** @type {(value: T) => void} */\n\tvar resolve;\n\n\t/** @type {(reason: any) => void} */\n\tvar reject;\n\n\t/** @type {Promise} */\n\tvar promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\n\t// @ts-expect-error\n\treturn { promise, resolve, reject };\n}\n\n/**\n * @template V\n * @param {V} value\n * @param {V | (() => V)} fallback\n * @param {boolean} [lazy]\n * @returns {V}\n */\nexport function fallback(value, fallback, lazy = false) {\n\treturn value === undefined\n\t\t? lazy\n\t\t\t? /** @type {() => V} */ (fallback)()\n\t\t\t: /** @type {V} */ (fallback)\n\t\t: value;\n}\n\n/**\n * When encountering a situation like `let [a, b, c] = $derived(blah())`,\n * we need to stash an intermediate value that `a`, `b`, and `c` derive\n * from, in case it's an iterable\n * @template T\n * @param {ArrayLike | Iterable} value\n * @param {number} [n]\n * @returns {Array}\n */\nexport function to_array(value, n) {\n\t// return arrays unchanged\n\tif (Array.isArray(value)) {\n\t\treturn value;\n\t}\n\n\t// if value is not iterable, or `n` is unspecified (indicates a rest\n\t// element, which means we're not concerned about unbounded iterables)\n\t// convert to an array with `Array.from`\n\tif (n === undefined || !(Symbol.iterator in value)) {\n\t\treturn Array.from(value);\n\t}\n\n\t// otherwise, populate an array with `n` values\n\n\t/** @type {T[]} */\n\tconst array = [];\n\n\tfor (const element of value) {\n\t\tarray.push(element);\n\t\tif (array.length === n) break;\n\t}\n\n\treturn array;\n}\n","// General flags\nexport const DERIVED = 1 << 1;\nexport const EFFECT = 1 << 2;\nexport const RENDER_EFFECT = 1 << 3;\n/**\n * An effect that does not destroy its child effects when it reruns.\n * Runs as part of render effects, i.e. not eagerly as part of tree traversal or effect flushing.\n */\nexport const MANAGED_EFFECT = 1 << 24;\n/**\n * An effect that does not destroy its child effects when it reruns (like MANAGED_EFFECT).\n * Runs eagerly as part of tree traversal or effect flushing.\n */\nexport const BLOCK_EFFECT = 1 << 4;\nexport const BRANCH_EFFECT = 1 << 5;\nexport const ROOT_EFFECT = 1 << 6;\nexport const BOUNDARY_EFFECT = 1 << 7;\n/**\n * Indicates that a reaction is connected to an effect root — either it is an effect,\n * or it is a derived that is depended on by at least one effect. If a derived has\n * no dependents, we can disconnect it from the graph, allowing it to either be\n * GC'd or reconnected later if an effect comes to depend on it again\n */\nexport const CONNECTED = 1 << 9;\nexport const CLEAN = 1 << 10;\nexport const DIRTY = 1 << 11;\nexport const MAYBE_DIRTY = 1 << 12;\nexport const INERT = 1 << 13;\nexport const DESTROYED = 1 << 14;\n\n// Flags exclusive to effects\n/** Set once an effect that should run synchronously has run */\nexport const EFFECT_RAN = 1 << 15;\n/**\n * 'Transparent' effects do not create a transition boundary.\n * This is on a block effect 99% of the time but may also be on a branch effect if its parent block effect was pruned\n */\nexport const EFFECT_TRANSPARENT = 1 << 16;\nexport const EAGER_EFFECT = 1 << 17;\nexport const HEAD_EFFECT = 1 << 18;\nexport const EFFECT_PRESERVED = 1 << 19;\nexport const USER_EFFECT = 1 << 20;\n\n// Flags exclusive to deriveds\n/**\n * Tells that we marked this derived and its reactions as visited during the \"mark as (maybe) dirty\"-phase.\n * Will be lifted during execution of the derived and during checking its dirty state (both are necessary\n * because a derived might be checked but not executed).\n */\nexport const WAS_MARKED = 1 << 15;\n\n// Flags used for async\nexport const REACTION_IS_UPDATING = 1 << 21;\nexport const ASYNC = 1 << 22;\n\nexport const ERROR_VALUE = 1 << 23;\n\nexport const STATE_SYMBOL = Symbol('$state');\nexport const LEGACY_PROPS = Symbol('legacy props');\nexport const LOADING_ATTR_SYMBOL = Symbol('');\nexport const PROXY_PATH_SYMBOL = Symbol('proxy path');\n\n/** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */\nexport const STALE_REACTION = new (class StaleReactionError extends Error {\n\tname = 'StaleReactionError';\n\tmessage = 'The reaction that called `getAbortSignal()` was re-run or destroyed';\n})();\n\nexport const ELEMENT_NODE = 1;\nexport const TEXT_NODE = 3;\nexport const COMMENT_NODE = 8;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\n/**\n * Cannot use `%name%(...)` unless the `experimental.async` compiler option is `true`\n * @param {string} name\n * @returns {never}\n */\nexport function experimental_async_required(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`experimental_async_required\\nCannot use \\`${name}(...)\\` unless the \\`experimental.async\\` compiler option is \\`true\\`\\nhttps://svelte.dev/e/experimental_async_required`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/experimental_async_required`);\n\t}\n}\n\n/**\n * Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead\n * @returns {never}\n */\nexport function invalid_default_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_default_snippet\\nCannot use \\`{@render children(...)}\\` if the parent component uses \\`let:\\` directives. Consider using a named snippet instead\\nhttps://svelte.dev/e/invalid_default_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_default_snippet`);\n\t}\n}\n\n/**\n * A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`\n * @returns {never}\n */\nexport function invalid_snippet_arguments() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet_arguments\\nA snippet function was passed invalid arguments. Snippets should only be instantiated via \\`{@render ...}\\`\\nhttps://svelte.dev/e/invalid_snippet_arguments`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet_arguments`);\n\t}\n}\n\n/**\n * `%name%(...)` can only be used during component initialisation\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_outside_component(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_outside_component\\n\\`${name}(...)\\` can only be used during component initialisation\\nhttps://svelte.dev/e/lifecycle_outside_component`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_outside_component`);\n\t}\n}\n\n/**\n * Context was not set in a parent component\n * @returns {never}\n */\nexport function missing_context() {\n\tif (DEV) {\n\t\tconst error = new Error(`missing_context\\nContext was not set in a parent component\\nhttps://svelte.dev/e/missing_context`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/missing_context`);\n\t}\n}\n\n/**\n * Attempted to render a snippet without a `{@render}` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change `{snippet}` to `{@render snippet()}`.\n * @returns {never}\n */\nexport function snippet_without_render_tag() {\n\tif (DEV) {\n\t\tconst error = new Error(`snippet_without_render_tag\\nAttempted to render a snippet without a \\`{@render}\\` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change \\`{snippet}\\` to \\`{@render snippet()}\\`.\\nhttps://svelte.dev/e/snippet_without_render_tag`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/snippet_without_render_tag`);\n\t}\n}\n\n/**\n * `%name%` is not a store with a `subscribe` method\n * @param {string} name\n * @returns {never}\n */\nexport function store_invalid_shape(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`store_invalid_shape\\n\\`${name}\\` is not a store with a \\`subscribe\\` method\\nhttps://svelte.dev/e/store_invalid_shape`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/store_invalid_shape`);\n\t}\n}\n\n/**\n * The `this` prop on `` must be a string, if defined\n * @returns {never}\n */\nexport function svelte_element_invalid_this_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_element_invalid_this_value\\nThe \\`this\\` prop on \\`\\` must be a string, if defined\\nhttps://svelte.dev/e/svelte_element_invalid_this_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_element_invalid_this_value`);\n\t}\n}","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nexport * from '../shared/errors.js';\n\n/**\n * Cannot create a `$derived(...)` with an `await` expression outside of an effect tree\n * @returns {never}\n */\nexport function async_derived_orphan() {\n\tif (DEV) {\n\t\tconst error = new Error(`async_derived_orphan\\nCannot create a \\`$derived(...)\\` with an \\`await\\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/async_derived_orphan`);\n\t}\n}\n\n/**\n * Using `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\n * @returns {never}\n */\nexport function bind_invalid_checkbox_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_checkbox_value\\nUsing \\`bind:value\\` together with a checkbox input is not allowed. Use \\`bind:checked\\` instead\\nhttps://svelte.dev/e/bind_invalid_checkbox_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_checkbox_value`);\n\t}\n}\n\n/**\n * Component %component% has an export named `%key%` that a consumer component is trying to access using `bind:%key%`, which is disallowed. Instead, use `bind:this` (e.g. `<%name% bind:this={component} />`) and then access the property on the bound component instance (e.g. `component.%key%`)\n * @param {string} component\n * @param {string} key\n * @param {string} name\n * @returns {never}\n */\nexport function bind_invalid_export(component, key, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_export\\nComponent ${component} has an export named \\`${key}\\` that a consumer component is trying to access using \\`bind:${key}\\`, which is disallowed. Instead, use \\`bind:this\\` (e.g. \\`<${name} bind:this={component} />\\`) and then access the property on the bound component instance (e.g. \\`component.${key}\\`)\\nhttps://svelte.dev/e/bind_invalid_export`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_export`);\n\t}\n}\n\n/**\n * A component is attempting to bind to a non-bindable property `%key%` belonging to %component% (i.e. `<%name% bind:%key%={...}>`). To mark a property as bindable: `let { %key% = $bindable() } = $props()`\n * @param {string} key\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function bind_not_bindable(key, component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_not_bindable\\nA component is attempting to bind to a non-bindable property \\`${key}\\` belonging to ${component} (i.e. \\`<${name} bind:${key}={...}>\\`). To mark a property as bindable: \\`let { ${key} = $bindable() } = $props()\\`\\nhttps://svelte.dev/e/bind_not_bindable`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_not_bindable`);\n\t}\n}\n\n/**\n * Calling `%method%` on a component instance (of %component%) is no longer valid in Svelte 5\n * @param {string} method\n * @param {string} component\n * @returns {never}\n */\nexport function component_api_changed(method, component) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_changed\\nCalling \\`${method}\\` on a component instance (of ${component}) is no longer valid in Svelte 5\\nhttps://svelte.dev/e/component_api_changed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_changed`);\n\t}\n}\n\n/**\n * Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working.\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function component_api_invalid_new(component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_invalid_new\\nAttempted to instantiate ${component} with \\`new ${name}\\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \\`compatibility.componentApi\\` compiler option to \\`4\\` to keep it working.\\nhttps://svelte.dev/e/component_api_invalid_new`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_invalid_new`);\n\t}\n}\n\n/**\n * A derived value cannot reference itself recursively\n * @returns {never}\n */\nexport function derived_references_self() {\n\tif (DEV) {\n\t\tconst error = new Error(`derived_references_self\\nA derived value cannot reference itself recursively\\nhttps://svelte.dev/e/derived_references_self`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/derived_references_self`);\n\t}\n}\n\n/**\n * Keyed each block has duplicate key `%value%` at indexes %a% and %b%\n * @param {string} a\n * @param {string} b\n * @param {string | undefined | null} [value]\n * @returns {never}\n */\nexport function each_key_duplicate(a, b, value) {\n\tif (DEV) {\n\t\tconst error = new Error(`each_key_duplicate\\n${value\n\t\t\t? `Keyed each block has duplicate key \\`${value}\\` at indexes ${a} and ${b}`\n\t\t\t: `Keyed each block has duplicate key at indexes ${a} and ${b}`}\\nhttps://svelte.dev/e/each_key_duplicate`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/each_key_duplicate`);\n\t}\n}\n\n/**\n * `%rune%` cannot be used inside an effect cleanup function\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_in_teardown(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_teardown\\n\\`${rune}\\` cannot be used inside an effect cleanup function\\nhttps://svelte.dev/e/effect_in_teardown`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_teardown`);\n\t}\n}\n\n/**\n * Effect cannot be created inside a `$derived` value that was not itself created inside an effect\n * @returns {never}\n */\nexport function effect_in_unowned_derived() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_unowned_derived\\nEffect cannot be created inside a \\`$derived\\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_unowned_derived`);\n\t}\n}\n\n/**\n * `%rune%` can only be used inside an effect (e.g. during component initialisation)\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_orphan(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_orphan\\n\\`${rune}\\` can only be used inside an effect (e.g. during component initialisation)\\nhttps://svelte.dev/e/effect_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_orphan`);\n\t}\n}\n\n/**\n * `$effect.pending()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function effect_pending_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_pending_outside_reaction\\n\\`$effect.pending()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/effect_pending_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_pending_outside_reaction`);\n\t}\n}\n\n/**\n * Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\n * @returns {never}\n */\nexport function effect_update_depth_exceeded() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_update_depth_exceeded\\nMaximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\\nhttps://svelte.dev/e/effect_update_depth_exceeded`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);\n\t}\n}\n\n/**\n * Cannot use `flushSync` inside an effect\n * @returns {never}\n */\nexport function flush_sync_in_effect() {\n\tif (DEV) {\n\t\tconst error = new Error(`flush_sync_in_effect\\nCannot use \\`flushSync\\` inside an effect\\nhttps://svelte.dev/e/flush_sync_in_effect`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/flush_sync_in_effect`);\n\t}\n}\n\n/**\n * Cannot commit a fork that was already discarded\n * @returns {never}\n */\nexport function fork_discarded() {\n\tif (DEV) {\n\t\tconst error = new Error(`fork_discarded\\nCannot commit a fork that was already discarded\\nhttps://svelte.dev/e/fork_discarded`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/fork_discarded`);\n\t}\n}\n\n/**\n * Cannot create a fork inside an effect or when state changes are pending\n * @returns {never}\n */\nexport function fork_timing() {\n\tif (DEV) {\n\t\tconst error = new Error(`fork_timing\\nCannot create a fork inside an effect or when state changes are pending\\nhttps://svelte.dev/e/fork_timing`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/fork_timing`);\n\t}\n}\n\n/**\n * `getAbortSignal()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function get_abort_signal_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`get_abort_signal_outside_reaction\\n\\`getAbortSignal()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/get_abort_signal_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/get_abort_signal_outside_reaction`);\n\t}\n}\n\n/**\n * Expected to find a hydratable with key `%key%` during hydration, but did not.\n * @param {string} key\n * @returns {never}\n */\nexport function hydratable_missing_but_required(key) {\n\tif (DEV) {\n\t\tconst error = new Error(`hydratable_missing_but_required\\nExpected to find a hydratable with key \\`${key}\\` during hydration, but did not.\\nhttps://svelte.dev/e/hydratable_missing_but_required`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/hydratable_missing_but_required`);\n\t}\n}\n\n/**\n * Failed to hydrate the application\n * @returns {never}\n */\nexport function hydration_failed() {\n\tif (DEV) {\n\t\tconst error = new Error(`hydration_failed\\nFailed to hydrate the application\\nhttps://svelte.dev/e/hydration_failed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/hydration_failed`);\n\t}\n}\n\n/**\n * Could not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\n * @returns {never}\n */\nexport function invalid_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet\\nCould not \\`{@render}\\` snippet due to the expression being \\`null\\` or \\`undefined\\`. Consider using optional chaining \\`{@render snippet?.()}\\`\\nhttps://svelte.dev/e/invalid_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet`);\n\t}\n}\n\n/**\n * `%name%(...)` cannot be used in runes mode\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_legacy_only(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_legacy_only\\n\\`${name}(...)\\` cannot be used in runes mode\\nhttps://svelte.dev/e/lifecycle_legacy_only`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_legacy_only`);\n\t}\n}\n\n/**\n * Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value\n * @param {string} key\n * @returns {never}\n */\nexport function props_invalid_value(key) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_invalid_value\\nCannot do \\`bind:${key}={undefined}\\` when \\`${key}\\` has a fallback value\\nhttps://svelte.dev/e/props_invalid_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_invalid_value`);\n\t}\n}\n\n/**\n * Rest element properties of `$props()` such as `%property%` are readonly\n * @param {string} property\n * @returns {never}\n */\nexport function props_rest_readonly(property) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_rest_readonly\\nRest element properties of \\`$props()\\` such as \\`${property}\\` are readonly\\nhttps://svelte.dev/e/props_rest_readonly`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_rest_readonly`);\n\t}\n}\n\n/**\n * The `%rune%` rune is only available inside `.svelte` and `.svelte.js/ts` files\n * @param {string} rune\n * @returns {never}\n */\nexport function rune_outside_svelte(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`rune_outside_svelte\\nThe \\`${rune}\\` rune is only available inside \\`.svelte\\` and \\`.svelte.js/ts\\` files\\nhttps://svelte.dev/e/rune_outside_svelte`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/rune_outside_svelte`);\n\t}\n}\n\n/**\n * `setContext` must be called when a component first initializes, not in a subsequent effect or after an `await` expression\n * @returns {never}\n */\nexport function set_context_after_init() {\n\tif (DEV) {\n\t\tconst error = new Error(`set_context_after_init\\n\\`setContext\\` must be called when a component first initializes, not in a subsequent effect or after an \\`await\\` expression\\nhttps://svelte.dev/e/set_context_after_init`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/set_context_after_init`);\n\t}\n}\n\n/**\n * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\n * @returns {never}\n */\nexport function state_descriptors_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_descriptors_fixed\\nProperty descriptors defined on \\`$state\\` objects must contain \\`value\\` and always be \\`enumerable\\`, \\`configurable\\` and \\`writable\\`.\\nhttps://svelte.dev/e/state_descriptors_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_descriptors_fixed`);\n\t}\n}\n\n/**\n * Cannot set prototype of `$state` object\n * @returns {never}\n */\nexport function state_prototype_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_prototype_fixed\\nCannot set prototype of \\`$state\\` object\\nhttps://svelte.dev/e/state_prototype_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_prototype_fixed`);\n\t}\n}\n\n/**\n * Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\n * @returns {never}\n */\nexport function state_unsafe_mutation() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_unsafe_mutation\\nUpdating state inside \\`$derived(...)\\`, \\`$inspect(...)\\` or a template expression is forbidden. If the value should not be reactive, declare it without \\`$state\\`\\nhttps://svelte.dev/e/state_unsafe_mutation`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_unsafe_mutation`);\n\t}\n}\n\n/**\n * A `` `reset` function cannot be called while an error is still being handled\n * @returns {never}\n */\nexport function svelte_boundary_reset_onerror() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_boundary_reset_onerror\\nA \\`\\` \\`reset\\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);\n\t}\n}","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nvar bold = 'font-weight: bold';\nvar normal = 'font-weight: normal';\n\n/**\n * Assignment to `%property%` property (%location%) will evaluate to the right-hand side, not the value of `%property%` following the assignment. This may result in unexpected behaviour.\n * @param {string} property\n * @param {string} location\n */\nexport function assignment_value_stale(property, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] assignment_value_stale\\n%cAssignment to \\`${property}\\` property (${location}) will evaluate to the right-hand side, not the value of \\`${property}\\` following the assignment. This may result in unexpected behaviour.\\nhttps://svelte.dev/e/assignment_value_stale`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/assignment_value_stale`);\n\t}\n}\n\n/**\n * Detected reactivity loss when reading `%name%`. This happens when state is read in an async function after an earlier `await`\n * @param {string} name\n */\nexport function await_reactivity_loss(name) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] await_reactivity_loss\\n%cDetected reactivity loss when reading \\`${name}\\`. This happens when state is read in an async function after an earlier \\`await\\`\\nhttps://svelte.dev/e/await_reactivity_loss`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/await_reactivity_loss`);\n\t}\n}\n\n/**\n * An async derived, `%name%` (%location%) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\n * @param {string} name\n * @param {string} location\n */\nexport function await_waterfall(name, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] await_waterfall\\n%cAn async derived, \\`${name}\\` (${location}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\\nhttps://svelte.dev/e/await_waterfall`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/await_waterfall`);\n\t}\n}\n\n/**\n * `%binding%` (%location%) is binding to a non-reactive property\n * @param {string} binding\n * @param {string | undefined | null} [location]\n */\nexport function binding_property_non_reactive(binding, location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] binding_property_non_reactive\\n%c${location\n\t\t\t\t? `\\`${binding}\\` (${location}) is binding to a non-reactive property`\n\t\t\t\t: `\\`${binding}\\` is binding to a non-reactive property`}\\nhttps://svelte.dev/e/binding_property_non_reactive`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/binding_property_non_reactive`);\n\t}\n}\n\n/**\n * Your `console.%method%` contained `$state` proxies. Consider using `$inspect(...)` or `$state.snapshot(...)` instead\n * @param {string} method\n */\nexport function console_log_state(method) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] console_log_state\\n%cYour \\`console.${method}\\` contained \\`$state\\` proxies. Consider using \\`$inspect(...)\\` or \\`$state.snapshot(...)\\` instead\\nhttps://svelte.dev/e/console_log_state`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/console_log_state`);\n\t}\n}\n\n/**\n * %handler% should be a function. Did you mean to %suggestion%?\n * @param {string} handler\n * @param {string} suggestion\n */\nexport function event_handler_invalid(handler, suggestion) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] event_handler_invalid\\n%c${handler} should be a function. Did you mean to ${suggestion}?\\nhttps://svelte.dev/e/event_handler_invalid`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/event_handler_invalid`);\n\t}\n}\n\n/**\n * Expected to find a hydratable with key `%key%` during hydration, but did not.\n * @param {string} key\n */\nexport function hydratable_missing_but_expected(key) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydratable_missing_but_expected\\n%cExpected to find a hydratable with key \\`${key}\\` during hydration, but did not.\\nhttps://svelte.dev/e/hydratable_missing_but_expected`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydratable_missing_but_expected`);\n\t}\n}\n\n/**\n * The `%attribute%` attribute on `%html%` changed its value between server and client renders. The client value, `%value%`, will be ignored in favour of the server value\n * @param {string} attribute\n * @param {string} html\n * @param {string} value\n */\nexport function hydration_attribute_changed(attribute, html, value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydration_attribute_changed\\n%cThe \\`${attribute}\\` attribute on \\`${html}\\` changed its value between server and client renders. The client value, \\`${value}\\`, will be ignored in favour of the server value\\nhttps://svelte.dev/e/hydration_attribute_changed`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_attribute_changed`);\n\t}\n}\n\n/**\n * The value of an `{@html ...}` block %location% changed between server and client renders. The client value will be ignored in favour of the server value\n * @param {string | undefined | null} [location]\n */\nexport function hydration_html_changed(location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] hydration_html_changed\\n%c${location\n\t\t\t\t? `The value of an \\`{@html ...}\\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value`\n\t\t\t\t: 'The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value'}\\nhttps://svelte.dev/e/hydration_html_changed`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_html_changed`);\n\t}\n}\n\n/**\n * Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location%\n * @param {string | undefined | null} [location]\n */\nexport function hydration_mismatch(location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] hydration_mismatch\\n%c${location\n\t\t\t\t? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}`\n\t\t\t\t: 'Hydration failed because the initial UI does not match what was rendered on the server'}\\nhttps://svelte.dev/e/hydration_mismatch`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_mismatch`);\n\t}\n}\n\n/**\n * The `render` function passed to `createRawSnippet` should return HTML for a single element\n */\nexport function invalid_raw_snippet_render() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] invalid_raw_snippet_render\\n%cThe \\`render\\` function passed to \\`createRawSnippet\\` should return HTML for a single element\\nhttps://svelte.dev/e/invalid_raw_snippet_render`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/invalid_raw_snippet_render`);\n\t}\n}\n\n/**\n * Detected a migrated `$:` reactive block in `%filename%` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.\n * @param {string} filename\n */\nexport function legacy_recursive_reactive_block(filename) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] legacy_recursive_reactive_block\\n%cDetected a migrated \\`$:\\` reactive block in \\`${filename}\\` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \\`$effect\\`.\\nhttps://svelte.dev/e/legacy_recursive_reactive_block`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/legacy_recursive_reactive_block`);\n\t}\n}\n\n/**\n * Tried to unmount a component that was not mounted\n */\nexport function lifecycle_double_unmount() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] lifecycle_double_unmount\\n%cTried to unmount a component that was not mounted\\nhttps://svelte.dev/e/lifecycle_double_unmount`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/lifecycle_double_unmount`);\n\t}\n}\n\n/**\n * %parent% passed property `%prop%` to %child% with `bind:`, but its parent component %owner% did not declare `%prop%` as a binding. Consider creating a binding between %owner% and %parent% (e.g. `bind:%prop%={...}` instead of `%prop%={...}`)\n * @param {string} parent\n * @param {string} prop\n * @param {string} child\n * @param {string} owner\n */\nexport function ownership_invalid_binding(parent, prop, child, owner) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_binding\\n%c${parent} passed property \\`${prop}\\` to ${child} with \\`bind:\\`, but its parent component ${owner} did not declare \\`${prop}\\` as a binding. Consider creating a binding between ${owner} and ${parent} (e.g. \\`bind:${prop}={...}\\` instead of \\`${prop}={...}\\`)\\nhttps://svelte.dev/e/ownership_invalid_binding`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_binding`);\n\t}\n}\n\n/**\n * Mutating unbound props (`%name%`, at %location%) is strongly discouraged. Consider using `bind:%prop%={...}` in %parent% (or using a callback) instead\n * @param {string} name\n * @param {string} location\n * @param {string} prop\n * @param {string} parent\n */\nexport function ownership_invalid_mutation(name, location, prop, parent) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_mutation\\n%cMutating unbound props (\\`${name}\\`, at ${location}) is strongly discouraged. Consider using \\`bind:${prop}={...}\\` in ${parent} (or using a callback) instead\\nhttps://svelte.dev/e/ownership_invalid_mutation`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_mutation`);\n\t}\n}\n\n/**\n * The `value` property of a `\\` element should be an array, but it received a non-array value. The selection will be kept as is.\\nhttps://svelte.dev/e/select_multiple_invalid_value`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/select_multiple_invalid_value`);\n\t}\n}\n\n/**\n * Reactive `$state(...)` proxies and the values they proxy have different identities. Because of this, comparisons with `%operator%` will produce unexpected results\n * @param {string} operator\n */\nexport function state_proxy_equality_mismatch(operator) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] state_proxy_equality_mismatch\\n%cReactive \\`$state(...)\\` proxies and the values they proxy have different identities. Because of this, comparisons with \\`${operator}\\` will produce unexpected results\\nhttps://svelte.dev/e/state_proxy_equality_mismatch`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`);\n\t}\n}\n\n/**\n * Tried to unmount a state proxy, rather than a component\n */\nexport function state_proxy_unmount() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] state_proxy_unmount\\n%cTried to unmount a state proxy, rather than a component\\nhttps://svelte.dev/e/state_proxy_unmount`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/state_proxy_unmount`);\n\t}\n}\n\n/**\n * A `` `reset` function only resets the boundary the first time it is called\n */\nexport function svelte_boundary_reset_noop() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] svelte_boundary_reset_noop\\n%cA \\`\\` \\`reset\\` function only resets the boundary the first time it is called\\nhttps://svelte.dev/e/svelte_boundary_reset_noop`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);\n\t}\n}\n\n/**\n * The `slide` transition does not work correctly for elements with `display: %value%`\n * @param {string} value\n */\nexport function transition_slide_display(value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] transition_slide_display\\n%cThe \\`slide\\` transition does not work correctly for elements with \\`display: ${value}\\`\\nhttps://svelte.dev/e/transition_slide_display`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/transition_slide_display`);\n\t}\n}","/** @import { TemplateNode } from '#client' */\n\nimport { COMMENT_NODE } from '#client/constants';\nimport {\n\tHYDRATION_END,\n\tHYDRATION_ERROR,\n\tHYDRATION_START,\n\tHYDRATION_START_ELSE\n} from '../../../constants.js';\nimport * as w from '../warnings.js';\nimport { get_next_sibling } from './operations.js';\n\n/**\n * Use this variable to guard everything related to hydration code so it can be treeshaken out\n * if the user doesn't use the `hydrate` method and these code paths are therefore not needed.\n */\nexport let hydrating = false;\n\n/** @param {boolean} value */\nexport function set_hydrating(value) {\n\thydrating = value;\n}\n\n/**\n * The node that is currently being hydrated. This starts out as the first node inside the opening\n * comment, and updates each time a component calls `$.child(...)` or `$.sibling(...)`.\n * When entering a block (e.g. `{#if ...}`), `hydrate_node` is the block opening comment; by the\n * time we leave the block it is the closing comment, which serves as the block's anchor.\n * @type {TemplateNode}\n */\nexport let hydrate_node;\n\n/** @param {TemplateNode} node */\nexport function set_hydrate_node(node) {\n\tif (node === null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn (hydrate_node = node);\n}\n\nexport function hydrate_next() {\n\treturn set_hydrate_node(/** @type {TemplateNode} */ (get_next_sibling(hydrate_node)));\n}\n\n/** @param {TemplateNode} node */\nexport function reset(node) {\n\tif (!hydrating) return;\n\n\t// If the node has remaining siblings, something has gone wrong\n\tif (get_next_sibling(hydrate_node) !== null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\thydrate_node = node;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n */\nexport function hydrate_template(template) {\n\tif (hydrating) {\n\t\t// @ts-expect-error TemplateNode doesn't include DocumentFragment, but it's actually fine\n\t\thydrate_node = template.content;\n\t}\n}\n\nexport function next(count = 1) {\n\tif (hydrating) {\n\t\tvar i = count;\n\t\tvar node = hydrate_node;\n\n\t\twhile (i--) {\n\t\t\tnode = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\t}\n\n\t\thydrate_node = node;\n\t}\n}\n\n/**\n * Skips or removes (depending on {@link remove}) all nodes starting at `hydrate_node` up until the next hydration end comment\n * @param {boolean} remove\n */\nexport function skip_nodes(remove = true) {\n\tvar depth = 0;\n\tvar node = hydrate_node;\n\n\twhile (true) {\n\t\tif (node.nodeType === COMMENT_NODE) {\n\t\t\tvar data = /** @type {Comment} */ (node).data;\n\n\t\t\tif (data === HYDRATION_END) {\n\t\t\t\tif (depth === 0) return node;\n\t\t\t\tdepth -= 1;\n\t\t\t} else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) {\n\t\t\t\tdepth += 1;\n\t\t\t}\n\t\t}\n\n\t\tvar next = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tif (remove) node.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n *\n * @param {TemplateNode} node\n */\nexport function read_hydration_instruction(node) {\n\tif (!node || node.nodeType !== COMMENT_NODE) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn /** @type {Comment} */ (node).data;\n}\n","/** @import { Equals } from '#client' */\n\n/** @type {Equals} */\nexport function equals(value) {\n\treturn value === this.v;\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function safe_not_equal(a, b) {\n\treturn a != a\n\t\t? b == b\n\t\t: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function';\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function not_equal(a, b) {\n\treturn a !== b;\n}\n\n/** @type {Equals} */\nexport function safe_equals(value) {\n\treturn !safe_not_equal(value, this.v);\n}\n","/** True if experimental.async=true */\nexport let async_mode_flag = false;\n/** True if we're not certain that we only have Svelte 5 code in the compilation */\nexport let legacy_mode_flag = false;\n/** True if $inspect.trace is used */\nexport let tracing_mode_flag = false;\n\nexport function enable_async_mode_flag() {\n\tasync_mode_flag = true;\n}\n\n/** ONLY USE THIS DURING TESTING */\nexport function disable_async_mode_flag() {\n\tasync_mode_flag = false;\n}\n\nexport function enable_legacy_mode_flag() {\n\tlegacy_mode_flag = true;\n}\n\nexport function enable_tracing_mode_flag() {\n\ttracing_mode_flag = true;\n}\n","/** @import { Snapshot } from './types' */\nimport { DEV } from 'esm-env';\nimport * as w from './warnings.js';\nimport { get_prototype_of, is_array, object_prototype } from './utils.js';\n\n/**\n * In dev, we keep track of which properties could not be cloned. In prod\n * we don't bother, but we keep a dummy array around so that the\n * signature stays the same\n * @type {string[]}\n */\nconst empty = [];\n\n/**\n * @template T\n * @param {T} value\n * @param {boolean} [skip_warning]\n * @param {boolean} [no_tojson]\n * @returns {Snapshot}\n */\nexport function snapshot(value, skip_warning = false, no_tojson = false) {\n\tif (DEV && !skip_warning) {\n\t\t/** @type {string[]} */\n\t\tconst paths = [];\n\n\t\tconst copy = clone(value, new Map(), '', paths, null, no_tojson);\n\t\tif (paths.length === 1 && paths[0] === '') {\n\t\t\t// value could not be cloned\n\t\t\tw.state_snapshot_uncloneable();\n\t\t} else if (paths.length > 0) {\n\t\t\t// some properties could not be cloned\n\t\t\tconst slice = paths.length > 10 ? paths.slice(0, 7) : paths.slice(0, 10);\n\t\t\tconst excess = paths.length - slice.length;\n\n\t\t\tlet uncloned = slice.map((path) => `- ${path}`).join('\\n');\n\t\t\tif (excess > 0) uncloned += `\\n- ...and ${excess} more`;\n\n\t\t\tw.state_snapshot_uncloneable(uncloned);\n\t\t}\n\n\t\treturn copy;\n\t}\n\n\treturn clone(value, new Map(), '', empty, null, no_tojson);\n}\n\n/**\n * @template T\n * @param {T} value\n * @param {Map>} cloned\n * @param {string} path\n * @param {string[]} paths\n * @param {null | T} [original] The original value, if `value` was produced from a `toJSON` call\n * @param {boolean} [no_tojson]\n * @returns {Snapshot}\n */\nfunction clone(value, cloned, path, paths, original = null, no_tojson = false) {\n\tif (typeof value === 'object' && value !== null) {\n\t\tvar unwrapped = cloned.get(value);\n\t\tif (unwrapped !== undefined) return unwrapped;\n\n\t\tif (value instanceof Map) return /** @type {Snapshot} */ (new Map(value));\n\t\tif (value instanceof Set) return /** @type {Snapshot} */ (new Set(value));\n\n\t\tif (is_array(value)) {\n\t\t\tvar copy = /** @type {Snapshot} */ (Array(value.length));\n\t\t\tcloned.set(value, copy);\n\n\t\t\tif (original !== null) {\n\t\t\t\tcloned.set(original, copy);\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < value.length; i += 1) {\n\t\t\t\tvar element = value[i];\n\t\t\t\tif (i in value) {\n\t\t\t\t\tcopy[i] = clone(element, cloned, DEV ? `${path}[${i}]` : path, paths, null, no_tojson);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn copy;\n\t\t}\n\n\t\tif (get_prototype_of(value) === object_prototype) {\n\t\t\t/** @type {Snapshot} */\n\t\t\tcopy = {};\n\t\t\tcloned.set(value, copy);\n\n\t\t\tif (original !== null) {\n\t\t\t\tcloned.set(original, copy);\n\t\t\t}\n\n\t\t\tfor (var key in value) {\n\t\t\t\tcopy[key] = clone(\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\tvalue[key],\n\t\t\t\t\tcloned,\n\t\t\t\t\tDEV ? `${path}.${key}` : path,\n\t\t\t\t\tpaths,\n\t\t\t\t\tnull,\n\t\t\t\t\tno_tojson\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn copy;\n\t\t}\n\n\t\tif (value instanceof Date) {\n\t\t\treturn /** @type {Snapshot} */ (structuredClone(value));\n\t\t}\n\n\t\tif (typeof (/** @type {T & { toJSON?: any } } */ (value).toJSON) === 'function' && !no_tojson) {\n\t\t\treturn clone(\n\t\t\t\t/** @type {T & { toJSON(): any } } */ (value).toJSON(),\n\t\t\t\tcloned,\n\t\t\t\tDEV ? `${path}.toJSON()` : path,\n\t\t\t\tpaths,\n\t\t\t\t// Associate the instance with the toJSON clone\n\t\t\t\tvalue\n\t\t\t);\n\t\t}\n\t}\n\n\tif (value instanceof EventTarget) {\n\t\t// can't be cloned\n\t\treturn /** @type {Snapshot} */ (value);\n\t}\n\n\ttry {\n\t\treturn /** @type {Snapshot} */ (structuredClone(value));\n\t} catch (e) {\n\t\tif (DEV) {\n\t\t\tpaths.push(path);\n\t\t}\n\n\t\treturn /** @type {Snapshot} */ (value);\n\t}\n}\n","/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport * as e from './errors.js';\nimport { active_effect, active_reaction } from './runtime.js';\nimport { create_user_effect } from './reactivity/effects.js';\nimport { async_mode_flag, legacy_mode_flag } from '../flags/index.js';\nimport { FILENAME } from '../../constants.js';\nimport { BRANCH_EFFECT, EFFECT_RAN } from './constants.js';\n\n/** @type {ComponentContext | null} */\nexport let component_context = null;\n\n/** @param {ComponentContext | null} context */\nexport function set_component_context(context) {\n\tcomponent_context = context;\n}\n\n/** @type {DevStackEntry | null} */\nexport let dev_stack = null;\n\n/** @param {DevStackEntry | null} stack */\nexport function set_dev_stack(stack) {\n\tdev_stack = stack;\n}\n\n/**\n * Execute a callback with a new dev stack entry\n * @param {() => any} callback - Function to execute\n * @param {DevStackEntry['type']} type - Type of block/component\n * @param {any} component - Component function\n * @param {number} line - Line number\n * @param {number} column - Column number\n * @param {Record} [additional] - Any additional properties to add to the dev stack entry\n * @returns {any}\n */\nexport function add_svelte_meta(callback, type, component, line, column, additional) {\n\tconst parent = dev_stack;\n\n\tdev_stack = {\n\t\ttype,\n\t\tfile: component[FILENAME],\n\t\tline,\n\t\tcolumn,\n\t\tparent,\n\t\t...additional\n\t};\n\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tdev_stack = parent;\n\t}\n}\n\n/**\n * The current component function. Different from current component context:\n * ```html\n * \n * \n * \n * \n * ```\n * @type {ComponentContext['function']}\n */\nexport let dev_current_component_function = null;\n\n/** @param {ComponentContext['function']} fn */\nexport function set_dev_current_component_function(fn) {\n\tdev_current_component_function = fn;\n}\n\n/**\n * Returns a `[get, set]` pair of functions for working with context in a type-safe way.\n *\n * `get` will throw an error if no parent component called `set`.\n *\n * @template T\n * @returns {[() => T, (context: T) => T]}\n * @since 5.40.0\n */\nexport function createContext() {\n\tconst key = {};\n\n\treturn [\n\t\t() => {\n\t\t\tif (!hasContext(key)) {\n\t\t\t\te.missing_context();\n\t\t\t}\n\n\t\t\treturn getContext(key);\n\t\t},\n\t\t(context) => setContext(key, context)\n\t];\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * [`createContext`](https://svelte.dev/docs/svelte/svelte#createContext) is a type-safe alternative.\n *\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\tconst context_map = get_or_init_context_map('getContext');\n\tconst result = /** @type {T} */ (context_map.get(key));\n\treturn result;\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * [`createContext`](https://svelte.dev/docs/svelte/svelte#createContext) is a type-safe alternative.\n *\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tconst context_map = get_or_init_context_map('setContext');\n\n\tif (async_mode_flag) {\n\t\tvar flags = /** @type {Effect} */ (active_effect).f;\n\t\tvar valid =\n\t\t\t!active_reaction &&\n\t\t\t(flags & BRANCH_EFFECT) !== 0 &&\n\t\t\t// pop() runs synchronously, so this indicates we're setting context after an await\n\t\t\t!(/** @type {ComponentContext} */ (component_context).i);\n\n\t\tif (!valid) {\n\t\t\te.set_context_after_init();\n\t\t}\n\t}\n\n\tcontext_map.set(key, context);\n\treturn context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\tconst context_map = get_or_init_context_map('hasContext');\n\treturn context_map.has(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * @template {Map} [T=Map]\n * @returns {T}\n */\nexport function getAllContexts() {\n\tconst context_map = get_or_init_context_map('getAllContexts');\n\treturn /** @type {T} */ (context_map);\n}\n\n/**\n * @param {Record} props\n * @param {any} runes\n * @param {Function} [fn]\n * @returns {void}\n */\nexport function push(props, runes = false, fn) {\n\tcomponent_context = {\n\t\tp: component_context,\n\t\ti: false,\n\t\tc: null,\n\t\te: null,\n\t\ts: props,\n\t\tx: null,\n\t\tl: legacy_mode_flag && !runes ? { s: null, u: null, $: [] } : null\n\t};\n\n\tif (DEV) {\n\t\t// component function\n\t\tcomponent_context.function = fn;\n\t\tdev_current_component_function = fn;\n\t}\n}\n\n/**\n * @template {Record} T\n * @param {T} [component]\n * @returns {T}\n */\nexport function pop(component) {\n\tvar context = /** @type {ComponentContext} */ (component_context);\n\tvar effects = context.e;\n\n\tif (effects !== null) {\n\t\tcontext.e = null;\n\n\t\tfor (var fn of effects) {\n\t\t\tcreate_user_effect(fn);\n\t\t}\n\t}\n\n\tif (component !== undefined) {\n\t\tcontext.x = component;\n\t}\n\n\tcontext.i = true;\n\n\tcomponent_context = context.p;\n\n\tif (DEV) {\n\t\tdev_current_component_function = component_context?.function ?? null;\n\t}\n\n\treturn component ?? /** @type {T} */ ({});\n}\n\n/** @returns {boolean} */\nexport function is_runes() {\n\treturn !legacy_mode_flag || (component_context !== null && component_context.l === null);\n}\n\n/**\n * @param {string} name\n * @returns {Map}\n */\nfunction get_or_init_context_map(name) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component(name);\n\t}\n\n\treturn (component_context.c ??= new Map(get_parent_context(component_context) || undefined));\n}\n\n/**\n * @param {ComponentContext} component_context\n * @returns {Map | null}\n */\nfunction get_parent_context(component_context) {\n\tlet parent = component_context.p;\n\twhile (parent !== null) {\n\t\tconst context_map = parent.c;\n\t\tif (context_map !== null) {\n\t\t\treturn context_map;\n\t\t}\n\t\tparent = parent.p;\n\t}\n\treturn null;\n}\n","import { run_all } from '../../shared/utils.js';\nimport { is_flushing_sync } from '../reactivity/batch.js';\n\n/** @type {Array<() => void>} */\nlet micro_tasks = [];\n\nfunction run_micro_tasks() {\n\tvar tasks = micro_tasks;\n\tmicro_tasks = [];\n\trun_all(tasks);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_micro_task(fn) {\n\tif (micro_tasks.length === 0 && !is_flushing_sync) {\n\t\tvar tasks = micro_tasks;\n\t\tqueueMicrotask(() => {\n\t\t\t// If this is false, a flushSync happened in the meantime. Do _not_ run new scheduled microtasks in that case\n\t\t\t// as the ordering of microtasks would be broken at that point - consider this case:\n\t\t\t// - queue_micro_task schedules microtask A to flush task X\n\t\t\t// - synchronously after, flushSync runs, processing task X\n\t\t\t// - synchronously after, some other microtask B is scheduled, but not through queue_micro_task but for example a Promise.resolve() in user code\n\t\t\t// - synchronously after, queue_micro_task schedules microtask C to flush task Y\n\t\t\t// - one tick later, microtask A now resolves, flushing task Y before microtask B, which is incorrect\n\t\t\t// This if check prevents that race condition (that realistically will only happen in tests)\n\t\t\tif (tasks === micro_tasks) run_micro_tasks();\n\t\t});\n\t}\n\n\tmicro_tasks.push(fn);\n}\n\n/**\n * Synchronously run any queued tasks.\n */\nexport function flush_tasks() {\n\twhile (micro_tasks.length > 0) {\n\t\trun_micro_tasks();\n\t}\n}\n","/** @import { Derived, Effect } from '#client' */\n/** @import { Boundary } from './dom/blocks/boundary.js' */\nimport { DEV } from 'esm-env';\nimport { FILENAME } from '../../constants.js';\nimport { is_firefox } from './dom/operations.js';\nimport { ERROR_VALUE, BOUNDARY_EFFECT, EFFECT_RAN } from './constants.js';\nimport { define_property, get_descriptor } from '../shared/utils.js';\nimport { active_effect, active_reaction } from './runtime.js';\n\nconst adjustments = new WeakMap();\n\n/**\n * @param {unknown} error\n */\nexport function handle_error(error) {\n\tvar effect = active_effect;\n\n\t// for unowned deriveds, don't throw until we read the value\n\tif (effect === null) {\n\t\t/** @type {Derived} */ (active_reaction).f |= ERROR_VALUE;\n\t\treturn error;\n\t}\n\n\tif (DEV && error instanceof Error && !adjustments.has(error)) {\n\t\tadjustments.set(error, get_adjustments(error, effect));\n\t}\n\n\tif ((effect.f & EFFECT_RAN) === 0) {\n\t\t// if the error occurred while creating this subtree, we let it\n\t\t// bubble up until it hits a boundary that can handle it\n\t\tif ((effect.f & BOUNDARY_EFFECT) === 0) {\n\t\t\tif (DEV && !effect.parent && error instanceof Error) {\n\t\t\t\tapply_adjustments(error);\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t} else {\n\t\t// otherwise we bubble up the effect tree ourselves\n\t\tinvoke_error_boundary(error, effect);\n\t}\n}\n\n/**\n * @param {unknown} error\n * @param {Effect | null} effect\n */\nexport function invoke_error_boundary(error, effect) {\n\twhile (effect !== null) {\n\t\tif ((effect.f & BOUNDARY_EFFECT) !== 0) {\n\t\t\ttry {\n\t\t\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\n\t\teffect = effect.parent;\n\t}\n\n\tif (DEV && error instanceof Error) {\n\t\tapply_adjustments(error);\n\t}\n\n\tthrow error;\n}\n\n/**\n * Add useful information to the error message/stack in development\n * @param {Error} error\n * @param {Effect} effect\n */\nfunction get_adjustments(error, effect) {\n\tconst message_descriptor = get_descriptor(error, 'message');\n\n\t// if the message was already changed and it's not configurable we can't change it\n\t// or it will throw a different error swallowing the original error\n\tif (message_descriptor && !message_descriptor.configurable) return;\n\n\tvar indent = is_firefox ? ' ' : '\\t';\n\tvar component_stack = `\\n${indent}in ${effect.fn?.name || ''}`;\n\tvar context = effect.ctx;\n\n\twhile (context !== null) {\n\t\tcomponent_stack += `\\n${indent}in ${context.function?.[FILENAME].split('/').pop()}`;\n\t\tcontext = context.p;\n\t}\n\n\treturn {\n\t\tmessage: error.message + `\\n${component_stack}\\n`,\n\t\tstack: error.stack\n\t\t\t?.split('\\n')\n\t\t\t.filter((line) => !line.includes('svelte/src/internal'))\n\t\t\t.join('\\n')\n\t};\n}\n\n/**\n * @param {Error} error\n */\nfunction apply_adjustments(error) {\n\tconst adjusted = adjustments.get(error);\n\n\tif (adjusted) {\n\t\tdefine_property(error, 'message', {\n\t\t\tvalue: adjusted.message\n\t\t});\n\n\t\tdefine_property(error, 'stack', {\n\t\t\tvalue: adjusted.stack\n\t\t});\n\t}\n}\n","/** @import { Fork } from 'svelte' */\n/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */\nimport {\n\tBLOCK_EFFECT,\n\tBRANCH_EFFECT,\n\tCLEAN,\n\tDESTROYED,\n\tDIRTY,\n\tEFFECT,\n\tASYNC,\n\tINERT,\n\tRENDER_EFFECT,\n\tROOT_EFFECT,\n\tMAYBE_DIRTY,\n\tDERIVED,\n\tBOUNDARY_EFFECT,\n\tEAGER_EFFECT,\n\tHEAD_EFFECT,\n\tERROR_VALUE,\n\tWAS_MARKED,\n\tMANAGED_EFFECT\n} from '#client/constants';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { deferred, define_property } from '../../shared/utils.js';\nimport {\n\tactive_effect,\n\tget,\n\tis_dirty,\n\tis_updating_effect,\n\tset_is_updating_effect,\n\tset_signal_status,\n\tupdate_effect\n} from '../runtime.js';\nimport * as e from '../errors.js';\nimport { flush_tasks, queue_micro_task } from '../dom/task.js';\nimport { DEV } from 'esm-env';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport { flush_eager_effects, old_values, set_eager_effects, source, update } from './sources.js';\nimport { eager_effect, unlink_effect } from './effects.js';\n\n/**\n * @typedef {{\n * parent: EffectTarget | null;\n * effect: Effect | null;\n * effects: Effect[];\n * render_effects: Effect[];\n * block_effects: Effect[];\n * }} EffectTarget\n */\n\n/** @type {Set} */\nconst batches = new Set();\n\n/** @type {Batch | null} */\nexport let current_batch = null;\n\n/**\n * This is needed to avoid overwriting inputs in non-async mode\n * TODO 6.0 remove this, as non-async mode will go away\n * @type {Batch | null}\n */\nexport let previous_batch = null;\n\n/**\n * When time travelling (i.e. working in one batch, while other batches\n * still have ongoing work), we ignore the real values of affected\n * signals in favour of their values within the batch\n * @type {Map | null}\n */\nexport let batch_values = null;\n\n// TODO this should really be a property of `batch`\n/** @type {Effect[]} */\nlet queued_root_effects = [];\n\n/** @type {Effect | null} */\nlet last_scheduled_effect = null;\n\nlet is_flushing = false;\nexport let is_flushing_sync = false;\n\nexport class Batch {\n\tcommitted = false;\n\n\t/**\n\t * The current values of any sources that are updated in this batch\n\t * They keys of this map are identical to `this.#previous`\n\t * @type {Map}\n\t */\n\tcurrent = new Map();\n\n\t/**\n\t * The values of any sources that are updated in this batch _before_ those updates took place.\n\t * They keys of this map are identical to `this.#current`\n\t * @type {Map}\n\t */\n\tprevious = new Map();\n\n\t/**\n\t * When the batch is committed (and the DOM is updated), we need to remove old branches\n\t * and append new ones by calling the functions added inside (if/each/key/etc) blocks\n\t * @type {Set<() => void>}\n\t */\n\t#commit_callbacks = new Set();\n\n\t/**\n\t * If a fork is discarded, we need to destroy any effects that are no longer needed\n\t * @type {Set<(batch: Batch) => void>}\n\t */\n\t#discard_callbacks = new Set();\n\n\t/**\n\t * The number of async effects that are currently in flight\n\t */\n\t#pending = 0;\n\n\t/**\n\t * The number of async effects that are currently in flight, _not_ inside a pending boundary\n\t */\n\t#blocking_pending = 0;\n\n\t/**\n\t * A deferred that resolves when the batch is committed, used with `settled()`\n\t * TODO replace with Promise.withResolvers once supported widely enough\n\t * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}\n\t */\n\t#deferred = null;\n\n\t/**\n\t * Deferred effects (which run after async work has completed) that are DIRTY\n\t * @type {Effect[]}\n\t */\n\t#dirty_effects = [];\n\n\t/**\n\t * Deferred effects that are MAYBE_DIRTY\n\t * @type {Effect[]}\n\t */\n\t#maybe_dirty_effects = [];\n\n\t/**\n\t * A set of branches that still exist, but will be destroyed when this batch\n\t * is committed — we skip over these during `process`\n\t * @type {Set}\n\t */\n\tskipped_effects = new Set();\n\n\tis_fork = false;\n\n\tis_deferred() {\n\t\treturn this.is_fork || this.#blocking_pending > 0;\n\t}\n\n\t/**\n\t *\n\t * @param {Effect[]} root_effects\n\t */\n\tprocess(root_effects) {\n\t\tqueued_root_effects = [];\n\n\t\tprevious_batch = null;\n\n\t\tthis.apply();\n\n\t\t/** @type {EffectTarget} */\n\t\tvar target = {\n\t\t\tparent: null,\n\t\t\teffect: null,\n\t\t\teffects: [],\n\t\t\trender_effects: [],\n\t\t\tblock_effects: []\n\t\t};\n\n\t\tfor (const root of root_effects) {\n\t\t\tthis.#traverse_effect_tree(root, target);\n\t\t\t// Note: #traverse_effect_tree runs block effects eagerly, which can schedule effects,\n\t\t\t// which means queued_root_effects now may be filled again.\n\t\t}\n\n\t\tif (!this.is_fork) {\n\t\t\tthis.#resolve();\n\t\t}\n\n\t\tif (this.is_deferred()) {\n\t\t\tthis.#defer_effects(target.effects);\n\t\t\tthis.#defer_effects(target.render_effects);\n\t\t\tthis.#defer_effects(target.block_effects);\n\t\t} else {\n\t\t\t// If sources are written to, then work needs to happen in a separate batch, else prior sources would be mixed with\n\t\t\t// newly updated sources, which could lead to infinite loops when effects run over and over again.\n\t\t\tprevious_batch = this;\n\t\t\tcurrent_batch = null;\n\n\t\t\tflush_queued_effects(target.render_effects);\n\t\t\tflush_queued_effects(target.effects);\n\n\t\t\tprevious_batch = null;\n\n\t\t\tthis.#deferred?.resolve();\n\t\t}\n\n\t\tbatch_values = null;\n\t}\n\n\t/**\n\t * Traverse the effect tree, executing effects or stashing\n\t * them for later execution as appropriate\n\t * @param {Effect} root\n\t * @param {EffectTarget} target\n\t */\n\t#traverse_effect_tree(root, target) {\n\t\troot.f ^= CLEAN;\n\n\t\tvar effect = root.first;\n\n\t\twhile (effect !== null) {\n\t\t\tvar flags = effect.f;\n\t\t\tvar is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;\n\t\t\tvar is_skippable_branch = is_branch && (flags & CLEAN) !== 0;\n\n\t\t\tvar skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect);\n\n\t\t\tif ((effect.f & BOUNDARY_EFFECT) !== 0 && effect.b?.is_pending()) {\n\t\t\t\ttarget = {\n\t\t\t\t\tparent: target,\n\t\t\t\t\teffect,\n\t\t\t\t\teffects: [],\n\t\t\t\t\trender_effects: [],\n\t\t\t\t\tblock_effects: []\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (!skip && effect.fn !== null) {\n\t\t\t\tif (is_branch) {\n\t\t\t\t\teffect.f ^= CLEAN;\n\t\t\t\t} else if ((flags & EFFECT) !== 0) {\n\t\t\t\t\ttarget.effects.push(effect);\n\t\t\t\t} else if (async_mode_flag && (flags & (RENDER_EFFECT | MANAGED_EFFECT)) !== 0) {\n\t\t\t\t\ttarget.render_effects.push(effect);\n\t\t\t\t} else if (is_dirty(effect)) {\n\t\t\t\t\tif ((effect.f & BLOCK_EFFECT) !== 0) target.block_effects.push(effect);\n\t\t\t\t\tupdate_effect(effect);\n\t\t\t\t}\n\n\t\t\t\tvar child = effect.first;\n\n\t\t\t\tif (child !== null) {\n\t\t\t\t\teffect = child;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar parent = effect.parent;\n\t\t\teffect = effect.next;\n\n\t\t\twhile (effect === null && parent !== null) {\n\t\t\t\tif (parent === target.effect) {\n\t\t\t\t\t// TODO rather than traversing into pending boundaries and deferring the effects,\n\t\t\t\t\t// could we just attach the effects _to_ the pending boundary and schedule them\n\t\t\t\t\t// once the boundary is ready?\n\t\t\t\t\tthis.#defer_effects(target.effects);\n\t\t\t\t\tthis.#defer_effects(target.render_effects);\n\t\t\t\t\tthis.#defer_effects(target.block_effects);\n\n\t\t\t\t\ttarget = /** @type {EffectTarget} */ (target.parent);\n\t\t\t\t}\n\n\t\t\t\teffect = parent.next;\n\t\t\t\tparent = parent.parent;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {Effect[]} effects\n\t */\n\t#defer_effects(effects) {\n\t\tfor (const e of effects) {\n\t\t\tconst target = (e.f & DIRTY) !== 0 ? this.#dirty_effects : this.#maybe_dirty_effects;\n\t\t\ttarget.push(e);\n\n\t\t\t// Since we're not executing these effects now, we need to clear any WAS_MARKED flags\n\t\t\t// so that other batches can correctly reach these effects during their own traversal\n\t\t\tthis.#clear_marked(e.deps);\n\n\t\t\t// mark as clean so they get scheduled if they depend on pending async state\n\t\t\tset_signal_status(e, CLEAN);\n\t\t}\n\t}\n\n\t/**\n\t * @param {Value[] | null} deps\n\t */\n\t#clear_marked(deps) {\n\t\tif (deps === null) return;\n\n\t\tfor (const dep of deps) {\n\t\t\tif ((dep.f & DERIVED) === 0 || (dep.f & WAS_MARKED) === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdep.f ^= WAS_MARKED;\n\n\t\t\tthis.#clear_marked(/** @type {Derived} */ (dep).deps);\n\t\t}\n\t}\n\n\t/**\n\t * Associate a change to a given source with the current\n\t * batch, noting its previous and current values\n\t * @param {Source} source\n\t * @param {any} value\n\t */\n\tcapture(source, value) {\n\t\tif (!this.previous.has(source)) {\n\t\t\tthis.previous.set(source, value);\n\t\t}\n\n\t\t// Don't save errors in `batch_values`, or they won't be thrown in `runtime.js#get`\n\t\tif ((source.f & ERROR_VALUE) === 0) {\n\t\t\tthis.current.set(source, source.v);\n\t\t\tbatch_values?.set(source, source.v);\n\t\t}\n\t}\n\n\tactivate() {\n\t\tcurrent_batch = this;\n\t\tthis.apply();\n\t}\n\n\tdeactivate() {\n\t\t// If we're not the current batch, don't deactivate,\n\t\t// else we could create zombie batches that are never flushed\n\t\tif (current_batch !== this) return;\n\n\t\tcurrent_batch = null;\n\t\tbatch_values = null;\n\t}\n\n\tflush() {\n\t\tthis.activate();\n\n\t\tif (queued_root_effects.length > 0) {\n\t\t\tflush_effects();\n\n\t\t\tif (current_batch !== null && current_batch !== this) {\n\t\t\t\t// this can happen if a new batch was created during `flush_effects()`\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (this.#pending === 0) {\n\t\t\tthis.process([]); // TODO this feels awkward\n\t\t}\n\n\t\tthis.deactivate();\n\t}\n\n\tdiscard() {\n\t\tfor (const fn of this.#discard_callbacks) fn(this);\n\t\tthis.#discard_callbacks.clear();\n\t}\n\n\t#resolve() {\n\t\tif (this.#blocking_pending === 0) {\n\t\t\t// append/remove branches\n\t\t\tfor (const fn of this.#commit_callbacks) fn();\n\t\t\tthis.#commit_callbacks.clear();\n\t\t}\n\n\t\tif (this.#pending === 0) {\n\t\t\tthis.#commit();\n\t\t}\n\t}\n\n\t#commit() {\n\t\t// If there are other pending batches, they now need to be 'rebased' —\n\t\t// in other words, we re-run block/async effects with the newly\n\t\t// committed state, unless the batch in question has a more\n\t\t// recent value for a given source\n\t\tif (batches.size > 1) {\n\t\t\tthis.previous.clear();\n\n\t\t\tvar previous_batch_values = batch_values;\n\t\t\tvar is_earlier = true;\n\n\t\t\t/** @type {EffectTarget} */\n\t\t\tvar dummy_target = {\n\t\t\t\tparent: null,\n\t\t\t\teffect: null,\n\t\t\t\teffects: [],\n\t\t\t\trender_effects: [],\n\t\t\t\tblock_effects: []\n\t\t\t};\n\n\t\t\tfor (const batch of batches) {\n\t\t\t\tif (batch === this) {\n\t\t\t\t\tis_earlier = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/** @type {Source[]} */\n\t\t\t\tconst sources = [];\n\n\t\t\t\tfor (const [source, value] of this.current) {\n\t\t\t\t\tif (batch.current.has(source)) {\n\t\t\t\t\t\tif (is_earlier && value !== batch.current.get(source)) {\n\t\t\t\t\t\t\t// bring the value up to date\n\t\t\t\t\t\t\tbatch.current.set(source, value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// same value or later batch has more recent value,\n\t\t\t\t\t\t\t// no need to re-run these effects\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsources.push(source);\n\t\t\t\t}\n\n\t\t\t\tif (sources.length === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Re-run async/block effects that depend on distinct values changed in both batches\n\t\t\t\tconst others = [...batch.current.keys()].filter((s) => !this.current.has(s));\n\t\t\t\tif (others.length > 0) {\n\t\t\t\t\t// Avoid running queued root effects on the wrong branch\n\t\t\t\t\tvar prev_queued_root_effects = queued_root_effects;\n\t\t\t\t\tqueued_root_effects = [];\n\n\t\t\t\t\t/** @type {Set} */\n\t\t\t\t\tconst marked = new Set();\n\t\t\t\t\t/** @type {Map} */\n\t\t\t\t\tconst checked = new Map();\n\t\t\t\t\tfor (const source of sources) {\n\t\t\t\t\t\tmark_effects(source, others, marked, checked);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (queued_root_effects.length > 0) {\n\t\t\t\t\t\tcurrent_batch = batch;\n\t\t\t\t\t\tbatch.apply();\n\n\t\t\t\t\t\tfor (const root of queued_root_effects) {\n\t\t\t\t\t\t\tbatch.#traverse_effect_tree(root, dummy_target);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// TODO do we need to do anything with `target`? defer block effects?\n\n\t\t\t\t\t\tbatch.deactivate();\n\t\t\t\t\t}\n\n\t\t\t\t\tqueued_root_effects = prev_queued_root_effects;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcurrent_batch = null;\n\t\t\tbatch_values = previous_batch_values;\n\t\t}\n\n\t\tthis.committed = true;\n\t\tbatches.delete(this);\n\t}\n\n\t/**\n\t *\n\t * @param {boolean} blocking\n\t */\n\tincrement(blocking) {\n\t\tthis.#pending += 1;\n\t\tif (blocking) this.#blocking_pending += 1;\n\t}\n\n\t/**\n\t *\n\t * @param {boolean} blocking\n\t */\n\tdecrement(blocking) {\n\t\tthis.#pending -= 1;\n\t\tif (blocking) this.#blocking_pending -= 1;\n\n\t\tthis.revive();\n\t}\n\n\trevive() {\n\t\tfor (const e of this.#dirty_effects) {\n\t\t\tset_signal_status(e, DIRTY);\n\t\t\tschedule_effect(e);\n\t\t}\n\n\t\tfor (const e of this.#maybe_dirty_effects) {\n\t\t\tset_signal_status(e, MAYBE_DIRTY);\n\t\t\tschedule_effect(e);\n\t\t}\n\n\t\tthis.#dirty_effects = [];\n\t\tthis.#maybe_dirty_effects = [];\n\n\t\tthis.flush();\n\t}\n\n\t/** @param {() => void} fn */\n\toncommit(fn) {\n\t\tthis.#commit_callbacks.add(fn);\n\t}\n\n\t/** @param {(batch: Batch) => void} fn */\n\tondiscard(fn) {\n\t\tthis.#discard_callbacks.add(fn);\n\t}\n\n\tsettled() {\n\t\treturn (this.#deferred ??= deferred()).promise;\n\t}\n\n\tstatic ensure() {\n\t\tif (current_batch === null) {\n\t\t\tconst batch = (current_batch = new Batch());\n\t\t\tbatches.add(current_batch);\n\n\t\t\tif (!is_flushing_sync) {\n\t\t\t\tBatch.enqueue(() => {\n\t\t\t\t\tif (current_batch !== batch) {\n\t\t\t\t\t\t// a flushSync happened in the meantime\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tbatch.flush();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn current_batch;\n\t}\n\n\t/** @param {() => void} task */\n\tstatic enqueue(task) {\n\t\tqueue_micro_task(task);\n\t}\n\n\tapply() {\n\t\tif (!async_mode_flag || (!this.is_fork && batches.size === 1)) return;\n\n\t\t// if there are multiple batches, we are 'time travelling' —\n\t\t// we need to override values with the ones in this batch...\n\t\tbatch_values = new Map(this.current);\n\n\t\t// ...and undo changes belonging to other batches\n\t\tfor (const batch of batches) {\n\t\t\tif (batch === this) continue;\n\n\t\t\tfor (const [source, previous] of batch.previous) {\n\t\t\t\tif (!batch_values.has(source)) {\n\t\t\t\t\tbatch_values.set(source, previous);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Synchronously flush any pending updates.\n * Returns void if no callback is provided, otherwise returns the result of calling the callback.\n * @template [T=void]\n * @param {(() => T) | undefined} [fn]\n * @returns {T}\n */\nexport function flushSync(fn) {\n\tvar was_flushing_sync = is_flushing_sync;\n\tis_flushing_sync = true;\n\n\ttry {\n\t\tvar result;\n\n\t\tif (fn) {\n\t\t\tif (current_batch !== null) {\n\t\t\t\tflush_effects();\n\t\t\t}\n\n\t\t\tresult = fn();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tflush_tasks();\n\n\t\t\tif (queued_root_effects.length === 0) {\n\t\t\t\tcurrent_batch?.flush();\n\n\t\t\t\t// we need to check again, in case we just updated an `$effect.pending()`\n\t\t\t\tif (queued_root_effects.length === 0) {\n\t\t\t\t\t// this would be reset in `flush_effects()` but since we are early returning here,\n\t\t\t\t\t// we need to reset it here as well in case the first time there's 0 queued root effects\n\t\t\t\t\tlast_scheduled_effect = null;\n\n\t\t\t\t\treturn /** @type {T} */ (result);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflush_effects();\n\t\t}\n\t} finally {\n\t\tis_flushing_sync = was_flushing_sync;\n\t}\n}\n\nfunction flush_effects() {\n\tvar was_updating_effect = is_updating_effect;\n\tis_flushing = true;\n\n\tvar source_stacks = DEV ? new Set() : null;\n\n\ttry {\n\t\tvar flush_count = 0;\n\t\tset_is_updating_effect(true);\n\n\t\twhile (queued_root_effects.length > 0) {\n\t\t\tvar batch = Batch.ensure();\n\n\t\t\tif (flush_count++ > 1000) {\n\t\t\t\tif (DEV) {\n\t\t\t\t\tvar updates = new Map();\n\n\t\t\t\t\tfor (const source of batch.current.keys()) {\n\t\t\t\t\t\tfor (const [stack, update] of source.updated ?? []) {\n\t\t\t\t\t\t\tvar entry = updates.get(stack);\n\n\t\t\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\t\t\tentry = { error: update.error, count: 0 };\n\t\t\t\t\t\t\t\tupdates.set(stack, entry);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tentry.count += update.count;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (const update of updates.values()) {\n\t\t\t\t\t\tif (update.error) {\n\t\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\t\tconsole.error(update.error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tinfinite_loop_guard();\n\t\t\t}\n\n\t\t\tbatch.process(queued_root_effects);\n\t\t\told_values.clear();\n\n\t\t\tif (DEV) {\n\t\t\t\tfor (const source of batch.current.keys()) {\n\t\t\t\t\t/** @type {Set} */ (source_stacks).add(source);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tis_flushing = false;\n\t\tset_is_updating_effect(was_updating_effect);\n\n\t\tlast_scheduled_effect = null;\n\n\t\tif (DEV) {\n\t\t\tfor (const source of /** @type {Set} */ (source_stacks)) {\n\t\t\t\tsource.updated = null;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction infinite_loop_guard() {\n\ttry {\n\t\te.effect_update_depth_exceeded();\n\t} catch (error) {\n\t\tif (DEV) {\n\t\t\t// stack contains no useful information, replace it\n\t\t\tdefine_property(error, 'stack', { value: '' });\n\t\t}\n\n\t\t// Best effort: invoke the boundary nearest the most recent\n\t\t// effect and hope that it's relevant to the infinite loop\n\t\tinvoke_error_boundary(error, last_scheduled_effect);\n\t}\n}\n\n/** @type {Set | null} */\nexport let eager_block_effects = null;\n\n/**\n * @param {Array} effects\n * @returns {void}\n */\nfunction flush_queued_effects(effects) {\n\tvar length = effects.length;\n\tif (length === 0) return;\n\n\tvar i = 0;\n\n\twhile (i < length) {\n\t\tvar effect = effects[i++];\n\n\t\tif ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {\n\t\t\teager_block_effects = new Set();\n\n\t\t\tupdate_effect(effect);\n\n\t\t\t// Effects with no dependencies or teardown do not get added to the effect tree.\n\t\t\t// Deferred effects (e.g. `$effect(...)`) _are_ added to the tree because we\n\t\t\t// don't know if we need to keep them until they are executed. Doing the check\n\t\t\t// here (rather than in `update_effect`) allows us to skip the work for\n\t\t\t// immediate effects.\n\t\t\tif (effect.deps === null && effect.first === null && effect.nodes_start === null) {\n\t\t\t\t// if there's no teardown or abort controller we completely unlink\n\t\t\t\t// the effect from the graph\n\t\t\t\tif (effect.teardown === null && effect.ac === null) {\n\t\t\t\t\t// remove this effect from the graph\n\t\t\t\t\tunlink_effect(effect);\n\t\t\t\t} else {\n\t\t\t\t\t// keep the effect in the graph, but free up some memory\n\t\t\t\t\teffect.fn = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If update_effect() has a flushSync() in it, we may have flushed another flush_queued_effects(),\n\t\t\t// which already handled this logic and did set eager_block_effects to null.\n\t\t\tif (eager_block_effects?.size > 0) {\n\t\t\t\told_values.clear();\n\n\t\t\t\tfor (const e of eager_block_effects) {\n\t\t\t\t\t// Skip eager effects that have already been unmounted\n\t\t\t\t\tif ((e.f & (DESTROYED | INERT)) !== 0) continue;\n\n\t\t\t\t\t// Run effects in order from ancestor to descendant, else we could run into nullpointers\n\t\t\t\t\t/** @type {Effect[]} */\n\t\t\t\t\tconst ordered_effects = [e];\n\t\t\t\t\tlet ancestor = e.parent;\n\t\t\t\t\twhile (ancestor !== null) {\n\t\t\t\t\t\tif (eager_block_effects.has(ancestor)) {\n\t\t\t\t\t\t\teager_block_effects.delete(ancestor);\n\t\t\t\t\t\t\tordered_effects.push(ancestor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tancestor = ancestor.parent;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let j = ordered_effects.length - 1; j >= 0; j--) {\n\t\t\t\t\t\tconst e = ordered_effects[j];\n\t\t\t\t\t\t// Skip eager effects that have already been unmounted\n\t\t\t\t\t\tif ((e.f & (DESTROYED | INERT)) !== 0) continue;\n\t\t\t\t\t\tupdate_effect(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\teager_block_effects.clear();\n\t\t\t}\n\t\t}\n\t}\n\n\teager_block_effects = null;\n}\n\n/**\n * This is similar to `mark_reactions`, but it only marks async/block effects\n * depending on `value` and at least one of the other `sources`, so that\n * these effects can re-run after another batch has been committed\n * @param {Value} value\n * @param {Source[]} sources\n * @param {Set} marked\n * @param {Map} checked\n */\nfunction mark_effects(value, sources, marked, checked) {\n\tif (marked.has(value)) return;\n\tmarked.add(value);\n\n\tif (value.reactions !== null) {\n\t\tfor (const reaction of value.reactions) {\n\t\t\tconst flags = reaction.f;\n\n\t\t\tif ((flags & DERIVED) !== 0) {\n\t\t\t\tmark_effects(/** @type {Derived} */ (reaction), sources, marked, checked);\n\t\t\t} else if (\n\t\t\t\t(flags & (ASYNC | BLOCK_EFFECT)) !== 0 &&\n\t\t\t\t(flags & DIRTY) === 0 &&\n\t\t\t\tdepends_on(reaction, sources, checked)\n\t\t\t) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * When committing a fork, we need to trigger eager effects so that\n * any `$state.eager(...)` expressions update immediately. This\n * function allows us to discover them\n * @param {Value} value\n * @param {Set} effects\n */\nfunction mark_eager_effects(value, effects) {\n\tif (value.reactions === null) return;\n\n\tfor (const reaction of value.reactions) {\n\t\tconst flags = reaction.f;\n\n\t\tif ((flags & DERIVED) !== 0) {\n\t\t\tmark_eager_effects(/** @type {Derived} */ (reaction), effects);\n\t\t} else if ((flags & EAGER_EFFECT) !== 0) {\n\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\teffects.add(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/**\n * @param {Reaction} reaction\n * @param {Source[]} sources\n * @param {Map} checked\n */\nfunction depends_on(reaction, sources, checked) {\n\tconst depends = checked.get(reaction);\n\tif (depends !== undefined) return depends;\n\n\tif (reaction.deps !== null) {\n\t\tfor (const dep of reaction.deps) {\n\t\t\tif (sources.includes(dep)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ((dep.f & DERIVED) !== 0 && depends_on(/** @type {Derived} */ (dep), sources, checked)) {\n\t\t\t\tchecked.set(/** @type {Derived} */ (dep), true);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\tchecked.set(reaction, false);\n\n\treturn false;\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function schedule_effect(signal) {\n\tvar effect = (last_scheduled_effect = signal);\n\n\twhile (effect.parent !== null) {\n\t\teffect = effect.parent;\n\t\tvar flags = effect.f;\n\n\t\t// if the effect is being scheduled because a parent (each/await/etc) block\n\t\t// updated an internal source, bail out or we'll cause a second flush\n\t\tif (\n\t\t\tis_flushing &&\n\t\t\teffect === active_effect &&\n\t\t\t(flags & BLOCK_EFFECT) !== 0 &&\n\t\t\t(flags & HEAD_EFFECT) === 0\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {\n\t\t\tif ((flags & CLEAN) === 0) return;\n\t\t\teffect.f ^= CLEAN;\n\t\t}\n\t}\n\n\tqueued_root_effects.push(effect);\n}\n\n/** @type {Source[]} */\nlet eager_versions = [];\n\nfunction eager_flush() {\n\ttry {\n\t\tflushSync(() => {\n\t\t\tfor (const version of eager_versions) {\n\t\t\t\tupdate(version);\n\t\t\t}\n\t\t});\n\t} finally {\n\t\teager_versions = [];\n\t}\n}\n\n/**\n * Implementation of `$state.eager(fn())`\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function eager(fn) {\n\tvar version = source(0);\n\tvar initial = true;\n\tvar value = /** @type {T} */ (undefined);\n\n\tget(version);\n\n\teager_effect(() => {\n\t\tif (initial) {\n\t\t\t// the first time this runs, we create an eager effect\n\t\t\t// that will run eagerly whenever the expression changes\n\t\t\tvar previous_batch_values = batch_values;\n\n\t\t\ttry {\n\t\t\t\tbatch_values = null;\n\t\t\t\tvalue = fn();\n\t\t\t} finally {\n\t\t\t\tbatch_values = previous_batch_values;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// the second time this effect runs, it's to schedule a\n\t\t// `version` update. since this will recreate the effect,\n\t\t// we don't need to evaluate the expression here\n\t\tif (eager_versions.length === 0) {\n\t\t\tqueue_micro_task(eager_flush);\n\t\t}\n\n\t\teager_versions.push(version);\n\t});\n\n\tinitial = false;\n\n\treturn value;\n}\n\n/**\n * Creates a 'fork', in which state changes are evaluated but not applied to the DOM.\n * This is useful for speculatively loading data (for example) when you suspect that\n * the user is about to take some action.\n *\n * Frameworks like SvelteKit can use this to preload data when the user touches or\n * hovers over a link, making any subsequent navigation feel instantaneous.\n *\n * The `fn` parameter is a synchronous function that modifies some state. The\n * state changes will be reverted after the fork is initialised, then reapplied\n * if and when the fork is eventually committed.\n *\n * When it becomes clear that a fork will _not_ be committed (e.g. because the\n * user navigated elsewhere), it must be discarded to avoid leaking memory.\n *\n * @param {() => void} fn\n * @returns {Fork}\n * @since 5.42\n */\nexport function fork(fn) {\n\tif (!async_mode_flag) {\n\t\te.experimental_async_required('fork');\n\t}\n\n\tif (current_batch !== null) {\n\t\te.fork_timing();\n\t}\n\n\tvar batch = Batch.ensure();\n\tbatch.is_fork = true;\n\tbatch_values = new Map();\n\n\tvar committed = false;\n\tvar settled = batch.settled();\n\n\tflushSync(fn);\n\n\tbatch_values = null;\n\n\t// revert state changes\n\tfor (var [source, value] of batch.previous) {\n\t\tsource.v = value;\n\t}\n\n\treturn {\n\t\tcommit: async () => {\n\t\t\tif (committed) {\n\t\t\t\tawait settled;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!batches.has(batch)) {\n\t\t\t\te.fork_discarded();\n\t\t\t}\n\n\t\t\tcommitted = true;\n\n\t\t\tbatch.is_fork = false;\n\n\t\t\t// apply changes\n\t\t\tfor (var [source, value] of batch.current) {\n\t\t\t\tsource.v = value;\n\t\t\t}\n\n\t\t\t// trigger any `$state.eager(...)` expressions with the new state.\n\t\t\t// eager effects don't get scheduled like other effects, so we\n\t\t\t// can't just encounter them during traversal, we need to\n\t\t\t// proactively flush them\n\t\t\t// TODO maybe there's a better implementation?\n\t\t\tflushSync(() => {\n\t\t\t\t/** @type {Set} */\n\t\t\t\tvar eager_effects = new Set();\n\n\t\t\t\tfor (var source of batch.current.keys()) {\n\t\t\t\t\tmark_eager_effects(source, eager_effects);\n\t\t\t\t}\n\n\t\t\t\tset_eager_effects(eager_effects);\n\t\t\t\tflush_eager_effects();\n\t\t\t});\n\n\t\t\tbatch.revive();\n\t\t\tawait settled;\n\t\t},\n\t\tdiscard: () => {\n\t\t\tif (!committed && batches.has(batch)) {\n\t\t\t\tbatches.delete(batch);\n\t\t\t\tbatch.discard();\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * Forcibly remove all current batches, to prevent cross-talk between tests\n */\nexport function clear() {\n\tbatches.clear();\n}\n","import { get, tick, untrack } from '../internal/client/runtime.js';\nimport { effect_tracking, render_effect } from '../internal/client/reactivity/effects.js';\nimport { source, increment } from '../internal/client/reactivity/sources.js';\nimport { tag } from '../internal/client/dev/tracing.js';\nimport { DEV } from 'esm-env';\nimport { queue_micro_task } from '../internal/client/dom/task.js';\n\n/**\n * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.\n * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.\n *\n * If `subscribe` is called inside an effect (including indirectly, for example inside a getter),\n * the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.\n *\n * If `start` returns a cleanup function, it will be called when the effect is destroyed.\n *\n * If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects\n * are active, and the returned teardown function will only be called when all effects are destroyed.\n *\n * It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):\n *\n * ```js\n * import { createSubscriber } from 'svelte/reactivity';\n * import { on } from 'svelte/events';\n *\n * export class MediaQuery {\n * \t#query;\n * \t#subscribe;\n *\n * \tconstructor(query) {\n * \t\tthis.#query = window.matchMedia(`(${query})`);\n *\n * \t\tthis.#subscribe = createSubscriber((update) => {\n * \t\t\t// when the `change` event occurs, re-run any effects that read `this.current`\n * \t\t\tconst off = on(this.#query, 'change', update);\n *\n * \t\t\t// stop listening when all the effects are destroyed\n * \t\t\treturn () => off();\n * \t\t});\n * \t}\n *\n * \tget current() {\n * \t\t// This makes the getter reactive, if read in an effect\n * \t\tthis.#subscribe();\n *\n * \t\t// Return the current state of the query, whether or not we're in an effect\n * \t\treturn this.#query.matches;\n * \t}\n * }\n * ```\n * @param {(update: () => void) => (() => void) | void} start\n * @since 5.7.0\n */\nexport function createSubscriber(start) {\n\tlet subscribers = 0;\n\tlet version = source(0);\n\t/** @type {(() => void) | void} */\n\tlet stop;\n\n\tif (DEV) {\n\t\ttag(version, 'createSubscriber version');\n\t}\n\n\treturn () => {\n\t\tif (effect_tracking()) {\n\t\t\tget(version);\n\n\t\t\trender_effect(() => {\n\t\t\t\tif (subscribers === 0) {\n\t\t\t\t\tstop = untrack(() => start(() => increment(version)));\n\t\t\t\t}\n\n\t\t\t\tsubscribers += 1;\n\n\t\t\t\treturn () => {\n\t\t\t\t\tqueue_micro_task(() => {\n\t\t\t\t\t\t// Only count down after a microtask, else we would reach 0 before our own render effect reruns,\n\t\t\t\t\t\t// but reach 1 again when the tick callback of the prior teardown runs. That would mean we\n\t\t\t\t\t\t// re-subcribe unnecessarily and create a memory leak because the old subscription is never cleaned up.\n\t\t\t\t\t\tsubscribers -= 1;\n\n\t\t\t\t\t\tif (subscribers === 0) {\n\t\t\t\t\t\t\tstop?.();\n\t\t\t\t\t\t\tstop = undefined;\n\t\t\t\t\t\t\t// Increment the version to ensure any dependent deriveds are marked dirty when the subscription is picked up again later.\n\t\t\t\t\t\t\t// If we didn't do this then the comparison of write versions would determine that the derived has a later version than\n\t\t\t\t\t\t\t// the subscriber, and it would not be re-run.\n\t\t\t\t\t\t\tincrement(version);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t};\n}\n","/** @import { Effect, Source, TemplateNode, } from '#client' */\nimport {\n\tBOUNDARY_EFFECT,\n\tCOMMENT_NODE,\n\tEFFECT_PRESERVED,\n\tEFFECT_TRANSPARENT\n} from '#client/constants';\nimport { HYDRATION_START_ELSE } from '../../../../constants.js';\nimport { component_context, set_component_context } from '../../context.js';\nimport { handle_error, invoke_error_boundary } from '../../error-handling.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\tmove_effect,\n\tpause_effect\n} from '../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tget,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tnext,\n\tskip_nodes,\n\tset_hydrate_node\n} from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport * as e from '../../errors.js';\nimport * as w from '../../warnings.js';\nimport { DEV } from 'esm-env';\nimport { Batch } from '../../reactivity/batch.js';\nimport { internal_set, source } from '../../reactivity/sources.js';\nimport { tag } from '../../dev/tracing.js';\nimport { createSubscriber } from '../../../../reactivity/create-subscriber.js';\nimport { create_text } from '../operations.js';\n\n/**\n * @typedef {{\n * \t onerror?: (error: unknown, reset: () => void) => void;\n * failed?: (anchor: Node, error: () => unknown, reset: () => () => void) => void;\n * pending?: (anchor: Node) => void;\n * }} BoundaryProps\n */\n\nvar flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED | BOUNDARY_EFFECT;\n\n/**\n * @param {TemplateNode} node\n * @param {BoundaryProps} props\n * @param {((anchor: Node) => void)} children\n * @returns {void}\n */\nexport function boundary(node, props, children) {\n\tnew Boundary(node, props, children);\n}\n\nexport class Boundary {\n\t/** @type {Boundary | null} */\n\tparent;\n\n\t#pending = false;\n\n\t/** @type {TemplateNode} */\n\t#anchor;\n\n\t/** @type {TemplateNode | null} */\n\t#hydrate_open = hydrating ? hydrate_node : null;\n\n\t/** @type {BoundaryProps} */\n\t#props;\n\n\t/** @type {((anchor: Node) => void)} */\n\t#children;\n\n\t/** @type {Effect} */\n\t#effect;\n\n\t/** @type {Effect | null} */\n\t#main_effect = null;\n\n\t/** @type {Effect | null} */\n\t#pending_effect = null;\n\n\t/** @type {Effect | null} */\n\t#failed_effect = null;\n\n\t/** @type {DocumentFragment | null} */\n\t#offscreen_fragment = null;\n\n\t/** @type {TemplateNode | null} */\n\t#pending_anchor = null;\n\n\t#local_pending_count = 0;\n\t#pending_count = 0;\n\n\t#is_creating_fallback = false;\n\n\t/**\n\t * A source containing the number of pending async deriveds/expressions.\n\t * Only created if `$effect.pending()` is used inside the boundary,\n\t * otherwise updating the source results in needless `Batch.ensure()`\n\t * calls followed by no-op flushes\n\t * @type {Source | null}\n\t */\n\t#effect_pending = null;\n\n\t#effect_pending_subscriber = createSubscriber(() => {\n\t\tthis.#effect_pending = source(this.#local_pending_count);\n\n\t\tif (DEV) {\n\t\t\ttag(this.#effect_pending, '$effect.pending()');\n\t\t}\n\n\t\treturn () => {\n\t\t\tthis.#effect_pending = null;\n\t\t};\n\t});\n\n\t/**\n\t * @param {TemplateNode} node\n\t * @param {BoundaryProps} props\n\t * @param {((anchor: Node) => void)} children\n\t */\n\tconstructor(node, props, children) {\n\t\tthis.#anchor = node;\n\t\tthis.#props = props;\n\t\tthis.#children = children;\n\n\t\tthis.parent = /** @type {Effect} */ (active_effect).b;\n\n\t\tthis.#pending = !!this.#props.pending;\n\n\t\tthis.#effect = block(() => {\n\t\t\t/** @type {Effect} */ (active_effect).b = this;\n\n\t\t\tif (hydrating) {\n\t\t\t\tconst comment = this.#hydrate_open;\n\t\t\t\thydrate_next();\n\n\t\t\t\tconst server_rendered_pending =\n\t\t\t\t\t/** @type {Comment} */ (comment).nodeType === COMMENT_NODE &&\n\t\t\t\t\t/** @type {Comment} */ (comment).data === HYDRATION_START_ELSE;\n\n\t\t\t\tif (server_rendered_pending) {\n\t\t\t\t\tthis.#hydrate_pending_content();\n\t\t\t\t} else {\n\t\t\t\t\tthis.#hydrate_resolved_content();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar anchor = this.#get_anchor();\n\n\t\t\t\ttry {\n\t\t\t\t\tthis.#main_effect = branch(() => children(anchor));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.error(error);\n\t\t\t\t}\n\n\t\t\t\tif (this.#pending_count > 0) {\n\t\t\t\t\tthis.#show_pending_snippet();\n\t\t\t\t} else {\n\t\t\t\t\tthis.#pending = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\tthis.#pending_anchor?.remove();\n\t\t\t};\n\t\t}, flags);\n\n\t\tif (hydrating) {\n\t\t\tthis.#anchor = hydrate_node;\n\t\t}\n\t}\n\n\t#hydrate_resolved_content() {\n\t\ttry {\n\t\t\tthis.#main_effect = branch(() => this.#children(this.#anchor));\n\t\t} catch (error) {\n\t\t\tthis.error(error);\n\t\t}\n\n\t\t// Since server rendered resolved content, we never show pending state\n\t\t// Even if client-side async operations are still running, the content is already displayed\n\t\tthis.#pending = false;\n\t}\n\n\t#hydrate_pending_content() {\n\t\tconst pending = this.#props.pending;\n\t\tif (!pending) {\n\t\t\treturn;\n\t\t}\n\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\n\t\tBatch.enqueue(() => {\n\t\t\tvar anchor = this.#get_anchor();\n\n\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\tBatch.ensure();\n\t\t\t\treturn branch(() => this.#children(anchor));\n\t\t\t});\n\n\t\t\tif (this.#pending_count > 0) {\n\t\t\t\tthis.#show_pending_snippet();\n\t\t\t} else {\n\t\t\t\tpause_effect(/** @type {Effect} */ (this.#pending_effect), () => {\n\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t});\n\n\t\t\t\tthis.#pending = false;\n\t\t\t}\n\t\t});\n\t}\n\n\t#get_anchor() {\n\t\tvar anchor = this.#anchor;\n\n\t\tif (this.#pending) {\n\t\t\tthis.#pending_anchor = create_text();\n\t\t\tthis.#anchor.before(this.#pending_anchor);\n\n\t\t\tanchor = this.#pending_anchor;\n\t\t}\n\n\t\treturn anchor;\n\t}\n\n\t/**\n\t * Returns `true` if the effect exists inside a boundary whose pending snippet is shown\n\t * @returns {boolean}\n\t */\n\tis_pending() {\n\t\treturn this.#pending || (!!this.parent && this.parent.is_pending());\n\t}\n\n\thas_pending_snippet() {\n\t\treturn !!this.#props.pending;\n\t}\n\n\t/**\n\t * @param {() => Effect | null} fn\n\t */\n\t#run(fn) {\n\t\tvar previous_effect = active_effect;\n\t\tvar previous_reaction = active_reaction;\n\t\tvar previous_ctx = component_context;\n\n\t\tset_active_effect(this.#effect);\n\t\tset_active_reaction(this.#effect);\n\t\tset_component_context(this.#effect.ctx);\n\n\t\ttry {\n\t\t\treturn fn();\n\t\t} catch (e) {\n\t\t\thandle_error(e);\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tset_active_effect(previous_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t\tset_component_context(previous_ctx);\n\t\t}\n\t}\n\n\t#show_pending_snippet() {\n\t\tconst pending = /** @type {(anchor: Node) => void} */ (this.#props.pending);\n\n\t\tif (this.#main_effect !== null) {\n\t\t\tthis.#offscreen_fragment = document.createDocumentFragment();\n\t\t\tthis.#offscreen_fragment.append(/** @type {TemplateNode} */ (this.#pending_anchor));\n\t\t\tmove_effect(this.#main_effect, this.#offscreen_fragment);\n\t\t}\n\n\t\tif (this.#pending_effect === null) {\n\t\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\t\t}\n\t}\n\n\t/**\n\t * Updates the pending count associated with the currently visible pending snippet,\n\t * if any, such that we can replace the snippet with content once work is done\n\t * @param {1 | -1} d\n\t */\n\t#update_pending_count(d) {\n\t\tif (!this.has_pending_snippet()) {\n\t\t\tif (this.parent) {\n\t\t\t\tthis.parent.#update_pending_count(d);\n\t\t\t}\n\n\t\t\t// if there's no parent, we're in a scope with no pending snippet\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#pending_count += d;\n\n\t\tif (this.#pending_count === 0) {\n\t\t\tthis.#pending = false;\n\n\t\t\tif (this.#pending_effect) {\n\t\t\t\tpause_effect(this.#pending_effect, () => {\n\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (this.#offscreen_fragment) {\n\t\t\t\tthis.#anchor.before(this.#offscreen_fragment);\n\t\t\t\tthis.#offscreen_fragment = null;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Update the source that powers `$effect.pending()` inside this boundary,\n\t * and controls when the current `pending` snippet (if any) is removed.\n\t * Do not call from inside the class\n\t * @param {1 | -1} d\n\t */\n\tupdate_pending_count(d) {\n\t\tthis.#update_pending_count(d);\n\n\t\tthis.#local_pending_count += d;\n\n\t\tif (this.#effect_pending) {\n\t\t\tinternal_set(this.#effect_pending, this.#local_pending_count);\n\t\t}\n\t}\n\n\tget_effect_pending() {\n\t\tthis.#effect_pending_subscriber();\n\t\treturn get(/** @type {Source} */ (this.#effect_pending));\n\t}\n\n\t/** @param {unknown} error */\n\terror(error) {\n\t\tvar onerror = this.#props.onerror;\n\t\tlet failed = this.#props.failed;\n\n\t\t// If we have nothing to capture the error, or if we hit an error while\n\t\t// rendering the fallback, re-throw for another boundary to handle\n\t\tif (this.#is_creating_fallback || (!onerror && !failed)) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (this.#main_effect) {\n\t\t\tdestroy_effect(this.#main_effect);\n\t\t\tthis.#main_effect = null;\n\t\t}\n\n\t\tif (this.#pending_effect) {\n\t\t\tdestroy_effect(this.#pending_effect);\n\t\t\tthis.#pending_effect = null;\n\t\t}\n\n\t\tif (this.#failed_effect) {\n\t\t\tdestroy_effect(this.#failed_effect);\n\t\t\tthis.#failed_effect = null;\n\t\t}\n\n\t\tif (hydrating) {\n\t\t\tset_hydrate_node(/** @type {TemplateNode} */ (this.#hydrate_open));\n\t\t\tnext();\n\t\t\tset_hydrate_node(skip_nodes());\n\t\t}\n\n\t\tvar did_reset = false;\n\t\tvar calling_on_error = false;\n\n\t\tconst reset = () => {\n\t\t\tif (did_reset) {\n\t\t\t\tw.svelte_boundary_reset_noop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdid_reset = true;\n\n\t\t\tif (calling_on_error) {\n\t\t\t\te.svelte_boundary_reset_onerror();\n\t\t\t}\n\n\t\t\t// If the failure happened while flushing effects, current_batch can be null\n\t\t\tBatch.ensure();\n\n\t\t\tthis.#local_pending_count = 0;\n\n\t\t\tif (this.#failed_effect !== null) {\n\t\t\t\tpause_effect(this.#failed_effect, () => {\n\t\t\t\t\tthis.#failed_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// we intentionally do not try to find the nearest pending boundary. If this boundary has one, we'll render it on reset\n\t\t\t// but it would be really weird to show the parent's boundary on a child reset.\n\t\t\tthis.#pending = this.has_pending_snippet();\n\n\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\treturn branch(() => this.#children(this.#anchor));\n\t\t\t});\n\n\t\t\tif (this.#pending_count > 0) {\n\t\t\t\tthis.#show_pending_snippet();\n\t\t\t} else {\n\t\t\t\tthis.#pending = false;\n\t\t\t}\n\t\t};\n\n\t\tvar previous_reaction = active_reaction;\n\n\t\ttry {\n\t\t\tset_active_reaction(null);\n\t\t\tcalling_on_error = true;\n\t\t\tonerror?.(error, reset);\n\t\t\tcalling_on_error = false;\n\t\t} catch (error) {\n\t\t\tinvoke_error_boundary(error, this.#effect && this.#effect.parent);\n\t\t} finally {\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\n\t\tif (failed) {\n\t\t\tqueue_micro_task(() => {\n\t\t\t\tthis.#failed_effect = this.#run(() => {\n\t\t\t\t\tBatch.ensure();\n\t\t\t\t\tthis.#is_creating_fallback = true;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn branch(() => {\n\t\t\t\t\t\t\tfailed(\n\t\t\t\t\t\t\t\tthis.#anchor,\n\t\t\t\t\t\t\t\t() => error,\n\t\t\t\t\t\t\t\t() => reset\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tinvoke_error_boundary(error, /** @type {Effect} */ (this.#effect.parent));\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tthis.#is_creating_fallback = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport function get_boundary() {\n\treturn /** @type {Boundary} */ (/** @type {Effect} */ (active_effect).b);\n}\n\nexport function pending() {\n\tif (active_effect === null) {\n\t\te.effect_pending_outside_reaction();\n\t}\n\n\tvar boundary = active_effect.b;\n\n\tif (boundary === null) {\n\t\treturn 0; // TODO eventually we will need this to be global\n\t}\n\n\treturn boundary.get_effect_pending();\n}\n","/** @import { EachItem, EachState, Effect, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport {\n\tEACH_INDEX_REACTIVE,\n\tEACH_IS_ANIMATED,\n\tEACH_IS_CONTROLLED,\n\tEACH_ITEM_IMMUTABLE,\n\tEACH_ITEM_REACTIVE,\n\tHYDRATION_END,\n\tHYDRATION_START_ELSE\n} from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tread_hydration_instruction,\n\tskip_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tshould_defer_append\n} from '../operations.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\trun_out_transitions,\n\tpause_children,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { source, mutable_source, internal_set } from '../../reactivity/sources.js';\nimport { array_from, is_array } from '../../../shared/utils.js';\nimport { COMMENT_NODE, INERT } from '#client/constants';\nimport { queue_micro_task } from '../task.js';\nimport { get } from '../../runtime.js';\nimport { DEV } from 'esm-env';\nimport { derived_safe_equal } from '../../reactivity/deriveds.js';\nimport { current_batch } from '../../reactivity/batch.js';\n\n/**\n * The row of a keyed each block that is currently updating. We track this\n * so that `animate:` directives have something to attach themselves to\n * @type {EachItem | null}\n */\nexport let current_each_item = null;\n\n/** @param {EachItem | null} item */\nexport function set_current_each_item(item) {\n\tcurrent_each_item = item;\n}\n\n/**\n * @param {any} _\n * @param {number} i\n */\nexport function index(_, i) {\n\treturn i;\n}\n\n/**\n * Pause multiple effects simultaneously, and coordinate their\n * subsequent destruction. Used in each blocks\n * @param {EachState} state\n * @param {EachItem[]} to_destroy\n * @param {null | Node} controlled_anchor\n */\nfunction pause_effects(state, to_destroy, controlled_anchor) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\tvar length = to_destroy.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tpause_children(to_destroy[i].e, transitions, true);\n\t}\n\n\trun_out_transitions(transitions, () => {\n\t\t// If we're in a controlled each block (i.e. the block is the only child of an\n\t\t// element), and we are removing all items, _and_ there are no out transitions,\n\t\t// we can use the fast path — emptying the element and replacing the anchor\n\t\tvar fast_path = transitions.length === 0 && controlled_anchor !== null;\n\n\t\t// TODO only destroy effects if no pending batch needs them. otherwise,\n\t\t// just set `item.o` back to `false`\n\n\t\tif (fast_path) {\n\t\t\tvar anchor = /** @type {Element} */ (controlled_anchor);\n\t\t\tvar parent_node = /** @type {Element} */ (anchor.parentNode);\n\n\t\t\tclear_text_content(parent_node);\n\t\t\tparent_node.append(anchor);\n\n\t\t\tstate.items.clear();\n\t\t\tlink(state, to_destroy[0].prev, to_destroy[length - 1].next);\n\t\t}\n\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tvar item = to_destroy[i];\n\n\t\t\tif (!fast_path) {\n\t\t\t\tstate.items.delete(item.k);\n\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t}\n\n\t\t\tdestroy_effect(item.e, !fast_path);\n\t\t}\n\n\t\tif (state.first === to_destroy[0]) {\n\t\t\tstate.first = to_destroy[0].prev;\n\t\t}\n\t});\n}\n\n/**\n * @template V\n * @param {Element | Comment} node The next sibling node, or the parent node if this is a 'controlled' block\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {(value: V, index: number) => any} get_key\n * @param {(anchor: Node, item: MaybeSource, index: MaybeSource) => void} render_fn\n * @param {null | ((anchor: Node) => void)} fallback_fn\n * @returns {void}\n */\nexport function each(node, flags, get_collection, get_key, render_fn, fallback_fn = null) {\n\tvar anchor = node;\n\n\t/** @type {Map} */\n\tvar items = new Map();\n\n\t/** @type {EachItem | null} */\n\tvar first = null;\n\n\tvar is_controlled = (flags & EACH_IS_CONTROLLED) !== 0;\n\tvar is_reactive_value = (flags & EACH_ITEM_REACTIVE) !== 0;\n\tvar is_reactive_index = (flags & EACH_INDEX_REACTIVE) !== 0;\n\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (node);\n\n\t\tanchor = hydrating\n\t\t\t? set_hydrate_node(/** @type {Comment | Text} */ (get_first_child(parent_node)))\n\t\t\t: parent_node.appendChild(create_text());\n\t}\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\t/** @type {{ fragment: DocumentFragment | null, effect: Effect } | null} */\n\tvar fallback = null;\n\n\t// TODO: ideally we could use derived for runes mode but because of the ability\n\t// to use a store which can be mutated, we can't do that here as mutating a store\n\t// will still result in the collection array being the same from the store\n\tvar each_array = derived_safe_equal(() => {\n\t\tvar collection = get_collection();\n\n\t\treturn is_array(collection) ? collection : collection == null ? [] : array_from(collection);\n\t});\n\n\t/** @type {V[]} */\n\tvar array;\n\n\tvar first_run = true;\n\n\tfunction commit() {\n\t\treconcile(state, array, anchor, flags, get_key);\n\n\t\tif (fallback !== null) {\n\t\t\tif (array.length === 0) {\n\t\t\t\tif (fallback.fragment) {\n\t\t\t\t\tanchor.before(fallback.fragment);\n\t\t\t\t\tfallback.fragment = null;\n\t\t\t\t} else {\n\t\t\t\t\tresume_effect(fallback.effect);\n\t\t\t\t}\n\n\t\t\t\teffect.first = fallback.effect;\n\t\t\t} else {\n\t\t\t\tpause_effect(fallback.effect, () => {\n\t\t\t\t\t// TODO only null out if no pending batch needs it,\n\t\t\t\t\t// otherwise re-add `fallback.fragment` and move the\n\t\t\t\t\t// effect into it\n\t\t\t\t\tfallback = null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tvar effect = block(() => {\n\t\tarray = /** @type {V[]} */ (get(each_array));\n\t\tvar length = array.length;\n\n\t\t/** `true` if there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tvar is_else = read_hydration_instruction(anchor) === HYDRATION_START_ELSE;\n\n\t\t\tif (is_else !== (length === 0)) {\n\t\t\t\t// hydration mismatch — remove the server-rendered DOM and start over\n\t\t\t\tanchor = skip_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\tvar keys = new Set();\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\t\tvar prev = null;\n\t\tvar defer = should_defer_append();\n\n\t\tfor (var i = 0; i < length; i += 1) {\n\t\t\tif (\n\t\t\t\thydrating &&\n\t\t\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\t\t\t/** @type {Comment} */ (hydrate_node).data === HYDRATION_END\n\t\t\t) {\n\t\t\t\t// The server rendered fewer items than expected,\n\t\t\t\t// so break out and continue appending non-hydrated items\n\t\t\t\tanchor = /** @type {Comment} */ (hydrate_node);\n\t\t\t\tmismatch = true;\n\t\t\t\tset_hydrating(false);\n\t\t\t}\n\n\t\t\tvar value = array[i];\n\t\t\tvar key = get_key(value, i);\n\n\t\t\tvar item = first_run ? null : items.get(key);\n\n\t\t\tif (item) {\n\t\t\t\t// update before reconciliation, to trigger any async updates\n\t\t\t\tif (is_reactive_value) {\n\t\t\t\t\tinternal_set(item.v, value);\n\t\t\t\t}\n\n\t\t\t\tif (is_reactive_index) {\n\t\t\t\t\tinternal_set(/** @type {Value} */ (item.i), i);\n\t\t\t\t} else {\n\t\t\t\t\titem.i = i;\n\t\t\t\t}\n\n\t\t\t\tif (defer) {\n\t\t\t\t\tbatch.skipped_effects.delete(item.e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\titem = create_item(\n\t\t\t\t\tfirst_run ? anchor : null,\n\t\t\t\t\tprev,\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\ti,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\n\t\t\t\tif (first_run) {\n\t\t\t\t\titem.o = true;\n\n\t\t\t\t\tif (prev === null) {\n\t\t\t\t\t\tfirst = item;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprev.next = item;\n\t\t\t\t\t}\n\n\t\t\t\t\tprev = item;\n\t\t\t\t}\n\n\t\t\t\titems.set(key, item);\n\t\t\t}\n\n\t\t\tkeys.add(key);\n\t\t}\n\n\t\tif (length === 0 && fallback_fn && !fallback) {\n\t\t\tif (first_run) {\n\t\t\t\tfallback = {\n\t\t\t\t\tfragment: null,\n\t\t\t\t\teffect: branch(() => fallback_fn(anchor))\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\t\tvar target = create_text();\n\t\t\t\tfragment.append(target);\n\n\t\t\t\tfallback = {\n\t\t\t\t\tfragment,\n\t\t\t\t\teffect: branch(() => fallback_fn(target))\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// remove excess nodes\n\t\tif (hydrating && length > 0) {\n\t\t\tset_hydrate_node(skip_nodes());\n\t\t}\n\n\t\tif (!first_run) {\n\t\t\tif (defer) {\n\t\t\t\tfor (const [key, item] of items) {\n\t\t\t\t\tif (!keys.has(key)) {\n\t\t\t\t\t\tbatch.skipped_effects.add(item.e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch.oncommit(commit);\n\t\t\t\tbatch.ondiscard(() => {\n\t\t\t\t\t// TODO presumably we need to do something here?\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tcommit();\n\t\t\t}\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\n\t\t// When we mount the each block for the first time, the collection won't be\n\t\t// connected to this effect as the effect hasn't finished running yet and its deps\n\t\t// won't be assigned. However, it's possible that when reconciling the each block\n\t\t// that a mutation occurred and it's made the collection MAYBE_DIRTY, so reading the\n\t\t// collection again can provide consistency to the reactive graph again as the deriveds\n\t\t// will now be `CLEAN`.\n\t\tget(each_array);\n\t});\n\n\t/** @type {EachState} */\n\tvar state = { effect, flags, items, first };\n\n\tfirst_run = false;\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * Add, remove, or reorder items output by an each block as its input changes\n * @template V\n * @param {EachState} state\n * @param {Array} array\n * @param {Element | Comment | Text} anchor\n * @param {number} flags\n * @param {(value: V, index: number) => any} get_key\n * @returns {void}\n */\nfunction reconcile(state, array, anchor, flags, get_key) {\n\tvar is_animated = (flags & EACH_IS_ANIMATED) !== 0;\n\n\tvar length = array.length;\n\tvar items = state.items;\n\tvar current = state.first;\n\n\t/** @type {undefined | Set} */\n\tvar seen;\n\n\t/** @type {EachItem | null} */\n\tvar prev = null;\n\n\t/** @type {undefined | Set} */\n\tvar to_animate;\n\n\t/** @type {EachItem[]} */\n\tvar matched = [];\n\n\t/** @type {EachItem[]} */\n\tvar stashed = [];\n\n\t/** @type {V} */\n\tvar value;\n\n\t/** @type {any} */\n\tvar key;\n\n\t/** @type {EachItem | undefined} */\n\tvar item;\n\n\t/** @type {number} */\n\tvar i;\n\n\tif (is_animated) {\n\t\tfor (i = 0; i < length; i += 1) {\n\t\t\tvalue = array[i];\n\t\t\tkey = get_key(value, i);\n\t\t\titem = /** @type {EachItem} */ (items.get(key));\n\n\t\t\t// offscreen == coming in now, no animation in that case,\n\t\t\t// else this would happen https://github.com/sveltejs/svelte/issues/17181\n\t\t\tif (item.o) {\n\t\t\t\titem.a?.measure();\n\t\t\t\t(to_animate ??= new Set()).add(item);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (i = 0; i < length; i += 1) {\n\t\tvalue = array[i];\n\t\tkey = get_key(value, i);\n\n\t\titem = /** @type {EachItem} */ (items.get(key));\n\n\t\tstate.first ??= item;\n\n\t\tif (!item.o) {\n\t\t\titem.o = true;\n\n\t\t\tvar next = prev ? prev.next : current;\n\n\t\t\tlink(state, prev, item);\n\t\t\tlink(state, item, next);\n\n\t\t\tmove(item, next, anchor);\n\t\t\tprev = item;\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\tcurrent = prev.next;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ((item.e.f & INERT) !== 0) {\n\t\t\tresume_effect(item.e);\n\t\t\tif (is_animated) {\n\t\t\t\titem.a?.unfix();\n\t\t\t\t(to_animate ??= new Set()).delete(item);\n\t\t\t}\n\t\t}\n\n\t\tif (item !== current) {\n\t\t\tif (seen !== undefined && seen.has(item)) {\n\t\t\t\tif (matched.length < stashed.length) {\n\t\t\t\t\t// more efficient to move later items to the front\n\t\t\t\t\tvar start = stashed[0];\n\t\t\t\t\tvar j;\n\n\t\t\t\t\tprev = start.prev;\n\n\t\t\t\t\tvar a = matched[0];\n\t\t\t\t\tvar b = matched[matched.length - 1];\n\n\t\t\t\t\tfor (j = 0; j < matched.length; j += 1) {\n\t\t\t\t\t\tmove(matched[j], start, anchor);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (j = 0; j < stashed.length; j += 1) {\n\t\t\t\t\t\tseen.delete(stashed[j]);\n\t\t\t\t\t}\n\n\t\t\t\t\tlink(state, a.prev, b.next);\n\t\t\t\t\tlink(state, prev, a);\n\t\t\t\t\tlink(state, b, start);\n\n\t\t\t\t\tcurrent = start;\n\t\t\t\t\tprev = b;\n\t\t\t\t\ti -= 1;\n\n\t\t\t\t\tmatched = [];\n\t\t\t\t\tstashed = [];\n\t\t\t\t} else {\n\t\t\t\t\t// more efficient to move earlier items to the back\n\t\t\t\t\tseen.delete(item);\n\t\t\t\t\tmove(item, current, anchor);\n\n\t\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t\t\tlink(state, item, prev === null ? state.first : prev.next);\n\t\t\t\t\tlink(state, prev, item);\n\n\t\t\t\t\tprev = item;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\twhile (current !== null && current.k !== key) {\n\t\t\t\t// If the each block isn't inert and an item has an effect that is already inert,\n\t\t\t\t// skip over adding it to our seen Set as the item is already being handled\n\t\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\t\t(seen ??= new Set()).add(current);\n\t\t\t\t}\n\t\t\t\tstashed.push(current);\n\t\t\t\tcurrent = current.next;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\titem = current;\n\t\t}\n\n\t\tmatched.push(item);\n\t\tprev = item;\n\t\tcurrent = item.next;\n\t}\n\n\tlet has_offscreen_items = items.size > length;\n\n\tif (current !== null || seen !== undefined) {\n\t\tvar to_destroy = seen === undefined ? [] : array_from(seen);\n\n\t\twhile (current !== null) {\n\t\t\t// If the each block isn't inert, then inert effects are currently outroing and will be removed once the transition is finished\n\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\tto_destroy.push(current);\n\t\t\t}\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tvar destroy_length = to_destroy.length;\n\n\t\thas_offscreen_items = items.size - destroy_length > length;\n\n\t\tif (destroy_length > 0) {\n\t\t\tvar controlled_anchor = (flags & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null;\n\n\t\t\tif (is_animated) {\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.measure();\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.fix();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpause_effects(state, to_destroy, controlled_anchor);\n\t\t}\n\t}\n\n\t// Append offscreen items at the end\n\tif (has_offscreen_items) {\n\t\tfor (const item of items.values()) {\n\t\t\tif (!item.o) {\n\t\t\t\tlink(state, prev, item);\n\t\t\t\tprev = item;\n\t\t\t}\n\t\t}\n\t}\n\n\tstate.effect.last = prev && prev.e;\n\n\tif (is_animated) {\n\t\tqueue_micro_task(() => {\n\t\t\tif (to_animate === undefined) return;\n\t\t\tfor (item of to_animate) {\n\t\t\t\titem.a?.apply();\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @template V\n * @param {Node | null} anchor\n * @param {EachItem | null} prev\n * @param {V} value\n * @param {unknown} key\n * @param {number} index\n * @param {(anchor: Node, item: V | Source, index: number | Value, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @returns {EachItem}\n */\nfunction create_item(anchor, prev, value, key, index, render_fn, flags, get_collection) {\n\tvar previous_each_item = current_each_item;\n\tvar reactive = (flags & EACH_ITEM_REACTIVE) !== 0;\n\tvar mutable = (flags & EACH_ITEM_IMMUTABLE) === 0;\n\n\tvar v = reactive ? (mutable ? mutable_source(value, false, false) : source(value)) : value;\n\tvar i = (flags & EACH_INDEX_REACTIVE) === 0 ? index : source(index);\n\n\tif (DEV && reactive) {\n\t\t// For tracing purposes, we need to link the source signal we create with the\n\t\t// collection + index so that tracing works as intended\n\t\t/** @type {Value} */ (v).trace = () => {\n\t\t\tvar collection_index = typeof i === 'number' ? index : i.v;\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-expressions\n\t\t\tget_collection()[collection_index];\n\t\t};\n\t}\n\n\t/** @type {EachItem} */\n\tvar item = {\n\t\ti,\n\t\tv,\n\t\tk: key,\n\t\ta: null,\n\t\t// @ts-expect-error\n\t\te: null,\n\t\to: false,\n\t\tprev,\n\t\tnext: null\n\t};\n\n\tcurrent_each_item = item;\n\n\ttry {\n\t\tif (anchor === null) {\n\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\tfragment.append((anchor = create_text()));\n\t\t}\n\n\t\titem.e = branch(() => render_fn(/** @type {Node} */ (anchor), v, i, get_collection));\n\n\t\tif (prev !== null) {\n\t\t\t// we only need to set `prev.next = item`, because\n\t\t\t// `item.prev = prev` was set on initialization.\n\t\t\t// the effects themselves are already linked\n\t\t\tprev.next = item;\n\t\t}\n\n\t\treturn item;\n\t} finally {\n\t\tcurrent_each_item = previous_each_item;\n\t}\n}\n\n/**\n * @param {EachItem} item\n * @param {EachItem | null} next\n * @param {Text | Element | Comment} anchor\n */\nfunction move(item, next, anchor) {\n\tvar end = item.next ? /** @type {TemplateNode} */ (item.next.e.nodes_start) : anchor;\n\n\tvar dest = next ? /** @type {TemplateNode} */ (next.e.nodes_start) : anchor;\n\tvar node = /** @type {TemplateNode} */ (item.e.nodes_start);\n\n\twhile (node !== null && node !== end) {\n\t\tvar next_node = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tdest.before(node);\n\t\tnode = next_node;\n\t}\n}\n\n/**\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n */\nfunction link(state, prev, next) {\n\tif (prev === null) {\n\t\tstate.first = next;\n\t\tstate.effect.first = next && next.e;\n\t} else {\n\t\tif (prev.e.next) {\n\t\t\tprev.e.next.prev = null;\n\t\t}\n\n\t\tprev.next = next;\n\t\tprev.e.next = next && next.e;\n\t}\n\n\tif (next !== null) {\n\t\tif (next.e.prev) {\n\t\t\tnext.e.prev.next = null;\n\t\t}\n\n\t\tnext.prev = prev;\n\t\tnext.e.prev = prev && prev.e;\n\t}\n}\n","/** @import { Effect, TemplateNode, Value } from '#client' */\nimport { DESTROYED, STALE_REACTION } from '#client/constants';\nimport { DEV } from 'esm-env';\nimport {\n\tcomponent_context,\n\tdev_stack,\n\tis_runes,\n\tset_component_context,\n\tset_dev_stack\n} from '../context.js';\nimport { get_boundary } from '../dom/blocks/boundary.js';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../runtime.js';\nimport { Batch, current_batch } from './batch.js';\nimport {\n\tasync_derived,\n\tcurrent_async_effect,\n\tderived,\n\tderived_safe_equal,\n\tset_from_async_derived\n} from './deriveds.js';\nimport { aborted } from './effects.js';\nimport { hydrate_next, hydrating, set_hydrate_node, skip_nodes } from '../dom/hydration.js';\nimport { current_each_item, set_current_each_item } from '../dom/blocks/each.js';\n\n/**\n * @param {Array>} blockers\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise>} async\n * @param {(values: Value[]) => any} fn\n */\nexport function flatten(blockers, sync, async, fn) {\n\tconst d = is_runes() ? derived : derived_safe_equal;\n\n\tif (async.length === 0 && blockers.length === 0) {\n\t\tfn(sync.map(d));\n\t\treturn;\n\t}\n\n\tvar batch = current_batch;\n\tvar parent = /** @type {Effect} */ (active_effect);\n\n\tvar restore = capture();\n\n\tfunction run() {\n\t\tPromise.all(async.map((expression) => async_derived(expression)))\n\t\t\t.then((result) => {\n\t\t\t\trestore();\n\n\t\t\t\ttry {\n\t\t\t\t\tfn([...sync.map(d), ...result]);\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// ignore errors in blocks that have already been destroyed\n\t\t\t\t\tif ((parent.f & DESTROYED) === 0) {\n\t\t\t\t\t\tinvoke_error_boundary(error, parent);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch?.deactivate();\n\t\t\t\tunset_context();\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tinvoke_error_boundary(error, parent);\n\t\t\t});\n\t}\n\n\tif (blockers.length > 0) {\n\t\tPromise.all(blockers).then(() => {\n\t\t\trestore();\n\n\t\t\ttry {\n\t\t\t\treturn run();\n\t\t\t} finally {\n\t\t\t\tbatch?.deactivate();\n\t\t\t\tunset_context();\n\t\t\t}\n\t\t});\n\t} else {\n\t\trun();\n\t}\n}\n\n/**\n * @param {Array>} blockers\n * @param {(values: Value[]) => any} fn\n */\nexport function run_after_blockers(blockers, fn) {\n\tvar each_item = current_each_item; // TODO should this be part of capture?\n\tflatten(blockers, [], [], (v) => {\n\t\tset_current_each_item(each_item);\n\t\tfn(v);\n\t});\n}\n\n/**\n * Captures the current effect context so that we can restore it after\n * some asynchronous work has happened (so that e.g. `await a + b`\n * causes `b` to be registered as a dependency).\n */\nexport function capture() {\n\tvar previous_effect = active_effect;\n\tvar previous_reaction = active_reaction;\n\tvar previous_component_context = component_context;\n\tvar previous_batch = current_batch;\n\n\tif (DEV) {\n\t\tvar previous_dev_stack = dev_stack;\n\t}\n\n\treturn function restore(activate_batch = true) {\n\t\tset_active_effect(previous_effect);\n\t\tset_active_reaction(previous_reaction);\n\t\tset_component_context(previous_component_context);\n\t\tif (activate_batch) previous_batch?.activate();\n\n\t\tif (DEV) {\n\t\t\tset_from_async_derived(null);\n\t\t\tset_dev_stack(previous_dev_stack);\n\t\t}\n\t};\n}\n\n/**\n * Wraps an `await` expression in such a way that the effect context that was\n * active before the expression evaluated can be reapplied afterwards —\n * `await a + b` becomes `(await $.save(a))() + b`\n * @template T\n * @param {Promise} promise\n * @returns {Promise<() => T>}\n */\nexport async function save(promise) {\n\tvar restore = capture();\n\tvar value = await promise;\n\n\treturn () => {\n\t\trestore();\n\t\treturn value;\n\t};\n}\n\n/**\n * Reset `current_async_effect` after the `promise` resolves, so\n * that we can emit `await_reactivity_loss` warnings\n * @template T\n * @param {Promise} promise\n * @returns {Promise<() => T>}\n */\nexport async function track_reactivity_loss(promise) {\n\tvar previous_async_effect = current_async_effect;\n\tvar value = await promise;\n\n\treturn () => {\n\t\tset_from_async_derived(previous_async_effect);\n\t\treturn value;\n\t};\n}\n\n/**\n * Used in `for await` loops in DEV, so\n * that we can emit `await_reactivity_loss` warnings\n * after each `async_iterator` result resolves and\n * after the `async_iterator` return resolves (if it runs)\n * @template T\n * @template TReturn\n * @param {Iterable | AsyncIterable} iterable\n * @returns {AsyncGenerator}\n */\nexport async function* for_await_track_reactivity_loss(iterable) {\n\t// This is based on the algorithms described in ECMA-262:\n\t// ForIn/OfBodyEvaluation\n\t// https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset\n\t// AsyncIteratorClose\n\t// https://tc39.es/ecma262/multipage/abstract-operations.html#sec-asynciteratorclose\n\n\t/** @type {AsyncIterator} */\n\t// @ts-ignore\n\tconst iterator = iterable[Symbol.asyncIterator]?.() ?? iterable[Symbol.iterator]?.();\n\n\tif (iterator === undefined) {\n\t\tthrow new TypeError('value is not async iterable');\n\t}\n\n\t/** Whether the completion of the iterator was \"normal\", meaning it wasn't ended via `break` or a similar method */\n\tlet normal_completion = false;\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = (await track_reactivity_loss(iterator.next()))();\n\t\t\tif (done) {\n\t\t\t\tnormal_completion = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tyield value;\n\t\t}\n\t} finally {\n\t\t// If the iterator had a normal completion and `return` is defined on the iterator, call it and return the value\n\t\tif (normal_completion && iterator.return !== undefined) {\n\t\t\t// eslint-disable-next-line no-unsafe-finally\n\t\t\treturn /** @type {TReturn} */ ((await track_reactivity_loss(iterator.return()))().value);\n\t\t}\n\t}\n}\n\nexport function unset_context() {\n\tset_active_effect(null);\n\tset_active_reaction(null);\n\tset_component_context(null);\n\n\tif (DEV) {\n\t\tset_from_async_derived(null);\n\t\tset_dev_stack(null);\n\t}\n}\n\n/**\n * @param {TemplateNode} anchor\n * @param {(target: TemplateNode) => Promise} fn\n */\nexport async function async_body(anchor, fn) {\n\tvar boundary = get_boundary();\n\tvar batch = /** @type {Batch} */ (current_batch);\n\tvar blocking = !boundary.is_pending();\n\n\tboundary.update_pending_count(1);\n\tbatch.increment(blocking);\n\n\tvar active = /** @type {Effect} */ (active_effect);\n\n\tvar was_hydrating = hydrating;\n\tvar next_hydrate_node = undefined;\n\n\tif (was_hydrating) {\n\t\thydrate_next();\n\t\tnext_hydrate_node = skip_nodes(false);\n\t}\n\n\ttry {\n\t\tvar promise = fn(anchor);\n\t} finally {\n\t\tif (next_hydrate_node) {\n\t\t\tset_hydrate_node(next_hydrate_node);\n\t\t\thydrate_next();\n\t\t}\n\t}\n\n\ttry {\n\t\tawait promise;\n\t} catch (error) {\n\t\tif (!aborted(active)) {\n\t\t\tinvoke_error_boundary(error, active);\n\t\t}\n\t} finally {\n\t\tboundary.update_pending_count(-1);\n\t\tbatch.decrement(blocking);\n\n\t\tunset_context();\n\t}\n}\n\n/**\n * @param {Array<() => void | Promise>} thunks\n */\nexport function run(thunks) {\n\tconst restore = capture();\n\n\tvar boundary = get_boundary();\n\tvar batch = /** @type {Batch} */ (current_batch);\n\tvar blocking = !boundary.is_pending();\n\n\tboundary.update_pending_count(1);\n\tbatch.increment(blocking);\n\n\tvar active = /** @type {Effect} */ (active_effect);\n\n\t/** @type {null | { error: any }} */\n\tvar errored = null;\n\n\t/** @param {any} error */\n\tconst handle_error = (error) => {\n\t\terrored = { error }; // wrap in object in case a promise rejects with a falsy value\n\n\t\tif (!aborted(active)) {\n\t\t\tinvoke_error_boundary(error, active);\n\t\t}\n\t};\n\n\tvar promise = Promise.resolve(thunks[0]()).catch(handle_error);\n\n\tvar promises = [promise];\n\n\tfor (const fn of thunks.slice(1)) {\n\t\tpromise = promise\n\t\t\t.then(() => {\n\t\t\t\tif (errored) {\n\t\t\t\t\tthrow errored.error;\n\t\t\t\t}\n\n\t\t\t\tif (aborted(active)) {\n\t\t\t\t\tthrow STALE_REACTION;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\trestore();\n\t\t\t\t\treturn fn();\n\t\t\t\t} finally {\n\t\t\t\t\t// TODO do we need it here as well as below?\n\t\t\t\t\tunset_context();\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(handle_error)\n\t\t\t.finally(() => {\n\t\t\t\tunset_context();\n\t\t\t});\n\n\t\tpromises.push(promise);\n\t}\n\n\tpromise\n\t\t// wait one more tick, so that template effects are\n\t\t// guaranteed to run before `$effect(...)`\n\t\t.then(() => Promise.resolve())\n\t\t.finally(() => {\n\t\t\tboundary.update_pending_count(-1);\n\t\t\tbatch.decrement(blocking);\n\t\t});\n\n\treturn promises;\n}\n","/** @import { Derived, Effect, Source } from '#client' */\n/** @import { Batch } from './batch.js'; */\nimport { DEV } from 'esm-env';\nimport {\n\tERROR_VALUE,\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tEFFECT_PRESERVED,\n\tMAYBE_DIRTY,\n\tSTALE_REACTION,\n\tASYNC,\n\tWAS_MARKED,\n\tCONNECTED,\n\tDESTROYED\n} from '#client/constants';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tset_signal_status,\n\tupdate_reaction,\n\tincrement_write_version,\n\tset_active_effect,\n\tpush_reaction_value,\n\tis_destroying_effect\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport * as e from '../errors.js';\nimport * as w from '../warnings.js';\nimport { async_effect, destroy_effect, effect_tracking, teardown } from './effects.js';\nimport { eager_effects, internal_set, set_eager_effects, source } from './sources.js';\nimport { get_error } from '../../shared/dev.js';\nimport { async_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { Boundary } from '../dom/blocks/boundary.js';\nimport { component_context } from '../context.js';\nimport { UNINITIALIZED } from '../../../constants.js';\nimport { batch_values, current_batch } from './batch.js';\nimport { unset_context } from './async.js';\nimport { deferred } from '../../shared/utils.js';\n\n/** @type {Effect | null} */\nexport let current_async_effect = null;\n\n/** @param {Effect | null} v */\nexport function set_from_async_derived(v) {\n\tcurrent_async_effect = v;\n}\n\nexport const recent_async_deriveds = new Set();\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived(fn) {\n\tvar flags = DERIVED | DIRTY;\n\tvar parent_derived =\n\t\tactive_reaction !== null && (active_reaction.f & DERIVED) !== 0\n\t\t\t? /** @type {Derived} */ (active_reaction)\n\t\t\t: null;\n\n\tif (active_effect !== null) {\n\t\t// Since deriveds are evaluated lazily, any effects created inside them are\n\t\t// created too late to ensure that the parent effect is added to the tree\n\t\tactive_effect.f |= EFFECT_PRESERVED;\n\t}\n\n\t/** @type {Derived} */\n\tconst signal = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\teffects: null,\n\t\tequals,\n\t\tf: flags,\n\t\tfn,\n\t\treactions: null,\n\t\trv: 0,\n\t\tv: /** @type {V} */ (UNINITIALIZED),\n\t\twv: 0,\n\t\tparent: parent_derived ?? active_effect,\n\t\tac: null\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = get_error('created at');\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {() => V | Promise} fn\n * @param {string} [location] If provided, print a warning if the value is not read immediately after update\n * @returns {Promise>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function async_derived(fn, location) {\n\tlet parent = /** @type {Effect | null} */ (active_effect);\n\n\tif (parent === null) {\n\t\te.async_derived_orphan();\n\t}\n\n\tvar boundary = /** @type {Boundary} */ (parent.b);\n\n\tvar promise = /** @type {Promise} */ (/** @type {unknown} */ (undefined));\n\tvar signal = source(/** @type {V} */ (UNINITIALIZED));\n\n\t// only suspend in async deriveds created on initialisation\n\tvar should_suspend = !active_reaction;\n\n\t/** @type {Map>>} */\n\tvar deferreds = new Map();\n\n\tasync_effect(() => {\n\t\tif (DEV) current_async_effect = active_effect;\n\n\t\t/** @type {ReturnType>} */\n\t\tvar d = deferred();\n\t\tpromise = d.promise;\n\n\t\ttry {\n\t\t\t// If this code is changed at some point, make sure to still access the then property\n\t\t\t// of fn() to read any signals it might access, so that we track them as dependencies.\n\t\t\t// We call `unset_context` to undo any `save` calls that happen inside `fn()`\n\t\t\tPromise.resolve(fn())\n\t\t\t\t.then(d.resolve, d.reject)\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (batch === current_batch && batch.committed) {\n\t\t\t\t\t\t// if the batch was rejected as stale, we need to cleanup\n\t\t\t\t\t\t// after any `$.save(...)` calls inside `fn()`\n\t\t\t\t\t\tbatch.deactivate();\n\t\t\t\t\t}\n\n\t\t\t\t\tunset_context();\n\t\t\t\t});\n\t\t} catch (error) {\n\t\t\td.reject(error);\n\t\t\tunset_context();\n\t\t}\n\n\t\tif (DEV) current_async_effect = null;\n\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\tif (should_suspend) {\n\t\t\tvar blocking = !boundary.is_pending();\n\n\t\t\tboundary.update_pending_count(1);\n\t\t\tbatch.increment(blocking);\n\n\t\t\tdeferreds.get(batch)?.reject(STALE_REACTION);\n\t\t\tdeferreds.delete(batch); // delete to ensure correct order in Map iteration below\n\t\t\tdeferreds.set(batch, d);\n\t\t}\n\n\t\t/**\n\t\t * @param {any} value\n\t\t * @param {unknown} error\n\t\t */\n\t\tconst handler = (value, error = undefined) => {\n\t\t\tcurrent_async_effect = null;\n\n\t\t\tbatch.activate();\n\n\t\t\tif (error) {\n\t\t\t\tif (error !== STALE_REACTION) {\n\t\t\t\t\tsignal.f |= ERROR_VALUE;\n\n\t\t\t\t\t// @ts-expect-error the error is the wrong type, but we don't care\n\t\t\t\t\tinternal_set(signal, error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\t\t\t\tsignal.f ^= ERROR_VALUE;\n\t\t\t\t}\n\n\t\t\t\tinternal_set(signal, value);\n\n\t\t\t\t// All prior async derived runs are now stale\n\t\t\t\tfor (const [b, d] of deferreds) {\n\t\t\t\t\tdeferreds.delete(b);\n\t\t\t\t\tif (b === batch) break;\n\t\t\t\t\td.reject(STALE_REACTION);\n\t\t\t\t}\n\n\t\t\t\tif (DEV && location !== undefined) {\n\t\t\t\t\trecent_async_deriveds.add(signal);\n\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (recent_async_deriveds.has(signal)) {\n\t\t\t\t\t\t\tw.await_waterfall(/** @type {string} */ (signal.label), location);\n\t\t\t\t\t\t\trecent_async_deriveds.delete(signal);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (should_suspend) {\n\t\t\t\tboundary.update_pending_count(-1);\n\t\t\t\tbatch.decrement(blocking);\n\t\t\t}\n\t\t};\n\n\t\td.promise.then(handler, (e) => handler(null, e || 'unknown'));\n\t});\n\n\tteardown(() => {\n\t\tfor (const d of deferreds.values()) {\n\t\t\td.reject(STALE_REACTION);\n\t\t}\n\t});\n\n\tif (DEV) {\n\t\t// add a flag that lets this be printed as a derived\n\t\t// when using `$inspect.trace()`\n\t\tsignal.f |= ASYNC;\n\t}\n\n\treturn new Promise((fulfil) => {\n\t\t/** @param {Promise} p */\n\t\tfunction next(p) {\n\t\t\tfunction go() {\n\t\t\t\tif (p === promise) {\n\t\t\t\t\tfulfil(signal);\n\t\t\t\t} else {\n\t\t\t\t\t// if the effect re-runs before the initial promise\n\t\t\t\t\t// resolves, delay resolution until we have a value\n\t\t\t\t\tnext(promise);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp.then(go, go);\n\t\t}\n\n\t\tnext(promise);\n\t});\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function user_derived(fn) {\n\tconst d = derived(fn);\n\n\tif (!async_mode_flag) push_reaction_value(d);\n\n\treturn d;\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived_safe_equal(fn) {\n\tconst signal = derived(fn);\n\tsignal.equals = safe_equals;\n\treturn signal;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function destroy_derived_effects(derived) {\n\tvar effects = derived.effects;\n\n\tif (effects !== null) {\n\t\tderived.effects = null;\n\n\t\tfor (var i = 0; i < effects.length; i += 1) {\n\t\t\tdestroy_effect(/** @type {Effect} */ (effects[i]));\n\t\t}\n\t}\n}\n\n/**\n * The currently updating deriveds, used to detect infinite recursion\n * in dev mode and provide a nicer error than 'too much recursion'\n * @type {Derived[]}\n */\nlet stack = [];\n\n/**\n * @param {Derived} derived\n * @returns {Effect | null}\n */\nfunction get_derived_parent_effect(derived) {\n\tvar parent = derived.parent;\n\twhile (parent !== null) {\n\t\tif ((parent.f & DERIVED) === 0) {\n\t\t\t// The original parent effect might've been destroyed but the derived\n\t\t\t// is used elsewhere now - do not return the destroyed effect in that case\n\t\t\treturn (parent.f & DESTROYED) === 0 ? /** @type {Effect} */ (parent) : null;\n\t\t}\n\t\tparent = parent.parent;\n\t}\n\treturn null;\n}\n\n/**\n * @template T\n * @param {Derived} derived\n * @returns {T}\n */\nexport function execute_derived(derived) {\n\tvar value;\n\tvar prev_active_effect = active_effect;\n\n\tset_active_effect(get_derived_parent_effect(derived));\n\n\tif (DEV) {\n\t\tlet prev_eager_effects = eager_effects;\n\t\tset_eager_effects(new Set());\n\t\ttry {\n\t\t\tif (stack.includes(derived)) {\n\t\t\t\te.derived_references_self();\n\t\t\t}\n\n\t\t\tstack.push(derived);\n\n\t\t\tderived.f &= ~WAS_MARKED;\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t\tset_eager_effects(prev_eager_effects);\n\t\t\tstack.pop();\n\t\t}\n\t} else {\n\t\ttry {\n\t\t\tderived.f &= ~WAS_MARKED;\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t}\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function update_derived(derived) {\n\tvar value = execute_derived(derived);\n\n\tif (!derived.equals(value)) {\n\t\t// in a fork, we don't update the underlying value, just `batch_values`.\n\t\t// the underlying value will be updated when the fork is committed.\n\t\t// otherwise, the next time we get here after a 'real world' state\n\t\t// change, `derived.equals` may incorrectly return `true`\n\t\tif (!current_batch?.is_fork) {\n\t\t\tderived.v = value;\n\t\t}\n\n\t\tderived.wv = increment_write_version();\n\t}\n\n\t// don't mark derived clean if we're reading it inside a\n\t// cleanup function, or it will cache a stale value\n\tif (is_destroying_effect) {\n\t\treturn;\n\t}\n\n\t// During time traveling we don't want to reset the status so that\n\t// traversal of the graph in the other batches still happens\n\tif (batch_values !== null) {\n\t\t// only cache the value if we're in a tracking context, otherwise we won't\n\t\t// clear the cache in `mark_reactions` when dependencies are updated\n\t\tif (effect_tracking() || current_batch?.is_fork) {\n\t\t\tbatch_values.set(derived, value);\n\t\t}\n\t} else {\n\t\tvar status = (derived.f & CONNECTED) === 0 ? MAYBE_DIRTY : CLEAN;\n\t\tset_signal_status(derived, status);\n\t}\n}\n","/** @import { Derived, Effect, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tuntracked_writes,\n\tget,\n\tset_untracked_writes,\n\tset_signal_status,\n\tuntrack,\n\tincrement_write_version,\n\tupdate_effect,\n\tcurrent_sources,\n\tis_dirty,\n\tuntracking,\n\tis_destroying_effect,\n\tpush_reaction_value,\n\tset_is_updating_effect,\n\tis_updating_effect\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport {\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tEAGER_EFFECT,\n\tMAYBE_DIRTY,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tASYNC,\n\tWAS_MARKED,\n\tCONNECTED\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { legacy_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { tag_proxy } from '../dev/tracing.js';\nimport { get_error } from '../../shared/dev.js';\nimport { component_context, is_runes } from '../context.js';\nimport { Batch, batch_values, eager_block_effects, schedule_effect } from './batch.js';\nimport { proxy } from '../proxy.js';\nimport { execute_derived } from './deriveds.js';\n\n/** @type {Set} */\nexport let eager_effects = new Set();\n\n/** @type {Map} */\nexport const old_values = new Map();\n\n/**\n * @param {Set} v\n */\nexport function set_eager_effects(v) {\n\teager_effects = v;\n}\n\nlet eager_effects_deferred = false;\n\nexport function set_eager_effects_deferred() {\n\teager_effects_deferred = true;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n * @returns {Source}\n */\n// TODO rename this to `state` throughout the codebase\nexport function source(v, stack) {\n\t/** @type {Value} */\n\tvar signal = {\n\t\tf: 0, // TODO ideally we could skip this altogether, but it causes type errors\n\t\tv,\n\t\treactions: null,\n\t\tequals,\n\t\trv: 0,\n\t\twv: 0\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = stack ?? get_error('created at');\n\t\tsignal.updated = null;\n\t\tsignal.set_during_effect = false;\n\t\tsignal.trace = null;\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function state(v, stack) {\n\tconst s = source(v, stack);\n\n\tpush_reaction_value(s);\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {V} initial_value\n * @param {boolean} [immutable]\n * @returns {Source}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function mutable_source(initial_value, immutable = false, trackable = true) {\n\tconst s = source(initial_value);\n\tif (!immutable) {\n\t\ts.equals = safe_equals;\n\t}\n\n\t// bind the signal to the component context, in case we need to\n\t// track updates to trigger beforeUpdate/afterUpdate callbacks\n\tif (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) {\n\t\t(component_context.l.s ??= []).push(s);\n\t}\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {Value} source\n * @param {V} value\n */\nexport function mutate(source, value) {\n\tset(\n\t\tsource,\n\t\tuntrack(() => get(source))\n\t);\n\treturn value;\n}\n\n/**\n * @template V\n * @param {Source} source\n * @param {V} value\n * @param {boolean} [should_proxy]\n * @returns {V}\n */\nexport function set(source, value, should_proxy = false) {\n\tif (\n\t\tactive_reaction !== null &&\n\t\t// since we are untracking the function inside `$inspect.with` we need to add this check\n\t\t// to ensure we error if state is set inside an inspect effect\n\t\t(!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) &&\n\t\tis_runes() &&\n\t\t(active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 &&\n\t\t!current_sources?.includes(source)\n\t) {\n\t\te.state_unsafe_mutation();\n\t}\n\n\tlet new_value = should_proxy ? proxy(value) : value;\n\n\tif (DEV) {\n\t\ttag_proxy(new_value, /** @type {string} */ (source.label));\n\t}\n\n\treturn internal_set(source, new_value);\n}\n\n/**\n * @template V\n * @param {Source} source\n * @param {V} value\n * @returns {V}\n */\nexport function internal_set(source, value) {\n\tif (!source.equals(value)) {\n\t\tvar old_value = source.v;\n\n\t\tif (is_destroying_effect) {\n\t\t\told_values.set(source, value);\n\t\t} else {\n\t\t\told_values.set(source, old_value);\n\t\t}\n\n\t\tsource.v = value;\n\n\t\tvar batch = Batch.ensure();\n\t\tbatch.capture(source, old_value);\n\n\t\tif (DEV) {\n\t\t\tif (tracing_mode_flag || active_effect !== null) {\n\t\t\t\tsource.updated ??= new Map();\n\n\t\t\t\t// For performance reasons, when not using $inspect.trace, we only start collecting stack traces\n\t\t\t\t// after the same source has been updated more than 5 times in the same flush cycle.\n\t\t\t\tconst count = (source.updated.get('')?.count ?? 0) + 1;\n\t\t\t\tsource.updated.set('', { error: /** @type {any} */ (null), count });\n\n\t\t\t\tif (tracing_mode_flag || count > 5) {\n\t\t\t\t\tconst error = get_error('updated at');\n\n\t\t\t\t\tif (error !== null) {\n\t\t\t\t\t\tlet entry = source.updated.get(error.stack);\n\n\t\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\t\tentry = { error, count: 0 };\n\t\t\t\t\t\t\tsource.updated.set(error.stack, entry);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tentry.count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (active_effect !== null) {\n\t\t\t\tsource.set_during_effect = true;\n\t\t\t}\n\t\t}\n\n\t\tif ((source.f & DERIVED) !== 0) {\n\t\t\t// if we are assigning to a dirty derived we set it to clean/maybe dirty but we also eagerly execute it to track the dependencies\n\t\t\tif ((source.f & DIRTY) !== 0) {\n\t\t\t\texecute_derived(/** @type {Derived} */ (source));\n\t\t\t}\n\n\t\t\tset_signal_status(source, (source.f & CONNECTED) !== 0 ? CLEAN : MAYBE_DIRTY);\n\t\t}\n\n\t\tsource.wv = increment_write_version();\n\n\t\tmark_reactions(source, DIRTY);\n\n\t\t// It's possible that the current reaction might not have up-to-date dependencies\n\t\t// whilst it's actively running. So in the case of ensuring it registers the reaction\n\t\t// properly for itself, we need to ensure the current effect actually gets\n\t\t// scheduled. i.e: `$effect(() => x++)`\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tactive_effect !== null &&\n\t\t\t(active_effect.f & CLEAN) !== 0 &&\n\t\t\t(active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0\n\t\t) {\n\t\t\tif (untracked_writes === null) {\n\t\t\t\tset_untracked_writes([source]);\n\t\t\t} else {\n\t\t\t\tuntracked_writes.push(source);\n\t\t\t}\n\t\t}\n\n\t\tif (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {\n\t\t\tflush_eager_effects();\n\t\t}\n\t}\n\n\treturn value;\n}\n\nexport function flush_eager_effects() {\n\teager_effects_deferred = false;\n\tvar prev_is_updating_effect = is_updating_effect;\n\tset_is_updating_effect(true);\n\n\tconst inspects = Array.from(eager_effects);\n\n\ttry {\n\t\tfor (const effect of inspects) {\n\t\t\t// Mark clean inspect-effects as maybe dirty and then check their dirtiness\n\t\t\t// instead of just updating the effects - this way we avoid overfiring.\n\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t}\n\n\t\t\tif (is_dirty(effect)) {\n\t\t\t\tupdate_effect(effect);\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tset_is_updating_effect(prev_is_updating_effect);\n\t}\n\n\teager_effects.clear();\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update(source, d = 1) {\n\tvar value = get(source);\n\tvar result = d === 1 ? value++ : value--;\n\n\tset(source, value);\n\n\t// @ts-expect-error\n\treturn result;\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update_pre(source, d = 1) {\n\tvar value = get(source);\n\n\t// @ts-expect-error\n\treturn set(source, d === 1 ? ++value : --value);\n}\n\n/**\n * Silently (without using `get`) increment a source\n * @param {Source} source\n */\nexport function increment(source) {\n\tset(source, source.v + 1);\n}\n\n/**\n * @param {Value} signal\n * @param {number} status should be DIRTY or MAYBE_DIRTY\n * @returns {void}\n */\nfunction mark_reactions(signal, status) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tvar runes = is_runes();\n\tvar length = reactions.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar reaction = reactions[i];\n\t\tvar flags = reaction.f;\n\n\t\t// In legacy mode, skip the current effect to prevent infinite loops\n\t\tif (!runes && reaction === active_effect) continue;\n\n\t\t// Inspect effects need to run immediately, so that the stack trace makes sense\n\t\tif (DEV && (flags & EAGER_EFFECT) !== 0) {\n\t\t\teager_effects.add(reaction);\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar not_dirty = (flags & DIRTY) === 0;\n\n\t\t// don't set a DIRTY reaction to MAYBE_DIRTY\n\t\tif (not_dirty) {\n\t\t\tset_signal_status(reaction, status);\n\t\t}\n\n\t\tif ((flags & DERIVED) !== 0) {\n\t\t\tvar derived = /** @type {Derived} */ (reaction);\n\n\t\t\tbatch_values?.delete(derived);\n\n\t\t\tif ((flags & WAS_MARKED) === 0) {\n\t\t\t\t// Only connected deriveds can be reliably unmarked right away\n\t\t\t\tif (flags & CONNECTED) {\n\t\t\t\t\treaction.f |= WAS_MARKED;\n\t\t\t\t}\n\n\t\t\t\tmark_reactions(derived, MAYBE_DIRTY);\n\t\t\t}\n\t\t} else if (not_dirty) {\n\t\t\tif ((flags & BLOCK_EFFECT) !== 0 && eager_block_effects !== null) {\n\t\t\t\teager_block_effects.add(/** @type {Effect} */ (reaction));\n\t\t\t}\n\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tget,\n\tactive_effect,\n\tupdate_version,\n\tactive_reaction,\n\tset_update_version,\n\tset_active_reaction\n} from './runtime.js';\nimport {\n\tarray_prototype,\n\tget_descriptor,\n\tget_prototype_of,\n\tis_array,\n\tobject_prototype\n} from '../shared/utils.js';\nimport {\n\tstate as source,\n\tset,\n\tincrement,\n\tflush_eager_effects,\n\tset_eager_effects_deferred\n} from './reactivity/sources.js';\nimport { PROXY_PATH_SYMBOL, STATE_SYMBOL } from '#client/constants';\nimport { UNINITIALIZED } from '../../constants.js';\nimport * as e from './errors.js';\nimport { tag } from './dev/tracing.js';\nimport { get_error } from '../shared/dev.js';\nimport { tracing_mode_flag } from '../flags/index.js';\n\n// TODO move all regexes into shared module?\nconst regex_is_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n/**\n * @template T\n * @param {T} value\n * @returns {T}\n */\nexport function proxy(value) {\n\t// if non-proxyable, or is already a proxy, return `value`\n\tif (typeof value !== 'object' || value === null || STATE_SYMBOL in value) {\n\t\treturn value;\n\t}\n\n\tconst prototype = get_prototype_of(value);\n\n\tif (prototype !== object_prototype && prototype !== array_prototype) {\n\t\treturn value;\n\t}\n\n\t/** @type {Map>} */\n\tvar sources = new Map();\n\tvar is_proxied_array = is_array(value);\n\tvar version = source(0);\n\n\tvar stack = DEV && tracing_mode_flag ? get_error('created at') : null;\n\tvar parent_version = update_version;\n\n\t/**\n\t * Executes the proxy in the context of the reaction it was originally created in, if any\n\t * @template T\n\t * @param {() => T} fn\n\t */\n\tvar with_parent = (fn) => {\n\t\tif (update_version === parent_version) {\n\t\t\treturn fn();\n\t\t}\n\n\t\t// child source is being created after the initial proxy —\n\t\t// prevent it from being associated with the current reaction\n\t\tvar reaction = active_reaction;\n\t\tvar version = update_version;\n\n\t\tset_active_reaction(null);\n\t\tset_update_version(parent_version);\n\n\t\tvar result = fn();\n\n\t\tset_active_reaction(reaction);\n\t\tset_update_version(version);\n\n\t\treturn result;\n\t};\n\n\tif (is_proxied_array) {\n\t\t// We need to create the length source eagerly to ensure that\n\t\t// mutations to the array are properly synced with our proxy\n\t\tsources.set('length', source(/** @type {any[]} */ (value).length, stack));\n\t\tif (DEV) {\n\t\t\tvalue = /** @type {any} */ (inspectable_array(/** @type {any[]} */ (value)));\n\t\t}\n\t}\n\n\t/** Used in dev for $inspect.trace() */\n\tvar path = '';\n\tlet updating = false;\n\t/** @param {string} new_path */\n\tfunction update_path(new_path) {\n\t\tif (updating) return;\n\t\tupdating = true;\n\t\tpath = new_path;\n\n\t\ttag(version, `${path} version`);\n\n\t\t// rename all child sources and child proxies\n\t\tfor (const [prop, source] of sources) {\n\t\t\ttag(source, get_label(path, prop));\n\t\t}\n\t\tupdating = false;\n\t}\n\n\treturn new Proxy(/** @type {any} */ (value), {\n\t\tdefineProperty(_, prop, descriptor) {\n\t\t\tif (\n\t\t\t\t!('value' in descriptor) ||\n\t\t\t\tdescriptor.configurable === false ||\n\t\t\t\tdescriptor.enumerable === false ||\n\t\t\t\tdescriptor.writable === false\n\t\t\t) {\n\t\t\t\t// we disallow non-basic descriptors, because unless they are applied to the\n\t\t\t\t// target object — which we avoid, so that state can be forked — we will run\n\t\t\t\t// afoul of the various invariants\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor#invariants\n\t\t\t\te.state_descriptors_fixed();\n\t\t\t}\n\t\t\tvar s = sources.get(prop);\n\t\t\tif (s === undefined) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar s = source(descriptor.value, stack);\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tif (DEV && typeof prop === 'string') {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tset(s, descriptor.value, true);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tdeleteProperty(target, prop) {\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s === undefined) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tincrement(version);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tset(s, UNINITIALIZED);\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tget(target, prop, receiver) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif (DEV && prop === PROXY_PATH_SYMBOL) {\n\t\t\t\treturn update_path;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar exists = prop in target;\n\n\t\t\t// create a source, but only if it's an own property and not a prototype property\n\t\t\tif (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar p = proxy(exists ? target[prop] : UNINITIALIZED);\n\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\n\t\t\t\tsources.set(prop, s);\n\t\t\t}\n\n\t\t\tif (s !== undefined) {\n\t\t\t\tvar v = get(s);\n\t\t\t\treturn v === UNINITIALIZED ? undefined : v;\n\t\t\t}\n\n\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t},\n\n\t\tgetOwnPropertyDescriptor(target, prop) {\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\tif (descriptor && 'value' in descriptor) {\n\t\t\t\tvar s = sources.get(prop);\n\t\t\t\tif (s) descriptor.value = get(s);\n\t\t\t} else if (descriptor === undefined) {\n\t\t\t\tvar source = sources.get(prop);\n\t\t\t\tvar value = source?.v;\n\n\t\t\t\tif (source !== undefined && value !== UNINITIALIZED) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\twritable: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn descriptor;\n\t\t},\n\n\t\thas(target, prop) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = (s !== undefined && s.v !== UNINITIALIZED) || Reflect.has(target, prop);\n\n\t\t\tif (\n\t\t\t\ts !== undefined ||\n\t\t\t\t(active_effect !== null && (!has || get_descriptor(target, prop)?.writable))\n\t\t\t) {\n\t\t\t\tif (s === undefined) {\n\t\t\t\t\ts = with_parent(() => {\n\t\t\t\t\t\tvar p = has ? proxy(target[prop]) : UNINITIALIZED;\n\t\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn s;\n\t\t\t\t\t});\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\n\t\t\t\tvar value = get(s);\n\t\t\t\tif (value === UNINITIALIZED) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn has;\n\t\t},\n\n\t\tset(target, prop, value, receiver) {\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = prop in target;\n\n\t\t\t// variable.length = value -> clear all signals with index >= value\n\t\t\tif (is_proxied_array && prop === 'length') {\n\t\t\t\tfor (var i = value; i < /** @type {Source} */ (s).v; i += 1) {\n\t\t\t\t\tvar other_s = sources.get(i + '');\n\t\t\t\t\tif (other_s !== undefined) {\n\t\t\t\t\t\tset(other_s, UNINITIALIZED);\n\t\t\t\t\t} else if (i in target) {\n\t\t\t\t\t\t// If the item exists in the original, we need to create an uninitialized source,\n\t\t\t\t\t\t// else a later read of the property would result in a source being created with\n\t\t\t\t\t\t// the value of the original item at that index.\n\t\t\t\t\t\tother_s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\t\tsources.set(i + '', other_s);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(other_s, get_label(path, i));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we haven't yet created a source for this property, we need to ensure\n\t\t\t// we do so otherwise if we read it later, then the write won't be tracked and\n\t\t\t// the heuristics of effects will be different vs if we had read the proxied\n\t\t\t// object property before writing to that property.\n\t\t\tif (s === undefined) {\n\t\t\t\tif (!has || get_descriptor(target, prop)?.writable) {\n\t\t\t\t\ts = with_parent(() => source(undefined, stack));\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\tset(s, proxy(value));\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thas = s.v !== UNINITIALIZED;\n\n\t\t\t\tvar p = with_parent(() => proxy(value));\n\t\t\t\tset(s, p);\n\t\t\t}\n\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\t// Set the new value before updating any signals so that any listeners get the new value\n\t\t\tif (descriptor?.set) {\n\t\t\t\tdescriptor.set.call(receiver, value);\n\t\t\t}\n\n\t\t\tif (!has) {\n\t\t\t\t// If we have mutated an array directly, we might need to\n\t\t\t\t// signal that length has also changed. Do it before updating metadata\n\t\t\t\t// to ensure that iterating over the array as a result of a metadata update\n\t\t\t\t// will not cause the length to be out of sync.\n\t\t\t\tif (is_proxied_array && typeof prop === 'string') {\n\t\t\t\t\tvar ls = /** @type {Source} */ (sources.get('length'));\n\t\t\t\t\tvar n = Number(prop);\n\n\t\t\t\t\tif (Number.isInteger(n) && n >= ls.v) {\n\t\t\t\t\t\tset(ls, n + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\townKeys(target) {\n\t\t\tget(version);\n\n\t\t\tvar own_keys = Reflect.ownKeys(target).filter((key) => {\n\t\t\t\tvar source = sources.get(key);\n\t\t\t\treturn source === undefined || source.v !== UNINITIALIZED;\n\t\t\t});\n\n\t\t\tfor (var [key, source] of sources) {\n\t\t\t\tif (source.v !== UNINITIALIZED && !(key in target)) {\n\t\t\t\t\town_keys.push(key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn own_keys;\n\t\t},\n\n\t\tsetPrototypeOf() {\n\t\t\te.state_prototype_fixed();\n\t\t}\n\t});\n}\n\n/**\n * @param {string} path\n * @param {string | symbol} prop\n */\nfunction get_label(path, prop) {\n\tif (typeof prop === 'symbol') return `${path}[Symbol(${prop.description ?? ''})]`;\n\tif (regex_is_valid_identifier.test(prop)) return `${path}.${prop}`;\n\treturn /^\\d+$/.test(prop) ? `${path}[${prop}]` : `${path}['${prop}']`;\n}\n\n/**\n * @param {any} value\n */\nexport function get_proxied_value(value) {\n\ttry {\n\t\tif (value !== null && typeof value === 'object' && STATE_SYMBOL in value) {\n\t\t\treturn value[STATE_SYMBOL];\n\t\t}\n\t} catch {\n\t\t// the above if check can throw an error if the value in question\n\t\t// is the contentWindow of an iframe on another domain, in which\n\t\t// case we want to just return the value (because it's definitely\n\t\t// not a proxied value) so we don't break any JavaScript interacting\n\t\t// with that iframe (such as various payment companies client side\n\t\t// JavaScript libraries interacting with their iframes on the same\n\t\t// domain)\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {any} a\n * @param {any} b\n */\nexport function is(a, b) {\n\treturn Object.is(get_proxied_value(a), get_proxied_value(b));\n}\n\nconst ARRAY_MUTATING_METHODS = new Set([\n\t'copyWithin',\n\t'fill',\n\t'pop',\n\t'push',\n\t'reverse',\n\t'shift',\n\t'sort',\n\t'splice',\n\t'unshift'\n]);\n\n/**\n * Wrap array mutating methods so $inspect is triggered only once and\n * to prevent logging an array in intermediate state (e.g. with an empty slot)\n * @param {any[]} array\n */\nfunction inspectable_array(array) {\n\treturn new Proxy(array, {\n\t\tget(target, prop, receiver) {\n\t\t\tvar value = Reflect.get(target, prop, receiver);\n\t\t\tif (!ARRAY_MUTATING_METHODS.has(/** @type {string} */ (prop))) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @this {any[]}\n\t\t\t * @param {any[]} args\n\t\t\t */\n\t\t\treturn function (...args) {\n\t\t\t\tset_eager_effects_deferred();\n\t\t\t\tvar result = value.apply(this, args);\n\t\t\t\tflush_eager_effects();\n\t\t\t\treturn result;\n\t\t\t};\n\t\t}\n\t});\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport { DEV } from 'esm-env';\nimport { init_array_prototype_warnings } from '../dev/equality.js';\nimport { get_descriptor, is_extensible } from '../../shared/utils.js';\nimport { active_effect } from '../runtime.js';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { TEXT_NODE, EFFECT_RAN } from '#client/constants';\nimport { eager_block_effects } from '../reactivity/batch.js';\n\n// export these for reference in the compiled code, making global name deduplication unnecessary\n/** @type {Window} */\nexport var $window;\n\n/** @type {Document} */\nexport var $document;\n\n/** @type {boolean} */\nexport var is_firefox;\n\n/** @type {() => Node | null} */\nvar first_child_getter;\n/** @type {() => Node | null} */\nvar next_sibling_getter;\n\n/**\n * Initialize these lazily to avoid issues when using the runtime in a server context\n * where these globals are not available while avoiding a separate server entry point\n */\nexport function init_operations() {\n\tif ($window !== undefined) {\n\t\treturn;\n\t}\n\n\t$window = window;\n\t$document = document;\n\tis_firefox = /Firefox/.test(navigator.userAgent);\n\n\tvar element_prototype = Element.prototype;\n\tvar node_prototype = Node.prototype;\n\tvar text_prototype = Text.prototype;\n\n\t// @ts-ignore\n\tfirst_child_getter = get_descriptor(node_prototype, 'firstChild').get;\n\t// @ts-ignore\n\tnext_sibling_getter = get_descriptor(node_prototype, 'nextSibling').get;\n\n\tif (is_extensible(element_prototype)) {\n\t\t// the following assignments improve perf of lookups on DOM nodes\n\t\t// @ts-expect-error\n\t\telement_prototype.__click = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__className = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__attributes = null;\n\t\t// @ts-expect-error\n\t\telement_prototype.__style = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__e = undefined;\n\t}\n\n\tif (is_extensible(text_prototype)) {\n\t\t// @ts-expect-error\n\t\ttext_prototype.__t = undefined;\n\t}\n\n\tif (DEV) {\n\t\t// @ts-expect-error\n\t\telement_prototype.__svelte_meta = null;\n\n\t\tinit_array_prototype_warnings();\n\t}\n}\n\n/**\n * @param {string} value\n * @returns {Text}\n */\nexport function create_text(value = '') {\n\treturn document.createTextNode(value);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_first_child(node) {\n\treturn first_child_getter.call(node);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_next_sibling(node) {\n\treturn next_sibling_getter.call(node);\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @template {Node} N\n * @param {N} node\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function child(node, is_text) {\n\tif (!hydrating) {\n\t\treturn get_first_child(node);\n\t}\n\n\tvar child = /** @type {TemplateNode} */ (get_first_child(hydrate_node));\n\n\t// Child can be null if we have an element with a single child, like `

{text}

`, where `text` is empty\n\tif (child === null) {\n\t\tchild = hydrate_node.appendChild(create_text());\n\t} else if (is_text && child.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\tchild?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(child);\n\treturn child;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {DocumentFragment | TemplateNode | TemplateNode[]} fragment\n * @param {boolean} [is_text]\n * @returns {Node | null}\n */\nexport function first_child(fragment, is_text = false) {\n\tif (!hydrating) {\n\t\t// when not hydrating, `fragment` is a `DocumentFragment` (the result of calling `open_frag`)\n\t\tvar first = /** @type {DocumentFragment} */ (get_first_child(/** @type {Node} */ (fragment)));\n\n\t\t// TODO prevent user comments with the empty string when preserveComments is true\n\t\tif (first instanceof Comment && first.data === '') return get_next_sibling(first);\n\n\t\treturn first;\n\t}\n\n\t// if an {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && hydrate_node?.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\n\t\thydrate_node?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\treturn hydrate_node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {TemplateNode} node\n * @param {number} count\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function sibling(node, count = 1, is_text = false) {\n\tlet next_sibling = hydrating ? hydrate_node : node;\n\tvar last_sibling;\n\n\twhile (count--) {\n\t\tlast_sibling = next_sibling;\n\t\tnext_sibling = /** @type {TemplateNode} */ (get_next_sibling(next_sibling));\n\t}\n\n\tif (!hydrating) {\n\t\treturn next_sibling;\n\t}\n\n\t// if a sibling {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && next_sibling?.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\t// If the next sibling is `null` and we're handling text then it's because\n\t\t// the SSR content was empty for the text, so we need to generate a new text\n\t\t// node and insert it after the last sibling\n\t\tif (next_sibling === null) {\n\t\t\tlast_sibling?.after(text);\n\t\t} else {\n\t\t\tnext_sibling.before(text);\n\t\t}\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(next_sibling);\n\treturn /** @type {TemplateNode} */ (next_sibling);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {void}\n */\nexport function clear_text_content(node) {\n\tnode.textContent = '';\n}\n\n/**\n * Returns `true` if we're updating the current block, for example `condition` in\n * an `{#if condition}` block just changed. In this case, the branch should be\n * appended (or removed) at the same time as other updates within the\n * current ``\n */\nexport function should_defer_append() {\n\tif (!async_mode_flag) return false;\n\tif (eager_block_effects !== null) return false;\n\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\treturn (flags & EFFECT_RAN) !== 0;\n}\n\n/**\n *\n * @param {string} tag\n * @param {string} [namespace]\n * @param {string} [is]\n * @returns\n */\nexport function create_element(tag, namespace, is) {\n\tlet options = is ? { is } : undefined;\n\tif (namespace) {\n\t\treturn document.createElementNS(namespace, tag, options);\n\t}\n\treturn document.createElement(tag, options);\n}\n\nexport function create_fragment() {\n\treturn document.createDocumentFragment();\n}\n\n/**\n * @param {string} data\n * @returns\n */\nexport function create_comment(data = '') {\n\treturn document.createComment(data);\n}\n\n/**\n * @param {Element} element\n * @param {string} key\n * @param {string} value\n * @returns\n */\nexport function set_attribute(element, key, value = '') {\n\tif (key.startsWith('xlink:')) {\n\t\telement.setAttributeNS('http://www.w3.org/1999/xlink', key, value);\n\t\treturn;\n\t}\n\treturn element.setAttribute(key, value);\n}\n","import { hydrating } from '../hydration.js';\nimport { clear_text_content, get_first_child } from '../operations.js';\nimport { queue_micro_task } from '../task.js';\n\n/**\n * @param {HTMLElement} dom\n * @param {boolean} value\n * @returns {void}\n */\nexport function autofocus(dom, value) {\n\tif (value) {\n\t\tconst body = document.body;\n\t\tdom.autofocus = true;\n\n\t\tqueue_micro_task(() => {\n\t\t\tif (document.activeElement === body) {\n\t\t\t\tdom.focus();\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * The child of a textarea actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLTextAreaElement} dom\n * @returns {void}\n */\nexport function remove_textarea_child(dom) {\n\tif (hydrating && get_first_child(dom) !== null) {\n\t\tclear_text_content(dom);\n\t}\n}\n\nlet listening_to_form_reset = false;\n\nexport function add_form_reset_listener() {\n\tif (!listening_to_form_reset) {\n\t\tlistening_to_form_reset = true;\n\t\tdocument.addEventListener(\n\t\t\t'reset',\n\t\t\t(evt) => {\n\t\t\t\t// Needs to happen one tick later or else the dom properties of the form\n\t\t\t\t// elements have not updated to their reset values yet\n\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\tif (!evt.defaultPrevented) {\n\t\t\t\t\t\tfor (const e of /**@type {HTMLFormElement} */ (evt.target).elements) {\n\t\t\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t\t\te.__on_r?.();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t// In the capture phase to guarantee we get noticed of it (no possibility of stopPropagation)\n\t\t\t{ capture: true }\n\t\t);\n\t}\n}\n","import { teardown } from '../../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../../runtime.js';\nimport { add_form_reset_listener } from '../misc.js';\n\n/**\n * Fires the handler once immediately (unless corresponding arg is set to `false`),\n * then listens to the given events until the render effect context is destroyed\n * @param {EventTarget} target\n * @param {Array} events\n * @param {(event?: Event) => void} handler\n * @param {any} call_handler_immediately\n */\nexport function listen(target, events, handler, call_handler_immediately = true) {\n\tif (call_handler_immediately) {\n\t\thandler();\n\t}\n\n\tfor (var name of events) {\n\t\ttarget.addEventListener(name, handler);\n\t}\n\n\tteardown(() => {\n\t\tfor (var name of events) {\n\t\t\ttarget.removeEventListener(name, handler);\n\t\t}\n\t});\n}\n\n/**\n * @template T\n * @param {() => T} fn\n */\nexport function without_reactive_context(fn) {\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * Listen to the given event, and then instantiate a global form reset listener if not already done,\n * to notify all bindings when the form is reset\n * @param {HTMLElement} element\n * @param {string} event\n * @param {(is_reset?: true) => void} handler\n * @param {(is_reset?: true) => void} [on_reset]\n */\nexport function listen_to_event_and_reset_event(element, event, handler, on_reset = handler) {\n\telement.addEventListener(event, () => without_reactive_context(handler));\n\t// @ts-expect-error\n\tconst prev = element.__on_r;\n\tif (prev) {\n\t\t// special case for checkbox that can have multiple binds (group & checked)\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => {\n\t\t\tprev();\n\t\t\ton_reset(true);\n\t\t};\n\t} else {\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => on_reset(true);\n\t}\n\n\tadd_form_reset_listener();\n}\n","/** @import { ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */\nimport {\n\tis_dirty,\n\tactive_effect,\n\tactive_reaction,\n\tupdate_effect,\n\tget,\n\tis_destroying_effect,\n\tremove_reactions,\n\tset_active_reaction,\n\tset_is_destroying_effect,\n\tset_signal_status,\n\tuntrack,\n\tuntracking\n} from '../runtime.js';\nimport {\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tRENDER_EFFECT,\n\tEFFECT,\n\tDESTROYED,\n\tINERT,\n\tEFFECT_RAN,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tEFFECT_TRANSPARENT,\n\tDERIVED,\n\tCLEAN,\n\tEAGER_EFFECT,\n\tHEAD_EFFECT,\n\tMAYBE_DIRTY,\n\tEFFECT_PRESERVED,\n\tSTALE_REACTION,\n\tUSER_EFFECT,\n\tASYNC,\n\tCONNECTED,\n\tMANAGED_EFFECT\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { DEV } from 'esm-env';\nimport { define_property } from '../../shared/utils.js';\nimport { get_next_sibling } from '../dom/operations.js';\nimport { component_context, dev_current_component_function, dev_stack } from '../context.js';\nimport { Batch, current_batch, schedule_effect } from './batch.js';\nimport { flatten } from './async.js';\nimport { without_reactive_context } from '../dom/elements/bindings/shared.js';\n\n/**\n * @param {'$effect' | '$effect.pre' | '$inspect'} rune\n */\nexport function validate_effect(rune) {\n\tif (active_effect === null) {\n\t\tif (active_reaction === null) {\n\t\t\te.effect_orphan(rune);\n\t\t}\n\n\t\te.effect_in_unowned_derived();\n\t}\n\n\tif (is_destroying_effect) {\n\t\te.effect_in_teardown(rune);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {Effect} parent_effect\n */\nfunction push_effect(effect, parent_effect) {\n\tvar parent_last = parent_effect.last;\n\tif (parent_last === null) {\n\t\tparent_effect.last = parent_effect.first = effect;\n\t} else {\n\t\tparent_last.next = effect;\n\t\teffect.prev = parent_last;\n\t\tparent_effect.last = effect;\n\t}\n}\n\n/**\n * @param {number} type\n * @param {null | (() => void | (() => void))} fn\n * @param {boolean} sync\n * @returns {Effect}\n */\nfunction create_effect(type, fn, sync) {\n\tvar parent = active_effect;\n\n\tif (DEV) {\n\t\t// Ensure the parent is never an inspect effect\n\t\twhile (parent !== null && (parent.f & EAGER_EFFECT) !== 0) {\n\t\t\tparent = parent.parent;\n\t\t}\n\t}\n\n\tif (parent !== null && (parent.f & INERT) !== 0) {\n\t\ttype |= INERT;\n\t}\n\n\t/** @type {Effect} */\n\tvar effect = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\tnodes_start: null,\n\t\tnodes_end: null,\n\t\tf: type | DIRTY | CONNECTED,\n\t\tfirst: null,\n\t\tfn,\n\t\tlast: null,\n\t\tnext: null,\n\t\tparent,\n\t\tb: parent && parent.b,\n\t\tprev: null,\n\t\tteardown: null,\n\t\ttransitions: null,\n\t\twv: 0,\n\t\tac: null\n\t};\n\n\tif (DEV) {\n\t\teffect.component_function = dev_current_component_function;\n\t}\n\n\tif (sync) {\n\t\ttry {\n\t\t\tupdate_effect(effect);\n\t\t\teffect.f |= EFFECT_RAN;\n\t\t} catch (e) {\n\t\t\tdestroy_effect(effect);\n\t\t\tthrow e;\n\t\t}\n\t} else if (fn !== null) {\n\t\tschedule_effect(effect);\n\t}\n\n\t/** @type {Effect | null} */\n\tvar e = effect;\n\n\t// if an effect has already ran and doesn't need to be kept in the tree\n\t// (because it won't re-run, has no DOM, and has no teardown etc)\n\t// then we skip it and go to its child (if any)\n\tif (\n\t\tsync &&\n\t\te.deps === null &&\n\t\te.teardown === null &&\n\t\te.nodes_start === null &&\n\t\te.first === e.last && // either `null`, or a singular child\n\t\t(e.f & EFFECT_PRESERVED) === 0\n\t) {\n\t\te = e.first;\n\t\tif ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {\n\t\t\te.f |= EFFECT_TRANSPARENT;\n\t\t}\n\t}\n\n\tif (e !== null) {\n\t\te.parent = parent;\n\n\t\tif (parent !== null) {\n\t\t\tpush_effect(e, parent);\n\t\t}\n\n\t\t// if we're in a derived, add the effect there too\n\t\tif (\n\t\t\tactive_reaction !== null &&\n\t\t\t(active_reaction.f & DERIVED) !== 0 &&\n\t\t\t(type & ROOT_EFFECT) === 0\n\t\t) {\n\t\t\tvar derived = /** @type {Derived} */ (active_reaction);\n\t\t\t(derived.effects ??= []).push(e);\n\t\t}\n\t}\n\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect.tracking()`\n * @returns {boolean}\n */\nexport function effect_tracking() {\n\treturn active_reaction !== null && !untracking;\n}\n\n/**\n * @param {() => void} fn\n */\nexport function teardown(fn) {\n\tconst effect = create_effect(RENDER_EFFECT, null, false);\n\tset_signal_status(effect, CLEAN);\n\teffect.teardown = fn;\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect(...)`\n * @param {() => void | (() => void)} fn\n */\nexport function user_effect(fn) {\n\tvalidate_effect('$effect');\n\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect'\n\t\t});\n\t}\n\n\t// Non-nested `$effect(...)` in a component should be deferred\n\t// until the component is mounted\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\tvar defer = !active_reaction && (flags & BRANCH_EFFECT) !== 0 && (flags & EFFECT_RAN) === 0;\n\n\tif (defer) {\n\t\t// Top-level `$effect(...)` in an unmounted component — defer until mount\n\t\tvar context = /** @type {ComponentContext} */ (component_context);\n\t\t(context.e ??= []).push(fn);\n\t} else {\n\t\t// Everything else — create immediately\n\t\treturn create_user_effect(fn);\n\t}\n}\n\n/**\n * @param {() => void | (() => void)} fn\n */\nexport function create_user_effect(fn) {\n\treturn create_effect(EFFECT | USER_EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$effect.pre(...)`\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function user_pre_effect(fn) {\n\tvalidate_effect('$effect.pre');\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect.pre'\n\t\t});\n\t}\n\treturn create_effect(RENDER_EFFECT | USER_EFFECT, fn, true);\n}\n\n/** @param {() => void | (() => void)} fn */\nexport function eager_effect(fn) {\n\treturn create_effect(EAGER_EFFECT, fn, true);\n}\n\n/**\n * Internal representation of `$effect.root(...)`\n * @param {() => void | (() => void)} fn\n * @returns {() => void}\n */\nexport function effect_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true);\n\n\treturn () => {\n\t\tdestroy_effect(effect);\n\t};\n}\n\n/**\n * An effect root whose children can transition out\n * @param {() => void} fn\n * @returns {(options?: { outro?: boolean }) => Promise}\n */\nexport function component_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true);\n\n\treturn (options = {}) => {\n\t\treturn new Promise((fulfil) => {\n\t\t\tif (options.outro) {\n\t\t\t\tpause_effect(effect, () => {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t\tfulfil(undefined);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tdestroy_effect(effect);\n\t\t\t\tfulfil(undefined);\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function effect(fn) {\n\treturn create_effect(EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$: ..`\n * @param {() => any} deps\n * @param {() => void | (() => void)} fn\n */\nexport function legacy_pre_effect(deps, fn) {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\t/** @type {{ effect: null | Effect, ran: boolean, deps: () => any }} */\n\tvar token = { effect: null, ran: false, deps };\n\n\tcontext.l.$.push(token);\n\n\ttoken.effect = render_effect(() => {\n\t\tdeps();\n\n\t\t// If this legacy pre effect has already run before the end of the reset, then\n\t\t// bail out to emulate the same behavior.\n\t\tif (token.ran) return;\n\n\t\ttoken.ran = true;\n\t\tuntrack(fn);\n\t});\n}\n\nexport function legacy_pre_effect_reset() {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\trender_effect(() => {\n\t\t// Run dirty `$:` statements\n\t\tfor (var token of context.l.$) {\n\t\t\ttoken.deps();\n\n\t\t\tvar effect = token.effect;\n\n\t\t\t// If the effect is CLEAN, then make it MAYBE_DIRTY. This ensures we traverse through\n\t\t\t// the effects dependencies and correctly ensure each dependency is up-to-date.\n\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t}\n\n\t\t\tif (is_dirty(effect)) {\n\t\t\t\tupdate_effect(effect);\n\t\t\t}\n\n\t\t\ttoken.ran = false;\n\t\t}\n\t});\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function async_effect(fn) {\n\treturn create_effect(ASYNC | EFFECT_PRESERVED, fn, true);\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function render_effect(fn, flags = 0) {\n\treturn create_effect(RENDER_EFFECT | flags, fn, true);\n}\n\n/**\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise>} async\n * @param {Array>} blockers\n */\nexport function template_effect(fn, sync = [], async = [], blockers = []) {\n\tflatten(blockers, sync, async, (values) => {\n\t\tcreate_effect(RENDER_EFFECT, () => fn(...values.map(get)), true);\n\t});\n}\n\n/**\n * Like `template_effect`, but with an effect which is deferred until the batch commits\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise>} async\n * @param {Array>} blockers\n */\nexport function deferred_template_effect(fn, sync = [], async = [], blockers = []) {\n\tvar batch = /** @type {Batch} */ (current_batch);\n\tvar is_async = async.length > 0 || blockers.length > 0;\n\n\tif (is_async) batch.increment(true);\n\n\tflatten(blockers, sync, async, (values) => {\n\t\tcreate_effect(EFFECT, () => fn(...values.map(get)), false);\n\t\tif (is_async) batch.decrement(true);\n\t});\n}\n\n/**\n * @param {(() => void)} fn\n * @param {number} flags\n */\nexport function block(fn, flags = 0) {\n\tvar effect = create_effect(BLOCK_EFFECT | flags, fn, true);\n\tif (DEV) {\n\t\teffect.dev_stack = dev_stack;\n\t}\n\treturn effect;\n}\n\n/**\n * @param {(() => void)} fn\n * @param {number} flags\n */\nexport function managed(fn, flags = 0) {\n\tvar effect = create_effect(MANAGED_EFFECT | flags, fn, true);\n\tif (DEV) {\n\t\teffect.dev_stack = dev_stack;\n\t}\n\treturn effect;\n}\n\n/**\n * @param {(() => void)} fn\n */\nexport function branch(fn) {\n\treturn create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn, true);\n}\n\n/**\n * @param {Effect} effect\n */\nexport function execute_effect_teardown(effect) {\n\tvar teardown = effect.teardown;\n\tif (teardown !== null) {\n\t\tconst previously_destroying_effect = is_destroying_effect;\n\t\tconst previous_reaction = active_reaction;\n\t\tset_is_destroying_effect(true);\n\t\tset_active_reaction(null);\n\t\ttry {\n\t\t\tteardown.call(null);\n\t\t} finally {\n\t\t\tset_is_destroying_effect(previously_destroying_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @param {boolean} remove_dom\n * @returns {void}\n */\nexport function destroy_effect_children(signal, remove_dom = false) {\n\tvar effect = signal.first;\n\tsignal.first = signal.last = null;\n\n\twhile (effect !== null) {\n\t\tconst controller = effect.ac;\n\n\t\tif (controller !== null) {\n\t\t\twithout_reactive_context(() => {\n\t\t\t\tcontroller.abort(STALE_REACTION);\n\t\t\t});\n\t\t}\n\n\t\tvar next = effect.next;\n\n\t\tif ((effect.f & ROOT_EFFECT) !== 0) {\n\t\t\t// this is now an independent root\n\t\t\teffect.parent = null;\n\t\t} else {\n\t\t\tdestroy_effect(effect, remove_dom);\n\t\t}\n\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function destroy_block_effect_children(signal) {\n\tvar effect = signal.first;\n\n\twhile (effect !== null) {\n\t\tvar next = effect.next;\n\t\tif ((effect.f & BRANCH_EFFECT) === 0) {\n\t\t\tdestroy_effect(effect);\n\t\t}\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} [remove_dom]\n * @returns {void}\n */\nexport function destroy_effect(effect, remove_dom = true) {\n\tvar removed = false;\n\n\tif (\n\t\t(remove_dom || (effect.f & HEAD_EFFECT) !== 0) &&\n\t\teffect.nodes_start !== null &&\n\t\teffect.nodes_end !== null\n\t) {\n\t\tremove_effect_dom(effect.nodes_start, /** @type {TemplateNode} */ (effect.nodes_end));\n\t\tremoved = true;\n\t}\n\n\tdestroy_effect_children(effect, remove_dom && !removed);\n\tremove_reactions(effect, 0);\n\tset_signal_status(effect, DESTROYED);\n\n\tvar transitions = effect.transitions;\n\n\tif (transitions !== null) {\n\t\tfor (const transition of transitions) {\n\t\t\ttransition.stop();\n\t\t}\n\t}\n\n\texecute_effect_teardown(effect);\n\n\tvar parent = effect.parent;\n\n\t// If the parent doesn't have any children, then skip this work altogether\n\tif (parent !== null && parent.first !== null) {\n\t\tunlink_effect(effect);\n\t}\n\n\tif (DEV) {\n\t\teffect.component_function = null;\n\t}\n\n\t// `first` and `child` are nulled out in destroy_effect_children\n\t// we don't null out `parent` so that error propagation can work correctly\n\teffect.next =\n\t\teffect.prev =\n\t\teffect.teardown =\n\t\teffect.ctx =\n\t\teffect.deps =\n\t\teffect.fn =\n\t\teffect.nodes_start =\n\t\teffect.nodes_end =\n\t\teffect.ac =\n\t\t\tnull;\n}\n\n/**\n *\n * @param {TemplateNode | null} node\n * @param {TemplateNode} end\n */\nexport function remove_effect_dom(node, end) {\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n * Detach an effect from the effect tree, freeing up memory and\n * reducing the amount of work that happens on subsequent traversals\n * @param {Effect} effect\n */\nexport function unlink_effect(effect) {\n\tvar parent = effect.parent;\n\tvar prev = effect.prev;\n\tvar next = effect.next;\n\n\tif (prev !== null) prev.next = next;\n\tif (next !== null) next.prev = prev;\n\n\tif (parent !== null) {\n\t\tif (parent.first === effect) parent.first = next;\n\t\tif (parent.last === effect) parent.last = prev;\n\t}\n}\n\n/**\n * When a block effect is removed, we don't immediately destroy it or yank it\n * out of the DOM, because it might have transitions. Instead, we 'pause' it.\n * It stays around (in memory, and in the DOM) until outro transitions have\n * completed, and if the state change is reversed then we _resume_ it.\n * A paused effect does not update, and the DOM subtree becomes inert.\n * @param {Effect} effect\n * @param {() => void} [callback]\n * @param {boolean} [destroy]\n */\nexport function pause_effect(effect, callback, destroy = true) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\n\tpause_children(effect, transitions, true);\n\n\trun_out_transitions(transitions, () => {\n\t\tif (destroy) destroy_effect(effect);\n\t\tif (callback) callback();\n\t});\n}\n\n/**\n * @param {TransitionManager[]} transitions\n * @param {() => void} fn\n */\nexport function run_out_transitions(transitions, fn) {\n\tvar remaining = transitions.length;\n\tif (remaining > 0) {\n\t\tvar check = () => --remaining || fn();\n\t\tfor (var transition of transitions) {\n\t\t\ttransition.out(check);\n\t\t}\n\t} else {\n\t\tfn();\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {TransitionManager[]} transitions\n * @param {boolean} local\n */\nexport function pause_children(effect, transitions, local) {\n\tif ((effect.f & INERT) !== 0) return;\n\teffect.f ^= INERT;\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransitions.push(transition);\n\t\t\t}\n\t\t}\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent =\n\t\t\t(child.f & EFFECT_TRANSPARENT) !== 0 ||\n\t\t\t// If this is a branch effect without a block effect parent,\n\t\t\t// it means the parent block effect was pruned. In that case,\n\t\t\t// transparency information was transferred to the branch effect.\n\t\t\t((child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0);\n\t\t// TODO we don't need to call pause_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tpause_children(child, transitions, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n}\n\n/**\n * The opposite of `pause_effect`. We call this if (for example)\n * `x` becomes falsy then truthy: `{#if x}...{/if}`\n * @param {Effect} effect\n */\nexport function resume_effect(effect) {\n\tresume_children(effect, true);\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} local\n */\nfunction resume_children(effect, local) {\n\tif ((effect.f & INERT) === 0) return;\n\teffect.f ^= INERT;\n\n\t// If a dependency of this effect changed while it was paused,\n\t// schedule the effect to update. we don't use `is_dirty`\n\t// here because we don't want to eagerly recompute a derived like\n\t// `{#if foo}{foo.bar()}{/if}` if `foo` is now `undefined\n\tif ((effect.f & CLEAN) === 0) {\n\t\tset_signal_status(effect, DIRTY);\n\t\tschedule_effect(effect);\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call resume_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tresume_children(child, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransition.in();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function aborted(effect = /** @type {Effect} */ (active_effect)) {\n\treturn (effect.f & DESTROYED) !== 0;\n}\n\n/**\n * @param {Effect} effect\n * @param {DocumentFragment} fragment\n */\nexport function move_effect(effect, fragment) {\n\tvar node = effect.nodes_start;\n\tvar end = effect.nodes_end;\n\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\tfragment.append(node);\n\t\tnode = next;\n\t}\n}\n","/** @import { Derived, Effect, Reaction, Signal, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport { get_descriptors, get_prototype_of, index_of } from '../shared/utils.js';\nimport {\n\tdestroy_block_effect_children,\n\tdestroy_effect_children,\n\teffect_tracking,\n\texecute_effect_teardown\n} from './reactivity/effects.js';\nimport {\n\tDIRTY,\n\tMAYBE_DIRTY,\n\tCLEAN,\n\tDERIVED,\n\tDESTROYED,\n\tBRANCH_EFFECT,\n\tSTATE_SYMBOL,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tCONNECTED,\n\tREACTION_IS_UPDATING,\n\tSTALE_REACTION,\n\tERROR_VALUE,\n\tWAS_MARKED,\n\tMANAGED_EFFECT\n} from './constants.js';\nimport { old_values } from './reactivity/sources.js';\nimport {\n\tdestroy_derived_effects,\n\texecute_derived,\n\tcurrent_async_effect,\n\trecent_async_deriveds,\n\tupdate_derived\n} from './reactivity/deriveds.js';\nimport { async_mode_flag, tracing_mode_flag } from '../flags/index.js';\nimport { tracing_expressions } from './dev/tracing.js';\nimport { get_error } from '../shared/dev.js';\nimport {\n\tcomponent_context,\n\tdev_current_component_function,\n\tdev_stack,\n\tis_runes,\n\tset_component_context,\n\tset_dev_current_component_function,\n\tset_dev_stack\n} from './context.js';\nimport * as w from './warnings.js';\nimport {\n\tBatch,\n\tbatch_values,\n\tcurrent_batch,\n\tflushSync,\n\tschedule_effect\n} from './reactivity/batch.js';\nimport { handle_error } from './error-handling.js';\nimport { UNINITIALIZED } from '../../constants.js';\nimport { captured_signals } from './legacy.js';\nimport { without_reactive_context } from './dom/elements/bindings/shared.js';\n\nexport let is_updating_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_updating_effect(value) {\n\tis_updating_effect = value;\n}\n\nexport let is_destroying_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_destroying_effect(value) {\n\tis_destroying_effect = value;\n}\n\n/** @type {null | Reaction} */\nexport let active_reaction = null;\n\nexport let untracking = false;\n\n/** @param {null | Reaction} reaction */\nexport function set_active_reaction(reaction) {\n\tactive_reaction = reaction;\n}\n\n/** @type {null | Effect} */\nexport let active_effect = null;\n\n/** @param {null | Effect} effect */\nexport function set_active_effect(effect) {\n\tactive_effect = effect;\n}\n\n/**\n * When sources are created within a reaction, reading and writing\n * them within that reaction should not cause a re-run\n * @type {null | Source[]}\n */\nexport let current_sources = null;\n\n/** @param {Value} value */\nexport function push_reaction_value(value) {\n\tif (active_reaction !== null && (!async_mode_flag || (active_reaction.f & DERIVED) !== 0)) {\n\t\tif (current_sources === null) {\n\t\t\tcurrent_sources = [value];\n\t\t} else {\n\t\t\tcurrent_sources.push(value);\n\t\t}\n\t}\n}\n\n/**\n * The dependencies of the reaction that is currently being executed. In many cases,\n * the dependencies are unchanged between runs, and so this will be `null` unless\n * and until a new dependency is accessed — we track this via `skipped_deps`\n * @type {null | Value[]}\n */\nlet new_deps = null;\n\nlet skipped_deps = 0;\n\n/**\n * Tracks writes that the effect it's executed in doesn't listen to yet,\n * so that the dependency can be added to the effect later on if it then reads it\n * @type {null | Source[]}\n */\nexport let untracked_writes = null;\n\n/** @param {null | Source[]} value */\nexport function set_untracked_writes(value) {\n\tuntracked_writes = value;\n}\n\n/**\n * @type {number} Used by sources and deriveds for handling updates.\n * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing\n **/\nexport let write_version = 1;\n\n/** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */\nlet read_version = 0;\n\nexport let update_version = read_version;\n\n/** @param {number} value */\nexport function set_update_version(value) {\n\tupdate_version = value;\n}\n\nexport function increment_write_version() {\n\treturn ++write_version;\n}\n\n/**\n * Determines whether a derived or effect is dirty.\n * If it is MAYBE_DIRTY, will set the status to CLEAN\n * @param {Reaction} reaction\n * @returns {boolean}\n */\nexport function is_dirty(reaction) {\n\tvar flags = reaction.f;\n\n\tif ((flags & DIRTY) !== 0) {\n\t\treturn true;\n\t}\n\n\tif (flags & DERIVED) {\n\t\treaction.f &= ~WAS_MARKED;\n\t}\n\n\tif ((flags & MAYBE_DIRTY) !== 0) {\n\t\tvar dependencies = reaction.deps;\n\n\t\tif (dependencies !== null) {\n\t\t\tvar length = dependencies.length;\n\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tvar dependency = dependencies[i];\n\n\t\t\t\tif (is_dirty(/** @type {Derived} */ (dependency))) {\n\t\t\t\t\tupdate_derived(/** @type {Derived} */ (dependency));\n\t\t\t\t}\n\n\t\t\t\tif (dependency.wv > reaction.wv) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t(flags & CONNECTED) !== 0 &&\n\t\t\t// During time traveling we don't want to reset the status so that\n\t\t\t// traversal of the graph in the other batches still happens\n\t\t\tbatch_values === null\n\t\t) {\n\t\t\tset_signal_status(reaction, CLEAN);\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {Value} signal\n * @param {Effect} effect\n * @param {boolean} [root]\n */\nfunction schedule_possible_effect_self_invalidation(signal, effect, root = true) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tif (!async_mode_flag && current_sources?.includes(signal)) {\n\t\treturn;\n\t}\n\n\tfor (var i = 0; i < reactions.length; i++) {\n\t\tvar reaction = reactions[i];\n\n\t\tif ((reaction.f & DERIVED) !== 0) {\n\t\t\tschedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false);\n\t\t} else if (effect === reaction) {\n\t\t\tif (root) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t} else if ((reaction.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(reaction, MAYBE_DIRTY);\n\t\t\t}\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/** @param {Reaction} reaction */\nexport function update_reaction(reaction) {\n\tvar previous_deps = new_deps;\n\tvar previous_skipped_deps = skipped_deps;\n\tvar previous_untracked_writes = untracked_writes;\n\tvar previous_reaction = active_reaction;\n\tvar previous_sources = current_sources;\n\tvar previous_component_context = component_context;\n\tvar previous_untracking = untracking;\n\tvar previous_update_version = update_version;\n\n\tvar flags = reaction.f;\n\n\tnew_deps = /** @type {null | Value[]} */ (null);\n\tskipped_deps = 0;\n\tuntracked_writes = null;\n\tactive_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;\n\n\tcurrent_sources = null;\n\tset_component_context(reaction.ctx);\n\tuntracking = false;\n\tupdate_version = ++read_version;\n\n\tif (reaction.ac !== null) {\n\t\twithout_reactive_context(() => {\n\t\t\t/** @type {AbortController} */ (reaction.ac).abort(STALE_REACTION);\n\t\t});\n\n\t\treaction.ac = null;\n\t}\n\n\ttry {\n\t\treaction.f |= REACTION_IS_UPDATING;\n\t\tvar fn = /** @type {Function} */ (reaction.fn);\n\t\tvar result = fn();\n\t\tvar deps = reaction.deps;\n\n\t\tif (new_deps !== null) {\n\t\t\tvar i;\n\n\t\t\tremove_reactions(reaction, skipped_deps);\n\n\t\t\tif (deps !== null && skipped_deps > 0) {\n\t\t\t\tdeps.length = skipped_deps + new_deps.length;\n\t\t\t\tfor (i = 0; i < new_deps.length; i++) {\n\t\t\t\t\tdeps[skipped_deps + i] = new_deps[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treaction.deps = deps = new_deps;\n\t\t\t}\n\n\t\t\tif (is_updating_effect && effect_tracking() && (reaction.f & CONNECTED) !== 0) {\n\t\t\t\tfor (i = skipped_deps; i < deps.length; i++) {\n\t\t\t\t\t(deps[i].reactions ??= []).push(reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (deps !== null && skipped_deps < deps.length) {\n\t\t\tremove_reactions(reaction, skipped_deps);\n\t\t\tdeps.length = skipped_deps;\n\t\t}\n\n\t\t// If we're inside an effect and we have untracked writes, then we need to\n\t\t// ensure that if any of those untracked writes result in re-invalidation\n\t\t// of the current effect, then that happens accordingly\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tuntracked_writes !== null &&\n\t\t\t!untracking &&\n\t\t\tdeps !== null &&\n\t\t\t(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0\n\t\t) {\n\t\t\tfor (i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {\n\t\t\t\tschedule_possible_effect_self_invalidation(\n\t\t\t\t\tuntracked_writes[i],\n\t\t\t\t\t/** @type {Effect} */ (reaction)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// If we are returning to an previous reaction then\n\t\t// we need to increment the read version to ensure that\n\t\t// any dependencies in this reaction aren't marked with\n\t\t// the same version\n\t\tif (previous_reaction !== null && previous_reaction !== reaction) {\n\t\t\tread_version++;\n\n\t\t\tif (untracked_writes !== null) {\n\t\t\t\tif (previous_untracked_writes === null) {\n\t\t\t\t\tprevious_untracked_writes = untracked_writes;\n\t\t\t\t} else {\n\t\t\t\t\tprevious_untracked_writes.push(.../** @type {Source[]} */ (untracked_writes));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ((reaction.f & ERROR_VALUE) !== 0) {\n\t\t\treaction.f ^= ERROR_VALUE;\n\t\t}\n\n\t\treturn result;\n\t} catch (error) {\n\t\treturn handle_error(error);\n\t} finally {\n\t\treaction.f ^= REACTION_IS_UPDATING;\n\t\tnew_deps = previous_deps;\n\t\tskipped_deps = previous_skipped_deps;\n\t\tuntracked_writes = previous_untracked_writes;\n\t\tactive_reaction = previous_reaction;\n\t\tcurrent_sources = previous_sources;\n\t\tset_component_context(previous_component_context);\n\t\tuntracking = previous_untracking;\n\t\tupdate_version = previous_update_version;\n\t}\n}\n\n/**\n * @template V\n * @param {Reaction} signal\n * @param {Value} dependency\n * @returns {void}\n */\nfunction remove_reaction(signal, dependency) {\n\tlet reactions = dependency.reactions;\n\tif (reactions !== null) {\n\t\tvar index = index_of.call(reactions, signal);\n\t\tif (index !== -1) {\n\t\t\tvar new_length = reactions.length - 1;\n\t\t\tif (new_length === 0) {\n\t\t\t\treactions = dependency.reactions = null;\n\t\t\t} else {\n\t\t\t\t// Swap with last element and then remove.\n\t\t\t\treactions[index] = reactions[new_length];\n\t\t\t\treactions.pop();\n\t\t\t}\n\t\t}\n\t}\n\n\t// If the derived has no reactions, then we can disconnect it from the graph,\n\t// allowing it to either reconnect in the future, or be GC'd by the VM.\n\tif (\n\t\treactions === null &&\n\t\t(dependency.f & DERIVED) !== 0 &&\n\t\t// Destroying a child effect while updating a parent effect can cause a dependency to appear\n\t\t// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`\n\t\t// allows us to skip the expensive work of disconnecting and immediately reconnecting it\n\t\t(new_deps === null || !new_deps.includes(dependency))\n\t) {\n\t\tset_signal_status(dependency, MAYBE_DIRTY);\n\t\t// If we are working with a derived that is owned by an effect, then mark it as being\n\t\t// disconnected and remove the mark flag, as it cannot be reliably removed otherwise\n\t\tif ((dependency.f & CONNECTED) !== 0) {\n\t\t\tdependency.f ^= CONNECTED;\n\t\t\tdependency.f &= ~WAS_MARKED;\n\t\t}\n\t\t// Disconnect any reactions owned by this reaction\n\t\tdestroy_derived_effects(/** @type {Derived} **/ (dependency));\n\t\tremove_reactions(/** @type {Derived} **/ (dependency), 0);\n\t}\n}\n\n/**\n * @param {Reaction} signal\n * @param {number} start_index\n * @returns {void}\n */\nexport function remove_reactions(signal, start_index) {\n\tvar dependencies = signal.deps;\n\tif (dependencies === null) return;\n\n\tfor (var i = start_index; i < dependencies.length; i++) {\n\t\tremove_reaction(signal, dependencies[i]);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @returns {void}\n */\nexport function update_effect(effect) {\n\tvar flags = effect.f;\n\n\tif ((flags & DESTROYED) !== 0) {\n\t\treturn;\n\t}\n\n\tset_signal_status(effect, CLEAN);\n\n\tvar previous_effect = active_effect;\n\tvar was_updating_effect = is_updating_effect;\n\n\tactive_effect = effect;\n\tis_updating_effect = true;\n\n\tif (DEV) {\n\t\tvar previous_component_fn = dev_current_component_function;\n\t\tset_dev_current_component_function(effect.component_function);\n\t\tvar previous_stack = /** @type {any} */ (dev_stack);\n\t\t// only block effects have a dev stack, keep the current one otherwise\n\t\tset_dev_stack(effect.dev_stack ?? dev_stack);\n\t}\n\n\ttry {\n\t\tif ((flags & (BLOCK_EFFECT | MANAGED_EFFECT)) !== 0) {\n\t\t\tdestroy_block_effect_children(effect);\n\t\t} else {\n\t\t\tdestroy_effect_children(effect);\n\t\t}\n\n\t\texecute_effect_teardown(effect);\n\t\tvar teardown = update_reaction(effect);\n\t\teffect.teardown = typeof teardown === 'function' ? teardown : null;\n\t\teffect.wv = write_version;\n\n\t\t// In DEV, increment versions of any sources that were written to during the effect,\n\t\t// so that they are correctly marked as dirty when the effect re-runs\n\t\tif (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) {\n\t\t\tfor (var dep of effect.deps) {\n\t\t\t\tif (dep.set_during_effect) {\n\t\t\t\t\tdep.wv = increment_write_version();\n\t\t\t\t\tdep.set_during_effect = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tis_updating_effect = was_updating_effect;\n\t\tactive_effect = previous_effect;\n\n\t\tif (DEV) {\n\t\t\tset_dev_current_component_function(previous_component_fn);\n\t\t\tset_dev_stack(previous_stack);\n\t\t}\n\t}\n}\n\n/**\n * Returns a promise that resolves once any pending state changes have been applied.\n * @returns {Promise}\n */\nexport async function tick() {\n\tif (async_mode_flag) {\n\t\treturn new Promise((f) => {\n\t\t\t// Race them against each other - in almost all cases requestAnimationFrame will fire first,\n\t\t\t// but e.g. in case the window is not focused or a view transition happens, requestAnimationFrame\n\t\t\t// will be delayed and setTimeout helps us resolve fast enough in that case\n\t\t\trequestAnimationFrame(() => f());\n\t\t\tsetTimeout(() => f());\n\t\t});\n\t}\n\n\tawait Promise.resolve();\n\n\t// By calling flushSync we guarantee that any pending state changes are applied after one tick.\n\t// TODO look into whether we can make flushing subsequent updates synchronously in the future.\n\tflushSync();\n}\n\n/**\n * Returns a promise that resolves once any state changes, and asynchronous work resulting from them,\n * have resolved and the DOM has been updated\n * @returns {Promise}\n * @since 5.36\n */\nexport function settled() {\n\treturn Batch.ensure().settled();\n}\n\n/**\n * @template V\n * @param {Value} signal\n * @returns {V}\n */\nexport function get(signal) {\n\tvar flags = signal.f;\n\tvar is_derived = (flags & DERIVED) !== 0;\n\n\tcaptured_signals?.add(signal);\n\n\t// Register the dependency on the current reaction signal.\n\tif (active_reaction !== null && !untracking) {\n\t\t// if we're in a derived that is being read inside an _async_ derived,\n\t\t// it's possible that the effect was already destroyed. In this case,\n\t\t// we don't add the dependency, because that would create a memory leak\n\t\tvar destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;\n\n\t\tif (!destroyed && !current_sources?.includes(signal)) {\n\t\t\tvar deps = active_reaction.deps;\n\n\t\t\tif ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {\n\t\t\t\t// we're in the effect init/update cycle\n\t\t\t\tif (signal.rv < read_version) {\n\t\t\t\t\tsignal.rv = read_version;\n\n\t\t\t\t\t// If the signal is accessing the same dependencies in the same\n\t\t\t\t\t// order as it did last time, increment `skipped_deps`\n\t\t\t\t\t// rather than updating `new_deps`, which creates GC cost\n\t\t\t\t\tif (new_deps === null && deps !== null && deps[skipped_deps] === signal) {\n\t\t\t\t\t\tskipped_deps++;\n\t\t\t\t\t} else if (new_deps === null) {\n\t\t\t\t\t\tnew_deps = [signal];\n\t\t\t\t\t} else if (!new_deps.includes(signal)) {\n\t\t\t\t\t\tnew_deps.push(signal);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// we're adding a dependency outside the init/update cycle\n\t\t\t\t// (i.e. after an `await`)\n\t\t\t\t(active_reaction.deps ??= []).push(signal);\n\n\t\t\t\tvar reactions = signal.reactions;\n\n\t\t\t\tif (reactions === null) {\n\t\t\t\t\tsignal.reactions = [active_reaction];\n\t\t\t\t} else if (!reactions.includes(active_reaction)) {\n\t\t\t\t\treactions.push(active_reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (DEV) {\n\t\t// TODO reinstate this, but make it actually work\n\t\t// if (current_async_effect) {\n\t\t// \tvar tracking = (current_async_effect.f & REACTION_IS_UPDATING) !== 0;\n\t\t// \tvar was_read = current_async_effect.deps?.includes(signal);\n\n\t\t// \tif (!tracking && !untracking && !was_read) {\n\t\t// \t\tw.await_reactivity_loss(/** @type {string} */ (signal.label));\n\n\t\t// \t\tvar trace = get_error('traced at');\n\t\t// \t\t// eslint-disable-next-line no-console\n\t\t// \t\tif (trace) console.warn(trace);\n\t\t// \t}\n\t\t// }\n\n\t\trecent_async_deriveds.delete(signal);\n\n\t\tif (\n\t\t\ttracing_mode_flag &&\n\t\t\t!untracking &&\n\t\t\ttracing_expressions !== null &&\n\t\t\tactive_reaction !== null &&\n\t\t\ttracing_expressions.reaction === active_reaction\n\t\t) {\n\t\t\t// Used when mapping state between special blocks like `each`\n\t\t\tif (signal.trace) {\n\t\t\t\tsignal.trace();\n\t\t\t} else {\n\t\t\t\tvar trace = get_error('traced at');\n\n\t\t\t\tif (trace) {\n\t\t\t\t\tvar entry = tracing_expressions.entries.get(signal);\n\n\t\t\t\t\tif (entry === undefined) {\n\t\t\t\t\t\tentry = { traces: [] };\n\t\t\t\t\t\ttracing_expressions.entries.set(signal, entry);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar last = entry.traces[entry.traces.length - 1];\n\n\t\t\t\t\t// traces can be duplicated, e.g. by `snapshot` invoking both\n\t\t\t\t\t// both `getOwnPropertyDescriptor` and `get` traps at once\n\t\t\t\t\tif (trace.stack !== last?.stack) {\n\t\t\t\t\t\tentry.traces.push(trace);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (is_destroying_effect) {\n\t\tif (old_values.has(signal)) {\n\t\t\treturn old_values.get(signal);\n\t\t}\n\n\t\tif (is_derived) {\n\t\t\tvar derived = /** @type {Derived} */ (signal);\n\n\t\t\tvar value = derived.v;\n\n\t\t\t// if the derived is dirty and has reactions, or depends on the values that just changed, re-execute\n\t\t\t// (a derived can be maybe_dirty due to the effect destroy removing its last reaction)\n\t\t\tif (\n\t\t\t\t((derived.f & CLEAN) === 0 && derived.reactions !== null) ||\n\t\t\t\tdepends_on_old_values(derived)\n\t\t\t) {\n\t\t\t\tvalue = execute_derived(derived);\n\t\t\t}\n\n\t\t\told_values.set(derived, value);\n\n\t\t\treturn value;\n\t\t}\n\t} else if (\n\t\tis_derived &&\n\t\t(!batch_values?.has(signal) || (current_batch?.is_fork && !effect_tracking()))\n\t) {\n\t\tderived = /** @type {Derived} */ (signal);\n\n\t\tif (is_dirty(derived)) {\n\t\t\tupdate_derived(derived);\n\t\t}\n\n\t\tif (is_updating_effect && effect_tracking() && (derived.f & CONNECTED) === 0) {\n\t\t\treconnect(derived);\n\t\t}\n\t}\n\n\tif (batch_values?.has(signal)) {\n\t\treturn batch_values.get(signal);\n\t}\n\n\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\tthrow signal.v;\n\t}\n\n\treturn signal.v;\n}\n\n/**\n * (Re)connect a disconnected derived, so that it is notified\n * of changes in `mark_reactions`\n * @param {Derived} derived\n */\nfunction reconnect(derived) {\n\tif (derived.deps === null) return;\n\n\tderived.f ^= CONNECTED;\n\n\tfor (const dep of derived.deps) {\n\t\t(dep.reactions ??= []).push(derived);\n\n\t\tif ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {\n\t\t\treconnect(/** @type {Derived} */ (dep));\n\t\t}\n\t}\n}\n\n/** @param {Derived} derived */\nfunction depends_on_old_values(derived) {\n\tif (derived.v === UNINITIALIZED) return true; // we don't know, so assume the worst\n\tif (derived.deps === null) return false;\n\n\tfor (const dep of derived.deps) {\n\t\tif (old_values.has(dep)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ((dep.f & DERIVED) !== 0 && depends_on_old_values(/** @type {Derived} */ (dep))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Like `get`, but checks for `undefined`. Used for `var` declarations because they can be accessed before being declared\n * @template V\n * @param {Value | undefined} signal\n * @returns {V | undefined}\n */\nexport function safe_get(signal) {\n\treturn signal && get(signal);\n}\n\n/**\n * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),\n * any state read inside `fn` will not be treated as a dependency.\n *\n * ```ts\n * $effect(() => {\n * // this will run when `data` changes, but not when `time` changes\n * save(data, {\n * timestamp: untrack(() => time)\n * });\n * });\n * ```\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function untrack(fn) {\n\tvar previous_untracking = untracking;\n\ttry {\n\t\tuntracking = true;\n\t\treturn fn();\n\t} finally {\n\t\tuntracking = previous_untracking;\n\t}\n}\n\nconst STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);\n\n/**\n * @param {Signal} signal\n * @param {number} status\n * @returns {void}\n */\nexport function set_signal_status(signal, status) {\n\tsignal.f = (signal.f & STATUS_MASK) | status;\n}\n\n/**\n * @param {Record} obj\n * @param {Array} keys\n * @returns {Record}\n */\nexport function exclude_from_object(obj, keys) {\n\t/** @type {Record} */\n\tvar result = {};\n\n\tfor (var key in obj) {\n\t\tif (!keys.includes(key)) {\n\t\t\tresult[key] = obj[key];\n\t\t}\n\t}\n\n\tfor (var symbol of Object.getOwnPropertySymbols(obj)) {\n\t\tif (Object.propertyIsEnumerable.call(obj, symbol) && !keys.includes(symbol)) {\n\t\t\tresult[symbol] = obj[symbol];\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Possibly traverse an object and read all its properties so that they're all reactive in case this is `$state`.\n * Does only check first level of an object for performance reasons (heuristic should be good for 99% of all cases).\n * @param {any} value\n * @returns {void}\n */\nexport function deep_read_state(value) {\n\tif (typeof value !== 'object' || !value || value instanceof EventTarget) {\n\t\treturn;\n\t}\n\n\tif (STATE_SYMBOL in value) {\n\t\tdeep_read(value);\n\t} else if (!Array.isArray(value)) {\n\t\tfor (let key in value) {\n\t\t\tconst prop = value[key];\n\t\t\tif (typeof prop === 'object' && prop && STATE_SYMBOL in prop) {\n\t\t\t\tdeep_read(prop);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Deeply traverse an object and read all its properties\n * so that they're all reactive in case this is `$state`\n * @param {any} value\n * @param {Set} visited\n * @returns {void}\n */\nexport function deep_read(value, visited = new Set()) {\n\tif (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t// We don't want to traverse DOM elements\n\t\t!(value instanceof EventTarget) &&\n\t\t!visited.has(value)\n\t) {\n\t\tvisited.add(value);\n\t\t// When working with a possible SvelteDate, this\n\t\t// will ensure we capture changes to it.\n\t\tif (value instanceof Date) {\n\t\t\tvalue.getTime();\n\t\t}\n\t\tfor (let key in value) {\n\t\t\ttry {\n\t\t\t\tdeep_read(value[key], visited);\n\t\t\t} catch (e) {\n\t\t\t\t// continue\n\t\t\t}\n\t\t}\n\t\tconst proto = get_prototype_of(value);\n\t\tif (\n\t\t\tproto !== Object.prototype &&\n\t\t\tproto !== Array.prototype &&\n\t\t\tproto !== Map.prototype &&\n\t\t\tproto !== Set.prototype &&\n\t\t\tproto !== Date.prototype\n\t\t) {\n\t\t\tconst descriptors = get_descriptors(proto);\n\t\t\tfor (let key in descriptors) {\n\t\t\t\tconst get = descriptors[key].get;\n\t\t\t\tif (get) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tget.call(value);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// continue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { teardown } from '../../reactivity/effects.js';\nimport { define_property } from '../../../shared/utils.js';\nimport { hydrating } from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport { FILENAME } from '../../../../constants.js';\nimport * as w from '../../warnings.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { without_reactive_context } from './bindings/shared.js';\n\n/** @type {Set} */\nexport const all_registered_events = new Set();\n\n/** @type {Set<(events: Array) => void>} */\nexport const root_event_handles = new Set();\n\n/**\n * SSR adds onload and onerror attributes to catch those events before the hydration.\n * This function detects those cases, removes the attributes and replays the events.\n * @param {HTMLElement} dom\n */\nexport function replay_events(dom) {\n\tif (!hydrating) return;\n\n\tdom.removeAttribute('onload');\n\tdom.removeAttribute('onerror');\n\t// @ts-expect-error\n\tconst event = dom.__e;\n\tif (event !== undefined) {\n\t\t// @ts-expect-error\n\t\tdom.__e = undefined;\n\t\tqueueMicrotask(() => {\n\t\t\tif (dom.isConnected) {\n\t\t\t\tdom.dispatchEvent(event);\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @param {string} event_name\n * @param {EventTarget} dom\n * @param {EventListener} [handler]\n * @param {AddEventListenerOptions} [options]\n */\nexport function create_event(event_name, dom, handler, options = {}) {\n\t/**\n\t * @this {EventTarget}\n\t */\n\tfunction target_handler(/** @type {Event} */ event) {\n\t\tif (!options.capture) {\n\t\t\t// Only call in the bubble phase, else delegated events would be called before the capturing events\n\t\t\thandle_event_propagation.call(dom, event);\n\t\t}\n\t\tif (!event.cancelBubble) {\n\t\t\treturn without_reactive_context(() => {\n\t\t\t\treturn handler?.call(this, event);\n\t\t\t});\n\t\t}\n\t}\n\n\t// Chrome has a bug where pointer events don't work when attached to a DOM element that has been cloned\n\t// with cloneNode() and the DOM element is disconnected from the document. To ensure the event works, we\n\t// defer the attachment till after it's been appended to the document. TODO: remove this once Chrome fixes\n\t// this bug. The same applies to wheel events and touch events.\n\tif (\n\t\tevent_name.startsWith('pointer') ||\n\t\tevent_name.startsWith('touch') ||\n\t\tevent_name === 'wheel'\n\t) {\n\t\tqueue_micro_task(() => {\n\t\t\tdom.addEventListener(event_name, target_handler, options);\n\t\t});\n\t} else {\n\t\tdom.addEventListener(event_name, target_handler, options);\n\t}\n\n\treturn target_handler;\n}\n\n/**\n * Attaches an event handler to an element and returns a function that removes the handler. Using this\n * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively\n * (with attributes like `onclick`), which use event delegation for performance reasons\n *\n * @param {EventTarget} element\n * @param {string} type\n * @param {EventListener} handler\n * @param {AddEventListenerOptions} [options]\n */\nexport function on(element, type, handler, options = {}) {\n\tvar target_handler = create_event(type, element, handler, options);\n\n\treturn () => {\n\t\telement.removeEventListener(type, target_handler, options);\n\t};\n}\n\n/**\n * @param {string} event_name\n * @param {Element} dom\n * @param {EventListener} [handler]\n * @param {boolean} [capture]\n * @param {boolean} [passive]\n * @returns {void}\n */\nexport function event(event_name, dom, handler, capture, passive) {\n\tvar options = { capture, passive };\n\tvar target_handler = create_event(event_name, dom, handler, options);\n\n\tif (\n\t\tdom === document.body ||\n\t\t// @ts-ignore\n\t\tdom === window ||\n\t\t// @ts-ignore\n\t\tdom === document ||\n\t\t// Firefox has quirky behavior, it can happen that we still get \"canplay\" events when the element is already removed\n\t\tdom instanceof HTMLMediaElement\n\t) {\n\t\tteardown(() => {\n\t\t\tdom.removeEventListener(event_name, target_handler, options);\n\t\t});\n\t}\n}\n\n/**\n * @param {Array} events\n * @returns {void}\n */\nexport function delegate(events) {\n\tfor (var i = 0; i < events.length; i++) {\n\t\tall_registered_events.add(events[i]);\n\t}\n\n\tfor (var fn of root_event_handles) {\n\t\tfn(events);\n\t}\n}\n\n// used to store the reference to the currently propagated event\n// to prevent garbage collection between microtasks in Firefox\n// If the event object is GCed too early, the expando __root property\n// set on the event object is lost, causing the event delegation\n// to process the event twice\nlet last_propagated_event = null;\n\n/**\n * @this {EventTarget}\n * @param {Event} event\n * @returns {void}\n */\nexport function handle_event_propagation(event) {\n\tvar handler_element = this;\n\tvar owner_document = /** @type {Node} */ (handler_element).ownerDocument;\n\tvar event_name = event.type;\n\tvar path = event.composedPath?.() || [];\n\tvar current_target = /** @type {null | Element} */ (path[0] || event.target);\n\n\tlast_propagated_event = event;\n\n\t// composedPath contains list of nodes the event has propagated through.\n\t// We check __root to skip all nodes below it in case this is a\n\t// parent of the __root node, which indicates that there's nested\n\t// mounted apps. In this case we don't want to trigger events multiple times.\n\tvar path_idx = 0;\n\n\t// the `last_propagated_event === event` check is redundant, but\n\t// without it the variable will be DCE'd and things will\n\t// fail mysteriously in Firefox\n\t// @ts-expect-error is added below\n\tvar handled_at = last_propagated_event === event && event.__root;\n\n\tif (handled_at) {\n\t\tvar at_idx = path.indexOf(handled_at);\n\t\tif (\n\t\t\tat_idx !== -1 &&\n\t\t\t(handler_element === document || handler_element === /** @type {any} */ (window))\n\t\t) {\n\t\t\t// This is the fallback document listener or a window listener, but the event was already handled\n\t\t\t// -> ignore, but set handle_at to document/window so that we're resetting the event\n\t\t\t// chain in case someone manually dispatches the same event object again.\n\t\t\t// @ts-expect-error\n\t\t\tevent.__root = handler_element;\n\t\t\treturn;\n\t\t}\n\n\t\t// We're deliberately not skipping if the index is higher, because\n\t\t// someone could create an event programmatically and emit it multiple times,\n\t\t// in which case we want to handle the whole propagation chain properly each time.\n\t\t// (this will only be a false negative if the event is dispatched multiple times and\n\t\t// the fallback document listener isn't reached in between, but that's super rare)\n\t\tvar handler_idx = path.indexOf(handler_element);\n\t\tif (handler_idx === -1) {\n\t\t\t// handle_idx can theoretically be -1 (happened in some JSDOM testing scenarios with an event listener on the window object)\n\t\t\t// so guard against that, too, and assume that everything was handled at this point.\n\t\t\treturn;\n\t\t}\n\n\t\tif (at_idx <= handler_idx) {\n\t\t\tpath_idx = at_idx;\n\t\t}\n\t}\n\n\tcurrent_target = /** @type {Element} */ (path[path_idx] || event.target);\n\t// there can only be one delegated event per element, and we either already handled the current target,\n\t// or this is the very first target in the chain which has a non-delegated listener, in which case it's safe\n\t// to handle a possible delegated event on it later (through the root delegation listener for example).\n\tif (current_target === handler_element) return;\n\n\t// Proxy currentTarget to correct target\n\tdefine_property(event, 'currentTarget', {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn current_target || owner_document;\n\t\t}\n\t});\n\n\t// This started because of Chromium issue https://chromestatus.com/feature/5128696823545856,\n\t// where removal or moving of of the DOM can cause sync `blur` events to fire, which can cause logic\n\t// to run inside the current `active_reaction`, which isn't what we want at all. However, on reflection,\n\t// it's probably best that all event handled by Svelte have this behaviour, as we don't really want\n\t// an event handler to run in the context of another reaction or effect.\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\t/**\n\t\t * @type {unknown}\n\t\t */\n\t\tvar throw_error;\n\t\t/**\n\t\t * @type {unknown[]}\n\t\t */\n\t\tvar other_errors = [];\n\n\t\twhile (current_target !== null) {\n\t\t\t/** @type {null | Element} */\n\t\t\tvar parent_element =\n\t\t\t\tcurrent_target.assignedSlot ||\n\t\t\t\tcurrent_target.parentNode ||\n\t\t\t\t/** @type {any} */ (current_target).host ||\n\t\t\t\tnull;\n\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tvar delegated = current_target['__' + event_name];\n\n\t\t\t\tif (\n\t\t\t\t\tdelegated != null &&\n\t\t\t\t\t(!(/** @type {any} */ (current_target).disabled) ||\n\t\t\t\t\t\t// DOM could've been updated already by the time this is reached, so we check this as well\n\t\t\t\t\t\t// -> the target could not have been disabled because it emits the event in the first place\n\t\t\t\t\t\tevent.target === current_target)\n\t\t\t\t) {\n\t\t\t\t\tdelegated.call(current_target, event);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (throw_error) {\n\t\t\t\t\tother_errors.push(error);\n\t\t\t\t} else {\n\t\t\t\t\tthrow_error = error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (event.cancelBubble || parent_element === handler_element || parent_element === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrent_target = parent_element;\n\t\t}\n\n\t\tif (throw_error) {\n\t\t\tfor (let error of other_errors) {\n\t\t\t\t// Throw the rest of the errors, one-by-one on a microtask\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow throw_error;\n\t\t}\n\t} finally {\n\t\t// @ts-expect-error is used above\n\t\tevent.__root = handler_element;\n\t\t// @ts-ignore remove proxy on currentTarget\n\t\tdelete event.currentTarget;\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * In dev, warn if an event handler is not a function, as it means the\n * user probably called the handler or forgot to add a `() =>`\n * @param {() => (event: Event, ...args: any) => void} thunk\n * @param {EventTarget} element\n * @param {[Event, ...any]} args\n * @param {any} component\n * @param {[number, number]} [loc]\n * @param {boolean} [remove_parens]\n */\nexport function apply(\n\tthunk,\n\telement,\n\targs,\n\tcomponent,\n\tloc,\n\thas_side_effects = false,\n\tremove_parens = false\n) {\n\tlet handler;\n\tlet error;\n\n\ttry {\n\t\thandler = thunk();\n\t} catch (e) {\n\t\terror = e;\n\t}\n\n\tif (typeof handler !== 'function' && (has_side_effects || handler != null || error)) {\n\t\tconst filename = component?.[FILENAME];\n\t\tconst location = loc ? ` at ${filename}:${loc[0]}:${loc[1]}` : ` in ${filename}`;\n\t\tconst phase = args[0]?.eventPhase < Event.BUBBLING_PHASE ? 'capture' : '';\n\t\tconst event_name = args[0]?.type + phase;\n\t\tconst description = `\\`${event_name}\\` handler${location}`;\n\t\tconst suggestion = remove_parens ? 'remove the trailing `()`' : 'add a leading `() =>`';\n\n\t\tw.event_handler_invalid(description, suggestion);\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t}\n\thandler?.apply(element, args);\n}\n","/** @param {string} html */\nexport function create_fragment_from_html(html) {\n\tvar elem = document.createElement('template');\n\telem.innerHTML = html.replaceAll('', ''); // XHTML compliance\n\treturn elem.content;\n}\n","/** @import { Effect, TemplateNode } from '#client' */\n/** @import { TemplateStructure } from './types' */\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport {\n\tcreate_text,\n\tget_first_child,\n\tis_firefox,\n\tcreate_element,\n\tcreate_fragment,\n\tcreate_comment,\n\tset_attribute\n} from './operations.js';\nimport { create_fragment_from_html } from './reconciler.js';\nimport { active_effect } from '../runtime.js';\nimport {\n\tNAMESPACE_MATHML,\n\tNAMESPACE_SVG,\n\tTEMPLATE_FRAGMENT,\n\tTEMPLATE_USE_IMPORT_NODE,\n\tTEMPLATE_USE_MATHML,\n\tTEMPLATE_USE_SVG\n} from '../../../constants.js';\nimport { COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, EFFECT_RAN, TEXT_NODE } from '#client/constants';\n\n/**\n * @param {TemplateNode} start\n * @param {TemplateNode | null} end\n */\nexport function assign_nodes(start, end) {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\tif (effect.nodes_start === null) {\n\t\teffect.nodes_start = start;\n\t\teffect.nodes_end = end;\n\t}\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_html(content, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('');\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tnode = create_fragment_from_html(has_start ? content : '' + content);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @param {'svg' | 'math'} ns\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nfunction from_namespace(content, flags, ns = 'svg') {\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('');\n\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar wrapped = `<${ns}>${has_start ? content : '' + content}`;\n\n\t/** @type {Element | DocumentFragment} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (!node) {\n\t\t\tvar fragment = /** @type {DocumentFragment} */ (create_fragment_from_html(wrapped));\n\t\t\tvar root = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (is_fragment) {\n\t\t\t\tnode = document.createDocumentFragment();\n\t\t\t\twhile (get_first_child(root)) {\n\t\t\t\t\tnode.appendChild(/** @type {Node} */ (get_first_child(root)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode = /** @type {Element} */ (get_first_child(root));\n\t\t\t}\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (node.cloneNode(true));\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_svg(content, flags) {\n\treturn from_namespace(content, flags, 'svg');\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_mathml(content, flags) {\n\treturn from_namespace(content, flags, 'math');\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {typeof NAMESPACE_SVG | typeof NAMESPACE_MATHML | undefined} [ns]\n */\nfunction fragment_from_tree(structure, ns) {\n\tvar fragment = create_fragment();\n\n\tfor (var item of structure) {\n\t\tif (typeof item === 'string') {\n\t\t\tfragment.append(create_text(item));\n\t\t\tcontinue;\n\t\t}\n\n\t\t// if `preserveComments === true`, comments are represented as `['// ']`\n\t\tif (item === undefined || item[0][0] === '/') {\n\t\t\tfragment.append(create_comment(item ? item[0].slice(3) : ''));\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [name, attributes, ...children] = item;\n\n\t\tconst namespace = name === 'svg' ? NAMESPACE_SVG : name === 'math' ? NAMESPACE_MATHML : ns;\n\n\t\tvar element = create_element(name, namespace, attributes?.is);\n\n\t\tfor (var key in attributes) {\n\t\t\tset_attribute(element, key, attributes[key]);\n\t\t}\n\n\t\tif (children.length > 0) {\n\t\t\tvar target =\n\t\t\t\telement.tagName === 'TEMPLATE'\n\t\t\t\t\t? /** @type {HTMLTemplateElement} */ (element).content\n\t\t\t\t\t: element;\n\n\t\t\ttarget.append(\n\t\t\t\tfragment_from_tree(children, element.tagName === 'foreignObject' ? undefined : namespace)\n\t\t\t);\n\t\t}\n\n\t\tfragment.append(element);\n\t}\n\n\treturn fragment;\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_tree(structure, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tconst ns =\n\t\t\t\t(flags & TEMPLATE_USE_SVG) !== 0\n\t\t\t\t\t? NAMESPACE_SVG\n\t\t\t\t\t: (flags & TEMPLATE_USE_MATHML) !== 0\n\t\t\t\t\t\t? NAMESPACE_MATHML\n\t\t\t\t\t\t: undefined;\n\n\t\t\tnode = fragment_from_tree(structure, ns);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {() => Element | DocumentFragment} fn\n */\nexport function with_script(fn) {\n\treturn () => run_scripts(fn());\n}\n\n/**\n * Creating a document fragment from HTML that contains script tags will not execute\n * the scripts. We need to replace the script tags with new ones so that they are executed.\n * @param {Element | DocumentFragment} node\n * @returns {Node | Node[]}\n */\nfunction run_scripts(node) {\n\t// scripts were SSR'd, in which case they will run\n\tif (hydrating) return node;\n\n\tconst is_fragment = node.nodeType === DOCUMENT_FRAGMENT_NODE;\n\tconst scripts =\n\t\t/** @type {HTMLElement} */ (node).tagName === 'SCRIPT'\n\t\t\t? [/** @type {HTMLScriptElement} */ (node)]\n\t\t\t: node.querySelectorAll('script');\n\tconst effect = /** @type {Effect} */ (active_effect);\n\n\tfor (const script of scripts) {\n\t\tconst clone = document.createElement('script');\n\t\tfor (var attribute of script.attributes) {\n\t\t\tclone.setAttribute(attribute.name, attribute.value);\n\t\t}\n\n\t\tclone.textContent = script.textContent;\n\n\t\t// The script has changed - if it's at the edges, the effect now points at dead nodes\n\t\tif (is_fragment ? node.firstChild === script : node === script) {\n\t\t\teffect.nodes_start = clone;\n\t\t}\n\t\tif (is_fragment ? node.lastChild === script : node === script) {\n\t\t\teffect.nodes_end = clone;\n\t\t}\n\n\t\tscript.replaceWith(clone);\n\t}\n\treturn node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {any} value\n */\nexport function text(value = '') {\n\tif (!hydrating) {\n\t\tvar t = create_text(value + '');\n\t\tassign_nodes(t, t);\n\t\treturn t;\n\t}\n\n\tvar node = hydrate_node;\n\n\tif (node.nodeType !== TEXT_NODE) {\n\t\t// if an {expression} is empty during SSR, we need to insert an empty text node\n\t\tnode.before((node = create_text()));\n\t\tset_hydrate_node(node);\n\t}\n\n\tassign_nodes(node, node);\n\treturn node;\n}\n\n/**\n * @returns {TemplateNode | DocumentFragment}\n */\nexport function comment() {\n\t// we're not delegating to `template` here for performance reasons\n\tif (hydrating) {\n\t\tassign_nodes(hydrate_node, null);\n\t\treturn hydrate_node;\n\t}\n\n\tvar frag = document.createDocumentFragment();\n\tvar start = document.createComment('');\n\tvar anchor = create_text();\n\tfrag.append(start, anchor);\n\n\tassign_nodes(start, anchor);\n\n\treturn frag;\n}\n\n/**\n * Assign the created (or in hydration mode, traversed) dom elements to the current block\n * and insert the elements into the dom (in client mode).\n * @param {Text | Comment | Element} anchor\n * @param {DocumentFragment | Element} dom\n */\nexport function append(anchor, dom) {\n\tif (hydrating) {\n\t\tvar effect = /** @type {Effect} */ (active_effect);\n\t\t// When hydrating and outer component and an inner component is async, i.e. blocked on a promise,\n\t\t// then by the time the inner resolves we have already advanced to the end of the hydrated nodes\n\t\t// of the parent component. Check for defined for that reason to avoid rewinding the parent's end marker.\n\t\tif ((effect.f & EFFECT_RAN) === 0 || effect.nodes_end === null) {\n\t\t\teffect.nodes_end = hydrate_node;\n\t\t}\n\t\thydrate_next();\n\t\treturn;\n\t}\n\n\tif (anchor === null) {\n\t\t// edge case — void `` with content\n\t\treturn;\n\t}\n\n\tanchor.before(/** @type {Node} */ (dom));\n}\n\n/**\n * Create (or hydrate) an unique UID for the component instance.\n */\nexport function props_id() {\n\tif (\n\t\thydrating &&\n\t\thydrate_node &&\n\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\thydrate_node.textContent?.startsWith(`$`)\n\t) {\n\t\tconst id = hydrate_node.textContent.substring(1);\n\t\thydrate_next();\n\t\treturn id;\n\t}\n\n\t// @ts-expect-error This way we ensure the id is unique even across Svelte runtimes\n\t(window.__svelte ??= {}).uid ??= 1;\n\n\t// @ts-expect-error\n\treturn `c${window.__svelte.uid++}`;\n}\n","const regex_return_characters = /\\r/g;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nexport function hash(str) {\n\tstr = str.replace(regex_return_characters, '');\n\tlet hash = 5381;\n\tlet i = str.length;\n\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn (hash >>> 0).toString(36);\n}\n\nconst VOID_ELEMENT_NAMES = [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr'\n];\n\n/**\n * Returns `true` if `name` is of a void element\n * @param {string} name\n */\nexport function is_void(name) {\n\treturn VOID_ELEMENT_NAMES.includes(name) || name.toLowerCase() === '!doctype';\n}\n\nconst RESERVED_WORDS = [\n\t'arguments',\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'eval',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'implements',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'interface',\n\t'let',\n\t'new',\n\t'null',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'return',\n\t'static',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield'\n];\n\n/**\n * Returns `true` if `word` is a reserved JavaScript keyword\n * @param {string} word\n */\nexport function is_reserved(word) {\n\treturn RESERVED_WORDS.includes(word);\n}\n\n/**\n * @param {string} name\n */\nexport function is_capture_event(name) {\n\treturn name.endsWith('capture') && name !== 'gotpointercapture' && name !== 'lostpointercapture';\n}\n\n/** List of Element events that will be delegated */\nconst DELEGATED_EVENTS = [\n\t'beforeinput',\n\t'click',\n\t'change',\n\t'dblclick',\n\t'contextmenu',\n\t'focusin',\n\t'focusout',\n\t'input',\n\t'keydown',\n\t'keyup',\n\t'mousedown',\n\t'mousemove',\n\t'mouseout',\n\t'mouseover',\n\t'mouseup',\n\t'pointerdown',\n\t'pointermove',\n\t'pointerout',\n\t'pointerover',\n\t'pointerup',\n\t'touchend',\n\t'touchmove',\n\t'touchstart'\n];\n\n/**\n * Returns `true` if `event_name` is a delegated event\n * @param {string} event_name\n */\nexport function can_delegate_event(event_name) {\n\treturn DELEGATED_EVENTS.includes(event_name);\n}\n\n/**\n * Attributes that are boolean, i.e. they are present or not present.\n */\nconst DOM_BOOLEAN_ATTRIBUTES = [\n\t'allowfullscreen',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'disabled',\n\t'formnovalidate',\n\t'indeterminate',\n\t'inert',\n\t'ismap',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'seamless',\n\t'selected',\n\t'webkitdirectory',\n\t'defer',\n\t'disablepictureinpicture',\n\t'disableremoteplayback'\n];\n\n/**\n * Returns `true` if `name` is a boolean attribute\n * @param {string} name\n */\nexport function is_boolean_attribute(name) {\n\treturn DOM_BOOLEAN_ATTRIBUTES.includes(name);\n}\n\n/**\n * @type {Record}\n * List of attribute names that should be aliased to their property names\n * because they behave differently between setting them as an attribute and\n * setting them as a property.\n */\nconst ATTRIBUTE_ALIASES = {\n\t// no `class: 'className'` because we handle that separately\n\tformnovalidate: 'formNoValidate',\n\tismap: 'isMap',\n\tnomodule: 'noModule',\n\tplaysinline: 'playsInline',\n\treadonly: 'readOnly',\n\tdefaultvalue: 'defaultValue',\n\tdefaultchecked: 'defaultChecked',\n\tsrcobject: 'srcObject',\n\tnovalidate: 'noValidate',\n\tallowfullscreen: 'allowFullscreen',\n\tdisablepictureinpicture: 'disablePictureInPicture',\n\tdisableremoteplayback: 'disableRemotePlayback'\n};\n\n/**\n * @param {string} name\n */\nexport function normalize_attribute(name) {\n\tname = name.toLowerCase();\n\treturn ATTRIBUTE_ALIASES[name] ?? name;\n}\n\nconst DOM_PROPERTIES = [\n\t...DOM_BOOLEAN_ATTRIBUTES,\n\t'formNoValidate',\n\t'isMap',\n\t'noModule',\n\t'playsInline',\n\t'readOnly',\n\t'value',\n\t'volume',\n\t'defaultValue',\n\t'defaultChecked',\n\t'srcObject',\n\t'noValidate',\n\t'allowFullscreen',\n\t'disablePictureInPicture',\n\t'disableRemotePlayback'\n];\n\n/**\n * @param {string} name\n */\nexport function is_dom_property(name) {\n\treturn DOM_PROPERTIES.includes(name);\n}\n\nconst NON_STATIC_PROPERTIES = ['autofocus', 'muted', 'defaultValue', 'defaultChecked'];\n\n/**\n * Returns `true` if the given attribute cannot be set through the template\n * string, i.e. needs some kind of JavaScript handling to work.\n * @param {string} name\n */\nexport function cannot_be_set_statically(name) {\n\treturn NON_STATIC_PROPERTIES.includes(name);\n}\n\n/**\n * Subset of delegated events which should be passive by default.\n * These two are already passive via browser defaults on window, document and body.\n * But since\n * - we're delegating them\n * - they happen often\n * - they apply to mobile which is generally less performant\n * we're marking them as passive by default for other elements, too.\n */\nconst PASSIVE_EVENTS = ['touchstart', 'touchmove'];\n\n/**\n * Returns `true` if `name` is a passive event\n * @param {string} name\n */\nexport function is_passive_event(name) {\n\treturn PASSIVE_EVENTS.includes(name);\n}\n\nconst CONTENT_EDITABLE_BINDINGS = ['textContent', 'innerHTML', 'innerText'];\n\n/** @param {string} name */\nexport function is_content_editable_binding(name) {\n\treturn CONTENT_EDITABLE_BINDINGS.includes(name);\n}\n\nconst LOAD_ERROR_ELEMENTS = [\n\t'body',\n\t'embed',\n\t'iframe',\n\t'img',\n\t'link',\n\t'object',\n\t'script',\n\t'style',\n\t'track'\n];\n\n/**\n * Returns `true` if the element emits `load` and `error` events\n * @param {string} name\n */\nexport function is_load_error_element(name) {\n\treturn LOAD_ERROR_ELEMENTS.includes(name);\n}\n\nconst SVG_ELEMENTS = [\n\t'altGlyph',\n\t'altGlyphDef',\n\t'altGlyphItem',\n\t'animate',\n\t'animateColor',\n\t'animateMotion',\n\t'animateTransform',\n\t'circle',\n\t'clipPath',\n\t'color-profile',\n\t'cursor',\n\t'defs',\n\t'desc',\n\t'discard',\n\t'ellipse',\n\t'feBlend',\n\t'feColorMatrix',\n\t'feComponentTransfer',\n\t'feComposite',\n\t'feConvolveMatrix',\n\t'feDiffuseLighting',\n\t'feDisplacementMap',\n\t'feDistantLight',\n\t'feDropShadow',\n\t'feFlood',\n\t'feFuncA',\n\t'feFuncB',\n\t'feFuncG',\n\t'feFuncR',\n\t'feGaussianBlur',\n\t'feImage',\n\t'feMerge',\n\t'feMergeNode',\n\t'feMorphology',\n\t'feOffset',\n\t'fePointLight',\n\t'feSpecularLighting',\n\t'feSpotLight',\n\t'feTile',\n\t'feTurbulence',\n\t'filter',\n\t'font',\n\t'font-face',\n\t'font-face-format',\n\t'font-face-name',\n\t'font-face-src',\n\t'font-face-uri',\n\t'foreignObject',\n\t'g',\n\t'glyph',\n\t'glyphRef',\n\t'hatch',\n\t'hatchpath',\n\t'hkern',\n\t'image',\n\t'line',\n\t'linearGradient',\n\t'marker',\n\t'mask',\n\t'mesh',\n\t'meshgradient',\n\t'meshpatch',\n\t'meshrow',\n\t'metadata',\n\t'missing-glyph',\n\t'mpath',\n\t'path',\n\t'pattern',\n\t'polygon',\n\t'polyline',\n\t'radialGradient',\n\t'rect',\n\t'set',\n\t'solidcolor',\n\t'stop',\n\t'svg',\n\t'switch',\n\t'symbol',\n\t'text',\n\t'textPath',\n\t'tref',\n\t'tspan',\n\t'unknown',\n\t'use',\n\t'view',\n\t'vkern'\n];\n\n/** @param {string} name */\nexport function is_svg(name) {\n\treturn SVG_ELEMENTS.includes(name);\n}\n\nconst MATHML_ELEMENTS = [\n\t'annotation',\n\t'annotation-xml',\n\t'maction',\n\t'math',\n\t'merror',\n\t'mfrac',\n\t'mi',\n\t'mmultiscripts',\n\t'mn',\n\t'mo',\n\t'mover',\n\t'mpadded',\n\t'mphantom',\n\t'mprescripts',\n\t'mroot',\n\t'mrow',\n\t'ms',\n\t'mspace',\n\t'msqrt',\n\t'mstyle',\n\t'msub',\n\t'msubsup',\n\t'msup',\n\t'mtable',\n\t'mtd',\n\t'mtext',\n\t'mtr',\n\t'munder',\n\t'munderover',\n\t'semantics'\n];\n\n/** @param {string} name */\nexport function is_mathml(name) {\n\treturn MATHML_ELEMENTS.includes(name);\n}\n\nconst STATE_CREATION_RUNES = /** @type {const} */ ([\n\t'$state',\n\t'$state.raw',\n\t'$derived',\n\t'$derived.by'\n]);\n\nconst RUNES = /** @type {const} */ ([\n\t...STATE_CREATION_RUNES,\n\t'$state.eager',\n\t'$state.snapshot',\n\t'$props',\n\t'$props.id',\n\t'$bindable',\n\t'$effect',\n\t'$effect.pre',\n\t'$effect.tracking',\n\t'$effect.root',\n\t'$effect.pending',\n\t'$inspect',\n\t'$inspect().with',\n\t'$inspect.trace',\n\t'$host'\n]);\n\n/** @typedef {typeof RUNES[number]} RuneName */\n\n/**\n * @param {string} name\n * @returns {name is RuneName}\n */\nexport function is_rune(name) {\n\treturn RUNES.includes(/** @type {RuneName} */ (name));\n}\n\n/** @typedef {typeof STATE_CREATION_RUNES[number]} StateCreationRuneName */\n\n/**\n * @param {string} name\n * @returns {name is StateCreationRuneName}\n */\nexport function is_state_creation_rune(name) {\n\treturn STATE_CREATION_RUNES.includes(/** @type {StateCreationRuneName} */ (name));\n}\n\n/** List of elements that require raw contents and should not have SSR comments put in them */\nconst RAW_TEXT_ELEMENTS = /** @type {const} */ (['textarea', 'script', 'style', 'title']);\n\n/** @param {string} name */\nexport function is_raw_text_element(name) {\n\treturn RAW_TEXT_ELEMENTS.includes(/** @type {typeof RAW_TEXT_ELEMENTS[number]} */ (name));\n}\n\n/**\n * Prevent devtools trying to make `location` a clickable link by inserting a zero-width space\n * @template {string | undefined} T\n * @param {T} location\n * @returns {T};\n */\nexport function sanitize_location(location) {\n\treturn /** @type {T} */ (location?.replace(/\\//g, '/\\u200b'));\n}\n","/** @import { ComponentContext, Effect, TemplateNode } from '#client' */\n/** @import { Component, ComponentType, SvelteComponent, MountOptions } from '../../index.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tinit_operations\n} from './dom/operations.js';\nimport { HYDRATION_END, HYDRATION_ERROR, HYDRATION_START } from '../../constants.js';\nimport { active_effect } from './runtime.js';\nimport { push, pop, component_context } from './context.js';\nimport { component_root } from './reactivity/effects.js';\nimport { hydrate_node, hydrating, set_hydrate_node, set_hydrating } from './dom/hydration.js';\nimport { array_from } from '../shared/utils.js';\nimport {\n\tall_registered_events,\n\thandle_event_propagation,\n\troot_event_handles\n} from './dom/elements/events.js';\nimport * as w from './warnings.js';\nimport * as e from './errors.js';\nimport { assign_nodes } from './dom/template.js';\nimport { is_passive_event } from '../../utils.js';\nimport { COMMENT_NODE, STATE_SYMBOL } from './constants.js';\nimport { boundary } from './dom/blocks/boundary.js';\n\n/**\n * This is normally true — block effects should run their intro transitions —\n * but is false during hydration (unless `options.intro` is `true`) and\n * when creating the children of a `` that just changed tag\n */\nexport let should_intro = true;\n\n/** @param {boolean} value */\nexport function set_should_intro(value) {\n\tshould_intro = value;\n}\n\n/**\n * @param {Element} text\n * @param {string} value\n * @returns {void}\n */\nexport function set_text(text, value) {\n\t// For objects, we apply string coercion (which might make things like $state array references in the template reactive) before diffing\n\tvar str = value == null ? '' : typeof value === 'object' ? value + '' : value;\n\t// @ts-expect-error\n\tif (str !== (text.__t ??= text.nodeValue)) {\n\t\t// @ts-expect-error\n\t\ttext.__t = str;\n\t\ttext.nodeValue = str + '';\n\t}\n}\n\n/**\n * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.\n * Transitions will play during the initial render unless the `intro` option is set to `false`.\n *\n * @template {Record} Props\n * @template {Record} Exports\n * @param {ComponentType> | Component} component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nexport function mount(component, options) {\n\treturn _mount(component, options);\n}\n\n/**\n * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component\n *\n * @template {Record} Props\n * @template {Record} Exports\n * @param {ComponentType> | Component} component\n * @param {{} extends Props ? {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops?: Props;\n * \t\tevents?: Record any>;\n * \tcontext?: Map;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t} : {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops: Props;\n * \t\tevents?: Record any>;\n * \tcontext?: Map;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t}} options\n * @returns {Exports}\n */\nexport function hydrate(component, options) {\n\tinit_operations();\n\toptions.intro = options.intro ?? false;\n\tconst target = options.target;\n\tconst was_hydrating = hydrating;\n\tconst previous_hydrate_node = hydrate_node;\n\n\ttry {\n\t\tvar anchor = /** @type {TemplateNode} */ (get_first_child(target));\n\t\twhile (\n\t\t\tanchor &&\n\t\t\t(anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */ (anchor).data !== HYDRATION_START)\n\t\t) {\n\t\t\tanchor = /** @type {TemplateNode} */ (get_next_sibling(anchor));\n\t\t}\n\n\t\tif (!anchor) {\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(/** @type {Comment} */ (anchor));\n\n\t\tconst instance = _mount(component, { ...options, anchor });\n\n\t\tset_hydrating(false);\n\n\t\treturn /** @type {Exports} */ (instance);\n\t} catch (error) {\n\t\t// re-throw Svelte errors - they are certainly not related to hydration\n\t\tif (\n\t\t\terror instanceof Error &&\n\t\t\terror.message.split('\\n').some((line) => line.startsWith('https://svelte.dev/e/'))\n\t\t) {\n\t\t\tthrow error;\n\t\t}\n\t\tif (error !== HYDRATION_ERROR) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('Failed to hydrate: ', error);\n\t\t}\n\n\t\tif (options.recover === false) {\n\t\t\te.hydration_failed();\n\t\t}\n\n\t\t// If an error occurred above, the operations might not yet have been initialised.\n\t\tinit_operations();\n\t\tclear_text_content(target);\n\n\t\tset_hydrating(false);\n\t\treturn mount(component, options);\n\t} finally {\n\t\tset_hydrating(was_hydrating);\n\t\tset_hydrate_node(previous_hydrate_node);\n\t}\n}\n\n/** @type {Map} */\nconst document_listeners = new Map();\n\n/**\n * @template {Record} Exports\n * @param {ComponentType> | Component} Component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nfunction _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {\n\tinit_operations();\n\n\t/** @type {Set} */\n\tvar registered_events = new Set();\n\n\t/** @param {Array} events */\n\tvar event_handle = (events) => {\n\t\tfor (var i = 0; i < events.length; i++) {\n\t\t\tvar event_name = events[i];\n\n\t\t\tif (registered_events.has(event_name)) continue;\n\t\t\tregistered_events.add(event_name);\n\n\t\t\tvar passive = is_passive_event(event_name);\n\n\t\t\t// Add the event listener to both the container and the document.\n\t\t\t// The container listener ensures we catch events from within in case\n\t\t\t// the outer content stops propagation of the event.\n\t\t\ttarget.addEventListener(event_name, handle_event_propagation, { passive });\n\n\t\t\tvar n = document_listeners.get(event_name);\n\n\t\t\tif (n === undefined) {\n\t\t\t\t// The document listener ensures we catch events that originate from elements that were\n\t\t\t\t// manually moved outside of the container (e.g. via manual portals).\n\t\t\t\tdocument.addEventListener(event_name, handle_event_propagation, { passive });\n\t\t\t\tdocument_listeners.set(event_name, 1);\n\t\t\t} else {\n\t\t\t\tdocument_listeners.set(event_name, n + 1);\n\t\t\t}\n\t\t}\n\t};\n\n\tevent_handle(array_from(all_registered_events));\n\troot_event_handles.add(event_handle);\n\n\t/** @type {Exports} */\n\t// @ts-expect-error will be defined because the render effect runs synchronously\n\tvar component = undefined;\n\n\tvar unmount = component_root(() => {\n\t\tvar anchor_node = anchor ?? target.appendChild(create_text());\n\n\t\tboundary(\n\t\t\t/** @type {TemplateNode} */ (anchor_node),\n\t\t\t{\n\t\t\t\tpending: () => {}\n\t\t\t},\n\t\t\t(anchor_node) => {\n\t\t\t\tif (context) {\n\t\t\t\t\tpush({});\n\t\t\t\t\tvar ctx = /** @type {ComponentContext} */ (component_context);\n\t\t\t\t\tctx.c = context;\n\t\t\t\t}\n\n\t\t\t\tif (events) {\n\t\t\t\t\t// We can't spread the object or else we'd lose the state proxy stuff, if it is one\n\t\t\t\t\t/** @type {any} */ (props).$$events = events;\n\t\t\t\t}\n\n\t\t\t\tif (hydrating) {\n\t\t\t\t\tassign_nodes(/** @type {TemplateNode} */ (anchor_node), null);\n\t\t\t\t}\n\n\t\t\t\tshould_intro = intro;\n\t\t\t\t// @ts-expect-error the public typings are not what the actual function looks like\n\t\t\t\tcomponent = Component(anchor_node, props) || {};\n\t\t\t\tshould_intro = true;\n\n\t\t\t\tif (hydrating) {\n\t\t\t\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\thydrate_node === null ||\n\t\t\t\t\t\thydrate_node.nodeType !== COMMENT_NODE ||\n\t\t\t\t\t\t/** @type {Comment} */ (hydrate_node).data !== HYDRATION_END\n\t\t\t\t\t) {\n\t\t\t\t\t\tw.hydration_mismatch();\n\t\t\t\t\t\tthrow HYDRATION_ERROR;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (context) {\n\t\t\t\t\tpop();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tfor (var event_name of registered_events) {\n\t\t\t\ttarget.removeEventListener(event_name, handle_event_propagation);\n\n\t\t\t\tvar n = /** @type {number} */ (document_listeners.get(event_name));\n\n\t\t\t\tif (--n === 0) {\n\t\t\t\t\tdocument.removeEventListener(event_name, handle_event_propagation);\n\t\t\t\t\tdocument_listeners.delete(event_name);\n\t\t\t\t} else {\n\t\t\t\t\tdocument_listeners.set(event_name, n);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\troot_event_handles.delete(event_handle);\n\n\t\t\tif (anchor_node !== anchor) {\n\t\t\t\tanchor_node.parentNode?.removeChild(anchor_node);\n\t\t\t}\n\t\t};\n\t});\n\n\tmounted_components.set(component, unmount);\n\treturn component;\n}\n\n/**\n * References of the components that were mounted or hydrated.\n * Uses a `WeakMap` to avoid memory leaks.\n */\nlet mounted_components = new WeakMap();\n\n/**\n * Unmounts a component that was previously mounted using `mount` or `hydrate`.\n *\n * Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM.\n *\n * Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`).\n *\n * ```js\n * import { mount, unmount } from 'svelte';\n * import App from './App.svelte';\n *\n * const app = mount(App, { target: document.body });\n *\n * // later...\n * unmount(app, { outro: true });\n * ```\n * @param {Record} component\n * @param {{ outro?: boolean }} [options]\n * @returns {Promise}\n */\nexport function unmount(component, options) {\n\tconst fn = mounted_components.get(component);\n\n\tif (fn) {\n\t\tmounted_components.delete(component);\n\t\treturn fn(options);\n\t}\n\n\tif (DEV) {\n\t\tif (STATE_SYMBOL in component) {\n\t\t\tw.state_proxy_unmount();\n\t\t} else {\n\t\t\tw.lifecycle_double_unmount();\n\t\t}\n\t}\n\n\treturn Promise.resolve();\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { Batch, current_batch } from '../../reactivity/batch.js';\nimport {\n\tbranch,\n\tdestroy_effect,\n\tmove_effect,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { hydrate_node, hydrating } from '../hydration.js';\nimport { create_text, should_defer_append } from '../operations.js';\n\n/**\n * @typedef {{ effect: Effect, fragment: DocumentFragment }} Branch\n */\n\n/**\n * @template Key\n */\nexport class BranchManager {\n\t/** @type {TemplateNode} */\n\tanchor;\n\n\t/** @type {Map} */\n\t#batches = new Map();\n\n\t/**\n\t * Map of keys to effects that are currently rendered in the DOM.\n\t * These effects are visible and actively part of the document tree.\n\t * Example:\n\t * ```\n\t * {#if condition}\n\t * \tfoo\n\t * {:else}\n\t * \tbar\n\t * {/if}\n\t * ```\n\t * Can result in the entries `true->Effect` and `false->Effect`\n\t * @type {Map}\n\t */\n\t#onscreen = new Map();\n\n\t/**\n\t * Similar to #onscreen with respect to the keys, but contains branches that are not yet\n\t * in the DOM, because their insertion is deferred.\n\t * @type {Map}\n\t */\n\t#offscreen = new Map();\n\n\t/**\n\t * Keys of effects that are currently outroing\n\t * @type {Set}\n\t */\n\t#outroing = new Set();\n\n\t/**\n\t * Whether to pause (i.e. outro) on change, or destroy immediately.\n\t * This is necessary for ``\n\t */\n\t#transition = true;\n\n\t/**\n\t * @param {TemplateNode} anchor\n\t * @param {boolean} transition\n\t */\n\tconstructor(anchor, transition = true) {\n\t\tthis.anchor = anchor;\n\t\tthis.#transition = transition;\n\t}\n\n\t#commit = () => {\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\t// if this batch was made obsolete, bail\n\t\tif (!this.#batches.has(batch)) return;\n\n\t\tvar key = /** @type {Key} */ (this.#batches.get(batch));\n\n\t\tvar onscreen = this.#onscreen.get(key);\n\n\t\tif (onscreen) {\n\t\t\t// effect is already in the DOM — abort any current outro\n\t\t\tresume_effect(onscreen);\n\t\t\tthis.#outroing.delete(key);\n\t\t} else {\n\t\t\t// effect is currently offscreen. put it in the DOM\n\t\t\tvar offscreen = this.#offscreen.get(key);\n\n\t\t\tif (offscreen) {\n\t\t\t\tthis.#onscreen.set(key, offscreen.effect);\n\t\t\t\tthis.#offscreen.delete(key);\n\n\t\t\t\t// remove the anchor...\n\t\t\t\t/** @type {TemplateNode} */ (offscreen.fragment.lastChild).remove();\n\n\t\t\t\t// ...and append the fragment\n\t\t\t\tthis.anchor.before(offscreen.fragment);\n\t\t\t\tonscreen = offscreen.effect;\n\t\t\t}\n\t\t}\n\n\t\tfor (const [b, k] of this.#batches) {\n\t\t\tthis.#batches.delete(b);\n\n\t\t\tif (b === batch) {\n\t\t\t\t// keep values for newer batches\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst offscreen = this.#offscreen.get(k);\n\n\t\t\tif (offscreen) {\n\t\t\t\t// for older batches, destroy offscreen effects\n\t\t\t\t// as they will never be committed\n\t\t\t\tdestroy_effect(offscreen.effect);\n\t\t\t\tthis.#offscreen.delete(k);\n\t\t\t}\n\t\t}\n\n\t\t// outro/destroy all onscreen effects...\n\t\tfor (const [k, effect] of this.#onscreen) {\n\t\t\t// ...except the one that was just committed\n\t\t\t// or those that are already outroing (else the transition is aborted and the effect destroyed right away)\n\t\t\tif (k === key || this.#outroing.has(k)) continue;\n\n\t\t\tconst on_destroy = () => {\n\t\t\t\tconst keys = Array.from(this.#batches.values());\n\n\t\t\t\tif (keys.includes(k)) {\n\t\t\t\t\t// keep the effect offscreen, as another batch will need it\n\t\t\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\t\t\tmove_effect(effect, fragment);\n\n\t\t\t\t\tfragment.append(create_text()); // TODO can we avoid this?\n\n\t\t\t\t\tthis.#offscreen.set(k, { effect, fragment });\n\t\t\t\t} else {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t}\n\n\t\t\t\tthis.#outroing.delete(k);\n\t\t\t\tthis.#onscreen.delete(k);\n\t\t\t};\n\n\t\t\tif (this.#transition || !onscreen) {\n\t\t\t\tthis.#outroing.add(k);\n\t\t\t\tpause_effect(effect, on_destroy, false);\n\t\t\t} else {\n\t\t\t\ton_destroy();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * @param {Batch} batch\n\t */\n\t#discard = (batch) => {\n\t\tthis.#batches.delete(batch);\n\n\t\tconst keys = Array.from(this.#batches.values());\n\n\t\tfor (const [k, branch] of this.#offscreen) {\n\t\t\tif (!keys.includes(k)) {\n\t\t\t\tdestroy_effect(branch.effect);\n\t\t\t\tthis.#offscreen.delete(k);\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t *\n\t * @param {any} key\n\t * @param {null | ((target: TemplateNode) => void)} fn\n\t */\n\tensure(key, fn) {\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\t\tvar defer = should_defer_append();\n\n\t\tif (fn && !this.#onscreen.has(key) && !this.#offscreen.has(key)) {\n\t\t\tif (defer) {\n\t\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\t\tvar target = create_text();\n\n\t\t\t\tfragment.append(target);\n\n\t\t\t\tthis.#offscreen.set(key, {\n\t\t\t\t\teffect: branch(() => fn(target)),\n\t\t\t\t\tfragment\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.#onscreen.set(\n\t\t\t\t\tkey,\n\t\t\t\t\tbranch(() => fn(this.anchor))\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.#batches.set(batch, key);\n\n\t\tif (defer) {\n\t\t\tfor (const [k, effect] of this.#onscreen) {\n\t\t\t\tif (k === key) {\n\t\t\t\t\tbatch.skipped_effects.delete(effect);\n\t\t\t\t} else {\n\t\t\t\t\tbatch.skipped_effects.add(effect);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const [k, branch] of this.#offscreen) {\n\t\t\t\tif (k === key) {\n\t\t\t\t\tbatch.skipped_effects.delete(branch.effect);\n\t\t\t\t} else {\n\t\t\t\t\tbatch.skipped_effects.add(branch.effect);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbatch.oncommit(this.#commit);\n\t\t\tbatch.ondiscard(this.#discard);\n\t\t} else {\n\t\t\tif (hydrating) {\n\t\t\t\tthis.anchor = hydrate_node;\n\t\t\t}\n\n\t\t\tthis.#commit();\n\t\t}\n\t}\n}\n","/** @import { Snippet } from 'svelte' */\n/** @import { TemplateNode } from '#client' */\n/** @import { Getters } from '#shared' */\nimport { EFFECT_TRANSPARENT, ELEMENT_NODE } from '#client/constants';\nimport { block, teardown } from '../../reactivity/effects.js';\nimport {\n\tdev_current_component_function,\n\tset_dev_current_component_function\n} from '../../context.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport * as e from '../../errors.js';\nimport { DEV } from 'esm-env';\nimport { get_first_child, get_next_sibling } from '../operations.js';\nimport { prevent_snippet_stringification } from '../../../shared/validate.js';\nimport { BranchManager } from './branches.js';\n\n/**\n * @template {(node: TemplateNode, ...args: any[]) => void} SnippetFn\n * @param {TemplateNode} node\n * @param {() => SnippetFn | null | undefined} get_snippet\n * @param {(() => any)[]} args\n * @returns {void}\n */\nexport function snippet(node, get_snippet, ...args) {\n\tvar branches = new BranchManager(node);\n\n\tblock(() => {\n\t\tconst snippet = get_snippet() ?? null;\n\n\t\tif (DEV && snippet == null) {\n\t\t\te.invalid_snippet();\n\t\t}\n\n\t\tbranches.ensure(snippet, snippet && ((anchor) => snippet(anchor, ...args)));\n\t}, EFFECT_TRANSPARENT);\n}\n\n/**\n * In development, wrap the snippet function so that it passes validation, and so that the\n * correct component context is set for ownership checks\n * @param {any} component\n * @param {(node: TemplateNode, ...args: any[]) => void} fn\n */\nexport function wrap_snippet(component, fn) {\n\tconst snippet = (/** @type {TemplateNode} */ node, /** @type {any[]} */ ...args) => {\n\t\tvar previous_component_function = dev_current_component_function;\n\t\tset_dev_current_component_function(component);\n\n\t\ttry {\n\t\t\treturn fn(node, ...args);\n\t\t} finally {\n\t\t\tset_dev_current_component_function(previous_component_function);\n\t\t}\n\t};\n\n\tprevent_snippet_stringification(snippet);\n\n\treturn snippet;\n}\n\n/**\n * Create a snippet programmatically\n * @template {unknown[]} Params\n * @param {(...params: Getters) => {\n * render: () => string\n * setup?: (element: Element) => void | (() => void)\n * }} fn\n * @returns {Snippet}\n */\nexport function createRawSnippet(fn) {\n\t// @ts-expect-error the types are a lie\n\treturn (/** @type {TemplateNode} */ anchor, /** @type {Getters} */ ...params) => {\n\t\tvar snippet = fn(...params);\n\n\t\t/** @type {Element} */\n\t\tvar element;\n\n\t\tif (hydrating) {\n\t\t\telement = /** @type {Element} */ (hydrate_node);\n\t\t\thydrate_next();\n\t\t} else {\n\t\t\tvar html = snippet.render().trim();\n\t\t\tvar fragment = create_fragment_from_html(html);\n\t\t\telement = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (DEV && (get_next_sibling(element) !== null || element.nodeType !== ELEMENT_NODE)) {\n\t\t\t\tw.invalid_raw_snippet_render();\n\t\t\t}\n\n\t\t\tanchor.before(element);\n\t\t}\n\n\t\tconst result = snippet.setup?.(element);\n\t\tassign_nodes(element, element);\n\n\t\tif (typeof result === 'function') {\n\t\t\tteardown(result);\n\t\t}\n\t};\n}\n","/** @import { ComponentContext, ComponentContextLegacy } from '#client' */\n/** @import { EventDispatcher } from './index.js' */\n/** @import { NotFunction } from './internal/types.js' */\nimport { active_reaction, untrack } from './internal/client/runtime.js';\nimport { is_array } from './internal/shared/utils.js';\nimport { user_effect } from './internal/client/index.js';\nimport * as e from './internal/client/errors.js';\nimport { legacy_mode_flag } from './internal/flags/index.js';\nimport { component_context } from './internal/client/context.js';\nimport { DEV } from 'esm-env';\n\nif (DEV) {\n\t/**\n\t * @param {string} rune\n\t */\n\tfunction throw_rune_error(rune) {\n\t\tif (!(rune in globalThis)) {\n\t\t\t// TODO if people start adjusting the \"this can contain runes\" config through v-p-s more, adjust this message\n\t\t\t/** @type {any} */\n\t\t\tlet value; // let's hope noone modifies this global, but belts and braces\n\t\t\tObject.defineProperty(globalThis, rune, {\n\t\t\t\tconfigurable: true,\n\t\t\t\t// eslint-disable-next-line getter-return\n\t\t\t\tget: () => {\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\n\t\t\t\t\te.rune_outside_svelte(rune);\n\t\t\t\t},\n\t\t\t\tset: (v) => {\n\t\t\t\t\tvalue = v;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tthrow_rune_error('$state');\n\tthrow_rune_error('$effect');\n\tthrow_rune_error('$derived');\n\tthrow_rune_error('$inspect');\n\tthrow_rune_error('$props');\n\tthrow_rune_error('$bindable');\n}\n\n/**\n * Returns an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that aborts when the current [derived](https://svelte.dev/docs/svelte/$derived) or [effect](https://svelte.dev/docs/svelte/$effect) re-runs or is destroyed.\n *\n * Must be called while a derived or effect is running.\n *\n * ```svelte\n * \n * ```\n */\nexport function getAbortSignal() {\n\tif (active_reaction === null) {\n\t\te.get_abort_signal_outside_reaction();\n\t}\n\n\treturn (active_reaction.ac ??= new AbortController()).signal;\n}\n\n/**\n * `onMount`, like [`$effect`](https://svelte.dev/docs/svelte/$effect), schedules a function to run as soon as the component has been mounted to the DOM.\n * Unlike `$effect`, the provided function only runs once.\n *\n * It must be called during the component's initialisation (but doesn't need to live _inside_ the component;\n * it can be called from an external module). If a function is returned _synchronously_ from `onMount`,\n * it will be called when the component is unmounted.\n *\n * `onMount` functions do not run during [server-side rendering](https://svelte.dev/docs/svelte/svelte-server#render).\n *\n * @template T\n * @param {() => NotFunction | Promise> | (() => any)} fn\n * @returns {void}\n */\nexport function onMount(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('onMount');\n\t}\n\n\tif (legacy_mode_flag && component_context.l !== null) {\n\t\tinit_update_callbacks(component_context).m.push(fn);\n\t} else {\n\t\tuser_effect(() => {\n\t\t\tconst cleanup = untrack(fn);\n\t\t\tif (typeof cleanup === 'function') return /** @type {() => void} */ (cleanup);\n\t\t});\n\t}\n}\n\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * @param {() => any} fn\n * @returns {void}\n */\nexport function onDestroy(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('onDestroy');\n\t}\n\n\tonMount(() => () => untrack(fn));\n}\n\n/**\n * @template [T=any]\n * @param {string} type\n * @param {T} [detail]\n * @param {any}params_0\n * @returns {CustomEvent}\n */\nfunction create_custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs/svelte/legacy-on#Component-events).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * The event dispatcher can be typed to narrow the allowed event names and the type of the `detail` argument:\n * ```ts\n * const dispatch = createEventDispatcher<{\n * loaded: null; // does not take a detail argument\n * change: string; // takes a detail argument of type string, which is required\n * optional: number | null; // takes an optional detail argument of type number\n * }>();\n * ```\n *\n * @deprecated Use callback props and/or the `$host()` rune instead — see [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Event-changes-Component-events)\n * @template {Record} [EventMap = any]\n * @returns {EventDispatcher}\n */\nexport function createEventDispatcher() {\n\tconst active_component_context = component_context;\n\tif (active_component_context === null) {\n\t\te.lifecycle_outside_component('createEventDispatcher');\n\t}\n\n\t/**\n\t * @param [detail]\n\t * @param [options]\n\t */\n\treturn (type, detail, options) => {\n\t\tconst events = /** @type {Record} */ (\n\t\t\tactive_component_context.s.$$events\n\t\t)?.[/** @type {string} */ (type)];\n\n\t\tif (events) {\n\t\t\tconst callbacks = is_array(events) ? events.slice() : [events];\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = create_custom_event(/** @type {string} */ (type), detail, options);\n\t\t\tfor (const fn of callbacks) {\n\t\t\t\tfn.call(active_component_context.x, event);\n\t\t\t}\n\t\t\treturn !event.defaultPrevented;\n\t\t}\n\n\t\treturn true;\n\t};\n}\n\n// TODO mark beforeUpdate and afterUpdate as deprecated in Svelte 6\n\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`.\n *\n * In runes mode use `$effect.pre` instead.\n *\n * @deprecated Use [`$effect.pre`](https://svelte.dev/docs/svelte/$effect#$effect.pre) instead\n * @param {() => void} fn\n * @returns {void}\n */\nexport function beforeUpdate(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('beforeUpdate');\n\t}\n\n\tif (component_context.l === null) {\n\t\te.lifecycle_legacy_only('beforeUpdate');\n\t}\n\n\tinit_update_callbacks(component_context).b.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`.\n *\n * In runes mode use `$effect` instead.\n *\n * @deprecated Use [`$effect`](https://svelte.dev/docs/svelte/$effect) instead\n * @param {() => void} fn\n * @returns {void}\n */\nexport function afterUpdate(fn) {\n\tif (component_context === null) {\n\t\te.lifecycle_outside_component('afterUpdate');\n\t}\n\n\tif (component_context.l === null) {\n\t\te.lifecycle_legacy_only('afterUpdate');\n\t}\n\n\tinit_update_callbacks(component_context).a.push(fn);\n}\n\n/**\n * Legacy-mode: Init callbacks object for onMount/beforeUpdate/afterUpdate\n * @param {ComponentContext} context\n */\nfunction init_update_callbacks(context) {\n\tvar l = /** @type {ComponentContextLegacy} */ (context).l;\n\treturn (l.u ??= { a: [], b: [], m: [] });\n}\n\nexport { flushSync, fork } from './internal/client/reactivity/batch.js';\nexport {\n\tcreateContext,\n\tgetContext,\n\tgetAllContexts,\n\thasContext,\n\tsetContext\n} from './internal/client/context.js';\nexport { hydratable } from './internal/client/hydratable.js';\nexport { hydrate, mount, unmount } from './internal/client/render.js';\nexport { tick, untrack, settled } from './internal/client/runtime.js';\nexport { createRawSnippet } from './internal/client/dom/blocks/snippet.js';\n","/** @import { Action, ActionReturn } from '../action/public' */\n/** @import { Attachment } from './public' */\nimport { noop, render_effect } from 'svelte/internal/client';\nimport { ATTACHMENT_KEY } from '../constants.js';\nimport { untrack } from '../index-client.js';\nimport { teardown } from '../internal/client/reactivity/effects.js';\n\n/**\n * Creates an object key that will be recognised as an attachment when the object is spread onto an element,\n * as a programmatic alternative to using `{@attach ...}`. This can be useful for library authors, though\n * is generally not needed when building an app.\n *\n * ```svelte\n * \n *\n * \n * ```\n * @since 5.29\n */\nexport function createAttachmentKey() {\n\treturn Symbol(ATTACHMENT_KEY);\n}\n\n/**\n * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.\n * It's useful if you want to start using attachments on components but you have actions provided by a library.\n *\n * Note that the second argument, if provided, must be a function that _returns_ the argument to the\n * action function, not the argument itself.\n *\n * ```svelte\n * \n *
...
\n *\n * \n *
bar)}>...
\n * ```\n * @template {EventTarget} E\n * @template {unknown} T\n * @overload\n * @param {Action | ((element: E, arg: T) => void | ActionReturn)} action The action function\n * @param {() => T} fn A function that returns the argument for the action\n * @returns {Attachment}\n */\n/**\n * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.\n * It's useful if you want to start using attachments on components but you have actions provided by a library.\n *\n * Note that the second argument, if provided, must be a function that _returns_ the argument to the\n * action function, not the argument itself.\n *\n * ```svelte\n * \n *
...
\n *\n * \n *
bar)}>...
\n * ```\n * @template {EventTarget} E\n * @overload\n * @param {Action | ((element: E) => void | ActionReturn)} action The action function\n * @returns {Attachment}\n */\n/**\n * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.\n * It's useful if you want to start using attachments on components but you have actions provided by a library.\n *\n * Note that the second argument, if provided, must be a function that _returns_ the argument to the\n * action function, not the argument itself.\n *\n * ```svelte\n * \n *
...
\n *\n * \n *
bar)}>...
\n * ```\n *\n * @template {EventTarget} E\n * @template {unknown} T\n * @param {Action | ((element: E, arg: T) => void | ActionReturn)} action The action function\n * @param {() => T} fn A function that returns the argument for the action\n * @returns {Attachment}\n * @since 5.32\n */\nexport function fromAction(action, fn = /** @type {() => T} */ (noop)) {\n\treturn (element) => {\n\t\tconst { update, destroy } = untrack(() => action(element, fn()) ?? {});\n\n\t\tif (update) {\n\t\t\tvar ran = false;\n\t\t\trender_effect(() => {\n\t\t\t\tconst arg = fn();\n\t\t\t\tif (ran) update(arg);\n\t\t\t});\n\t\t\tran = true;\n\t\t}\n\n\t\tif (destroy) {\n\t\t\tteardown(destroy);\n\t\t}\n\t};\n}\n","/** @import { TemplateNode } from '#client' */\nimport { EFFECT_TRANSPARENT } from '#client/constants';\nimport {\n\thydrate_next,\n\thydrating,\n\tread_hydration_instruction,\n\tskip_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport { block } from '../../reactivity/effects.js';\nimport { HYDRATION_START_ELSE } from '../../../../constants.js';\nimport { BranchManager } from './branches.js';\n\n// TODO reinstate https://github.com/sveltejs/svelte/pull/15250\n\n/**\n * @param {TemplateNode} node\n * @param {(branch: (fn: (anchor: Node) => void, flag?: boolean) => void) => void} fn\n * @param {boolean} [elseif] True if this is an `{:else if ...}` block rather than an `{#if ...}`, as that affects which transitions are considered 'local'\n * @returns {void}\n */\nexport function if_block(node, fn, elseif = false) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar branches = new BranchManager(node);\n\tvar flags = elseif ? EFFECT_TRANSPARENT : 0;\n\n\t/**\n\t * @param {boolean} condition,\n\t * @param {null | ((anchor: Node) => void)} fn\n\t */\n\tfunction update_branch(condition, fn) {\n\t\tif (hydrating) {\n\t\t\tconst is_else = read_hydration_instruction(node) === HYDRATION_START_ELSE;\n\n\t\t\tif (condition === is_else) {\n\t\t\t\t// Hydration mismatch: remove everything inside the anchor and start fresh.\n\t\t\t\t// This could happen with `{#if browser}...{/if}`, for example\n\t\t\t\tvar anchor = skip_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tbranches.anchor = anchor;\n\n\t\t\t\tset_hydrating(false);\n\t\t\t\tbranches.ensure(condition, fn);\n\t\t\t\tset_hydrating(true);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tbranches.ensure(condition, fn);\n\t}\n\n\tblock(() => {\n\t\tvar has_branch = false;\n\n\t\tfn((fn, flag = true) => {\n\t\t\thas_branch = true;\n\t\t\tupdate_branch(flag, fn);\n\t\t});\n\n\t\tif (!has_branch) {\n\t\t\tupdate_branch(false, null);\n\t\t}\n\t}, flags);\n}\n","/** @import { TemplateNode } from '#client' */\nimport { is_runes } from '../../context.js';\nimport { block } from '../../reactivity/effects.js';\nimport { hydrate_next, hydrating } from '../hydration.js';\nimport { BranchManager } from './branches.js';\n\n/**\n * @template V\n * @param {TemplateNode} node\n * @param {() => V} get_key\n * @param {(anchor: Node) => TemplateNode | void} render_fn\n * @returns {void}\n */\nexport function key(node, get_key, render_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar branches = new BranchManager(node);\n\n\tvar legacy = !is_runes();\n\n\tblock(() => {\n\t\tvar key = get_key();\n\n\t\t// key blocks in Svelte <5 had stupid semantics\n\t\tif (legacy && key !== null && typeof key === 'object') {\n\t\t\tkey = /** @type {V} */ ({});\n\t\t}\n\n\t\tbranches.ensure(key, render_fn);\n\t});\n}\n","/** @import { TemplateNode } from '#client' */\nimport { render_effect, teardown } from '../../reactivity/effects.js';\nimport { hydrating, set_hydrate_node } from '../hydration.js';\nimport { get_first_child } from '../operations.js';\n\n/**\n * @param {HTMLDivElement | SVGGElement} element\n * @param {() => Record} get_styles\n * @returns {void}\n */\nexport function css_props(element, get_styles) {\n\tif (hydrating) {\n\t\tset_hydrate_node(/** @type {TemplateNode} */ (get_first_child(element)));\n\t}\n\n\trender_effect(() => {\n\t\tvar styles = get_styles();\n\n\t\tfor (var key in styles) {\n\t\t\tvar value = styles[key];\n\n\t\t\tif (value) {\n\t\t\t\telement.style.setProperty(key, value);\n\t\t\t} else {\n\t\t\t\telement.style.removeProperty(key);\n\t\t\t}\n\t\t}\n\t});\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { FILENAME, HYDRATION_ERROR } from '../../../../constants.js';\nimport { remove_effect_dom, template_effect } from '../../reactivity/effects.js';\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport { hash, sanitize_location } from '../../../../utils.js';\nimport { DEV } from 'esm-env';\nimport { dev_current_component_function } from '../../context.js';\nimport { get_first_child, get_next_sibling } from '../operations.js';\nimport { active_effect } from '../../runtime.js';\nimport { COMMENT_NODE } from '#client/constants';\n\n/**\n * @param {Element} element\n * @param {string | null} server_hash\n * @param {string} value\n */\nfunction check_hash(element, server_hash, value) {\n\tif (!server_hash || server_hash === hash(String(value ?? ''))) return;\n\n\tlet location;\n\n\t// @ts-expect-error\n\tconst loc = element.__svelte_meta?.loc;\n\tif (loc) {\n\t\tlocation = `near ${loc.file}:${loc.line}:${loc.column}`;\n\t} else if (dev_current_component_function?.[FILENAME]) {\n\t\tlocation = `in ${dev_current_component_function[FILENAME]}`;\n\t}\n\n\tw.hydration_html_changed(sanitize_location(location));\n}\n\n/**\n * @param {Element | Text | Comment} node\n * @param {() => string} get_value\n * @param {boolean} [svg]\n * @param {boolean} [mathml]\n * @param {boolean} [skip_warning]\n * @returns {void}\n */\nexport function html(node, get_value, svg = false, mathml = false, skip_warning = false) {\n\tvar anchor = node;\n\n\tvar value = '';\n\n\ttemplate_effect(() => {\n\t\tvar effect = /** @type {Effect} */ (active_effect);\n\n\t\tif (value === (value = get_value() ?? '')) {\n\t\t\tif (hydrating) hydrate_next();\n\t\t\treturn;\n\t\t}\n\n\t\tif (effect.nodes_start !== null) {\n\t\t\tremove_effect_dom(effect.nodes_start, /** @type {TemplateNode} */ (effect.nodes_end));\n\t\t\teffect.nodes_start = effect.nodes_end = null;\n\t\t}\n\n\t\tif (value === '') return;\n\n\t\tif (hydrating) {\n\t\t\t// We're deliberately not trying to repair mismatches between server and client,\n\t\t\t// as it's costly and error-prone (and it's an edge case to have a mismatch anyway)\n\t\t\tvar hash = /** @type {Comment} */ (hydrate_node).data;\n\t\t\tvar next = hydrate_next();\n\t\t\tvar last = next;\n\n\t\t\twhile (\n\t\t\t\tnext !== null &&\n\t\t\t\t(next.nodeType !== COMMENT_NODE || /** @type {Comment} */ (next).data !== '')\n\t\t\t) {\n\t\t\t\tlast = next;\n\t\t\t\tnext = /** @type {TemplateNode} */ (get_next_sibling(next));\n\t\t\t}\n\n\t\t\tif (next === null) {\n\t\t\t\tw.hydration_mismatch();\n\t\t\t\tthrow HYDRATION_ERROR;\n\t\t\t}\n\n\t\t\tif (DEV && !skip_warning) {\n\t\t\t\tcheck_hash(/** @type {Element} */ (next.parentNode), hash, value);\n\t\t\t}\n\n\t\t\tassign_nodes(hydrate_node, last);\n\t\t\tanchor = set_hydrate_node(next);\n\t\t\treturn;\n\t\t}\n\n\t\tvar html = value + '';\n\t\tif (svg) html = `${html}`;\n\t\telse if (mathml) html = `${html}`;\n\n\t\t// Don't use create_fragment_with_script_from_html here because that would mean script tags are executed.\n\t\t// @html is basically `.innerHTML = ...` and that doesn't execute scripts either due to security reasons.\n\t\t/** @type {DocumentFragment | Element} */\n\t\tvar node = create_fragment_from_html(html);\n\n\t\tif (svg || mathml) {\n\t\t\tnode = /** @type {Element} */ (get_first_child(node));\n\t\t}\n\n\t\tassign_nodes(\n\t\t\t/** @type {TemplateNode} */ (get_first_child(node)),\n\t\t\t/** @type {TemplateNode} */ (node.lastChild)\n\t\t);\n\n\t\tif (svg || mathml) {\n\t\t\twhile (get_first_child(node)) {\n\t\t\t\tanchor.before(/** @type {Node} */ (get_first_child(node)));\n\t\t\t}\n\t\t} else {\n\t\t\tanchor.before(node);\n\t\t}\n\t});\n}\n","/** @import { TemplateNode, Dom } from '#client' */\nimport { EFFECT_TRANSPARENT } from '#client/constants';\nimport { block } from '../../reactivity/effects.js';\nimport { hydrate_next, hydrating } from '../hydration.js';\nimport { BranchManager } from './branches.js';\n\n/**\n * @template P\n * @template {(props: P) => void} C\n * @param {TemplateNode} node\n * @param {() => C} get_component\n * @param {(anchor: TemplateNode, component: C) => Dom | void} render_fn\n * @returns {void}\n */\nexport function component(node, get_component, render_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar branches = new BranchManager(node);\n\n\tblock(() => {\n\t\tvar component = get_component() ?? null;\n\t\tbranches.ensure(component, component && ((target) => render_fn(target, component)));\n\t}, EFFECT_TRANSPARENT);\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { FILENAME, NAMESPACE_SVG } from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport { create_text, get_first_child } from '../operations.js';\nimport { block, teardown } from '../../reactivity/effects.js';\nimport { set_should_intro } from '../../render.js';\nimport { current_each_item, set_current_each_item } from './each.js';\nimport { active_effect } from '../../runtime.js';\nimport { component_context, dev_stack } from '../../context.js';\nimport { DEV } from 'esm-env';\nimport { EFFECT_TRANSPARENT, ELEMENT_NODE } from '#client/constants';\nimport { assign_nodes } from '../template.js';\nimport { is_raw_text_element } from '../../../../utils.js';\nimport { BranchManager } from './branches.js';\n\n/**\n * @param {Comment | Element} node\n * @param {() => string} get_tag\n * @param {boolean} is_svg\n * @param {undefined | ((element: Element, anchor: Node | null) => void)} render_fn,\n * @param {undefined | (() => string)} get_namespace\n * @param {undefined | [number, number]} location\n * @returns {void}\n */\nexport function element(node, get_tag, is_svg, render_fn, get_namespace, location) {\n\tlet was_hydrating = hydrating;\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar filename = DEV && location && component_context?.function[FILENAME];\n\n\t/** @type {null | Element} */\n\tvar element = null;\n\n\tif (hydrating && hydrate_node.nodeType === ELEMENT_NODE) {\n\t\telement = /** @type {Element} */ (hydrate_node);\n\t\thydrate_next();\n\t}\n\n\tvar anchor = /** @type {TemplateNode} */ (hydrating ? hydrate_node : node);\n\n\t/**\n\t * The keyed `{#each ...}` item block, if any, that this element is inside.\n\t * We track this so we can set it when changing the element, allowing any\n\t * `animate:` directive to bind itself to the correct block\n\t */\n\tvar each_item_block = current_each_item;\n\n\tvar branches = new BranchManager(anchor, false);\n\n\tblock(() => {\n\t\tconst next_tag = get_tag() || null;\n\t\tvar ns = get_namespace ? get_namespace() : is_svg || next_tag === 'svg' ? NAMESPACE_SVG : null;\n\n\t\tif (next_tag === null) {\n\t\t\tbranches.ensure(null, null);\n\t\t\tset_should_intro(true);\n\t\t\treturn;\n\t\t}\n\n\t\tbranches.ensure(next_tag, (anchor) => {\n\t\t\t// See explanation of `each_item_block` above\n\t\t\tvar previous_each_item = current_each_item;\n\t\t\tset_current_each_item(each_item_block);\n\n\t\t\tif (next_tag) {\n\t\t\t\telement = hydrating\n\t\t\t\t\t? /** @type {Element} */ (element)\n\t\t\t\t\t: ns\n\t\t\t\t\t\t? document.createElementNS(ns, next_tag)\n\t\t\t\t\t\t: document.createElement(next_tag);\n\n\t\t\t\tif (DEV && location) {\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\telement.__svelte_meta = {\n\t\t\t\t\t\tparent: dev_stack,\n\t\t\t\t\t\tloc: {\n\t\t\t\t\t\t\tfile: filename,\n\t\t\t\t\t\t\tline: location[0],\n\t\t\t\t\t\t\tcolumn: location[1]\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tassign_nodes(element, element);\n\n\t\t\t\tif (render_fn) {\n\t\t\t\t\tif (hydrating && is_raw_text_element(next_tag)) {\n\t\t\t\t\t\t// prevent hydration glitches\n\t\t\t\t\t\telement.append(document.createComment(''));\n\t\t\t\t\t}\n\n\t\t\t\t\t// If hydrating, use the existing ssr comment as the anchor so that the\n\t\t\t\t\t// inner open and close methods can pick up the existing nodes correctly\n\t\t\t\t\tvar child_anchor = /** @type {TemplateNode} */ (\n\t\t\t\t\t\thydrating ? get_first_child(element) : element.appendChild(create_text())\n\t\t\t\t\t);\n\n\t\t\t\t\tif (hydrating) {\n\t\t\t\t\t\tif (child_anchor === null) {\n\t\t\t\t\t\t\tset_hydrating(false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset_hydrate_node(child_anchor);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// `child_anchor` is undefined if this is a void element, but we still\n\t\t\t\t\t// need to call `render_fn` in order to run actions etc. If the element\n\t\t\t\t\t// contains children, it's a user error (which is warned on elsewhere)\n\t\t\t\t\t// and the DOM will be silently discarded\n\t\t\t\t\trender_fn(element, child_anchor);\n\t\t\t\t}\n\n\t\t\t\t// we do this after calling `render_fn` so that child effects don't override `nodes.end`\n\t\t\t\t/** @type {Effect} */ (active_effect).nodes_end = element;\n\n\t\t\t\tanchor.before(element);\n\t\t\t}\n\n\t\t\tset_current_each_item(previous_each_item);\n\n\t\t\tif (hydrating) {\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t}\n\t\t});\n\n\t\t// revert to the default state after the effect has been created\n\t\tset_should_intro(true);\n\n\t\treturn () => {\n\t\t\tif (next_tag) {\n\t\t\t\t// if we're in this callback because we're re-running the effect,\n\t\t\t\t// disable intros (unless no element is currently displayed)\n\t\t\t\tset_should_intro(false);\n\t\t\t}\n\t\t};\n\t}, EFFECT_TRANSPARENT);\n\n\tteardown(() => {\n\t\tset_should_intro(true);\n\t});\n\n\tif (was_hydrating) {\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(anchor);\n\t}\n}\n","/** @import { TemplateNode } from '#client' */\nimport { hydrate_node, hydrating, set_hydrate_node, set_hydrating } from '../hydration.js';\nimport { create_text, get_first_child, get_next_sibling } from '../operations.js';\nimport { block } from '../../reactivity/effects.js';\nimport { COMMENT_NODE, HEAD_EFFECT } from '#client/constants';\n\n/**\n * @param {string} hash\n * @param {(anchor: Node) => void} render_fn\n * @returns {void}\n */\nexport function head(hash, render_fn) {\n\t// The head function may be called after the first hydration pass and ssr comment nodes may still be present,\n\t// therefore we need to skip that when we detect that we're not in hydration mode.\n\tlet previous_hydrate_node = null;\n\tlet was_hydrating = hydrating;\n\n\t/** @type {Comment | Text} */\n\tvar anchor;\n\n\tif (hydrating) {\n\t\tprevious_hydrate_node = hydrate_node;\n\n\t\tvar head_anchor = /** @type {TemplateNode} */ (get_first_child(document.head));\n\n\t\t// There might be multiple head blocks in our app, and they could have been\n\t\t// rendered in an arbitrary order — find one corresponding to this component\n\t\twhile (\n\t\t\thead_anchor !== null &&\n\t\t\t(head_anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */ (head_anchor).data !== hash)\n\t\t) {\n\t\t\thead_anchor = /** @type {TemplateNode} */ (get_next_sibling(head_anchor));\n\t\t}\n\n\t\t// If we can't find an opening hydration marker, skip hydration (this can happen\n\t\t// if a framework rendered body but not head content)\n\t\tif (head_anchor === null) {\n\t\t\tset_hydrating(false);\n\t\t} else {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_next_sibling(head_anchor));\n\t\t\thead_anchor.remove(); // in case this component is repeated\n\n\t\t\tset_hydrate_node(start);\n\t\t}\n\t}\n\n\tif (!hydrating) {\n\t\tanchor = document.head.appendChild(create_text());\n\t}\n\n\ttry {\n\t\tblock(() => render_fn(anchor), HEAD_EFFECT);\n\t} finally {\n\t\tif (was_hydrating) {\n\t\t\tset_hydrating(true);\n\t\t\tset_hydrate_node(/** @type {TemplateNode} */ (previous_hydrate_node));\n\t\t}\n\t}\n}\n","import { DEV } from 'esm-env';\nimport { register_style } from '../dev/css.js';\nimport { effect } from '../reactivity/effects.js';\n\n/**\n * @param {Node} anchor\n * @param {{ hash: string, code: string }} css\n */\nexport function append_styles(anchor, css) {\n\t// Use `queue_micro_task` to ensure `anchor` is in the DOM, otherwise getRootNode() will yield wrong results\n\teffect(() => {\n\t\tvar root = anchor.getRootNode();\n\n\t\tvar target = /** @type {ShadowRoot} */ (root).host\n\t\t\t? /** @type {ShadowRoot} */ (root)\n\t\t\t: /** @type {Document} */ (root).head ?? /** @type {Document} */ (root.ownerDocument).head;\n\n\t\t// Always querying the DOM is roughly the same perf as additionally checking for presence in a map first assuming\n\t\t// that you'll get cache hits half of the time, so we just always query the dom for simplicity and code savings.\n\t\tif (!target.querySelector('#' + css.hash)) {\n\t\t\tconst style = document.createElement('style');\n\t\t\tstyle.id = css.hash;\n\t\t\tstyle.textContent = css.code;\n\n\t\t\ttarget.appendChild(style);\n\n\t\t\tif (DEV) {\n\t\t\t\tregister_style(css.hash, style);\n\t\t\t}\n\t\t}\n\t});\n}\n","/** @import { ActionPayload } from '#client' */\nimport { effect, render_effect } from '../../reactivity/effects.js';\nimport { safe_not_equal } from '../../reactivity/equality.js';\nimport { deep_read_state, untrack } from '../../runtime.js';\n\n/**\n * @template P\n * @param {Element} dom\n * @param {(dom: Element, value?: P) => ActionPayload

} action\n * @param {() => P} [get_value]\n * @returns {void}\n */\nexport function action(dom, action, get_value) {\n\teffect(() => {\n\t\tvar payload = untrack(() => action(dom, get_value?.()) || {});\n\n\t\tif (get_value && payload?.update) {\n\t\t\tvar inited = false;\n\t\t\t/** @type {P} */\n\t\t\tvar prev = /** @type {any} */ ({}); // initialize with something so it's never equal on first run\n\n\t\t\trender_effect(() => {\n\t\t\t\tvar value = get_value();\n\n\t\t\t\t// Action's update method is coarse-grained, i.e. when anything in the passed value changes, update.\n\t\t\t\t// This works in legacy mode because of mutable_source being updated as a whole, but when using $state\n\t\t\t\t// together with actions and mutation, it wouldn't notice the change without a deep read.\n\t\t\t\tdeep_read_state(value);\n\n\t\t\t\tif (inited && safe_not_equal(prev, value)) {\n\t\t\t\t\tprev = value;\n\t\t\t\t\t/** @type {Function} */ (payload.update)(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tinited = true;\n\t\t}\n\n\t\tif (payload?.destroy) {\n\t\t\treturn () => /** @type {Function} */ (payload.destroy)();\n\t\t}\n\t});\n}\n","/** @import { Effect } from '#client' */\nimport { branch, effect, destroy_effect, managed } from '../../reactivity/effects.js';\n\n// TODO in 6.0 or 7.0, when we remove legacy mode, we can simplify this by\n// getting rid of the block/branch stuff and just letting the effect rip.\n// see https://github.com/sveltejs/svelte/pull/15962\n\n/**\n * @param {Element} node\n * @param {() => (node: Element) => void} get_fn\n */\nexport function attach(node, get_fn) {\n\t/** @type {false | undefined | ((node: Element) => void)} */\n\tvar fn = undefined;\n\n\t/** @type {Effect | null} */\n\tvar e;\n\n\tmanaged(() => {\n\t\tif (fn !== (fn = get_fn())) {\n\t\t\tif (e) {\n\t\t\t\tdestroy_effect(e);\n\t\t\t\te = null;\n\t\t\t}\n\n\t\t\tif (fn) {\n\t\t\t\te = branch(() => {\n\t\t\t\t\teffect(() => /** @type {(node: Element) => void} */ (fn)(node));\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t` should be rendered as `

` and _not_\n * `
`, which is equivalent to `
`. There\n * may be other odd cases that need to be added to this list in future\n * @type {Record>}\n */\nconst replacements = {\n\ttranslate: new Map([\n\t\t[true, 'yes'],\n\t\t[false, 'no']\n\t])\n};\n\n/**\n * @template V\n * @param {string} name\n * @param {V} value\n * @param {boolean} [is_boolean]\n * @returns {string}\n */\nexport function attr(name, value, is_boolean = false) {\n\t// attribute hidden for values other than \"until-found\" behaves like a boolean attribute\n\tif (name === 'hidden' && value !== 'until-found') {\n\t\tis_boolean = true;\n\t}\n\tif (value == null || (!value && is_boolean)) return '';\n\tconst normalized = (name in replacements && replacements[name].get(value)) || value;\n\tconst assignment = is_boolean ? '' : `=\"${escape_html(normalized, true)}\"`;\n\treturn ` ${name}${assignment}`;\n}\n\n/**\n * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.\n * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)\n * @param {any} value\n */\nexport function clsx(value) {\n\tif (typeof value === 'object') {\n\t\treturn _clsx(value);\n\t} else {\n\t\treturn value ?? '';\n\t}\n}\n\nconst whitespace = [...' \\t\\n\\r\\f\\u00a0\\u000b\\ufeff'];\n\n/**\n * @param {any} value\n * @param {string | null} [hash]\n * @param {Record} [directives]\n * @returns {string | null}\n */\nexport function to_class(value, hash, directives) {\n\tvar classname = value == null ? '' : '' + value;\n\n\tif (hash) {\n\t\tclassname = classname ? classname + ' ' + hash : hash;\n\t}\n\n\tif (directives) {\n\t\tfor (var key in directives) {\n\t\t\tif (directives[key]) {\n\t\t\t\tclassname = classname ? classname + ' ' + key : key;\n\t\t\t} else if (classname.length) {\n\t\t\t\tvar len = key.length;\n\t\t\t\tvar a = 0;\n\n\t\t\t\twhile ((a = classname.indexOf(key, a)) >= 0) {\n\t\t\t\t\tvar b = a + len;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(a === 0 || whitespace.includes(classname[a - 1])) &&\n\t\t\t\t\t\t(b === classname.length || whitespace.includes(classname[b]))\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassname = (a === 0 ? '' : classname.substring(0, a)) + classname.substring(b + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ta = b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn classname === '' ? null : classname;\n}\n\n/**\n *\n * @param {Record} styles\n * @param {boolean} important\n */\nfunction append_styles(styles, important = false) {\n\tvar separator = important ? ' !important;' : ';';\n\tvar css = '';\n\n\tfor (var key in styles) {\n\t\tvar value = styles[key];\n\t\tif (value != null && value !== '') {\n\t\t\tcss += ' ' + key + ': ' + value + separator;\n\t\t}\n\t}\n\n\treturn css;\n}\n\n/**\n * @param {string} name\n * @returns {string}\n */\nfunction to_css_name(name) {\n\tif (name[0] !== '-' || name[1] !== '-') {\n\t\treturn name.toLowerCase();\n\t}\n\treturn name;\n}\n\n/**\n * @param {any} value\n * @param {Record | [Record, Record]} [styles]\n * @returns {string | null}\n */\nexport function to_style(value, styles) {\n\tif (styles) {\n\t\tvar new_style = '';\n\n\t\t/** @type {Record | undefined} */\n\t\tvar normal_styles;\n\n\t\t/** @type {Record | undefined} */\n\t\tvar important_styles;\n\n\t\tif (Array.isArray(styles)) {\n\t\t\tnormal_styles = styles[0];\n\t\t\timportant_styles = styles[1];\n\t\t} else {\n\t\t\tnormal_styles = styles;\n\t\t}\n\n\t\tif (value) {\n\t\t\tvalue = String(value)\n\t\t\t\t.replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g, '')\n\t\t\t\t.trim();\n\n\t\t\t/** @type {boolean | '\"' | \"'\"} */\n\t\t\tvar in_str = false;\n\t\t\tvar in_apo = 0;\n\t\t\tvar in_comment = false;\n\n\t\t\tvar reserved_names = [];\n\n\t\t\tif (normal_styles) {\n\t\t\t\treserved_names.push(...Object.keys(normal_styles).map(to_css_name));\n\t\t\t}\n\t\t\tif (important_styles) {\n\t\t\t\treserved_names.push(...Object.keys(important_styles).map(to_css_name));\n\t\t\t}\n\n\t\t\tvar start_index = 0;\n\t\t\tvar name_index = -1;\n\n\t\t\tconst len = value.length;\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tvar c = value[i];\n\n\t\t\t\tif (in_comment) {\n\t\t\t\t\tif (c === '/' && value[i - 1] === '*') {\n\t\t\t\t\t\tin_comment = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (in_str) {\n\t\t\t\t\tif (in_str === c) {\n\t\t\t\t\t\tin_str = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (c === '/' && value[i + 1] === '*') {\n\t\t\t\t\tin_comment = true;\n\t\t\t\t} else if (c === '\"' || c === \"'\") {\n\t\t\t\t\tin_str = c;\n\t\t\t\t} else if (c === '(') {\n\t\t\t\t\tin_apo++;\n\t\t\t\t} else if (c === ')') {\n\t\t\t\t\tin_apo--;\n\t\t\t\t}\n\n\t\t\t\tif (!in_comment && in_str === false && in_apo === 0) {\n\t\t\t\t\tif (c === ':' && name_index === -1) {\n\t\t\t\t\t\tname_index = i;\n\t\t\t\t\t} else if (c === ';' || i === len - 1) {\n\t\t\t\t\t\tif (name_index !== -1) {\n\t\t\t\t\t\t\tvar name = to_css_name(value.substring(start_index, name_index).trim());\n\n\t\t\t\t\t\t\tif (!reserved_names.includes(name)) {\n\t\t\t\t\t\t\t\tif (c !== ';') {\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar property = value.substring(start_index, i).trim();\n\t\t\t\t\t\t\t\tnew_style += ' ' + property + ';';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart_index = i + 1;\n\t\t\t\t\t\tname_index = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (normal_styles) {\n\t\t\tnew_style += append_styles(normal_styles);\n\t\t}\n\n\t\tif (important_styles) {\n\t\t\tnew_style += append_styles(important_styles, true);\n\t\t}\n\n\t\tnew_style = new_style.trim();\n\t\treturn new_style === '' ? null : new_style;\n\t}\n\n\treturn value == null ? null : String(value);\n}\n","import { to_class } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element} dom\n * @param {boolean | number} is_html\n * @param {string | null} value\n * @param {string} [hash]\n * @param {Record} [prev_classes]\n * @param {Record} [next_classes]\n * @returns {Record | undefined}\n */\nexport function set_class(dom, is_html, value, hash, prev_classes, next_classes) {\n\t// @ts-expect-error need to add __className to patched prototype\n\tvar prev = dom.__className;\n\n\tif (\n\t\thydrating ||\n\t\tprev !== value ||\n\t\tprev === undefined // for edge case of `class={undefined}`\n\t) {\n\t\tvar next_class_name = to_class(value, hash, next_classes);\n\n\t\tif (!hydrating || next_class_name !== dom.getAttribute('class')) {\n\t\t\t// Removing the attribute when the value is only an empty string causes\n\t\t\t// performance issues vs simply making the className an empty string. So\n\t\t\t// we should only remove the class if the value is nullish\n\t\t\t// and there no hash/directives :\n\t\t\tif (next_class_name == null) {\n\t\t\t\tdom.removeAttribute('class');\n\t\t\t} else if (is_html) {\n\t\t\t\tdom.className = next_class_name;\n\t\t\t} else {\n\t\t\t\tdom.setAttribute('class', next_class_name);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error need to add __className to patched prototype\n\t\tdom.__className = value;\n\t} else if (next_classes && prev_classes !== next_classes) {\n\t\tfor (var key in next_classes) {\n\t\t\tvar is_present = !!next_classes[key];\n\n\t\t\tif (prev_classes == null || is_present !== !!prev_classes[key]) {\n\t\t\t\tdom.classList.toggle(key, is_present);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn next_classes;\n}\n","import { to_style } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {Record} prev\n * @param {Record} next\n * @param {string} [priority]\n */\nfunction update_styles(dom, prev = {}, next, priority) {\n\tfor (var key in next) {\n\t\tvar value = next[key];\n\n\t\tif (prev[key] !== value) {\n\t\t\tif (next[key] == null) {\n\t\t\t\tdom.style.removeProperty(key);\n\t\t\t} else {\n\t\t\t\tdom.style.setProperty(key, value, priority);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {string | null} value\n * @param {Record | [Record, Record]} [prev_styles]\n * @param {Record | [Record, Record]} [next_styles]\n */\nexport function set_style(dom, value, prev_styles, next_styles) {\n\t// @ts-expect-error\n\tvar prev = dom.__style;\n\n\tif (hydrating || prev !== value) {\n\t\tvar next_style_attr = to_style(value, next_styles);\n\n\t\tif (!hydrating || next_style_attr !== dom.getAttribute('style')) {\n\t\t\tif (next_style_attr == null) {\n\t\t\t\tdom.removeAttribute('style');\n\t\t\t} else {\n\t\t\t\tdom.style.cssText = next_style_attr;\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error\n\t\tdom.__style = value;\n\t} else if (next_styles) {\n\t\tif (Array.isArray(next_styles)) {\n\t\t\tupdate_styles(dom, prev_styles?.[0], next_styles[0]);\n\t\t\tupdate_styles(dom, prev_styles?.[1], next_styles[1], 'important');\n\t\t} else {\n\t\t\tupdate_styles(dom, prev_styles, next_styles);\n\t\t}\n\t}\n\n\treturn next_styles;\n}\n","import { effect, teardown } from '../../../reactivity/effects.js';\nimport { listen_to_event_and_reset_event } from './shared.js';\nimport { is } from '../../../proxy.js';\nimport { is_array } from '../../../../shared/utils.js';\nimport * as w from '../../../warnings.js';\nimport { Batch, current_batch, previous_batch } from '../../../reactivity/batch.js';\n\n/**\n * Selects the correct option(s) (depending on whether this is a multiple select)\n * @template V\n * @param {HTMLSelectElement} select\n * @param {V} value\n * @param {boolean} mounting\n */\nexport function select_option(select, value, mounting = false) {\n\tif (select.multiple) {\n\t\t// If value is null or undefined, keep the selection as is\n\t\tif (value == undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If not an array, warn and keep the selection as is\n\t\tif (!is_array(value)) {\n\t\t\treturn w.select_multiple_invalid_value();\n\t\t}\n\n\t\t// Otherwise, update the selection\n\t\tfor (var option of select.options) {\n\t\t\toption.selected = value.includes(get_option_value(option));\n\t\t}\n\n\t\treturn;\n\t}\n\n\tfor (option of select.options) {\n\t\tvar option_value = get_option_value(option);\n\t\tif (is(option_value, value)) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (!mounting || value !== undefined) {\n\t\tselect.selectedIndex = -1; // no option should be selected\n\t}\n}\n\n/**\n * Selects the correct option(s) if `value` is given,\n * and then sets up a mutation observer to sync the\n * current selection to the dom when it changes. Such\n * changes could for example occur when options are\n * inside an `#each` block.\n * @param {HTMLSelectElement} select\n */\nexport function init_select(select) {\n\tvar observer = new MutationObserver(() => {\n\t\t// @ts-ignore\n\t\tselect_option(select, select.__value);\n\t\t// Deliberately don't update the potential binding value,\n\t\t// the model should be preserved unless explicitly changed\n\t});\n\n\tobserver.observe(select, {\n\t\t// Listen to option element changes\n\t\tchildList: true,\n\t\tsubtree: true, // because of \n\t\t// Listen to option element value attribute changes\n\t\t// (doesn't get notified of select value changes,\n\t\t// because that property is not reflected as an attribute)\n\t\tattributes: true,\n\t\tattributeFilter: ['value']\n\t});\n\n\tteardown(() => {\n\t\tobserver.disconnect();\n\t});\n}\n\n/**\n * @param {HTMLSelectElement} select\n * @param {() => unknown} get\n * @param {(value: unknown) => void} set\n * @returns {void}\n */\nexport function bind_select_value(select, get, set = get) {\n\tvar batches = new WeakSet();\n\tvar mounting = true;\n\n\tlisten_to_event_and_reset_event(select, 'change', (is_reset) => {\n\t\tvar query = is_reset ? '[selected]' : ':checked';\n\t\t/** @type {unknown} */\n\t\tvar value;\n\n\t\tif (select.multiple) {\n\t\t\tvalue = [].map.call(select.querySelectorAll(query), get_option_value);\n\t\t} else {\n\t\t\t/** @type {HTMLOptionElement | null} */\n\t\t\tvar selected_option =\n\t\t\t\tselect.querySelector(query) ??\n\t\t\t\t// will fall back to first non-disabled option if no option is selected\n\t\t\t\tselect.querySelector('option:not([disabled])');\n\t\t\tvalue = selected_option && get_option_value(selected_option);\n\t\t}\n\n\t\tset(value);\n\n\t\tif (current_batch !== null) {\n\t\t\tbatches.add(current_batch);\n\t\t}\n\t});\n\n\t// Needs to be an effect, not a render_effect, so that in case of each loops the logic runs after the each block has updated\n\teffect(() => {\n\t\tvar value = get();\n\n\t\tif (select === document.activeElement) {\n\t\t\t// we need both, because in non-async mode, render effects run before previous_batch is set\n\t\t\tvar batch = /** @type {Batch} */ (previous_batch ?? current_batch);\n\n\t\t\t// Don't update the ...\n\t\t\t//

{await find(selected)}

\n\t\t\tif (batches.has(batch)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tselect_option(select, value, mounting);\n\n\t\t// Mounting and value undefined -> take selection from dom\n\t\tif (mounting && value === undefined) {\n\t\t\t/** @type {HTMLOptionElement | null} */\n\t\t\tvar selected_option = select.querySelector(':checked');\n\t\t\tif (selected_option !== null) {\n\t\t\t\tvalue = get_option_value(selected_option);\n\t\t\t\tset(value);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-ignore\n\t\tselect.__value = value;\n\t\tmounting = false;\n\t});\n\n\tinit_select(select);\n}\n\n/** @param {HTMLOptionElement} option */\nfunction get_option_value(option) {\n\t// __value only exists if the
\n","\n\n\n{data?.label}\n\n","\n\n{data?.label}\n\n","\n\n{data?.label}\n\n","\n","import { useStore } from '../../store';\nfunction tryToMount(node, domNode, target) {\n if (!target || !domNode) {\n return;\n }\n const targetEl = target === 'root' ? domNode : domNode.querySelector(`.svelte-flow__${target}`);\n if (targetEl) {\n targetEl.appendChild(node);\n }\n}\nexport function portal(node, target) {\n const { domNode } = $derived(useStore());\n let destroyEffect;\n // svelte-ignore state_referenced_locally\n if (domNode) {\n // if the domNode is already mounted, we can directly try to mount the node\n tryToMount(node, domNode, target);\n }\n else {\n // if the domNode is not mounted yet, we need to wait for it to be ready\n destroyEffect = $effect.root(() => {\n $effect(() => {\n tryToMount(node, domNode, target);\n destroyEffect?.();\n });\n });\n }\n return {\n async update(target) {\n tryToMount(node, domNode, target);\n },\n destroy() {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n destroyEffect?.();\n }\n };\n}\n","export function hideOnSSR() {\n let hide = $state(typeof window === 'undefined');\n if (hide) {\n const destroyEffect = $effect.root(() => {\n $effect(() => {\n hide = false;\n destroyEffect?.();\n });\n });\n }\n return {\n get value() {\n return hide;\n }\n };\n}\n","import { isNodeBase, isEdgeBase } from '@xyflow/system';\n/**\n * Test whether an object is usable as a Node\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Node\n */\nexport const isNode = (element) => isNodeBase(element);\n/**\n * Test whether an object is usable as an Edge\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Edge\n */\nexport const isEdge = (element) => isEdgeBase(element);\nexport function toPxString(value) {\n return value === undefined ? undefined : `${value}px`;\n}\nexport const arrowKeyDiffs = {\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 },\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 }\n};\n","\n\n {\n if (selectEdgeOnClick) store.handleEdgeSelection(edgeId);\n }}\n {...rest}\n>\n {@render children?.()}\n
\n\n\n","\n\n\n\n{#if interactionWidth > 0}\n \n{/if}\n\n{#if label}\n \n {label}\n \n{/if}\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport { set, source, state, increment } from '../internal/client/reactivity/sources.js';\nimport { label, tag } from '../internal/client/dev/tracing.js';\nimport { get, update_version } from '../internal/client/runtime.js';\n\n/**\n * A reactive version of the built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) object.\n * Reading contents of the map (by iterating, or by reading `map.size` or calling `map.get(...)` or `map.has(...)` as in the [tic-tac-toe example](https://svelte.dev/playground/0b0ff4aa49c9443f9b47fe5203c78293) below) in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)\n * will cause it to be re-evaluated as necessary when the map is updated.\n *\n * Note that values in a reactive map are _not_ made [deeply reactive](https://svelte.dev/docs/svelte/$state#Deep-state).\n *\n * ```svelte\n * \n *\n *
\n * \t{#each Array(9), i}\n * \t\t {\n * \t\t\t\tboard.set(i, player);\n * \t\t\t\tplayer = player === 'x' ? 'o' : 'x';\n * \t\t\t}}\n * \t\t>{board.get(i)}\n * \t{/each}\n *
\n *\n * {#if winner}\n * \t

{winner} wins!

\n * \t\n * {:else}\n * \t

{player} is next

\n * {/if}\n * ```\n *\n * @template K\n * @template V\n * @extends {Map}\n */\nexport class SvelteMap extends Map {\n\t/** @type {Map>} */\n\t#sources = new Map();\n\t#version = state(0);\n\t#size = state(0);\n\t#update_version = update_version || -1;\n\n\t/**\n\t * @param {Iterable | null | undefined} [value]\n\t */\n\tconstructor(value) {\n\t\tsuper();\n\n\t\tif (DEV) {\n\t\t\t// If the value is invalid then the native exception will fire here\n\t\t\tvalue = new Map(value);\n\n\t\t\ttag(this.#version, 'SvelteMap version');\n\t\t\ttag(this.#size, 'SvelteMap.size');\n\t\t}\n\n\t\tif (value) {\n\t\t\tfor (var [key, v] of value) {\n\t\t\t\tsuper.set(key, v);\n\t\t\t}\n\t\t\tthis.#size.v = super.size;\n\t\t}\n\t}\n\n\t/**\n\t * If the source is being created inside the same reaction as the SvelteMap instance,\n\t * we use `state` so that it will not be a dependency of the reaction. Otherwise we\n\t * use `source` so it will be.\n\t *\n\t * @template T\n\t * @param {T} value\n\t * @returns {Source}\n\t */\n\t#source(value) {\n\t\treturn update_version === this.#update_version ? state(value) : source(value);\n\t}\n\n\t/** @param {K} key */\n\thas(key) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\n\t\tif (s === undefined) {\n\t\t\tvar ret = super.get(key);\n\t\t\tif (ret !== undefined) {\n\t\t\t\ts = this.#source(0);\n\n\t\t\t\tif (DEV) {\n\t\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t\t}\n\n\t\t\t\tsources.set(key, s);\n\t\t\t} else {\n\t\t\t\t// We should always track the version in case\n\t\t\t\t// the Set ever gets this value in the future.\n\t\t\t\tget(this.#version);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tget(s);\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param {(value: V, key: K, map: Map) => void} callbackfn\n\t * @param {any} [this_arg]\n\t */\n\tforEach(callbackfn, this_arg) {\n\t\tthis.#read_all();\n\t\tsuper.forEach(callbackfn, this_arg);\n\t}\n\n\t/** @param {K} key */\n\tget(key) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\n\t\tif (s === undefined) {\n\t\t\tvar ret = super.get(key);\n\t\t\tif (ret !== undefined) {\n\t\t\t\ts = this.#source(0);\n\n\t\t\t\tif (DEV) {\n\t\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t\t}\n\n\t\t\t\tsources.set(key, s);\n\t\t\t} else {\n\t\t\t\t// We should always track the version in case\n\t\t\t\t// the Set ever gets this value in the future.\n\t\t\t\tget(this.#version);\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\tget(s);\n\t\treturn super.get(key);\n\t}\n\n\t/**\n\t * @param {K} key\n\t * @param {V} value\n\t * */\n\tset(key, value) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\t\tvar prev_res = super.get(key);\n\t\tvar res = super.set(key, value);\n\t\tvar version = this.#version;\n\n\t\tif (s === undefined) {\n\t\t\ts = this.#source(0);\n\n\t\t\tif (DEV) {\n\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t}\n\n\t\t\tsources.set(key, s);\n\t\t\tset(this.#size, super.size);\n\t\t\tincrement(version);\n\t\t} else if (prev_res !== value) {\n\t\t\tincrement(s);\n\n\t\t\t// if not every reaction of s is a reaction of version we need to also include version\n\t\t\tvar v_reactions = version.reactions === null ? null : new Set(version.reactions);\n\t\t\tvar needs_version_increase =\n\t\t\t\tv_reactions === null ||\n\t\t\t\t!s.reactions?.every((r) =>\n\t\t\t\t\t/** @type {NonNullable} */ (v_reactions).has(r)\n\t\t\t\t);\n\t\t\tif (needs_version_increase) {\n\t\t\t\tincrement(version);\n\t\t\t}\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t/** @param {K} key */\n\tdelete(key) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\t\tvar res = super.delete(key);\n\n\t\tif (s !== undefined) {\n\t\t\tsources.delete(key);\n\t\t\tset(this.#size, super.size);\n\t\t\tset(s, -1);\n\t\t\tincrement(this.#version);\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tclear() {\n\t\tif (super.size === 0) {\n\t\t\treturn;\n\t\t}\n\t\t// Clear first, so we get nice console.log outputs with $inspect\n\t\tsuper.clear();\n\t\tvar sources = this.#sources;\n\t\tset(this.#size, 0);\n\t\tfor (var s of sources.values()) {\n\t\t\tset(s, -1);\n\t\t}\n\t\tincrement(this.#version);\n\t\tsources.clear();\n\t}\n\n\t#read_all() {\n\t\tget(this.#version);\n\n\t\tvar sources = this.#sources;\n\t\tif (this.#size.v !== sources.size) {\n\t\t\tfor (var key of super.keys()) {\n\t\t\t\tif (!sources.has(key)) {\n\t\t\t\t\tvar s = this.#source(0);\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t\t\t}\n\n\t\t\t\t\tsources.set(key, s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor ([, s] of this.#sources) {\n\t\t\tget(s);\n\t\t}\n\t}\n\n\tkeys() {\n\t\tget(this.#version);\n\t\treturn super.keys();\n\t}\n\n\tvalues() {\n\t\tthis.#read_all();\n\t\treturn super.values();\n\t}\n\n\tentries() {\n\t\tthis.#read_all();\n\t\treturn super.entries();\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n\n\tget size() {\n\t\tget(this.#size);\n\t\treturn super.size;\n\t}\n}\n","import { createSubscriber } from './create-subscriber.js';\n\n/**\n * @template T\n */\nexport class ReactiveValue {\n\t#fn;\n\t#subscribe;\n\n\t/**\n\t *\n\t * @param {() => T} fn\n\t * @param {(update: () => void) => void} onsubscribe\n\t */\n\tconstructor(fn, onsubscribe) {\n\t\tthis.#fn = fn;\n\t\tthis.#subscribe = createSubscriber(onsubscribe);\n\t}\n\n\tget current() {\n\t\tthis.#subscribe();\n\t\treturn this.#fn();\n\t}\n}\n","import { on } from '../events/index.js';\nimport { ReactiveValue } from './reactive-value.js';\n\nconst parenthesis_regex = /\\(.+\\)/;\n\n// these keywords are valid media queries but they need to be without parenthesis\n//\n// eg: new MediaQuery('screen')\n//\n// however because of the auto-parenthesis logic in the constructor since there's no parentehesis\n// in the media query they'll be surrounded by parenthesis\n//\n// however we can check if the media query is only composed of these keywords\n// and skip the auto-parenthesis\n//\n// https://github.com/sveltejs/svelte/issues/15930\nconst non_parenthesized_keywords = new Set(['all', 'print', 'screen', 'and', 'or', 'not', 'only']);\n\n/**\n * Creates a media query and provides a `current` property that reflects whether or not it matches.\n *\n * Use it carefully — during server-side rendering, there is no way to know what the correct value should be, potentially causing content to change upon hydration.\n * If you can use the media query in CSS to achieve the same effect, do that.\n *\n * ```svelte\n * \n *\n *

{large.current ? 'large screen' : 'small screen'}

\n * ```\n * @extends {ReactiveValue}\n * @since 5.7.0\n */\nexport class MediaQuery extends ReactiveValue {\n\t/**\n\t * @param {string} query A media query string\n\t * @param {boolean} [fallback] Fallback value for the server\n\t */\n\tconstructor(query, fallback) {\n\t\tlet final_query =\n\t\t\tparenthesis_regex.test(query) ||\n\t\t\t// we need to use `some` here because technically this `window.matchMedia('random,screen')` still returns true\n\t\t\tquery.split(/[\\s,]+/).some((keyword) => non_parenthesized_keywords.has(keyword.trim()))\n\t\t\t\t? query\n\t\t\t\t: `(${query})`;\n\t\tconst q = window.matchMedia(final_query);\n\t\tsuper(\n\t\t\t() => q.matches,\n\t\t\t(update) => on(q, 'change', update)\n\t\t);\n\t}\n}\n","import { ConnectionMode, getEdgePosition, getElevatedEdgeZIndex, getNodesInside, isEdgeVisible } from '@xyflow/system';\nexport function getVisibleNodes(nodeLookup, transform, width, height) {\n const visibleNodes = new Map();\n getNodesInside(nodeLookup, { x: 0, y: 0, width: width, height: height }, transform, true).forEach((node) => {\n visibleNodes.set(node.id, node);\n });\n return visibleNodes;\n}\nexport function getLayoutedEdges(options) {\n const { edges, defaultEdgeOptions, nodeLookup, previousEdges, connectionMode, onerror, onlyRenderVisible, elevateEdgesOnSelect } = options;\n const layoutedEdges = new Map();\n for (const edge of edges) {\n const sourceNode = nodeLookup.get(edge.source);\n const targetNode = nodeLookup.get(edge.target);\n if (!sourceNode || !targetNode) {\n continue;\n }\n if (onlyRenderVisible) {\n const { visibleNodes, transform, width, height } = options;\n if (isEdgeVisible({\n sourceNode,\n targetNode,\n width: width,\n height: height,\n transform: transform\n })) {\n visibleNodes.set(sourceNode.id, sourceNode);\n visibleNodes.set(targetNode.id, targetNode);\n }\n else {\n continue;\n }\n }\n // we reuse the previous edge object if\n // the current and previous edge are the same\n // and the source and target node are the same\n // and references to internalNodes are the same\n const previous = previousEdges.get(edge.id);\n if (previous &&\n edge === previous.edge &&\n sourceNode == previous.sourceNode &&\n targetNode == previous.targetNode) {\n layoutedEdges.set(edge.id, previous);\n continue;\n }\n const edgePosition = getEdgePosition({\n id: edge.id,\n sourceNode,\n targetNode,\n sourceHandle: edge.sourceHandle || null,\n targetHandle: edge.targetHandle || null,\n connectionMode,\n onError: onerror\n });\n if (edgePosition) {\n layoutedEdges.set(edge.id, {\n ...defaultEdgeOptions,\n ...edge,\n ...edgePosition,\n zIndex: getElevatedEdgeZIndex({\n selected: edge.selected,\n zIndex: edge.zIndex ?? defaultEdgeOptions.zIndex,\n sourceNode,\n targetNode,\n elevateOnSelect: elevateEdgesOnSelect\n }),\n sourceNode,\n targetNode,\n edge\n });\n }\n }\n return layoutedEdges;\n}\n","/* eslint-disable svelte/prefer-svelte-reactivity */\nimport { infiniteExtent, SelectionMode, ConnectionMode, devWarn, adoptUserNodes, getViewportForBounds, updateConnectionLookup, initialConnection, mergeAriaLabelConfig, getInternalNodesBounds, createMarkerIds, pointToRendererPoint, fitViewport } from '@xyflow/system';\nimport DefaultNode from '../components/nodes/DefaultNode.svelte';\nimport InputNode from '../components/nodes/InputNode.svelte';\nimport OutputNode from '../components/nodes/OutputNode.svelte';\nimport GroupNode from '../components/nodes/GroupNode.svelte';\nimport { BezierEdgeInternal, SmoothStepEdgeInternal, StraightEdgeInternal, StepEdgeInternal } from '../components/edges';\nimport { MediaQuery } from 'svelte/reactivity';\nimport { getLayoutedEdges, getVisibleNodes } from './visibleElements';\nexport const initialNodeTypes = {\n input: InputNode,\n output: OutputNode,\n default: DefaultNode,\n group: GroupNode\n};\nexport const initialEdgeTypes = {\n straight: StraightEdgeInternal,\n smoothstep: SmoothStepEdgeInternal,\n default: BezierEdgeInternal,\n step: StepEdgeInternal\n};\nfunction getInitialViewport(\n// This is just used to make sure adoptUserNodes is called before we calculate the viewport\n_nodesInitialized, fitView, initialViewport, width, height, nodeLookup) {\n if (fitView && !initialViewport && width && height) {\n const bounds = getInternalNodesBounds(nodeLookup, {\n filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight))\n });\n return getViewportForBounds(bounds, width, height, 0.5, 2, 0.1);\n }\n else {\n return initialViewport ?? { x: 0, y: 0, zoom: 1 };\n }\n}\nexport function getInitialStore(signals) {\n // We use a class here, because Svelte adds getters & setter for us.\n // Inline classes have some performance implications but we just call it once (max twice).\n class SvelteFlowStore {\n flowId = $derived(signals.props.id ?? '1');\n domNode = $state.raw(null);\n panZoom = $state.raw(null);\n width = $state.raw(signals.width ?? 0);\n height = $state.raw(signals.height ?? 0);\n nodesInitialized = $derived.by(() => {\n const nodesInitialized = adoptUserNodes(signals.nodes, this.nodeLookup, this.parentLookup, {\n nodeExtent: this.nodeExtent,\n nodeOrigin: this.nodeOrigin,\n elevateNodesOnSelect: signals.props.elevateNodesOnSelect ?? true,\n checkEquality: true\n });\n if (this.fitViewQueued && nodesInitialized) {\n if (this.fitViewOptions?.duration) {\n this.resolveFitView();\n }\n else {\n /**\n * When no duration is set, viewport is set immediately which prevents an update\n * I do not understand why, however we are setting state in a derived which is a no-go\n */\n queueMicrotask(() => {\n this.resolveFitView();\n });\n }\n }\n return nodesInitialized;\n });\n viewportInitialized = $derived(this.panZoom !== null);\n _edges = $derived.by(() => {\n updateConnectionLookup(this.connectionLookup, this.edgeLookup, signals.edges);\n return signals.edges;\n });\n get nodes() {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n this.nodesInitialized;\n return signals.nodes;\n }\n set nodes(nodes) {\n signals.nodes = nodes;\n }\n get edges() {\n return this._edges;\n }\n set edges(edges) {\n signals.edges = edges;\n }\n _prevSelectedNodes = [];\n _prevSelectedNodeIds = new Set();\n selectedNodes = $derived.by(() => {\n const selectedNodesCount = this._prevSelectedNodeIds.size;\n const selectedNodeIds = new Set();\n const selectedNodes = this.nodes.filter((node) => {\n if (node.selected) {\n selectedNodeIds.add(node.id);\n this._prevSelectedNodeIds.delete(node.id);\n }\n return node.selected;\n });\n // Either the number of selected nodes has changed or two nodes changed their selection state\n // at the same time. However then the previously selected node will be inside _prevSelectedNodeIds\n if (selectedNodesCount !== selectedNodeIds.size || this._prevSelectedNodeIds.size > 0) {\n this._prevSelectedNodes = selectedNodes;\n }\n this._prevSelectedNodeIds = selectedNodeIds;\n return this._prevSelectedNodes;\n });\n _prevSelectedEdges = [];\n _prevSelectedEdgeIds = new Set();\n selectedEdges = $derived.by(() => {\n const selectedEdgesCount = this._prevSelectedEdgeIds.size;\n const selectedEdgeIds = new Set();\n const selectedEdges = this.edges.filter((edge) => {\n if (edge.selected) {\n selectedEdgeIds.add(edge.id);\n this._prevSelectedEdgeIds.delete(edge.id);\n }\n return edge.selected;\n });\n // Either the number of selected edges has changed or two edges changed their selection state\n // at the same time. However then the previously selected edge will be inside _prevSelectedEdgeIds\n if (selectedEdgesCount !== selectedEdgeIds.size || this._prevSelectedEdgeIds.size > 0) {\n this._prevSelectedEdges = selectedEdges;\n }\n this._prevSelectedEdgeIds = selectedEdgeIds;\n return this._prevSelectedEdges;\n });\n selectionChangeHandlers = new Map();\n nodeLookup = new Map();\n parentLookup = new Map();\n connectionLookup = new Map();\n edgeLookup = new Map();\n _prevVisibleEdges = new Map();\n visible = $derived.by(() => {\n const { \n // We need to access this._nodes to trigger on changes\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n nodes, _edges: edges, _prevVisibleEdges: previousEdges, nodeLookup, connectionMode, onerror, onlyRenderVisibleElements, defaultEdgeOptions } = this;\n let visibleNodes;\n let visibleEdges;\n const options = {\n edges,\n defaultEdgeOptions,\n previousEdges,\n nodeLookup,\n connectionMode,\n elevateEdgesOnSelect: signals.props.elevateEdgesOnSelect ?? true,\n onerror\n };\n if (onlyRenderVisibleElements) {\n // We only subscribe to viewport, width, height if onlyRenderVisibleElements is true\n const { viewport, width, height } = this;\n const transform = [viewport.x, viewport.y, viewport.zoom];\n visibleNodes = getVisibleNodes(nodeLookup, transform, width, height);\n visibleEdges = getLayoutedEdges({\n ...options,\n onlyRenderVisible: true,\n visibleNodes,\n transform,\n width,\n height\n });\n }\n else {\n visibleNodes = this.nodeLookup;\n visibleEdges = getLayoutedEdges(options);\n }\n return {\n nodes: visibleNodes,\n edges: visibleEdges\n };\n });\n nodesDraggable = $derived(signals.props.nodesDraggable ?? true);\n nodesConnectable = $derived(signals.props.nodesConnectable ?? true);\n elementsSelectable = $derived(signals.props.elementsSelectable ?? true);\n nodesFocusable = $derived(signals.props.nodesFocusable ?? true);\n edgesFocusable = $derived(signals.props.edgesFocusable ?? true);\n disableKeyboardA11y = $derived(signals.props.disableKeyboardA11y ?? false);\n minZoom = $derived(signals.props.minZoom ?? 0.5);\n maxZoom = $derived(signals.props.maxZoom ?? 2);\n nodeOrigin = $derived(signals.props.nodeOrigin ?? [0, 0]);\n nodeExtent = $derived(signals.props.nodeExtent ?? infiniteExtent);\n translateExtent = $derived(signals.props.translateExtent ?? infiniteExtent);\n defaultEdgeOptions = $derived(signals.props.defaultEdgeOptions ?? {});\n nodeDragThreshold = $derived(signals.props.nodeDragThreshold ?? 1);\n autoPanOnNodeDrag = $derived(signals.props.autoPanOnNodeDrag ?? true);\n autoPanOnConnect = $derived(signals.props.autoPanOnConnect ?? true);\n autoPanOnNodeFocus = $derived(signals.props.autoPanOnNodeFocus ?? true);\n autoPanSpeed = $derived(signals.props.autoPanSpeed ?? 15);\n connectionDragThreshold = $derived(signals.props.connectionDragThreshold ?? 1);\n fitViewQueued = signals.props.fitView ?? false;\n fitViewOptions = signals.props.fitViewOptions;\n fitViewResolver = null;\n snapGrid = $derived(signals.props.snapGrid ?? null);\n dragging = $state.raw(false);\n selectionRect = $state.raw(null);\n selectionKeyPressed = $state.raw(false);\n multiselectionKeyPressed = $state.raw(false);\n deleteKeyPressed = $state.raw(false);\n panActivationKeyPressed = $state.raw(false);\n zoomActivationKeyPressed = $state.raw(false);\n selectionRectMode = $state.raw(null);\n ariaLiveMessage = $state.raw('');\n selectionMode = $derived(signals.props.selectionMode ?? SelectionMode.Partial);\n nodeTypes = $derived({ ...initialNodeTypes, ...signals.props.nodeTypes });\n edgeTypes = $derived({ ...initialEdgeTypes, ...signals.props.edgeTypes });\n noPanClass = $derived(signals.props.noPanClass ?? 'nopan');\n noDragClass = $derived(signals.props.noDragClass ?? 'nodrag');\n noWheelClass = $derived(signals.props.noWheelClass ?? 'nowheel');\n ariaLabelConfig = $derived(mergeAriaLabelConfig(signals.props.ariaLabelConfig));\n // _viewport is the internal viewport.\n // when binding to viewport, we operate on signals.viewport instead\n _viewport = $state.raw(getInitialViewport(this.nodesInitialized, signals.props.fitView, signals.props.initialViewport, this.width, this.height, this.nodeLookup));\n get viewport() {\n return signals.viewport ?? this._viewport;\n }\n set viewport(newViewport) {\n if (signals.viewport) {\n signals.viewport = newViewport;\n }\n this._viewport = newViewport;\n }\n // _connection is viewport independent and originating from XYHandle\n _connection = $state.raw(initialConnection);\n // We derive a viewport dependent connection here\n connection = $derived.by(() => {\n if (!this._connection.inProgress) {\n return this._connection;\n }\n return {\n ...this._connection,\n to: pointToRendererPoint(this._connection.to, [\n this.viewport.x,\n this.viewport.y,\n this.viewport.zoom\n ])\n };\n });\n connectionMode = $derived(signals.props.connectionMode ?? ConnectionMode.Strict);\n connectionRadius = $derived(signals.props.connectionRadius ?? 20);\n isValidConnection = $derived(signals.props.isValidConnection ?? (() => true));\n selectNodesOnDrag = $derived(signals.props.selectNodesOnDrag ?? true);\n defaultMarkerColor = $derived(signals.props.defaultMarkerColor === undefined ? '#b1b1b7' : signals.props.defaultMarkerColor);\n markers = $derived.by(() => {\n return createMarkerIds(signals.edges, {\n defaultColor: this.defaultMarkerColor,\n id: this.flowId,\n defaultMarkerStart: this.defaultEdgeOptions.markerStart,\n defaultMarkerEnd: this.defaultEdgeOptions.markerEnd\n });\n });\n onlyRenderVisibleElements = $derived(signals.props.onlyRenderVisibleElements ?? false);\n onerror = $derived(signals.props.onflowerror ?? devWarn);\n ondelete = $derived(signals.props.ondelete);\n onbeforedelete = $derived(signals.props.onbeforedelete);\n onbeforeconnect = $derived(signals.props.onbeforeconnect);\n onconnect = $derived(signals.props.onconnect);\n onconnectstart = $derived(signals.props.onconnectstart);\n onconnectend = $derived(signals.props.onconnectend);\n onbeforereconnect = $derived(signals.props.onbeforereconnect);\n onreconnect = $derived(signals.props.onreconnect);\n onreconnectstart = $derived(signals.props.onreconnectstart);\n onreconnectend = $derived(signals.props.onreconnectend);\n clickConnect = $derived(signals.props.clickConnect ?? true);\n onclickconnectstart = $derived(signals.props.onclickconnectstart);\n onclickconnectend = $derived(signals.props.onclickconnectend);\n clickConnectStartHandle = $state.raw(null);\n onselectiondrag = $derived(signals.props.onselectiondrag);\n onselectiondragstart = $derived(signals.props.onselectiondragstart);\n onselectiondragstop = $derived(signals.props.onselectiondragstop);\n resolveFitView = async () => {\n if (!this.panZoom) {\n return;\n }\n await fitViewport({\n nodes: this.nodeLookup,\n width: this.width,\n height: this.height,\n panZoom: this.panZoom,\n minZoom: this.minZoom,\n maxZoom: this.maxZoom\n }, this.fitViewOptions);\n this.fitViewResolver?.resolve(true);\n /**\n * wait for the fitViewport to resolve before deleting the resolver,\n * we want to reuse the old resolver if the user calls fitView again in the mean time\n */\n this.fitViewQueued = false;\n this.fitViewOptions = undefined;\n this.fitViewResolver = null;\n };\n _prefersDark = new MediaQuery('(prefers-color-scheme: dark)', signals.props.colorModeSSR === 'dark');\n colorMode = $derived(signals.props.colorMode === 'system'\n ? this._prefersDark.current\n ? 'dark'\n : 'light'\n : (signals.props.colorMode ?? 'light'));\n constructor() {\n if (process.env.NODE_ENV === 'development') {\n warnIfDeeplyReactive(signals.nodes, 'nodes');\n warnIfDeeplyReactive(signals.edges, 'edges');\n }\n }\n resetStoreValues() {\n this.dragging = false;\n this.selectionRect = null;\n this.selectionRectMode = null;\n this.selectionKeyPressed = false;\n this.multiselectionKeyPressed = false;\n this.deleteKeyPressed = false;\n this.panActivationKeyPressed = false;\n this.zoomActivationKeyPressed = false;\n this._connection = initialConnection;\n this.clickConnectStartHandle = null;\n this.viewport = signals.props.initialViewport ?? { x: 0, y: 0, zoom: 1 };\n this.ariaLiveMessage = '';\n }\n }\n return new SvelteFlowStore();\n}\n// Only way to check if an object is a proxy\n// is to see if is failes to perform a structured clone\nfunction warnIfDeeplyReactive(array, name) {\n try {\n if (array && array.length > 0) {\n structuredClone(array[0]);\n }\n }\n catch {\n console.warn(`Use $state.raw for ${name} to prevent performance issues.`);\n }\n}\n/* eslint-enable svelte/prefer-svelte-reactivity */\n","import { getContext } from 'svelte';\nimport { key } from '../store';\nimport { derivedWarning } from './derivedWarning.svelte';\nexport function useStore() {\n const storeContext = getContext(key);\n if (!storeContext) {\n throw new Error('To call useStore outside of you need to wrap your component in a ');\n }\n if (process.env.NODE_ENV === 'development') {\n derivedWarning('useStore');\n }\n return storeContext.getStore();\n}\n","import { panBy as panBySystem, updateNodeInternals as updateNodeInternalsSystem, addEdge as addEdgeUtil, initialConnection, errorMessages, updateAbsolutePositions, snapPosition, calculateNodePosition } from '@xyflow/system';\nimport { initialEdgeTypes, initialNodeTypes, getInitialStore } from './initial-store.svelte';\nimport {} from './types';\nexport const key = Symbol();\nexport { useStore } from '../hooks/useStore';\nexport function createStore(signals) {\n const store = getInitialStore(signals);\n function setNodeTypes(nodeTypes) {\n store.nodeTypes = {\n ...initialNodeTypes,\n ...nodeTypes\n };\n }\n function setEdgeTypes(edgeTypes) {\n store.edgeTypes = {\n ...initialEdgeTypes,\n ...edgeTypes\n };\n }\n function addEdge(edgeParams) {\n store.edges = addEdgeUtil(edgeParams, store.edges);\n }\n const updateNodePositions = (nodeDragItems, dragging = false) => {\n store.nodes = store.nodes.map((node) => {\n const dragItem = nodeDragItems.get(node.id);\n return dragItem ? { ...node, position: dragItem.position, dragging } : node;\n });\n };\n function updateNodeInternals(updates) {\n const { changes, updatedInternals } = updateNodeInternalsSystem(updates, store.nodeLookup, store.parentLookup, store.domNode, store.nodeOrigin);\n if (!updatedInternals) {\n return;\n }\n updateAbsolutePositions(store.nodeLookup, store.parentLookup, {\n nodeOrigin: store.nodeOrigin,\n nodeExtent: store.nodeExtent\n });\n if (store.fitViewQueued) {\n store.resolveFitView();\n }\n const newNodes = new Map();\n for (const change of changes) {\n const userNode = store.nodeLookup.get(change.id)?.internals.userNode;\n if (!userNode) {\n continue;\n }\n const node = { ...userNode };\n switch (change.type) {\n case 'dimensions': {\n const measured = { ...node.measured, ...change.dimensions };\n if (change.setAttributes) {\n node.width = change.dimensions?.width ?? node.width;\n node.height = change.dimensions?.height ?? node.height;\n }\n node.measured = measured;\n break;\n }\n case 'position':\n node.position = change.position ?? node.position;\n break;\n }\n newNodes.set(change.id, node);\n }\n store.nodes = store.nodes.map((node) => newNodes.get(node.id) ?? node);\n }\n function fitView(options) {\n // We either create a new Promise or reuse the existing one\n // Even if fitView is called multiple times in a row, we only end up with a single Promise\n const fitViewResolver = store.fitViewResolver ?? Promise.withResolvers();\n // We schedule a fitView by setting fitViewQueued and triggering a setNodes\n store.fitViewQueued = true;\n store.fitViewOptions = options;\n store.fitViewResolver = fitViewResolver;\n // We need to update the nodes so that adoptUserNodes is triggered\n store.nodes = [...store.nodes];\n return fitViewResolver.promise;\n }\n async function setCenter(x, y, options) {\n const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : store.maxZoom;\n const currentPanZoom = store.panZoom;\n if (!currentPanZoom) {\n return Promise.resolve(false);\n }\n await currentPanZoom.setViewport({\n x: store.width / 2 - x * nextZoom,\n y: store.height / 2 - y * nextZoom,\n zoom: nextZoom\n }, { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate });\n return Promise.resolve(true);\n }\n function zoomBy(factor, options) {\n const panZoom = store.panZoom;\n if (!panZoom) {\n return Promise.resolve(false);\n }\n return panZoom.scaleBy(factor, options);\n }\n function zoomIn(options) {\n return zoomBy(1.2, options);\n }\n function zoomOut(options) {\n return zoomBy(1 / 1.2, options);\n }\n function setMinZoom(minZoom) {\n const panZoom = store.panZoom;\n if (panZoom) {\n panZoom.setScaleExtent([minZoom, store.maxZoom]);\n store.minZoom = minZoom;\n }\n }\n function setMaxZoom(maxZoom) {\n const panZoom = store.panZoom;\n if (panZoom) {\n panZoom.setScaleExtent([store.minZoom, maxZoom]);\n store.maxZoom = maxZoom;\n }\n }\n function setTranslateExtent(extent) {\n const panZoom = store.panZoom;\n if (panZoom) {\n panZoom.setTranslateExtent(extent);\n store.translateExtent = extent;\n }\n }\n function deselect(elements, elementsToDeselect = null) {\n let deselected = false;\n const newElements = elements.map((element) => {\n const shouldDeselect = elementsToDeselect ? elementsToDeselect.has(element.id) : true;\n if (shouldDeselect && element.selected) {\n deselected = true;\n return { ...element, selected: false };\n }\n return element;\n });\n return [deselected, newElements];\n }\n function unselectNodesAndEdges(params) {\n const nodesToDeselect = params?.nodes ? new Set(params.nodes.map((node) => node.id)) : null;\n const [nodesDeselected, newNodes] = deselect(store.nodes, nodesToDeselect);\n if (nodesDeselected) {\n store.nodes = newNodes;\n }\n const edgesToDeselect = params?.edges ? new Set(params.edges.map((node) => node.id)) : null;\n const [edgesDeselected, newEdges] = deselect(store.edges, edgesToDeselect);\n if (edgesDeselected) {\n store.edges = newEdges;\n }\n }\n function addSelectedNodes(ids) {\n const isMultiSelection = store.multiselectionKeyPressed;\n store.nodes = store.nodes.map((node) => {\n const nodeWillBeSelected = ids.includes(node.id);\n const selected = isMultiSelection ? node.selected || nodeWillBeSelected : nodeWillBeSelected;\n if (!!node.selected !== selected) {\n return { ...node, selected };\n }\n return node;\n });\n if (!isMultiSelection) {\n unselectNodesAndEdges({ nodes: [] });\n }\n }\n function addSelectedEdges(ids) {\n const isMultiSelection = store.multiselectionKeyPressed;\n store.edges = store.edges.map((edge) => {\n const edgeWillBeSelected = ids.includes(edge.id);\n const selected = isMultiSelection ? edge.selected || edgeWillBeSelected : edgeWillBeSelected;\n if (!!edge.selected !== selected) {\n return { ...edge, selected };\n }\n return edge;\n });\n if (!isMultiSelection) {\n unselectNodesAndEdges({ edges: [] });\n }\n }\n function handleNodeSelection(id, unselect, nodeRef) {\n const node = store.nodeLookup.get(id);\n if (!node) {\n console.warn('012', errorMessages['error012'](id));\n return;\n }\n store.selectionRect = null;\n store.selectionRectMode = null;\n if (!node.selected) {\n addSelectedNodes([id]);\n }\n else if (unselect || (node.selected && store.multiselectionKeyPressed)) {\n unselectNodesAndEdges({ nodes: [node], edges: [] });\n requestAnimationFrame(() => nodeRef?.blur());\n }\n }\n function handleEdgeSelection(id) {\n const edge = store.edgeLookup.get(id);\n if (!edge) {\n console.warn('012', errorMessages['error012'](id));\n return;\n }\n const selectable = edge.selectable || (store.elementsSelectable && typeof edge.selectable === 'undefined');\n if (selectable) {\n store.selectionRect = null;\n store.selectionRectMode = null;\n if (!edge.selected) {\n addSelectedEdges([id]);\n }\n else if (edge.selected && store.multiselectionKeyPressed) {\n unselectNodesAndEdges({ nodes: [], edges: [edge] });\n }\n }\n }\n function moveSelectedNodes(direction, factor) {\n const { nodeExtent, snapGrid, nodeOrigin, nodeLookup, nodesDraggable, onerror } = store;\n const nodeUpdates = new Map();\n /*\n * by default a node moves 5px on each key press\n * if snap grid is enabled, we use that for the velocity\n */\n const xVelo = snapGrid?.[0] ?? 5;\n const yVelo = snapGrid?.[1] ?? 5;\n const xDiff = direction.x * xVelo * factor;\n const yDiff = direction.y * yVelo * factor;\n for (const node of nodeLookup.values()) {\n const isSelected = node.selected &&\n (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'));\n if (!isSelected) {\n continue;\n }\n let nextPosition = {\n x: node.internals.positionAbsolute.x + xDiff,\n y: node.internals.positionAbsolute.y + yDiff\n };\n if (snapGrid) {\n nextPosition = snapPosition(nextPosition, snapGrid);\n }\n const { position, positionAbsolute } = calculateNodePosition({\n nodeId: node.id,\n nextPosition,\n nodeLookup,\n nodeExtent,\n nodeOrigin,\n onError: onerror\n });\n node.position = position;\n node.internals.positionAbsolute = positionAbsolute;\n nodeUpdates.set(node.id, node);\n }\n updateNodePositions(nodeUpdates);\n }\n function panBy(delta) {\n return panBySystem({\n delta,\n panZoom: store.panZoom,\n transform: [store.viewport.x, store.viewport.y, store.viewport.zoom],\n translateExtent: store.translateExtent,\n width: store.width,\n height: store.height\n });\n }\n const updateConnection = (newConnection) => {\n store._connection = { ...newConnection };\n };\n function cancelConnection() {\n store._connection = initialConnection;\n }\n function reset() {\n store.resetStoreValues();\n unselectNodesAndEdges();\n }\n const storeWithActions = Object.assign(store, {\n setNodeTypes,\n setEdgeTypes,\n addEdge,\n updateNodePositions,\n updateNodeInternals,\n zoomIn,\n zoomOut,\n fitView,\n setCenter,\n setMinZoom,\n setMaxZoom,\n setTranslateExtent,\n unselectNodesAndEdges,\n addSelectedNodes,\n addSelectedEdges,\n handleNodeSelection,\n handleEdgeSelection,\n moveSelectedNodes,\n panBy,\n updateConnection,\n cancelConnection,\n reset\n });\n return storeWithActions;\n}\n","import { PanOnScrollMode, XYPanZoom } from '@xyflow/system';\nexport default function zoom(domNode, params) {\n const { minZoom, maxZoom, initialViewport, onPanZoomStart, onPanZoom, onPanZoomEnd, translateExtent, setPanZoomInstance, onDraggingChange, onTransformChange } = params;\n const panZoomInstance = XYPanZoom({\n domNode,\n minZoom,\n maxZoom,\n translateExtent,\n viewport: initialViewport,\n onPanZoom,\n onPanZoomStart,\n onPanZoomEnd,\n onDraggingChange\n });\n const viewport = panZoomInstance.getViewport();\n if (initialViewport.x !== viewport.x ||\n initialViewport.y !== viewport.y ||\n initialViewport.zoom !== viewport.zoom) {\n onTransformChange([viewport.x, viewport.y, viewport.zoom]);\n }\n setPanZoomInstance(panZoomInstance);\n panZoomInstance.update(params);\n return {\n update(params) {\n panZoomInstance.update(params);\n }\n };\n}\n","\n\n {\n store.dragging = dragging;\n },\n setPanZoomInstance: (instance: PanZoomInstance) => {\n store.panZoom = instance;\n },\n onPanZoomStart: onmovestart,\n onPanZoom: onmove,\n onPanZoomEnd: onmoveend,\n zoomOnScroll,\n zoomOnDoubleClick,\n zoomOnPinch,\n panOnScroll: panOnScrollActive,\n panOnDrag: panOnDragActive,\n panOnScrollSpeed,\n panOnScrollMode,\n zoomActivationKeyPressed: store.zoomActivationKeyPressed,\n preventScrolling: typeof preventScrolling === 'boolean' ? preventScrolling : true,\n noPanClassName: store.noPanClass,\n noWheelClassName: store.noWheelClass,\n userSelectionActive: !!store.selectionRect,\n translateExtent: store.translateExtent,\n lib: 'svelte',\n paneClickDistance,\n selectionOnDrag,\n onTransformChange: (transform: Transform) => {\n store.viewport = { x: transform[0], y: transform[1], zoom: transform[2] };\n },\n connectionInProgress: store.connection.inProgress\n }}\n>\n {@render children()}\n
\n","\n\n\n\n\n\n\n {@render children()}\n\n","\n\n\n {@render children()}\n\n","import { XYDrag } from '@xyflow/system';\nexport default function drag(domNode, params) {\n const { store, onDrag, onDragStart, onDragStop, onNodeMouseDown } = params;\n const dragInstance = XYDrag({\n onDrag,\n onDragStart,\n onDragStop,\n onNodeMouseDown,\n getStoreItems: () => {\n const { snapGrid, viewport } = store;\n return {\n nodes: store.nodes,\n nodeLookup: store.nodeLookup,\n edges: store.edges,\n nodeExtent: store.nodeExtent,\n snapGrid: snapGrid ? snapGrid : [0, 0],\n snapToGrid: !!snapGrid,\n nodeOrigin: store.nodeOrigin,\n multiSelectionActive: store.multiselectionKeyPressed,\n domNode: store.domNode,\n transform: [viewport.x, viewport.y, viewport.zoom],\n autoPanOnNodeDrag: store.autoPanOnNodeDrag,\n nodesDraggable: store.nodesDraggable,\n selectNodesOnDrag: store.selectNodesOnDrag,\n nodeDragThreshold: store.nodeDragThreshold,\n unselectNodesAndEdges: store.unselectNodesAndEdges,\n updateNodePositions: store.updateNodePositions,\n onSelectionDrag: store.onselectiondrag,\n onSelectionDragStart: store.onselectiondragstart,\n onSelectionDragStop: store.onselectiondragstop,\n panBy: store.panBy\n };\n }\n });\n function updateDrag(domNode, params) {\n if (params.disabled) {\n dragInstance.destroy();\n return;\n }\n dragInstance.update({\n domNode,\n noDragClassName: params.noDragClass,\n handleSelector: params.handleSelector,\n nodeId: params.nodeId,\n isSelectable: params.isSelectable,\n nodeClickDistance: params.nodeClickDistance\n });\n }\n updateDrag(domNode, params);\n return {\n update(params) {\n updateDrag(domNode, params);\n },\n destroy() {\n dragInstance.destroy();\n }\n };\n}\n","\n\n
\n {store.disableKeyboardA11y\n ? store.ariaLabelConfig['node.a11yDescription.default']\n : store.ariaLabelConfig['node.a11yDescription.keyboardDisabled']}\n
\n
\n {store.ariaLabelConfig['edge.a11yDescription.default']}\n
\n\n{#if !store.disableKeyboardA11y}\n \n {store.ariaLiveMessage}\n \n{/if}\n\n\n","export { default as A11yDescriptions } from './A11yDescriptions.svelte';\nexport const ARIA_NODE_DESC_KEY = 'svelte-flow__node-desc';\nexport const ARIA_EDGE_DESC_KEY = 'svelte-flow__edge-desc';\nexport const ARIA_LIVE_MESSAGE = 'svelte-flow__aria-live';\n","\n\n{#if !hidden}\n {\n onnodedrag?.({ event, targetNode: targetNode as NodeType, nodes: nodes as NodeType[] });\n },\n onDragStart: (event, _, targetNode, nodes) => {\n onnodedragstart?.({\n event,\n targetNode: targetNode as NodeType,\n nodes: nodes as NodeType[]\n });\n },\n onDragStop: (event, _, targetNode, nodes) => {\n onnodedragstop?.({ event, targetNode: targetNode as NodeType, nodes: nodes as NodeType[] });\n },\n store\n }}\n bind:this={nodeRef}\n data-id={id}\n class={['svelte-flow__node', `svelte-flow__node-${type}`, className]}\n class:dragging\n class:selected\n class:draggable\n class:connectable\n class:selectable\n class:nopan={draggable}\n class:parent={isParent}\n style:z-index={zIndex}\n style:transform=\"translate({positionX}px, {positionY}px)\"\n style:visibility={hasDimensions ? 'visible' : 'hidden'}\n style={nodeStyle}\n onclick={onSelectNodeHandler}\n onpointerenter={onnodepointerenter\n ? (event) => onnodepointerenter({ node: userNode, event })\n : undefined}\n onpointerleave={onnodepointerleave\n ? (event) => onnodepointerleave({ node: userNode, event })\n : undefined}\n onpointermove={onnodepointermove\n ? (event) => onnodepointermove({ node: userNode, event })\n : undefined}\n oncontextmenu={onnodecontextmenu\n ? (event) => onnodecontextmenu({ node: userNode, event })\n : undefined}\n onkeydown={focusable ? onKeyDown : undefined}\n onfocus={focusable ? onFocus : undefined}\n tabIndex={focusable ? 0 : undefined}\n role={node.ariaRole ?? (focusable ? 'group' : undefined)}\n aria-roledescription=\"node\"\n aria-describedby={store.disableKeyboardA11y\n ? undefined\n : `${ARIA_NODE_DESC_KEY}-${store.flowId}`}\n {...node.domAttributes}\n >\n \n \n{/if}\n","\n\n
\n {#each store.visible.nodes.values() as node (node.id)}\n \n {/each}\n
\n","\n\n\n{#if !hidden}\n \n {\n onmouseevent(e, onedgecontextmenu);\n }\n : undefined}\n onpointerenter={onedgepointerenter\n ? (e) => {\n onmouseevent(e, onedgepointerenter);\n }\n : undefined}\n onpointerleave={onedgepointerleave\n ? (e) => {\n onmouseevent(e, onedgepointerleave);\n }\n : undefined}\n aria-label={ariaLabel === null\n ? undefined\n : ariaLabel\n ? ariaLabel\n : `Edge from ${source} to ${target}`}\n aria-describedby={focusable ? `${ARIA_EDGE_DESC_KEY}-${store.flowId}` : undefined}\n role={edge.ariaRole ?? (focusable ? 'group' : 'img')}\n aria-roledescription=\"edge\"\n onkeydown={focusable ? onkeydown : undefined}\n tabindex={focusable ? 0 : undefined}\n {...edge.domAttributes}\n >\n \n \n \n{/if}\n","import { enable_legacy_mode_flag } from './index.js';\n\nenable_legacy_mode_flag();\n","\n\n\n {#each store.markers as marker (marker.id)}\n \n {/each}\n\n","\n\n\n {#if type === MarkerType.Arrow}\n \n {:else if type === MarkerType.ArrowClosed}\n \n {/if}\n\n","\n\n
\n \n \n \n\n {#each store.visible.edges.values() as edge (edge.id)}\n \n {/each}\n
\n","\n\n{#if isVisible}\n \n{/if}\n\n\n","\n\n{#if store.selectionRectMode === 'nodes' && bounds && isNumeric(bounds.x) && isNumeric(bounds.y)}\n {\n onnodedrag?.({ event, targetNode: null, nodes: nodes as NodeType[] });\n },\n onDragStart: (event, _, __, nodes) => {\n onnodedragstart?.({ event, targetNode: null, nodes: nodes as NodeType[] });\n },\n onDragStop: (event, _, __, nodes) => {\n onnodedragstop?.({ event, targetNode: null, nodes: nodes as NodeType[] });\n }\n }}\n {oncontextmenu}\n {onclick}\n role={store.disableKeyboardA11y ? undefined : 'button'}\n tabIndex={store.disableKeyboardA11y ? undefined : -1}\n onkeydown={store.disableKeyboardA11y ? undefined : onkeydown}\n bind:this={ref}\n >\n \n \n{/if}\n\n\n","import { on } from 'svelte/events';\n\n/**\n * @param {import('./types.public').ShortcutModifier} def\n * @returns {number}\n */\nfunction mapModifierToBitMask(def) {\n\tswitch (def) {\n\t\tcase 'ctrl':\n\t\t\treturn 0b1000;\n\t\tcase 'shift':\n\t\t\treturn 0b0100;\n\t\tcase 'alt':\n\t\t\treturn 0b0010;\n\t\tcase 'meta':\n\t\t\treturn 0b0001;\n\t}\n}\n\n/**\n * Listen for keyboard event and trigger `shortcut` {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | CustomEvent }\n * @example Typical usage\n *\n * ```svelte\n * \n *\n * \n * ```\n * You can either:\n *\n * - pass multiple callbacks to their associated triggers, or\n *\n * - pass one single handler to the `onshortcut` event, in which case you should\n * provide an ID to each trigger to be able to distinguish what trigger was activated\n * in the event handler.\n *\n * Either way, only use `callback` or `onshortcut` and not both to\n * avoid handler duplication.\n * @param {HTMLElement} node - HTMLElement to add event listener to\n * @param {import('./types.public').ShortcutParameter} param - svelte action parameters\n * @returns {import('./types.public').ShortcutActionReturn}\n */\nexport function shortcut(node, param) {\n\tlet { enabled = true, trigger, type = 'keydown' } = param;\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tfunction handler(event) {\n\t\tconst normalizedTriggers = Array.isArray(trigger) ? trigger : [trigger];\n\t\tconst modifierMask = [event.metaKey, event.altKey, event.shiftKey, event.ctrlKey].reduce(\n\t\t\t(acc, value, index) => {\n\t\t\t\tif (value) {\n\t\t\t\t\treturn acc | (1 << index);\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t0b0000,\n\t\t);\n\t\tfor (const trigger of normalizedTriggers) {\n\t\t\tconst mergedTrigger = {\n\t\t\t\tpreventDefault: false,\n\t\t\t\tenabled: true,\n\t\t\t\t...trigger,\n\t\t\t};\n\t\t\tconst { modifier, key, callback, preventDefault, enabled: triggerEnabled } = mergedTrigger;\n\t\t\tif (triggerEnabled) {\n\t\t\t\tif (event.key !== key) continue;\n\n\t\t\t\tif (modifier === null || modifier === false) {\n\t\t\t\t\tif (modifierMask !== 0b0000) continue;\n\t\t\t\t} else if (\n\t\t\t\t\tmodifier !== undefined &&\n\t\t\t\t\tmodifier?.[0]?.length > 0\n\t\t\t\t) {\n\t\t\t\t\tconst orDefs = Array.isArray(modifier) ? modifier : [modifier];\n\t\t\t\t\tlet modified = false;\n\t\t\t\t\tfor (const orDef of orDefs) {\n\t\t\t\t\t\tconst mask = (Array.isArray(orDef) ? orDef : [orDef]).reduce(\n\t\t\t\t\t\t\t(acc, def) => acc | mapModifierToBitMask(def),\n\t\t\t\t\t\t\t0b0000,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (mask === modifierMask) {\n\t\t\t\t\t\t\tmodified = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!modified) continue;\n\t\t\t\t}\n\n\t\t\t\tif (preventDefault) event.preventDefault();\n\t\t\t\t/** @type {import('./types.public').ShortcutEventDetail} */\n\t\t\t\tconst detail = {\n\t\t\t\t\tnode,\n\t\t\t\t\ttrigger: mergedTrigger,\n\t\t\t\t\toriginalEvent: event,\n\t\t\t\t};\n\t\t\t\tnode.dispatchEvent(new CustomEvent('shortcut', { detail }));\n\t\t\t\tcallback?.(detail);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @type {undefined | (() => void)} */\n\tlet off;\n\tif (enabled) {\n\t\toff = on(node, type, handler);\n\t}\n\n\treturn {\n\t\tupdate: (update) => {\n\t\t\tconst { enabled: newEnabled = true, type: newType = 'keydown' } = update;\n\n\t\t\tif (enabled && (!newEnabled || type !== newType)) {\n\t\t\t\toff?.();\n\t\t\t} else if (!enabled && newEnabled) {\n\t\t\t\toff = on(node, newType, handler);\n\t\t\t}\n\n\t\t\tenabled = newEnabled;\n\t\t\ttype = newType;\n\t\t\ttrigger = update.trigger;\n\t\t},\n\t\tdestroy: () => {\n\t\t\toff?.();\n\t\t},\n\t};\n}\n","import { getOverlappingArea, isRectObject, nodeToRect, pointToRendererPoint, getViewportForBounds, getElementsToRemove, rendererPointToPoint, evaluateAbsolutePosition, getNodesBounds } from '@xyflow/system';\nimport { useStore } from '../store';\nimport { isEdge, isNode } from '../utils';\nimport { untrack } from 'svelte';\n/**\n * Hook for accessing the SvelteFlow instance.\n *\n * @public\n * @returns A set of helper functions\n */\nexport function useSvelteFlow() {\n const store = $derived(useStore());\n const getNodeRect = (node) => {\n const nodeToUse = isNode(node) ? node : store.nodeLookup.get(node.id);\n const position = nodeToUse.parentId\n ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, store.nodeLookup, store.nodeOrigin)\n : nodeToUse.position;\n const nodeWithPosition = {\n ...nodeToUse,\n position,\n width: nodeToUse.measured?.width ?? nodeToUse.width,\n height: nodeToUse.measured?.height ?? nodeToUse.height\n };\n return nodeToRect(nodeWithPosition);\n };\n function updateNode(id, nodeUpdate, options = { replace: false }) {\n store.nodes = untrack(() => store.nodes).map((node) => {\n if (node.id === id) {\n const nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate;\n return options?.replace && isNode(nextNode) ? nextNode : { ...node, ...nextNode };\n }\n return node;\n });\n }\n function updateEdge(id, edgeUpdate, options = { replace: false }) {\n store.edges = untrack(() => store.edges).map((edge) => {\n if (edge.id === id) {\n const nextEdge = typeof edgeUpdate === 'function' ? edgeUpdate(edge) : edgeUpdate;\n return options.replace && isEdge(nextEdge) ? nextEdge : { ...edge, ...nextEdge };\n }\n return edge;\n });\n }\n const getInternalNode = (id) => store.nodeLookup.get(id);\n return {\n zoomIn: store.zoomIn,\n zoomOut: store.zoomOut,\n getInternalNode,\n getNode: (id) => getInternalNode(id)?.internals.userNode,\n getNodes: (ids) => (ids === undefined ? store.nodes : getElements(store.nodeLookup, ids)),\n getEdge: (id) => store.edgeLookup.get(id),\n getEdges: (ids) => (ids === undefined ? store.edges : getElements(store.edgeLookup, ids)),\n setZoom: (zoomLevel, options) => {\n const panZoom = store.panZoom;\n return panZoom\n ? panZoom.scaleTo(zoomLevel, { duration: options?.duration })\n : Promise.resolve(false);\n },\n getZoom: () => store.viewport.zoom,\n setViewport: async (nextViewport, options) => {\n const currentViewport = store.viewport;\n if (!store.panZoom) {\n return Promise.resolve(false);\n }\n await store.panZoom.setViewport({\n x: nextViewport.x ?? currentViewport.x,\n y: nextViewport.y ?? currentViewport.y,\n zoom: nextViewport.zoom ?? currentViewport.zoom\n }, options);\n return Promise.resolve(true);\n },\n getViewport: () => $state.snapshot(store.viewport),\n setCenter: async (x, y, options) => store.setCenter(x, y, options),\n fitView: (options) => store.fitView(options),\n fitBounds: async (bounds, options) => {\n if (!store.panZoom) {\n return Promise.resolve(false);\n }\n const viewport = getViewportForBounds(bounds, store.width, store.height, store.minZoom, store.maxZoom, options?.padding ?? 0.1);\n await store.panZoom.setViewport(viewport, {\n duration: options?.duration,\n ease: options?.ease,\n interpolate: options?.interpolate\n });\n return Promise.resolve(true);\n },\n /**\n * Partial is defined as \"the 2 nodes/areas are intersecting partially\".\n * If a is contained in b or b is contained in a, they are both\n * considered fully intersecting.\n */\n getIntersectingNodes: (nodeOrRect, partially = true, nodesToIntersect) => {\n const isRect = isRectObject(nodeOrRect);\n const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n if (!nodeRect) {\n return [];\n }\n return (nodesToIntersect || store.nodes).filter((n) => {\n const internalNode = store.nodeLookup.get(n.id);\n if (!internalNode || (!isRect && n.id === nodeOrRect.id)) {\n return false;\n }\n const currNodeRect = nodeToRect(internalNode);\n const overlappingArea = getOverlappingArea(currNodeRect, nodeRect);\n const partiallyVisible = partially && overlappingArea > 0;\n return (partiallyVisible ||\n overlappingArea >= currNodeRect.width * currNodeRect.height ||\n overlappingArea >= nodeRect.width * nodeRect.height);\n });\n },\n isNodeIntersecting: (nodeOrRect, area, partially = true) => {\n const isRect = isRectObject(nodeOrRect);\n const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n if (!nodeRect) {\n return false;\n }\n const overlappingArea = getOverlappingArea(nodeRect, area);\n const partiallyVisible = partially && overlappingArea > 0;\n return (partiallyVisible ||\n overlappingArea >= area.width * area.height ||\n overlappingArea >= nodeRect.width * nodeRect.height);\n },\n deleteElements: async ({ nodes: nodesToRemove = [], edges: edgesToRemove = [] }) => {\n const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove({\n nodesToRemove,\n edgesToRemove,\n nodes: store.nodes,\n edges: store.edges,\n onBeforeDelete: store.onbeforedelete\n });\n if (matchingNodes) {\n store.nodes = untrack(() => store.nodes).filter((node) => !matchingNodes.some(({ id }) => id === node.id));\n }\n if (matchingEdges) {\n store.edges = untrack(() => store.edges).filter((edge) => !matchingEdges.some(({ id }) => id === edge.id));\n }\n if (matchingNodes.length > 0 || matchingEdges.length > 0) {\n store.ondelete?.({\n nodes: matchingNodes,\n edges: matchingEdges\n });\n }\n return {\n deletedNodes: matchingNodes,\n deletedEdges: matchingEdges\n };\n },\n screenToFlowPosition: (position, options = { snapToGrid: true }) => {\n if (!store.domNode) {\n return position;\n }\n const _snapGrid = options.snapToGrid ? store.snapGrid : false;\n const { x, y, zoom } = store.viewport;\n const { x: domX, y: domY } = store.domNode.getBoundingClientRect();\n const correctedPosition = {\n x: position.x - domX,\n y: position.y - domY\n };\n return pointToRendererPoint(correctedPosition, [x, y, zoom], _snapGrid !== null, _snapGrid || [1, 1]);\n },\n /**\n *\n * @param position\n * @returns\n */\n flowToScreenPosition: (position) => {\n if (!store.domNode) {\n return position;\n }\n const { x, y, zoom } = store.viewport;\n const { x: domX, y: domY } = store.domNode.getBoundingClientRect();\n const rendererPosition = rendererPointToPoint(position, [x, y, zoom]);\n return {\n x: rendererPosition.x + domX,\n y: rendererPosition.y + domY\n };\n },\n toObject: () => {\n return structuredClone({\n nodes: [...store.nodes],\n edges: [...store.edges],\n viewport: { ...store.viewport }\n });\n },\n updateNode,\n updateNodeData: (id, dataUpdate, options) => {\n const node = store.nodeLookup.get(id)?.internals.userNode;\n if (!node) {\n return;\n }\n const nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate;\n updateNode(id, (node) => ({\n ...node,\n data: options?.replace ? nextData : { ...node.data, ...nextData }\n }));\n },\n updateEdge,\n getNodesBounds: (nodes) => {\n return getNodesBounds(nodes, { nodeLookup: store.nodeLookup, nodeOrigin: store.nodeOrigin });\n },\n getHandleConnections: ({ type, id, nodeId }) => Array.from(store.connectionLookup.get(`${nodeId}-${type}-${id ?? null}`)?.values() ?? [])\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getElements(lookup, ids) {\n const result = [];\n for (const id of ids) {\n const item = lookup.get(id);\n if (item) {\n const element = 'internals' in item ? item.internals?.userNode : item;\n result.push(element);\n }\n }\n return result;\n}\n","\n\n (store.selectionKeyPressed = true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(selectionKey, () => (store.selectionKeyPressed = false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(multiSelectionKey, () => {\n store.multiselectionKeyPressed = true;\n }),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(multiSelectionKey, () => (store.multiselectionKeyPressed = false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(deleteKey, (detail) => {\n const isModifierKey =\n detail.originalEvent.ctrlKey ||\n detail.originalEvent.metaKey ||\n detail.originalEvent.shiftKey;\n if (!isModifierKey && !isInputDOMNode(detail.originalEvent)) {\n store.deleteKeyPressed = true;\n handleDelete();\n }\n }),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(deleteKey, () => (store.deleteKeyPressed = false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(panActivationKey, () => (store.panActivationKeyPressed = true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(panActivationKey, () => (store.panActivationKeyPressed = false)),\n type: 'keyup'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(zoomActivationKey, () => (store.zoomActivationKeyPressed = true)),\n type: 'keydown'\n }}\n use:shortcut={{\n trigger: getShortcutTrigger(zoomActivationKey, () => (store.zoomActivationKeyPressed = false)),\n type: 'keyup'\n }}\n/>\n","\n\n{#if store.connection.inProgress}\n \n \n {#if LineComponent}\n \n {:else}\n \n {/if}\n \n \n{/if}\n","\n\n
\n {@render children?.()}\n
\n","\n\n{#if !proOptions?.hideAttribution}\n \n \n Svelte Flow\n \n \n{/if}\n","\n\n}\n>\n {@render children?.()}\n\n\n\n","\n\n\n \n \n \n \n
\n \n
\n \n \n \n
\n
\n \n \n \n \n \n {@render children?.()}\n\n","\n\n{@render children?.()}\n","\n\n\n {@render children?.()}\n\n","\n\n\n {#if before}\n {@render before()}\n {/if}\n {#if showZoom}\n \n \n \n \n \n \n {/if}\n {#if showFitView}\n \n \n \n {/if}\n {#if showLock}\n \n {#if isInteractive}{:else}{/if}\n \n {/if}\n {#if children}\n {@render children()}\n {/if}\n {#if after}\n {@render after()}\n {/if}\n\n","export var BackgroundVariant;\n(function (BackgroundVariant) {\n BackgroundVariant[\"Lines\"] = \"lines\";\n BackgroundVariant[\"Dots\"] = \"dots\";\n BackgroundVariant[\"Cross\"] = \"cross\";\n})(BackgroundVariant || (BackgroundVariant = {}));\n","\n\n\n","\n\n\n","\n\n\n\n\n \n {#if isDots}\n \n {:else}\n \n {/if}\n \n \n\n","\n\n{#if nodeComponent}\n {@const CustomComponent = nodeComponent}\n\n \n{:else}\n \n{/if}\n","import { XYMinimap } from '@xyflow/system';\nexport default function interactive(domNode, params) {\n const minimap = XYMinimap({\n domNode,\n panZoom: params.panZoom,\n getTransform: () => {\n const { viewport } = params.store;\n return [viewport.x, viewport.y, viewport.zoom];\n },\n getViewScale: params.getViewScale\n });\n minimap.update({\n translateExtent: params.translateExtent,\n width: params.width,\n height: params.height,\n inversePan: params.inversePan,\n zoomStep: params.zoomStep,\n pannable: params.pannable,\n zoomable: params.zoomable\n });\n function update(params) {\n minimap.update({\n translateExtent: params.translateExtent,\n width: params.width,\n height: params.height,\n inversePan: params.inversePan,\n zoomStep: params.zoomStep,\n pannable: params.pannable,\n zoomable: params.zoomable\n });\n }\n return {\n update,\n destroy() {\n minimap.destroy();\n }\n };\n}\n","\n\n\n\n\n {#if store.panZoom}\n \n {#if ariaLabel ?? ariaLabelConfig['minimap.ariaLabel']}\n {ariaLabel ?? ariaLabelConfig['minimap.ariaLabel']}\n {/if}\n\n {#each store.nodes as userNode (userNode.id)}\n {@const node = store.nodeLookup.get(userNode.id)}\n {#if node && nodeHasDimensions(node) && !node.hidden}\n {@const nodeDimesions = getNodeDimensions(node)}\n \n {/if}\n {/each}\n \n \n {/if}\n\n","\n\n{#if store.domNode && isActive && toolbarNodes}\n `${acc}${node.id} `, '').trim()}\n style:position=\"absolute\"\n style:transform\n style:z-index={zIndex}\n {...rest}\n >\n {@render children?.()}\n \n{/if}\n","import { shallowNodeData } from '@xyflow/system';\nimport { useStore } from '../store';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function useNodesData(nodeIds) {\n const { nodes, nodeLookup } = $derived(useStore());\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let prevNodesData = [];\n let initialRun = true;\n const nodeData = $derived.by(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n nodes;\n const nextNodesData = [];\n const isArrayOfIds = Array.isArray(nodeIds);\n const _nodeIds = isArrayOfIds ? nodeIds : [nodeIds];\n for (const nodeId of _nodeIds) {\n const node = nodeLookup.get(nodeId)?.internals.userNode;\n if (node) {\n nextNodesData.push({\n id: node.id,\n type: node.type,\n data: node.data\n });\n }\n }\n if (!shallowNodeData(nextNodesData, prevNodesData) || initialRun) {\n prevNodesData = nextNodesData;\n initialRun = false;\n }\n return isArrayOfIds ? prevNodesData : (prevNodesData[0] ?? null);\n });\n return {\n get current() {\n return nodeData;\n }\n };\n}\n","export const componentName = 'tinyflow-component';\n\nexport const parameterDataTypes = [\n {\n value: 'String',\n label: 'String'\n },\n {\n value: 'Number',\n label: 'Number'\n },\n {\n value: 'Boolean',\n label: 'Boolean'\n },\n {\n value: 'File',\n label: 'File'\n },\n {\n value: 'Object',\n label: 'Object'\n },\n {\n value: 'Array',\n label: 'Array'\n }\n];\n\nexport const parameterRefTypes = [\n {\n value: 'ref',\n label: '引用'\n },\n {\n value: 'fixed',\n label: '固定值'\n },\n {\n value: 'form',\n label: '表单输入'\n }\n];\n\nexport const contentTypes = [\n { label: '文字', value: 'text' },\n { label: '图片', value: 'image' },\n { label: '视频', value: 'video' },\n { label: '音频', value: 'audio' },\n { label: '文件', value: 'file' },\n { label: '其他', value: 'other' }\n];\n\nexport const inputFormTypes = [\n { label: '单行输入框', value: 'input' },\n { label: '多行输入框', value: 'textarea' },\n { label: '下拉菜单', value: 'select' },\n { label: '单选', value: 'radio' },\n { label: '多选', value: 'checkbox' }\n];\n\nexport const inputFormTypesForFiles = [\n // { label: '单行输入框', value: 'input' },\n // { label: '多行输入框', value: 'textarea' },\n // { label: '下拉菜单', value: 'select' },\n { label: '单选', value: 'radio' },\n { label: '多选', value: 'checkbox' }\n];\n\nexport const confirmFormTypes = [\n { label: '单选', value: 'radio' },\n { label: '多选', value: 'checkbox' }\n];\n","import { BROWSER } from \"esm-env\";\nexport const defaultWindow = BROWSER && typeof window !== \"undefined\" ? window : undefined;\nexport const defaultDocument = BROWSER && typeof window !== \"undefined\" ? window.document : undefined;\nexport const defaultNavigator = BROWSER && typeof window !== \"undefined\" ? window.navigator : undefined;\nexport const defaultLocation = BROWSER && typeof window !== \"undefined\" ? window.location : undefined;\n","import { defaultDocument } from \"../configurable-globals.js\";\n/**\n * Handles getting the active element in a document or shadow root.\n * If the active element is within a shadow root, it will traverse the shadow root\n * to find the active element.\n * If not, it will return the active element in the document.\n *\n * @param document A document or shadow root to get the active element from.\n * @returns The active element in the document or shadow root.\n */\nexport function getActiveElement(document) {\n let activeElement = document.activeElement;\n while (activeElement?.shadowRoot) {\n const node = activeElement.shadowRoot.activeElement;\n if (node === activeElement)\n break;\n else\n activeElement = node;\n }\n return activeElement;\n}\n/**\n * Returns the owner document of a given element.\n *\n * @param node The element to get the owner document from.\n * @returns\n */\nexport function getOwnerDocument(node, fallback = defaultDocument) {\n return node?.ownerDocument ?? fallback;\n}\n/**\n * Checks if an element is or is contained by another element.\n *\n * @param node The element to check if it or its descendants contain the target element.\n * @param target The element to check if it is contained by the node.\n * @returns\n */\nexport function isOrContainsTarget(node, target) {\n return node === target || node.contains(target);\n}\n","import { defaultWindow, } from \"../../internal/configurable-globals.js\";\nimport { getActiveElement } from \"../../internal/utils/dom.js\";\nimport { on } from \"svelte/events\";\nimport { createSubscriber } from \"svelte/reactivity\";\nexport class ActiveElement {\n #document;\n #subscribe;\n constructor(options = {}) {\n const { window = defaultWindow, document = window?.document } = options;\n if (window === undefined)\n return;\n this.#document = document;\n this.#subscribe = createSubscriber((update) => {\n const cleanupFocusIn = on(window, \"focusin\", update);\n const cleanupFocusOut = on(window, \"focusout\", update);\n return () => {\n cleanupFocusIn();\n cleanupFocusOut();\n };\n });\n }\n get current() {\n this.#subscribe?.();\n if (!this.#document)\n return null;\n return getActiveElement(this.#document);\n }\n}\n/**\n * An object holding a reactive value that is equal to `document.activeElement`.\n * It automatically listens for changes, keeping the reference up to date.\n *\n * If you wish to use a custom document or shadowRoot, you should use\n * [useActiveElement](https://runed.dev/docs/utilities/active-element) instead.\n *\n * @see {@link https://runed.dev/docs/utilities/active-element}\n */\nexport const activeElement = new ActiveElement();\n","import { untrack } from \"svelte\";\nfunction runEffect(flush, effect) {\n switch (flush) {\n case \"post\":\n $effect(effect);\n break;\n case \"pre\":\n $effect.pre(effect);\n break;\n }\n}\nfunction runWatcher(sources, flush, effect, options = {}) {\n const { lazy = false } = options;\n // Run the effect immediately if `lazy` is `false`.\n let active = !lazy;\n // On the first run, if the dependencies are an array, pass an empty array\n // to the previous value instead of `undefined` to allow destructuring.\n //\n // watch(() => [a, b], ([a, b], [prevA, prevB]) => { ... });\n let previousValues = Array.isArray(sources)\n ? []\n : undefined;\n runEffect(flush, () => {\n const values = Array.isArray(sources) ? sources.map((source) => source()) : sources();\n if (!active) {\n active = true;\n previousValues = values;\n return;\n }\n const cleanup = untrack(() => effect(values, previousValues));\n previousValues = values;\n return cleanup;\n });\n}\nfunction runWatcherOnce(sources, flush, effect) {\n const cleanupRoot = $effect.root(() => {\n let stop = false;\n runWatcher(sources, flush, (values, previousValues) => {\n if (stop) {\n cleanupRoot();\n return;\n }\n // Since `lazy` is `true`, `previousValues` is always defined.\n const cleanup = effect(values, previousValues);\n stop = true;\n return cleanup;\n }, \n // Running the effect immediately just once makes no sense at all.\n // That's just `onMount` with extra steps.\n { lazy: true });\n });\n $effect(() => {\n return cleanupRoot;\n });\n}\nexport function watch(sources, effect, options) {\n runWatcher(sources, \"post\", effect, options);\n}\nfunction watchPre(sources, effect, options) {\n runWatcher(sources, \"pre\", effect, options);\n}\nwatch.pre = watchPre;\nexport function watchOnce(source, effect) {\n runWatcherOnce(source, \"post\", effect);\n}\nfunction watchOncePre(source, effect) {\n runWatcherOnce(source, \"pre\", effect);\n}\nwatchOnce.pre = watchOncePre;\n","import { defaultWindow } from \"../../internal/configurable-globals.js\";\nimport { on } from \"svelte/events\";\nimport { createSubscriber } from \"svelte/reactivity\";\nfunction getStorage(storageType, window) {\n switch (storageType) {\n case \"local\":\n return window.localStorage;\n case \"session\":\n return window.sessionStorage;\n }\n}\n/**\n * Creates reactive state that is persisted and synchronized across browser sessions and tabs using Web Storage.\n * @param key The unique key used to store the state in the storage.\n * @param initialValue The initial value of the state if not already present in the storage.\n * @param options Configuration options including storage type, serializer for complex data types, and whether to sync state changes across tabs.\n *\n * @see {@link https://runed.dev/docs/utilities/persisted-state}\n */\nexport class PersistedState {\n #current;\n #key;\n #serializer;\n #storage;\n #subscribe;\n #version = $state(0);\n constructor(key, initialValue, options = {}) {\n const { storage: storageType = \"local\", serializer = { serialize: JSON.stringify, deserialize: JSON.parse }, syncTabs = true, window = defaultWindow, } = options;\n this.#current = initialValue;\n this.#key = key;\n this.#serializer = serializer;\n if (window === undefined)\n return;\n const storage = getStorage(storageType, window);\n this.#storage = storage;\n const existingValue = storage.getItem(key);\n if (existingValue !== null) {\n this.#current = this.#deserialize(existingValue);\n }\n else {\n this.#serialize(initialValue);\n }\n if (syncTabs && storageType === \"local\") {\n this.#subscribe = createSubscriber(() => {\n return on(window, \"storage\", this.#handleStorageEvent);\n });\n }\n }\n get current() {\n this.#subscribe?.();\n this.#version;\n const root = this.#deserialize(this.#storage?.getItem(this.#key)) ?? this.#current;\n const proxies = new WeakMap();\n const proxy = (value) => {\n if (value === null || value?.constructor.name === \"Date\" || typeof value !== \"object\") {\n return value;\n }\n let p = proxies.get(value);\n if (!p) {\n p = new Proxy(value, {\n get: (target, property) => {\n this.#version;\n return proxy(Reflect.get(target, property));\n },\n set: (target, property, value) => {\n this.#version += 1;\n Reflect.set(target, property, value);\n this.#serialize(root);\n return true;\n },\n });\n proxies.set(value, p);\n }\n return p;\n };\n return proxy(root);\n }\n set current(newValue) {\n this.#serialize(newValue);\n this.#version += 1;\n }\n #handleStorageEvent = (event) => {\n if (event.key !== this.#key || event.newValue === null)\n return;\n this.#current = this.#deserialize(event.newValue);\n this.#version += 1;\n };\n #deserialize(value) {\n try {\n return this.#serializer.deserialize(value);\n }\n catch (error) {\n console.error(`Error when parsing \"${value}\" from persisted store \"${this.#key}\"`, error);\n return;\n }\n }\n #serialize(value) {\n try {\n if (value != undefined) {\n this.#storage?.setItem(this.#key, this.#serializer.serialize(value));\n }\n }\n catch (error) {\n console.error(`Error when writing value from persisted store \"${this.#key}\" to ${this.#storage}`, error);\n }\n }\n}\n","/**\n * Sanitizes an array of classnames by removing any empty strings.\n */\nexport function sanitizeClassNames(classNames) {\n return classNames.filter((className) => className.length > 0);\n}\nexport const noopStorage = {\n getItem: (_key) => null,\n setItem: (_key, _value) => { },\n};\nexport const isBrowser = typeof document !== \"undefined\";\n","export function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nconst CLASS_VALUE_PRIMITIVE_TYPES = [\"string\", \"number\", \"bigint\", \"boolean\"];\nexport function isClassValue(value) {\n // handle primitive types\n if (value === null || value === undefined)\n return true;\n if (CLASS_VALUE_PRIMITIVE_TYPES.includes(typeof value))\n return true;\n // handle arrays (ClassArray)\n if (Array.isArray(value))\n return value.every((item) => isClassValue(item));\n // handle objects (ClassDictionary)\n if (typeof value === \"object\") {\n // ensure it's a plain object and not some other object type\n if (Object.getPrototypeOf(value) !== Object.prototype)\n return false;\n return true;\n }\n return false;\n}\nconst ELEMENT_NODE = 1;\nconst DOCUMENT_NODE = 9;\nconst DOCUMENT_FRAGMENT_NODE = 11;\nexport function isHTMLElement(v) {\n return isObject(v) && v.nodeType === ELEMENT_NODE && typeof v.nodeName === \"string\";\n}\nexport function isDocument(v) {\n return isObject(v) && v.nodeType === DOCUMENT_NODE;\n}\nexport function isWindow(v) {\n return isObject(v) && v === v.window;\n}\nexport function getNodeName(node) {\n if (isHTMLElement(node))\n return node.localName || \"\";\n return \"#document\";\n}\nexport function isRootElement(node) {\n return [\"html\", \"body\", \"#document\"].includes(getNodeName(node));\n}\nexport function isNode(v) {\n return isObject(v) && v.nodeType !== undefined;\n}\nexport function isShadowRoot(v) {\n return isNode(v) && v.nodeType === DOCUMENT_FRAGMENT_NODE && \"host\" in v;\n}\n","import { isFunction, isObject } from \"../utils/is.js\";\nconst BoxSymbol = Symbol(\"box\");\nconst isWritableSymbol = Symbol(\"is-writable\");\n/**\n * @returns Whether the value is a Box\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction isBox(value) {\n return isObject(value) && BoxSymbol in value;\n}\n/**\n * @returns Whether the value is a WritableBox\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction isWritableBox(value) {\n return box.isBox(value) && isWritableSymbol in value;\n}\nexport function box(initialValue) {\n let current = $state(initialValue);\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return current;\n },\n set current(v) {\n current = v;\n }\n };\n}\nfunction boxWith(getter, setter) {\n const derived = $derived.by(getter);\n if (setter) {\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return derived;\n },\n set current(v) {\n setter(v);\n }\n };\n }\n return {\n [BoxSymbol]: true,\n get current() {\n return getter();\n }\n };\n}\nfunction boxFrom(value) {\n if (box.isBox(value))\n return value;\n if (isFunction(value))\n return box.with(value);\n return box(value);\n}\n/**\n * Function that gets an object of boxes, and returns an object of reactive values\n *\n * @example\n * const count = box(0)\n * const flat = box.flatten({ count, double: box.with(() => count.current) })\n * // type of flat is { count: number, readonly double: number }\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction boxFlatten(boxes) {\n return Object.entries(boxes).reduce((acc, [key, b]) => {\n if (!box.isBox(b)) {\n return Object.assign(acc, { [key]: b });\n }\n if (box.isWritableBox(b)) {\n Object.defineProperty(acc, key, {\n get() {\n return b.current;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set(v) {\n b.current = v;\n }\n });\n }\n else {\n Object.defineProperty(acc, key, {\n get() {\n return b.current;\n }\n });\n }\n return acc;\n }, {});\n}\n/**\n * Function that converts a box to a readonly box.\n *\n * @example\n * const count = box(0) // WritableBox\n * const countReadonly = box.readonly(count) // ReadableBox\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction toReadonlyBox(b) {\n if (!box.isWritableBox(b))\n return b;\n return {\n [BoxSymbol]: true,\n get current() {\n return b.current;\n }\n };\n}\nbox.from = boxFrom;\nbox.with = boxWith;\nbox.flatten = boxFlatten;\nbox.readonly = toReadonlyBox;\nbox.isBox = isBox;\nbox.isWritableBox = isWritableBox;\n","// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nfunction index (style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) ; else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n}\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n\nexport { index as default };\n//# sourceMappingURL=index.mjs.map\n","import parse from 'inline-style-parser';\n\n/**\n * Parses inline style to object.\n *\n * @param style - Inline style.\n * @param iterator - Iterator.\n * @returns - Style object or null.\n *\n * @example Parsing inline style to object:\n *\n * ```js\n * import parse from 'style-to-object';\n * parse('line-height: 42;'); // { 'line-height': '42' }\n * ```\n */\nfunction StyleToObject(style, iterator) {\n let styleObject = null;\n if (!style || typeof style !== 'string') {\n return styleObject;\n }\n const declarations = parse(style);\n const hasIterator = typeof iterator === 'function';\n declarations.forEach((declaration) => {\n if (declaration.type !== 'declaration') {\n return;\n }\n const { property, value } = declaration;\n if (hasIterator) {\n iterator(property, value, declaration);\n }\n else if (value) {\n styleObject = styleObject || {};\n styleObject[property] = value;\n }\n });\n return styleObject;\n}\n\nexport { StyleToObject as default };\n//# sourceMappingURL=index.mjs.map\n","function createParser(matcher, replacer) {\n const regex = RegExp(matcher, \"g\");\n return (str) => {\n // throw an error if not a string\n if (typeof str !== \"string\") {\n throw new TypeError(`expected an argument of type string, but got ${typeof str}`);\n }\n // if no match between string and matcher\n if (!str.match(regex))\n return str;\n // executes the replacer function for each match\n return str.replace(regex, replacer);\n };\n}\nconst camelToKebab = createParser(/[A-Z]/, (match) => `-${match.toLowerCase()}`);\nexport function styleToCSS(styleObj) {\n if (!styleObj || typeof styleObj !== \"object\" || Array.isArray(styleObj)) {\n throw new TypeError(`expected an argument of type object, but got ${typeof styleObj}`);\n }\n return Object.keys(styleObj)\n .map((property) => `${camelToKebab(property)}: ${styleObj[property]};`)\n .join(\"\\n\");\n}\n","import { styleToCSS } from \"./style-to-css.js\";\nexport function styleToString(style = {}) {\n return styleToCSS(style).replace(\"\\n\", \" \");\n}\nexport const srOnlyStyles = {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: \"0\",\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n borderWidth: \"0\",\n transform: \"translateX(-100%)\"\n};\nexport const srOnlyStylesString = styleToString(srOnlyStyles);\n","import { BROWSER } from \"esm-env\";\nexport const defaultWindow = BROWSER && typeof window !== \"undefined\" ? window : undefined;\nexport const defaultDocument = BROWSER && typeof window !== \"undefined\" ? window.document : undefined;\nexport const defaultNavigator = BROWSER && typeof window !== \"undefined\" ? window.navigator : undefined;\nexport const defaultLocation = BROWSER && typeof window !== \"undefined\" ? window.location : undefined;\n","import { defaultDocument } from \"../configurable-globals.js\";\n/**\n * Handles getting the active element in a document or shadow root.\n * If the active element is within a shadow root, it will traverse the shadow root\n * to find the active element.\n * If not, it will return the active element in the document.\n *\n * @param document A document or shadow root to get the active element from.\n * @returns The active element in the document or shadow root.\n */\nexport function getActiveElement(document) {\n let activeElement = document.activeElement;\n while (activeElement?.shadowRoot) {\n const node = activeElement.shadowRoot.activeElement;\n if (node === activeElement)\n break;\n else\n activeElement = node;\n }\n return activeElement;\n}\n/**\n * Returns the owner document of a given element.\n *\n * @param node The element to get the owner document from.\n * @returns\n */\nexport function getOwnerDocument(node, fallback = defaultDocument) {\n return node?.ownerDocument ?? fallback;\n}\n/**\n * Checks if an element is or is contained by another element.\n *\n * @param node The element to check if it or its descendants contain the target element.\n * @param target The element to check if it is contained by the node.\n * @returns\n */\nexport function isOrContainsTarget(node, target) {\n return node === target || node.contains(target);\n}\n","import { defaultWindow, } from \"../../internal/configurable-globals.js\";\nimport { getActiveElement } from \"../../internal/utils/dom.js\";\nimport { on } from \"svelte/events\";\nimport { createSubscriber } from \"svelte/reactivity\";\nexport class ActiveElement {\n #document;\n #subscribe;\n constructor(options = {}) {\n const { window = defaultWindow, document = window?.document } = options;\n if (window === undefined)\n return;\n this.#document = document;\n this.#subscribe = createSubscriber((update) => {\n const cleanupFocusIn = on(window, \"focusin\", update);\n const cleanupFocusOut = on(window, \"focusout\", update);\n return () => {\n cleanupFocusIn();\n cleanupFocusOut();\n };\n });\n }\n get current() {\n this.#subscribe?.();\n if (!this.#document)\n return null;\n return getActiveElement(this.#document);\n }\n}\n/**\n * An object holding a reactive value that is equal to `document.activeElement`.\n * It automatically listens for changes, keeping the reference up to date.\n *\n * If you wish to use a custom document or shadowRoot, you should use\n * [useActiveElement](https://runed.dev/docs/utilities/active-element) instead.\n *\n * @see {@link https://runed.dev/docs/utilities/active-element}\n */\nexport const activeElement = new ActiveElement();\n","import { box } from \"svelte-toolbelt\";\n/**\n * The key used to store the `mode` in localStorage.\n */\nexport const modeStorageKey = box(\"mode-watcher-mode\");\n/**\n * The key used to store the `theme` in localStorage.\n */\nexport const themeStorageKey = box(\"mode-watcher-theme\");\n","/**\n * the modes that are supported, used for validation & type\n * derivation\n */\nexport const modes = [\"dark\", \"light\", \"system\"];\nexport function isValidMode(value) {\n if (typeof value !== \"string\")\n return false;\n return modes.includes(value);\n}\n","import { PersistedState, watch } from \"runed\";\nimport { isBrowser, noopStorage } from \"./utils.js\";\nimport { modeStorageKey } from \"./storage-keys.svelte.js\";\nimport { isValidMode } from \"./modes.js\";\nimport { MediaQuery } from \"svelte/reactivity\";\nexport class UserPrefersMode {\n #defaultValue = \"system\";\n #storage = isBrowser ? localStorage : noopStorage;\n #initialValue = this.#storage.getItem(modeStorageKey.current);\n #value = isValidMode(this.#initialValue) ? this.#initialValue : this.#defaultValue;\n #persisted = $state(this.#makePersisted());\n #makePersisted(value = this.#value) {\n return new PersistedState(modeStorageKey.current, value, {\n serializer: {\n serialize: (v) => v,\n deserialize: (v) => {\n if (isValidMode(v))\n return v;\n return this.#defaultValue;\n },\n },\n });\n }\n constructor() {\n $effect.root(() => {\n return watch.pre(() => modeStorageKey.current, (_, prevStorageKey) => {\n const currModeValue = this.#persisted.current;\n this.#persisted = this.#makePersisted(currModeValue);\n if (prevStorageKey) {\n localStorage.removeItem(prevStorageKey);\n }\n });\n });\n }\n get current() {\n return this.#persisted.current;\n }\n set current(newValue) {\n this.#persisted.current = newValue;\n }\n}\nexport class SystemPrefersMode {\n #defaultValue = undefined;\n #track = true;\n #current = $state(this.#defaultValue);\n #mediaQueryState = typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? new MediaQuery(\"prefers-color-scheme: light\")\n : { current: false };\n query() {\n if (!isBrowser)\n return;\n this.#current = this.#mediaQueryState.current ? \"light\" : \"dark\";\n }\n tracking(active) {\n this.#track = active;\n }\n constructor() {\n $effect.root(() => {\n $effect.pre(() => {\n if (!this.#track)\n return;\n this.query();\n });\n });\n this.query = this.query.bind(this);\n this.tracking = this.tracking.bind(this);\n }\n get current() {\n return this.#current;\n }\n}\n/**\n * Writable state that represents the user's preferred mode\n * (`\"dark\"`, `\"light\"` or `\"system\"`)\n */\nexport const userPrefersMode = new UserPrefersMode();\n/**\n * Readable store that represents the system's preferred mode (`\"dark\"`, `\"light\"` or `undefined`)\n */\nexport const systemPrefersMode = new SystemPrefersMode();\n","import { PersistedState, watch } from \"runed\";\nimport { themeStorageKey } from \"./storage-keys.svelte.js\";\nimport { isBrowser, noopStorage } from \"./utils.js\";\nclass CustomTheme {\n #storage = isBrowser ? localStorage : noopStorage;\n #initialValue = this.#storage.getItem(themeStorageKey.current);\n #value = this.#initialValue === null || this.#initialValue === undefined ? \"\" : this.#initialValue;\n #persisted = $state(this.#makePersisted());\n #makePersisted(value = this.#value) {\n return new PersistedState(themeStorageKey.current, value, {\n serializer: {\n serialize: (v) => {\n if (typeof v !== \"string\")\n return \"\";\n return v;\n },\n deserialize: (v) => v,\n },\n });\n }\n constructor() {\n $effect.root(() => {\n return watch.pre(() => themeStorageKey.current, (_, prevStorageKey) => {\n const currModeValue = this.#persisted.current;\n this.#persisted = this.#makePersisted(currModeValue);\n if (prevStorageKey) {\n localStorage.removeItem(prevStorageKey);\n }\n });\n });\n }\n /**\n * The current theme.\n * @returns The current theme.\n */\n get current() {\n return this.#persisted.current;\n }\n /**\n * Set the current theme.\n * @param newValue The new theme to set.\n */\n set current(newValue) {\n this.#persisted.current = newValue;\n }\n}\n/**\n * A custom theme to apply and persist to the root `html` element.\n */\nexport const customTheme = new CustomTheme();\n","// Original Source: https://reemus.dev/article/disable-css-transition-color-scheme-change#heading-ultimate-solution-for-changing-color-scheme-without-transitions\nlet timeoutAction;\nlet timeoutEnable;\n/**\n * Whether this is the first time the function has been\n * called, which will be true for the initial load, where\n * we shouldn't need to disable any transitions, as there\n * is nothing to transition from.\n */\nlet hasLoaded = false;\nlet styleElement = null;\n// Create reusable style element\nfunction getStyleElement() {\n if (styleElement)\n return styleElement;\n styleElement = document.createElement(\"style\");\n styleElement.appendChild(document.createTextNode(`* {\n\t\t-webkit-transition: none !important;\n\t\t-moz-transition: none !important;\n\t\t-o-transition: none !important;\n\t\t-ms-transition: none !important;\n\t\ttransition: none !important;\n\t}`));\n return styleElement;\n}\n// Perform a task without any css transitions\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function withoutTransition(action, synchronous = false) {\n if (typeof document === \"undefined\")\n return;\n // Skip transition disabling on initial load\n if (!hasLoaded) {\n hasLoaded = true;\n action();\n return;\n }\n // In test environments, run synchronously to avoid timing issues\n const isTest = (typeof process !== \"undefined\" && process.env?.NODE_ENV === \"test\") ||\n (typeof window !== \"undefined\" &&\n window.__vitest_worker__);\n if (isTest) {\n action();\n return;\n }\n clearTimeout(timeoutAction);\n clearTimeout(timeoutEnable);\n const style = getStyleElement();\n const disable = () => document.head.appendChild(style);\n const enable = () => {\n if (style.parentNode) {\n document.head.removeChild(style);\n }\n };\n function executeAction() {\n action();\n // defer enable to ensure action completes\n window.requestAnimationFrame(enable);\n }\n // Use requestAnimationFrame for better performance\n if (typeof window.requestAnimationFrame !== \"undefined\") {\n disable();\n if (synchronous) {\n executeAction();\n }\n else {\n // defer action to next frame to avoid blocking\n window.requestAnimationFrame(() => {\n executeAction();\n });\n }\n return;\n }\n // Fallback for older browsers\n disable();\n timeoutAction = window.setTimeout(() => {\n action();\n timeoutEnable = window.setTimeout(enable, 16);\n }, 16);\n}\n","import { box } from \"svelte-toolbelt\";\nimport { isBrowser, sanitizeClassNames } from \"./utils.js\";\nimport { withoutTransition } from \"./without-transition.js\";\nimport { systemPrefersMode, userPrefersMode } from \"./mode-states.svelte.js\";\nimport { customTheme } from \"./theme-state.svelte.js\";\nimport { untrack } from \"svelte\";\n/**\n * Theme colors for light and dark modes.\n */\nexport const themeColors = box(undefined);\n/**\n * Whether to disable transitions when changing the mode.\n */\nexport const disableTransitions = box(true);\n/**\n * Whether to run the mode changes synchronously instead of using\n * an animation frame. If true, will have an impact on blocking performance\n * due to blocking the main thread.\n */\nexport const synchronousModeChanges = box(false);\n/**\n * The classnames to add to the root `html` element when the mode is dark.\n */\nexport const darkClassNames = box([]);\n/**\n * The classnames to add to the root `html` element when the mode is light.\n */\nexport const lightClassNames = box([]);\nfunction createDerivedMode() {\n const current = $derived.by(() => {\n if (!isBrowser)\n return undefined;\n const derivedMode = userPrefersMode.current === \"system\"\n ? systemPrefersMode.current\n : userPrefersMode.current;\n const sanitizedDarkClassNames = sanitizeClassNames(darkClassNames.current);\n const sanitizedLightClassNames = sanitizeClassNames(lightClassNames.current);\n function update() {\n const htmlEl = document.documentElement;\n const themeColorEl = document.querySelector('meta[name=\"theme-color\"]');\n if (derivedMode === \"light\") {\n if (sanitizedDarkClassNames.length)\n htmlEl.classList.remove(...sanitizedDarkClassNames);\n if (sanitizedLightClassNames.length)\n htmlEl.classList.add(...sanitizedLightClassNames);\n htmlEl.style.colorScheme = \"light\";\n if (themeColorEl && themeColors.current) {\n themeColorEl.setAttribute(\"content\", themeColors.current.light);\n }\n }\n else {\n if (sanitizedLightClassNames.length)\n htmlEl.classList.remove(...sanitizedLightClassNames);\n if (sanitizedDarkClassNames.length)\n htmlEl.classList.add(...sanitizedDarkClassNames);\n htmlEl.style.colorScheme = \"dark\";\n if (themeColorEl && themeColors.current) {\n themeColorEl.setAttribute(\"content\", themeColors.current.dark);\n }\n }\n }\n if (disableTransitions.current) {\n withoutTransition(update, synchronousModeChanges.current);\n }\n else {\n update();\n }\n return derivedMode;\n });\n return {\n get current() {\n return current;\n },\n };\n}\nfunction createDerivedTheme() {\n const current = $derived.by(() => {\n customTheme.current;\n if (!isBrowser)\n return undefined;\n function update() {\n const htmlEl = document.documentElement;\n htmlEl.setAttribute(\"data-theme\", customTheme.current);\n }\n if (disableTransitions.current) {\n withoutTransition(update, untrack(() => synchronousModeChanges.current));\n }\n else {\n update();\n }\n return customTheme.current;\n });\n return {\n get current() {\n return current;\n },\n };\n}\n/**\n * Derived store that represents the current mode (`\"dark\"`, `\"light\"` or `undefined`)\n */\nexport const derivedMode = createDerivedMode();\n/**\n * Derived store that represents the current custom theme\n */\nexport const derivedTheme = createDerivedTheme();\nexport { derivedMode as mode, derivedTheme as theme };\n","import { userPrefersMode } from \"./mode-states.svelte.js\";\nimport { customTheme } from \"./theme-state.svelte.js\";\nimport { derivedMode } from \"./states.svelte.js\";\n/** Toggle between light and dark mode */\nexport function toggleMode() {\n userPrefersMode.current = derivedMode.current === \"dark\" ? \"light\" : \"dark\";\n}\n/** Set the mode to light or dark */\nexport function setMode(mode) {\n userPrefersMode.current = mode;\n}\n/** Reset the mode to operating system preference */\nexport function resetMode() {\n userPrefersMode.current = \"system\";\n}\n/** Set the theme to a custom value */\nexport function setTheme(newTheme) {\n customTheme.current = newTheme;\n}\nexport function defineConfig(config) {\n return config;\n}\n/** Used to set the mode on initial page load to prevent FOUC */\nexport function setInitialMode({ defaultMode = \"system\", themeColors, darkClassNames = [\"dark\"], lightClassNames = [], defaultTheme = \"\", modeStorageKey = \"mode-watcher-mode\", themeStorageKey = \"mode-watcher-theme\", }) {\n const rootEl = document.documentElement;\n const mode = localStorage.getItem(modeStorageKey) ?? defaultMode;\n const theme = localStorage.getItem(themeStorageKey) ?? defaultTheme;\n const light = mode === \"light\" ||\n (mode === \"system\" && window.matchMedia(\"(prefers-color-scheme: light)\").matches);\n if (light) {\n if (darkClassNames.length)\n rootEl.classList.remove(...darkClassNames.filter(Boolean));\n if (lightClassNames.length)\n rootEl.classList.add(...lightClassNames.filter(Boolean));\n }\n else {\n if (lightClassNames.length)\n rootEl.classList.remove(...lightClassNames.filter(Boolean));\n if (darkClassNames.length)\n rootEl.classList.add(...darkClassNames.filter(Boolean));\n }\n rootEl.style.colorScheme = light ? \"light\" : \"dark\";\n if (themeColors) {\n const themeMetaEl = document.querySelector('meta[name=\"theme-color\"]');\n if (themeMetaEl) {\n themeMetaEl.setAttribute(\"content\", mode === \"light\" ? themeColors.light : themeColors.dark);\n }\n }\n if (theme) {\n rootEl.setAttribute(\"data-theme\", theme);\n localStorage.setItem(themeStorageKey, theme);\n }\n localStorage.setItem(modeStorageKey, mode);\n}\n/**\n * A type-safe way to generate the source expression used to set the initial mode and avoid FOUC.\n */\nexport function createInitialModeExpression(config = {}) {\n return `(${setInitialMode.toString()})(${JSON.stringify(config)});`;\n}\n/**\n * A type-safe way to generate the source expression used to set the initial mode and avoid FOUC.\n *\n * @deprecated Use `createInitialModeExpression` instead.\n */\nexport const generateSetInitialModeExpression = createInitialModeExpression;\n","\n\n{#if themeColors}\n\t\n\t\n\t\n\t\n{/if}\n","\n\n\n\t{#if themeColors}\n\t\t\n\t\t\n\t\t\n\t\t\n\t{/if}\n\t\n\t{@html `(` +\n\t\tsetInitialMode.toString() +\n\t\t`)(` +\n\t\tJSON.stringify(initConfig) +\n\t\t`);`}\n\n","\n\n{#if disableHeadScriptInjection}\n\t\n{:else}\n\t\n{/if}\n","import { type useSvelteFlow } from '@xyflow/svelte';\nimport { componentName } from './consts';\nimport type { TinyflowData, TinyflowOptions } from './types';\nimport { systemPrefersMode } from 'mode-watcher';\n\ntype FlowInstance = ReturnType;\n\nexport class Tinyflow {\n private options!: TinyflowOptions;\n private rootEl!: Element;\n private svelteFlowInstance!: FlowInstance;\n\n constructor(options: TinyflowOptions) {\n if (typeof options.element !== 'string' && !(options.element instanceof Element)) {\n throw new Error('element must be a string or Element');\n }\n if (!options.defaultTheme || options.defaultTheme === 'system') {\n options.defaultTheme = systemPrefersMode.current;\n }\n this._setOptions(options);\n this._init();\n }\n\n private _init() {\n if (typeof this.options.element === 'string') {\n this.rootEl = document.querySelector(this.options.element)!;\n if (!this.rootEl) {\n throw new Error(\n `element not found by document.querySelector('${this.options.element}')`\n );\n }\n } else if (this.options.element instanceof Element) {\n this.rootEl = this.options.element;\n } else {\n throw new Error('element must be a string or Element');\n }\n\n const tinyflowEl = document.createElement(componentName) as HTMLElement & {\n options: TinyflowOptions;\n onInit: (svelteFlowInstance: FlowInstance) => void;\n };\n tinyflowEl.style.display = 'block';\n tinyflowEl.style.width = '100%';\n tinyflowEl.style.height = '100%';\n tinyflowEl.classList.add(\n ...(this.options.defaultTheme === 'dark' ? ['tf-root', 'dark'] : ['tf-root'])\n );\n\n tinyflowEl.options = this.options;\n tinyflowEl.onInit = (svelteFlowInstance: FlowInstance) => {\n this.svelteFlowInstance = svelteFlowInstance;\n };\n\n this.rootEl.appendChild(tinyflowEl);\n }\n\n private _setOptions(options: TinyflowOptions) {\n this.options = {\n ...options\n };\n }\n\n getOptions() {\n return this.options;\n }\n\n getData() {\n return this.svelteFlowInstance.toObject();\n }\n\n setData(data: TinyflowData) {\n this.options.data = data;\n\n const tinyflowEl = document.createElement(componentName) as HTMLElement & {\n options: TinyflowOptions;\n onInit: (svelteFlowInstance: FlowInstance) => void;\n };\n tinyflowEl.style.display = 'block';\n tinyflowEl.style.width = '100%';\n tinyflowEl.style.height = '100%';\n tinyflowEl.classList.add(\n ...(this.options.defaultTheme === 'dark' ? ['tf-root', 'dark'] : ['tf-root'])\n );\n\n tinyflowEl.options = this.options;\n tinyflowEl.onInit = (svelteFlowInstance: FlowInstance) => {\n this.svelteFlowInstance = svelteFlowInstance;\n };\n\n this.destroy();\n this.rootEl.appendChild(tinyflowEl);\n }\n\n setTheme(theme: 'light' | 'dark' | 'system') {\n if (theme === 'system') {\n this.options.defaultTheme = systemPrefersMode.current;\n } else {\n this.options.defaultTheme = theme;\n }\n this.destroy();\n this._init();\n }\n\n destroy() {\n while (this.rootEl.firstChild) {\n this.rootEl.removeChild(this.rootEl.firstChild);\n }\n }\n}\n","import { type Edge, type Node, type Viewport } from '@xyflow/svelte';\n\nconst createStore = () => {\n let nodesInternal = $state.raw([] as Node[]);\n let edgesInternal = $state.raw([] as Edge[]);\n let viewport = $state.raw({ x: 250, y: 100, zoom: 1 } as Viewport);\n\n return {\n // nodes: nodesInternal,\n // edges: edgesInternal,\n // viewport,\n init: (nodes: Node[], edges: Edge[]) => {\n nodesInternal = nodes;\n edgesInternal = edges;\n },\n\n getNodes: () => nodesInternal,\n setNodes: (nodes: Node[]) => {\n nodesInternal = nodes;\n },\n getEdges: () => edgesInternal,\n setEdges: (edges: Edge[]) => {\n edgesInternal = edges;\n },\n getViewport: () => viewport,\n setViewport: (v: Viewport) => {\n viewport = v;\n },\n\n getNode: (id: string) => nodesInternal.find((node) => node.id === id),\n addNode: (node: Node) => {\n nodesInternal = [...nodesInternal, node];\n },\n removeNode: (id: string) => {\n nodesInternal = nodesInternal.filter((node) => node.id !== id);\n },\n updateNode: (id: string, node: Node) => {\n nodesInternal = nodesInternal.map((n) => (n.id === id ? { ...n, ...node } : n));\n },\n updateNodes: (update: (nodes: Node[]) => Node[]) => {\n nodesInternal = update(nodesInternal);\n },\n updateNodeData: (id: string, data: Node['data']) => {\n nodesInternal = nodesInternal.map((n) =>\n n.id === id ? { ...n, data: { ...n.data, ...data } } : n\n );\n },\n selectNodeOnly: (id: string) => {\n nodesInternal = nodesInternal.map((n) =>\n n.id === id ? { ...n, selected: true } : { ...n, selected: false }\n );\n },\n getEdge: (id: string) => edgesInternal.find((edge) => edge.id === id),\n addEdge: (edge: Edge) => {\n edgesInternal = [...edgesInternal, edge];\n },\n removeEdge: (id: string) => {\n edgesInternal = edgesInternal.filter((edge) => edge.id !== id);\n },\n updateEdge: (id: string, edge: Edge) => {\n edgesInternal = edgesInternal.map((e) => (e.id === id ? { ...e, ...edge } : e));\n },\n updateEdges: (update: (edges: Edge[]) => Edge[]) => {\n edgesInternal = update(edgesInternal);\n },\n updateEdgeData: (id: string, data: Edge['data']) => {\n edgesInternal = edgesInternal.map((e) =>\n e.id === id ? { ...e, data: { ...e.data, ...data } } : e\n );\n }\n };\n};\n\nexport const store = createStore();\n","import { clsx, type ClassValue } from 'clsx';\n\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type WithoutChild = T extends { child?: any } ? Omit : T;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type WithoutChildren = T extends { children?: any } ? Omit : T;\nexport type WithoutChildrenOrChild = WithoutChildren>;\nexport type WithElementRef = T & { ref?: U | null };\n","\n\n\n\n{#if href}\n \n {@render children?.()}\n \n{:else}\n \n {@render children?.()}\n \n{/if}\n","export function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nconst CLASS_VALUE_PRIMITIVE_TYPES = [\"string\", \"number\", \"bigint\", \"boolean\"];\nexport function isClassValue(value) {\n // handle primitive types\n if (value === null || value === undefined)\n return true;\n if (CLASS_VALUE_PRIMITIVE_TYPES.includes(typeof value))\n return true;\n // handle arrays (ClassArray)\n if (Array.isArray(value))\n return value.every((item) => isClassValue(item));\n // handle objects (ClassDictionary)\n if (typeof value === \"object\") {\n // ensure it's a plain object and not some other object type\n if (Object.getPrototypeOf(value) !== Object.prototype)\n return false;\n return true;\n }\n return false;\n}\n","import { isFunction, isObject } from \"../utils/is.js\";\nexport const BoxSymbol = Symbol(\"box\");\nexport const isWritableSymbol = Symbol(\"is-writable\");\nfunction boxWith(getter, setter) {\n const derived = $derived.by(getter);\n if (setter) {\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return derived;\n },\n set current(v) {\n setter(v);\n }\n };\n }\n return {\n [BoxSymbol]: true,\n get current() {\n return getter();\n }\n };\n}\n/**\n * @returns Whether the value is a Box\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction isBox(value) {\n return isObject(value) && BoxSymbol in value;\n}\n/**\n * @returns Whether the value is a WritableBox\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction isWritableBox(value) {\n return isBox(value) && isWritableSymbol in value;\n}\nfunction boxFrom(value) {\n if (isBox(value))\n return value;\n if (isFunction(value))\n return boxWith(value);\n return simpleBox(value);\n}\n/**\n * Function that gets an object of boxes, and returns an object of reactive values\n *\n * @example\n * const count = box(0)\n * const flat = box.flatten({ count, double: box.with(() => count.current) })\n * // type of flat is { count: number, readonly double: number }\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction boxFlatten(boxes) {\n return Object.entries(boxes).reduce((acc, [key, b]) => {\n if (!isBox(b)) {\n return Object.assign(acc, { [key]: b });\n }\n if (isWritableBox(b)) {\n Object.defineProperty(acc, key, {\n get() {\n return b.current;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set(v) {\n b.current = v;\n }\n });\n }\n else {\n Object.defineProperty(acc, key, {\n get() {\n return b.current;\n }\n });\n }\n return acc;\n }, {});\n}\n/**\n * Function that converts a box to a readonly box.\n *\n * @example\n * const count = box(0) // WritableBox\n * const countReadonly = box.readonly(count) // ReadableBox\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction toReadonlyBox(b) {\n if (!isWritableBox(b))\n return b;\n return {\n [BoxSymbol]: true,\n get current() {\n return b.current;\n }\n };\n}\nfunction simpleBox(initialValue) {\n let current = $state(initialValue);\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return current;\n },\n set current(v) {\n current = v;\n }\n };\n}\nexport { boxWith, isBox, isWritableBox, boxFrom, boxFlatten, toReadonlyBox, simpleBox };\n","/**\n * Composes event handlers into a single function that can be called with an event.\n * If the previous handler cancels the event using `event.preventDefault()`, the handlers\n * that follow will not be called.\n */\nexport function composeHandlers(...handlers) {\n return function (e) {\n for (const handler of handlers) {\n if (!handler)\n continue;\n if (e.defaultPrevented)\n return;\n if (typeof handler === \"function\") {\n handler.call(this, e);\n }\n else {\n handler.current?.call(this, e);\n }\n }\n };\n}\n","const NUMBER_CHAR_RE = /\\d/;\nconst STR_SPLITTERS = [\"-\", \"_\", \"/\", \".\"];\nfunction isUppercase(char = \"\") {\n if (NUMBER_CHAR_RE.test(char))\n return undefined;\n return char !== char.toLowerCase();\n}\nfunction splitByCase(str) {\n const parts = [];\n let buff = \"\";\n let previousUpper;\n let previousSplitter;\n for (const char of str) {\n // Splitter\n const isSplitter = STR_SPLITTERS.includes(char);\n if (isSplitter === true) {\n parts.push(buff);\n buff = \"\";\n previousUpper = undefined;\n continue;\n }\n const isUpper = isUppercase(char);\n if (previousSplitter === false) {\n // Case rising edge\n if (previousUpper === false && isUpper === true) {\n parts.push(buff);\n buff = char;\n previousUpper = isUpper;\n continue;\n }\n // Case falling edge\n if (previousUpper === true && isUpper === false && buff.length > 1) {\n const lastChar = buff.at(-1);\n parts.push(buff.slice(0, Math.max(0, buff.length - 1)));\n buff = lastChar + char;\n previousUpper = isUpper;\n continue;\n }\n }\n // Normal char\n buff += char;\n previousUpper = isUpper;\n previousSplitter = isSplitter;\n }\n parts.push(buff);\n return parts;\n}\nexport function pascalCase(str) {\n if (!str)\n return \"\";\n return splitByCase(str)\n .map((p) => upperFirst(p))\n .join(\"\");\n}\nexport function camelCase(str) {\n return lowerFirst(pascalCase(str || \"\"));\n}\nexport function kebabCase(str) {\n return str\n ? splitByCase(str)\n .map((p) => p.toLowerCase())\n .join(\"-\")\n : \"\";\n}\nfunction upperFirst(str) {\n return str ? str[0].toUpperCase() + str.slice(1) : \"\";\n}\nfunction lowerFirst(str) {\n return str ? str[0].toLowerCase() + str.slice(1) : \"\";\n}\n","import parse from \"style-to-object\";\nimport { camelCase, pascalCase } from \"./strings.js\";\nexport function cssToStyleObj(css) {\n if (!css)\n return {};\n const styleObj = {};\n function iterator(name, value) {\n if (name.startsWith(\"-moz-\") ||\n name.startsWith(\"-webkit-\") ||\n name.startsWith(\"-ms-\") ||\n name.startsWith(\"-o-\")) {\n styleObj[pascalCase(name)] = value;\n return;\n }\n if (name.startsWith(\"--\")) {\n styleObj[name] = value;\n return;\n }\n styleObj[camelCase(name)] = value;\n }\n parse(css, iterator);\n return styleObj;\n}\n","/**\n * Executes an array of callback functions with the same arguments.\n * @template T The types of the arguments that the callback functions take.\n * @param callbacks array of callback functions to execute.\n * @returns A new function that executes all of the original callback functions with the same arguments.\n */\nexport function executeCallbacks(...callbacks) {\n return (...args) => {\n for (const callback of callbacks) {\n if (typeof callback === \"function\") {\n callback(...args);\n }\n }\n };\n}\n","function createParser(matcher, replacer) {\n const regex = RegExp(matcher, \"g\");\n return (str) => {\n // throw an error if not a string\n if (typeof str !== \"string\") {\n throw new TypeError(`expected an argument of type string, but got ${typeof str}`);\n }\n // if no match between string and matcher\n if (!str.match(regex))\n return str;\n // executes the replacer function for each match\n return str.replace(regex, replacer);\n };\n}\nconst camelToKebab = createParser(/[A-Z]/, (match) => `-${match.toLowerCase()}`);\nexport function styleToCSS(styleObj) {\n if (!styleObj || typeof styleObj !== \"object\" || Array.isArray(styleObj)) {\n throw new TypeError(`expected an argument of type object, but got ${typeof styleObj}`);\n }\n return Object.keys(styleObj)\n .map((property) => `${camelToKebab(property)}: ${styleObj[property]};`)\n .join(\"\\n\");\n}\n","import { styleToCSS } from \"./style-to-css.js\";\nexport function styleToString(style = {}) {\n return styleToCSS(style).replace(\"\\n\", \" \");\n}\n","const EVENT_LIST = [\n \"onabort\",\n \"onanimationcancel\",\n \"onanimationend\",\n \"onanimationiteration\",\n \"onanimationstart\",\n \"onauxclick\",\n \"onbeforeinput\",\n \"onbeforetoggle\",\n \"onblur\",\n \"oncancel\",\n \"oncanplay\",\n \"oncanplaythrough\",\n \"onchange\",\n \"onclick\",\n \"onclose\",\n \"oncompositionend\",\n \"oncompositionstart\",\n \"oncompositionupdate\",\n \"oncontextlost\",\n \"oncontextmenu\",\n \"oncontextrestored\",\n \"oncopy\",\n \"oncuechange\",\n \"oncut\",\n \"ondblclick\",\n \"ondrag\",\n \"ondragend\",\n \"ondragenter\",\n \"ondragleave\",\n \"ondragover\",\n \"ondragstart\",\n \"ondrop\",\n \"ondurationchange\",\n \"onemptied\",\n \"onended\",\n \"onerror\",\n \"onfocus\",\n \"onfocusin\",\n \"onfocusout\",\n \"onformdata\",\n \"ongotpointercapture\",\n \"oninput\",\n \"oninvalid\",\n \"onkeydown\",\n \"onkeypress\",\n \"onkeyup\",\n \"onload\",\n \"onloadeddata\",\n \"onloadedmetadata\",\n \"onloadstart\",\n \"onlostpointercapture\",\n \"onmousedown\",\n \"onmouseenter\",\n \"onmouseleave\",\n \"onmousemove\",\n \"onmouseout\",\n \"onmouseover\",\n \"onmouseup\",\n \"onpaste\",\n \"onpause\",\n \"onplay\",\n \"onplaying\",\n \"onpointercancel\",\n \"onpointerdown\",\n \"onpointerenter\",\n \"onpointerleave\",\n \"onpointermove\",\n \"onpointerout\",\n \"onpointerover\",\n \"onpointerup\",\n \"onprogress\",\n \"onratechange\",\n \"onreset\",\n \"onresize\",\n \"onscroll\",\n \"onscrollend\",\n \"onsecuritypolicyviolation\",\n \"onseeked\",\n \"onseeking\",\n \"onselect\",\n \"onselectionchange\",\n \"onselectstart\",\n \"onslotchange\",\n \"onstalled\",\n \"onsubmit\",\n \"onsuspend\",\n \"ontimeupdate\",\n \"ontoggle\",\n \"ontouchcancel\",\n \"ontouchend\",\n \"ontouchmove\",\n \"ontouchstart\",\n \"ontransitioncancel\",\n \"ontransitionend\",\n \"ontransitionrun\",\n \"ontransitionstart\",\n \"onvolumechange\",\n \"onwaiting\",\n \"onwebkitanimationend\",\n \"onwebkitanimationiteration\",\n \"onwebkitanimationstart\",\n \"onwebkittransitionend\",\n \"onwheel\"\n];\nexport const EVENT_LIST_SET = new Set(EVENT_LIST);\n","/**\n * Modified from https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/utils/src/mergeProps.ts (see NOTICE.txt for source)\n */\nimport { clsx } from \"clsx\";\nimport { composeHandlers } from \"./compose-handlers.js\";\nimport { cssToStyleObj } from \"./css-to-style-obj.js\";\nimport { isClassValue } from \"./is.js\";\nimport { executeCallbacks } from \"./execute-callbacks.js\";\nimport { styleToString } from \"./style.js\";\nimport { EVENT_LIST_SET } from \"./event-list.js\";\nfunction isEventHandler(key) {\n return EVENT_LIST_SET.has(key);\n}\n/**\n * Given a list of prop objects, merges them into a single object.\n * - Automatically composes event handlers (e.g. `onclick`, `oninput`, etc.)\n * - Chains regular functions with the same name so they are called in order\n * - Merges class strings with `clsx`\n * - Merges style objects and converts them to strings\n * - Handles a bug with Svelte where setting the `hidden` attribute to `false` doesn't remove it\n * - Overrides other values with the last one\n */\nexport function mergeProps(...args) {\n const result = { ...args[0] };\n for (let i = 1; i < args.length; i++) {\n const props = args[i];\n if (!props)\n continue;\n // Handle string keys\n for (const key of Object.keys(props)) {\n const a = result[key];\n const b = props[key];\n const aIsFunction = typeof a === \"function\";\n const bIsFunction = typeof b === \"function\";\n // compose event handlers\n if (aIsFunction && typeof bIsFunction && isEventHandler(key)) {\n // handle merging of event handlers\n const aHandler = a;\n const bHandler = b;\n result[key] = composeHandlers(aHandler, bHandler);\n }\n else if (aIsFunction && bIsFunction) {\n // chain non-event handler functions\n result[key] = executeCallbacks(a, b);\n }\n else if (key === \"class\") {\n // handle merging acceptable class values from clsx\n const aIsClassValue = isClassValue(a);\n const bIsClassValue = isClassValue(b);\n if (aIsClassValue && bIsClassValue) {\n result[key] = clsx(a, b);\n }\n else if (aIsClassValue) {\n result[key] = clsx(a);\n }\n else if (bIsClassValue) {\n result[key] = clsx(b);\n }\n }\n else if (key === \"style\") {\n const aIsObject = typeof a === \"object\";\n const bIsObject = typeof b === \"object\";\n const aIsString = typeof a === \"string\";\n const bIsString = typeof b === \"string\";\n if (aIsObject && bIsObject) {\n // both are style objects, merge them\n result[key] = { ...a, ...b };\n }\n else if (aIsObject && bIsString) {\n // a is style object, b is string, convert b to style object and merge\n const parsedStyle = cssToStyleObj(b);\n result[key] = { ...a, ...parsedStyle };\n }\n else if (aIsString && bIsObject) {\n // a is string, b is style object, convert a to style object and merge\n const parsedStyle = cssToStyleObj(a);\n result[key] = { ...parsedStyle, ...b };\n }\n else if (aIsString && bIsString) {\n // both are strings, convert both to objects and merge\n const parsedStyleA = cssToStyleObj(a);\n const parsedStyleB = cssToStyleObj(b);\n result[key] = { ...parsedStyleA, ...parsedStyleB };\n }\n else if (aIsObject) {\n result[key] = a;\n }\n else if (bIsObject) {\n result[key] = b;\n }\n else if (aIsString) {\n result[key] = a;\n }\n else if (bIsString) {\n result[key] = b;\n }\n }\n else {\n // override other values\n result[key] = b !== undefined ? b : a;\n }\n }\n // handle symbol keys (mostly for `Attachments`)\n for (const key of Object.getOwnPropertySymbols(props)) {\n const a = result[key];\n const b = props[key];\n // for matching symbols, we just override\n result[key] = b !== undefined ? b : a;\n }\n }\n // convert style object to string\n if (typeof result.style === \"object\") {\n result.style = styleToString(result.style).replaceAll(\"\\n\", \" \");\n }\n // handle weird svelte bug where `hidden` is not removed when set to `false`\n if (result.hidden === false) {\n result.hidden = undefined;\n delete result.hidden;\n }\n // handle weird svelte bug where `disabled` is not removed when set to `false`\n if (result.disabled === false) {\n result.disabled = undefined;\n delete result.disabled;\n }\n return result;\n}\n","import { styleToString } from \"./style.js\";\nexport const srOnlyStyles = {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: \"0\",\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n borderWidth: \"0\",\n transform: \"translateX(-100%)\"\n};\nexport const srOnlyStylesString = styleToString(srOnlyStyles);\n","import { BROWSER } from \"esm-env\";\nexport const defaultWindow = BROWSER && typeof window !== \"undefined\" ? window : undefined;\nexport const defaultDocument = BROWSER && typeof window !== \"undefined\" ? window.document : undefined;\nexport const defaultNavigator = BROWSER && typeof window !== \"undefined\" ? window.navigator : undefined;\nexport const defaultLocation = BROWSER && typeof window !== \"undefined\" ? window.location : undefined;\n","import { defaultDocument } from \"../configurable-globals.js\";\n/**\n * Handles getting the active element in a document or shadow root.\n * If the active element is within a shadow root, it will traverse the shadow root\n * to find the active element.\n * If not, it will return the active element in the document.\n *\n * @param document A document or shadow root to get the active element from.\n * @returns The active element in the document or shadow root.\n */\nexport function getActiveElement(document) {\n let activeElement = document.activeElement;\n while (activeElement?.shadowRoot) {\n const node = activeElement.shadowRoot.activeElement;\n if (node === activeElement)\n break;\n else\n activeElement = node;\n }\n return activeElement;\n}\n/**\n * Returns the owner document of a given element.\n *\n * @param node The element to get the owner document from.\n * @returns\n */\nexport function getOwnerDocument(node, fallback = defaultDocument) {\n return node?.ownerDocument ?? fallback;\n}\n/**\n * Checks if an element is or is contained by another element.\n *\n * @param node The element to check if it or its descendants contain the target element.\n * @param target The element to check if it is contained by the node.\n * @returns\n */\nexport function isOrContainsTarget(node, target) {\n return node === target || node.contains(target);\n}\n","import { defaultWindow, } from \"../../internal/configurable-globals.js\";\nimport { getActiveElement } from \"../../internal/utils/dom.js\";\nimport { on } from \"svelte/events\";\nimport { createSubscriber } from \"svelte/reactivity\";\nexport class ActiveElement {\n #document;\n #subscribe;\n constructor(options = {}) {\n const { window = defaultWindow, document = window?.document } = options;\n if (window === undefined)\n return;\n this.#document = document;\n this.#subscribe = createSubscriber((update) => {\n const cleanupFocusIn = on(window, \"focusin\", update);\n const cleanupFocusOut = on(window, \"focusout\", update);\n return () => {\n cleanupFocusIn();\n cleanupFocusOut();\n };\n });\n }\n get current() {\n this.#subscribe?.();\n if (!this.#document)\n return null;\n return getActiveElement(this.#document);\n }\n}\n/**\n * An object holding a reactive value that is equal to `document.activeElement`.\n * It automatically listens for changes, keeping the reference up to date.\n *\n * If you wish to use a custom document or shadowRoot, you should use\n * [useActiveElement](https://runed.dev/docs/utilities/active-element) instead.\n *\n * @see {@link https://runed.dev/docs/utilities/active-element}\n */\nexport const activeElement = new ActiveElement();\n","export function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nexport function isElement(value) {\n return value instanceof Element;\n}\n","import { getContext, hasContext, setContext } from \"svelte\";\nexport class Context {\n #name;\n #key;\n /**\n * @param name The name of the context.\n * This is used for generating the context key and error messages.\n */\n constructor(name) {\n this.#name = name;\n this.#key = Symbol(name);\n }\n /**\n * The key used to get and set the context.\n *\n * It is not recommended to use this value directly.\n * Instead, use the methods provided by this class.\n */\n get key() {\n return this.#key;\n }\n /**\n * Checks whether this has been set in the context of a parent component.\n *\n * Must be called during component initialisation.\n */\n exists() {\n return hasContext(this.#key);\n }\n /**\n * Retrieves the context that belongs to the closest parent component.\n *\n * Must be called during component initialisation.\n *\n * @throws An error if the context does not exist.\n */\n get() {\n const context = getContext(this.#key);\n if (context === undefined) {\n throw new Error(`Context \"${this.#name}\" not found`);\n }\n return context;\n }\n /**\n * Retrieves the context that belongs to the closest parent component,\n * or the given fallback value if the context does not exist.\n *\n * Must be called during component initialisation.\n */\n getOr(fallback) {\n const context = getContext(this.#key);\n if (context === undefined) {\n return fallback;\n }\n return context;\n }\n /**\n * Associates the given value with the current component and returns it.\n *\n * Must be called during component initialisation.\n */\n set(context) {\n return setContext(this.#key, context);\n }\n}\n","import { untrack } from \"svelte\";\nfunction runEffect(flush, effect) {\n switch (flush) {\n case \"post\":\n $effect(effect);\n break;\n case \"pre\":\n $effect.pre(effect);\n break;\n }\n}\nfunction runWatcher(sources, flush, effect, options = {}) {\n const { lazy = false } = options;\n // Run the effect immediately if `lazy` is `false`.\n let active = !lazy;\n // On the first run, if the dependencies are an array, pass an empty array\n // to the previous value instead of `undefined` to allow destructuring.\n //\n // watch(() => [a, b], ([a, b], [prevA, prevB]) => { ... });\n let previousValues = Array.isArray(sources)\n ? []\n : undefined;\n runEffect(flush, () => {\n const values = Array.isArray(sources) ? sources.map((source) => source()) : sources();\n if (!active) {\n active = true;\n previousValues = values;\n return;\n }\n const cleanup = untrack(() => effect(values, previousValues));\n previousValues = values;\n return cleanup;\n });\n}\nfunction runWatcherOnce(sources, flush, effect) {\n const cleanupRoot = $effect.root(() => {\n let stop = false;\n runWatcher(sources, flush, (values, previousValues) => {\n if (stop) {\n cleanupRoot();\n return;\n }\n // Since `lazy` is `true`, `previousValues` is always defined.\n const cleanup = effect(values, previousValues);\n stop = true;\n return cleanup;\n }, \n // Running the effect immediately just once makes no sense at all.\n // That's just `onMount` with extra steps.\n { lazy: true });\n });\n $effect(() => {\n return cleanupRoot;\n });\n}\nexport function watch(sources, effect, options) {\n runWatcher(sources, \"post\", effect, options);\n}\nfunction watchPre(sources, effect, options) {\n runWatcher(sources, \"pre\", effect, options);\n}\nwatch.pre = watchPre;\nexport function watchOnce(source, effect) {\n runWatcherOnce(source, \"post\", effect);\n}\nfunction watchOncePre(source, effect) {\n runWatcherOnce(source, \"pre\", effect);\n}\nwatchOnce.pre = watchOncePre;\n","import { isFunction } from \"./is.js\";\nexport function get(value) {\n if (isFunction(value)) {\n return value();\n }\n return value;\n}\n","import { defaultWindow } from \"../../internal/configurable-globals.js\";\nimport { get } from \"../../internal/utils/get.js\";\nimport { createSubscriber } from \"svelte/reactivity\";\n/**\n * Returns a reactive value holding the size of `node`.\n *\n * Accepts an `options` object with the following properties:\n * - `initialSize`: The initial size of the element. Defaults to `{ width: 0, height: 0 }`.\n * - `box`: The box model to use. Can be either `\"content-box\"` or `\"border-box\"`. Defaults to `\"border-box\"`.\n *\n * @returns an object with `width` and `height` properties.\n *\n * @see {@link https://runed.dev/docs/utilities/element-size}\n */\nexport class ElementSize {\n // no need to use `$state` here since we are using createSubscriber\n #size = {\n width: 0,\n height: 0,\n };\n #observed = false;\n #options;\n #node;\n #window;\n // we use a derived here to extract the width so that if the width doesn't change we don't get a state update\n // which we would get if we would just use a getter since the version of the subscriber will be changing\n #width = $derived.by(() => {\n this.#subscribe?.();\n return this.getSize().width;\n });\n // we use a derived here to extract the height so that if the height doesn't change we don't get a state update\n // which we would get if we would just use a getter since the version of the subscriber will be changing\n #height = $derived.by(() => {\n this.#subscribe?.();\n return this.getSize().height;\n });\n // we need to use a derived here because the class will be created before the node is bound to the ref\n #subscribe = $derived.by(() => {\n const node$ = get(this.#node);\n if (!node$)\n return;\n return createSubscriber((update) => {\n if (!this.#window)\n return;\n const observer = new this.#window.ResizeObserver((entries) => {\n this.#observed = true;\n for (const entry of entries) {\n const boxSize = this.#options.box === \"content-box\" ? entry.contentBoxSize : entry.borderBoxSize;\n const boxSizeArr = Array.isArray(boxSize) ? boxSize : [boxSize];\n this.#size.width = boxSizeArr.reduce((acc, size) => Math.max(acc, size.inlineSize), 0);\n this.#size.height = boxSizeArr.reduce((acc, size) => Math.max(acc, size.blockSize), 0);\n }\n update();\n });\n observer.observe(node$);\n return () => {\n this.#observed = false;\n observer.disconnect();\n };\n });\n });\n constructor(node, options = { box: \"border-box\" }) {\n this.#window = options.window ?? defaultWindow;\n this.#options = options;\n this.#node = node;\n this.#size = {\n width: 0,\n height: 0,\n };\n }\n calculateSize() {\n const element = get(this.#node);\n // no element or no window, return undefined, we will return 0x0 in the getSize method\n if (!element || !this.#window) {\n return;\n }\n const offsetWidth = element.offsetWidth;\n const offsetHeight = element.offsetHeight;\n // easy mode, just return offsets\n if (this.#options.box === \"border-box\") {\n return {\n width: offsetWidth,\n height: offsetHeight,\n };\n }\n // hard mode, we need to calculate the content size\n const style = this.#window.getComputedStyle(element);\n const paddingWidth = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\n const paddingHeight = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n const borderWidth = parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);\n const borderHeight = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n const contentWidth = offsetWidth - paddingWidth - borderWidth;\n const contentHeight = offsetHeight - paddingHeight - borderHeight;\n return {\n width: contentWidth,\n height: contentHeight,\n };\n }\n getSize() {\n // if the resize observer already run we can just return the size\n // otherwise we calculate the size if possible or we return the initial size\n return this.#observed ? this.#size : (this.calculateSize() ?? this.#size);\n }\n get current() {\n this.#subscribe?.();\n return this.getSize();\n }\n get width() {\n return this.#width;\n }\n get height() {\n return this.#height;\n }\n}\n","/**\n * Holds the previous value of a getter.\n *\n * @see {@link https://runed.dev/docs/utilities/previous}\n */\nexport class Previous {\n #previousCallback = () => undefined;\n #previous = $derived.by(() => this.#previousCallback());\n constructor(getter, initialValue) {\n let actualPrevious = undefined;\n if (initialValue !== undefined)\n actualPrevious = initialValue;\n this.#previousCallback = () => {\n try {\n return actualPrevious;\n }\n finally {\n actualPrevious = getter();\n }\n };\n }\n get current() {\n return this.#previous;\n }\n}\n","export function onDestroyEffect(fn) {\n $effect(() => {\n return () => {\n fn();\n };\n });\n}\n","import { untrack } from \"svelte\";\nexport function onMountEffect(fn) {\n $effect(() => {\n const cleanup = untrack(() => fn());\n return cleanup;\n });\n}\n","/**\n * A utility function that executes a callback after a specified number of milliseconds.\n */\nexport function afterSleep(ms, cb) {\n return setTimeout(cb, ms);\n}\n","import { tick } from \"svelte\";\nexport function afterTick(fn) {\n tick().then(fn);\n}\n","import { isObject } from \"./is.js\";\nconst ELEMENT_NODE = 1;\nconst DOCUMENT_NODE = 9;\nconst DOCUMENT_FRAGMENT_NODE = 11;\nexport function isHTMLElement(node) {\n return isObject(node) && node.nodeType === ELEMENT_NODE && typeof node.nodeName === \"string\";\n}\nexport function isDocument(node) {\n return isObject(node) && node.nodeType === DOCUMENT_NODE;\n}\nexport function isWindow(node) {\n return isObject(node) && node.constructor?.name === \"VisualViewport\";\n}\nexport function getNodeName(node) {\n if (isHTMLElement(node))\n return node.localName ?? \"\";\n return \"#document\";\n}\nexport function isNode(node) {\n return isObject(node) && node.nodeType !== undefined;\n}\nexport function isShadowRoot(node) {\n return isNode(node) && node.nodeType === DOCUMENT_FRAGMENT_NODE && \"host\" in node;\n}\nexport function contains(parent, child) {\n if (!parent || !child)\n return false;\n if (!isHTMLElement(parent) || !isHTMLElement(child))\n return false;\n const rootNode = child.getRootNode?.();\n if (parent === child)\n return true;\n if (parent.contains(child))\n return true;\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next)\n return true;\n // @ts-expect-error - host is not typed\n next = next.parentNode || next.host;\n }\n }\n return false;\n}\nexport function getDocument(node) {\n if (isDocument(node))\n return node;\n if (isWindow(node))\n return node.document;\n return node?.ownerDocument ?? document;\n}\nexport function getDocumentElement(node) {\n return getDocument(node).documentElement;\n}\nexport function getWindow(node) {\n if (isShadowRoot(node))\n return getWindow(node.host);\n if (isDocument(node))\n return node.defaultView ?? window;\n if (isHTMLElement(node))\n return node.ownerDocument?.defaultView ?? window;\n return window;\n}\nexport function getActiveElement(rootNode) {\n let activeElement = rootNode.activeElement;\n while (activeElement?.shadowRoot) {\n const el = activeElement.shadowRoot.activeElement;\n if (el === activeElement)\n break;\n else\n activeElement = el;\n }\n return activeElement;\n}\nexport function getParentNode(node) {\n if (getNodeName(node) === \"html\")\n return node;\n const result = \n // @ts-expect-error - assignedSlot is not typed\n node.assignedSlot ||\n node.parentNode ||\n (isShadowRoot(node) && node.host) ||\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\n","import { boxWith } from \"../box/box-extras.svelte.js\";\nimport { getActiveElement, getDocument } from \"./dom.js\";\nexport class DOMContext {\n element;\n root = $derived.by(() => {\n if (!this.element.current)\n return document;\n const rootNode = this.element.current.getRootNode() ?? document;\n return rootNode;\n });\n constructor(element) {\n if (typeof element === \"function\") {\n this.element = boxWith(element);\n }\n else {\n this.element = element;\n }\n }\n getDocument = () => {\n return getDocument(this.root);\n };\n getWindow = () => {\n return this.getDocument().defaultView ?? window;\n };\n getActiveElement = () => {\n return getActiveElement(this.root);\n };\n isActiveElement = (node) => {\n return node === this.getActiveElement();\n };\n getElementById(id) {\n return this.root.getElementById(id);\n }\n querySelector = (selector) => {\n if (!this.root)\n return null;\n return this.root.querySelector(selector);\n };\n querySelectorAll = (selector) => {\n if (!this.root)\n return [];\n return this.root.querySelectorAll(selector);\n };\n setTimeout = (callback, delay) => {\n return this.getWindow().setTimeout(callback, delay);\n };\n clearTimeout = (timeoutId) => {\n return this.getWindow().clearTimeout(timeoutId);\n };\n}\n","import { untrack } from \"svelte\";\nimport { isBox } from \"../box/box-extras.svelte.js\";\nimport { createAttachmentKey } from \"svelte/attachments\";\n/**\n * Creates a Svelte Attachment that attaches a DOM element to a ref.\n * The ref can be either a WritableBox or a callback function.\n *\n * @param ref - Either a WritableBox to store the element in, or a callback function that receives the element\n * @param onChange - Optional callback that fires when the ref changes\n * @returns An object with a spreadable attachment key that should be spread onto the element\n *\n * @example\n * // Using with WritableBox\n * const ref = box(null);\n *
Content
\n *\n * @example\n * // Using with callback\n *
myNode = node)}>Content
\n *\n * @example\n * // Using with onChange\n *
console.log(node))}>Content
\n */\nexport function attachRef(ref, onChange) {\n return {\n [createAttachmentKey()]: (node) => {\n if (isBox(ref)) {\n ref.current = node;\n untrack(() => onChange?.(node));\n return () => {\n // we don't want to detach the node if it's still connected\n if (\"isConnected\" in node && node.isConnected)\n return;\n ref.current = null;\n onChange?.(null);\n };\n }\n ref(node);\n untrack(() => onChange?.(node));\n return () => {\n // we don't want to detach the node if it's still connected\n if (\"isConnected\" in node && node.isConnected)\n return;\n ref(null);\n onChange?.(null);\n };\n }\n };\n}\n","export function boolToStr(condition) {\n return condition ? \"true\" : \"false\";\n}\nexport function boolToStrTrueOrUndef(condition) {\n return condition ? \"true\" : undefined;\n}\nexport function boolToEmptyStrOrUndef(condition) {\n return condition ? \"\" : undefined;\n}\nexport function boolToTrueOrUndef(condition) {\n return condition ? true : undefined;\n}\nexport function getDataOpenClosed(condition) {\n return condition ? \"open\" : \"closed\";\n}\nexport function getDataChecked(condition) {\n return condition ? \"checked\" : \"unchecked\";\n}\nexport function getAriaChecked(checked, indeterminate) {\n if (indeterminate) {\n return \"mixed\";\n }\n return checked ? \"true\" : \"false\";\n}\nexport class BitsAttrs {\n #variant;\n #prefix;\n attrs;\n constructor(config) {\n this.#variant = config.getVariant ? config.getVariant() : null;\n this.#prefix = this.#variant ? `data-${this.#variant}-` : `data-${config.component}-`;\n this.getAttr = this.getAttr.bind(this);\n this.selector = this.selector.bind(this);\n this.attrs = Object.fromEntries(config.parts.map((part) => [part, this.getAttr(part)]));\n }\n getAttr(part, variantOverride) {\n if (variantOverride)\n return `data-${variantOverride}-${part}`;\n return `${this.#prefix}${part}`;\n }\n selector(part, variantOverride) {\n return `[${this.getAttr(part, variantOverride)}]`;\n }\n}\nexport function createBitsAttrs(config) {\n const bitsAttrs = new BitsAttrs(config);\n return {\n ...bitsAttrs.attrs,\n selector: bitsAttrs.selector,\n getAttr: bitsAttrs.getAttr,\n };\n}\n","export const ALT = \"Alt\";\nexport const ARROW_DOWN = \"ArrowDown\";\nexport const ARROW_LEFT = \"ArrowLeft\";\nexport const ARROW_RIGHT = \"ArrowRight\";\nexport const ARROW_UP = \"ArrowUp\";\nexport const BACKSPACE = \"Backspace\";\nexport const CAPS_LOCK = \"CapsLock\";\nexport const CONTROL = \"Control\";\nexport const DELETE = \"Delete\";\nexport const END = \"End\";\nexport const ENTER = \"Enter\";\nexport const ESCAPE = \"Escape\";\nexport const F1 = \"F1\";\nexport const F10 = \"F10\";\nexport const F11 = \"F11\";\nexport const F12 = \"F12\";\nexport const F2 = \"F2\";\nexport const F3 = \"F3\";\nexport const F4 = \"F4\";\nexport const F5 = \"F5\";\nexport const F6 = \"F6\";\nexport const F7 = \"F7\";\nexport const F8 = \"F8\";\nexport const F9 = \"F9\";\nexport const HOME = \"Home\";\nexport const META = \"Meta\";\nexport const PAGE_DOWN = \"PageDown\";\nexport const PAGE_UP = \"PageUp\";\nexport const SHIFT = \"Shift\";\nexport const SPACE = \" \";\nexport const TAB = \"Tab\";\nexport const CTRL = \"Control\";\nexport const ASTERISK = \"*\";\nexport const a = \"a\";\nexport const P = \"P\";\nexport const A = \"A\";\nexport const p = \"p\";\nexport const n = \"n\";\nexport const j = \"j\";\nexport const k = \"k\";\nexport const h = \"h\";\nexport const l = \"l\";\n","export const isBrowser = typeof document !== \"undefined\";\nexport const isIOS = getIsIOS();\nfunction getIsIOS() {\n return (isBrowser &&\n window?.navigator?.userAgent &&\n (/iP(ad|hone|od)/.test(window.navigator.userAgent) ||\n // The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh.\n (window?.navigator?.maxTouchPoints > 2 &&\n /iPad|Macintosh/.test(window?.navigator.userAgent))));\n}\nexport function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isHTMLElement(element) {\n return element instanceof HTMLElement;\n}\nexport function isElement(element) {\n return element instanceof Element;\n}\nexport function isElementOrSVGElement(element) {\n return element instanceof Element || element instanceof SVGElement;\n}\nexport function isNumberString(value) {\n return !Number.isNaN(Number(value)) && !Number.isNaN(Number.parseFloat(value));\n}\nexport function isNull(value) {\n return value === null;\n}\nexport function isTouch(e) {\n return e.pointerType === \"touch\";\n}\nexport function isFocusVisible(element) {\n return element.matches(\":focus-visible\");\n}\nexport function isNotNull(value) {\n return value !== null;\n}\n/**\n * Determines if the provided object is a valid `HTMLInputElement` with\n * a `select` method available.\n */\nexport function isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\n/**\n * Given a node, determine if it is hidden by walking up the\n * DOM tree until we hit the `stopAt` node (exclusive), if provided)\n * otherwise we stop at the document root.\n */\nexport function isElementHidden(node, stopAt) {\n if (getComputedStyle(node).visibility === \"hidden\")\n return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (stopAt !== undefined && node === stopAt)\n return false;\n if (getComputedStyle(node).display === \"none\")\n return true;\n node = node.parentElement;\n }\n return false;\n}\n","import { afterTick, onDestroyEffect } from \"svelte-toolbelt\";\nexport class AnimationsComplete {\n #opts;\n #currentFrame = null;\n constructor(opts) {\n this.#opts = opts;\n onDestroyEffect(() => this.#cleanup());\n }\n #cleanup() {\n if (!this.#currentFrame)\n return;\n window.cancelAnimationFrame(this.#currentFrame);\n this.#currentFrame = null;\n }\n run(fn) {\n // if already running, cleanup and restart\n this.#cleanup();\n const node = this.#opts.ref.current;\n if (!node)\n return;\n if (typeof node.getAnimations !== \"function\") {\n this.#executeCallback(fn);\n return;\n }\n this.#currentFrame = window.requestAnimationFrame(() => {\n const animations = node.getAnimations();\n if (animations.length === 0) {\n this.#executeCallback(fn);\n return;\n }\n Promise.allSettled(animations.map((animation) => animation.finished)).then(() => {\n this.#executeCallback(fn);\n });\n });\n }\n #executeCallback(fn) {\n const execute = () => {\n fn();\n };\n if (this.#opts.afterTick) {\n afterTick(execute);\n }\n else {\n execute();\n }\n }\n}\n","import { watch } from \"runed\";\nimport { AnimationsComplete } from \"./animations-complete.js\";\nexport class PresenceManager {\n #opts;\n #enabled;\n #afterAnimations;\n #shouldRender = $state(false);\n constructor(opts) {\n this.#opts = opts;\n this.#shouldRender = opts.open.current;\n this.#enabled = opts.enabled ?? true;\n this.#afterAnimations = new AnimationsComplete({\n ref: this.#opts.ref,\n afterTick: this.#opts.open,\n });\n watch(() => this.#opts.open.current, (isOpen) => {\n if (isOpen)\n this.#shouldRender = true;\n if (!this.#enabled)\n return;\n this.#afterAnimations.run(() => {\n if (isOpen === this.#opts.open.current) {\n if (!this.#opts.open.current) {\n this.#shouldRender = false;\n }\n this.#opts.onComplete?.();\n }\n });\n });\n }\n get shouldRender() {\n return this.#shouldRender;\n }\n}\n","/**\n * A no operation function (does nothing)\n */\nexport function noop() { }\n","export function createId(prefixOrUid, uid) {\n if (uid === undefined)\n return `bits-${prefixOrUid}`;\n return `bits-${prefixOrUid}-${uid}`;\n}\n","\n\n{#key children}\n\t{@render children?.()}\n{/key}\n","import { Context } from \"runed\";\nimport { boxWith } from \"svelte-toolbelt\";\nexport const BitsConfigContext = new Context(\"BitsConfig\");\n/**\n * Gets the current Bits UI configuration state from the context.\n *\n * Returns a default configuration (where all values are `undefined`) if no configuration is found.\n */\nexport function getBitsConfig() {\n const fallback = new BitsConfigState(null, {});\n return BitsConfigContext.getOr(fallback).opts;\n}\n/**\n * Creates and sets a new Bits UI configuration state that inherits from parent configs.\n *\n * @param opts - Configuration options for this level\n * @returns The configuration state instance\n *\n * @example\n * ```typescript\n * // In a component that wants to set a default portal target\n * const config = useBitsConfig({ defaultPortalTo: box(\"#some-element\") });\n *\n * // Child components will inherit this config and can override specific values\n * const childConfig = useBitsConfig({ someOtherProp: box(\"value\") });\n * // childConfig still has defaultPortalTo=\"#some-element\" from parent\n * ```\n */\nexport function useBitsConfig(opts) {\n return BitsConfigContext.set(new BitsConfigState(BitsConfigContext.getOr(null), opts));\n}\n/**\n * Configuration state that inherits from parent configurations.\n *\n * @example\n * Config resolution:\n * ```\n * Level 1: { defaultPortalTo: \"#some-element\", theme: \"dark\" }\n * Level 2: { spacing: \"large\" } // inherits defaultPortalTo=\"#some-element\", theme=\"dark\"\n * Level 3: { theme: \"light\" } // inherits defaultPortalTo=\"#some-element\", spacing=\"large\", overrides theme=\"light\"\n * ```\n */\nexport class BitsConfigState {\n opts;\n constructor(parent, opts) {\n const resolveConfigOption = createConfigResolver(parent, opts);\n this.opts = {\n defaultPortalTo: resolveConfigOption((config) => config.defaultPortalTo),\n defaultLocale: resolveConfigOption((config) => config.defaultLocale),\n };\n }\n}\n/**\n * Returns a config resolver that resolves a given config option's value.\n *\n * The resolver creates reactive boxes that resolve config option values using this priority:\n * 1. Current level's value (if defined)\n * 2. Parent level's value (if defined and current is undefined)\n * 3. `undefined` (if no value is found in either parent or child)\n *\n * @param parent - Parent configuration state (null if this is root level)\n * @param currentOpts - Current level's configuration options\n *\n * @example\n * ```typescript\n * // Given this hierarchy:\n * // Root: { defaultPortalTo: \"#some-element\" }\n * // Child: { someOtherProp: \"value\" } // no defaultPortalTo specified\n *\n * const resolveConfigOption = createConfigResolver(parent, opts);\n * const portalTo = resolveConfigOption(config => config.defaultPortalTo);\n *\n * // portalTo.current === \"#some-element\" (inherited from parent)\n * // even when child didn't specify `defaultPortalTo`\n * ```\n */\nfunction createConfigResolver(parent, currentOpts) {\n return (getter) => {\n const configOption = boxWith(() => {\n // try current opts first\n const value = getter(currentOpts)?.current;\n if (value !== undefined)\n return value;\n // if no parent, return undefined\n if (parent === null)\n return undefined;\n // get value from parent (which already has its own chain resolved)\n return getter(parent.opts)?.current;\n });\n return configOption;\n };\n}\n","import { boxWith } from \"svelte-toolbelt\";\nimport { getBitsConfig } from \"./bits-config.js\";\n/**\n * Creates a generic prop resolver that follows a standard priority chain:\n * 1. The getter's prop value (if defined)\n * 2. The config default value (if no getter prop value is defined)\n * 3. The fallback value (if no config value found)\n */\nfunction createPropResolver(configOption, fallback) {\n return (getProp) => {\n const config = getBitsConfig();\n return boxWith(() => {\n // 1. return the prop's value, if provided\n const propValue = getProp();\n if (propValue !== undefined)\n return propValue;\n // 2. return the resolved config option value, if available\n const option = configOption(config).current;\n if (option !== undefined)\n return option;\n // 3. return the fallback if no other value is found\n return fallback;\n });\n };\n}\n/**\n * Resolves a locale value using the prop, the config default, or a fallback.\n *\n * Default value: `\"en\"`\n */\nexport const resolveLocaleProp = createPropResolver((config) => config.defaultLocale, \"en\");\n/**\n * Resolves a portal's `to` value using the prop, the config default, or a fallback.\n *\n * Default value: `\"body\"`\n */\nexport const resolvePortalToProp = createPropResolver((config) => config.defaultPortalTo, \"body\");\n","\n\n{#if disabled}\n\t{@render children?.()}\n{/if}\n","// oxlint-disable-next-line no-explicit-any\nexport function debounce(fn, wait = 500) {\n let timeout = null;\n const debounced = (...args) => {\n if (timeout !== null) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(() => {\n fn(...args);\n }, wait);\n };\n debounced.destroy = () => {\n if (timeout !== null) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n return debounced;\n}\n","export function isOrContainsTarget(node, target) {\n return node === target || node.contains(target);\n}\nexport function getOwnerDocument(el) {\n return el?.ownerDocument ?? document;\n}\n","export function getFirstNonCommentChild(element) {\n if (!element)\n return null;\n for (const child of element.childNodes) {\n if (child.nodeType !== Node.COMMENT_NODE) {\n return child;\n }\n }\n return null;\n}\n/**\n * Determines if the click event truly occurred outside the content node.\n * This was added to handle password managers and other elements that may be injected\n * into the DOM but visually appear inside the content.\n */\nexport function isClickTrulyOutside(event, contentNode) {\n const { clientX, clientY } = event;\n const rect = contentNode.getBoundingClientRect();\n return (clientX < rect.left || clientX > rect.right || clientY < rect.top || clientY > rect.bottom);\n}\n","/*!\n* tabbable 6.4.0\n* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE\n*/\n// NOTE: separate `:not()` selectors has broader browser support than the newer\n// `:not([inert], [inert] *)` (Feb 2023)\nvar candidateSelectors = ['input:not([inert]):not([inert] *)', 'select:not([inert]):not([inert] *)', 'textarea:not([inert]):not([inert] *)', 'a[href]:not([inert]):not([inert] *)', 'button:not([inert]):not([inert] *)', '[tabindex]:not(slot):not([inert]):not([inert] *)', 'audio[controls]:not([inert]):not([inert] *)', 'video[controls]:not([inert]):not([inert] *)', '[contenteditable]:not([contenteditable=\"false\"]):not([inert]):not([inert] *)', 'details>summary:first-of-type:not([inert]):not([inert] *)', 'details:not([inert]):not([inert] *)'];\nvar candidateSelector = /* #__PURE__ */candidateSelectors.join(',');\nvar NoElement = typeof Element === 'undefined';\nvar matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\nvar getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {\n var _element$getRootNode;\n return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);\n} : function (element) {\n return element === null || element === void 0 ? void 0 : element.ownerDocument;\n};\n\n/**\n * Determines if a node is inert or in an inert ancestor.\n * @param {Node} [node]\n * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to\n * see if any of them are inert. If false, only `node` itself is considered.\n * @returns {boolean} True if inert itself or by way of being in an inert ancestor.\n * False if `node` is falsy.\n */\nvar _isInert = function isInert(node, lookUp) {\n var _node$getAttribute;\n if (lookUp === void 0) {\n lookUp = true;\n }\n // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`\n // JS API property; we have to check the attribute, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's an active element\n var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');\n var inert = inertAtt === '' || inertAtt === 'true';\n\n // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`\n // if it weren't for `matches()` not being a function on shadow roots; the following\n // code works for any kind of node\n var result = inert || lookUp && node && (\n // closest does not exist on shadow roots, so we fall back to a manual\n // lookup upward, in case it is not defined.\n typeof node.closest === 'function' ? node.closest('[inert]') : _isInert(node.parentNode));\n return result;\n};\n\n/**\n * Determines if a node's content is editable.\n * @param {Element} [node]\n * @returns True if it's content-editable; false if it's not or `node` is falsy.\n */\nvar isContentEditable = function isContentEditable(node) {\n var _node$getAttribute2;\n // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have\n // to use the attribute directly to check for this, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's a non-editable element\n var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');\n return attValue === '' || attValue === 'true';\n};\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nvar getCandidates = function getCandidates(el, includeContainer, filter) {\n // even if `includeContainer=false`, we still have to check it for inertness because\n // if it's inert (either by itself or via its parent), then all its children are inert\n if (_isInert(el)) {\n return [];\n }\n var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.}\n */\nvar _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {\n var candidates = [];\n var elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n var element = elementsToCheck.shift();\n if (_isInert(element, false)) {\n // no need to look up since we're drilling down\n // anything inside this container will also be inert\n continue;\n }\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n var assigned = element.assignedElements();\n var content = assigned.length ? assigned : element.children;\n var nestedCandidates = _getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates\n });\n }\n } else {\n // check candidate element\n var validCandidate = matches.call(element, candidateSelector);\n if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n var shadowRoot = element.shadowRoot ||\n // check for an undisclosed shadow\n typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);\n\n // no inert look up because we're already drilling down and checking for inertness\n // on the way down, so all containers to this root node should have already been\n // vetted as non-inert\n var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, _nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: _nestedCandidates\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift.apply(elementsToCheck, element.children);\n }\n }\n }\n return candidates;\n};\n\n/**\n * @private\n * Determines if the node has an explicitly specified `tabindex` attribute.\n * @param {HTMLElement} node\n * @returns {boolean} True if so; false if not.\n */\nvar hasTabIndex = function hasTabIndex(node) {\n return !isNaN(parseInt(node.getAttribute('tabindex'), 10));\n};\n\n/**\n * Determine the tab index of a given node.\n * @param {HTMLElement} node\n * @returns {number} Tab order (negative, 0, or positive number).\n * @throws {Error} If `node` is falsy.\n */\nvar getTabIndex = function getTabIndex(node) {\n if (!node) {\n throw new Error('No node provided');\n }\n if (node.tabIndex < 0) {\n // in Chrome,
,