import "./chunk-VAL2CHZC.js"; import { createElementBlock, defineComponent, onMounted, onUnmounted, openBlock, ref } from "./chunk-AAHVYXXY.js"; import { normalizeClass, normalizeStyle } from "./chunk-OWZYVOTZ.js"; import "./chunk-V4OQ3NZ2.js"; // ../node_modules/.pnpm/@tinyflow-ai+vue@1.1.10_sve_b677e5cf21c71f6b6079aa80aa72e80f/node_modules/@tinyflow-ai/vue/dist/index.js var wf = "5"; typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(wf); var Ml = 1; var Tl = 2; var Ll = 4; var bf = 8; var xf = 16; var Cf = 1; var $f = 2; var Vl = 4; var _f = 8; var kf = 16; var Dl = 1; var Sf = 2; var Ol = "["; var xi = "[!"; var Vs = "]"; var cr = {}; var at = Symbol(); var Ef = "http://www.w3.org/1999/xhtml"; var Pf = "http://www.w3.org/2000/svg"; var Nf = "@attach"; var Mf = false; var Ci = Array.isArray; var Tf = Array.prototype.indexOf; var Ds = Array.from; var Jo = Object.keys; var ei = Object.defineProperty; var Sn = Object.getOwnPropertyDescriptor; var zl = Object.getOwnPropertyDescriptors; var Al = Object.prototype; var Lf = Array.prototype; var $i = Object.getPrototypeOf; var wa = Object.isExtensible; function Wr(e3) { return typeof e3 == "function"; } var vt = () => { }; function Vf(e3) { return e3(); } function ss(e3) { for (var t = 0; t < e3.length; t++) e3[t](); } function Hl() { var e3, t, n = new Promise((r, o) => { e3 = r, t = o; }); return { promise: n, resolve: e3, reject: t }; } function yt(e3, t, n = false) { return e3 === void 0 ? n ? ( /** @type {() => V} */ t() ) : ( /** @type {V} */ t ) : e3; } function mo(e3, t) { if (Array.isArray(e3)) return e3; if (t === void 0 || !(Symbol.iterator in e3)) return Array.from(e3); const n = []; for (const r of e3) if (n.push(r), n.length === t) break; return n; } var ct = 2; var Os = 4; var _i = 8; var Il = 1 << 24; var Vn = 16; var Dn = 32; var Qn = 64; var ki = 128; var Qt = 512; var ht = 1024; var St = 2048; var On = 4096; var Ot = 8192; var En = 16384; var Si = 32768; var Nn = 65536; var ba = 1 << 17; var Zl = 1 << 18; var vr = 1 << 19; var jl = 1 << 20; var to = 32768; var as = 1 << 21; var zs = 1 << 22; var Bn = 1 << 23; var fn = Symbol("$state"); var As = Symbol("legacy props"); var Df = Symbol(""); var Cr = new class extends Error { name = "StaleReactionError"; message = "The reaction that called `getAbortSignal()` was re-run or destroyed"; }(); var Of = 1; var Ei = 3; var mr = 8; function Hs(e3) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } function zf() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } function Af(e3) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } function Hf() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } function If(e3) { throw new Error("https://svelte.dev/e/effect_orphan"); } function Zf() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } function jf() { throw new Error("https://svelte.dev/e/hydration_failed"); } function Kf(e3) { throw new Error("https://svelte.dev/e/props_invalid_value"); } function Rf() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } function Bf() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } function Wf() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } function Yf() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } function yo(e3) { console.warn("https://svelte.dev/e/hydration_mismatch"); } function Ff() { console.warn("https://svelte.dev/e/select_multiple_invalid_value"); } function qf() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } var be = false; function Dt(e3) { be = e3; } var Pe; function et(e3) { if (e3 === null) throw yo(), cr; return Pe = e3; } function Mn() { return et( /** @type {TemplateNode} */ tn(Pe) ); } function Z(e3) { if (be) { if (tn(Pe) !== null) throw yo(), cr; Pe = e3; } } function ve(e3 = 1) { if (be) { for (var t = e3, n = Pe; t--; ) n = /** @type {TemplateNode} */ tn(n); Pe = n; } } function ti(e3 = true) { for (var t = 0, n = Pe; ; ) { if (n.nodeType === mr) { var r = ( /** @type {Comment} */ n.data ); if (r === Vs) { if (t === 0) return n; t -= 1; } else (r === Ol || r === xi) && (t += 1); } var o = ( /** @type {TemplateNode} */ tn(n) ); e3 && n.remove(), n = o; } } function Kl(e3) { if (!e3 || e3.nodeType !== mr) throw yo(), cr; return ( /** @type {Comment} */ e3.data ); } function Rl(e3) { return e3 === this.v; } function Bl(e3, t) { return e3 != e3 ? t == t : e3 !== t || e3 !== null && typeof e3 == "object" || typeof e3 == "function"; } function Wl(e3) { return !Bl(e3, this.v); } var jr = false; var Xf = false; function Gf() { jr = true; } var Uf = []; function Yl(e3, t = false, n = false) { return Wo(e3, /* @__PURE__ */ new Map(), "", Uf, null, n); } function Wo(e3, t, n, r, o = null, i = false) { if (typeof e3 == "object" && e3 !== null) { var s = t.get(e3); if (s !== void 0) return s; if (e3 instanceof Map) return ( /** @type {Snapshot} */ new Map(e3) ); if (e3 instanceof Set) return ( /** @type {Snapshot} */ new Set(e3) ); if (Ci(e3)) { var a = ( /** @type {Snapshot} */ Array(e3.length) ); t.set(e3, a), o !== null && t.set(o, a); for (var l = 0; l < e3.length; l += 1) { var u = e3[l]; l in e3 && (a[l] = Wo(u, t, n, r, null, i)); } return a; } if ($i(e3) === Al) { a = {}, t.set(e3, a), o !== null && t.set(o, a); for (var d in e3) a[d] = Wo( // @ts-expect-error e3[d], t, n, r, null, i ); return a; } if (e3 instanceof Date) return ( /** @type {Snapshot} */ structuredClone(e3) ); if (typeof /** @type {T & { toJSON?: any } } */ e3.toJSON == "function" && !i) return Wo( /** @type {T & { toJSON(): any } } */ e3.toJSON(), t, n, r, // Associate the instance with the toJSON clone e3 ); } if (e3 instanceof EventTarget) return ( /** @type {Snapshot} */ e3 ); try { return ( /** @type {Snapshot} */ structuredClone(e3) ); } catch { return ( /** @type {Snapshot} */ e3 ); } } var We = null; function Nr(e3) { We = e3; } function Fn(e3) { return ( /** @type {T} */ Fl().get(e3) ); } function Mr(e3, t) { return Fl().set(e3, t), t; } function le(e3, t = false, n) { We = { p: We, i: false, c: null, e: null, s: e3, x: null, l: jr && !t ? { s: null, u: null, $: [] } : null }; } function ue(e3) { var t = ( /** @type {ComponentContext} */ We ), n = t.e; if (n !== null) { t.e = null; for (var r of n) du(r); } return e3 !== void 0 && (t.x = e3), t.i = true, We = t.p, e3 ?? /** @type {T} */ {}; } function wo() { return !jr || We !== null && We.l === null; } function Fl(e3) { return We === null && Hs(), We.c ??= new Map(Qf(We) || void 0); } function Qf(e3) { let t = e3.p; for (; t !== null; ) { const n = t.c; if (n !== null) return n; t = t.p; } return null; } var or = []; function ql() { var e3 = or; or = [], ss(e3); } function Jn(e3) { if (or.length === 0 && !Qr) { var t = or; queueMicrotask(() => { t === or && ql(); }); } or.push(e3); } function Jf() { for (; or.length > 0; ) ql(); } function Xl(e3) { var t = Ne; if (t === null) return Ve.f |= Bn, e3; if ((t.f & Si) === 0) { if ((t.f & ki) === 0) throw e3; t.b.error(e3); } else Tr(e3, t); } function Tr(e3, t) { for (; t !== null; ) { if ((t.f & ki) !== 0) try { t.b.error(e3); return; } catch (n) { e3 = n; } t = t.parent; } throw e3; } var zo = /* @__PURE__ */ new Set(); var Fe = null; var jt = null; var Zt = []; var Pi = null; var ls = false; var Qr = false; var Gt = class _Gt { committed = false; /** * The current values of any sources that are updated in this batch * They keys of this map are identical to `this.#previous` * @type {Map} */ current = /* @__PURE__ */ new Map(); /** * The values of any sources that are updated in this batch _before_ those updates took place. * They keys of this map are identical to `this.#current` * @type {Map} */ previous = /* @__PURE__ */ new Map(); /** * When the batch is committed (and the DOM is updated), we need to remove old branches * and append new ones by calling the functions added inside (if/each/key/etc) blocks * @type {Set<() => void>} */ #e = /* @__PURE__ */ new Set(); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ #t = /* @__PURE__ */ new Set(); /** * The number of async effects that are currently in flight */ #n = 0; /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ #r = 0; /** * A deferred that resolves when the batch is committed, used with `settled()` * TODO replace with Promise.withResolvers once supported widely enough * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} */ #l = null; /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Effect[]} */ #a = []; /** * Deferred effects that are MAYBE_DIRTY * @type {Effect[]} */ #o = []; /** * A set of branches that still exist, but will be destroyed when this batch * is committed — we skip over these during `process` * @type {Set} */ skipped_effects = /* @__PURE__ */ new Set(); is_fork = false; is_deferred() { return this.is_fork || this.#r > 0; } /** * * @param {Effect[]} root_effects */ process(t) { Zt = [], this.apply(); var n = { parent: null, effect: null, effects: [], render_effects: [], block_effects: [] }; for (const r of t) this.#i(r, n); this.is_fork || this.#c(), this.is_deferred() ? (this.#s(n.effects), this.#s(n.render_effects), this.#s(n.block_effects)) : (Fe = null, xa(n.render_effects), xa(n.effects), this.#l?.resolve()), jt = null; } /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {EffectTarget} target */ #i(t, n) { t.f ^= ht; for (var r = t.first; r !== null; ) { var o = r.f, i = (o & (Dn | Qn)) !== 0, s = i && (o & ht) !== 0, a = s || (o & Ot) !== 0 || this.skipped_effects.has(r); if ((r.f & ki) !== 0 && r.b?.is_pending() && (n = { parent: n, effect: r, effects: [], render_effects: [], block_effects: [] }), !a && r.fn !== null) { i ? r.f ^= ht : (o & Os) !== 0 ? n.effects.push(r) : Co(r) && ((r.f & Vn) !== 0 && n.block_effects.push(r), oo(r)); var l = r.first; if (l !== null) { r = l; continue; } } var u = r.parent; for (r = r.next; r === null && u !== null; ) u === n.effect && (this.#s(n.effects), this.#s(n.render_effects), this.#s(n.block_effects), n = /** @type {EffectTarget} */ n.parent), r = u.next, u = u.parent; } } /** * @param {Effect[]} effects */ #s(t) { for (const n of t) ((n.f & St) !== 0 ? this.#a : this.#o).push(n), this.#u(n.deps), gt(n, ht); } /** * @param {Value[] | null} deps */ #u(t) { if (t !== null) for (const n of t) (n.f & ct) === 0 || (n.f & to) === 0 || (n.f ^= to, this.#u( /** @type {Derived} */ n.deps )); } /** * Associate a change to a given source with the current * batch, noting its previous and current values * @param {Source} source * @param {any} value */ capture(t, n) { this.previous.has(t) || this.previous.set(t, n), (t.f & Bn) === 0 && (this.current.set(t, t.v), jt?.set(t, t.v)); } activate() { Fe = this, this.apply(); } deactivate() { Fe === this && (Fe = null, jt = null); } flush() { if (this.activate(), Zt.length > 0) { if (Gl(), Fe !== null && Fe !== this) return; } else this.#n === 0 && this.process([]); this.deactivate(); } discard() { for (const t of this.#t) t(this); this.#t.clear(); } #c() { if (this.#r === 0) { for (const t of this.#e) t(); this.#e.clear(); } this.#n === 0 && this.#d(); } #d() { if (zo.size > 1) { this.previous.clear(); var t = jt, n = true, r = { parent: null, effect: null, effects: [], render_effects: [], block_effects: [] }; for (const i of zo) { if (i === this) { n = false; continue; } const s = []; for (const [l, u] of this.current) { if (i.current.has(l)) if (n && u !== i.current.get(l)) i.current.set(l, u); else continue; s.push(l); } if (s.length === 0) continue; const a = [...i.current.keys()].filter((l) => !this.current.has(l)); if (a.length > 0) { var o = Zt; Zt = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const d of s) Ul(d, a, l, u); if (Zt.length > 0) { Fe = i, i.apply(); for (const d of Zt) i.#i(d, r); i.deactivate(); } Zt = o; } } Fe = null, jt = t; } this.committed = true, zo.delete(this); } /** * * @param {boolean} blocking */ increment(t) { this.#n += 1, t && (this.#r += 1); } /** * * @param {boolean} blocking */ decrement(t) { this.#n -= 1, t && (this.#r -= 1), this.revive(); } revive() { for (const t of this.#a) gt(t, St), dr(t); for (const t of this.#o) gt(t, On), dr(t); this.#a = [], this.#o = [], this.flush(); } /** @param {() => void} fn */ oncommit(t) { this.#e.add(t); } /** @param {(batch: Batch) => void} fn */ ondiscard(t) { this.#t.add(t); } settled() { return (this.#l ??= Hl()).promise; } static ensure() { if (Fe === null) { const t = Fe = new _Gt(); zo.add(Fe), Qr || _Gt.enqueue(() => { Fe === t && t.flush(); }); } return Fe; } /** @param {() => void} task */ static enqueue(t) { Jn(t); } apply() { } }; function g(e3) { var t = Qr; Qr = true; try { for (var n; ; ) { if (Jf(), Zt.length === 0 && (Fe?.flush(), Zt.length === 0)) return Pi = null, /** @type {T} */ n; Gl(); } } finally { Qr = t; } } function Gl() { var e3 = Yn; ls = true; try { var t = 0; for (ri(true); Zt.length > 0; ) { var n = Gt.ensure(); if (t++ > 1e3) { var r, o; ep(); } n.process(Zt), Wn.clear(); } } finally { ls = false, ri(e3), Pi = null; } } function ep() { try { Zf(); } catch (e3) { Tr(e3, Pi); } } var bn = null; function xa(e3) { var t = e3.length; if (t !== 0) { for (var n = 0; n < t; ) { var r = e3[n++]; if ((r.f & (En | Ot)) === 0 && Co(r) && (bn = /* @__PURE__ */ new Set(), oo(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null && r.ac === null ? mu(r) : r.fn = null), bn?.size > 0)) { Wn.clear(); for (const o of bn) { if ((o.f & (En | Ot)) !== 0) continue; const i = [o]; let s = o.parent; for (; s !== null; ) bn.has(s) && (bn.delete(s), i.push(s)), s = s.parent; for (let a = i.length - 1; a >= 0; a--) { const l = i[a]; (l.f & (En | Ot)) === 0 && oo(l); } } bn.clear(); } } bn = null; } } function Ul(e3, t, n, r) { if (!n.has(e3) && (n.add(e3), e3.reactions !== null)) for (const o of e3.reactions) { const i = o.f; (i & ct) !== 0 ? Ul( /** @type {Derived} */ o, t, n, r ) : (i & (zs | Vn)) !== 0 && (i & St) === 0 && Ql(o, t, r) && (gt(o, St), dr( /** @type {Effect} */ o )); } } function Ql(e3, t, n) { const r = n.get(e3); if (r !== void 0) return r; if (e3.deps !== null) for (const o of e3.deps) { if (t.includes(o)) return true; if ((o.f & ct) !== 0 && Ql( /** @type {Derived} */ o, t, n )) return n.set( /** @type {Derived} */ o, true ), true; } return n.set(e3, false), false; } function dr(e3) { for (var t = Pi = e3; t.parent !== null; ) { t = t.parent; var n = t.f; if (ls && t === Ne && (n & Vn) !== 0 && (n & Zl) === 0) return; if ((n & (Qn | Dn)) !== 0) { if ((n & ht) === 0) return; t.f ^= ht; } } Zt.push(t); } function Jl(e3) { let t = 0, n = qn(0), r; return () => { no() && (c(n), xo(() => (t === 0 && (r = lt(() => e3(() => Jr(n)))), t += 1, () => { Jn(() => { t -= 1, t === 0 && (r?.(), r = void 0, Jr(n)); }); }))); }; } var tp = Nn | vr | ki; function np(e3, t, n) { new rp(e3, t, n); } var rp = class { /** @type {Boundary | null} */ parent; #e = false; /** @type {TemplateNode} */ #t; /** @type {TemplateNode | null} */ #n = be ? Pe : null; /** @type {BoundaryProps} */ #r; /** @type {((anchor: Node) => void)} */ #l; /** @type {Effect} */ #a; /** @type {Effect | null} */ #o = null; /** @type {Effect | null} */ #i = null; /** @type {Effect | null} */ #s = null; /** @type {DocumentFragment | null} */ #u = null; /** @type {TemplateNode | null} */ #c = null; #d = 0; #f = 0; #h = false; /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, * otherwise updating the source results in needless `Batch.ensure()` * calls followed by no-op flushes * @type {Source | null} */ #p = null; #w = Jl(() => (this.#p = qn(this.#d), () => { this.#p = null; })); /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ constructor(t, n, r) { this.#t = t, this.#r = n, this.#l = r, this.parent = /** @type {Effect} */ Ne.b, this.#e = !!this.#r.pending, this.#a = Rr(() => { if (Ne.b = this, be) { const i = this.#n; Mn(), /** @type {Comment} */ i.nodeType === mr && /** @type {Comment} */ i.data === xi ? this.#x() : this.#b(); } else { var o = this.#m(); try { this.#o = Vt(() => r(o)); } catch (i) { this.error(i); } this.#f > 0 ? this.#v() : this.#e = false; } return () => { this.#c?.remove(); }; }, tp), be && (this.#t = Pe); } #b() { try { this.#o = Vt(() => this.#l(this.#t)); } catch (t) { this.error(t); } this.#e = false; } #x() { const t = this.#r.pending; t && (this.#i = Vt(() => t(this.#t)), Gt.enqueue(() => { var n = this.#m(); this.#o = this.#g(() => (Gt.ensure(), Vt(() => this.#l(n)))), this.#f > 0 ? this.#v() : (_r( /** @type {Effect} */ this.#i, () => { this.#i = null; } ), this.#e = false); })); } #m() { var t = this.#t; return this.#e && (this.#c = Et(), this.#t.before(this.#c), t = this.#c), t; } /** * Returns `true` if the effect exists inside a boundary whose pending snippet is shown * @returns {boolean} */ is_pending() { return this.#e || !!this.parent && this.parent.is_pending(); } has_pending_snippet() { return !!this.#r.pending; } /** * @param {() => Effect | null} fn */ #g(t) { var n = Ne, r = Ve, o = We; Bt(this.#a), $t(this.#a), Nr(this.#a.ctx); try { return t(); } catch (i) { return Xl(i), null; } finally { Bt(n), $t(r), Nr(o); } } #v() { const t = ( /** @type {(anchor: Node) => void} */ this.#r.pending ); this.#o !== null && (this.#u = document.createDocumentFragment(), this.#u.append( /** @type {TemplateNode} */ this.#c ), bu(this.#o, this.#u)), this.#i === null && (this.#i = Vt(() => t(this.#t))); } /** * Updates the pending count associated with the currently visible pending snippet, * if any, such that we can replace the snippet with content once work is done * @param {1 | -1} d */ #y(t) { if (!this.has_pending_snippet()) { this.parent && this.parent.#y(t); return; } this.#f += t, this.#f === 0 && (this.#e = false, this.#i && _r(this.#i, () => { this.#i = null; }), this.#u && (this.#t.before(this.#u), this.#u = null)); } /** * Update the source that powers `$effect.pending()` inside this boundary, * and controls when the current `pending` snippet (if any) is removed. * Do not call from inside the class * @param {1 | -1} d */ update_pending_count(t) { this.#y(t), this.#d += t, this.#p && Vr(this.#p, this.#d); } get_effect_pending() { return this.#w(), c( /** @type {Source} */ this.#p ); } /** @param {unknown} error */ error(t) { var n = this.#r.onerror; let r = this.#r.failed; if (this.#h || !n && !r) throw t; this.#o && (it(this.#o), this.#o = null), this.#i && (it(this.#i), this.#i = null), this.#s && (it(this.#s), this.#s = null), be && (et( /** @type {TemplateNode} */ this.#n ), ve(), et(ti())); var o = false, i = false; const s = () => { if (o) { qf(); return; } o = true, i && Yf(), Gt.ensure(), this.#d = 0, this.#s !== null && _r(this.#s, () => { this.#s = null; }), this.#e = this.has_pending_snippet(), this.#o = this.#g(() => (this.#h = false, Vt(() => this.#l(this.#t)))), this.#f > 0 ? this.#v() : this.#e = false; }; var a = Ve; try { $t(null), i = true, n?.(t, s), i = false; } catch (l) { Tr(l, this.#a && this.#a.parent); } finally { $t(a); } r && Jn(() => { this.#s = this.#g(() => { Gt.ensure(), this.#h = true; try { return Vt(() => { r( this.#t, () => t, () => s ); }); } catch (l) { return Tr( l, /** @type {Effect} */ this.#a.parent ), null; } finally { this.#h = false; } }); }); } }; function Lr(e3, t) { return t; } function op(e3, t, n) { for (var r = [], o = t.length, i = 0; i < o; i++) Bs(t[i].e, r, true); yu(r, () => { var s = r.length === 0 && n !== null; if (s) { var a = ( /** @type {Element} */ n ), l = ( /** @type {Element} */ a.parentNode ); js(l), l.append(a), e3.items.clear(), Ft(e3, t[0].prev, t[o - 1].next); } for (var u = 0; u < o; u++) { var d = t[u]; s || (e3.items.delete(d.k), Ft(e3, d.prev, d.next)), it(d.e, !s); } e3.first === t[0] && (e3.first = t[0].prev); }); } function mt(e3, t, n, r, o, i = null) { var s = e3, a = /* @__PURE__ */ new Map(), l = null, u = (t & Ll) !== 0, d = (t & Ml) !== 0, p = (t & Tl) !== 0; if (u) { var f = ( /** @type {Element} */ e3 ); s = be ? et( /** @type {Comment | Text} */ rt(f) ) : f.appendChild(Et()); } be && Mn(); var h = null, y = Is(() => { var x = n(); return Ci(x) ? x : x == null ? [] : Ds(x); }), w, m = true; function b() { ip(_, w, s, t, r), h !== null && (w.length === 0 ? (h.fragment ? (s.before(h.fragment), h.fragment = null) : Ws(h.effect), $.first = h.effect) : _r(h.effect, () => { h = null; })); } var $ = Rr(() => { w = /** @type {V[]} */ c(y); var x = w.length; let k = false; if (be) { var N = Kl(s) === xi; N !== (x === 0) && (s = ti(), et(s), Dt(false), k = true); } for (var V = /* @__PURE__ */ new Set(), j = ( /** @type {Batch} */ Fe ), A = null, H = uu(), z = 0; z < x; z += 1) { be && Pe.nodeType === mr && /** @type {Comment} */ Pe.data === Vs && (s = /** @type {Comment} */ Pe, k = true, Dt(false)); var S = w[z], T = r(S, z), C = m ? null : a.get(T); C ? (d && Vr(C.v, S), p ? Vr( /** @type {Value} */ C.i, z ) : C.i = z, H && j.skipped_effects.delete(C.e)) : (C = sp( m ? s : null, A, S, T, z, o, t, n ), m && (C.o = true, A === null ? l = C : A.next = C, A = C), a.set(T, C)), V.add(T); } if (x === 0 && i && !h) if (m) h = { fragment: null, effect: Vt(() => i(s)) }; else { var P = document.createDocumentFragment(), M = Et(); P.append(M), h = { fragment: P, effect: Vt(() => i(M)) }; } if (be && x > 0 && et(ti()), !m) if (H) { for (const [K, B] of a) V.has(K) || j.skipped_effects.add(B.e); j.oncommit(b), j.ondiscard(() => { }); } else b(); k && Dt(true), c(y); }), _ = { effect: $, items: a, first: l }; m = false, be && (s = Pe); } function ip(e3, t, n, r, o) { var i = (r & bf) !== 0, s = t.length, a = e3.items, l = e3.first, u, d = null, p, f = [], h = [], y, w, m, b; if (i) for (b = 0; b < s; b += 1) y = t[b], w = o(y, b), m = /** @type {EachItem} */ a.get(w), m.o && (m.a?.measure(), (p ??= /* @__PURE__ */ new Set()).add(m)); for (b = 0; b < s; b += 1) { if (y = t[b], w = o(y, b), m = /** @type {EachItem} */ a.get(w), e3.first ??= m, !m.o) { m.o = true; var $ = d ? d.next : l; Ft(e3, d, m), Ft(e3, m, $), Wi(m, $, n), d = m, f = [], h = [], l = d.next; continue; } if ((m.e.f & Ot) !== 0 && (Ws(m.e), i && (m.a?.unfix(), (p ??= /* @__PURE__ */ new Set()).delete(m))), m !== l) { if (u !== void 0 && u.has(m)) { if (f.length < h.length) { var _ = h[0], x; d = _.prev; var k = f[0], N = f[f.length - 1]; for (x = 0; x < f.length; x += 1) Wi(f[x], _, n); for (x = 0; x < h.length; x += 1) u.delete(h[x]); Ft(e3, k.prev, N.next), Ft(e3, d, k), Ft(e3, N, _), l = _, d = N, b -= 1, f = [], h = []; } else u.delete(m), Wi(m, l, n), Ft(e3, m.prev, m.next), Ft(e3, m, d === null ? e3.first : d.next), Ft(e3, d, m), d = m; continue; } for (f = [], h = []; l !== null && l.k !== w; ) (l.e.f & Ot) === 0 && (u ??= /* @__PURE__ */ new Set()).add(l), h.push(l), l = l.next; if (l === null) continue; m = l; } f.push(m), d = m, l = m.next; } let V = a.size > s; if (l !== null || u !== void 0) { for (var j = u === void 0 ? [] : Ds(u); l !== null; ) (l.e.f & Ot) === 0 && j.push(l), l = l.next; var A = j.length; if (V = a.size - A > s, A > 0) { var H = (r & Ll) !== 0 && s === 0 ? n : null; if (i) { for (b = 0; b < A; b += 1) j[b].a?.measure(); for (b = 0; b < A; b += 1) j[b].a?.fix(); } op(e3, j, H); } } if (V) for (const z of a.values()) z.o || (Ft(e3, d, z), d = z); e3.effect.last = d && d.e, i && Jn(() => { if (p !== void 0) for (m of p) m.a?.apply(); }); } function sp(e3, t, n, r, o, i, s, a) { var l = (s & Ml) !== 0, u = (s & xf) === 0, d = l ? u ? ou(n, false, false) : qn(n) : n, p = (s & Tl) === 0 ? o : qn(o), f = { i: p, v: d, k: r, a: null, // @ts-expect-error e: null, o: false, prev: t, next: null }; try { if (e3 === null) { var h = document.createDocumentFragment(); h.append(e3 = Et()); } return f.e = Vt(() => i( /** @type {Node} */ e3, d, p, a )), t !== null && (t.next = f), f; } finally { } } function Wi(e3, t, n) { for (var r = e3.next ? ( /** @type {TemplateNode} */ e3.next.e.nodes_start ) : n, o = t ? ( /** @type {TemplateNode} */ t.e.nodes_start ) : n, i = ( /** @type {TemplateNode} */ e3.e.nodes_start ); i !== null && i !== r; ) { var s = ( /** @type {TemplateNode} */ tn(i) ); o.before(i), i = s; } } function Ft(e3, t, n) { t === null ? (e3.first = n, e3.effect.first = n && n.e) : (t.e.next && (t.e.next.prev = null), t.next = n, t.e.next = n && n.e), n !== null && (n.e.prev && (n.e.prev.next = null), n.prev = t, n.e.prev = t && t.e); } function eu(e3, t, n, r) { const o = wo() ? bo : Is; if (n.length === 0 && e3.length === 0) { r(t.map(o)); return; } var i = Fe, s = ( /** @type {Effect} */ Ne ), a = ap(); function l() { Promise.all(n.map((u) => lp(u))).then((u) => { a(); try { r([...t.map(o), ...u]); } catch (d) { (s.f & En) === 0 && Tr(d, s); } i?.deactivate(), ni(); }).catch((u) => { Tr(u, s); }); } e3.length > 0 ? Promise.all(e3).then(() => { a(); try { return l(); } finally { i?.deactivate(), ni(); } }) : l(); } function ap() { var e3 = Ne, t = Ve, n = We, r = Fe; return function(o = true) { Bt(e3), $t(t), Nr(n), o && r?.activate(); }; } function ni() { Bt(null), $t(null), Nr(null); } function bo(e3) { var t = ct | St, n = Ve !== null && (Ve.f & ct) !== 0 ? ( /** @type {Derived} */ Ve ) : null; return Ne !== null && (Ne.f |= vr), { ctx: We, deps: null, effects: null, equals: Rl, f: t, fn: e3, reactions: null, rv: 0, v: ( /** @type {V} */ at ), wv: 0, parent: n ?? Ne, ac: null }; } function lp(e3, t) { let n = ( /** @type {Effect | null} */ Ne ); n === null && zf(); var r = ( /** @type {Boundary} */ n.b ), o = ( /** @type {Promise} */ /** @type {unknown} */ void 0 ), i = qn( /** @type {V} */ at ), s = !Ve, a = /* @__PURE__ */ new Map(); return mp(() => { var l = Hl(); o = l.promise; try { Promise.resolve(e3()).then(l.resolve, l.reject).then(() => { u === Fe && u.committed && u.deactivate(), ni(); }); } catch (f) { l.reject(f), ni(); } var u = ( /** @type {Batch} */ Fe ); if (s) { var d = !r.is_pending(); r.update_pending_count(1), u.increment(d), a.get(u)?.reject(Cr), a.delete(u), a.set(u, l); } const p = (f, h = void 0) => { if (u.activate(), h) h !== Cr && (i.f |= Bn, Vr(i, h)); else { (i.f & Bn) !== 0 && (i.f ^= Bn), Vr(i, f); for (const [y, w] of a) { if (a.delete(y), y === u) break; w.reject(Cr); } } s && (r.update_pending_count(-1), u.decrement(d)); }; l.promise.then(p, (f) => p(null, f || "unknown")); }), Ni(() => { for (const l of a.values()) l.reject(Cr); }), new Promise((l) => { function u(d) { function p() { d === o ? l(i) : u(o); } d.then(p, p); } u(o); }); } function E(e3) { const t = bo(e3); return xu(t), t; } function Is(e3) { const t = bo(e3); return t.equals = Wl, t; } function tu(e3) { var t = e3.effects; if (t !== null) { e3.effects = null; for (var n = 0; n < t.length; n += 1) it( /** @type {Effect} */ t[n] ); } } function up(e3) { for (var t = e3.parent; t !== null; ) { if ((t.f & ct) === 0) return (t.f & En) === 0 ? ( /** @type {Effect} */ t ) : null; t = t.parent; } return null; } function Zs(e3) { var t, n = Ne; Bt(up(e3)); try { e3.f &= ~to, tu(e3), t = ku(e3); } finally { Bt(n); } return t; } function nu(e3) { var t = Zs(e3); if (e3.equals(t) || (Fe?.is_fork || (e3.v = t), e3.wv = $u()), !yr) if (jt !== null) (no() || Fe?.is_fork) && jt.set(e3, t); else { var n = (e3.f & Qt) === 0 ? On : ht; gt(e3, n); } } var us = /* @__PURE__ */ new Set(); var Wn = /* @__PURE__ */ new Map(); var ru = false; function qn(e3, t) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: e3, reactions: null, equals: Rl, rv: 0, wv: 0 }; return n; } function Ee(e3, t) { const n = qn(e3); return xu(n), n; } function ou(e3, t = false, n = true) { const r = qn(e3); return t || (r.equals = Wl), jr && n && We !== null && We.l !== null && (We.l.s ??= []).push(r), r; } function Q(e3, t, n = false) { Ve !== 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 (!dn || (Ve.f & ba) !== 0) && wo() && (Ve.f & (ct | Vn | zs | ba)) !== 0 && !Pn?.includes(e3) && Wf(); let r = n ? Rt(t) : t; return Vr(e3, r); } function Vr(e3, t) { if (!e3.equals(t)) { var n = e3.v; yr ? Wn.set(e3, t) : Wn.set(e3, n), e3.v = t; var r = Gt.ensure(); r.capture(e3, n), (e3.f & ct) !== 0 && ((e3.f & St) !== 0 && Zs( /** @type {Derived} */ e3 ), gt(e3, (e3.f & Qt) !== 0 ? ht : On)), e3.wv = $u(), iu(e3, St), wo() && Ne !== null && (Ne.f & ht) !== 0 && (Ne.f & (Dn | Qn)) === 0 && (It === null ? wp([e3]) : It.push(e3)), !r.is_fork && us.size > 0 && !ru && cp(); } return t; } function cp() { ru = false; var e3 = Yn; ri(true); const t = Array.from(us); try { for (const n of t) (n.f & ht) !== 0 && gt(n, On), Co(n) && oo(n); } finally { ri(e3); } us.clear(); } function Ca(e3, t = 1) { var n = c(e3), r = t === 1 ? n++ : n--; return Q(e3, n), r; } function Jr(e3) { Q(e3, e3.v + 1); } function iu(e3, t) { var n = e3.reactions; if (n !== null) for (var r = wo(), o = n.length, i = 0; i < o; i++) { var s = n[i], a = s.f; if (!(!r && s === Ne)) { var l = (a & St) === 0; if (l && gt(s, t), (a & ct) !== 0) { var u = ( /** @type {Derived} */ s ); jt?.delete(u), (a & to) === 0 && (a & Qt && (s.f |= to), iu(u, On)); } else l && ((a & Vn) !== 0 && bn !== null && bn.add( /** @type {Effect} */ s ), dr( /** @type {Effect} */ s )); } } } function Rt(e3) { if (typeof e3 != "object" || e3 === null || fn in e3) return e3; const t = $i(e3); if (t !== Al && t !== Lf) return e3; var n = /* @__PURE__ */ new Map(), r = Ci(e3), o = Ee(0), i = ar, s = (a) => { if (ar === i) return a(); var l = Ve, u = ar; $t(null), Sa(i); var d = a(); return $t(l), Sa(u), d; }; return r && n.set("length", Ee( /** @type {any[]} */ e3.length )), new Proxy( /** @type {any} */ e3, { defineProperty(a, l, u) { (!("value" in u) || u.configurable === false || u.enumerable === false || u.writable === false) && Rf(); var d = n.get(l); return d === void 0 ? d = s(() => { var p = Ee(u.value); return n.set(l, p), p; }) : Q(d, u.value, true), true; }, deleteProperty(a, l) { var u = n.get(l); if (u === void 0) { if (l in a) { const d = s(() => Ee(at)); n.set(l, d), Jr(o); } } else Q(u, at), Jr(o); return true; }, get(a, l, u) { if (l === fn) return e3; var d = n.get(l), p = l in a; if (d === void 0 && (!p || Sn(a, l)?.writable) && (d = s(() => { var h = Rt(p ? a[l] : at), y = Ee(h); return y; }), n.set(l, d)), d !== void 0) { var f = c(d); return f === at ? void 0 : f; } return Reflect.get(a, l, u); }, getOwnPropertyDescriptor(a, l) { var u = Reflect.getOwnPropertyDescriptor(a, l); if (u && "value" in u) { var d = n.get(l); d && (u.value = c(d)); } else if (u === void 0) { var p = n.get(l), f = p?.v; if (p !== void 0 && f !== at) return { enumerable: true, configurable: true, value: f, writable: true }; } return u; }, has(a, l) { if (l === fn) return true; var u = n.get(l), d = u !== void 0 && u.v !== at || Reflect.has(a, l); if (u !== void 0 || Ne !== null && (!d || Sn(a, l)?.writable)) { u === void 0 && (u = s(() => { var f = d ? Rt(a[l]) : at, h = Ee(f); return h; }), n.set(l, u)); var p = c(u); if (p === at) return false; } return d; }, set(a, l, u, d) { var p = n.get(l), f = l in a; if (r && l === "length") for (var h = u; h < /** @type {Source} */ p.v; h += 1) { var y = n.get(h + ""); y !== void 0 ? Q(y, at) : h in a && (y = s(() => Ee(at)), n.set(h + "", y)); } if (p === void 0) (!f || Sn(a, l)?.writable) && (p = s(() => Ee(void 0)), Q(p, Rt(u)), n.set(l, p)); else { f = p.v !== at; var w = s(() => Rt(u)); Q(p, w); } var m = Reflect.getOwnPropertyDescriptor(a, l); if (m?.set && m.set.call(d, u), !f) { if (r && typeof l == "string") { var b = ( /** @type {Source} */ n.get("length") ), $ = Number(l); Number.isInteger($) && $ >= b.v && Q(b, $ + 1); } Jr(o); } return true; }, ownKeys(a) { c(o); var l = Reflect.ownKeys(a).filter((p) => { var f = n.get(p); return f === void 0 || f.v !== at; }); for (var [u, d] of n) d.v !== at && !(u in a) && l.push(u); return l; }, setPrototypeOf() { Bf(); } } ); } function $a(e3) { try { if (e3 !== null && typeof e3 == "object" && fn in e3) return e3[fn]; } catch { } return e3; } function dp(e3, t) { return Object.is($a(e3), $a(t)); } var Ct; var su; var au; var lu; function cs() { if (Ct === void 0) { Ct = window, su = /Firefox/.test(navigator.userAgent); var e3 = Element.prototype, t = Node.prototype, n = Text.prototype; au = Sn(t, "firstChild").get, lu = Sn(t, "nextSibling").get, wa(e3) && (e3.__click = void 0, e3.__className = void 0, e3.__attributes = null, e3.__style = void 0, e3.__e = void 0), wa(n) && (n.__t = void 0); } } function Et(e3 = "") { return document.createTextNode(e3); } function rt(e3) { return au.call(e3); } function tn(e3) { return lu.call(e3); } function R(e3, t) { if (!be) return rt(e3); var n = ( /** @type {TemplateNode} */ rt(Pe) ); if (n === null) n = Pe.appendChild(Et()); else if (t && n.nodeType !== Ei) { var r = Et(); return n?.before(r), et(r), r; } return et(n), n; } function oe(e3, t = false) { if (!be) { var n = ( /** @type {DocumentFragment} */ rt( /** @type {Node} */ e3 ) ); return n instanceof Comment && n.data === "" ? tn(n) : n; } if (t && Pe?.nodeType !== Ei) { var r = Et(); return Pe?.before(r), et(r), r; } return Pe; } function O(e3, t = 1, n = false) { let r = be ? Pe : e3; for (var o; t--; ) o = r, r = /** @type {TemplateNode} */ tn(r); if (!be) return r; if (n && r?.nodeType !== Ei) { var i = Et(); return r === null ? o?.after(i) : r.before(i), et(i), i; } return et(r), /** @type {TemplateNode} */ r; } function js(e3) { e3.textContent = ""; } function uu() { return false; } function fp(e3, t) { if (t) { const n = document.body; e3.autofocus = true, Jn(() => { document.activeElement === n && e3.focus(); }); } } function pp(e3) { be && rt(e3) !== null && js(e3); } var _a = false; function hp() { _a || (_a = true, document.addEventListener( "reset", (e3) => { Promise.resolve().then(() => { if (!e3.defaultPrevented) for ( const t of /**@type {HTMLFormElement} */ e3.target.elements ) t.__on_r?.(); }); }, // In the capture phase to guarantee we get noticed of it (no possibility of stopPropagation) { capture: true } )); } function Ks(e3) { var t = Ve, n = Ne; $t(null), Bt(null); try { return e3(); } finally { $t(t), Bt(n); } } function cu(e3) { Ne === null && (Ve === null && If(), Hf()), yr && Af(); } function gp(e3, t) { var n = t.last; n === null ? t.last = t.first = e3 : (n.next = e3, e3.prev = n, t.last = e3); } function Wt(e3, t, n) { var r = Ne; r !== null && (r.f & Ot) !== 0 && (e3 |= Ot); var o = { ctx: We, deps: null, nodes_start: null, nodes_end: null, f: e3 | St | Qt, first: null, fn: t, last: null, next: null, parent: r, b: r && r.b, prev: null, teardown: null, transitions: null, wv: 0, ac: null }; if (n) try { oo(o), o.f |= Si; } catch (a) { throw it(o), a; } else t !== null && dr(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 & vr) === 0 && (i = i.first, (e3 & Vn) !== 0 && (e3 & Nn) !== 0 && i !== null && (i.f |= Nn)), i !== null && (i.parent = r, r !== null && gp(i, r), Ve !== null && (Ve.f & ct) !== 0 && (e3 & Qn) === 0)) { var s = ( /** @type {Derived} */ Ve ); (s.effects ??= []).push(i); } return o; } function no() { return Ve !== null && !dn; } function Ni(e3) { const t = Wt(_i, null, false); return gt(t, ht), t.teardown = e3, t; } function qe(e3) { cu(); var t = ( /** @type {Effect} */ Ne.f ), n = !Ve && (t & Dn) !== 0 && (t & Si) === 0; if (n) { var r = ( /** @type {ComponentContext} */ We ); (r.e ??= []).push(e3); } else return du(e3); } function du(e3) { return Wt(Os | jl, e3, false); } function fu(e3) { return cu(), Wt(_i | jl, e3, true); } function Rs(e3) { Gt.ensure(); const t = Wt(Qn | vr, e3, true); return () => { it(t); }; } function vp(e3) { Gt.ensure(); const t = Wt(Qn | vr, e3, true); return (n = {}) => new Promise((r) => { n.outro ? _r(t, () => { it(t), r(void 0); }) : (it(t), r(void 0)); }); } function Kr(e3) { return Wt(Os, e3, false); } function mp(e3) { return Wt(zs | vr, e3, true); } function xo(e3, t = 0) { return Wt(_i | t, e3, true); } function $e(e3, t = [], n = [], r = []) { eu(r, t, n, (o) => { Wt(_i, () => e3(...o.map(c)), true); }); } function Rr(e3, t = 0) { var n = Wt(Vn | t, e3, true); return n; } function pu(e3, t = 0) { var n = Wt(Il | t, e3, true); return n; } function Vt(e3) { return Wt(Dn | vr, e3, true); } function hu(e3) { var t = e3.teardown; if (t !== null) { const n = yr, r = Ve; ka(true), $t(null); try { t.call(null); } finally { ka(n), $t(r); } } } function gu(e3, t = false) { var n = e3.first; for (e3.first = e3.last = null; n !== null; ) { const o = n.ac; o !== null && Ks(() => { o.abort(Cr); }); var r = n.next; (n.f & Qn) !== 0 ? n.parent = null : it(n, t), n = r; } } function yp(e3) { for (var t = e3.first; t !== null; ) { var n = t.next; (t.f & Dn) === 0 && it(t), t = n; } } function it(e3, t = true) { var n = false; (t || (e3.f & Zl) !== 0) && e3.nodes_start !== null && e3.nodes_end !== null && (vu( e3.nodes_start, /** @type {TemplateNode} */ e3.nodes_end ), n = true), gu(e3, t && !n), oi(e3, 0), gt(e3, En); var r = e3.transitions; if (r !== null) for (const i of r) i.stop(); hu(e3); var o = e3.parent; o !== null && o.first !== null && mu(e3), e3.next = e3.prev = e3.teardown = e3.ctx = e3.deps = e3.fn = e3.nodes_start = e3.nodes_end = e3.ac = null; } function vu(e3, t) { for (; e3 !== null; ) { var n = e3 === t ? null : ( /** @type {TemplateNode} */ tn(e3) ); e3.remove(), e3 = n; } } function mu(e3) { var t = e3.parent, n = e3.prev, r = e3.next; n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e3 && (t.first = r), t.last === e3 && (t.last = n)); } function _r(e3, t, n = true) { var r = []; Bs(e3, r, true), yu(r, () => { n && it(e3), t && t(); }); } function yu(e3, t) { var n = e3.length; if (n > 0) { var r = () => --n || t(); for (var o of e3) o.out(r); } else t(); } function Bs(e3, t, n) { if ((e3.f & Ot) === 0) { if (e3.f ^= Ot, e3.transitions !== null) for (const s of e3.transitions) (s.is_global || n) && t.push(s); for (var r = e3.first; r !== null; ) { var o = r.next, i = (r.f & Nn) !== 0 || // If this is a branch effect without a block effect parent, // it means the parent block effect was pruned. In that case, // transparency information was transferred to the branch effect. (r.f & Dn) !== 0 && (e3.f & Vn) !== 0; Bs(r, t, i ? n : false), r = o; } } } function Ws(e3) { wu(e3, true); } function wu(e3, t) { if ((e3.f & Ot) !== 0) { e3.f ^= Ot, (e3.f & ht) === 0 && (gt(e3, St), dr(e3)); for (var n = e3.first; n !== null; ) { var r = n.next, o = (n.f & Nn) !== 0 || (n.f & Dn) !== 0; wu(n, o ? t : false), n = r; } if (e3.transitions !== null) for (const i of e3.transitions) (i.is_global || t) && i.in(); } } function bu(e3, t) { for (var n = e3.nodes_start, r = e3.nodes_end; n !== null; ) { var o = n === r ? null : ( /** @type {TemplateNode} */ tn(n) ); t.append(n), n = o; } } var Yn = false; function ri(e3) { Yn = e3; } var yr = false; function ka(e3) { yr = e3; } var Ve = null; var dn = false; function $t(e3) { Ve = e3; } var Ne = null; function Bt(e3) { Ne = e3; } var Pn = null; function xu(e3) { Ve !== null && (Pn === null ? Pn = [e3] : Pn.push(e3)); } var wt = null; var Lt = 0; var It = null; function wp(e3) { It = e3; } var Cu = 1; var ro = 0; var ar = ro; function Sa(e3) { ar = e3; } function $u() { return ++Cu; } function Co(e3) { var t = e3.f; if ((t & St) !== 0) return true; if (t & ct && (e3.f &= -32769), (t & On) !== 0) { var n = e3.deps; if (n !== null) for (var r = n.length, o = 0; o < r; o++) { var i = n[o]; if (Co( /** @type {Derived} */ i ) && nu( /** @type {Derived} */ i ), i.wv > e3.wv) return true; } (t & Qt) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens jt === null && gt(e3, ht); } return false; } function _u(e3, t, n = true) { var r = e3.reactions; if (r !== null && !Pn?.includes(e3)) for (var o = 0; o < r.length; o++) { var i = r[o]; (i.f & ct) !== 0 ? _u( /** @type {Derived} */ i, t, false ) : t === i && (n ? gt(i, St) : (i.f & ht) !== 0 && gt(i, On), dr( /** @type {Effect} */ i )); } } function ku(e3) { var t = wt, n = Lt, r = It, o = Ve, i = Pn, s = We, a = dn, l = ar, u = e3.f; wt = /** @type {null | Value[]} */ null, Lt = 0, It = null, Ve = (u & (Dn | Qn)) === 0 ? e3 : null, Pn = null, Nr(e3.ctx), dn = false, ar = ++ro, e3.ac !== null && (Ks(() => { e3.ac.abort(Cr); }), e3.ac = null); try { e3.f |= as; var d = ( /** @type {Function} */ e3.fn ), p = d(), f = e3.deps; if (wt !== null) { var h; if (oi(e3, Lt), f !== null && Lt > 0) for (f.length = Lt + wt.length, h = 0; h < wt.length; h++) f[Lt + h] = wt[h]; else e3.deps = f = wt; if (Yn && no() && (e3.f & Qt) !== 0) for (h = Lt; h < f.length; h++) (f[h].reactions ??= []).push(e3); } else f !== null && Lt < f.length && (oi(e3, Lt), f.length = Lt); if (wo() && It !== null && !dn && f !== null && (e3.f & (ct | On | St)) === 0) for (h = 0; h < /** @type {Source[]} */ It.length; h++) _u( It[h], /** @type {Effect} */ e3 ); return o !== null && o !== e3 && (ro++, It !== null && (r === null ? r = It : r.push(.../** @type {Source[]} */ It))), (e3.f & Bn) !== 0 && (e3.f ^= Bn), p; } catch (y) { return Xl(y); } finally { e3.f ^= as, wt = t, Lt = n, It = r, Ve = o, Pn = i, Nr(s), dn = a, ar = l; } } function bp(e3, t) { let n = t.reactions; if (n !== null) { var r = Tf.call(n, e3); if (r !== -1) { var o = n.length - 1; o === 0 ? n = t.reactions = null : (n[r] = n[o], n.pop()); } } n === null && (t.f & ct) !== 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 (wt === null || !wt.includes(t)) && (gt(t, On), (t.f & Qt) !== 0 && (t.f ^= Qt, t.f &= -32769), tu( /** @type {Derived} **/ t ), oi( /** @type {Derived} **/ t, 0 )); } function oi(e3, t) { var n = e3.deps; if (n !== null) for (var r = t; r < n.length; r++) bp(e3, n[r]); } function oo(e3) { var t = e3.f; if ((t & En) === 0) { gt(e3, ht); var n = Ne, r = Yn; Ne = e3, Yn = true; try { (t & (Vn | Il)) !== 0 ? yp(e3) : gu(e3), hu(e3); var o = ku(e3); e3.teardown = typeof o == "function" ? o : null, e3.wv = Cu; var i; Mf && Xf && (e3.f & St) !== 0 && e3.deps; } finally { Yn = r, Ne = n; } } } function c(e3) { var t = e3.f, n = (t & ct) !== 0; if (Ve !== null && !dn) { var r = Ne !== null && (Ne.f & En) !== 0; if (!r && !Pn?.includes(e3)) { var o = Ve.deps; if ((Ve.f & as) !== 0) e3.rv < ro && (e3.rv = ro, wt === null && o !== null && o[Lt] === e3 ? Lt++ : wt === null ? wt = [e3] : wt.includes(e3) || wt.push(e3)); else { (Ve.deps ??= []).push(e3); var i = e3.reactions; i === null ? e3.reactions = [Ve] : i.includes(Ve) || i.push(Ve); } } } if (yr) { if (Wn.has(e3)) return Wn.get(e3); if (n) { var s = ( /** @type {Derived} */ e3 ), a = s.v; return ((s.f & ht) === 0 && s.reactions !== null || Eu(s)) && (a = Zs(s)), Wn.set(s, a), a; } } else n && (!jt?.has(e3) || Fe?.is_fork && !no()) && (s = /** @type {Derived} */ e3, Co(s) && nu(s), Yn && no() && (s.f & Qt) === 0 && Su(s)); if (jt?.has(e3)) return jt.get(e3); if ((e3.f & Bn) !== 0) throw e3.v; return e3.v; } function Su(e3) { if (e3.deps !== null) { e3.f ^= Qt; for (const t of e3.deps) (t.reactions ??= []).push(e3), (t.f & ct) !== 0 && (t.f & Qt) === 0 && Su( /** @type {Derived} */ t ); } } function Eu(e3) { if (e3.v === at) return true; if (e3.deps === null) return false; for (const t of e3.deps) if (Wn.has(t) || (t.f & ct) !== 0 && Eu( /** @type {Derived} */ t )) return true; return false; } function lt(e3) { var t = dn; try { return dn = true, e3(); } finally { dn = t; } } var xp = -7169; function gt(e3, t) { e3.f = e3.f & xp | t; } function Cp(e3, t) { var n = {}; for (var r in e3) t.includes(r) || (n[r] = e3[r]); for (var o of Object.getOwnPropertySymbols(e3)) Object.propertyIsEnumerable.call(e3, o) && !t.includes(o) && (n[o] = e3[o]); return n; } function Ys(e3) { if (!(typeof e3 != "object" || !e3 || e3 instanceof EventTarget)) { if (fn in e3) ds(e3); else if (!Array.isArray(e3)) for (let t in e3) { const n = e3[t]; typeof n == "object" && n && fn in n && ds(n); } } } function ds(e3, t = /* @__PURE__ */ new Set()) { if (typeof e3 == "object" && e3 !== null && // We don't want to traverse DOM elements !(e3 instanceof EventTarget) && !t.has(e3)) { t.add(e3), e3 instanceof Date && e3.getTime(); for (let r in e3) try { ds(e3[r], t); } catch { } const n = $i(e3); if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) { const r = zl(n); for (let o in r) { const i = r[o].get; if (i) try { i.call(e3); } catch { } } } } } var Pu = /* @__PURE__ */ new Set(); var fs = /* @__PURE__ */ new Set(); function Fs(e3, t, n, r = {}) { function o(i) { if (r.capture || qr.call(t, i), !i.cancelBubble) return Ks(() => n?.call(this, i)); } return e3.startsWith("pointer") || e3.startsWith("touch") || e3 === "wheel" ? Jn(() => { t.addEventListener(e3, o, r); }) : t.addEventListener(e3, o, r), o; } function ps(e3, t, n, r = {}) { var o = Fs(t, e3, n, r); return () => { e3.removeEventListener(t, o, r); }; } function ii(e3, t, n, r, o) { var i = { capture: r, passive: o }, s = Fs(e3, t, n, i); (t === document.body || // @ts-ignore t === window || // @ts-ignore t === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed t instanceof HTMLMediaElement) && Ni(() => { t.removeEventListener(e3, s, i); }); } function er(e3) { for (var t = 0; t < e3.length; t++) Pu.add(e3[t]); for (var n of fs) n(e3); } var Ea = null; function qr(e3) { var t = this, n = ( /** @type {Node} */ t.ownerDocument ), r = e3.type, o = e3.composedPath?.() || [], i = ( /** @type {null | Element} */ o[0] || e3.target ); Ea = e3; var s = 0, a = Ea === e3 && e3.__root; if (a) { var l = o.indexOf(a); if (l !== -1 && (t === document || t === /** @type {any} */ window)) { e3.__root = t; return; } var u = o.indexOf(t); if (u === -1) return; l <= u && (s = l); } if (i = /** @type {Element} */ o[s] || e3.target, i !== t) { ei(e3, "currentTarget", { configurable: true, get() { return i || n; } }); var d = Ve, p = Ne; $t(null), Bt(null); try { for (var f, h = []; i !== null; ) { var y = i.assignedSlot || i.parentNode || /** @type {any} */ i.host || null; try { var w = i["__" + r]; w != null && (!/** @type {any} */ i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well // -> the target could not have been disabled because it emits the event in the first place e3.target === i) && w.call(i, e3); } catch (m) { f ? h.push(m) : f = m; } if (e3.cancelBubble || y === t || y === null) break; i = y; } if (f) { for (let m of h) queueMicrotask(() => { throw m; }); throw f; } } finally { e3.__root = t, delete e3.currentTarget, $t(d), Bt(p); } } } function qs(e3) { var t = document.createElement("template"); return t.innerHTML = e3.replaceAll("", ""), t.content; } function kt(e3, t) { var n = ( /** @type {Effect} */ Ne ); n.nodes_start === null && (n.nodes_start = e3, n.nodes_end = t); } function ee(e3, t) { var n = (t & Dl) !== 0, r = (t & Sf) !== 0, o, i = !e3.startsWith(""); return () => { if (be) return kt(Pe, null), Pe; o === void 0 && (o = qs(i ? e3 : "" + e3), n || (o = /** @type {Node} */ rt(o))); var s = ( /** @type {TemplateNode} */ r || su ? document.importNode(o, true) : o.cloneNode(true) ); if (n) { var a = ( /** @type {TemplateNode} */ rt(s) ), l = ( /** @type {TemplateNode} */ s.lastChild ); kt(a, l); } else kt(s, s); return s; }; } function $p(e3, t, n = "svg") { var r = !e3.startsWith(""), o = (t & Dl) !== 0, i = `<${n}>${r ? e3 : "" + e3}`, s; return () => { if (be) return kt(Pe, null), Pe; if (!s) { var a = ( /** @type {DocumentFragment} */ qs(i) ), l = ( /** @type {Element} */ rt(a) ); if (o) for (s = document.createDocumentFragment(); rt(l); ) s.appendChild( /** @type {Node} */ rt(l) ); else s = /** @type {Element} */ rt(l); } var u = ( /** @type {TemplateNode} */ s.cloneNode(true) ); if (o) { var d = ( /** @type {TemplateNode} */ rt(u) ), p = ( /** @type {TemplateNode} */ u.lastChild ); kt(d, p); } else kt(u, u); return u; }; } function ge(e3, t) { return $p(e3, t, "svg"); } function ke(e3 = "") { if (!be) { var t = Et(e3 + ""); return kt(t, t), t; } var n = Pe; return n.nodeType !== Ei && (n.before(n = Et()), et(n)), kt(n, n), n; } function Se() { if (be) return kt(Pe, null), Pe; var e3 = document.createDocumentFragment(), t = document.createComment(""), n = Et(); return e3.append(t, n), kt(t, n), e3; } function L(e3, t) { if (be) { var n = ( /** @type {Effect} */ Ne ); ((n.f & Si) === 0 || n.nodes_end === null) && (n.nodes_end = Pe), Mn(); return; } e3 !== null && e3.before( /** @type {Node} */ t ); } function _p(e3) { return e3.endsWith("capture") && e3 !== "gotpointercapture" && e3 !== "lostpointercapture"; } var kp = [ "beforeinput", "click", "change", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart" ]; function Sp(e3) { return kp.includes(e3); } var Ep = { // no `class: 'className'` because we handle that separately formnovalidate: "formNoValidate", ismap: "isMap", nomodule: "noModule", playsinline: "playsInline", readonly: "readOnly", defaultvalue: "defaultValue", defaultchecked: "defaultChecked", srcobject: "srcObject", novalidate: "noValidate", allowfullscreen: "allowFullscreen", disablepictureinpicture: "disablePictureInPicture", disableremoteplayback: "disableRemotePlayback" }; function Pp(e3) { return e3 = e3.toLowerCase(), Ep[e3] ?? e3; } var Np = ["touchstart", "touchmove"]; function Mp(e3) { return Np.includes(e3); } var Tp = ( /** @type {const} */ ["textarea", "script", "style", "title"] ); function Lp(e3) { return Tp.includes( /** @type {typeof RAW_TEXT_ELEMENTS[number]} */ e3 ); } function Re(e3, t) { var n = t == null ? "" : typeof t == "object" ? t + "" : t; n !== (e3.__t ??= e3.nodeValue) && (e3.__t = n, e3.nodeValue = n + ""); } function Nu(e3, t) { return Mu(e3, t); } function Vp(e3, t) { cs(), t.intro = t.intro ?? false; const n = t.target, r = be, o = Pe; try { for (var i = ( /** @type {TemplateNode} */ rt(n) ); i && (i.nodeType !== mr || /** @type {Comment} */ i.data !== Ol); ) i = /** @type {TemplateNode} */ tn(i); if (!i) throw cr; Dt(true), et( /** @type {Comment} */ i ); const s = Mu(e3, { ...t, anchor: i }); return Dt(false), /** @type {Exports} */ s; } catch (s) { if (s instanceof Error && s.message.split(` `).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s; return s !== cr && console.warn("Failed to hydrate: ", s), t.recover === false && jf(), cs(), js(n), Dt(false), Nu(e3, t); } finally { Dt(r), et(o); } } var br = /* @__PURE__ */ new Map(); function Mu(e3, { target: t, anchor: n, props: r = {}, events: o, context: i, intro: s = true }) { cs(); var a = /* @__PURE__ */ new Set(), l = (p) => { for (var f = 0; f < p.length; f++) { var h = p[f]; if (!a.has(h)) { a.add(h); var y = Mp(h); t.addEventListener(h, qr, { passive: y }); var w = br.get(h); w === void 0 ? (document.addEventListener(h, qr, { passive: y }), br.set(h, 1)) : br.set(h, w + 1); } } }; l(Ds(Pu)), fs.add(l); var u = void 0, d = vp(() => { var p = n ?? t.appendChild(Et()); return np( /** @type {TemplateNode} */ p, { pending: () => { } }, (f) => { if (i) { le({}); var h = ( /** @type {ComponentContext} */ We ); h.c = i; } if (o && (r.$$events = o), be && kt( /** @type {TemplateNode} */ f, null ), u = e3(f, r) || {}, be && (Ne.nodes_end = Pe, Pe === null || Pe.nodeType !== mr || /** @type {Comment} */ Pe.data !== Vs)) throw yo(), cr; i && ue(); } ), () => { for (var f of a) { t.removeEventListener(f, qr); var h = ( /** @type {number} */ br.get(f) ); --h === 0 ? (document.removeEventListener(f, qr), br.delete(f)) : br.set(f, h); } fs.delete(l), p !== n && p.parentNode?.removeChild(p); }; }); return hs.set(u, d), u; } var hs = /* @__PURE__ */ new WeakMap(); function Dp(e3, t) { const n = hs.get(e3); return n ? (hs.delete(e3), n(t)) : Promise.resolve(); } var Mi = class { /** @type {TemplateNode} */ anchor; /** @type {Map} */ #e = /* @__PURE__ */ new Map(); /** * Map of keys to effects that are currently rendered in the DOM. * These effects are visible and actively part of the document tree. * Example: * ``` * {#if condition} * foo * {:else} * bar * {/if} * ``` * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ #t = /* @__PURE__ */ new Map(); /** * Similar to #onscreen with respect to the keys, but contains branches that are not yet * in the DOM, because their insertion is deferred. * @type {Map} */ #n = /* @__PURE__ */ new Map(); /** * Keys of effects that are currently outroing * @type {Set} */ #r = /* @__PURE__ */ new Set(); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ #l = true; /** * @param {TemplateNode} anchor * @param {boolean} transition */ constructor(t, n = true) { this.anchor = t, this.#l = n; } #a = () => { var t = ( /** @type {Batch} */ Fe ); if (this.#e.has(t)) { var n = ( /** @type {Key} */ this.#e.get(t) ), r = this.#t.get(n); if (r) Ws(r), this.#r.delete(n); else { var o = this.#n.get(n); o && (this.#t.set(n, o.effect), this.#n.delete(n), o.fragment.lastChild.remove(), this.anchor.before(o.fragment), r = o.effect); } for (const [i, s] of this.#e) { if (this.#e.delete(i), i === t) break; const a = this.#n.get(s); a && (it(a.effect), this.#n.delete(s)); } for (const [i, s] of this.#t) { if (i === n || this.#r.has(i)) continue; const a = () => { if (Array.from(this.#e.values()).includes(i)) { var l = document.createDocumentFragment(); bu(s, l), l.append(Et()), this.#n.set(i, { effect: s, fragment: l }); } else it(s); this.#r.delete(i), this.#t.delete(i); }; this.#l || !r ? (this.#r.add(i), _r(s, a, false)) : a(); } } }; /** * @param {Batch} batch */ #o = (t) => { this.#e.delete(t); const n = Array.from(this.#e.values()); for (const [r, o] of this.#n) n.includes(r) || (it(o.effect), this.#n.delete(r)); }; /** * * @param {any} key * @param {null | ((target: TemplateNode) => void)} fn */ ensure(t, n) { var r = ( /** @type {Batch} */ Fe ), o = uu(); n && !this.#t.has(t) && !this.#n.has(t) && this.#t.set( t, Vt(() => n(this.anchor)) ), this.#e.set(r, t), o || (be && (this.anchor = Pe), this.#a()); } }; function Ge(e3, t, ...n) { var r = new Mi(e3); Rr(() => { const o = t() ?? null; r.ensure(o, o && ((i) => o(i, ...n))); }, Nn); } function zn(e3) { We === null && Hs(), jr && We.l !== null ? Op(We).m.push(e3) : qe(() => { const t = lt(e3); if (typeof t == "function") return ( /** @type {() => void} */ t ); }); } function $o(e3) { We === null && Hs(), zn(() => () => lt(e3)); } function Op(e3) { var t = ( /** @type {ComponentContextLegacy} */ e3.l ); return t.u ??= { a: [], b: [], m: [] }; } function ae(e3, t, n = false) { be && Mn(); var r = new Mi(e3), o = n ? Nn : 0; function i(s, a) { if (be) { const u = Kl(e3) === xi; if (s === u) { var l = ti(); et(l), r.anchor = l, Dt(false), r.ensure(s, a), Dt(true); return; } } r.ensure(s, a); } Rr(() => { var s = false; t((a, l = true) => { s = true, i(l, a); }), s || i(false, null); }, o); } function zp(e3, t) { be && et( /** @type {TemplateNode} */ rt(e3) ), xo(() => { var n = t(); for (var r in n) { var o = n[r]; o ? e3.style.setProperty(r, o) : e3.style.removeProperty(r); } }); } function Xs(e3, t, n = false, r = false, o = false) { var i = e3, s = ""; $e(() => { var a = ( /** @type {Effect} */ Ne ); if (s === (s = t() ?? "")) { be && Mn(); return; } if (a.nodes_start !== null && (vu( a.nodes_start, /** @type {TemplateNode} */ a.nodes_end ), a.nodes_start = a.nodes_end = null), s !== "") { if (be) { Pe.data; for (var l = Mn(), u = l; l !== null && (l.nodeType !== mr || /** @type {Comment} */ l.data !== ""); ) u = l, l = /** @type {TemplateNode} */ tn(l); if (l === null) throw yo(), cr; kt(Pe, u), i = et(l); return; } var d = s + ""; n ? d = `${d}` : r && (d = `${d}`); var p = qs(d); if ((n || r) && (p = /** @type {Element} */ rt(p)), kt( /** @type {TemplateNode} */ rt(p), /** @type {TemplateNode} */ p.lastChild ), n || r) for (; rt(p); ) i.before( /** @type {Node} */ rt(p) ); else i.before(p); } }); } function Ti(e3, t, n) { be && Mn(); var r = new Mi(e3); Rr(() => { var o = t() ?? null; r.ensure(o, o && ((i) => n(i, o))); }, Nn); } function Ap(e3, t, n, r, o, i) { let s = be; be && Mn(); var a = null; be && Pe.nodeType === Of && (a = /** @type {Element} */ Pe, Mn()); var l = ( /** @type {TemplateNode} */ be ? Pe : e3 ), u = new Mi(l, false); Rr(() => { const d = t() || null; var p = d === "svg" ? Pf : null; if (d === null) { u.ensure(null, null); return; } return u.ensure(d, (f) => { if (d) { if (a = be ? ( /** @type {Element} */ a ) : p ? document.createElementNS(p, d) : document.createElement(d), kt(a, a), r) { be && Lp(d) && a.append(document.createComment("")); var h = ( /** @type {TemplateNode} */ be ? rt(a) : a.appendChild(Et()) ); be && (h === null ? Dt(false) : et(h)), r(a, h); } Ne.nodes_end = a, f.before(a); } be && et(f); }), () => { }; }, Nn), Ni(() => { }), s && (Dt(true), et(l)); } function He(e3, t) { Kr(() => { var n = e3.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( /** @type {ShadowRoot} */ n ) : ( /** @type {Document} */ n.head ?? /** @type {Document} */ n.ownerDocument.head ) ); if (!r.querySelector("#" + t.hash)) { const o = document.createElement("style"); o.id = t.hash, o.textContent = t.code, r.appendChild(o); } }); } function pt(e3, t, n) { Kr(() => { var r = lt(() => t(e3, n?.()) || {}); if (n && r?.update) { var o = false, i = ( /** @type {any} */ {} ); xo(() => { var s = n(); Ys(s), o && Bl(i, s) && (i = s, r.update(s)); }), o = true; } if (r?.destroy) return () => ( /** @type {Function} */ r.destroy() ); }); } function Hp(e3, t) { var n = void 0, r; pu(() => { n !== (n = t()) && (r && (it(r), r = null), n && (r = Vt(() => { Kr(() => ( /** @type {(node: Element) => void} */ n(e3) )); }))); }); } function Tu(e3) { var t, n, r = ""; if (typeof e3 == "string" || typeof e3 == "number") r += e3; else if (typeof e3 == "object") if (Array.isArray(e3)) { var o = e3.length; for (t = 0; t < o; t++) e3[t] && (n = Tu(e3[t])) && (r && (r += " "), r += n); } else for (n in e3) e3[n] && (r && (r += " "), r += n); return r; } function Ip() { for (var e3, t, n = 0, r = "", o = arguments.length; n < o; n++) (e3 = arguments[n]) && (t = Tu(e3)) && (r && (r += " "), r += t); return r; } function An(e3) { return typeof e3 == "object" ? Ip(e3) : e3 ?? ""; } var Pa = [...` \r\f \v\uFEFF`]; function Zp(e3, t, n) { var r = e3 == null ? "" : "" + e3; if (t && (r = r ? r + " " + t : t), n) { for (var o in n) if (n[o]) r = r ? r + " " + o : o; else if (r.length) for (var i = o.length, s = 0; (s = r.indexOf(o, s)) >= 0; ) { var a = s + i; (s === 0 || Pa.includes(r[s - 1])) && (a === r.length || Pa.includes(r[a])) ? r = (s === 0 ? "" : r.substring(0, s)) + r.substring(a + 1) : s = a; } } return r === "" ? null : r; } function Na(e3, t = false) { var n = t ? " !important;" : ";", r = ""; for (var o in e3) { var i = e3[o]; i != null && i !== "" && (r += " " + o + ": " + i + n); } return r; } function Yi(e3) { return e3[0] !== "-" || e3[1] !== "-" ? e3.toLowerCase() : e3; } function jp(e3, t) { if (t) { var n = "", r, o; if (Array.isArray(t) ? (r = t[0], o = t[1]) : r = t, e3) { e3 = String(e3).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim(); var i = false, s = 0, a = false, l = []; r && l.push(...Object.keys(r).map(Yi)), o && l.push(...Object.keys(o).map(Yi)); var u = 0, d = -1; const w = e3.length; for (var p = 0; p < w; p++) { var f = e3[p]; if (a ? f === "/" && e3[p - 1] === "*" && (a = false) : i ? i === f && (i = false) : f === "/" && e3[p + 1] === "*" ? a = true : f === '"' || f === "'" ? i = f : f === "(" ? s++ : f === ")" && s--, !a && i === false && s === 0) { if (f === ":" && d === -1) d = p; else if (f === ";" || p === w - 1) { if (d !== -1) { var h = Yi(e3.substring(u, d).trim()); if (!l.includes(h)) { f !== ";" && p++; var y = e3.substring(u, p).trim(); n += " " + y + ";"; } } u = p + 1, d = -1; } } } } return r && (n += Na(r)), o && (n += Na(o, true)), n = n.trim(), n === "" ? null : n; } return e3 == null ? null : String(e3); } function Pt(e3, t, n, r, o, i) { var s = e3.__className; if (be || s !== n || s === void 0) { var a = Zp(n, r, i); (!be || a !== e3.getAttribute("class")) && (a == null ? e3.removeAttribute("class") : t ? e3.className = a : e3.setAttribute("class", a)), e3.__className = n; } else if (i && o !== i) for (var l in i) { var u = !!i[l]; (o == null || u !== !!o[l]) && e3.classList.toggle(l, u); } return i; } function Fi(e3, t = {}, n, r) { for (var o in n) { var i = n[o]; t[o] !== i && (n[o] == null ? e3.style.removeProperty(o) : e3.style.setProperty(o, i, r)); } } function dt(e3, t, n, r) { var o = e3.__style; if (be || o !== t) { var i = jp(t, r); (!be || i !== e3.getAttribute("style")) && (i == null ? e3.removeAttribute("style") : e3.style.cssText = i), e3.__style = t; } else r && (Array.isArray(r) ? (Fi(e3, n?.[0], r[0]), Fi(e3, n?.[1], r[1], "important")) : Fi(e3, n, r)); return r; } function gs(e3, t, n = false) { if (e3.multiple) { if (t == null) return; if (!Ci(t)) return Ff(); for (var r of e3.options) r.selected = t.includes(Ma(r)); return; } for (r of e3.options) { var o = Ma(r); if (dp(o, t)) { r.selected = true; return; } } (!n || t !== void 0) && (e3.selectedIndex = -1); } function Kp(e3) { var t = new MutationObserver(() => { gs(e3, e3.__value); }); t.observe(e3, { // Listen to option element changes childList: true, subtree: true, // because of // Listen to option element value attribute changes // (doesn't get notified of select value changes, // because that property is not reflected as an attribute) attributes: true, attributeFilter: ["value"] }), Ni(() => { t.disconnect(); }); } function Ma(e3) { return "__value" in e3 ? e3.__value : e3.value; } var jn = Symbol("class"); var cn = Symbol("style"); var Lu = Symbol("is custom element"); var Vu = Symbol("is html"); function Cn(e3) { if (be) { var t = false, n = () => { if (!t) { if (t = true, e3.hasAttribute("value")) { var r = e3.value; xe(e3, "value", null), e3.value = r; } if (e3.hasAttribute("checked")) { var o = e3.checked; xe(e3, "checked", null), e3.checked = o; } } }; e3.__on_r = n, Jn(n), hp(); } } function Yo(e3, t) { var n = Li(e3); n.value === (n.value = // treat null and undefined the same for the initial value t ?? void 0) || // @ts-expect-error // `progress` elements always need their value set when it's `0` e3.value === t && (t !== 0 || e3.nodeName !== "PROGRESS") || (e3.value = t ?? ""); } function Ao(e3, t) { var n = Li(e3); n.checked !== (n.checked = // treat null and undefined the same for the initial value t ?? void 0) && (e3.checked = t); } function Rp(e3, t) { t ? e3.hasAttribute("selected") || e3.setAttribute("selected", "") : e3.removeAttribute("selected"); } function xe(e3, t, n, r) { var o = Li(e3); be && (o[t] = e3.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e3.nodeName === "LINK") || o[t] !== (o[t] = n) && (t === "loading" && (e3[Df] = n), n == null ? e3.removeAttribute(t) : typeof n != "string" && Du(e3).includes(t) ? e3[t] = n : e3.setAttribute(t, n)); } function Bp(e3, t, n, r, o = false, i = false) { if (be && o && e3.tagName === "INPUT") { var s = ( /** @type {HTMLInputElement} */ e3 ), a = s.type === "checkbox" ? "defaultChecked" : "defaultValue"; a in n || Cn(s); } var l = Li(e3), u = l[Lu], d = !l[Vu]; let p = be && u; p && Dt(false); var f = t || {}, h = e3.tagName === "OPTION"; for (var y in t) y in n || (n[y] = null); n.class ? n.class = An(n.class) : (r || n[jn]) && (n.class = null), n[cn] && (n.style ??= null); var w = Du(e3); for (const N in n) { let V = n[N]; if (h && N === "value" && V == null) { e3.value = e3.__value = "", f[N] = V; continue; } if (N === "class") { var m = e3.namespaceURI === "http://www.w3.org/1999/xhtml"; Pt(e3, m, V, r, t?.[jn], n[jn]), f[N] = V, f[jn] = n[jn]; continue; } if (N === "style") { dt(e3, V, t?.[cn], n[cn]), f[N] = V, f[cn] = n[cn]; continue; } var b = f[N]; if (!(V === b && !(V === void 0 && e3.hasAttribute(N)))) { f[N] = V; var $ = N[0] + N[1]; if ($ !== "$$") if ($ === "on") { const j = {}, A = "$$" + N; let H = N.slice(2); var _ = Sp(H); if (_p(H) && (H = H.slice(0, -7), j.capture = true), !_ && b) { if (V != null) continue; e3.removeEventListener(H, f[A], j), f[A] = null; } if (V != null) if (_) e3[`__${H}`] = V, er([H]); else { let z = function(S) { f[N].call(this, S); }; f[A] = Fs(H, e3, z, j); } else _ && (e3[`__${H}`] = void 0); } else if (N === "style") xe(e3, N, V); else if (N === "autofocus") fp( /** @type {HTMLElement} */ e3, !!V ); else if (!u && (N === "__value" || N === "value" && V != null)) e3.value = e3.__value = V; else if (N === "selected" && h) Rp( /** @type {HTMLOptionElement} */ e3, V ); else { var x = N; d || (x = Pp(x)); var k = x === "defaultValue" || x === "defaultChecked"; if (V == null && !u && !k) if (l[N] = null, x === "value" || x === "checked") { let j = ( /** @type {HTMLInputElement} */ e3 ); const A = t === void 0; if (x === "value") { let H = j.defaultValue; j.removeAttribute(x), j.defaultValue = H, j.value = j.__value = A ? H : null; } else { let H = j.defaultChecked; j.removeAttribute(x), j.defaultChecked = H, j.checked = A ? H : false; } } else e3.removeAttribute(N); else k || w.includes(x) && (u || typeof V != "string") ? (e3[x] = V, x in l && (l[x] = at)) : typeof V != "function" && xe(e3, x, V); } } } return p && Dt(true), f; } function ot(e3, t, n = [], r = [], o = [], i, s = false, a = false) { eu(o, n, r, (l) => { var u = void 0, d = {}, p = e3.nodeName === "SELECT", f = false; if (pu(() => { var y = t(...l.map(c)), w = Bp( e3, u, y, i, s, a ); f && p && "value" in y && gs( /** @type {HTMLSelectElement} */ e3, y.value ); for (let b of Object.getOwnPropertySymbols(d)) y[b] || it(d[b]); for (let b of Object.getOwnPropertySymbols(y)) { var m = y[b]; b.description === Nf && (!u || m !== u[b]) && (d[b] && it(d[b]), d[b] = Vt(() => Hp(e3, () => m))), w[b] = m; } u = w; }), p) { var h = ( /** @type {HTMLSelectElement} */ e3 ); Kr(() => { gs( h, /** @type {Record} */ u.value, true ), Kp(h); }); } f = true; }); } function Li(e3) { return ( /** @type {Record} **/ // @ts-expect-error e3.__attributes ??= { [Lu]: e3.nodeName.includes("-"), [Vu]: e3.namespaceURI === Ef } ); } var Ta = /* @__PURE__ */ new Map(); function Du(e3) { var t = e3.getAttribute("is") || e3.nodeName, n = Ta.get(t); if (n) return n; Ta.set(t, n = []); for (var r, o = e3, i = Element.prototype; i !== o; ) { r = zl(o); for (var s in r) r[s].set && n.push(s); o = $i(o); } return n; } var Gs = class _Gs { /** */ #e = /* @__PURE__ */ new WeakMap(); /** @type {ResizeObserver | undefined} */ #t; /** @type {ResizeObserverOptions} */ #n; /** @static */ static entries = /* @__PURE__ */ new WeakMap(); /** @param {ResizeObserverOptions} options */ constructor(t) { this.#n = t; } /** * @param {Element} element * @param {(entry: ResizeObserverEntry) => any} listener */ observe(t, n) { var r = this.#e.get(t) || /* @__PURE__ */ new Set(); return r.add(n), this.#e.set(t, r), this.#r().observe(t, this.#n), () => { var o = this.#e.get(t); o.delete(n), o.size === 0 && (this.#e.delete(t), this.#t.unobserve(t)); }; } #r() { return this.#t ?? (this.#t = new ResizeObserver( /** @param {any} entries */ (t) => { for (var n of t) { _Gs.entries.set(n.target, n); for (var r of this.#e.get(n.target) || []) r(n); } } )); } }; var Wp = new Gs({ box: "border-box" }); function La(e3, t, n) { var r = Wp.observe(e3, () => n(e3[t])); Kr(() => (lt(() => n(e3[t])), r)); } function Va(e3, t) { return e3 === t || e3?.[fn] === t; } function Nt(e3 = {}, t, n, r) { return Kr(() => { var o, i; return xo(() => { o = i, i = [], lt(() => { e3 !== n(...i) && (t(e3, ...i), o && Va(n(...o), e3) && t(null, ...o)); }); }), () => { Jn(() => { i && Va(n(...i), e3) && t(null, ...i); }); }; }), e3; } function Ou(e3 = false) { const t = ( /** @type {ComponentContextLegacy} */ We ), n = t.l.u; if (!n) return; let r = () => Ys(t.s); if (e3) { let o = 0, i = ( /** @type {Record} */ {} ); const s = bo(() => { let a = false; const l = t.s; for (const u in l) l[u] !== i[u] && (i[u] = l[u], a = true); return a && o++, o; }); r = () => c(s); } n.b.length && fu(() => { Da(t, r), ss(n.b); }), qe(() => { const o = lt(() => n.m.map(Vf)); return () => { for (const i of o) typeof i == "function" && i(); }; }), n.a.length && qe(() => { Da(t, r), ss(n.a); }); } function Da(e3, t) { if (e3.l.s) for (const n of e3.l.s) c(n); t(); } var Ho = false; function Yp(e3) { var t = Ho; try { return Ho = false, [e3(), Ho]; } finally { Ho = t; } } var Fp = { get(e3, t) { if (!e3.exclude.includes(t)) return e3.props[t]; }, set(e3, t) { return false; }, getOwnPropertyDescriptor(e3, t) { if (!e3.exclude.includes(t) && t in e3.props) return { enumerable: true, configurable: true, value: e3.props[t] }; }, has(e3, t) { return e3.exclude.includes(t) ? false : t in e3.props; }, ownKeys(e3) { return Reflect.ownKeys(e3.props).filter((t) => !e3.exclude.includes(t)); } }; function Ze(e3, t, n) { return new Proxy( { props: e3, exclude: t }, Fp ); } var qp = { get(e3, t) { if (!e3.exclude.includes(t)) return c(e3.version), t in e3.special ? e3.special[t]() : e3.props[t]; }, set(e3, t, n) { if (!(t in e3.special)) { var r = Ne; try { Bt(e3.parent_effect), e3.special[t] = v( { get [t]() { return e3.props[t]; } }, /** @type {string} */ t, Vl ); } finally { Bt(r); } } return e3.special[t](n), Ca(e3.version), true; }, getOwnPropertyDescriptor(e3, t) { if (!e3.exclude.includes(t) && t in e3.props) return { enumerable: true, configurable: true, value: e3.props[t] }; }, deleteProperty(e3, t) { return e3.exclude.includes(t) || (e3.exclude.push(t), Ca(e3.version)), true; }, has(e3, t) { return e3.exclude.includes(t) ? false : t in e3.props; }, ownKeys(e3) { return Reflect.ownKeys(e3.props).filter((t) => !e3.exclude.includes(t)); } }; function Oa(e3, t) { return new Proxy( { props: e3, exclude: t, special: {}, version: qn(0), // TODO this is only necessary because we need to track component // destruction inside `prop`, because of `bind:this`, but it // seems likely that we can simplify `bind:this` instead parent_effect: ( /** @type {Effect} */ Ne ) }, qp ); } var Xp = { get(e3, t) { let n = e3.props.length; for (; n--; ) { let r = e3.props[n]; if (Wr(r) && (r = r()), typeof r == "object" && r !== null && t in r) return r[t]; } }, set(e3, t, n) { let r = e3.props.length; for (; r--; ) { let o = e3.props[r]; Wr(o) && (o = o()); const i = Sn(o, t); if (i && i.set) return i.set(n), true; } return false; }, getOwnPropertyDescriptor(e3, t) { let n = e3.props.length; for (; n--; ) { let r = e3.props[n]; if (Wr(r) && (r = r()), typeof r == "object" && r !== null && t in r) { const o = Sn(r, t); return o && !o.configurable && (o.configurable = true), o; } } }, has(e3, t) { if (t === fn || t === As) return false; for (let n of e3.props) if (Wr(n) && (n = n()), n != null && t in n) return true; return false; }, ownKeys(e3) { const t = []; for (let n of e3.props) if (Wr(n) && (n = n()), !!n) { for (const r in n) t.includes(r) || t.push(r); for (const r of Object.getOwnPropertySymbols(n)) t.includes(r) || t.push(r); } return t; } }; function Be(...e3) { return new Proxy({ props: e3 }, Xp); } function v(e3, t, n, r) { var o = !jr || (n & $f) !== 0, i = (n & _f) !== 0, s = (n & kf) !== 0, a = ( /** @type {V} */ r ), l = true, u = () => (l && (l = false, a = s ? lt( /** @type {() => V} */ r ) : ( /** @type {V} */ r )), a), d; if (i) { var p = fn in e3 || As in e3; d = Sn(e3, t)?.set ?? (p && t in e3 ? (_) => e3[t] = _ : void 0); } var f, h = false; i ? [f, h] = Yp(() => ( /** @type {V} */ e3[t] )) : f = /** @type {V} */ e3[t], f === void 0 && r !== void 0 && (f = u(), d && (o && Kf(), d(f))); var y; if (o ? y = () => { var _ = ( /** @type {V} */ e3[t] ); return _ === void 0 ? u() : (l = true, _); } : y = () => { var _ = ( /** @type {V} */ e3[t] ); return _ !== void 0 && (a = /** @type {V} */ void 0), _ === void 0 ? a : _; }, o && (n & Vl) === 0) return y; if (d) { var w = e3.$$legacy; return ( /** @type {() => V} */ function(_, x) { return arguments.length > 0 ? ((!o || !x || w || h) && d(x ? y() : _), _) : y(); } ); } var m = false, b = ((n & Cf) !== 0 ? bo : Is)(() => (m = false, y())); i && c(b); var $ = ( /** @type {Effect} */ Ne ); return ( /** @type {() => V} */ function(_, x) { if (arguments.length > 0) { const k = x ? c(b) : o && i ? Rt(_) : _; return Q(b, k), m = true, a !== void 0 && (a = k), _; } return yr && m || ($.f & En) !== 0 ? b.v : c(b); } ); } function Gp(e3) { return new Up(e3); } var Up = class { /** @type {any} */ #e; /** @type {Record} */ #t; /** * @param {ComponentConstructorOptions & { * component: any; * }} options */ constructor(t) { var n = /* @__PURE__ */ new Map(), r = (i, s) => { var a = ou(s, false, false); return n.set(i, a), a; }; const o = new Proxy( { ...t.props || {}, $$events: {} }, { get(i, s) { return c(n.get(s) ?? r(s, Reflect.get(i, s))); }, has(i, s) { return s === As ? true : (c(n.get(s) ?? r(s, Reflect.get(i, s))), Reflect.has(i, s)); }, set(i, s, a) { return Q(n.get(s) ?? r(s, a), a), Reflect.set(i, s, a); } } ); this.#t = (t.hydrate ? Vp : Nu)(t.component, { target: t.target, anchor: t.anchor, props: o, context: t.context, intro: t.intro ?? false, recover: t.recover }), (!t?.props?.$$host || t.sync === false) && g(), this.#e = o.$$events; for (const i of Object.keys(this.#t)) i === "$set" || i === "$destroy" || i === "$on" || ei(this, i, { get() { return this.#t[i]; }, /** @param {any} value */ set(s) { this.#t[i] = s; }, enumerable: true }); this.#t.$set = /** @param {Record} next */ (i) => { Object.assign(o, i); }, this.#t.$destroy = () => { Dp(this.#t); }; } /** @param {Record} props */ $set(t) { this.#t.$set(t); } /** * @param {string} event * @param {(...args: any[]) => any} callback * @returns {any} */ $on(t, n) { this.#e[t] = this.#e[t] || []; const r = (...o) => n.call(this, ...o); return this.#e[t].push(r), () => { this.#e[t] = this.#e[t].filter( /** @param {any} fn */ (o) => o !== r ); }; } $destroy() { this.#t.$destroy(); } }; var zu; typeof HTMLElement == "function" && (zu = class extends HTMLElement { /** The Svelte component constructor */ $$ctor; /** Slots */ $$s; /** @type {any} The Svelte component instance */ $$c; /** Whether or not the custom element is connected */ $$cn = false; /** @type {Record} Component props data */ $$d = {}; /** `true` if currently in the process of reflecting component props back to attributes */ $$r = false; /** @type {Record} Props definition (name, reflected, type etc) */ $$p_d = {}; /** @type {Record} Event listeners */ $$l = {}; /** @type {Map} Event listener unsubscribe functions */ $$l_u = /* @__PURE__ */ new Map(); /** @type {any} The managed render effect for reflecting attributes */ $$me; /** * @param {*} $$componentCtor * @param {*} $$slots * @param {*} use_shadow_dom */ constructor(e3, t, n) { super(), this.$$ctor = e3, this.$$s = t, n && this.attachShadow({ mode: "open" }); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ addEventListener(e3, t, n) { if (this.$$l[e3] = this.$$l[e3] || [], this.$$l[e3].push(t), this.$$c) { const r = this.$$c.$on(e3, t); this.$$l_u.set(t, r); } super.addEventListener(e3, t, n); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ removeEventListener(e3, t, n) { if (super.removeEventListener(e3, t, n), this.$$c) { const r = this.$$l_u.get(t); r && (r(), this.$$l_u.delete(t)); } } async connectedCallback() { if (this.$$cn = true, !this.$$c) { let e3 = function(r) { return (o) => { const i = document.createElement("slot"); r !== "default" && (i.name = r), L(o, i); }; }; if (await Promise.resolve(), !this.$$cn || this.$$c) return; const t = {}, n = Qp(this); for (const r of this.$$s) r in n && (r === "default" && !this.$$d.children ? (this.$$d.children = e3(r), t.default = true) : t[r] = e3(r)); for (const r of this.attributes) { const o = this.$$g_p(r.name); o in this.$$d || (this.$$d[o] = Fo(o, r.value, this.$$p_d, "toProp")); } for (const r in this.$$p_d) !(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]); this.$$c = Gp({ component: this.$$ctor, target: this.shadowRoot || this, props: { ...this.$$d, $$slots: t, $$host: this } }), this.$$me = Rs(() => { xo(() => { this.$$r = true; for (const r of Jo(this.$$c)) { if (!this.$$p_d[r]?.reflect) continue; this.$$d[r] = this.$$c[r]; const o = Fo( r, this.$$d[r], this.$$p_d, "toAttribute" ); o == null ? this.removeAttribute(this.$$p_d[r].attribute || r) : this.setAttribute(this.$$p_d[r].attribute || r, o); } this.$$r = false; }); }); for (const r in this.$$l) for (const o of this.$$l[r]) { const i = this.$$c.$on(r, o); this.$$l_u.set(o, i); } this.$$l = {}; } } // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte // and setting attributes through setAttribute etc, this is helpful /** * @param {string} attr * @param {string} _oldValue * @param {string} newValue */ attributeChangedCallback(e3, t, n) { this.$$r || (e3 = this.$$g_p(e3), this.$$d[e3] = Fo(e3, n, this.$$p_d, "toProp"), this.$$c?.$set({ [e3]: this.$$d[e3] })); } disconnectedCallback() { this.$$cn = false, Promise.resolve().then(() => { !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0); }); } /** * @param {string} attribute_name */ $$g_p(e3) { return Jo(this.$$p_d).find( (t) => this.$$p_d[t].attribute === e3 || !this.$$p_d[t].attribute && t.toLowerCase() === e3 ) || e3; } }); function Fo(e3, t, n, r) { const o = n[e3]?.type; if (t = o === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e3]) return t; if (r === "toAttribute") switch (o) { case "Object": case "Array": return t == null ? null : JSON.stringify(t); case "Boolean": return t ? "" : null; case "Number": return t ?? null; default: return t; } else switch (o) { case "Object": case "Array": return t && JSON.parse(t); case "Boolean": return t; // conversion already handled above case "Number": return t != null ? +t : t; default: return t; } } function Qp(e3) { const t = {}; return e3.childNodes.forEach((n) => { t[ /** @type {Element} node */ n.slot || "default" ] = true; }), t; } function se(e3, t, n, r, o, i) { let s = class extends zu { constructor() { super(e3, n, o), this.$$p_d = t; } static get observedAttributes() { return Jo(t).map( (a) => (t[a].attribute || a).toLowerCase() ); } }; return Jo(t).forEach((a) => { ei(s.prototype, a, { get() { return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a]; }, set(l) { l = Fo(a, l, t), this.$$d[a] = l; var u = this.$$c; if (u) { var d = Sn(u, a)?.get; d ? u[a] = l : u.$set({ [a]: l }); } } }); }), r.forEach((a) => { ei(s.prototype, a, { get() { return this.$$c?.[a]; } }); }), e3.element = /** @type {any} */ s, s; } var Jp = { value: () => { } }; function Vi() { for (var e3 = 0, t = arguments.length, n = {}, r; e3 < t; ++e3) { if (!(r = arguments[e3] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } return new qo(n); } function qo(e3) { this._ = e3; } function eh(e3, t) { return e3.trim().split(/^|\s+/).map(function(n) { var r = "", o = n.indexOf("."); if (o >= 0 && (r = n.slice(o + 1), n = n.slice(0, o)), n && !t.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } qo.prototype = Vi.prototype = { constructor: qo, on: function(e3, t) { var n = this._, r = eh(e3 + "", n), o, i = -1, s = r.length; if (arguments.length < 2) { for (; ++i < s; ) if ((o = (e3 = r[i]).type) && (o = th(n[o], e3.name))) return o; return; } if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); for (; ++i < s; ) if (o = (e3 = r[i]).type) n[o] = za(n[o], e3.name, t); else if (t == null) for (o in n) n[o] = za(n[o], e3.name, null); return this; }, copy: function() { var e3 = {}, t = this._; for (var n in t) e3[n] = t[n].slice(); return new qo(e3); }, call: function(e3, t) { if ((o = arguments.length - 2) > 0) for (var n = new Array(o), r = 0, o, i; r < o; ++r) n[r] = arguments[r + 2]; if (!this._.hasOwnProperty(e3)) throw new Error("unknown type: " + e3); for (i = this._[e3], r = 0, o = i.length; r < o; ++r) i[r].value.apply(t, n); }, apply: function(e3, t, n) { if (!this._.hasOwnProperty(e3)) throw new Error("unknown type: " + e3); for (var r = this._[e3], o = 0, i = r.length; o < i; ++o) r[o].value.apply(t, n); } }; function th(e3, t) { for (var n = 0, r = e3.length, o; n < r; ++n) if ((o = e3[n]).name === t) return o.value; } function za(e3, t, n) { for (var r = 0, o = e3.length; r < o; ++r) if (e3[r].name === t) { e3[r] = Jp, e3 = e3.slice(0, r).concat(e3.slice(r + 1)); break; } return n != null && e3.push({ name: t, value: n }), e3; } var vs = "http://www.w3.org/1999/xhtml"; var Aa = { svg: "http://www.w3.org/2000/svg", xhtml: vs, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; function Di(e3) { var t = e3 += "", n = t.indexOf(":"); return n >= 0 && (t = e3.slice(0, n)) !== "xmlns" && (e3 = e3.slice(n + 1)), Aa.hasOwnProperty(t) ? { space: Aa[t], local: e3 } : e3; } function nh(e3) { return function() { var t = this.ownerDocument, n = this.namespaceURI; return n === vs && t.documentElement.namespaceURI === vs ? t.createElement(e3) : t.createElementNS(n, e3); }; } function rh(e3) { return function() { return this.ownerDocument.createElementNS(e3.space, e3.local); }; } function Au(e3) { var t = Di(e3); return (t.local ? rh : nh)(t); } function oh() { } function Us(e3) { return e3 == null ? oh : function() { return this.querySelector(e3); }; } function ih(e3) { typeof e3 != "function" && (e3 = Us(e3)); for (var t = this._groups, n = t.length, r = new Array(n), o = 0; o < n; ++o) for (var i = t[o], s = i.length, a = r[o] = new Array(s), l, u, d = 0; d < s; ++d) (l = i[d]) && (u = e3.call(l, l.__data__, d, i)) && ("__data__" in l && (u.__data__ = l.__data__), a[d] = u); return new At(r, this._parents); } function sh(e3) { return e3 == null ? [] : Array.isArray(e3) ? e3 : Array.from(e3); } function ah() { return []; } function Hu(e3) { return e3 == null ? ah : function() { return this.querySelectorAll(e3); }; } function lh(e3) { return function() { return sh(e3.apply(this, arguments)); }; } function uh(e3) { typeof e3 == "function" ? e3 = lh(e3) : e3 = Hu(e3); for (var t = this._groups, n = t.length, r = [], o = [], i = 0; i < n; ++i) for (var s = t[i], a = s.length, l, u = 0; u < a; ++u) (l = s[u]) && (r.push(e3.call(l, l.__data__, u, s)), o.push(l)); return new At(r, o); } function Iu(e3) { return function() { return this.matches(e3); }; } function Zu(e3) { return function(t) { return t.matches(e3); }; } var ch = Array.prototype.find; function dh(e3) { return function() { return ch.call(this.children, e3); }; } function fh() { return this.firstElementChild; } function ph(e3) { return this.select(e3 == null ? fh : dh(typeof e3 == "function" ? e3 : Zu(e3))); } var hh = Array.prototype.filter; function gh() { return Array.from(this.children); } function vh(e3) { return function() { return hh.call(this.children, e3); }; } function mh(e3) { return this.selectAll(e3 == null ? gh : vh(typeof e3 == "function" ? e3 : Zu(e3))); } function yh(e3) { typeof e3 != "function" && (e3 = Iu(e3)); for (var t = this._groups, n = t.length, r = new Array(n), o = 0; o < n; ++o) for (var i = t[o], s = i.length, a = r[o] = [], l, u = 0; u < s; ++u) (l = i[u]) && e3.call(l, l.__data__, u, i) && a.push(l); return new At(r, this._parents); } function ju(e3) { return new Array(e3.length); } function wh() { return new At(this._enter || this._groups.map(ju), this._parents); } function si(e3, t) { this.ownerDocument = e3.ownerDocument, this.namespaceURI = e3.namespaceURI, this._next = null, this._parent = e3, this.__data__ = t; } si.prototype = { constructor: si, appendChild: function(e3) { return this._parent.insertBefore(e3, this._next); }, insertBefore: function(e3, t) { return this._parent.insertBefore(e3, t); }, querySelector: function(e3) { return this._parent.querySelector(e3); }, querySelectorAll: function(e3) { return this._parent.querySelectorAll(e3); } }; function bh(e3) { return function() { return e3; }; } function xh(e3, t, n, r, o, i) { for (var s = 0, a, l = t.length, u = i.length; s < u; ++s) (a = t[s]) ? (a.__data__ = i[s], r[s] = a) : n[s] = new si(e3, i[s]); for (; s < l; ++s) (a = t[s]) && (o[s] = a); } function Ch(e3, t, n, r, o, i, s) { var a, l, u = /* @__PURE__ */ new Map(), d = t.length, p = i.length, f = new Array(d), h; for (a = 0; a < d; ++a) (l = t[a]) && (f[a] = h = s.call(l, l.__data__, a, t) + "", u.has(h) ? o[a] = l : u.set(h, l)); for (a = 0; a < p; ++a) h = s.call(e3, i[a], a, i) + "", (l = u.get(h)) ? (r[a] = l, l.__data__ = i[a], u.delete(h)) : n[a] = new si(e3, i[a]); for (a = 0; a < d; ++a) (l = t[a]) && u.get(f[a]) === l && (o[a] = l); } function $h(e3) { return e3.__data__; } function _h(e3, t) { if (!arguments.length) return Array.from(this, $h); var n = t ? Ch : xh, r = this._parents, o = this._groups; typeof e3 != "function" && (e3 = bh(e3)); for (var i = o.length, s = new Array(i), a = new Array(i), l = new Array(i), u = 0; u < i; ++u) { var d = r[u], p = o[u], f = p.length, h = kh(e3.call(d, d && d.__data__, u, r)), y = h.length, w = a[u] = new Array(y), m = s[u] = new Array(y), b = l[u] = new Array(f); n(d, p, w, m, b, h, t); for (var $ = 0, _ = 0, x, k; $ < y; ++$) if (x = w[$]) { for ($ >= _ && (_ = $ + 1); !(k = m[_]) && ++_ < y; ) ; x._next = k || null; } } return s = new At(s, r), s._enter = a, s._exit = l, s; } function kh(e3) { return typeof e3 == "object" && "length" in e3 ? e3 : Array.from(e3); } function Sh() { return new At(this._exit || this._groups.map(ju), this._parents); } function Eh(e3, t, n) { var r = this.enter(), o = this, i = this.exit(); return typeof e3 == "function" ? (r = e3(r), r && (r = r.selection())) : r = r.append(e3 + ""), t != null && (o = t(o), o && (o = o.selection())), n == null ? i.remove() : n(i), r && o ? r.merge(o).order() : o; } function Ph(e3) { for (var t = e3.selection ? e3.selection() : e3, n = this._groups, r = t._groups, o = n.length, i = r.length, s = Math.min(o, i), a = new Array(o), l = 0; l < s; ++l) for (var u = n[l], d = r[l], p = u.length, f = a[l] = new Array(p), h, y = 0; y < p; ++y) (h = u[y] || d[y]) && (f[y] = h); for (; l < o; ++l) a[l] = n[l]; return new At(a, this._parents); } function Nh() { for (var e3 = this._groups, t = -1, n = e3.length; ++t < n; ) for (var r = e3[t], o = r.length - 1, i = r[o], s; --o >= 0; ) (s = r[o]) && (i && s.compareDocumentPosition(i) ^ 4 && i.parentNode.insertBefore(s, i), i = s); return this; } function Mh(e3) { e3 || (e3 = Th); function t(p, f) { return p && f ? e3(p.__data__, f.__data__) : !p - !f; } for (var n = this._groups, r = n.length, o = new Array(r), i = 0; i < r; ++i) { for (var s = n[i], a = s.length, l = o[i] = new Array(a), u, d = 0; d < a; ++d) (u = s[d]) && (l[d] = u); l.sort(t); } return new At(o, this._parents).order(); } function Th(e3, t) { return e3 < t ? -1 : e3 > t ? 1 : e3 >= t ? 0 : NaN; } function Lh() { var e3 = arguments[0]; return arguments[0] = this, e3.apply(null, arguments), this; } function Vh() { return Array.from(this); } function Dh() { for (var e3 = this._groups, t = 0, n = e3.length; t < n; ++t) for (var r = e3[t], o = 0, i = r.length; o < i; ++o) { var s = r[o]; if (s) return s; } return null; } function Oh() { let e3 = 0; for (const t of this) ++e3; return e3; } function zh() { return !this.node(); } function Ah(e3) { for (var t = this._groups, n = 0, r = t.length; n < r; ++n) for (var o = t[n], i = 0, s = o.length, a; i < s; ++i) (a = o[i]) && e3.call(a, a.__data__, i, o); return this; } function Hh(e3) { return function() { this.removeAttribute(e3); }; } function Ih(e3) { return function() { this.removeAttributeNS(e3.space, e3.local); }; } function Zh(e3, t) { return function() { this.setAttribute(e3, t); }; } function jh(e3, t) { return function() { this.setAttributeNS(e3.space, e3.local, t); }; } function Kh(e3, t) { return function() { var n = t.apply(this, arguments); n == null ? this.removeAttribute(e3) : this.setAttribute(e3, n); }; } function Rh(e3, t) { return function() { var n = t.apply(this, arguments); n == null ? this.removeAttributeNS(e3.space, e3.local) : this.setAttributeNS(e3.space, e3.local, n); }; } function Bh(e3, t) { var n = Di(e3); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } return this.each((t == null ? n.local ? Ih : Hh : typeof t == "function" ? n.local ? Rh : Kh : n.local ? jh : Zh)(n, t)); } function Ku(e3) { return e3.ownerDocument && e3.ownerDocument.defaultView || e3.document && e3 || e3.defaultView; } function Wh(e3) { return function() { this.style.removeProperty(e3); }; } function Yh(e3, t, n) { return function() { this.style.setProperty(e3, t, n); }; } function Fh(e3, t, n) { return function() { var r = t.apply(this, arguments); r == null ? this.style.removeProperty(e3) : this.style.setProperty(e3, r, n); }; } function qh(e3, t, n) { return arguments.length > 1 ? this.each((t == null ? Wh : typeof t == "function" ? Fh : Yh)(e3, t, n ?? "")) : Dr(this.node(), e3); } function Dr(e3, t) { return e3.style.getPropertyValue(t) || Ku(e3).getComputedStyle(e3, null).getPropertyValue(t); } function Xh(e3) { return function() { delete this[e3]; }; } function Gh(e3, t) { return function() { this[e3] = t; }; } function Uh(e3, t) { return function() { var n = t.apply(this, arguments); n == null ? delete this[e3] : this[e3] = n; }; } function Qh(e3, t) { return arguments.length > 1 ? this.each((t == null ? Xh : typeof t == "function" ? Uh : Gh)(e3, t)) : this.node()[e3]; } function Ru(e3) { return e3.trim().split(/^|\s+/); } function Qs(e3) { return e3.classList || new Bu(e3); } function Bu(e3) { this._node = e3, this._names = Ru(e3.getAttribute("class") || ""); } Bu.prototype = { add: function(e3) { var t = this._names.indexOf(e3); t < 0 && (this._names.push(e3), this._node.setAttribute("class", this._names.join(" "))); }, remove: function(e3) { var t = this._names.indexOf(e3); t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" "))); }, contains: function(e3) { return this._names.indexOf(e3) >= 0; } }; function Wu(e3, t) { for (var n = Qs(e3), r = -1, o = t.length; ++r < o; ) n.add(t[r]); } function Yu(e3, t) { for (var n = Qs(e3), r = -1, o = t.length; ++r < o; ) n.remove(t[r]); } function Jh(e3) { return function() { Wu(this, e3); }; } function eg(e3) { return function() { Yu(this, e3); }; } function tg(e3, t) { return function() { (t.apply(this, arguments) ? Wu : Yu)(this, e3); }; } function ng(e3, t) { var n = Ru(e3 + ""); if (arguments.length < 2) { for (var r = Qs(this.node()), o = -1, i = n.length; ++o < i; ) if (!r.contains(n[o])) return false; return true; } return this.each((typeof t == "function" ? tg : t ? Jh : eg)(n, t)); } function rg() { this.textContent = ""; } function og(e3) { return function() { this.textContent = e3; }; } function ig(e3) { return function() { var t = e3.apply(this, arguments); this.textContent = t ?? ""; }; } function sg(e3) { return arguments.length ? this.each(e3 == null ? rg : (typeof e3 == "function" ? ig : og)(e3)) : this.node().textContent; } function ag() { this.innerHTML = ""; } function lg(e3) { return function() { this.innerHTML = e3; }; } function ug(e3) { return function() { var t = e3.apply(this, arguments); this.innerHTML = t ?? ""; }; } function cg(e3) { return arguments.length ? this.each(e3 == null ? ag : (typeof e3 == "function" ? ug : lg)(e3)) : this.node().innerHTML; } function dg() { this.nextSibling && this.parentNode.appendChild(this); } function fg() { return this.each(dg); } function pg() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function hg() { return this.each(pg); } function gg(e3) { var t = typeof e3 == "function" ? e3 : Au(e3); return this.select(function() { return this.appendChild(t.apply(this, arguments)); }); } function vg() { return null; } function mg(e3, t) { var n = typeof e3 == "function" ? e3 : Au(e3), r = t == null ? vg : typeof t == "function" ? t : Us(t); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } function yg() { var e3 = this.parentNode; e3 && e3.removeChild(this); } function wg() { return this.each(yg); } function bg() { var e3 = this.cloneNode(false), t = this.parentNode; return t ? t.insertBefore(e3, this.nextSibling) : e3; } function xg() { var e3 = this.cloneNode(true), t = this.parentNode; return t ? t.insertBefore(e3, this.nextSibling) : e3; } function Cg(e3) { return this.select(e3 ? xg : bg); } function $g(e3) { return arguments.length ? this.property("__data__", e3) : this.node().__data__; } function _g(e3) { return function(t) { e3.call(this, t, this.__data__); }; } function kg(e3) { return e3.trim().split(/^|\s+/).map(function(t) { var n = "", r = t.indexOf("."); return r >= 0 && (n = t.slice(r + 1), t = t.slice(0, r)), { type: t, name: n }; }); } function Sg(e3) { return function() { var t = this.__on; if (t) { for (var n = 0, r = -1, o = t.length, i; n < o; ++n) i = t[n], (!e3.type || i.type === e3.type) && i.name === e3.name ? this.removeEventListener(i.type, i.listener, i.options) : t[++r] = i; ++r ? t.length = r : delete this.__on; } }; } function Eg(e3, t, n) { return function() { var r = this.__on, o, i = _g(t); if (r) { for (var s = 0, a = r.length; s < a; ++s) if ((o = r[s]).type === e3.type && o.name === e3.name) { this.removeEventListener(o.type, o.listener, o.options), this.addEventListener(o.type, o.listener = i, o.options = n), o.value = t; return; } } this.addEventListener(e3.type, i, n), o = { type: e3.type, name: e3.name, value: t, listener: i, options: n }, r ? r.push(o) : this.__on = [o]; }; } function Pg(e3, t, n) { var r = kg(e3 + ""), o, i = r.length, s; if (arguments.length < 2) { var a = this.node().__on; if (a) { for (var l = 0, u = a.length, d; l < u; ++l) for (o = 0, d = a[l]; o < i; ++o) if ((s = r[o]).type === d.type && s.name === d.name) return d.value; } return; } for (a = t ? Eg : Sg, o = 0; o < i; ++o) this.each(a(r[o], t, n)); return this; } function Fu(e3, t, n) { var r = Ku(e3), o = r.CustomEvent; typeof o == "function" ? o = new o(t, n) : (o = r.document.createEvent("Event"), n ? (o.initEvent(t, n.bubbles, n.cancelable), o.detail = n.detail) : o.initEvent(t, false, false)), e3.dispatchEvent(o); } function Ng(e3, t) { return function() { return Fu(this, e3, t); }; } function Mg(e3, t) { return function() { return Fu(this, e3, t.apply(this, arguments)); }; } function Tg(e3, t) { return this.each((typeof t == "function" ? Mg : Ng)(e3, t)); } function* Lg() { for (var e3 = this._groups, t = 0, n = e3.length; t < n; ++t) for (var r = e3[t], o = 0, i = r.length, s; o < i; ++o) (s = r[o]) && (yield s); } var qu = [null]; function At(e3, t) { this._groups = e3, this._parents = t; } function _o() { return new At([[document.documentElement]], qu); } function Vg() { return this; } At.prototype = _o.prototype = { constructor: At, select: ih, selectAll: uh, selectChild: ph, selectChildren: mh, filter: yh, data: _h, enter: wh, exit: Sh, join: Eh, merge: Ph, selection: Vg, order: Nh, sort: Mh, call: Lh, nodes: Vh, node: Dh, size: Oh, empty: zh, each: Ah, attr: Bh, style: qh, property: Qh, classed: ng, text: sg, html: cg, raise: fg, lower: hg, append: gg, insert: mg, remove: wg, clone: Cg, datum: $g, on: Pg, dispatch: Tg, [Symbol.iterator]: Lg }; function Kt(e3) { return typeof e3 == "string" ? new At([[document.querySelector(e3)]], [document.documentElement]) : new At([[e3]], qu); } function Dg(e3) { let t; for (; t = e3.sourceEvent; ) e3 = t; return e3; } function qt(e3, t) { if (e3 = Dg(e3), t === void 0 && (t = e3.currentTarget), t) { var n = t.ownerSVGElement || t; if (n.createSVGPoint) { var r = n.createSVGPoint(); return r.x = e3.clientX, r.y = e3.clientY, r = r.matrixTransform(t.getScreenCTM().inverse()), [r.x, r.y]; } if (t.getBoundingClientRect) { var o = t.getBoundingClientRect(); return [e3.clientX - o.left - t.clientLeft, e3.clientY - o.top - t.clientTop]; } } return [e3.pageX, e3.pageY]; } var Og = { passive: false }; var io = { capture: true, passive: false }; function qi(e3) { e3.stopImmediatePropagation(); } function kr(e3) { e3.preventDefault(), e3.stopImmediatePropagation(); } function Xu(e3) { var t = e3.document.documentElement, n = Kt(e3).on("dragstart.drag", kr, io); "onselectstart" in t ? n.on("selectstart.drag", kr, io) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none"); } function Gu(e3, t) { var n = e3.document.documentElement, r = Kt(e3).on("dragstart.drag", null); t && (r.on("click.drag", kr, io), setTimeout(function() { r.on("click.drag", null); }, 0)), "onselectstart" in n ? r.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect); } var Io = (e3) => () => e3; function ms(e3, { sourceEvent: t, subject: n, target: r, identifier: o, active: i, x: s, y: a, dx: l, dy: u, dispatch: d }) { Object.defineProperties(this, { type: { value: e3, enumerable: true, configurable: true }, sourceEvent: { value: t, enumerable: true, configurable: true }, subject: { value: n, enumerable: true, configurable: true }, target: { value: r, enumerable: true, configurable: true }, identifier: { value: o, enumerable: true, configurable: true }, active: { value: i, enumerable: true, configurable: true }, x: { value: s, enumerable: true, configurable: true }, y: { value: a, enumerable: true, configurable: true }, dx: { value: l, enumerable: true, configurable: true }, dy: { value: u, enumerable: true, configurable: true }, _: { value: d } }); } ms.prototype.on = function() { var e3 = this._.on.apply(this._, arguments); return e3 === this._ ? this : e3; }; function zg(e3) { return !e3.ctrlKey && !e3.button; } function Ag() { return this.parentNode; } function Hg(e3, t) { return t ?? { x: e3.x, y: e3.y }; } function Ig() { return navigator.maxTouchPoints || "ontouchstart" in this; } function Zg() { var e3 = zg, t = Ag, n = Hg, r = Ig, o = {}, i = Vi("start", "drag", "end"), s = 0, a, l, u, d, p = 0; function f(x) { x.on("mousedown.drag", h).filter(r).on("touchstart.drag", m).on("touchmove.drag", b, Og).on("touchend.drag touchcancel.drag", $).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); } function h(x, k) { if (!(d || !e3.call(this, x, k))) { var N = _(this, t.call(this, x, k), x, k, "mouse"); N && (Kt(x.view).on("mousemove.drag", y, io).on("mouseup.drag", w, io), Xu(x.view), qi(x), u = false, a = x.clientX, l = x.clientY, N("start", x)); } } function y(x) { if (kr(x), !u) { var k = x.clientX - a, N = x.clientY - l; u = k * k + N * N > p; } o.mouse("drag", x); } function w(x) { Kt(x.view).on("mousemove.drag mouseup.drag", null), Gu(x.view, u), kr(x), o.mouse("end", x); } function m(x, k) { if (e3.call(this, x, k)) { var N = x.changedTouches, V = t.call(this, x, k), j = N.length, A, H; for (A = 0; A < j; ++A) (H = _(this, V, x, k, N[A].identifier, N[A])) && (qi(x), H("start", x, N[A])); } } function b(x) { var k = x.changedTouches, N = k.length, V, j; for (V = 0; V < N; ++V) (j = o[k[V].identifier]) && (kr(x), j("drag", x, k[V])); } function $(x) { var k = x.changedTouches, N = k.length, V, j; for (d && clearTimeout(d), d = setTimeout(function() { d = null; }, 500), V = 0; V < N; ++V) (j = o[k[V].identifier]) && (qi(x), j("end", x, k[V])); } function _(x, k, N, V, j, A) { var H = i.copy(), z = qt(A || N, k), S, T, C; if ((C = n.call(x, new ms("beforestart", { sourceEvent: N, target: f, identifier: j, active: s, x: z[0], y: z[1], dx: 0, dy: 0, dispatch: H }), V)) != null) return S = C.x - z[0] || 0, T = C.y - z[1] || 0, function P(M, K, B) { var W = z, D; switch (M) { case "start": o[j] = P, D = s++; break; case "end": delete o[j], --s; // falls through case "drag": z = qt(B || K, k), D = s; break; } H.call( M, x, new ms(M, { sourceEvent: K, subject: C, target: f, identifier: j, active: D, x: z[0] + S, y: z[1] + T, dx: z[0] - W[0], dy: z[1] - W[1], dispatch: H }), V ); }; } return f.filter = function(x) { return arguments.length ? (e3 = typeof x == "function" ? x : Io(!!x), f) : e3; }, f.container = function(x) { return arguments.length ? (t = typeof x == "function" ? x : Io(x), f) : t; }, f.subject = function(x) { return arguments.length ? (n = typeof x == "function" ? x : Io(x), f) : n; }, f.touchable = function(x) { return arguments.length ? (r = typeof x == "function" ? x : Io(!!x), f) : r; }, f.on = function() { var x = i.on.apply(i, arguments); return x === i ? f : x; }, f.clickDistance = function(x) { return arguments.length ? (p = (x = +x) * x, f) : Math.sqrt(p); }, f; } function Js(e3, t, n) { e3.prototype = t.prototype = n, n.constructor = e3; } function Uu(e3, t) { var n = Object.create(e3.prototype); for (var r in t) n[r] = t[r]; return n; } function ko() { } var so = 0.7; var ai = 1 / so; var Sr = "\\s*([+-]?\\d+)\\s*"; var ao = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*"; var pn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*"; var jg = /^#([0-9a-f]{3,8})$/; var Kg = new RegExp(`^rgb\\(${Sr},${Sr},${Sr}\\)$`); var Rg = new RegExp(`^rgb\\(${pn},${pn},${pn}\\)$`); var Bg = new RegExp(`^rgba\\(${Sr},${Sr},${Sr},${ao}\\)$`); var Wg = new RegExp(`^rgba\\(${pn},${pn},${pn},${ao}\\)$`); var Yg = new RegExp(`^hsl\\(${ao},${pn},${pn}\\)$`); var Fg = new RegExp(`^hsla\\(${ao},${pn},${pn},${ao}\\)$`); var Ha = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }; Js(ko, fr, { copy(e3) { return Object.assign(new this.constructor(), this, e3); }, displayable() { return this.rgb().displayable(); }, hex: Ia, // Deprecated! Use color.formatHex. formatHex: Ia, formatHex8: qg, formatHsl: Xg, formatRgb: Za, toString: Za }); function Ia() { return this.rgb().formatHex(); } function qg() { return this.rgb().formatHex8(); } function Xg() { return Qu(this).formatHsl(); } function Za() { return this.rgb().formatRgb(); } function fr(e3) { var t, n; return e3 = (e3 + "").trim().toLowerCase(), (t = jg.exec(e3)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? ja(t) : n === 3 ? new _t(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? Zo(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? Zo(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Kg.exec(e3)) ? new _t(t[1], t[2], t[3], 1) : (t = Rg.exec(e3)) ? new _t(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = Bg.exec(e3)) ? Zo(t[1], t[2], t[3], t[4]) : (t = Wg.exec(e3)) ? Zo(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = Yg.exec(e3)) ? Ba(t[1], t[2] / 100, t[3] / 100, 1) : (t = Fg.exec(e3)) ? Ba(t[1], t[2] / 100, t[3] / 100, t[4]) : Ha.hasOwnProperty(e3) ? ja(Ha[e3]) : e3 === "transparent" ? new _t(NaN, NaN, NaN, 0) : null; } function ja(e3) { return new _t(e3 >> 16 & 255, e3 >> 8 & 255, e3 & 255, 1); } function Zo(e3, t, n, r) { return r <= 0 && (e3 = t = n = NaN), new _t(e3, t, n, r); } function Gg(e3) { return e3 instanceof ko || (e3 = fr(e3)), e3 ? (e3 = e3.rgb(), new _t(e3.r, e3.g, e3.b, e3.opacity)) : new _t(); } function ys(e3, t, n, r) { return arguments.length === 1 ? Gg(e3) : new _t(e3, t, n, r ?? 1); } function _t(e3, t, n, r) { this.r = +e3, this.g = +t, this.b = +n, this.opacity = +r; } Js(_t, ys, Uu(ko, { brighter(e3) { return e3 = e3 == null ? ai : Math.pow(ai, e3), new _t(this.r * e3, this.g * e3, this.b * e3, this.opacity); }, darker(e3) { return e3 = e3 == null ? so : Math.pow(so, e3), new _t(this.r * e3, this.g * e3, this.b * e3, this.opacity); }, rgb() { return this; }, clamp() { return new _t(lr(this.r), lr(this.g), lr(this.b), li(this.opacity)); }, displayable() { return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1; }, hex: Ka, // Deprecated! Use color.formatHex. formatHex: Ka, formatHex8: Ug, formatRgb: Ra, toString: Ra })); function Ka() { return `#${ir(this.r)}${ir(this.g)}${ir(this.b)}`; } function Ug() { return `#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Ra() { const e3 = li(this.opacity); return `${e3 === 1 ? "rgb(" : "rgba("}${lr(this.r)}, ${lr(this.g)}, ${lr(this.b)}${e3 === 1 ? ")" : `, ${e3})`}`; } function li(e3) { return isNaN(e3) ? 1 : Math.max(0, Math.min(1, e3)); } function lr(e3) { return Math.max(0, Math.min(255, Math.round(e3) || 0)); } function ir(e3) { return e3 = lr(e3), (e3 < 16 ? "0" : "") + e3.toString(16); } function Ba(e3, t, n, r) { return r <= 0 ? e3 = t = n = NaN : n <= 0 || n >= 1 ? e3 = t = NaN : t <= 0 && (e3 = NaN), new Xt(e3, t, n, r); } function Qu(e3) { if (e3 instanceof Xt) return new Xt(e3.h, e3.s, e3.l, e3.opacity); if (e3 instanceof ko || (e3 = fr(e3)), !e3) return new Xt(); if (e3 instanceof Xt) return e3; e3 = e3.rgb(); var t = e3.r / 255, n = e3.g / 255, r = e3.b / 255, o = Math.min(t, n, r), i = Math.max(t, n, r), s = NaN, a = i - o, l = (i + o) / 2; return a ? (t === i ? s = (n - r) / a + (n < r) * 6 : n === i ? s = (r - t) / a + 2 : s = (t - n) / a + 4, a /= l < 0.5 ? i + o : 2 - i - o, s *= 60) : a = l > 0 && l < 1 ? 0 : s, new Xt(s, a, l, e3.opacity); } function Qg(e3, t, n, r) { return arguments.length === 1 ? Qu(e3) : new Xt(e3, t, n, r ?? 1); } function Xt(e3, t, n, r) { this.h = +e3, this.s = +t, this.l = +n, this.opacity = +r; } Js(Xt, Qg, Uu(ko, { brighter(e3) { return e3 = e3 == null ? ai : Math.pow(ai, e3), new Xt(this.h, this.s, this.l * e3, this.opacity); }, darker(e3) { return e3 = e3 == null ? so : Math.pow(so, e3), new Xt(this.h, this.s, this.l * e3, this.opacity); }, rgb() { var e3 = this.h % 360 + (this.h < 0) * 360, t = isNaN(e3) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, o = 2 * n - r; return new _t( Xi(e3 >= 240 ? e3 - 240 : e3 + 120, o, r), Xi(e3, o, r), Xi(e3 < 120 ? e3 + 240 : e3 - 120, o, r), this.opacity ); }, clamp() { return new Xt(Wa(this.h), jo(this.s), jo(this.l), li(this.opacity)); }, displayable() { return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; }, formatHsl() { const e3 = li(this.opacity); return `${e3 === 1 ? "hsl(" : "hsla("}${Wa(this.h)}, ${jo(this.s) * 100}%, ${jo(this.l) * 100}%${e3 === 1 ? ")" : `, ${e3})`}`; } })); function Wa(e3) { return e3 = (e3 || 0) % 360, e3 < 0 ? e3 + 360 : e3; } function jo(e3) { return Math.max(0, Math.min(1, e3 || 0)); } function Xi(e3, t, n) { return (e3 < 60 ? t + (n - t) * e3 / 60 : e3 < 180 ? n : e3 < 240 ? t + (n - t) * (240 - e3) / 60 : t) * 255; } var ea = (e3) => () => e3; function Jg(e3, t) { return function(n) { return e3 + n * t; }; } function e1(e3, t, n) { return e3 = Math.pow(e3, n), t = Math.pow(t, n) - e3, n = 1 / n, function(r) { return Math.pow(e3 + r * t, n); }; } function t1(e3) { return (e3 = +e3) == 1 ? Ju : function(t, n) { return n - t ? e1(t, n, e3) : ea(isNaN(t) ? n : t); }; } function Ju(e3, t) { var n = t - e3; return n ? Jg(e3, n) : ea(isNaN(e3) ? t : e3); } var ui = function e(t) { var n = t1(t); function r(o, i) { var s = n((o = ys(o)).r, (i = ys(i)).r), a = n(o.g, i.g), l = n(o.b, i.b), u = Ju(o.opacity, i.opacity); return function(d) { return o.r = s(d), o.g = a(d), o.b = l(d), o.opacity = u(d), o + ""; }; } return r.gamma = e, r; }(1); function n1(e3, t) { t || (t = []); var n = e3 ? Math.min(t.length, e3.length) : 0, r = t.slice(), o; return function(i) { for (o = 0; o < n; ++o) r[o] = e3[o] * (1 - i) + t[o] * i; return r; }; } function r1(e3) { return ArrayBuffer.isView(e3) && !(e3 instanceof DataView); } function o1(e3, t) { var n = t ? t.length : 0, r = e3 ? Math.min(n, e3.length) : 0, o = new Array(r), i = new Array(n), s; for (s = 0; s < r; ++s) o[s] = eo(e3[s], t[s]); for (; s < n; ++s) i[s] = t[s]; return function(a) { for (s = 0; s < r; ++s) i[s] = o[s](a); return i; }; } function i1(e3, t) { var n = /* @__PURE__ */ new Date(); return e3 = +e3, t = +t, function(r) { return n.setTime(e3 * (1 - r) + t * r), n; }; } function un(e3, t) { return e3 = +e3, t = +t, function(n) { return e3 * (1 - n) + t * n; }; } function s1(e3, t) { var n = {}, r = {}, o; (e3 === null || typeof e3 != "object") && (e3 = {}), (t === null || typeof t != "object") && (t = {}); for (o in t) o in e3 ? n[o] = eo(e3[o], t[o]) : r[o] = t[o]; return function(i) { for (o in n) r[o] = n[o](i); return r; }; } var ws = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g; var Gi = new RegExp(ws.source, "g"); function a1(e3) { return function() { return e3; }; } function l1(e3) { return function(t) { return e3(t) + ""; }; } function ec(e3, t) { var n = ws.lastIndex = Gi.lastIndex = 0, r, o, i, s = -1, a = [], l = []; for (e3 = e3 + "", t = t + ""; (r = ws.exec(e3)) && (o = Gi.exec(t)); ) (i = o.index) > n && (i = t.slice(n, i), a[s] ? a[s] += i : a[++s] = i), (r = r[0]) === (o = o[0]) ? a[s] ? a[s] += o : a[++s] = o : (a[++s] = null, l.push({ i: s, x: un(r, o) })), n = Gi.lastIndex; return n < t.length && (i = t.slice(n), a[s] ? a[s] += i : a[++s] = i), a.length < 2 ? l[0] ? l1(l[0].x) : a1(t) : (t = l.length, function(u) { for (var d = 0, p; d < t; ++d) a[(p = l[d]).i] = p.x(u); return a.join(""); }); } function eo(e3, t) { var n = typeof t, r; return t == null || n === "boolean" ? ea(t) : (n === "number" ? un : n === "string" ? (r = fr(t)) ? (t = r, ui) : ec : t instanceof fr ? ui : t instanceof Date ? i1 : r1(t) ? n1 : Array.isArray(t) ? o1 : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? s1 : un)(e3, t); } var Ya = 180 / Math.PI; var tc = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function nc(e3, t, n, r, o, i) { var s, a, l; return (s = Math.sqrt(e3 * e3 + t * t)) && (e3 /= s, t /= s), (l = e3 * n + t * r) && (n -= e3 * l, r -= t * l), (a = Math.sqrt(n * n + r * r)) && (n /= a, r /= a, l /= a), e3 * r < t * n && (e3 = -e3, t = -t, l = -l, s = -s), { translateX: o, translateY: i, rotate: Math.atan2(t, e3) * Ya, skewX: Math.atan(l) * Ya, scaleX: s, scaleY: a }; } var Ko; function u1(e3) { const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e3 + ""); return t.isIdentity ? tc : nc(t.a, t.b, t.c, t.d, t.e, t.f); } function c1(e3) { return e3 == null || (Ko || (Ko = document.createElementNS("http://www.w3.org/2000/svg", "g")), Ko.setAttribute("transform", e3), !(e3 = Ko.transform.baseVal.consolidate())) ? tc : (e3 = e3.matrix, nc(e3.a, e3.b, e3.c, e3.d, e3.e, e3.f)); } function rc(e3, t, n, r) { function o(u) { return u.length ? u.pop() + " " : ""; } function i(u, d, p, f, h, y) { if (u !== p || d !== f) { var w = h.push("translate(", null, t, null, n); y.push({ i: w - 4, x: un(u, p) }, { i: w - 2, x: un(d, f) }); } else (p || f) && h.push("translate(" + p + t + f + n); } function s(u, d, p, f) { u !== d ? (u - d > 180 ? d += 360 : d - u > 180 && (u += 360), f.push({ i: p.push(o(p) + "rotate(", null, r) - 2, x: un(u, d) })) : d && p.push(o(p) + "rotate(" + d + r); } function a(u, d, p, f) { u !== d ? f.push({ i: p.push(o(p) + "skewX(", null, r) - 2, x: un(u, d) }) : d && p.push(o(p) + "skewX(" + d + r); } function l(u, d, p, f, h, y) { if (u !== p || d !== f) { var w = h.push(o(h) + "scale(", null, ",", null, ")"); y.push({ i: w - 4, x: un(u, p) }, { i: w - 2, x: un(d, f) }); } else (p !== 1 || f !== 1) && h.push(o(h) + "scale(" + p + "," + f + ")"); } return function(u, d) { var p = [], f = []; return u = e3(u), d = e3(d), i(u.translateX, u.translateY, d.translateX, d.translateY, p, f), s(u.rotate, d.rotate, p, f), a(u.skewX, d.skewX, p, f), l(u.scaleX, u.scaleY, d.scaleX, d.scaleY, p, f), u = d = null, function(h) { for (var y = -1, w = f.length, m; ++y < w; ) p[(m = f[y]).i] = m.x(h); return p.join(""); }; }; } var d1 = rc(u1, "px, ", "px)", "deg)"); var f1 = rc(c1, ", ", ")", ")"); var p1 = 1e-12; function Fa(e3) { return ((e3 = Math.exp(e3)) + 1 / e3) / 2; } function h1(e3) { return ((e3 = Math.exp(e3)) - 1 / e3) / 2; } function g1(e3) { return ((e3 = Math.exp(2 * e3)) - 1) / (e3 + 1); } var Xo = function e2(t, n, r) { function o(i, s) { var a = i[0], l = i[1], u = i[2], d = s[0], p = s[1], f = s[2], h = d - a, y = p - l, w = h * h + y * y, m, b; if (w < p1) b = Math.log(f / u) / t, m = function(V) { return [ a + V * h, l + V * y, u * Math.exp(t * V * b) ]; }; else { var $ = Math.sqrt(w), _ = (f * f - u * u + r * w) / (2 * u * n * $), x = (f * f - u * u - r * w) / (2 * f * n * $), k = Math.log(Math.sqrt(_ * _ + 1) - _), N = Math.log(Math.sqrt(x * x + 1) - x); b = (N - k) / t, m = function(V) { var j = V * b, A = Fa(k), H = u / (n * $) * (A * g1(t * j + k) - h1(k)); return [ a + H * h, l + H * y, u * A / Fa(t * j + k) ]; }; } return m.duration = b * 1e3 * t / Math.SQRT2, m; } return o.rho = function(i) { var s = Math.max(1e-3, +i), a = s * s, l = a * a; return e2(s, a, l); }, o; }(Math.SQRT2, 2, 4); var Or = 0; var Xr = 0; var Yr = 0; var oc = 1e3; var ci; var Gr; var di = 0; var pr = 0; var Oi = 0; var lo = typeof performance == "object" && performance.now ? performance : Date; var ic = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e3) { setTimeout(e3, 17); }; function ta() { return pr || (ic(v1), pr = lo.now() + Oi); } function v1() { pr = 0; } function fi() { this._call = this._time = this._next = null; } fi.prototype = sc.prototype = { constructor: fi, restart: function(e3, t, n) { if (typeof e3 != "function") throw new TypeError("callback is not a function"); n = (n == null ? ta() : +n) + (t == null ? 0 : +t), !this._next && Gr !== this && (Gr ? Gr._next = this : ci = this, Gr = this), this._call = e3, this._time = n, bs(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, bs()); } }; function sc(e3, t, n) { var r = new fi(); return r.restart(e3, t, n), r; } function m1() { ta(), ++Or; for (var e3 = ci, t; e3; ) (t = pr - e3._time) >= 0 && e3._call.call(void 0, t), e3 = e3._next; --Or; } function qa() { pr = (di = lo.now()) + Oi, Or = Xr = 0; try { m1(); } finally { Or = 0, w1(), pr = 0; } } function y1() { var e3 = lo.now(), t = e3 - di; t > oc && (Oi -= t, di = e3); } function w1() { for (var e3, t = ci, n, r = 1 / 0; t; ) t._call ? (r > t._time && (r = t._time), e3 = t, t = t._next) : (n = t._next, t._next = null, t = e3 ? e3._next = n : ci = n); Gr = e3, bs(r); } function bs(e3) { if (!Or) { Xr && (Xr = clearTimeout(Xr)); var t = e3 - pr; t > 24 ? (e3 < 1 / 0 && (Xr = setTimeout(qa, e3 - lo.now() - Oi)), Yr && (Yr = clearInterval(Yr))) : (Yr || (di = lo.now(), Yr = setInterval(y1, oc)), Or = 1, ic(qa)); } } function Xa(e3, t, n) { var r = new fi(); return t = t == null ? 0 : +t, r.restart((o) => { r.stop(), e3(o + t); }, t, n), r; } var b1 = Vi("start", "end", "cancel", "interrupt"); var x1 = []; var ac = 0; var Ga = 1; var xs = 2; var Go = 3; var Ua = 4; var Cs = 5; var Uo = 6; function zi(e3, t, n, r, o, i) { var s = e3.__transition; if (!s) e3.__transition = {}; else if (n in s) return; C1(e3, n, { name: t, index: r, // For context during callback. group: o, // For context during callback. on: b1, tween: x1, time: i.time, delay: i.delay, duration: i.duration, ease: i.ease, timer: null, state: ac }); } function na(e3, t) { var n = nn(e3, t); if (n.state > ac) throw new Error("too late; already scheduled"); return n; } function mn(e3, t) { var n = nn(e3, t); if (n.state > Go) throw new Error("too late; already running"); return n; } function nn(e3, t) { var n = e3.__transition; if (!n || !(n = n[t])) throw new Error("transition not found"); return n; } function C1(e3, t, n) { var r = e3.__transition, o; r[t] = n, n.timer = sc(i, 0, n.time); function i(u) { n.state = Ga, n.timer.restart(s, n.delay, n.time), n.delay <= u && s(u - n.delay); } function s(u) { var d, p, f, h; if (n.state !== Ga) return l(); for (d in r) if (h = r[d], h.name === n.name) { if (h.state === Go) return Xa(s); h.state === Ua ? (h.state = Uo, h.timer.stop(), h.on.call("interrupt", e3, e3.__data__, h.index, h.group), delete r[d]) : +d < t && (h.state = Uo, h.timer.stop(), h.on.call("cancel", e3, e3.__data__, h.index, h.group), delete r[d]); } if (Xa(function() { n.state === Go && (n.state = Ua, n.timer.restart(a, n.delay, n.time), a(u)); }), n.state = xs, n.on.call("start", e3, e3.__data__, n.index, n.group), n.state === xs) { for (n.state = Go, o = new Array(f = n.tween.length), d = 0, p = -1; d < f; ++d) (h = n.tween[d].value.call(e3, e3.__data__, n.index, n.group)) && (o[++p] = h); o.length = p + 1; } } function a(u) { for (var d = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Cs, 1), p = -1, f = o.length; ++p < f; ) o[p].call(e3, d); n.state === Cs && (n.on.call("end", e3, e3.__data__, n.index, n.group), l()); } function l() { n.state = Uo, n.timer.stop(), delete r[t]; for (var u in r) return; delete e3.__transition; } } function Qo(e3, t) { var n = e3.__transition, r, o, i = true, s; if (n) { t = t == null ? null : t + ""; for (s in n) { if ((r = n[s]).name !== t) { i = false; continue; } o = r.state > xs && r.state < Cs, r.state = Uo, r.timer.stop(), r.on.call(o ? "interrupt" : "cancel", e3, e3.__data__, r.index, r.group), delete n[s]; } i && delete e3.__transition; } } function $1(e3) { return this.each(function() { Qo(this, e3); }); } function _1(e3, t) { var n, r; return function() { var o = mn(this, e3), i = o.tween; if (i !== n) { r = n = i; for (var s = 0, a = r.length; s < a; ++s) if (r[s].name === t) { r = r.slice(), r.splice(s, 1); break; } } o.tween = r; }; } function k1(e3, t, n) { var r, o; if (typeof n != "function") throw new Error(); return function() { var i = mn(this, e3), s = i.tween; if (s !== r) { o = (r = s).slice(); for (var a = { name: t, value: n }, l = 0, u = o.length; l < u; ++l) if (o[l].name === t) { o[l] = a; break; } l === u && o.push(a); } i.tween = o; }; } function S1(e3, t) { var n = this._id; if (e3 += "", arguments.length < 2) { for (var r = nn(this.node(), n).tween, o = 0, i = r.length, s; o < i; ++o) if ((s = r[o]).name === e3) return s.value; return null; } return this.each((t == null ? _1 : k1)(n, e3, t)); } function ra(e3, t, n) { var r = e3._id; return e3.each(function() { var o = mn(this, r); (o.value || (o.value = {}))[t] = n.apply(this, arguments); }), function(o) { return nn(o, r).value[t]; }; } function lc(e3, t) { var n; return (typeof t == "number" ? un : t instanceof fr ? ui : (n = fr(t)) ? (t = n, ui) : ec)(e3, t); } function E1(e3) { return function() { this.removeAttribute(e3); }; } function P1(e3) { return function() { this.removeAttributeNS(e3.space, e3.local); }; } function N1(e3, t, n) { var r, o = n + "", i; return function() { var s = this.getAttribute(e3); return s === o ? null : s === r ? i : i = t(r = s, n); }; } function M1(e3, t, n) { var r, o = n + "", i; return function() { var s = this.getAttributeNS(e3.space, e3.local); return s === o ? null : s === r ? i : i = t(r = s, n); }; } function T1(e3, t, n) { var r, o, i; return function() { var s, a = n(this), l; return a == null ? void this.removeAttribute(e3) : (s = this.getAttribute(e3), l = a + "", s === l ? null : s === r && l === o ? i : (o = l, i = t(r = s, a))); }; } function L1(e3, t, n) { var r, o, i; return function() { var s, a = n(this), l; return a == null ? void this.removeAttributeNS(e3.space, e3.local) : (s = this.getAttributeNS(e3.space, e3.local), l = a + "", s === l ? null : s === r && l === o ? i : (o = l, i = t(r = s, a))); }; } function V1(e3, t) { var n = Di(e3), r = n === "transform" ? f1 : lc; return this.attrTween(e3, typeof t == "function" ? (n.local ? L1 : T1)(n, r, ra(this, "attr." + e3, t)) : t == null ? (n.local ? P1 : E1)(n) : (n.local ? M1 : N1)(n, r, t)); } function D1(e3, t) { return function(n) { this.setAttribute(e3, t.call(this, n)); }; } function O1(e3, t) { return function(n) { this.setAttributeNS(e3.space, e3.local, t.call(this, n)); }; } function z1(e3, t) { var n, r; function o() { var i = t.apply(this, arguments); return i !== r && (n = (r = i) && O1(e3, i)), n; } return o._value = t, o; } function A1(e3, t) { var n, r; function o() { var i = t.apply(this, arguments); return i !== r && (n = (r = i) && D1(e3, i)), n; } return o._value = t, o; } function H1(e3, t) { var n = "attr." + e3; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (t == null) return this.tween(n, null); if (typeof t != "function") throw new Error(); var r = Di(e3); return this.tween(n, (r.local ? z1 : A1)(r, t)); } function I1(e3, t) { return function() { na(this, e3).delay = +t.apply(this, arguments); }; } function Z1(e3, t) { return t = +t, function() { na(this, e3).delay = t; }; } function j1(e3) { var t = this._id; return arguments.length ? this.each((typeof e3 == "function" ? I1 : Z1)(t, e3)) : nn(this.node(), t).delay; } function K1(e3, t) { return function() { mn(this, e3).duration = +t.apply(this, arguments); }; } function R1(e3, t) { return t = +t, function() { mn(this, e3).duration = t; }; } function B1(e3) { var t = this._id; return arguments.length ? this.each((typeof e3 == "function" ? K1 : R1)(t, e3)) : nn(this.node(), t).duration; } function W1(e3, t) { if (typeof t != "function") throw new Error(); return function() { mn(this, e3).ease = t; }; } function Y1(e3) { var t = this._id; return arguments.length ? this.each(W1(t, e3)) : nn(this.node(), t).ease; } function F1(e3, t) { return function() { var n = t.apply(this, arguments); if (typeof n != "function") throw new Error(); mn(this, e3).ease = n; }; } function q1(e3) { if (typeof e3 != "function") throw new Error(); return this.each(F1(this._id, e3)); } function X1(e3) { typeof e3 != "function" && (e3 = Iu(e3)); for (var t = this._groups, n = t.length, r = new Array(n), o = 0; o < n; ++o) for (var i = t[o], s = i.length, a = r[o] = [], l, u = 0; u < s; ++u) (l = i[u]) && e3.call(l, l.__data__, u, i) && a.push(l); return new Tn(r, this._parents, this._name, this._id); } function G1(e3) { if (e3._id !== this._id) throw new Error(); for (var t = this._groups, n = e3._groups, r = t.length, o = n.length, i = Math.min(r, o), s = new Array(r), a = 0; a < i; ++a) for (var l = t[a], u = n[a], d = l.length, p = s[a] = new Array(d), f, h = 0; h < d; ++h) (f = l[h] || u[h]) && (p[h] = f); for (; a < r; ++a) s[a] = t[a]; return new Tn(s, this._parents, this._name, this._id); } function U1(e3) { return (e3 + "").trim().split(/^|\s+/).every(function(t) { var n = t.indexOf("."); return n >= 0 && (t = t.slice(0, n)), !t || t === "start"; }); } function Q1(e3, t, n) { var r, o, i = U1(t) ? na : mn; return function() { var s = i(this, e3), a = s.on; a !== r && (o = (r = a).copy()).on(t, n), s.on = o; }; } function J1(e3, t) { var n = this._id; return arguments.length < 2 ? nn(this.node(), n).on.on(e3) : this.each(Q1(n, e3, t)); } function ev(e3) { return function() { var t = this.parentNode; for (var n in this.__transition) if (+n !== e3) return; t && t.removeChild(this); }; } function tv() { return this.on("end.remove", ev(this._id)); } function nv(e3) { var t = this._name, n = this._id; typeof e3 != "function" && (e3 = Us(e3)); for (var r = this._groups, o = r.length, i = new Array(o), s = 0; s < o; ++s) for (var a = r[s], l = a.length, u = i[s] = new Array(l), d, p, f = 0; f < l; ++f) (d = a[f]) && (p = e3.call(d, d.__data__, f, a)) && ("__data__" in d && (p.__data__ = d.__data__), u[f] = p, zi(u[f], t, n, f, u, nn(d, n))); return new Tn(i, this._parents, t, n); } function rv(e3) { var t = this._name, n = this._id; typeof e3 != "function" && (e3 = Hu(e3)); for (var r = this._groups, o = r.length, i = [], s = [], a = 0; a < o; ++a) for (var l = r[a], u = l.length, d, p = 0; p < u; ++p) if (d = l[p]) { for (var f = e3.call(d, d.__data__, p, l), h, y = nn(d, n), w = 0, m = f.length; w < m; ++w) (h = f[w]) && zi(h, t, n, w, f, y); i.push(f), s.push(d); } return new Tn(i, s, t, n); } var ov = _o.prototype.constructor; function iv() { return new ov(this._groups, this._parents); } function sv(e3, t) { var n, r, o; return function() { var i = Dr(this, e3), s = (this.style.removeProperty(e3), Dr(this, e3)); return i === s ? null : i === n && s === r ? o : o = t(n = i, r = s); }; } function uc(e3) { return function() { this.style.removeProperty(e3); }; } function av(e3, t, n) { var r, o = n + "", i; return function() { var s = Dr(this, e3); return s === o ? null : s === r ? i : i = t(r = s, n); }; } function lv(e3, t, n) { var r, o, i; return function() { var s = Dr(this, e3), a = n(this), l = a + ""; return a == null && (l = a = (this.style.removeProperty(e3), Dr(this, e3))), s === l ? null : s === r && l === o ? i : (o = l, i = t(r = s, a)); }; } function uv(e3, t) { var n, r, o, i = "style." + t, s = "end." + i, a; return function() { var l = mn(this, e3), u = l.on, d = l.value[i] == null ? a || (a = uc(t)) : void 0; (u !== n || o !== d) && (r = (n = u).copy()).on(s, o = d), l.on = r; }; } function cv(e3, t, n) { var r = (e3 += "") == "transform" ? d1 : lc; return t == null ? this.styleTween(e3, sv(e3, r)).on("end.style." + e3, uc(e3)) : typeof t == "function" ? this.styleTween(e3, lv(e3, r, ra(this, "style." + e3, t))).each(uv(this._id, e3)) : this.styleTween(e3, av(e3, r, t), n).on("end.style." + e3, null); } function dv(e3, t, n) { return function(r) { this.style.setProperty(e3, t.call(this, r), n); }; } function fv(e3, t, n) { var r, o; function i() { var s = t.apply(this, arguments); return s !== o && (r = (o = s) && dv(e3, s, n)), r; } return i._value = t, i; } function pv(e3, t, n) { var r = "style." + (e3 += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (t == null) return this.tween(r, null); if (typeof t != "function") throw new Error(); return this.tween(r, fv(e3, t, n ?? "")); } function hv(e3) { return function() { this.textContent = e3; }; } function gv(e3) { return function() { var t = e3(this); this.textContent = t ?? ""; }; } function vv(e3) { return this.tween("text", typeof e3 == "function" ? gv(ra(this, "text", e3)) : hv(e3 == null ? "" : e3 + "")); } function mv(e3) { return function(t) { this.textContent = e3.call(this, t); }; } function yv(e3) { var t, n; function r() { var o = e3.apply(this, arguments); return o !== n && (t = (n = o) && mv(o)), t; } return r._value = e3, r; } function wv(e3) { var t = "text"; if (arguments.length < 1) return (t = this.tween(t)) && t._value; if (e3 == null) return this.tween(t, null); if (typeof e3 != "function") throw new Error(); return this.tween(t, yv(e3)); } function bv() { for (var e3 = this._name, t = this._id, n = cc(), r = this._groups, o = r.length, i = 0; i < o; ++i) for (var s = r[i], a = s.length, l, u = 0; u < a; ++u) if (l = s[u]) { var d = nn(l, t); zi(l, e3, n, u, s, { time: d.time + d.delay + d.duration, delay: 0, duration: d.duration, ease: d.ease }); } return new Tn(r, this._parents, e3, n); } function xv() { var e3, t, n = this, r = n._id, o = n.size(); return new Promise(function(i, s) { var a = { value: s }, l = { value: function() { --o === 0 && i(); } }; n.each(function() { var u = mn(this, r), d = u.on; d !== e3 && (t = (e3 = d).copy(), t._.cancel.push(a), t._.interrupt.push(a), t._.end.push(l)), u.on = t; }), o === 0 && i(); }); } var Cv = 0; function Tn(e3, t, n, r) { this._groups = e3, this._parents = t, this._name = n, this._id = r; } function cc() { return ++Cv; } var wn = _o.prototype; Tn.prototype = { constructor: Tn, select: nv, selectAll: rv, selectChild: wn.selectChild, selectChildren: wn.selectChildren, filter: X1, merge: G1, selection: iv, transition: bv, call: wn.call, nodes: wn.nodes, node: wn.node, size: wn.size, empty: wn.empty, each: wn.each, on: J1, attr: V1, attrTween: H1, style: cv, styleTween: pv, text: vv, textTween: wv, remove: tv, tween: S1, delay: j1, duration: B1, ease: Y1, easeVarying: q1, end: xv, [Symbol.iterator]: wn[Symbol.iterator] }; function $v(e3) { return ((e3 *= 2) <= 1 ? e3 * e3 * e3 : (e3 -= 2) * e3 * e3 + 2) / 2; } var _v = { time: null, // Set on use. delay: 0, duration: 250, ease: $v }; function kv(e3, t) { for (var n; !(n = e3.__transition) || !(n = n[t]); ) if (!(e3 = e3.parentNode)) throw new Error(`transition ${t} not found`); return n; } function Sv(e3) { var t, n; e3 instanceof Tn ? (t = e3._id, e3 = e3._name) : (t = cc(), (n = _v).time = ta(), e3 = e3 == null ? null : e3 + ""); for (var r = this._groups, o = r.length, i = 0; i < o; ++i) for (var s = r[i], a = s.length, l, u = 0; u < a; ++u) (l = s[u]) && zi(l, e3, t, u, s, n || kv(l, t)); return new Tn(r, this._parents, e3, t); } _o.prototype.interrupt = $1; _o.prototype.transition = Sv; var Ro = (e3) => () => e3; function Ev(e3, { sourceEvent: t, target: n, transform: r, dispatch: o }) { Object.defineProperties(this, { type: { value: e3, enumerable: true, configurable: true }, sourceEvent: { value: t, enumerable: true, configurable: true }, target: { value: n, enumerable: true, configurable: true }, transform: { value: r, enumerable: true, configurable: true }, _: { value: o } }); } function $n(e3, t, n) { this.k = e3, this.x = t, this.y = n; } $n.prototype = { constructor: $n, scale: function(e3) { return e3 === 1 ? this : new $n(this.k * e3, this.x, this.y); }, translate: function(e3, t) { return e3 === 0 & t === 0 ? this : new $n(this.k, this.x + this.k * e3, this.y + this.k * t); }, apply: function(e3) { return [e3[0] * this.k + this.x, e3[1] * this.k + this.y]; }, applyX: function(e3) { return e3 * this.k + this.x; }, applyY: function(e3) { return e3 * this.k + this.y; }, invert: function(e3) { return [(e3[0] - this.x) / this.k, (e3[1] - this.y) / this.k]; }, invertX: function(e3) { return (e3 - this.x) / this.k; }, invertY: function(e3) { return (e3 - this.y) / this.k; }, rescaleX: function(e3) { return e3.copy().domain(e3.range().map(this.invertX, this).map(e3.invert, e3)); }, rescaleY: function(e3) { return e3.copy().domain(e3.range().map(this.invertY, this).map(e3.invert, e3)); }, toString: function() { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; var Ai = new $n(1, 0, 0); dc.prototype = $n.prototype; function dc(e3) { for (; !e3.__zoom; ) if (!(e3 = e3.parentNode)) return Ai; return e3.__zoom; } function Ui(e3) { e3.stopImmediatePropagation(); } function Fr(e3) { e3.preventDefault(), e3.stopImmediatePropagation(); } function Pv(e3) { return (!e3.ctrlKey || e3.type === "wheel") && !e3.button; } function Nv() { var e3 = this; return e3 instanceof SVGElement ? (e3 = e3.ownerSVGElement || e3, e3.hasAttribute("viewBox") ? (e3 = e3.viewBox.baseVal, [[e3.x, e3.y], [e3.x + e3.width, e3.y + e3.height]]) : [[0, 0], [e3.width.baseVal.value, e3.height.baseVal.value]]) : [[0, 0], [e3.clientWidth, e3.clientHeight]]; } function Qa() { return this.__zoom || Ai; } function Mv(e3) { return -e3.deltaY * (e3.deltaMode === 1 ? 0.05 : e3.deltaMode ? 1 : 2e-3) * (e3.ctrlKey ? 10 : 1); } function Tv() { return navigator.maxTouchPoints || "ontouchstart" in this; } function Lv(e3, t, n) { var r = e3.invertX(t[0][0]) - n[0][0], o = e3.invertX(t[1][0]) - n[1][0], i = e3.invertY(t[0][1]) - n[0][1], s = e3.invertY(t[1][1]) - n[1][1]; return e3.translate( o > r ? (r + o) / 2 : Math.min(0, r) || Math.max(0, o), s > i ? (i + s) / 2 : Math.min(0, i) || Math.max(0, s) ); } function fc() { var e3 = Pv, t = Nv, n = Lv, r = Mv, o = Tv, i = [0, 1 / 0], s = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], a = 250, l = Xo, u = Vi("start", "zoom", "end"), d, p, f, h = 500, y = 150, w = 0, m = 10; function b(C) { C.property("__zoom", Qa).on("wheel.zoom", j, { passive: false }).on("mousedown.zoom", A).on("dblclick.zoom", H).filter(o).on("touchstart.zoom", z).on("touchmove.zoom", S).on("touchend.zoom touchcancel.zoom", T).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); } b.transform = function(C, P, M, K) { var B = C.selection ? C.selection() : C; B.property("__zoom", Qa), C !== B ? k(C, P, M, K) : B.interrupt().each(function() { N(this, arguments).event(K).start().zoom(null, typeof P == "function" ? P.apply(this, arguments) : P).end(); }); }, b.scaleBy = function(C, P, M, K) { b.scaleTo(C, function() { var B = this.__zoom.k, W = typeof P == "function" ? P.apply(this, arguments) : P; return B * W; }, M, K); }, b.scaleTo = function(C, P, M, K) { b.transform(C, function() { var B = t.apply(this, arguments), W = this.__zoom, D = M == null ? x(B) : typeof M == "function" ? M.apply(this, arguments) : M, X = W.invert(D), q = typeof P == "function" ? P.apply(this, arguments) : P; return n(_($(W, q), D, X), B, s); }, M, K); }, b.translateBy = function(C, P, M, K) { b.transform(C, function() { return n(this.__zoom.translate( typeof P == "function" ? P.apply(this, arguments) : P, typeof M == "function" ? M.apply(this, arguments) : M ), t.apply(this, arguments), s); }, null, K); }, b.translateTo = function(C, P, M, K, B) { b.transform(C, function() { var W = t.apply(this, arguments), D = this.__zoom, X = K == null ? x(W) : typeof K == "function" ? K.apply(this, arguments) : K; return n(Ai.translate(X[0], X[1]).scale(D.k).translate( typeof P == "function" ? -P.apply(this, arguments) : -P, typeof M == "function" ? -M.apply(this, arguments) : -M ), W, s); }, K, B); }; function $(C, P) { return P = Math.max(i[0], Math.min(i[1], P)), P === C.k ? C : new $n(P, C.x, C.y); } function _(C, P, M) { var K = P[0] - M[0] * C.k, B = P[1] - M[1] * C.k; return K === C.x && B === C.y ? C : new $n(C.k, K, B); } function x(C) { return [(+C[0][0] + +C[1][0]) / 2, (+C[0][1] + +C[1][1]) / 2]; } function k(C, P, M, K) { C.on("start.zoom", function() { N(this, arguments).event(K).start(); }).on("interrupt.zoom end.zoom", function() { N(this, arguments).event(K).end(); }).tween("zoom", function() { var B = this, W = arguments, D = N(B, W).event(K), X = t.apply(B, W), q = M == null ? x(X) : typeof M == "function" ? M.apply(B, W) : M, U = Math.max(X[1][0] - X[0][0], X[1][1] - X[0][1]), I = B.__zoom, F = typeof P == "function" ? P.apply(B, W) : P, G = l(I.invert(q).concat(U / I.k), F.invert(q).concat(U / F.k)); return function(te) { if (te === 1) te = F; else { var ne = G(te), J = U / ne[2]; te = new $n(J, q[0] - ne[0] * J, q[1] - ne[1] * J); } D.zoom(null, te); }; }); } function N(C, P, M) { return !M && C.__zooming || new V(C, P); } function V(C, P) { this.that = C, this.args = P, this.active = 0, this.sourceEvent = null, this.extent = t.apply(C, P), this.taps = 0; } V.prototype = { event: function(C) { return C && (this.sourceEvent = C), this; }, start: function() { return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this; }, zoom: function(C, P) { return this.mouse && C !== "mouse" && (this.mouse[1] = P.invert(this.mouse[0])), this.touch0 && C !== "touch" && (this.touch0[1] = P.invert(this.touch0[0])), this.touch1 && C !== "touch" && (this.touch1[1] = P.invert(this.touch1[0])), this.that.__zoom = P, this.emit("zoom"), this; }, end: function() { return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this; }, emit: function(C) { var P = Kt(this.that).datum(); u.call( C, this.that, new Ev(C, { sourceEvent: this.sourceEvent, target: b, transform: this.that.__zoom, dispatch: u }), P ); } }; function j(C, ...P) { if (!e3.apply(this, arguments)) return; var M = N(this, P).event(C), K = this.__zoom, B = Math.max(i[0], Math.min(i[1], K.k * Math.pow(2, r.apply(this, arguments)))), W = qt(C); if (M.wheel) (M.mouse[0][0] !== W[0] || M.mouse[0][1] !== W[1]) && (M.mouse[1] = K.invert(M.mouse[0] = W)), clearTimeout(M.wheel); else { if (K.k === B) return; M.mouse = [W, K.invert(W)], Qo(this), M.start(); } Fr(C), M.wheel = setTimeout(D, y), M.zoom("mouse", n(_($(K, B), M.mouse[0], M.mouse[1]), M.extent, s)); function D() { M.wheel = null, M.end(); } } function A(C, ...P) { if (f || !e3.apply(this, arguments)) return; var M = C.currentTarget, K = N(this, P, true).event(C), B = Kt(C.view).on("mousemove.zoom", q, true).on("mouseup.zoom", U, true), W = qt(C, M), D = C.clientX, X = C.clientY; Xu(C.view), Ui(C), K.mouse = [W, this.__zoom.invert(W)], Qo(this), K.start(); function q(I) { if (Fr(I), !K.moved) { var F = I.clientX - D, G = I.clientY - X; K.moved = F * F + G * G > w; } K.event(I).zoom("mouse", n(_(K.that.__zoom, K.mouse[0] = qt(I, M), K.mouse[1]), K.extent, s)); } function U(I) { B.on("mousemove.zoom mouseup.zoom", null), Gu(I.view, K.moved), Fr(I), K.event(I).end(); } } function H(C, ...P) { if (e3.apply(this, arguments)) { var M = this.__zoom, K = qt(C.changedTouches ? C.changedTouches[0] : C, this), B = M.invert(K), W = M.k * (C.shiftKey ? 0.5 : 2), D = n(_($(M, W), K, B), t.apply(this, P), s); Fr(C), a > 0 ? Kt(this).transition().duration(a).call(k, D, K, C) : Kt(this).call(b.transform, D, K, C); } } function z(C, ...P) { if (e3.apply(this, arguments)) { var M = C.touches, K = M.length, B = N(this, P, C.changedTouches.length === K).event(C), W, D, X, q; for (Ui(C), D = 0; D < K; ++D) X = M[D], q = qt(X, this), q = [q, this.__zoom.invert(q), X.identifier], B.touch0 ? !B.touch1 && B.touch0[2] !== q[2] && (B.touch1 = q, B.taps = 0) : (B.touch0 = q, W = true, B.taps = 1 + !!d); d && (d = clearTimeout(d)), W && (B.taps < 2 && (p = q[0], d = setTimeout(function() { d = null; }, h)), Qo(this), B.start()); } } function S(C, ...P) { if (this.__zooming) { var M = N(this, P).event(C), K = C.changedTouches, B = K.length, W, D, X, q; for (Fr(C), W = 0; W < B; ++W) D = K[W], X = qt(D, this), M.touch0 && M.touch0[2] === D.identifier ? M.touch0[0] = X : M.touch1 && M.touch1[2] === D.identifier && (M.touch1[0] = X); if (D = M.that.__zoom, M.touch1) { var U = M.touch0[0], I = M.touch0[1], F = M.touch1[0], G = M.touch1[1], te = (te = F[0] - U[0]) * te + (te = F[1] - U[1]) * te, ne = (ne = G[0] - I[0]) * ne + (ne = G[1] - I[1]) * ne; D = $(D, Math.sqrt(te / ne)), X = [(U[0] + F[0]) / 2, (U[1] + F[1]) / 2], q = [(I[0] + G[0]) / 2, (I[1] + G[1]) / 2]; } else if (M.touch0) X = M.touch0[0], q = M.touch0[1]; else return; M.zoom("touch", n(_(D, X, q), M.extent, s)); } } function T(C, ...P) { if (this.__zooming) { var M = N(this, P).event(C), K = C.changedTouches, B = K.length, W, D; for (Ui(C), f && clearTimeout(f), f = setTimeout(function() { f = null; }, h), W = 0; W < B; ++W) D = K[W], M.touch0 && M.touch0[2] === D.identifier ? delete M.touch0 : M.touch1 && M.touch1[2] === D.identifier && delete M.touch1; if (M.touch1 && !M.touch0 && (M.touch0 = M.touch1, delete M.touch1), M.touch0) M.touch0[1] = this.__zoom.invert(M.touch0[0]); else if (M.end(), M.taps === 2 && (D = qt(D, this), Math.hypot(p[0] - D[0], p[1] - D[1]) < m)) { var X = Kt(this).on("dblclick.zoom"); X && X.apply(this, arguments); } } } return b.wheelDelta = function(C) { return arguments.length ? (r = typeof C == "function" ? C : Ro(+C), b) : r; }, b.filter = function(C) { return arguments.length ? (e3 = typeof C == "function" ? C : Ro(!!C), b) : e3; }, b.touchable = function(C) { return arguments.length ? (o = typeof C == "function" ? C : Ro(!!C), b) : o; }, b.extent = function(C) { return arguments.length ? (t = typeof C == "function" ? C : Ro([[+C[0][0], +C[0][1]], [+C[1][0], +C[1][1]]]), b) : t; }, b.scaleExtent = function(C) { return arguments.length ? (i[0] = +C[0], i[1] = +C[1], b) : [i[0], i[1]]; }, b.translateExtent = function(C) { return arguments.length ? (s[0][0] = +C[0][0], s[1][0] = +C[1][0], s[0][1] = +C[0][1], s[1][1] = +C[1][1], b) : [[s[0][0], s[0][1]], [s[1][0], s[1][1]]]; }, b.constrain = function(C) { return arguments.length ? (n = C, b) : n; }, b.duration = function(C) { return arguments.length ? (a = +C, b) : a; }, b.interpolate = function(C) { return arguments.length ? (l = C, b) : l; }, b.on = function() { var C = u.on.apply(u, arguments); return C === u ? b : C; }, b.clickDistance = function(C) { return arguments.length ? (w = (C = +C) * C, b) : Math.sqrt(w); }, b.tapDistance = function(C) { return arguments.length ? (m = +C, b) : m; }, b; } var uo = { 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: (e3) => `Node type "${e3}" not found. Using fallback type "default".`, error004: () => "The React Flow parent container needs a width and a height to render the graph.", error005: () => "Only child nodes can use a parent extent.", error006: () => "Can't create edge. An edge needs a source and a target.", error007: (e3) => `The old edge with id=${e3} does not exist.`, error009: (e3) => `Marker type "${e3}" doesn't exist.`, error008: (e3, { id: t, sourceHandle: n, targetHandle: r }) => `Couldn't create edge for ${e3} handle id: "${e3 === "source" ? n : r}", edge id: ${t}.`, error010: () => "Handle: No node id found. Make sure to only use a Handle inside a custom Node.", error011: (e3) => `Edge type "${e3}" not found. Using fallback type "default".`, error012: (e3) => `Node with id "${e3}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`, error013: (e3 = "react") => `It seems that you haven't loaded the styles. Please import '@xyflow/${e3}/dist/style.css' or base.css to make sure everything is working properly.`, error014: () => "useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.", error015: () => "It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs." }; var $s = [ [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY] ]; var pc = ["Enter", " ", "Escape"]; var Vv = { "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: e3, x: t, y: n }) => `Moved selected node ${e3}. New position, x: ${t}, y: ${n}`, "edge.a11yDescription.default": "Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.", // Control elements "controls.ariaLabel": "Control Panel", "controls.zoomIn.ariaLabel": "Zoom In", "controls.zoomOut.ariaLabel": "Zoom Out", "controls.fitView.ariaLabel": "Fit View", "controls.interactive.ariaLabel": "Toggle Interactivity", // Mini map "minimap.ariaLabel": "Mini Map", // Handle "handle.ariaLabel": "Handle" }; var zr; (function(e3) { e3.Strict = "strict", e3.Loose = "loose"; })(zr || (zr = {})); var ur; (function(e3) { e3.Free = "free", e3.Vertical = "vertical", e3.Horizontal = "horizontal"; })(ur || (ur = {})); var pi; (function(e3) { e3.Partial = "partial", e3.Full = "full"; })(pi || (pi = {})); var _s = { inProgress: false, isValid: null, from: null, fromHandle: null, fromPosition: null, fromNode: null, to: null, toHandle: null, toPosition: null, toNode: null, pointer: null }; var xn; (function(e3) { e3.Bezier = "default", e3.Straight = "straight", e3.Step = "step", e3.SmoothStep = "smoothstep", e3.SimpleBezier = "simplebezier"; })(xn || (xn = {})); var co; (function(e3) { e3.Arrow = "arrow", e3.ArrowClosed = "arrowclosed"; })(co || (co = {})); var me; (function(e3) { e3.Left = "left", e3.Top = "top", e3.Right = "right", e3.Bottom = "bottom"; })(me || (me = {})); var Ja = { [me.Left]: me.Right, [me.Right]: me.Left, [me.Top]: me.Bottom, [me.Bottom]: me.Top }; function Dv(e3, t) { if (!e3 && !t) return true; if (!e3 || !t || e3.size !== t.size) return false; if (!e3.size && !t.size) return true; for (const n of e3.keys()) if (!t.has(n)) return false; return true; } function el(e3, t, n) { if (!n) return; const r = []; e3.forEach((o, i) => { t?.has(i) || r.push(o); }), r.length && n(r); } function Ov(e3) { return e3 === null ? null : e3 ? "valid" : "invalid"; } var hc = (e3) => "id" in e3 && "source" in e3 && "target" in e3; var zv = (e3) => "id" in e3 && "position" in e3 && !("source" in e3) && !("target" in e3); var oa = (e3) => "id" in e3 && "internals" in e3 && !("source" in e3) && !("target" in e3); var So = (e3, t = [0, 0]) => { const { width: n, height: r } = tr(e3), o = e3.origin ?? t, i = n * o[0], s = r * o[1]; return { x: e3.position.x - i, y: e3.position.y - s }; }; var Av = (e3, t = { nodeOrigin: [0, 0] }) => { if (e3.length === 0) return { x: 0, y: 0, width: 0, height: 0 }; const n = e3.reduce((r, o) => { const i = typeof o == "string"; let s = !t.nodeLookup && !i ? o : void 0; t.nodeLookup && (s = i ? t.nodeLookup.get(o) : oa(o) ? o : t.nodeLookup.get(o.id)); const a = s ? hi(s, t.nodeOrigin) : { x: 0, y: 0, x2: 0, y2: 0 }; return Hi(r, a); }, { x: 1 / 0, y: 1 / 0, x2: -1 / 0, y2: -1 / 0 }); return Ii(n); }; var Eo = (e3, t = {}) => { let n = { x: 1 / 0, y: 1 / 0, x2: -1 / 0, y2: -1 / 0 }, r = false; return e3.forEach((o) => { (t.filter === void 0 || t.filter(o)) && (n = Hi(n, hi(o)), r = true); }), r ? Ii(n) : { x: 0, y: 0, width: 0, height: 0 }; }; var ia = (e3, t, [n, r, o] = [0, 0, 1], i = false, s = false) => { const a = { ...No(t, [n, r, o]), width: t.width / o, height: t.height / o }, l = []; for (const u of e3.values()) { const { measured: d, selectable: p = true, hidden: f = false } = u; if (s && !p || f) continue; const h = d.width ?? u.width ?? u.initialWidth ?? null, y = d.height ?? u.height ?? u.initialHeight ?? null, w = fo(a, Hr(u)), m = (h ?? 0) * (y ?? 0), b = i && w > 0; (!u.internals.handleBounds || b || w >= m || u.dragging) && l.push(u); } return l; }; var Hv = (e3, t) => { const n = /* @__PURE__ */ new Set(); return e3.forEach((r) => { n.add(r.id); }), t.filter((r) => n.has(r.source) || n.has(r.target)); }; function Iv(e3, t) { const n = /* @__PURE__ */ new Map(), r = t?.nodes ? new Set(t.nodes.map((o) => o.id)) : null; return e3.forEach((o) => { o.measured.width && o.measured.height && (t?.includeHiddenNodes || !o.hidden) && (!r || r.has(o.id)) && n.set(o.id, o); }), n; } async function Zv({ nodes: e3, width: t, height: n, panZoom: r, minZoom: o, maxZoom: i }, s) { if (e3.size === 0) return Promise.resolve(true); const a = Iv(e3, s), l = Eo(a), u = sa(l, t, n, s?.minZoom ?? o, s?.maxZoom ?? i, s?.padding ?? 0.1); return await r.setViewport(u, { duration: s?.duration, ease: s?.ease, interpolate: s?.interpolate }), Promise.resolve(true); } function gc({ nodeId: e3, nextPosition: t, nodeLookup: n, nodeOrigin: r = [0, 0], nodeExtent: o, onError: i }) { const s = n.get(e3), a = s.parentId ? n.get(s.parentId) : void 0, { x: l, y: u } = a ? a.internals.positionAbsolute : { x: 0, y: 0 }, d = s.origin ?? r; let p = s.extent || o; if (s.extent === "parent" && !s.expandParent) if (!a) i?.("005", uo.error005()); else { const h = a.measured.width, y = a.measured.height; h && y && (p = [ [l, u], [l + h, u + y] ]); } else a && Ir(s.extent) && (p = [ [s.extent[0][0] + l, s.extent[0][1] + u], [s.extent[1][0] + l, s.extent[1][1] + u] ]); const f = Ir(p) ? hr(t, p, s.measured) : t; return (s.measured.width === void 0 || s.measured.height === void 0) && i?.("015", uo.error015()), { position: { x: f.x - l + (s.measured.width ?? 0) * d[0], y: f.y - u + (s.measured.height ?? 0) * d[1] }, positionAbsolute: f }; } async function jv({ nodesToRemove: e3 = [], edgesToRemove: t = [], nodes: n, edges: r, onBeforeDelete: o }) { const i = new Set(e3.map((p) => p.id)), s = []; for (const p of n) { if (p.deletable === false) continue; const f = i.has(p.id), h = !f && p.parentId && s.find((y) => y.id === p.parentId); (f || h) && s.push(p); } const a = new Set(t.map((p) => p.id)), l = r.filter((p) => p.deletable !== false), u = Hv(s, l); for (const p of l) a.has(p.id) && !u.find((f) => f.id === p.id) && u.push(p); if (!o) return { edges: u, nodes: s }; const d = await o({ nodes: s, edges: u }); return typeof d == "boolean" ? d ? { edges: u, nodes: s } : { edges: [], nodes: [] } : d; } var Ar = (e3, t = 0, n = 1) => Math.min(Math.max(e3, t), n); var hr = (e3 = { x: 0, y: 0 }, t, n) => ({ x: Ar(e3.x, t[0][0], t[1][0] - (n?.width ?? 0)), y: Ar(e3.y, t[0][1], t[1][1] - (n?.height ?? 0)) }); function vc(e3, t, n) { const { width: r, height: o } = tr(n), { x: i, y: s } = n.internals.positionAbsolute; return hr(e3, [ [i, s], [i + r, s + o] ], t); } var tl = (e3, t, n) => e3 < t ? Ar(Math.abs(e3 - t), 1, t) / t : e3 > n ? -Ar(Math.abs(e3 - n), 1, t) / t : 0; var mc = (e3, t, n = 15, r = 40) => { const o = tl(e3.x, r, t.width - r) * n, i = tl(e3.y, r, t.height - r) * n; return [o, i]; }; var Hi = (e3, t) => ({ x: Math.min(e3.x, t.x), y: Math.min(e3.y, t.y), x2: Math.max(e3.x2, t.x2), y2: Math.max(e3.y2, t.y2) }); var ks = ({ x: e3, y: t, width: n, height: r }) => ({ x: e3, y: t, x2: e3 + n, y2: t + r }); var Ii = ({ x: e3, y: t, x2: n, y2: r }) => ({ x: e3, y: t, width: n - e3, height: r - t }); var Hr = (e3, t = [0, 0]) => { const { x: n, y: r } = oa(e3) ? e3.internals.positionAbsolute : So(e3, t); return { x: n, y: r, width: e3.measured?.width ?? e3.width ?? e3.initialWidth ?? 0, height: e3.measured?.height ?? e3.height ?? e3.initialHeight ?? 0 }; }; var hi = (e3, t = [0, 0]) => { const { x: n, y: r } = oa(e3) ? e3.internals.positionAbsolute : So(e3, t); return { x: n, y: r, x2: n + (e3.measured?.width ?? e3.width ?? e3.initialWidth ?? 0), y2: r + (e3.measured?.height ?? e3.height ?? e3.initialHeight ?? 0) }; }; var yc = (e3, t) => Ii(Hi(ks(e3), ks(t))); var fo = (e3, t) => { const n = Math.max(0, Math.min(e3.x + e3.width, t.x + t.width) - Math.max(e3.x, t.x)), r = Math.max(0, Math.min(e3.y + e3.height, t.y + t.height) - Math.max(e3.y, t.y)); return Math.ceil(n * r); }; var nl = (e3) => _n(e3.width) && _n(e3.height) && _n(e3.x) && _n(e3.y); var _n = (e3) => !isNaN(e3) && isFinite(e3); var Kv = (e3, t) => { }; var Po = (e3, t = [1, 1]) => ({ x: t[0] * Math.round(e3.x / t[0]), y: t[1] * Math.round(e3.y / t[1]) }); var No = ({ x: e3, y: t }, [n, r, o], i = false, s = [1, 1]) => { const a = { x: (e3 - n) / o, y: (t - r) / o }; return i ? Po(a, s) : a; }; var gi = ({ x: e3, y: t }, [n, r, o]) => ({ x: e3 * o + n, y: t * o + r }); function xr(e3, t) { if (typeof e3 == "number") return Math.floor((t - t / (1 + e3)) * 0.5); if (typeof e3 == "string" && e3.endsWith("px")) { const n = parseFloat(e3); if (!Number.isNaN(n)) return Math.floor(n); } if (typeof e3 == "string" && e3.endsWith("%")) { const n = parseFloat(e3); if (!Number.isNaN(n)) return Math.floor(t * n * 0.01); } return console.error(`[React Flow] The padding value "${e3}" is invalid. Please provide a number or a string with a valid unit (px or %).`), 0; } function Rv(e3, t, n) { if (typeof e3 == "string" || typeof e3 == "number") { const r = xr(e3, n), o = xr(e3, t); return { top: r, right: o, bottom: r, left: o, x: o * 2, y: r * 2 }; } if (typeof e3 == "object") { const r = xr(e3.top ?? e3.y ?? 0, n), o = xr(e3.bottom ?? e3.y ?? 0, n), i = xr(e3.left ?? e3.x ?? 0, t), s = xr(e3.right ?? e3.x ?? 0, t); return { top: r, right: s, bottom: o, left: i, x: i + s, y: r + o }; } return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 }; } function Bv(e3, t, n, r, o, i) { const { x: s, y: a } = gi(e3, [t, n, r]), { x: l, y: u } = gi({ x: e3.x + e3.width, y: e3.y + e3.height }, [t, n, r]), d = o - l, p = i - u; return { left: Math.floor(s), top: Math.floor(a), right: Math.floor(d), bottom: Math.floor(p) }; } var sa = (e3, t, n, r, o, i) => { const s = Rv(i, t, n), a = (t - s.x) / e3.width, l = (n - s.y) / e3.height, u = Math.min(a, l), d = Ar(u, r, o), p = e3.x + e3.width / 2, f = e3.y + e3.height / 2, h = t / 2 - p * d, y = n / 2 - f * d, w = Bv(e3, h, y, d, t, n), m = { left: Math.min(w.left - s.left, 0), top: Math.min(w.top - s.top, 0), right: Math.min(w.right - s.right, 0), bottom: Math.min(w.bottom - s.bottom, 0) }; return { x: h - m.left + m.right, y: y - m.top + m.bottom, zoom: d }; }; var sr = () => typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0; function Ir(e3) { return e3 != null && e3 !== "parent"; } function tr(e3) { return { width: e3.measured?.width ?? e3.width ?? e3.initialWidth ?? 0, height: e3.measured?.height ?? e3.height ?? e3.initialHeight ?? 0 }; } function wc(e3) { return (e3.measured?.width ?? e3.width ?? e3.initialWidth) !== void 0 && (e3.measured?.height ?? e3.height ?? e3.initialHeight) !== void 0; } function Wv(e3, t = { width: 0, height: 0 }, n, r, o) { const i = { ...e3 }, s = r.get(n); if (s) { const a = s.origin || o; i.x += s.internals.positionAbsolute.x - (t.width ?? 0) * a[0], i.y += s.internals.positionAbsolute.y - (t.height ?? 0) * a[1]; } return i; } function Yv(e3) { return { ...Vv, ...e3 || {} }; } function Qi(e3, { snapGrid: t = [0, 0], snapToGrid: n = false, transform: r, containerBounds: o }) { const { x: i, y: s } = Ut(e3), a = No({ x: i - (o?.left ?? 0), y: s - (o?.top ?? 0) }, r), { x: l, y: u } = n ? Po(a, t) : a; return { xSnapped: l, ySnapped: u, ...a }; } var bc = (e3) => ({ width: e3.offsetWidth, height: e3.offsetHeight }); var xc = (e3) => e3?.getRootNode?.() || window?.document; var Fv = ["INPUT", "SELECT", "TEXTAREA"]; function Cc(e3) { const t = e3.composedPath?.()?.[0] || e3.target; return t?.nodeType !== 1 ? false : Fv.includes(t.nodeName) || t.hasAttribute("contenteditable") || !!t.closest(".nokey"); } var $c = (e3) => "clientX" in e3; var Ut = (e3, t) => { const n = $c(e3), r = n ? e3.clientX : e3.touches?.[0].clientX, o = n ? e3.clientY : e3.touches?.[0].clientY; return { x: r - (t?.left ?? 0), y: o - (t?.top ?? 0) }; }; var rl = (e3, t, n, r, o) => { const i = t.querySelectorAll(`.${e3}`); return !i || !i.length ? null : Array.from(i).map((s) => { const a = s.getBoundingClientRect(); return { id: s.getAttribute("data-handleid"), type: e3, nodeId: o, position: s.getAttribute("data-handlepos"), x: (a.left - n.left) / r, y: (a.top - n.top) / r, ...bc(s) }; }); }; function qv({ sourceX: e3, sourceY: t, targetX: n, targetY: r, sourceControlX: o, sourceControlY: i, targetControlX: s, targetControlY: a }) { const l = e3 * 0.125 + o * 0.375 + s * 0.375 + n * 0.125, u = t * 0.125 + i * 0.375 + a * 0.375 + r * 0.125, d = Math.abs(l - e3), p = Math.abs(u - t); return [l, u, d, p]; } function Bo(e3, t) { return e3 >= 0 ? 0.5 * e3 : t * 25 * Math.sqrt(-e3); } function ol({ pos: e3, x1: t, y1: n, x2: r, y2: o, c: i }) { switch (e3) { case me.Left: return [t - Bo(t - r, i), n]; case me.Right: return [t + Bo(r - t, i), n]; case me.Top: return [t, n - Bo(n - o, i)]; case me.Bottom: return [t, n + Bo(o - n, i)]; } } function _c({ sourceX: e3, sourceY: t, sourcePosition: n = me.Bottom, targetX: r, targetY: o, targetPosition: i = me.Top, curvature: s = 0.25 }) { const [a, l] = ol({ pos: n, x1: e3, y1: t, x2: r, y2: o, c: s }), [u, d] = ol({ pos: i, x1: r, y1: o, x2: e3, y2: t, c: s }), [p, f, h, y] = qv({ sourceX: e3, sourceY: t, targetX: r, targetY: o, sourceControlX: a, sourceControlY: l, targetControlX: u, targetControlY: d }); return [ `M${e3},${t} C${a},${l} ${u},${d} ${r},${o}`, p, f, h, y ]; } function kc({ sourceX: e3, sourceY: t, targetX: n, targetY: r }) { const o = Math.abs(n - e3) / 2, i = n < e3 ? n + o : n - o, s = Math.abs(r - t) / 2, a = r < t ? r + s : r - s; return [i, a, o, s]; } function Xv({ sourceNode: e3, targetNode: t, selected: n = false, zIndex: r, elevateOnSelect: o = false }) { if (r !== void 0) return r; const i = o && n ? 1e3 : 0, s = Math.max(e3.parentId || o && e3.selected ? e3.internals.z : 0, t.parentId || o && t.selected ? t.internals.z : 0); return i + s; } function Gv({ sourceNode: e3, targetNode: t, width: n, height: r, transform: o }) { const i = Hi(hi(e3), hi(t)); i.x === i.x2 && (i.x2 += 1), i.y === i.y2 && (i.y2 += 1); const s = { x: -o[0] / o[2], y: -o[1] / o[2], width: n / o[2], height: r / o[2] }; return fo(s, Ii(i)) > 0; } var Uv = ({ source: e3, sourceHandle: t, target: n, targetHandle: r }) => `xy-edge__${e3}${t || ""}-${n}${r || ""}`; var Qv = (e3, t) => t.some((n) => n.source === e3.source && n.target === e3.target && (n.sourceHandle === e3.sourceHandle || !n.sourceHandle && !e3.sourceHandle) && (n.targetHandle === e3.targetHandle || !n.targetHandle && !e3.targetHandle)); var Jv = (e3, t) => { if (!e3.source || !e3.target) return t; let n; return hc(e3) ? n = { ...e3 } : n = { ...e3, id: Uv(e3) }, Qv(n, t) ? t : (n.sourceHandle === null && delete n.sourceHandle, n.targetHandle === null && delete n.targetHandle, t.concat(n)); }; function Sc({ sourceX: e3, sourceY: t, targetX: n, targetY: r }) { const [o, i, s, a] = kc({ sourceX: e3, sourceY: t, targetX: n, targetY: r }); return [`M ${e3},${t}L ${n},${r}`, o, i, s, a]; } var il = { [me.Left]: { x: -1, y: 0 }, [me.Right]: { x: 1, y: 0 }, [me.Top]: { x: 0, y: -1 }, [me.Bottom]: { x: 0, y: 1 } }; var e0 = ({ source: e3, sourcePosition: t = me.Bottom, target: n }) => t === me.Left || t === me.Right ? e3.x < n.x ? { x: 1, y: 0 } : { x: -1, y: 0 } : e3.y < n.y ? { x: 0, y: 1 } : { x: 0, y: -1 }; var sl = (e3, t) => Math.sqrt(Math.pow(t.x - e3.x, 2) + Math.pow(t.y - e3.y, 2)); function t0({ source: e3, sourcePosition: t = me.Bottom, target: n, targetPosition: r = me.Top, center: o, offset: i, stepPosition: s }) { const a = il[t], l = il[r], u = { x: e3.x + a.x * i, y: e3.y + a.y * i }, d = { x: n.x + l.x * i, y: n.y + l.y * i }, p = e0({ source: u, sourcePosition: t, target: d }), f = p.x !== 0 ? "x" : "y", h = p[f]; let y = [], w, m; const b = { x: 0, y: 0 }, $ = { x: 0, y: 0 }, [, , _, x] = kc({ sourceX: e3.x, sourceY: e3.y, targetX: n.x, targetY: n.y }); if (a[f] * l[f] === -1) { f === "x" ? (w = o.x ?? u.x + (d.x - u.x) * s, m = o.y ?? (u.y + d.y) / 2) : (w = o.x ?? (u.x + d.x) / 2, m = o.y ?? u.y + (d.y - u.y) * s); const k = [ { x: w, y: u.y }, { x: w, y: d.y } ], N = [ { x: u.x, y: m }, { x: d.x, y: m } ]; a[f] === h ? y = f === "x" ? k : N : y = f === "x" ? N : k; } else { const k = [{ x: u.x, y: d.y }], N = [{ x: d.x, y: u.y }]; if (f === "x" ? y = a.x === h ? N : k : y = a.y === h ? k : N, t === r) { const z = Math.abs(e3[f] - n[f]); if (z <= i) { const S = Math.min(i - 1, i - z); a[f] === h ? b[f] = (u[f] > e3[f] ? -1 : 1) * S : $[f] = (d[f] > n[f] ? -1 : 1) * S; } } if (t !== r) { const z = f === "x" ? "y" : "x", S = a[f] === l[z], T = u[z] > d[z], C = u[z] < d[z]; (a[f] === 1 && (!S && T || S && C) || a[f] !== 1 && (!S && C || S && T)) && (y = f === "x" ? k : N); } const V = { x: u.x + b.x, y: u.y + b.y }, j = { x: d.x + $.x, y: d.y + $.y }, A = Math.max(Math.abs(V.x - y[0].x), Math.abs(j.x - y[0].x)), H = Math.max(Math.abs(V.y - y[0].y), Math.abs(j.y - y[0].y)); A >= H ? (w = (V.x + j.x) / 2, m = y[0].y) : (w = y[0].x, m = (V.y + j.y) / 2); } return [[ e3, { x: u.x + b.x, y: u.y + b.y }, ...y, { x: d.x + $.x, y: d.y + $.y }, n ], w, m, _, x]; } function n0(e3, t, n, r) { const o = Math.min(sl(e3, t) / 2, sl(t, n) / 2, r), { x: i, y: s } = t; if (e3.x === i && i === n.x || e3.y === s && s === n.y) return `L${i} ${s}`; if (e3.y === s) { const u = e3.x < n.x ? -1 : 1, d = e3.y < n.y ? 1 : -1; return `L ${i + o * u},${s}Q ${i},${s} ${i},${s + o * d}`; } const a = e3.x < n.x ? 1 : -1, l = e3.y < n.y ? -1 : 1; return `L ${i},${s + o * l}Q ${i},${s} ${i + o * a},${s}`; } function aa({ sourceX: e3, sourceY: t, sourcePosition: n = me.Bottom, targetX: r, targetY: o, targetPosition: i = me.Top, borderRadius: s = 5, centerX: a, centerY: l, offset: u = 20, stepPosition: d = 0.5 }) { const [p, f, h, y, w] = t0({ source: { x: e3, y: t }, sourcePosition: n, target: { x: r, y: o }, targetPosition: i, center: { x: a, y: l }, offset: u, stepPosition: d }); return [p.reduce((m, b, $) => { let _ = ""; return $ > 0 && $ < p.length - 1 ? _ = n0(p[$ - 1], b, p[$ + 1], s) : _ = `${$ === 0 ? "M" : "L"}${b.x} ${b.y}`, m += _, m; }, ""), f, h, y, w]; } function al(e3) { return e3 && !!(e3.internals.handleBounds || e3.handles?.length) && !!(e3.measured.width || e3.width || e3.initialWidth); } function r0(e3) { const { sourceNode: t, targetNode: n } = e3; if (!al(t) || !al(n)) return null; const r = t.internals.handleBounds || ll(t.handles), o = n.internals.handleBounds || ll(n.handles), i = ul(r?.source ?? [], e3.sourceHandle), s = ul( // when connection type is loose we can define all handles as sources and connect source -> source e3.connectionMode === zr.Strict ? o?.target ?? [] : (o?.target ?? []).concat(o?.source ?? []), e3.targetHandle ); if (!i || !s) return e3.onError?.("008", uo.error008(i ? "target" : "source", { id: e3.id, sourceHandle: e3.sourceHandle, targetHandle: e3.targetHandle })), null; const a = i?.position || me.Bottom, l = s?.position || me.Top, u = po(t, i, a), d = po(n, s, l); return { sourceX: u.x, sourceY: u.y, targetX: d.x, targetY: d.y, sourcePosition: a, targetPosition: l }; } function ll(e3) { if (!e3) return null; const t = [], n = []; for (const r of e3) r.width = r.width ?? 1, r.height = r.height ?? 1, r.type === "source" ? t.push(r) : r.type === "target" && n.push(r); return { source: t, target: n }; } function po(e3, t, n = me.Left, r = false) { const o = (t?.x ?? 0) + e3.internals.positionAbsolute.x, i = (t?.y ?? 0) + e3.internals.positionAbsolute.y, { width: s, height: a } = t ?? tr(e3); if (r) return { x: o + s / 2, y: i + a / 2 }; switch (t?.position ?? n) { case me.Top: return { x: o + s / 2, y: i }; case me.Right: return { x: o + s, y: i + a / 2 }; case me.Bottom: return { x: o + s / 2, y: i + a }; case me.Left: return { x: o, y: i + a / 2 }; } } function ul(e3, t) { return e3 && (t ? e3.find((n) => n.id === t) : e3[0]) || null; } function Ss(e3, t) { return e3 ? typeof e3 == "string" ? e3 : `${t ? `${t}__` : ""}${Object.keys(e3).sort().map((n) => `${n}=${e3[n]}`).join("&")}` : ""; } function o0(e3, { id: t, defaultColor: n, defaultMarkerStart: r, defaultMarkerEnd: o }) { const i = /* @__PURE__ */ new Set(); return e3.reduce((s, a) => ([a.markerStart || r, a.markerEnd || o].forEach((l) => { if (l && typeof l == "object") { const u = Ss(l, t); i.has(u) || (s.push({ id: u, color: l.color || n, ...l }), i.add(u)); } }), s), []).sort((s, a) => s.id.localeCompare(a.id)); } function i0(e3, t, n, r, o) { let i = 0.5; o === "start" ? i = 0 : o === "end" && (i = 1); let s = [ (e3.x + e3.width * i) * t.zoom + t.x, e3.y * t.zoom + t.y - r ], a = [-100 * i, -100]; switch (n) { case me.Right: s = [ (e3.x + e3.width) * t.zoom + t.x + r, (e3.y + e3.height * i) * t.zoom + t.y ], a = [0, -100 * i]; break; case me.Bottom: s[1] = (e3.y + e3.height) * t.zoom + t.y + r, a[1] = 0; break; case me.Left: s = [ e3.x * t.zoom + t.x - r, (e3.y + e3.height * i) * t.zoom + t.y ], a = [-100, -100 * i]; break; } return `translate(${s[0]}px, ${s[1]}px) translate(${a[0]}%, ${a[1]}%)`; } var Ec = 1e3; var s0 = 10; var la = { nodeOrigin: [0, 0], nodeExtent: $s, elevateNodesOnSelect: true, defaults: {} }; var a0 = { ...la, checkEquality: true }; function ua(e3, t) { const n = { ...e3 }; for (const r in t) t[r] !== void 0 && (n[r] = t[r]); return n; } function l0(e3, t, n) { const r = ua(la, n); for (const o of e3.values()) if (o.parentId) ca(o, e3, t, r); else { const i = So(o, r.nodeOrigin), s = Ir(o.extent) ? o.extent : r.nodeExtent, a = hr(i, s, tr(o)); o.internals.positionAbsolute = a; } } function u0(e3, t) { if (!e3.handles) return e3.measured ? t?.internals.handleBounds : void 0; const n = [], r = []; for (const o of e3.handles) { const i = { id: o.id, width: o.width ?? 1, height: o.height ?? 1, nodeId: e3.id, x: o.x, y: o.y, position: o.position, type: o.type }; o.type === "source" ? n.push(i) : o.type === "target" && r.push(i); } return { source: n, target: r }; } function c0(e3, t, n, r) { const o = ua(a0, r); let i = { i: -1 }, s = e3.length > 0; const a = new Map(t), l = o?.elevateNodesOnSelect ? Ec : 0; t.clear(), n.clear(); for (const u of e3) { let d = a.get(u.id); if (o.checkEquality && u === d?.internals.userNode) t.set(u.id, d); else { const p = So(u, o.nodeOrigin), f = Ir(u.extent) ? u.extent : o.nodeExtent, h = hr(p, f, tr(u)); d = { ...o.defaults, ...u, measured: { width: u.measured?.width, height: u.measured?.height }, internals: { positionAbsolute: h, // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured handleBounds: u0(u, d), z: Pc(u, l), userNode: u } }, t.set(u.id, d); } (d.measured === void 0 || d.measured.width === void 0 || d.measured.height === void 0) && !d.hidden && (s = false), u.parentId && ca(d, t, n, r, i); } return s; } function d0(e3, t) { if (!e3.parentId) return; const n = t.get(e3.parentId); n ? n.set(e3.id, e3) : t.set(e3.parentId, /* @__PURE__ */ new Map([[e3.id, e3]])); } function ca(e3, t, n, r, o) { const { elevateNodesOnSelect: i, nodeOrigin: s, nodeExtent: a } = ua(la, r), l = e3.parentId, u = t.get(l); if (!u) { console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`); return; } d0(e3, n), o && !u.parentId && u.internals.rootParentIndex === void 0 && (u.internals.rootParentIndex = ++o.i, u.internals.z = u.internals.z + o.i * s0), o && u.internals.rootParentIndex !== void 0 && (o.i = u.internals.rootParentIndex); const d = i ? Ec : 0, { x: p, y: f, z: h } = f0(e3, u, s, a, d), { positionAbsolute: y } = e3.internals, w = p !== y.x || f !== y.y; (w || h !== e3.internals.z) && t.set(e3.id, { ...e3, internals: { ...e3.internals, positionAbsolute: w ? { x: p, y: f } : y, z: h } }); } function Pc(e3, t) { return (_n(e3.zIndex) ? e3.zIndex : 0) + (e3.selected ? t : 0); } function f0(e3, t, n, r, o) { const { x: i, y: s } = t.internals.positionAbsolute, a = tr(e3), l = So(e3, n), u = Ir(e3.extent) ? hr(l, e3.extent, a) : l; let d = hr({ x: i + u.x, y: s + u.y }, r, a); e3.extent === "parent" && (d = vc(d, a, t)); const p = Pc(e3, o), f = t.internals.z ?? 0; return { x: d.x, y: d.y, z: f >= p ? f + 1 : p }; } function p0(e3, t, n, r = [0, 0]) { const o = [], i = /* @__PURE__ */ new Map(); for (const s of e3) { const a = t.get(s.parentId); if (!a) continue; const l = i.get(s.parentId)?.expandedRect ?? Hr(a), u = yc(l, s.rect); i.set(s.parentId, { expandedRect: u, parent: a }); } return i.size > 0 && i.forEach(({ expandedRect: s, parent: a }, l) => { const u = a.internals.positionAbsolute, d = tr(a), p = a.origin ?? r, f = s.x < u.x ? Math.round(Math.abs(u.x - s.x)) : 0, h = s.y < u.y ? Math.round(Math.abs(u.y - s.y)) : 0, y = Math.max(d.width, Math.round(s.width)), w = Math.max(d.height, Math.round(s.height)), m = (y - d.width) * p[0], b = (w - d.height) * p[1]; (f > 0 || h > 0 || m || b) && (o.push({ id: l, type: "position", position: { x: a.position.x - f + m, y: a.position.y - h + b } }), n.get(l)?.forEach(($) => { e3.some((_) => _.id === $.id) || o.push({ id: $.id, type: "position", position: { x: $.position.x + f, y: $.position.y + h } }); })), (d.width < s.width || d.height < s.height || f || h) && o.push({ id: l, type: "dimensions", setAttributes: true, dimensions: { width: y + (f ? p[0] * f - m : 0), height: w + (h ? p[1] * h - b : 0) } }); }), o; } function h0(e3, t, n, r, o, i) { const s = r?.querySelector(".xyflow__viewport"); let a = false; if (!s) return { changes: [], updatedInternals: a }; const l = [], u = window.getComputedStyle(s), { m22: d } = new window.DOMMatrixReadOnly(u.transform), p = []; for (const f of e3.values()) { const h = t.get(f.id); if (!h) continue; if (h.hidden) { t.set(h.id, { ...h, internals: { ...h.internals, handleBounds: void 0 } }), a = true; continue; } const y = bc(f.nodeElement), w = h.measured.width !== y.width || h.measured.height !== y.height; if (y.width && y.height && (w || !h.internals.handleBounds || f.force)) { const m = f.nodeElement.getBoundingClientRect(), b = Ir(h.extent) ? h.extent : i; let { positionAbsolute: $ } = h.internals; h.parentId && h.extent === "parent" ? $ = vc($, y, t.get(h.parentId)) : b && ($ = hr($, b, y)); const _ = { ...h, measured: y, internals: { ...h.internals, positionAbsolute: $, handleBounds: { source: rl("source", f.nodeElement, m, d, h.id), target: rl("target", f.nodeElement, m, d, h.id) } } }; t.set(h.id, _), h.parentId && ca(_, t, n, { nodeOrigin: o }), a = true, w && (l.push({ id: h.id, type: "dimensions", dimensions: y }), h.expandParent && h.parentId && p.push({ id: h.id, parentId: h.parentId, rect: Hr(_, o) })); } } if (p.length > 0) { const f = p0(p, t, n, o); l.push(...f); } return { changes: l, updatedInternals: a }; } async function g0({ delta: e3, panZoom: t, transform: n, translateExtent: r, width: o, height: i }) { if (!t || !e3.x && !e3.y) return Promise.resolve(false); const s = await t.setViewportConstrained({ x: n[0] + e3.x, y: n[1] + e3.y, zoom: n[2] }, [ [0, 0], [o, i] ], r), a = !!s && (s.x !== n[0] || s.y !== n[1] || s.k !== n[2]); return Promise.resolve(a); } function cl(e3, t, n, r, o, i) { let s = o; const a = r.get(s) || /* @__PURE__ */ new Map(); r.set(s, a.set(n, t)), s = `${o}-${e3}`; const l = r.get(s) || /* @__PURE__ */ new Map(); if (r.set(s, l.set(n, t)), i) { s = `${o}-${e3}-${i}`; const u = r.get(s) || /* @__PURE__ */ new Map(); r.set(s, u.set(n, t)); } } function v0(e3, t, n) { e3.clear(), t.clear(); for (const r of n) { const { source: o, target: i, sourceHandle: s = null, targetHandle: a = null } = r, l = { edgeId: r.id, source: o, target: i, sourceHandle: s, targetHandle: a }, u = `${o}-${s}--${i}-${a}`, d = `${i}-${a}--${o}-${s}`; cl("source", l, d, e3, o, s), cl("target", l, u, e3, i, a), t.set(r.id, r); } } function m0(e3, t) { if (e3 === null || t === null) return false; const n = Array.isArray(e3) ? e3 : [e3], r = Array.isArray(t) ? t : [t]; if (n.length !== r.length) return false; for (let o = 0; o < n.length; o++) if (n[o].id !== r[o].id || n[o].type !== r[o].type || !Object.is(n[o].data, r[o].data)) return false; return true; } function Nc(e3, t) { if (!e3.parentId) return false; const n = t.get(e3.parentId); return n ? n.selected ? true : Nc(n, t) : false; } function dl(e3, t, n) { let r = e3; do { if (r?.matches?.(t)) return true; if (r === n) return false; r = r?.parentElement; } while (r); return false; } function y0(e3, t, n, r) { const o = /* @__PURE__ */ new Map(); for (const [i, s] of e3) if ((s.selected || s.id === r) && (!s.parentId || !Nc(s, e3)) && (s.draggable || t && typeof s.draggable > "u")) { const a = e3.get(i); a && o.set(i, { id: i, position: a.position || { x: 0, y: 0 }, distance: { x: n.x - a.internals.positionAbsolute.x, y: n.y - a.internals.positionAbsolute.y }, extent: a.extent, parentId: a.parentId, origin: a.origin, expandParent: a.expandParent, internals: { positionAbsolute: a.internals.positionAbsolute || { x: 0, y: 0 } }, measured: { width: a.measured.width ?? 0, height: a.measured.height ?? 0 } }); } return o; } function Ji({ nodeId: e3, dragItems: t, nodeLookup: n, dragging: r = true }) { const o = []; for (const [s, a] of t) { const l = n.get(s)?.internals.userNode; l && o.push({ ...l, position: a.position, dragging: r }); } if (!e3) return [o[0], o]; const i = n.get(e3)?.internals.userNode; return [ i ? { ...i, position: t.get(e3)?.position || i.position, dragging: r } : o[0], o ]; } function w0({ dragItems: e3, snapGrid: t, x: n, y: r }) { const o = e3.values().next().value; if (!o) return null; const i = { x: n - o.distance.x, y: r - o.distance.y }, s = Po(i, t); return { x: s.x - i.x, y: s.y - i.y }; } function b0({ onNodeMouseDown: e3, getStoreItems: t, onDragStart: n, onDrag: r, onDragStop: o }) { let i = { x: null, y: null }, s = 0, a = /* @__PURE__ */ new Map(), l = false, u = { x: 0, y: 0 }, d = null, p = false, f = null, h = false, y = false, w = null; function m({ noDragClassName: $, handleSelector: _, domNode: x, isSelectable: k, nodeId: N, nodeClickDistance: V = 0 }) { f = Kt(x); function j({ x: S, y: T }) { const { nodeLookup: C, nodeExtent: P, snapGrid: M, snapToGrid: K, nodeOrigin: B, onNodeDrag: W, onSelectionDrag: D, onError: X, updateNodePositions: q } = t(); i = { x: S, y: T }; let U = false; const I = a.size > 1, F = I && P ? ks(Eo(a)) : null, G = I && K ? w0({ dragItems: a, snapGrid: M, x: S, y: T }) : null; for (const [te, ne] of a) { if (!C.has(te)) continue; let J = { x: S - ne.distance.x, y: T - ne.distance.y }; K && (J = G ? { x: Math.round(J.x + G.x), y: Math.round(J.y + G.y) } : Po(J, M)); let he = null; if (I && P && !ne.extent && F) { const { positionAbsolute: ie } = ne.internals, fe = ie.x - F.x + P[0][0], pe = ie.x + ne.measured.width - F.x2 + P[1][0], Ce = ie.y - F.y + P[0][1], de = ie.y + ne.measured.height - F.y2 + P[1][1]; he = [ [fe, Ce], [pe, de] ]; } const { position: ce, positionAbsolute: re } = gc({ nodeId: te, nextPosition: J, nodeLookup: C, nodeExtent: he || P, nodeOrigin: B, onError: X }); U = U || ne.position.x !== ce.x || ne.position.y !== ce.y, ne.position = ce, ne.internals.positionAbsolute = re; } if (y = y || U, !!U && (q(a, true), w && (r || W || !N && D))) { const [te, ne] = Ji({ nodeId: N, dragItems: a, nodeLookup: C }); r?.(w, a, te, ne), W?.(w, te, ne), N || D?.(w, ne); } } async function A() { if (!d) return; const { transform: S, panBy: T, autoPanSpeed: C, autoPanOnNodeDrag: P } = t(); if (!P) { l = false, cancelAnimationFrame(s); return; } const [M, K] = mc(u, d, C); (M !== 0 || K !== 0) && (i.x = (i.x ?? 0) - M / S[2], i.y = (i.y ?? 0) - K / S[2], await T({ x: M, y: K }) && j(i)), s = requestAnimationFrame(A); } function H(S) { const { nodeLookup: T, multiSelectionActive: C, nodesDraggable: P, transform: M, snapGrid: K, snapToGrid: B, selectNodesOnDrag: W, onNodeDragStart: D, onSelectionDragStart: X, unselectNodesAndEdges: q } = t(); p = true, (!W || !k) && !C && N && (T.get(N)?.selected || q()), k && W && N && e3?.(N); const U = Qi(S.sourceEvent, { transform: M, snapGrid: K, snapToGrid: B, containerBounds: d }); if (i = U, a = y0(T, P, U, N), a.size > 0 && (n || D || !N && X)) { const [I, F] = Ji({ nodeId: N, dragItems: a, nodeLookup: T }); n?.(S.sourceEvent, a, I, F), D?.(S.sourceEvent, I, F), N || X?.(S.sourceEvent, F); } } const z = Zg().clickDistance(V).on("start", (S) => { const { domNode: T, nodeDragThreshold: C, transform: P, snapGrid: M, snapToGrid: K } = t(); d = T?.getBoundingClientRect() || null, h = false, y = false, w = S.sourceEvent, C === 0 && H(S), i = Qi(S.sourceEvent, { transform: P, snapGrid: M, snapToGrid: K, containerBounds: d }), u = Ut(S.sourceEvent, d); }).on("drag", (S) => { const { autoPanOnNodeDrag: T, transform: C, snapGrid: P, snapToGrid: M, nodeDragThreshold: K, nodeLookup: B } = t(), W = Qi(S.sourceEvent, { transform: C, snapGrid: P, snapToGrid: M, containerBounds: d }); if (w = S.sourceEvent, (S.sourceEvent.type === "touchmove" && S.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors N && !B.has(N)) && (h = true), !h) { if (!l && T && p && (l = true, A()), !p) { const D = Ut(S.sourceEvent, d), X = D.x - u.x, q = D.y - u.y; Math.sqrt(X * X + q * q) > K && H(S); } (i.x !== W.xSnapped || i.y !== W.ySnapped) && a && p && (u = Ut(S.sourceEvent, d), j(W)); } }).on("end", (S) => { if (!(!p || h) && (l = false, p = false, cancelAnimationFrame(s), a.size > 0)) { const { nodeLookup: T, updateNodePositions: C, onNodeDragStop: P, onSelectionDragStop: M } = t(); if (y && (C(a, false), y = false), o || P || !N && M) { const [K, B] = Ji({ nodeId: N, dragItems: a, nodeLookup: T, dragging: false }); o?.(S.sourceEvent, a, K, B), P?.(S.sourceEvent, K, B), N || M?.(S.sourceEvent, B); } } }).filter((S) => { const T = S.target; return !S.button && (!$ || !dl(T, `.${$}`, x)) && (!_ || dl(T, _, x)); }); f.call(z); } function b() { f?.on(".drag", null); } return { update: m, destroy: b }; } function x0(e3, t, n) { const r = [], o = { x: e3.x - n, y: e3.y - n, width: n * 2, height: n * 2 }; for (const i of t.values()) fo(o, Hr(i)) > 0 && r.push(i); return r; } var C0 = 250; function $0(e3, t, n, r) { let o = [], i = 1 / 0; const s = x0(e3, n, t + C0); for (const a of s) { const l = [...a.internals.handleBounds?.source ?? [], ...a.internals.handleBounds?.target ?? []]; for (const u of l) { if (r.nodeId === u.nodeId && r.type === u.type && r.id === u.id) continue; const { x: d, y: p } = po(a, u, u.position, true), f = Math.sqrt(Math.pow(d - e3.x, 2) + Math.pow(p - e3.y, 2)); f > t || (f < i ? (o = [{ ...u, x: d, y: p }], i = f) : f === i && o.push({ ...u, x: d, y: p })); } } if (!o.length) return null; if (o.length > 1) { const a = r.type === "source" ? "target" : "source"; return o.find((l) => l.type === a) ?? o[0]; } return o[0]; } function Mc(e3, t, n, r, o, i = false) { const s = r.get(e3); if (!s) return null; const a = o === "strict" ? s.internals.handleBounds?.[t] : [...s.internals.handleBounds?.source ?? [], ...s.internals.handleBounds?.target ?? []], l = (n ? a?.find((u) => u.id === n) : a?.[0]) ?? null; return l && i ? { ...l, ...po(s, l, l.position, true) } : l; } function Tc(e3, t) { return e3 || (t?.classList.contains("target") ? "target" : t?.classList.contains("source") ? "source" : null); } function _0(e3, t) { let n = null; return t ? n = true : e3 && !t && (n = false), n; } var Lc = () => true; function k0(e3, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: l, lib: u, autoPanOnConnect: d, flowId: p, panBy: f, cancelConnection: h, onConnectStart: y, onConnect: w, onConnectEnd: m, isValidConnection: b = Lc, onReconnectEnd: $, updateConnection: _, getTransform: x, getFromHandle: k, autoPanSpeed: N, dragThreshold: V = 1, handleDomNode: j }) { const A = xc(e3.target); let H = 0, z; const { x: S, y: T } = Ut(e3), C = Tc(i, j), P = a?.getBoundingClientRect(); let M = false; if (!P || !C) return; const K = Mc(o, C, r, l, t); if (!K) return; let B = Ut(e3, P), W = false, D = null, X = false, q = null; function U() { if (!d || !P) return; const [he, ce] = mc(B, P, N); f({ x: he, y: ce }), H = requestAnimationFrame(U); } const I = { ...K, nodeId: o, type: C, position: K.position }, F = l.get(o); let G = { inProgress: true, isValid: null, from: po(F, I, me.Left, true), fromHandle: I, fromPosition: I.position, fromNode: F, to: B, toHandle: null, toPosition: Ja[I.position], toNode: null, pointer: B }; function te() { M = true, _(G), y?.(e3, { nodeId: o, handleId: r, handleType: C }); } V === 0 && te(); function ne(he) { if (!M) { const { x: fe, y: pe } = Ut(he), Ce = fe - S, de = pe - T; if (!(Ce * Ce + de * de > V * V)) return; te(); } if (!k() || !I) { J(he); return; } const ce = x(); B = Ut(he, P), z = $0(No(B, ce, false, [1, 1]), n, l, I), W || (U(), W = true); const re = Vc(he, { handle: z, connectionMode: t, fromNodeId: o, fromHandleId: r, fromType: s ? "target" : "source", isValidConnection: b, doc: A, lib: u, flowId: p, nodeLookup: l }); q = re.handleDomNode, D = re.connection, X = _0(!!z, re.isValid); const ie = { // from stays the same ...G, isValid: X, to: re.toHandle && X ? gi({ x: re.toHandle.x, y: re.toHandle.y }, ce) : B, toHandle: re.toHandle, toPosition: X && re.toHandle ? re.toHandle.position : Ja[I.position], toNode: re.toHandle ? l.get(re.toHandle.nodeId) : null, pointer: B }; _(ie), G = ie; } function J(he) { if (!("touches" in he && he.touches.length > 0)) { if (M) { (z || q) && D && X && w?.(D); const { inProgress: ce, ...re } = G, ie = { ...re, toPosition: G.toHandle ? G.toPosition : null }; m?.(he, ie), i && $?.(he, ie); } h(), cancelAnimationFrame(H), W = false, X = false, D = null, q = null, A.removeEventListener("mousemove", ne), A.removeEventListener("mouseup", J), A.removeEventListener("touchmove", ne), A.removeEventListener("touchend", J); } } A.addEventListener("mousemove", ne), A.addEventListener("mouseup", J), A.addEventListener("touchmove", ne), A.addEventListener("touchend", J); } function Vc(e3, { handle: t, connectionMode: n, fromNodeId: r, fromHandleId: o, fromType: i, doc: s, lib: a, flowId: l, isValidConnection: u = Lc, nodeLookup: d }) { const p = i === "target", f = t ? s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`) : null, { x: h, y } = Ut(e3), w = s.elementFromPoint(h, y), m = w?.classList.contains(`${a}-flow__handle`) ? w : f, b = { handleDomNode: m, isValid: false, connection: null, toHandle: null }; if (m) { const $ = Tc(void 0, m), _ = m.getAttribute("data-nodeid"), x = m.getAttribute("data-handleid"), k = m.classList.contains("connectable"), N = m.classList.contains("connectableend"); if (!_ || !$) return b; const V = { source: p ? _ : r, sourceHandle: p ? x : o, target: p ? r : _, targetHandle: p ? o : x }; b.connection = V; const j = k && N && (n === zr.Strict ? p && $ === "source" || !p && $ === "target" : _ !== r || x !== o); b.isValid = j && u(V), b.toHandle = Mc(_, $, x, d, n, true); } return b; } var fl = { onPointerDown: k0, isValid: Vc }; function S0({ domNode: e3, panZoom: t, getTransform: n, getViewScale: r }) { const o = Kt(e3); function i({ translateExtent: a, width: l, height: u, zoomStep: d = 1, pannable: p = true, zoomable: f = true, inversePan: h = false }) { const y = (_) => { if (_.sourceEvent.type !== "wheel" || !t) return; const x = n(), k = _.sourceEvent.ctrlKey && sr() ? 10 : 1, N = -_.sourceEvent.deltaY * (_.sourceEvent.deltaMode === 1 ? 0.05 : _.sourceEvent.deltaMode ? 1 : 2e-3) * d, V = x[2] * Math.pow(2, N * k); t.scaleTo(V); }; let w = [0, 0]; const m = (_) => { (_.sourceEvent.type === "mousedown" || _.sourceEvent.type === "touchstart") && (w = [ _.sourceEvent.clientX ?? _.sourceEvent.touches[0].clientX, _.sourceEvent.clientY ?? _.sourceEvent.touches[0].clientY ]); }, b = (_) => { const x = n(); if (_.sourceEvent.type !== "mousemove" && _.sourceEvent.type !== "touchmove" || !t) return; const k = [ _.sourceEvent.clientX ?? _.sourceEvent.touches[0].clientX, _.sourceEvent.clientY ?? _.sourceEvent.touches[0].clientY ], N = [k[0] - w[0], k[1] - w[1]]; w = k; const V = r() * Math.max(x[2], Math.log(x[2])) * (h ? -1 : 1), j = { x: x[0] - N[0] * V, y: x[1] - N[1] * V }, A = [ [0, 0], [l, u] ]; t.setViewportConstrained({ x: j.x, y: j.y, zoom: x[2] }, A, a); }, $ = fc().on("start", m).on("zoom", p ? b : null).on("zoom.wheel", f ? y : null); o.call($, {}); } function s() { o.on("zoom", null); } return { update: i, destroy: s, pointer: qt }; } var Zi = (e3) => ({ x: e3.x, y: e3.y, zoom: e3.k }); var es = ({ x: e3, y: t, zoom: n }) => Ai.translate(e3, t).scale(n); var $r = (e3, t) => e3.target.closest(`.${t}`); var Dc = (e3, t) => t === 2 && Array.isArray(e3) && e3.includes(2); var E0 = (e3) => ((e3 *= 2) <= 1 ? e3 * e3 * e3 : (e3 -= 2) * e3 * e3 + 2) / 2; var ts = (e3, t = 0, n = E0, r = () => { }) => { const o = typeof t == "number" && t > 0; return o || r(), o ? e3.transition().duration(t).ease(n).on("end", r) : e3; }; var Oc = (e3) => { const t = e3.ctrlKey && sr() ? 10 : 1; return -e3.deltaY * (e3.deltaMode === 1 ? 0.05 : e3.deltaMode ? 1 : 2e-3) * t; }; function P0({ zoomPanValues: e3, noWheelClassName: t, d3Selection: n, d3Zoom: r, panOnScrollMode: o, panOnScrollSpeed: i, zoomOnPinch: s, onPanZoomStart: a, onPanZoom: l, onPanZoomEnd: u }) { return (d) => { if ($r(d, t)) return d.ctrlKey && d.preventDefault(), false; d.preventDefault(), d.stopImmediatePropagation(); const p = n.property("__zoom").k || 1; if (d.ctrlKey && s) { const m = qt(d), b = Oc(d), $ = p * Math.pow(2, b); r.scaleTo(n, $, m, d); return; } const f = d.deltaMode === 1 ? 20 : 1; let h = o === ur.Vertical ? 0 : d.deltaX * f, y = o === ur.Horizontal ? 0 : d.deltaY * f; !sr() && d.shiftKey && o !== ur.Vertical && (h = d.deltaY * f, y = 0), r.translateBy( n, -(h / p) * i, -(y / p) * i, // @ts-ignore { internal: true } ); const w = Zi(n.property("__zoom")); clearTimeout(e3.panScrollTimeout), e3.isPanScrolling ? (l?.(d, w), e3.panScrollTimeout = setTimeout(() => { u?.(d, w), e3.isPanScrolling = false; }, 150)) : (e3.isPanScrolling = true, a?.(d, w)); }; } function N0({ noWheelClassName: e3, preventScrolling: t, d3ZoomHandler: n }) { return function(r, o) { const i = r.type === "wheel", s = !t && i && !r.ctrlKey, a = $r(r, e3); if (r.ctrlKey && i && a && r.preventDefault(), s || a) return null; r.preventDefault(), n.call(this, r, o); }; } function M0({ zoomPanValues: e3, onDraggingChange: t, onPanZoomStart: n }) { return (r) => { if (r.sourceEvent?.internal) return; const o = Zi(r.transform); e3.mouseButton = r.sourceEvent?.button || 0, e3.isZoomingOrPanning = true, e3.prevViewport = o, r.sourceEvent?.type === "mousedown" && t(true), n && n?.(r.sourceEvent, o); }; } function T0({ zoomPanValues: e3, panOnDrag: t, onPaneContextMenu: n, onTransformChange: r, onPanZoom: o }) { return (i) => { e3.usedRightMouseButton = !!(n && Dc(t, e3.mouseButton ?? 0)), i.sourceEvent?.sync || r([i.transform.x, i.transform.y, i.transform.k]), o && !i.sourceEvent?.internal && o?.(i.sourceEvent, Zi(i.transform)); }; } function L0({ zoomPanValues: e3, panOnDrag: t, panOnScroll: n, onDraggingChange: r, onPanZoomEnd: o, onPaneContextMenu: i }) { return (s) => { if (!s.sourceEvent?.internal && (e3.isZoomingOrPanning = false, i && Dc(t, e3.mouseButton ?? 0) && !e3.usedRightMouseButton && s.sourceEvent && i(s.sourceEvent), e3.usedRightMouseButton = false, r(false), o)) { const a = Zi(s.transform); e3.prevViewport = a, clearTimeout(e3.timerId), e3.timerId = setTimeout( () => { o?.(s.sourceEvent, a); }, // we need a setTimeout for panOnScroll to supress multiple end events fired during scroll n ? 150 : 0 ); } }; } function V0({ zoomActivationKeyPressed: e3, zoomOnScroll: t, zoomOnPinch: n, panOnDrag: r, panOnScroll: o, zoomOnDoubleClick: i, userSelectionActive: s, noWheelClassName: a, noPanClassName: l, lib: u, connectionInProgress: d }) { return (p) => { const f = e3 || t, h = n && p.ctrlKey, y = p.type === "wheel"; if (p.button === 1 && p.type === "mousedown" && ($r(p, `${u}-flow__node`) || $r(p, `${u}-flow__edge`))) return true; if (!r && !f && !o && !i && !n || s || d && !y || $r(p, a) && y || $r(p, l) && (!y || o && y && !e3) || !n && p.ctrlKey && y) return false; if (!n && p.type === "touchstart" && p.touches?.length > 1) return p.preventDefault(), false; if (!f && !o && !h && y || !r && (p.type === "mousedown" || p.type === "touchstart") || Array.isArray(r) && !r.includes(p.button) && p.type === "mousedown") return false; const w = Array.isArray(r) && r.includes(p.button) || !p.button || p.button <= 1; return (!p.ctrlKey || y) && w; }; } function D0({ domNode: e3, minZoom: t, maxZoom: n, translateExtent: r, viewport: o, onPanZoom: i, onPanZoomStart: s, onPanZoomEnd: a, onDraggingChange: l }) { const u = { isZoomingOrPanning: false, usedRightMouseButton: false, prevViewport: {}, mouseButton: 0, timerId: void 0, panScrollTimeout: void 0, isPanScrolling: false }, d = e3.getBoundingClientRect(), p = fc().scaleExtent([t, n]).translateExtent(r), f = Kt(e3).call(p); $({ x: o.x, y: o.y, zoom: Ar(o.zoom, t, n) }, [ [0, 0], [d.width, d.height] ], r); const h = f.on("wheel.zoom"), y = f.on("dblclick.zoom"); p.wheelDelta(Oc); function w(z, S) { return f ? new Promise((T) => { p?.interpolate(S?.interpolate === "linear" ? eo : Xo).transform(ts(f, S?.duration, S?.ease, () => T(true)), z); }) : Promise.resolve(false); } function m({ noWheelClassName: z, noPanClassName: S, onPaneContextMenu: T, userSelectionActive: C, panOnScroll: P, panOnDrag: M, panOnScrollMode: K, panOnScrollSpeed: B, preventScrolling: W, zoomOnPinch: D, zoomOnScroll: X, zoomOnDoubleClick: q, zoomActivationKeyPressed: U, lib: I, onTransformChange: F, connectionInProgress: G, paneClickDistance: te, selectionOnDrag: ne }) { C && !u.isZoomingOrPanning && b(); const J = P && !U && !C; p.clickDistance(ne ? 1 / 0 : !_n(te) || te < 0 ? 0 : te); const he = J ? P0({ zoomPanValues: u, noWheelClassName: z, d3Selection: f, d3Zoom: p, panOnScrollMode: K, panOnScrollSpeed: B, zoomOnPinch: D, onPanZoomStart: s, onPanZoom: i, onPanZoomEnd: a }) : N0({ noWheelClassName: z, preventScrolling: W, d3ZoomHandler: h }); if (f.on("wheel.zoom", he, { passive: false }), !C) { const re = M0({ zoomPanValues: u, onDraggingChange: l, onPanZoomStart: s }); p.on("start", re); const ie = T0({ zoomPanValues: u, panOnDrag: M, onPaneContextMenu: !!T, onPanZoom: i, onTransformChange: F }); p.on("zoom", ie); const fe = L0({ zoomPanValues: u, panOnDrag: M, panOnScroll: P, onPaneContextMenu: T, onPanZoomEnd: a, onDraggingChange: l }); p.on("end", fe); } const ce = V0({ zoomActivationKeyPressed: U, panOnDrag: M, zoomOnScroll: X, panOnScroll: P, zoomOnDoubleClick: q, zoomOnPinch: D, userSelectionActive: C, noPanClassName: S, noWheelClassName: z, lib: I, connectionInProgress: G }); p.filter(ce), q ? f.on("dblclick.zoom", y) : f.on("dblclick.zoom", null); } function b() { p.on("zoom", null); } async function $(z, S, T) { const C = es(z), P = p?.constrain()(C, S, T); return P && await w(P), new Promise((M) => M(P)); } async function _(z, S) { const T = es(z); return await w(T, S), new Promise((C) => C(T)); } function x(z) { if (f) { const S = es(z), T = f.property("__zoom"); (T.k !== z.zoom || T.x !== z.x || T.y !== z.y) && p?.transform(f, S, null, { sync: true }); } } function k() { const z = f ? dc(f.node()) : { x: 0, y: 0, k: 1 }; return { x: z.x, y: z.y, zoom: z.k }; } function N(z, S) { return f ? new Promise((T) => { p?.interpolate(S?.interpolate === "linear" ? eo : Xo).scaleTo(ts(f, S?.duration, S?.ease, () => T(true)), z); }) : Promise.resolve(false); } function V(z, S) { return f ? new Promise((T) => { p?.interpolate(S?.interpolate === "linear" ? eo : Xo).scaleBy(ts(f, S?.duration, S?.ease, () => T(true)), z); }) : Promise.resolve(false); } function j(z) { p?.scaleExtent(z); } function A(z) { p?.translateExtent(z); } function H(z) { const S = !_n(z) || z < 0 ? 0 : z; p?.clickDistance(S); } return { update: m, destroy: b, setViewport: _, setViewportConstrained: $, getViewport: k, scaleTo: N, scaleBy: V, setScaleExtent: j, setTranslateExtent: A, syncViewport: x, setClickDistance: H }; } var pl; (function(e3) { e3.Line = "line", e3.Handle = "handle"; })(pl || (pl = {})); var O0 = ee("
"); function Xn(e3, t) { le(t, true); let n = v(t, "id", 7, null), r = v(t, "type", 7, "source"), o = v(t, "position", 23, () => me.Top), i = v(t, "style", 7), s = v(t, "class", 7), a = v(t, "isConnectable", 7), l = v(t, "isConnectableStart", 7, true), u = v(t, "isConnectableEnd", 7, true), d = v(t, "isValidConnection", 7), p = v(t, "onconnect", 7), f = v(t, "ondisconnect", 7), h = v(t, "children", 7), y = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "id", "type", "position", "style", "class", "isConnectable", "isConnectableStart", "isConnectableEnd", "isValidConnection", "onconnect", "ondisconnect", "children" ]); const w = Fn("svelteflow__node_id"), m = Fn("svelteflow__node_connectable"); let b = E(() => r() === "target"), $ = E(() => a() !== void 0 ? a() : m.value), _ = rn(), x = E(() => _.ariaLabelConfig), k = null; fu(() => { if (p() || f()) { _.edges; let D = _.connectionLookup.get(`${w}-${r()}${n() ? `-${n()}` : ""}`); if (k && !Dv(D, k)) { const X = D ?? /* @__PURE__ */ new Map(); el(k, X, f()), el(X, k, p()); } k = new Map(D); } }); let N = E(() => { if (!_.connection.inProgress) return [false, false, false, false, null]; const { fromHandle: D, toHandle: X, isValid: q } = _.connection, U = D && D.nodeId === w && D.type === r() && D.id === n(), I = X && X.nodeId === w && X.type === r() && X.id === n(), F = _.connectionMode === zr.Strict ? D?.type !== r() : w !== D?.nodeId || n() !== D?.id; return [ true, U, I, F, I && q ]; }), V = E(() => mo(c(N), 5)), j = E(() => c(V)[0]), A = E(() => c(V)[1]), H = E(() => c(V)[2]), z = E(() => c(V)[3]), S = E(() => c(V)[4]); function T(D) { const X = _.onbeforeconnect ? _.onbeforeconnect(D) : D; X && (_.addEdge(X), _.onconnect?.(D)); } function C(D) { const X = $c(D); D.currentTarget && (X && D.button === 0 || !X) && fl.onPointerDown(D, { handleId: n(), nodeId: w, isTarget: c(b), connectionRadius: _.connectionRadius, domNode: _.domNode, nodeLookup: _.nodeLookup, connectionMode: _.connectionMode, lib: "svelte", autoPanOnConnect: _.autoPanOnConnect, autoPanSpeed: _.autoPanSpeed, flowId: _.flowId, isValidConnection: d() ?? _.isValidConnection, updateConnection: _.updateConnection, cancelConnection: _.cancelConnection, panBy: _.panBy, onConnect: T, onConnectStart: (q, U) => { _.onconnectstart?.(q, { nodeId: U.nodeId, handleId: U.handleId, handleType: U.handleType }); }, onConnectEnd: (q, U) => { _.onconnectend?.(q, U); }, getTransform: () => [_.viewport.x, _.viewport.y, _.viewport.zoom], getFromHandle: () => _.connection.fromHandle, dragThreshold: _.connectionDragThreshold, handleDomNode: D.currentTarget }); } function P(D) { if (!w || !_.clickConnectStartHandle && !l()) return; if (!_.clickConnectStartHandle) { _.onclickconnectstart?.(D, { nodeId: w, handleId: n(), handleType: r() }), _.clickConnectStartHandle = { nodeId: w, type: r(), id: n() }; return; } const X = xc(D.target), q = d() ?? _.isValidConnection, { connectionMode: U, clickConnectStartHandle: I, flowId: F, nodeLookup: G } = _, { connection: te, isValid: ne } = fl.isValid(D, { handle: { nodeId: w, id: n(), type: r() }, connectionMode: U, fromNodeId: I.nodeId, fromHandleId: I.id ?? null, fromType: I.type, isValidConnection: q, flowId: F, doc: X, lib: "svelte", nodeLookup: G }); ne && te && T(te); const J = structuredClone(Yl(_.connection)); delete J.inProgress, J.toPosition = J.toHandle ? J.toHandle.position : null, _.onclickconnectend?.(D, J), _.clickConnectStartHandle = null; } var M = { get id() { return n(); }, set id(D = null) { n(D), g(); }, get type() { return r(); }, set type(D = "source") { r(D), g(); }, get position() { return o(); }, set position(D = me.Top) { o(D), g(); }, get style() { return i(); }, set style(D) { i(D), g(); }, get class() { return s(); }, set class(D) { s(D), g(); }, get isConnectable() { return a(); }, set isConnectable(D) { a(D), g(); }, get isConnectableStart() { return l(); }, set isConnectableStart(D = true) { l(D), g(); }, get isConnectableEnd() { return u(); }, set isConnectableEnd(D = true) { u(D), g(); }, get isValidConnection() { return d(); }, set isValidConnection(D) { d(D), g(); }, get onconnect() { return p(); }, set onconnect(D) { p(D), g(); }, get ondisconnect() { return f(); }, set ondisconnect(D) { f(D), g(); }, get children() { return h(); }, set children(D) { h(D), g(); } }, K = O0(), B = () => { }; ot(K, () => ({ "data-handleid": n(), "data-nodeid": w, "data-handlepos": o(), "data-id": `${_.flowId ?? ""}-${w ?? ""}-${n() ?? "null" ?? ""}-${r() ?? ""}`, class: [ "svelte-flow__handle", `svelte-flow__handle-${o()}`, _.noDragClass, _.noPanClass, o(), s() ], onmousedown: C, ontouchstart: C, onclick: _.clickConnect ? P : void 0, onkeypress: B, style: i(), role: "button", "aria-label": c(x)["handle.ariaLabel"], tabindex: "-1", ...y, [jn]: { valid: c(S), connectingto: c(H), connectingfrom: c(A), source: !c(b), target: c(b), connectablestart: l(), connectableend: u(), connectable: c($), connectionindicator: c($) && (!c(j) || c(z)) && (c(j) || _.clickConnectStartHandle ? u() : l()) } })); var W = R(K); return Ge(W, () => h() ?? vt), Z(K), L(e3, K), ue(M); } se( Xn, { id: {}, type: {}, position: {}, style: {}, class: {}, isConnectable: {}, isConnectableStart: {}, isConnectableEnd: {}, isValidConnection: {}, onconnect: {}, ondisconnect: {}, children: {} }, [], [], true ); var z0 = ee(" ", 1); function da(e3, t) { le(t, true); let n = v(t, "data", 7), r = v(t, "targetPosition", 23, () => me.Top), o = v(t, "sourcePosition", 23, () => me.Bottom); var i = { get data() { return n(); }, set data(d) { n(d), g(); }, get targetPosition() { return r(); }, set targetPosition(d = me.Top) { r(d), g(); }, get sourcePosition() { return o(); }, set sourcePosition(d = me.Bottom) { o(d), g(); } }, s = z0(), a = oe(s); Xn(a, { type: "target", get position() { return r(); } }); var l = O(a), u = O(l); return Xn(u, { type: "source", get position() { return o(); } }), $e(() => Re(l, ` ${n()?.label ?? ""} `)), L(e3, s), ue(i); } se(da, { data: {}, targetPosition: {}, sourcePosition: {} }, [], [], true); var A0 = ee(" ", 1); function zc(e3, t) { le(t, true); let n = v(t, "data", 23, () => ({ label: "Node" })), r = v(t, "sourcePosition", 23, () => me.Bottom); var o = { get data() { return n(); }, set data(l = { label: "Node" }) { n(l), g(); }, get sourcePosition() { return r(); }, set sourcePosition(l = me.Bottom) { r(l), g(); } }; ve(); var i = A0(), s = oe(i), a = O(s); return Xn(a, { type: "source", get position() { return r(); } }), $e(() => Re(s, `${n()?.label ?? ""} `)), L(e3, i), ue(o); } se(zc, { data: {}, sourcePosition: {} }, [], [], true); var H0 = ee(" ", 1); function Ac(e3, t) { le(t, true); let n = v(t, "data", 23, () => ({ label: "Node" })), r = v(t, "targetPosition", 23, () => me.Top); var o = { get data() { return n(); }, set data(l = { label: "Node" }) { n(l), g(); }, get targetPosition() { return r(); }, set targetPosition(l = me.Top) { r(l), g(); } }; ve(); var i = H0(), s = oe(i), a = O(s); return Xn(a, { type: "target", get position() { return r(); } }), $e(() => Re(s, `${n()?.label ?? ""} `)), L(e3, i), ue(o); } se(Ac, { data: {}, targetPosition: {} }, [], [], true); function Hc(e3, t) { } se(Hc, {}, [], [], true); function ns(e3, t, n) { if (!n || !t) return; const r = n === "root" ? t : t.querySelector(`.svelte-flow__${n}`); r && r.appendChild(e3); } function Ic(e3, t) { const n = E(rn), r = E(() => c(n).domNode); let o; return c(r) ? ns(e3, c(r), t) : o = Rs(() => { qe(() => { ns(e3, c(r), t), o?.(); }); }), { async update(i) { ns(e3, c(r), i); }, destroy() { e3.parentNode && e3.parentNode.removeChild(e3), o?.(); } }; } function Zc() { let e3 = Ee(typeof window > "u"); if (c(e3)) { const t = Rs(() => { qe(() => { Q(e3, false), t?.(); }); }); } return { get value() { return c(e3); } }; } var hl = (e3) => zv(e3); var I0 = (e3) => hc(e3); function gn(e3) { return e3 === void 0 ? void 0 : `${e3}px`; } var vi = { ArrowUp: { x: 0, y: -1 }, ArrowDown: { x: 0, y: 1 }, ArrowLeft: { x: -1, y: 0 }, ArrowRight: { x: 1, y: 0 } }; var Z0 = ee("
"); var j0 = { hash: "svelte-1ix3cbb", code: ".transparent.svelte-1ix3cbb {background:transparent;}" }; function jc(e3, t) { le(t, true), He(e3, j0); let n = v(t, "x", 7, 0), r = v(t, "y", 7, 0), o = v(t, "width", 7), i = v(t, "height", 7), s = v(t, "selectEdgeOnClick", 7, false), a = v(t, "transparent", 7, false), l = v(t, "class", 7), u = v(t, "children", 7), d = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "x", "y", "width", "height", "selectEdgeOnClick", "transparent", "class", "children" ]); const p = rn(), f = Fn("svelteflow__edge_id"); if (!f) throw new Error("EdgeLabel must be used within an edge"); let h = E(() => p.visible.edges.get(f)?.zIndex); var y = { get x() { return n(); }, set x($ = 0) { n($), g(); }, get y() { return r(); }, set y($ = 0) { r($), g(); }, get width() { return o(); }, set width($) { o($), g(); }, get height() { return i(); }, set height($) { i($), g(); }, get selectEdgeOnClick() { return s(); }, set selectEdgeOnClick($ = false) { s($), g(); }, get transparent() { return a(); }, set transparent($ = false) { a($), g(); }, get class() { return l(); }, set class($) { l($), g(); }, get children() { return u(); }, set children($) { u($), g(); } }, w = Z0(), m = () => { s() && p.handleEdgeSelection(f); }; ot( w, ($) => ({ class: [ "svelte-flow__edge-label", { transparent: a() }, l() ], tabindex: "-1", onclick: m, ...d, [cn]: $ }), [ () => ({ display: Zc().value ? "none" : void 0, cursor: s() ? "pointer" : void 0, transform: `translate(-50%, -50%) translate(${n() ?? ""}px,${r() ?? ""}px)`, "pointer-events": "all", width: gn(o()), height: gn(i()), "z-index": c(h) }) ], void 0, void 0, "svelte-1ix3cbb" ); var b = R(w); return Ge(b, () => u() ?? vt), Z(w), pt(w, ($, _) => Ic?.($, _), () => "edge-labels"), L(e3, w), ue(y); } se( jc, { x: {}, y: {}, width: {}, height: {}, selectEdgeOnClick: {}, transparent: {}, class: {}, children: {} }, [], [], true ); var K0 = ge(""); var R0 = ge('', 1); function Mo(e3, t) { le(t, true); let n = v(t, "id", 7), r = v(t, "path", 7), o = v(t, "label", 7), i = v(t, "labelX", 7), s = v(t, "labelY", 7), a = v(t, "labelStyle", 7), l = v(t, "markerStart", 7), u = v(t, "markerEnd", 7), d = v(t, "style", 7), p = v(t, "interactionWidth", 7, 20), f = v(t, "class", 7), h = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "id", "path", "label", "labelX", "labelY", "labelStyle", "markerStart", "markerEnd", "style", "interactionWidth", "class" ]); var y = { get id() { return n(); }, set id(k) { n(k), g(); }, get path() { return r(); }, set path(k) { r(k), g(); }, get label() { return o(); }, set label(k) { o(k), g(); }, get labelX() { return i(); }, set labelX(k) { i(k), g(); }, get labelY() { return s(); }, set labelY(k) { s(k), g(); }, get labelStyle() { return a(); }, set labelStyle(k) { a(k), g(); }, get markerStart() { return l(); }, set markerStart(k) { l(k), g(); }, get markerEnd() { return u(); }, set markerEnd(k) { u(k), g(); }, get style() { return d(); }, set style(k) { d(k), g(); }, get interactionWidth() { return p(); }, set interactionWidth(k = 20) { p(k), g(); }, get class() { return f(); }, set class(k) { f(k), g(); } }, w = R0(), m = oe(w), b = O(m); { var $ = (k) => { var N = K0(); ot(N, () => ({ d: r(), "stroke-opacity": 0, "stroke-width": p(), fill: "none", class: "svelte-flow__edge-interaction", ...h })), L(k, N); }; ae(b, (k) => { p() > 0 && k($); }); } var _ = O(b); { var x = (k) => { jc(k, { get x() { return i(); }, get y() { return s(); }, get style() { return a(); }, selectEdgeOnClick: true, children: (N, V) => { ve(); var j = ke(); $e(() => Re(j, o())), L(N, j); }, $$slots: { default: true } }); }; ae(_, (k) => { o() && k(x); }); } return $e(() => { xe(m, "id", n()), xe(m, "d", r()), Pt(m, 0, An(["svelte-flow__edge-path", f()])), xe(m, "marker-start", l()), xe(m, "marker-end", u()), dt(m, d()); }), L(e3, w), ue(y); } se( Mo, { id: {}, path: {}, label: {}, labelX: {}, labelY: {}, labelStyle: {}, markerStart: {}, markerEnd: {}, style: {}, interactionWidth: {}, class: {} }, [], [], true ); function fa(e3, t) { le(t, true); let n = v(t, "id", 7), r = v(t, "interactionWidth", 7), o = v(t, "label", 7), i = v(t, "labelStyle", 7), s = v(t, "markerEnd", 7), a = v(t, "markerStart", 7), l = v(t, "pathOptions", 7), u = v(t, "sourcePosition", 7), d = v(t, "sourceX", 7), p = v(t, "sourceY", 7), f = v(t, "style", 7), h = v(t, "targetPosition", 7), y = v(t, "targetX", 7), w = v(t, "targetY", 7), m = E(() => _c({ sourceX: d(), sourceY: p(), targetX: y(), targetY: w(), sourcePosition: u(), targetPosition: h(), curvature: l()?.curvature })), b = E(() => mo(c(m), 3)), $ = E(() => c(b)[0]), _ = E(() => c(b)[1]), x = E(() => c(b)[2]); var k = { get id() { return n(); }, set id(N) { n(N), g(); }, get interactionWidth() { return r(); }, set interactionWidth(N) { r(N), g(); }, get label() { return o(); }, set label(N) { o(N), g(); }, get labelStyle() { return i(); }, set labelStyle(N) { i(N), g(); }, get markerEnd() { return s(); }, set markerEnd(N) { s(N), g(); }, get markerStart() { return a(); }, set markerStart(N) { a(N), g(); }, get pathOptions() { return l(); }, set pathOptions(N) { l(N), g(); }, get sourcePosition() { return u(); }, set sourcePosition(N) { u(N), g(); }, get sourceX() { return d(); }, set sourceX(N) { d(N), g(); }, get sourceY() { return p(); }, set sourceY(N) { p(N), g(); }, get style() { return f(); }, set style(N) { f(N), g(); }, get targetPosition() { return h(); }, set targetPosition(N) { h(N), g(); }, get targetX() { return y(); }, set targetX(N) { y(N), g(); }, get targetY() { return w(); }, set targetY(N) { w(N), g(); } }; return Mo(e3, { get id() { return n(); }, get path() { return c($); }, get labelX() { return c(_); }, get labelY() { return c(x); }, get label() { return o(); }, get labelStyle() { return i(); }, get markerStart() { return a(); }, get markerEnd() { return s(); }, get interactionWidth() { return r(); }, get style() { return f(); } }), ue(k); } se( fa, { id: {}, interactionWidth: {}, label: {}, labelStyle: {}, markerEnd: {}, markerStart: {}, pathOptions: {}, sourcePosition: {}, sourceX: {}, sourceY: {}, style: {}, targetPosition: {}, targetX: {}, targetY: {} }, [], [], true ); function Kc(e3, t) { le(t, true); let n = v(t, "interactionWidth", 7), r = v(t, "label", 7), o = v(t, "labelStyle", 7), i = v(t, "style", 7), s = v(t, "markerEnd", 7), a = v(t, "markerStart", 7), l = v(t, "sourcePosition", 7), u = v(t, "sourceX", 7), d = v(t, "sourceY", 7), p = v(t, "targetPosition", 7), f = v(t, "targetX", 7), h = v(t, "targetY", 7), y = E(() => aa({ sourceX: u(), sourceY: d(), targetX: f(), targetY: h(), sourcePosition: l(), targetPosition: p() })), w = E(() => mo(c(y), 3)), m = E(() => c(w)[0]), b = E(() => c(w)[1]), $ = E(() => c(w)[2]); var _ = { get interactionWidth() { return n(); }, set interactionWidth(x) { n(x), g(); }, get label() { return r(); }, set label(x) { r(x), g(); }, get labelStyle() { return o(); }, set labelStyle(x) { o(x), g(); }, get style() { return i(); }, set style(x) { i(x), g(); }, get markerEnd() { return s(); }, set markerEnd(x) { s(x), g(); }, get markerStart() { return a(); }, set markerStart(x) { a(x), g(); }, get sourcePosition() { return l(); }, set sourcePosition(x) { l(x), g(); }, get sourceX() { return u(); }, set sourceX(x) { u(x), g(); }, get sourceY() { return d(); }, set sourceY(x) { d(x), g(); }, get targetPosition() { return p(); }, set targetPosition(x) { p(x), g(); }, get targetX() { return f(); }, set targetX(x) { f(x), g(); }, get targetY() { return h(); }, set targetY(x) { h(x), g(); } }; return Mo(e3, { get path() { return c(m); }, get labelX() { return c(b); }, get labelY() { return c($); }, get label() { return r(); }, get labelStyle() { return o(); }, get markerStart() { return a(); }, get markerEnd() { return s(); }, get interactionWidth() { return n(); }, get style() { return i(); } }), ue(_); } se( Kc, { interactionWidth: {}, label: {}, labelStyle: {}, style: {}, markerEnd: {}, markerStart: {}, sourcePosition: {}, sourceX: {}, sourceY: {}, targetPosition: {}, targetX: {}, targetY: {} }, [], [], true ); function Rc(e3, t) { le(t, true); let n = v(t, "sourceX", 7), r = v(t, "sourceY", 7), o = v(t, "targetX", 7), i = v(t, "targetY", 7), s = v(t, "label", 7), a = v(t, "labelStyle", 7), l = v(t, "markerStart", 7), u = v(t, "markerEnd", 7), d = v(t, "interactionWidth", 7), p = v(t, "style", 7), f = E(() => Sc({ sourceX: n(), sourceY: r(), targetX: o(), targetY: i() })), h = E(() => mo(c(f), 3)), y = E(() => c(h)[0]), w = E(() => c(h)[1]), m = E(() => c(h)[2]); var b = { get sourceX() { return n(); }, set sourceX($) { n($), g(); }, get sourceY() { return r(); }, set sourceY($) { r($), g(); }, get targetX() { return o(); }, set targetX($) { o($), g(); }, get targetY() { return i(); }, set targetY($) { i($), g(); }, get label() { return s(); }, set label($) { s($), g(); }, get labelStyle() { return a(); }, set labelStyle($) { a($), g(); }, get markerStart() { return l(); }, set markerStart($) { l($), g(); }, get markerEnd() { return u(); }, set markerEnd($) { u($), g(); }, get interactionWidth() { return d(); }, set interactionWidth($) { d($), g(); }, get style() { return p(); }, set style($) { p($), g(); } }; return Mo(e3, { get path() { return c(y); }, get labelX() { return c(w); }, get labelY() { return c(m); }, get label() { return s(); }, get labelStyle() { return a(); }, get markerStart() { return l(); }, get markerEnd() { return u(); }, get interactionWidth() { return d(); }, get style() { return p(); } }), ue(b); } se( Rc, { sourceX: {}, sourceY: {}, targetX: {}, targetY: {}, label: {}, labelStyle: {}, markerStart: {}, markerEnd: {}, interactionWidth: {}, style: {} }, [], [], true ); function Bc(e3, t) { le(t, true); let n = v(t, "sourceX", 7), r = v(t, "sourceY", 7), o = v(t, "sourcePosition", 7), i = v(t, "targetX", 7), s = v(t, "targetY", 7), a = v(t, "targetPosition", 7), l = v(t, "label", 7), u = v(t, "labelStyle", 7), d = v(t, "markerStart", 7), p = v(t, "markerEnd", 7), f = v(t, "interactionWidth", 7), h = v(t, "style", 7), y = E(() => aa({ sourceX: n(), sourceY: r(), targetX: i(), targetY: s(), sourcePosition: o(), targetPosition: a(), borderRadius: 0 })), w = E(() => mo(c(y), 3)), m = E(() => c(w)[0]), b = E(() => c(w)[1]), $ = E(() => c(w)[2]); var _ = { get sourceX() { return n(); }, set sourceX(x) { n(x), g(); }, get sourceY() { return r(); }, set sourceY(x) { r(x), g(); }, get sourcePosition() { return o(); }, set sourcePosition(x) { o(x), g(); }, get targetX() { return i(); }, set targetX(x) { i(x), g(); }, get targetY() { return s(); }, set targetY(x) { s(x), g(); }, get targetPosition() { return a(); }, set targetPosition(x) { a(x), g(); }, get label() { return l(); }, set label(x) { l(x), g(); }, get labelStyle() { return u(); }, set labelStyle(x) { u(x), g(); }, get markerStart() { return d(); }, set markerStart(x) { d(x), g(); }, get markerEnd() { return p(); }, set markerEnd(x) { p(x), g(); }, get interactionWidth() { return f(); }, set interactionWidth(x) { f(x), g(); }, get style() { return h(); }, set style(x) { h(x), g(); } }; return Mo(e3, { get path() { return c(m); }, get labelX() { return c(b); }, get labelY() { return c($); }, get label() { return l(); }, get labelStyle() { return u(); }, get markerStart() { return d(); }, get markerEnd() { return p(); }, get interactionWidth() { return f(); }, get style() { return h(); } }), ue(_); } se( Bc, { sourceX: {}, sourceY: {}, sourcePosition: {}, targetX: {}, targetY: {}, targetPosition: {}, label: {}, labelStyle: {}, markerStart: {}, markerEnd: {}, interactionWidth: {}, style: {} }, [], [], true ); var B0 = class { #e; #t; /** * * @param {() => T} fn * @param {(update: () => void) => void} onsubscribe */ constructor(t, n) { this.#e = t, this.#t = Jl(n); } get current() { return this.#t(), this.#e(); } }; var W0 = /\(.+\)/; var Y0 = /* @__PURE__ */ new Set(["all", "print", "screen", "and", "or", "not", "only"]); var F0 = class extends B0 { /** * @param {string} query A media query string * @param {boolean} [fallback] Fallback value for the server */ constructor(t, n) { let r = W0.test(t) || // we need to use `some` here because technically this `window.matchMedia('random,screen')` still returns true t.split(/[\s,]+/).some((i) => Y0.has(i.trim())) ? t : `(${t})`; const o = window.matchMedia(r); super( () => o.matches, (i) => ps(o, "change", i) ); } }; function q0(e3, t, n, r) { const o = /* @__PURE__ */ new Map(); return ia(e3, { x: 0, y: 0, width: n, height: r }, t, true).forEach((i) => { o.set(i.id, i); }), o; } function gl(e3) { const { edges: t, defaultEdgeOptions: n, nodeLookup: r, previousEdges: o, connectionMode: i, onerror: s, onlyRenderVisible: a, elevateEdgesOnSelect: l } = e3, u = /* @__PURE__ */ new Map(); for (const d of t) { const p = r.get(d.source), f = r.get(d.target); if (!p || !f) continue; if (a) { const { visibleNodes: w, transform: m, width: b, height: $ } = e3; if (Gv({ sourceNode: p, targetNode: f, width: b, height: $, transform: m })) w.set(p.id, p), w.set(f.id, f); else continue; } const h = o.get(d.id); if (h && d === h.edge && p == h.sourceNode && f == h.targetNode) { u.set(d.id, h); continue; } const y = r0({ id: d.id, sourceNode: p, targetNode: f, sourceHandle: d.sourceHandle || null, targetHandle: d.targetHandle || null, connectionMode: i, onError: s }); y && u.set(d.id, { ...n, ...d, ...y, zIndex: Xv({ selected: d.selected, zIndex: d.zIndex ?? n.zIndex, sourceNode: p, targetNode: f, elevateOnSelect: l }), sourceNode: p, targetNode: f, edge: d }); } return u; } var Wc = { input: zc, output: Ac, default: da, group: Hc }; var Yc = { straight: Rc, smoothstep: Kc, default: fa, step: Bc }; function X0(e3, t, n, r, o, i) { if (t && !n && r && o) { const s = Eo(i, { filter: (a) => !!((a.width || a.initialWidth) && (a.height || a.initialHeight)) }); return sa(s, r, o, 0.5, 2, 0.1); } else return n ?? { x: 0, y: 0, zoom: 1 }; } function G0(e3) { class t { #e = E(() => e3.props.id ?? "1"); get flowId() { return c(this.#e); } set flowId(r) { Q(this.#e, r); } #t = Ee(null); get domNode() { return c(this.#t); } set domNode(r) { Q(this.#t, r); } #n = Ee(null); get panZoom() { return c(this.#n); } set panZoom(r) { Q(this.#n, r); } #r = Ee(e3.width ?? 0); get width() { return c(this.#r); } set width(r) { Q(this.#r, r); } #l = Ee(e3.height ?? 0); get height() { return c(this.#l); } set height(r) { Q(this.#l, r); } #a = E(() => { const r = c0(e3.nodes, this.nodeLookup, this.parentLookup, { nodeExtent: this.nodeExtent, nodeOrigin: this.nodeOrigin, elevateNodesOnSelect: e3.props.elevateNodesOnSelect ?? true, checkEquality: true }); return this.fitViewQueued && r && (this.fitViewOptions?.duration ? this.resolveFitView() : queueMicrotask(() => { this.resolveFitView(); })), r; }); get nodesInitialized() { return c(this.#a); } set nodesInitialized(r) { Q(this.#a, r); } #o = E(() => this.panZoom !== null); get viewportInitialized() { return c(this.#o); } set viewportInitialized(r) { Q(this.#o, r); } #i = E(() => (v0(this.connectionLookup, this.edgeLookup, e3.edges), e3.edges)); get _edges() { return c(this.#i); } set _edges(r) { Q(this.#i, r); } get nodes() { return this.nodesInitialized, e3.nodes; } set nodes(r) { e3.nodes = r; } get edges() { return this._edges; } set edges(r) { e3.edges = r; } _prevSelectedNodes = []; _prevSelectedNodeIds = /* @__PURE__ */ new Set(); #s = E(() => { const r = this._prevSelectedNodeIds.size, o = /* @__PURE__ */ new Set(), i = this.nodes.filter((s) => (s.selected && (o.add(s.id), this._prevSelectedNodeIds.delete(s.id)), s.selected)); return (r !== o.size || this._prevSelectedNodeIds.size > 0) && (this._prevSelectedNodes = i), this._prevSelectedNodeIds = o, this._prevSelectedNodes; }); get selectedNodes() { return c(this.#s); } set selectedNodes(r) { Q(this.#s, r); } _prevSelectedEdges = []; _prevSelectedEdgeIds = /* @__PURE__ */ new Set(); #u = E(() => { const r = this._prevSelectedEdgeIds.size, o = /* @__PURE__ */ new Set(), i = this.edges.filter((s) => (s.selected && (o.add(s.id), this._prevSelectedEdgeIds.delete(s.id)), s.selected)); return (r !== o.size || this._prevSelectedEdgeIds.size > 0) && (this._prevSelectedEdges = i), this._prevSelectedEdgeIds = o, this._prevSelectedEdges; }); get selectedEdges() { return c(this.#u); } set selectedEdges(r) { Q(this.#u, r); } selectionChangeHandlers = /* @__PURE__ */ new Map(); nodeLookup = /* @__PURE__ */ new Map(); parentLookup = /* @__PURE__ */ new Map(); connectionLookup = /* @__PURE__ */ new Map(); edgeLookup = /* @__PURE__ */ new Map(); _prevVisibleEdges = /* @__PURE__ */ new Map(); #c = E(() => { const { // We need to access this._nodes to trigger on changes // eslint-disable-next-line @typescript-eslint/no-unused-vars nodes: r, _edges: o, _prevVisibleEdges: i, nodeLookup: s, connectionMode: a, onerror: l, onlyRenderVisibleElements: u, defaultEdgeOptions: d } = this; let p, f; const h = { edges: o, defaultEdgeOptions: d, previousEdges: i, nodeLookup: s, connectionMode: a, elevateEdgesOnSelect: e3.props.elevateEdgesOnSelect ?? true, onerror: l }; if (u) { const { viewport: y, width: w, height: m } = this, b = [y.x, y.y, y.zoom]; p = q0(s, b, w, m), f = gl({ ...h, onlyRenderVisible: true, visibleNodes: p, transform: b, width: w, height: m }); } else p = this.nodeLookup, f = gl(h); return { nodes: p, edges: f }; }); get visible() { return c(this.#c); } set visible(r) { Q(this.#c, r); } #d = E(() => e3.props.nodesDraggable ?? true); get nodesDraggable() { return c(this.#d); } set nodesDraggable(r) { Q(this.#d, r); } #f = E(() => e3.props.nodesConnectable ?? true); get nodesConnectable() { return c(this.#f); } set nodesConnectable(r) { Q(this.#f, r); } #h = E(() => e3.props.elementsSelectable ?? true); get elementsSelectable() { return c(this.#h); } set elementsSelectable(r) { Q(this.#h, r); } #p = E(() => e3.props.nodesFocusable ?? true); get nodesFocusable() { return c(this.#p); } set nodesFocusable(r) { Q(this.#p, r); } #w = E(() => e3.props.edgesFocusable ?? true); get edgesFocusable() { return c(this.#w); } set edgesFocusable(r) { Q(this.#w, r); } #b = E(() => e3.props.disableKeyboardA11y ?? false); get disableKeyboardA11y() { return c(this.#b); } set disableKeyboardA11y(r) { Q(this.#b, r); } #x = E(() => e3.props.minZoom ?? 0.5); get minZoom() { return c(this.#x); } set minZoom(r) { Q(this.#x, r); } #m = E(() => e3.props.maxZoom ?? 2); get maxZoom() { return c(this.#m); } set maxZoom(r) { Q(this.#m, r); } #g = E(() => e3.props.nodeOrigin ?? [0, 0]); get nodeOrigin() { return c(this.#g); } set nodeOrigin(r) { Q(this.#g, r); } #v = E(() => e3.props.nodeExtent ?? $s); get nodeExtent() { return c(this.#v); } set nodeExtent(r) { Q(this.#v, r); } #y = E(() => e3.props.translateExtent ?? $s); get translateExtent() { return c(this.#y); } set translateExtent(r) { Q(this.#y, r); } #C = E(() => e3.props.defaultEdgeOptions ?? {}); get defaultEdgeOptions() { return c(this.#C); } set defaultEdgeOptions(r) { Q(this.#C, r); } #$ = E(() => e3.props.nodeDragThreshold ?? 1); get nodeDragThreshold() { return c(this.#$); } set nodeDragThreshold(r) { Q(this.#$, r); } #_ = E(() => e3.props.autoPanOnNodeDrag ?? true); get autoPanOnNodeDrag() { return c(this.#_); } set autoPanOnNodeDrag(r) { Q(this.#_, r); } #k = E(() => e3.props.autoPanOnConnect ?? true); get autoPanOnConnect() { return c(this.#k); } set autoPanOnConnect(r) { Q(this.#k, r); } #S = E(() => e3.props.autoPanOnNodeFocus ?? true); get autoPanOnNodeFocus() { return c(this.#S); } set autoPanOnNodeFocus(r) { Q(this.#S, r); } #E = E(() => e3.props.autoPanSpeed ?? 15); get autoPanSpeed() { return c(this.#E); } set autoPanSpeed(r) { Q(this.#E, r); } #P = E(() => e3.props.connectionDragThreshold ?? 1); get connectionDragThreshold() { return c(this.#P); } set connectionDragThreshold(r) { Q(this.#P, r); } fitViewQueued = e3.props.fitView ?? false; fitViewOptions = e3.props.fitViewOptions; fitViewResolver = null; #N = E(() => e3.props.snapGrid ?? null); get snapGrid() { return c(this.#N); } set snapGrid(r) { Q(this.#N, r); } #M = Ee(false); get dragging() { return c(this.#M); } set dragging(r) { Q(this.#M, r); } #T = Ee(null); get selectionRect() { return c(this.#T); } set selectionRect(r) { Q(this.#T, r); } #L = Ee(false); get selectionKeyPressed() { return c(this.#L); } set selectionKeyPressed(r) { Q(this.#L, r); } #V = Ee(false); get multiselectionKeyPressed() { return c(this.#V); } set multiselectionKeyPressed(r) { Q(this.#V, r); } #D = Ee(false); get deleteKeyPressed() { return c(this.#D); } set deleteKeyPressed(r) { Q(this.#D, r); } #O = Ee(false); get panActivationKeyPressed() { return c(this.#O); } set panActivationKeyPressed(r) { Q(this.#O, r); } #z = Ee(false); get zoomActivationKeyPressed() { return c(this.#z); } set zoomActivationKeyPressed(r) { Q(this.#z, r); } #A = Ee(null); get selectionRectMode() { return c(this.#A); } set selectionRectMode(r) { Q(this.#A, r); } #H = Ee(""); get ariaLiveMessage() { return c(this.#H); } set ariaLiveMessage(r) { Q(this.#H, r); } #I = E(() => e3.props.selectionMode ?? pi.Partial); get selectionMode() { return c(this.#I); } set selectionMode(r) { Q(this.#I, r); } #Z = E(() => ({ ...Wc, ...e3.props.nodeTypes })); get nodeTypes() { return c(this.#Z); } set nodeTypes(r) { Q(this.#Z, r); } #j = E(() => ({ ...Yc, ...e3.props.edgeTypes })); get edgeTypes() { return c(this.#j); } set edgeTypes(r) { Q(this.#j, r); } #K = E(() => e3.props.noPanClass ?? "nopan"); get noPanClass() { return c(this.#K); } set noPanClass(r) { Q(this.#K, r); } #R = E(() => e3.props.noDragClass ?? "nodrag"); get noDragClass() { return c(this.#R); } set noDragClass(r) { Q(this.#R, r); } #B = E(() => e3.props.noWheelClass ?? "nowheel"); get noWheelClass() { return c(this.#B); } set noWheelClass(r) { Q(this.#B, r); } #W = E(() => Yv(e3.props.ariaLabelConfig)); get ariaLabelConfig() { return c(this.#W); } set ariaLabelConfig(r) { Q(this.#W, r); } #Y = Ee(X0(this.nodesInitialized, e3.props.fitView, e3.props.initialViewport, this.width, this.height, this.nodeLookup)); get _viewport() { return c(this.#Y); } set _viewport(r) { Q(this.#Y, r); } get viewport() { return e3.viewport ?? this._viewport; } set viewport(r) { e3.viewport && (e3.viewport = r), this._viewport = r; } #F = Ee( // _connection is viewport independent and originating from XYHandle _s ); get _connection() { return c(this.#F); } set _connection(r) { Q(this.#F, r); } #q = E(() => this._connection.inProgress ? { ...this._connection, to: No(this._connection.to, [this.viewport.x, this.viewport.y, this.viewport.zoom]) } : this._connection); get connection() { return c(this.#q); } set connection(r) { Q(this.#q, r); } #X = E(() => e3.props.connectionMode ?? zr.Strict); get connectionMode() { return c(this.#X); } set connectionMode(r) { Q(this.#X, r); } #G = E(() => e3.props.connectionRadius ?? 20); get connectionRadius() { return c(this.#G); } set connectionRadius(r) { Q(this.#G, r); } #U = E(() => e3.props.isValidConnection ?? (() => true)); get isValidConnection() { return c(this.#U); } set isValidConnection(r) { Q(this.#U, r); } #Q = E(() => e3.props.selectNodesOnDrag ?? true); get selectNodesOnDrag() { return c(this.#Q); } set selectNodesOnDrag(r) { Q(this.#Q, r); } #J = E(() => e3.props.defaultMarkerColor === void 0 ? "#b1b1b7" : e3.props.defaultMarkerColor); get defaultMarkerColor() { return c(this.#J); } set defaultMarkerColor(r) { Q(this.#J, r); } #ee = E(() => o0(e3.edges, { defaultColor: this.defaultMarkerColor, id: this.flowId, defaultMarkerStart: this.defaultEdgeOptions.markerStart, defaultMarkerEnd: this.defaultEdgeOptions.markerEnd })); get markers() { return c(this.#ee); } set markers(r) { Q(this.#ee, r); } #te = E(() => e3.props.onlyRenderVisibleElements ?? false); get onlyRenderVisibleElements() { return c(this.#te); } set onlyRenderVisibleElements(r) { Q(this.#te, r); } #ne = E(() => e3.props.onflowerror ?? Kv); get onerror() { return c(this.#ne); } set onerror(r) { Q(this.#ne, r); } #re = E(() => e3.props.ondelete); get ondelete() { return c(this.#re); } set ondelete(r) { Q(this.#re, r); } #oe = E(() => e3.props.onbeforedelete); get onbeforedelete() { return c(this.#oe); } set onbeforedelete(r) { Q(this.#oe, r); } #ie = E(() => e3.props.onbeforeconnect); get onbeforeconnect() { return c(this.#ie); } set onbeforeconnect(r) { Q(this.#ie, r); } #se = E(() => e3.props.onconnect); get onconnect() { return c(this.#se); } set onconnect(r) { Q(this.#se, r); } #ae = E(() => e3.props.onconnectstart); get onconnectstart() { return c(this.#ae); } set onconnectstart(r) { Q(this.#ae, r); } #le = E(() => e3.props.onconnectend); get onconnectend() { return c(this.#le); } set onconnectend(r) { Q(this.#le, r); } #ue = E(() => e3.props.onbeforereconnect); get onbeforereconnect() { return c(this.#ue); } set onbeforereconnect(r) { Q(this.#ue, r); } #ce = E(() => e3.props.onreconnect); get onreconnect() { return c(this.#ce); } set onreconnect(r) { Q(this.#ce, r); } #de = E(() => e3.props.onreconnectstart); get onreconnectstart() { return c(this.#de); } set onreconnectstart(r) { Q(this.#de, r); } #fe = E(() => e3.props.onreconnectend); get onreconnectend() { return c(this.#fe); } set onreconnectend(r) { Q(this.#fe, r); } #pe = E(() => e3.props.clickConnect ?? true); get clickConnect() { return c(this.#pe); } set clickConnect(r) { Q(this.#pe, r); } #he = E(() => e3.props.onclickconnectstart); get onclickconnectstart() { return c(this.#he); } set onclickconnectstart(r) { Q(this.#he, r); } #ge = E(() => e3.props.onclickconnectend); get onclickconnectend() { return c(this.#ge); } set onclickconnectend(r) { Q(this.#ge, r); } #ve = Ee(null); get clickConnectStartHandle() { return c(this.#ve); } set clickConnectStartHandle(r) { Q(this.#ve, r); } #me = E(() => e3.props.onselectiondrag); get onselectiondrag() { return c(this.#me); } set onselectiondrag(r) { Q(this.#me, r); } #ye = E(() => e3.props.onselectiondragstart); get onselectiondragstart() { return c(this.#ye); } set onselectiondragstart(r) { Q(this.#ye, r); } #we = E(() => e3.props.onselectiondragstop); get onselectiondragstop() { return c(this.#we); } set onselectiondragstop(r) { Q(this.#we, r); } resolveFitView = async () => { this.panZoom && (await Zv( { nodes: this.nodeLookup, width: this.width, height: this.height, panZoom: this.panZoom, minZoom: this.minZoom, maxZoom: this.maxZoom }, this.fitViewOptions ), this.fitViewResolver?.resolve(true), this.fitViewQueued = false, this.fitViewOptions = void 0, this.fitViewResolver = null); }; _prefersDark = new F0("(prefers-color-scheme: dark)", e3.props.colorModeSSR === "dark"); #be = E(() => e3.props.colorMode === "system" ? this._prefersDark.current ? "dark" : "light" : e3.props.colorMode ?? "light"); get colorMode() { return c(this.#be); } set colorMode(r) { Q(this.#be, r); } constructor() { } resetStoreValues() { this.dragging = false, this.selectionRect = null, this.selectionRectMode = null, this.selectionKeyPressed = false, this.multiselectionKeyPressed = false, this.deleteKeyPressed = false, this.panActivationKeyPressed = false, this.zoomActivationKeyPressed = false, this._connection = _s, this.clickConnectStartHandle = null, this.viewport = e3.props.initialViewport ?? { x: 0, y: 0, zoom: 1 }, this.ariaLiveMessage = ""; } } return new t(); } function rn() { const e3 = Fn(mi); if (!e3) throw new Error("To call useStore outside of you need to wrap your component in a "); return e3.getStore(); } var mi = Symbol(); function Fc(e3) { const t = G0(e3); function n(H) { t.nodeTypes = { ...Wc, ...H }; } function r(H) { t.edgeTypes = { ...Yc, ...H }; } function o(H) { t.edges = Jv(H, t.edges); } const i = (H, z = false) => { t.nodes = t.nodes.map((S) => { const T = H.get(S.id); return T ? { ...S, position: T.position, dragging: z } : S; }); }; function s(H) { const { changes: z, updatedInternals: S } = h0(H, t.nodeLookup, t.parentLookup, t.domNode, t.nodeOrigin); if (!S) return; l0(t.nodeLookup, t.parentLookup, { nodeOrigin: t.nodeOrigin, nodeExtent: t.nodeExtent }), t.fitViewQueued && t.resolveFitView(); const T = /* @__PURE__ */ new Map(); for (const C of z) { const P = t.nodeLookup.get(C.id)?.internals.userNode; if (!P) continue; const M = { ...P }; switch (C.type) { case "dimensions": { const K = { ...M.measured, ...C.dimensions }; C.setAttributes && (M.width = C.dimensions?.width ?? M.width, M.height = C.dimensions?.height ?? M.height), M.measured = K; break; } case "position": M.position = C.position ?? M.position; break; } T.set(C.id, M); } t.nodes = t.nodes.map((C) => T.get(C.id) ?? C); } function a(H) { const z = t.fitViewResolver ?? Promise.withResolvers(); return t.fitViewQueued = true, t.fitViewOptions = H, t.fitViewResolver = z, t.nodes = [...t.nodes], z.promise; } async function l(H, z, S) { const T = typeof S?.zoom < "u" ? S.zoom : t.maxZoom, C = t.panZoom; return C ? (await C.setViewport({ x: t.width / 2 - H * T, y: t.height / 2 - z * T, zoom: T }, { duration: S?.duration, ease: S?.ease, interpolate: S?.interpolate }), Promise.resolve(true)) : Promise.resolve(false); } function u(H, z) { const S = t.panZoom; return S ? S.scaleBy(H, z) : Promise.resolve(false); } function d(H) { return u(1.2, H); } function p(H) { return u(1 / 1.2, H); } function f(H) { const z = t.panZoom; z && (z.setScaleExtent([H, t.maxZoom]), t.minZoom = H); } function h(H) { const z = t.panZoom; z && (z.setScaleExtent([t.minZoom, H]), t.maxZoom = H); } function y(H) { const z = t.panZoom; z && (z.setTranslateExtent(H), t.translateExtent = H); } function w(H, z = null) { let S = false; const T = H.map((C) => (!z || z.has(C.id)) && C.selected ? (S = true, { ...C, selected: false }) : C); return [S, T]; } function m(H) { const z = H?.nodes ? new Set(H.nodes.map((K) => K.id)) : null, [S, T] = w(t.nodes, z); S && (t.nodes = T); const C = H?.edges ? new Set(H.edges.map((K) => K.id)) : null, [P, M] = w(t.edges, C); P && (t.edges = M); } function b(H) { const z = t.multiselectionKeyPressed; t.nodes = t.nodes.map((S) => { const T = H.includes(S.id), C = z && S.selected || T; return !!S.selected !== C ? { ...S, selected: C } : S; }), z || m({ nodes: [] }); } function $(H) { const z = t.multiselectionKeyPressed; t.edges = t.edges.map((S) => { const T = H.includes(S.id), C = z && S.selected || T; return !!S.selected !== C ? { ...S, selected: C } : S; }), z || m({ edges: [] }); } function _(H, z, S) { const T = t.nodeLookup.get(H); if (!T) { console.warn("012", uo.error012(H)); return; } t.selectionRect = null, t.selectionRectMode = null, T.selected ? (z || T.selected && t.multiselectionKeyPressed) && (m({ nodes: [T], edges: [] }), requestAnimationFrame(() => S?.blur())) : b([H]); } function x(H) { const z = t.edgeLookup.get(H); if (!z) { console.warn("012", uo.error012(H)); return; } (z.selectable || t.elementsSelectable && typeof z.selectable > "u") && (t.selectionRect = null, t.selectionRectMode = null, z.selected ? z.selected && t.multiselectionKeyPressed && m({ nodes: [], edges: [z] }) : $([H])); } function k(H, z) { const { nodeExtent: S, snapGrid: T, nodeOrigin: C, nodeLookup: P, nodesDraggable: M, onerror: K } = t, B = /* @__PURE__ */ new Map(), W = T?.[0] ?? 5, D = T?.[1] ?? 5, X = H.x * W * z, q = H.y * D * z; for (const U of P.values()) { if (!(U.selected && (U.draggable || M && typeof U.draggable > "u"))) continue; let I = { x: U.internals.positionAbsolute.x + X, y: U.internals.positionAbsolute.y + q }; T && (I = Po(I, T)); const { position: F, positionAbsolute: G } = gc({ nodeId: U.id, nextPosition: I, nodeLookup: P, nodeExtent: S, nodeOrigin: C, onError: K }); U.position = F, U.internals.positionAbsolute = G, B.set(U.id, U); } i(B); } function N(H) { return g0({ delta: H, panZoom: t.panZoom, transform: [t.viewport.x, t.viewport.y, t.viewport.zoom], translateExtent: t.translateExtent, width: t.width, height: t.height }); } const V = (H) => { t._connection = { ...H }; }; function j() { t._connection = _s; } function A() { t.resetStoreValues(), m(); } return Object.assign(t, { setNodeTypes: n, setEdgeTypes: r, addEdge: o, updateNodePositions: i, updateNodeInternals: s, zoomIn: d, zoomOut: p, fitView: a, setCenter: l, setMinZoom: f, setMaxZoom: h, setTranslateExtent: y, unselectNodesAndEdges: m, addSelectedNodes: b, addSelectedEdges: $, handleNodeSelection: _, handleEdgeSelection: x, moveSelectedNodes: k, panBy: N, updateConnection: V, cancelConnection: j, reset: A }); } function U0(e3, t) { const { minZoom: n, maxZoom: r, initialViewport: o, onPanZoomStart: i, onPanZoom: s, onPanZoomEnd: a, translateExtent: l, setPanZoomInstance: u, onDraggingChange: d, onTransformChange: p } = t, f = D0({ domNode: e3, minZoom: n, maxZoom: r, translateExtent: l, viewport: o, onPanZoom: s, onPanZoomStart: i, onPanZoomEnd: a, onDraggingChange: d }), h = f.getViewport(); return (o.x !== h.x || o.y !== h.y || o.zoom !== h.zoom) && p([h.x, h.y, h.zoom]), u(f), f.update(t), { update(y) { f.update(y); } }; } var Q0 = ee('
'); function qc(e3, t) { le(t, true); let n = v(t, "store", 15), r = v(t, "panOnScrollMode", 7), o = v(t, "preventScrolling", 7), i = v(t, "zoomOnScroll", 7), s = v(t, "zoomOnDoubleClick", 7), a = v(t, "zoomOnPinch", 7), l = v(t, "panOnDrag", 7), u = v(t, "panOnScroll", 7), d = v(t, "panOnScrollSpeed", 7), p = v(t, "paneClickDistance", 7), f = v(t, "selectionOnDrag", 7), h = v(t, "onmovestart", 7), y = v(t, "onmove", 7), w = v(t, "onmoveend", 7), m = v(t, "oninit", 7), b = v(t, "children", 7), $ = E(() => n().panActivationKeyPressed || l()), _ = E(() => n().panActivationKeyPressed || u()); const { viewport: x } = n(); let k = false; qe(() => { !k && n().viewportInitialized && (m()?.(), k = true); }); var N = { get store() { return n(); }, set store(A) { n(A), g(); }, get panOnScrollMode() { return r(); }, set panOnScrollMode(A) { r(A), g(); }, get preventScrolling() { return o(); }, set preventScrolling(A) { o(A), g(); }, get zoomOnScroll() { return i(); }, set zoomOnScroll(A) { i(A), g(); }, get zoomOnDoubleClick() { return s(); }, set zoomOnDoubleClick(A) { s(A), g(); }, get zoomOnPinch() { return a(); }, set zoomOnPinch(A) { a(A), g(); }, get panOnDrag() { return l(); }, set panOnDrag(A) { l(A), g(); }, get panOnScroll() { return u(); }, set panOnScroll(A) { u(A), g(); }, get panOnScrollSpeed() { return d(); }, set panOnScrollSpeed(A) { d(A), g(); }, get paneClickDistance() { return p(); }, set paneClickDistance(A) { p(A), g(); }, get selectionOnDrag() { return f(); }, set selectionOnDrag(A) { f(A), g(); }, get onmovestart() { return h(); }, set onmovestart(A) { h(A), g(); }, get onmove() { return y(); }, set onmove(A) { y(A), g(); }, get onmoveend() { return w(); }, set onmoveend(A) { w(A), g(); }, get oninit() { return m(); }, set oninit(A) { m(A), g(); }, get children() { return b(); }, set children(A) { b(A), g(); } }, V = Q0(), j = R(V); return Ge(j, b), Z(V), pt(V, (A, H) => U0?.(A, H), () => ({ viewport: n().viewport, minZoom: n().minZoom, maxZoom: n().maxZoom, initialViewport: x, onDraggingChange: (A) => { n(n().dragging = A, true); }, setPanZoomInstance: (A) => { n(n().panZoom = A, true); }, onPanZoomStart: h(), onPanZoom: y(), onPanZoomEnd: w(), zoomOnScroll: i(), zoomOnDoubleClick: s(), zoomOnPinch: a(), panOnScroll: c(_), panOnDrag: c($), panOnScrollSpeed: d(), panOnScrollMode: r(), zoomActivationKeyPressed: n().zoomActivationKeyPressed, preventScrolling: typeof o() == "boolean" ? o() : true, noPanClassName: n().noPanClass, noWheelClassName: n().noWheelClass, userSelectionActive: !!n().selectionRect, translateExtent: n().translateExtent, lib: "svelte", paneClickDistance: p(), selectionOnDrag: f(), onTransformChange: (A) => { n(n().viewport = { x: A[0], y: A[1], zoom: A[2] }, true); }, connectionInProgress: n().connection.inProgress })), L(e3, V), ue(N); } se( qc, { store: {}, panOnScrollMode: {}, preventScrolling: {}, zoomOnScroll: {}, zoomOnDoubleClick: {}, zoomOnPinch: {}, panOnDrag: {}, panOnScroll: {}, panOnScrollSpeed: {}, paneClickDistance: {}, selectionOnDrag: {}, onmovestart: {}, onmove: {}, onmoveend: {}, oninit: {}, children: {} }, [], [], true ); function vl(e3, t) { return (n) => { n.target === t && e3?.(n); }; } function ml(e3) { return (t) => { const n = e3.has(t.id); return !!t.selected !== n ? { ...t, selected: n } : t; }; } function yl(e3, t) { if (e3.size !== t.size) return false; for (const n of e3) if (!t.has(n)) return false; return true; } var J0 = ee("
"); function Xc(e3, t) { le(t, true); let n = v(t, "store", 15), r = v(t, "panOnDrag", 7, true), o = v(t, "paneClickDistance", 7, 1), i = v(t, "selectionOnDrag", 7), s = v(t, "onpaneclick", 7), a = v(t, "onpanecontextmenu", 7), l = v(t, "onselectionstart", 7), u = v(t, "onselectionend", 7), d = v(t, "children", 7), p, f = null, h = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Set(), w = E(() => n().panActivationKeyPressed || r()), m = E(() => n().selectionKeyPressed || !!n().selectionRect || i() && c(w) !== true), b = E(() => n().elementsSelectable && (c(m) || n().selectionRectMode === "user")), $ = false; function _(P) { if (f = p?.getBoundingClientRect(), !f) return; const M = P.target === p, K = !M && !!P.target.closest(".nokey"), B = i() && M || n().selectionKeyPressed; if (K || !c(m) || !B || P.button !== 0 || !P.isPrimary) return; P.target?.setPointerCapture?.(P.pointerId), $ = false; const { x: W, y: D } = Ut(P, f); n(n().selectionRect = { width: 0, height: 0, startX: W, startY: D, x: W, y: D }, true), M || (P.stopPropagation(), P.preventDefault()); } function x(P) { if (!c(m) || !f || !n().selectionRect) return; const M = Ut(P, f), { startX: K = 0, startY: B = 0 } = n().selectionRect; if (!$) { const U = n().selectionKeyPressed ? 0 : o(); if (Math.hypot(M.x - K, M.y - B) <= U) return; n().unselectNodesAndEdges(), l()?.(P); } $ = true; const W = { ...n().selectionRect, x: M.x < K ? M.x : K, y: M.y < B ? M.y : B, width: Math.abs(M.x - K), height: Math.abs(M.y - B) }, D = h, X = y; h = new Set(ia( n().nodeLookup, W, [ n().viewport.x, n().viewport.y, n().viewport.zoom ], n().selectionMode === pi.Partial, true ).map((U) => U.id)); const q = n().defaultEdgeOptions.selectable ?? true; y = /* @__PURE__ */ new Set(); for (const U of h) { const I = n().connectionLookup.get(U); if (I) for (const { edgeId: F } of I.values()) { const G = n().edgeLookup.get(F); G && (G.selectable ?? q) && y.add(F); } } yl(D, h) || n(n().nodes = n().nodes.map(ml(h)), true), yl(X, y) || n(n().edges = n().edges.map(ml(y)), true), n(n().selectionRectMode = "user", true), n(n().selectionRect = W, true); } function k(P) { P.button === 0 && (P.target?.releasePointerCapture?.(P.pointerId), !$ && P.target === p && j?.(P), n(n().selectionRect = null, true), $ && n(n().selectionRectMode = h.size > 0 ? "nodes" : null, true), $ && u()?.(P)); } const N = (P) => { if (Array.isArray(c(w)) && c(w).includes(2)) { P.preventDefault(); return; } a()?.({ event: P }); }, V = (P) => { $ && (P.stopPropagation(), $ = false); }; function j(P) { if ($ || n().connection.inProgress) { $ = false; return; } s()?.({ event: P }), n().unselectNodesAndEdges(), n(n().selectionRectMode = null, true), n(n().selectionRect = null, true); } var A = { get store() { return n(); }, set store(P) { n(P), g(); }, get panOnDrag() { return r(); }, set panOnDrag(P = true) { r(P), g(); }, get paneClickDistance() { return o(); }, set paneClickDistance(P = 1) { o(P), g(); }, get selectionOnDrag() { return i(); }, set selectionOnDrag(P) { i(P), g(); }, get onpaneclick() { return s(); }, set onpaneclick(P) { s(P), g(); }, get onpanecontextmenu() { return a(); }, set onpanecontextmenu(P) { a(P), g(); }, get onselectionstart() { return l(); }, set onselectionstart(P) { l(P), g(); }, get onselectionend() { return u(); }, set onselectionend(P) { u(P), g(); }, get children() { return d(); }, set children(P) { d(P), g(); } }, H = J0(); let z; var S = E(() => c(b) ? void 0 : vl(j, p)); H.__click = function(...P) { c(S)?.apply(this, P); }, H.__pointermove = function(...P) { (c(b) ? x : void 0)?.apply(this, P); }, H.__pointerup = function(...P) { (c(b) ? k : void 0)?.apply(this, P); }; var T = E(() => vl(N, p)); H.__contextmenu = function(...P) { c(T)?.apply(this, P); }; var C = R(H); return Ge(C, d), Z(H), Nt(H, (P) => p = P, () => p), $e((P) => z = Pt(H, 1, "svelte-flow__pane svelte-flow__container", null, z, P), [ () => ({ draggable: r() === true || Array.isArray(r()) && r().includes(0), dragging: n().dragging, selection: c(m) }) ]), ii( "pointerdown", H, function(...P) { (c(b) ? _ : void 0)?.apply(this, P); }, true ), ii( "click", H, function(...P) { (c(b) ? V : void 0)?.apply(this, P); }, true ), L(e3, H), ue(A); } er(["click", "pointermove", "pointerup", "contextmenu"]); se( Xc, { store: {}, panOnDrag: {}, paneClickDistance: {}, selectionOnDrag: {}, onpaneclick: {}, onpanecontextmenu: {}, onselectionstart: {}, onselectionend: {}, children: {} }, [], [], true ); var em = ee('
'); function Gc(e3, t) { le(t, true); let n = v(t, "store", 15), r = v(t, "children", 7); var o = { get store() { return n(); }, set store(l) { n(l), g(); }, get children() { return r(); }, set children(l) { r(l), g(); } }, i = em(); let s; var a = R(i); return Ge(a, r), Z(i), $e(() => s = dt(i, "", s, { transform: `translate(${n().viewport.x ?? ""}px, ${n().viewport.y ?? ""}px) scale(${n().viewport.zoom ?? ""})` })), L(e3, i), ue(o); } se(Gc, { store: {}, children: {} }, [], [], true); function Uc(e3, t) { const { store: n, onDrag: r, onDragStart: o, onDragStop: i, onNodeMouseDown: s } = t, a = b0({ onDrag: r, onDragStart: o, onDragStop: i, onNodeMouseDown: s, getStoreItems: () => { const { snapGrid: u, viewport: d } = n; return { nodes: n.nodes, nodeLookup: n.nodeLookup, edges: n.edges, nodeExtent: n.nodeExtent, snapGrid: u || [0, 0], snapToGrid: !!u, nodeOrigin: n.nodeOrigin, multiSelectionActive: n.multiselectionKeyPressed, domNode: n.domNode, transform: [d.x, d.y, d.zoom], autoPanOnNodeDrag: n.autoPanOnNodeDrag, nodesDraggable: n.nodesDraggable, selectNodesOnDrag: n.selectNodesOnDrag, nodeDragThreshold: n.nodeDragThreshold, unselectNodesAndEdges: n.unselectNodesAndEdges, updateNodePositions: n.updateNodePositions, onSelectionDrag: n.onselectiondrag, onSelectionDragStart: n.onselectiondragstart, onSelectionDragStop: n.onselectiondragstop, panBy: n.panBy }; } }); function l(u, d) { if (d.disabled) { a.destroy(); return; } a.update({ domNode: u, noDragClassName: d.noDragClass, handleSelector: d.handleSelector, nodeId: d.nodeId, isSelectable: d.isSelectable, nodeClickDistance: d.nodeClickDistance }); } return l(e3, t), { update(u) { l(e3, u); }, destroy() { a.destroy(); } }; } var tm = ee('
'); var nm = ee('
', 1); var rm = { 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%);}" }; function Qc(e3, t) { le(t, true), He(e3, rm); let n = v(t, "store", 7); var r = { get store() { return n(); }, set store(p) { n(p), g(); } }, o = nm(), i = oe(o), s = R(i, true); Z(i); var a = O(i, 2), l = R(a, true); Z(a); var u = O(a, 2); { var d = (p) => { var f = tm(), h = R(f, true); Z(f), $e(() => { xe(f, "id", `${om}-${n().flowId}`), Re(h, n().ariaLiveMessage); }), L(p, f); }; ae(u, (p) => { n().disableKeyboardA11y || p(d); }); } return $e(() => { xe(i, "id", `${Jc}-${n().flowId}`), Re(s, n().disableKeyboardA11y ? n().ariaLabelConfig["node.a11yDescription.default"] : n().ariaLabelConfig["node.a11yDescription.keyboardDisabled"]), xe(a, "id", `${ed}-${n().flowId}`), Re(l, n().ariaLabelConfig["edge.a11yDescription.default"]); }), L(e3, o), ue(r); } se(Qc, { store: {} }, [], [], true); var Jc = "svelte-flow__node-desc"; var ed = "svelte-flow__edge-desc"; var om = "svelte-flow__aria-live"; var im = ee("
"); function td(e3, t) { le(t, true); let n = v(t, "store", 15), r = v(t, "node", 7), o = v(t, "resizeObserver", 7), i = v(t, "nodeClickDistance", 7), s = v(t, "onnodeclick", 7), a = v(t, "onnodedrag", 7), l = v(t, "onnodedragstart", 7), u = v(t, "onnodedragstop", 7), d = v(t, "onnodepointerenter", 7), p = v(t, "onnodepointerleave", 7), f = v(t, "onnodepointermove", 7), h = v(t, "onnodecontextmenu", 7), y = E(() => yt(r().data, () => ({}), true)), w = E(() => yt(r().selected, false)), m = E(() => r().draggable), b = E(() => r().selectable), $ = E(() => yt(r().deletable, true)), _ = E(() => r().connectable), x = E(() => r().focusable), k = E(() => yt(r().hidden, false)), N = E(() => yt(r().dragging, false)), V = E(() => yt(r().style, "")), j = E(() => r().class), A = E(() => yt(r().type, "default")), H = E(() => r().parentId), z = E(() => r().sourcePosition), S = E(() => r().targetPosition), T = E(() => yt(r().measured, () => ({ width: 0, height: 0 }), true).width), C = E(() => yt(r().measured, () => ({ width: 0, height: 0 }), true).height), P = E(() => r().initialWidth), M = E(() => r().initialHeight), K = E(() => r().width), B = E(() => r().height), W = E(() => r().dragHandle), D = E(() => yt(r().internals.z, 0)), X = E(() => r().internals.positionAbsolute.x), q = E(() => r().internals.positionAbsolute.y), U = E(() => r().internals.userNode), { id: I } = r(), F = E(() => c(m) ?? n().nodesDraggable), G = E(() => c(b) ?? n().elementsSelectable), te = E(() => c(_) ?? n().nodesConnectable), ne = E(() => wc(r())), J = E(() => !!r().internals.handleBounds), he = E(() => c(ne) && c(J)), ce = E(() => c(x) ?? n().nodesFocusable); function re(ye) { return n().parentLookup.has(ye); } let ie = E(() => re(I)), fe = Ee(null), pe = null, Ce = c(A), de = c(z), we = c(S), Oe = E(() => n().nodeTypes[c(A)] ?? da), Y = E(() => n().ariaLabelConfig); Mr("svelteflow__node_connectable", { get value() { return c(te); } }), Mr("svelteflow__node_id", I); let je = E(() => { const ye = c(T) === void 0 ? c(K) ?? c(P) : c(K), Ye = c(C) === void 0 ? c(B) ?? c(M) : c(B); if (!(ye === void 0 && Ye === void 0 && c(V) === void 0)) return `${c(V)};${ye ? `width:${gn(ye)};` : ""}${Ye ? `height:${gn(Ye)};` : ""}`; }); qe(() => { (c(A) !== Ce || c(z) !== de || c(S) !== we) && c(fe) !== null && requestAnimationFrame(() => { c(fe) !== null && n().updateNodeInternals(/* @__PURE__ */ new Map([[I, { id: I, nodeElement: c(fe), force: true }]])); }), Ce = c(A), de = c(z), we = c(S); }), qe(() => { o() && (!c(he) || c(fe) !== pe) && (pe && o().unobserve(pe), c(fe) && o().observe(c(fe)), pe = c(fe)); }), $o(() => { pe && o()?.unobserve(pe); }); function ze(ye) { c(G) && (!n().selectNodesOnDrag || !c(F) || n().nodeDragThreshold > 0) && n().handleNodeSelection(I), s()?.({ node: c(U), event: ye }); } function Ae(ye) { if (!(Cc(ye) || n().disableKeyboardA11y)) if (pc.includes(ye.key) && c(G)) { const Ye = ye.key === "Escape"; n().handleNodeSelection(I, Ye, c(fe)); } else c(F) && r().selected && Object.prototype.hasOwnProperty.call(vi, ye.key) && (ye.preventDefault(), n( n().ariaLiveMessage = c(Y)["node.a11yDescription.ariaLiveMessage"]({ direction: ye.key.replace("Arrow", "").toLowerCase(), x: ~~r().internals.positionAbsolute.x, y: ~~r().internals.positionAbsolute.y }), true ), n().moveSelectedNodes(vi[ye.key], ye.shiftKey ? 4 : 1)); } const Ie = () => { if (n().disableKeyboardA11y || !n().autoPanOnNodeFocus || !c(fe)?.matches(":focus-visible")) return; const { width: ye, height: Ye, viewport: De } = n(); ia(/* @__PURE__ */ new Map([[I, r()]]), { x: 0, y: 0, width: ye, height: Ye }, [De.x, De.y, De.zoom], true).length > 0 || n().setCenter(r().position.x + (r().measured.width ?? 0) / 2, r().position.y + (r().measured.height ?? 0) / 2, { zoom: De.zoom }); }; var tt = { get store() { return n(); }, set store(ye) { n(ye), g(); }, get node() { return r(); }, set node(ye) { r(ye), g(); }, get resizeObserver() { return o(); }, set resizeObserver(ye) { o(ye), g(); }, get nodeClickDistance() { return i(); }, set nodeClickDistance(ye) { i(ye), g(); }, get onnodeclick() { return s(); }, set onnodeclick(ye) { s(ye), g(); }, get onnodedrag() { return a(); }, set onnodedrag(ye) { a(ye), g(); }, get onnodedragstart() { return l(); }, set onnodedragstart(ye) { l(ye), g(); }, get onnodedragstop() { return u(); }, set onnodedragstop(ye) { u(ye), g(); }, get onnodepointerenter() { return d(); }, set onnodepointerenter(ye) { d(ye), g(); }, get onnodepointerleave() { return p(); }, set onnodepointerleave(ye) { p(ye), g(); }, get onnodepointermove() { return f(); }, set onnodepointermove(ye) { f(ye), g(); }, get onnodecontextmenu() { return h(); }, set onnodecontextmenu(ye) { h(ye), g(); } }, Mt = Se(), Ht = oe(Mt); { var Qe = (ye) => { var Ye = im(); ot(Ye, () => ({ "data-id": I, class: [ "svelte-flow__node", `svelte-flow__node-${c(A)}`, c(j) ], style: c(je), onclick: ze, onpointerenter: d() ? (_e) => d()({ node: c(U), event: _e }) : void 0, onpointerleave: p() ? (_e) => p()({ node: c(U), event: _e }) : void 0, onpointermove: f() ? (_e) => f()({ node: c(U), event: _e }) : void 0, oncontextmenu: h() ? (_e) => h()({ node: c(U), event: _e }) : void 0, onkeydown: c(ce) ? Ae : void 0, onfocus: c(ce) ? Ie : void 0, tabIndex: c(ce) ? 0 : void 0, role: r().ariaRole ?? (c(ce) ? "group" : void 0), "aria-roledescription": "node", "aria-describedby": n().disableKeyboardA11y ? void 0 : `${Jc}-${n().flowId}`, ...r().domAttributes, [jn]: { dragging: c(N), selected: c(w), draggable: c(F), connectable: c(te), selectable: c(G), nopan: c(F), parent: c(ie) }, [cn]: { "z-index": c(D), transform: `translate(${c(X) ?? ""}px, ${c(q) ?? ""}px)`, visibility: c(ne) ? "visible" : "hidden" } })); var De = R(Ye); Ti(De, () => c(Oe), (_e, nt) => { nt(_e, { get data() { return c(y); }, get id() { return I; }, get selected() { return c(w); }, get selectable() { return c(G); }, get deletable() { return c($); }, get sourcePosition() { return c(z); }, get targetPosition() { return c(S); }, get zIndex() { return c(D); }, get dragging() { return c(N); }, get draggable() { return c(F); }, get dragHandle() { return c(W); }, get parentId() { return c(H); }, get type() { return c(A); }, get isConnectable() { return c(te); }, get positionAbsoluteX() { return c(X); }, get positionAbsoluteY() { return c(q); }, get width() { return c(K); }, get height() { return c(B); } }); }), Z(Ye), pt(Ye, (_e, nt) => Uc?.(_e, nt), () => ({ nodeId: I, isSelectable: c(G), disabled: !c(F), handleSelector: c(W), noDragClass: n().noDragClass, nodeClickDistance: i(), onNodeMouseDown: n().handleNodeSelection, onDrag: (_e, nt, Tt, Xe) => { a()?.({ event: _e, targetNode: Tt, nodes: Xe }); }, onDragStart: (_e, nt, Tt, Xe) => { l()?.({ event: _e, targetNode: Tt, nodes: Xe }); }, onDragStop: (_e, nt, Tt, Xe) => { u()?.({ event: _e, targetNode: Tt, nodes: Xe }); }, store: n() })), Nt(Ye, (_e) => Q(fe, _e), () => c(fe)), L(ye, Ye); }; ae(Ht, (ye) => { c(k) || ye(Qe); }); } return L(e3, Mt), ue(tt); } se( td, { store: {}, node: {}, resizeObserver: {}, nodeClickDistance: {}, onnodeclick: {}, onnodedrag: {}, onnodedragstart: {}, onnodedragstop: {}, onnodepointerenter: {}, onnodepointerleave: {}, onnodepointermove: {}, onnodecontextmenu: {} }, [], [], true ); var sm = ee('
'); function nd(e3, t) { le(t, true); let n = v(t, "store", 15), r = v(t, "nodeClickDistance", 7), o = v(t, "onnodeclick", 7), i = v(t, "onnodecontextmenu", 7), s = v(t, "onnodepointerenter", 7), a = v(t, "onnodepointermove", 7), l = v(t, "onnodepointerleave", 7), u = v(t, "onnodedrag", 7), d = v(t, "onnodedragstart", 7), p = v(t, "onnodedragstop", 7); const f = typeof ResizeObserver > "u" ? null : new ResizeObserver((w) => { const m = /* @__PURE__ */ new Map(); w.forEach((b) => { const $ = b.target.getAttribute("data-id"); m.set($, { id: $, nodeElement: b.target, force: true }); }), n().updateNodeInternals(m); }); $o(() => { f?.disconnect(); }); var h = { get store() { return n(); }, set store(w) { n(w), g(); }, get nodeClickDistance() { return r(); }, set nodeClickDistance(w) { r(w), g(); }, get onnodeclick() { return o(); }, set onnodeclick(w) { o(w), g(); }, get onnodecontextmenu() { return i(); }, set onnodecontextmenu(w) { i(w), g(); }, get onnodepointerenter() { return s(); }, set onnodepointerenter(w) { s(w), g(); }, get onnodepointermove() { return a(); }, set onnodepointermove(w) { a(w), g(); }, get onnodepointerleave() { return l(); }, set onnodepointerleave(w) { l(w), g(); }, get onnodedrag() { return u(); }, set onnodedrag(w) { u(w), g(); }, get onnodedragstart() { return d(); }, set onnodedragstart(w) { d(w), g(); }, get onnodedragstop() { return p(); }, set onnodedragstop(w) { p(w), g(); } }, y = sm(); return mt(y, 21, () => n().visible.nodes.values(), (w) => w.id, (w, m) => { td(w, { get node() { return c(m); }, get resizeObserver() { return f; }, get nodeClickDistance() { return r(); }, get onnodeclick() { return o(); }, get onnodepointerenter() { return s(); }, get onnodepointermove() { return a(); }, get onnodepointerleave() { return l(); }, get onnodedrag() { return u(); }, get onnodedragstart() { return d(); }, get onnodedragstop() { return p(); }, get onnodecontextmenu() { return i(); }, get store() { return n(); }, set store(b) { n(b); } }); }), Z(y), L(e3, y), ue(h); } se( nd, { store: {}, nodeClickDistance: {}, onnodeclick: {}, onnodecontextmenu: {}, onnodepointerenter: {}, onnodepointermove: {}, onnodepointerleave: {}, onnodedrag: {}, onnodedragstart: {}, onnodedragstop: {} }, [], [], true ); var am = ge(''); function rd(e3, t) { le(t, true); const n = v(t, "edge", 7), r = v(t, "store", 15), o = v(t, "onedgeclick", 7), i = v(t, "onedgecontextmenu", 7), s = v(t, "onedgepointerenter", 7), a = v(t, "onedgepointerleave", 7); let l = E(() => n().source), u = E(() => n().target), d = E(() => n().sourceX), p = E(() => n().sourceY), f = E(() => n().targetX), h = E(() => n().targetY), y = E(() => n().sourcePosition), w = E(() => n().targetPosition), m = E(() => yt(n().animated, false)), b = E(() => yt(n().selected, false)), $ = E(() => n().label), _ = E(() => n().labelStyle), x = E(() => yt(n().data, () => ({}), true)), k = E(() => n().style), N = E(() => n().interactionWidth), V = E(() => yt(n().type, "default")), j = E(() => n().sourceHandle), A = E(() => n().targetHandle), H = E(() => n().markerStart), z = E(() => n().markerEnd), S = E(() => n().selectable), T = E(() => n().focusable), C = E(() => yt(n().deletable, true)), P = E(() => n().hidden), M = E(() => n().zIndex), K = E(() => n().class), B = E(() => n().ariaLabel), W = null; const { id: D } = n(); Mr("svelteflow__edge_id", D); let X = E(() => c(S) ?? r().elementsSelectable), q = E(() => c(T) ?? r().edgesFocusable), U = E(() => r().edgeTypes[c(V)] ?? fa), I = E(() => c(H) ? `url('#${Ss(c(H), r().flowId)}')` : void 0), F = E(() => c(z) ? `url('#${Ss(c(z), r().flowId)}')` : void 0); function G(ie) { const fe = r().edgeLookup.get(D); fe && (c(X) && r().handleEdgeSelection(D), o()?.({ event: ie, edge: fe })); } function te(ie, fe) { const pe = r().edgeLookup.get(D); pe && fe({ event: ie, edge: pe }); } function ne(ie) { if (!r().disableKeyboardA11y && pc.includes(ie.key) && c(X)) { const { unselectNodesAndEdges: fe, addSelectedEdges: pe } = r(); ie.key === "Escape" ? (W?.blur(), fe({ edges: [n()] })) : pe([D]); } } var J = { get edge() { return n(); }, set edge(ie) { n(ie), g(); }, get store() { return r(); }, set store(ie) { r(ie), g(); }, get onedgeclick() { return o(); }, set onedgeclick(ie) { o(ie), g(); }, get onedgecontextmenu() { return i(); }, set onedgecontextmenu(ie) { i(ie), g(); }, get onedgepointerenter() { return s(); }, set onedgepointerenter(ie) { s(ie), g(); }, get onedgepointerleave() { return a(); }, set onedgepointerleave(ie) { a(ie), g(); } }, he = Se(), ce = oe(he); { var re = (ie) => { var fe = am(); let pe; var Ce = R(fe); ot(Ce, () => ({ class: ["svelte-flow__edge", c(K)], "data-id": D, onclick: G, oncontextmenu: i() ? (we) => { te(we, i()); } : void 0, onpointerenter: s() ? (we) => { te(we, s()); } : void 0, onpointerleave: a() ? (we) => { te(we, a()); } : void 0, "aria-label": c(B) === null ? void 0 : c(B) ? c(B) : `Edge from ${c(l)} to ${c(u)}`, "aria-describedby": c(q) ? `${ed}-${r().flowId}` : void 0, role: n().ariaRole ?? (c(q) ? "group" : "img"), "aria-roledescription": "edge", onkeydown: c(q) ? ne : void 0, tabindex: c(q) ? 0 : void 0, ...n().domAttributes, [jn]: { animated: c(m), selected: c(b), selectable: c(X) } })); var de = R(Ce); Ti(de, () => c(U), (we, Oe) => { Oe(we, { get id() { return D; }, get source() { return c(l); }, get target() { return c(u); }, get sourceX() { return c(d); }, get sourceY() { return c(p); }, get targetX() { return c(f); }, get targetY() { return c(h); }, get sourcePosition() { return c(y); }, get targetPosition() { return c(w); }, get animated() { return c(m); }, get selected() { return c(b); }, get label() { return c($); }, get labelStyle() { return c(_); }, get data() { return c(x); }, get style() { return c(k); }, get interactionWidth() { return c(N); }, get selectable() { return c(X); }, get deletable() { return c(C); }, get type() { return c(V); }, get sourceHandleId() { return c(j); }, get targetHandleId() { return c(A); }, get markerStart() { return c(I); }, get markerEnd() { return c(F); } }); }), Z(Ce), Nt(Ce, (we) => W = we, () => W), Z(fe), $e(() => pe = dt(fe, "", pe, { "z-index": c(M) })), L(ie, fe); }; ae(ce, (ie) => { c(P) || ie(re); }); } return L(e3, he), ue(J); } se( rd, { edge: {}, store: {}, onedgeclick: {}, onedgecontextmenu: {}, onedgepointerenter: {}, onedgepointerleave: {} }, [], [], true ); Gf(); var lm = ge(""); function od(e3, t) { le(t, false); const n = rn(); Ou(); var r = lm(); mt(r, 5, () => n.markers, (o) => o.id, (o, i) => { id(o, Be(() => c(i))); }), Z(r), L(e3, r), ue(); } se(od, {}, [], [], true); var um = ge(''); var cm = ge(''); var dm = ge(''); function id(e3, t) { le(t, true); let n = v(t, "id", 7), r = v(t, "type", 7), o = v(t, "width", 7, 12.5), i = v(t, "height", 7, 12.5), s = v(t, "markerUnits", 7, "strokeWidth"), a = v(t, "orient", 7, "auto-start-reverse"), l = v(t, "color", 7, "none"), u = v(t, "strokeWidth", 7); var d = { get id() { return n(); }, set id(w) { n(w), g(); }, get type() { return r(); }, set type(w) { r(w), g(); }, get width() { return o(); }, set width(w = 12.5) { o(w), g(); }, get height() { return i(); }, set height(w = 12.5) { i(w), g(); }, get markerUnits() { return s(); }, set markerUnits(w = "strokeWidth") { s(w), g(); }, get orient() { return a(); }, set orient(w = "auto-start-reverse") { a(w), g(); }, get color() { return l(); }, set color(w = "none") { l(w), g(); }, get strokeWidth() { return u(); }, set strokeWidth(w) { u(w), g(); } }, p = dm(), f = R(p); { var h = (w) => { var m = um(); let b; $e(() => { xe(m, "stroke-width", u()), b = dt(m, "", b, { stroke: l() }); }), L(w, m); }, y = (w) => { var m = Se(), b = oe(m); { var $ = (_) => { var x = cm(); let k; $e(() => { xe(x, "stroke-width", u()), k = dt(x, "", k, { stroke: l(), fill: l() }); }), L(_, x); }; ae( b, (_) => { r() === co.ArrowClosed && _($); }, true ); } L(w, m); }; ae(f, (w) => { r() === co.Arrow ? w(h) : w(y, false); }); } return Z(p), $e(() => { xe(p, "id", n()), xe(p, "markerWidth", `${o()}`), xe(p, "markerHeight", `${i()}`), xe(p, "markerUnits", s()), xe(p, "orient", a()); }), L(e3, p), ue(d); } se( id, { id: {}, type: {}, width: {}, height: {}, markerUnits: {}, orient: {}, color: {}, strokeWidth: {} }, [], [], true ); var fm = ee('
'); function sd(e3, t) { le(t, true); let n = v(t, "store", 15), r = v(t, "onedgeclick", 7), o = v(t, "onedgecontextmenu", 7), i = v(t, "onedgepointerenter", 7), s = v(t, "onedgepointerleave", 7); var a = { get store() { return n(); }, set store(f) { n(f), g(); }, get onedgeclick() { return r(); }, set onedgeclick(f) { r(f), g(); }, get onedgecontextmenu() { return o(); }, set onedgecontextmenu(f) { o(f), g(); }, get onedgepointerenter() { return i(); }, set onedgepointerenter(f) { i(f), g(); }, get onedgepointerleave() { return s(); }, set onedgepointerleave(f) { s(f), g(); } }, l = fm(), u = R(l), d = R(u); od(d, {}), Z(u); var p = O(u, 2); return mt(p, 17, () => n().visible.edges.values(), (f) => f.id, (f, h) => { rd(f, { get edge() { return c(h); }, get onedgeclick() { return r(); }, get onedgecontextmenu() { return o(); }, get onedgepointerenter() { return i(); }, get onedgepointerleave() { return s(); }, get store() { return n(); }, set store(y) { n(y); } }); }), Z(l), L(e3, l), ue(a); } se( sd, { store: {}, onedgeclick: {}, onedgecontextmenu: {}, onedgepointerenter: {}, onedgepointerleave: {} }, [], [], true ); var pm = ee('
'); var hm = { hash: "svelte-qtk83j", code: ".svelte-flow__selection.svelte-qtk83j {position:absolute;top:0;left:0;}" }; function pa(e3, t) { le(t, true), He(e3, hm); let n = v(t, "x", 7, 0), r = v(t, "y", 7, 0), o = v(t, "width", 7, 0), i = v(t, "height", 7, 0), s = v(t, "isVisible", 7, true); var a = { get x() { return n(); }, set x(p = 0) { n(p), g(); }, get y() { return r(); }, set y(p = 0) { r(p), g(); }, get width() { return o(); }, set width(p = 0) { o(p), g(); }, get height() { return i(); }, set height(p = 0) { i(p), g(); }, get isVisible() { return s(); }, set isVisible(p = true) { s(p), g(); } }, l = Se(), u = oe(l); { var d = (p) => { var f = pm(); let h; $e((y) => h = dt(f, "", h, y), [ () => ({ width: typeof o() == "string" ? o() : gn(o()), height: typeof i() == "string" ? i() : gn(i()), transform: `translate(${n()}px, ${r()}px)` }) ]), L(p, f); }; ae(u, (p) => { s() && p(d); }); } return L(e3, l), ue(a); } se(pa, { x: {}, y: {}, width: {}, height: {}, isVisible: {} }, [], [], true); var gm = ee("
"); var vm = { 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;}` }; function ad(e3, t) { le(t, true), He(e3, vm); let n = v(t, "store", 15), r = v(t, "onnodedrag", 7), o = v(t, "onnodedragstart", 7), i = v(t, "onnodedragstop", 7), s = v(t, "onselectionclick", 7), a = v(t, "onselectioncontextmenu", 7), l = Ee(void 0); qe(() => { n().disableKeyboardA11y || c(l)?.focus({ preventScroll: true }); }); let u = E(() => { if (n().selectionRectMode === "nodes") { n().nodes; const b = Eo(n().nodeLookup, { filter: ($) => !!$.selected }); if (b.width > 0 && b.height > 0) return b; } return null; }); function d(b) { const $ = n().nodes.filter((_) => _.selected); a()?.({ nodes: $, event: b }); } function p(b) { const $ = n().nodes.filter((_) => _.selected); s()?.({ nodes: $, event: b }); } function f(b) { Object.prototype.hasOwnProperty.call(vi, b.key) && (b.preventDefault(), n().moveSelectedNodes(vi[b.key], b.shiftKey ? 4 : 1)); } var h = { get store() { return n(); }, set store(b) { n(b), g(); }, get onnodedrag() { return r(); }, set onnodedrag(b) { r(b), g(); }, get onnodedragstart() { return o(); }, set onnodedragstart(b) { o(b), g(); }, get onnodedragstop() { return i(); }, set onnodedragstop(b) { i(b), g(); }, get onselectionclick() { return s(); }, set onselectionclick(b) { s(b), g(); }, get onselectioncontextmenu() { return a(); }, set onselectioncontextmenu(b) { a(b), g(); } }, y = Se(), w = oe(y); { var m = (b) => { var $ = gm(); $.__contextmenu = d, $.__click = p, $.__keydown = function(...k) { (n().disableKeyboardA11y ? void 0 : f)?.apply(this, k); }; let _; var x = R($); pa(x, { width: "100%", height: "100%", x: 0, y: 0 }), Z($), pt($, (k, N) => Uc?.(k, N), () => ({ disabled: false, store: n(), onDrag: (k, N, V, j) => { r()?.({ event: k, targetNode: null, nodes: j }); }, onDragStart: (k, N, V, j) => { o()?.({ event: k, targetNode: null, nodes: j }); }, onDragStop: (k, N, V, j) => { i()?.({ event: k, targetNode: null, nodes: j }); } })), Nt($, (k) => Q(l, k), () => c(l)), $e( (k) => { Pt($, 1, An(["svelte-flow__selection-wrapper", n().noPanClass]), "svelte-c7g5lf"), xe($, "role", n().disableKeyboardA11y ? void 0 : "button"), xe($, "tabindex", n().disableKeyboardA11y ? void 0 : -1), _ = dt($, "", _, k); }, [ () => ({ width: gn(c(u).width), height: gn(c(u).height), transform: `translate(${c(u).x ?? ""}px, ${c(u).y ?? ""}px)` }) ] ), L(b, $); }; ae(w, (b) => { n().selectionRectMode === "nodes" && c(u) && _n(c(u).x) && _n(c(u).y) && b(m); }); } return L(e3, y), ue(h); } er(["contextmenu", "click", "keydown"]); se( ad, { store: {}, onnodedrag: {}, onnodedragstart: {}, onnodedragstop: {}, onselectionclick: {}, onselectioncontextmenu: {} }, [], [], true ); function mm(e3) { switch (e3) { case "ctrl": return 8; case "shift": return 4; case "alt": return 2; case "meta": return 1; } } function ln(e3, t) { let { enabled: n = true, trigger: r, type: o = "keydown" } = t; function i(a) { const l = Array.isArray(r) ? r : [r], u = [a.metaKey, a.altKey, a.shiftKey, a.ctrlKey].reduce( (d, p, f) => p ? d | 1 << f : d, 0 ); for (const d of l) { const p = { preventDefault: false, enabled: true, ...d }, { modifier: f, key: h, callback: y, preventDefault: w, enabled: m } = p; if (m) { if (a.key !== h) continue; if (f === null || f === false) { if (u !== 0) continue; } else if (f !== void 0 && f?.[0]?.length > 0) { const $ = Array.isArray(f) ? f : [f]; let _ = false; for (const x of $) if ((Array.isArray(x) ? x : [x]).reduce( (k, N) => k | mm(N), 0 ) === u) { _ = true; break; } if (!_) continue; } w && a.preventDefault(); const b = { node: e3, trigger: p, originalEvent: a }; e3.dispatchEvent(new CustomEvent("shortcut", { detail: b })), y?.(b); } } } let s; return n && (s = ps(e3, o, i)), { update: (a) => { const { enabled: l = true, type: u = "keydown" } = a; n && (!l || o !== u) ? s?.() : !n && l && (s = ps(e3, u, i)), n = l, o = u, r = a.trigger; }, destroy: () => { s?.(); } }; } function st() { const e3 = E(rn), t = (i) => { const s = hl(i) ? i : c(e3).nodeLookup.get(i.id), a = s.parentId ? Wv(s.position, s.measured, s.parentId, c(e3).nodeLookup, c(e3).nodeOrigin) : s.position, l = { ...s, position: a, width: s.measured?.width ?? s.width, height: s.measured?.height ?? s.height }; return Hr(l); }; function n(i, s, a = { replace: false }) { c(e3).nodes = lt(() => c(e3).nodes).map((l) => { if (l.id === i) { const u = typeof s == "function" ? s(l) : s; return a?.replace && hl(u) ? u : { ...l, ...u }; } return l; }); } function r(i, s, a = { replace: false }) { c(e3).edges = lt(() => c(e3).edges).map((l) => { if (l.id === i) { const u = typeof s == "function" ? s(l) : s; return a.replace && I0(u) ? u : { ...l, ...u }; } return l; }); } const o = (i) => c(e3).nodeLookup.get(i); return { zoomIn: c(e3).zoomIn, zoomOut: c(e3).zoomOut, getInternalNode: o, getNode: (i) => o(i)?.internals.userNode, getNodes: (i) => i === void 0 ? c(e3).nodes : wl(c(e3).nodeLookup, i), getEdge: (i) => c(e3).edgeLookup.get(i), getEdges: (i) => i === void 0 ? c(e3).edges : wl(c(e3).edgeLookup, i), setZoom: (i, s) => { const a = c(e3).panZoom; return a ? a.scaleTo(i, { duration: s?.duration }) : Promise.resolve(false); }, getZoom: () => c(e3).viewport.zoom, setViewport: async (i, s) => { const a = c(e3).viewport; return c(e3).panZoom ? (await c(e3).panZoom.setViewport( { x: i.x ?? a.x, y: i.y ?? a.y, zoom: i.zoom ?? a.zoom }, s ), Promise.resolve(true)) : Promise.resolve(false); }, getViewport: () => Yl(c(e3).viewport), setCenter: async (i, s, a) => c(e3).setCenter(i, s, a), fitView: (i) => c(e3).fitView(i), fitBounds: async (i, s) => { if (!c(e3).panZoom) return Promise.resolve(false); const a = sa(i, c(e3).width, c(e3).height, c(e3).minZoom, c(e3).maxZoom, s?.padding ?? 0.1); return await c(e3).panZoom.setViewport(a, { duration: s?.duration, ease: s?.ease, interpolate: s?.interpolate }), Promise.resolve(true); }, /** * Partial is defined as "the 2 nodes/areas are intersecting partially". * If a is contained in b or b is contained in a, they are both * considered fully intersecting. */ getIntersectingNodes: (i, s = true, a) => { const l = nl(i), u = l ? i : t(i); return u ? (a || c(e3).nodes).filter((d) => { const p = c(e3).nodeLookup.get(d.id); if (!p || !l && d.id === i.id) return false; const f = Hr(p), h = fo(f, u); return s && h > 0 || h >= f.width * f.height || h >= u.width * u.height; }) : []; }, isNodeIntersecting: (i, s, a = true) => { const l = nl(i) ? i : t(i); if (!l) return false; const u = fo(l, s); return a && u > 0 || u >= s.width * s.height || u >= l.width * l.height; }, deleteElements: async ({ nodes: i = [], edges: s = [] }) => { const { nodes: a, edges: l } = await jv({ nodesToRemove: i, edgesToRemove: s, nodes: c(e3).nodes, edges: c(e3).edges, onBeforeDelete: c(e3).onbeforedelete }); return a && (c(e3).nodes = lt(() => c(e3).nodes).filter((u) => !a.some(({ id: d }) => d === u.id))), l && (c(e3).edges = lt(() => c(e3).edges).filter((u) => !l.some(({ id: d }) => d === u.id))), (a.length > 0 || l.length > 0) && c(e3).ondelete?.({ nodes: a, edges: l }), { deletedNodes: a, deletedEdges: l }; }, screenToFlowPosition: (i, s = { snapToGrid: true }) => { if (!c(e3).domNode) return i; const a = s.snapToGrid ? c(e3).snapGrid : false, { x: l, y: u, zoom: d } = c(e3).viewport, { x: p, y: f } = c(e3).domNode.getBoundingClientRect(), h = { x: i.x - p, y: i.y - f }; return No(h, [l, u, d], a !== null, a || [1, 1]); }, /** * * @param position * @returns */ flowToScreenPosition: (i) => { if (!c(e3).domNode) return i; const { x: s, y: a, zoom: l } = c(e3).viewport, { x: u, y: d } = c(e3).domNode.getBoundingClientRect(), p = gi(i, [s, a, l]); return { x: p.x + u, y: p.y + d }; }, toObject: () => structuredClone({ nodes: [...c(e3).nodes], edges: [...c(e3).edges], viewport: { ...c(e3).viewport } }), updateNode: n, updateNodeData: (i, s, a) => { const l = c(e3).nodeLookup.get(i)?.internals.userNode; if (!l) return; const u = typeof s == "function" ? s(l) : s; n(i, (d) => ({ ...d, data: a?.replace ? u : { ...d.data, ...u } })); }, updateEdge: r, getNodesBounds: (i) => Av(i, { nodeLookup: c(e3).nodeLookup, nodeOrigin: c(e3).nodeOrigin }), getHandleConnections: ({ type: i, id: s, nodeId: a }) => Array.from(c(e3).connectionLookup.get(`${a}-${i}-${s ?? null}`)?.values() ?? []) }; } function wl(e3, t) { const n = []; for (const r of t) { const o = e3.get(r); if (o) { const i = "internals" in o ? o.internals?.userNode : o; n.push(i); } } return n; } function ld(e3, t) { le(t, true); let n = v(t, "store", 15), r = v(t, "selectionKey", 7, "Shift"), o = v(t, "multiSelectionKey", 23, () => sr() ? "Meta" : "Control"), i = v(t, "deleteKey", 7, "Backspace"), s = v(t, "panActivationKey", 7, " "), a = v(t, "zoomActivationKey", 23, () => sr() ? "Meta" : "Control"), { deleteElements: l } = st(); function u(m) { return m !== null && typeof m == "object"; } function d(m) { return u(m) ? m.modifier || [] : []; } function p(m) { return m == null ? "" : u(m) ? m.key : m; } function f(m, b) { return (Array.isArray(m) ? m : [m]).map(($) => { const _ = p($); return { key: _, modifier: d($), enabled: _ !== null, callback: b }; }); } function h() { n(n().selectionRect = null, true), n(n().selectionKeyPressed = false, true), n(n().multiselectionKeyPressed = false, true), n(n().deleteKeyPressed = false, true), n(n().panActivationKeyPressed = false, true), n(n().zoomActivationKeyPressed = false, true); } function y() { const m = n().nodes.filter(($) => $.selected), b = n().edges.filter(($) => $.selected); l({ nodes: m, edges: b }); } var w = { get store() { return n(); }, set store(m) { n(m), g(); }, get selectionKey() { return r(); }, set selectionKey(m = "Shift") { r(m), g(); }, get multiSelectionKey() { return o(); }, set multiSelectionKey(m = sr() ? "Meta" : "Control") { o(m), g(); }, get deleteKey() { return i(); }, set deleteKey(m = "Backspace") { i(m), g(); }, get panActivationKey() { return s(); }, set panActivationKey(m = " ") { s(m), g(); }, get zoomActivationKey() { return a(); }, set zoomActivationKey(m = sr() ? "Meta" : "Control") { a(m), g(); } }; return ii("blur", Ct, h), ii("contextmenu", Ct, h), pt(Ct, (m, b) => ln?.(m, b), () => ({ trigger: f(r(), () => n(n().selectionKeyPressed = true, true)), type: "keydown" })), pt(Ct, (m, b) => ln?.(m, b), () => ({ trigger: f(r(), () => n(n().selectionKeyPressed = false, true)), type: "keyup" })), pt(Ct, (m, b) => ln?.(m, b), () => ({ trigger: f(o(), () => { n(n().multiselectionKeyPressed = true, true); }), type: "keydown" })), pt(Ct, (m, b) => ln?.(m, b), () => ({ trigger: f(o(), () => n(n().multiselectionKeyPressed = false, true)), type: "keyup" })), pt(Ct, (m, b) => ln?.(m, b), () => ({ trigger: f(i(), (m) => { !(m.originalEvent.ctrlKey || m.originalEvent.metaKey || m.originalEvent.shiftKey) && !Cc(m.originalEvent) && (n(n().deleteKeyPressed = true, true), y()); }), type: "keydown" })), pt(Ct, (m, b) => ln?.(m, b), () => ({ trigger: f(i(), () => n(n().deleteKeyPressed = false, true)), type: "keyup" })), pt(Ct, (m, b) => ln?.(m, b), () => ({ trigger: f(s(), () => n(n().panActivationKeyPressed = true, true)), type: "keydown" })), pt(Ct, (m, b) => ln?.(m, b), () => ({ trigger: f(s(), () => n(n().panActivationKeyPressed = false, true)), type: "keyup" })), pt(Ct, (m, b) => ln?.(m, b), () => ({ trigger: f(a(), () => n(n().zoomActivationKeyPressed = true, true)), type: "keydown" })), pt(Ct, (m, b) => ln?.(m, b), () => ({ trigger: f(a(), () => n(n().zoomActivationKeyPressed = false, true)), type: "keyup" })), ue(w); } se( ld, { store: {}, selectionKey: {}, multiSelectionKey: {}, deleteKey: {}, panActivationKey: {}, zoomActivationKey: {} }, [], [], true ); var ym = ge(''); var wm = ge(''); function ud(e3, t) { le(t, true); let n = v(t, "store", 15), r = v(t, "type", 7), o = v(t, "containerStyle", 7), i = v(t, "style", 7), s = v(t, "LineComponent", 7), a = E(() => { if (!n().connection.inProgress) return ""; const f = { sourceX: n().connection.from.x, sourceY: n().connection.from.y, sourcePosition: n().connection.fromPosition, targetX: n().connection.to.x, targetY: n().connection.to.y, targetPosition: n().connection.toPosition }; switch (r()) { case xn.Bezier: { const [h] = _c(f); return h; } case xn.Straight: { const [h] = Sc(f); return h; } case xn.Step: case xn.SmoothStep: { const [h] = aa({ ...f, borderRadius: r() === xn.Step ? 0 : void 0 }); return h; } } }); var l = { get store() { return n(); }, set store(f) { n(f), g(); }, get type() { return r(); }, set type(f) { r(f), g(); }, get containerStyle() { return o(); }, set containerStyle(f) { o(f), g(); }, get style() { return i(); }, set style(f) { i(f), g(); }, get LineComponent() { return s(); }, set LineComponent(f) { s(f), g(); } }, u = Se(), d = oe(u); { var p = (f) => { var h = wm(), y = R(h), w = R(y); { var m = ($) => { var _ = Se(), x = oe(_); Ti(x, s, (k, N) => { N(k, {}); }), L($, _); }, b = ($) => { var _ = ym(); $e(() => { xe(_, "d", c(a)), dt(_, i()); }), L($, _); }; ae(w, ($) => { s() ? $(m) : $(b, false); }); } Z(y), Z(h), $e( ($) => { xe(h, "width", n().width), xe(h, "height", n().height), dt(h, o()), Pt(y, 0, $); }, [ () => An([ "svelte-flow__connection", Ov(n().connection.isValid) ]) ] ), L(f, h); }; ae(d, (f) => { n().connection.inProgress && f(p); }); } return L(e3, u), ue(l); } se( ud, { store: {}, type: {}, containerStyle: {}, style: {}, LineComponent: {} }, [], [], true ); var bm = ee("
"); function To(e3, t) { le(t, true); let n = v(t, "position", 7, "top-right"), r = v(t, "style", 7), o = v(t, "class", 7), i = v(t, "children", 7), s = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "position", "style", "class", "children" ]), a = E(() => `${n()}`.split("-")); var l = { get position() { return n(); }, set position(p = "top-right") { n(p), g(); }, get style() { return r(); }, set style(p) { r(p), g(); }, get class() { return o(); }, set class(p) { o(p), g(); }, get children() { return i(); }, set children(p) { i(p), g(); } }, u = bm(); ot(u, (p) => ({ class: p, style: r(), ...s }), [ () => ["svelte-flow__panel", o(), ...c(a)] ]); var d = R(u); return Ge(d, () => i() ?? vt), Z(u), L(e3, u), ue(l); } se(To, { position: {}, style: {}, class: {}, children: {} }, [], [], true); var xm = ee('Svelte Flow'); function cd(e3, t) { le(t, true); let n = v(t, "proOptions", 7), r = v(t, "position", 7, "bottom-right"); var o = { get proOptions() { return n(); }, set proOptions(l) { n(l), g(); }, get position() { return r(); }, set position(l = "bottom-right") { r(l), g(); } }, i = Se(), s = oe(i); { var a = (l) => { To(l, { get position() { return r(); }, class: "svelte-flow__attribution", "data-message": "Feel free to remove the attribution or check out how you could support us: https://svelteflow.dev/support-us", children: (u, d) => { var p = xm(); L(u, p); }, $$slots: { default: true } }); }; ae(s, (l) => { n()?.hideAttribution || l(a); }); } return L(e3, i), ue(o); } se(cd, { proOptions: {}, position: {} }, [], [], true); var Cm = ee("
"); var $m = { 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;}" }; function dd(e3, t) { le(t, true), He(e3, $m); let n = v(t, "width", 7), r = v(t, "height", 7), o = v(t, "colorMode", 7), i = v(t, "domNode", 15), s = v(t, "clientWidth", 15), a = v(t, "clientHeight", 15), l = v(t, "children", 7), u = v(t, "rest", 7), d = E(() => u().class), p = E(() => Cp(u(), [ "id", "class", "nodeTypes", "edgeTypes", "colorMode", "isValidConnection", "onmove", "onmovestart", "onmoveend", "onflowerror", "ondelete", "onbeforedelete", "onbeforeconnect", "onconnect", "onconnectstart", "onconnectend", "onbeforereconnect", "onreconnect", "onreconnectstart", "onreconnectend", "onclickconnectstart", "onclickconnectend", "oninit", "onselectionchange", "onselectiondragstart", "onselectiondrag", "onselectiondragstop", "onselectionstart", "onselectionend", "clickConnect", "fitView", "fitViewOptions", "nodeOrigin", "nodeDragThreshold", "connectionDragThreshold", "minZoom", "maxZoom", "initialViewport", "connectionRadius", "connectionMode", "selectionMode", "selectNodesOnDrag", "snapGrid", "defaultMarkerColor", "translateExtent", "nodeExtent", "onlyRenderVisibleElements", "autoPanOnConnect", "autoPanOnNodeDrag", "colorModeSSR", "defaultEdgeOptions", "elevateNodesOnSelect", "elevateEdgesOnSelect", "nodesDraggable", "autoPanOnNodeFocus", "nodesConnectable", "elementsSelectable", "nodesFocusable", "edgesFocusable", "disableKeyboardA11y", "noDragClass", "noPanClass", "noWheelClass", "ariaLabelConfig", "autoPanSpeed", "panOnScrollSpeed" ])); function f(m) { m.currentTarget.scrollTo({ top: 0, left: 0, behavior: "auto" }), u().onscroll && u().onscroll(m); } var h = { get width() { return n(); }, set width(m) { n(m), g(); }, get height() { return r(); }, set height(m) { r(m), g(); }, get colorMode() { return o(); }, set colorMode(m) { o(m), g(); }, get domNode() { return i(); }, set domNode(m) { i(m), g(); }, get clientWidth() { return s(); }, set clientWidth(m) { s(m), g(); }, get clientHeight() { return a(); }, set clientHeight(m) { a(m), g(); }, get children() { return l(); }, set children(m) { l(m), g(); }, get rest() { return u(); }, set rest(m) { u(m), g(); } }, y = Cm(); ot( y, (m) => ({ class: [ "svelte-flow", "svelte-flow__container", c(d), o() ], "data-testid": "svelte-flow__wrapper", role: "application", onscroll: f, ...c(p), [cn]: m }), [ () => ({ width: gn(n()), height: gn(r()) }) ], void 0, void 0, "svelte-15m40wc" ); var w = R(y); return Ge(w, () => l() ?? vt), Z(y), Nt(y, (m) => i(m), () => i()), La(y, "clientHeight", a), La(y, "clientWidth", s), L(e3, y), ue(h); } se( dd, { width: {}, height: {}, colorMode: {}, domNode: {}, clientWidth: {}, clientHeight: {}, children: {}, rest: {} }, [], [], true ); var _m = ee('
', 1); var km = ee(" ", 1); var Sm = ee(" ", 1); function fd(e3, t) { le(t, true); let n = v(t, "width", 7), r = v(t, "height", 7), o = v(t, "proOptions", 7), i = v(t, "selectionKey", 7), s = v(t, "deleteKey", 7), a = v(t, "panActivationKey", 7), l = v(t, "multiSelectionKey", 7), u = v(t, "zoomActivationKey", 7), d = v(t, "paneClickDistance", 7, 1), p = v(t, "nodeClickDistance", 7, 1), f = v(t, "onmovestart", 7), h = v(t, "onmoveend", 7), y = v(t, "onmove", 7), w = v(t, "oninit", 7), m = v(t, "onnodeclick", 7), b = v(t, "onnodecontextmenu", 7), $ = v(t, "onnodedrag", 7), _ = v(t, "onnodedragstart", 7), x = v(t, "onnodedragstop", 7), k = v(t, "onnodepointerenter", 7), N = v(t, "onnodepointermove", 7), V = v(t, "onnodepointerleave", 7), j = v(t, "onselectionclick", 7), A = v(t, "onselectioncontextmenu", 7), H = v(t, "onselectionstart", 7), z = v(t, "onselectionend", 7), S = v(t, "onedgeclick", 7), T = v(t, "onedgecontextmenu", 7), C = v(t, "onedgepointerenter", 7), P = v(t, "onedgepointerleave", 7), M = v(t, "onpaneclick", 7), K = v(t, "onpanecontextmenu", 7), B = v(t, "panOnScrollMode", 23, () => ur.Free), W = v(t, "preventScrolling", 7, true), D = v(t, "zoomOnScroll", 7, true), X = v(t, "zoomOnDoubleClick", 7, true), q = v(t, "zoomOnPinch", 7, true), U = v(t, "panOnScroll", 7, false), I = v(t, "panOnScrollSpeed", 7, 0.5), F = v(t, "panOnDrag", 7, true), G = v(t, "selectionOnDrag", 7, false), te = v(t, "connectionLineComponent", 7), ne = v(t, "connectionLineStyle", 7), J = v(t, "connectionLineContainerStyle", 7), he = v(t, "connectionLineType", 23, () => xn.Bezier), ce = v(t, "attributionPosition", 7), re = v(t, "children", 7), ie = v(t, "nodes", 31, () => Rt([])), fe = v(t, "edges", 31, () => Rt([])), pe = v(t, "viewport", 31, () => { }), Ce = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "width", "height", "proOptions", "selectionKey", "deleteKey", "panActivationKey", "multiSelectionKey", "zoomActivationKey", "paneClickDistance", "nodeClickDistance", "onmovestart", "onmoveend", "onmove", "oninit", "onnodeclick", "onnodecontextmenu", "onnodedrag", "onnodedragstart", "onnodedragstop", "onnodepointerenter", "onnodepointermove", "onnodepointerleave", "onselectionclick", "onselectioncontextmenu", "onselectionstart", "onselectionend", "onedgeclick", "onedgecontextmenu", "onedgepointerenter", "onedgepointerleave", "onpaneclick", "onpanecontextmenu", "panOnScrollMode", "preventScrolling", "zoomOnScroll", "zoomOnDoubleClick", "zoomOnPinch", "panOnScroll", "panOnScrollSpeed", "panOnDrag", "selectionOnDrag", "connectionLineComponent", "connectionLineStyle", "connectionLineContainerStyle", "connectionLineType", "attributionPosition", "children", "nodes", "edges", "viewport" ]), de = Fc({ props: Ce, width: n(), height: r(), get nodes() { return ie(); }, set nodes(Y) { ie(Y); }, get edges() { return fe(); }, set edges(Y) { fe(Y); }, get viewport() { return pe(); }, set viewport(Y) { pe(Y); } }); const we = Fn(mi); we && we.setStore && we.setStore(de), Mr(mi, { provider: false, getStore() { return de; } }), qe(() => { const Y = { nodes: de.selectedNodes, edges: de.selectedEdges }; lt(() => t.onselectionchange)?.(Y); for (const je of de.selectionChangeHandlers.values()) je(Y); }), $o(() => { de.reset(); }); var Oe = { get width() { return n(); }, set width(Y) { n(Y), g(); }, get height() { return r(); }, set height(Y) { r(Y), g(); }, get proOptions() { return o(); }, set proOptions(Y) { o(Y), g(); }, get selectionKey() { return i(); }, set selectionKey(Y) { i(Y), g(); }, get deleteKey() { return s(); }, set deleteKey(Y) { s(Y), g(); }, get panActivationKey() { return a(); }, set panActivationKey(Y) { a(Y), g(); }, get multiSelectionKey() { return l(); }, set multiSelectionKey(Y) { l(Y), g(); }, get zoomActivationKey() { return u(); }, set zoomActivationKey(Y) { u(Y), g(); }, get paneClickDistance() { return d(); }, set paneClickDistance(Y = 1) { d(Y), g(); }, get nodeClickDistance() { return p(); }, set nodeClickDistance(Y = 1) { p(Y), g(); }, get onmovestart() { return f(); }, set onmovestart(Y) { f(Y), g(); }, get onmoveend() { return h(); }, set onmoveend(Y) { h(Y), g(); }, get onmove() { return y(); }, set onmove(Y) { y(Y), g(); }, get oninit() { return w(); }, set oninit(Y) { w(Y), g(); }, get onnodeclick() { return m(); }, set onnodeclick(Y) { m(Y), g(); }, get onnodecontextmenu() { return b(); }, set onnodecontextmenu(Y) { b(Y), g(); }, get onnodedrag() { return $(); }, set onnodedrag(Y) { $(Y), g(); }, get onnodedragstart() { return _(); }, set onnodedragstart(Y) { _(Y), g(); }, get onnodedragstop() { return x(); }, set onnodedragstop(Y) { x(Y), g(); }, get onnodepointerenter() { return k(); }, set onnodepointerenter(Y) { k(Y), g(); }, get onnodepointermove() { return N(); }, set onnodepointermove(Y) { N(Y), g(); }, get onnodepointerleave() { return V(); }, set onnodepointerleave(Y) { V(Y), g(); }, get onselectionclick() { return j(); }, set onselectionclick(Y) { j(Y), g(); }, get onselectioncontextmenu() { return A(); }, set onselectioncontextmenu(Y) { A(Y), g(); }, get onselectionstart() { return H(); }, set onselectionstart(Y) { H(Y), g(); }, get onselectionend() { return z(); }, set onselectionend(Y) { z(Y), g(); }, get onedgeclick() { return S(); }, set onedgeclick(Y) { S(Y), g(); }, get onedgecontextmenu() { return T(); }, set onedgecontextmenu(Y) { T(Y), g(); }, get onedgepointerenter() { return C(); }, set onedgepointerenter(Y) { C(Y), g(); }, get onedgepointerleave() { return P(); }, set onedgepointerleave(Y) { P(Y), g(); }, get onpaneclick() { return M(); }, set onpaneclick(Y) { M(Y), g(); }, get onpanecontextmenu() { return K(); }, set onpanecontextmenu(Y) { K(Y), g(); }, get panOnScrollMode() { return B(); }, set panOnScrollMode(Y = ur.Free) { B(Y), g(); }, get preventScrolling() { return W(); }, set preventScrolling(Y = true) { W(Y), g(); }, get zoomOnScroll() { return D(); }, set zoomOnScroll(Y = true) { D(Y), g(); }, get zoomOnDoubleClick() { return X(); }, set zoomOnDoubleClick(Y = true) { X(Y), g(); }, get zoomOnPinch() { return q(); }, set zoomOnPinch(Y = true) { q(Y), g(); }, get panOnScroll() { return U(); }, set panOnScroll(Y = false) { U(Y), g(); }, get panOnScrollSpeed() { return I(); }, set panOnScrollSpeed(Y = 0.5) { I(Y), g(); }, get panOnDrag() { return F(); }, set panOnDrag(Y = true) { F(Y), g(); }, get selectionOnDrag() { return G(); }, set selectionOnDrag(Y = false) { G(Y), g(); }, get connectionLineComponent() { return te(); }, set connectionLineComponent(Y) { te(Y), g(); }, get connectionLineStyle() { return ne(); }, set connectionLineStyle(Y) { ne(Y), g(); }, get connectionLineContainerStyle() { return J(); }, set connectionLineContainerStyle(Y) { J(Y), g(); }, get connectionLineType() { return he(); }, set connectionLineType(Y = xn.Bezier) { he(Y), g(); }, get attributionPosition() { return ce(); }, set attributionPosition(Y) { ce(Y), g(); }, get children() { return re(); }, set children(Y) { re(Y), g(); }, get nodes() { return ie(); }, set nodes(Y = []) { ie(Y), g(); }, get edges() { return fe(); }, set edges(Y = []) { fe(Y), g(); }, get viewport() { return pe(); }, set viewport(Y = void 0) { pe(Y), g(); } }; return dd(e3, { get colorMode() { return de.colorMode; }, get width() { return n(); }, get height() { return r(); }, get rest() { return Ce; }, get domNode() { return de.domNode; }, set domNode(Y) { de.domNode = Y; }, get clientWidth() { return de.width; }, set clientWidth(Y) { de.width = Y; }, get clientHeight() { return de.height; }, set clientHeight(Y) { de.height = Y; }, children: (Y, je) => { var ze = Sm(), Ae = oe(ze); ld(Ae, { get selectionKey() { return i(); }, get deleteKey() { return s(); }, get panActivationKey() { return a(); }, get multiSelectionKey() { return l(); }, get zoomActivationKey() { return u(); }, get store() { return de; }, set store(Qe) { de = Qe; } }); var Ie = O(Ae, 2); qc(Ie, { get panOnScrollMode() { return B(); }, get preventScrolling() { return W(); }, get zoomOnScroll() { return D(); }, get zoomOnDoubleClick() { return X(); }, get zoomOnPinch() { return q(); }, get panOnScroll() { return U(); }, get panOnScrollSpeed() { return I(); }, get panOnDrag() { return F(); }, get paneClickDistance() { return d(); }, get selectionOnDrag() { return G(); }, get onmovestart() { return f(); }, get onmove() { return y(); }, get onmoveend() { return h(); }, get oninit() { return w(); }, get store() { return de; }, set store(Qe) { de = Qe; }, children: (Qe, ye) => { Xc(Qe, { get onpaneclick() { return M(); }, get onpanecontextmenu() { return K(); }, get onselectionstart() { return H(); }, get onselectionend() { return z(); }, get panOnDrag() { return F(); }, get paneClickDistance() { return d(); }, get selectionOnDrag() { return G(); }, get store() { return de; }, set store(Ye) { de = Ye; }, children: (Ye, De) => { var _e = km(), nt = oe(_e); Gc(nt, { get store() { return de; }, set store(Xe) { de = Xe; }, children: (Xe, wr) => { var sn = _m(), an = O(oe(sn), 2); sd(an, { get onedgeclick() { return S(); }, get onedgecontextmenu() { return T(); }, get onedgepointerenter() { return C(); }, get onedgepointerleave() { return P(); }, get store() { return de; }, set store(rr) { de = rr; } }); var ft = O(an, 4); ud(ft, { get type() { return he(); }, get LineComponent() { return te(); }, get containerStyle() { return J(); }, get style() { return ne(); }, get store() { return de; }, set store(rr) { de = rr; } }); var xt = O(ft, 2); nd(xt, { get nodeClickDistance() { return p(); }, get onnodeclick() { return m(); }, get onnodecontextmenu() { return b(); }, get onnodepointerenter() { return k(); }, get onnodepointermove() { return N(); }, get onnodepointerleave() { return V(); }, get onnodedrag() { return $(); }, get onnodedragstart() { return _(); }, get onnodedragstop() { return x(); }, get store() { return de; }, set store(rr) { de = rr; } }); var yn = O(xt, 2); ad(yn, { get onselectionclick() { return j(); }, get onselectioncontextmenu() { return A(); }, get onnodedrag() { return $(); }, get onnodedragstart() { return _(); }, get onnodedragstop() { return x(); }, get store() { return de; }, set store(rr) { de = rr; } }), ve(2), L(Xe, sn); }, $$slots: { default: true } }); var Tt = O(nt, 2); { let Xe = E(() => !!(de.selectionRect && de.selectionRectMode === "user")), wr = E(() => de.selectionRect?.width), sn = E(() => de.selectionRect?.height), an = E(() => de.selectionRect?.x), ft = E(() => de.selectionRect?.y); pa(Tt, { get isVisible() { return c(Xe); }, get width() { return c(wr); }, get height() { return c(sn); }, get x() { return c(an); }, get y() { return c(ft); } }); } L(Ye, _e); }, $$slots: { default: true } }); }, $$slots: { default: true } }); var tt = O(Ie, 2); cd(tt, { get proOptions() { return o(); }, get position() { return ce(); } }); var Mt = O(tt, 2); Qc(Mt, { get store() { return de; } }); var Ht = O(Mt, 2); Ge(Ht, () => re() ?? vt), L(Y, ze); }, $$slots: { default: true } }), ue(Oe); } se( fd, { width: {}, height: {}, proOptions: {}, selectionKey: {}, deleteKey: {}, panActivationKey: {}, multiSelectionKey: {}, zoomActivationKey: {}, paneClickDistance: {}, nodeClickDistance: {}, onmovestart: {}, onmoveend: {}, onmove: {}, oninit: {}, onnodeclick: {}, onnodecontextmenu: {}, onnodedrag: {}, onnodedragstart: {}, onnodedragstop: {}, onnodepointerenter: {}, onnodepointermove: {}, onnodepointerleave: {}, onselectionclick: {}, onselectioncontextmenu: {}, onselectionstart: {}, onselectionend: {}, onedgeclick: {}, onedgecontextmenu: {}, onedgepointerenter: {}, onedgepointerleave: {}, onpaneclick: {}, onpanecontextmenu: {}, panOnScrollMode: {}, preventScrolling: {}, zoomOnScroll: {}, zoomOnDoubleClick: {}, zoomOnPinch: {}, panOnScroll: {}, panOnScrollSpeed: {}, panOnDrag: {}, selectionOnDrag: {}, connectionLineComponent: {}, connectionLineStyle: {}, connectionLineContainerStyle: {}, connectionLineType: {}, attributionPosition: {}, children: {}, nodes: {}, edges: {}, viewport: {} }, [], [], true ); function pd(e3, t) { le(t, true); let n = v(t, "children", 7), r = Ee(Fc({ props: {}, nodes: [], edges: [] })); Mr(mi, { provider: true, getStore() { return c(r); }, setStore: (a) => { Q(r, a); } }), $o(() => { c(r).reset(); }); var o = { get children() { return n(); }, set children(a) { n(a), g(); } }, i = Se(), s = oe(i); return Ge(s, () => n() ?? vt), L(e3, i), ue(o); } se(pd, { children: {} }, [], [], true); var Em = ee(""); function Ur(e3, t) { le(t, true); let n = v(t, "class", 7), r = v(t, "bgColor", 7), o = v(t, "bgColorHover", 7), i = v(t, "color", 7), s = v(t, "colorHover", 7), a = v(t, "borderColor", 7), l = v(t, "onclick", 7), u = v(t, "children", 7), d = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "class", "bgColor", "bgColorHover", "color", "colorHover", "borderColor", "onclick", "children" ]); var p = { get class() { return n(); }, set class(y) { n(y), g(); }, get bgColor() { return r(); }, set bgColor(y) { r(y), g(); }, get bgColorHover() { return o(); }, set bgColorHover(y) { o(y), g(); }, get color() { return i(); }, set color(y) { i(y), g(); }, get colorHover() { return s(); }, set colorHover(y) { s(y), g(); }, get borderColor() { return a(); }, set borderColor(y) { a(y), g(); }, get onclick() { return l(); }, set onclick(y) { l(y), g(); }, get children() { return u(); }, set children(y) { u(y), g(); } }, f = Em(); ot(f, () => ({ type: "button", onclick: l(), class: ["svelte-flow__controls-button", n()], ...d, [cn]: { "--xy-controls-button-background-color-props": r(), "--xy-controls-button-background-color-hover-props": o(), "--xy-controls-button-color-props": i(), "--xy-controls-button-color-hover-props": s(), "--xy-controls-button-border-color-props": a() } })); var h = R(f); return Ge(h, () => u() ?? vt), Z(f), L(e3, f), ue(p); } se( Ur, { class: {}, bgColor: {}, bgColorHover: {}, color: {}, colorHover: {}, borderColor: {}, onclick: {}, children: {} }, [], [], true ); var Pm = ge(''); function hd(e3) { var t = Pm(); L(e3, t); } se(hd, {}, [], [], true); var Nm = ge(''); function gd(e3) { var t = Nm(); L(e3, t); } se(gd, {}, [], [], true); var Mm = ge(''); function vd(e3) { var t = Mm(); L(e3, t); } se(vd, {}, [], [], true); var Tm = ge(''); function md(e3) { var t = Tm(); L(e3, t); } se(md, {}, [], [], true); var Lm = ge(''); function yd(e3) { var t = Lm(); L(e3, t); } se(yd, {}, [], [], true); var Vm = ee(" ", 1); var Dm = ee(" ", 1); function wd(e3, t) { le(t, true); let n = v(t, "position", 7, "bottom-left"), r = v(t, "orientation", 7, "vertical"), o = v(t, "showZoom", 7, true), i = v(t, "showFitView", 7, true), s = v(t, "showLock", 7, true), a = v(t, "style", 7), l = v(t, "class", 7), u = v(t, "buttonBgColor", 7), d = v(t, "buttonBgColorHover", 7), p = v(t, "buttonColor", 7), f = v(t, "buttonColorHover", 7), h = v(t, "buttonBorderColor", 7), y = v(t, "fitViewOptions", 7), w = v(t, "children", 7), m = v(t, "before", 7), b = v(t, "after", 7), $ = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "position", "orientation", "showZoom", "showFitView", "showLock", "style", "class", "buttonBgColor", "buttonBgColorHover", "buttonColor", "buttonColorHover", "buttonBorderColor", "fitViewOptions", "children", "before", "after" ]), _ = E(rn); const x = { bgColor: u(), bgColorHover: d(), color: p(), colorHover: f(), borderColor: h() }; let k = E(() => c(_).nodesDraggable || c(_).nodesConnectable || c(_).elementsSelectable), N = E(() => c(_).viewport.zoom <= c(_).minZoom), V = E(() => c(_).viewport.zoom >= c(_).maxZoom), j = E(() => c(_).ariaLabelConfig), A = E(() => r() === "horizontal" ? "horizontal" : "vertical"); const H = () => { c(_).zoomIn(); }, z = () => { c(_).zoomOut(); }, S = () => { c(_).fitView(y()); }, T = () => { let P = !c(k); c(_).nodesDraggable = P, c(_).nodesConnectable = P, c(_).elementsSelectable = P; }; var C = { get position() { return n(); }, set position(P = "bottom-left") { n(P), g(); }, get orientation() { return r(); }, set orientation(P = "vertical") { r(P), g(); }, get showZoom() { return o(); }, set showZoom(P = true) { o(P), g(); }, get showFitView() { return i(); }, set showFitView(P = true) { i(P), g(); }, get showLock() { return s(); }, set showLock(P = true) { s(P), g(); }, get style() { return a(); }, set style(P) { a(P), g(); }, get class() { return l(); }, set class(P) { l(P), g(); }, get buttonBgColor() { return u(); }, set buttonBgColor(P) { u(P), g(); }, get buttonBgColorHover() { return d(); }, set buttonBgColorHover(P) { d(P), g(); }, get buttonColor() { return p(); }, set buttonColor(P) { p(P), g(); }, get buttonColorHover() { return f(); }, set buttonColorHover(P) { f(P), g(); }, get buttonBorderColor() { return h(); }, set buttonBorderColor(P) { h(P), g(); }, get fitViewOptions() { return y(); }, set fitViewOptions(P) { y(P), g(); }, get children() { return w(); }, set children(P) { w(P), g(); }, get before() { return m(); }, set before(P) { m(P), g(); }, get after() { return b(); }, set after(P) { b(P), g(); } }; { let P = E(() => [ "svelte-flow__controls", c(A), l() ]); To(e3, Be( { get class() { return c(P); }, get position() { return n(); }, "data-testid": "svelte-flow__controls", get "aria-label"() { return c(j)["controls.ariaLabel"]; }, get style() { return a(); } }, () => $, { children: (M, K) => { var B = Dm(), W = oe(B); { var D = (ce) => { var re = Se(), ie = oe(re); Ge(ie, m), L(ce, re); }; ae(W, (ce) => { m() && ce(D); }); } var X = O(W, 2); { var q = (ce) => { var re = Vm(), ie = oe(re); Ur(ie, Be( { onclick: H, class: "svelte-flow__controls-zoomin", get title() { return c(j)["controls.zoomIn.ariaLabel"]; }, get "aria-label"() { return c(j)["controls.zoomIn.ariaLabel"]; }, get disabled() { return c(V); } }, () => x, { children: (pe, Ce) => { hd(pe); }, $$slots: { default: true } } )); var fe = O(ie, 2); Ur(fe, Be( { onclick: z, class: "svelte-flow__controls-zoomout", get title() { return c(j)["controls.zoomOut.ariaLabel"]; }, get "aria-label"() { return c(j)["controls.zoomOut.ariaLabel"]; }, get disabled() { return c(N); } }, () => x, { children: (pe, Ce) => { gd(pe); }, $$slots: { default: true } } )), L(ce, re); }; ae(X, (ce) => { o() && ce(q); }); } var U = O(X, 2); { var I = (ce) => { Ur(ce, Be( { class: "svelte-flow__controls-fitview", onclick: S, get title() { return c(j)["controls.fitView.ariaLabel"]; }, get "aria-label"() { return c(j)["controls.fitView.ariaLabel"]; } }, () => x, { children: (re, ie) => { vd(re); }, $$slots: { default: true } } )); }; ae(U, (ce) => { i() && ce(I); }); } var F = O(U, 2); { var G = (ce) => { Ur(ce, Be( { class: "svelte-flow__controls-interactive", onclick: T, get title() { return c(j)["controls.interactive.ariaLabel"]; }, get "aria-label"() { return c(j)["controls.interactive.ariaLabel"]; } }, () => x, { children: (re, ie) => { var fe = Se(), pe = oe(fe); { var Ce = (we) => { yd(we); }, de = (we) => { md(we); }; ae(pe, (we) => { c(k) ? we(Ce) : we(de, false); }); } L(re, fe); }, $$slots: { default: true } } )); }; ae(F, (ce) => { s() && ce(G); }); } var te = O(F, 2); { var ne = (ce) => { var re = Se(), ie = oe(re); Ge(ie, w), L(ce, re); }; ae(te, (ce) => { w() && ce(ne); }); } var J = O(te, 2); { var he = (ce) => { var re = Se(), ie = oe(re); Ge(ie, b), L(ce, re); }; ae(J, (ce) => { b() && ce(he); }); } L(M, B); }, $$slots: { default: true } } )); } return ue(C); } se( wd, { position: {}, orientation: {}, showZoom: {}, showFitView: {}, showLock: {}, style: {}, class: {}, buttonBgColor: {}, buttonBgColorHover: {}, buttonColor: {}, buttonColorHover: {}, buttonBorderColor: {}, fitViewOptions: {}, children: {}, before: {}, after: {} }, [], [], true ); var kn; (function(e3) { e3.Lines = "lines", e3.Dots = "dots", e3.Cross = "cross"; })(kn || (kn = {})); var Om = ge(""); function bd(e3, t) { le(t, true); let n = v(t, "radius", 7), r = v(t, "class", 7); var o = { get radius() { return n(); }, set radius(s) { n(s), g(); }, get class() { return r(); }, set class(s) { r(s), g(); } }, i = Om(); return $e(() => { xe(i, "cx", n()), xe(i, "cy", n()), xe(i, "r", n()), Pt(i, 0, An(["svelte-flow__background-pattern", "dots", r()])); }), L(e3, i), ue(o); } se(bd, { radius: {}, class: {} }, [], [], true); var zm = ge(""); function xd(e3, t) { le(t, true); let n = v(t, "lineWidth", 7), r = v(t, "dimensions", 7), o = v(t, "variant", 7), i = v(t, "class", 7); var s = { get lineWidth() { return n(); }, set lineWidth(l) { n(l), g(); }, get dimensions() { return r(); }, set dimensions(l) { r(l), g(); }, get variant() { return o(); }, set variant(l) { o(l), g(); }, get class() { return i(); }, set class(l) { i(l), g(); } }, a = zm(); return $e(() => { xe(a, "stroke-width", n()), xe(a, "d", `M${r()[0] / 2} 0 V${r()[1]} M0 ${r()[1] / 2} H${r()[0]}`), Pt(a, 0, An(["svelte-flow__background-pattern", o(), i()])); }), L(e3, a), ue(s); } se(xd, { lineWidth: {}, dimensions: {}, variant: {}, class: {} }, [], [], true); var Am = { [kn.Dots]: 1, [kn.Lines]: 1, [kn.Cross]: 6 }; var Hm = ge(''); function Cd(e3, t) { le(t, true); let n = v(t, "id", 7), r = v(t, "variant", 23, () => kn.Dots), o = v(t, "gap", 7, 20), i = v(t, "size", 7), s = v(t, "lineWidth", 7, 1), a = v(t, "bgColor", 7), l = v(t, "patternColor", 7), u = v(t, "patternClass", 7), d = v(t, "class", 7), p = E(rn), f = E(() => r() === kn.Dots), h = E(() => r() === kn.Cross), y = E(() => Array.isArray(o()) ? o() : [o(), o()]), w = E(() => `background-pattern-${c(p).flowId}-${n() ?? ""}`), m = E(() => [ c(y)[0] * c(p).viewport.zoom || 1, c(y)[1] * c(p).viewport.zoom || 1 ]), b = E(() => (i() ?? Am[r()]) * c(p).viewport.zoom), $ = E(() => c(h) ? [c(b), c(b)] : c(m)), _ = E(() => c(f) ? [c(b) / 2, c(b) / 2] : [ c($)[0] / 2, c($)[1] / 2 ]); var x = { get id() { return n(); }, set id(S) { n(S), g(); }, get variant() { return r(); }, set variant(S = kn.Dots) { r(S), g(); }, get gap() { return o(); }, set gap(S = 20) { o(S), g(); }, get size() { return i(); }, set size(S) { i(S), g(); }, get lineWidth() { return s(); }, set lineWidth(S = 1) { s(S), g(); }, get bgColor() { return a(); }, set bgColor(S) { a(S), g(); }, get patternColor() { return l(); }, set patternColor(S) { l(S), g(); }, get patternClass() { return u(); }, set patternClass(S) { u(S), g(); }, get class() { return d(); }, set class(S) { d(S), g(); } }, k = Hm(); let N; var V = R(k), j = R(V); { var A = (S) => { { let T = E(() => c(b) / 2); bd(S, { get radius() { return c(T); }, get class() { return u(); } }); } }, H = (S) => { xd(S, { get dimensions() { return c($); }, get variant() { return r(); }, get lineWidth() { return s(); }, get class() { return u(); } }); }; ae(j, (S) => { c(f) ? S(A) : S(H, false); }); } Z(V); var z = O(V); return Z(k), $e(() => { Pt(k, 0, An([ "svelte-flow__background", "svelte-flow__container", d() ])), N = dt(k, "", N, { "--xy-background-color-props": a(), "--xy-background-pattern-color-props": l() }), xe(V, "id", c(w)), xe(V, "x", c(p).viewport.x % c(m)[0]), xe(V, "y", c(p).viewport.y % c(m)[1]), xe(V, "width", c(m)[0]), xe(V, "height", c(m)[1]), xe(V, "patternTransform", `translate(-${c(_)[0]},-${c(_)[1]})`), xe(z, "fill", `url(#${c(w)})`); }), L(e3, k), ue(x); } se( Cd, { id: {}, variant: {}, gap: {}, size: {}, lineWidth: {}, bgColor: {}, patternColor: {}, patternClass: {}, class: {} }, [], [], true ); var Im = ge(""); function $d(e3, t) { le(t, true); let n = v(t, "id", 7), r = v(t, "x", 7), o = v(t, "y", 7), i = v(t, "width", 7), s = v(t, "height", 7), a = v(t, "borderRadius", 7, 5), l = v(t, "color", 7), u = v(t, "shapeRendering", 7), d = v(t, "strokeColor", 7), p = v(t, "strokeWidth", 7, 2), f = v(t, "selected", 7), h = v(t, "class", 7), y = v(t, "nodeComponent", 7); var w = { get id() { return n(); }, set id(x) { n(x), g(); }, get x() { return r(); }, set x(x) { r(x), g(); }, get y() { return o(); }, set y(x) { o(x), g(); }, get width() { return i(); }, set width(x) { i(x), g(); }, get height() { return s(); }, set height(x) { s(x), g(); }, get borderRadius() { return a(); }, set borderRadius(x = 5) { a(x), g(); }, get color() { return l(); }, set color(x) { l(x), g(); }, get shapeRendering() { return u(); }, set shapeRendering(x) { u(x), g(); }, get strokeColor() { return d(); }, set strokeColor(x) { d(x), g(); }, get strokeWidth() { return p(); }, set strokeWidth(x = 2) { p(x), g(); }, get selected() { return f(); }, set selected(x) { f(x), g(); }, get class() { return h(); }, set class(x) { h(x), g(); }, get nodeComponent() { return y(); }, set nodeComponent(x) { y(x), g(); } }, m = Se(), b = oe(m); { var $ = (x) => { const k = E(y); var N = Se(), V = oe(N); Ti(V, () => c(k), (j, A) => { A(j, { get id() { return n(); }, get x() { return r(); }, get y() { return o(); }, get width() { return i(); }, get height() { return s(); }, get borderRadius() { return a(); }, get class() { return h(); }, get color() { return l(); }, get shapeRendering() { return u(); }, get strokeColor() { return d(); }, get strokeWidth() { return p(); }, get selected() { return f(); } }); }), L(x, N); }, _ = (x) => { var k = Im(); let N, V; $e(() => { N = Pt(k, 0, An(["svelte-flow__minimap-node", h()]), null, N, { selected: f() }), xe(k, "x", r()), xe(k, "y", o()), xe(k, "rx", a()), xe(k, "ry", a()), xe(k, "width", i()), xe(k, "height", s()), xe(k, "shape-rendering", u()), V = dt(k, "", V, { fill: l(), stroke: d(), "stroke-width": p() }); }), L(x, k); }; ae(b, (x) => { y() ? x($) : x(_, false); }); } return L(e3, m), ue(w); } se( $d, { id: {}, x: {}, y: {}, width: {}, height: {}, borderRadius: {}, color: {}, shapeRendering: {}, strokeColor: {}, strokeWidth: {}, selected: {}, class: {}, nodeComponent: {} }, [], [], true ); function Zm(e3, t) { const n = S0({ domNode: e3, panZoom: t.panZoom, getTransform: () => { const { viewport: o } = t.store; return [o.x, o.y, o.zoom]; }, getViewScale: t.getViewScale }); n.update({ translateExtent: t.translateExtent, width: t.width, height: t.height, inversePan: t.inversePan, zoomStep: t.zoomStep, pannable: t.pannable, zoomable: t.zoomable }); function r(o) { n.update({ translateExtent: o.translateExtent, width: o.width, height: o.height, inversePan: o.inversePan, zoomStep: o.zoomStep, pannable: o.pannable, zoomable: o.zoomable }); } return { update: r, destroy() { n.destroy(); } }; } var rs = (e3) => e3 instanceof Function ? e3 : () => e3; var jm = ge(" "); var Km = ge(''); var Rm = ee('', 1); function _d(e3, t) { le(t, true); let n = v(t, "position", 7, "bottom-right"), r = v(t, "ariaLabel", 7), o = v(t, "nodeStrokeColor", 7, "transparent"), i = v(t, "nodeColor", 7), s = v(t, "nodeClass", 7, ""), a = v(t, "nodeBorderRadius", 7, 5), l = v(t, "nodeStrokeWidth", 7, 2), u = v(t, "nodeComponent", 7), d = v(t, "bgColor", 7), p = v(t, "maskColor", 7), f = v(t, "maskStrokeColor", 7), h = v(t, "maskStrokeWidth", 7), y = v(t, "width", 7, 200), w = v(t, "height", 7, 150), m = v(t, "pannable", 7, true), b = v(t, "zoomable", 7, true), $ = v(t, "inversePan", 7), _ = v(t, "zoomStep", 7), x = v(t, "class", 7), k = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "position", "ariaLabel", "nodeStrokeColor", "nodeColor", "nodeClass", "nodeBorderRadius", "nodeStrokeWidth", "nodeComponent", "bgColor", "maskColor", "maskStrokeColor", "maskStrokeWidth", "width", "height", "pannable", "zoomable", "inversePan", "zoomStep", "class" ]), N = E(rn), V = E(() => c(N).ariaLabelConfig); const j = i() === void 0 ? void 0 : rs(i()), A = rs(o()), H = rs(s()), z = ( // @ts-expect-error - TS doesn't know about chrome typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision" ); let S = E(() => `svelte-flow__minimap-desc-${c(N).flowId}`), T = E(() => ({ x: -c(N).viewport.x / c(N).viewport.zoom, y: -c(N).viewport.y / c(N).viewport.zoom, width: c(N).width / c(N).viewport.zoom, height: c(N).height / c(N).viewport.zoom })), C = E(() => yc(Eo(c(N).nodeLookup, { filter: (J) => !J.hidden }), c(T))), P = E(() => c(C).width / y()), M = E(() => c(C).height / w()), K = E(() => Math.max(c(P), c(M))), B = E(() => c(K) * y()), W = E(() => c(K) * w()), D = E(() => 5 * c(K)), X = E(() => c(C).x - (c(B) - c(C).width) / 2 - c(D)), q = E(() => c(C).y - (c(W) - c(C).height) / 2 - c(D)), U = E(() => c(B) + c(D) * 2), I = E(() => c(W) + c(D) * 2); const F = () => c(K); var G = { get position() { return n(); }, set position(J = "bottom-right") { n(J), g(); }, get ariaLabel() { return r(); }, set ariaLabel(J) { r(J), g(); }, get nodeStrokeColor() { return o(); }, set nodeStrokeColor(J = "transparent") { o(J), g(); }, get nodeColor() { return i(); }, set nodeColor(J) { i(J), g(); }, get nodeClass() { return s(); }, set nodeClass(J = "") { s(J), g(); }, get nodeBorderRadius() { return a(); }, set nodeBorderRadius(J = 5) { a(J), g(); }, get nodeStrokeWidth() { return l(); }, set nodeStrokeWidth(J = 2) { l(J), g(); }, get nodeComponent() { return u(); }, set nodeComponent(J) { u(J), g(); }, get bgColor() { return d(); }, set bgColor(J) { d(J), g(); }, get maskColor() { return p(); }, set maskColor(J) { p(J), g(); }, get maskStrokeColor() { return f(); }, set maskStrokeColor(J) { f(J), g(); }, get maskStrokeWidth() { return h(); }, set maskStrokeWidth(J) { h(J), g(); }, get width() { return y(); }, set width(J = 200) { y(J), g(); }, get height() { return w(); }, set height(J = 150) { w(J), g(); }, get pannable() { return m(); }, set pannable(J = true) { m(J), g(); }, get zoomable() { return b(); }, set zoomable(J = true) { b(J), g(); }, get inversePan() { return $(); }, set inversePan(J) { $(J), g(); }, get zoomStep() { return _(); }, set zoomStep(J) { _(J), g(); }, get class() { return x(); }, set class(J) { x(J), g(); } }, te = Rm(), ne = oe(te); { let J = E(() => ["svelte-flow__minimap", x()]); zp(ne, () => ({ "--xy-minimap-background-color-props": d() })), To(ne.lastChild, Be( { get position() { return n(); }, get class() { return c(J); }, "data-testid": "svelte-flow__minimap" }, () => k, { children: (he, ce) => { var re = Se(), ie = oe(re); { var fe = (pe) => { var Ce = Km(); let de; var we = R(Ce); { var Oe = (ze) => { var Ae = jm(), Ie = R(Ae, true); Z(Ae), $e(() => { xe(Ae, "id", c(S)), Re(Ie, r() ?? c(V)["minimap.ariaLabel"]); }), L(ze, Ae); }; ae(we, (ze) => { (r() ?? c(V)["minimap.ariaLabel"]) && ze(Oe); }); } var Y = O(we); mt(Y, 17, () => c(N).nodes, (ze) => ze.id, (ze, Ae) => { const Ie = E(() => c(N).nodeLookup.get(c(Ae).id)); var tt = Se(), Mt = oe(tt); { var Ht = (Qe) => { const ye = E(() => tr(c(Ie))); { let Ye = E(() => j?.(c(Ie))), De = E(() => A(c(Ie))), _e = E(() => H(c(Ie))); $d(Qe, Be( { get id() { return c(Ie).id; }, get x() { return c(Ie).internals.positionAbsolute.x; }, get y() { return c(Ie).internals.positionAbsolute.y; } }, () => c(ye), { get selected() { return c(Ie).selected; }, get nodeComponent() { return u(); }, get color() { return c(Ye); }, get borderRadius() { return a(); }, get strokeColor() { return c(De); }, get strokeWidth() { return l(); }, get shapeRendering() { return z; }, get class() { return c(_e); } } )); } }; ae(Mt, (Qe) => { c(Ie) && wc(c(Ie)) && !c(Ie).hidden && Qe(Ht); }); } L(ze, tt); }); var je = O(Y); Z(Ce), pt(Ce, (ze, Ae) => Zm?.(ze, Ae), () => ({ store: c(N), panZoom: c(N).panZoom, getViewScale: F, translateExtent: c(N).translateExtent, width: c(N).width, height: c(N).height, inversePan: $(), zoomStep: _(), pannable: m(), zoomable: b() })), $e(() => { xe(Ce, "width", y()), xe(Ce, "height", w()), xe(Ce, "viewBox", `${c(X) ?? ""} ${c(q) ?? ""} ${c(U) ?? ""} ${c(I) ?? ""}`), xe(Ce, "aria-labelledby", c(S)), de = dt(Ce, "", de, { "--xy-minimap-mask-background-color-props": p(), "--xy-minimap-mask-stroke-color-props": f(), "--xy-minimap-mask-stroke-width-props": h() ? h() * c(K) : void 0 }), xe(je, "d", `M${c(X) - c(D)},${c(q) - c(D)}h${c(U) + c(D) * 2}v${c(I) + c(D) * 2}h${-c(U) - c(D) * 2}z M${c(T).x ?? ""},${c(T).y ?? ""}h${c(T).width ?? ""}v${c(T).height ?? ""}h${-c(T).width}z`); }), L(pe, Ce); }; ae(ie, (pe) => { c(N).panZoom && pe(fe); }); } L(he, re); }, $$slots: { default: true } } )), Z(ne); } return L(e3, te), ue(G); } se( _d, { position: {}, ariaLabel: {}, nodeStrokeColor: {}, nodeColor: {}, nodeClass: {}, nodeBorderRadius: {}, nodeStrokeWidth: {}, nodeComponent: {}, bgColor: {}, maskColor: {}, maskStrokeColor: {}, maskStrokeWidth: {}, width: {}, height: {}, pannable: {}, zoomable: {}, inversePan: {}, zoomStep: {}, class: {} }, [], [], true ); var Bm = ee("
"); function kd(e3, t) { le(t, true); let n = v(t, "nodeId", 7), r = v(t, "position", 23, () => me.Top), o = v(t, "align", 7, "center"), i = v(t, "offset", 7, 10), s = v(t, "isVisible", 7), a = v(t, "children", 7), l = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "nodeId", "position", "align", "offset", "isVisible", "children" ]); const u = rn(), { getNodesBounds: d } = st(), p = Fn("svelteflow__node_id"); let f = E(() => (u.nodes, (Array.isArray(n()) ? n() : [n() ?? p]).reduce( (k, N) => { const V = u.nodeLookup.get(N); return V && k.push(V), k; }, [] ))), h = E(() => { const k = d(c(f)); return k ? i0(k, u.viewport, r(), i(), o()) : ""; }), y = E(() => c(f).length === 0 ? 1 : Math.max(...c(f).map((k) => (k.internals.z || 5) + 1))), w = E(() => u.nodes.filter((k) => k.selected).length), m = E(() => typeof s() == "boolean" ? s() : c(f).length === 1 && c(f)[0].selected && c(w) === 1); var b = { get nodeId() { return n(); }, set nodeId(k) { n(k), g(); }, get position() { return r(); }, set position(k = me.Top) { r(k), g(); }, get align() { return o(); }, set align(k = "center") { o(k), g(); }, get offset() { return i(); }, set offset(k = 10) { i(k), g(); }, get isVisible() { return s(); }, set isVisible(k) { s(k), g(); }, get children() { return a(); }, set children(k) { a(k), g(); } }, $ = Se(), _ = oe($); { var x = (k) => { var N = Bm(); ot( N, (j, A) => ({ class: "svelte-flow__node-toolbar", "data-id": j, ...l, [cn]: A }), [ () => c(f).reduce((j, A) => `${j}${A.id} `, "").trim(), () => ({ display: Zc().value ? "none" : void 0, position: "absolute", transform: c(h), "z-index": c(y) }) ] ); var V = R(N); Ge(V, () => a() ?? vt), Z(N), pt(N, (j, A) => Ic?.(j, A), () => "root"), L(k, N); }; ae(_, (k) => { u.domNode && c(m) && c(f) && k(x); }); } return L(e3, $), ue(b); } se( kd, { nodeId: {}, position: {}, align: {}, offset: {}, isVisible: {}, children: {} }, [], [], true ); function Hn(e3) { const t = E(rn), n = E(() => c(t).nodes), r = E(() => c(t).nodeLookup); let o = [], i = true; const s = E(() => { c(n); const a = [], l = Array.isArray(e3), u = l ? e3 : [e3]; for (const d of u) { const p = c(r).get(d)?.internals.userNode; p && a.push({ id: p.id, type: p.type, data: p.data }); } return (!m0(a, o) || i) && (o = a, i = false), l ? o : o[0] ?? null; }); return { get current() { return c(s); } }; } var bl = "tinyflow-component"; var Wm = [ { value: "String", label: "String" }, { value: "Number", label: "Number" }, { value: "Boolean", label: "Boolean" }, { value: "File", label: "File" }, { value: "Object", label: "Object" }, { value: "Array", label: "Array" } ]; var Ym = [ { value: "ref", label: "引用" }, { value: "fixed", label: "固定值" } // { // value: 'input', // label: '输入' // } ]; var ha = [ { label: "文字", value: "text" }, { label: "图片", value: "image" }, { label: "视频", value: "video" }, { label: "音频", value: "audio" }, { label: "文件", value: "file" }, { label: "其他", value: "other" } ]; var Fm = [ { label: "单行输入框", value: "input" }, { label: "多行输入框", value: "textarea" }, { label: "下拉菜单", value: "select" }, { label: "单选", value: "radio" }, { label: "多选", value: "checkbox" } ]; var qm = [ { label: "单选", value: "radio" }, { label: "多选", value: "checkbox" } ]; var Xm = class { options; rootEl; svelteFlowInstance; constructor(t) { if (typeof t.element != "string" && !(t.element instanceof Element)) throw new Error("element must be a string or Element"); this._setOptions(t), this._init(); } _init() { if (typeof this.options.element == "string") { if (this.rootEl = document.querySelector(this.options.element), !this.rootEl) throw new Error( `element not found by document.querySelector('${this.options.element}')` ); } else if (this.options.element instanceof Element) this.rootEl = this.options.element; else throw new Error("element must be a string or Element"); const t = document.createElement(bl); t.style.display = "block", t.style.width = "100%", t.style.height = "100%", t.classList.add("tf-theme-light"), t.options = this.options, t.onInit = (n) => { this.svelteFlowInstance = n; }, this.rootEl.appendChild(t); } _setOptions(t) { this.options = { ...t }; } getOptions() { return this.options; } getData() { return this.svelteFlowInstance.toObject(); } setData(t) { this.options.data = t; const n = document.createElement(bl); n.style.display = "block", n.style.width = "100%", n.style.height = "100%", n.classList.add("tf-theme-light"), n.options = this.options, n.onInit = (r) => { this.svelteFlowInstance = r; }, this.destroy(), this.rootEl.appendChild(n); } destroy() { for (; this.rootEl.firstChild; ) this.rootEl.removeChild(this.rootEl.firstChild); } }; var Gm = () => { let e3 = Ee([]), t = Ee([]), n = Ee({ x: 250, y: 100, zoom: 1 }); return { // nodes: nodesInternal, // edges: edgesInternal, // viewport, init: (r, o) => { Q(e3, r), Q(t, o); }, getNodes: () => c(e3), setNodes: (r) => { Q(e3, r); }, getEdges: () => c(t), setEdges: (r) => { Q(t, r); }, getViewport: () => c(n), setViewport: (r) => { Q(n, r); }, getNode: (r) => c(e3).find((o) => o.id === r), addNode: (r) => { Q(e3, [...c(e3), r]); }, removeNode: (r) => { Q(e3, c(e3).filter((o) => o.id !== r)); }, updateNode: (r, o) => { Q(e3, c(e3).map((i) => i.id === r ? { ...i, ...o } : i)); }, updateNodes: (r) => { Q(e3, r(c(e3))); }, updateNodeData: (r, o) => { Q(e3, c(e3).map((i) => i.id === r ? { ...i, data: { ...i.data, ...o } } : i)); }, selectNodeOnly: (r) => { Q(e3, c(e3).map((o) => o.id === r ? { ...o, selected: true } : { ...o, selected: false })); }, getEdge: (r) => c(t).find((o) => o.id === r), addEdge: (r) => { Q(t, [...c(t), r]); }, removeEdge: (r) => { Q(t, c(t).filter((o) => o.id !== r)); }, updateEdge: (r, o) => { Q(t, c(t).map((i) => i.id === r ? { ...i, ...o } : i)); }, updateEdges: (r) => { Q(t, r(c(t))); }, updateEdgeData: (r, o) => { Q(t, c(t).map((i) => i.id === r ? { ...i, data: { ...i.data, ...o } } : i)); } }; }; var Le = Gm(); var Um = ee(""); function Me(e3, t) { le(t, true); const n = v(t, "children", 7), r = v(t, "primary", 7), o = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "children", "primary" ]); var i = { get children() { return n(); }, set children(l) { n(l), g(); }, get primary() { return r(); }, set primary(l) { r(l), g(); } }, s = Um(); ot(s, () => ({ type: "button", ...o, class: `tf-btn ${r() ? "tf-btn-primary" : ""} nopan nodrag ${t.class ?? ""}` })); var a = R(s); return Ge(a, () => n() ?? vt), Z(s), L(e3, s), ue(i); } se(Me, { children: {}, primary: {} }, [], [], true); var Qm = ee(""); function Sd(e3, t) { le(t, true); const n = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host"]); var r = Qm(); ot( r, () => ({ type: "checkbox", ...n, class: `tf-checkbox nopan nodrag ${t.class ?? ""}` }), void 0, void 0, void 0, void 0, true ), L(e3, r), ue(); } se(Sd, {}, [], [], true); var Jm = ee('
'); var ey = { hash: "svelte-1o3a23c", code: ".tf-chosen.svelte-1o3a23c {display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:5px;}" }; function Ed(e3, t) { le(t, true), He(e3, ey); const n = v(t, "placeholder", 7), r = v(t, "label", 7), o = v(t, "value", 7), i = v(t, "buttonText", 7, "选择..."), s = v(t, "onChosen", 7), a = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "placeholder", "label", "value", "buttonText", "onChosen" ]); var l = { get placeholder() { return n(); }, set placeholder(h) { n(h), g(); }, get label() { return r(); }, set label(h) { r(h), g(); }, get value() { return o(); }, set value(h) { o(h), g(); }, get buttonText() { return i(); }, set buttonText(h = "选择...") { i(h), g(); }, get onChosen() { return s(); }, set onChosen(h) { s(h), g(); } }, u = Jm(); ot( u, () => ({ ...a, class: `tf-chosen nopan nodrag ${t.class ?? ""}` }), void 0, void 0, void 0, "svelte-1o3a23c" ); var d = R(u); Cn(d); var p = O(d, 2); Je(p, { get value() { return r(); }, get placeholder() { return n(); }, style: "flex-grow: 1;", disabled: true }); var f = O(p, 2); return Me(f, { onclick: (h) => { s()?.(o(), r(), h); }, style: "padding: 3px", children: (h, y) => { ve(); var w = ke(); $e(() => Re(w, i())), L(h, w); }, $$slots: { default: true } }), Z(u), $e(() => Yo(d, o())), L(e3, u), ue(l); } se( Ed, { placeholder: {}, label: {}, value: {}, buttonText: {}, onChosen: {} }, [], [], true ); var ty = ee(""); function Je(e3, t) { le(t, true); const n = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host"]); var r = ty(); ot( r, () => ({ type: "text", spellcheck: "false", ...n, class: `tf-input nopan nodrag ${t.class ?? ""}` }), void 0, void 0, void 0, void 0, true ), L(e3, r), ue(); } se(Je, {}, [], [], true); var ny = ee(""); function Ke(e3, t) { le(t, true); const n = v(t, "value", 7), r = v(t, "height", 7), o = v(t, "autoHeight", 7, true), i = v(t, "maxHeight", 7), s = v(t, "onHeightChange", 7), a = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "value", "height", "autoHeight", "maxHeight", "onHeightChange" ]); let l, u; function d() { if (l && o()) { if (r() !== void 0) { const m = typeof r() == "number" ? `${r()}px` : r(); l.style.height = m, l.style.overflowY = "hidden", s()?.(m); return; } l.style.height = "auto", l.style.overflowY = "hidden"; let w = l.scrollHeight; if (!u) { const m = t.rows || 1, b = getComputedStyle(l); u = parseFloat(b.fontSize) * 1.2 * m + parseFloat(b.paddingTop) + parseFloat(b.paddingBottom) + parseFloat(b.borderTopWidth); } if (w < u && (w = u), i()) { const m = typeof i() == "number" ? `${i()}px` : i(); w > parseInt(m) ? (l.style.height = m, l.style.overflowY = "auto") : l.style.height = `${w}px`; } else l.style.height = `${w}px`; s()?.(l.style.height); } } qe(() => { d(); }); var p = { get value() { return n(); }, set value(w) { n(w), g(); }, get height() { return r(); }, set height(w) { r(w), g(); }, get autoHeight() { return o(); }, set autoHeight(w = true) { o(w), g(); }, get maxHeight() { return i(); }, set maxHeight(w) { i(w), g(); }, get onHeightChange() { return s(); }, set onHeightChange(w) { s(w), g(); } }, f = ny(); pp(f); var h = (w) => { d(), t.oninput?.(w); }, y = (w) => { d(), t.onchange?.(w); }; return ot(f, () => ({ spellcheck: "false", ...a, oninput: h, onchange: y, class: `tf-textarea nodrag nowheel ${t.class ?? ""}`, value: n() || "" })), Nt(f, (w) => l = w, () => l), L(e3, f), ue(p); } se( Ke, { value: {}, height: {}, autoHeight: {}, maxHeight: {}, onHeightChange: {} }, [], [], true ); var ry = ee('
'); var oy = ee("
"); function Pd(e3, t) { const n = Oa(t, ["children", "$$slots", "$$events", "$$legacy", "$$host"]), r = Oa(n, ["items", "onChange", "activeIndex"]); le(t, false); let o = v(t, "items", 28, () => []), i = v(t, "onChange", 12, () => { }), s = v(t, "activeIndex", 12, 0); function a(d, p) { s(p), i()?.(d, p); } var l = { get items() { return o(); }, set items(d) { o(d), g(); }, get onChange() { return i(); }, set onChange(d) { i(d), g(); }, get activeIndex() { return s(); }, set activeIndex(d) { s(d), g(); } }; Ou(); var u = oy(); return ot(u, () => ({ ...r, class: `tf-tabs ${Ys(r), lt(() => r.class) ?? ""}` })), mt(u, 5, o, Lr, (d, p, f) => { var h = ry(); xe(h, "tabindex", f), h.__click = () => a(c(p), f), h.__keydown = (b) => { (b.key === "Enter" || b.key === " ") && (b.preventDefault(), a(c(p), f)); }; var y = R(h); { var w = (b) => { var $ = ke(); $e(() => Re($, (c(p), lt(() => c(p).label)))), L(b, $); }, m = (b) => { var $ = Se(), _ = oe($); Ge(_, () => (c(p), lt(() => c(p).label) ?? vt)), L(b, $); }; ae(y, (b) => { c(p), lt(() => typeof c(p).label == "string") ? b(w) : b(m, false); }); } Z(h), $e(() => Pt(h, 1, `tf-tabs-item ${f === s() ? "active" : ""}`)), L(d, h); }), Z(u), L(e3, u), ue(l); } er(["click", "keydown"]); se(Pd, { items: {}, onChange: {}, activeIndex: {} }, [], [], true); var iy = ee(''); var sy = ee('
'); var ay = ee('
'); var ly = ee('
'); var uy = ee("
"); var cy = { hash: "svelte-ynwjxt", code: ` /* 定义旋转的 CSS 类 */.rotate-90.svelte-ynwjxt {transform:rotate(90deg);transition:transform 0.3s ease;}` }; function Nd(e3, t) { le(t, true), He(e3, cy); let n = v(t, "items", 7), r = v(t, "onChange", 7), o = v(t, "activeKeys", 31, () => Rt([])); function i(l) { o().includes(l.key) ? o(o().filter((u) => u !== l.key)) : (o().push(l.key), o(o())), r()?.(l, o()); } var s = { get items() { return n(); }, set items(l) { n(l), g(); }, get onChange() { return r(); }, set onChange(l) { r(l), g(); }, get activeKeys() { return o(); }, set activeKeys(l = []) { o(l), g(); } }, a = uy(); return mt(a, 21, n, Lr, (l, u, d) => { var p = ly(), f = R(p); xe(f, "tabindex", d), f.__click = () => i(c(u)), f.__keydown = (k) => { (k.key === "Enter" || k.key === " ") && (k.preventDefault(), i(c(u))); }; var h = R(f); { var y = (k) => { var N = iy(), V = R(N); Kn(V, { get target() { return c(u).icon; } }), Z(N), L(k, N); }; ae(h, (k) => { c(u).icon && k(y); }); } var w = O(h, 2); Kn(w, { get target() { return c(u).title; } }); var m = O(w, 2); Z(f); var b = O(f, 2); { var $ = (k) => { var N = sy(), V = R(N); Kn(V, { get target() { return c(u).description; } }), Z(N), L(k, N); }; ae(b, (k) => { c(u).description && k($); }); } var _ = O(b, 2); { var x = (k) => { var N = ay(), V = R(N); Kn(V, { get target() { return c(u).content; } }), Z(N), L(k, N); }; ae(_, (k) => { o().includes(c(u).key) && k(x); }); } Z(p), $e((k) => Pt(m, 1, `tf-collapse-item-title-arrow ${k ?? ""}`, "svelte-ynwjxt"), [ () => o().includes(c(u).key) ? "rotate-90" : "" ]), L(l, p); }), Z(a), $e(() => { dt(a, t.style), Pt(a, 1, `tf-collapse ${t.class ?? ""}`, "svelte-ynwjxt"); }), L(e3, a), ue(s); } er(["click", "keydown"]); se(Nd, { items: {}, onChange: {}, activeKeys: {} }, [], [], true); function Kn(e3, t) { le(t, true); let n = v(t, "target", 7); typeof n() > "u" && n("undefined"); var r = { get target() { return n(); }, set target(l) { n(l), g(); } }, o = Se(), i = oe(o); { var s = (l) => { var u = Se(), d = oe(u); Ge(d, () => n() ?? vt), L(l, u); }, a = (l) => { var u = Se(), d = oe(u); Xs(d, n), L(l, u); }; ae(i, (l) => { typeof n() == "function" ? l(s) : l(a, false); }); } return L(e3, o), ue(r); } se(Kn, { target: {} }, [], [], true); var dy = ge(''); var fy = ee('
'); var py = ee(' ', 1); var hy = ee('
'); var gy = ee(" ", 1); var vy = ee('
'); var my = ee(''); var yy = ee("
"); function ut(e3, t) { le(t, true); const n = ($, _ = vt) => { var x = Se(), k = oe(x); mt(k, 19, _, (N, V) => `${V}_${N.value}`, (N, V) => { var j = py(), A = oe(j); A.__click = () => y(c(V)); var H = R(A), z = R(H); { var S = (M) => { var K = dy(); L(M, K); }; ae(z, (M) => { c(V).children && c(V).children.length > 0 && M(S); }); } Z(H); var T = O(H, 2); Kn(T, { get target() { return c(V).label; } }), Z(A); var C = O(A, 2); { var P = (M) => { var K = fy(), B = R(K); n(B, () => c(V).children), Z(K), L(M, K); }; ae(C, (M) => { c(V).children && c(V).children.length > 0 && (a() || u().includes(c(V).value)) && M(P); }); } L(N, j); }), L($, x); }; let r = v(t, "items", 7), o = v(t, "onSelect", 7), i = v(t, "value", 23, () => []), s = v(t, "defaultValue", 23, () => []), a = v(t, "expandAll", 7, true), l = v(t, "multiple", 7, false), u = v(t, "expandValue", 23, () => []), d = v(t, "placeholder", 7), p = Ze(t, [ "$$slots", "$$events", "$$legacy", "$$host", "items", "onSelect", "value", "defaultValue", "expandAll", "multiple", "expandValue", "placeholder" ]), f = E(() => { const $ = [], _ = (x) => { for (let k of x) i().length > 0 ? i().includes(k.value) && $.push(k) : s().includes(k.value) && $.push(k), k.children && k.children.length > 0 && _(k.children); }; return _(r()), $; }), h; function y($) { h?.hide(), o()?.($); } var w = { get items() { return r(); }, set items($) { r($), g(); }, get onSelect() { return o(); }, set onSelect($) { o($), g(); }, get value() { return i(); }, set value($ = []) { i($), g(); }, get defaultValue() { return s(); }, set defaultValue($ = []) { s($), g(); }, get expandAll() { return a(); }, set expandAll($ = true) { a($), g(); }, get multiple() { return l(); }, set multiple($ = false) { l($), g(); }, get expandValue() { return u(); }, set expandValue($ = []) { u($), g(); }, get placeholder() { return d(); }, set placeholder($) { d($), g(); } }, m = yy(); ot(m, () => ({ ...p, class: `tf-select ${p.class ?? ""}` })); var b = R(m); return Nt( nr(b, { floating: ($) => { var _ = hy(), x = R(_); n(x, r), Z(_), L($, _); }, children: ($, _) => { var x = my(); ot(x, () => ({ class: "tf-select-input nopan nodrag", ...p })); var k = R(x); mt( k, 23, () => c(f), (N, V) => `${V}_${N.value}`, (N, V, j) => { var A = Se(), H = oe(A); { var z = (T) => { var C = Se(), P = oe(C); { var M = (K) => { Kn(K, { get target() { return c(V).label; } }); }; ae(P, (K) => { c(j) === 0 && K(M); }); } L(T, C); }, S = (T) => { var C = gy(), P = oe(C); Kn(P, { get target() { return c(V).label; } }); var M = O(P, 2); { var K = (B) => { var W = ke(","); L(B, W); }; ae(M, (B) => { c(j) < c(f).length - 1 && B(K); }); } L(T, C); }; ae(H, (T) => { l() ? T(S, false) : T(z); }); } L(N, A); }, (N) => { var V = vy(), j = R(V, true); Z(V), $e(() => Re(j, d())), L(N, V); } ), Z(k), ve(2), Z(x), L($, x); }, $$slots: { floating: true, default: true } }), ($) => h = $, () => h ), Z(m), L(e3, m), ue(w); } er(["click"]); se( ut, { items: {}, onSelect: {}, value: {}, defaultValue: {}, expandAll: {}, multiple: {}, expandValue: {}, placeholder: {} }, [], [], true ); var ho = Math.min; var Er = Math.max; var yi = Math.round; var hn = (e3) => ({ x: e3, y: e3 }); var wy = { left: "right", right: "left", bottom: "top", top: "bottom" }; var by = { start: "end", end: "start" }; function Es(e3, t, n) { return Er(e3, ho(t, n)); } function Lo(e3, t) { return typeof e3 == "function" ? e3(t) : e3; } function gr(e3) { return e3.split("-")[0]; } function Vo(e3) { return e3.split("-")[1]; } function Md(e3) { return e3 === "x" ? "y" : "x"; } function ga(e3) { return e3 === "y" ? "height" : "width"; } var xy = /* @__PURE__ */ new Set(["top", "bottom"]); function Rn(e3) { return xy.has(gr(e3)) ? "y" : "x"; } function va(e3) { return Md(Rn(e3)); } function Cy(e3, t, n) { n === void 0 && (n = false); const r = Vo(e3), o = va(e3), i = ga(o); let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top"; return t.reference[i] > t.floating[i] && (s = wi(s)), [s, wi(s)]; } function $y(e3) { const t = wi(e3); return [Ps(e3), t, Ps(t)]; } function Ps(e3) { return e3.replace(/start|end/g, (t) => by[t]); } var xl = ["left", "right"]; var Cl = ["right", "left"]; var _y = ["top", "bottom"]; var ky = ["bottom", "top"]; function Sy(e3, t, n) { switch (e3) { case "top": case "bottom": return n ? t ? Cl : xl : t ? xl : Cl; case "left": case "right": return t ? _y : ky; default: return []; } } function Ey(e3, t, n, r) { const o = Vo(e3); let i = Sy(gr(e3), n === "start", r); return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(Ps)))), i; } function wi(e3) { return e3.replace(/left|right|bottom|top/g, (t) => wy[t]); } function Py(e3) { return { top: 0, right: 0, bottom: 0, left: 0, ...e3 }; } function Td(e3) { return typeof e3 != "number" ? Py(e3) : { top: e3, right: e3, bottom: e3, left: e3 }; } function bi(e3) { const { x: t, y: n, width: r, height: o } = e3; return { width: r, height: o, top: n, left: t, right: t + r, bottom: n + o, x: t, y: n }; } function $l(e3, t, n) { let { reference: r, floating: o } = e3; const i = Rn(t), s = va(t), a = ga(s), l = gr(t), u = i === "y", d = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, f = r[a] / 2 - o[a] / 2; let h; switch (l) { case "top": h = { x: d, y: r.y - o.height }; break; case "bottom": h = { x: d, y: r.y + r.height }; break; case "right": h = { x: r.x + r.width, y: p }; break; case "left": h = { x: r.x - o.width, y: p }; break; default: h = { x: r.x, y: r.y }; } switch (Vo(t)) { case "start": h[s] -= f * (n && u ? -1 : 1); break; case "end": h[s] += f * (n && u ? -1 : 1); break; } return h; } var Ny = async (e3, t, n) => { const { placement: r = "bottom", strategy: o = "absolute", middleware: i = [], platform: s } = n, a = i.filter(Boolean), l = await (s.isRTL == null ? void 0 : s.isRTL(t)); let u = await s.getElementRects({ reference: e3, floating: t, strategy: o }), { x: d, y: p } = $l(u, r, l), f = r, h = {}, y = 0; for (let w = 0; w < a.length; w++) { const { name: m, fn: b } = a[w], { x: $, y: _, data: x, reset: k } = await b({ x: d, y: p, initialPlacement: r, placement: f, strategy: o, middlewareData: h, rects: u, platform: s, elements: { reference: e3, floating: t } }); d = $ ?? d, p = _ ?? p, h = { ...h, [m]: { ...h[m], ...x } }, k && y <= 50 && (y++, typeof k == "object" && (k.placement && (f = k.placement), k.rects && (u = k.rects === true ? await s.getElementRects({ reference: e3, floating: t, strategy: o }) : k.rects), { x: d, y: p } = $l(u, f, l)), w = -1); } return { x: d, y: p, placement: f, strategy: o, middlewareData: h }; }; async function Ld(e3, t) { var n; t === void 0 && (t = {}); const { x: r, y: o, platform: i, rects: s, elements: a, strategy: l } = e3, { boundary: u = "clippingAncestors", rootBoundary: d = "viewport", elementContext: p = "floating", altBoundary: f = false, padding: h = 0 } = Lo(t, e3), y = Td(h), w = a[f ? p === "floating" ? "reference" : "floating" : p], m = bi(await i.getClippingRect({ element: (n = await (i.isElement == null ? void 0 : i.isElement(w))) == null || n ? w : w.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(a.floating)), boundary: u, rootBoundary: d, strategy: l })), b = p === "floating" ? { x: r, y: o, width: s.floating.width, height: s.floating.height } : s.reference, $ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), _ = await (i.isElement == null ? void 0 : i.isElement($)) ? await (i.getScale == null ? void 0 : i.getScale($)) || { x: 1, y: 1 } : { x: 1, y: 1 }, x = bi(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({ elements: a, rect: b, offsetParent: $, strategy: l }) : b); return { top: (m.top - x.top + y.top) / _.y, bottom: (x.bottom - m.bottom + y.bottom) / _.y, left: (m.left - x.left + y.left) / _.x, right: (x.right - m.right + y.right) / _.x }; } var My = (e3) => ({ name: "arrow", options: e3, async fn(t) { const { x: n, y: r, placement: o, rects: i, platform: s, elements: a, middlewareData: l } = t, { element: u, padding: d = 0 } = Lo(e3, t) || {}; if (u == null) return {}; const p = Td(d), f = { x: n, y: r }, h = va(o), y = ga(h), w = await s.getDimensions(u), m = h === "y", b = m ? "top" : "left", $ = m ? "bottom" : "right", _ = m ? "clientHeight" : "clientWidth", x = i.reference[y] + i.reference[h] - f[h] - i.floating[y], k = f[h] - i.reference[h], N = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(u)); let V = N ? N[_] : 0; (!V || !await (s.isElement == null ? void 0 : s.isElement(N))) && (V = a.floating[_] || i.floating[y]); const j = x / 2 - k / 2, A = V / 2 - w[y] / 2 - 1, H = ho(p[b], A), z = ho(p[$], A), S = H, T = V - w[y] - z, C = V / 2 - w[y] / 2 + j, P = Es(S, C, T), M = !l.arrow && Vo(o) != null && C !== P && i.reference[y] / 2 - (C < S ? H : z) - w[y] / 2 < 0, K = M ? C < S ? C - S : C - T : 0; return { [h]: f[h] + K, data: { [h]: P, centerOffset: C - P - K, ...M && { alignmentOffset: K } }, reset: M }; } }); var Ty = function(e3) { return e3 === void 0 && (e3 = {}), { name: "flip", options: e3, async fn(t) { var n, r; const { placement: o, middlewareData: i, rects: s, initialPlacement: a, platform: l, elements: u } = t, { mainAxis: d = true, crossAxis: p = true, fallbackPlacements: f, fallbackStrategy: h = "bestFit", fallbackAxisSideDirection: y = "none", flipAlignment: w = true, ...m } = Lo(e3, t); if ((n = i.arrow) != null && n.alignmentOffset) return {}; const b = gr(o), $ = Rn(a), _ = gr(a) === a, x = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), k = f || (_ || !w ? [wi(a)] : $y(a)), N = y !== "none"; !f && N && k.push(...Ey(a, w, y, x)); const V = [a, ...k], j = await Ld(t, m), A = []; let H = ((r = i.flip) == null ? void 0 : r.overflows) || []; if (d && A.push(j[b]), p) { const C = Cy(o, s, x); A.push(j[C[0]], j[C[1]]); } if (H = [...H, { placement: o, overflows: A }], !A.every((C) => C <= 0)) { var z, S; const C = (((z = i.flip) == null ? void 0 : z.index) || 0) + 1, P = V[C]; if (P && (!(p === "alignment" && $ !== Rn(P)) || // We leave the current main axis only if every placement on that axis // overflows the main axis. H.every((K) => Rn(K.placement) === $ ? K.overflows[0] > 0 : true))) return { data: { index: C, overflows: H }, reset: { placement: P } }; let M = (S = H.filter((K) => K.overflows[0] <= 0).sort((K, B) => K.overflows[1] - B.overflows[1])[0]) == null ? void 0 : S.placement; if (!M) switch (h) { case "bestFit": { var T; const K = (T = H.filter((B) => { if (N) { const W = Rn(B.placement); return W === $ || // Create a bias to the `y` side axis due to horizontal // reading directions favoring greater width. W === "y"; } return true; }).map((B) => [B.placement, B.overflows.filter((W) => W > 0).reduce((W, D) => W + D, 0)]).sort((B, W) => B[1] - W[1])[0]) == null ? void 0 : T[0]; K && (M = K); break; } case "initialPlacement": M = a; break; } if (o !== M) return { reset: { placement: M } }; } return {}; } }; }; var Ly = /* @__PURE__ */ new Set(["left", "top"]); async function Vy(e3, t) { const { placement: n, platform: r, elements: o } = e3, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = gr(n), a = Vo(n), l = Rn(n) === "y", u = Ly.has(s) ? -1 : 1, d = i && l ? -1 : 1, p = Lo(t, e3); let { mainAxis: f, crossAxis: h, alignmentAxis: y } = typeof p == "number" ? { mainAxis: p, crossAxis: 0, alignmentAxis: null } : { mainAxis: p.mainAxis || 0, crossAxis: p.crossAxis || 0, alignmentAxis: p.alignmentAxis }; return a && typeof y == "number" && (h = a === "end" ? y * -1 : y), l ? { x: h * d, y: f * u } : { x: f * u, y: h * d }; } var Dy = function(e3) { return e3 === void 0 && (e3 = 0), { name: "offset", options: e3, async fn(t) { var n, r; const { x: o, y: i, placement: s, middlewareData: a } = t, l = await Vy(t, e3); return s === ((n = a.offset) == null ? void 0 : n.placement) && (r = a.arrow) != null && r.alignmentOffset ? {} : { x: o + l.x, y: i + l.y, data: { ...l, placement: s } }; } }; }; var Oy = function(e3) { return e3 === void 0 && (e3 = {}), { name: "shift", options: e3, async fn(t) { const { x: n, y: r, placement: o } = t, { mainAxis: i = true, crossAxis: s = false, limiter: a = { fn: (m) => { let { x: b, y: $ } = m; return { x: b, y: $ }; } }, ...l } = Lo(e3, t), u = { x: n, y: r }, d = await Ld(t, l), p = Rn(gr(o)), f = Md(p); let h = u[f], y = u[p]; if (i) { const m = f === "y" ? "top" : "left", b = f === "y" ? "bottom" : "right", $ = h + d[m], _ = h - d[b]; h = Es($, h, _); } if (s) { const m = p === "y" ? "top" : "left", b = p === "y" ? "bottom" : "right", $ = y + d[m], _ = y - d[b]; y = Es($, y, _); } const w = a.fn({ ...t, [f]: h, [p]: y }); return { ...w, data: { x: w.x - n, y: w.y - r, enabled: { [f]: i, [p]: s } } }; } }; }; function ji() { return typeof window < "u"; } function Br(e3) { return Vd(e3) ? (e3.nodeName || "").toLowerCase() : "#document"; } function zt(e3) { var t; return (e3 == null || (t = e3.ownerDocument) == null ? void 0 : t.defaultView) || window; } function In(e3) { var t; return (t = (Vd(e3) ? e3.ownerDocument : e3.document) || window.document) == null ? void 0 : t.documentElement; } function Vd(e3) { return ji() ? e3 instanceof Node || e3 instanceof zt(e3).Node : false; } function Jt(e3) { return ji() ? e3 instanceof Element || e3 instanceof zt(e3).Element : false; } function vn(e3) { return ji() ? e3 instanceof HTMLElement || e3 instanceof zt(e3).HTMLElement : false; } function _l(e3) { return !ji() || typeof ShadowRoot > "u" ? false : e3 instanceof ShadowRoot || e3 instanceof zt(e3).ShadowRoot; } var zy = /* @__PURE__ */ new Set(["inline", "contents"]); function Do(e3) { const { overflow: t, overflowX: n, overflowY: r, display: o } = en(e3); return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !zy.has(o); } var Ay = /* @__PURE__ */ new Set(["table", "td", "th"]); function Hy(e3) { return Ay.has(Br(e3)); } var Iy = [":popover-open", ":modal"]; function Ki(e3) { return Iy.some((t) => { try { return e3.matches(t); } catch { return false; } }); } var Zy = ["transform", "translate", "scale", "rotate", "perspective"]; var jy = ["transform", "translate", "scale", "rotate", "perspective", "filter"]; var Ky = ["paint", "layout", "strict", "content"]; function ma(e3) { const t = ya(), n = Jt(e3) ? en(e3) : e3; return Zy.some((r) => n[r] ? n[r] !== "none" : false) || (n.containerType ? n.containerType !== "normal" : false) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : false) || !t && (n.filter ? n.filter !== "none" : false) || jy.some((r) => (n.willChange || "").includes(r)) || Ky.some((r) => (n.contain || "").includes(r)); } function Ry(e3) { let t = Gn(e3); for (; vn(t) && !Zr(t); ) { if (ma(t)) return t; if (Ki(t)) return null; t = Gn(t); } return null; } function ya() { return typeof CSS > "u" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter", "none"); } var By = /* @__PURE__ */ new Set(["html", "body", "#document"]); function Zr(e3) { return By.has(Br(e3)); } function en(e3) { return zt(e3).getComputedStyle(e3); } function Ri(e3) { return Jt(e3) ? { scrollLeft: e3.scrollLeft, scrollTop: e3.scrollTop } : { scrollLeft: e3.scrollX, scrollTop: e3.scrollY }; } function Gn(e3) { if (Br(e3) === "html") return e3; const t = ( // Step into the shadow DOM of the parent of a slotted node. e3.assignedSlot || // DOM Element detected. e3.parentNode || // ShadowRoot detected. _l(e3) && e3.host || // Fallback. In(e3) ); return _l(t) ? t.host : t; } function Dd(e3) { const t = Gn(e3); return Zr(t) ? e3.ownerDocument ? e3.ownerDocument.body : e3.body : vn(t) && Do(t) ? t : Dd(t); } function Od(e3, t, n) { var r; t === void 0 && (t = []); const o = Dd(e3), i = o === ((r = e3.ownerDocument) == null ? void 0 : r.body), s = zt(o); return i ? (Ns(s), t.concat(s, s.visualViewport || [], Do(o) ? o : [], [])) : t.concat(o, Od(o, [])); } function Ns(e3) { return e3.parent && Object.getPrototypeOf(e3.parent) ? e3.frameElement : null; } function zd(e3) { const t = en(e3); let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0; const o = vn(e3), i = o ? e3.offsetWidth : n, s = o ? e3.offsetHeight : r, a = yi(n) !== i || yi(r) !== s; return a && (n = i, r = s), { width: n, height: r, $: a }; } function Ad(e3) { return Jt(e3) ? e3 : e3.contextElement; } function Pr(e3) { const t = Ad(e3); if (!vn(t)) return hn(1); const n = t.getBoundingClientRect(), { width: r, height: o, $: i } = zd(t); let s = (i ? yi(n.width) : n.width) / r, a = (i ? yi(n.height) : n.height) / o; return (!s || !Number.isFinite(s)) && (s = 1), (!a || !Number.isFinite(a)) && (a = 1), { x: s, y: a }; } var Wy = hn(0); function Hd(e3) { const t = zt(e3); return !ya() || !t.visualViewport ? Wy : { x: t.visualViewport.offsetLeft, y: t.visualViewport.offsetTop }; } function Yy(e3, t, n) { return t === void 0 && (t = false), !n || t && n !== zt(e3) ? false : t; } function go(e3, t, n, r) { t === void 0 && (t = false), n === void 0 && (n = false); const o = e3.getBoundingClientRect(), i = Ad(e3); let s = hn(1); t && (r ? Jt(r) && (s = Pr(r)) : s = Pr(e3)); const a = Yy(i, n, r) ? Hd(i) : hn(0); let l = (o.left + a.x) / s.x, u = (o.top + a.y) / s.y, d = o.width / s.x, p = o.height / s.y; if (i) { const f = zt(i), h = r && Jt(r) ? zt(r) : r; let y = f, w = Ns(y); for (; w && r && h !== y; ) { const m = Pr(w), b = w.getBoundingClientRect(), $ = en(w), _ = b.left + (w.clientLeft + parseFloat($.paddingLeft)) * m.x, x = b.top + (w.clientTop + parseFloat($.paddingTop)) * m.y; l *= m.x, u *= m.y, d *= m.x, p *= m.y, l += _, u += x, y = zt(w), w = Ns(y); } } return bi({ width: d, height: p, x: l, y: u }); } function Bi(e3, t) { const n = Ri(e3).scrollLeft; return t ? t.left + n : go(In(e3)).left + n; } function Id(e3, t) { const n = e3.getBoundingClientRect(), r = n.left + t.scrollLeft - Bi(e3, n), o = n.top + t.scrollTop; return { x: r, y: o }; } function Fy(e3) { let { elements: t, rect: n, offsetParent: r, strategy: o } = e3; const i = o === "fixed", s = In(r), a = t ? Ki(t.floating) : false; if (r === s || a && i) return n; let l = { scrollLeft: 0, scrollTop: 0 }, u = hn(1); const d = hn(0), p = vn(r); if ((p || !p && !i) && ((Br(r) !== "body" || Do(s)) && (l = Ri(r)), vn(r))) { const h = go(r); u = Pr(r), d.x = h.x + r.clientLeft, d.y = h.y + r.clientTop; } const f = s && !p && !i ? Id(s, l) : hn(0); return { width: n.width * u.x, height: n.height * u.y, x: n.x * u.x - l.scrollLeft * u.x + d.x + f.x, y: n.y * u.y - l.scrollTop * u.y + d.y + f.y }; } function qy(e3) { return Array.from(e3.getClientRects()); } function Xy(e3) { const t = In(e3), n = Ri(e3), r = e3.ownerDocument.body, o = Er(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = Er(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight); let s = -n.scrollLeft + Bi(e3); const a = -n.scrollTop; return en(r).direction === "rtl" && (s += Er(t.clientWidth, r.clientWidth) - o), { width: o, height: i, x: s, y: a }; } var kl = 25; function Gy(e3, t) { const n = zt(e3), r = In(e3), o = n.visualViewport; let i = r.clientWidth, s = r.clientHeight, a = 0, l = 0; if (o) { i = o.width, s = o.height; const d = ya(); (!d || d && t === "fixed") && (a = o.offsetLeft, l = o.offsetTop); } const u = Bi(r); if (u <= 0) { const d = r.ownerDocument, p = d.body, f = getComputedStyle(p), h = d.compatMode === "CSS1Compat" && parseFloat(f.marginLeft) + parseFloat(f.marginRight) || 0, y = Math.abs(r.clientWidth - p.clientWidth - h); y <= kl && (i -= y); } else u <= kl && (i += u); return { width: i, height: s, x: a, y: l }; } var Uy = /* @__PURE__ */ new Set(["absolute", "fixed"]); function Qy(e3, t) { const n = go(e3, true, t === "fixed"), r = n.top + e3.clientTop, o = n.left + e3.clientLeft, i = vn(e3) ? Pr(e3) : hn(1), s = e3.clientWidth * i.x, a = e3.clientHeight * i.y, l = o * i.x, u = r * i.y; return { width: s, height: a, x: l, y: u }; } function Sl(e3, t, n) { let r; if (t === "viewport") r = Gy(e3, n); else if (t === "document") r = Xy(In(e3)); else if (Jt(t)) r = Qy(t, n); else { const o = Hd(e3); r = { x: t.x - o.x, y: t.y - o.y, width: t.width, height: t.height }; } return bi(r); } function Zd(e3, t) { const n = Gn(e3); return n === t || !Jt(n) || Zr(n) ? false : en(n).position === "fixed" || Zd(n, t); } function Jy(e3, t) { const n = t.get(e3); if (n) return n; let r = Od(e3, []).filter((a) => Jt(a) && Br(a) !== "body"), o = null; const i = en(e3).position === "fixed"; let s = i ? Gn(e3) : e3; for (; Jt(s) && !Zr(s); ) { const a = en(s), l = ma(s); !l && a.position === "fixed" && (o = null), (i ? !l && !o : !l && a.position === "static" && o && Uy.has(o.position) || Do(s) && !l && Zd(e3, s)) ? r = r.filter((u) => u !== s) : o = a, s = Gn(s); } return t.set(e3, r), r; } function e22(e3) { let { element: t, boundary: n, rootBoundary: r, strategy: o } = e3; const i = [...n === "clippingAncestors" ? Ki(t) ? [] : Jy(t, this._c) : [].concat(n), r], s = i[0], a = i.reduce((l, u) => { const d = Sl(t, u, o); return l.top = Er(d.top, l.top), l.right = ho(d.right, l.right), l.bottom = ho(d.bottom, l.bottom), l.left = Er(d.left, l.left), l; }, Sl(t, s, o)); return { width: a.right - a.left, height: a.bottom - a.top, x: a.left, y: a.top }; } function t2(e3) { const { width: t, height: n } = zd(e3); return { width: t, height: n }; } function n2(e3, t, n) { const r = vn(t), o = In(t), i = n === "fixed", s = go(e3, true, i, t); let a = { scrollLeft: 0, scrollTop: 0 }; const l = hn(0); function u() { l.x = Bi(o); } if (r || !r && !i) if ((Br(t) !== "body" || Do(o)) && (a = Ri(t)), r) { const h = go(t, true, i, t); l.x = h.x + t.clientLeft, l.y = h.y + t.clientTop; } else o && u(); i && !r && o && u(); const d = o && !r && !i ? Id(o, a) : hn(0), p = s.left + a.scrollLeft - l.x - d.x, f = s.top + a.scrollTop - l.y - d.y; return { x: p, y: f, width: s.width, height: s.height }; } function os(e3) { return en(e3).position === "static"; } function El(e3, t) { if (!vn(e3) || en(e3).position === "fixed") return null; if (t) return t(e3); let n = e3.offsetParent; return In(e3) === n && (n = n.ownerDocument.body), n; } function jd(e3, t) { const n = zt(e3); if (Ki(e3)) return n; if (!vn(e3)) { let o = Gn(e3); for (; o && !Zr(o); ) { if (Jt(o) && !os(o)) return o; o = Gn(o); } return n; } let r = El(e3, t); for (; r && Hy(r) && os(r); ) r = El(r, t); return r && Zr(r) && os(r) && !ma(r) ? n : r || Ry(e3) || n; } var r2 = async function(e3) { const t = this.getOffsetParent || jd, n = this.getDimensions, r = await n(e3.floating); return { reference: n2(e3.reference, await t(e3.floating), e3.strategy), floating: { x: 0, y: 0, width: r.width, height: r.height } }; }; function o2(e3) { return en(e3).direction === "rtl"; } var i2 = { convertOffsetParentRelativeRectToViewportRelativeRect: Fy, getDocumentElement: In, getClippingRect: e22, getOffsetParent: jd, getElementRects: r2, getClientRects: qy, getDimensions: t2, getScale: Pr, isElement: Jt, isRTL: o2 }; var s2 = Dy; var a2 = Oy; var l2 = Ty; var u2 = My; var c2 = (e3, t, n) => { const r = /* @__PURE__ */ new Map(), o = { platform: i2, ...n }, i = { ...o.platform, _c: r }; return Ny(e3, t, { ...o, platform: i }); }; var d2 = ({ trigger: e3, triggerEvent: t, floatContent: n, placement: r = "bottom", offsetOptions: o, flipOptions: i, shiftOptions: s, interactive: a, showArrow: l }) => { if (typeof e3 == "string") { const b = document.querySelector(e3); if (b) e3 = b; else throw new Error("element not found by document.querySelector('" + e3 + "')"); } let u; if (typeof n == "string") { const b = document.querySelector(n); if (b) u = b; else throw new Error("element not found by document.querySelector('" + n + "')"); } else u = n; let d; l && (d = document.createElement("div"), d.style.position = "absolute", d.style.backgroundColor = "#222", d.style.width = "8px", d.style.height = "8px", d.style.transform = "rotate(45deg)", d.style.display = "none", u.firstElementChild.before(d)); function p() { c2(e3, u, { placement: r, middleware: [ s2(o), // 手动偏移配置 l2(i), //自动翻转 a2(s), //自动偏移(使得浮动元素能够进入视野) ...l ? [u2({ element: d })] : [] ] }).then(({ x: b, y: $, placement: _, middlewareData: x }) => { if (Object.assign(u.style, { left: `${b}px`, top: `${$}px` }), l) { const { x: k, y: N } = x.arrow, V = { top: "bottom", right: "left", bottom: "top", left: "right" }[_.split("-")[0]]; Object.assign(d.style, { zIndex: -1, left: k != null ? `${k}px` : "", top: N != null ? `${N}px` : "", right: "", bottom: "", [V]: "2px" }); } }); } let f = false; function h() { u.style.display = "block", u.style.visibility = "block", u.style.position = "absolute", l && (d.style.display = "block"), f = true, p(); } function y() { u.style.display = "none", l && (d.style.display = "none"), f = false; } function w(b) { b.stopPropagation(), f ? y() : h(); } function m(b) { u.contains(b.target) || y(); } return (!t || t.length == 0) && (t = ["click"]), t.forEach((b) => { e3.addEventListener(b, w); }), document.addEventListener("click", m), { destroy() { t.forEach((b) => { e3.removeEventListener(b, w); }), document.removeEventListener("click", m); }, hide() { y(); }, isVisible() { return f; } }; }; var f2 = ee('
'); function nr(e3, t) { le(t, true); const n = v(t, "children", 7), r = v(t, "floating", 7), o = v(t, "placement", 7, "bottom"); let i, s, a; zn(() => (a = d2({ trigger: i, floatContent: s, interactive: true, placement: o() }), () => { a.destroy(); })); function l() { a.hide(); } var u = { hide: l, get children() { return n(); }, set children(w) { n(w), g(); }, get floating() { return r(); }, set floating(w) { r(w), g(); }, get placement() { return o(); }, set placement(w = "bottom") { o(w), g(); } }, d = f2(), p = R(d), f = R(p); Ge(f, n), Z(p), Nt(p, (w) => i = w, () => i); var h = O(p, 2), y = R(h); return Ge(y, r), Z(h), Nt(h, (w) => s = w, () => s), Z(d), L(e3, d), ue(u); } se(nr, { children: {}, floating: {}, placement: {} }, [], ["hide"], true); function Te(e3, t) { le(t, true); const n = v(t, "children", 7), r = v(t, "level", 7, 1), o = v(t, "mt", 7), i = v(t, "mb", 7); var s = { get children() { return n(); }, set children(u) { n(u), g(); }, get level() { return r(); }, set level(u = 1) { r(u), g(); }, get mt() { return o(); }, set mt(u) { o(u), g(); }, get mb() { return i(); }, set mb(u) { i(u), g(); } }, a = Se(), l = oe(a); return Ap(l, () => `h${r()}`, false, (u, d) => { ot(u, () => ({ class: "tf-heading", style: `margin-top:${o() || "0"};margin-bottom:${i() || "0"}` })); var p = Se(), f = oe(p); Ge(f, () => n() ?? vt), L(d, p); }), L(e3, a), ue(s); } se(Te, { children: {}, level: {}, mt: {}, mb: {} }, [], [], true); var p2 = ge(''); var h2 = { hash: "svelte-1q3h954", code: ".input-btn-more {border:1px solid transparent;padding:3px;&:hover {background:#eee;border:1px solid transparent;}}" }; function Oo(e3, t) { le(t, true), He(e3, h2); const n = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host"]); Me(e3, Be(() => n, { get class() { return `input-btn-more ${t.class ?? ""}`; }, children: (r, o) => { var i = p2(); L(r, i); }, $$slots: { default: true } })), ue(); } se(Oo, {}, [], [], true); var g2 = () => ({ deleteNode: (e3) => { Le.removeNode(e3), Le.updateEdges((t) => t.filter((n) => n.source !== e3 && n.target !== e3)); } }); var Ln = (e3 = 16) => { const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = new Uint8Array(e3); return crypto.getRandomValues(n), Array.from(n, (r) => t[r % t.length]).join(""); }; var v2 = () => ({ copyNode: (e3) => { const t = Le.getNode(e3); if (t) { const n = Ln(), r = { ...t, id: n, position: { x: t.position.x + 50, y: t.position.y + 50 } }; Le.updateNodes((o) => [...o.map((i) => ({ ...i, selected: false })), r]); } } }); var Ue = () => Fn("svelteflow__node_id"); var Un = () => Fn("tinyflow_options"); var m2 = ge(''); var y2 = ge(''); var w2 = ge(''); var b2 = ee('
执行条件:
'); var x2 = ee('
循环间隔时间(单位:毫秒):
最大循环次数(0 表示不限制):
退出条件:
', 1); var C2 = ee('
错误重试间隔时间(单位:毫秒):
最大重试次数:
', 1); var $2 = ee('
节点名称:
参数描述:
'); var _2 = ge(''); var k2 = ee('
'); var S2 = ee('
TinyFlow.ai
', 1); var E2 = { hash: "svelte-ana6zl", code: ".tf-node-toolbar.svelte-ana6zl {display:flex;gap:5px;padding:5px;border-radius:5px;background:#fff;border:1px solid #eee;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:#fff;border:1px solid #ddd;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:#666;}.settings.svelte-ana6zl .input-item-inline:where(.svelte-ana6zl) {display:flex;align-items:center;font-size:12px;color:#666;}" }; function Yt(e3, t) { le(t, true), He(e3, E2); const n = v(t, "data", 7), r = v(t, "id", 7, ""), o = v(t, "icon", 7), i = v(t, "handle", 7), s = v(t, "children", 7), a = v(t, "allowExecute", 7, true), l = v(t, "allowCopy", 7, true), u = v(t, "allowDelete", 7, true), d = v(t, "allowSetting", 7, true), p = v(t, "allowSettingOfCondition", 7, true), f = v(t, "showSourceHandle", 7, true), h = v(t, "showTargetHandle", 7, true), y = v(t, "onCollapse", 7); let w = n().expand ? ["key"] : []; const { updateNodeData: m, getNode: b } = st(), $ = E(() => [ { key: "key", icon: o(), title: n().title, description: n().description, content: s() } ]), { deleteNode: _ } = g2(), { copyNode: x } = v2(), k = Un(), N = () => { k.onNodeExecute?.(b(r())); }; let V = Ue(); var j = { get data() { return n(); }, set data(D) { n(D), g(); }, get id() { return r(); }, set id(D = "") { r(D), g(); }, get icon() { return o(); }, set icon(D) { o(D), g(); }, get handle() { return i(); }, set handle(D) { i(D), g(); }, get children() { return s(); }, set children(D) { s(D), g(); }, get allowExecute() { return a(); }, set allowExecute(D = true) { a(D), g(); }, get allowCopy() { return l(); }, set allowCopy(D = true) { l(D), g(); }, get allowDelete() { return u(); }, set allowDelete(D = true) { u(D), g(); }, get allowSetting() { return d(); }, set allowSetting(D = true) { d(D), g(); }, get allowSettingOfCondition() { return p(); }, set allowSettingOfCondition(D = true) { p(D), g(); }, get showSourceHandle() { return f(); }, set showSourceHandle(D = true) { f(D), g(); }, get showTargetHandle() { return h(); }, set showTargetHandle(D = true) { h(D), g(); }, get onCollapse() { return y(); }, set onCollapse(D) { y(D), g(); } }, A = S2(), H = oe(A); { var z = (D) => { kd(D, { get position() { return me.Top; }, align: "start", children: (X, q) => { var U = k2(), I = R(U); { var F = (re) => { Me(re, { class: "tf-node-toolbar-item", onclick: () => { _(r()); }, children: (ie, fe) => { var pe = m2(); L(ie, pe); }, $$slots: { default: true } }); }; ae(I, (re) => { u() && re(F); }); } var G = O(I, 2); { var te = (re) => { Me(re, { class: "tf-node-toolbar-item", onclick: () => { x(r()); }, children: (ie, fe) => { var pe = y2(); L(ie, pe); }, $$slots: { default: true } }); }; ae(G, (re) => { l() && re(te); }); } var ne = O(G, 2); { var J = (re) => { Me(re, { class: "tf-node-toolbar-item", onclick: N, children: (ie, fe) => { var pe = w2(); L(ie, pe); }, $$slots: { default: true } }); }; ae(ne, (re) => { a() && re(J); }); } var he = O(ne, 2); { var ce = (re) => { nr(re, { placement: "bottom", floating: (ie) => { var fe = $2(), pe = R(fe), Ce = O(R(pe)); Je(Ce, { style: "width: 100%;", onchange: (De) => { const _e = De.target.value; m(V, { title: _e }); }, get value() { return n().title; } }), Z(pe); var de = O(pe, 2), we = O(R(de)); Ke(we, { rows: 3, style: "width: 100%;", onchange: (De) => { const _e = De.target.value; m(V, { description: _e }); }, get value() { return n().description; } }), Z(de); var Oe = O(de, 2); { var Y = (De) => { var _e = b2(), nt = O(R(_e)); Ke(nt, { rows: 2, style: "width: 100%;", onchange: (Tt) => { const Xe = Tt.target.value; m(V, { condition: Xe }); }, get value() { return n().condition; } }), Z(_e), L(De, _e); }; ae(Oe, (De) => { p() && De(Y); }); } var je = O(Oe, 2), ze = O(R(je), 2); Cn(ze), ze.__change = (De) => { const _e = De.target.checked; m(V, { async: _e }); }, Z(je); var Ae = O(je, 2), Ie = O(R(Ae), 2); Cn(Ie), Ie.__change = (De) => { const _e = De.target.checked; m(V, { loopEnable: _e }); }, Z(Ae); var tt = O(Ae, 2); { var Mt = (De) => { var _e = x2(), nt = oe(_e), Tt = O(R(nt)); { let ft = E(() => n().loopIntervalMs || "1000"); Ke(Tt, { rows: 1, style: "width: 100%;", onchange: (xt) => { const yn = xt.target.value; m(V, { loopIntervalMs: yn }); }, get value() { return c(ft); } }); } Z(nt); var Xe = O(nt, 2), wr = O(R(Xe)); { let ft = E(() => n().maxLoopCount || "0"); Ke(wr, { rows: 1, style: "width: 100%;", onchange: (xt) => { const yn = xt.target.value; m(V, { maxLoopCount: yn }); }, get value() { return c(ft); } }); } Z(Xe); var sn = O(Xe, 2), an = O(R(sn)); Ke(an, { rows: 2, style: "width: 100%;", onchange: (ft) => { const xt = ft.target.value; m(V, { loopBreakCondition: xt }); }, get value() { return n().loopBreakCondition; } }), Z(sn), L(De, _e); }; ae(tt, (De) => { n().loopEnable && De(Mt); }); } var Ht = O(tt, 2), Qe = O(R(Ht), 2); Cn(Qe), Qe.__change = (De) => { const _e = De.target.checked; m(V, { retryEnable: _e }); }, Z(Ht); var ye = O(Ht, 2); { var Ye = (De) => { var _e = C2(), nt = oe(_e), Tt = O(R(nt)); { let ft = E(() => n().retryIntervalMs || "1000"); Ke(Tt, { rows: 1, style: "width: 100%;", onchange: (xt) => { const yn = xt.target.value; m(V, { retryIntervalMs: yn }); }, get value() { return c(ft); } }); } Z(nt); var Xe = O(nt, 2), wr = O(R(Xe)); { let ft = E(() => n().maxRetryCount || "3"); Ke(wr, { rows: 1, style: "width: 100%;", onchange: (xt) => { const yn = xt.target.value; m(V, { maxRetryCount: yn }); }, get value() { return c(ft); } }); } Z(Xe); var sn = O(Xe, 2), an = O(R(sn), 2); Cn(an), an.__change = (ft) => { const xt = ft.target.checked; m(V, { resetRetryCountAfterNormal: xt }); }, Z(sn), $e(() => Ao(an, !!n().resetRetryCountAfterNormal)), L(De, _e); }; ae(ye, (De) => { n().retryEnable && De(Ye); }); } Z(fe), $e(() => { Ao(ze, !!n().async), Ao(Ie, !!n().loopEnable), Ao(Qe, !!n().retryEnable); }), L(ie, fe); }, children: (ie, fe) => { Me(ie, { class: "tf-node-toolbar-item", children: (pe, Ce) => { var de = _2(); L(pe, de); }, $$slots: { default: true } }); }, $$slots: { floating: true, default: true } }); }; ae(he, (re) => { d() && re(ce); }); } Z(U), L(X, U); }, $$slots: { default: true } }); }; ae(H, (D) => { (a() || l() || u()) && D(z); }); } var S = O(H, 2), T = O(R(S), 2), C = R(T); Nd(C, { get items() { return c($); }, get activeKeys() { return w; }, onChange: (D, X) => { m(r(), { expand: X?.includes("key") }), y()?.(X?.includes("key") ? "key" : ""); } }), Z(T), Z(S); var P = O(S, 2); { var M = (D) => { Xn(D, { type: "target", get position() { return me.Left; }, style: " left: -12px;top: 20px" }); }; ae(P, (D) => { h() && D(M); }); } var K = O(P, 2); { var B = (D) => { Xn(D, { type: "source", get position() { return me.Right; }, style: "right: -12px;top: 20px" }); }; ae(K, (D) => { f() && D(B); }); } var W = O(K, 2); return Ge(W, () => i() ?? vt), L(e3, A), ue(j); } er(["change"]); se( Yt, { data: {}, id: {}, icon: {}, handle: {}, children: {}, allowExecute: {}, allowCopy: {}, allowDelete: {}, allowSetting: {}, allowSettingOfCondition: {}, showSourceHandle: {}, showTargetHandle: {}, onCollapse: {} }, [], [], true ); var P2 = ee('
数据选项:
'); var N2 = ee('
数据内容:
输入方式:
数据标题:
数据描述:
占位符:
'); var M2 = ge(''); var T2 = ee('
', 1); var L2 = { 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:#fff;border:1px solid #ddd;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:#666;}" }; function Kd(e3, t) { le(t, true), He(e3, L2); const n = v(t, "parameter", 7), r = v(t, "index", 7); let o = Ue(), i = Hn(o), s = E(() => ({ ...n(), ...i?.current?.data?.parameters[r()] })); const { updateNodeData: a } = st(), l = (j, A) => { a(o, (H) => { let z = H.data.parameters; return z[r()][j] = A, { parameters: z }; }); }, u = (j, A) => { const H = A.target.value; l(j, H); }, d = (j) => { const A = j.target.value; l("name", A); }, p = (j) => { const A = j.target.checked; l("required", A); }, f = (j) => { const A = j.value; l("formType", A); }, h = (j) => { const A = j.value; l("contentType", A); }; let y; const w = () => { a(o, (j) => { let A = j.data.parameters; return A.splice(r(), 1), { parameters: [...A] }; }), y?.hide(); }; var m = { get parameter() { return n(); }, set parameter(j) { n(j), g(); }, get index() { return r(); }, set index(j) { r(j), g(); } }, b = T2(), $ = oe(b), _ = R($); Je(_, { style: "width: 100%;", get value() { return c(s).name; }, placeholder: "请输入参数名称", oninput: d }), Z($); var x = O($, 2), k = R(x); Sd(k, { get checked() { return c(s).required; }, onchange: p }), Z(x); var N = O(x, 2), V = R(N); return Nt( nr(V, { placement: "bottom", floating: (j) => { var A = N2(), H = R(A), z = O(R(H)); { let I = E(() => c(s).contentType ? [c(s).contentType] : []); ut(z, { get items() { return ha; }, style: "width: 100%", defaultValue: ["text"], get value() { return c(I); }, onSelect: h }); } Z(H); var S = O(H, 2), T = O(R(S)); { let I = E(() => c(s).formType ? [c(s).formType] : []); ut(T, { get items() { return Fm; }, style: "width: 100%", defaultValue: ["input"], get value() { return c(I); }, onSelect: f }); } Z(S); var C = O(S, 2); { var P = (I) => { var F = P2(), G = O(R(F)); { let te = E(() => c(s).enums?.join(` `)); Ke(G, { rows: 3, style: "width: 100%;", onchange: (ne) => { l("enums", ne.target?.value.trim().split(` `)); }, get value() { return c(te); }, placeholder: "一行一个选项" }); } Z(F), L(I, F); }; ae(C, (I) => { (c(s).formType === "radio" || c(s).formType === "checkbox" || c(s).formType === "select") && I(P); }); } var M = O(C, 2), K = O(R(M)); Ke(K, { rows: 1, style: "width: 100%;", onchange: (I) => { u("formLabel", I); }, get value() { return c(s).formLabel; } }), Z(M); var B = O(M, 2), W = O(R(B)); Ke(W, { rows: 2, style: "width: 100%;", onchange: (I) => { u("formDescription", I); }, get value() { return c(s).formDescription; } }), Z(B); var D = O(B, 2), X = O(R(D)); Ke(X, { rows: 2, style: "width: 100%;", onchange: (I) => { u("formPlaceholder", I); }, get value() { return c(s).formPlaceholder; } }), Z(D); var q = O(D, 2), U = R(q); Me(U, { onclick: w, children: (I, F) => { ve(); var G = ke("删除"); L(I, G); }, $$slots: { default: true } }), Z(q), Z(A), L(j, A); }, children: (j, A) => { Me(j, { class: "input-btn-more", children: (H, z) => { var S = M2(); L(H, S); }, $$slots: { default: true } }); }, $$slots: { floating: true, default: true } }), (j) => y = j, () => y ), Z(N), L(e3, b), ue(m); } se(Kd, { parameter: {}, index: {} }, [], [], true); var V2 = ee('
参数名称
必填
', 1); var D2 = ee('
无输入参数
'); var O2 = ee('
'); var z2 = { 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:#f8f8f8;height:40px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1; /* 从第一列开始到最后一列结束 */}.input-container.svelte-1yp5n1k .input-header:where(.svelte-1yp5n1k) {font-size:12px;color:#666;}` }; function Rd(e3, t) { le(t, true), He(e3, z2); let n = Ue(), r = Hn(n), o = E(() => [...r?.current?.data?.parameters || []]); var i = O2(), s = R(i); { var a = (u) => { var d = V2(); ve(4), L(u, d); }; ae(s, (u) => { c(o).length !== 0 && u(a); }); } var l = O(s, 2); mt( l, 19, () => c(o), (u) => u.id, (u, d, p) => { Kd(u, { get parameter() { return c(d); }, get index() { return c(p); } }); }, (u) => { var d = D2(); L(u, d); } ), Z(i), L(e3, i), ue(); } se(Rd, {}, [], [], true); var vo = (e3) => (!e3 || e3.length == 0 || e3.forEach((t) => { t.id || (t.id = Ln()), vo(t.children); }), e3); var on = () => { const { updateNodeData: e3 } = st(); return { addParameter: (t, n = "parameters", r) => { Array.isArray(r) ? r.forEach((s) => vo(s?.children)) : vo(r?.children); function o(s) { return { name: "", dataType: "String", refType: "ref", ...s, id: Ln() }; } const i = []; Array.isArray(r) ? i.push(...r.map(o)) : i.push(o(r)), e3(t, (s) => { let a = s.data[n]; return a ? a.push(...i) : a = [...i], { [n]: [...a] }; }); } }; }; var A2 = ge(''); var H2 = ge(''); var I2 = ee('
', 1); var Z2 = { 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:#eee;border:1px solid transparent;}" }; function Bd(e3, t) { le(t, true), He(e3, Z2); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = Ue(), { addParameter: i } = on(); var s = { get data() { return n(); }, set data(a) { n(a), g(); } }; return Yt(e3, Be(() => r, { get data() { return n(); }, allowExecute: false, showTargetHandle: false, allowSettingOfCondition: false, icon: (a) => { var l = A2(); L(a, l); }, children: (a, l) => { var u = I2(), d = oe(u), p = R(d); Te(p, { level: 3, children: (y, w) => { ve(); var m = ke("输入参数"); L(y, m); }, $$slots: { default: true } }); var f = O(p, 2); Me(f, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o, "parameters", { refType: "input", name: "newParam" }); }, children: (y, w) => { var m = H2(); L(y, m); }, $$slots: { default: true } }), Z(d); var h = O(d, 2); Rd(h, {}), L(a, u); }, $$slots: { icon: true, default: true } })), ue(s); } se(Bd, { data: {} }, [], [], true); var Wd = (e3, t, n) => { for (const r of n) r.target === t && r.source && (e3.push(r.source), Wd(e3, r.source, n)); }; var Yd = (e3, t, n) => !e3 || e3.length === 0 ? [] : e3.map((r) => ({ label: r.name + (n ? ` (Array<${r.dataType || "String"}>)` : ` (${r.dataType || "String"})`), value: t + "." + r.name, children: Yd(r.children, t + "." + r.name, n) })); var Pl = (e3, t, n) => { if (e3.type === "startNode") { const r = e3.data.parameters, o = []; if (r) for (const i of r) o.push({ label: i.name + (t ? ` (Array<${i.dataType || "String"}>)` : ` (${i.dataType || "String"})`), value: e3.id + "." + i.name }); return { label: e3.data.title, value: e3.id, children: o }; } else { if (e3.type === "loopNode" && n.parentId) return { label: e3.data.title, value: e3.id, children: [ { label: "loopItem", value: e3.id + ".loopItem" }, { label: "index (Number)", value: e3.id + ".index" } ] }; { const r = e3.data.outputDefs; if (r) return { label: e3.data.title, value: e3.id, children: Yd(r, e3.id, t) }; } } }; var Fd = (e3 = false) => { const t = Ue(), n = Hn(t), r = E(rn), o = E(() => c(r).nodes), i = E(() => c(r).edges), s = E(() => c(r).nodeLookup); let a = E(() => { const l = []; if (!n.current) return []; const u = c(s).get(t); if (e3) for (const d of c(o)) { const p = d.parentId === n.current.id; if (p) { const f = Pl(d, p, u); f && l.push(f); } } else { const d = []; Wd(d, t, c(i)); for (const p of c(o)) if (d.includes(p.id)) { const f = p.parentId === n.current.id, h = Pl(p, f, u); h && l.push(h); } } return l; }); return { get current() { return c(a); } }; }; var j2 = ee('
数据内容:
'); var K2 = ee('
数据来源:
默认值:
参数描述:
'); var R2 = ee('
', 1); var B2 = { 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:#fff;border:1px solid #ddd;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:#666;}" }; function qd(e3, t) { le(t, true), He(e3, B2), zn(() => { c(u).refType || y({ value: "ref" }); }); const n = v(t, "parameter", 7), r = v(t, "index", 7), o = v(t, "dataKeyName", 7), i = v(t, "useChildrenOnly", 7), s = v(t, "showContentType", 7, false); let a = Ue(), l = Hn(a), u = E(() => ({ ...n(), ...l?.current?.data?.[o()][r()] })); const { updateNodeData: d } = st(), p = (T, C) => { d(a, (P) => { let M = P.data?.[o()]; return M[r()] = { ...M[r()], [T]: C }, { [o()]: M }; }); }, f = (T, C) => { const P = C.target.value; p(T, P); }, h = (T) => { const C = T.value; p("ref", C); }, y = (T) => { const C = T.value; p("refType", C); }, w = (T) => { const C = T.value; p("contentType", C); }; let m; const b = () => { d(a, (T) => { let C = T.data?.[o()]; return C.splice(r(), 1), { [o()]: [...C] }; }), m?.hide(); }; let $ = Fd(i()); var _ = { get parameter() { return n(); }, set parameter(T) { n(T), g(); }, get index() { return r(); }, set index(T) { r(T), g(); }, get dataKeyName() { return o(); }, set dataKeyName(T) { o(T), g(); }, get useChildrenOnly() { return i(); }, set useChildrenOnly(T) { i(T), g(); }, get showContentType() { return s(); }, set showContentType(T = false) { s(T), g(); } }, x = R2(), k = oe(x), N = R(k); { let T = E(() => c(u).nameDisabled === true); Je(N, { style: "width: 100%;", get value() { return c(u).name; }, placeholder: "请输入参数名称", get disabled() { return c(T); }, oninput: (C) => f("name", C) }); } Z(k); var V = O(k, 2), j = R(V); { var A = (T) => { Je(T, { get value() { return c(u).value; }, placeholder: "请输入参数值", oninput: (C) => f("value", C) }); }, H = (T) => { var C = Se(), P = oe(C); { var M = (K) => { { let B = E(() => [c(u).ref]); ut(K, { get items() { return $.current; }, style: "width: 100%", defaultValue: ["ref"], get value() { return c(B); }, expandAll: true, onSelect: h }); } }; ae( P, (K) => { c(u).refType !== "input" && K(M); }, true ); } L(T, C); }; ae(j, (T) => { c(u).refType === "fixed" ? T(A) : T(H, false); }); } Z(V); var z = O(V, 2), S = R(z); return Nt( nr(S, { placement: "bottom", floating: (T) => { var C = K2(), P = R(C), M = O(R(P)); { let F = E(() => c(u).refType ? [c(u).refType] : []); ut(M, { get items() { return Ym; }, style: "width: 100%", defaultValue: ["ref"], get value() { return c(F); }, onSelect: y }); } Z(P); var K = O(P, 2); { var B = (F) => { var G = j2(), te = O(R(G)); { let ne = E(() => c(u).contentType ? [c(u).contentType] : []); ut(te, { get items() { return ha; }, style: "width: 100%", defaultValue: ["text"], get value() { return c(ne); }, onSelect: w }); } Z(G), L(F, G); }; ae(K, (F) => { s() && F(B); }); } var W = O(K, 2), D = O(R(W)); Ke(D, { rows: 1, style: "width: 100%;", onchange: (F) => { f("defaultValue", F); }, get value() { return c(u).defaultValue; }, placeholder: "请输入参数默认值" }), Z(W); var X = O(W, 2), q = O(R(X)); Ke(q, { rows: 3, style: "width: 100%;", onchange: (F) => { f("description", F); }, get value() { return c(u).description; }, placeholder: "请输入参数描述" }), Z(X); var U = O(X, 2), I = R(U); Me(I, { onclick: b, children: (F, G) => { ve(); var te = ke("删除"); L(F, te); }, $$slots: { default: true } }), Z(U), Z(C), L(T, C); }, children: (T, C) => { Oo(T, {}); }, $$slots: { floating: true, default: true } }), (T) => m = T, () => m ), Z(z), L(e3, x), ue(_); } se( qd, { parameter: {}, index: {}, dataKeyName: {}, useChildrenOnly: {}, showContentType: {} }, [], [], true ); var W2 = ee('
参数名称
参数值
', 1); var Y2 = ee('
'); var F2 = ee('
'); var q2 = { 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:#f8f8f8;height:40px;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:#666;}` }; function bt(e3, t) { le(t, true), He(e3, q2); const n = v(t, "noneParameterText", 7, "无输入参数"), r = v(t, "dataKeyName", 7, "parameters"), o = v(t, "useChildrenOnly", 7), i = v(t, "showContentType", 7, false); let s = Ue(), a = Hn(s), l = E(() => [...a?.current?.data?.[r()] || []]); var u = { get noneParameterText() { return n(); }, set noneParameterText(y = "无输入参数") { n(y), g(); }, get dataKeyName() { return r(); }, set dataKeyName(y = "parameters") { r(y), g(); }, get useChildrenOnly() { return o(); }, set useChildrenOnly(y) { o(y), g(); }, get showContentType() { return i(); }, set showContentType(y = false) { i(y), g(); } }, d = F2(), p = R(d); { var f = (y) => { var w = W2(); ve(4), L(y, w); }; ae(p, (y) => { c(l).length !== 0 && y(f); }); } var h = O(p, 2); return mt( h, 19, () => c(l), (y) => y.id, (y, w, m) => { qd(y, { get parameter() { return c(w); }, get index() { return c(m); }, get dataKeyName() { return r(); }, get useChildrenOnly() { return o(); }, get showContentType() { return i(); } }); }, (y) => { var w = Y2(), m = R(w, true); Z(w), $e(() => Re(m, n())), L(y, w); } ), Z(d), L(e3, d), ue(u); } se( bt, { noneParameterText: {}, dataKeyName: {}, useChildrenOnly: {}, showContentType: {} }, [], [], true ); var X2 = ge(''); var G2 = ge(''); var U2 = ee('
', 1); var Q2 = { hash: "svelte-1fiuxu3", code: ".heading.svelte-1fiuxu3 {display:flex;margin-bottom:10px;}" }; function Xd(e3, t) { le(t, true), He(e3, Q2); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = Ue(), { addParameter: i } = on(); var s = { get data() { return n(); }, set data(a) { n(a), g(); } }; return Yt(e3, Be( { get data() { return n(); } }, () => r, { allowExecute: false, showSourceHandle: false, icon: (a) => { var l = X2(); L(a, l); }, children: (a, l) => { var u = U2(), d = oe(u), p = R(d); Te(p, { level: 3, children: (y, w) => { ve(); var m = ke("输出参数"); L(y, m); }, $$slots: { default: true } }); var f = O(p, 2); Me(f, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o, "outputDefs", { name: "output" }); }, children: (y, w) => { var m = G2(); L(y, m); }, $$slots: { default: true } }), Z(d); var h = O(d, 2); bt(h, { noneParameterText: "无输出参数", dataKeyName: "outputDefs", showContentType: true }), L(a, u); }, $$slots: { icon: true, default: true } } )), ue(s); } se(Xd, { data: {} }, [], [], true); var is = (e3) => JSON.parse(JSON.stringify(e3)); var J2 = ge(''); var ew = ee('
'); var tw = ee('
默认值:
参数描述:
'); var nw = ee('
', 1); var rw = { 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:#fff;border:1px solid #ddd;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:#666;}" }; function Gd(e3, t) { le(t, true), He(e3, rw); const n = v(t, "parameter", 7), r = v(t, "position", 7), o = v(t, "dataKeyName", 7), i = v(t, "placeholder", 7, "请输入参数值"); let s = Ue(), a = Hn(s), l = E(() => { let S = a?.current?.data?.[o()], T; if (S && r().length > 0) { let C = S; for (let P = 0; P < r().length; P++) { const M = r()[P]; P == r().length - 1 ? T = C[M] : C = C[M].children; } } return { ...n(), ...T }; }); const { updateNodeData: u } = st(), d = (S, T) => { u(s, (C) => { const P = C.data?.[o()]; if (P && r().length > 0) { let M = P; for (let K = 0; K < r().length; K++) { const B = r()[K]; K == r().length - 1 ? M[B] = { ...M[B], [S]: T } : M = M[B].children; } } return { [o()]: [...is(P)] }; }); }, p = (S, T) => { const C = T.target.value; d(S, C); }, f = (S) => { const T = S.value; d("dataType", T); }; let h; const y = () => { u(s, (S) => { let T = S.data?.[o()]; if (T && r().length > 0) { let C = T; for (let P = 0; P < r().length; P++) { const M = r()[P]; P == r().length - 1 ? C.splice(M, 1) : C = C[M].children; } } return { [o()]: [...is(T)] }; }), h?.hide(); }, w = () => { u(s, (S) => { let T = S.data?.[o()]; if (T && r().length > 0) { let C = T; for (let P = 0; P < r().length; P++) { const M = r()[P]; P == r().length - 1 ? C[M].children ? C[M].children.push({ id: Ln(), name: "newParam", dataType: "String" }) : C[M].children = [{ id: Ln(), name: "newParam", dataType: "String" }] : C = C[M].children; } } return { [o()]: [...is(T)] }; }); }; var m = { get parameter() { return n(); }, set parameter(S) { n(S), g(); }, get position() { return r(); }, set position(S) { r(S), g(); }, get dataKeyName() { return o(); }, set dataKeyName(S) { o(S), g(); }, get placeholder() { return i(); }, set placeholder(S = "请输入参数值") { i(S), g(); } }, b = nw(), $ = oe(b), _ = R($); { var x = (S) => { var T = Se(), C = oe(T); mt(C, 17, r, Lr, (P, M) => { ve(); var K = ke(" "); L(P, K); }), L(S, T); }; ae(_, (S) => { r().length > 1 && S(x); }); } var k = O(_, 2); { let S = E(() => c(l).nameDisabled === true); Je(k, { style: "width: 100%;", get value() { return c(l).name; }, get placeholder() { return i(); }, oninput: (T) => { p("name", T); }, get disabled() { return c(S); } }); } Z($); var N = O($, 2), V = R(N); { let S = E(() => c(l).dataTypeItems || Wm), T = E(() => c(l).dataType ? [c(l).dataType] : []), C = E(() => c(l).dataTypeDisabled === true); ut(V, { get items() { return c(S); }, style: "width: 100%", defaultValue: ["String"], get value() { return c(T); }, get disabled() { return c(C); }, onSelect: f }); } var j = O(V, 2); { var A = (S) => { Me(S, { class: "input-btn-more", style: "margin-left: auto", onclick: w, children: (T, C) => { var P = J2(); L(T, P); }, $$slots: { default: true } }); }; ae(j, (S) => { (c(l).dataType === "Object" || c(l).dataType === "Array") && c(l).addChildDisabled !== true && S(A); }); } Z(N); var H = O(N, 2), z = R(H); return Nt( nr(z, { placement: "bottom", floating: (S) => { var T = tw(), C = R(T), P = O(R(C)); { let D = E(() => c(l).defaultValue || ""); Ke(P, { rows: 1, style: "width: 100%;", get value() { return c(D); }, onchange: (X) => { p("defaultValue", X); } }); } Z(C); var M = O(C, 2), K = O(R(M)); { let D = E(() => c(l).description || ""); Ke(K, { rows: 3, style: "width: 100%;", get value() { return c(D); }, onchange: (X) => { p("description", X); } }); } Z(M); var B = O(M, 2); { var W = (D) => { var X = ew(), q = R(X); Me(q, { onclick: y, children: (U, I) => { ve(); var F = ke("删除"); L(U, F); }, $$slots: { default: true } }), Z(X), L(D, X); }; ae(B, (D) => { c(l).deleteDisabled !== true && D(W); }); } Z(T), L(S, T); }, children: (S, T) => { Oo(S, {}); }, $$slots: { floating: true, default: true } }), (S) => h = S, () => h ), Z(H), L(e3, b), ue(m); } se( Gd, { parameter: {}, position: {}, dataKeyName: {}, placeholder: {} }, [], [], true ); var ow = ee(" ", 1); var iw = ee('
'); var sw = ee('
参数名称
参数类型
', 1); var aw = ee('
'); var lw = { 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:#f8f8f8;height:40px;display:flex;justify-content:center;align-items:center;border-radius:5px;width:calc(100% - 5px);grid-column:1 / -1; /* 从第一列开始到最后一列结束 */}.input-container.svelte-1oz5kx0 .input-header:where(.svelte-1oz5kx0) {font-size:12px;color:#666;}` }; function Zn(e3, t) { le(t, true), He(e3, lw); const n = (y, w = vt, m = vt) => { var b = Se(), $ = oe(b); mt( $, 19, w, (_) => `${_.id}_${_.children ? _.children.length : 0}`, (_, x, k) => { var N = ow(), V = oe(N); { let H = E(() => [...m(), c(k)]); Gd(V, { get parameter() { return c(x); }, get position() { return c(H); }, get dataKeyName() { return o(); }, get placeholder() { return i(); } }); } var j = O(V, 2); { var A = (H) => { { let z = E(() => [...m(), c(k)]); n(H, () => c(x).children, () => c(z)); } }; ae(j, (H) => { c(x).children && H(A); }); } L(_, N); }, (_) => { var x = Se(), k = oe(x); { var N = (V) => { var j = iw(), A = R(j, true); Z(j), $e(() => Re(A, r())), L(V, j); }; ae(k, (V) => { m().length === 0 && V(N); }); } L(_, x); } ), L(y, b); }, r = v(t, "noneParameterText", 7, "无输出参数"), o = v(t, "dataKeyName", 7, "outputDefs"), i = v(t, "placeholder", 7, "请输入参数名称"); let s = Ue(), a = Hn(s), l = E(() => [...a?.current?.data?.[o()] || []]); var u = { get noneParameterText() { return r(); }, set noneParameterText(y = "无输出参数") { r(y), g(); }, get dataKeyName() { return o(); }, set dataKeyName(y = "outputDefs") { o(y), g(); }, get placeholder() { return i(); }, set placeholder(y = "请输入参数名称") { i(y), g(); } }, d = aw(), p = R(d); { var f = (y) => { var w = sw(); ve(4), L(y, w); }; ae(p, (y) => { c(l).length !== 0 && y(f); }); } var h = O(p, 2); return n(h, () => c(l) || [], () => []), Z(d), L(e3, d), ue(u); } se(Zn, { noneParameterText: {}, dataKeyName: {}, placeholder: {} }, [], [], true); var uw = ge(''); var cw = ge(''); var dw = ge(''); var fw = ee('
采样参数
'); var pw = ee('
模型
系统提示词
用户提示词
', 1); var hw = { hash: "svelte-j81vcl", code: `.heading.svelte-j81vcl {display:flex;align-items:center;margin-bottom:10px;}.setting-title.svelte-j81vcl {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-j81vcl {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;} /* 新增样式 */.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:#666;display:flex;justify-content:space-between;align-items:center;}.llm-setting.svelte-j81vcl {width:200px;background:#fff;padding:10px;border-radius:5px;box-shadow:0 0 10px rgba(0, 0, 0, 0.1);border:1px solid #ddd;}input[type="range"].svelte-j81vcl {width:100%;height:4px;background:#ddd;border-radius:2px;outline:none;-webkit-appearance:none;}input[type="range"].svelte-j81vcl::-webkit-slider-thumb {-webkit-appearance:none;width:14px;height:14px;background:#007bff;border-radius:50%;cursor:pointer;}` }; function Ud(e3, t) { le(t, true), He(e3, hw); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = Ue(), { addParameter: i } = on(), s = Un(); let a = Ee(Rt([])); zn(async () => { const p = await s.provider?.llm?.(); c(a).push(...p || []); }); const { updateNodeData: l } = st(), u = (p) => { l(o, () => ({ outType: p })), p === "text" ? l(o, { outputDefs: [ { name: "output", dataType: "String", dataTypeDisabled: true, deleteDisabled: true } ] }) : l(o, { outputDefs: [ { name: "root", dataType: "Object", dataTypeItems: [ { value: "Object", label: "Object" }, { value: "Array", label: "Array" } ], deleteDisabled: true } ] }); }; qe(() => { n().outType || u("text"); }); var d = { get data() { return n(); }, set data(p) { n(p), g(); } }; return Yt(e3, Be( { get data() { return n(); } }, () => r, { icon: (p) => { var f = uw(); L(p, f); }, children: (p, f) => { var h = pw(), y = oe(h), w = R(y); Te(w, { level: 3, children: (B, W) => { ve(); var D = ke("输入参数"); L(B, D); }, $$slots: { default: true } }); var m = O(w, 2); Me(m, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o); }, children: (B, W) => { var D = cw(); L(B, D); }, $$slots: { default: true } }), Z(y); var b = O(y, 2); bt(b, {}); var $ = O(b, 2), _ = R($); Te(_, { level: 3, children: (B, W) => { ve(); var D = ke("图片识别"); L(B, D); }, $$slots: { default: true } }); var x = O(_, 2); Me(x, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o, "images"); }, children: (B, W) => { var D = dw(); L(B, D); }, $$slots: { default: true } }), Z($); var k = O($, 2); bt(k, { dataKeyName: "images", noneParameterText: "无图片参数" }); var N = O(k, 2); Te(N, { level: 3, mt: "10px", children: (B, W) => { ve(); var D = ke("模型设置"); L(B, D); }, $$slots: { default: true } }); var V = O(N, 4), j = R(V); { let B = E(() => n().llmId ? [n().llmId] : []); ut(j, { get items() { return c(a); }, style: "width: 100%", placeholder: "请选择模型", onSelect: (W) => { const D = W.value; l(o, () => ({ llmId: D })); }, get value() { return c(B); } }); } var A = O(j, 2); nr(A, { placement: "bottom", floating: (B) => { var W = fw(), D = O(R(W), 2), X = R(D), q = R(X), U = R(q); Z(q); var I = O(q, 2); Cn(I), I.__input = (pe) => l(o, { temperature: parseFloat(pe.target.value) }), Z(X), Z(D); var F = O(D, 2), G = R(F), te = R(G), ne = R(te); Z(te); var J = O(te, 2); Cn(J), J.__input = (pe) => l(o, { topP: parseFloat(pe.target.value) }), Z(G), Z(F); var he = O(F, 2), ce = R(he), re = R(ce), ie = R(re); Z(re); var fe = O(re, 2); Cn(fe), fe.__input = (pe) => l(o, { topK: parseInt(pe.target.value) }), Z(ce), Z(he), Z(W), $e(() => { Re(U, `Temperature: ${n().temperature ?? 0.7 ?? ""}`), Yo(I, n().temperature ?? 0.7), Re(ne, `Top P: ${n().topP ?? 0.9 ?? ""}`), Yo(J, n().topP ?? 0.9), Re(ie, `Top K: ${n().topK ?? 50 ?? ""}`), Yo(fe, n().topK ?? 50); }), L(B, W); }, children: (B, W) => { Oo(B, {}); }, $$slots: { floating: true, default: true } }), Z(V); var H = O(V, 4), z = R(H); { let B = E(() => n().systemPrompt || ""); Ke(z, { rows: 5, placeholder: "请输入系统提示词", style: "width: 100%", get value() { return c(B); }, oninput: (W) => { l(o, { systemPrompt: W.target.value }); } }); } Z(H); var S = O(H, 4), T = R(S); { let B = E(() => n().userPrompt || ""); Ke(T, { rows: 5, placeholder: "请输入用户提示词", style: "width: 100%", get value() { return c(B); }, oninput: (W) => { l(o, { userPrompt: W.target.value }); } }); } Z(S); var C = O(S, 2), P = R(C); Te(P, { level: 3, children: (B, W) => { ve(); var D = ke("输出参数"); L(B, D); }, $$slots: { default: true } }); var M = O(P, 2); { let B = E(() => n().outType ? [n().outType] : []); ut(M, { items: [ { label: "文本", value: "text" }, { label: "JSON", value: "json" } ], style: "width: 100px;margin-left: auto", onSelect: (W) => { u(W.value); }, get value() { return c(B); } }); } Z(C); var K = O(C, 2); Zn(K, {}), L(p, h); }, $$slots: { icon: true, default: true } } )), ue(d); } er(["input"]); se(Ud, { data: {} }, [], [], true); var gw = ge(''); var vw = ge(''); var mw = ge(''); var yw = ee('
执行引擎
执行代码
', 1); var ww = { hash: "svelte-1wcsayx", code: ".heading.svelte-1wcsayx {display:flex;margin-bottom:10px;}.setting-title.svelte-1wcsayx {font-size:12px;color:#999;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 Qd(e3, t) { le(t, true), He(e3, ww); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]); zn(() => { n().engine || s(o, () => ({ engine: "qlexpress" })); }); const o = Ue(), { addParameter: i } = on(), { updateNodeData: s } = st(), a = [ { label: "QLExpress", value: "qlexpress" }, { label: "Groovy", value: "groovy" }, { label: "JavaScript", value: "js" } ]; var l = { get data() { return n(); }, set data(u) { n(u), g(); } }; return Yt(e3, Be( { get data() { return n(); } }, () => r, { icon: (u) => { var d = gw(); L(u, d); }, children: (u, d) => { var p = yw(), f = oe(p), h = R(f); Te(h, { level: 3, children: (A, H) => { ve(); var z = ke("输入参数"); L(A, z); }, $$slots: { default: true } }); var y = O(h, 2); Me(y, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o); }, children: (A, H) => { var z = vw(); L(A, z); }, $$slots: { default: true } }), Z(f); var w = O(f, 2); bt(w, {}); var m = O(w, 2); Te(m, { level: 3, mt: "10px", children: (A, H) => { ve(); var z = ke("代码"); L(A, z); }, $$slots: { default: true } }); var b = O(m, 4), $ = R(b); { let A = E(() => n().engine ? [n().engine] : ["qlexpress"]); ut($, { get items() { return a; }, style: "width: 100%", placeholder: "请选择执行引擎", onSelect: (H) => { const z = H.value; s(o, () => ({ engine: z })); }, get value() { return c(A); } }); } Z(b); var _ = O(b, 4), x = R(_); { let A = E(() => n().code || ""); Ke(x, { rows: 10, placeholder: "请输入执行代码,注:输出内容需添加到_result中,如:_result['key'] = value 或者 _result.key = value", style: "width: 100%", onchange: (H) => { s(o, () => ({ code: H.target.value })); }, get value() { return c(A); } }); } Z(_); var k = O(_, 2), N = R(k); Te(N, { level: 3, mt: "10px", children: (A, H) => { ve(); var z = ke("输出参数"); L(A, z); }, $$slots: { default: true } }); var V = O(N, 2); Me(V, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o, "outputDefs"); }, children: (A, H) => { var z = mw(); L(A, z); }, $$slots: { default: true } }), Z(k); var j = O(k, 2); Zn(j, {}), L(u, p); }, $$slots: { icon: true, default: true } } )), ue(l); } se(Qd, { data: {} }, [], [], true); var bw = ge(''); var xw = ge(''); var Cw = ee('
', 1); var $w = { 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 Jd(e3, t) { le(t, true), He(e3, $w); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = Ue(), { addParameter: i } = on(), { updateNodeData: s } = st(); qe(() => { (!n().outputDefs || n().outputDefs.length === 0) && i(o, "outputDefs", { name: "output", dataType: "String", dataTypeDisabled: true, deleteDisabled: true }); }); var a = { get data() { return n(); }, set data(l) { n(l), g(); } }; return Yt(e3, Be( { get data() { return n(); } }, () => r, { icon: (l) => { var u = bw(); L(l, u); }, children: (l, u) => { var d = Cw(), p = oe(d), f = R(p); Te(f, { level: 3, children: (k, N) => { ve(); var V = ke("输入参数"); L(k, V); }, $$slots: { default: true } }); var h = O(f, 2); Me(h, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o); }, children: (k, N) => { var V = xw(); L(k, V); }, $$slots: { default: true } }), Z(p); var y = O(p, 2); bt(y, {}); var w = O(y, 2); Te(w, { level: 3, mt: "10px", mb: "10px", children: (k, N) => { ve(); var V = ke("模板内容"); L(k, V); }, $$slots: { default: true } }); var m = O(w, 2), b = R(m); { let k = E(() => n().template || ""); Ke(b, { rows: 10, placeholder: "请输入模板内容", style: "width: 100%", onchange: (N) => { s(o, () => ({ template: N.target.value })); }, get value() { return c(k); } }); } Z(m); var $ = O(m, 2), _ = R($); Te(_, { level: 3, mt: "10px", children: (k, N) => { ve(); var V = ke("输出参数"); L(k, V); }, $$slots: { default: true } }), Z($); var x = O($, 2); Zn(x, {}), L(l, d); }, $$slots: { icon: true, default: true } } )), ue(a); } se(Jd, { data: {} }, [], [], true); var _w = ge(''); var kw = ge(''); var Sw = ge(''); var Ew = ee('
', 1); var Pw = ge(''); var Nw = ee('
', 1); var Mw = ge(''); var Tw = ee('
', 1); var Lw = ee('
'); var Vw = ee('
'); var Dw = ge(''); var Ow = ee('
', 1); var zw = { hash: "svelte-19uflw6", code: ".heading.svelte-19uflw6 {display:flex;margin-bottom:10px;}.radio-group.svelte-19uflw6 {display:flex;margin:10px 0;flex-wrap:wrap;}.radio-group.svelte-19uflw6 label:where(.svelte-19uflw6) {display:flex;font-size:14px;box-sizing:border-box;}" }; function ef(e3, t) { le(t, true), He(e3, zw); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]); zn(() => { n().method || a(i, () => ({ method: "get" })), n().outputDefs || s(i, "outputDefs", [ { name: "headers", nameDisabled: true, dataType: "Object", dataTypeDisabled: true, deleteDisabled: true }, { name: "body", nameDisabled: true, dataType: "String", deleteDisabled: true }, { name: "statusCode", nameDisabled: true, dataType: "Number", dataTypeDisabled: true, deleteDisabled: true } ]); }); const o = [ { value: "get", label: "GET" }, { value: "post", label: "POST" }, { value: "put", label: "PUT" }, { value: "delete", label: "DELETE" }, { value: "head", label: "HEAD" }, { value: "patch", label: "PATCH" } ], i = Ue(), { addParameter: s } = on(), { updateNodeData: a } = st(); var l = { get data() { return n(); }, set data(u) { n(u), g(); } }; return Yt(e3, Be( { get data() { return n(); } }, () => r, { icon: (u) => { var d = _w(); L(u, d); }, children: (u, d) => { var p = Ow(), f = oe(p), h = R(f); Te(h, { level: 3, children: (I, F) => { ve(); var G = ke("输入参数"); L(I, G); }, $$slots: { default: true } }); var y = O(h, 2); Me(y, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { s(i); }, children: (I, F) => { var G = kw(); L(I, G); }, $$slots: { default: true } }), Z(f); var w = O(f, 2); bt(w, {}); var m = O(w, 2); Te(m, { level: 3, mt: "10px", children: (I, F) => { ve(); var G = ke("URL 地址"); L(I, G); }, $$slots: { default: true } }); var b = O(m, 2), $ = R(b), _ = R($); { let I = E(() => n().method ? [n().method] : ["get"]); ut(_, { get items() { return o; }, style: "width: 100%", placeholder: "请选择请求方式", onSelect: (F) => { const G = F.value; a(i, () => ({ method: G })); }, get value() { return c(I); } }); } Z($); var x = O($, 2), k = R(x); { let I = E(() => n().url || ""); Je(k, { placeholder: "请输入url", style: "width: 100%", onchange: (F) => { a(i, () => ({ url: F.target.value })); }, get value() { return c(I); } }); } Z(x), Z(b); var N = O(b, 2), V = R(N); Te(V, { level: 3, children: (I, F) => { ve(); var G = ke("Http 头信息"); L(I, G); }, $$slots: { default: true } }); var j = O(V, 2); Me(j, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { s(i, "headers"); }, children: (I, F) => { var G = Sw(); L(I, G); }, $$slots: { default: true } }), Z(N); var A = O(N, 2); bt(A, { dataKeyName: "headers" }); var H = O(A, 2); { var z = (I) => { var F = Ew(), G = oe(F); Te(G, { level: 3, mt: "10px", children: (we, Oe) => { ve(); var Y = ke("Body"); L(we, Y); }, $$slots: { default: true } }); var te = O(G, 2), ne = R(te), J = R(ne); { let we = E(() => !n().bodyType || n().bodyType === ""); Je(J, { type: "radio", value: "", get checked() { return c(we); }, onchange: (Oe) => { Oe.target?.checked && a(i, { bodyType: "" }); } }); } ve(), Z(ne); var he = O(ne, 2), ce = R(he); { let we = E(() => n().bodyType === "form-data"); Je(ce, { type: "radio", value: "form-data", get checked() { return c(we); }, onchange: (Oe) => { Oe.target?.checked && a(i, { bodyType: "form-data" }); } }); } ve(), Z(he); var re = O(he, 2), ie = R(re); { let we = E(() => n().bodyType === "x-www-form-urlencoded"); Je(ie, { type: "radio", value: "x-www-form-urlencoded", get checked() { return c(we); }, onchange: (Oe) => { Oe.target?.checked && a(i, { bodyType: "x-www-form-urlencoded" }); } }); } ve(), Z(re); var fe = O(re, 2), pe = R(fe); { let we = E(() => n().bodyType === "json"); Je(pe, { type: "radio", value: "json", get checked() { return c(we); }, onchange: (Oe) => { Oe.target?.checked && a(i, { bodyType: "json" }); } }); } ve(), Z(fe); var Ce = O(fe, 2), de = R(Ce); { let we = E(() => n().bodyType === "raw"); Je(de, { type: "radio", value: "raw", get checked() { return c(we); }, onchange: (Oe) => { Oe.target?.checked && a(i, { bodyType: "raw" }); } }); } ve(), Z(Ce), Z(te), L(I, F); }; ae(H, (I) => { (n().method === "post" || n().method === "put" || n().method === "delete" || n().method === "patch") && I(z); }); } var S = O(H, 2); { var T = (I) => { var F = Nw(), G = oe(F), te = R(G); Te(te, { level: 3, children: (he, ce) => { ve(); var re = ke("参数"); L(he, re); }, $$slots: { default: true } }); var ne = O(te, 2); Me(ne, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { s(i, "formData"); }, children: (he, ce) => { var re = Pw(); L(he, re); }, $$slots: { default: true } }), Z(G); var J = O(G, 2); bt(J, { dataKeyName: "formData" }), L(I, F); }; ae(S, (I) => { n().bodyType === "form-data" && I(T); }); } var C = O(S, 2); { var P = (I) => { var F = Tw(), G = oe(F), te = R(G); Te(te, { level: 3, children: (he, ce) => { ve(); var re = ke("Body 参数"); L(he, re); }, $$slots: { default: true } }); var ne = O(te, 2); Me(ne, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { s(i, "formUrlencoded"); }, children: (he, ce) => { var re = Mw(); L(he, re); }, $$slots: { default: true } }), Z(G); var J = O(G, 2); bt(J, { dataKeyName: "formUrlencoded" }), L(I, F); }; ae(C, (I) => { n().bodyType === "x-www-form-urlencoded" && I(P); }); } var M = O(C, 2); { var K = (I) => { var F = Lw(), G = R(F); Ke(G, { rows: 5, style: "width: 100%", placeholder: "请输入 json 信息", get value() { return n().bodyJson; }, oninput: (te) => { a(i, { bodyJson: te.target.value }); } }), Z(F), L(I, F); }; ae(M, (I) => { n().bodyType === "json" && I(K); }); } var B = O(M, 2); { var W = (I) => { var F = Vw(), G = R(F); Ke(G, { rows: 5, style: "width: 100%", placeholder: "请输入请求信息", get value() { return n().bodyRaw; }, oninput: (te) => { a(i, { bodyRaw: te.target.value }); } }), Z(F), L(I, F); }; ae(B, (I) => { n().bodyType === "raw" && I(W); }); } var D = O(B, 2), X = R(D); Te(X, { level: 3, mt: "10px", children: (I, F) => { ve(); var G = ke("输出参数"); L(I, G); }, $$slots: { default: true } }); var q = O(X, 2); Me(q, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { s(i, "outputDefs"); }, children: (I, F) => { var G = Dw(); L(I, G); }, $$slots: { default: true } }), Z(D); var U = O(D, 2); Zn(U, {}), L(u, p); }, $$slots: { icon: true, default: true } } )), ue(l); } se(ef, { data: {} }, [], [], true); var Aw = ge(''); var Hw = ge(''); var Iw = ee('
知识库
关键字
获取数据量
', 1); var Zw = { hash: "svelte-ddi5i", code: ".heading.svelte-ddi5i {display:flex;margin-bottom:10px;}.setting-title.svelte-ddi5i {font-size:12px;color:#999;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 tf(e3, t) { le(t, true), He(e3, Zw); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = Ue(), { addParameter: i } = on(), s = Un(); let a = Ee(Rt([])); zn(async () => { const d = await s.provider?.knowledge?.(); c(a).push(...d || []); }); const { updateNodeData: l } = st(); qe(() => { (!n().outputDefs || n().outputDefs.length === 0) && i(o, "outputDefs", { name: "documents", dataType: "Array", nameDisabled: true, dataTypeDisabled: true, addChildDisabled: true, deleteDisabled: true, children: [ { name: "title", dataType: "String", nameDisabled: true, dataTypeDisabled: true, deleteDisabled: true }, { name: "content", dataType: "String", nameDisabled: true, dataTypeDisabled: true, deleteDisabled: true }, { name: "documentId", dataType: "Number", nameDisabled: true, dataTypeDisabled: true, deleteDisabled: true }, { name: "knowledgeId", dataType: "Number", nameDisabled: true, dataTypeDisabled: true, deleteDisabled: true } ] }); }); var u = { get data() { return n(); }, set data(d) { n(d), g(); } }; return Yt(e3, Be( { get data() { return n(); } }, () => r, { icon: (d) => { var p = Aw(); L(d, p); }, children: (d, p) => { var f = Iw(), h = oe(f), y = R(h); Te(y, { level: 3, children: (z, S) => { ve(); var T = ke("输入参数"); L(z, T); }, $$slots: { default: true } }); var w = O(y, 2); Me(w, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o); }, children: (z, S) => { var T = Hw(); L(z, T); }, $$slots: { default: true } }), Z(h); var m = O(h, 2); bt(m, {}); var b = O(m, 2); Te(b, { level: 3, mt: "10px", children: (z, S) => { ve(); var T = ke("知识库设置"); L(z, T); }, $$slots: { default: true } }); var $ = O(b, 4), _ = R($); { let z = E(() => n().knowledgeId ? [n().knowledgeId] : []); ut(_, { get items() { return c(a); }, style: "width: 100%", placeholder: "请选择知识库", onSelect: (S) => { const T = S.value; l(o, () => ({ knowledgeId: T })); }, get value() { return c(z); } }); } Z($); var x = O($, 4), k = R(x); Je(k, { placeholder: "请输入关键字", style: "width: 100%", get value() { return n().keyword; }, onchange: (z) => { const S = z.target.value; l(o, () => ({ keyword: S })); } }), Z(x); var N = O(x, 4), V = R(N); { let z = E(() => n().limit || ""); Je(V, { placeholder: "搜索的数据条数", style: "width: 100%", onchange: (S) => { const T = S.target.value; l(o, () => ({ limit: T })); }, get value() { return c(z); } }); } Z(N); var j = O(N, 2), A = R(j); Te(A, { level: 3, mt: "10px", children: (z, S) => { ve(); var T = ke("输出参数"); L(z, T); }, $$slots: { default: true } }), Z(j); var H = O(j, 2); Zn(H, {}), L(d, f); }, $$slots: { icon: true, default: true } } )), ue(u); } se(tf, { data: {} }, [], [], true); var jw = ge(''); var Kw = ge(''); var Rw = ee('
搜索引擎
关键字
搜索数据量
', 1); var Bw = { hash: "svelte-1qblm04", code: ".heading.svelte-1qblm04 {display:flex;margin-bottom:10px;}.setting-title.svelte-1qblm04 {font-size:12px;color:#999;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 nf(e3, t) { le(t, true), He(e3, Bw); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = Ue(), { addParameter: i } = on(), s = Un(); let a = Ee(Rt([])); zn(async () => { const d = await s.provider?.searchEngine?.(); c(a).push(...d || []); }); const { updateNodeData: l } = st(); qe(() => { (!n().outputDefs || n().outputDefs.length === 0) && i(o, "outputDefs", { name: "documents", dataType: "Array", nameDisabled: true, dataTypeDisabled: true, addChildDisabled: true, deleteDisabled: true, children: [ { name: "title", dataType: "String", nameDisabled: true, dataTypeDisabled: true, deleteDisabled: true }, { name: "content", dataType: "String", nameDisabled: true, dataTypeDisabled: true, deleteDisabled: true } ] }); }); var u = { get data() { return n(); }, set data(d) { n(d), g(); } }; return Yt(e3, Be( { get data() { return n(); } }, () => r, { icon: (d) => { var p = jw(); L(d, p); }, children: (d, p) => { var f = Rw(), h = oe(f), y = R(h); Te(y, { level: 3, children: (z, S) => { ve(); var T = ke("输入参数"); L(z, T); }, $$slots: { default: true } }); var w = O(y, 2); Me(w, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o); }, children: (z, S) => { var T = Kw(); L(z, T); }, $$slots: { default: true } }), Z(h); var m = O(h, 2); bt(m, {}); var b = O(m, 2); Te(b, { level: 3, mt: "10px", children: (z, S) => { ve(); var T = ke("搜索引擎设置"); L(z, T); }, $$slots: { default: true } }); var $ = O(b, 4), _ = R($); { let z = E(() => n().engine ? [n().engine] : []); ut(_, { get items() { return c(a); }, style: "width: 100%", placeholder: "请选择搜索引擎", onSelect: (S) => { const T = S.value; l(o, () => ({ engine: T })); }, get value() { return c(z); } }); } Z($); var x = O($, 4), k = R(x); Je(k, { placeholder: "请输入关键字", style: "width: 100%", get value() { return n().keyword; }, onchange: (z) => { const S = z.target.value; l(o, () => ({ keyword: S })); } }), Z(x); var N = O(x, 4), V = R(N); Je(V, { placeholder: "搜索的数据条数", style: "width: 100%", get value() { return n().limit; }, onchange: (z) => { const S = z.target.value; l(o, () => ({ limit: S })); } }), Z(N); var j = O(N, 2), A = R(j); Te(A, { level: 3, mt: "10px", children: (z, S) => { ve(); var T = ke("输出参数"); L(z, T); }, $$slots: { default: true } }), Z(j); var H = O(j, 2); Zn(H, {}), L(d, f); }, $$slots: { icon: true, default: true } } )), ue(u); } se(nf, { data: {} }, [], [], true); var Ww = ge(''); var Yw = ge(''); var Fw = ee('
', 1); var qw = { 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:#000;color:#fff;display:flex;justify-content:center;align-items:center;}" }; function rf(e3, t) { le(t, true), He(e3, qw); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = Ue(), { addParameter: i } = on(); qe(() => { (!n().loopVars || n().loopVars.length === 0) && i(o, "loopVars", { name: "loopVar", nameDisabled: true, deleteDisabled: true }); }); var s = { get data() { return n(); }, set data(a) { n(a), g(); } }; return Yt(e3, Be( { get data() { return n(); } }, () => r, { icon: (a) => { var l = Ww(); L(a, l); }, handle: (a) => { Xn(a, { type: "source", get position() { return me.Bottom; }, id: "loop_handle", style: "bottom: -12px;width: 100px", class: "loop_handle_wrapper" }); }, children: (a, l) => { var u = Fw(), d = oe(u), p = R(d); Te(p, { level: 3, children: (b, $) => { ve(); var _ = ke("循环变量"); L(b, _); }, $$slots: { default: true } }), Z(d); var f = O(d, 2); bt(f, { dataKeyName: "loopVars" }); var h = O(f, 2), y = R(h); Te(y, { level: 3, children: (b, $) => { ve(); var _ = ke("输出参数"); L(b, _); }, $$slots: { default: true } }); var w = O(y, 2); Me(w, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o, "outputDefs"); }, children: (b, $) => { var _ = Yw(); L(b, _); }, $$slots: { default: true } }), Z(h); var m = O(h, 2); bt(m, { noneParameterText: "无输出参数", dataKeyName: "outputDefs", useChildrenOnly: true }), L(a, u); }, $$slots: { icon: true, handle: true, default: true } } )), ue(s); } se(rf, { data: {} }, [], [], true); var Xw = ee('
数据内容:
确认方式:
数据标题:
数据描述:
'); var Gw = ee('
', 1); var Uw = { 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:#fff;border:1px solid #ddd;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:#666;}" }; function of(e3, t) { le(t, true), He(e3, Uw); const n = v(t, "parameter", 7), r = v(t, "index", 7), o = v(t, "dataKeyName", 7), i = v(t, "useChildrenOnly", 7); let s = Ue(), a = Hn(s), l = E(() => ({ ...n(), ...a?.current?.data?.[o()][r()] })); const { updateNodeData: u } = st(), d = (S, T) => { u(s, (C) => { let P = C.data?.[o()]; return P[r()] = { ...P[r()], [S]: T }, { [o()]: P }; }); }, p = (S, T) => { const C = T.target.value; d(S, C); }, f = (S) => { const T = S.value; d("ref", T); }, h = (S) => { const T = S.value; d("formType", T); }, y = (S) => { const T = S.value; d("contentType", T); }; let w; const m = () => { u(s, (S) => { let T = S.data?.[o()]; return T.splice(r(), 1), { [o()]: [...T] }; }), w?.hide(); }; let b = Fd(i()); var $ = { get parameter() { return n(); }, set parameter(S) { n(S), g(); }, get index() { return r(); }, set index(S) { r(S), g(); }, get dataKeyName() { return o(); }, set dataKeyName(S) { o(S), g(); }, get useChildrenOnly() { return i(); }, set useChildrenOnly(S) { i(S), g(); } }, _ = Gw(), x = oe(_), k = R(x); { let S = E(() => c(l).nameDisabled === true); Je(k, { style: "width: 100%;", get value() { return c(l).name; }, placeholder: "请输入参数名称", get disabled() { return c(S); }, oninput: (T) => p("name", T) }); } Z(x); var N = O(x, 2), V = R(N); { var j = (S) => { Je(S, { get value() { return c(l).value; }, placeholder: "请输入参数值", oninput: (T) => p("value", T) }); }, A = (S) => { var T = Se(), C = oe(T); { var P = (M) => { { let K = E(() => [c(l).ref]); ut(M, { get items() { return b.current; }, style: "width: 100%", defaultValue: ["ref"], get value() { return c(K); }, expandAll: true, onSelect: f }); } }; ae( C, (M) => { c(l).refType !== "input" && M(P); }, true ); } L(S, T); }; ae(V, (S) => { c(l).refType === "fixed" ? S(j) : S(A, false); }); } Z(N); var H = O(N, 2), z = R(H); return Nt( nr(z, { placement: "bottom", floating: (S) => { var T = Xw(), C = R(T), P = O(R(C)); { let I = E(() => c(l).contentType ? [c(l).contentType] : []); ut(P, { get items() { return ha; }, style: "width: 100%", defaultValue: ["text"], get value() { return c(I); }, onSelect: y }); } Z(C); var M = O(C, 2), K = O(R(M)); { let I = E(() => c(l).formType ? [c(l).formType] : []); ut(K, { get items() { return qm; }, style: "width: 100%", defaultValue: ["single"], get value() { return c(I); }, onSelect: h }); } Z(M); var B = O(M, 2), W = O(R(B)); Ke(W, { rows: 1, style: "width: 100%;", onchange: (I) => { p("formLabel", I); }, get value() { return c(l).formLabel; } }), Z(B); var D = O(B, 2), X = O(R(D)); Ke(X, { rows: 2, style: "width: 100%;", onchange: (I) => { p("formDescription", I); }, get value() { return c(l).formDescription; } }), Z(D); var q = O(D, 2), U = R(q); Me(U, { onclick: m, children: (I, F) => { ve(); var G = ke("删除"); L(I, G); }, $$slots: { default: true } }), Z(q), Z(T), L(S, T); }, children: (S, T) => { Oo(S, {}); }, $$slots: { floating: true, default: true } }), (S) => w = S, () => w ), Z(H), L(e3, _), ue($); } se( of, { parameter: {}, index: {}, dataKeyName: {}, useChildrenOnly: {} }, [], [], true ); var Qw = ee('
参数名称
参数值
', 1); var Jw = ee('
'); var eb = ee('
'); var tb = { 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:#f8f8f8;height:40px;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:#666;}` }; function sf(e3, t) { le(t, true), He(e3, tb); const n = v(t, "noneParameterText", 7, "无确认数据"), r = v(t, "dataKeyName", 7, "parameters"), o = v(t, "useChildrenOnly", 7); let i = Ue(), s = Hn(i), a = E(() => [...s?.current?.data?.[r()] || []]); var l = { get noneParameterText() { return n(); }, set noneParameterText(h = "无确认数据") { n(h), g(); }, get dataKeyName() { return r(); }, set dataKeyName(h = "parameters") { r(h), g(); }, get useChildrenOnly() { return o(); }, set useChildrenOnly(h) { o(h), g(); } }, u = eb(), d = R(u); { var p = (h) => { var y = Qw(); ve(4), L(h, y); }; ae(d, (h) => { c(a).length !== 0 && h(p); }); } var f = O(d, 2); return mt( f, 19, () => c(a), (h) => h.id, (h, y, w) => { of(h, { get parameter() { return c(y); }, get index() { return c(w); }, get dataKeyName() { return r(); }, get useChildrenOnly() { return o(); } }); }, (h) => { var y = Jw(), w = R(y, true); Z(y), $e(() => Re(w, n())), L(h, y); } ), Z(u), L(e3, u), ue(l); } se(sf, { noneParameterText: {}, dataKeyName: {}, useChildrenOnly: {} }, [], [], true); var Ms = (e3, t) => { if (e3 === t) return true; if (typeof e3 != "object" || e3 === null || typeof t != "object" || t === null) return false; const n = Array.isArray(e3), r = Array.isArray(t); if (n !== r) return false; if (n && r) { if (e3.length !== t.length) return false; for (let o = 0; o < e3.length; o++) if (!Ms(e3[o], t[o])) return false; return true; } else { const o = Object.keys(e3), i = Object.keys(t); if (o.length !== i.length) return false; for (const s of o) if (!(s in t) || !Ms(e3[s], t[s])) return false; return true; } }; var nb = ge(''); var rb = ge(''); var ob = ee('
消息内容
', 1); var ib = { hash: "svelte-8iukvu", code: ".heading.svelte-8iukvu {display:flex;margin-bottom:10px;}.setting-title.svelte-8iukvu {font-size:12px;color:#999;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 af(e3, t) { le(t, true), He(e3, ib); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = Ue(), { addParameter: i } = on(), { updateNodeData: s } = st(); qe(() => { if (n().confirms) { const l = n().confirms.map((u) => ({ // id?: string; // name?: string; // nameDisabled?: boolean; // dataType?: string; // dataTypeDisabled?: boolean; // ref?: string; // refType?: string; // value?: string; // description?: string; // required?: boolean; // defaultValue?: string; // deleteDisabled?: boolean; // addChildDisabled?: boolean; // children?: Parameter[]; ...u, nameDisabled: true, dataTypeDisabled: true, dataType: u.formType === "checkbox" || u.formType === "select" ? "Array" : "String", addChildDisabled: true })); Ms(l, n().outputDefs) || s(o, () => ({ outputDefs: l })); } }); var a = { get data() { return n(); }, set data(l) { n(l), g(); } }; return Yt(e3, Be( { get data() { return n(); } }, () => r, { icon: (l) => { var u = nb(); L(l, u); }, children: (l, u) => { var d = ob(), p = oe(d), f = R(p); Te(f, { level: 3, children: (k, N) => { ve(); var V = ke("确认数据"); L(k, V); }, $$slots: { default: true } }); var h = O(f, 2); Me(h, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o, "confirms"); }, children: (k, N) => { var V = rb(); L(k, V); }, $$slots: { default: true } }), Z(p); var y = O(p, 2); sf(y, { dataKeyName: "confirms", noneParameterText: "无确认数据" }); var w = O(y, 2); Te(w, { level: 3, mt: "10px", children: (k, N) => { ve(); var V = ke("确认消息"); L(k, V); }, $$slots: { default: true } }); var m = O(w, 4), b = R(m); { let k = E(() => n().message || ""); Ke(b, { rows: 5, placeholder: "请输入用户需要确认的消息内容", style: "width: 100%", onchange: (N) => { s(o, () => ({ message: N.target.value })); }, get value() { return c(k); } }); } Z(m); var $ = O(m, 2), _ = R($); Te(_, { level: 3, mt: "10px", children: (k, N) => { ve(); var V = ke("输出参数"); L(k, V); }, $$slots: { default: true } }), Z($); var x = O($, 2); Zn(x, { placeholder: "" }), L(l, d); }, $$slots: { icon: true, default: true } } )), ue(a); } se(af, { data: {} }, [], [], true); var sb = { startNode: Bd, codeNode: Qd, confirmNode: af, llmNode: Ud, templateNode: Jd, httpNode: ef, knowledgeNode: tf, searchEngineNode: nf, loopNode: rf, endNode: Xd }; var ab = ee(" ", 1); function Ts(e3, t) { le(t, true); const n = v(t, "icon", 7), r = v(t, "title", 7), o = v(t, "type", 7), i = v(t, "description", 7), s = v(t, "extra", 7), a = (u) => { if (!u.dataTransfer) return null; const d = { type: o(), data: { title: r(), description: i(), ...s() } }; u.dataTransfer.setData("application/tinyflow", JSON.stringify(d)), u.dataTransfer.effectAllowed = "move"; }; var l = { get icon() { return n(); }, set icon(u) { n(u), g(); }, get title() { return r(); }, set title(u) { r(u), g(); }, get type() { return o(); }, set type(u) { o(u), g(); }, get description() { return i(); }, set description(u) { i(u), g(); }, get extra() { return s(); }, set extra(u) { s(u), g(); } }; return Me(e3, { draggable: true, ondragstart: a, get "data-node-type"() { return o(); }, children: (u, d) => { var p = ab(), f = oe(p); Xs(f, n); var h = O(f); $e(() => Re(h, ` ${r() ?? ""}`)), L(u, p); }, $$slots: { default: true } }), ue(l); } se(Ts, { icon: {}, title: {}, type: {}, description: {}, extra: {} }, [], [], true); var lb = ge(''); var ub = ge(''); var cb = ee('
'); function lf(e3, t) { le(t, true); let n = Ee("base"), r = Ee("show"); const o = [ { icon: '', title: "开始节点", type: "startNode", sortNo: 100, description: "开始定义输入参数" }, { icon: '', title: "循环", type: "loopNode", sortNo: 200, description: "用于循环执行任务" }, { icon: '', title: "大模型", type: "llmNode", sortNo: 300, description: "使用大模型处理问题" }, { icon: '', title: "知识库", type: "knowledgeNode", sortNo: 400, description: "通过知识库获取内容" }, { icon: '', title: "搜索引擎", type: "searchEngineNode", sortNo: 500, description: "通过搜索引擎搜索内容" }, { icon: '', title: "Http 请求", type: "httpNode", sortNo: 600, description: "通过 HTTP 请求获取数据" }, { icon: '', title: "动态代码", type: "codeNode", sortNo: 700, description: "动态执行代码" }, { icon: '', title: "内容模板", type: "templateNode", sortNo: 800, description: "通过模板引擎生成内容" }, { icon: '', title: "用户确认", type: "confirmNode", sortNo: 900, description: "确认继续或选择内容" }, { icon: '', title: "结束节点", type: "endNode", sortNo: 1e3, description: "结束定义输出参数" } ], i = [ { label: "基础节点", value: "base" }, { label: "业务工具", value: "tools" } ], s = [], a = Un(), l = a.customNodes; if (l) { const b = Object.keys(l).sort(($, _) => (l[$].sortNo || 0) - (l[_].sortNo || 0)); for (let $ of b) l[$].group === "base" ? o.push({ type: $, ...l[$] }) : s.push({ icon: l[$].icon, title: l[$].title, type: $ }); o.sort(($, _) => ($.sortNo || 0) - (_.sortNo || 0)); } if (a.hiddenNodes) { const b = typeof a.hiddenNodes == "function" ? a.hiddenNodes() : a.hiddenNodes; if (Array.isArray(b)) { for (let $ of b) for (let _ = 0; _ < o.length; _++) if (o[_].type === $) { o.splice(_, 1); break; } } } var u = cb(), d = R(u), p = R(d), f = R(p); Pd(f, { style: "width: 100%", get items() { return i; }, onChange: (b) => { Q(n, b.value.toString(), true); } }), Z(p); var h = O(p, 2), y = R(h); mt(y, 21, () => o, Lr, (b, $) => { Ts(b, Be(() => c($))); }), Z(y); var w = O(y, 2); mt(w, 21, () => s, Lr, (b, $) => { Ts(b, Be(() => c($))); }), Z(w), Z(h), Z(d); var m = O(d, 2); Me(m, { onclick: () => { Q(r, c(r) ? "" : "show", true); }, children: (b, $) => { var _ = Se(), x = oe(_); { var k = (V) => { var j = lb(); L(V, j); }, N = (V) => { var j = ub(); L(V, j); }; ae(x, (V) => { c(r) === "show" ? V(k) : V(N, false); }); } L(b, _); }, $$slots: { default: true } }), Z(u), $e(() => { Pt(u, 1, `tf-toolbar ${c(r) ?? ""}`), dt(y, `display: ${c(n) === "base" ? "flex" : "none"}`), dt(w, `display: ${c(n) !== "base" ? "flex" : "none"}`); }), L(e3, u), ue(); } se(lf, {}, [], [], true); var db = () => ({ getNode: (e3) => Le.getNode(e3) }); var fb = () => ({ ensureParentInNodesBefore: (e3, t) => { Le.updateNodes((n) => { let r = -1; for (let s = 0; s < n.length; s++) if (n[s].id === e3) { r = s; break; } if (r <= 0) return n; let o = -1; for (let s = 0; s < r; s++) if (n[s].parentId === e3 || n[s].id === t) { o = s; break; } if (o == -1) return n; const i = n[r]; for (let s = r; s > o; s--) n[s] = n[s - 1]; return n[o] = i, n; }); } }); var pb = () => ({ getEdgesByTarget: (e3) => Le.getEdges().filter((t) => t.target === e3) }); var hb = ge(''); var gb = ee('
', 1); var vb = ee('
', 1); var mb = ee('
', 1); var yb = ee('
', 1); var wb = ee('
', 1); var bb = ee('
', 1); var xb = ge(''); var Cb = ee('
', 1); var $b = ee("
", 1); var _b = { hash: "svelte-qt4m0r", code: `.heading.svelte-qt4m0r {display:flex;align-items:center;margin-bottom:10px;}.setting-title.svelte-qt4m0r {font-size:12px;color:#999;margin-bottom:4px;margin-top:10px;}.setting-item.svelte-qt4m0r {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px;} /* 新增样式 */.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:#666;display:flex;justify-content:space-between;align-items:center;}input[type="range"].svelte-qt4m0r {width:100%;height:4px;background:#ddd;border-radius:2px;outline:none;-webkit-appearance:none;}input[type="range"].svelte-qt4m0r::-webkit-slider-thumb {-webkit-appearance:none;width:14px;height:14px;background:#007bff;border-radius:50%;cursor:pointer;}` }; function uf(e3, t) { le(t, true), He(e3, _b); const n = v(t, "data", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "data"]), o = Ue(), { addParameter: i } = on(), s = st(), { updateNodeData: a } = s, l = (m) => { a(o, m); }, u = (m, b) => { l({ [m]: b.target?.value }); }, d = { ...r, id: o, data: n() }, p = document.createElement("div"), f = Un().customNodes[t.type]; f.render?.(p, d, s); const h = f.forms; let y; qe(() => { n().expand && y && y.append(p); }), qe(() => { n() && f.onUpdate?.(p, { ...d, data: n() }); }), qe(() => { !n().parameters && f.parameters && l({ parameters: vo(JSON.parse(JSON.stringify(f.parameters))) }); }), qe(() => { !n().outputDefs && f.outputDefs && l({ outputDefs: vo(JSON.parse(JSON.stringify(f.outputDefs))) }); }); var w = { get data() { return n(); }, set data(m) { n(m), g(); } }; { const m = ($) => { var _ = Se(), x = oe(_); Xs(x, () => f.icon), L($, _); }; let b = E(() => ({ ...n(), description: f.description })); Yt(e3, Be( { get data() { return c(b); } }, () => r, { icon: m, children: ($, _) => { var x = $b(), k = oe(x); { var N = (S) => { var T = gb(), C = oe(T), P = R(C); Te(P, { level: 3, children: (W, D) => { ve(); var X = ke("输入参数"); L(W, X); }, $$slots: { default: true } }); var M = O(P, 2); { var K = (W) => { Me(W, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o); }, children: (D, X) => { var q = hb(); L(D, q); }, $$slots: { default: true } }); }; ae(M, (W) => { f.parametersAddEnable !== false && W(K); }); } Z(C); var B = O(C, 2); bt(B, {}), L(S, T); }; ae(k, (S) => { f.parametersEnable !== false && S(N); }); } var V = O(k, 2); { var j = (S) => { var T = Se(), C = oe(T); mt(C, 17, () => h, Lr, (P, M) => { var K = Se(), B = oe(K); { var W = (X) => { var q = vb(), U = oe(q), I = R(U, true); Z(U); var F = O(U, 2), G = R(F); { let te = E(() => n()[c(M).name] || c(M).defaultValue); Je(G, Be( { get placeholder() { return c(M).placeholder; }, style: "width: 100%", get value() { return c(te); } }, () => c(M).attrs, { onchange: (ne) => { u(c(M).name, ne); } } )); } Z(F), $e(() => Re(I, c(M).label)), L(X, q); }, D = (X) => { var q = Se(), U = oe(q); { var I = (G) => { var te = mb(), ne = oe(te), J = R(ne, true); Z(ne); var he = O(ne, 2), ce = R(he); { let re = E(() => n()[c(M).name] || c(M).defaultValue); Ke(ce, Be( { rows: 3, get placeholder() { return c(M).placeholder; }, style: "width: 100%", get value() { return c(re); } }, () => c(M).attrs, { onchange: (ie) => { u(c(M).name, ie); } } )); } Z(he), $e(() => Re(J, c(M).label)), L(G, te); }, F = (G) => { var te = Se(), ne = oe(te); { var J = (ce) => { var re = yb(), ie = oe(re), fe = R(ie, true); Z(ie); var pe = O(ie, 2), Ce = R(pe), de = R(Ce), we = R(de); Z(de); var Oe = O(de, 2), Y = (je) => l({ [c(M).name]: parseFloat(je.target.value) }); ot( Oe, () => ({ class: "nodrag", type: "range", ...c(M).attrs, value: n()[c(M).name] ?? c(M).defaultValue, oninput: Y }), void 0, void 0, void 0, "svelte-qt4m0r", true ), Z(Ce), Z(pe), $e(() => { Re(fe, c(M).label), Re(we, `${c(M).description ?? ""}: ${n()[c(M).name] ?? c(M).defaultValue ?? ""}`); }), L(ce, re); }, he = (ce) => { var re = Se(), ie = oe(re); { var fe = (Ce) => { var de = wb(), we = oe(de), Oe = R(we, true); Z(we); var Y = O(we, 2), je = R(Y); { let ze = E(() => c(M).options || []), Ae = E(() => n()[c(M).name] ? [n()[c(M).name]] : [c(M).defaultValue]); ut(je, { get items() { return c(ze); }, style: "width: 100%", get placeholder() { return c(M).placeholder; }, onSelect: (Ie) => { const tt = Ie.value; l({ [c(M).name]: tt }); }, get value() { return c(Ae); } }); } Z(Y), $e(() => Re(Oe, c(M).label)), L(Ce, de); }, pe = (Ce) => { var de = Se(), we = oe(de); { var Oe = (je) => { var ze = bb(), Ae = oe(ze), Ie = R(Ae, true); Z(Ae); var tt = O(Ae, 2), Mt = R(tt); { let Ht = E(() => c(M).chosen?.buttonText); Ed(Mt, { style: "width: 100%", get placeholder() { return c(M).placeholder; }, get buttonText() { return c(Ht); }, onChosen: (Qe, ye, Ye) => { c(M).chosen?.onChosen?.(l, Qe, ye, Ye); }, get value() { return n()[c(M).chosen?.valueDataKey || ""]; }, get label() { return n()[c(M).chosen?.labelDataKey || ""]; } }); } Z(tt), $e(() => Re(Ie, c(M).label)), L(je, ze); }, Y = (je) => { var ze = Se(), Ae = oe(ze); { var Ie = (tt) => { Te(tt, Be({ level: 3, mt: "10px" }, () => c(M).attrs, { children: (Mt, Ht) => { ve(); var Qe = ke(); $e(() => Re(Qe, c(M).label)), L(Mt, Qe); }, $$slots: { default: true } })); }; ae( Ae, (tt) => { c(M).type === "heading" && tt(Ie); }, true ); } L(je, ze); }; ae( we, (je) => { c(M).type === "chosen" ? je(Oe) : je(Y, false); }, true ); } L(Ce, de); }; ae( ie, (Ce) => { c(M).type === "select" ? Ce(fe) : Ce(pe, false); }, true ); } L(ce, re); }; ae( ne, (ce) => { c(M).type === "slider" ? ce(J) : ce(he, false); }, true ); } L(G, te); }; ae( U, (G) => { c(M).type === "textarea" ? G(I) : G(F, false); }, true ); } L(X, q); }; ae(B, (X) => { c(M).type === "input" ? X(W) : X(D, false); }); } L(P, K); }), L(S, T); }; ae(V, (S) => { h && S(j); }); } var A = O(V, 2); Nt(A, (S) => y = S, () => y); var H = O(A, 2); { var z = (S) => { var T = Cb(), C = oe(T), P = R(C); Te(P, { level: 3, mt: "10px", children: (W, D) => { ve(); var X = ke("输出参数"); L(W, X); }, $$slots: { default: true } }); var M = O(P, 2); { var K = (W) => { Me(W, { class: "input-btn-more", style: "margin-left: auto", onclick: () => { i(o, "outputDefs"); }, children: (D, X) => { var q = xb(); L(D, q); }, $$slots: { default: true } }); }; ae(M, (W) => { f.outputDefsAddEnable !== false && W(K); }); } Z(C); var B = O(C, 2); Zn(B, {}), L(S, T); }; ae(H, (S) => { f.outputDefsEnable !== false && S(z); }); } $e(() => { dt(A, f.rootStyle || ""), Pt(A, 1, An(f.rootClass), "svelte-qt4m0r"); }), L($, x); }, $$slots: { icon: true, default: true } } )); } return ue(w); } se(uf, { data: {} }, [], [], true); var kb = () => ({ updateEdgeData: (e3, t, n) => { const r = Le.getEdge(e3); if (!r) return; const o = typeof t == "function" ? t(r) : t; r.data = n?.replace ? o : { ...r.data, ...o }, Le.updateEdges((i) => i.map((s) => s.id === e3 ? r : s)); } }); var Sb = () => ({ deleteEdge: (e3) => { Le.removeEdge(e3); } }); var Eb = () => { const e3 = (t, n) => n.filter( // 排除循环节点的子节点,否则在多层循环嵌套时不正确 (r) => r.source === t && r.sourceHandle !== "loop_handle" ); return { getNodesFromSource: (t) => { const n = Le.getEdges(), r = []; let o = e3(t, n); for (; o.length > 0; ) { const i = []; o.forEach((s) => { r.push(Le.getNode(s.target)), i.push(...e3(s.target, n)); }), o = i; } return r; } }; }; var Pb = () => ({ getNodeRelativePosition: (e3) => { let t = Le.getNode(e3); const n = { x: 0, y: 0 }; for (; t; ) n.x += t.position.x, n.y += t.position.y, t.parentId ? t = Le.getNode(t.parentId) : t = void 0; return n; } }); function Nb(e3) { const { id: t, type: n, position: r, data: o, parentId: i } = e3; return { id: t, type: n, position: { x: r.x, y: r.y }, parentId: i || void 0, data: o ? JSON.parse(JSON.stringify(o)) : {}, ...i !== void 0 && { parentId: i } }; } function Mb(e3) { const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(); for (const a of e3) t.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)); const o = []; for (const a of e3) (!a.parentId || !t.has(a.parentId)) && o.push(a); const i = [], s = /* @__PURE__ */ new Set(); for (; o.length > 0; ) { const a = o.shift(); if (s.has(a.id)) continue; s.add(a.id), i.push(a); const l = r.get(a.id) || []; for (const u of l) s.has(u) || o.push(t.get(u)); } for (const a of e3) s.has(a.id) || i.push(a); return i; } function Tb(e3) { const { id: t, source: n, target: r, sourceHandle: o, targetHandle: i, type: s, data: a } = e3; return { id: t, source: n, target: r, ...o !== void 0 && { sourceHandle: o }, ...i !== void 0 && { targetHandle: i }, ...s !== void 0 && { type: s }, data: a ? JSON.parse(JSON.stringify(a)) : {} }; } function Ls(e3, t) { if (e3 == null) return e3; if (Array.isArray(e3)) return e3.map((n) => Ls(n, t)); if (typeof e3 == "object") { if (e3.refType === "ref" && typeof e3.ref == "string") { const r = e3.ref.match(/^([^.\s]+)\.(.+)$/); if (r) { const [o, i, s] = r, a = t.get(i); if (a !== void 0) return { ...e3, ref: `${a}.${s}` }; } } const n = {}; for (const r in e3) Object.hasOwn(e3, r) && (n[r] = Ls(e3[r], t)); return n; } return e3; } var Lb = () => (st(), { copyHandler: async (e3) => { const t = Le.getNodes().filter((s) => s.selected); if (t.length === 0) return; const n = Le.getEdges().filter((s) => t.some((a) => a.id === s.source) && t.some((a) => a.id === s.target)), r = t.map(Nb), o = n.map(Tb), i = JSON.stringify({ tinyflowNodes: r, tinyflowEdges: o, version: "1.0" }, null, 0); try { "clipboardData" in e3 && e3.clipboardData ? (e3.clipboardData.setData("text/plain", i), e3 instanceof ClipboardEvent && e3.preventDefault()) : await navigator.clipboard.writeText(i), console.log("Copied nodes and edges to clipboard"); } catch (s) { console.error("Failed to copy:", s); try { sessionStorage.setItem("tinyflow_clipboard", i); } catch { } } }, pasteHandler: (e3) => { const t = e3.clipboardData?.getData("text/plain"); if (!t) return; let n = null; try { n = JSON.parse(t); } catch { return; } if (!n?.tinyflowNodes || !Array.isArray(n.tinyflowNodes)) return; e3.preventDefault(); const r = Mb(n.tinyflowNodes), o = n.tinyflowEdges || [], i = /* @__PURE__ */ new Map(), s = []; for (const l of r) { const u = `node_${Ln()}`; i.set(l.id, u); } for (const l of r) { const u = i.get(l.id), d = l.parentId !== void 0 ? i.get(l.parentId) : void 0, p = Ls(l.data, i); s.push({ ...l, id: u, parentId: d, data: p, position: { x: (l.position?.x ?? 0) + 50, y: (l.position?.y ?? 0) + 50 }, selected: true }); } const a = []; for (const l of o) { const u = i.get(l.source), d = i.get(l.target); u && d && a.push({ ...l, id: `edge_${Ln()}`, source: u, target: d }); } Le.updateNodes((l) => [...l.map((u) => ({ ...u, selected: false })), ...s]), Le.updateEdges((l) => [...l.map((u) => ({ ...u, selected: false })), ...a]); } }); var Nl = () => { const e3 = document.activeElement; return !e3 || !(e3 instanceof HTMLElement) ? false : e3 instanceof HTMLInputElement || e3 instanceof HTMLTextAreaElement || e3.isContentEditable; }; var Vb = ee('
边属性设置
边条件设置
'); var Db = ee(" ", 1); var Ob = ee('
'); var zb = { hash: "svelte-woejl3", code: ".panel-content.svelte-woejl3 {padding:10px;background-color:#fff;border-radius:5px;box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);width:200px;border:1px solid #efefef;}.setting-title.svelte-woejl3 {margin:10px 0;font-size:12px;color:#999;}.setting-item.svelte-woejl3 {display:flex;gap:5px;align-items:center;justify-content:end;}" }; function cf(e3, t) { le(t, true), He(e3, zb); const n = v(t, "onInit", 7), r = Ze(t, ["$$slots", "$$events", "$$legacy", "$$host", "onInit"]), o = st(); console.log("props", r), n()(o); let i = Ee(false), s = Ee(null); const { updateEdgeData: a } = kb(), l = (q) => { q.preventDefault(), q.dataTransfer && (q.dataTransfer.dropEffect = "move"); }, u = (q) => { q.preventDefault(); const U = o.screenToFlowPosition({ x: q.clientX - 250, y: q.clientY - 100 }), I = q.dataTransfer?.getData("application/tinyflow"); if (!I) return; const F = JSON.parse(I), G = { id: `node_${Ln()}`, position: U, data: {}, ...F }; Le.addNode(G), Le.selectNodeOnly(G.id); }, { getNode: d } = db(), p = (q) => { const U = d(q.source), I = d(q.target); if (q.sourceHandle === "loop_handle" || U.parentId) { const F = o.getEdges(); for (let G of F) if (G.target === q.target) { const te = d(G.source); if (q.sourceHandle === "loop_handle" && te.parentId !== U.id || U.parentId && te.parentId !== U.parentId) return false; } } return !(!U.parentId && I.parentId && I.parentId !== U.id); }, { getNodesFromSource: f } = Eb(), { getNodeRelativePosition: h } = Pb(), { ensureParentInNodesBefore: y } = fb(), w = (q, U) => { if (!U.isValid) return; const I = U.toNode; if (I.parentId) return; const F = U.fromNode, G = U.fromHandle, te = { position: { ...I.position } }; if (G.id === "loop_handle" ? te.parentId = F.id : F.parentId && (te.parentId = F.parentId), te.parentId) { const { x: ne, y: J } = h(te.parentId); te.position = { x: I.position.x - ne, y: I.position.y - J }, o.updateNode(I.id, te), f(I.id).forEach((he) => { o.updateNode(he.id, { parentId: te.parentId, position: { x: he.position.x - ne, y: he.position.y - J } }); }), y(te.parentId, I.id); } setTimeout(() => { Le.getEdges().forEach((ne) => { ne.target === I.id && ne.source == F.id && (Q(i, true), Q(s, ne, true)); }); }); }, { getEdgesByTarget: m } = pb(), b = (q) => { q.edges.forEach((U) => { U.id === c(s)?.id && (Q(s, null), Q(i, false)); const I = d(U.target); if (I && I.parentId) { const F = m(U.target), { x: G, y: te } = h(I.parentId); if (F.length === 0) o.updateNode(I.id, { parentId: void 0, position: { x: I.position.x + G, y: I.position.y + te } }), f(I.id).forEach((ne) => { o.updateNode(ne.id, { parentId: void 0, position: { x: ne.position.x + G, y: ne.position.y + te } }); }); else { let ne = false; for (let J = 0; J < F.length; J++) { const he = F[J], ce = d(he.source); if (ce.parentId || ce.type === "loopNode") { ne = true; break; } } ne || (o.updateNode(I.id, { parentId: void 0, position: { x: I.position.x + G, y: I.position.y + te } }), f(I.id).forEach((J) => { o.updateNode(J.id, { parentId: void 0, position: { x: J.position.x + G, y: J.position.y + te } }); })); } } }); }, { deleteEdge: $ } = Sb(), _ = (q, U) => { }, x = (q) => { }, { copyHandler: k, pasteHandler: N } = Lb(), V = (q) => { Nl() || ((q.ctrlKey || q.metaKey) && q.key === "c" && (q.preventDefault(), k(q)), (q.ctrlKey || q.metaKey) && q.key === "a" && (q.preventDefault(), Le.updateNodes((U) => U.map((I) => ({ ...I, selected: true }))), Le.updateEdges((U) => U.map((I) => ({ ...I, selected: true }))))); }, j = async (q) => { Nl() || N(q); }; zn(() => { window.addEventListener("keydown", V), window.addEventListener("paste", j); }), $o(() => { window.removeEventListener("keydown", V), window.removeEventListener("paste", j); }); const A = { // ...nodeTypes }, H = Un().customNodes; if (H) for (let q of Object.keys(H)) A[q] = uf; const z = Un().onDataChange; qe(() => { z?.({ nodes: Le.getNodes(), edges: Le.getEdges(), viewport: Le.getViewport() }); }); var S = { get onInit() { return n(); }, set onInit(q) { n(q), g(); } }, T = Ob(), C = R(T), P = Le.getNodes, M = Le.setNodes, K = Le.getEdges, B = Le.setEdges, W = Le.getViewport, D = Le.setViewport; { let q = E(() => ({ ...sb, ...A })), U = E(() => ({ markerEnd: { type: co.ArrowClosed, width: 20, height: 20 } })); fd(C, { get nodeTypes() { return c(q); }, get nodes() { return P(); }, set nodes(I) { M(I); }, get edges() { return K(); }, set edges(I) { B(I); }, get viewport() { return W(); }, set viewport(I) { D(I); }, class: "tinyflow-logo", ondrop: u, ondragover: l, isValidConnection: p, onconnectend: w, onconnectstart: _, onconnect: x, connectionRadius: 50, onedgeclick: (I) => { Q(i, true), Q(s, I.edge, true); }, onbeforeconnect: (I) => ({ ...I, id: Ln() }), ondelete: b, onclick: (I) => { const F = I.target; F.classList.contains("svelte-flow__edge-interaction") || F.classList.contains("panel-content") || F.closest(".panel-content") || (Q(i, false), Q(s, null)); }, get defaultEdgeOptions() { return c(U); }, children: (I, F) => { var G = Db(), te = oe(G); Cd(te, {}); var ne = O(te, 2); wd(ne, {}); var J = O(ne, 2); _d(J, {}); var he = O(J, 2); { var ce = (re) => { To(re, { children: (ie, fe) => { var pe = Vb(), Ce = O(R(pe), 4), de = R(Ce); { let je = E(() => c(s)?.data?.condition); Ke(de, { rows: 3, placeholder: "请输入边条件", style: "width: 100%", get value() { return c(je); }, onchange: (ze) => { c(s) && a(c(s).id, { condition: ze.target?.value }); } }); } Z(Ce); var we = O(Ce, 2), Oe = R(we); Me(Oe, { onclick: () => { $(c(s)?.id), Q(i, false); }, children: (je, ze) => { ve(); var Ae = ke("删除"); L(je, Ae); }, $$slots: { default: true } }); var Y = O(Oe, 2); Me(Y, { primary: true, onclick: () => { Q(i, false); }, children: (je, ze) => { ve(); var Ae = ke("保存"); L(je, Ae); }, $$slots: { default: true } }), Z(we), Z(pe), L(ie, pe); }, $$slots: { default: true } }); }; ae(he, (re) => { c(i) && re(ce); }); } L(I, G); }, $$slots: { default: true } }); } var X = O(C, 2); return lf(X, {}), Z(T), L(e3, T), ue(S); } se(cf, { onInit: {} }, [], [], true); function Ab(e3, t) { le(t, true); const n = v(t, "options", 7), r = v(t, "onInit", 7); let { data: o } = n(); if (typeof o == "string") try { o = JSON.parse(o.trim()); } catch { console.error("Invalid JSON data:", o); } Le.init(o?.nodes || [], o?.edges || []), Mr("tinyflow_options", n()); var i = { get options() { return n(); }, set options(s) { n(s), g(); }, get onInit() { return r(); }, set onInit(s) { r(s), g(); } }; return pd(e3, { children: (s, a) => { cf(s, { get onInit() { return r(); } }); }, $$slots: { default: true } }), ue(i); } customElements.define("tinyflow-component", se(Ab, { options: {}, onInit: {} }, [], [], false)); var Ib = defineComponent({ __name: "Tinyflow", props: { className: {}, style: {}, data: {}, provider: {}, customNodes: {}, onNodeExecute: { type: Function }, hiddenNodes: { type: [Array, Function] }, onDataChange: { type: Function } }, setup(e3, { expose: t }) { const n = e3, r = ref(null); let o = null; function i(a) { if (a === null || typeof a != "object") return a; try { return structuredClone(a); } catch { try { return JSON.parse(JSON.stringify(a)); } catch { return console.warn("Failed to clone object, returning original (may cause issues)", a), a; } } } return onMounted(() => { if (r.value) { const a = { ...n }; "data" in a && a.data != null && (a.data = i(a.data)), o = new Xm({ ...a, element: r.value }); } }), onUnmounted(() => { o && (o.destroy(), o = null); }), t({ getData: () => o ? o.getData() : (console.warn("Tinyflow instance is not initialized"), null) }), (a, l) => (openBlock(), createElementBlock("div", { ref_key: "divRef", ref: r, class: normalizeClass(["tinyflow", a.className]), style: normalizeStyle(a.style) }, null, 6)); } }); export { Ib as Tinyflow }; //# sourceMappingURL=@tinyflow-ai_vue.js.map