@hintergrund/worker 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/cms/handlers/admin-users.handler.d.ts +1 -0
- package/dist/api/cms/handlers/admin-users.handler.d.ts.map +1 -1
- package/dist/api/cms/handlers/admin-users.handler.js +60 -74
- package/dist/api/cms/handlers/agent-conversations.handler.d.ts +0 -1
- package/dist/api/cms/handlers/agent-conversations.handler.d.ts.map +1 -1
- package/dist/api/cms/handlers/agent-conversations.handler.js +0 -7
- package/dist/api/cms/handlers/agent-provider.handler.d.ts +12 -0
- package/dist/api/cms/handlers/agent-provider.handler.d.ts.map +1 -0
- package/dist/api/cms/handlers/agent-provider.handler.js +64 -0
- package/dist/api/cms/handlers/auth.handler.d.ts +1 -1
- package/dist/api/cms/handlers/auth.handler.d.ts.map +1 -1
- package/dist/api/cms/handlers/auth.handler.js +13 -62
- package/dist/api/cms/handlers/dashboard.handler.d.ts +1 -1
- package/dist/api/cms/handlers/dashboard.handler.d.ts.map +1 -1
- package/dist/api/cms/handlers/dashboard.handler.js +3 -4
- package/dist/api/cms/handlers/github-secrets.handler.d.ts.map +1 -1
- package/dist/api/cms/handlers/github-secrets.handler.js +12 -1
- package/dist/api/cms/handlers/integrations.handler.d.ts +5 -0
- package/dist/api/cms/handlers/integrations.handler.d.ts.map +1 -0
- package/dist/api/cms/handlers/integrations.handler.js +24 -0
- package/dist/api/cms/handlers/recovery.handler.d.ts +5 -0
- package/dist/api/cms/handlers/recovery.handler.d.ts.map +1 -0
- package/dist/api/cms/handlers/recovery.handler.js +53 -0
- package/dist/api/cms/handlers/setup.handler.d.ts.map +1 -1
- package/dist/api/cms/handlers/setup.handler.js +159 -29
- package/dist/api/cms/handlers/website-repo.handler.d.ts +2 -0
- package/dist/api/cms/handlers/website-repo.handler.d.ts.map +1 -1
- package/dist/api/cms/handlers/website-repo.handler.js +124 -16
- package/dist/api/cms/handlers/website-templates.handler.d.ts +2 -0
- package/dist/api/cms/handlers/website-templates.handler.d.ts.map +1 -1
- package/dist/api/cms/handlers/website-templates.handler.js +22 -2
- package/dist/api/cms/routes/auth.routes.d.ts +1 -1
- package/dist/api/cms/routes/auth.routes.d.ts.map +1 -1
- package/dist/api/cms/routes/auth.routes.js +7 -2
- package/dist/api/cms/routes/index.d.ts +1 -1
- package/dist/api/cms/routes/index.d.ts.map +1 -1
- package/dist/api/cms/routes/index.js +14 -9
- package/dist/api/emails/handlers/campaigns.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/campaigns.handler.js +3 -4
- package/dist/api/emails/handlers/invoice.handler.d.ts +8 -15
- package/dist/api/emails/handlers/invoice.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/invoice.handler.js +142 -170
- package/dist/api/emails/handlers/public.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/public.handler.js +27 -8
- package/dist/api/emails/handlers/send.handler.d.ts +1 -3
- package/dist/api/emails/handlers/send.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/send.handler.js +18 -65
- package/dist/api/emails/handlers/settings.handler.d.ts +60 -12
- package/dist/api/emails/handlers/settings.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/settings.handler.js +38 -94
- package/dist/api/emails/routes/admin.routes.d.ts.map +1 -1
- package/dist/api/emails/routes/admin.routes.js +5 -6
- package/dist/api/emails/routes/mail-events.routes.d.ts +5 -0
- package/dist/api/emails/routes/mail-events.routes.d.ts.map +1 -0
- package/dist/api/emails/routes/mail-events.routes.js +29 -0
- package/dist/api/emails/routes/mail.routes.d.ts +5 -0
- package/dist/api/emails/routes/mail.routes.d.ts.map +1 -0
- package/dist/api/emails/routes/mail.routes.js +188 -0
- package/dist/api/shop/handlers/products.handler.d.ts +2 -2
- package/dist/api/shop/handlers/products.handler.d.ts.map +1 -1
- package/dist/api/shop/handlers/products.handler.js +30 -8
- package/dist/api/shop/handlers/public.handler.d.ts.map +1 -1
- package/dist/api/shop/handlers/public.handler.js +17 -66
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -22
- package/dist/lib/brand.d.ts +6 -0
- package/dist/lib/brand.d.ts.map +1 -0
- package/dist/lib/brand.js +29 -0
- package/dist/lib/config.d.ts +5 -11
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +21 -39
- package/dist/lib/email-template.d.ts +2 -5
- package/dist/lib/email-template.d.ts.map +1 -1
- package/dist/lib/email-template.js +6 -27
- package/dist/lib/email.d.ts +20 -11
- package/dist/lib/email.d.ts.map +1 -1
- package/dist/lib/email.js +29 -19
- package/dist/lib/github.d.ts +1 -1
- package/dist/lib/github.d.ts.map +1 -1
- package/dist/lib/github.js +13 -4
- package/dist/lib/integration-health.d.ts +18 -0
- package/dist/lib/integration-health.d.ts.map +1 -0
- package/dist/lib/integration-health.js +51 -0
- package/dist/lib/invoice.d.ts +13 -0
- package/dist/lib/invoice.d.ts.map +1 -0
- package/dist/lib/invoice.js +41 -0
- package/dist/lib/launch-draft.d.ts +14 -0
- package/dist/lib/launch-draft.d.ts.map +1 -0
- package/dist/lib/launch-draft.js +45 -0
- package/dist/lib/launch.d.ts +3 -0
- package/dist/lib/launch.d.ts.map +1 -0
- package/dist/lib/launch.js +18 -0
- package/dist/lib/mail-schema.d.ts +5 -0
- package/dist/lib/mail-schema.d.ts.map +1 -0
- package/dist/lib/mail-schema.js +62 -0
- package/dist/lib/mail.d.ts +83 -0
- package/dist/lib/mail.d.ts.map +1 -0
- package/dist/lib/mail.js +211 -0
- package/dist/lib/project-db.d.ts +5 -4
- package/dist/lib/project-db.d.ts.map +1 -1
- package/dist/lib/project-db.js +27 -42
- package/dist/lib/template-installer.d.ts +9 -0
- package/dist/lib/template-installer.d.ts.map +1 -0
- package/dist/lib/template-installer.js +97 -0
- package/dist/lib/template.d.ts.map +1 -1
- package/dist/lib/template.js +28 -0
- package/dist/lib/user-recovery.d.ts +9 -0
- package/dist/lib/user-recovery.d.ts.map +1 -0
- package/dist/lib/user-recovery.js +42 -0
- package/dist/lib/website-i18n.d.ts +10 -0
- package/dist/lib/website-i18n.d.ts.map +1 -0
- package/dist/lib/website-i18n.js +195 -0
- package/dist/middleware/auth.d.ts +3 -1
- package/dist/middleware/auth.d.ts.map +1 -1
- package/dist/middleware/auth.js +8 -4
- package/package.json +5 -3
- package/dist/hintergrund-assets.d.ts +0 -5
- package/dist/hintergrund-assets.d.ts.map +0 -1
- package/dist/hintergrund-assets.js +0 -11
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const ADMIN_JS = "import { i as wf, g as Cv, o as _v, b as kf, B as Cf, a as Sv, h as Mi, c as yc, E as _f, r as Ev, s as Tv, d as Mv, e as Nd, H as Av, f as Pv, j as Nv, k as Ov, R as $v, l as xc, T as Iv, m as zv, q as Rv, n as Kr, w as Sf, u as Ue, p as jv, t as Lv, v as Dv, x as Ef, y as Le, z as Fv, A as Bv, C as Ua, D as Tf, F as Hv, G as qv, I as Vv, J as Wv, K as kr, L as Uv, M as Od, N as c, O as Jv, P as k, Q as W, S as ft, U as wa, V as Mf, W as wc, X as hr, Y as rt, Z as nt, _ as bt, $ as Ar, a0 as ke, a1 as x, a2 as v, a3 as Je, a4 as qe, a5 as w, a6 as bs, a7 as K, a8 as B, a9 as nr, aa as st, ab as S, ac as ie, ad as m, ae as Pe, af as Ut, ag as D, ah as tt, ai as Ne, aj as pt, ak as Go, al as fe, am as ce, an as kc, ao as de, ap as Cc, aq as bn, ar as Ge, as as yn, at as Ai, au as ka, av as tr, aw as Vs, ax as lt, ay as jn, az as Af, aA as ro, aB as Pf, aC as Kv, aD as is, aE as Nf, aF as wi, aG as Oo, aH as cs, aI as _c, aJ as Gv, aK as Of, aL as Qn, aM as Ws, aN as Yv, aO as $d, aP as Xv, aQ as Yo, aR as Gs, aS as Ys, aT as $o, aU as Kt, aV as Yr, aW as Vt, aX as Ze, aY as Qv, aZ as Zv, a_ as eg, a$ as Sc, b0 as bo, b1 as tg, b2 as rg, b3 as ng, b4 as sg, b5 as og } from \"./global-DdaMTl90.js\";\nimport { _ as Xo, A as $f, a as Ec, g as If, O as Ja, S as Us, U as ig, L as oi, r as ag, c as lg, b as cg, R as dg, B as ug } from \"./Builder-BhGmzNTC.js\";\ntypeof globalThis.process > \"u\" && (globalThis.process = { env: {}, platform: \"browser\", version: \"\", versions: {}, browser: !0, nextTick: function(r) {\n return Promise.resolve().then(r);\n} });\nconst fg = [];\nfunction pg(r, e = !1, t = !1) {\n return ki(r, /* @__PURE__ */ new Map(), \"\", fg, null, t);\n}\nfunction ki(r, e, t, n, s = null, o = !1) {\n if (typeof r == \"object\" && r !== null) {\n var i = e.get(r);\n if (i !== void 0) return i;\n if (r instanceof Map) return (\n /** @type {Snapshot<T>} */\n new Map(r)\n );\n if (r instanceof Set) return (\n /** @type {Snapshot<T>} */\n new Set(r)\n );\n if (wf(r)) {\n var a = (\n /** @type {Snapshot<any>} */\n Array(r.length)\n );\n e.set(r, a), s !== null && e.set(s, a);\n for (var l = 0; l < r.length; l += 1) {\n var d = r[l];\n l in r && (a[l] = ki(d, e, t, n, null, o));\n }\n return a;\n }\n if (Cv(r) === _v) {\n a = {}, e.set(r, a), s !== null && e.set(s, a);\n for (var u of Object.keys(r))\n a[u] = ki(\n // @ts-expect-error\n r[u],\n e,\n t,\n n,\n null,\n o\n );\n return a;\n }\n if (r instanceof Date)\n return (\n /** @type {Snapshot<T>} */\n structuredClone(r)\n );\n if (typeof /** @type {T & { toJSON?: any } } */\n r.toJSON == \"function\" && !o)\n return ki(\n /** @type {T & { toJSON(): any } } */\n r.toJSON(),\n e,\n t,\n n,\n // Associate the instance with the toJSON clone\n r\n );\n }\n if (r instanceof EventTarget)\n return (\n /** @type {Snapshot<T>} */\n r\n );\n try {\n return (\n /** @type {Snapshot<T>} */\n structuredClone(r)\n );\n } catch {\n return (\n /** @type {Snapshot<T>} */\n r\n );\n }\n}\nconst hg = /* @__PURE__ */ Symbol(\"NaN\");\nfunction _s(r, e, t) {\n Mi && yc();\n var n = new Cf(r), s = !Sv();\n kf(() => {\n var o = e();\n o !== o && (o = /** @type {any} */\n hg), s && o !== null && typeof o == \"object\" && (o = /** @type {V} */\n {}), n.ensure(o, t);\n });\n}\nfunction ys(r, e, t, n, s) {\n Mi && yc();\n var o = e.$$slots?.[t], i = !1;\n o === !0 && (o = e[t === \"default\" ? \"children\" : t], i = !0), o === void 0 || o(r, i ? () => n : n);\n}\nfunction mg(r, e, t) {\n var n;\n Mi && (n = Pv, yc());\n var s = new Cf(r);\n kf(() => {\n var o = e() ?? null;\n if (Mi) {\n var i = Ev(\n /** @type {TemplateNode} */\n n\n ), a = i === Av, l = o !== null;\n if (a !== l) {\n var d = Tv();\n Mv(d), s.anchor = d, Nd(!1), s.ensure(o, o && ((u) => t(u, o))), Nd(!0);\n return;\n }\n }\n s.ensure(o, o && ((u) => t(u, o)));\n }, _f);\n}\nconst vg = () => performance.now(), _n = {\n // don't access requestAnimationFrame eagerly outside method\n // this allows basic testing of user code without JSDOM\n // bunder will eval and remove ternary when the user's app is built\n tick: (\n /** @param {any} _ */\n (r) => requestAnimationFrame(r)\n ),\n now: () => vg(),\n tasks: /* @__PURE__ */ new Set()\n};\nfunction zf() {\n const r = _n.now();\n _n.tasks.forEach((e) => {\n e.c(r) || (_n.tasks.delete(e), e.f());\n }), _n.tasks.size !== 0 && _n.tick(zf);\n}\nfunction Rf(r) {\n let e;\n return _n.tasks.size === 0 && _n.tick(zf), {\n promise: new Promise((t) => {\n _n.tasks.add(e = { c: r, f: t });\n }),\n abort() {\n _n.tasks.delete(e);\n }\n };\n}\nfunction ii(r, e) {\n Sf(() => {\n r.dispatchEvent(new CustomEvent(e));\n });\n}\nfunction gg(r) {\n if (r === \"float\") return \"cssFloat\";\n if (r === \"offset\") return \"cssOffset\";\n if (r.startsWith(\"--\")) return r;\n const e = r.split(\"-\");\n return e.length === 1 ? e[0] : e[0] + e.slice(1).map(\n /** @param {any} word */\n (t) => t[0].toUpperCase() + t.slice(1)\n ).join(\"\");\n}\nfunction Id(r) {\n const e = {}, t = r.split(\";\");\n for (const n of t) {\n const [s, o] = n.split(\":\");\n if (!s || o === void 0) break;\n const i = gg(s.trim());\n e[i] = o.trim();\n }\n return e;\n}\nconst bg = (r) => r;\nfunction Ca(r, e, t, n) {\n var s = (r & Lv) !== 0, o = (r & Dv) !== 0, i = s && o, a = (r & Iv) !== 0, l = i ? \"both\" : s ? \"in\" : \"out\", d, u = e.inert, f = e.style.overflow, h, p;\n function g() {\n return Sf(() => d ??= t()(e, n?.() ?? /** @type {P} */\n {}, {\n direction: l\n }));\n }\n var b = {\n is_global: a,\n in() {\n if (e.inert = u, !s) {\n p?.abort(), p?.reset?.();\n return;\n }\n o || h?.abort(), h = _l(\n e,\n g(),\n p,\n 1,\n () => {\n ii(e, \"introstart\");\n },\n () => {\n ii(e, \"introend\"), h?.abort(), h = d = void 0, e.style.overflow = f;\n }\n );\n },\n out(R) {\n if (!o) {\n R?.(), d = void 0;\n return;\n }\n e.inert = !0, p = _l(\n e,\n g(),\n h,\n 0,\n () => {\n ii(e, \"outrostart\");\n },\n () => {\n ii(e, \"outroend\"), R?.();\n }\n );\n },\n stop: () => {\n h?.abort(), p?.abort();\n }\n }, y = (\n /** @type {Effect & { nodes: EffectNodes }} */\n Nv\n );\n if ((y.nodes.t ??= []).push(b), s && jv) {\n var C = a;\n if (!C) {\n for (var E = (\n /** @type {Effect | null} */\n y.parent\n ); E && (E.f & _f) !== 0; )\n for (; (E = E.parent) && (E.f & Ov) === 0; )\n ;\n C = !E || (E.f & $v) !== 0;\n }\n C && xc(() => {\n Ue(() => b.in());\n });\n }\n}\nfunction _l(r, e, t, n, s, o) {\n var i = n === 1;\n if (zv(e)) {\n var a, l = !1;\n return Rv(() => {\n if (!l) {\n var C = e({ direction: i ? \"in\" : \"out\" });\n a = _l(r, C, t, n, s, o);\n }\n }), {\n abort: () => {\n l = !0, a?.abort();\n },\n deactivate: () => a.deactivate(),\n reset: () => a.reset(),\n t: () => a.t()\n };\n }\n if (t?.deactivate(), !e?.duration && !e?.delay)\n return s(), o(), {\n abort: Kr,\n deactivate: Kr,\n reset: Kr,\n t: () => n\n };\n const { delay: d = 0, css: u, tick: f, easing: h = bg } = e;\n var p = [];\n if (i && t === void 0 && (f && f(0, 1), u)) {\n var g = Id(u(0, 1));\n p.push(g, g);\n }\n var b = () => 1 - n, y = r.animate(p, { duration: d, fill: \"forwards\" });\n return y.onfinish = () => {\n y.cancel(), s();\n var C = t?.t() ?? 1 - n;\n t?.abort();\n var E = n - C, R = (\n /** @type {number} */\n e.duration * Math.abs(E)\n ), q = [];\n if (R > 0) {\n var O = !1;\n if (u)\n for (var M = Math.ceil(R / 16.666666666666668), P = 0; P <= M; P += 1) {\n var L = C + E * h(P / M), $ = Id(u(L, 1 - L));\n q.push($), O ||= $.overflow === \"hidden\";\n }\n O && (r.style.overflow = \"hidden\"), b = () => {\n var J = (\n /** @type {number} */\n /** @type {globalThis.Animation} */\n y.currentTime\n );\n return C + E * h(J / R);\n }, f && Rf(() => {\n if (y.playState !== \"running\") return !1;\n var J = b();\n return f(J, 1 - J), !0;\n });\n }\n y = r.animate(q, { duration: R, fill: \"forwards\" }), y.onfinish = () => {\n b = () => n, f?.(n, 1 - n), o();\n };\n }, {\n abort: () => {\n y && (y.cancel(), y.effect = null, y.onfinish = Kr);\n },\n deactivate: () => {\n o = Kr;\n },\n reset: () => {\n n === 0 && f?.(1, 0);\n },\n t: () => b()\n };\n}\nfunction yg(r, e, t) {\n xc(() => {\n var n = Ue(() => e(r, t?.()) || {});\n if (t && n?.update) {\n var s = !1, o = (\n /** @type {any} */\n {}\n );\n Ef(() => {\n var i = t();\n Le(i), s && Fv(o, i) && (o = i, n.update(i));\n }), s = !0;\n }\n if (n?.destroy)\n return () => (\n /** @type {Function} */\n n.destroy()\n );\n });\n}\nfunction jf(r, e, t = !1) {\n if (r.multiple) {\n if (e == null)\n return;\n if (!wf(e))\n return Hv();\n for (var n of r.options)\n n.selected = e.includes(yo(n));\n return;\n }\n for (n of r.options) {\n var s = yo(n);\n if (qv(s, e)) {\n n.selected = !0;\n return;\n }\n }\n (!t || e !== void 0) && (r.selectedIndex = -1);\n}\nfunction xg(r) {\n var e = new MutationObserver(() => {\n jf(r, r.__value);\n });\n e.observe(r, {\n // Listen to option element changes\n childList: !0,\n subtree: !0,\n // because of <optgroup>\n // Listen to option element value attribute changes\n // (doesn't get notified of select value changes,\n // because that property is not reflected as an attribute)\n attributes: !0,\n attributeFilter: [\"value\"]\n }), Tf(() => {\n e.disconnect();\n });\n}\nfunction Tc(r, e, t = e) {\n var n = /* @__PURE__ */ new WeakSet(), s = !0;\n Bv(r, \"change\", (o) => {\n var i = o ? \"[selected]\" : \":checked\", a;\n if (r.multiple)\n a = [].map.call(r.querySelectorAll(i), yo);\n else {\n var l = r.querySelector(i) ?? // will fall back to first non-disabled option if no option is selected\n r.querySelector(\"option:not([disabled])\");\n a = l && yo(l);\n }\n t(a), r.__value = a, Ua !== null && n.add(Ua);\n }), xc(() => {\n var o = e();\n if (r === document.activeElement) {\n var i = (\n /** @type {Batch} */\n Ua\n );\n if (n.has(i))\n return;\n }\n if (jf(r, o, s), s && o === void 0) {\n var a = r.querySelector(\":checked\");\n a !== null && (o = yo(a), t(o));\n }\n r.__value = o, s = !1;\n }), xg(r);\n}\nfunction yo(r) {\n return \"__value\" in r ? r.__value : r.value;\n}\nclass Mc {\n /** */\n #t = /* @__PURE__ */ new WeakMap();\n /** @type {ResizeObserver | undefined} */\n #r;\n /** @type {ResizeObserverOptions} */\n #n;\n /** @static */\n static entries = /* @__PURE__ */ new WeakMap();\n /** @param {ResizeObserverOptions} options */\n constructor(e) {\n this.#n = e;\n }\n /**\n * @param {Element} element\n * @param {(entry: ResizeObserverEntry) => any} listener\n */\n observe(e, t) {\n var n = this.#t.get(e) || /* @__PURE__ */ new Set();\n return n.add(t), this.#t.set(e, n), this.#e().observe(e, this.#n), () => {\n var s = this.#t.get(e);\n s.delete(t), s.size === 0 && (this.#t.delete(e), this.#r.unobserve(e));\n };\n }\n #e() {\n return this.#r ?? (this.#r = new ResizeObserver(\n /** @param {any} entries */\n (e) => {\n for (var t of e) {\n Mc.entries.set(t.target, t);\n for (var n of this.#t.get(t.target) || [])\n n(t);\n }\n }\n ));\n }\n}\nvar wg = /* @__PURE__ */ new Mc({\n box: \"content-box\"\n});\nfunction kg(r, e, t) {\n var n = wg, s = n.observe(\n r,\n /** @param {any} entry */\n (o) => t(o[e])\n );\n Tf(s);\n}\nfunction zd(r) {\n return function(...e) {\n var t = (\n /** @type {Event} */\n e[0]\n );\n return t.stopPropagation(), r?.apply(this, e);\n };\n}\nfunction Tr(r = !1) {\n const e = (\n /** @type {ComponentContextLegacy} */\n Vv\n ), t = e.l.u;\n if (!t) return;\n let n = () => Le(e.s);\n if (r) {\n let s = 0, o = (\n /** @type {Record<string, any>} */\n {}\n );\n const i = Jv(() => {\n let a = !1;\n const l = e.s;\n for (const d in l)\n l[d] !== o[d] && (o[d] = l[d], a = !0);\n return a && s++, s;\n });\n n = () => c(i);\n }\n t.b.length && Wv(() => {\n Rd(e, n), Od(t.b);\n }), kr(() => {\n const s = Ue(() => t.m.map(Uv));\n return () => {\n for (const o of s)\n typeof o == \"function\" && o();\n };\n }), t.a.length && kr(() => {\n Rd(e, n), Od(t.a);\n });\n}\nfunction Rd(r, e) {\n if (r.l.s)\n for (const t of r.l.s) c(t);\n e();\n}\nfunction Cg(r, e, t) {\n const n = [], s = r.map((l) => `import ${l.component} from './${l.component}.svelte';`), o = r.filter((l) => l.loadModule).map((l) => `import * as ${l.component}Loader from './${l.loadModule}';`), i = Array.from(e.entries()).map(\n ([l, d]) => `import ${d} from './${d}.svelte';`\n ), a = r.map((l) => {\n const d = e.get(l.layoutPath) || \"null\", u = l.loadModule ? `${l.component}Loader` : \"null\";\n return `{ path: '${l.path}', page: ${l.component}, layout: ${d}, loader: ${u}, pattern: routePattern('${l.path}') }`;\n });\n return n.push(\"<script>\"), n.push('\timport { onMount, tick } from \"svelte\";'), t && n.push(\"\t\" + t), n.push(\"\t\" + s.join(`\n\t`)), o.length > 0 && n.push(\"\t\" + o.join(`\n\t`)), i.length > 0 && n.push(\"\t\" + i.join(`\n\t`)), n.push(\"\"), n.push(\"\tfunction routePattern(path) {\"), n.push(\"\t\tconst keys = [];\"), n.push(\"\t\tconst source = path.split('/').filter(Boolean).map((segment) => {\"), n.push(\"\t\t\tconst optional = segment.startsWith('[[...') && segment.endsWith(']]');\"), n.push(\"\t\t\tconst rest = segment.startsWith('[...') || optional;\"), n.push(\"\t\t\tconst dynamic = segment.startsWith('[') && segment.endsWith(']');\"), n.push(\"\t\t\tif (!dynamic) return segment.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, '\\\\\\\\$&');\"), n.push(\"\t\t\tconst name = segment.replace(/^\\\\[\\\\[?\\\\.\\\\.\\\\.|^\\\\[\\\\.\\\\.\\\\.|^\\\\[\\\\[?|\\\\]\\\\]?$/g, '');\"), n.push(\"\t\t\tkeys.push(name);\"), n.push(\"\t\t\tif (optional) return '(?:/(.*))?';\"), n.push(\"\t\t\tif (rest) return '(.+)';\"), n.push(\"\t\t\treturn '([^/]+)';\"), n.push(\"\t\t}).join('/');\"), n.push(\"\t\tconst prefix = source.startsWith('(?:/') ? '' : '/';\"), n.push(\"\t\treturn { keys, regex: new RegExp('^' + prefix + source + '/?$') };\"), n.push(\"\t}\"), n.push(\"\"), n.push(\"\tconst routeList = [\"), n.push(\"\t\t\" + a.join(`,\n\t\t`)), n.push(\"\t];\"), n.push(\"\tconst routes = Object.fromEntries(routeList.filter((route) => !route.path.includes('[')).map((route) => [route.path, route]));\"), n.push(\"\"), n.push(\"\tlet currentPath = $state('/');\"), n.push(\"\tlet routeData = $state({});\"), n.push(\"\tlet loadError = $state(null);\"), n.push(\"\tlet loadedPath = $state('');\"), n.push(\"\tlet pendingAnchor = $state(null);\"), n.push(\"\tlet currentMatch = $derived(findRoute(currentPath));\"), n.push(\"\tlet currentRoute = $derived(currentMatch?.route || routes['/']);\"), n.push(\"\"), n.push(\"\tfunction normalizePath(path) {\"), n.push(\"\t\tpath = path.split('?')[0] || '/';\"), n.push(\"\t\tif (!path.startsWith('/')) path = '/' + path;\"), n.push(\"\t\tif (path !== '/' && path.endsWith('/')) path = path.slice(0, -1);\"), n.push(\"\t\treturn path;\"), n.push(\"\t}\"), n.push(\"\"), n.push(\"\tfunction findRoute(path) {\"), n.push(\"\t\tpath = normalizePath(path);\"), n.push(\"\t\tconst exact = routes[path];\"), n.push(\"\t\tif (exact) return { route: exact, params: {} };\"), n.push(\"\t\tfor (const route of routeList) {\"), n.push(\"\t\t\tif (!route.path.includes('[')) continue;\"), n.push(\"\t\t\tconst match = route.pattern.regex.exec(path);\"), n.push(\"\t\t\tif (!match) continue;\"), n.push(\"\t\t\tconst params = {};\"), n.push('\t\t\troute.pattern.keys.forEach((key, index) => { params[key] = decodeURIComponent(match[index + 1] || \"\"); });'), n.push(\"\t\t\treturn { route, params };\"), n.push(\"\t\t}\"), n.push(\"\t\treturn null;\"), n.push(\"\t}\"), n.push(\"\"), n.push(\"\tfunction navigate(path) {\"), n.push(\"\t\tpath = normalizePath(path);\"), n.push(\"\t\t\"), n.push(\"\t\t// Check if route exists\"), n.push(\"\t\tif (findRoute(path)) {\"), n.push(\"\t\t\tpendingAnchor = null;\"), n.push(\"\t\t\tcurrentPath = path;\"), n.push(\"\t\t\twindow.location.hash = path === '/' ? '' : path;\"), n.push(\"\t\t}\"), n.push(\"\t}\"), n.push(\"\"), n.push(\"\tasync function scrollAfterNavigation(anchor) {\"), n.push(\"\t\tawait tick();\"), n.push(\"\t\tif (anchor) {\"), n.push(\"\t\t\tconst el = document.getElementById(anchor);\"), n.push(\"\t\t\tif (el) {\"), n.push(\"\t\t\t\tel.scrollIntoView();\"), n.push(\"\t\t\t\treturn;\"), n.push(\"\t\t\t}\"), n.push(\"\t\t}\"), n.push(\"\t\twindow.scrollTo({ top: 0, left: 0 });\"), n.push(\"\t}\"), n.push(\"\"), n.push(\"\tasync function loadRouteData() {\"), n.push(\"\t\tconst match = currentMatch;\"), n.push(\"\t\tconst path = currentPath;\"), n.push(\"\t\tloadError = null;\"), n.push(\"\t\trouteData = {};\"), n.push(\"\t\tloadedPath = '';\"), n.push(\"\t\tif (!match?.route?.loader?.load) {\"), n.push(\"\t\t\tloadedPath = path;\"), n.push(\"\t\t\treturn;\"), n.push(\"\t\t}\"), n.push(\"\t\ttry {\"), n.push(\"\t\t\trouteData = await match.route.loader.load({ params: match.params, url: new URL(path, 'https://preview.local') });\"), n.push(\"\t\t\tloadedPath = path;\"), n.push(\"\t\t} catch (error) {\"), n.push(\"\t\t\tloadError = error;\"), n.push(\"\t\t\tloadedPath = path;\"), n.push(\"\t\t}\"), n.push(\"\t}\"), n.push(\"\"), n.push(\"\t// Handle hash changes (back/forward browser buttons)\"), n.push(\"\tasync function handleHashChange() {\"), n.push(\"\t\tconst hash = window.location.hash.slice(1) || '/';\"), n.push(\"\t\t\"), n.push(\"\t\t// Ignore pure anchors (not starting with /) to allow browser default behavior\"), n.push(\"\t\tif (!hash.startsWith('/')) return;\"), n.push(\"\t\t\"), n.push(\"\t\t// Split path and anchor (e.g. /about#team)\"), n.push(\"\t\tconst [rawPath, anchor] = hash.split('#');\"), n.push(\"\t\tconst path = normalizePath(rawPath);\"), n.push(\"\t\t\"), n.push(\"\t\tif (findRoute(path)) {\"), n.push(\"\t\t\tpendingAnchor = anchor || null;\"), n.push(\"\t\t\tcurrentPath = path;\"), n.push(\"\t\t}\"), n.push(\"\t}\"), n.push(\"\"), n.push(\"\tonMount(() => {\"), n.push(\"\t\t// Set initial route from hash\"), n.push(\"\t\thandleHashChange();\"), n.push(\"\t\t\"), n.push(\"\t\twindow.addEventListener('hashchange', handleHashChange);\"), n.push(\"\t\treturn () => window.removeEventListener('hashchange', handleHashChange);\"), n.push(\"\t});\"), n.push(\"\"), n.push(\"\t$effect(() => {\"), n.push(\"\t\tcurrentPath;\"), n.push(\"\t\tvoid loadRouteData();\"), n.push(\"\t});\"), n.push(\"\"), n.push(\"\t$effect(() => {\"), n.push(\"\t\tif (!currentRoute) return;\"), n.push(\"\t\tif (currentRoute.loader && loadedPath !== currentPath) return;\"), n.push(\"\t\tconst anchor = pendingAnchor;\"), n.push(\"\t\tpendingAnchor = null;\"), n.push(\"\t\tvoid scrollAfterNavigation(anchor);\"), n.push(\"\t});\"), n.push(\"<\\/script>\"), n.push(\"\"), n.push(\"{#if currentRoute}\"), n.push(\"\t{#if loadError}\"), n.push('\t\t<main style=\"padding: 2rem; font-family: system-ui, sans-serif;\">{loadError.message || \"Route failed to load\"}</main>'), n.push(\"\t{:else if currentRoute.loader && loadedPath !== currentPath}\"), n.push('\t\t<main style=\"padding: 2rem; font-family: system-ui, sans-serif;\"></main>'), n.push(\"\t{:else}\"), n.push(\"\t{#if currentRoute.layout}\"), n.push(\"\t\t<currentRoute.layout>\"), n.push(\"\t\t\t<currentRoute.page data={routeData} />\"), n.push(\"\t\t</currentRoute.layout>\"), n.push(\"\t{:else}\"), n.push(\"\t\t<currentRoute.page data={routeData} />\"), n.push(\"\t{/if}\"), n.push(\"\t{/if}\"), n.push(\"{/if}\"), n.join(`\n`);\n}\nfunction _g(r) {\n return r === \"/\" ? \"PageHome\" : \"Page\" + r.split(\"/\").filter(Boolean).map((e) => {\n const t = e.replace(/^\\^+|\\^+$/g, \"\").replace(/^\\[\\[?|\\]?\\]$/g, \"\").replace(/[^a-zA-Z0-9_$]/g, \"_\");\n return t.charAt(0).toUpperCase() + t.slice(1);\n }).join(\"\");\n}\nfunction Sg(r) {\n return r === \"/\" ? \"RootLayout\" : \"Layout\" + r.split(\"/\").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(\"\");\n}\nfunction jd(r, e) {\n const t = e.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"), n = r.match(new RegExp(`routes/(.*)/?${t}$`));\n return n?.[1] ? \"/\" + n[1].replace(/\\/$/, \"\") : \"/\";\n}\nfunction Eg(r) {\n return r.replace(/\\+page\\.svelte$/, \"+page.ts\");\n}\nfunction qn(r, e) {\n return {\n name: r,\n basename: r.split(\"/\").pop() || r,\n contents: e,\n text: !0,\n type: \"file\"\n };\n}\nfunction Tg(r, e = {}) {\n const t = [], n = [], s = /* @__PURE__ */ new Map();\n for (const o of r) {\n if (!o.path.endsWith(\"+layout.svelte\")) continue;\n const i = jd(o.path, \"+layout.svelte\"), a = o.path.substring(0, o.path.lastIndexOf(\"/\")), l = Sg(i);\n let d = o.content;\n const u = /(['\"])\\.\\/([^'\"].+\\.css)\\1/g;\n let f;\n for (; (f = u.exec(o.content)) !== null; ) {\n const h = f[2], p = `${a}/${h}`, g = `${l}_${h}`, b = r.find((C) => C.path === p);\n b && (t.push(qn(g, b.content)), e.debug && console.log(\"[Preview] Layout CSS:\", p, \"->\", g));\n const y = h.replace(/\\./g, \"\\\\.\");\n d = d.replace(\n new RegExp(`(['\"])\\\\./${y}\\\\1`, \"g\"),\n `$1./${g}$1`\n );\n }\n s.set(i, { name: l, content: d }), t.push(qn(`${l}.svelte`, d)), e.debug && console.log(\"[Preview] Layout:\", i, \"->\", l);\n }\n for (const o of r) {\n const i = o.path;\n if (i.includes(\"routes/\") && i.endsWith(\"+page.svelte\")) {\n const a = jd(i, \"+page.svelte\"), l = _g(a), d = r.find((p) => p.path === Eg(i)), u = d ? `${l}_load.ts` : void 0;\n let f = \"/\";\n const h = a.split(\"/\").filter(Boolean);\n for (let p = h.length; p >= 0; p--) {\n const g = p === 0 ? \"/\" : \"/\" + h.slice(0, p).filter((b) => !b.includes(\"[\")).join(\"/\");\n if (s.has(g)) {\n f = g;\n break;\n }\n }\n n.push({ path: a, component: l, layoutPath: f, loadModule: u }), t.push(qn(`${l}.svelte`, o.content)), d && u && t.push(qn(u, d.content)), e.debug && console.log(\"[Preview] Route:\", a, \"->\", l);\n } else {\n if (i.endsWith(\"+layout.svelte\"))\n continue;\n if (i.startsWith(\"lib/\") || i.includes(\"/lib/\")) {\n const a = i.includes(\"/lib/\") ? i.substring(i.indexOf(\"/lib/\") + 1) : i;\n a.endsWith(\".svelte\") || a.endsWith(\".ts\") || a.endsWith(\".js\") || a.endsWith(\".json\") || a.endsWith(\".jsonc\") || a.endsWith(\".css\") ? (t.push(qn(a, o.content)), e.debug && console.log(\"[Preview] Lib:\", i, \"->\", a)) : e.debug && console.log(\"[Preview] Skipping lib:\", i);\n } else i.endsWith(\"app.css\") ? t.push(qn(\"app.css\", o.content)) : i.endsWith(\"app.html\") || i.endsWith(\".ts\") || i.endsWith(\".js\") ? e.debug && console.log(\"[Preview] Skipping:\", i) : i.endsWith(\".svelte\") && t.push(qn(i, o.content));\n }\n }\n if (n.length > 0) {\n const o = /* @__PURE__ */ new Map();\n for (const a of n) {\n const l = s.get(a.layoutPath);\n l && o.set(a.layoutPath, l.name);\n }\n const i = t.some((a) => a.name === \"app.css\") ? \"import './app.css';\" : \"\";\n t.push(qn(\"App.svelte\", Cg(n, o, i)));\n } else e.debug && console.warn(\"[Preview] No routes found! Files:\", r.map((o) => o.path));\n return e.debug && console.log(\"[Preview] Total files for bundler:\", t.length, \"names:\", t.map((o) => o.name)), t;\n}\nconst Mg = (r) => r;\nfunction Ag(r) {\n const e = r - 1;\n return e * e * e + 1;\n}\nfunction Ac(r, { delay: e = 0, duration: t = 400, easing: n = Mg } = {}) {\n const s = +getComputedStyle(r).opacity;\n return {\n delay: e,\n duration: t,\n easing: n,\n css: (o) => `opacity: ${o * s}`\n };\n}\nfunction Pg(r, { delay: e = 0, duration: t = 400, easing: n = Ag, axis: s = \"y\" } = {}) {\n const o = getComputedStyle(r), i = +o.opacity, a = s === \"y\" ? \"height\" : \"width\", l = parseFloat(o[a]), d = s === \"y\" ? [\"top\", \"bottom\"] : [\"left\", \"right\"], u = d.map(\n (C) => (\n /** @type {'Left' | 'Right' | 'Top' | 'Bottom'} */\n `${C[0].toUpperCase()}${C.slice(1)}`\n )\n ), f = parseFloat(o[`padding${u[0]}`]), h = parseFloat(o[`padding${u[1]}`]), p = parseFloat(o[`margin${u[0]}`]), g = parseFloat(o[`margin${u[1]}`]), b = parseFloat(\n o[`border${u[0]}Width`]\n ), y = parseFloat(\n o[`border${u[1]}Width`]\n );\n return {\n delay: e,\n duration: t,\n easing: n,\n css: (C) => `overflow: hidden;opacity: ${Math.min(C * 20, 1) * i};${a}: ${C * l}px;padding-${d[0]}: ${C * f}px;padding-${d[1]}: ${C * h}px;margin-${d[0]}: ${C * p}px;margin-${d[1]}: ${C * g}px;border-${d[0]}-width: ${C * b}px;border-${d[1]}-width: ${C * y}px;min-${a}: 0`\n };\n}\nconst Io = [\n {\n id: \"studio-minimal\",\n name: \"Studio Minimal\",\n description: \"Clean neutral layout with crisp blue actions.\",\n displayFont: \"Inter\",\n bodyFont: \"Source Sans 3\",\n colors: xn(\"#F8FAFC\", \"#FFFFFF\", \"#111827\", \"#64748B\", \"#2563EB\", \"#0F766E\")\n },\n {\n id: \"saas-clarity\",\n name: \"SaaS Clarity\",\n description: \"Direct, trustworthy, and conversion-focused.\",\n displayFont: \"Inter\",\n bodyFont: \"Roboto\",\n colors: xn(\"#FFFFFF\", \"#F8FAFC\", \"#0F172A\", \"#64748B\", \"#2563EB\", \"#10B981\")\n },\n {\n id: \"warm-editorial\",\n name: \"Warm Editorial\",\n description: \"Magazine-like warmth for writing and publishing.\",\n displayFont: \"Playfair Display\",\n bodyFont: \"Source Sans 3\",\n colors: xn(\"#FAF7F2\", \"#FFFFFF\", \"#2A1F1A\", \"#7C6F67\", \"#B85C38\", \"#6B7A44\")\n },\n {\n id: \"boutique-commerce\",\n name: \"Boutique Commerce\",\n description: \"Refined product presentation with soft contrast.\",\n displayFont: \"Montserrat\",\n bodyFont: \"Lato\",\n colors: xn(\"#F7F3EF\", \"#FFFFFF\", \"#1F2933\", \"#6B7280\", \"#D14D72\", \"#8BA888\")\n },\n {\n id: \"creator-bold\",\n name: \"Creator Bold\",\n description: \"High-contrast launch energy for creators.\",\n displayFont: \"Poppins\",\n bodyFont: \"Inter\",\n colors: xn(\"#FAFAFA\", \"#FFFFFF\", \"#09090B\", \"#52525B\", \"#7C3AED\", \"#84CC16\")\n },\n {\n id: \"heritage-trust\",\n name: \"Heritage Trust\",\n description: \"Established, calm, and business-ready.\",\n displayFont: \"Merriweather\",\n bodyFont: \"Open Sans\",\n colors: xn(\"#F8F1E7\", \"#FFFFFF\", \"#102A43\", \"#627D98\", \"#8A1538\", \"#B7791F\")\n },\n {\n id: \"nature-calm\",\n name: \"Nature Calm\",\n description: \"Grounded palette for local, wellness, and craft sites.\",\n displayFont: \"Lato\",\n bodyFont: \"Merriweather\",\n colors: xn(\"#F3F7F2\", \"#FFFFFF\", \"#1F4D3A\", \"#6B8F71\", \"#1F7A5C\", \"#8EC5D6\")\n },\n {\n id: \"tech-graphite\",\n name: \"Tech Graphite\",\n description: \"Dark graphite with precise electric accents.\",\n displayFont: \"Roboto\",\n bodyFont: \"Inter\",\n colors: xn(\"#F1F5F9\", \"#FFFFFF\", \"#111827\", \"#64748B\", \"#06B6D4\", \"#8B5CF6\")\n },\n {\n id: \"playful-product\",\n name: \"Playful Product\",\n description: \"Friendly, colorful, and approachable.\",\n displayFont: \"Nunito Sans\",\n bodyFont: \"Poppins\",\n colors: xn(\"#FFF7ED\", \"#FFFFFF\", \"#1F2937\", \"#6B7280\", \"#4338CA\", \"#2DD4BF\")\n },\n {\n id: \"gallery-luxury\",\n name: \"Gallery Luxury\",\n description: \"Restrained luxury for art, venues, and premium goods.\",\n displayFont: \"Playfair Display\",\n bodyFont: \"Lato\",\n colors: xn(\"#FAFAF9\", \"#FFFFFF\", \"#0E0E0E\", \"#78716C\", \"#C6A15B\", \"#57534E\")\n }\n];\nfunction Lf() {\n const r = Io[0];\n return {\n structure: null,\n pages: [],\n designTemplateId: r.id,\n displayFont: r.displayFont,\n bodyFont: r.bodyFont,\n cornerRadius: \"soft\",\n logoColor: null,\n logoSuggestedTemplateId: null,\n designTemplateSource: \"default\",\n homepageStart: null,\n generationStatus: \"idle\",\n generatedAt: null\n };\n}\nfunction Df(r) {\n const e = Lf(), t = Io.find((s) => s.id === r?.designTemplateId) ?? Io[0], n = r?.structure === \"single-page\" || r?.structure === \"multi-page\" ? r.structure : e.structure;\n return {\n ...e,\n ...r ?? {},\n structure: n,\n designTemplateId: r?.designTemplateId ?? t.id,\n displayFont: r?.displayFont ?? t.displayFont,\n bodyFont: r?.bodyFont ?? t.bodyFont,\n cornerRadius: r?.cornerRadius === \"sharp\" || r?.cornerRadius === \"round\" ? r.cornerRadius : \"soft\",\n logoColor: r?.logoColor ?? null,\n logoSuggestedTemplateId: r?.logoSuggestedTemplateId ?? null,\n designTemplateSource: r?.designTemplateSource ?? \"default\",\n pages: Array.isArray(r?.pages) ? r.pages : e.pages,\n generationStatus: r?.generationStatus ?? \"idle\",\n generatedAt: r?.generatedAt ?? null\n };\n}\nfunction Ng(r) {\n return Io.find((e) => e.id === r) ?? Io[0];\n}\nfunction xn(r, e, t, n, s, o) {\n return {\n background: { name: \"Background\", value: r },\n surface: { name: \"Surface\", value: e },\n text: { name: \"Text\", value: t },\n muted: { name: \"Muted\", value: n },\n primary: { name: \"Primary\", value: s },\n accent: { name: \"Accent\", value: o }\n };\n}\nconst Pi = \"frontend/src/lib/website/setup.json\", Og = {\n version: 1,\n complete: !1,\n websiteSetup: Lf(),\n updatedAt: 0\n};\nfunction Sl(r) {\n return {\n ...Og,\n ...r ?? {},\n version: 1,\n complete: !!r?.complete,\n websiteSetup: Df(r?.websiteSetup)\n };\n}\nconst $g = /* @__PURE__ */ new Set([\"Playfair Display\", \"Merriweather\"]);\nfunction Ig(r) {\n const e = r.getFileContent(Pi);\n if (!e) return null;\n try {\n const t = JSON.parse(e), n = Df(t.websiteSetup);\n return { template: Ng(n.designTemplateId), bodyFont: n.bodyFont };\n } catch {\n return null;\n }\n}\nfunction Ld(r) {\n const e = Ig(r);\n if (!e) return null;\n const { colors: t } = e.template, n = $g.has(e.bodyFont) ? `'${e.bodyFont}', Georgia, 'Times New Roman', serif` : `'${e.bodyFont}', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif`;\n return {\n primaryColor: t.primary.value,\n footerHtml: \"<p>You are receiving this email because you subscribed to updates from us.</p>\",\n html: `<!doctype html>\n<html>\n<head>\n\t<meta charset=\"utf-8\">\n\t<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n</head>\n<body style=\"margin:0;padding:0;background:${t.background.value};\">\n\t<div style=\"background:${t.background.value};padding:40px 0;font-family:${n};font-size:14px;line-height:1.5;color:${t.text.value};\">\n\t\t<div style=\"max-width:580px;margin:0 auto;background:${t.surface.value};border:1px solid ${t.muted.value}33;border-radius:8px;padding:32px;\">\n\t\t\t{{logo}}\n\t\t\t{{content}}\n\t\t</div>\n\t\t<div style=\"max-width:580px;margin:20px auto 0;padding:0 32px;font-size:12px;color:${t.muted.value};text-align:center;\">\n\t\t\t{{footer}}\n\t\t\t{{unsubscribe}}\n\t\t</div>\n\t</div>\n</body>\n</html>`\n };\n}\nconst ai = \"frontend/src/lib/emails/settings.json\";\nfunction Ka() {\n return {\n primaryColor: \"#111827\",\n footerHtml: \"<p>You are receiving this email because you subscribed to updates from us.</p>\",\n html: `<!doctype html>\n<html>\n<head>\n\t<meta charset=\"utf-8\">\n\t<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n</head>\n<body style=\"margin:0;padding:0;background:#f6f8fa;\">\n\t<div style=\"background:#f6f8fa;padding:40px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;font-size:14px;line-height:1.5;color:#24292f;\">\n\t\t<div style=\"max-width:580px;margin:0 auto;background:#ffffff;border:1px solid #d0d7de;border-radius:8px;padding:32px;\">\n\t\t\t{{logo}}\n\t\t\t{{content}}\n\t\t</div>\n\t\t<div style=\"max-width:580px;margin:20px auto 0;padding:0 32px;font-size:12px;color:#6e7781;text-align:center;\">\n\t\t\t{{footer}}\n\t\t\t{{unsubscribe}}\n\t\t</div>\n\t</div>\n</body>\n</html>`\n };\n}\nfunction js() {\n return {\n showLogo: !0,\n primaryColor: \"#111827\",\n accentColor: \"#2563eb\",\n logoPosition: \"center\",\n fontFamily: \"helvetica\",\n companyName: \"Company\",\n companyAddress: \"123 Main Street, City, Country\",\n companyEmail: \"contact@company.com\",\n companyPhone: \"+1 234 567 890\",\n currencySymbol: \"$\",\n currencyPosition: \"before\",\n showTaxBreakdown: !0,\n taxLabel: \"Tax\",\n taxRate: 0,\n dueDays: 14,\n footerText: \"\"\n };\n}\nfunction fo() {\n return {\n newsletterEnabled: !0,\n doubleOptIn: !0,\n welcome: {\n subject: \"Welcome to our community!\",\n bodyHtml: `<h2>Welcome Aboard!</h2>\n<p>Thank you for confirming your subscription. We're thrilled to have you as part of our community.</p>`\n },\n confirmation: {\n subject: \"Please confirm your subscription\",\n bodyHtml: `<h2>Confirm Your Subscription</h2>\n<p>Thank you for signing up. Please confirm your email address to complete your subscription.</p>\n<p><a href=\"{{confirm_url}}\">Confirm subscription</a></p>`\n }\n };\n}\nfunction Ga(r) {\n const e = fo();\n return {\n ...e,\n ...r ?? {},\n welcome: { ...e.welcome, ...r?.welcome ?? {} },\n confirmation: { ...e.confirmation, ...r?.confirmation ?? {} }\n };\n}\nfunction hn(r) {\n return JSON.parse(JSON.stringify(pg(r)));\n}\nclass zg {\n #t;\n get subscribers() {\n return c(this.#t);\n }\n set subscribers(e) {\n k(this.#t, e, !0);\n }\n #r;\n get subscribersTotal() {\n return c(this.#r);\n }\n set subscribersTotal(e) {\n k(this.#r, e, !0);\n }\n #n;\n get campaigns() {\n return c(this.#n);\n }\n set campaigns(e) {\n k(this.#n, e, !0);\n }\n #e;\n get sends() {\n return c(this.#e);\n }\n set sends(e) {\n k(this.#e, e, !0);\n }\n #s;\n get emailTemplate() {\n return c(this.#s);\n }\n set emailTemplate(e) {\n k(this.#s, e, !0);\n }\n #o;\n get logoPath() {\n return c(this.#o);\n }\n set logoPath(e) {\n k(this.#o, e, !0);\n }\n #a;\n get logo() {\n return c(this.#a);\n }\n set logo(e) {\n k(this.#a, e, !0);\n }\n #i;\n get invoice() {\n return c(this.#i);\n }\n set invoice(e) {\n k(this.#i, e, !0);\n }\n #l;\n get automation() {\n return c(this.#l);\n }\n set automation(e) {\n k(this.#l, e, !0);\n }\n #c;\n get commitSha() {\n return c(this.#c);\n }\n set commitSha(e) {\n k(this.#c, e, !0);\n }\n #d;\n get serverEmailTemplate() {\n return c(this.#d);\n }\n set serverEmailTemplate(e) {\n k(this.#d, e, !0);\n }\n #u;\n get serverLogoPath() {\n return c(this.#u);\n }\n set serverLogoPath(e) {\n k(this.#u, e, !0);\n }\n #f;\n get serverInvoice() {\n return c(this.#f);\n }\n set serverInvoice(e) {\n k(this.#f, e, !0);\n }\n #p;\n get serverAutomation() {\n return c(this.#p);\n }\n set serverAutomation(e) {\n k(this.#p, e, !0);\n }\n #h;\n get loadingState() {\n return c(this.#h);\n }\n set loadingState(e) {\n k(this.#h, e, !0);\n }\n constructor(e) {\n this.repoFiles = e, this.#t = W(ft([])), this.#r = W(0), this.#n = W(ft([])), this.#e = W(ft([])), this.#s = W(ft(Ka())), this.#o = W(void 0), this.#a = W(void 0), this.#i = W(ft(js())), this.#l = W(ft(fo())), this.#c = W(void 0), this.#d = W(ft(Ka())), this.#u = W(void 0), this.#f = W(ft(js())), this.#p = W(ft(fo())), this.#h = W(ft({ loading: !1, error: null })), this.initPromise = null;\n }\n get subscribedCount() {\n return this.subscribers.filter((e) => e.status === \"subscribed\").length;\n }\n get unsubscribedCount() {\n return this.subscribers.filter((e) => e.status === \"unsubscribed\").length;\n }\n get hasTemplateChanges() {\n return JSON.stringify(this.emailTemplate) !== JSON.stringify(this.serverEmailTemplate) || this.logoPath !== this.serverLogoPath;\n }\n get hasInvoiceChanges() {\n return JSON.stringify(this.invoice) !== JSON.stringify(this.serverInvoice);\n }\n get hasAutomationChanges() {\n return JSON.stringify(this.automation) !== JSON.stringify(this.serverAutomation);\n }\n get hasChanges() {\n return this.hasTemplateChanges || this.hasInvoiceChanges || this.hasAutomationChanges;\n }\n get isLoading() {\n return this.loadingState.loading;\n }\n get error() {\n return this.loadingState.error;\n }\n /** Template baseline: the wrapper derived from the website design, or the generic default. */\n baseTemplate() {\n return Ld(this.repoFiles) ?? Ka();\n }\n parseSettings() {\n const e = this.repoFiles.getFileContent(ai);\n if (!e) return {\n emailTemplate: this.baseTemplate(),\n invoice: js(),\n automation: fo(),\n updatedAt: 0\n };\n try {\n const t = JSON.parse(e);\n return {\n ...t,\n emailTemplate: { ...this.baseTemplate(), ...t.emailTemplate ?? {} },\n invoice: { ...js(), ...t.invoice ?? {} },\n automation: Ga(t.automation)\n };\n } catch (t) {\n return console.error(`Failed to parse ${ai}:`, t), {\n emailTemplate: this.baseTemplate(),\n invoice: js(),\n automation: fo(),\n updatedAt: 0\n };\n }\n }\n writeSettings(e) {\n const t = {\n emailTemplate: this.emailTemplate,\n invoice: this.invoice,\n automation: this.automation,\n logoPath: this.logoPath,\n updatedAt: Date.now()\n };\n this.repoFiles.writeFile(ai, JSON.stringify(t, null, 2), { source: \"emails\", label: e });\n }\n async initialize() {\n return this.initPromise ? this.initPromise : (this.initPromise = Promise.all([\n this.fetchSubscribers(),\n this.fetchCampaigns(),\n this.fetchSettings()\n ]).then(() => {\n }), this.initPromise);\n }\n async init() {\n return this.initialize();\n }\n // ==========================================================================\n // Subscribers\n // ==========================================================================\n async fetchSubscribers(e) {\n this.loadingState = { loading: !0, error: null };\n try {\n const t = new URLSearchParams();\n e?.status && t.set(\"status\", e.status);\n const n = `/api/email/admin/subscribers${t.size ? `?${t}` : \"\"}`, s = await fetch(n);\n if (!s.ok) throw new Error(`Failed to fetch subscribers: ${s.statusText}`);\n const o = await s.json();\n this.subscribers = o.subscribers, this.subscribersTotal = o.total, this.loadingState = { loading: !1, error: null };\n } catch (t) {\n const n = t instanceof Error ? t.message : \"Failed to fetch subscribers\";\n this.loadingState = { loading: !1, error: n };\n }\n }\n async createSubscriber(e, t, n = \"subscribed\") {\n const s = await fetch(\"/api/email/admin/subscribers\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ email: e, name: t, status: n, source: \"manual\" })\n });\n if (!s.ok) {\n const o = await s.json();\n throw new Error(o.error || \"Failed to create subscriber\");\n }\n await this.fetchSubscribers();\n }\n async updateSubscriber(e, t) {\n const n = await fetch(`/api/email/admin/subscribers/${e}`, {\n method: \"PATCH\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(t)\n });\n if (!n.ok) {\n const o = await n.json();\n throw new Error(o.error || \"Failed to update subscriber\");\n }\n const s = this.subscribers.findIndex((o) => o.id === e);\n s !== -1 && (this.subscribers[s] = { ...this.subscribers[s], ...t });\n }\n async deleteSubscriber(e) {\n const t = await fetch(`/api/email/admin/subscribers/${e}`, { method: \"DELETE\" });\n if (!t.ok) {\n const n = await t.json();\n throw new Error(n.error || \"Failed to delete subscriber\");\n }\n this.subscribers = this.subscribers.filter((n) => n.id !== e), this.subscribersTotal--;\n }\n async subscribeContact(e) {\n await this.updateSubscriber(e, { status: \"subscribed\" });\n }\n async unsubscribeContact(e) {\n await this.updateSubscriber(e, { status: \"unsubscribed\" });\n }\n // ==========================================================================\n // Campaigns\n // ==========================================================================\n async fetchCampaigns() {\n const e = await fetch(\"/api/email/admin/campaigns\");\n if (!e.ok) throw new Error(`Failed to fetch campaigns: ${e.statusText}`);\n const t = await e.json();\n this.campaigns = t.campaigns;\n }\n async createCampaign(e) {\n const t = await fetch(\"/api/email/admin/campaigns\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(e)\n });\n if (!t.ok) {\n const s = await t.json();\n throw new Error(s.error || \"Failed to create campaign\");\n }\n const n = await t.json();\n return this.campaigns = [n.campaign, ...this.campaigns], n.campaign.id;\n }\n async updateCampaign(e, t) {\n const n = await fetch(`/api/email/admin/campaigns/${e}`, {\n method: \"PATCH\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(t)\n });\n if (!n.ok) {\n const s = await n.json();\n throw new Error(s.error || \"Failed to update campaign\");\n }\n await this.fetchCampaigns();\n }\n async deleteCampaign(e) {\n const t = await fetch(`/api/email/admin/campaigns/${e}`, { method: \"DELETE\" });\n if (!t.ok) {\n const n = await t.json();\n throw new Error(n.error || \"Failed to delete campaign\");\n }\n this.campaigns = this.campaigns.filter((n) => n.id !== e);\n }\n async sendCampaign(e) {\n const t = await fetch(`/api/email/admin/campaigns/${e}/send`, { method: \"POST\" });\n if (!t.ok) {\n const s = await t.json();\n throw new Error(s.error || \"Failed to send campaign\");\n }\n const n = await t.json();\n return await this.fetchCampaigns(), await this.fetchSends(), n.recipientCount;\n }\n async testCampaign(e, t) {\n const n = await fetch(`/api/email/admin/campaigns/${e}/test`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ email: t })\n });\n if (!n.ok) {\n const s = await n.json();\n throw new Error(s.error || \"Failed to send test email\");\n }\n }\n // ==========================================================================\n // Send history\n // ==========================================================================\n async fetchSends() {\n const e = await fetch(\"/api/email/admin/sends\");\n if (!e.ok) throw new Error(`Failed to fetch send history: ${e.statusText}`);\n const t = await e.json();\n this.sends = t.sends;\n }\n // ==========================================================================\n // Transactional\n // ==========================================================================\n async sendTransactional(e, t, n, s) {\n const o = await fetch(\"/api/email/admin/send\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ to: e, subject: t, bodyHtml: n, name: s })\n });\n if (!o.ok) {\n const i = await o.json();\n throw new Error(i.error || \"Failed to send email\");\n }\n }\n async sendTestEmail(e, t, n) {\n await this.sendTransactional(e, t, n);\n }\n async sendBulkEmail(e, t) {\n const n = await fetch(\"/api/email/admin/send/bulk\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ subject: e, bodyHtml: t })\n });\n if (!n.ok) {\n const o = await n.json();\n throw new Error(o.error || \"Failed to send bulk email\");\n }\n return (await n.json()).sent;\n }\n // ==========================================================================\n // Settings\n // ==========================================================================\n async fetchSettings() {\n const e = this.parseSettings();\n this.commitSha = this.repoFiles.commitSha, this.emailTemplate = { ...this.baseTemplate(), ...e.emailTemplate ?? {} }, this.logoPath = e.logoPath, this.logo = e.logoPath ? this.repoFiles.getStaticAssetDataURL(e.logoPath) ?? void 0 : void 0, this.invoice = { ...js(), ...e.invoice ?? {} }, this.automation = Ga(e.automation), this.serverEmailTemplate = hn(this.emailTemplate), this.serverLogoPath = e.logoPath, this.serverInvoice = hn(this.invoice), this.serverAutomation = hn(this.automation);\n }\n updateEmailTemplate(e) {\n this.emailTemplate = { ...this.emailTemplate, ...e };\n }\n /** True when the settings file already contains a saved wrapper template. */\n get hasStoredTemplate() {\n const e = this.repoFiles.getFileContent(ai);\n if (!e) return !1;\n try {\n return !!JSON.parse(e).emailTemplate?.html;\n } catch {\n return !1;\n }\n }\n /**\n * Stage the current (design-derived) template when none is stored yet, so\n * emails sent by the worker match what the admin previews.\n */\n ensureTemplateStaged() {\n this.hasStoredTemplate || (this.writeSettings(\"Design email template from website design\"), this.serverEmailTemplate = hn(this.emailTemplate));\n }\n /** Re-derive the wrapper from the current website design and stage it. */\n applyWebsiteDesign() {\n const e = Ld(this.repoFiles);\n return e ? (this.emailTemplate = { ...e, footerHtml: this.emailTemplate.footerHtml }, this.writeSettings(\"Match email template to website design\"), this.serverEmailTemplate = hn(this.emailTemplate), !0) : !1;\n }\n updateLogoPath(e) {\n this.logoPath = e;\n }\n async uploadLogo(e) {\n try {\n const t = await this.repoFiles.uploadAndStage(e, \"email\");\n return this.logoPath = t.path, this.logo = `data:${t.mimeType};base64,${t.content}`, { success: !0 };\n } catch (t) {\n return {\n success: !1,\n error: t instanceof Error ? t.message : \"Failed to upload logo\"\n };\n }\n }\n updateInvoice(e) {\n this.invoice = { ...this.invoice, ...e };\n }\n updateAutomation(e) {\n this.automation = Ga({ ...this.automation, ...e });\n }\n async saveSettings() {\n try {\n const e = this.hasTemplateChanges && (this.hasInvoiceChanges || this.hasAutomationChanges) ? \"Update email settings\" : this.hasTemplateChanges ? \"Update generated email template\" : this.hasAutomationChanges ? \"Update email automation\" : \"Update invoice template\";\n return this.writeSettings(e), this.commitSha = this.repoFiles.commitSha, this.serverEmailTemplate = hn(this.emailTemplate), this.serverLogoPath = this.logoPath, this.serverInvoice = hn(this.invoice), this.serverAutomation = hn(this.automation), { success: !0 };\n } catch (e) {\n return {\n success: !1,\n error: e instanceof Error ? e.message : \"Failed to save settings\"\n };\n }\n }\n discardChanges() {\n this.emailTemplate = hn(this.serverEmailTemplate), this.logoPath = this.serverLogoPath, this.invoice = hn(this.serverInvoice), this.automation = hn(this.serverAutomation);\n }\n}\nconst Ff = /* @__PURE__ */ Symbol(\"emails-context\");\nfunction Rg(r) {\n const e = new zg(r), t = new Mf();\n let n = W(void 0), s = W(void 0);\n const o = {\n emails: e,\n notifications: t,\n get location() {\n return c(n);\n },\n set location(i) {\n k(n, i, !0);\n },\n get subLocation() {\n return c(s);\n },\n set subLocation(i) {\n k(s, i, !0);\n }\n };\n return wc(Ff, o), o;\n}\nfunction no() {\n const r = wa(Ff);\n if (!r)\n throw new Error(\"Emails context not found. Make sure to call createEmailsContext() in a parent component.\");\n return r;\n}\nvar jg = S('<p class=\"svelte-98mw90\">Try adjusting your filters.</p>'), Lg = S('<div class=\"empty-state svelte-98mw90\"><svg width=\"48\" height=\"48\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1\" class=\"svelte-98mw90\"><path d=\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\"></path><circle cx=\"9\" cy=\"7\" r=\"4\"></circle><path d=\"M23 21v-2a4 4 0 0 0-3-3.87\"></path><path d=\"M16 3.13a4 4 0 0 1 0 7.75\"></path></svg> <p class=\"svelte-98mw90\">No subscribers found.</p> <!></div>'), Dg = S('<tr class=\"svelte-98mw90\"><td class=\"list-item-item email svelte-98mw90\"> </td><td class=\"list-item-item svelte-98mw90\"><span> </span></td><td class=\"list-item-item date svelte-98mw90\"> </td><td class=\"list-item-item svelte-98mw90\"><div class=\"actions svelte-98mw90\"><!> <!></div></td></tr>'), Fg = S('<div class=\"table-container svelte-98mw90\"><table class=\"svelte-98mw90\"><thead><tr><th class=\"list-heading-item svelte-98mw90\">Email</th><th class=\"list-heading-item svelte-98mw90\">Status</th><th class=\"list-heading-item svelte-98mw90\">Created</th><th class=\"list-heading-item svelte-98mw90\">Actions</th></tr></thead><tbody class=\"svelte-98mw90\"></tbody></table></div>'), Bg = S(`<div class=\"modal-backdrop svelte-98mw90\" role=\"presentation\"><div class=\"modal svelte-98mw90\" role=\"dialog\" aria-modal=\"true\" tabindex=\"-1\"><div class=\"modal-header svelte-98mw90\"><h3 class=\"svelte-98mw90\">Add Subscribers</h3> <button type=\"button\" class=\"close-btn svelte-98mw90\" aria-label=\"Close\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M18 6L6 18M6 6l12 12\"></path></svg></button></div> <div class=\"modal-body svelte-98mw90\"><p class=\"help-text svelte-98mw90\">Enter email addresses, one per line. You can also separate them with commas or\n\t\t\t\t\tsemicolons. Subscribers will be added as subscribed.</p> <textarea placeholder=\"email@example.com another@example.com third@example.com\" rows=\"10\" class=\"email-textarea svelte-98mw90\"></textarea></div> <div class=\"modal-footer svelte-98mw90\"><!> <!></div></div></div>`), Hg = S('<div class=\"subscriber-list svelte-98mw90\"><div class=\"header svelte-98mw90\"><div><h2 class=\"svelte-98mw90\">Subscribers</h2> <p class=\"subtitle svelte-98mw90\"> </p></div> <!></div> <div class=\"filters svelte-98mw90\"><input type=\"text\" placeholder=\"Search by email...\" class=\"search-input svelte-98mw90\"/> <!></div> <!></div> <!>', 1);\nconst qg = {\n hash: \"svelte-98mw90\",\n code: `.subscriber-list.svelte-98mw90 {padding:0;flex:1;display:flex;flex-direction:column;min-height:0;}.table-container.svelte-98mw90 {overflow-y:auto;flex:1;min-height:0;}table.svelte-98mw90 {width:100%;background-color:var(--bgColor-default);border-spacing:0;border-collapse:separate;font-size:var(--text-body-size-medium, 0.875rem);table-layout:auto;}th.svelte-98mw90 {color:var(--fgColor-muted);font-weight:var(--base-text-weight-semibold, 600);padding:var(--base-size-16, 1rem) var(--base-size-24, 1.5rem);text-align:start;white-space:nowrap;}th.svelte-98mw90,\n\ttd.svelte-98mw90 {border-bottom:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);overflow:hidden;}td.list-item-item.svelte-98mw90 {padding:var(--base-size-16, 1rem) var(--base-size-24, 1.5rem);}tbody.svelte-98mw90 tr:where(.svelte-98mw90) {transition:background-color 150ms ease;}tbody.svelte-98mw90 tr:where(.svelte-98mw90):hover {background-color:var(--bgColor-muted);}.email.svelte-98mw90 {font-family:monospace;font-size:var(--text-body-size-small, 0.8125rem);}.date.svelte-98mw90 {color:var(--fgColor-muted);}.status-badge.svelte-98mw90 {display:inline-block;padding:0.25rem 0.5rem;border-radius:var(--borderRadius-small, 0.25rem);font-size:0.75rem;font-weight:500;}.status-badge.subscribed.svelte-98mw90 {background-color:#d1f4e0;color:#116329;}.status-badge.unsubscribed.svelte-98mw90 {background-color:#f0f0f0;color:#656d76;}.actions.svelte-98mw90 {display:flex;gap:var(--base-size-16, 1rem);}\n\n\n\n\n\t/* Modal */.modal-backdrop.svelte-98mw90 {position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000;}.modal.svelte-98mw90 {background-color:var(--bgColor-default);border-radius:0.5rem;width:90%;max-width:600px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.2);}.modal-header.svelte-98mw90 {padding:1.5rem;border-bottom:1px solid var(--borderColor-default);display:flex;justify-content:space-between;align-items:center;}.modal-header.svelte-98mw90 h3:where(.svelte-98mw90) {margin:0;font-size:1.25rem;font-weight:600;}.close-btn.svelte-98mw90 {background:none;border:none;padding:0.25rem;cursor:pointer;display:flex;align-items:center;color:var(--fgColor-muted);border-radius:0.25rem;}.close-btn.svelte-98mw90:hover {background-color:var(--bgColor-muted);}.modal-body.svelte-98mw90 {padding:1.5rem;}.help-text.svelte-98mw90 {margin:0 0 1rem 0;color:var(--fgColor-muted);font-size:0.875rem;}.email-textarea.svelte-98mw90 {width:100%;padding:var(--control-medium-paddingBlock, 0.375rem)\n\t\t\tvar(--control-medium-paddingInline-normal, 0.75rem);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);font-size:var(--text-body-size-medium, 0.875rem);line-height:var(--text-body-lineHeight-medium, 1.4285);font-family:monospace;background-color:var(--bgColor-default);color:var(--fgColor-default);resize:vertical;transition:border-color 0.2s ease;box-shadow:var(--shadow-inset, inset 0 1px 0 rgba(208, 215, 222, 0.2));}.email-textarea.svelte-98mw90:focus-visible {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;border-color:var(--fgColor-accent);box-shadow:none;}.modal-footer.svelte-98mw90 {padding:1.5rem;border-top:1px solid var(--borderColor-default);display:flex;justify-content:flex-end;gap:0.75rem;}\n\n\t/* Header */.header.svelte-98mw90 {display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:1.5rem;}h2.svelte-98mw90 {margin:var(--stack-gap-normal, 1.5rem) 0 0;line-height:1.25;font-size:1.5rem;font-weight:500;}.subtitle.svelte-98mw90 {margin:0.25rem 0 0;font-size:0.875rem;color:var(--fgColor-muted);}\n\n\t/* Filters */.filters.svelte-98mw90 {display:flex;gap:1rem;margin-bottom:1.5rem;}.search-input.svelte-98mw90 {flex:1;max-width:300px;padding:var(--control-medium-paddingBlock, 0.375rem)\n\t\t\tvar(--control-medium-paddingInline-normal, 0.75rem);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);font-size:var(--text-body-size-medium, 0.875rem);line-height:var(--text-body-lineHeight-medium, 1.4285);font-family:inherit;background-color:var(--bgColor-default);color:var(--fgColor-default);transition:border-color 0.2s ease;box-shadow:var(--shadow-inset, inset 0 1px 0 rgba(208, 215, 222, 0.2));}.search-input.svelte-98mw90:focus-visible {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;border-color:var(--fgColor-accent);box-shadow:none;}\n\n\t/* Buttons */\n\n\n\n\n\t/* Empty State */.empty-state.svelte-98mw90 {display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;text-align:center;color:var(--fgColor-muted);}.empty-state.svelte-98mw90 svg:where(.svelte-98mw90) {margin-bottom:1rem;opacity:0.5;}.empty-state.svelte-98mw90 p:where(.svelte-98mw90) {margin:0;}.empty-state.svelte-98mw90 .primer-button {margin-top:1rem;}`\n};\nfunction Bf(r, e) {\n nt(e, !0), bt(r, qg);\n const t = no(), { emails: n, notifications: s } = t, o = ie(() => [...n.subscribers].sort((T, I) => I.createdAt - T.createdAt));\n let i = W(\"\"), a = W(\"all\"), l = W(!1);\n const d = [\n { id: \"all\", text: \"All Subscribers\" },\n { id: \"subscribed\", text: \"Subscribed\" },\n { id: \"unsubscribed\", text: \"Unsubscribed\" }\n ], u = ie(() => d.find((T) => T.id === c(a)) || d[0]);\n let f = W(!1), h = W(\"\");\n const p = ie(() => c(o).filter((T) => {\n if (c(i)) {\n const I = c(i).toLowerCase();\n if (!T.email.toLowerCase().includes(I) && !T.name?.toLowerCase().includes(I)) return !1;\n }\n return !(c(a) === \"subscribed\" && T.status !== \"subscribed\" || c(a) === \"unsubscribed\" && T.status !== \"unsubscribed\");\n }));\n async function g() {\n const T = c(h).split(/[\\n,;]/).map((A) => A.trim()).filter((A) => A.length > 0);\n if (T.length === 0) {\n s.warning(\"Please enter at least one email address\");\n return;\n }\n let I = 0, te = 0;\n for (const A of T)\n try {\n await n.createSubscriber(A.toLowerCase().trim()), I++;\n } catch {\n te++;\n }\n I > 0 && s.success(`Added ${I} subscriber(s)`), te > 0 && s.info(`Skipped ${te} duplicate(s) or invalid email(s)`), k(h, \"\"), k(f, !1);\n }\n async function b(T, I) {\n if (confirm(`Delete subscriber ${I}? This action cannot be undone.`))\n try {\n await n.deleteSubscriber(T), s.success(\"Subscriber deleted\");\n } catch {\n s.error(\"Failed to delete subscriber\");\n }\n }\n async function y(T) {\n try {\n T.status === \"subscribed\" ? (await n.unsubscribeContact(T.id), s.success(`${T.email} unsubscribed`)) : (await n.subscribeContact(T.id), s.success(`${T.email} subscribed`));\n } catch {\n s.error(\"Failed to update subscription status\");\n }\n }\n function C(T) {\n return T ? new Date(T).toLocaleDateString() : \"-\";\n }\n Ar(async () => {\n try {\n await n.fetchSubscribers();\n } catch {\n s.error(\"Failed to load subscribers\");\n }\n });\n var E = Hg(), R = ke(E), q = v(R), O = v(q), M = x(v(O), 2), P = v(M);\n m(M), m(O);\n var L = x(O, 2);\n Je(L, {\n variant: \"primary\",\n onclick: () => k(f, !0),\n children: (T, I) => {\n Pe();\n var te = qe(\"Add Subscribers\");\n w(T, te);\n },\n $$slots: { default: !0 }\n }), m(q);\n var $ = x(q, 2), J = v($);\n Ut(J);\n var U = x(J, 2);\n bs(U, {\n get items() {\n return d;\n },\n get selected() {\n return c(u);\n },\n placeholder: \"All Subscribers\",\n align: \"right\",\n onSelectedChange: (T) => {\n T && !Array.isArray(T) && k(a, T.id || \"all\", !0);\n },\n get open() {\n return c(l);\n },\n set open(T) {\n k(l, T, !0);\n }\n }), m($);\n var F = x($, 2);\n {\n var z = (T) => {\n var I = Lg(), te = x(v(I), 4);\n {\n var A = (H) => {\n var ne = jg();\n w(H, ne);\n }, V = (H) => {\n Je(H, {\n variant: \"primary\",\n onclick: () => k(f, !0),\n children: (ne, X) => {\n Pe();\n var G = qe(\"Add Your First Subscribers\");\n w(ne, G);\n },\n $$slots: { default: !0 }\n });\n };\n K(te, (H) => {\n c(i) || c(a) !== \"all\" ? H(A) : H(V, -1);\n });\n }\n m(I), w(T, I);\n }, _ = (T) => {\n var I = Fg(), te = v(I), A = x(v(te));\n tt(A, 21, () => c(p), pt, (V, H) => {\n var ne = Dg(), X = v(ne), G = v(X, !0);\n m(X);\n var Y = x(X), se = v(Y);\n let ue;\n var le = v(se, !0);\n m(se), m(Y);\n var re = x(Y), ae = v(re, !0);\n m(re);\n var ge = x(re), Se = v(ge), _e = v(Se);\n Je(_e, {\n size: \"small\",\n variant: \"invisible\",\n onclick: () => y(c(H)),\n children: (Ie, Fe) => {\n Pe();\n var j = qe();\n B(() => D(j, c(H).status === \"subscribed\" ? \"Unsubscribe\" : \"Subscribe\")), w(Ie, j);\n },\n $$slots: { default: !0 }\n });\n var Re = x(_e, 2);\n Je(Re, {\n size: \"small\",\n variant: \"danger-invisible\",\n onclick: () => b(c(H).id, c(H).email),\n children: (Ie, Fe) => {\n Pe();\n var j = qe(\"Delete\");\n w(Ie, j);\n },\n $$slots: { default: !0 }\n }), m(Se), m(ge), m(ne), B(\n (Ie, Fe) => {\n D(G, c(H).email), ue = Ne(se, 1, \"status-badge svelte-98mw90\", null, ue, {\n subscribed: c(H).status === \"subscribed\",\n unsubscribed: c(H).status !== \"subscribed\"\n }), D(le, Ie), D(ae, Fe);\n },\n [\n () => c(H).status.charAt(0).toUpperCase() + c(H).status.slice(1),\n () => C(c(H).createdAt)\n ]\n ), w(V, ne);\n }), m(A), m(te), m(I), w(T, I);\n };\n K(F, (T) => {\n c(p).length === 0 ? T(z) : T(_, -1);\n });\n }\n m(R);\n var N = x(R, 2);\n {\n var Q = (T) => {\n var I = Bg(), te = v(I), A = v(te), V = x(v(A), 2);\n m(A);\n var H = x(A, 2), ne = x(v(H), 2);\n Go(ne), m(H);\n var X = x(H, 2), G = v(X);\n Je(G, {\n onclick: () => k(f, !1),\n children: (se, ue) => {\n Pe();\n var le = qe(\"Cancel\");\n w(se, le);\n },\n $$slots: { default: !0 }\n });\n var Y = x(G, 2);\n Je(Y, {\n variant: \"primary\",\n onclick: g,\n children: (se, ue) => {\n Pe();\n var le = qe(\"Add Subscribers\");\n w(se, le);\n },\n $$slots: { default: !0 }\n }), m(X), m(te), m(I), fe(\"click\", I, () => k(f, !1)), fe(\"click\", te, (se) => se.stopPropagation()), fe(\"keydown\", te, (se) => se.stopPropagation()), fe(\"click\", V, () => k(f, !1)), nr(ne, () => c(h), (se) => k(h, se)), w(T, I);\n };\n K(N, (T) => {\n c(f) && T(Q);\n });\n }\n B(() => D(P, `${n.subscribedCount ?? \"\"} subscribed, ${n.unsubscribedCount ?? \"\"} unsubscribed`)), nr(J, () => c(i), (T) => k(i, T)), w(r, E), st();\n}\nhr([\"click\", \"keydown\"]);\nrt(Bf, {}, [], [], { mode: \"open\" });\nvar Vg = S('<p class=\"svelte-rk9qj6\">Try adjusting your search.</p>'), Wg = S('<div class=\"empty-state svelte-rk9qj6\"><svg width=\"48\" height=\"48\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1\" class=\"svelte-rk9qj6\"><path d=\"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6z\"></path><path d=\"M2 6l10 7 10-7\"></path></svg> <p class=\"svelte-rk9qj6\">No newsletters found.</p> <!></div>'), Ug = S('<button type=\"button\" class=\"btn-text svelte-rk9qj6\">Send</button>'), Jg = S('<tr class=\"svelte-rk9qj6\"><td class=\"list-item-item name svelte-rk9qj6\"> </td><td class=\"list-item-item subject svelte-rk9qj6\"> </td><td class=\"list-item-item svelte-rk9qj6\"><span> </span></td><td class=\"list-item-item svelte-rk9qj6\"> </td><td class=\"list-item-item date svelte-rk9qj6\"> </td><td class=\"list-item-item svelte-rk9qj6\"><div class=\"actions svelte-rk9qj6\"><!></div></td></tr>'), Kg = S('<div class=\"table-container svelte-rk9qj6\"><table class=\"svelte-rk9qj6\"><thead><tr><th class=\"list-heading-item svelte-rk9qj6\">Name</th><th class=\"list-heading-item svelte-rk9qj6\">Subject</th><th class=\"list-heading-item svelte-rk9qj6\">Status</th><th class=\"list-heading-item svelte-rk9qj6\">Sent</th><th class=\"list-heading-item svelte-rk9qj6\">Created</th><th class=\"list-heading-item svelte-rk9qj6\">Actions</th></tr></thead><tbody class=\"svelte-rk9qj6\"></tbody></table></div>'), Gg = S('<div class=\"newsletter-list svelte-rk9qj6\"><div class=\"header svelte-rk9qj6\"><div><h2 class=\"svelte-rk9qj6\">Newsletters</h2> <p class=\"subtitle svelte-rk9qj6\"> </p></div> <!></div> <div class=\"filters svelte-rk9qj6\"><input type=\"text\" placeholder=\"Search newsletters...\" class=\"search-input svelte-rk9qj6\"/></div> <!></div>');\nconst Yg = {\n hash: \"svelte-rk9qj6\",\n code: `.newsletter-list.svelte-rk9qj6 {padding:0;flex:1;display:flex;flex-direction:column;min-height:0;}.table-container.svelte-rk9qj6 {overflow-y:auto;flex:1;min-height:0;}table.svelte-rk9qj6 {width:100%;background-color:var(--bgColor-default);border-spacing:0;border-collapse:separate;font-size:0.875rem;}th.svelte-rk9qj6 {color:var(--fgColor-muted);font-weight:600;padding:1rem 1.5rem;text-align:start;white-space:nowrap;}th.svelte-rk9qj6,\n\ttd.svelte-rk9qj6 {border-bottom:1px solid var(--borderColor-default);}td.list-item-item.svelte-rk9qj6 {padding:1rem 1.5rem;}tbody.svelte-rk9qj6 tr:where(.svelte-rk9qj6) {transition:background-color 150ms ease;}tbody.svelte-rk9qj6 tr:where(.svelte-rk9qj6):hover {background-color:var(--bgColor-muted);}.name.svelte-rk9qj6 {font-weight:500;}.subject.svelte-rk9qj6 {color:var(--fgColor-muted);max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.date.svelte-rk9qj6 {color:var(--fgColor-muted);}.status-badge.svelte-rk9qj6 {display:inline-block;padding:0.25rem 0.5rem;border-radius:0.25rem;font-size:0.75rem;font-weight:500;text-transform:capitalize;}.status-badge.sent.svelte-rk9qj6 {background-color:#d1f4e0;color:#116329;}.status-badge.scheduled.svelte-rk9qj6 {background-color:#ddf4ff;color:#0969da;}.status-badge.draft.svelte-rk9qj6 {background-color:#f0f0f0;color:#656d76;}.actions.svelte-rk9qj6 {display:flex;gap:1rem;}.btn-text.svelte-rk9qj6 {background:none;border:none;padding:0;color:var(--fgColor-accent);cursor:pointer;font-size:0.875rem;text-decoration:underline;}.btn-text.svelte-rk9qj6:hover {text-decoration:none;}\n\n\t/* Header */.header.svelte-rk9qj6 {display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:1.5rem;}h2.svelte-rk9qj6 {margin:var(--stack-gap-normal, 1.5rem) 0 0;line-height:1.25;font-size:1.5rem;font-weight:500;}.subtitle.svelte-rk9qj6 {margin:0.25rem 0 0;font-size:0.875rem;color:var(--fgColor-muted);}\n\n\t/* Filters */.filters.svelte-rk9qj6 {display:flex;gap:1rem;margin-bottom:1.5rem;}.search-input.svelte-rk9qj6 {flex:1;max-width:300px;padding:var(--control-medium-paddingBlock, 0.375rem)\n\t\t\tvar(--control-medium-paddingInline-normal, 0.75rem);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);font-size:var(--text-body-size-medium, 0.875rem);line-height:var(--text-body-lineHeight-medium, 1.4285);font-family:inherit;background-color:var(--bgColor-default);color:var(--fgColor-default);transition:border-color 0.2s ease;box-shadow:var(--shadow-inset, inset 0 1px 0 rgba(208, 215, 222, 0.2));}.search-input.svelte-rk9qj6:focus-visible {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;border-color:var(--fgColor-accent);box-shadow:none;}\n\n\t/* Buttons */\n\n\n\n\n\t/* Empty State */.empty-state.svelte-rk9qj6 {display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;text-align:center;color:var(--fgColor-muted);}.empty-state.svelte-rk9qj6 svg:where(.svelte-rk9qj6) {margin-bottom:1rem;opacity:0.5;}.empty-state.svelte-rk9qj6 p:where(.svelte-rk9qj6) {margin:0;}.empty-state.svelte-rk9qj6 .primer-button {margin-top:1rem;}`\n};\nfunction El(r, e) {\n nt(e, !0), bt(r, Yg);\n const t = no(), { emails: n, notifications: s } = t, o = ie(() => [...n.campaigns].sort((M, P) => P.createdAt - M.createdAt));\n let i = W(\"\");\n const a = ie(() => c(o).filter((M) => {\n if (c(i)) {\n const P = c(i).toLowerCase();\n return M.name.toLowerCase().includes(P) || M.subject.toLowerCase().includes(P);\n }\n return !0;\n }));\n function l(M) {\n return M ? new Date(M).toLocaleDateString() : \"-\";\n }\n function d(M) {\n switch (M) {\n case \"SENT\":\n return \"sent\";\n case \"SCHEDULED\":\n return \"scheduled\";\n default:\n return \"draft\";\n }\n }\n async function u(M) {\n if (confirm(`Send newsletter \"${M.name}\" to all subscribers?`))\n try {\n const P = await n.sendCampaign(M.id);\n s.success(`Newsletter sent to ${P} subscribers`);\n } catch {\n s.error(\"Failed to send newsletter\");\n }\n }\n Ar(async () => {\n try {\n await n.fetchCampaigns();\n } catch {\n s.error(\"Failed to load newsletters\");\n }\n });\n var f = Gg(), h = v(f), p = v(h), g = x(v(p), 2), b = v(g);\n m(g), m(p);\n var y = x(p, 2);\n Je(y, {\n href: \"#emails/newsletters/compose\",\n variant: \"primary\",\n children: (M, P) => {\n Pe();\n var L = qe(\"New Newsletter\");\n w(M, L);\n },\n $$slots: { default: !0 }\n }), m(h);\n var C = x(h, 2), E = v(C);\n Ut(E), m(C);\n var R = x(C, 2);\n {\n var q = (M) => {\n var P = Wg(), L = x(v(P), 4);\n {\n var $ = (U) => {\n var F = Vg();\n w(U, F);\n }, J = (U) => {\n Je(U, {\n href: \"#emails/newsletters/compose\",\n variant: \"primary\",\n children: (F, z) => {\n Pe();\n var _ = qe(\"Create Your First Newsletter\");\n w(F, _);\n },\n $$slots: { default: !0 }\n });\n };\n K(L, (U) => {\n c(i) ? U($) : U(J, -1);\n });\n }\n m(P), w(M, P);\n }, O = (M) => {\n var P = Kg(), L = v(P), $ = x(v(L));\n tt($, 21, () => c(a), pt, (J, U) => {\n var F = Jg(), z = v(F), _ = v(z, !0);\n m(z);\n var N = x(z), Q = v(N, !0);\n m(N);\n var T = x(N), I = v(T), te = v(I, !0);\n m(I), m(T);\n var A = x(T), V = v(A, !0);\n m(A);\n var H = x(A), ne = v(H, !0);\n m(H);\n var X = x(H), G = v(X), Y = v(G);\n {\n var se = (ue) => {\n var le = Ug();\n fe(\"click\", le, () => u(c(U))), w(ue, le);\n };\n K(Y, (ue) => {\n c(U).status === \"draft\" && ue(se);\n });\n }\n m(G), m(X), m(F), B(\n (ue, le, re) => {\n D(_, c(U).name), D(Q, c(U).subject), Ne(I, 1, `status-badge ${ue ?? \"\"}`, \"svelte-rk9qj6\"), D(te, le), D(V, c(U).recipientCount ?? \"-\"), D(ne, re);\n },\n [\n () => d(c(U).status),\n () => c(U).status.toLowerCase(),\n () => l(c(U).createdAt)\n ]\n ), w(J, F);\n }), m($), m(L), m(P), w(M, P);\n };\n K(R, (M) => {\n c(a).length === 0 ? M(q) : M(O, -1);\n });\n }\n m(f), B(() => D(b, `${n.campaigns.length ?? \"\"} newsletter${n.campaigns.length !== 1 ? \"s\" : \"\"}`)), nr(E, () => c(i), (M) => k(i, M)), w(r, f), st();\n}\nhr([\"click\"]);\nrt(El, {}, [], [], { mode: \"open\" });\nfunction Hf(r, e) {\n nt(e, !0);\n const t = no(), { notifications: n } = t;\n let s = ce(e, \"handleImageChange\", 7, (a) => {\n }), o = ce(e, \"preselected\", 7, \"\");\n var i = {\n get handleImageChange() {\n return s();\n },\n set handleImageChange(a = (l) => {\n }) {\n s(a), de();\n },\n get preselected() {\n return o();\n },\n set preselected(a = \"\") {\n o(a), de();\n }\n };\n return kc(r, {\n get handleAssetChange() {\n return s();\n },\n get preselected() {\n return o();\n },\n currentModule: \"emails\",\n get notifications() {\n return n;\n }\n }), st(i);\n}\nrt(Hf, { handleImageChange: {}, preselected: {} }, [], [], { mode: \"open\" });\nconst Tl = \"google\", Dd = \"gemini-2.5-flash\";\nasync function Xg(r) {\n const { prompt: e, fieldName: t, fieldConfig: n, contentConfig: s, currentRecord: o, signal: i, getUserApiKey: a } = r;\n let l = null;\n const d = Xo({\n value: $f({ description: `New value for ${t}. Match the field's widget type.` })\n }), u = {\n name: \"proposeFieldValue\",\n label: \"Propose value\",\n description: `Return the new value for the field \"${t}\" (${n.widget}). Call this exactly once with the final value.`,\n parameters: d,\n execute: async (h, p) => (l = { value: p.value }, { content: [{ type: \"text\", text: \"Proposal recorded.\" }], details: {} })\n }, f = Zg(t, n, s, o);\n if (await Qg({\n systemPrompt: f,\n tools: [u],\n userPrompt: e,\n signal: i,\n getUserApiKey: a\n }), !l)\n throw new Error(\"The model did not return a proposal.\");\n return l;\n}\nasync function Qg(r) {\n const e = new Ec({\n initialState: {\n systemPrompt: r.systemPrompt,\n model: eb(),\n thinkingLevel: \"off\",\n messages: [],\n tools: r.tools\n },\n convertToLlm: (s) => s.filter(\n (o) => o.role === \"user\" || o.role === \"assistant\" || o.role === \"toolResult\"\n ),\n getApiKey: async (s) => {\n if (s !== Tl) return;\n const o = r.getUserApiKey?.()?.trim();\n if (o) return o;\n const i = await fetch(\"/api/admin/agent/api-key\");\n return i.ok ? (await i.json()).apiKey : void 0;\n },\n toolExecution: \"sequential\"\n }), t = e.subscribe((s) => {\n s.type === \"tool_execution_end\" && !s.isError && e.abort();\n }), n = () => e.abort();\n r.signal?.addEventListener(\"abort\", n);\n try {\n await e.prompt(r.userPrompt);\n } catch (s) {\n if (r.signal?.aborted || !(s instanceof Error && /abort/i.test(s.message)))\n throw s;\n } finally {\n r.signal?.removeEventListener(\"abort\", n), t();\n }\n}\nfunction Zg(r, e, t, n) {\n return [\n \"You are a one-shot CMS field editor. You will edit a single field and stop.\",\n \"\",\n `Collection: ${t.title}`,\n t.description ? `Collection description: ${t.description}` : \"\",\n \"\",\n `Field to edit: \"${r}\"`,\n `- Widget: ${e.widget}`,\n e.label ? `- Label: ${e.label}` : \"\",\n e.helpText ? `- Help: ${e.helpText}` : \"\",\n e.options ? `- Allowed options: ${JSON.stringify(e.options)}` : \"\",\n \"\",\n \"Current full record (for context \u2014 only the target field is being changed):\",\n \"```json\",\n JSON.stringify(n ?? {}, null, 2),\n \"```\",\n \"\",\n \"Output shape by widget:\",\n \"- string / text / richtext / asset / date / datetime / derived \u2192 string\",\n \"- number \u2192 number\",\n \"- checkbox \u2192 boolean\",\n \"- select-single / reference \u2192 string (one of the allowed values)\",\n \"- select-multiple / reference-multiple \u2192 array of strings\",\n \"\",\n \"Call the proposeFieldValue tool exactly once with the new value. Do not call any other tool. Do not write commentary.\"\n ].filter(Boolean).join(`\n`);\n}\nfunction eb() {\n const r = If(Tl, Dd);\n return r || {\n id: Dd,\n name: \"CMS Edit\",\n api: \"google-generative-ai\",\n provider: Tl,\n baseUrl: \"https://generativelanguage.googleapis.com/v1beta\",\n reasoning: !1,\n input: [\"text\", \"image\"],\n cost: { input: 0.25, output: 1.5, cacheRead: 0.025, cacheWrite: 1 },\n contextWindow: 1048576,\n maxTokens: 65536\n };\n}\nvar tb = S('<button type=\"button\" class=\"quick-action svelte-5ce7bm\"> </button>'), rb = S('<div class=\"quick-actions svelte-5ce7bm\"></div>'), nb = S('<div class=\"popover-error svelte-5ce7bm\"> </div>'), sb = S('<div class=\"diff svelte-5ce7bm\"><div class=\"diff-block diff-old svelte-5ce7bm\"><div class=\"diff-label svelte-5ce7bm\">Current</div> <div class=\"diff-value svelte-5ce7bm\"> </div></div> <div class=\"diff-block diff-new svelte-5ce7bm\"><div class=\"diff-label svelte-5ce7bm\">Proposed</div> <div class=\"diff-value svelte-5ce7bm\"> </div></div></div> <div class=\"popover-actions svelte-5ce7bm\"><button type=\"button\" class=\"reject-btn svelte-5ce7bm\">Discard</button> <button type=\"button\" class=\"accept-btn svelte-5ce7bm\">Accept</button></div>', 1), ob = S('<div class=\"popover-backdrop svelte-5ce7bm\"></div> <div class=\"popover svelte-5ce7bm\" role=\"dialog\" aria-label=\"AI field edit\"><div class=\"popover-row svelte-5ce7bm\"><input class=\"svelte-5ce7bm\"/> <button type=\"button\" class=\"run-btn svelte-5ce7bm\"><!></button></div> <!> <!> <!></div>', 1), ib = S('<div class=\"ai-field-root svelte-5ce7bm\"><button type=\"button\" aria-label=\"Edit with AI\" title=\"Edit with AI\"><svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 3l1.9 4.6L18.5 9l-4.6 1.9L12 15l-1.9-4.1L5.5 9l4.6-1.4z\"></path><path d=\"M19 14l.7 1.6L21.5 16l-1.8.4L19 18l-.7-1.6L16.5 16l1.8-.4z\"></path></svg></button> <!></div>');\nconst ab = {\n hash: \"svelte-5ce7bm\",\n code: `.ai-field-root.svelte-5ce7bm {position:relative;display:inline-flex;}.ai-trigger.svelte-5ce7bm {display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;border:1px solid transparent;border-radius:999px;background:transparent;color:var(--fgColor-accent, #0969da);cursor:pointer;opacity:0.75;transition:opacity 0.15s, background-color 0.15s, border-color 0.15s;}.ai-trigger.svelte-5ce7bm:hover,\n\t.ai-trigger.open.svelte-5ce7bm {opacity:1;background:var(--bgColor-accent-muted, #ddf4ff);border-color:var(--borderColor-accent-muted, #54aeff66);}.popover-backdrop.svelte-5ce7bm {position:fixed;inset:0;background:transparent;z-index:999;}.popover.svelte-5ce7bm {position:absolute;top:calc(100% + 4px);right:0;z-index:1000;min-width:22rem;max-width:min(28rem, 90vw);padding:0.75rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:0.5rem;background:var(--bgColor-default, #ffffff);box-shadow:0 8px 24px rgba(140, 149, 159, 0.2);display:flex;flex-direction:column;gap:0.5rem;}.popover-row.svelte-5ce7bm {display:flex;gap:0.5rem;}.popover.svelte-5ce7bm input:where(.svelte-5ce7bm) {flex:1;min-width:0;padding:0.375rem 0.5rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:0.375rem;font:inherit;font-size:0.8125rem;}.popover.svelte-5ce7bm input:where(.svelte-5ce7bm):focus-visible {outline:2px solid var(--fgColor-accent, #0969da);outline-offset:-1px;}.run-btn.svelte-5ce7bm {padding:0.375rem 0.75rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:0.375rem;background:var(--button-primary-bgColor-rest, #1f883d);color:#fff;font:inherit;font-size:0.8125rem;cursor:pointer;}.run-btn.svelte-5ce7bm:disabled {opacity:0.6;cursor:not-allowed;}.quick-actions.svelte-5ce7bm {display:flex;flex-wrap:wrap;gap:0.25rem;}.quick-action.svelte-5ce7bm {padding:0.25rem 0.5rem;border:1px solid var(--borderColor-muted, #d8dee4);border-radius:999px;background:var(--bgColor-muted, #f6f8fa);font:inherit;font-size:0.75rem;cursor:pointer;}.quick-action.svelte-5ce7bm:hover {border-color:var(--fgColor-accent, #0969da);}.popover-error.svelte-5ce7bm {padding:0.5rem;border:1px solid var(--borderColor-danger-emphasis, #cf222e);border-radius:0.375rem;background:var(--bgColor-danger-muted, #ffebe9);color:var(--fgColor-danger, #d1242f);font-size:0.8125rem;}.diff.svelte-5ce7bm {display:grid;grid-template-columns:1fr;gap:0.375rem;max-height:50vh;overflow-y:auto;}.diff-block.svelte-5ce7bm {border:1px solid var(--borderColor-muted, #d8dee4);border-radius:0.375rem;padding:0.5rem;font-size:0.8125rem;}.diff-label.svelte-5ce7bm {font-size:0.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:var(--fgColor-muted, #656d76);margin-bottom:0.25rem;}.diff-value.svelte-5ce7bm {white-space:pre-wrap;word-break:break-word;font-family:inherit;}.diff-old.svelte-5ce7bm .diff-value:where(.svelte-5ce7bm) {color:var(--fgColor-muted, #656d76);text-decoration:line-through;text-decoration-color:rgba(207, 34, 46, 0.4);}.diff-new.svelte-5ce7bm {background:var(--bgColor-success-muted, #dafbe1);border-color:rgba(26, 127, 55, 0.4);}.popover-actions.svelte-5ce7bm {display:flex;justify-content:flex-end;gap:0.5rem;}.reject-btn.svelte-5ce7bm,\n\t.accept-btn.svelte-5ce7bm {padding:0.375rem 0.75rem;border-radius:0.375rem;font:inherit;font-size:0.8125rem;cursor:pointer;}.reject-btn.svelte-5ce7bm {border:1px solid var(--borderColor-default, #d0d7de);background:var(--bgColor-default, #ffffff);color:var(--fgColor-default, #24292f);}.accept-btn.svelte-5ce7bm {border:1px solid transparent;background:var(--button-primary-bgColor-rest, #1f883d);color:#ffffff;}`\n};\nfunction Ni(r, e) {\n nt(e, !0), bt(r, ab);\n let t = ce(e, \"fieldName\", 7), n = ce(e, \"fieldConfig\", 7), s = ce(e, \"contentConfig\", 7), o = ce(e, \"currentRecord\", 7), i = ce(e, \"currentValue\", 7), a = ce(e, \"onAccept\", 7), l = W(!1), d = W(\"\"), u = W(!1), f = W(null), h = W(void 0), p = W(!1), g, b = W(void 0);\n const y = ie(() => M(t(), n()));\n async function C() {\n k(l, !c(l)), c(l) ? (await Cc(), c(b)?.focus()) : E();\n }\n function E() {\n g?.abort(), g = void 0, k(l, !1), k(d, \"\"), k(f, null), k(h, void 0), k(p, !1), k(u, !1);\n }\n async function R(_) {\n const N = _.trim();\n if (!(!N || c(u))) {\n g?.abort(), g = new AbortController(), k(u, !0), k(f, null), k(h, void 0), k(p, !1);\n try {\n const Q = await Xg({\n scope: \"field\",\n prompt: N,\n fieldName: t(),\n fieldConfig: n(),\n contentConfig: s(),\n currentRecord: o(),\n signal: g.signal,\n getUserApiKey: () => typeof localStorage < \"u\" ? localStorage.getItem(\"hintergrund_user_gemini_api_key\") ?? void 0 : void 0\n });\n k(h, Q.value, !0), k(p, !0);\n } catch (Q) {\n if (g?.signal.aborted) return;\n k(f, Q instanceof Error ? Q.message : String(Q), !0);\n } finally {\n k(u, !1);\n }\n }\n }\n function q() {\n c(p) && (a()(c(h)), E());\n }\n function O(_) {\n _.key === \"Enter\" && !_.shiftKey ? (_.preventDefault(), R(c(d))) : _.key === \"Escape\" && E();\n }\n function M(_, N) {\n return _ === \"subject\" ? [\n \"Make punchier\",\n \"Shorten\",\n \"Add urgency\",\n \"Translate to German\"\n ] : N.widget === \"text\" || N.widget === \"richtext\" ? [\n \"Shorten\",\n \"Make more engaging\",\n \"Fix grammar\",\n \"Translate to German\"\n ] : [\"Shorten\", \"Fix grammar\", \"Translate to German\"];\n }\n function P(_) {\n if (_ == null) return \"\";\n if (typeof _ == \"string\") return _.replace(/<[^>]*>/g, \" \").replace(/\\s+/g, \" \").trim();\n try {\n return JSON.stringify(_, null, 2);\n } catch {\n return String(_);\n }\n }\n var L = {\n get fieldName() {\n return t();\n },\n set fieldName(_) {\n t(_), de();\n },\n get fieldConfig() {\n return n();\n },\n set fieldConfig(_) {\n n(_), de();\n },\n get contentConfig() {\n return s();\n },\n set contentConfig(_) {\n s(_), de();\n },\n get currentRecord() {\n return o();\n },\n set currentRecord(_) {\n o(_), de();\n },\n get currentValue() {\n return i();\n },\n set currentValue(_) {\n i(_), de();\n },\n get onAccept() {\n return a();\n },\n set onAccept(_) {\n a(_), de();\n }\n }, $ = ib(), J = v($);\n let U;\n var F = x(J, 2);\n {\n var z = (_) => {\n var N = ob(), Q = ke(N), T = x(Q, 2), I = v(T), te = v(I);\n Ut(te), bn(te, (re) => k(b, re), () => c(b));\n var A = x(te, 2), V = v(A);\n {\n var H = (re) => {\n var ae = qe(\"\u2026\");\n w(re, ae);\n }, ne = (re) => {\n var ae = qe(\"Run\");\n w(re, ae);\n };\n K(V, (re) => {\n c(u) ? re(H) : re(ne, -1);\n });\n }\n m(A), m(I);\n var X = x(I, 2);\n {\n var G = (re) => {\n var ae = rb();\n tt(ae, 21, () => c(y), pt, (ge, Se) => {\n var _e = tb(), Re = v(_e, !0);\n m(_e), B(() => D(Re, c(Se))), fe(\"click\", _e, () => R(c(Se))), w(ge, _e);\n }), m(ae), w(re, ae);\n };\n K(X, (re) => {\n c(y).length > 0 && !c(p) && !c(u) && re(G);\n });\n }\n var Y = x(X, 2);\n {\n var se = (re) => {\n var ae = nb(), ge = v(ae, !0);\n m(ae), B(() => D(ge, c(f))), w(re, ae);\n };\n K(Y, (re) => {\n c(f) && re(se);\n });\n }\n var ue = x(Y, 2);\n {\n var le = (re) => {\n var ae = sb(), ge = ke(ae), Se = v(ge), _e = x(v(Se), 2), Re = v(_e, !0);\n m(_e), m(Se);\n var Ie = x(Se, 2), Fe = x(v(Ie), 2), j = v(Fe, !0);\n m(Fe), m(Ie), m(ge);\n var oe = x(ge, 2), he = v(oe), Z = x(he, 2);\n m(oe), B(\n (pe, xe) => {\n D(Re, pe), D(j, xe);\n },\n [\n () => P(i()) || \"(empty)\",\n () => P(c(h)) || \"(empty)\"\n ]\n ), fe(\"click\", he, E), fe(\"click\", Z, q), w(re, ae);\n };\n K(ue, (re) => {\n c(p) && re(le);\n });\n }\n m(T), B(\n (re) => {\n Ge(te, \"placeholder\", c(p) ? \"Refine, or press Enter again to try a new variant\u2026\" : \"Describe the change\u2026\"), te.disabled = c(u), A.disabled = re;\n },\n [() => c(u) || !c(d).trim()]\n ), fe(\"click\", Q, E), fe(\"keydown\", te, O), nr(te, () => c(d), (re) => k(d, re)), fe(\"click\", A, () => R(c(d))), w(_, N);\n };\n K(F, (_) => {\n c(l) && _(z);\n });\n }\n return m($), B(() => U = Ne(J, 1, \"ai-trigger svelte-5ce7bm\", null, U, { open: c(l) })), fe(\"click\", J, C), w(r, $), st(L);\n}\nhr([\"click\", \"keydown\"]);\nrt(\n Ni,\n {\n fieldName: {},\n fieldConfig: {},\n contentConfig: {},\n currentRecord: {},\n currentValue: {},\n onAccept: {}\n },\n [],\n [],\n { mode: \"open\" }\n);\nfunction Ir(r) {\n this.content = r;\n}\nIr.prototype = {\n constructor: Ir,\n find: function(r) {\n for (var e = 0; e < this.content.length; e += 2)\n if (this.content[e] === r) return e;\n return -1;\n },\n // :: (string) \u2192 ?any\n // Retrieve the value stored under `key`, or return undefined when\n // no such key exists.\n get: function(r) {\n var e = this.find(r);\n return e == -1 ? void 0 : this.content[e + 1];\n },\n // :: (string, any, ?string) \u2192 OrderedMap\n // Create a new map by replacing the value of `key` with a new\n // value, or adding a binding to the end of the map. If `newKey` is\n // given, the key of the binding will be replaced with that key.\n update: function(r, e, t) {\n var n = t && t != r ? this.remove(t) : this, s = n.find(r), o = n.content.slice();\n return s == -1 ? o.push(t || r, e) : (o[s + 1] = e, t && (o[s] = t)), new Ir(o);\n },\n // :: (string) \u2192 OrderedMap\n // Return a map with the given key removed, if it existed.\n remove: function(r) {\n var e = this.find(r);\n if (e == -1) return this;\n var t = this.content.slice();\n return t.splice(e, 2), new Ir(t);\n },\n // :: (string, any) \u2192 OrderedMap\n // Add a new key to the start of the map.\n addToStart: function(r, e) {\n return new Ir([r, e].concat(this.remove(r).content));\n },\n // :: (string, any) \u2192 OrderedMap\n // Add a new key to the end of the map.\n addToEnd: function(r, e) {\n var t = this.remove(r).content.slice();\n return t.push(r, e), new Ir(t);\n },\n // :: (string, string, any) \u2192 OrderedMap\n // Add a key after the given key. If `place` is not found, the new\n // key is added to the end.\n addBefore: function(r, e, t) {\n var n = this.remove(e), s = n.content.slice(), o = n.find(r);\n return s.splice(o == -1 ? s.length : o, 0, e, t), new Ir(s);\n },\n // :: ((key: string, value: any))\n // Call the given function for each key/value pair in the map, in\n // order.\n forEach: function(r) {\n for (var e = 0; e < this.content.length; e += 2)\n r(this.content[e], this.content[e + 1]);\n },\n // :: (union<Object, OrderedMap>) \u2192 OrderedMap\n // Create a new map by prepending the keys in this map that don't\n // appear in `map` before the keys in `map`.\n prepend: function(r) {\n return r = Ir.from(r), r.size ? new Ir(r.content.concat(this.subtract(r).content)) : this;\n },\n // :: (union<Object, OrderedMap>) \u2192 OrderedMap\n // Create a new map by appending the keys in this map that don't\n // appear in `map` after the keys in `map`.\n append: function(r) {\n return r = Ir.from(r), r.size ? new Ir(this.subtract(r).content.concat(r.content)) : this;\n },\n // :: (union<Object, OrderedMap>) \u2192 OrderedMap\n // Create a map containing all the keys in this map that don't\n // appear in `map`.\n subtract: function(r) {\n var e = this;\n r = Ir.from(r);\n for (var t = 0; t < r.content.length; t += 2)\n e = e.remove(r.content[t]);\n return e;\n },\n // :: () \u2192 Object\n // Turn ordered map into a plain object.\n toObject: function() {\n var r = {};\n return this.forEach(function(e, t) {\n r[e] = t;\n }), r;\n },\n // :: number\n // The amount of keys in this map.\n get size() {\n return this.content.length >> 1;\n }\n};\nIr.from = function(r) {\n if (r instanceof Ir) return r;\n var e = [];\n if (r) for (var t in r) e.push(t, r[t]);\n return new Ir(e);\n};\nfunction qf(r, e, t) {\n for (let n = 0; ; n++) {\n if (n == r.childCount || n == e.childCount)\n return r.childCount == e.childCount ? null : t;\n let s = r.child(n), o = e.child(n);\n if (s == o) {\n t += s.nodeSize;\n continue;\n }\n if (!s.sameMarkup(o))\n return t;\n if (s.isText && s.text != o.text) {\n for (let i = 0; s.text[i] == o.text[i]; i++)\n t++;\n return t;\n }\n if (s.content.size || o.content.size) {\n let i = qf(s.content, o.content, t + 1);\n if (i != null)\n return i;\n }\n t += s.nodeSize;\n }\n}\nfunction Vf(r, e, t, n) {\n for (let s = r.childCount, o = e.childCount; ; ) {\n if (s == 0 || o == 0)\n return s == o ? null : { a: t, b: n };\n let i = r.child(--s), a = e.child(--o), l = i.nodeSize;\n if (i == a) {\n t -= l, n -= l;\n continue;\n }\n if (!i.sameMarkup(a))\n return { a: t, b: n };\n if (i.isText && i.text != a.text) {\n let d = 0, u = Math.min(i.text.length, a.text.length);\n for (; d < u && i.text[i.text.length - d - 1] == a.text[a.text.length - d - 1]; )\n d++, t--, n--;\n return { a: t, b: n };\n }\n if (i.content.size || a.content.size) {\n let d = Vf(i.content, a.content, t - 1, n - 1);\n if (d)\n return d;\n }\n t -= l, n -= l;\n }\n}\nclass ye {\n /**\n @internal\n */\n constructor(e, t) {\n if (this.content = e, this.size = t || 0, t == null)\n for (let n = 0; n < e.length; n++)\n this.size += e[n].nodeSize;\n }\n /**\n Invoke a callback for all descendant nodes between the given two\n positions (relative to start of this fragment). Doesn't descend\n into a node when the callback returns `false`.\n */\n nodesBetween(e, t, n, s = 0, o) {\n for (let i = 0, a = 0; a < t; i++) {\n let l = this.content[i], d = a + l.nodeSize;\n if (d > e && n(l, s + a, o || null, i) !== !1 && l.content.size) {\n let u = a + 1;\n l.nodesBetween(Math.max(0, e - u), Math.min(l.content.size, t - u), n, s + u);\n }\n a = d;\n }\n }\n /**\n Call the given callback for every descendant node. `pos` will be\n relative to the start of the fragment. The callback may return\n `false` to prevent traversal of a given node's children.\n */\n descendants(e) {\n this.nodesBetween(0, this.size, e);\n }\n /**\n Extract the text between `from` and `to`. See the same method on\n [`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).\n */\n textBetween(e, t, n, s) {\n let o = \"\", i = !0;\n return this.nodesBetween(e, t, (a, l) => {\n let d = a.isText ? a.text.slice(Math.max(e, l) - l, t - l) : a.isLeaf ? s ? typeof s == \"function\" ? s(a) : s : a.type.spec.leafText ? a.type.spec.leafText(a) : \"\" : \"\";\n a.isBlock && (a.isLeaf && d || a.isTextblock) && n && (i ? i = !1 : o += n), o += d;\n }, 0), o;\n }\n /**\n Create a new fragment containing the combined content of this\n fragment and the other.\n */\n append(e) {\n if (!e.size)\n return this;\n if (!this.size)\n return e;\n let t = this.lastChild, n = e.firstChild, s = this.content.slice(), o = 0;\n for (t.isText && t.sameMarkup(n) && (s[s.length - 1] = t.withText(t.text + n.text), o = 1); o < e.content.length; o++)\n s.push(e.content[o]);\n return new ye(s, this.size + e.size);\n }\n /**\n Cut out the sub-fragment between the two given positions.\n */\n cut(e, t = this.size) {\n if (e == 0 && t == this.size)\n return this;\n let n = [], s = 0;\n if (t > e)\n for (let o = 0, i = 0; i < t; o++) {\n let a = this.content[o], l = i + a.nodeSize;\n l > e && ((i < e || l > t) && (a.isText ? a = a.cut(Math.max(0, e - i), Math.min(a.text.length, t - i)) : a = a.cut(Math.max(0, e - i - 1), Math.min(a.content.size, t - i - 1))), n.push(a), s += a.nodeSize), i = l;\n }\n return new ye(n, s);\n }\n /**\n @internal\n */\n cutByIndex(e, t) {\n return e == t ? ye.empty : e == 0 && t == this.content.length ? this : new ye(this.content.slice(e, t));\n }\n /**\n Create a new fragment in which the node at the given index is\n replaced by the given node.\n */\n replaceChild(e, t) {\n let n = this.content[e];\n if (n == t)\n return this;\n let s = this.content.slice(), o = this.size + t.nodeSize - n.nodeSize;\n return s[e] = t, new ye(s, o);\n }\n /**\n Create a new fragment by prepending the given node to this\n fragment.\n */\n addToStart(e) {\n return new ye([e].concat(this.content), this.size + e.nodeSize);\n }\n /**\n Create a new fragment by appending the given node to this\n fragment.\n */\n addToEnd(e) {\n return new ye(this.content.concat(e), this.size + e.nodeSize);\n }\n /**\n Compare this fragment to another one.\n */\n eq(e) {\n if (this.content.length != e.content.length)\n return !1;\n for (let t = 0; t < this.content.length; t++)\n if (!this.content[t].eq(e.content[t]))\n return !1;\n return !0;\n }\n /**\n The first child of the fragment, or `null` if it is empty.\n */\n get firstChild() {\n return this.content.length ? this.content[0] : null;\n }\n /**\n The last child of the fragment, or `null` if it is empty.\n */\n get lastChild() {\n return this.content.length ? this.content[this.content.length - 1] : null;\n }\n /**\n The number of child nodes in this fragment.\n */\n get childCount() {\n return this.content.length;\n }\n /**\n Get the child node at the given index. Raise an error when the\n index is out of range.\n */\n child(e) {\n let t = this.content[e];\n if (!t)\n throw new RangeError(\"Index \" + e + \" out of range for \" + this);\n return t;\n }\n /**\n Get the child node at the given index, if it exists.\n */\n maybeChild(e) {\n return this.content[e] || null;\n }\n /**\n Call `f` for every child node, passing the node, its offset\n into this parent node, and its index.\n */\n forEach(e) {\n for (let t = 0, n = 0; t < this.content.length; t++) {\n let s = this.content[t];\n e(s, n, t), n += s.nodeSize;\n }\n }\n /**\n Find the first position at which this fragment and another\n fragment differ, or `null` if they are the same.\n */\n findDiffStart(e, t = 0) {\n return qf(this, e, t);\n }\n /**\n Find the first position, searching from the end, at which this\n fragment and the given fragment differ, or `null` if they are\n the same. Since this position will not be the same in both\n nodes, an object with two separate positions is returned.\n */\n findDiffEnd(e, t = this.size, n = e.size) {\n return Vf(this, e, t, n);\n }\n /**\n Find the index and inner offset corresponding to a given relative\n position in this fragment. The result object will be reused\n (overwritten) the next time the function is called. @internal\n */\n findIndex(e) {\n if (e == 0)\n return li(0, e);\n if (e == this.size)\n return li(this.content.length, e);\n if (e > this.size || e < 0)\n throw new RangeError(`Position ${e} outside of fragment (${this})`);\n for (let t = 0, n = 0; ; t++) {\n let s = this.child(t), o = n + s.nodeSize;\n if (o >= e)\n return o == e ? li(t + 1, o) : li(t, n);\n n = o;\n }\n }\n /**\n Return a debugging string that describes this fragment.\n */\n toString() {\n return \"<\" + this.toStringInner() + \">\";\n }\n /**\n @internal\n */\n toStringInner() {\n return this.content.join(\", \");\n }\n /**\n Create a JSON-serializeable representation of this fragment.\n */\n toJSON() {\n return this.content.length ? this.content.map((e) => e.toJSON()) : null;\n }\n /**\n Deserialize a fragment from its JSON representation.\n */\n static fromJSON(e, t) {\n if (!t)\n return ye.empty;\n if (!Array.isArray(t))\n throw new RangeError(\"Invalid input for Fragment.fromJSON\");\n return new ye(t.map(e.nodeFromJSON));\n }\n /**\n Build a fragment from an array of nodes. Ensures that adjacent\n text nodes with the same marks are joined together.\n */\n static fromArray(e) {\n if (!e.length)\n return ye.empty;\n let t, n = 0;\n for (let s = 0; s < e.length; s++) {\n let o = e[s];\n n += o.nodeSize, s && o.isText && e[s - 1].sameMarkup(o) ? (t || (t = e.slice(0, s)), t[t.length - 1] = o.withText(t[t.length - 1].text + o.text)) : t && t.push(o);\n }\n return new ye(t || e, n);\n }\n /**\n Create a fragment from something that can be interpreted as a\n set of nodes. For `null`, it returns the empty fragment. For a\n fragment, the fragment itself. For a node or array of nodes, a\n fragment containing those nodes.\n */\n static from(e) {\n if (!e)\n return ye.empty;\n if (e instanceof ye)\n return e;\n if (Array.isArray(e))\n return this.fromArray(e);\n if (e.attrs)\n return new ye([e], e.nodeSize);\n throw new RangeError(\"Can not convert \" + e + \" to a Fragment\" + (e.nodesBetween ? \" (looks like multiple versions of prosemirror-model were loaded)\" : \"\"));\n }\n}\nye.empty = new ye([], 0);\nconst Ya = { index: 0, offset: 0 };\nfunction li(r, e) {\n return Ya.index = r, Ya.offset = e, Ya;\n}\nfunction Oi(r, e) {\n if (r === e)\n return !0;\n if (!(r && typeof r == \"object\") || !(e && typeof e == \"object\"))\n return !1;\n let t = Array.isArray(r);\n if (Array.isArray(e) != t)\n return !1;\n if (t) {\n if (r.length != e.length)\n return !1;\n for (let n = 0; n < r.length; n++)\n if (!Oi(r[n], e[n]))\n return !1;\n } else {\n for (let n in r)\n if (!(n in e) || !Oi(r[n], e[n]))\n return !1;\n for (let n in e)\n if (!(n in r))\n return !1;\n }\n return !0;\n}\nlet Gt = class Ml {\n /**\n @internal\n */\n constructor(e, t) {\n this.type = e, this.attrs = t;\n }\n /**\n Given a set of marks, create a new set which contains this one as\n well, in the right position. If this mark is already in the set,\n the set itself is returned. If any marks that are set to be\n [exclusive](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) with this mark are present,\n those are replaced by this one.\n */\n addToSet(e) {\n let t, n = !1;\n for (let s = 0; s < e.length; s++) {\n let o = e[s];\n if (this.eq(o))\n return e;\n if (this.type.excludes(o.type))\n t || (t = e.slice(0, s));\n else {\n if (o.type.excludes(this.type))\n return e;\n !n && o.type.rank > this.type.rank && (t || (t = e.slice(0, s)), t.push(this), n = !0), t && t.push(o);\n }\n }\n return t || (t = e.slice()), n || t.push(this), t;\n }\n /**\n Remove this mark from the given set, returning a new set. If this\n mark is not in the set, the set itself is returned.\n */\n removeFromSet(e) {\n for (let t = 0; t < e.length; t++)\n if (this.eq(e[t]))\n return e.slice(0, t).concat(e.slice(t + 1));\n return e;\n }\n /**\n Test whether this mark is in the given set of marks.\n */\n isInSet(e) {\n for (let t = 0; t < e.length; t++)\n if (this.eq(e[t]))\n return !0;\n return !1;\n }\n /**\n Test whether this mark has the same type and attributes as\n another mark.\n */\n eq(e) {\n return this == e || this.type == e.type && Oi(this.attrs, e.attrs);\n }\n /**\n Convert this mark to a JSON-serializeable representation.\n */\n toJSON() {\n let e = { type: this.type.name };\n for (let t in this.attrs) {\n e.attrs = this.attrs;\n break;\n }\n return e;\n }\n /**\n Deserialize a mark from JSON.\n */\n static fromJSON(e, t) {\n if (!t)\n throw new RangeError(\"Invalid input for Mark.fromJSON\");\n let n = e.marks[t.type];\n if (!n)\n throw new RangeError(`There is no mark type ${t.type} in this schema`);\n let s = n.create(t.attrs);\n return n.checkAttrs(s.attrs), s;\n }\n /**\n Test whether two sets of marks are identical.\n */\n static sameSet(e, t) {\n if (e == t)\n return !0;\n if (e.length != t.length)\n return !1;\n for (let n = 0; n < e.length; n++)\n if (!e[n].eq(t[n]))\n return !1;\n return !0;\n }\n /**\n Create a properly sorted mark set from null, a single mark, or an\n unsorted array of marks.\n */\n static setFrom(e) {\n if (!e || Array.isArray(e) && e.length == 0)\n return Ml.none;\n if (e instanceof Ml)\n return [e];\n let t = e.slice();\n return t.sort((n, s) => n.type.rank - s.type.rank), t;\n }\n};\nGt.none = [];\nclass $i extends Error {\n}\nclass De {\n /**\n Create a slice. When specifying a non-zero open depth, you must\n make sure that there are nodes of at least that depth at the\n appropriate side of the fragment\u2014i.e. if the fragment is an\n empty paragraph node, `openStart` and `openEnd` can't be greater\n than 1.\n \n It is not necessary for the content of open nodes to conform to\n the schema's content constraints, though it should be a valid\n start/end/middle for such a node, depending on which sides are\n open.\n */\n constructor(e, t, n) {\n this.content = e, this.openStart = t, this.openEnd = n;\n }\n /**\n The size this slice would add when inserted into a document.\n */\n get size() {\n return this.content.size - this.openStart - this.openEnd;\n }\n /**\n @internal\n */\n insertAt(e, t) {\n let n = Uf(this.content, e + this.openStart, t);\n return n && new De(n, this.openStart, this.openEnd);\n }\n /**\n @internal\n */\n removeBetween(e, t) {\n return new De(Wf(this.content, e + this.openStart, t + this.openStart), this.openStart, this.openEnd);\n }\n /**\n Tests whether this slice is equal to another slice.\n */\n eq(e) {\n return this.content.eq(e.content) && this.openStart == e.openStart && this.openEnd == e.openEnd;\n }\n /**\n @internal\n */\n toString() {\n return this.content + \"(\" + this.openStart + \",\" + this.openEnd + \")\";\n }\n /**\n Convert a slice to a JSON-serializable representation.\n */\n toJSON() {\n if (!this.content.size)\n return null;\n let e = { content: this.content.toJSON() };\n return this.openStart > 0 && (e.openStart = this.openStart), this.openEnd > 0 && (e.openEnd = this.openEnd), e;\n }\n /**\n Deserialize a slice from its JSON representation.\n */\n static fromJSON(e, t) {\n if (!t)\n return De.empty;\n let n = t.openStart || 0, s = t.openEnd || 0;\n if (typeof n != \"number\" || typeof s != \"number\")\n throw new RangeError(\"Invalid input for Slice.fromJSON\");\n return new De(ye.fromJSON(e, t.content), n, s);\n }\n /**\n Create a slice from a fragment by taking the maximum possible\n open value on both side of the fragment.\n */\n static maxOpen(e, t = !0) {\n let n = 0, s = 0;\n for (let o = e.firstChild; o && !o.isLeaf && (t || !o.type.spec.isolating); o = o.firstChild)\n n++;\n for (let o = e.lastChild; o && !o.isLeaf && (t || !o.type.spec.isolating); o = o.lastChild)\n s++;\n return new De(e, n, s);\n }\n}\nDe.empty = new De(ye.empty, 0, 0);\nfunction Wf(r, e, t) {\n let { index: n, offset: s } = r.findIndex(e), o = r.maybeChild(n), { index: i, offset: a } = r.findIndex(t);\n if (s == e || o.isText) {\n if (a != t && !r.child(i).isText)\n throw new RangeError(\"Removing non-flat range\");\n return r.cut(0, e).append(r.cut(t));\n }\n if (n != i)\n throw new RangeError(\"Removing non-flat range\");\n return r.replaceChild(n, o.copy(Wf(o.content, e - s - 1, t - s - 1)));\n}\nfunction Uf(r, e, t, n) {\n let { index: s, offset: o } = r.findIndex(e), i = r.maybeChild(s);\n if (o == e || i.isText)\n return n && !n.canReplace(s, s, t) ? null : r.cut(0, e).append(t).append(r.cut(e));\n let a = Uf(i.content, e - o - 1, t, i);\n return a && r.replaceChild(s, i.copy(a));\n}\nfunction lb(r, e, t) {\n if (t.openStart > r.depth)\n throw new $i(\"Inserted content deeper than insertion position\");\n if (r.depth - t.openStart != e.depth - t.openEnd)\n throw new $i(\"Inconsistent open depths\");\n return Jf(r, e, t, 0);\n}\nfunction Jf(r, e, t, n) {\n let s = r.index(n), o = r.node(n);\n if (s == e.index(n) && n < r.depth - t.openStart) {\n let i = Jf(r, e, t, n + 1);\n return o.copy(o.content.replaceChild(s, i));\n } else if (t.content.size)\n if (!t.openStart && !t.openEnd && r.depth == n && e.depth == n) {\n let i = r.parent, a = i.content;\n return Es(i, a.cut(0, r.parentOffset).append(t.content).append(a.cut(e.parentOffset)));\n } else {\n let { start: i, end: a } = cb(t, r);\n return Es(o, Gf(r, i, a, e, n));\n }\n else return Es(o, Ii(r, e, n));\n}\nfunction Kf(r, e) {\n if (!e.type.compatibleContent(r.type))\n throw new $i(\"Cannot join \" + e.type.name + \" onto \" + r.type.name);\n}\nfunction Al(r, e, t) {\n let n = r.node(t);\n return Kf(n, e.node(t)), n;\n}\nfunction Ss(r, e) {\n let t = e.length - 1;\n t >= 0 && r.isText && r.sameMarkup(e[t]) ? e[t] = r.withText(e[t].text + r.text) : e.push(r);\n}\nfunction xo(r, e, t, n) {\n let s = (e || r).node(t), o = 0, i = e ? e.index(t) : s.childCount;\n r && (o = r.index(t), r.depth > t ? o++ : r.textOffset && (Ss(r.nodeAfter, n), o++));\n for (let a = o; a < i; a++)\n Ss(s.child(a), n);\n e && e.depth == t && e.textOffset && Ss(e.nodeBefore, n);\n}\nfunction Es(r, e) {\n return r.type.checkContent(e), r.copy(e);\n}\nfunction Gf(r, e, t, n, s) {\n let o = r.depth > s && Al(r, e, s + 1), i = n.depth > s && Al(t, n, s + 1), a = [];\n return xo(null, r, s, a), o && i && e.index(s) == t.index(s) ? (Kf(o, i), Ss(Es(o, Gf(r, e, t, n, s + 1)), a)) : (o && Ss(Es(o, Ii(r, e, s + 1)), a), xo(e, t, s, a), i && Ss(Es(i, Ii(t, n, s + 1)), a)), xo(n, null, s, a), new ye(a);\n}\nfunction Ii(r, e, t) {\n let n = [];\n if (xo(null, r, t, n), r.depth > t) {\n let s = Al(r, e, t + 1);\n Ss(Es(s, Ii(r, e, t + 1)), n);\n }\n return xo(e, null, t, n), new ye(n);\n}\nfunction cb(r, e) {\n let t = e.depth - r.openStart, s = e.node(t).copy(r.content);\n for (let o = t - 1; o >= 0; o--)\n s = e.node(o).copy(ye.from(s));\n return {\n start: s.resolveNoCache(r.openStart + t),\n end: s.resolveNoCache(s.content.size - r.openEnd - t)\n };\n}\nclass zo {\n /**\n @internal\n */\n constructor(e, t, n) {\n this.pos = e, this.path = t, this.parentOffset = n, this.depth = t.length / 3 - 1;\n }\n /**\n @internal\n */\n resolveDepth(e) {\n return e == null ? this.depth : e < 0 ? this.depth + e : e;\n }\n /**\n The parent node that the position points into. Note that even if\n a position points into a text node, that node is not considered\n the parent\u2014text nodes are \u2018flat\u2019 in this model, and have no content.\n */\n get parent() {\n return this.node(this.depth);\n }\n /**\n The root node in which the position was resolved.\n */\n get doc() {\n return this.node(0);\n }\n /**\n The ancestor node at the given level. `p.node(p.depth)` is the\n same as `p.parent`.\n */\n node(e) {\n return this.path[this.resolveDepth(e) * 3];\n }\n /**\n The index into the ancestor at the given level. If this points\n at the 3rd node in the 2nd paragraph on the top level, for\n example, `p.index(0)` is 1 and `p.index(1)` is 2.\n */\n index(e) {\n return this.path[this.resolveDepth(e) * 3 + 1];\n }\n /**\n The index pointing after this position into the ancestor at the\n given level.\n */\n indexAfter(e) {\n return e = this.resolveDepth(e), this.index(e) + (e == this.depth && !this.textOffset ? 0 : 1);\n }\n /**\n The (absolute) position at the start of the node at the given\n level.\n */\n start(e) {\n return e = this.resolveDepth(e), e == 0 ? 0 : this.path[e * 3 - 1] + 1;\n }\n /**\n The (absolute) position at the end of the node at the given\n level.\n */\n end(e) {\n return e = this.resolveDepth(e), this.start(e) + this.node(e).content.size;\n }\n /**\n The (absolute) position directly before the wrapping node at the\n given level, or, when `depth` is `this.depth + 1`, the original\n position.\n */\n before(e) {\n if (e = this.resolveDepth(e), !e)\n throw new RangeError(\"There is no position before the top-level node\");\n return e == this.depth + 1 ? this.pos : this.path[e * 3 - 1];\n }\n /**\n The (absolute) position directly after the wrapping node at the\n given level, or the original position when `depth` is `this.depth + 1`.\n */\n after(e) {\n if (e = this.resolveDepth(e), !e)\n throw new RangeError(\"There is no position after the top-level node\");\n return e == this.depth + 1 ? this.pos : this.path[e * 3 - 1] + this.path[e * 3].nodeSize;\n }\n /**\n When this position points into a text node, this returns the\n distance between the position and the start of the text node.\n Will be zero for positions that point between nodes.\n */\n get textOffset() {\n return this.pos - this.path[this.path.length - 1];\n }\n /**\n Get the node directly after the position, if any. If the position\n points into a text node, only the part of that node after the\n position is returned.\n */\n get nodeAfter() {\n let e = this.parent, t = this.index(this.depth);\n if (t == e.childCount)\n return null;\n let n = this.pos - this.path[this.path.length - 1], s = e.child(t);\n return n ? e.child(t).cut(n) : s;\n }\n /**\n Get the node directly before the position, if any. If the\n position points into a text node, only the part of that node\n before the position is returned.\n */\n get nodeBefore() {\n let e = this.index(this.depth), t = this.pos - this.path[this.path.length - 1];\n return t ? this.parent.child(e).cut(0, t) : e == 0 ? null : this.parent.child(e - 1);\n }\n /**\n Get the position at the given index in the parent node at the\n given depth (which defaults to `this.depth`).\n */\n posAtIndex(e, t) {\n t = this.resolveDepth(t);\n let n = this.path[t * 3], s = t == 0 ? 0 : this.path[t * 3 - 1] + 1;\n for (let o = 0; o < e; o++)\n s += n.child(o).nodeSize;\n return s;\n }\n /**\n Get the marks at this position, factoring in the surrounding\n marks' [`inclusive`](https://prosemirror.net/docs/ref/#model.MarkSpec.inclusive) property. If the\n position is at the start of a non-empty node, the marks of the\n node after it (if any) are returned.\n */\n marks() {\n let e = this.parent, t = this.index();\n if (e.content.size == 0)\n return Gt.none;\n if (this.textOffset)\n return e.child(t).marks;\n let n = e.maybeChild(t - 1), s = e.maybeChild(t);\n if (!n) {\n let a = n;\n n = s, s = a;\n }\n let o = n.marks;\n for (var i = 0; i < o.length; i++)\n o[i].type.spec.inclusive === !1 && (!s || !o[i].isInSet(s.marks)) && (o = o[i--].removeFromSet(o));\n return o;\n }\n /**\n Get the marks after the current position, if any, except those\n that are non-inclusive and not present at position `$end`. This\n is mostly useful for getting the set of marks to preserve after a\n deletion. Will return `null` if this position is at the end of\n its parent node or its parent node isn't a textblock (in which\n case no marks should be preserved).\n */\n marksAcross(e) {\n let t = this.parent.maybeChild(this.index());\n if (!t || !t.isInline)\n return null;\n let n = t.marks, s = e.parent.maybeChild(e.index());\n for (var o = 0; o < n.length; o++)\n n[o].type.spec.inclusive === !1 && (!s || !n[o].isInSet(s.marks)) && (n = n[o--].removeFromSet(n));\n return n;\n }\n /**\n The depth up to which this position and the given (non-resolved)\n position share the same parent nodes.\n */\n sharedDepth(e) {\n for (let t = this.depth; t > 0; t--)\n if (this.start(t) <= e && this.end(t) >= e)\n return t;\n return 0;\n }\n /**\n Returns a range based on the place where this position and the\n given position diverge around block content. If both point into\n the same textblock, for example, a range around that textblock\n will be returned. If they point into different blocks, the range\n around those blocks in their shared ancestor is returned. You can\n pass in an optional predicate that will be called with a parent\n node to see if a range into that parent is acceptable.\n */\n blockRange(e = this, t) {\n if (e.pos < this.pos)\n return e.blockRange(this);\n for (let n = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); n >= 0; n--)\n if (e.pos <= this.end(n) && (!t || t(this.node(n))))\n return new zi(this, e, n);\n return null;\n }\n /**\n Query whether the given position shares the same parent node.\n */\n sameParent(e) {\n return this.pos - this.parentOffset == e.pos - e.parentOffset;\n }\n /**\n Return the greater of this and the given position.\n */\n max(e) {\n return e.pos > this.pos ? e : this;\n }\n /**\n Return the smaller of this and the given position.\n */\n min(e) {\n return e.pos < this.pos ? e : this;\n }\n /**\n @internal\n */\n toString() {\n let e = \"\";\n for (let t = 1; t <= this.depth; t++)\n e += (e ? \"/\" : \"\") + this.node(t).type.name + \"_\" + this.index(t - 1);\n return e + \":\" + this.parentOffset;\n }\n /**\n @internal\n */\n static resolve(e, t) {\n if (!(t >= 0 && t <= e.content.size))\n throw new RangeError(\"Position \" + t + \" out of range\");\n let n = [], s = 0, o = t;\n for (let i = e; ; ) {\n let { index: a, offset: l } = i.content.findIndex(o), d = o - l;\n if (n.push(i, a, s + l), !d || (i = i.child(a), i.isText))\n break;\n o = d - 1, s += l + 1;\n }\n return new zo(t, n, o);\n }\n /**\n @internal\n */\n static resolveCached(e, t) {\n let n = Fd.get(e);\n if (n)\n for (let o = 0; o < n.elts.length; o++) {\n let i = n.elts[o];\n if (i.pos == t)\n return i;\n }\n else\n Fd.set(e, n = new db());\n let s = n.elts[n.i] = zo.resolve(e, t);\n return n.i = (n.i + 1) % ub, s;\n }\n}\nclass db {\n constructor() {\n this.elts = [], this.i = 0;\n }\n}\nconst ub = 12, Fd = /* @__PURE__ */ new WeakMap();\nclass zi {\n /**\n Construct a node range. `$from` and `$to` should point into the\n same node until at least the given `depth`, since a node range\n denotes an adjacent set of nodes in a single parent node.\n */\n constructor(e, t, n) {\n this.$from = e, this.$to = t, this.depth = n;\n }\n /**\n The position at the start of the range.\n */\n get start() {\n return this.$from.before(this.depth + 1);\n }\n /**\n The position at the end of the range.\n */\n get end() {\n return this.$to.after(this.depth + 1);\n }\n /**\n The parent node that the range points into.\n */\n get parent() {\n return this.$from.node(this.depth);\n }\n /**\n The start index of the range in the parent node.\n */\n get startIndex() {\n return this.$from.index(this.depth);\n }\n /**\n The end index of the range in the parent node.\n */\n get endIndex() {\n return this.$to.indexAfter(this.depth);\n }\n}\nconst fb = /* @__PURE__ */ Object.create(null);\nclass gn {\n /**\n @internal\n */\n constructor(e, t, n, s = Gt.none) {\n this.type = e, this.attrs = t, this.marks = s, this.content = n || ye.empty;\n }\n /**\n The array of this node's child nodes.\n */\n get children() {\n return this.content.content;\n }\n /**\n The size of this node, as defined by the integer-based [indexing\n scheme](https://prosemirror.net/docs/guide/#doc.indexing). For text nodes, this is the\n amount of characters. For other leaf nodes, it is one. For\n non-leaf nodes, it is the size of the content plus two (the\n start and end token).\n */\n get nodeSize() {\n return this.isLeaf ? 1 : 2 + this.content.size;\n }\n /**\n The number of children that the node has.\n */\n get childCount() {\n return this.content.childCount;\n }\n /**\n Get the child node at the given index. Raises an error when the\n index is out of range.\n */\n child(e) {\n return this.content.child(e);\n }\n /**\n Get the child node at the given index, if it exists.\n */\n maybeChild(e) {\n return this.content.maybeChild(e);\n }\n /**\n Call `f` for every child node, passing the node, its offset\n into this parent node, and its index.\n */\n forEach(e) {\n this.content.forEach(e);\n }\n /**\n Invoke a callback for all descendant nodes recursively between\n the given two positions that are relative to start of this\n node's content. The callback is invoked with the node, its\n position relative to the original node (method receiver),\n its parent node, and its child index. When the callback returns\n false for a given node, that node's children will not be\n recursed over. The last parameter can be used to specify a\n starting position to count from.\n */\n nodesBetween(e, t, n, s = 0) {\n this.content.nodesBetween(e, t, n, s, this);\n }\n /**\n Call the given callback for every descendant node. Doesn't\n descend into a node when the callback returns `false`.\n */\n descendants(e) {\n this.nodesBetween(0, this.content.size, e);\n }\n /**\n Concatenates all the text nodes found in this fragment and its\n children.\n */\n get textContent() {\n return this.isLeaf && this.type.spec.leafText ? this.type.spec.leafText(this) : this.textBetween(0, this.content.size, \"\");\n }\n /**\n Get all text between positions `from` and `to`. When\n `blockSeparator` is given, it will be inserted to separate text\n from different block nodes. If `leafText` is given, it'll be\n inserted for every non-text leaf node encountered, otherwise\n [`leafText`](https://prosemirror.net/docs/ref/#model.NodeSpec.leafText) will be used.\n */\n textBetween(e, t, n, s) {\n return this.content.textBetween(e, t, n, s);\n }\n /**\n Returns this node's first child, or `null` if there are no\n children.\n */\n get firstChild() {\n return this.content.firstChild;\n }\n /**\n Returns this node's last child, or `null` if there are no\n children.\n */\n get lastChild() {\n return this.content.lastChild;\n }\n /**\n Test whether two nodes represent the same piece of document.\n */\n eq(e) {\n return this == e || this.sameMarkup(e) && this.content.eq(e.content);\n }\n /**\n Compare the markup (type, attributes, and marks) of this node to\n those of another. Returns `true` if both have the same markup.\n */\n sameMarkup(e) {\n return this.hasMarkup(e.type, e.attrs, e.marks);\n }\n /**\n Check whether this node's markup correspond to the given type,\n attributes, and marks.\n */\n hasMarkup(e, t, n) {\n return this.type == e && Oi(this.attrs, t || e.defaultAttrs || fb) && Gt.sameSet(this.marks, n || Gt.none);\n }\n /**\n Create a new node with the same markup as this node, containing\n the given content (or empty, if no content is given).\n */\n copy(e = null) {\n return e == this.content ? this : new gn(this.type, this.attrs, e, this.marks);\n }\n /**\n Create a copy of this node, with the given set of marks instead\n of the node's own marks.\n */\n mark(e) {\n return e == this.marks ? this : new gn(this.type, this.attrs, this.content, e);\n }\n /**\n Create a copy of this node with only the content between the\n given positions. If `to` is not given, it defaults to the end of\n the node.\n */\n cut(e, t = this.content.size) {\n return e == 0 && t == this.content.size ? this : this.copy(this.content.cut(e, t));\n }\n /**\n Cut out the part of the document between the given positions, and\n return it as a `Slice` object.\n */\n slice(e, t = this.content.size, n = !1) {\n if (e == t)\n return De.empty;\n let s = this.resolve(e), o = this.resolve(t), i = n ? 0 : s.sharedDepth(t), a = s.start(i), d = s.node(i).content.cut(s.pos - a, o.pos - a);\n return new De(d, s.depth - i, o.depth - i);\n }\n /**\n Replace the part of the document between the given positions with\n the given slice. The slice must 'fit', meaning its open sides\n must be able to connect to the surrounding content, and its\n content nodes must be valid children for the node they are placed\n into. If any of this is violated, an error of type\n [`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.\n */\n replace(e, t, n) {\n return lb(this.resolve(e), this.resolve(t), n);\n }\n /**\n Find the node directly after the given position.\n */\n nodeAt(e) {\n for (let t = this; ; ) {\n let { index: n, offset: s } = t.content.findIndex(e);\n if (t = t.maybeChild(n), !t)\n return null;\n if (s == e || t.isText)\n return t;\n e -= s + 1;\n }\n }\n /**\n Find the (direct) child node after the given offset, if any,\n and return it along with its index and offset relative to this\n node.\n */\n childAfter(e) {\n let { index: t, offset: n } = this.content.findIndex(e);\n return { node: this.content.maybeChild(t), index: t, offset: n };\n }\n /**\n Find the (direct) child node before the given offset, if any,\n and return it along with its index and offset relative to this\n node.\n */\n childBefore(e) {\n if (e == 0)\n return { node: null, index: 0, offset: 0 };\n let { index: t, offset: n } = this.content.findIndex(e);\n if (n < e)\n return { node: this.content.child(t), index: t, offset: n };\n let s = this.content.child(t - 1);\n return { node: s, index: t - 1, offset: n - s.nodeSize };\n }\n /**\n Resolve the given position in the document, returning an\n [object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.\n */\n resolve(e) {\n return zo.resolveCached(this, e);\n }\n /**\n @internal\n */\n resolveNoCache(e) {\n return zo.resolve(this, e);\n }\n /**\n Test whether a given mark or mark type occurs in this document\n between the two given positions.\n */\n rangeHasMark(e, t, n) {\n let s = !1;\n return t > e && this.nodesBetween(e, t, (o) => (n.isInSet(o.marks) && (s = !0), !s)), s;\n }\n /**\n True when this is a block (non-inline node)\n */\n get isBlock() {\n return this.type.isBlock;\n }\n /**\n True when this is a textblock node, a block node with inline\n content.\n */\n get isTextblock() {\n return this.type.isTextblock;\n }\n /**\n True when this node allows inline content.\n */\n get inlineContent() {\n return this.type.inlineContent;\n }\n /**\n True when this is an inline node (a text node or a node that can\n appear among text).\n */\n get isInline() {\n return this.type.isInline;\n }\n /**\n True when this is a text node.\n */\n get isText() {\n return this.type.isText;\n }\n /**\n True when this is a leaf node.\n */\n get isLeaf() {\n return this.type.isLeaf;\n }\n /**\n True when this is an atom, i.e. when it does not have directly\n editable content. This is usually the same as `isLeaf`, but can\n be configured with the [`atom` property](https://prosemirror.net/docs/ref/#model.NodeSpec.atom)\n on a node's spec (typically used when the node is displayed as\n an uneditable [node view](https://prosemirror.net/docs/ref/#view.NodeView)).\n */\n get isAtom() {\n return this.type.isAtom;\n }\n /**\n Return a string representation of this node for debugging\n purposes.\n */\n toString() {\n if (this.type.spec.toDebugString)\n return this.type.spec.toDebugString(this);\n let e = this.type.name;\n return this.content.size && (e += \"(\" + this.content.toStringInner() + \")\"), Yf(this.marks, e);\n }\n /**\n Get the content match in this node at the given index.\n */\n contentMatchAt(e) {\n let t = this.type.contentMatch.matchFragment(this.content, 0, e);\n if (!t)\n throw new Error(\"Called contentMatchAt on a node with invalid content\");\n return t;\n }\n /**\n Test whether replacing the range between `from` and `to` (by\n child index) with the given replacement fragment (which defaults\n to the empty fragment) would leave the node's content valid. You\n can optionally pass `start` and `end` indices into the\n replacement fragment.\n */\n canReplace(e, t, n = ye.empty, s = 0, o = n.childCount) {\n let i = this.contentMatchAt(e).matchFragment(n, s, o), a = i && i.matchFragment(this.content, t);\n if (!a || !a.validEnd)\n return !1;\n for (let l = s; l < o; l++)\n if (!this.type.allowsMarks(n.child(l).marks))\n return !1;\n return !0;\n }\n /**\n Test whether replacing the range `from` to `to` (by index) with\n a node of the given type would leave the node's content valid.\n */\n canReplaceWith(e, t, n, s) {\n if (s && !this.type.allowsMarks(s))\n return !1;\n let o = this.contentMatchAt(e).matchType(n), i = o && o.matchFragment(this.content, t);\n return i ? i.validEnd : !1;\n }\n /**\n Test whether the given node's content could be appended to this\n node. If that node is empty, this will only return true if there\n is at least one node type that can appear in both nodes (to avoid\n merging completely incompatible nodes).\n */\n canAppend(e) {\n return e.content.size ? this.canReplace(this.childCount, this.childCount, e.content) : this.type.compatibleContent(e.type);\n }\n /**\n Check whether this node and its descendants conform to the\n schema, and raise an exception when they do not.\n */\n check() {\n this.type.checkContent(this.content), this.type.checkAttrs(this.attrs);\n let e = Gt.none;\n for (let t = 0; t < this.marks.length; t++) {\n let n = this.marks[t];\n n.type.checkAttrs(n.attrs), e = n.addToSet(e);\n }\n if (!Gt.sameSet(e, this.marks))\n throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((t) => t.type.name)}`);\n this.content.forEach((t) => t.check());\n }\n /**\n Return a JSON-serializeable representation of this node.\n */\n toJSON() {\n let e = { type: this.type.name };\n for (let t in this.attrs) {\n e.attrs = this.attrs;\n break;\n }\n return this.content.size && (e.content = this.content.toJSON()), this.marks.length && (e.marks = this.marks.map((t) => t.toJSON())), e;\n }\n /**\n Deserialize a node from its JSON representation.\n */\n static fromJSON(e, t) {\n if (!t)\n throw new RangeError(\"Invalid input for Node.fromJSON\");\n let n;\n if (t.marks) {\n if (!Array.isArray(t.marks))\n throw new RangeError(\"Invalid mark data for Node.fromJSON\");\n n = t.marks.map(e.markFromJSON);\n }\n if (t.type == \"text\") {\n if (typeof t.text != \"string\")\n throw new RangeError(\"Invalid text node in JSON\");\n return e.text(t.text, n);\n }\n let s = ye.fromJSON(e, t.content), o = e.nodeType(t.type).create(t.attrs, s, n);\n return o.type.checkAttrs(o.attrs), o;\n }\n}\ngn.prototype.text = void 0;\nclass Ri extends gn {\n /**\n @internal\n */\n constructor(e, t, n, s) {\n if (super(e, t, null, s), !n)\n throw new RangeError(\"Empty text nodes are not allowed\");\n this.text = n;\n }\n toString() {\n return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) : Yf(this.marks, JSON.stringify(this.text));\n }\n get textContent() {\n return this.text;\n }\n textBetween(e, t) {\n return this.text.slice(e, t);\n }\n get nodeSize() {\n return this.text.length;\n }\n mark(e) {\n return e == this.marks ? this : new Ri(this.type, this.attrs, this.text, e);\n }\n withText(e) {\n return e == this.text ? this : new Ri(this.type, this.attrs, e, this.marks);\n }\n cut(e = 0, t = this.text.length) {\n return e == 0 && t == this.text.length ? this : this.withText(this.text.slice(e, t));\n }\n eq(e) {\n return this.sameMarkup(e) && this.text == e.text;\n }\n toJSON() {\n let e = super.toJSON();\n return e.text = this.text, e;\n }\n}\nfunction Yf(r, e) {\n for (let t = r.length - 1; t >= 0; t--)\n e = r[t].type.name + \"(\" + e + \")\";\n return e;\n}\nclass Ps {\n /**\n @internal\n */\n constructor(e) {\n this.validEnd = e, this.next = [], this.wrapCache = [];\n }\n /**\n @internal\n */\n static parse(e, t) {\n let n = new pb(e, t);\n if (n.next == null)\n return Ps.empty;\n let s = Xf(n);\n n.next && n.err(\"Unexpected trailing text\");\n let o = xb(yb(s));\n return wb(o, n), o;\n }\n /**\n Match a node type, returning a match after that node if\n successful.\n */\n matchType(e) {\n for (let t = 0; t < this.next.length; t++)\n if (this.next[t].type == e)\n return this.next[t].next;\n return null;\n }\n /**\n Try to match a fragment. Returns the resulting match when\n successful.\n */\n matchFragment(e, t = 0, n = e.childCount) {\n let s = this;\n for (let o = t; s && o < n; o++)\n s = s.matchType(e.child(o).type);\n return s;\n }\n /**\n @internal\n */\n get inlineContent() {\n return this.next.length != 0 && this.next[0].type.isInline;\n }\n /**\n Get the first matching node type at this match position that can\n be generated.\n */\n get defaultType() {\n for (let e = 0; e < this.next.length; e++) {\n let { type: t } = this.next[e];\n if (!(t.isText || t.hasRequiredAttrs()))\n return t;\n }\n return null;\n }\n /**\n @internal\n */\n compatible(e) {\n for (let t = 0; t < this.next.length; t++)\n for (let n = 0; n < e.next.length; n++)\n if (this.next[t].type == e.next[n].type)\n return !0;\n return !1;\n }\n /**\n Try to match the given fragment, and if that fails, see if it can\n be made to match by inserting nodes in front of it. When\n successful, return a fragment of inserted nodes (which may be\n empty if nothing had to be inserted). When `toEnd` is true, only\n return a fragment if the resulting match goes to the end of the\n content expression.\n */\n fillBefore(e, t = !1, n = 0) {\n let s = [this];\n function o(i, a) {\n let l = i.matchFragment(e, n);\n if (l && (!t || l.validEnd))\n return ye.from(a.map((d) => d.createAndFill()));\n for (let d = 0; d < i.next.length; d++) {\n let { type: u, next: f } = i.next[d];\n if (!(u.isText || u.hasRequiredAttrs()) && s.indexOf(f) == -1) {\n s.push(f);\n let h = o(f, a.concat(u));\n if (h)\n return h;\n }\n }\n return null;\n }\n return o(this, []);\n }\n /**\n Find a set of wrapping node types that would allow a node of the\n given type to appear at this position. The result may be empty\n (when it fits directly) and will be null when no such wrapping\n exists.\n */\n findWrapping(e) {\n for (let n = 0; n < this.wrapCache.length; n += 2)\n if (this.wrapCache[n] == e)\n return this.wrapCache[n + 1];\n let t = this.computeWrapping(e);\n return this.wrapCache.push(e, t), t;\n }\n /**\n @internal\n */\n computeWrapping(e) {\n let t = /* @__PURE__ */ Object.create(null), n = [{ match: this, type: null, via: null }];\n for (; n.length; ) {\n let s = n.shift(), o = s.match;\n if (o.matchType(e)) {\n let i = [];\n for (let a = s; a.type; a = a.via)\n i.push(a.type);\n return i.reverse();\n }\n for (let i = 0; i < o.next.length; i++) {\n let { type: a, next: l } = o.next[i];\n !a.isLeaf && !a.hasRequiredAttrs() && !(a.name in t) && (!s.type || l.validEnd) && (n.push({ match: a.contentMatch, type: a, via: s }), t[a.name] = !0);\n }\n }\n return null;\n }\n /**\n The number of outgoing edges this node has in the finite\n automaton that describes the content expression.\n */\n get edgeCount() {\n return this.next.length;\n }\n /**\n Get the _n_\u200Bth outgoing edge from this node in the finite\n automaton that describes the content expression.\n */\n edge(e) {\n if (e >= this.next.length)\n throw new RangeError(`There's no ${e}th edge in this content match`);\n return this.next[e];\n }\n /**\n @internal\n */\n toString() {\n let e = [];\n function t(n) {\n e.push(n);\n for (let s = 0; s < n.next.length; s++)\n e.indexOf(n.next[s].next) == -1 && t(n.next[s].next);\n }\n return t(this), e.map((n, s) => {\n let o = s + (n.validEnd ? \"*\" : \" \") + \" \";\n for (let i = 0; i < n.next.length; i++)\n o += (i ? \", \" : \"\") + n.next[i].type.name + \"->\" + e.indexOf(n.next[i].next);\n return o;\n }).join(`\n`);\n }\n}\nPs.empty = new Ps(!0);\nclass pb {\n constructor(e, t) {\n this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\\s*(?=\\b|\\W|$)/), this.tokens[this.tokens.length - 1] == \"\" && this.tokens.pop(), this.tokens[0] == \"\" && this.tokens.shift();\n }\n get next() {\n return this.tokens[this.pos];\n }\n eat(e) {\n return this.next == e && (this.pos++ || !0);\n }\n err(e) {\n throw new SyntaxError(e + \" (in content expression '\" + this.string + \"')\");\n }\n}\nfunction Xf(r) {\n let e = [];\n do\n e.push(hb(r));\n while (r.eat(\"|\"));\n return e.length == 1 ? e[0] : { type: \"choice\", exprs: e };\n}\nfunction hb(r) {\n let e = [];\n do\n e.push(mb(r));\n while (r.next && r.next != \")\" && r.next != \"|\");\n return e.length == 1 ? e[0] : { type: \"seq\", exprs: e };\n}\nfunction mb(r) {\n let e = bb(r);\n for (; ; )\n if (r.eat(\"+\"))\n e = { type: \"plus\", expr: e };\n else if (r.eat(\"*\"))\n e = { type: \"star\", expr: e };\n else if (r.eat(\"?\"))\n e = { type: \"opt\", expr: e };\n else if (r.eat(\"{\"))\n e = vb(r, e);\n else\n break;\n return e;\n}\nfunction Bd(r) {\n /\\D/.test(r.next) && r.err(\"Expected number, got '\" + r.next + \"'\");\n let e = Number(r.next);\n return r.pos++, e;\n}\nfunction vb(r, e) {\n let t = Bd(r), n = t;\n return r.eat(\",\") && (r.next != \"}\" ? n = Bd(r) : n = -1), r.eat(\"}\") || r.err(\"Unclosed braced range\"), { type: \"range\", min: t, max: n, expr: e };\n}\nfunction gb(r, e) {\n let t = r.nodeTypes, n = t[e];\n if (n)\n return [n];\n let s = [];\n for (let o in t) {\n let i = t[o];\n i.isInGroup(e) && s.push(i);\n }\n return s.length == 0 && r.err(\"No node type or group '\" + e + \"' found\"), s;\n}\nfunction bb(r) {\n if (r.eat(\"(\")) {\n let e = Xf(r);\n return r.eat(\")\") || r.err(\"Missing closing paren\"), e;\n } else if (/\\W/.test(r.next))\n r.err(\"Unexpected token '\" + r.next + \"'\");\n else {\n let e = gb(r, r.next).map((t) => (r.inline == null ? r.inline = t.isInline : r.inline != t.isInline && r.err(\"Mixing inline and block content\"), { type: \"name\", value: t }));\n return r.pos++, e.length == 1 ? e[0] : { type: \"choice\", exprs: e };\n }\n}\nfunction yb(r) {\n let e = [[]];\n return s(o(r, 0), t()), e;\n function t() {\n return e.push([]) - 1;\n }\n function n(i, a, l) {\n let d = { term: l, to: a };\n return e[i].push(d), d;\n }\n function s(i, a) {\n i.forEach((l) => l.to = a);\n }\n function o(i, a) {\n if (i.type == \"choice\")\n return i.exprs.reduce((l, d) => l.concat(o(d, a)), []);\n if (i.type == \"seq\")\n for (let l = 0; ; l++) {\n let d = o(i.exprs[l], a);\n if (l == i.exprs.length - 1)\n return d;\n s(d, a = t());\n }\n else if (i.type == \"star\") {\n let l = t();\n return n(a, l), s(o(i.expr, l), l), [n(l)];\n } else if (i.type == \"plus\") {\n let l = t();\n return s(o(i.expr, a), l), s(o(i.expr, l), l), [n(l)];\n } else {\n if (i.type == \"opt\")\n return [n(a)].concat(o(i.expr, a));\n if (i.type == \"range\") {\n let l = a;\n for (let d = 0; d < i.min; d++) {\n let u = t();\n s(o(i.expr, l), u), l = u;\n }\n if (i.max == -1)\n s(o(i.expr, l), l);\n else\n for (let d = i.min; d < i.max; d++) {\n let u = t();\n n(l, u), s(o(i.expr, l), u), l = u;\n }\n return [n(l)];\n } else {\n if (i.type == \"name\")\n return [n(a, void 0, i.value)];\n throw new Error(\"Unknown expr type\");\n }\n }\n }\n}\nfunction Qf(r, e) {\n return e - r;\n}\nfunction Hd(r, e) {\n let t = [];\n return n(e), t.sort(Qf);\n function n(s) {\n let o = r[s];\n if (o.length == 1 && !o[0].term)\n return n(o[0].to);\n t.push(s);\n for (let i = 0; i < o.length; i++) {\n let { term: a, to: l } = o[i];\n !a && t.indexOf(l) == -1 && n(l);\n }\n }\n}\nfunction xb(r) {\n let e = /* @__PURE__ */ Object.create(null);\n return t(Hd(r, 0));\n function t(n) {\n let s = [];\n n.forEach((i) => {\n r[i].forEach(({ term: a, to: l }) => {\n if (!a)\n return;\n let d;\n for (let u = 0; u < s.length; u++)\n s[u][0] == a && (d = s[u][1]);\n Hd(r, l).forEach((u) => {\n d || s.push([a, d = []]), d.indexOf(u) == -1 && d.push(u);\n });\n });\n });\n let o = e[n.join(\",\")] = new Ps(n.indexOf(r.length - 1) > -1);\n for (let i = 0; i < s.length; i++) {\n let a = s[i][1].sort(Qf);\n o.next.push({ type: s[i][0], next: e[a.join(\",\")] || t(a) });\n }\n return o;\n }\n}\nfunction wb(r, e) {\n for (let t = 0, n = [r]; t < n.length; t++) {\n let s = n[t], o = !s.validEnd, i = [];\n for (let a = 0; a < s.next.length; a++) {\n let { type: l, next: d } = s.next[a];\n i.push(l.name), o && !(l.isText || l.hasRequiredAttrs()) && (o = !1), n.indexOf(d) == -1 && n.push(d);\n }\n o && e.err(\"Only non-generatable nodes (\" + i.join(\", \") + \") in a required position (see https://prosemirror.net/docs/guide/#generatable)\");\n }\n}\nfunction Zf(r) {\n let e = /* @__PURE__ */ Object.create(null);\n for (let t in r) {\n let n = r[t];\n if (!n.hasDefault)\n return null;\n e[t] = n.default;\n }\n return e;\n}\nfunction ep(r, e) {\n let t = /* @__PURE__ */ Object.create(null);\n for (let n in r) {\n let s = e && e[n];\n if (s === void 0) {\n let o = r[n];\n if (o.hasDefault)\n s = o.default;\n else\n throw new RangeError(\"No value supplied for attribute \" + n);\n }\n t[n] = s;\n }\n return t;\n}\nfunction tp(r, e, t, n) {\n for (let s in e)\n if (!(s in r))\n throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);\n for (let s in r) {\n let o = r[s];\n o.validate && o.validate(e[s]);\n }\n}\nfunction rp(r, e) {\n let t = /* @__PURE__ */ Object.create(null);\n if (e)\n for (let n in e)\n t[n] = new Cb(r, n, e[n]);\n return t;\n}\nlet qd = class np {\n /**\n @internal\n */\n constructor(e, t, n) {\n this.name = e, this.schema = t, this.spec = n, this.markSet = null, this.groups = n.group ? n.group.split(\" \") : [], this.attrs = rp(e, n.attrs), this.defaultAttrs = Zf(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(n.inline || e == \"text\"), this.isText = e == \"text\";\n }\n /**\n True if this is an inline type.\n */\n get isInline() {\n return !this.isBlock;\n }\n /**\n True if this is a textblock type, a block that contains inline\n content.\n */\n get isTextblock() {\n return this.isBlock && this.inlineContent;\n }\n /**\n True for node types that allow no content.\n */\n get isLeaf() {\n return this.contentMatch == Ps.empty;\n }\n /**\n True when this node is an atom, i.e. when it does not have\n directly editable content.\n */\n get isAtom() {\n return this.isLeaf || !!this.spec.atom;\n }\n /**\n Return true when this node type is part of the given\n [group](https://prosemirror.net/docs/ref/#model.NodeSpec.group).\n */\n isInGroup(e) {\n return this.groups.indexOf(e) > -1;\n }\n /**\n The node type's [whitespace](https://prosemirror.net/docs/ref/#model.NodeSpec.whitespace) option.\n */\n get whitespace() {\n return this.spec.whitespace || (this.spec.code ? \"pre\" : \"normal\");\n }\n /**\n Tells you whether this node type has any required attributes.\n */\n hasRequiredAttrs() {\n for (let e in this.attrs)\n if (this.attrs[e].isRequired)\n return !0;\n return !1;\n }\n /**\n Indicates whether this node allows some of the same content as\n the given node type.\n */\n compatibleContent(e) {\n return this == e || this.contentMatch.compatible(e.contentMatch);\n }\n /**\n @internal\n */\n computeAttrs(e) {\n return !e && this.defaultAttrs ? this.defaultAttrs : ep(this.attrs, e);\n }\n /**\n Create a `Node` of this type. The given attributes are\n checked and defaulted (you can pass `null` to use the type's\n defaults entirely, if no required attributes exist). `content`\n may be a `Fragment`, a node, an array of nodes, or\n `null`. Similarly `marks` may be `null` to default to the empty\n set of marks.\n */\n create(e = null, t, n) {\n if (this.isText)\n throw new Error(\"NodeType.create can't construct text nodes\");\n return new gn(this, this.computeAttrs(e), ye.from(t), Gt.setFrom(n));\n }\n /**\n Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content\n against the node type's content restrictions, and throw an error\n if it doesn't match.\n */\n createChecked(e = null, t, n) {\n return t = ye.from(t), this.checkContent(t), new gn(this, this.computeAttrs(e), t, Gt.setFrom(n));\n }\n /**\n Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is\n necessary to add nodes to the start or end of the given fragment\n to make it fit the node. If no fitting wrapping can be found,\n return null. Note that, due to the fact that required nodes can\n always be created, this will always succeed if you pass null or\n `Fragment.empty` as content.\n */\n createAndFill(e = null, t, n) {\n if (e = this.computeAttrs(e), t = ye.from(t), t.size) {\n let i = this.contentMatch.fillBefore(t);\n if (!i)\n return null;\n t = i.append(t);\n }\n let s = this.contentMatch.matchFragment(t), o = s && s.fillBefore(ye.empty, !0);\n return o ? new gn(this, e, t.append(o), Gt.setFrom(n)) : null;\n }\n /**\n Returns true if the given fragment is valid content for this node\n type.\n */\n validContent(e) {\n let t = this.contentMatch.matchFragment(e);\n if (!t || !t.validEnd)\n return !1;\n for (let n = 0; n < e.childCount; n++)\n if (!this.allowsMarks(e.child(n).marks))\n return !1;\n return !0;\n }\n /**\n Throws a RangeError if the given fragment is not valid content for this\n node type.\n @internal\n */\n checkContent(e) {\n if (!this.validContent(e))\n throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0, 50)}`);\n }\n /**\n @internal\n */\n checkAttrs(e) {\n tp(this.attrs, e, \"node\", this.name);\n }\n /**\n Check whether the given mark type is allowed in this node.\n */\n allowsMarkType(e) {\n return this.markSet == null || this.markSet.indexOf(e) > -1;\n }\n /**\n Test whether the given set of marks are allowed in this node.\n */\n allowsMarks(e) {\n if (this.markSet == null)\n return !0;\n for (let t = 0; t < e.length; t++)\n if (!this.allowsMarkType(e[t].type))\n return !1;\n return !0;\n }\n /**\n Removes the marks that are not allowed in this node from the given set.\n */\n allowedMarks(e) {\n if (this.markSet == null)\n return e;\n let t;\n for (let n = 0; n < e.length; n++)\n this.allowsMarkType(e[n].type) ? t && t.push(e[n]) : t || (t = e.slice(0, n));\n return t ? t.length ? t : Gt.none : e;\n }\n /**\n @internal\n */\n static compile(e, t) {\n let n = /* @__PURE__ */ Object.create(null);\n e.forEach((o, i) => n[o] = new np(o, t, i));\n let s = t.spec.topNode || \"doc\";\n if (!n[s])\n throw new RangeError(\"Schema is missing its top node type ('\" + s + \"')\");\n if (!n.text)\n throw new RangeError(\"Every schema needs a 'text' type\");\n for (let o in n.text.attrs)\n throw new RangeError(\"The text node type should not have attributes\");\n return n;\n }\n};\nfunction kb(r, e, t) {\n let n = t.split(\"|\");\n return (s) => {\n let o = s === null ? \"null\" : typeof s;\n if (n.indexOf(o) < 0)\n throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${o}`);\n };\n}\nclass Cb {\n constructor(e, t, n) {\n this.hasDefault = Object.prototype.hasOwnProperty.call(n, \"default\"), this.default = n.default, this.validate = typeof n.validate == \"string\" ? kb(e, t, n.validate) : n.validate;\n }\n get isRequired() {\n return !this.hasDefault;\n }\n}\nclass _a {\n /**\n @internal\n */\n constructor(e, t, n, s) {\n this.name = e, this.rank = t, this.schema = n, this.spec = s, this.attrs = rp(e, s.attrs), this.excluded = null;\n let o = Zf(this.attrs);\n this.instance = o ? new Gt(this, o) : null;\n }\n /**\n Create a mark of this type. `attrs` may be `null` or an object\n containing only some of the mark's attributes. The others, if\n they have defaults, will be added.\n */\n create(e = null) {\n return !e && this.instance ? this.instance : new Gt(this, ep(this.attrs, e));\n }\n /**\n @internal\n */\n static compile(e, t) {\n let n = /* @__PURE__ */ Object.create(null), s = 0;\n return e.forEach((o, i) => n[o] = new _a(o, s++, t, i)), n;\n }\n /**\n When there is a mark of this type in the given set, a new set\n without it is returned. Otherwise, the input set is returned.\n */\n removeFromSet(e) {\n for (var t = 0; t < e.length; t++)\n e[t].type == this && (e = e.slice(0, t).concat(e.slice(t + 1)), t--);\n return e;\n }\n /**\n Tests whether there is a mark of this type in the given set.\n */\n isInSet(e) {\n for (let t = 0; t < e.length; t++)\n if (e[t].type == this)\n return e[t];\n }\n /**\n @internal\n */\n checkAttrs(e) {\n tp(this.attrs, e, \"mark\", this.name);\n }\n /**\n Queries whether a given mark type is\n [excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.\n */\n excludes(e) {\n return this.excluded.indexOf(e) > -1;\n }\n}\nclass sp {\n /**\n Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).\n */\n constructor(e) {\n this.linebreakReplacement = null, this.cached = /* @__PURE__ */ Object.create(null);\n let t = this.spec = {};\n for (let s in e)\n t[s] = e[s];\n t.nodes = Ir.from(e.nodes), t.marks = Ir.from(e.marks || {}), this.nodes = qd.compile(this.spec.nodes, this), this.marks = _a.compile(this.spec.marks, this);\n let n = /* @__PURE__ */ Object.create(null);\n for (let s in this.nodes) {\n if (s in this.marks)\n throw new RangeError(s + \" can not be both a node and a mark\");\n let o = this.nodes[s], i = o.spec.content || \"\", a = o.spec.marks;\n if (o.contentMatch = n[i] || (n[i] = Ps.parse(i, this.nodes)), o.inlineContent = o.contentMatch.inlineContent, o.spec.linebreakReplacement) {\n if (this.linebreakReplacement)\n throw new RangeError(\"Multiple linebreak nodes defined\");\n if (!o.isInline || !o.isLeaf)\n throw new RangeError(\"Linebreak replacement nodes must be inline leaf nodes\");\n this.linebreakReplacement = o;\n }\n o.markSet = a == \"_\" ? null : a ? Vd(this, a.split(\" \")) : a == \"\" || !o.inlineContent ? [] : null;\n }\n for (let s in this.marks) {\n let o = this.marks[s], i = o.spec.excludes;\n o.excluded = i == null ? [o] : i == \"\" ? [] : Vd(this, i.split(\" \"));\n }\n this.nodeFromJSON = (s) => gn.fromJSON(this, s), this.markFromJSON = (s) => Gt.fromJSON(this, s), this.topNodeType = this.nodes[this.spec.topNode || \"doc\"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);\n }\n /**\n Create a node in this schema. The `type` may be a string or a\n `NodeType` instance. Attributes will be extended with defaults,\n `content` may be a `Fragment`, `null`, a `Node`, or an array of\n nodes.\n */\n node(e, t = null, n, s) {\n if (typeof e == \"string\")\n e = this.nodeType(e);\n else if (e instanceof qd) {\n if (e.schema != this)\n throw new RangeError(\"Node type from different schema used (\" + e.name + \")\");\n } else throw new RangeError(\"Invalid node type: \" + e);\n return e.createChecked(t, n, s);\n }\n /**\n Create a text node in the schema. Empty text nodes are not\n allowed.\n */\n text(e, t) {\n let n = this.nodes.text;\n return new Ri(n, n.defaultAttrs, e, Gt.setFrom(t));\n }\n /**\n Create a mark with the given type and attributes.\n */\n mark(e, t) {\n return typeof e == \"string\" && (e = this.marks[e]), e.create(t);\n }\n /**\n @internal\n */\n nodeType(e) {\n let t = this.nodes[e];\n if (!t)\n throw new RangeError(\"Unknown node type: \" + e);\n return t;\n }\n}\nfunction Vd(r, e) {\n let t = [];\n for (let n = 0; n < e.length; n++) {\n let s = e[n], o = r.marks[s], i = o;\n if (o)\n t.push(o);\n else\n for (let a in r.marks) {\n let l = r.marks[a];\n (s == \"_\" || l.spec.group && l.spec.group.split(\" \").indexOf(s) > -1) && t.push(i = l);\n }\n if (!i)\n throw new SyntaxError(\"Unknown mark type: '\" + e[n] + \"'\");\n }\n return t;\n}\nfunction _b(r) {\n return r.tag != null;\n}\nfunction Sb(r) {\n return r.style != null;\n}\nlet wo = class Pl {\n /**\n Create a parser that targets the given schema, using the given\n parsing rules.\n */\n constructor(e, t) {\n this.schema = e, this.rules = t, this.tags = [], this.styles = [];\n let n = this.matchedStyles = [];\n t.forEach((s) => {\n if (_b(s))\n this.tags.push(s);\n else if (Sb(s)) {\n let o = /[^=]*/.exec(s.style)[0];\n n.indexOf(o) < 0 && n.push(o), this.styles.push(s);\n }\n }), this.normalizeLists = !this.tags.some((s) => {\n if (!/^(ul|ol)\\b/.test(s.tag) || !s.node)\n return !1;\n let o = e.nodes[s.node];\n return o.contentMatch.matchType(o);\n });\n }\n /**\n Parse a document from the content of a DOM node.\n */\n parse(e, t = {}) {\n let n = new Ud(this, t, !1);\n return n.addAll(e, Gt.none, t.from, t.to), n.finish();\n }\n /**\n Parses the content of the given DOM node, like\n [`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of\n options. But unlike that method, which produces a whole node,\n this one returns a slice that is open at the sides, meaning that\n the schema constraints aren't applied to the start of nodes to\n the left of the input and the end of nodes at the end.\n */\n parseSlice(e, t = {}) {\n let n = new Ud(this, t, !0);\n return n.addAll(e, Gt.none, t.from, t.to), De.maxOpen(n.finish());\n }\n /**\n @internal\n */\n matchTag(e, t, n) {\n for (let s = n ? this.tags.indexOf(n) + 1 : 0; s < this.tags.length; s++) {\n let o = this.tags[s];\n if (Mb(e, o.tag) && (o.namespace === void 0 || e.namespaceURI == o.namespace) && (!o.context || t.matchesContext(o.context))) {\n if (o.getAttrs) {\n let i = o.getAttrs(e);\n if (i === !1)\n continue;\n o.attrs = i || void 0;\n }\n return o;\n }\n }\n }\n /**\n @internal\n */\n matchStyle(e, t, n, s) {\n for (let o = s ? this.styles.indexOf(s) + 1 : 0; o < this.styles.length; o++) {\n let i = this.styles[o], a = i.style;\n if (!(a.indexOf(e) != 0 || i.context && !n.matchesContext(i.context) || // Test that the style string either precisely matches the prop,\n // or has an '=' sign after the prop, followed by the given\n // value.\n a.length > e.length && (a.charCodeAt(e.length) != 61 || a.slice(e.length + 1) != t))) {\n if (i.getAttrs) {\n let l = i.getAttrs(t);\n if (l === !1)\n continue;\n i.attrs = l || void 0;\n }\n return i;\n }\n }\n }\n /**\n @internal\n */\n static schemaRules(e) {\n let t = [];\n function n(s) {\n let o = s.priority == null ? 50 : s.priority, i = 0;\n for (; i < t.length; i++) {\n let a = t[i];\n if ((a.priority == null ? 50 : a.priority) < o)\n break;\n }\n t.splice(i, 0, s);\n }\n for (let s in e.marks) {\n let o = e.marks[s].spec.parseDOM;\n o && o.forEach((i) => {\n n(i = Jd(i)), i.mark || i.ignore || i.clearMark || (i.mark = s);\n });\n }\n for (let s in e.nodes) {\n let o = e.nodes[s].spec.parseDOM;\n o && o.forEach((i) => {\n n(i = Jd(i)), i.node || i.ignore || i.mark || (i.node = s);\n });\n }\n return t;\n }\n /**\n Construct a DOM parser using the parsing rules listed in a\n schema's [node specs](https://prosemirror.net/docs/ref/#model.NodeSpec.parseDOM), reordered by\n [priority](https://prosemirror.net/docs/ref/#model.GenericParseRule.priority).\n */\n static fromSchema(e) {\n return e.cached.domParser || (e.cached.domParser = new Pl(e, Pl.schemaRules(e)));\n }\n};\nconst op = {\n address: !0,\n article: !0,\n aside: !0,\n blockquote: !0,\n canvas: !0,\n dd: !0,\n div: !0,\n dl: !0,\n fieldset: !0,\n figcaption: !0,\n figure: !0,\n footer: !0,\n form: !0,\n h1: !0,\n h2: !0,\n h3: !0,\n h4: !0,\n h5: !0,\n h6: !0,\n header: !0,\n hgroup: !0,\n hr: !0,\n li: !0,\n noscript: !0,\n ol: !0,\n output: !0,\n p: !0,\n pre: !0,\n section: !0,\n table: !0,\n tfoot: !0,\n ul: !0\n}, Eb = {\n head: !0,\n noscript: !0,\n object: !0,\n script: !0,\n style: !0,\n title: !0\n}, ip = { ol: !0, ul: !0 }, Ro = 1, Nl = 2, ko = 4;\nfunction Wd(r, e, t) {\n return e != null ? (e ? Ro : 0) | (e === \"full\" ? Nl : 0) : r && r.whitespace == \"pre\" ? Ro | Nl : t & ~ko;\n}\nclass ci {\n constructor(e, t, n, s, o, i) {\n this.type = e, this.attrs = t, this.marks = n, this.solid = s, this.options = i, this.content = [], this.activeMarks = Gt.none, this.match = o || (i & ko ? null : e.contentMatch);\n }\n findWrapping(e) {\n if (!this.match) {\n if (!this.type)\n return [];\n let t = this.type.contentMatch.fillBefore(ye.from(e));\n if (t)\n this.match = this.type.contentMatch.matchFragment(t);\n else {\n let n = this.type.contentMatch, s;\n return (s = n.findWrapping(e.type)) ? (this.match = n, s) : null;\n }\n }\n return this.match.findWrapping(e.type);\n }\n finish(e) {\n if (!(this.options & Ro)) {\n let n = this.content[this.content.length - 1], s;\n if (n && n.isText && (s = /[ \\t\\r\\n\\u000c]+$/.exec(n.text))) {\n let o = n;\n n.text.length == s[0].length ? this.content.pop() : this.content[this.content.length - 1] = o.withText(o.text.slice(0, o.text.length - s[0].length));\n }\n }\n let t = ye.from(this.content);\n return !e && this.match && (t = t.append(this.match.fillBefore(ye.empty, !0))), this.type ? this.type.create(this.attrs, t, this.marks) : t;\n }\n inlineContext(e) {\n return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !op.hasOwnProperty(e.parentNode.nodeName.toLowerCase());\n }\n}\nclass Ud {\n constructor(e, t, n) {\n this.parser = e, this.options = t, this.isOpen = n, this.open = 0, this.localPreserveWS = !1;\n let s = t.topNode, o, i = Wd(null, t.preserveWhitespace, 0) | (n ? ko : 0);\n s ? o = new ci(s.type, s.attrs, Gt.none, !0, t.topMatch || s.type.contentMatch, i) : n ? o = new ci(null, null, Gt.none, !0, null, i) : o = new ci(e.schema.topNodeType, null, Gt.none, !0, null, i), this.nodes = [o], this.find = t.findPositions, this.needsBlock = !1;\n }\n get top() {\n return this.nodes[this.open];\n }\n // Add a DOM node to the content. Text is inserted as text node,\n // otherwise, the node is passed to `addElement` or, if it has a\n // `style` attribute, `addElementWithStyles`.\n addDOM(e, t) {\n e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);\n }\n addTextNode(e, t) {\n let n = e.nodeValue, s = this.top, o = s.options & Nl ? \"full\" : this.localPreserveWS || (s.options & Ro) > 0, { schema: i } = this.parser;\n if (o === \"full\" || s.inlineContext(e) || /[^ \\t\\r\\n\\u000c]/.test(n)) {\n if (o)\n if (o === \"full\")\n n = n.replace(/\\r\\n?/g, `\n`);\n else if (i.linebreakReplacement && /[\\r\\n]/.test(n) && this.top.findWrapping(i.linebreakReplacement.create())) {\n let a = n.split(/\\r?\\n|\\r/);\n for (let l = 0; l < a.length; l++)\n l && this.insertNode(i.linebreakReplacement.create(), t, !0), a[l] && this.insertNode(i.text(a[l]), t, !/\\S/.test(a[l]));\n n = \"\";\n } else\n n = n.replace(/\\r?\\n|\\r/g, \" \");\n else if (n = n.replace(/[ \\t\\r\\n\\u000c]+/g, \" \"), /^[ \\t\\r\\n\\u000c]/.test(n) && this.open == this.nodes.length - 1) {\n let a = s.content[s.content.length - 1], l = e.previousSibling;\n (!a || l && l.nodeName == \"BR\" || a.isText && /[ \\t\\r\\n\\u000c]$/.test(a.text)) && (n = n.slice(1));\n }\n n && this.insertNode(i.text(n), t, !/\\S/.test(n)), this.findInText(e);\n } else\n this.findInside(e);\n }\n // Try to find a handler for the given tag and use that to parse. If\n // none is found, the element's content nodes are added directly.\n addElement(e, t, n) {\n let s = this.localPreserveWS, o = this.top;\n (e.tagName == \"PRE\" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);\n let i = e.nodeName.toLowerCase(), a;\n ip.hasOwnProperty(i) && this.parser.normalizeLists && Tb(e);\n let l = this.options.ruleFromNode && this.options.ruleFromNode(e) || (a = this.parser.matchTag(e, this, n));\n e: if (l ? l.ignore : Eb.hasOwnProperty(i))\n this.findInside(e), this.ignoreFallback(e, t);\n else if (!l || l.skip || l.closeParent) {\n l && l.closeParent ? this.open = Math.max(0, this.open - 1) : l && l.skip.nodeType && (e = l.skip);\n let d, u = this.needsBlock;\n if (op.hasOwnProperty(i))\n o.content.length && o.content[0].isInline && this.open && (this.open--, o = this.top), d = !0, o.type || (this.needsBlock = !0);\n else if (!e.firstChild) {\n this.leafFallback(e, t);\n break e;\n }\n let f = l && l.skip ? t : this.readStyles(e, t);\n f && this.addAll(e, f), d && this.sync(o), this.needsBlock = u;\n } else {\n let d = this.readStyles(e, t);\n d && this.addElementByRule(e, l, d, l.consuming === !1 ? a : void 0);\n }\n this.localPreserveWS = s;\n }\n // Called for leaf DOM nodes that would otherwise be ignored\n leafFallback(e, t) {\n e.nodeName == \"BR\" && this.top.type && this.top.type.inlineContent && this.addTextNode(e.ownerDocument.createTextNode(`\n`), t);\n }\n // Called for ignored nodes\n ignoreFallback(e, t) {\n e.nodeName == \"BR\" && (!this.top.type || !this.top.type.inlineContent) && this.findPlace(this.parser.schema.text(\"-\"), t, !0);\n }\n // Run any style parser associated with the node's styles. Either\n // return an updated array of marks, or null to indicate some of the\n // styles had a rule with `ignore` set.\n readStyles(e, t) {\n let n = e.style;\n if (n && n.length)\n for (let s = 0; s < this.parser.matchedStyles.length; s++) {\n let o = this.parser.matchedStyles[s], i = n.getPropertyValue(o);\n if (i)\n for (let a = void 0; ; ) {\n let l = this.parser.matchStyle(o, i, this, a);\n if (!l)\n break;\n if (l.ignore)\n return null;\n if (l.clearMark ? t = t.filter((d) => !l.clearMark(d)) : t = t.concat(this.parser.schema.marks[l.mark].create(l.attrs)), l.consuming === !1)\n a = l;\n else\n break;\n }\n }\n return t;\n }\n // Look up a handler for the given node. If none are found, return\n // false. Otherwise, apply it, use its return value to drive the way\n // the node's content is wrapped, and return true.\n addElementByRule(e, t, n, s) {\n let o, i;\n if (t.node)\n if (i = this.parser.schema.nodes[t.node], i.isLeaf)\n this.insertNode(i.create(t.attrs), n, e.nodeName == \"BR\") || this.leafFallback(e, n);\n else {\n let l = this.enter(i, t.attrs || null, n, t.preserveWhitespace);\n l && (o = !0, n = l);\n }\n else {\n let l = this.parser.schema.marks[t.mark];\n n = n.concat(l.create(t.attrs));\n }\n let a = this.top;\n if (i && i.isLeaf)\n this.findInside(e);\n else if (s)\n this.addElement(e, n, s);\n else if (t.getContent)\n this.findInside(e), t.getContent(e, this.parser.schema).forEach((l) => this.insertNode(l, n, !1));\n else {\n let l = e;\n typeof t.contentElement == \"string\" ? l = e.querySelector(t.contentElement) : typeof t.contentElement == \"function\" ? l = t.contentElement(e) : t.contentElement && (l = t.contentElement), this.findAround(e, l, !0), this.addAll(l, n), this.findAround(e, l, !1);\n }\n o && this.sync(a) && this.open--;\n }\n // Add all child nodes between `startIndex` and `endIndex` (or the\n // whole node, if not given). If `sync` is passed, use it to\n // synchronize after every block element.\n addAll(e, t, n, s) {\n let o = n || 0;\n for (let i = n ? e.childNodes[n] : e.firstChild, a = s == null ? null : e.childNodes[s]; i != a; i = i.nextSibling, ++o)\n this.findAtPoint(e, o), this.addDOM(i, t);\n this.findAtPoint(e, o);\n }\n // Try to find a way to fit the given node type into the current\n // context. May add intermediate wrappers and/or leave non-solid\n // nodes that we're in.\n findPlace(e, t, n) {\n let s, o;\n for (let i = this.open, a = 0; i >= 0; i--) {\n let l = this.nodes[i], d = l.findWrapping(e);\n if (d && (!s || s.length > d.length + a) && (s = d, o = l, !d.length))\n break;\n if (l.solid) {\n if (n)\n break;\n a += 2;\n }\n }\n if (!s)\n return null;\n this.sync(o);\n for (let i = 0; i < s.length; i++)\n t = this.enterInner(s[i], null, t, !1);\n return t;\n }\n // Try to insert the given node, adjusting the context when needed.\n insertNode(e, t, n) {\n if (e.isInline && this.needsBlock && !this.top.type) {\n let o = this.textblockFromContext();\n o && (t = this.enterInner(o, null, t));\n }\n let s = this.findPlace(e, t, n);\n if (s) {\n this.closeExtra();\n let o = this.top;\n o.match && (o.match = o.match.matchType(e.type));\n let i = Gt.none;\n for (let a of s.concat(e.marks))\n (o.type ? o.type.allowsMarkType(a.type) : Kd(a.type, e.type)) && (i = a.addToSet(i));\n return o.content.push(e.mark(i)), !0;\n }\n return !1;\n }\n // Try to start a node of the given type, adjusting the context when\n // necessary.\n enter(e, t, n, s) {\n let o = this.findPlace(e.create(t), n, !1);\n return o && (o = this.enterInner(e, t, n, !0, s)), o;\n }\n // Open a node of the given type\n enterInner(e, t, n, s = !1, o) {\n this.closeExtra();\n let i = this.top;\n i.match = i.match && i.match.matchType(e);\n let a = Wd(e, o, i.options);\n i.options & ko && i.content.length == 0 && (a |= ko);\n let l = Gt.none;\n return n = n.filter((d) => (i.type ? i.type.allowsMarkType(d.type) : Kd(d.type, e)) ? (l = d.addToSet(l), !1) : !0), this.nodes.push(new ci(e, t, l, s, null, a)), this.open++, n;\n }\n // Make sure all nodes above this.open are finished and added to\n // their parents\n closeExtra(e = !1) {\n let t = this.nodes.length - 1;\n if (t > this.open) {\n for (; t > this.open; t--)\n this.nodes[t - 1].content.push(this.nodes[t].finish(e));\n this.nodes.length = this.open + 1;\n }\n }\n finish() {\n return this.open = 0, this.closeExtra(this.isOpen), this.nodes[0].finish(!!(this.isOpen || this.options.topOpen));\n }\n sync(e) {\n for (let t = this.open; t >= 0; t--) {\n if (this.nodes[t] == e)\n return this.open = t, !0;\n this.localPreserveWS && (this.nodes[t].options |= Ro);\n }\n return !1;\n }\n get currentPos() {\n this.closeExtra();\n let e = 0;\n for (let t = this.open; t >= 0; t--) {\n let n = this.nodes[t].content;\n for (let s = n.length - 1; s >= 0; s--)\n e += n[s].nodeSize;\n t && e++;\n }\n return e;\n }\n findAtPoint(e, t) {\n if (this.find)\n for (let n = 0; n < this.find.length; n++)\n this.find[n].node == e && this.find[n].offset == t && (this.find[n].pos = this.currentPos);\n }\n findInside(e) {\n if (this.find)\n for (let t = 0; t < this.find.length; t++)\n this.find[t].pos == null && e.nodeType == 1 && e.contains(this.find[t].node) && (this.find[t].pos = this.currentPos);\n }\n findAround(e, t, n) {\n if (e != t && this.find)\n for (let s = 0; s < this.find.length; s++)\n this.find[s].pos == null && e.nodeType == 1 && e.contains(this.find[s].node) && t.compareDocumentPosition(this.find[s].node) & (n ? 2 : 4) && (this.find[s].pos = this.currentPos);\n }\n findInText(e) {\n if (this.find)\n for (let t = 0; t < this.find.length; t++)\n this.find[t].node == e && (this.find[t].pos = this.currentPos - (e.nodeValue.length - this.find[t].offset));\n }\n // Determines whether the given context string matches this context.\n matchesContext(e) {\n if (e.indexOf(\"|\") > -1)\n return e.split(/\\s*\\|\\s*/).some(this.matchesContext, this);\n let t = e.split(\"/\"), n = this.options.context, s = !this.isOpen && (!n || n.parent.type == this.nodes[0].type), o = -(n ? n.depth + 1 : 0) + (s ? 0 : 1), i = (a, l) => {\n for (; a >= 0; a--) {\n let d = t[a];\n if (d == \"\") {\n if (a == t.length - 1 || a == 0)\n continue;\n for (; l >= o; l--)\n if (i(a - 1, l))\n return !0;\n return !1;\n } else {\n let u = l > 0 || l == 0 && s ? this.nodes[l].type : n && l >= o ? n.node(l - o).type : null;\n if (!u || u.name != d && !u.isInGroup(d))\n return !1;\n l--;\n }\n }\n return !0;\n };\n return i(t.length - 1, this.open);\n }\n textblockFromContext() {\n let e = this.options.context;\n if (e)\n for (let t = e.depth; t >= 0; t--) {\n let n = e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;\n if (n && n.isTextblock && n.defaultAttrs)\n return n;\n }\n for (let t in this.parser.schema.nodes) {\n let n = this.parser.schema.nodes[t];\n if (n.isTextblock && n.defaultAttrs)\n return n;\n }\n }\n}\nfunction Tb(r) {\n for (let e = r.firstChild, t = null; e; e = e.nextSibling) {\n let n = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;\n n && ip.hasOwnProperty(n) && t ? (t.appendChild(e), e = t) : n == \"li\" ? t = e : n && (t = null);\n }\n}\nfunction Mb(r, e) {\n return (r.matches || r.msMatchesSelector || r.webkitMatchesSelector || r.mozMatchesSelector).call(r, e);\n}\nfunction Jd(r) {\n let e = {};\n for (let t in r)\n e[t] = r[t];\n return e;\n}\nfunction Kd(r, e) {\n let t = e.schema.nodes;\n for (let n in t) {\n let s = t[n];\n if (!s.allowsMarkType(r))\n continue;\n let o = [], i = (a) => {\n o.push(a);\n for (let l = 0; l < a.edgeCount; l++) {\n let { type: d, next: u } = a.edge(l);\n if (d == e || o.indexOf(u) < 0 && i(u))\n return !0;\n }\n };\n if (i(s.contentMatch))\n return !0;\n }\n}\nclass Is {\n /**\n Create a serializer. `nodes` should map node names to functions\n that take a node and return a description of the corresponding\n DOM. `marks` does the same for mark names, but also gets an\n argument that tells it whether the mark's content is block or\n inline content (for typical use, it'll always be inline). A mark\n serializer may be `null` to indicate that marks of that type\n should not be serialized.\n */\n constructor(e, t) {\n this.nodes = e, this.marks = t;\n }\n /**\n Serialize the content of this fragment to a DOM fragment. When\n not in the browser, the `document` option, containing a DOM\n document, should be passed so that the serializer can create\n nodes.\n */\n serializeFragment(e, t = {}, n) {\n n || (n = Xa(t).createDocumentFragment());\n let s = n, o = [];\n return e.forEach((i) => {\n if (o.length || i.marks.length) {\n let a = 0, l = 0;\n for (; a < o.length && l < i.marks.length; ) {\n let d = i.marks[l];\n if (!this.marks[d.type.name]) {\n l++;\n continue;\n }\n if (!d.eq(o[a][0]) || d.type.spec.spanning === !1)\n break;\n a++, l++;\n }\n for (; a < o.length; )\n s = o.pop()[1];\n for (; l < i.marks.length; ) {\n let d = i.marks[l++], u = this.serializeMark(d, i.isInline, t);\n u && (o.push([d, s]), s.appendChild(u.dom), s = u.contentDOM || u.dom);\n }\n }\n s.appendChild(this.serializeNodeInner(i, t));\n }), n;\n }\n /**\n @internal\n */\n serializeNodeInner(e, t) {\n let { dom: n, contentDOM: s } = Ci(Xa(t), this.nodes[e.type.name](e), null, e.attrs);\n if (s) {\n if (e.isLeaf)\n throw new RangeError(\"Content hole not allowed in a leaf node spec\");\n this.serializeFragment(e.content, t, s);\n }\n return n;\n }\n /**\n Serialize this node to a DOM node. This can be useful when you\n need to serialize a part of a document, as opposed to the whole\n document. To serialize a whole document, use\n [`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on\n its [content](https://prosemirror.net/docs/ref/#model.Node.content).\n */\n serializeNode(e, t = {}) {\n let n = this.serializeNodeInner(e, t);\n for (let s = e.marks.length - 1; s >= 0; s--) {\n let o = this.serializeMark(e.marks[s], e.isInline, t);\n o && ((o.contentDOM || o.dom).appendChild(n), n = o.dom);\n }\n return n;\n }\n /**\n @internal\n */\n serializeMark(e, t, n = {}) {\n let s = this.marks[e.type.name];\n return s && Ci(Xa(n), s(e, t), null, e.attrs);\n }\n static renderSpec(e, t, n = null, s) {\n return Ci(e, t, n, s);\n }\n /**\n Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)\n properties in a schema's node and mark specs.\n */\n static fromSchema(e) {\n return e.cached.domSerializer || (e.cached.domSerializer = new Is(this.nodesFromSchema(e), this.marksFromSchema(e)));\n }\n /**\n Gather the serializers in a schema's node specs into an object.\n This can be useful as a base to build a custom serializer from.\n */\n static nodesFromSchema(e) {\n let t = Gd(e.nodes);\n return t.text || (t.text = (n) => n.text), t;\n }\n /**\n Gather the serializers in a schema's mark specs into an object.\n */\n static marksFromSchema(e) {\n return Gd(e.marks);\n }\n}\nfunction Gd(r) {\n let e = {};\n for (let t in r) {\n let n = r[t].spec.toDOM;\n n && (e[t] = n);\n }\n return e;\n}\nfunction Xa(r) {\n return r.document || window.document;\n}\nconst Yd = /* @__PURE__ */ new WeakMap();\nfunction Ab(r) {\n let e = Yd.get(r);\n return e === void 0 && Yd.set(r, e = Pb(r)), e;\n}\nfunction Pb(r) {\n let e = null;\n function t(n) {\n if (n && typeof n == \"object\")\n if (Array.isArray(n))\n if (typeof n[0] == \"string\")\n e || (e = []), e.push(n);\n else\n for (let s = 0; s < n.length; s++)\n t(n[s]);\n else\n for (let s in n)\n t(n[s]);\n }\n return t(r), e;\n}\nfunction Ci(r, e, t, n) {\n if (typeof e == \"string\")\n return { dom: r.createTextNode(e) };\n if (e.nodeType != null)\n return { dom: e };\n if (e.dom && e.dom.nodeType != null)\n return e;\n let s = e[0], o;\n if (typeof s != \"string\")\n throw new RangeError(\"Invalid array passed to renderSpec\");\n if (n && (o = Ab(n)) && o.indexOf(e) > -1)\n throw new RangeError(\"Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.\");\n let i = s.indexOf(\" \");\n i > 0 && (t = s.slice(0, i), s = s.slice(i + 1));\n let a, l = t ? r.createElementNS(t, s) : r.createElement(s), d = e[1], u = 1;\n if (d && typeof d == \"object\" && d.nodeType == null && !Array.isArray(d)) {\n u = 2;\n for (let f in d)\n if (d[f] != null) {\n let h = f.indexOf(\" \");\n h > 0 ? l.setAttributeNS(f.slice(0, h), f.slice(h + 1), d[f]) : f == \"style\" && l.style ? l.style.cssText = d[f] : l.setAttribute(f, d[f]);\n }\n }\n for (let f = u; f < e.length; f++) {\n let h = e[f];\n if (h === 0) {\n if (f < e.length - 1 || f > u)\n throw new RangeError(\"Content hole must be the only child of its parent node\");\n return { dom: l, contentDOM: l };\n } else {\n let { dom: p, contentDOM: g } = Ci(r, h, t, n);\n if (l.appendChild(p), g) {\n if (a)\n throw new RangeError(\"Multiple content holes\");\n a = g;\n }\n }\n }\n return { dom: l, contentDOM: a };\n}\nconst ap = 65535, lp = Math.pow(2, 16);\nfunction Nb(r, e) {\n return r + e * lp;\n}\nfunction Xd(r) {\n return r & ap;\n}\nfunction Ob(r) {\n return (r - (r & ap)) / lp;\n}\nconst cp = 1, dp = 2, _i = 4, up = 8;\nclass Ol {\n /**\n @internal\n */\n constructor(e, t, n) {\n this.pos = e, this.delInfo = t, this.recover = n;\n }\n /**\n Tells you whether the position was deleted, that is, whether the\n step removed the token on the side queried (via the `assoc`)\n argument from the document.\n */\n get deleted() {\n return (this.delInfo & up) > 0;\n }\n /**\n Tells you whether the token before the mapped position was deleted.\n */\n get deletedBefore() {\n return (this.delInfo & (cp | _i)) > 0;\n }\n /**\n True when the token after the mapped position was deleted.\n */\n get deletedAfter() {\n return (this.delInfo & (dp | _i)) > 0;\n }\n /**\n Tells whether any of the steps mapped through deletes across the\n position (including both the token before and after the\n position).\n */\n get deletedAcross() {\n return (this.delInfo & _i) > 0;\n }\n}\nclass Qr {\n /**\n Create a position map. The modifications to the document are\n represented as an array of numbers, in which each group of three\n represents a modified chunk as `[start, oldSize, newSize]`.\n */\n constructor(e, t = !1) {\n if (this.ranges = e, this.inverted = t, !e.length && Qr.empty)\n return Qr.empty;\n }\n /**\n @internal\n */\n recover(e) {\n let t = 0, n = Xd(e);\n if (!this.inverted)\n for (let s = 0; s < n; s++)\n t += this.ranges[s * 3 + 2] - this.ranges[s * 3 + 1];\n return this.ranges[n * 3] + t + Ob(e);\n }\n mapResult(e, t = 1) {\n return this._map(e, t, !1);\n }\n map(e, t = 1) {\n return this._map(e, t, !0);\n }\n /**\n @internal\n */\n _map(e, t, n) {\n let s = 0, o = this.inverted ? 2 : 1, i = this.inverted ? 1 : 2;\n for (let a = 0; a < this.ranges.length; a += 3) {\n let l = this.ranges[a] - (this.inverted ? s : 0);\n if (l > e)\n break;\n let d = this.ranges[a + o], u = this.ranges[a + i], f = l + d;\n if (e <= f) {\n let h = d ? e == l ? -1 : e == f ? 1 : t : t, p = l + s + (h < 0 ? 0 : u);\n if (n)\n return p;\n let g = e == (t < 0 ? l : f) ? null : Nb(a / 3, e - l), b = e == l ? dp : e == f ? cp : _i;\n return (t < 0 ? e != l : e != f) && (b |= up), new Ol(p, b, g);\n }\n s += u - d;\n }\n return n ? e + s : new Ol(e + s, 0, null);\n }\n /**\n @internal\n */\n touches(e, t) {\n let n = 0, s = Xd(t), o = this.inverted ? 2 : 1, i = this.inverted ? 1 : 2;\n for (let a = 0; a < this.ranges.length; a += 3) {\n let l = this.ranges[a] - (this.inverted ? n : 0);\n if (l > e)\n break;\n let d = this.ranges[a + o], u = l + d;\n if (e <= u && a == s * 3)\n return !0;\n n += this.ranges[a + i] - d;\n }\n return !1;\n }\n /**\n Calls the given function on each of the changed ranges included in\n this map.\n */\n forEach(e) {\n let t = this.inverted ? 2 : 1, n = this.inverted ? 1 : 2;\n for (let s = 0, o = 0; s < this.ranges.length; s += 3) {\n let i = this.ranges[s], a = i - (this.inverted ? o : 0), l = i + (this.inverted ? 0 : o), d = this.ranges[s + t], u = this.ranges[s + n];\n e(a, a + d, l, l + u), o += u - d;\n }\n }\n /**\n Create an inverted version of this map. The result can be used to\n map positions in the post-step document to the pre-step document.\n */\n invert() {\n return new Qr(this.ranges, !this.inverted);\n }\n /**\n @internal\n */\n toString() {\n return (this.inverted ? \"-\" : \"\") + JSON.stringify(this.ranges);\n }\n /**\n Create a map that moves all positions by offset `n` (which may be\n negative). This can be useful when applying steps meant for a\n sub-document to a larger document, or vice-versa.\n */\n static offset(e) {\n return e == 0 ? Qr.empty : new Qr(e < 0 ? [0, -e, 0] : [0, 0, e]);\n }\n}\nQr.empty = new Qr([]);\nclass jo {\n /**\n Create a new mapping with the given position maps.\n */\n constructor(e, t, n = 0, s = e ? e.length : 0) {\n this.mirror = t, this.from = n, this.to = s, this._maps = e || [], this.ownData = !(e || t);\n }\n /**\n The step maps in this mapping.\n */\n get maps() {\n return this._maps;\n }\n /**\n Create a mapping that maps only through a part of this one.\n */\n slice(e = 0, t = this.maps.length) {\n return new jo(this._maps, this.mirror, e, t);\n }\n /**\n Add a step map to the end of this mapping. If `mirrors` is\n given, it should be the index of the step map that is the mirror\n image of this one.\n */\n appendMap(e, t) {\n this.ownData || (this._maps = this._maps.slice(), this.mirror = this.mirror && this.mirror.slice(), this.ownData = !0), this.to = this._maps.push(e), t != null && this.setMirror(this._maps.length - 1, t);\n }\n /**\n Add all the step maps in a given mapping to this one (preserving\n mirroring information).\n */\n appendMapping(e) {\n for (let t = 0, n = this._maps.length; t < e._maps.length; t++) {\n let s = e.getMirror(t);\n this.appendMap(e._maps[t], s != null && s < t ? n + s : void 0);\n }\n }\n /**\n Finds the offset of the step map that mirrors the map at the\n given offset, in this mapping (as per the second argument to\n `appendMap`).\n */\n getMirror(e) {\n if (this.mirror) {\n for (let t = 0; t < this.mirror.length; t++)\n if (this.mirror[t] == e)\n return this.mirror[t + (t % 2 ? -1 : 1)];\n }\n }\n /**\n @internal\n */\n setMirror(e, t) {\n this.mirror || (this.mirror = []), this.mirror.push(e, t);\n }\n /**\n Append the inverse of the given mapping to this one.\n */\n appendMappingInverted(e) {\n for (let t = e.maps.length - 1, n = this._maps.length + e._maps.length; t >= 0; t--) {\n let s = e.getMirror(t);\n this.appendMap(e._maps[t].invert(), s != null && s > t ? n - s - 1 : void 0);\n }\n }\n /**\n Create an inverted version of this mapping.\n */\n invert() {\n let e = new jo();\n return e.appendMappingInverted(this), e;\n }\n /**\n Map a position through this mapping.\n */\n map(e, t = 1) {\n if (this.mirror)\n return this._map(e, t, !0);\n for (let n = this.from; n < this.to; n++)\n e = this._maps[n].map(e, t);\n return e;\n }\n /**\n Map a position through this mapping, returning a mapping\n result.\n */\n mapResult(e, t = 1) {\n return this._map(e, t, !1);\n }\n /**\n @internal\n */\n _map(e, t, n) {\n let s = 0;\n for (let o = this.from; o < this.to; o++) {\n let i = this._maps[o], a = i.mapResult(e, t);\n if (a.recover != null) {\n let l = this.getMirror(o);\n if (l != null && l > o && l < this.to) {\n o = l, e = this._maps[l].recover(a.recover);\n continue;\n }\n }\n s |= a.delInfo, e = a.pos;\n }\n return n ? e : new Ol(e, s, null);\n }\n}\nconst Qa = /* @__PURE__ */ Object.create(null);\nclass Hr {\n /**\n Get the step map that represents the changes made by this step,\n and which can be used to transform between positions in the old\n and the new document.\n */\n getMap() {\n return Qr.empty;\n }\n /**\n Try to merge this step with another one, to be applied directly\n after it. Returns the merged step when possible, null if the\n steps can't be merged.\n */\n merge(e) {\n return null;\n }\n /**\n Deserialize a step from its JSON representation. Will call\n through to the step class' own implementation of this method.\n */\n static fromJSON(e, t) {\n if (!t || !t.stepType)\n throw new RangeError(\"Invalid input for Step.fromJSON\");\n let n = Qa[t.stepType];\n if (!n)\n throw new RangeError(`No step type ${t.stepType} defined`);\n return n.fromJSON(e, t);\n }\n /**\n To be able to serialize steps to JSON, each step needs a string\n ID to attach to its JSON representation. Use this method to\n register an ID for your step classes. Try to pick something\n that's unlikely to clash with steps from other modules.\n */\n static jsonID(e, t) {\n if (e in Qa)\n throw new RangeError(\"Duplicate use of step JSON ID \" + e);\n return Qa[e] = t, t.prototype.jsonID = e, t;\n }\n}\nclass Cr {\n /**\n @internal\n */\n constructor(e, t) {\n this.doc = e, this.failed = t;\n }\n /**\n Create a successful step result.\n */\n static ok(e) {\n return new Cr(e, null);\n }\n /**\n Create a failed step result.\n */\n static fail(e) {\n return new Cr(null, e);\n }\n /**\n Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given\n arguments. Create a successful result if it succeeds, and a\n failed one if it throws a `ReplaceError`.\n */\n static fromReplace(e, t, n, s) {\n try {\n return Cr.ok(e.replace(t, n, s));\n } catch (o) {\n if (o instanceof $i)\n return Cr.fail(o.message);\n throw o;\n }\n }\n}\nfunction Pc(r, e, t) {\n let n = [];\n for (let s = 0; s < r.childCount; s++) {\n let o = r.child(s);\n o.content.size && (o = o.copy(Pc(o.content, e, o))), o.isInline && (o = e(o, t, s)), n.push(o);\n }\n return ye.fromArray(n);\n}\nclass Zn extends Hr {\n /**\n Create a mark step.\n */\n constructor(e, t, n) {\n super(), this.from = e, this.to = t, this.mark = n;\n }\n apply(e) {\n let t = e.slice(this.from, this.to), n = e.resolve(this.from), s = n.node(n.sharedDepth(this.to)), o = new De(Pc(t.content, (i, a) => !i.isAtom || !a.type.allowsMarkType(this.mark.type) ? i : i.mark(this.mark.addToSet(i.marks)), s), t.openStart, t.openEnd);\n return Cr.fromReplace(e, this.from, this.to, o);\n }\n invert() {\n return new vn(this.from, this.to, this.mark);\n }\n map(e) {\n let t = e.mapResult(this.from, 1), n = e.mapResult(this.to, -1);\n return t.deleted && n.deleted || t.pos >= n.pos ? null : new Zn(t.pos, n.pos, this.mark);\n }\n merge(e) {\n return e instanceof Zn && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new Zn(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;\n }\n toJSON() {\n return {\n stepType: \"addMark\",\n mark: this.mark.toJSON(),\n from: this.from,\n to: this.to\n };\n }\n /**\n @internal\n */\n static fromJSON(e, t) {\n if (typeof t.from != \"number\" || typeof t.to != \"number\")\n throw new RangeError(\"Invalid input for AddMarkStep.fromJSON\");\n return new Zn(t.from, t.to, e.markFromJSON(t.mark));\n }\n}\nHr.jsonID(\"addMark\", Zn);\nclass vn extends Hr {\n /**\n Create a mark-removing step.\n */\n constructor(e, t, n) {\n super(), this.from = e, this.to = t, this.mark = n;\n }\n apply(e) {\n let t = e.slice(this.from, this.to), n = new De(Pc(t.content, (s) => s.mark(this.mark.removeFromSet(s.marks)), e), t.openStart, t.openEnd);\n return Cr.fromReplace(e, this.from, this.to, n);\n }\n invert() {\n return new Zn(this.from, this.to, this.mark);\n }\n map(e) {\n let t = e.mapResult(this.from, 1), n = e.mapResult(this.to, -1);\n return t.deleted && n.deleted || t.pos >= n.pos ? null : new vn(t.pos, n.pos, this.mark);\n }\n merge(e) {\n return e instanceof vn && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new vn(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;\n }\n toJSON() {\n return {\n stepType: \"removeMark\",\n mark: this.mark.toJSON(),\n from: this.from,\n to: this.to\n };\n }\n /**\n @internal\n */\n static fromJSON(e, t) {\n if (typeof t.from != \"number\" || typeof t.to != \"number\")\n throw new RangeError(\"Invalid input for RemoveMarkStep.fromJSON\");\n return new vn(t.from, t.to, e.markFromJSON(t.mark));\n }\n}\nHr.jsonID(\"removeMark\", vn);\nclass es extends Hr {\n /**\n Create a node mark step.\n */\n constructor(e, t) {\n super(), this.pos = e, this.mark = t;\n }\n apply(e) {\n let t = e.nodeAt(this.pos);\n if (!t)\n return Cr.fail(\"No node at mark step's position\");\n let n = t.type.create(t.attrs, null, this.mark.addToSet(t.marks));\n return Cr.fromReplace(e, this.pos, this.pos + 1, new De(ye.from(n), 0, t.isLeaf ? 0 : 1));\n }\n invert(e) {\n let t = e.nodeAt(this.pos);\n if (t) {\n let n = this.mark.addToSet(t.marks);\n if (n.length == t.marks.length) {\n for (let s = 0; s < t.marks.length; s++)\n if (!t.marks[s].isInSet(n))\n return new es(this.pos, t.marks[s]);\n return new es(this.pos, this.mark);\n }\n }\n return new Ns(this.pos, this.mark);\n }\n map(e) {\n let t = e.mapResult(this.pos, 1);\n return t.deletedAfter ? null : new es(t.pos, this.mark);\n }\n toJSON() {\n return { stepType: \"addNodeMark\", pos: this.pos, mark: this.mark.toJSON() };\n }\n /**\n @internal\n */\n static fromJSON(e, t) {\n if (typeof t.pos != \"number\")\n throw new RangeError(\"Invalid input for AddNodeMarkStep.fromJSON\");\n return new es(t.pos, e.markFromJSON(t.mark));\n }\n}\nHr.jsonID(\"addNodeMark\", es);\nclass Ns extends Hr {\n /**\n Create a mark-removing step.\n */\n constructor(e, t) {\n super(), this.pos = e, this.mark = t;\n }\n apply(e) {\n let t = e.nodeAt(this.pos);\n if (!t)\n return Cr.fail(\"No node at mark step's position\");\n let n = t.type.create(t.attrs, null, this.mark.removeFromSet(t.marks));\n return Cr.fromReplace(e, this.pos, this.pos + 1, new De(ye.from(n), 0, t.isLeaf ? 0 : 1));\n }\n invert(e) {\n let t = e.nodeAt(this.pos);\n return !t || !this.mark.isInSet(t.marks) ? this : new es(this.pos, this.mark);\n }\n map(e) {\n let t = e.mapResult(this.pos, 1);\n return t.deletedAfter ? null : new Ns(t.pos, this.mark);\n }\n toJSON() {\n return { stepType: \"removeNodeMark\", pos: this.pos, mark: this.mark.toJSON() };\n }\n /**\n @internal\n */\n static fromJSON(e, t) {\n if (typeof t.pos != \"number\")\n throw new RangeError(\"Invalid input for RemoveNodeMarkStep.fromJSON\");\n return new Ns(t.pos, e.markFromJSON(t.mark));\n }\n}\nHr.jsonID(\"removeNodeMark\", Ns);\nclass wr extends Hr {\n /**\n The given `slice` should fit the 'gap' between `from` and\n `to`\u2014the depths must line up, and the surrounding nodes must be\n able to be joined with the open sides of the slice. When\n `structure` is true, the step will fail if the content between\n from and to is not just a sequence of closing and then opening\n tokens (this is to guard against rebased replace steps\n overwriting something they weren't supposed to).\n */\n constructor(e, t, n, s = !1) {\n super(), this.from = e, this.to = t, this.slice = n, this.structure = s;\n }\n apply(e) {\n return this.structure && $l(e, this.from, this.to) ? Cr.fail(\"Structure replace would overwrite content\") : Cr.fromReplace(e, this.from, this.to, this.slice);\n }\n getMap() {\n return new Qr([this.from, this.to - this.from, this.slice.size]);\n }\n invert(e) {\n return new wr(this.from, this.from + this.slice.size, e.slice(this.from, this.to));\n }\n map(e) {\n let t = e.mapResult(this.to, -1), n = this.from == this.to && wr.MAP_BIAS < 0 ? t : e.mapResult(this.from, 1);\n return n.deletedAcross && t.deletedAcross ? null : new wr(n.pos, Math.max(n.pos, t.pos), this.slice, this.structure);\n }\n merge(e) {\n if (!(e instanceof wr) || e.structure || this.structure)\n return null;\n if (this.from + this.slice.size == e.from && !this.slice.openEnd && !e.slice.openStart) {\n let t = this.slice.size + e.slice.size == 0 ? De.empty : new De(this.slice.content.append(e.slice.content), this.slice.openStart, e.slice.openEnd);\n return new wr(this.from, this.to + (e.to - e.from), t, this.structure);\n } else if (e.to == this.from && !this.slice.openStart && !e.slice.openEnd) {\n let t = this.slice.size + e.slice.size == 0 ? De.empty : new De(e.slice.content.append(this.slice.content), e.slice.openStart, this.slice.openEnd);\n return new wr(e.from, this.to, t, this.structure);\n } else\n return null;\n }\n toJSON() {\n let e = { stepType: \"replace\", from: this.from, to: this.to };\n return this.slice.size && (e.slice = this.slice.toJSON()), this.structure && (e.structure = !0), e;\n }\n /**\n @internal\n */\n static fromJSON(e, t) {\n if (typeof t.from != \"number\" || typeof t.to != \"number\")\n throw new RangeError(\"Invalid input for ReplaceStep.fromJSON\");\n return new wr(t.from, t.to, De.fromJSON(e, t.slice), !!t.structure);\n }\n}\nwr.MAP_BIAS = 1;\nHr.jsonID(\"replace\", wr);\nclass Pr extends Hr {\n /**\n Create a replace-around step with the given range and gap.\n `insert` should be the point in the slice into which the content\n of the gap should be moved. `structure` has the same meaning as\n it has in the [`ReplaceStep`](https://prosemirror.net/docs/ref/#transform.ReplaceStep) class.\n */\n constructor(e, t, n, s, o, i, a = !1) {\n super(), this.from = e, this.to = t, this.gapFrom = n, this.gapTo = s, this.slice = o, this.insert = i, this.structure = a;\n }\n apply(e) {\n if (this.structure && ($l(e, this.from, this.gapFrom) || $l(e, this.gapTo, this.to)))\n return Cr.fail(\"Structure gap-replace would overwrite content\");\n let t = e.slice(this.gapFrom, this.gapTo);\n if (t.openStart || t.openEnd)\n return Cr.fail(\"Gap is not a flat range\");\n let n = this.slice.insertAt(this.insert, t.content);\n return n ? Cr.fromReplace(e, this.from, this.to, n) : Cr.fail(\"Content does not fit in gap\");\n }\n getMap() {\n return new Qr([\n this.from,\n this.gapFrom - this.from,\n this.insert,\n this.gapTo,\n this.to - this.gapTo,\n this.slice.size - this.insert\n ]);\n }\n invert(e) {\n let t = this.gapTo - this.gapFrom;\n return new Pr(this.from, this.from + this.slice.size + t, this.from + this.insert, this.from + this.insert + t, e.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);\n }\n map(e) {\n let t = e.mapResult(this.from, 1), n = e.mapResult(this.to, -1), s = this.from == this.gapFrom ? t.pos : e.map(this.gapFrom, -1), o = this.to == this.gapTo ? n.pos : e.map(this.gapTo, 1);\n return t.deletedAcross && n.deletedAcross || s < t.pos || o > n.pos ? null : new Pr(t.pos, n.pos, s, o, this.slice, this.insert, this.structure);\n }\n toJSON() {\n let e = {\n stepType: \"replaceAround\",\n from: this.from,\n to: this.to,\n gapFrom: this.gapFrom,\n gapTo: this.gapTo,\n insert: this.insert\n };\n return this.slice.size && (e.slice = this.slice.toJSON()), this.structure && (e.structure = !0), e;\n }\n /**\n @internal\n */\n static fromJSON(e, t) {\n if (typeof t.from != \"number\" || typeof t.to != \"number\" || typeof t.gapFrom != \"number\" || typeof t.gapTo != \"number\" || typeof t.insert != \"number\")\n throw new RangeError(\"Invalid input for ReplaceAroundStep.fromJSON\");\n return new Pr(t.from, t.to, t.gapFrom, t.gapTo, De.fromJSON(e, t.slice), t.insert, !!t.structure);\n }\n}\nHr.jsonID(\"replaceAround\", Pr);\nfunction $l(r, e, t) {\n let n = r.resolve(e), s = t - e, o = n.depth;\n for (; s > 0 && o > 0 && n.indexAfter(o) == n.node(o).childCount; )\n o--, s--;\n if (s > 0) {\n let i = n.node(o).maybeChild(n.indexAfter(o));\n for (; s > 0; ) {\n if (!i || i.isLeaf)\n return !0;\n i = i.firstChild, s--;\n }\n }\n return !1;\n}\nfunction $b(r, e, t, n) {\n let s = [], o = [], i, a;\n r.doc.nodesBetween(e, t, (l, d, u) => {\n if (!l.isInline)\n return;\n let f = l.marks;\n if (!n.isInSet(f) && u.type.allowsMarkType(n.type)) {\n let h = Math.max(d, e), p = Math.min(d + l.nodeSize, t), g = n.addToSet(f);\n for (let b = 0; b < f.length; b++)\n f[b].isInSet(g) || (i && i.to == h && i.mark.eq(f[b]) ? i.to = p : s.push(i = new vn(h, p, f[b])));\n a && a.to == h ? a.to = p : o.push(a = new Zn(h, p, n));\n }\n }), s.forEach((l) => r.step(l)), o.forEach((l) => r.step(l));\n}\nfunction Ib(r, e, t, n) {\n let s = [], o = 0;\n r.doc.nodesBetween(e, t, (i, a) => {\n if (!i.isInline)\n return;\n o++;\n let l = null;\n if (n instanceof _a) {\n let d = i.marks, u;\n for (; u = n.isInSet(d); )\n (l || (l = [])).push(u), d = u.removeFromSet(d);\n } else n ? n.isInSet(i.marks) && (l = [n]) : l = i.marks;\n if (l && l.length) {\n let d = Math.min(a + i.nodeSize, t);\n for (let u = 0; u < l.length; u++) {\n let f = l[u], h;\n for (let p = 0; p < s.length; p++) {\n let g = s[p];\n g.step == o - 1 && f.eq(s[p].style) && (h = g);\n }\n h ? (h.to = d, h.step = o) : s.push({ style: f, from: Math.max(a, e), to: d, step: o });\n }\n }\n }), s.forEach((i) => r.step(new vn(i.from, i.to, i.style)));\n}\nfunction Nc(r, e, t, n = t.contentMatch, s = !0) {\n let o = r.doc.nodeAt(e), i = [], a = e + 1;\n for (let l = 0; l < o.childCount; l++) {\n let d = o.child(l), u = a + d.nodeSize, f = n.matchType(d.type);\n if (!f)\n i.push(new wr(a, u, De.empty));\n else {\n n = f;\n for (let h = 0; h < d.marks.length; h++)\n t.allowsMarkType(d.marks[h].type) || r.step(new vn(a, u, d.marks[h]));\n if (s && d.isText && t.whitespace != \"pre\") {\n let h, p = /\\r?\\n|\\r/g, g;\n for (; h = p.exec(d.text); )\n g || (g = new De(ye.from(t.schema.text(\" \", t.allowedMarks(d.marks))), 0, 0)), i.push(new wr(a + h.index, a + h.index + h[0].length, g));\n }\n }\n a = u;\n }\n if (!n.validEnd) {\n let l = n.fillBefore(ye.empty, !0);\n r.replace(a, a, new De(l, 0, 0));\n }\n for (let l = i.length - 1; l >= 0; l--)\n r.step(i[l]);\n}\nfunction zb(r, e, t) {\n return (e == 0 || r.canReplace(e, r.childCount)) && (t == r.childCount || r.canReplace(0, t));\n}\nfunction so(r) {\n let t = r.parent.content.cutByIndex(r.startIndex, r.endIndex);\n for (let n = r.depth, s = 0, o = 0; ; --n) {\n let i = r.$from.node(n), a = r.$from.index(n) + s, l = r.$to.indexAfter(n) - o;\n if (n < r.depth && i.canReplace(a, l, t))\n return n;\n if (n == 0 || i.type.spec.isolating || !zb(i, a, l))\n break;\n a && (s = 1), l < i.childCount && (o = 1);\n }\n return null;\n}\nfunction Rb(r, e, t) {\n let { $from: n, $to: s, depth: o } = e, i = n.before(o + 1), a = s.after(o + 1), l = i, d = a, u = ye.empty, f = 0;\n for (let g = o, b = !1; g > t; g--)\n b || n.index(g) > 0 ? (b = !0, u = ye.from(n.node(g).copy(u)), f++) : l--;\n let h = ye.empty, p = 0;\n for (let g = o, b = !1; g > t; g--)\n b || s.after(g + 1) < s.end(g) ? (b = !0, h = ye.from(s.node(g).copy(h)), p++) : d++;\n r.step(new Pr(l, d, i, a, new De(u.append(h), f, p), u.size - f, !0));\n}\nfunction Oc(r, e, t = null, n = r) {\n let s = jb(r, e), o = s && Lb(n, e);\n return o ? s.map(Qd).concat({ type: e, attrs: t }).concat(o.map(Qd)) : null;\n}\nfunction Qd(r) {\n return { type: r, attrs: null };\n}\nfunction jb(r, e) {\n let { parent: t, startIndex: n, endIndex: s } = r, o = t.contentMatchAt(n).findWrapping(e);\n if (!o)\n return null;\n let i = o.length ? o[0] : e;\n return t.canReplaceWith(n, s, i) ? o : null;\n}\nfunction Lb(r, e) {\n let { parent: t, startIndex: n, endIndex: s } = r, o = t.child(n), i = e.contentMatch.findWrapping(o.type);\n if (!i)\n return null;\n let l = (i.length ? i[i.length - 1] : e).contentMatch;\n for (let d = n; l && d < s; d++)\n l = l.matchType(t.child(d).type);\n return !l || !l.validEnd ? null : i;\n}\nfunction Db(r, e, t) {\n let n = ye.empty;\n for (let i = t.length - 1; i >= 0; i--) {\n if (n.size) {\n let a = t[i].type.contentMatch.matchFragment(n);\n if (!a || !a.validEnd)\n throw new RangeError(\"Wrapper type given to Transform.wrap does not form valid content of its parent wrapper\");\n }\n n = ye.from(t[i].type.create(t[i].attrs, n));\n }\n let s = e.start, o = e.end;\n r.step(new Pr(s, o, s, o, new De(n, 0, 0), t.length, !0));\n}\nfunction Fb(r, e, t, n, s) {\n if (!n.isTextblock)\n throw new RangeError(\"Type given to setBlockType should be a textblock\");\n let o = r.steps.length;\n r.doc.nodesBetween(e, t, (i, a) => {\n let l = typeof s == \"function\" ? s(i) : s;\n if (i.isTextblock && !i.hasMarkup(n, l) && Bb(r.doc, r.mapping.slice(o).map(a), n)) {\n let d = null;\n if (n.schema.linebreakReplacement) {\n let p = n.whitespace == \"pre\", g = !!n.contentMatch.matchType(n.schema.linebreakReplacement);\n p && !g ? d = !1 : !p && g && (d = !0);\n }\n d === !1 && pp(r, i, a, o), Nc(r, r.mapping.slice(o).map(a, 1), n, void 0, d === null);\n let u = r.mapping.slice(o), f = u.map(a, 1), h = u.map(a + i.nodeSize, 1);\n return r.step(new Pr(f, h, f + 1, h - 1, new De(ye.from(n.create(l, null, i.marks)), 0, 0), 1, !0)), d === !0 && fp(r, i, a, o), !1;\n }\n });\n}\nfunction fp(r, e, t, n) {\n e.forEach((s, o) => {\n if (s.isText) {\n let i, a = /\\r?\\n|\\r/g;\n for (; i = a.exec(s.text); ) {\n let l = r.mapping.slice(n).map(t + 1 + o + i.index);\n r.replaceWith(l, l + 1, e.type.schema.linebreakReplacement.create());\n }\n }\n });\n}\nfunction pp(r, e, t, n) {\n e.forEach((s, o) => {\n if (s.type == s.type.schema.linebreakReplacement) {\n let i = r.mapping.slice(n).map(t + 1 + o);\n r.replaceWith(i, i + 1, e.type.schema.text(`\n`));\n }\n });\n}\nfunction Bb(r, e, t) {\n let n = r.resolve(e), s = n.index();\n return n.parent.canReplaceWith(s, s + 1, t);\n}\nfunction Hb(r, e, t, n, s) {\n let o = r.doc.nodeAt(e);\n if (!o)\n throw new RangeError(\"No node at given position\");\n t || (t = o.type);\n let i = t.create(n, null, s || o.marks);\n if (o.isLeaf)\n return r.replaceWith(e, e + o.nodeSize, i);\n if (!t.validContent(o.content))\n throw new RangeError(\"Invalid content for node type \" + t.name);\n r.step(new Pr(e, e + o.nodeSize, e + 1, e + o.nodeSize - 1, new De(ye.from(i), 0, 0), 1, !0));\n}\nfunction Dn(r, e, t = 1, n) {\n let s = r.resolve(e), o = s.depth - t, i = n && n[n.length - 1] || s.parent;\n if (o < 0 || s.parent.type.spec.isolating || !s.parent.canReplace(s.index(), s.parent.childCount) || !i.type.validContent(s.parent.content.cutByIndex(s.index(), s.parent.childCount)))\n return !1;\n for (let d = s.depth - 1, u = t - 2; d > o; d--, u--) {\n let f = s.node(d), h = s.index(d);\n if (f.type.spec.isolating)\n return !1;\n let p = f.content.cutByIndex(h, f.childCount), g = n && n[u + 1];\n g && (p = p.replaceChild(0, g.type.create(g.attrs)));\n let b = n && n[u] || f;\n if (!f.canReplace(h + 1, f.childCount) || !b.type.validContent(p))\n return !1;\n }\n let a = s.indexAfter(o), l = n && n[0];\n return s.node(o).canReplaceWith(a, a, l ? l.type : s.node(o + 1).type);\n}\nfunction qb(r, e, t = 1, n) {\n let s = r.doc.resolve(e), o = ye.empty, i = ye.empty;\n for (let a = s.depth, l = s.depth - t, d = t - 1; a > l; a--, d--) {\n o = ye.from(s.node(a).copy(o));\n let u = n && n[d];\n i = ye.from(u ? u.type.create(u.attrs, i) : s.node(a).copy(i));\n }\n r.step(new wr(e, e, new De(o.append(i), t, t), !0));\n}\nfunction ds(r, e) {\n let t = r.resolve(e), n = t.index();\n return hp(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(n, n + 1);\n}\nfunction Vb(r, e) {\n e.content.size || r.type.compatibleContent(e.type);\n let t = r.contentMatchAt(r.childCount), { linebreakReplacement: n } = r.type.schema;\n for (let s = 0; s < e.childCount; s++) {\n let o = e.child(s), i = o.type == n ? r.type.schema.nodes.text : o.type;\n if (t = t.matchType(i), !t || !r.type.allowsMarks(o.marks))\n return !1;\n }\n return t.validEnd;\n}\nfunction hp(r, e) {\n return !!(r && e && !r.isLeaf && Vb(r, e));\n}\nfunction Sa(r, e, t = -1) {\n let n = r.resolve(e);\n for (let s = n.depth; ; s--) {\n let o, i, a = n.index(s);\n if (s == n.depth ? (o = n.nodeBefore, i = n.nodeAfter) : t > 0 ? (o = n.node(s + 1), a++, i = n.node(s).maybeChild(a)) : (o = n.node(s).maybeChild(a - 1), i = n.node(s + 1)), o && !o.isTextblock && hp(o, i) && n.node(s).canReplace(a, a + 1))\n return e;\n if (s == 0)\n break;\n e = t < 0 ? n.before(s) : n.after(s);\n }\n}\nfunction Wb(r, e, t) {\n let n = null, { linebreakReplacement: s } = r.doc.type.schema, o = r.doc.resolve(e - t), i = o.node().type;\n if (s && i.inlineContent) {\n let u = i.whitespace == \"pre\", f = !!i.contentMatch.matchType(s);\n u && !f ? n = !1 : !u && f && (n = !0);\n }\n let a = r.steps.length;\n if (n === !1) {\n let u = r.doc.resolve(e + t);\n pp(r, u.node(), u.before(), a);\n }\n i.inlineContent && Nc(r, e + t - 1, i, o.node().contentMatchAt(o.index()), n == null);\n let l = r.mapping.slice(a), d = l.map(e - t);\n if (r.step(new wr(d, l.map(e + t, -1), De.empty, !0)), n === !0) {\n let u = r.doc.resolve(d);\n fp(r, u.node(), u.before(), r.steps.length);\n }\n return r;\n}\nfunction Ub(r, e, t) {\n let n = r.resolve(e);\n if (n.parent.canReplaceWith(n.index(), n.index(), t))\n return e;\n if (n.parentOffset == 0)\n for (let s = n.depth - 1; s >= 0; s--) {\n let o = n.index(s);\n if (n.node(s).canReplaceWith(o, o, t))\n return n.before(s + 1);\n if (o > 0)\n return null;\n }\n if (n.parentOffset == n.parent.content.size)\n for (let s = n.depth - 1; s >= 0; s--) {\n let o = n.indexAfter(s);\n if (n.node(s).canReplaceWith(o, o, t))\n return n.after(s + 1);\n if (o < n.node(s).childCount)\n return null;\n }\n return null;\n}\nfunction mp(r, e, t) {\n let n = r.resolve(e);\n if (!t.content.size)\n return e;\n let s = t.content;\n for (let o = 0; o < t.openStart; o++)\n s = s.firstChild.content;\n for (let o = 1; o <= (t.openStart == 0 && t.size ? 2 : 1); o++)\n for (let i = n.depth; i >= 0; i--) {\n let a = i == n.depth ? 0 : n.pos <= (n.start(i + 1) + n.end(i + 1)) / 2 ? -1 : 1, l = n.index(i) + (a > 0 ? 1 : 0), d = n.node(i), u = !1;\n if (o == 1)\n u = d.canReplace(l, l, s);\n else {\n let f = d.contentMatchAt(l).findWrapping(s.firstChild.type);\n u = f && d.canReplaceWith(l, l, f[0]);\n }\n if (u)\n return a == 0 ? n.pos : a < 0 ? n.before(i + 1) : n.after(i + 1);\n }\n return null;\n}\nfunction Ea(r, e, t = e, n = De.empty) {\n if (e == t && !n.size)\n return null;\n let s = r.resolve(e), o = r.resolve(t);\n return vp(s, o, n) ? new wr(e, t, n) : new Jb(s, o, n).fit();\n}\nfunction vp(r, e, t) {\n return !t.openStart && !t.openEnd && r.start() == e.start() && r.parent.canReplace(r.index(), e.index(), t.content);\n}\nclass Jb {\n constructor(e, t, n) {\n this.$from = e, this.$to = t, this.unplaced = n, this.frontier = [], this.placed = ye.empty;\n for (let s = 0; s <= e.depth; s++) {\n let o = e.node(s);\n this.frontier.push({\n type: o.type,\n match: o.contentMatchAt(e.indexAfter(s))\n });\n }\n for (let s = e.depth; s > 0; s--)\n this.placed = ye.from(e.node(s).copy(this.placed));\n }\n get depth() {\n return this.frontier.length - 1;\n }\n fit() {\n for (; this.unplaced.size; ) {\n let d = this.findFittable();\n d ? this.placeNodes(d) : this.openMore() || this.dropNode();\n }\n let e = this.mustMoveInline(), t = this.placed.size - this.depth - this.$from.depth, n = this.$from, s = this.close(e < 0 ? this.$to : n.doc.resolve(e));\n if (!s)\n return null;\n let o = this.placed, i = n.depth, a = s.depth;\n for (; i && a && o.childCount == 1; )\n o = o.firstChild.content, i--, a--;\n let l = new De(o, i, a);\n return e > -1 ? new Pr(n.pos, e, this.$to.pos, this.$to.end(), l, t) : l.size || n.pos != this.$to.pos ? new wr(n.pos, s.pos, l) : null;\n }\n // Find a position on the start spine of `this.unplaced` that has\n // content that can be moved somewhere on the frontier. Returns two\n // depths, one for the slice and one for the frontier.\n findFittable() {\n let e = this.unplaced.openStart;\n for (let t = this.unplaced.content, n = 0, s = this.unplaced.openEnd; n < e; n++) {\n let o = t.firstChild;\n if (t.childCount > 1 && (s = 0), o.type.spec.isolating && s <= n) {\n e = n;\n break;\n }\n t = o.content;\n }\n for (let t = 1; t <= 2; t++)\n for (let n = t == 1 ? e : this.unplaced.openStart; n >= 0; n--) {\n let s, o = null;\n n ? (o = Za(this.unplaced.content, n - 1).firstChild, s = o.content) : s = this.unplaced.content;\n let i = s.firstChild;\n for (let a = this.depth; a >= 0; a--) {\n let { type: l, match: d } = this.frontier[a], u, f = null;\n if (t == 1 && (i ? d.matchType(i.type) || (f = d.fillBefore(ye.from(i), !1)) : o && l.compatibleContent(o.type)))\n return { sliceDepth: n, frontierDepth: a, parent: o, inject: f };\n if (t == 2 && i && (u = d.findWrapping(i.type)))\n return { sliceDepth: n, frontierDepth: a, parent: o, wrap: u };\n if (o && d.matchType(o.type))\n break;\n }\n }\n }\n openMore() {\n let { content: e, openStart: t, openEnd: n } = this.unplaced, s = Za(e, t);\n return !s.childCount || s.firstChild.isLeaf ? !1 : (this.unplaced = new De(e, t + 1, Math.max(n, s.size + t >= e.size - n ? t + 1 : 0)), !0);\n }\n dropNode() {\n let { content: e, openStart: t, openEnd: n } = this.unplaced, s = Za(e, t);\n if (s.childCount <= 1 && t > 0) {\n let o = e.size - t <= t + s.size;\n this.unplaced = new De(po(e, t - 1, 1), t - 1, o ? t - 1 : n);\n } else\n this.unplaced = new De(po(e, t, 1), t, n);\n }\n // Move content from the unplaced slice at `sliceDepth` to the\n // frontier node at `frontierDepth`. Close that frontier node when\n // applicable.\n placeNodes({ sliceDepth: e, frontierDepth: t, parent: n, inject: s, wrap: o }) {\n for (; this.depth > t; )\n this.closeFrontierNode();\n if (o)\n for (let b = 0; b < o.length; b++)\n this.openFrontierNode(o[b]);\n let i = this.unplaced, a = n ? n.content : i.content, l = i.openStart - e, d = 0, u = [], { match: f, type: h } = this.frontier[t];\n if (s) {\n for (let b = 0; b < s.childCount; b++)\n u.push(s.child(b));\n f = f.matchFragment(s);\n }\n let p = a.size + e - (i.content.size - i.openEnd);\n for (; d < a.childCount; ) {\n let b = a.child(d), y = f.matchType(b.type);\n if (!y)\n break;\n d++, (d > 1 || l == 0 || b.content.size) && (f = y, u.push(gp(b.mark(h.allowedMarks(b.marks)), d == 1 ? l : 0, d == a.childCount ? p : -1)));\n }\n let g = d == a.childCount;\n g || (p = -1), this.placed = ho(this.placed, t, ye.from(u)), this.frontier[t].match = f, g && p < 0 && n && n.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();\n for (let b = 0, y = a; b < p; b++) {\n let C = y.lastChild;\n this.frontier.push({ type: C.type, match: C.contentMatchAt(C.childCount) }), y = C.content;\n }\n this.unplaced = g ? e == 0 ? De.empty : new De(po(i.content, e - 1, 1), e - 1, p < 0 ? i.openEnd : e - 1) : new De(po(i.content, e, d), i.openStart, i.openEnd);\n }\n mustMoveInline() {\n if (!this.$to.parent.isTextblock)\n return -1;\n let e = this.frontier[this.depth], t;\n if (!e.type.isTextblock || !el(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)\n return -1;\n let { depth: n } = this.$to, s = this.$to.after(n);\n for (; n > 1 && s == this.$to.end(--n); )\n ++s;\n return s;\n }\n findCloseLevel(e) {\n e: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {\n let { match: n, type: s } = this.frontier[t], o = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), i = el(e, t, s, n, o);\n if (i) {\n for (let a = t - 1; a >= 0; a--) {\n let { match: l, type: d } = this.frontier[a], u = el(e, a, d, l, !0);\n if (!u || u.childCount)\n continue e;\n }\n return { depth: t, fit: i, move: o ? e.doc.resolve(e.after(t + 1)) : e };\n }\n }\n }\n close(e) {\n let t = this.findCloseLevel(e);\n if (!t)\n return null;\n for (; this.depth > t.depth; )\n this.closeFrontierNode();\n t.fit.childCount && (this.placed = ho(this.placed, t.depth, t.fit)), e = t.move;\n for (let n = t.depth + 1; n <= e.depth; n++) {\n let s = e.node(n), o = s.type.contentMatch.fillBefore(s.content, !0, e.index(n));\n this.openFrontierNode(s.type, s.attrs, o);\n }\n return e;\n }\n openFrontierNode(e, t = null, n) {\n let s = this.frontier[this.depth];\n s.match = s.match.matchType(e), this.placed = ho(this.placed, this.depth, ye.from(e.create(t, n))), this.frontier.push({ type: e, match: e.contentMatch });\n }\n closeFrontierNode() {\n let t = this.frontier.pop().match.fillBefore(ye.empty, !0);\n t.childCount && (this.placed = ho(this.placed, this.frontier.length, t));\n }\n}\nfunction po(r, e, t) {\n return e == 0 ? r.cutByIndex(t, r.childCount) : r.replaceChild(0, r.firstChild.copy(po(r.firstChild.content, e - 1, t)));\n}\nfunction ho(r, e, t) {\n return e == 0 ? r.append(t) : r.replaceChild(r.childCount - 1, r.lastChild.copy(ho(r.lastChild.content, e - 1, t)));\n}\nfunction Za(r, e) {\n for (let t = 0; t < e; t++)\n r = r.firstChild.content;\n return r;\n}\nfunction gp(r, e, t) {\n if (e <= 0)\n return r;\n let n = r.content;\n return e > 1 && (n = n.replaceChild(0, gp(n.firstChild, e - 1, n.childCount == 1 ? t - 1 : 0))), e > 0 && (n = r.type.contentMatch.fillBefore(n).append(n), t <= 0 && (n = n.append(r.type.contentMatch.matchFragment(n).fillBefore(ye.empty, !0)))), r.copy(n);\n}\nfunction el(r, e, t, n, s) {\n let o = r.node(e), i = s ? r.indexAfter(e) : r.index(e);\n if (i == o.childCount && !t.compatibleContent(o.type))\n return null;\n let a = n.fillBefore(o.content, !0, i);\n return a && !Kb(t, o.content, i) ? a : null;\n}\nfunction Kb(r, e, t) {\n for (let n = t; n < e.childCount; n++)\n if (!r.allowsMarks(e.child(n).marks))\n return !0;\n return !1;\n}\nfunction Gb(r) {\n return r.spec.defining || r.spec.definingForContent;\n}\nfunction Yb(r, e, t, n) {\n if (!n.size)\n return r.deleteRange(e, t);\n let s = r.doc.resolve(e), o = r.doc.resolve(t);\n if (vp(s, o, n))\n return r.step(new wr(e, t, n));\n let i = yp(s, o);\n i[i.length - 1] == 0 && i.pop();\n let a = -(s.depth + 1);\n i.unshift(a);\n for (let h = s.depth, p = s.pos - 1; h > 0; h--, p--) {\n let g = s.node(h).type.spec;\n if (g.defining || g.definingAsContext || g.isolating)\n break;\n i.indexOf(h) > -1 ? a = h : s.before(h) == p && i.splice(1, 0, -h);\n }\n let l = i.indexOf(a), d = [], u = n.openStart;\n for (let h = n.content, p = 0; ; p++) {\n let g = h.firstChild;\n if (d.push(g), p == n.openStart)\n break;\n h = g.content;\n }\n for (let h = u - 1; h >= 0; h--) {\n let p = d[h], g = Gb(p.type);\n if (g && !p.sameMarkup(s.node(Math.abs(a) - 1)))\n u = h;\n else if (g || !p.type.isTextblock)\n break;\n }\n for (let h = n.openStart; h >= 0; h--) {\n let p = (h + u + 1) % (n.openStart + 1), g = d[p];\n if (g)\n for (let b = 0; b < i.length; b++) {\n let y = i[(b + l) % i.length], C = !0;\n y < 0 && (C = !1, y = -y);\n let E = s.node(y - 1), R = s.index(y - 1);\n if (E.canReplaceWith(R, R, g.type, g.marks))\n return r.replace(s.before(y), C ? o.after(y) : t, new De(bp(n.content, 0, n.openStart, p), p, n.openEnd));\n }\n }\n let f = r.steps.length;\n for (let h = i.length - 1; h >= 0 && (r.replace(e, t, n), !(r.steps.length > f)); h--) {\n let p = i[h];\n p < 0 || (e = s.before(p), t = o.after(p));\n }\n}\nfunction bp(r, e, t, n, s) {\n if (e < t) {\n let o = r.firstChild;\n r = r.replaceChild(0, o.copy(bp(o.content, e + 1, t, n, o)));\n }\n if (e > n) {\n let o = s.contentMatchAt(0), i = o.fillBefore(r).append(r);\n r = i.append(o.matchFragment(i).fillBefore(ye.empty, !0));\n }\n return r;\n}\nfunction Xb(r, e, t, n) {\n if (!n.isInline && e == t && r.doc.resolve(e).parent.content.size) {\n let s = Ub(r.doc, e, n.type);\n s != null && (e = t = s);\n }\n r.replaceRange(e, t, new De(ye.from(n), 0, 0));\n}\nfunction Qb(r, e, t) {\n let n = r.doc.resolve(e), s = r.doc.resolve(t);\n if (n.parent.isTextblock && s.parent.isTextblock && n.start() != s.start() && n.parentOffset == 0 && s.parentOffset == 0) {\n let i = n.sharedDepth(t), a = !1;\n for (let l = n.depth; l > i; l--)\n n.node(l).type.spec.isolating && (a = !0);\n for (let l = s.depth; l > i; l--)\n s.node(l).type.spec.isolating && (a = !0);\n if (!a) {\n for (let l = n.depth; l > 0 && e == n.start(l); l--)\n e = n.before(l);\n for (let l = s.depth; l > 0 && t == s.start(l); l--)\n t = s.before(l);\n n = r.doc.resolve(e), s = r.doc.resolve(t);\n }\n }\n let o = yp(n, s);\n for (let i = 0; i < o.length; i++) {\n let a = o[i], l = i == o.length - 1;\n if (l && a == 0 || n.node(a).type.contentMatch.validEnd)\n return r.delete(n.start(a), s.end(a));\n if (a > 0 && (l || n.node(a - 1).canReplace(n.index(a - 1), s.indexAfter(a - 1))))\n return r.delete(n.before(a), s.after(a));\n }\n for (let i = 1; i <= n.depth && i <= s.depth; i++)\n if (e - n.start(i) == n.depth - i && t > n.end(i) && s.end(i) - t != s.depth - i && n.start(i - 1) == s.start(i - 1) && n.node(i - 1).canReplace(n.index(i - 1), s.index(i - 1)))\n return r.delete(n.before(i), t);\n r.delete(e, t);\n}\nfunction yp(r, e) {\n let t = [], n = Math.min(r.depth, e.depth);\n for (let s = n; s >= 0; s--) {\n let o = r.start(s);\n if (o < r.pos - (r.depth - s) || e.end(s) > e.pos + (e.depth - s) || r.node(s).type.spec.isolating || e.node(s).type.spec.isolating)\n break;\n (o == e.start(s) || s == r.depth && s == e.depth && r.parent.inlineContent && e.parent.inlineContent && s && e.start(s - 1) == o - 1) && t.push(s);\n }\n return t;\n}\nclass Js extends Hr {\n /**\n Construct an attribute step.\n */\n constructor(e, t, n) {\n super(), this.pos = e, this.attr = t, this.value = n;\n }\n apply(e) {\n let t = e.nodeAt(this.pos);\n if (!t)\n return Cr.fail(\"No node at attribute step's position\");\n let n = /* @__PURE__ */ Object.create(null);\n for (let o in t.attrs)\n n[o] = t.attrs[o];\n n[this.attr] = this.value;\n let s = t.type.create(n, null, t.marks);\n return Cr.fromReplace(e, this.pos, this.pos + 1, new De(ye.from(s), 0, t.isLeaf ? 0 : 1));\n }\n getMap() {\n return Qr.empty;\n }\n invert(e) {\n return new Js(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);\n }\n map(e) {\n let t = e.mapResult(this.pos, 1);\n return t.deletedAfter ? null : new Js(t.pos, this.attr, this.value);\n }\n toJSON() {\n return { stepType: \"attr\", pos: this.pos, attr: this.attr, value: this.value };\n }\n static fromJSON(e, t) {\n if (typeof t.pos != \"number\" || typeof t.attr != \"string\")\n throw new RangeError(\"Invalid input for AttrStep.fromJSON\");\n return new Js(t.pos, t.attr, t.value);\n }\n}\nHr.jsonID(\"attr\", Js);\nclass Lo extends Hr {\n /**\n Construct an attribute step.\n */\n constructor(e, t) {\n super(), this.attr = e, this.value = t;\n }\n apply(e) {\n let t = /* @__PURE__ */ Object.create(null);\n for (let s in e.attrs)\n t[s] = e.attrs[s];\n t[this.attr] = this.value;\n let n = e.type.create(t, e.content, e.marks);\n return Cr.ok(n);\n }\n getMap() {\n return Qr.empty;\n }\n invert(e) {\n return new Lo(this.attr, e.attrs[this.attr]);\n }\n map(e) {\n return this;\n }\n toJSON() {\n return { stepType: \"docAttr\", attr: this.attr, value: this.value };\n }\n static fromJSON(e, t) {\n if (typeof t.attr != \"string\")\n throw new RangeError(\"Invalid input for DocAttrStep.fromJSON\");\n return new Lo(t.attr, t.value);\n }\n}\nHr.jsonID(\"docAttr\", Lo);\nlet Xs = class extends Error {\n};\nXs = function r(e) {\n let t = Error.call(this, e);\n return t.__proto__ = r.prototype, t;\n};\nXs.prototype = Object.create(Error.prototype);\nXs.prototype.constructor = Xs;\nXs.prototype.name = \"TransformError\";\nclass xp {\n /**\n Create a transform that starts with the given document.\n */\n constructor(e) {\n this.doc = e, this.steps = [], this.docs = [], this.mapping = new jo();\n }\n /**\n The starting document.\n */\n get before() {\n return this.docs.length ? this.docs[0] : this.doc;\n }\n /**\n Apply a new step in this transform, saving the result. Throws an\n error when the step fails.\n */\n step(e) {\n let t = this.maybeStep(e);\n if (t.failed)\n throw new Xs(t.failed);\n return this;\n }\n /**\n Try to apply a step in this transformation, ignoring it if it\n fails. Returns the step result.\n */\n maybeStep(e) {\n let t = e.apply(this.doc);\n return t.failed || this.addStep(e, t.doc), t;\n }\n /**\n True when the document has been changed (when there are any\n steps).\n */\n get docChanged() {\n return this.steps.length > 0;\n }\n /**\n Return a single range, in post-transform document positions,\n that covers all content changed by this transform. Returns null\n if no replacements are made. Note that this will ignore changes\n that add/remove marks without replacing the underlying content.\n */\n changedRange() {\n let e = 1e9, t = -1e9;\n for (let n = 0; n < this.mapping.maps.length; n++) {\n let s = this.mapping.maps[n];\n n && (e = s.map(e, 1), t = s.map(t, -1)), s.forEach((o, i, a, l) => {\n e = Math.min(e, a), t = Math.max(t, l);\n });\n }\n return e == 1e9 ? null : { from: e, to: t };\n }\n /**\n @internal\n */\n addStep(e, t) {\n this.docs.push(this.doc), this.steps.push(e), this.mapping.appendMap(e.getMap()), this.doc = t;\n }\n /**\n Replace the part of the document between `from` and `to` with the\n given `slice`.\n */\n replace(e, t = e, n = De.empty) {\n let s = Ea(this.doc, e, t, n);\n return s && this.step(s), this;\n }\n /**\n Replace the given range with the given content, which may be a\n fragment, node, or array of nodes.\n */\n replaceWith(e, t, n) {\n return this.replace(e, t, new De(ye.from(n), 0, 0));\n }\n /**\n Delete the content between the given positions.\n */\n delete(e, t) {\n return this.replace(e, t, De.empty);\n }\n /**\n Insert the given content at the given position.\n */\n insert(e, t) {\n return this.replaceWith(e, e, t);\n }\n /**\n Replace a range of the document with a given slice, using\n `from`, `to`, and the slice's\n [`openStart`](https://prosemirror.net/docs/ref/#model.Slice.openStart) property as hints, rather\n than fixed start and end points. This method may grow the\n replaced area or close open nodes in the slice in order to get a\n fit that is more in line with WYSIWYG expectations, by dropping\n fully covered parent nodes of the replaced region when they are\n marked [non-defining as\n context](https://prosemirror.net/docs/ref/#model.NodeSpec.definingAsContext), or including an\n open parent node from the slice that _is_ marked as [defining\n its content](https://prosemirror.net/docs/ref/#model.NodeSpec.definingForContent).\n \n This is the method, for example, to handle paste. The similar\n [`replace`](https://prosemirror.net/docs/ref/#transform.Transform.replace) method is a more\n primitive tool which will _not_ move the start and end of its given\n range, and is useful in situations where you need more precise\n control over what happens.\n */\n replaceRange(e, t, n) {\n return Yb(this, e, t, n), this;\n }\n /**\n Replace the given range with a node, but use `from` and `to` as\n hints, rather than precise positions. When from and to are the same\n and are at the start or end of a parent node in which the given\n node doesn't fit, this method may _move_ them out towards a parent\n that does allow the given node to be placed. When the given range\n completely covers a parent node, this method may completely replace\n that parent node.\n */\n replaceRangeWith(e, t, n) {\n return Xb(this, e, t, n), this;\n }\n /**\n Delete the given range, expanding it to cover fully covered\n parent nodes until a valid replace is found.\n */\n deleteRange(e, t) {\n return Qb(this, e, t), this;\n }\n /**\n Split the content in the given range off from its parent, if there\n is sibling content before or after it, and move it up the tree to\n the depth specified by `target`. You'll probably want to use\n [`liftTarget`](https://prosemirror.net/docs/ref/#transform.liftTarget) to compute `target`, to make\n sure the lift is valid.\n */\n lift(e, t) {\n return Rb(this, e, t), this;\n }\n /**\n Join the blocks around the given position. If depth is 2, their\n last and first siblings are also joined, and so on.\n */\n join(e, t = 1) {\n return Wb(this, e, t), this;\n }\n /**\n Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.\n The wrappers are assumed to be valid in this position, and should\n probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).\n */\n wrap(e, t) {\n return Db(this, e, t), this;\n }\n /**\n Set the type of all textblocks (partly) between `from` and `to` to\n the given node type with the given attributes.\n */\n setBlockType(e, t = e, n, s = null) {\n return Fb(this, e, t, n, s), this;\n }\n /**\n Change the type, attributes, and/or marks of the node at `pos`.\n When `type` isn't given, the existing node type is preserved,\n */\n setNodeMarkup(e, t, n = null, s) {\n return Hb(this, e, t, n, s), this;\n }\n /**\n Set a single attribute on a given node to a new value.\n The `pos` addresses the document content. Use `setDocAttribute`\n to set attributes on the document itself.\n */\n setNodeAttribute(e, t, n) {\n return this.step(new Js(e, t, n)), this;\n }\n /**\n Set a single attribute on the document to a new value.\n */\n setDocAttribute(e, t) {\n return this.step(new Lo(e, t)), this;\n }\n /**\n Add a mark to the node at position `pos`.\n */\n addNodeMark(e, t) {\n return this.step(new es(e, t)), this;\n }\n /**\n Remove a mark (or all marks of the given type) from the node at\n position `pos`.\n */\n removeNodeMark(e, t) {\n let n = this.doc.nodeAt(e);\n if (!n)\n throw new RangeError(\"No node at position \" + e);\n if (t instanceof Gt)\n t.isInSet(n.marks) && this.step(new Ns(e, t));\n else {\n let s = n.marks, o, i = [];\n for (; o = t.isInSet(s); )\n i.push(new Ns(e, o)), s = o.removeFromSet(s);\n for (let a = i.length - 1; a >= 0; a--)\n this.step(i[a]);\n }\n return this;\n }\n /**\n Split the node at the given position, and optionally, if `depth` is\n greater than one, any number of nodes above that. By default, the\n parts split off will inherit the node type of the original node.\n This can be changed by passing an array of types and attributes to\n use after the split (with the outermost nodes coming first).\n */\n split(e, t = 1, n) {\n return qb(this, e, t, n), this;\n }\n /**\n Add the given mark to the inline content between `from` and `to`.\n */\n addMark(e, t, n) {\n return $b(this, e, t, n), this;\n }\n /**\n Remove marks from inline nodes between `from` and `to`. When\n `mark` is a single mark, remove precisely that mark. When it is\n a mark type, remove all marks of that type. When it is null,\n remove all marks of any type.\n */\n removeMark(e, t, n) {\n return Ib(this, e, t, n), this;\n }\n /**\n Removes all marks and nodes from the content of the node at\n `pos` that don't match the given new parent node type. Accepts\n an optional starting [content match](https://prosemirror.net/docs/ref/#model.ContentMatch) as\n third argument.\n */\n clearIncompatible(e, t, n) {\n return Nc(this, e, t, n), this;\n }\n}\nconst tl = /* @__PURE__ */ Object.create(null);\nclass St {\n /**\n Initialize a selection with the head and anchor and ranges. If no\n ranges are given, constructs a single range across `$anchor` and\n `$head`.\n */\n constructor(e, t, n) {\n this.$anchor = e, this.$head = t, this.ranges = n || [new Zb(e.min(t), e.max(t))];\n }\n /**\n The selection's anchor, as an unresolved position.\n */\n get anchor() {\n return this.$anchor.pos;\n }\n /**\n The selection's head.\n */\n get head() {\n return this.$head.pos;\n }\n /**\n The lower bound of the selection's main range.\n */\n get from() {\n return this.$from.pos;\n }\n /**\n The upper bound of the selection's main range.\n */\n get to() {\n return this.$to.pos;\n }\n /**\n The resolved lower bound of the selection's main range.\n */\n get $from() {\n return this.ranges[0].$from;\n }\n /**\n The resolved upper bound of the selection's main range.\n */\n get $to() {\n return this.ranges[0].$to;\n }\n /**\n Indicates whether the selection contains any content.\n */\n get empty() {\n let e = this.ranges;\n for (let t = 0; t < e.length; t++)\n if (e[t].$from.pos != e[t].$to.pos)\n return !1;\n return !0;\n }\n /**\n Get the content of this selection as a slice.\n */\n content() {\n return this.$from.doc.slice(this.from, this.to, !0);\n }\n /**\n Replace the selection with a slice or, if no slice is given,\n delete the selection. Will append to the given transaction.\n */\n replace(e, t = De.empty) {\n let n = t.content.lastChild, s = null;\n for (let a = 0; a < t.openEnd; a++)\n s = n, n = n.lastChild;\n let o = e.steps.length, i = this.ranges;\n for (let a = 0; a < i.length; a++) {\n let { $from: l, $to: d } = i[a], u = e.mapping.slice(o);\n e.replaceRange(u.map(l.pos), u.map(d.pos), a ? De.empty : t), a == 0 && tu(e, o, (n ? n.isInline : s && s.isTextblock) ? -1 : 1);\n }\n }\n /**\n Replace the selection with the given node, appending the changes\n to the given transaction.\n */\n replaceWith(e, t) {\n let n = e.steps.length, s = this.ranges;\n for (let o = 0; o < s.length; o++) {\n let { $from: i, $to: a } = s[o], l = e.mapping.slice(n), d = l.map(i.pos), u = l.map(a.pos);\n o ? e.deleteRange(d, u) : (e.replaceRangeWith(d, u, t), tu(e, n, t.isInline ? -1 : 1));\n }\n }\n /**\n Find a valid cursor or leaf node selection starting at the given\n position and searching back if `dir` is negative, and forward if\n positive. When `textOnly` is true, only consider cursor\n selections. Will return null when no valid selection position is\n found.\n */\n static findFrom(e, t, n = !1) {\n let s = e.parent.inlineContent ? new ht(e) : Fs(e.node(0), e.parent, e.pos, e.index(), t, n);\n if (s)\n return s;\n for (let o = e.depth - 1; o >= 0; o--) {\n let i = t < 0 ? Fs(e.node(0), e.node(o), e.before(o + 1), e.index(o), t, n) : Fs(e.node(0), e.node(o), e.after(o + 1), e.index(o) + 1, t, n);\n if (i)\n return i;\n }\n return null;\n }\n /**\n Find a valid cursor or leaf node selection near the given\n position. Searches forward first by default, but if `bias` is\n negative, it will search backwards first.\n */\n static near(e, t = 1) {\n return this.findFrom(e, t) || this.findFrom(e, -t) || new Zr(e.node(0));\n }\n /**\n Find the cursor or leaf node selection closest to the start of\n the given document. Will return an\n [`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position\n exists.\n */\n static atStart(e) {\n return Fs(e, e, 0, 0, 1) || new Zr(e);\n }\n /**\n Find the cursor or leaf node selection closest to the end of the\n given document.\n */\n static atEnd(e) {\n return Fs(e, e, e.content.size, e.childCount, -1) || new Zr(e);\n }\n /**\n Deserialize the JSON representation of a selection. Must be\n implemented for custom classes (as a static class method).\n */\n static fromJSON(e, t) {\n if (!t || !t.type)\n throw new RangeError(\"Invalid input for Selection.fromJSON\");\n let n = tl[t.type];\n if (!n)\n throw new RangeError(`No selection type ${t.type} defined`);\n return n.fromJSON(e, t);\n }\n /**\n To be able to deserialize selections from JSON, custom selection\n classes must register themselves with an ID string, so that they\n can be disambiguated. Try to pick something that's unlikely to\n clash with classes from other modules.\n */\n static jsonID(e, t) {\n if (e in tl)\n throw new RangeError(\"Duplicate use of selection JSON ID \" + e);\n return tl[e] = t, t.prototype.jsonID = e, t;\n }\n /**\n Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,\n which is a value that can be mapped without having access to a\n current document, and later resolved to a real selection for a\n given document again. (This is used mostly by the history to\n track and restore old selections.) The default implementation of\n this method just converts the selection to a text selection and\n returns the bookmark for that.\n */\n getBookmark() {\n return ht.between(this.$anchor, this.$head).getBookmark();\n }\n}\nSt.prototype.visible = !0;\nclass Zb {\n /**\n Create a range.\n */\n constructor(e, t) {\n this.$from = e, this.$to = t;\n }\n}\nlet Zd = !1;\nfunction eu(r) {\n !Zd && !r.parent.inlineContent && (Zd = !0, console.warn(\"TextSelection endpoint not pointing into a node with inline content (\" + r.parent.type.name + \")\"));\n}\nclass ht extends St {\n /**\n Construct a text selection between the given points.\n */\n constructor(e, t = e) {\n eu(e), eu(t), super(e, t);\n }\n /**\n Returns a resolved position if this is a cursor selection (an\n empty text selection), and null otherwise.\n */\n get $cursor() {\n return this.$anchor.pos == this.$head.pos ? this.$head : null;\n }\n map(e, t) {\n let n = e.resolve(t.map(this.head));\n if (!n.parent.inlineContent)\n return St.near(n);\n let s = e.resolve(t.map(this.anchor));\n return new ht(s.parent.inlineContent ? s : n, n);\n }\n replace(e, t = De.empty) {\n if (super.replace(e, t), t == De.empty) {\n let n = this.$from.marksAcross(this.$to);\n n && e.ensureMarks(n);\n }\n }\n eq(e) {\n return e instanceof ht && e.anchor == this.anchor && e.head == this.head;\n }\n getBookmark() {\n return new Ta(this.anchor, this.head);\n }\n toJSON() {\n return { type: \"text\", anchor: this.anchor, head: this.head };\n }\n /**\n @internal\n */\n static fromJSON(e, t) {\n if (typeof t.anchor != \"number\" || typeof t.head != \"number\")\n throw new RangeError(\"Invalid input for TextSelection.fromJSON\");\n return new ht(e.resolve(t.anchor), e.resolve(t.head));\n }\n /**\n Create a text selection from non-resolved positions.\n */\n static create(e, t, n = t) {\n let s = e.resolve(t);\n return new this(s, n == t ? s : e.resolve(n));\n }\n /**\n Return a text selection that spans the given positions or, if\n they aren't text positions, find a text selection near them.\n `bias` determines whether the method searches forward (default)\n or backwards (negative number) first. Will fall back to calling\n [`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document\n doesn't contain a valid text position.\n */\n static between(e, t, n) {\n let s = e.pos - t.pos;\n if ((!n || s) && (n = s >= 0 ? 1 : -1), !t.parent.inlineContent) {\n let o = St.findFrom(t, n, !0) || St.findFrom(t, -n, !0);\n if (o)\n t = o.$head;\n else\n return St.near(t, n);\n }\n return e.parent.inlineContent || (s == 0 ? e = t : (e = (St.findFrom(e, -n, !0) || St.findFrom(e, n, !0)).$anchor, e.pos < t.pos != s < 0 && (e = t))), new ht(e, t);\n }\n}\nSt.jsonID(\"text\", ht);\nclass Ta {\n constructor(e, t) {\n this.anchor = e, this.head = t;\n }\n map(e) {\n return new Ta(e.map(this.anchor), e.map(this.head));\n }\n resolve(e) {\n return ht.between(e.resolve(this.anchor), e.resolve(this.head));\n }\n}\nclass ot extends St {\n /**\n Create a node selection. Does not verify the validity of its\n argument.\n */\n constructor(e) {\n let t = e.nodeAfter, n = e.node(0).resolve(e.pos + t.nodeSize);\n super(e, n), this.node = t;\n }\n map(e, t) {\n let { deleted: n, pos: s } = t.mapResult(this.anchor), o = e.resolve(s);\n return n ? St.near(o) : new ot(o);\n }\n content() {\n return new De(ye.from(this.node), 0, 0);\n }\n eq(e) {\n return e instanceof ot && e.anchor == this.anchor;\n }\n toJSON() {\n return { type: \"node\", anchor: this.anchor };\n }\n getBookmark() {\n return new $c(this.anchor);\n }\n /**\n @internal\n */\n static fromJSON(e, t) {\n if (typeof t.anchor != \"number\")\n throw new RangeError(\"Invalid input for NodeSelection.fromJSON\");\n return new ot(e.resolve(t.anchor));\n }\n /**\n Create a node selection from non-resolved positions.\n */\n static create(e, t) {\n return new ot(e.resolve(t));\n }\n /**\n Determines whether the given node may be selected as a node\n selection.\n */\n static isSelectable(e) {\n return !e.isText && e.type.spec.selectable !== !1;\n }\n}\not.prototype.visible = !1;\nSt.jsonID(\"node\", ot);\nclass $c {\n constructor(e) {\n this.anchor = e;\n }\n map(e) {\n let { deleted: t, pos: n } = e.mapResult(this.anchor);\n return t ? new Ta(n, n) : new $c(n);\n }\n resolve(e) {\n let t = e.resolve(this.anchor), n = t.nodeAfter;\n return n && ot.isSelectable(n) ? new ot(t) : St.near(t);\n }\n}\nclass Zr extends St {\n /**\n Create an all-selection over the given document.\n */\n constructor(e) {\n super(e.resolve(0), e.resolve(e.content.size));\n }\n replace(e, t = De.empty) {\n if (t == De.empty) {\n e.delete(0, e.doc.content.size);\n let n = St.atStart(e.doc);\n n.eq(e.selection) || e.setSelection(n);\n } else\n super.replace(e, t);\n }\n toJSON() {\n return { type: \"all\" };\n }\n /**\n @internal\n */\n static fromJSON(e) {\n return new Zr(e);\n }\n map(e) {\n return new Zr(e);\n }\n eq(e) {\n return e instanceof Zr;\n }\n getBookmark() {\n return e0;\n }\n}\nSt.jsonID(\"all\", Zr);\nconst e0 = {\n map() {\n return this;\n },\n resolve(r) {\n return new Zr(r);\n }\n};\nfunction Fs(r, e, t, n, s, o = !1) {\n if (e.inlineContent)\n return ht.create(r, t);\n for (let i = n - (s > 0 ? 0 : 1); s > 0 ? i < e.childCount : i >= 0; i += s) {\n let a = e.child(i);\n if (a.isAtom) {\n if (!o && ot.isSelectable(a))\n return ot.create(r, t - (s < 0 ? a.nodeSize : 0));\n } else {\n let l = Fs(r, a, t + s, s < 0 ? a.childCount : 0, s, o);\n if (l)\n return l;\n }\n t += a.nodeSize * s;\n }\n return null;\n}\nfunction tu(r, e, t) {\n let n = r.steps.length - 1;\n if (n < e)\n return;\n let s = r.steps[n];\n if (!(s instanceof wr || s instanceof Pr))\n return;\n let o = r.mapping.maps[n], i;\n o.forEach((a, l, d, u) => {\n i == null && (i = u);\n }), r.setSelection(St.near(r.doc.resolve(i), t));\n}\nconst ru = 1, di = 2, nu = 4;\nclass t0 extends xp {\n /**\n @internal\n */\n constructor(e) {\n super(e.doc), this.curSelectionFor = 0, this.updated = 0, this.meta = /* @__PURE__ */ Object.create(null), this.time = Date.now(), this.curSelection = e.selection, this.storedMarks = e.storedMarks;\n }\n /**\n The transaction's current selection. This defaults to the editor\n selection [mapped](https://prosemirror.net/docs/ref/#state.Selection.map) through the steps in the\n transaction, but can be overwritten with\n [`setSelection`](https://prosemirror.net/docs/ref/#state.Transaction.setSelection).\n */\n get selection() {\n return this.curSelectionFor < this.steps.length && (this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor)), this.curSelectionFor = this.steps.length), this.curSelection;\n }\n /**\n Update the transaction's current selection. Will determine the\n selection that the editor gets when the transaction is applied.\n */\n setSelection(e) {\n if (e.$from.doc != this.doc)\n throw new RangeError(\"Selection passed to setSelection must point at the current document\");\n return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | ru) & ~di, this.storedMarks = null, this;\n }\n /**\n Whether the selection was explicitly updated by this transaction.\n */\n get selectionSet() {\n return (this.updated & ru) > 0;\n }\n /**\n Set the current stored marks.\n */\n setStoredMarks(e) {\n return this.storedMarks = e, this.updated |= di, this;\n }\n /**\n Make sure the current stored marks or, if that is null, the marks\n at the selection, match the given set of marks. Does nothing if\n this is already the case.\n */\n ensureMarks(e) {\n return Gt.sameSet(this.storedMarks || this.selection.$from.marks(), e) || this.setStoredMarks(e), this;\n }\n /**\n Add a mark to the set of stored marks.\n */\n addStoredMark(e) {\n return this.ensureMarks(e.addToSet(this.storedMarks || this.selection.$head.marks()));\n }\n /**\n Remove a mark or mark type from the set of stored marks.\n */\n removeStoredMark(e) {\n return this.ensureMarks(e.removeFromSet(this.storedMarks || this.selection.$head.marks()));\n }\n /**\n Whether the stored marks were explicitly set for this transaction.\n */\n get storedMarksSet() {\n return (this.updated & di) > 0;\n }\n /**\n @internal\n */\n addStep(e, t) {\n super.addStep(e, t), this.updated = this.updated & ~di, this.storedMarks = null;\n }\n /**\n Update the timestamp for the transaction.\n */\n setTime(e) {\n return this.time = e, this;\n }\n /**\n Replace the current selection with the given slice.\n */\n replaceSelection(e) {\n return this.selection.replace(this, e), this;\n }\n /**\n Replace the selection with the given node. When `inheritMarks` is\n true and the content is inline, it inherits the marks from the\n place where it is inserted.\n */\n replaceSelectionWith(e, t = !0) {\n let n = this.selection;\n return t && (e = e.mark(this.storedMarks || (n.empty ? n.$from.marks() : n.$from.marksAcross(n.$to) || Gt.none))), n.replaceWith(this, e), this;\n }\n /**\n Delete the selection.\n */\n deleteSelection() {\n return this.selection.replace(this), this;\n }\n /**\n Replace the given range, or the selection if no range is given,\n with a text node containing the given string.\n */\n insertText(e, t, n) {\n let s = this.doc.type.schema;\n if (t == null)\n return e ? this.replaceSelectionWith(s.text(e), !0) : this.deleteSelection();\n {\n if (n == null && (n = t), !e)\n return this.deleteRange(t, n);\n let o = this.storedMarks;\n if (!o) {\n let i = this.doc.resolve(t);\n o = n == t ? i.marks() : i.marksAcross(this.doc.resolve(n));\n }\n return this.replaceRangeWith(t, n, s.text(e, o)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(St.near(this.selection.$to)), this;\n }\n }\n /**\n Store a metadata property in this transaction, keyed either by\n name or by plugin.\n */\n setMeta(e, t) {\n return this.meta[typeof e == \"string\" ? e : e.key] = t, this;\n }\n /**\n Retrieve a metadata property for a given name or plugin.\n */\n getMeta(e) {\n return this.meta[typeof e == \"string\" ? e : e.key];\n }\n /**\n Returns true if this transaction doesn't contain any metadata,\n and can thus safely be extended.\n */\n get isGeneric() {\n for (let e in this.meta)\n return !1;\n return !0;\n }\n /**\n Indicate that the editor should scroll the selection into view\n when updated to the state produced by this transaction.\n */\n scrollIntoView() {\n return this.updated |= nu, this;\n }\n /**\n True when this transaction has had `scrollIntoView` called on it.\n */\n get scrolledIntoView() {\n return (this.updated & nu) > 0;\n }\n}\nfunction su(r, e) {\n return !e || !r ? r : r.bind(e);\n}\nclass mo {\n constructor(e, t, n) {\n this.name = e, this.init = su(t.init, n), this.apply = su(t.apply, n);\n }\n}\nconst r0 = [\n new mo(\"doc\", {\n init(r) {\n return r.doc || r.schema.topNodeType.createAndFill();\n },\n apply(r) {\n return r.doc;\n }\n }),\n new mo(\"selection\", {\n init(r, e) {\n return r.selection || St.atStart(e.doc);\n },\n apply(r) {\n return r.selection;\n }\n }),\n new mo(\"storedMarks\", {\n init(r) {\n return r.storedMarks || null;\n },\n apply(r, e, t, n) {\n return n.selection.$cursor ? r.storedMarks : null;\n }\n }),\n new mo(\"scrollToSelection\", {\n init() {\n return 0;\n },\n apply(r, e) {\n return r.scrolledIntoView ? e + 1 : e;\n }\n })\n];\nclass rl {\n constructor(e, t) {\n this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = r0.slice(), t && t.forEach((n) => {\n if (this.pluginsByKey[n.key])\n throw new RangeError(\"Adding different instances of a keyed plugin (\" + n.key + \")\");\n this.plugins.push(n), this.pluginsByKey[n.key] = n, n.spec.state && this.fields.push(new mo(n.key, n.spec.state, n));\n });\n }\n}\nclass qs {\n /**\n @internal\n */\n constructor(e) {\n this.config = e;\n }\n /**\n The schema of the state's document.\n */\n get schema() {\n return this.config.schema;\n }\n /**\n The plugins that are active in this state.\n */\n get plugins() {\n return this.config.plugins;\n }\n /**\n Apply the given transaction to produce a new state.\n */\n apply(e) {\n return this.applyTransaction(e).state;\n }\n /**\n @internal\n */\n filterTransaction(e, t = -1) {\n for (let n = 0; n < this.config.plugins.length; n++)\n if (n != t) {\n let s = this.config.plugins[n];\n if (s.spec.filterTransaction && !s.spec.filterTransaction.call(s, e, this))\n return !1;\n }\n return !0;\n }\n /**\n Verbose variant of [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) that\n returns the precise transactions that were applied (which might\n be influenced by the [transaction\n hooks](https://prosemirror.net/docs/ref/#state.PluginSpec.filterTransaction) of\n plugins) along with the new state.\n */\n applyTransaction(e) {\n if (!this.filterTransaction(e))\n return { state: this, transactions: [] };\n let t = [e], n = this.applyInner(e), s = null;\n for (; ; ) {\n let o = !1;\n for (let i = 0; i < this.config.plugins.length; i++) {\n let a = this.config.plugins[i];\n if (a.spec.appendTransaction) {\n let l = s ? s[i].n : 0, d = s ? s[i].state : this, u = l < t.length && a.spec.appendTransaction.call(a, l ? t.slice(l) : t, d, n);\n if (u && n.filterTransaction(u, i)) {\n if (u.setMeta(\"appendedTransaction\", e), !s) {\n s = [];\n for (let f = 0; f < this.config.plugins.length; f++)\n s.push(f < i ? { state: n, n: t.length } : { state: this, n: 0 });\n }\n t.push(u), n = n.applyInner(u), o = !0;\n }\n s && (s[i] = { state: n, n: t.length });\n }\n }\n if (!o)\n return { state: n, transactions: t };\n }\n }\n /**\n @internal\n */\n applyInner(e) {\n if (!e.before.eq(this.doc))\n throw new RangeError(\"Applying a mismatched transaction\");\n let t = new qs(this.config), n = this.config.fields;\n for (let s = 0; s < n.length; s++) {\n let o = n[s];\n t[o.name] = o.apply(e, this[o.name], this, t);\n }\n return t;\n }\n /**\n Accessor that constructs and returns a new [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.\n */\n get tr() {\n return new t0(this);\n }\n /**\n Create a new state.\n */\n static create(e) {\n let t = new rl(e.doc ? e.doc.type.schema : e.schema, e.plugins), n = new qs(t);\n for (let s = 0; s < t.fields.length; s++)\n n[t.fields[s].name] = t.fields[s].init(e, n);\n return n;\n }\n /**\n Create a new state based on this one, but with an adjusted set\n of active plugins. State fields that exist in both sets of\n plugins are kept unchanged. Those that no longer exist are\n dropped, and those that are new are initialized using their\n [`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new\n configuration object..\n */\n reconfigure(e) {\n let t = new rl(this.schema, e.plugins), n = t.fields, s = new qs(t);\n for (let o = 0; o < n.length; o++) {\n let i = n[o].name;\n s[i] = this.hasOwnProperty(i) ? this[i] : n[o].init(e, s);\n }\n return s;\n }\n /**\n Serialize this state to JSON. If you want to serialize the state\n of plugins, pass an object mapping property names to use in the\n resulting JSON object to plugin objects. The argument may also be\n a string or number, in which case it is ignored, to support the\n way `JSON.stringify` calls `toString` methods.\n */\n toJSON(e) {\n let t = { doc: this.doc.toJSON(), selection: this.selection.toJSON() };\n if (this.storedMarks && (t.storedMarks = this.storedMarks.map((n) => n.toJSON())), e && typeof e == \"object\")\n for (let n in e) {\n if (n == \"doc\" || n == \"selection\")\n throw new RangeError(\"The JSON fields `doc` and `selection` are reserved\");\n let s = e[n], o = s.spec.state;\n o && o.toJSON && (t[n] = o.toJSON.call(s, this[s.key]));\n }\n return t;\n }\n /**\n Deserialize a JSON representation of a state. `config` should\n have at least a `schema` field, and should contain array of\n plugins to initialize the state with. `pluginFields` can be used\n to deserialize the state of plugins, by associating plugin\n instances with the property names they use in the JSON object.\n */\n static fromJSON(e, t, n) {\n if (!t)\n throw new RangeError(\"Invalid input for EditorState.fromJSON\");\n if (!e.schema)\n throw new RangeError(\"Required config field 'schema' missing\");\n let s = new rl(e.schema, e.plugins), o = new qs(s);\n return s.fields.forEach((i) => {\n if (i.name == \"doc\")\n o.doc = gn.fromJSON(e.schema, t.doc);\n else if (i.name == \"selection\")\n o.selection = St.fromJSON(o.doc, t.selection);\n else if (i.name == \"storedMarks\")\n t.storedMarks && (o.storedMarks = t.storedMarks.map(e.schema.markFromJSON));\n else {\n if (n)\n for (let a in n) {\n let l = n[a], d = l.spec.state;\n if (l.key == i.name && d && d.fromJSON && Object.prototype.hasOwnProperty.call(t, a)) {\n o[i.name] = d.fromJSON.call(l, e, t[a], o);\n return;\n }\n }\n o[i.name] = i.init(e, o);\n }\n }), o;\n }\n}\nfunction wp(r, e, t) {\n for (let n in r) {\n let s = r[n];\n s instanceof Function ? s = s.bind(e) : n == \"handleDOMEvents\" && (s = wp(s, e, {})), t[n] = s;\n }\n return t;\n}\nclass mr {\n /**\n Create a plugin.\n */\n constructor(e) {\n this.spec = e, this.props = {}, e.props && wp(e.props, this, this.props), this.key = e.key ? e.key.key : kp(\"plugin\");\n }\n /**\n Extract the plugin's state field from an editor state.\n */\n getState(e) {\n return e[this.key];\n }\n}\nconst nl = /* @__PURE__ */ Object.create(null);\nfunction kp(r) {\n return r in nl ? r + \"$\" + ++nl[r] : (nl[r] = 0, r + \"$\");\n}\nclass Or {\n /**\n Create a plugin key.\n */\n constructor(e = \"key\") {\n this.key = kp(e);\n }\n /**\n Get the active plugin with this key, if any, from an editor\n state.\n */\n get(e) {\n return e.config.pluginsByKey[this.key];\n }\n /**\n Get the plugin's state from an editor state.\n */\n getState(e) {\n return e[this.key];\n }\n}\nconst Ic = (r, e) => r.selection.empty ? !1 : (e && e(r.tr.deleteSelection().scrollIntoView()), !0);\nfunction Cp(r, e) {\n let { $cursor: t } = r.selection;\n return !t || (e ? !e.endOfTextblock(\"backward\", r) : t.parentOffset > 0) ? null : t;\n}\nconst _p = (r, e, t) => {\n let n = Cp(r, t);\n if (!n)\n return !1;\n let s = zc(n);\n if (!s) {\n let i = n.blockRange(), a = i && so(i);\n return a == null ? !1 : (e && e(r.tr.lift(i, a).scrollIntoView()), !0);\n }\n let o = s.nodeBefore;\n if ($p(r, s, e, -1))\n return !0;\n if (n.parent.content.size == 0 && (Qs(o, \"end\") || ot.isSelectable(o)))\n for (let i = n.depth; ; i--) {\n let a = Ea(r.doc, n.before(i), n.after(i), De.empty);\n if (a && a.slice.size < a.to - a.from) {\n if (e) {\n let l = r.tr.step(a);\n l.setSelection(Qs(o, \"end\") ? St.findFrom(l.doc.resolve(l.mapping.map(s.pos, -1)), -1) : ot.create(l.doc, s.pos - o.nodeSize)), e(l.scrollIntoView());\n }\n return !0;\n }\n if (i == 1 || n.node(i - 1).childCount > 1)\n break;\n }\n return o.isAtom && s.depth == n.depth - 1 ? (e && e(r.tr.delete(s.pos - o.nodeSize, s.pos).scrollIntoView()), !0) : !1;\n}, n0 = (r, e, t) => {\n let n = Cp(r, t);\n if (!n)\n return !1;\n let s = zc(n);\n return s ? Sp(r, s, e) : !1;\n}, s0 = (r, e, t) => {\n let n = Tp(r, t);\n if (!n)\n return !1;\n let s = Rc(n);\n return s ? Sp(r, s, e) : !1;\n};\nfunction Sp(r, e, t) {\n let n = e.nodeBefore, s = n, o = e.pos - 1;\n for (; !s.isTextblock; o--) {\n if (s.type.spec.isolating)\n return !1;\n let u = s.lastChild;\n if (!u)\n return !1;\n s = u;\n }\n let i = e.nodeAfter, a = i, l = e.pos + 1;\n for (; !a.isTextblock; l++) {\n if (a.type.spec.isolating)\n return !1;\n let u = a.firstChild;\n if (!u)\n return !1;\n a = u;\n }\n let d = Ea(r.doc, o, l, De.empty);\n if (!d || d.from != o || d instanceof wr && d.slice.size >= l - o)\n return !1;\n if (t) {\n let u = r.tr.step(d);\n u.setSelection(ht.create(u.doc, o)), t(u.scrollIntoView());\n }\n return !0;\n}\nfunction Qs(r, e, t = !1) {\n for (let n = r; n; n = e == \"start\" ? n.firstChild : n.lastChild) {\n if (n.isTextblock)\n return !0;\n if (t && n.childCount != 1)\n return !1;\n }\n return !1;\n}\nconst Ep = (r, e, t) => {\n let { $head: n, empty: s } = r.selection, o = n;\n if (!s)\n return !1;\n if (n.parent.isTextblock) {\n if (t ? !t.endOfTextblock(\"backward\", r) : n.parentOffset > 0)\n return !1;\n o = zc(n);\n }\n let i = o && o.nodeBefore;\n return !i || !ot.isSelectable(i) ? !1 : (e && e(r.tr.setSelection(ot.create(r.doc, o.pos - i.nodeSize)).scrollIntoView()), !0);\n};\nfunction zc(r) {\n if (!r.parent.type.spec.isolating)\n for (let e = r.depth - 1; e >= 0; e--) {\n if (r.index(e) > 0)\n return r.doc.resolve(r.before(e + 1));\n if (r.node(e).type.spec.isolating)\n break;\n }\n return null;\n}\nfunction Tp(r, e) {\n let { $cursor: t } = r.selection;\n return !t || (e ? !e.endOfTextblock(\"forward\", r) : t.parentOffset < t.parent.content.size) ? null : t;\n}\nconst Mp = (r, e, t) => {\n let n = Tp(r, t);\n if (!n)\n return !1;\n let s = Rc(n);\n if (!s)\n return !1;\n let o = s.nodeAfter;\n if ($p(r, s, e, 1))\n return !0;\n if (n.parent.content.size == 0 && (Qs(o, \"start\") || ot.isSelectable(o))) {\n let i = Ea(r.doc, n.before(), n.after(), De.empty);\n if (i && i.slice.size < i.to - i.from) {\n if (e) {\n let a = r.tr.step(i);\n a.setSelection(Qs(o, \"start\") ? St.findFrom(a.doc.resolve(a.mapping.map(s.pos)), 1) : ot.create(a.doc, a.mapping.map(s.pos))), e(a.scrollIntoView());\n }\n return !0;\n }\n }\n return o.isAtom && s.depth == n.depth - 1 ? (e && e(r.tr.delete(s.pos, s.pos + o.nodeSize).scrollIntoView()), !0) : !1;\n}, Ap = (r, e, t) => {\n let { $head: n, empty: s } = r.selection, o = n;\n if (!s)\n return !1;\n if (n.parent.isTextblock) {\n if (t ? !t.endOfTextblock(\"forward\", r) : n.parentOffset < n.parent.content.size)\n return !1;\n o = Rc(n);\n }\n let i = o && o.nodeAfter;\n return !i || !ot.isSelectable(i) ? !1 : (e && e(r.tr.setSelection(ot.create(r.doc, o.pos)).scrollIntoView()), !0);\n};\nfunction Rc(r) {\n if (!r.parent.type.spec.isolating)\n for (let e = r.depth - 1; e >= 0; e--) {\n let t = r.node(e);\n if (r.index(e) + 1 < t.childCount)\n return r.doc.resolve(r.after(e + 1));\n if (t.type.spec.isolating)\n break;\n }\n return null;\n}\nconst o0 = (r, e) => {\n let t = r.selection, n = t instanceof ot, s;\n if (n) {\n if (t.node.isTextblock || !ds(r.doc, t.from))\n return !1;\n s = t.from;\n } else if (s = Sa(r.doc, t.from, -1), s == null)\n return !1;\n if (e) {\n let o = r.tr.join(s);\n n && o.setSelection(ot.create(o.doc, s - r.doc.resolve(s).nodeBefore.nodeSize)), e(o.scrollIntoView());\n }\n return !0;\n}, i0 = (r, e) => {\n let t = r.selection, n;\n if (t instanceof ot) {\n if (t.node.isTextblock || !ds(r.doc, t.to))\n return !1;\n n = t.to;\n } else if (n = Sa(r.doc, t.to, 1), n == null)\n return !1;\n return e && e(r.tr.join(n).scrollIntoView()), !0;\n}, a0 = (r, e) => {\n let { $from: t, $to: n } = r.selection, s = t.blockRange(n), o = s && so(s);\n return o == null ? !1 : (e && e(r.tr.lift(s, o).scrollIntoView()), !0);\n}, Pp = (r, e) => {\n let { $head: t, $anchor: n } = r.selection;\n return !t.parent.type.spec.code || !t.sameParent(n) ? !1 : (e && e(r.tr.insertText(`\n`).scrollIntoView()), !0);\n};\nfunction jc(r) {\n for (let e = 0; e < r.edgeCount; e++) {\n let { type: t } = r.edge(e);\n if (t.isTextblock && !t.hasRequiredAttrs())\n return t;\n }\n return null;\n}\nconst l0 = (r, e) => {\n let { $head: t, $anchor: n } = r.selection;\n if (!t.parent.type.spec.code || !t.sameParent(n))\n return !1;\n let s = t.node(-1), o = t.indexAfter(-1), i = jc(s.contentMatchAt(o));\n if (!i || !s.canReplaceWith(o, o, i))\n return !1;\n if (e) {\n let a = t.after(), l = r.tr.replaceWith(a, a, i.createAndFill());\n l.setSelection(St.near(l.doc.resolve(a), 1)), e(l.scrollIntoView());\n }\n return !0;\n}, Np = (r, e) => {\n let t = r.selection, { $from: n, $to: s } = t;\n if (t instanceof Zr || n.parent.inlineContent || s.parent.inlineContent)\n return !1;\n let o = jc(s.parent.contentMatchAt(s.indexAfter()));\n if (!o || !o.isTextblock)\n return !1;\n if (e) {\n let i = (!n.parentOffset && s.index() < s.parent.childCount ? n : s).pos, a = r.tr.insert(i, o.createAndFill());\n a.setSelection(ht.create(a.doc, i + 1)), e(a.scrollIntoView());\n }\n return !0;\n}, Op = (r, e) => {\n let { $cursor: t } = r.selection;\n if (!t || t.parent.content.size)\n return !1;\n if (t.depth > 1 && t.after() != t.end(-1)) {\n let o = t.before();\n if (Dn(r.doc, o))\n return e && e(r.tr.split(o).scrollIntoView()), !0;\n }\n let n = t.blockRange(), s = n && so(n);\n return s == null ? !1 : (e && e(r.tr.lift(n, s).scrollIntoView()), !0);\n};\nfunction c0(r) {\n return (e, t) => {\n let { $from: n, $to: s } = e.selection;\n if (e.selection instanceof ot && e.selection.node.isBlock)\n return !n.parentOffset || !Dn(e.doc, n.pos) ? !1 : (t && t(e.tr.split(n.pos).scrollIntoView()), !0);\n if (!n.depth)\n return !1;\n let o = [], i, a, l = !1, d = !1;\n for (let p = n.depth; ; p--)\n if (n.node(p).isBlock) {\n l = n.end(p) == n.pos + (n.depth - p), d = n.start(p) == n.pos - (n.depth - p), a = jc(n.node(p - 1).contentMatchAt(n.indexAfter(p - 1))), o.unshift(l && a ? { type: a } : null), i = p;\n break;\n } else {\n if (p == 1)\n return !1;\n o.unshift(null);\n }\n let u = e.tr;\n (e.selection instanceof ht || e.selection instanceof Zr) && u.deleteSelection();\n let f = u.mapping.map(n.pos), h = Dn(u.doc, f, o.length, o);\n if (h || (o[0] = a ? { type: a } : null, h = Dn(u.doc, f, o.length, o)), !h)\n return !1;\n if (u.split(f, o.length, o), !l && d && n.node(i).type != a) {\n let p = u.mapping.map(n.before(i)), g = u.doc.resolve(p);\n a && n.node(i - 1).canReplaceWith(g.index(), g.index() + 1, a) && u.setNodeMarkup(u.mapping.map(n.before(i)), a);\n }\n return t && t(u.scrollIntoView()), !0;\n };\n}\nconst d0 = c0(), u0 = (r, e) => {\n let { $from: t, to: n } = r.selection, s, o = t.sharedDepth(n);\n return o == 0 ? !1 : (s = t.before(o), e && e(r.tr.setSelection(ot.create(r.doc, s))), !0);\n};\nfunction f0(r, e, t) {\n let n = e.nodeBefore, s = e.nodeAfter, o = e.index();\n return !n || !s || !n.type.compatibleContent(s.type) ? !1 : !n.content.size && e.parent.canReplace(o - 1, o) ? (t && t(r.tr.delete(e.pos - n.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(o, o + 1) || !(s.isTextblock || ds(r.doc, e.pos)) ? !1 : (t && t(r.tr.join(e.pos).scrollIntoView()), !0);\n}\nfunction $p(r, e, t, n) {\n let s = e.nodeBefore, o = e.nodeAfter, i, a, l = s.type.spec.isolating || o.type.spec.isolating;\n if (!l && f0(r, e, t))\n return !0;\n let d = !l && e.parent.canReplace(e.index(), e.index() + 1);\n if (d && (i = (a = s.contentMatchAt(s.childCount)).findWrapping(o.type)) && a.matchType(i[0] || o.type).validEnd) {\n if (t) {\n let p = e.pos + o.nodeSize, g = ye.empty;\n for (let C = i.length - 1; C >= 0; C--)\n g = ye.from(i[C].create(null, g));\n g = ye.from(s.copy(g));\n let b = r.tr.step(new Pr(e.pos - 1, p, e.pos, p, new De(g, 1, 0), i.length, !0)), y = b.doc.resolve(p + 2 * i.length);\n y.nodeAfter && y.nodeAfter.type == s.type && ds(b.doc, y.pos) && b.join(y.pos), t(b.scrollIntoView());\n }\n return !0;\n }\n let u = o.type.spec.isolating || n > 0 && l ? null : St.findFrom(e, 1), f = u && u.$from.blockRange(u.$to), h = f && so(f);\n if (h != null && h >= e.depth)\n return t && t(r.tr.lift(f, h).scrollIntoView()), !0;\n if (d && Qs(o, \"start\", !0) && Qs(s, \"end\")) {\n let p = s, g = [];\n for (; g.push(p), !p.isTextblock; )\n p = p.lastChild;\n let b = o, y = 1;\n for (; !b.isTextblock; b = b.firstChild)\n y++;\n if (p.canReplace(p.childCount, p.childCount, b.content)) {\n if (t) {\n let C = ye.empty;\n for (let R = g.length - 1; R >= 0; R--)\n C = ye.from(g[R].copy(C));\n let E = r.tr.step(new Pr(e.pos - g.length, e.pos + o.nodeSize, e.pos + y, e.pos + o.nodeSize - y, new De(C, g.length, 0), 0, !0));\n t(E.scrollIntoView());\n }\n return !0;\n }\n }\n return !1;\n}\nfunction Ip(r) {\n return function(e, t) {\n let n = e.selection, s = r < 0 ? n.$from : n.$to, o = s.depth;\n for (; s.node(o).isInline; ) {\n if (!o)\n return !1;\n o--;\n }\n return s.node(o).isTextblock ? (t && t(e.tr.setSelection(ht.create(e.doc, r < 0 ? s.start(o) : s.end(o)))), !0) : !1;\n };\n}\nconst p0 = Ip(-1), h0 = Ip(1);\nfunction m0(r, e = null) {\n return function(t, n) {\n let { $from: s, $to: o } = t.selection, i = s.blockRange(o), a = i && Oc(i, r, e);\n return a ? (n && n(t.tr.wrap(i, a).scrollIntoView()), !0) : !1;\n };\n}\nfunction ou(r, e = null) {\n return function(t, n) {\n let s = !1;\n for (let o = 0; o < t.selection.ranges.length && !s; o++) {\n let { $from: { pos: i }, $to: { pos: a } } = t.selection.ranges[o];\n t.doc.nodesBetween(i, a, (l, d) => {\n if (s)\n return !1;\n if (!(!l.isTextblock || l.hasMarkup(r, e)))\n if (l.type == r)\n s = !0;\n else {\n let u = t.doc.resolve(d), f = u.index();\n s = u.parent.canReplaceWith(f, f + 1, r);\n }\n });\n }\n if (!s)\n return !1;\n if (n) {\n let o = t.tr;\n for (let i = 0; i < t.selection.ranges.length; i++) {\n let { $from: { pos: a }, $to: { pos: l } } = t.selection.ranges[i];\n o.setBlockType(a, l, r, e);\n }\n n(o.scrollIntoView());\n }\n return !0;\n };\n}\nfunction Lc(...r) {\n return function(e, t, n) {\n for (let s = 0; s < r.length; s++)\n if (r[s](e, t, n))\n return !0;\n return !1;\n };\n}\nLc(Ic, _p, Ep);\nLc(Ic, Mp, Ap);\nLc(Pp, Np, Op, d0);\ntypeof navigator < \"u\" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < \"u\" && os.platform && os.platform() == \"darwin\";\nfunction v0(r, e = null) {\n return function(t, n) {\n let { $from: s, $to: o } = t.selection, i = s.blockRange(o);\n if (!i)\n return !1;\n let a = n ? t.tr : null;\n return g0(a, i, r, e) ? (n && n(a.scrollIntoView()), !0) : !1;\n };\n}\nfunction g0(r, e, t, n = null) {\n let s = !1, o = e, i = e.$from.doc;\n if (e.depth >= 2 && e.$from.node(e.depth - 1).type.compatibleContent(t) && e.startIndex == 0) {\n if (e.$from.index(e.depth - 1) == 0)\n return !1;\n let l = i.resolve(e.start - 2);\n o = new zi(l, l, e.depth), e.endIndex < e.parent.childCount && (e = new zi(e.$from, i.resolve(e.$to.end(e.depth)), e.depth)), s = !0;\n }\n let a = Oc(o, t, n, e);\n return a ? (r && b0(r, e, a, s, t), !0) : !1;\n}\nfunction b0(r, e, t, n, s) {\n let o = ye.empty;\n for (let u = t.length - 1; u >= 0; u--)\n o = ye.from(t[u].type.create(t[u].attrs, o));\n r.step(new Pr(e.start - (n ? 2 : 0), e.end, e.start, e.end, new De(o, 0, 0), t.length, !0));\n let i = 0;\n for (let u = 0; u < t.length; u++)\n t[u].type == s && (i = u + 1);\n let a = t.length - i, l = e.start + t.length - (n ? 2 : 0), d = e.parent;\n for (let u = e.startIndex, f = e.endIndex, h = !0; u < f; u++, h = !1)\n !h && Dn(r.doc, l, a) && (r.split(l, a), l += 2 * a), l += d.child(u).nodeSize;\n return r;\n}\nfunction y0(r) {\n return function(e, t) {\n let { $from: n, $to: s } = e.selection, o = n.blockRange(s, (i) => i.childCount > 0 && i.firstChild.type == r);\n return o ? t ? n.node(o.depth - 1).type == r ? x0(e, t, r, o) : w0(e, t, o) : !0 : !1;\n };\n}\nfunction x0(r, e, t, n) {\n let s = r.tr, o = n.end, i = n.$to.end(n.depth);\n o < i && (s.step(new Pr(o - 1, i, o, i, new De(ye.from(t.create(null, n.parent.copy())), 1, 0), 1, !0)), n = new zi(s.doc.resolve(n.$from.pos), s.doc.resolve(i), n.depth));\n const a = so(n);\n if (a == null)\n return !1;\n s.lift(n, a);\n let l = s.doc.resolve(s.mapping.map(o, -1) - 1);\n return ds(s.doc, l.pos) && l.nodeBefore.type == l.nodeAfter.type && s.join(l.pos), e(s.scrollIntoView()), !0;\n}\nfunction w0(r, e, t) {\n let n = r.tr, s = t.parent;\n for (let p = t.end, g = t.endIndex - 1, b = t.startIndex; g > b; g--)\n p -= s.child(g).nodeSize, n.delete(p - 1, p + 1);\n let o = n.doc.resolve(t.start), i = o.nodeAfter;\n if (n.mapping.map(t.end) != t.start + o.nodeAfter.nodeSize)\n return !1;\n let a = t.startIndex == 0, l = t.endIndex == s.childCount, d = o.node(-1), u = o.index(-1);\n if (!d.canReplace(u + (a ? 0 : 1), u + 1, i.content.append(l ? ye.empty : ye.from(s))))\n return !1;\n let f = o.pos, h = f + i.nodeSize;\n return n.step(new Pr(f - (a ? 1 : 0), h + (l ? 1 : 0), f + 1, h - 1, new De((a ? ye.empty : ye.from(s.copy(ye.empty))).append(l ? ye.empty : ye.from(s.copy(ye.empty))), a ? 0 : 1, l ? 0 : 1), a ? 0 : 1)), e(n.scrollIntoView()), !0;\n}\nfunction k0(r) {\n return function(e, t) {\n let { $from: n, $to: s } = e.selection, o = n.blockRange(s, (d) => d.childCount > 0 && d.firstChild.type == r);\n if (!o)\n return !1;\n let i = o.startIndex;\n if (i == 0)\n return !1;\n let a = o.parent, l = a.child(i - 1);\n if (l.type != r)\n return !1;\n if (t) {\n let d = l.lastChild && l.lastChild.type == a.type, u = ye.from(d ? r.create() : null), f = new De(ye.from(r.create(null, ye.from(a.type.create(null, u)))), d ? 3 : 1, 0), h = o.start, p = o.end;\n t(e.tr.step(new Pr(h - (d ? 3 : 1), p, h, p, f, 1, !0)).scrollIntoView());\n }\n return !0;\n };\n}\nconst zr = function(r) {\n for (var e = 0; ; e++)\n if (r = r.previousSibling, !r)\n return e;\n}, Zs = function(r) {\n let e = r.assignedSlot || r.parentNode;\n return e && e.nodeType == 11 ? e.host : e;\n};\nlet Il = null;\nconst Rn = function(r, e, t) {\n let n = Il || (Il = document.createRange());\n return n.setEnd(r, t ?? r.nodeValue.length), n.setStart(r, e || 0), n;\n}, C0 = function() {\n Il = null;\n}, Os = function(r, e, t, n) {\n return t && (iu(r, e, t, n, -1) || iu(r, e, t, n, 1));\n}, _0 = /^(img|br|input|textarea|hr)$/i;\nfunction iu(r, e, t, n, s) {\n for (var o; ; ) {\n if (r == t && e == n)\n return !0;\n if (e == (s < 0 ? 0 : ln(r))) {\n let i = r.parentNode;\n if (!i || i.nodeType != 1 || Qo(r) || _0.test(r.nodeName) || r.contentEditable == \"false\")\n return !1;\n e = zr(r) + (s < 0 ? 0 : 1), r = i;\n } else if (r.nodeType == 1) {\n let i = r.childNodes[e + (s < 0 ? -1 : 0)];\n if (i.nodeType == 1 && i.contentEditable == \"false\")\n if (!((o = i.pmViewDesc) === null || o === void 0) && o.ignoreForSelection)\n e += s;\n else\n return !1;\n else\n r = i, e = s < 0 ? ln(r) : 0;\n } else\n return !1;\n }\n}\nfunction ln(r) {\n return r.nodeType == 3 ? r.nodeValue.length : r.childNodes.length;\n}\nfunction S0(r, e) {\n for (; ; ) {\n if (r.nodeType == 3 && e)\n return r;\n if (r.nodeType == 1 && e > 0) {\n if (r.contentEditable == \"false\")\n return null;\n r = r.childNodes[e - 1], e = ln(r);\n } else if (r.parentNode && !Qo(r))\n e = zr(r), r = r.parentNode;\n else\n return null;\n }\n}\nfunction E0(r, e) {\n for (; ; ) {\n if (r.nodeType == 3 && e < r.nodeValue.length)\n return r;\n if (r.nodeType == 1 && e < r.childNodes.length) {\n if (r.contentEditable == \"false\")\n return null;\n r = r.childNodes[e], e = 0;\n } else if (r.parentNode && !Qo(r))\n e = zr(r) + 1, r = r.parentNode;\n else\n return null;\n }\n}\nfunction T0(r, e, t) {\n for (let n = e == 0, s = e == ln(r); n || s; ) {\n if (r == t)\n return !0;\n let o = zr(r);\n if (r = r.parentNode, !r)\n return !1;\n n = n && o == 0, s = s && o == ln(r);\n }\n}\nfunction Qo(r) {\n let e;\n for (let t = r; t && !(e = t.pmViewDesc); t = t.parentNode)\n ;\n return e && e.node && e.node.isBlock && (e.dom == r || e.contentDOM == r);\n}\nconst Ma = function(r) {\n return r.focusNode && Os(r.focusNode, r.focusOffset, r.anchorNode, r.anchorOffset);\n};\nfunction gs(r, e) {\n let t = document.createEvent(\"Event\");\n return t.initEvent(\"keydown\", !0, !0), t.keyCode = r, t.key = t.code = e, t;\n}\nfunction M0(r) {\n let e = r.activeElement;\n for (; e && e.shadowRoot; )\n e = e.shadowRoot.activeElement;\n return e;\n}\nfunction A0(r, e, t) {\n if (r.caretPositionFromPoint)\n try {\n let n = r.caretPositionFromPoint(e, t);\n if (n)\n return { node: n.offsetNode, offset: Math.min(ln(n.offsetNode), n.offset) };\n } catch {\n }\n if (r.caretRangeFromPoint) {\n let n = r.caretRangeFromPoint(e, t);\n if (n)\n return { node: n.startContainer, offset: Math.min(ln(n.startContainer), n.startOffset) };\n }\n}\nconst Sn = typeof navigator < \"u\" ? navigator : null, au = typeof document < \"u\" ? document : null, us = Sn && Sn.userAgent || \"\", zl = /Edge\\/(\\d+)/.exec(us), zp = /MSIE \\d/.exec(us), Rl = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(us), Gr = !!(zp || Rl || zl), rs = zp ? document.documentMode : Rl ? +Rl[1] : zl ? +zl[1] : 0, cn = !Gr && /gecko\\/(\\d+)/i.test(us);\ncn && +(/Firefox\\/(\\d+)/.exec(us) || [0, 0])[1];\nconst jl = !Gr && /Chrome\\/(\\d+)/.exec(us), jr = !!jl, Rp = jl ? +jl[1] : 0, Br = !Gr && !!Sn && /Apple Computer/.test(Sn.vendor), eo = Br && (/Mobile\\/\\w+/.test(us) || !!Sn && Sn.maxTouchPoints > 2), an = eo || (Sn ? /Mac/.test(Sn.platform) : !1), jp = Sn ? /Win/.test(Sn.platform) : !1, Ln = /Android \\d/.test(us), Zo = !!au && \"webkitFontSmoothing\" in au.documentElement.style, P0 = Zo ? +(/\\bAppleWebKit\\/(\\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;\nfunction N0(r) {\n let e = r.defaultView && r.defaultView.visualViewport;\n return e ? {\n left: 0,\n right: e.width,\n top: 0,\n bottom: e.height\n } : {\n left: 0,\n right: r.documentElement.clientWidth,\n top: 0,\n bottom: r.documentElement.clientHeight\n };\n}\nfunction Nn(r, e) {\n return typeof r == \"number\" ? r : r[e];\n}\nfunction O0(r) {\n let e = r.getBoundingClientRect(), t = e.width / r.offsetWidth || 1, n = e.height / r.offsetHeight || 1;\n return {\n left: e.left,\n right: e.left + r.clientWidth * t,\n top: e.top,\n bottom: e.top + r.clientHeight * n\n };\n}\nfunction lu(r, e, t) {\n let n = r.someProp(\"scrollThreshold\") || 0, s = r.someProp(\"scrollMargin\") || 5, o = r.dom.ownerDocument;\n for (let i = t || r.dom; i; ) {\n if (i.nodeType != 1) {\n i = Zs(i);\n continue;\n }\n let a = i, l = a == o.body, d = l ? N0(o) : O0(a), u = 0, f = 0;\n if (e.top < d.top + Nn(n, \"top\") ? f = -(d.top - e.top + Nn(s, \"top\")) : e.bottom > d.bottom - Nn(n, \"bottom\") && (f = e.bottom - e.top > d.bottom - d.top ? e.top + Nn(s, \"top\") - d.top : e.bottom - d.bottom + Nn(s, \"bottom\")), e.left < d.left + Nn(n, \"left\") ? u = -(d.left - e.left + Nn(s, \"left\")) : e.right > d.right - Nn(n, \"right\") && (u = e.right - d.right + Nn(s, \"right\")), u || f)\n if (l)\n o.defaultView.scrollBy(u, f);\n else {\n let p = a.scrollLeft, g = a.scrollTop;\n f && (a.scrollTop += f), u && (a.scrollLeft += u);\n let b = a.scrollLeft - p, y = a.scrollTop - g;\n e = { left: e.left - b, top: e.top - y, right: e.right - b, bottom: e.bottom - y };\n }\n let h = l ? \"fixed\" : getComputedStyle(i).position;\n if (/^(fixed|sticky)$/.test(h))\n break;\n i = h == \"absolute\" ? i.offsetParent : Zs(i);\n }\n}\nfunction $0(r) {\n let e = r.dom.getBoundingClientRect(), t = Math.max(0, e.top), n, s;\n for (let o = (e.left + e.right) / 2, i = t + 1; i < Math.min(innerHeight, e.bottom); i += 5) {\n let a = r.root.elementFromPoint(o, i);\n if (!a || a == r.dom || !r.dom.contains(a))\n continue;\n let l = a.getBoundingClientRect();\n if (l.top >= t - 20) {\n n = a, s = l.top;\n break;\n }\n }\n return { refDOM: n, refTop: s, stack: Lp(r.dom) };\n}\nfunction Lp(r) {\n let e = [], t = r.ownerDocument;\n for (let n = r; n && (e.push({ dom: n, top: n.scrollTop, left: n.scrollLeft }), r != t); n = Zs(n))\n ;\n return e;\n}\nfunction I0({ refDOM: r, refTop: e, stack: t }) {\n let n = r ? r.getBoundingClientRect().top : 0;\n Dp(t, n == 0 ? 0 : n - e);\n}\nfunction Dp(r, e) {\n for (let t = 0; t < r.length; t++) {\n let { dom: n, top: s, left: o } = r[t];\n n.scrollTop != s + e && (n.scrollTop = s + e), n.scrollLeft != o && (n.scrollLeft = o);\n }\n}\nlet Ls = null;\nfunction z0(r) {\n if (r.setActive)\n return r.setActive();\n if (Ls)\n return r.focus(Ls);\n let e = Lp(r);\n r.focus(Ls == null ? {\n get preventScroll() {\n return Ls = { preventScroll: !0 }, !0;\n }\n } : void 0), Ls || (Ls = !1, Dp(e, 0));\n}\nfunction Fp(r, e) {\n let t, n = 2e8, s, o = 0, i = e.top, a = e.top, l, d;\n for (let u = r.firstChild, f = 0; u; u = u.nextSibling, f++) {\n let h;\n if (u.nodeType == 1)\n h = u.getClientRects();\n else if (u.nodeType == 3)\n h = Rn(u).getClientRects();\n else\n continue;\n for (let p = 0; p < h.length; p++) {\n let g = h[p];\n if (g.top <= i && g.bottom >= a) {\n i = Math.max(g.bottom, i), a = Math.min(g.top, a);\n let b = g.left > e.left ? g.left - e.left : g.right < e.left ? e.left - g.right : 0;\n if (b < n) {\n t = u, n = b, s = b && t.nodeType == 3 ? {\n left: g.right < e.left ? g.right : g.left,\n top: e.top\n } : e, u.nodeType == 1 && b && (o = f + (e.left >= (g.left + g.right) / 2 ? 1 : 0));\n continue;\n }\n } else g.top > e.top && !l && g.left <= e.left && g.right >= e.left && (l = u, d = { left: Math.max(g.left, Math.min(g.right, e.left)), top: g.top });\n !t && (e.left >= g.right && e.top >= g.top || e.left >= g.left && e.top >= g.bottom) && (o = f + 1);\n }\n }\n return !t && l && (t = l, s = d, n = 0), t && t.nodeType == 3 ? R0(t, s) : !t || n && t.nodeType == 1 ? { node: r, offset: o } : Fp(t, s);\n}\nfunction R0(r, e) {\n let t = r.nodeValue.length, n = document.createRange(), s;\n for (let o = 0; o < t; o++) {\n n.setEnd(r, o + 1), n.setStart(r, o);\n let i = Wn(n, 1);\n if (i.top != i.bottom && Dc(e, i)) {\n s = { node: r, offset: o + (e.left >= (i.left + i.right) / 2 ? 1 : 0) };\n break;\n }\n }\n return n.detach(), s || { node: r, offset: 0 };\n}\nfunction Dc(r, e) {\n return r.left >= e.left - 1 && r.left <= e.right + 1 && r.top >= e.top - 1 && r.top <= e.bottom + 1;\n}\nfunction j0(r, e) {\n let t = r.parentNode;\n return t && /^li$/i.test(t.nodeName) && e.left < r.getBoundingClientRect().left ? t : r;\n}\nfunction L0(r, e, t) {\n let { node: n, offset: s } = Fp(e, t), o = -1;\n if (n.nodeType == 1 && !n.firstChild) {\n let i = n.getBoundingClientRect();\n o = i.left != i.right && t.left > (i.left + i.right) / 2 ? 1 : -1;\n }\n return r.docView.posFromDOM(n, s, o);\n}\nfunction D0(r, e, t, n) {\n let s = -1;\n for (let o = e, i = !1; o != r.dom; ) {\n let a = r.docView.nearestDesc(o, !0), l;\n if (!a)\n return null;\n if (a.dom.nodeType == 1 && (a.node.isBlock && a.parent || !a.contentDOM) && // Ignore elements with zero-size bounding rectangles\n ((l = a.dom.getBoundingClientRect()).width || l.height) && (a.node.isBlock && a.parent && !/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName) && (!i && l.left > n.left || l.top > n.top ? s = a.posBefore : (!i && l.right < n.left || l.bottom < n.top) && (s = a.posAfter), i = !0), !a.contentDOM && s < 0 && !a.node.isText))\n return (a.node.isBlock ? n.top < (l.top + l.bottom) / 2 : n.left < (l.left + l.right) / 2) ? a.posBefore : a.posAfter;\n o = a.dom.parentNode;\n }\n return s > -1 ? s : r.docView.posFromDOM(e, t, -1);\n}\nfunction Bp(r, e, t) {\n let n = r.childNodes.length;\n if (n && t.top < t.bottom)\n for (let s = Math.max(0, Math.min(n - 1, Math.floor(n * (e.top - t.top) / (t.bottom - t.top)) - 2)), o = s; ; ) {\n let i = r.childNodes[o];\n if (i.nodeType == 1) {\n let a = i.getClientRects();\n for (let l = 0; l < a.length; l++) {\n let d = a[l];\n if (Dc(e, d))\n return Bp(i, e, d);\n }\n }\n if ((o = (o + 1) % n) == s)\n break;\n }\n return r;\n}\nfunction F0(r, e) {\n let t = r.dom.ownerDocument, n, s = 0, o = A0(t, e.left, e.top);\n o && ({ node: n, offset: s } = o);\n let i = (r.root.elementFromPoint ? r.root : t).elementFromPoint(e.left, e.top), a;\n if (!i || !r.dom.contains(i.nodeType != 1 ? i.parentNode : i)) {\n let d = r.dom.getBoundingClientRect();\n if (!Dc(e, d) || (i = Bp(r.dom, e, d), !i))\n return null;\n }\n if (Br)\n for (let d = i; n && d; d = Zs(d))\n d.draggable && (n = void 0);\n if (i = j0(i, e), n) {\n if (cn && n.nodeType == 1 && (s = Math.min(s, n.childNodes.length), s < n.childNodes.length)) {\n let u = n.childNodes[s], f;\n u.nodeName == \"IMG\" && (f = u.getBoundingClientRect()).right <= e.left && f.bottom > e.top && s++;\n }\n let d;\n Zo && s && n.nodeType == 1 && (d = n.childNodes[s - 1]).nodeType == 1 && d.contentEditable == \"false\" && d.getBoundingClientRect().top >= e.top && s--, n == r.dom && s == n.childNodes.length - 1 && n.lastChild.nodeType == 1 && e.top > n.lastChild.getBoundingClientRect().bottom ? a = r.state.doc.content.size : (s == 0 || n.nodeType != 1 || n.childNodes[s - 1].nodeName != \"BR\") && (a = D0(r, n, s, e));\n }\n a == null && (a = L0(r, i, e));\n let l = r.docView.nearestDesc(i, !0);\n return { pos: a, inside: l ? l.posAtStart - l.border : -1 };\n}\nfunction cu(r) {\n return r.top < r.bottom || r.left < r.right;\n}\nfunction Wn(r, e) {\n let t = r.getClientRects();\n if (t.length) {\n let n = t[e < 0 ? 0 : t.length - 1];\n if (cu(n))\n return n;\n }\n return Array.prototype.find.call(t, cu) || r.getBoundingClientRect();\n}\nconst B0 = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\nfunction Hp(r, e, t) {\n let { node: n, offset: s, atom: o } = r.docView.domFromPos(e, t < 0 ? -1 : 1), i = Zo || cn;\n if (n.nodeType == 3)\n if (i && (B0.test(n.nodeValue) || (t < 0 ? !s : s == n.nodeValue.length))) {\n let l = Wn(Rn(n, s, s), t);\n if (cn && s && /\\s/.test(n.nodeValue[s - 1]) && s < n.nodeValue.length) {\n let d = Wn(Rn(n, s - 1, s - 1), -1);\n if (d.top == l.top) {\n let u = Wn(Rn(n, s, s + 1), -1);\n if (u.top != l.top)\n return io(u, u.left < d.left);\n }\n }\n return l;\n } else {\n let l = s, d = s, u = t < 0 ? 1 : -1;\n return t < 0 && !s ? (d++, u = -1) : t >= 0 && s == n.nodeValue.length ? (l--, u = 1) : t < 0 ? l-- : d++, io(Wn(Rn(n, l, d), u), u < 0);\n }\n if (!r.state.doc.resolve(e - (o || 0)).parent.inlineContent) {\n if (o == null && s && (t < 0 || s == ln(n))) {\n let l = n.childNodes[s - 1];\n if (l.nodeType == 1)\n return sl(l.getBoundingClientRect(), !1);\n }\n if (o == null && s < ln(n)) {\n let l = n.childNodes[s];\n if (l.nodeType == 1)\n return sl(l.getBoundingClientRect(), !0);\n }\n return sl(n.getBoundingClientRect(), t >= 0);\n }\n if (o == null && s && (t < 0 || s == ln(n))) {\n let l = n.childNodes[s - 1], d = l.nodeType == 3 ? Rn(l, ln(l) - (i ? 0 : 1)) : l.nodeType == 1 && (l.nodeName != \"BR\" || !l.nextSibling) ? l : null;\n if (d)\n return io(Wn(d, 1), !1);\n }\n if (o == null && s < ln(n)) {\n let l = n.childNodes[s];\n for (; l.pmViewDesc && l.pmViewDesc.ignoreForCoords; )\n l = l.nextSibling;\n let d = l ? l.nodeType == 3 ? Rn(l, 0, i ? 0 : 1) : l.nodeType == 1 ? l : null : null;\n if (d)\n return io(Wn(d, -1), !0);\n }\n return io(Wn(n.nodeType == 3 ? Rn(n) : n, -t), t >= 0);\n}\nfunction io(r, e) {\n if (r.width == 0)\n return r;\n let t = e ? r.left : r.right;\n return { top: r.top, bottom: r.bottom, left: t, right: t };\n}\nfunction sl(r, e) {\n if (r.height == 0)\n return r;\n let t = e ? r.top : r.bottom;\n return { top: t, bottom: t, left: r.left, right: r.right };\n}\nfunction qp(r, e, t) {\n let n = r.state, s = r.root.activeElement;\n n != e && r.updateState(e), s != r.dom && r.focus();\n try {\n return t();\n } finally {\n n != e && r.updateState(n), s != r.dom && s && s.focus();\n }\n}\nfunction H0(r, e, t) {\n let n = e.selection, s = t == \"up\" ? n.$from : n.$to;\n return qp(r, e, () => {\n let { node: o } = r.docView.domFromPos(s.pos, t == \"up\" ? -1 : 1);\n for (; ; ) {\n let a = r.docView.nearestDesc(o, !0);\n if (!a)\n break;\n if (a.node.isBlock) {\n o = a.contentDOM || a.dom;\n break;\n }\n o = a.dom.parentNode;\n }\n let i = Hp(r, s.pos, 1);\n for (let a = o.firstChild; a; a = a.nextSibling) {\n let l;\n if (a.nodeType == 1)\n l = a.getClientRects();\n else if (a.nodeType == 3)\n l = Rn(a, 0, a.nodeValue.length).getClientRects();\n else\n continue;\n for (let d = 0; d < l.length; d++) {\n let u = l[d];\n if (u.bottom > u.top + 1 && (t == \"up\" ? i.top - u.top > (u.bottom - i.top) * 2 : u.bottom - i.bottom > (i.bottom - u.top) * 2))\n return !1;\n }\n }\n return !0;\n });\n}\nconst q0 = /[\\u0590-\\u08ac]/;\nfunction V0(r, e, t) {\n let { $head: n } = e.selection;\n if (!n.parent.isTextblock)\n return !1;\n let s = n.parentOffset, o = !s, i = s == n.parent.content.size, a = r.domSelection();\n return a ? !q0.test(n.parent.textContent) || !a.modify ? t == \"left\" || t == \"backward\" ? o : i : qp(r, e, () => {\n let { focusNode: l, focusOffset: d, anchorNode: u, anchorOffset: f } = r.domSelectionRange(), h = a.caretBidiLevel;\n a.modify(\"move\", t, \"character\");\n let p = n.depth ? r.docView.domAfterPos(n.before()) : r.dom, { focusNode: g, focusOffset: b } = r.domSelectionRange(), y = g && !p.contains(g.nodeType == 1 ? g : g.parentNode) || l == g && d == b;\n try {\n a.collapse(u, f), l && (l != u || d != f) && a.extend && a.extend(l, d);\n } catch {\n }\n return h != null && (a.caretBidiLevel = h), y;\n }) : n.pos == n.start() || n.pos == n.end();\n}\nlet du = null, uu = null, fu = !1;\nfunction W0(r, e, t) {\n return du == e && uu == t ? fu : (du = e, uu = t, fu = t == \"up\" || t == \"down\" ? H0(r, e, t) : V0(r, e, t));\n}\nconst dn = 0, pu = 1, xs = 2, En = 3;\nclass ei {\n constructor(e, t, n, s) {\n this.parent = e, this.children = t, this.dom = n, this.contentDOM = s, this.dirty = dn, n.pmViewDesc = this;\n }\n // Used to check whether a given description corresponds to a\n // widget/mark/node.\n matchesWidget(e) {\n return !1;\n }\n matchesMark(e) {\n return !1;\n }\n matchesNode(e, t, n) {\n return !1;\n }\n matchesHack(e) {\n return !1;\n }\n // When parsing in-editor content (in domchange.js), we allow\n // descriptions to determine the parse rules that should be used to\n // parse them.\n parseRule() {\n return null;\n }\n // Used by the editor's event handler to ignore events that come\n // from certain descs.\n stopEvent(e) {\n return !1;\n }\n // The size of the content represented by this desc.\n get size() {\n let e = 0;\n for (let t = 0; t < this.children.length; t++)\n e += this.children[t].size;\n return e;\n }\n // For block nodes, this represents the space taken up by their\n // start/end tokens.\n get border() {\n return 0;\n }\n destroy() {\n this.parent = void 0, this.dom.pmViewDesc == this && (this.dom.pmViewDesc = void 0);\n for (let e = 0; e < this.children.length; e++)\n this.children[e].destroy();\n }\n posBeforeChild(e) {\n for (let t = 0, n = this.posAtStart; ; t++) {\n let s = this.children[t];\n if (s == e)\n return n;\n n += s.size;\n }\n }\n get posBefore() {\n return this.parent.posBeforeChild(this);\n }\n get posAtStart() {\n return this.parent ? this.parent.posBeforeChild(this) + this.border : 0;\n }\n get posAfter() {\n return this.posBefore + this.size;\n }\n get posAtEnd() {\n return this.posAtStart + this.size - 2 * this.border;\n }\n localPosFromDOM(e, t, n) {\n if (this.contentDOM && this.contentDOM.contains(e.nodeType == 1 ? e : e.parentNode))\n if (n < 0) {\n let o, i;\n if (e == this.contentDOM)\n o = e.childNodes[t - 1];\n else {\n for (; e.parentNode != this.contentDOM; )\n e = e.parentNode;\n o = e.previousSibling;\n }\n for (; o && !((i = o.pmViewDesc) && i.parent == this); )\n o = o.previousSibling;\n return o ? this.posBeforeChild(i) + i.size : this.posAtStart;\n } else {\n let o, i;\n if (e == this.contentDOM)\n o = e.childNodes[t];\n else {\n for (; e.parentNode != this.contentDOM; )\n e = e.parentNode;\n o = e.nextSibling;\n }\n for (; o && !((i = o.pmViewDesc) && i.parent == this); )\n o = o.nextSibling;\n return o ? this.posBeforeChild(i) : this.posAtEnd;\n }\n let s;\n if (e == this.dom && this.contentDOM)\n s = t > zr(this.contentDOM);\n else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM))\n s = e.compareDocumentPosition(this.contentDOM) & 2;\n else if (this.dom.firstChild) {\n if (t == 0)\n for (let o = e; ; o = o.parentNode) {\n if (o == this.dom) {\n s = !1;\n break;\n }\n if (o.previousSibling)\n break;\n }\n if (s == null && t == e.childNodes.length)\n for (let o = e; ; o = o.parentNode) {\n if (o == this.dom) {\n s = !0;\n break;\n }\n if (o.nextSibling)\n break;\n }\n }\n return s ?? n > 0 ? this.posAtEnd : this.posAtStart;\n }\n nearestDesc(e, t = !1) {\n for (let n = !0, s = e; s; s = s.parentNode) {\n let o = this.getDesc(s), i;\n if (o && (!t || o.node))\n if (n && (i = o.nodeDOM) && !(i.nodeType == 1 ? i.contains(e.nodeType == 1 ? e : e.parentNode) : i == e))\n n = !1;\n else\n return o;\n }\n }\n getDesc(e) {\n let t = e.pmViewDesc;\n for (let n = t; n; n = n.parent)\n if (n == this)\n return t;\n }\n posFromDOM(e, t, n) {\n for (let s = e; s; s = s.parentNode) {\n let o = this.getDesc(s);\n if (o)\n return o.localPosFromDOM(e, t, n);\n }\n return -1;\n }\n // Find the desc for the node after the given pos, if any. (When a\n // parent node overrode rendering, there might not be one.)\n descAt(e) {\n for (let t = 0, n = 0; t < this.children.length; t++) {\n let s = this.children[t], o = n + s.size;\n if (n == e && o != n) {\n for (; !s.border && s.children.length; )\n for (let i = 0; i < s.children.length; i++) {\n let a = s.children[i];\n if (a.size) {\n s = a;\n break;\n }\n }\n return s;\n }\n if (e < o)\n return s.descAt(e - n - s.border);\n n = o;\n }\n }\n domFromPos(e, t) {\n if (!this.contentDOM)\n return { node: this.dom, offset: 0, atom: e + 1 };\n let n = 0, s = 0;\n for (let o = 0; n < this.children.length; n++) {\n let i = this.children[n], a = o + i.size;\n if (a > e || i instanceof Wp) {\n s = e - o;\n break;\n }\n o = a;\n }\n if (s)\n return this.children[n].domFromPos(s - this.children[n].border, t);\n for (let o; n && !(o = this.children[n - 1]).size && o instanceof Vp && o.side >= 0; n--)\n ;\n if (t <= 0) {\n let o, i = !0;\n for (; o = n ? this.children[n - 1] : null, !(!o || o.dom.parentNode == this.contentDOM); n--, i = !1)\n ;\n return o && t && i && !o.border && !o.domAtom ? o.domFromPos(o.size, t) : { node: this.contentDOM, offset: o ? zr(o.dom) + 1 : 0 };\n } else {\n let o, i = !0;\n for (; o = n < this.children.length ? this.children[n] : null, !(!o || o.dom.parentNode == this.contentDOM); n++, i = !1)\n ;\n return o && i && !o.border && !o.domAtom ? o.domFromPos(0, t) : { node: this.contentDOM, offset: o ? zr(o.dom) : this.contentDOM.childNodes.length };\n }\n }\n // Used to find a DOM range in a single parent for a given changed\n // range.\n parseRange(e, t, n = 0) {\n if (this.children.length == 0)\n return { node: this.contentDOM, from: e, to: t, fromOffset: 0, toOffset: this.contentDOM.childNodes.length };\n let s = -1, o = -1;\n for (let i = n, a = 0; ; a++) {\n let l = this.children[a], d = i + l.size;\n if (s == -1 && e <= d) {\n let u = i + l.border;\n if (e >= u && t <= d - l.border && l.node && l.contentDOM && this.contentDOM.contains(l.contentDOM))\n return l.parseRange(e, t, u);\n e = i;\n for (let f = a; f > 0; f--) {\n let h = this.children[f - 1];\n if (h.size && h.dom.parentNode == this.contentDOM && !h.emptyChildAt(1)) {\n s = zr(h.dom) + 1;\n break;\n }\n e -= h.size;\n }\n s == -1 && (s = 0);\n }\n if (s > -1 && (d > t || a == this.children.length - 1)) {\n t = d;\n for (let u = a + 1; u < this.children.length; u++) {\n let f = this.children[u];\n if (f.size && f.dom.parentNode == this.contentDOM && !f.emptyChildAt(-1)) {\n o = zr(f.dom);\n break;\n }\n t += f.size;\n }\n o == -1 && (o = this.contentDOM.childNodes.length);\n break;\n }\n i = d;\n }\n return { node: this.contentDOM, from: e, to: t, fromOffset: s, toOffset: o };\n }\n emptyChildAt(e) {\n if (this.border || !this.contentDOM || !this.children.length)\n return !1;\n let t = this.children[e < 0 ? 0 : this.children.length - 1];\n return t.size == 0 || t.emptyChildAt(e);\n }\n domAfterPos(e) {\n let { node: t, offset: n } = this.domFromPos(e, 0);\n if (t.nodeType != 1 || n == t.childNodes.length)\n throw new RangeError(\"No node after pos \" + e);\n return t.childNodes[n];\n }\n // View descs are responsible for setting any selection that falls\n // entirely inside of them, so that custom implementations can do\n // custom things with the selection. Note that this falls apart when\n // a selection starts in such a node and ends in another, in which\n // case we just use whatever domFromPos produces as a best effort.\n setSelection(e, t, n, s = !1) {\n let o = Math.min(e, t), i = Math.max(e, t);\n for (let p = 0, g = 0; p < this.children.length; p++) {\n let b = this.children[p], y = g + b.size;\n if (o > g && i < y)\n return b.setSelection(e - g - b.border, t - g - b.border, n, s);\n g = y;\n }\n let a = this.domFromPos(e, e ? -1 : 1), l = t == e ? a : this.domFromPos(t, t ? -1 : 1), d = n.root.getSelection(), u = n.domSelectionRange(), f = !1;\n if ((cn || Br) && e == t) {\n let { node: p, offset: g } = a;\n if (p.nodeType == 3) {\n if (f = !!(g && p.nodeValue[g - 1] == `\n`), f && g == p.nodeValue.length)\n for (let b = p, y; b; b = b.parentNode) {\n if (y = b.nextSibling) {\n y.nodeName == \"BR\" && (a = l = { node: y.parentNode, offset: zr(y) + 1 });\n break;\n }\n let C = b.pmViewDesc;\n if (C && C.node && C.node.isBlock)\n break;\n }\n } else {\n let b = p.childNodes[g - 1];\n f = b && (b.nodeName == \"BR\" || b.contentEditable == \"false\");\n }\n }\n if (cn && u.focusNode && u.focusNode != l.node && u.focusNode.nodeType == 1) {\n let p = u.focusNode.childNodes[u.focusOffset];\n p && p.contentEditable == \"false\" && (s = !0);\n }\n if (!(s || f && Br) && Os(a.node, a.offset, u.anchorNode, u.anchorOffset) && Os(l.node, l.offset, u.focusNode, u.focusOffset))\n return;\n let h = !1;\n if ((d.extend || e == t) && !(f && cn)) {\n d.collapse(a.node, a.offset);\n try {\n e != t && d.extend(l.node, l.offset), h = !0;\n } catch {\n }\n }\n if (!h) {\n if (e > t) {\n let g = a;\n a = l, l = g;\n }\n let p = document.createRange();\n p.setEnd(l.node, l.offset), p.setStart(a.node, a.offset), d.removeAllRanges(), d.addRange(p);\n }\n }\n ignoreMutation(e) {\n return !this.contentDOM && e.type != \"selection\";\n }\n get contentLost() {\n return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM);\n }\n // Remove a subtree of the element tree that has been touched\n // by a DOM change, so that the next update will redraw it.\n markDirty(e, t) {\n for (let n = 0, s = 0; s < this.children.length; s++) {\n let o = this.children[s], i = n + o.size;\n if (n == i ? e <= i && t >= n : e < i && t > n) {\n let a = n + o.border, l = i - o.border;\n if (e >= a && t <= l) {\n this.dirty = e == n || t == i ? xs : pu, e == a && t == l && (o.contentLost || o.dom.parentNode != this.contentDOM) ? o.dirty = En : o.markDirty(e - a, t - a);\n return;\n } else\n o.dirty = o.dom == o.contentDOM && o.dom.parentNode == this.contentDOM && !o.children.length ? xs : En;\n }\n n = i;\n }\n this.dirty = xs;\n }\n markParentsDirty() {\n let e = 1;\n for (let t = this.parent; t; t = t.parent, e++) {\n let n = e == 1 ? xs : pu;\n t.dirty < n && (t.dirty = n);\n }\n }\n get domAtom() {\n return !1;\n }\n get ignoreForCoords() {\n return !1;\n }\n get ignoreForSelection() {\n return !1;\n }\n isText(e) {\n return !1;\n }\n}\nclass Vp extends ei {\n constructor(e, t, n, s) {\n let o, i = t.type.toDOM;\n if (typeof i == \"function\" && (i = i(n, () => {\n if (!o)\n return s;\n if (o.parent)\n return o.parent.posBeforeChild(o);\n })), !t.type.spec.raw) {\n if (i.nodeType != 1) {\n let a = document.createElement(\"span\");\n a.appendChild(i), i = a;\n }\n i.contentEditable = \"false\", i.classList.add(\"ProseMirror-widget\");\n }\n super(e, [], i, null), this.widget = t, this.widget = t, o = this;\n }\n matchesWidget(e) {\n return this.dirty == dn && e.type.eq(this.widget.type);\n }\n parseRule() {\n return { ignore: !0 };\n }\n stopEvent(e) {\n let t = this.widget.spec.stopEvent;\n return t ? t(e) : !1;\n }\n ignoreMutation(e) {\n return e.type != \"selection\" || this.widget.spec.ignoreSelection;\n }\n destroy() {\n this.widget.type.destroy(this.dom), super.destroy();\n }\n get domAtom() {\n return !0;\n }\n get ignoreForSelection() {\n return !!this.widget.type.spec.relaxedSide;\n }\n get side() {\n return this.widget.type.side;\n }\n}\nclass U0 extends ei {\n constructor(e, t, n, s) {\n super(e, [], t, null), this.textDOM = n, this.text = s;\n }\n get size() {\n return this.text.length;\n }\n localPosFromDOM(e, t) {\n return e != this.textDOM ? this.posAtStart + (t ? this.size : 0) : this.posAtStart + t;\n }\n domFromPos(e) {\n return { node: this.textDOM, offset: e };\n }\n ignoreMutation(e) {\n return e.type === \"characterData\" && e.target.nodeValue == e.oldValue;\n }\n}\nclass $s extends ei {\n constructor(e, t, n, s, o) {\n super(e, [], n, s), this.mark = t, this.spec = o;\n }\n static create(e, t, n, s) {\n let o = s.nodeViews[t.type.name], i = o && o(t, s, n);\n return (!i || !i.dom) && (i = Is.renderSpec(document, t.type.spec.toDOM(t, n), null, t.attrs)), new $s(e, t, i.dom, i.contentDOM || i.dom, i);\n }\n parseRule() {\n return this.dirty & En || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };\n }\n matchesMark(e) {\n return this.dirty != En && this.mark.eq(e);\n }\n markDirty(e, t) {\n if (super.markDirty(e, t), this.dirty != dn) {\n let n = this.parent;\n for (; !n.node; )\n n = n.parent;\n n.dirty < this.dirty && (n.dirty = this.dirty), this.dirty = dn;\n }\n }\n slice(e, t, n) {\n let s = $s.create(this.parent, this.mark, !0, n), o = this.children, i = this.size;\n t < i && (o = Dl(o, t, i, n)), e > 0 && (o = Dl(o, 0, e, n));\n for (let a = 0; a < o.length; a++)\n o[a].parent = s;\n return s.children = o, s;\n }\n ignoreMutation(e) {\n return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);\n }\n destroy() {\n this.spec.destroy && this.spec.destroy(), super.destroy();\n }\n}\nclass ns extends ei {\n constructor(e, t, n, s, o, i, a, l, d) {\n super(e, [], o, i), this.node = t, this.outerDeco = n, this.innerDeco = s, this.nodeDOM = a;\n }\n // By default, a node is rendered using the `toDOM` method from the\n // node type spec. But client code can use the `nodeViews` spec to\n // supply a custom node view, which can influence various aspects of\n // the way the node works.\n //\n // (Using subclassing for this was intentionally decided against,\n // since it'd require exposing a whole slew of finicky\n // implementation details to the user code that they probably will\n // never need.)\n static create(e, t, n, s, o, i) {\n let a = o.nodeViews[t.type.name], l, d = a && a(t, o, () => {\n if (!l)\n return i;\n if (l.parent)\n return l.parent.posBeforeChild(l);\n }, n, s), u = d && d.dom, f = d && d.contentDOM;\n if (t.isText) {\n if (!u)\n u = document.createTextNode(t.text);\n else if (u.nodeType != 3)\n throw new RangeError(\"Text must be rendered as a DOM text node\");\n } else u || ({ dom: u, contentDOM: f } = Is.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));\n !f && !t.isText && u.nodeName != \"BR\" && (u.hasAttribute(\"contenteditable\") || (u.contentEditable = \"false\"), t.type.spec.draggable && (u.draggable = !0));\n let h = u;\n return u = Kp(u, n, t), d ? l = new J0(e, t, n, s, u, f || null, h, d, o, i + 1) : t.isText ? new Aa(e, t, n, s, u, h, o) : new ns(e, t, n, s, u, f || null, h, o, i + 1);\n }\n parseRule() {\n if (this.node.type.spec.reparseInView)\n return null;\n let e = { node: this.node.type.name, attrs: this.node.attrs };\n if (this.node.type.whitespace == \"pre\" && (e.preserveWhitespace = \"full\"), !this.contentDOM)\n e.getContent = () => this.node.content;\n else if (!this.contentLost)\n e.contentElement = this.contentDOM;\n else {\n for (let t = this.children.length - 1; t >= 0; t--) {\n let n = this.children[t];\n if (this.dom.contains(n.dom.parentNode)) {\n e.contentElement = n.dom.parentNode;\n break;\n }\n }\n e.contentElement || (e.getContent = () => ye.empty);\n }\n return e;\n }\n matchesNode(e, t, n) {\n return this.dirty == dn && e.eq(this.node) && ji(t, this.outerDeco) && n.eq(this.innerDeco);\n }\n get size() {\n return this.node.nodeSize;\n }\n get border() {\n return this.node.isLeaf ? 0 : 1;\n }\n // Syncs `this.children` to match `this.node.content` and the local\n // decorations, possibly introducing nesting for marks. Then, in a\n // separate step, syncs the DOM inside `this.contentDOM` to\n // `this.children`.\n updateChildren(e, t) {\n let n = this.node.inlineContent, s = t, o = e.composing ? this.localCompositionInfo(e, t) : null, i = o && o.pos > -1 ? o : null, a = o && o.pos < 0, l = new G0(this, i && i.node, e);\n Q0(this.node, this.innerDeco, (d, u, f) => {\n d.spec.marks ? l.syncToMarks(d.spec.marks, n, e, u) : d.type.side >= 0 && !f && l.syncToMarks(u == this.node.childCount ? Gt.none : this.node.child(u).marks, n, e, u), l.placeWidget(d, e, s);\n }, (d, u, f, h) => {\n l.syncToMarks(d.marks, n, e, h);\n let p;\n l.findNodeMatch(d, u, f, h) || a && e.state.selection.from > s && e.state.selection.to < s + d.nodeSize && (p = l.findIndexWithChild(o.node)) > -1 && l.updateNodeAt(d, u, f, p, e) || l.updateNextNode(d, u, f, e, h, s) || l.addNode(d, u, f, e, s), s += d.nodeSize;\n }), l.syncToMarks([], n, e, 0), this.node.isTextblock && l.addTextblockHacks(), l.destroyRest(), (l.changed || this.dirty == xs) && (i && this.protectLocalComposition(e, i), Up(this.contentDOM, this.children, e), eo && Z0(this.dom));\n }\n localCompositionInfo(e, t) {\n let { from: n, to: s } = e.state.selection;\n if (!(e.state.selection instanceof ht) || n < t || s > t + this.node.content.size)\n return null;\n let o = e.input.compositionNode;\n if (!o || !this.dom.contains(o.parentNode))\n return null;\n if (this.node.inlineContent) {\n let i = o.nodeValue, a = e1(this.node.content, i, n - t, s - t);\n return a < 0 ? null : { node: o, pos: a, text: i };\n } else\n return { node: o, pos: -1, text: \"\" };\n }\n protectLocalComposition(e, { node: t, pos: n, text: s }) {\n if (this.getDesc(t))\n return;\n let o = t;\n for (; o.parentNode != this.contentDOM; o = o.parentNode) {\n for (; o.previousSibling; )\n o.parentNode.removeChild(o.previousSibling);\n for (; o.nextSibling; )\n o.parentNode.removeChild(o.nextSibling);\n o.pmViewDesc && (o.pmViewDesc = void 0);\n }\n let i = new U0(this, o, t, s);\n e.input.compositionNodes.push(i), this.children = Dl(this.children, n, n + s.length, e, i);\n }\n // If this desc must be updated to match the given node decoration,\n // do so and return true.\n update(e, t, n, s) {\n return this.dirty == En || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, n, s), !0);\n }\n updateInner(e, t, n, s) {\n this.updateOuterDeco(t), this.node = e, this.innerDeco = n, this.contentDOM && this.updateChildren(s, this.posAtStart), this.dirty = dn;\n }\n updateOuterDeco(e) {\n if (ji(e, this.outerDeco))\n return;\n let t = this.nodeDOM.nodeType != 1, n = this.dom;\n this.dom = Jp(this.dom, this.nodeDOM, Ll(this.outerDeco, this.node, t), Ll(e, this.node, t)), this.dom != n && (n.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;\n }\n // Mark this node as being the selected node.\n selectNode() {\n this.nodeDOM.nodeType == 1 && (this.nodeDOM.classList.add(\"ProseMirror-selectednode\"), (this.contentDOM || !this.node.type.spec.draggable) && (this.nodeDOM.draggable = !0));\n }\n // Remove selected node marking from this node.\n deselectNode() {\n this.nodeDOM.nodeType == 1 && (this.nodeDOM.classList.remove(\"ProseMirror-selectednode\"), (this.contentDOM || !this.node.type.spec.draggable) && this.nodeDOM.removeAttribute(\"draggable\"));\n }\n get domAtom() {\n return this.node.isAtom;\n }\n}\nfunction hu(r, e, t, n, s) {\n Kp(n, e, r);\n let o = new ns(void 0, r, e, t, n, n, n, s, 0);\n return o.contentDOM && o.updateChildren(s, 0), o;\n}\nclass Aa extends ns {\n constructor(e, t, n, s, o, i, a) {\n super(e, t, n, s, o, null, i, a, 0);\n }\n parseRule() {\n let e = this.nodeDOM.parentNode;\n for (; e && e != this.dom && !e.pmIsDeco; )\n e = e.parentNode;\n return { skip: e || !0 };\n }\n update(e, t, n, s) {\n return this.dirty == En || this.dirty != dn && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != dn || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, s.trackWrites == this.nodeDOM && (s.trackWrites = null)), this.node = e, this.dirty = dn, !0);\n }\n inParent() {\n let e = this.parent.contentDOM;\n for (let t = this.nodeDOM; t; t = t.parentNode)\n if (t == e)\n return !0;\n return !1;\n }\n domFromPos(e) {\n return { node: this.nodeDOM, offset: e };\n }\n localPosFromDOM(e, t, n) {\n return e == this.nodeDOM ? this.posAtStart + Math.min(t, this.node.text.length) : super.localPosFromDOM(e, t, n);\n }\n ignoreMutation(e) {\n return e.type != \"characterData\" && e.type != \"selection\";\n }\n slice(e, t, n) {\n let s = this.node.cut(e, t), o = document.createTextNode(s.text);\n return new Aa(this.parent, s, this.outerDeco, this.innerDeco, o, o, n);\n }\n markDirty(e, t) {\n super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = En);\n }\n get domAtom() {\n return !1;\n }\n isText(e) {\n return this.node.text == e;\n }\n}\nclass Wp extends ei {\n parseRule() {\n return { ignore: !0 };\n }\n matchesHack(e) {\n return this.dirty == dn && this.dom.nodeName == e;\n }\n get domAtom() {\n return !0;\n }\n get ignoreForCoords() {\n return this.dom.nodeName == \"IMG\";\n }\n}\nclass J0 extends ns {\n constructor(e, t, n, s, o, i, a, l, d, u) {\n super(e, t, n, s, o, i, a, d, u), this.spec = l;\n }\n // A custom `update` method gets to decide whether the update goes\n // through. If it does, and there's a `contentDOM` node, our logic\n // updates the children.\n update(e, t, n, s) {\n if (this.dirty == En)\n return !1;\n if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {\n let o = this.spec.update(e, t, n);\n return o && this.updateInner(e, t, n, s), o;\n } else return !this.contentDOM && !e.isLeaf ? !1 : super.update(e, t, n, s);\n }\n selectNode() {\n this.spec.selectNode ? this.spec.selectNode() : super.selectNode();\n }\n deselectNode() {\n this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();\n }\n setSelection(e, t, n, s) {\n this.spec.setSelection ? this.spec.setSelection(e, t, n.root) : super.setSelection(e, t, n, s);\n }\n destroy() {\n this.spec.destroy && this.spec.destroy(), super.destroy();\n }\n stopEvent(e) {\n return this.spec.stopEvent ? this.spec.stopEvent(e) : !1;\n }\n ignoreMutation(e) {\n return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);\n }\n}\nfunction Up(r, e, t) {\n let n = r.firstChild, s = !1;\n for (let o = 0; o < e.length; o++) {\n let i = e[o], a = i.dom;\n if (a.parentNode == r) {\n for (; a != n; )\n n = mu(n), s = !0;\n n = n.nextSibling;\n } else\n s = !0, r.insertBefore(a, n);\n if (i instanceof $s) {\n let l = n ? n.previousSibling : r.lastChild;\n Up(i.contentDOM, i.children, t), n = l ? l.nextSibling : r.firstChild;\n }\n }\n for (; n; )\n n = mu(n), s = !0;\n s && t.trackWrites == r && (t.trackWrites = null);\n}\nconst Co = function(r) {\n r && (this.nodeName = r);\n};\nCo.prototype = /* @__PURE__ */ Object.create(null);\nconst ws = [new Co()];\nfunction Ll(r, e, t) {\n if (r.length == 0)\n return ws;\n let n = t ? ws[0] : new Co(), s = [n];\n for (let o = 0; o < r.length; o++) {\n let i = r[o].type.attrs;\n if (i) {\n i.nodeName && s.push(n = new Co(i.nodeName));\n for (let a in i) {\n let l = i[a];\n l != null && (t && s.length == 1 && s.push(n = new Co(e.isInline ? \"span\" : \"div\")), a == \"class\" ? n.class = (n.class ? n.class + \" \" : \"\") + l : a == \"style\" ? n.style = (n.style ? n.style + \";\" : \"\") + l : a != \"nodeName\" && (n[a] = l));\n }\n }\n }\n return s;\n}\nfunction Jp(r, e, t, n) {\n if (t == ws && n == ws)\n return e;\n let s = e;\n for (let o = 0; o < n.length; o++) {\n let i = n[o], a = t[o];\n if (o) {\n let l;\n a && a.nodeName == i.nodeName && s != r && (l = s.parentNode) && l.nodeName.toLowerCase() == i.nodeName || (l = document.createElement(i.nodeName), l.pmIsDeco = !0, l.appendChild(s), a = ws[0]), s = l;\n }\n K0(s, a || ws[0], i);\n }\n return s;\n}\nfunction K0(r, e, t) {\n for (let n in e)\n n != \"class\" && n != \"style\" && n != \"nodeName\" && !(n in t) && r.removeAttribute(n);\n for (let n in t)\n n != \"class\" && n != \"style\" && n != \"nodeName\" && t[n] != e[n] && r.setAttribute(n, t[n]);\n if (e.class != t.class) {\n let n = e.class ? e.class.split(\" \").filter(Boolean) : [], s = t.class ? t.class.split(\" \").filter(Boolean) : [];\n for (let o = 0; o < n.length; o++)\n s.indexOf(n[o]) == -1 && r.classList.remove(n[o]);\n for (let o = 0; o < s.length; o++)\n n.indexOf(s[o]) == -1 && r.classList.add(s[o]);\n r.classList.length == 0 && r.removeAttribute(\"class\");\n }\n if (e.style != t.style) {\n if (e.style) {\n let n = /\\s*([\\w\\-\\xa1-\\uffff]+)\\s*:(?:\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|\\(.*?\\)|[^;])*/g, s;\n for (; s = n.exec(e.style); )\n r.style.removeProperty(s[1]);\n }\n t.style && (r.style.cssText += t.style);\n }\n}\nfunction Kp(r, e, t) {\n return Jp(r, r, ws, Ll(e, t, r.nodeType != 1));\n}\nfunction ji(r, e) {\n if (r.length != e.length)\n return !1;\n for (let t = 0; t < r.length; t++)\n if (!r[t].type.eq(e[t].type))\n return !1;\n return !0;\n}\nfunction mu(r) {\n let e = r.nextSibling;\n return r.parentNode.removeChild(r), e;\n}\nclass G0 {\n constructor(e, t, n) {\n this.lock = t, this.view = n, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = Y0(e.node.content, e);\n }\n // Destroy and remove the children between the given indices in\n // `this.top`.\n destroyBetween(e, t) {\n if (e != t) {\n for (let n = e; n < t; n++)\n this.top.children[n].destroy();\n this.top.children.splice(e, t - e), this.changed = !0;\n }\n }\n // Destroy all remaining children in `this.top`.\n destroyRest() {\n this.destroyBetween(this.index, this.top.children.length);\n }\n // Sync the current stack of mark descs with the given array of\n // marks, reusing existing mark descs when possible.\n syncToMarks(e, t, n, s) {\n let o = 0, i = this.stack.length >> 1, a = Math.min(i, e.length);\n for (; o < a && (o == i - 1 ? this.top : this.stack[o + 1 << 1]).matchesMark(e[o]) && e[o].type.spec.spanning !== !1; )\n o++;\n for (; o < i; )\n this.destroyRest(), this.top.dirty = dn, this.index = this.stack.pop(), this.top = this.stack.pop(), i--;\n for (; i < e.length; ) {\n this.stack.push(this.top, this.index + 1);\n let l = -1, d = this.top.children.length;\n s < this.preMatch.index && (d = Math.min(this.index + 3, d));\n for (let u = this.index; u < d; u++) {\n let f = this.top.children[u];\n if (f.matchesMark(e[i]) && !this.isLocked(f.dom)) {\n l = u;\n break;\n }\n }\n if (l > -1)\n l > this.index && (this.changed = !0, this.destroyBetween(this.index, l)), this.top = this.top.children[this.index];\n else {\n let u = $s.create(this.top, e[i], t, n);\n this.top.children.splice(this.index, 0, u), this.top = u, this.changed = !0;\n }\n this.index = 0, i++;\n }\n }\n // Try to find a node desc matching the given data. Skip over it and\n // return true when successful.\n findNodeMatch(e, t, n, s) {\n let o = -1, i;\n if (s >= this.preMatch.index && (i = this.preMatch.matches[s - this.preMatch.index]).parent == this.top && i.matchesNode(e, t, n))\n o = this.top.children.indexOf(i, this.index);\n else\n for (let a = this.index, l = Math.min(this.top.children.length, a + 5); a < l; a++) {\n let d = this.top.children[a];\n if (d.matchesNode(e, t, n) && !this.preMatch.matched.has(d)) {\n o = a;\n break;\n }\n }\n return o < 0 ? !1 : (this.destroyBetween(this.index, o), this.index++, !0);\n }\n updateNodeAt(e, t, n, s, o) {\n let i = this.top.children[s];\n return i.dirty == En && i.dom == i.contentDOM && (i.dirty = xs), i.update(e, t, n, o) ? (this.destroyBetween(this.index, s), this.index++, !0) : !1;\n }\n findIndexWithChild(e) {\n for (; ; ) {\n let t = e.parentNode;\n if (!t)\n return -1;\n if (t == this.top.contentDOM) {\n let n = e.pmViewDesc;\n if (n) {\n for (let s = this.index; s < this.top.children.length; s++)\n if (this.top.children[s] == n)\n return s;\n }\n return -1;\n }\n e = t;\n }\n }\n // Try to update the next node, if any, to the given data. Checks\n // pre-matches to avoid overwriting nodes that could still be used.\n updateNextNode(e, t, n, s, o, i) {\n for (let a = this.index; a < this.top.children.length; a++) {\n let l = this.top.children[a];\n if (l instanceof ns) {\n let d = this.preMatch.matched.get(l);\n if (d != null && d != o)\n return !1;\n let u = l.dom, f, h = this.isLocked(u) && !(e.isText && l.node && l.node.isText && l.nodeDOM.nodeValue == e.text && l.dirty != En && ji(t, l.outerDeco));\n if (!h && l.update(e, t, n, s))\n return this.destroyBetween(this.index, a), l.dom != u && (this.changed = !0), this.index++, !0;\n if (!h && (f = this.recreateWrapper(l, e, t, n, s, i)))\n return this.destroyBetween(this.index, a), this.top.children[this.index] = f, f.contentDOM && (f.dirty = xs, f.updateChildren(s, i + 1), f.dirty = dn), this.changed = !0, this.index++, !0;\n break;\n }\n }\n return !1;\n }\n // When a node with content is replaced by a different node with\n // identical content, move over its children.\n recreateWrapper(e, t, n, s, o, i) {\n if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !ji(n, e.outerDeco) || !s.eq(e.innerDeco))\n return null;\n let a = ns.create(this.top, t, n, s, o, i);\n if (a.contentDOM) {\n a.children = e.children, e.children = [];\n for (let l of a.children)\n l.parent = a;\n }\n return e.destroy(), a;\n }\n // Insert the node as a newly created node desc.\n addNode(e, t, n, s, o) {\n let i = ns.create(this.top, e, t, n, s, o);\n i.contentDOM && i.updateChildren(s, o + 1), this.top.children.splice(this.index++, 0, i), this.changed = !0;\n }\n placeWidget(e, t, n) {\n let s = this.index < this.top.children.length ? this.top.children[this.index] : null;\n if (s && s.matchesWidget(e) && (e == s.widget || !s.widget.type.toDOM.parentNode))\n this.index++;\n else {\n let o = new Vp(this.top, e, t, n);\n this.top.children.splice(this.index++, 0, o), this.changed = !0;\n }\n }\n // Make sure a textblock looks and behaves correctly in\n // contentEditable.\n addTextblockHacks() {\n let e = this.top.children[this.index - 1], t = this.top;\n for (; e instanceof $s; )\n t = e, e = t.children[t.children.length - 1];\n (!e || // Empty textblock\n !(e instanceof Aa) || /\\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\\s$/.test(e.node.text)) && ((Br || jr) && e && e.dom.contentEditable == \"false\" && this.addHackNode(\"IMG\", t), this.addHackNode(\"BR\", this.top));\n }\n addHackNode(e, t) {\n if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))\n this.index++;\n else {\n let n = document.createElement(e);\n e == \"IMG\" && (n.className = \"ProseMirror-separator\", n.alt = \"\"), e == \"BR\" && (n.className = \"ProseMirror-trailingBreak\");\n let s = new Wp(this.top, [], n, null);\n t != this.top ? t.children.push(s) : t.children.splice(this.index++, 0, s), this.changed = !0;\n }\n }\n isLocked(e) {\n return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));\n }\n}\nfunction Y0(r, e) {\n let t = e, n = t.children.length, s = r.childCount, o = /* @__PURE__ */ new Map(), i = [];\n e: for (; s > 0; ) {\n let a;\n for (; ; )\n if (n) {\n let d = t.children[n - 1];\n if (d instanceof $s)\n t = d, n = d.children.length;\n else {\n a = d, n--;\n break;\n }\n } else {\n if (t == e)\n break e;\n n = t.parent.children.indexOf(t), t = t.parent;\n }\n let l = a.node;\n if (l) {\n if (l != r.child(s - 1))\n break;\n --s, o.set(a, s), i.push(a);\n }\n }\n return { index: s, matched: o, matches: i.reverse() };\n}\nfunction X0(r, e) {\n return r.type.side - e.type.side;\n}\nfunction Q0(r, e, t, n) {\n let s = e.locals(r), o = 0;\n if (s.length == 0) {\n for (let d = 0; d < r.childCount; d++) {\n let u = r.child(d);\n n(u, s, e.forChild(o, u), d), o += u.nodeSize;\n }\n return;\n }\n let i = 0, a = [], l = null;\n for (let d = 0; ; ) {\n let u, f;\n for (; i < s.length && s[i].to == o; ) {\n let y = s[i++];\n y.widget && (u ? (f || (f = [u])).push(y) : u = y);\n }\n if (u)\n if (f) {\n f.sort(X0);\n for (let y = 0; y < f.length; y++)\n t(f[y], d, !!l);\n } else\n t(u, d, !!l);\n let h, p;\n if (l)\n p = -1, h = l, l = null;\n else if (d < r.childCount)\n p = d, h = r.child(d++);\n else\n break;\n for (let y = 0; y < a.length; y++)\n a[y].to <= o && a.splice(y--, 1);\n for (; i < s.length && s[i].from <= o && s[i].to > o; )\n a.push(s[i++]);\n let g = o + h.nodeSize;\n if (h.isText) {\n let y = g;\n i < s.length && s[i].from < y && (y = s[i].from);\n for (let C = 0; C < a.length; C++)\n a[C].to < y && (y = a[C].to);\n y < g && (l = h.cut(y - o), h = h.cut(0, y - o), g = y, p = -1);\n } else\n for (; i < s.length && s[i].to < g; )\n i++;\n let b = h.isInline && !h.isLeaf ? a.filter((y) => !y.inline) : a.slice();\n n(h, b, e.forChild(o, h), p), o = g;\n }\n}\nfunction Z0(r) {\n if (r.nodeName == \"UL\" || r.nodeName == \"OL\") {\n let e = r.style.cssText;\n r.style.cssText = e + \"; list-style: square !important\", window.getComputedStyle(r).listStyle, r.style.cssText = e;\n }\n}\nfunction e1(r, e, t, n) {\n for (let s = 0, o = 0; s < r.childCount && o <= n; ) {\n let i = r.child(s++), a = o;\n if (o += i.nodeSize, !i.isText)\n continue;\n let l = i.text;\n for (; s < r.childCount; ) {\n let d = r.child(s++);\n if (o += d.nodeSize, !d.isText)\n break;\n l += d.text;\n }\n if (o >= t) {\n if (o >= n && l.slice(n - e.length - a, n - a) == e)\n return n - e.length;\n let d = a < n ? l.lastIndexOf(e, n - a - 1) : -1;\n if (d >= 0 && d + e.length + a >= t)\n return a + d;\n if (t == n && l.length >= n + e.length - a && l.slice(n - a, n - a + e.length) == e)\n return n;\n }\n }\n return -1;\n}\nfunction Dl(r, e, t, n, s) {\n let o = [];\n for (let i = 0, a = 0; i < r.length; i++) {\n let l = r[i], d = a, u = a += l.size;\n d >= t || u <= e ? o.push(l) : (d < e && o.push(l.slice(0, e - d, n)), s && (o.push(s), s = void 0), u > t && o.push(l.slice(t - d, l.size, n)));\n }\n return o;\n}\nfunction Fc(r, e = null) {\n let t = r.domSelectionRange(), n = r.state.doc;\n if (!t.focusNode)\n return null;\n let s = r.docView.nearestDesc(t.focusNode), o = s && s.size == 0, i = r.docView.posFromDOM(t.focusNode, t.focusOffset, 1);\n if (i < 0)\n return null;\n let a = n.resolve(i), l, d;\n if (Ma(t)) {\n for (l = i; s && !s.node; )\n s = s.parent;\n let f = s.node;\n if (s && f.isAtom && ot.isSelectable(f) && s.parent && !(f.isInline && T0(t.focusNode, t.focusOffset, s.dom))) {\n let h = s.posBefore;\n d = new ot(i == h ? a : n.resolve(h));\n }\n } else {\n if (t instanceof r.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {\n let f = i, h = i;\n for (let p = 0; p < t.rangeCount; p++) {\n let g = t.getRangeAt(p);\n f = Math.min(f, r.docView.posFromDOM(g.startContainer, g.startOffset, 1)), h = Math.max(h, r.docView.posFromDOM(g.endContainer, g.endOffset, -1));\n }\n if (f < 0)\n return null;\n [l, i] = h == r.state.selection.anchor ? [h, f] : [f, h], a = n.resolve(i);\n } else\n l = r.docView.posFromDOM(t.anchorNode, t.anchorOffset, 1);\n if (l < 0)\n return null;\n }\n let u = n.resolve(l);\n if (!d) {\n let f = e == \"pointer\" || r.state.selection.head < a.pos && !o ? 1 : -1;\n d = Bc(r, u, a, f);\n }\n return d;\n}\nfunction Gp(r) {\n return r.editable ? r.hasFocus() : Xp(r) && document.activeElement && document.activeElement.contains(r.dom);\n}\nfunction Fn(r, e = !1) {\n let t = r.state.selection;\n if (Yp(r, t), !!Gp(r)) {\n if (!e && r.input.mouseDown && r.input.mouseDown.allowDefault && jr) {\n let n = r.domSelectionRange(), s = r.domObserver.currentSelection;\n if (n.anchorNode && s.anchorNode && Os(n.anchorNode, n.anchorOffset, s.anchorNode, s.anchorOffset)) {\n r.input.mouseDown.delayedSelectionSync = !0, r.domObserver.setCurSelection();\n return;\n }\n }\n if (r.domObserver.disconnectSelection(), r.cursorWrapper)\n r1(r);\n else {\n let { anchor: n, head: s } = t, o, i;\n vu && !(t instanceof ht) && (t.$from.parent.inlineContent || (o = gu(r, t.from)), !t.empty && !t.$from.parent.inlineContent && (i = gu(r, t.to))), r.docView.setSelection(n, s, r, e), vu && (o && bu(o), i && bu(i)), t.visible ? r.dom.classList.remove(\"ProseMirror-hideselection\") : (r.dom.classList.add(\"ProseMirror-hideselection\"), \"onselectionchange\" in document && t1(r));\n }\n r.domObserver.setCurSelection(), r.domObserver.connectSelection();\n }\n}\nconst vu = Br || jr && Rp < 63;\nfunction gu(r, e) {\n let { node: t, offset: n } = r.docView.domFromPos(e, 0), s = n < t.childNodes.length ? t.childNodes[n] : null, o = n ? t.childNodes[n - 1] : null;\n if (Br && s && s.contentEditable == \"false\")\n return ol(s);\n if ((!s || s.contentEditable == \"false\") && (!o || o.contentEditable == \"false\")) {\n if (s)\n return ol(s);\n if (o)\n return ol(o);\n }\n}\nfunction ol(r) {\n return r.contentEditable = \"true\", Br && r.draggable && (r.draggable = !1, r.wasDraggable = !0), r;\n}\nfunction bu(r) {\n r.contentEditable = \"false\", r.wasDraggable && (r.draggable = !0, r.wasDraggable = null);\n}\nfunction t1(r) {\n let e = r.dom.ownerDocument;\n e.removeEventListener(\"selectionchange\", r.input.hideSelectionGuard);\n let t = r.domSelectionRange(), n = t.anchorNode, s = t.anchorOffset;\n e.addEventListener(\"selectionchange\", r.input.hideSelectionGuard = () => {\n (t.anchorNode != n || t.anchorOffset != s) && (e.removeEventListener(\"selectionchange\", r.input.hideSelectionGuard), setTimeout(() => {\n (!Gp(r) || r.state.selection.visible) && r.dom.classList.remove(\"ProseMirror-hideselection\");\n }, 20));\n });\n}\nfunction r1(r) {\n let e = r.domSelection();\n if (!e)\n return;\n let t = r.cursorWrapper.dom, n = t.nodeName == \"IMG\";\n n ? e.collapse(t.parentNode, zr(t) + 1) : e.collapse(t, 0), !n && !r.state.selection.visible && Gr && rs <= 11 && (t.disabled = !0, t.disabled = !1);\n}\nfunction Yp(r, e) {\n if (e instanceof ot) {\n let t = r.docView.descAt(e.from);\n t != r.lastSelectedViewDesc && (yu(r), t && t.selectNode(), r.lastSelectedViewDesc = t);\n } else\n yu(r);\n}\nfunction yu(r) {\n r.lastSelectedViewDesc && (r.lastSelectedViewDesc.parent && r.lastSelectedViewDesc.deselectNode(), r.lastSelectedViewDesc = void 0);\n}\nfunction Bc(r, e, t, n) {\n return r.someProp(\"createSelectionBetween\", (s) => s(r, e, t)) || ht.between(e, t, n);\n}\nfunction xu(r) {\n return r.editable && !r.hasFocus() ? !1 : Xp(r);\n}\nfunction Xp(r) {\n let e = r.domSelectionRange();\n if (!e.anchorNode)\n return !1;\n try {\n return r.dom.contains(e.anchorNode.nodeType == 3 ? e.anchorNode.parentNode : e.anchorNode) && (r.editable || r.dom.contains(e.focusNode.nodeType == 3 ? e.focusNode.parentNode : e.focusNode));\n } catch {\n return !1;\n }\n}\nfunction n1(r) {\n let e = r.docView.domFromPos(r.state.selection.anchor, 0), t = r.domSelectionRange();\n return Os(e.node, e.offset, t.anchorNode, t.anchorOffset);\n}\nfunction Fl(r, e) {\n let { $anchor: t, $head: n } = r.selection, s = e > 0 ? t.max(n) : t.min(n), o = s.parent.inlineContent ? s.depth ? r.doc.resolve(e > 0 ? s.after() : s.before()) : null : s;\n return o && St.findFrom(o, e);\n}\nfunction Jn(r, e) {\n return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()), !0;\n}\nfunction wu(r, e, t) {\n let n = r.state.selection;\n if (n instanceof ht)\n if (t.indexOf(\"s\") > -1) {\n let { $head: s } = n, o = s.textOffset ? null : e < 0 ? s.nodeBefore : s.nodeAfter;\n if (!o || o.isText || !o.isLeaf)\n return !1;\n let i = r.state.doc.resolve(s.pos + o.nodeSize * (e < 0 ? -1 : 1));\n return Jn(r, new ht(n.$anchor, i));\n } else if (n.empty) {\n if (r.endOfTextblock(e > 0 ? \"forward\" : \"backward\")) {\n let s = Fl(r.state, e);\n return s && s instanceof ot ? Jn(r, s) : !1;\n } else if (!(an && t.indexOf(\"m\") > -1)) {\n let s = n.$head, o = s.textOffset ? null : e < 0 ? s.nodeBefore : s.nodeAfter, i;\n if (!o || o.isText)\n return !1;\n let a = e < 0 ? s.pos - o.nodeSize : s.pos;\n return o.isAtom || (i = r.docView.descAt(a)) && !i.contentDOM ? ot.isSelectable(o) ? Jn(r, new ot(e < 0 ? r.state.doc.resolve(s.pos - o.nodeSize) : s)) : Zo ? Jn(r, new ht(r.state.doc.resolve(e < 0 ? a : a + o.nodeSize))) : !1 : !1;\n }\n } else return !1;\n else {\n if (n instanceof ot && n.node.isInline)\n return Jn(r, new ht(e > 0 ? n.$to : n.$from));\n {\n let s = Fl(r.state, e);\n return s ? Jn(r, s) : !1;\n }\n }\n}\nfunction Li(r) {\n return r.nodeType == 3 ? r.nodeValue.length : r.childNodes.length;\n}\nfunction _o(r, e) {\n let t = r.pmViewDesc;\n return t && t.size == 0 && (e < 0 || r.nextSibling || r.nodeName != \"BR\");\n}\nfunction Ds(r, e) {\n return e < 0 ? s1(r) : o1(r);\n}\nfunction s1(r) {\n let e = r.domSelectionRange(), t = e.focusNode, n = e.focusOffset;\n if (!t)\n return;\n let s, o, i = !1;\n for (cn && t.nodeType == 1 && n < Li(t) && _o(t.childNodes[n], -1) && (i = !0); ; )\n if (n > 0) {\n if (t.nodeType != 1)\n break;\n {\n let a = t.childNodes[n - 1];\n if (_o(a, -1))\n s = t, o = --n;\n else if (a.nodeType == 3)\n t = a, n = t.nodeValue.length;\n else\n break;\n }\n } else {\n if (Qp(t))\n break;\n {\n let a = t.previousSibling;\n for (; a && _o(a, -1); )\n s = t.parentNode, o = zr(a), a = a.previousSibling;\n if (a)\n t = a, n = Li(t);\n else {\n if (t = t.parentNode, t == r.dom)\n break;\n n = 0;\n }\n }\n }\n i ? Bl(r, t, n) : s && Bl(r, s, o);\n}\nfunction o1(r) {\n let e = r.domSelectionRange(), t = e.focusNode, n = e.focusOffset;\n if (!t)\n return;\n let s = Li(t), o, i;\n for (; ; )\n if (n < s) {\n if (t.nodeType != 1)\n break;\n let a = t.childNodes[n];\n if (_o(a, 1))\n o = t, i = ++n;\n else\n break;\n } else {\n if (Qp(t))\n break;\n {\n let a = t.nextSibling;\n for (; a && _o(a, 1); )\n o = a.parentNode, i = zr(a) + 1, a = a.nextSibling;\n if (a)\n t = a, n = 0, s = Li(t);\n else {\n if (t = t.parentNode, t == r.dom)\n break;\n n = s = 0;\n }\n }\n }\n o && Bl(r, o, i);\n}\nfunction Qp(r) {\n let e = r.pmViewDesc;\n return e && e.node && e.node.isBlock;\n}\nfunction i1(r, e) {\n for (; r && e == r.childNodes.length && !Qo(r); )\n e = zr(r) + 1, r = r.parentNode;\n for (; r && e < r.childNodes.length; ) {\n let t = r.childNodes[e];\n if (t.nodeType == 3)\n return t;\n if (t.nodeType == 1 && t.contentEditable == \"false\")\n break;\n r = t, e = 0;\n }\n}\nfunction a1(r, e) {\n for (; r && !e && !Qo(r); )\n e = zr(r), r = r.parentNode;\n for (; r && e; ) {\n let t = r.childNodes[e - 1];\n if (t.nodeType == 3)\n return t;\n if (t.nodeType == 1 && t.contentEditable == \"false\")\n break;\n r = t, e = r.childNodes.length;\n }\n}\nfunction Bl(r, e, t) {\n if (e.nodeType != 3) {\n let o, i;\n (i = i1(e, t)) ? (e = i, t = 0) : (o = a1(e, t)) && (e = o, t = o.nodeValue.length);\n }\n let n = r.domSelection();\n if (!n)\n return;\n if (Ma(n)) {\n let o = document.createRange();\n o.setEnd(e, t), o.setStart(e, t), n.removeAllRanges(), n.addRange(o);\n } else n.extend && n.extend(e, t);\n r.domObserver.setCurSelection();\n let { state: s } = r;\n setTimeout(() => {\n r.state == s && Fn(r);\n }, 50);\n}\nfunction ku(r, e) {\n let t = r.state.doc.resolve(e);\n if (!(jr || jp) && t.parent.inlineContent) {\n let s = r.coordsAtPos(e);\n if (e > t.start()) {\n let o = r.coordsAtPos(e - 1), i = (o.top + o.bottom) / 2;\n if (i > s.top && i < s.bottom && Math.abs(o.left - s.left) > 1)\n return o.left < s.left ? \"ltr\" : \"rtl\";\n }\n if (e < t.end()) {\n let o = r.coordsAtPos(e + 1), i = (o.top + o.bottom) / 2;\n if (i > s.top && i < s.bottom && Math.abs(o.left - s.left) > 1)\n return o.left > s.left ? \"ltr\" : \"rtl\";\n }\n }\n return getComputedStyle(r.dom).direction == \"rtl\" ? \"rtl\" : \"ltr\";\n}\nfunction Cu(r, e, t) {\n let n = r.state.selection;\n if (n instanceof ht && !n.empty || t.indexOf(\"s\") > -1 || an && t.indexOf(\"m\") > -1)\n return !1;\n let { $from: s, $to: o } = n;\n if (!s.parent.inlineContent || r.endOfTextblock(e < 0 ? \"up\" : \"down\")) {\n let i = Fl(r.state, e);\n if (i && i instanceof ot)\n return Jn(r, i);\n }\n if (!s.parent.inlineContent) {\n let i = e < 0 ? s : o, a = n instanceof Zr ? St.near(i, e) : St.findFrom(i, e);\n return a ? Jn(r, a) : !1;\n }\n return !1;\n}\nfunction _u(r, e) {\n if (!(r.state.selection instanceof ht))\n return !0;\n let { $head: t, $anchor: n, empty: s } = r.state.selection;\n if (!t.sameParent(n))\n return !0;\n if (!s)\n return !1;\n if (r.endOfTextblock(e > 0 ? \"forward\" : \"backward\"))\n return !0;\n let o = !t.textOffset && (e < 0 ? t.nodeBefore : t.nodeAfter);\n if (o && !o.isText) {\n let i = r.state.tr;\n return e < 0 ? i.delete(t.pos - o.nodeSize, t.pos) : i.delete(t.pos, t.pos + o.nodeSize), r.dispatch(i), !0;\n }\n return !1;\n}\nfunction Su(r, e, t) {\n r.domObserver.stop(), e.contentEditable = t, r.domObserver.start();\n}\nfunction l1(r) {\n if (!Br || r.state.selection.$head.parentOffset > 0)\n return !1;\n let { focusNode: e, focusOffset: t } = r.domSelectionRange();\n if (e && e.nodeType == 1 && t == 0 && e.firstChild && e.firstChild.contentEditable == \"false\") {\n let n = e.firstChild;\n Su(r, n, \"true\"), setTimeout(() => Su(r, n, \"false\"), 20);\n }\n return !1;\n}\nfunction c1(r) {\n let e = \"\";\n return r.ctrlKey && (e += \"c\"), r.metaKey && (e += \"m\"), r.altKey && (e += \"a\"), r.shiftKey && (e += \"s\"), e;\n}\nfunction d1(r, e) {\n let t = e.keyCode, n = c1(e);\n if (t == 8 || an && t == 72 && n == \"c\")\n return _u(r, -1) || Ds(r, -1);\n if (t == 46 && !e.shiftKey || an && t == 68 && n == \"c\")\n return _u(r, 1) || Ds(r, 1);\n if (t == 13 || t == 27)\n return !0;\n if (t == 37 || an && t == 66 && n == \"c\") {\n let s = t == 37 ? ku(r, r.state.selection.from) == \"ltr\" ? -1 : 1 : -1;\n return wu(r, s, n) || Ds(r, s);\n } else if (t == 39 || an && t == 70 && n == \"c\") {\n let s = t == 39 ? ku(r, r.state.selection.from) == \"ltr\" ? 1 : -1 : 1;\n return wu(r, s, n) || Ds(r, s);\n } else {\n if (t == 38 || an && t == 80 && n == \"c\")\n return Cu(r, -1, n) || Ds(r, -1);\n if (t == 40 || an && t == 78 && n == \"c\")\n return l1(r) || Cu(r, 1, n) || Ds(r, 1);\n if (n == (an ? \"m\" : \"c\") && (t == 66 || t == 73 || t == 89 || t == 90))\n return !0;\n }\n return !1;\n}\nfunction Hc(r, e) {\n r.someProp(\"transformCopied\", (p) => {\n e = p(e, r);\n });\n let t = [], { content: n, openStart: s, openEnd: o } = e;\n for (; s > 1 && o > 1 && n.childCount == 1 && n.firstChild.childCount == 1; ) {\n s--, o--;\n let p = n.firstChild;\n t.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), n = p.content;\n }\n let i = r.someProp(\"clipboardSerializer\") || Is.fromSchema(r.state.schema), a = sh(), l = a.createElement(\"div\");\n l.appendChild(i.serializeFragment(n, { document: a }));\n let d = l.firstChild, u, f = 0;\n for (; d && d.nodeType == 1 && (u = nh[d.nodeName.toLowerCase()]); ) {\n for (let p = u.length - 1; p >= 0; p--) {\n let g = a.createElement(u[p]);\n for (; l.firstChild; )\n g.appendChild(l.firstChild);\n l.appendChild(g), f++;\n }\n d = l.firstChild;\n }\n d && d.nodeType == 1 && d.setAttribute(\"data-pm-slice\", `${s} ${o}${f ? ` -${f}` : \"\"} ${JSON.stringify(t)}`);\n let h = r.someProp(\"clipboardTextSerializer\", (p) => p(e, r)) || e.content.textBetween(0, e.content.size, `\n\n`);\n return { dom: l, text: h, slice: e };\n}\nfunction Zp(r, e, t, n, s) {\n let o = s.parent.type.spec.code, i, a;\n if (!t && !e)\n return null;\n let l = !!e && (n || o || !t);\n if (l) {\n if (r.someProp(\"transformPastedText\", (h) => {\n e = h(e, o || n, r);\n }), o)\n return a = new De(ye.from(r.state.schema.text(e.replace(/\\r\\n?/g, `\n`))), 0, 0), r.someProp(\"transformPasted\", (h) => {\n a = h(a, r, !0);\n }), a;\n let f = r.someProp(\"clipboardTextParser\", (h) => h(e, s, n, r));\n if (f)\n a = f;\n else {\n let h = s.marks(), { schema: p } = r.state, g = Is.fromSchema(p);\n i = document.createElement(\"div\"), e.split(/(?:\\r\\n?|\\n)+/).forEach((b) => {\n let y = i.appendChild(document.createElement(\"p\"));\n b && y.appendChild(g.serializeNode(p.text(b, h)));\n });\n }\n } else\n r.someProp(\"transformPastedHTML\", (f) => {\n t = f(t, r);\n }), i = h1(t), Zo && m1(i);\n let d = i && i.querySelector(\"[data-pm-slice]\"), u = d && /^(\\d+) (\\d+)(?: -(\\d+))? (.*)/.exec(d.getAttribute(\"data-pm-slice\") || \"\");\n if (u && u[3])\n for (let f = +u[3]; f > 0; f--) {\n let h = i.firstChild;\n for (; h && h.nodeType != 1; )\n h = h.nextSibling;\n if (!h)\n break;\n i = h;\n }\n if (a || (a = (r.someProp(\"clipboardParser\") || r.someProp(\"domParser\") || wo.fromSchema(r.state.schema)).parseSlice(i, {\n preserveWhitespace: !!(l || u),\n context: s,\n ruleFromNode(h) {\n return h.nodeName == \"BR\" && !h.nextSibling && h.parentNode && !u1.test(h.parentNode.nodeName) ? { ignore: !0 } : null;\n }\n })), u)\n a = v1(Eu(a, +u[1], +u[2]), u[4]);\n else if (a = De.maxOpen(f1(a.content, s), !0), a.openStart || a.openEnd) {\n let f = 0, h = 0;\n for (let p = a.content.firstChild; f < a.openStart && !p.type.spec.isolating; f++, p = p.firstChild)\n ;\n for (let p = a.content.lastChild; h < a.openEnd && !p.type.spec.isolating; h++, p = p.lastChild)\n ;\n a = Eu(a, f, h);\n }\n return r.someProp(\"transformPasted\", (f) => {\n a = f(a, r, l);\n }), a;\n}\nconst u1 = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;\nfunction f1(r, e) {\n if (r.childCount < 2)\n return r;\n for (let t = e.depth; t >= 0; t--) {\n let s = e.node(t).contentMatchAt(e.index(t)), o, i = [];\n if (r.forEach((a) => {\n if (!i)\n return;\n let l = s.findWrapping(a.type), d;\n if (!l)\n return i = null;\n if (d = i.length && o.length && th(l, o, a, i[i.length - 1], 0))\n i[i.length - 1] = d;\n else {\n i.length && (i[i.length - 1] = rh(i[i.length - 1], o.length));\n let u = eh(a, l);\n i.push(u), s = s.matchType(u.type), o = l;\n }\n }), i)\n return ye.from(i);\n }\n return r;\n}\nfunction eh(r, e, t = 0) {\n for (let n = e.length - 1; n >= t; n--)\n r = e[n].create(null, ye.from(r));\n return r;\n}\nfunction th(r, e, t, n, s) {\n if (s < r.length && s < e.length && r[s] == e[s]) {\n let o = th(r, e, t, n.lastChild, s + 1);\n if (o)\n return n.copy(n.content.replaceChild(n.childCount - 1, o));\n if (n.contentMatchAt(n.childCount).matchType(s == r.length - 1 ? t.type : r[s + 1]))\n return n.copy(n.content.append(ye.from(eh(t, r, s + 1))));\n }\n}\nfunction rh(r, e) {\n if (e == 0)\n return r;\n let t = r.content.replaceChild(r.childCount - 1, rh(r.lastChild, e - 1)), n = r.contentMatchAt(r.childCount).fillBefore(ye.empty, !0);\n return r.copy(t.append(n));\n}\nfunction Hl(r, e, t, n, s, o) {\n let i = e < 0 ? r.firstChild : r.lastChild, a = i.content;\n return r.childCount > 1 && (o = 0), s < n - 1 && (a = Hl(a, e, t, n, s + 1, o)), s >= t && (a = e < 0 ? i.contentMatchAt(0).fillBefore(a, o <= s).append(a) : a.append(i.contentMatchAt(i.childCount).fillBefore(ye.empty, !0))), r.replaceChild(e < 0 ? 0 : r.childCount - 1, i.copy(a));\n}\nfunction Eu(r, e, t) {\n return e < r.openStart && (r = new De(Hl(r.content, -1, e, r.openStart, 0, r.openEnd), e, r.openEnd)), t < r.openEnd && (r = new De(Hl(r.content, 1, t, r.openEnd, 0, 0), r.openStart, t)), r;\n}\nconst nh = {\n thead: [\"table\"],\n tbody: [\"table\"],\n tfoot: [\"table\"],\n caption: [\"table\"],\n colgroup: [\"table\"],\n col: [\"table\", \"colgroup\"],\n tr: [\"table\", \"tbody\"],\n td: [\"table\", \"tbody\", \"tr\"],\n th: [\"table\", \"tbody\", \"tr\"]\n};\nlet Tu = null;\nfunction sh() {\n return Tu || (Tu = document.implementation.createHTMLDocument(\"title\"));\n}\nlet il = null;\nfunction p1(r) {\n let e = window.trustedTypes;\n return e ? (il || (il = e.defaultPolicy || e.createPolicy(\"ProseMirrorClipboard\", { createHTML: (t) => t })), il.createHTML(r)) : r;\n}\nfunction h1(r) {\n let e = /^(\\s*<meta [^>]*>)*/.exec(r);\n e && (r = r.slice(e[0].length));\n let t = sh().createElement(\"div\"), n = /<([a-z][^>\\s]+)/i.exec(r), s;\n if ((s = n && nh[n[1].toLowerCase()]) && (r = s.map((o) => \"<\" + o + \">\").join(\"\") + r + s.map((o) => \"</\" + o + \">\").reverse().join(\"\")), t.innerHTML = p1(r), s)\n for (let o = 0; o < s.length; o++)\n t = t.querySelector(s[o]) || t;\n return t;\n}\nfunction m1(r) {\n let e = r.querySelectorAll(jr ? \"span:not([class]):not([style])\" : \"span.Apple-converted-space\");\n for (let t = 0; t < e.length; t++) {\n let n = e[t];\n n.childNodes.length == 1 && n.textContent == \"\u00A0\" && n.parentNode && n.parentNode.replaceChild(r.ownerDocument.createTextNode(\" \"), n);\n }\n}\nfunction v1(r, e) {\n if (!r.size)\n return r;\n let t = r.content.firstChild.type.schema, n;\n try {\n n = JSON.parse(e);\n } catch {\n return r;\n }\n let { content: s, openStart: o, openEnd: i } = r;\n for (let a = n.length - 2; a >= 0; a -= 2) {\n let l = t.nodes[n[a]];\n if (!l || l.hasRequiredAttrs())\n break;\n s = ye.from(l.create(n[a + 1], s)), o++, i++;\n }\n return new De(s, o, i);\n}\nconst Vr = {}, Wr = {}, g1 = { touchstart: !0, touchmove: !0 };\nclass b1 {\n constructor() {\n this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: \"\", button: 0 }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.badSafariComposition = !1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;\n }\n}\nfunction y1(r) {\n for (let e in Vr) {\n let t = Vr[e];\n r.dom.addEventListener(e, r.input.eventHandlers[e] = (n) => {\n w1(r, n) && !qc(r, n) && (r.editable || !(n.type in Wr)) && t(r, n);\n }, g1[e] ? { passive: !0 } : void 0);\n }\n Br && r.dom.addEventListener(\"input\", () => null), ql(r);\n}\nfunction ts(r, e) {\n r.input.lastSelectionOrigin = e, r.input.lastSelectionTime = Date.now();\n}\nfunction x1(r) {\n r.domObserver.stop();\n for (let e in r.input.eventHandlers)\n r.dom.removeEventListener(e, r.input.eventHandlers[e]);\n clearTimeout(r.input.composingTimeout), clearTimeout(r.input.lastIOSEnterFallbackTimeout);\n}\nfunction ql(r) {\n r.someProp(\"handleDOMEvents\", (e) => {\n for (let t in e)\n r.input.eventHandlers[t] || r.dom.addEventListener(t, r.input.eventHandlers[t] = (n) => qc(r, n));\n });\n}\nfunction qc(r, e) {\n return r.someProp(\"handleDOMEvents\", (t) => {\n let n = t[e.type];\n return n ? n(r, e) || e.defaultPrevented : !1;\n });\n}\nfunction w1(r, e) {\n if (!e.bubbles)\n return !0;\n if (e.defaultPrevented)\n return !1;\n for (let t = e.target; t != r.dom; t = t.parentNode)\n if (!t || t.nodeType == 11 || t.pmViewDesc && t.pmViewDesc.stopEvent(e))\n return !1;\n return !0;\n}\nfunction k1(r, e) {\n !qc(r, e) && Vr[e.type] && (r.editable || !(e.type in Wr)) && Vr[e.type](r, e);\n}\nWr.keydown = (r, e) => {\n let t = e;\n if (r.input.shiftKey = t.keyCode == 16 || t.shiftKey, !ih(r, t) && (r.input.lastKeyCode = t.keyCode, r.input.lastKeyCodeTime = Date.now(), !(Ln && jr && t.keyCode == 13)))\n if (t.keyCode != 229 && r.domObserver.forceFlush(), eo && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {\n let n = Date.now();\n r.input.lastIOSEnter = n, r.input.lastIOSEnterFallbackTimeout = setTimeout(() => {\n r.input.lastIOSEnter == n && (r.someProp(\"handleKeyDown\", (s) => s(r, gs(13, \"Enter\"))), r.input.lastIOSEnter = 0);\n }, 200);\n } else r.someProp(\"handleKeyDown\", (n) => n(r, t)) || d1(r, t) ? t.preventDefault() : ts(r, \"key\");\n};\nWr.keyup = (r, e) => {\n e.keyCode == 16 && (r.input.shiftKey = !1);\n};\nWr.keypress = (r, e) => {\n let t = e;\n if (ih(r, t) || !t.charCode || t.ctrlKey && !t.altKey || an && t.metaKey)\n return;\n if (r.someProp(\"handleKeyPress\", (s) => s(r, t))) {\n t.preventDefault();\n return;\n }\n let n = r.state.selection;\n if (!(n instanceof ht) || !n.$from.sameParent(n.$to)) {\n let s = String.fromCharCode(t.charCode), o = () => r.state.tr.insertText(s).scrollIntoView();\n !/[\\r\\n]/.test(s) && !r.someProp(\"handleTextInput\", (i) => i(r, n.$from.pos, n.$to.pos, s, o)) && r.dispatch(o()), t.preventDefault();\n }\n};\nfunction Pa(r) {\n return { left: r.clientX, top: r.clientY };\n}\nfunction C1(r, e) {\n let t = e.x - r.clientX, n = e.y - r.clientY;\n return t * t + n * n < 100;\n}\nfunction Vc(r, e, t, n, s) {\n if (n == -1)\n return !1;\n let o = r.state.doc.resolve(n);\n for (let i = o.depth + 1; i > 0; i--)\n if (r.someProp(e, (a) => i > o.depth ? a(r, t, o.nodeAfter, o.before(i), s, !0) : a(r, t, o.node(i), o.before(i), s, !1)))\n return !0;\n return !1;\n}\nfunction Ks(r, e, t) {\n if (r.focused || r.focus(), r.state.selection.eq(e))\n return;\n let n = r.state.tr.setSelection(e);\n n.setMeta(\"pointer\", !0), r.dispatch(n);\n}\nfunction _1(r, e) {\n if (e == -1)\n return !1;\n let t = r.state.doc.resolve(e), n = t.nodeAfter;\n return n && n.isAtom && ot.isSelectable(n) ? (Ks(r, new ot(t)), !0) : !1;\n}\nfunction S1(r, e) {\n if (e == -1)\n return !1;\n let t = r.state.selection, n, s;\n t instanceof ot && (n = t.node);\n let o = r.state.doc.resolve(e);\n for (let i = o.depth + 1; i > 0; i--) {\n let a = i > o.depth ? o.nodeAfter : o.node(i);\n if (ot.isSelectable(a)) {\n n && t.$from.depth > 0 && i >= t.$from.depth && o.before(t.$from.depth + 1) == t.$from.pos ? s = o.before(t.$from.depth) : s = o.before(i);\n break;\n }\n }\n return s != null ? (Ks(r, ot.create(r.state.doc, s)), !0) : !1;\n}\nfunction E1(r, e, t, n, s) {\n return Vc(r, \"handleClickOn\", e, t, n) || r.someProp(\"handleClick\", (o) => o(r, e, n)) || (s ? S1(r, t) : _1(r, t));\n}\nfunction T1(r, e, t, n) {\n return Vc(r, \"handleDoubleClickOn\", e, t, n) || r.someProp(\"handleDoubleClick\", (s) => s(r, e, n));\n}\nfunction M1(r, e, t, n) {\n return Vc(r, \"handleTripleClickOn\", e, t, n) || r.someProp(\"handleTripleClick\", (s) => s(r, e, n)) || A1(r, t, n);\n}\nfunction A1(r, e, t) {\n if (t.button != 0)\n return !1;\n let n = r.state.doc;\n if (e == -1)\n return n.inlineContent ? (Ks(r, ht.create(n, 0, n.content.size)), !0) : !1;\n let s = n.resolve(e);\n for (let o = s.depth + 1; o > 0; o--) {\n let i = o > s.depth ? s.nodeAfter : s.node(o), a = s.before(o);\n if (i.inlineContent)\n Ks(r, ht.create(n, a + 1, a + 1 + i.content.size));\n else if (ot.isSelectable(i))\n Ks(r, ot.create(n, a));\n else\n continue;\n return !0;\n }\n}\nfunction Wc(r) {\n return Di(r);\n}\nconst oh = an ? \"metaKey\" : \"ctrlKey\";\nVr.mousedown = (r, e) => {\n let t = e;\n r.input.shiftKey = t.shiftKey;\n let n = Wc(r), s = Date.now(), o = \"singleClick\";\n s - r.input.lastClick.time < 500 && C1(t, r.input.lastClick) && !t[oh] && r.input.lastClick.button == t.button && (r.input.lastClick.type == \"singleClick\" ? o = \"doubleClick\" : r.input.lastClick.type == \"doubleClick\" && (o = \"tripleClick\")), r.input.lastClick = { time: s, x: t.clientX, y: t.clientY, type: o, button: t.button };\n let i = r.posAtCoords(Pa(t));\n i && (o == \"singleClick\" ? (r.input.mouseDown && r.input.mouseDown.done(), r.input.mouseDown = new P1(r, i, t, !!n)) : (o == \"doubleClick\" ? T1 : M1)(r, i.pos, i.inside, t) ? t.preventDefault() : ts(r, \"pointer\"));\n};\nclass P1 {\n constructor(e, t, n, s) {\n this.view = e, this.pos = t, this.event = n, this.flushed = s, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!n[oh], this.allowDefault = n.shiftKey;\n let o, i;\n if (t.inside > -1)\n o = e.state.doc.nodeAt(t.inside), i = t.inside;\n else {\n let u = e.state.doc.resolve(t.pos);\n o = u.parent, i = u.depth ? u.before() : 0;\n }\n const a = s ? null : n.target, l = a ? e.docView.nearestDesc(a, !0) : null;\n this.target = l && l.nodeDOM.nodeType == 1 ? l.nodeDOM : null;\n let { selection: d } = e.state;\n n.button == 0 && (o.type.spec.draggable && o.type.spec.selectable !== !1 || d instanceof ot && d.from <= i && d.to > i) && (this.mightDrag = {\n node: o,\n pos: i,\n addAttr: !!(this.target && !this.target.draggable),\n setUneditable: !!(this.target && cn && !this.target.hasAttribute(\"contentEditable\"))\n }), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {\n this.view.input.mouseDown == this && this.target.setAttribute(\"contentEditable\", \"false\");\n }, 20), this.view.domObserver.start()), e.root.addEventListener(\"mouseup\", this.up = this.up.bind(this)), e.root.addEventListener(\"mousemove\", this.move = this.move.bind(this)), ts(e, \"pointer\");\n }\n done() {\n this.view.root.removeEventListener(\"mouseup\", this.up), this.view.root.removeEventListener(\"mousemove\", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute(\"draggable\"), this.mightDrag.setUneditable && this.target.removeAttribute(\"contentEditable\"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() => Fn(this.view)), this.view.input.mouseDown = null;\n }\n up(e) {\n if (this.done(), !this.view.dom.contains(e.target))\n return;\n let t = this.pos;\n this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Pa(e))), this.updateAllowDefault(e), this.allowDefault || !t ? ts(this.view, \"pointer\") : E1(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements\n Br && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a\n // cursor, but still report that the node is selected\n // when asked through getSelection. You'll then get a\n // situation where clicking at the point where that\n // (hidden) cursor is doesn't change the selection, and\n // thus doesn't get a reaction from ProseMirror. This\n // works around that.\n jr && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (Ks(this.view, St.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : ts(this.view, \"pointer\");\n }\n move(e) {\n this.updateAllowDefault(e), ts(this.view, \"pointer\"), e.buttons == 0 && this.done();\n }\n updateAllowDefault(e) {\n !this.allowDefault && (Math.abs(this.event.x - e.clientX) > 4 || Math.abs(this.event.y - e.clientY) > 4) && (this.allowDefault = !0);\n }\n}\nVr.touchstart = (r) => {\n r.input.lastTouch = Date.now(), Wc(r), ts(r, \"pointer\");\n};\nVr.touchmove = (r) => {\n r.input.lastTouch = Date.now(), ts(r, \"pointer\");\n};\nVr.contextmenu = (r) => Wc(r);\nfunction ih(r, e) {\n return r.composing ? !0 : Br && Math.abs(e.timeStamp - r.input.compositionEndedAt) < 500 ? (r.input.compositionEndedAt = -2e8, !0) : !1;\n}\nconst N1 = Ln ? 5e3 : -1;\nWr.compositionstart = Wr.compositionupdate = (r) => {\n if (!r.composing) {\n r.domObserver.flush();\n let { state: e } = r, t = e.selection.$to;\n if (e.selection instanceof ht && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((n) => n.type.spec.inclusive === !1) || jr && jp && O1(r)))\n r.markCursor = r.state.storedMarks || t.marks(), Di(r, !0), r.markCursor = null;\n else if (Di(r, !e.selection.empty), cn && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {\n let n = r.domSelectionRange();\n for (let s = n.focusNode, o = n.focusOffset; s && s.nodeType == 1 && o != 0; ) {\n let i = o < 0 ? s.lastChild : s.childNodes[o - 1];\n if (!i)\n break;\n if (i.nodeType == 3) {\n let a = r.domSelection();\n a && a.collapse(i, i.nodeValue.length);\n break;\n } else\n s = i, o = -1;\n }\n }\n r.input.composing = !0;\n }\n ah(r, N1);\n};\nfunction O1(r) {\n let { focusNode: e, focusOffset: t } = r.domSelectionRange();\n if (!e || e.nodeType != 1 || t >= e.childNodes.length)\n return !1;\n let n = e.childNodes[t];\n return n.nodeType == 1 && n.contentEditable == \"false\";\n}\nWr.compositionend = (r, e) => {\n r.composing && (r.input.composing = !1, r.input.compositionEndedAt = e.timeStamp, r.input.compositionPendingChanges = r.domObserver.pendingRecords().length ? r.input.compositionID : 0, r.input.compositionNode = null, r.input.badSafariComposition ? r.domObserver.forceFlush() : r.input.compositionPendingChanges && Promise.resolve().then(() => r.domObserver.flush()), r.input.compositionID++, ah(r, 20));\n};\nfunction ah(r, e) {\n clearTimeout(r.input.composingTimeout), e > -1 && (r.input.composingTimeout = setTimeout(() => Di(r), e));\n}\nfunction lh(r) {\n for (r.composing && (r.input.composing = !1, r.input.compositionEndedAt = I1()); r.input.compositionNodes.length > 0; )\n r.input.compositionNodes.pop().markParentsDirty();\n}\nfunction $1(r) {\n let e = r.domSelectionRange();\n if (!e.focusNode)\n return null;\n let t = S0(e.focusNode, e.focusOffset), n = E0(e.focusNode, e.focusOffset);\n if (t && n && t != n) {\n let s = n.pmViewDesc, o = r.domObserver.lastChangedTextNode;\n if (t == o || n == o)\n return o;\n if (!s || !s.isText(n.nodeValue))\n return n;\n if (r.input.compositionNode == n) {\n let i = t.pmViewDesc;\n if (!(!i || !i.isText(t.nodeValue)))\n return n;\n }\n }\n return t || n;\n}\nfunction I1() {\n let r = document.createEvent(\"Event\");\n return r.initEvent(\"event\", !0, !0), r.timeStamp;\n}\nfunction Di(r, e = !1) {\n if (!(Ln && r.domObserver.flushingSoon >= 0)) {\n if (r.domObserver.forceFlush(), lh(r), e || r.docView && r.docView.dirty) {\n let t = Fc(r), n = r.state.selection;\n return t && !t.eq(n) ? r.dispatch(r.state.tr.setSelection(t)) : (r.markCursor || e) && !n.$from.node(n.$from.sharedDepth(n.to)).inlineContent ? r.dispatch(r.state.tr.deleteSelection()) : r.updateState(r.state), !0;\n }\n return !1;\n }\n}\nfunction z1(r, e) {\n if (!r.dom.parentNode)\n return;\n let t = r.dom.parentNode.appendChild(document.createElement(\"div\"));\n t.appendChild(e), t.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n let n = getSelection(), s = document.createRange();\n s.selectNodeContents(e), r.dom.blur(), n.removeAllRanges(), n.addRange(s), setTimeout(() => {\n t.parentNode && t.parentNode.removeChild(t), r.focus();\n }, 50);\n}\nconst Do = Gr && rs < 15 || eo && P0 < 604;\nVr.copy = Wr.cut = (r, e) => {\n let t = e, n = r.state.selection, s = t.type == \"cut\";\n if (n.empty)\n return;\n let o = Do ? null : t.clipboardData, i = n.content(), { dom: a, text: l } = Hc(r, i);\n o ? (t.preventDefault(), o.clearData(), o.setData(\"text/html\", a.innerHTML), o.setData(\"text/plain\", l)) : z1(r, a), s && r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta(\"uiEvent\", \"cut\"));\n};\nfunction R1(r) {\n return r.openStart == 0 && r.openEnd == 0 && r.content.childCount == 1 ? r.content.firstChild : null;\n}\nfunction j1(r, e) {\n if (!r.dom.parentNode)\n return;\n let t = r.input.shiftKey || r.state.selection.$from.parent.type.spec.code, n = r.dom.parentNode.appendChild(document.createElement(t ? \"textarea\" : \"div\"));\n t || (n.contentEditable = \"true\"), n.style.cssText = \"position: fixed; left: -10000px; top: 10px\", n.focus();\n let s = r.input.shiftKey && r.input.lastKeyCode != 45;\n setTimeout(() => {\n r.focus(), n.parentNode && n.parentNode.removeChild(n), t ? Fo(r, n.value, null, s, e) : Fo(r, n.textContent, n.innerHTML, s, e);\n }, 50);\n}\nfunction Fo(r, e, t, n, s) {\n let o = Zp(r, e, t, n, r.state.selection.$from);\n if (r.someProp(\"handlePaste\", (l) => l(r, s, o || De.empty)))\n return !0;\n if (!o)\n return !1;\n let i = R1(o), a = i ? r.state.tr.replaceSelectionWith(i, n) : r.state.tr.replaceSelection(o);\n return r.dispatch(a.scrollIntoView().setMeta(\"paste\", !0).setMeta(\"uiEvent\", \"paste\")), !0;\n}\nfunction ch(r) {\n let e = r.getData(\"text/plain\") || r.getData(\"Text\");\n if (e)\n return e;\n let t = r.getData(\"text/uri-list\");\n return t ? t.replace(/\\r?\\n/g, \" \") : \"\";\n}\nWr.paste = (r, e) => {\n let t = e;\n if (r.composing && !Ln)\n return;\n let n = Do ? null : t.clipboardData, s = r.input.shiftKey && r.input.lastKeyCode != 45;\n n && Fo(r, ch(n), n.getData(\"text/html\"), s, t) ? t.preventDefault() : j1(r, t);\n};\nclass dh {\n constructor(e, t, n) {\n this.slice = e, this.move = t, this.node = n;\n }\n}\nconst L1 = an ? \"altKey\" : \"ctrlKey\";\nfunction uh(r, e) {\n let t;\n return r.someProp(\"dragCopies\", (n) => {\n t = t || n(e);\n }), t != null ? !t : !e[L1];\n}\nVr.dragstart = (r, e) => {\n let t = e, n = r.input.mouseDown;\n if (n && n.done(), !t.dataTransfer)\n return;\n let s = r.state.selection, o = s.empty ? null : r.posAtCoords(Pa(t)), i;\n if (!(o && o.pos >= s.from && o.pos <= (s instanceof ot ? s.to - 1 : s.to))) {\n if (n && n.mightDrag)\n i = ot.create(r.state.doc, n.mightDrag.pos);\n else if (t.target && t.target.nodeType == 1) {\n let f = r.docView.nearestDesc(t.target, !0);\n f && f.node.type.spec.draggable && f != r.docView && (i = ot.create(r.state.doc, f.posBefore));\n }\n }\n let a = (i || r.state.selection).content(), { dom: l, text: d, slice: u } = Hc(r, a);\n (!t.dataTransfer.files.length || !jr || Rp > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Do ? \"Text\" : \"text/html\", l.innerHTML), t.dataTransfer.effectAllowed = \"copyMove\", Do || t.dataTransfer.setData(\"text/plain\", d), r.dragging = new dh(u, uh(r, t), i);\n};\nVr.dragend = (r) => {\n let e = r.dragging;\n window.setTimeout(() => {\n r.dragging == e && (r.dragging = null);\n }, 50);\n};\nWr.dragover = Wr.dragenter = (r, e) => e.preventDefault();\nWr.drop = (r, e) => {\n try {\n D1(r, e, r.dragging);\n } finally {\n r.dragging = null;\n }\n};\nfunction D1(r, e, t) {\n if (!e.dataTransfer)\n return;\n let n = r.posAtCoords(Pa(e));\n if (!n)\n return;\n let s = r.state.doc.resolve(n.pos), o = t && t.slice;\n o ? r.someProp(\"transformPasted\", (p) => {\n o = p(o, r, !1);\n }) : o = Zp(r, ch(e.dataTransfer), Do ? null : e.dataTransfer.getData(\"text/html\"), !1, s);\n let i = !!(t && uh(r, e));\n if (r.someProp(\"handleDrop\", (p) => p(r, e, o || De.empty, i))) {\n e.preventDefault();\n return;\n }\n if (!o)\n return;\n e.preventDefault();\n let a = o ? mp(r.state.doc, s.pos, o) : s.pos;\n a == null && (a = s.pos);\n let l = r.state.tr;\n if (i) {\n let { node: p } = t;\n p ? p.replace(l) : l.deleteSelection();\n }\n let d = l.mapping.map(a), u = o.openStart == 0 && o.openEnd == 0 && o.content.childCount == 1, f = l.doc;\n if (u ? l.replaceRangeWith(d, d, o.content.firstChild) : l.replaceRange(d, d, o), l.doc.eq(f))\n return;\n let h = l.doc.resolve(d);\n if (u && ot.isSelectable(o.content.firstChild) && h.nodeAfter && h.nodeAfter.sameMarkup(o.content.firstChild))\n l.setSelection(new ot(h));\n else {\n let p = l.mapping.map(a);\n l.mapping.maps[l.mapping.maps.length - 1].forEach((g, b, y, C) => p = C), l.setSelection(Bc(r, h, l.doc.resolve(p)));\n }\n r.focus(), r.dispatch(l.setMeta(\"uiEvent\", \"drop\"));\n}\nVr.focus = (r) => {\n r.input.lastFocus = Date.now(), r.focused || (r.domObserver.stop(), r.dom.classList.add(\"ProseMirror-focused\"), r.domObserver.start(), r.focused = !0, setTimeout(() => {\n r.docView && r.hasFocus() && !r.domObserver.currentSelection.eq(r.domSelectionRange()) && Fn(r);\n }, 20));\n};\nVr.blur = (r, e) => {\n let t = e;\n r.focused && (r.domObserver.stop(), r.dom.classList.remove(\"ProseMirror-focused\"), r.domObserver.start(), t.relatedTarget && r.dom.contains(t.relatedTarget) && r.domObserver.currentSelection.clear(), r.focused = !1);\n};\nVr.beforeinput = (r, e) => {\n if (jr && Ln && e.inputType == \"deleteContentBackward\") {\n r.domObserver.flushSoon();\n let { domChangeCount: n } = r.input;\n setTimeout(() => {\n if (r.input.domChangeCount != n || (r.dom.blur(), r.focus(), r.someProp(\"handleKeyDown\", (o) => o(r, gs(8, \"Backspace\")))))\n return;\n let { $cursor: s } = r.state.selection;\n s && s.pos > 0 && r.dispatch(r.state.tr.delete(s.pos - 1, s.pos).scrollIntoView());\n }, 50);\n }\n};\nfor (let r in Wr)\n Vr[r] = Wr[r];\nfunction Bo(r, e) {\n if (r == e)\n return !0;\n for (let t in r)\n if (r[t] !== e[t])\n return !1;\n for (let t in e)\n if (!(t in r))\n return !1;\n return !0;\n}\nclass Fi {\n constructor(e, t) {\n this.toDOM = e, this.spec = t || Ts, this.side = this.spec.side || 0;\n }\n map(e, t, n, s) {\n let { pos: o, deleted: i } = e.mapResult(t.from + s, this.side < 0 ? -1 : 1);\n return i ? null : new qr(o - n, o - n, this);\n }\n valid() {\n return !0;\n }\n eq(e) {\n return this == e || e instanceof Fi && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Bo(this.spec, e.spec));\n }\n destroy(e) {\n this.spec.destroy && this.spec.destroy(e);\n }\n}\nclass ss {\n constructor(e, t) {\n this.attrs = e, this.spec = t || Ts;\n }\n map(e, t, n, s) {\n let o = e.map(t.from + s, this.spec.inclusiveStart ? -1 : 1) - n, i = e.map(t.to + s, this.spec.inclusiveEnd ? 1 : -1) - n;\n return o >= i ? null : new qr(o, i, this);\n }\n valid(e, t) {\n return t.from < t.to;\n }\n eq(e) {\n return this == e || e instanceof ss && Bo(this.attrs, e.attrs) && Bo(this.spec, e.spec);\n }\n static is(e) {\n return e.type instanceof ss;\n }\n destroy() {\n }\n}\nclass Uc {\n constructor(e, t) {\n this.attrs = e, this.spec = t || Ts;\n }\n map(e, t, n, s) {\n let o = e.mapResult(t.from + s, 1);\n if (o.deleted)\n return null;\n let i = e.mapResult(t.to + s, -1);\n return i.deleted || i.pos <= o.pos ? null : new qr(o.pos - n, i.pos - n, this);\n }\n valid(e, t) {\n let { index: n, offset: s } = e.content.findIndex(t.from), o;\n return s == t.from && !(o = e.child(n)).isText && s + o.nodeSize == t.to;\n }\n eq(e) {\n return this == e || e instanceof Uc && Bo(this.attrs, e.attrs) && Bo(this.spec, e.spec);\n }\n destroy() {\n }\n}\nclass qr {\n /**\n @internal\n */\n constructor(e, t, n) {\n this.from = e, this.to = t, this.type = n;\n }\n /**\n @internal\n */\n copy(e, t) {\n return new qr(e, t, this.type);\n }\n /**\n @internal\n */\n eq(e, t = 0) {\n return this.type.eq(e.type) && this.from + t == e.from && this.to + t == e.to;\n }\n /**\n @internal\n */\n map(e, t, n) {\n return this.type.map(e, this, t, n);\n }\n /**\n Creates a widget decoration, which is a DOM node that's shown in\n the document at the given position. It is recommended that you\n delay rendering the widget by passing a function that will be\n called when the widget is actually drawn in a view, but you can\n also directly pass a DOM node. `getPos` can be used to find the\n widget's current document position.\n */\n static widget(e, t, n) {\n return new qr(e, e, new Fi(t, n));\n }\n /**\n Creates an inline decoration, which adds the given attributes to\n each inline node between `from` and `to`.\n */\n static inline(e, t, n, s) {\n return new qr(e, t, new ss(n, s));\n }\n /**\n Creates a node decoration. `from` and `to` should point precisely\n before and after a node in the document. That node, and only that\n node, will receive the given attributes.\n */\n static node(e, t, n, s) {\n return new qr(e, t, new Uc(n, s));\n }\n /**\n The spec provided when creating this decoration. Can be useful\n if you've stored extra information in that object.\n */\n get spec() {\n return this.type.spec;\n }\n /**\n @internal\n */\n get inline() {\n return this.type instanceof ss;\n }\n /**\n @internal\n */\n get widget() {\n return this.type instanceof Fi;\n }\n}\nconst Bs = [], Ts = {};\nclass lr {\n /**\n @internal\n */\n constructor(e, t) {\n this.local = e.length ? e : Bs, this.children = t.length ? t : Bs;\n }\n /**\n Create a set of decorations, using the structure of the given\n document. This will consume (modify) the `decorations` array, so\n you must make a copy if you want need to preserve that.\n */\n static create(e, t) {\n return t.length ? Bi(t, e, 0, Ts) : Fr;\n }\n /**\n Find all decorations in this set which touch the given range\n (including decorations that start or end directly at the\n boundaries) and match the given predicate on their spec. When\n `start` and `end` are omitted, all decorations in the set are\n considered. When `predicate` isn't given, all decorations are\n assumed to match.\n */\n find(e, t, n) {\n let s = [];\n return this.findInner(e ?? 0, t ?? 1e9, s, 0, n), s;\n }\n findInner(e, t, n, s, o) {\n for (let i = 0; i < this.local.length; i++) {\n let a = this.local[i];\n a.from <= t && a.to >= e && (!o || o(a.spec)) && n.push(a.copy(a.from + s, a.to + s));\n }\n for (let i = 0; i < this.children.length; i += 3)\n if (this.children[i] < t && this.children[i + 1] > e) {\n let a = this.children[i] + 1;\n this.children[i + 2].findInner(e - a, t - a, n, s + a, o);\n }\n }\n /**\n Map the set of decorations in response to a change in the\n document.\n */\n map(e, t, n) {\n return this == Fr || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, n || Ts);\n }\n /**\n @internal\n */\n mapInner(e, t, n, s, o) {\n let i;\n for (let a = 0; a < this.local.length; a++) {\n let l = this.local[a].map(e, n, s);\n l && l.type.valid(t, l) ? (i || (i = [])).push(l) : o.onRemove && o.onRemove(this.local[a].spec);\n }\n return this.children.length ? F1(this.children, i || [], e, t, n, s, o) : i ? new lr(i.sort(Ms), Bs) : Fr;\n }\n /**\n Add the given array of decorations to the ones in the set,\n producing a new set. Consumes the `decorations` array. Needs\n access to the current document to create the appropriate tree\n structure.\n */\n add(e, t) {\n return t.length ? this == Fr ? lr.create(e, t) : this.addInner(e, t, 0) : this;\n }\n addInner(e, t, n) {\n let s, o = 0;\n e.forEach((a, l) => {\n let d = l + n, u;\n if (u = ph(t, a, d)) {\n for (s || (s = this.children.slice()); o < s.length && s[o] < l; )\n o += 3;\n s[o] == l ? s[o + 2] = s[o + 2].addInner(a, u, d + 1) : s.splice(o, 0, l, l + a.nodeSize, Bi(u, a, d + 1, Ts)), o += 3;\n }\n });\n let i = fh(o ? hh(t) : t, -n);\n for (let a = 0; a < i.length; a++)\n i[a].type.valid(e, i[a]) || i.splice(a--, 1);\n return new lr(i.length ? this.local.concat(i).sort(Ms) : this.local, s || this.children);\n }\n /**\n Create a new set that contains the decorations in this set, minus\n the ones in the given array.\n */\n remove(e) {\n return e.length == 0 || this == Fr ? this : this.removeInner(e, 0);\n }\n removeInner(e, t) {\n let n = this.children, s = this.local;\n for (let o = 0; o < n.length; o += 3) {\n let i, a = n[o] + t, l = n[o + 1] + t;\n for (let u = 0, f; u < e.length; u++)\n (f = e[u]) && f.from > a && f.to < l && (e[u] = null, (i || (i = [])).push(f));\n if (!i)\n continue;\n n == this.children && (n = this.children.slice());\n let d = n[o + 2].removeInner(i, a + 1);\n d != Fr ? n[o + 2] = d : (n.splice(o, 3), o -= 3);\n }\n if (s.length) {\n for (let o = 0, i; o < e.length; o++)\n if (i = e[o])\n for (let a = 0; a < s.length; a++)\n s[a].eq(i, t) && (s == this.local && (s = this.local.slice()), s.splice(a--, 1));\n }\n return n == this.children && s == this.local ? this : s.length || n.length ? new lr(s, n) : Fr;\n }\n forChild(e, t) {\n if (this == Fr)\n return this;\n if (t.isLeaf)\n return lr.empty;\n let n, s;\n for (let a = 0; a < this.children.length; a += 3)\n if (this.children[a] >= e) {\n this.children[a] == e && (n = this.children[a + 2]);\n break;\n }\n let o = e + 1, i = o + t.content.size;\n for (let a = 0; a < this.local.length; a++) {\n let l = this.local[a];\n if (l.from < i && l.to > o && l.type instanceof ss) {\n let d = Math.max(o, l.from) - o, u = Math.min(i, l.to) - o;\n d < u && (s || (s = [])).push(l.copy(d, u));\n }\n }\n if (s) {\n let a = new lr(s.sort(Ms), Bs);\n return n ? new Yn([a, n]) : a;\n }\n return n || Fr;\n }\n /**\n @internal\n */\n eq(e) {\n if (this == e)\n return !0;\n if (!(e instanceof lr) || this.local.length != e.local.length || this.children.length != e.children.length)\n return !1;\n for (let t = 0; t < this.local.length; t++)\n if (!this.local[t].eq(e.local[t]))\n return !1;\n for (let t = 0; t < this.children.length; t += 3)\n if (this.children[t] != e.children[t] || this.children[t + 1] != e.children[t + 1] || !this.children[t + 2].eq(e.children[t + 2]))\n return !1;\n return !0;\n }\n /**\n @internal\n */\n locals(e) {\n return Jc(this.localsInner(e));\n }\n /**\n @internal\n */\n localsInner(e) {\n if (this == Fr)\n return Bs;\n if (e.inlineContent || !this.local.some(ss.is))\n return this.local;\n let t = [];\n for (let n = 0; n < this.local.length; n++)\n this.local[n].type instanceof ss || t.push(this.local[n]);\n return t;\n }\n forEachSet(e) {\n e(this);\n }\n}\nlr.empty = new lr([], []);\nlr.removeOverlap = Jc;\nconst Fr = lr.empty;\nclass Yn {\n constructor(e) {\n this.members = e;\n }\n map(e, t) {\n const n = this.members.map((s) => s.map(e, t, Ts));\n return Yn.from(n);\n }\n forChild(e, t) {\n if (t.isLeaf)\n return lr.empty;\n let n = [];\n for (let s = 0; s < this.members.length; s++) {\n let o = this.members[s].forChild(e, t);\n o != Fr && (o instanceof Yn ? n = n.concat(o.members) : n.push(o));\n }\n return Yn.from(n);\n }\n eq(e) {\n if (!(e instanceof Yn) || e.members.length != this.members.length)\n return !1;\n for (let t = 0; t < this.members.length; t++)\n if (!this.members[t].eq(e.members[t]))\n return !1;\n return !0;\n }\n locals(e) {\n let t, n = !0;\n for (let s = 0; s < this.members.length; s++) {\n let o = this.members[s].localsInner(e);\n if (o.length)\n if (!t)\n t = o;\n else {\n n && (t = t.slice(), n = !1);\n for (let i = 0; i < o.length; i++)\n t.push(o[i]);\n }\n }\n return t ? Jc(n ? t : t.sort(Ms)) : Bs;\n }\n // Create a group for the given array of decoration sets, or return\n // a single set when possible.\n static from(e) {\n switch (e.length) {\n case 0:\n return Fr;\n case 1:\n return e[0];\n default:\n return new Yn(e.every((t) => t instanceof lr) ? e : e.reduce((t, n) => t.concat(n instanceof lr ? n : n.members), []));\n }\n }\n forEachSet(e) {\n for (let t = 0; t < this.members.length; t++)\n this.members[t].forEachSet(e);\n }\n}\nfunction F1(r, e, t, n, s, o, i) {\n let a = r.slice();\n for (let d = 0, u = o; d < t.maps.length; d++) {\n let f = 0;\n t.maps[d].forEach((h, p, g, b) => {\n let y = b - g - (p - h);\n for (let C = 0; C < a.length; C += 3) {\n let E = a[C + 1];\n if (E < 0 || h > E + u - f)\n continue;\n let R = a[C] + u - f;\n p >= R ? a[C + 1] = h <= R ? -2 : -1 : h >= u && y && (a[C] += y, a[C + 1] += y);\n }\n f += y;\n }), u = t.maps[d].map(u, -1);\n }\n let l = !1;\n for (let d = 0; d < a.length; d += 3)\n if (a[d + 1] < 0) {\n if (a[d + 1] == -2) {\n l = !0, a[d + 1] = -1;\n continue;\n }\n let u = t.map(r[d] + o), f = u - s;\n if (f < 0 || f >= n.content.size) {\n l = !0;\n continue;\n }\n let h = t.map(r[d + 1] + o, -1), p = h - s, { index: g, offset: b } = n.content.findIndex(f), y = n.maybeChild(g);\n if (y && b == f && b + y.nodeSize == p) {\n let C = a[d + 2].mapInner(t, y, u + 1, r[d] + o + 1, i);\n C != Fr ? (a[d] = f, a[d + 1] = p, a[d + 2] = C) : (a[d + 1] = -2, l = !0);\n } else\n l = !0;\n }\n if (l) {\n let d = B1(a, r, e, t, s, o, i), u = Bi(d, n, 0, i);\n e = u.local;\n for (let f = 0; f < a.length; f += 3)\n a[f + 1] < 0 && (a.splice(f, 3), f -= 3);\n for (let f = 0, h = 0; f < u.children.length; f += 3) {\n let p = u.children[f];\n for (; h < a.length && a[h] < p; )\n h += 3;\n a.splice(h, 0, u.children[f], u.children[f + 1], u.children[f + 2]);\n }\n }\n return new lr(e.sort(Ms), a);\n}\nfunction fh(r, e) {\n if (!e || !r.length)\n return r;\n let t = [];\n for (let n = 0; n < r.length; n++) {\n let s = r[n];\n t.push(new qr(s.from + e, s.to + e, s.type));\n }\n return t;\n}\nfunction B1(r, e, t, n, s, o, i) {\n function a(l, d) {\n for (let u = 0; u < l.local.length; u++) {\n let f = l.local[u].map(n, s, d);\n f ? t.push(f) : i.onRemove && i.onRemove(l.local[u].spec);\n }\n for (let u = 0; u < l.children.length; u += 3)\n a(l.children[u + 2], l.children[u] + d + 1);\n }\n for (let l = 0; l < r.length; l += 3)\n r[l + 1] == -1 && a(r[l + 2], e[l] + o + 1);\n return t;\n}\nfunction ph(r, e, t) {\n if (e.isLeaf)\n return null;\n let n = t + e.nodeSize, s = null;\n for (let o = 0, i; o < r.length; o++)\n (i = r[o]) && i.from > t && i.to < n && ((s || (s = [])).push(i), r[o] = null);\n return s;\n}\nfunction hh(r) {\n let e = [];\n for (let t = 0; t < r.length; t++)\n r[t] != null && e.push(r[t]);\n return e;\n}\nfunction Bi(r, e, t, n) {\n let s = [], o = !1;\n e.forEach((a, l) => {\n let d = ph(r, a, l + t);\n if (d) {\n o = !0;\n let u = Bi(d, a, t + l + 1, n);\n u != Fr && s.push(l, l + a.nodeSize, u);\n }\n });\n let i = fh(o ? hh(r) : r, -t).sort(Ms);\n for (let a = 0; a < i.length; a++)\n i[a].type.valid(e, i[a]) || (n.onRemove && n.onRemove(i[a].spec), i.splice(a--, 1));\n return i.length || s.length ? new lr(i, s) : Fr;\n}\nfunction Ms(r, e) {\n return r.from - e.from || r.to - e.to;\n}\nfunction Jc(r) {\n let e = r;\n for (let t = 0; t < e.length - 1; t++) {\n let n = e[t];\n if (n.from != n.to)\n for (let s = t + 1; s < e.length; s++) {\n let o = e[s];\n if (o.from == n.from) {\n o.to != n.to && (e == r && (e = r.slice()), e[s] = o.copy(o.from, n.to), Mu(e, s + 1, o.copy(n.to, o.to)));\n continue;\n } else {\n o.from < n.to && (e == r && (e = r.slice()), e[t] = n.copy(n.from, o.from), Mu(e, s, n.copy(o.from, n.to)));\n break;\n }\n }\n }\n return e;\n}\nfunction Mu(r, e, t) {\n for (; e < r.length && Ms(t, r[e]) > 0; )\n e++;\n r.splice(e, 0, t);\n}\nfunction al(r) {\n let e = [];\n return r.someProp(\"decorations\", (t) => {\n let n = t(r.state);\n n && n != Fr && e.push(n);\n }), r.cursorWrapper && e.push(lr.create(r.state.doc, [r.cursorWrapper.deco])), Yn.from(e);\n}\nconst H1 = {\n childList: !0,\n characterData: !0,\n characterDataOldValue: !0,\n attributes: !0,\n attributeOldValue: !0,\n subtree: !0\n}, q1 = Gr && rs <= 11;\nclass V1 {\n constructor() {\n this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;\n }\n set(e) {\n this.anchorNode = e.anchorNode, this.anchorOffset = e.anchorOffset, this.focusNode = e.focusNode, this.focusOffset = e.focusOffset;\n }\n clear() {\n this.anchorNode = this.focusNode = null;\n }\n eq(e) {\n return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;\n }\n}\nclass W1 {\n constructor(e, t) {\n this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new V1(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((n) => {\n for (let s = 0; s < n.length; s++)\n this.queue.push(n[s]);\n Gr && rs <= 11 && n.some((s) => s.type == \"childList\" && s.removedNodes.length || s.type == \"characterData\" && s.oldValue.length > s.target.nodeValue.length) ? this.flushSoon() : Br && e.composing && n.some((s) => s.type == \"childList\" && s.target.nodeName == \"TR\") ? (e.input.badSafariComposition = !0, this.flushSoon()) : this.flush();\n }), q1 && (this.onCharData = (n) => {\n this.queue.push({ target: n.target, type: \"characterData\", oldValue: n.prevValue }), this.flushSoon();\n }), this.onSelectionChange = this.onSelectionChange.bind(this);\n }\n flushSoon() {\n this.flushingSoon < 0 && (this.flushingSoon = window.setTimeout(() => {\n this.flushingSoon = -1, this.flush();\n }, 20));\n }\n forceFlush() {\n this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());\n }\n start() {\n this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, H1)), this.onCharData && this.view.dom.addEventListener(\"DOMCharacterDataModified\", this.onCharData), this.connectSelection();\n }\n stop() {\n if (this.observer) {\n let e = this.observer.takeRecords();\n if (e.length) {\n for (let t = 0; t < e.length; t++)\n this.queue.push(e[t]);\n window.setTimeout(() => this.flush(), 20);\n }\n this.observer.disconnect();\n }\n this.onCharData && this.view.dom.removeEventListener(\"DOMCharacterDataModified\", this.onCharData), this.disconnectSelection();\n }\n connectSelection() {\n this.view.dom.ownerDocument.addEventListener(\"selectionchange\", this.onSelectionChange);\n }\n disconnectSelection() {\n this.view.dom.ownerDocument.removeEventListener(\"selectionchange\", this.onSelectionChange);\n }\n suppressSelectionUpdates() {\n this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);\n }\n onSelectionChange() {\n if (xu(this.view)) {\n if (this.suppressingSelectionUpdates)\n return Fn(this.view);\n if (Gr && rs <= 11 && !this.view.state.selection.empty) {\n let e = this.view.domSelectionRange();\n if (e.focusNode && Os(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))\n return this.flushSoon();\n }\n this.flush();\n }\n }\n setCurSelection() {\n this.currentSelection.set(this.view.domSelectionRange());\n }\n ignoreSelectionChange(e) {\n if (!e.focusNode)\n return !0;\n let t = /* @__PURE__ */ new Set(), n;\n for (let o = e.focusNode; o; o = Zs(o))\n t.add(o);\n for (let o = e.anchorNode; o; o = Zs(o))\n if (t.has(o)) {\n n = o;\n break;\n }\n let s = n && this.view.docView.nearestDesc(n);\n if (s && s.ignoreMutation({\n type: \"selection\",\n target: n.nodeType == 3 ? n.parentNode : n\n }))\n return this.setCurSelection(), !0;\n }\n pendingRecords() {\n if (this.observer)\n for (let e of this.observer.takeRecords())\n this.queue.push(e);\n return this.queue;\n }\n flush() {\n let { view: e } = this;\n if (!e.docView || this.flushingSoon > -1)\n return;\n let t = this.pendingRecords();\n t.length && (this.queue = []);\n let n = e.domSelectionRange(), s = !this.suppressingSelectionUpdates && !this.currentSelection.eq(n) && xu(e) && !this.ignoreSelectionChange(n), o = -1, i = -1, a = !1, l = [];\n if (e.editable)\n for (let u = 0; u < t.length; u++) {\n let f = this.registerMutation(t[u], l);\n f && (o = o < 0 ? f.from : Math.min(f.from, o), i = i < 0 ? f.to : Math.max(f.to, i), f.typeOver && (a = !0));\n }\n if (l.some((u) => u.nodeName == \"BR\") && (e.input.lastKeyCode == 8 || e.input.lastKeyCode == 46)) {\n for (let u of l)\n if (u.nodeName == \"BR\" && u.parentNode) {\n let f = u.nextSibling;\n for (; f && f.nodeType == 1; ) {\n if (f.contentEditable == \"false\") {\n u.parentNode.removeChild(u);\n break;\n }\n f = f.firstChild;\n }\n }\n } else if (cn && l.length) {\n let u = l.filter((f) => f.nodeName == \"BR\");\n if (u.length == 2) {\n let [f, h] = u;\n f.parentNode && f.parentNode.parentNode == h.parentNode ? h.remove() : f.remove();\n } else {\n let { focusNode: f } = this.currentSelection;\n for (let h of u) {\n let p = h.parentNode;\n p && p.nodeName == \"LI\" && (!f || K1(e, f) != p) && h.remove();\n }\n }\n }\n let d = null;\n o < 0 && s && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Ma(n) && (d = Fc(e)) && d.eq(St.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Fn(e), this.currentSelection.set(n), e.scrollToSelection()) : (o > -1 || s) && (o > -1 && (e.docView.markDirty(o, i), U1(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, G1(e, l)), this.handleDOMChange(o, i, a, l), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(n) || Fn(e), this.currentSelection.set(n));\n }\n registerMutation(e, t) {\n if (t.indexOf(e.target) > -1)\n return null;\n let n = this.view.docView.nearestDesc(e.target);\n if (e.type == \"attributes\" && (n == this.view.docView || e.attributeName == \"contenteditable\" || // Firefox sometimes fires spurious events for null/empty styles\n e.attributeName == \"style\" && !e.oldValue && !e.target.getAttribute(\"style\")) || !n || n.ignoreMutation(e))\n return null;\n if (e.type == \"childList\") {\n for (let u = 0; u < e.addedNodes.length; u++) {\n let f = e.addedNodes[u];\n t.push(f), f.nodeType == 3 && (this.lastChangedTextNode = f);\n }\n if (n.contentDOM && n.contentDOM != n.dom && !n.contentDOM.contains(e.target))\n return { from: n.posBefore, to: n.posAfter };\n let s = e.previousSibling, o = e.nextSibling;\n if (Gr && rs <= 11 && e.addedNodes.length)\n for (let u = 0; u < e.addedNodes.length; u++) {\n let { previousSibling: f, nextSibling: h } = e.addedNodes[u];\n (!f || Array.prototype.indexOf.call(e.addedNodes, f) < 0) && (s = f), (!h || Array.prototype.indexOf.call(e.addedNodes, h) < 0) && (o = h);\n }\n let i = s && s.parentNode == e.target ? zr(s) + 1 : 0, a = n.localPosFromDOM(e.target, i, -1), l = o && o.parentNode == e.target ? zr(o) : e.target.childNodes.length, d = n.localPosFromDOM(e.target, l, 1);\n return { from: a, to: d };\n } else return e.type == \"attributes\" ? { from: n.posAtStart - n.border, to: n.posAtEnd + n.border } : (this.lastChangedTextNode = e.target, {\n from: n.posAtStart,\n to: n.posAtEnd,\n // An event was generated for a text change that didn't change\n // any text. Mark the dom change to fall back to assuming the\n // selection was typed over with an identical value if it can't\n // find another change.\n typeOver: e.target.nodeValue == e.oldValue\n });\n }\n}\nlet Au = /* @__PURE__ */ new WeakMap(), Pu = !1;\nfunction U1(r) {\n if (!Au.has(r) && (Au.set(r, null), [\"normal\", \"nowrap\", \"pre-line\"].indexOf(getComputedStyle(r.dom).whiteSpace) !== -1)) {\n if (r.requiresGeckoHackNode = cn, Pu)\n return;\n console.warn(\"ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.\"), Pu = !0;\n }\n}\nfunction Nu(r, e) {\n let t = e.startContainer, n = e.startOffset, s = e.endContainer, o = e.endOffset, i = r.domAtPos(r.state.selection.anchor);\n return Os(i.node, i.offset, s, o) && ([t, n, s, o] = [s, o, t, n]), { anchorNode: t, anchorOffset: n, focusNode: s, focusOffset: o };\n}\nfunction J1(r, e) {\n if (e.getComposedRanges) {\n let s = e.getComposedRanges(r.root)[0];\n if (s)\n return Nu(r, s);\n }\n let t;\n function n(s) {\n s.preventDefault(), s.stopImmediatePropagation(), t = s.getTargetRanges()[0];\n }\n return r.dom.addEventListener(\"beforeinput\", n, !0), document.execCommand(\"indent\"), r.dom.removeEventListener(\"beforeinput\", n, !0), t ? Nu(r, t) : null;\n}\nfunction K1(r, e) {\n for (let t = e.parentNode; t && t != r.dom; t = t.parentNode) {\n let n = r.docView.nearestDesc(t, !0);\n if (n && n.node.isBlock)\n return t;\n }\n return null;\n}\nfunction G1(r, e) {\n var t;\n let { focusNode: n, focusOffset: s } = r.domSelectionRange();\n for (let o of e)\n if (((t = o.parentNode) === null || t === void 0 ? void 0 : t.nodeName) == \"TR\") {\n let i = o.nextSibling;\n for (; i && i.nodeName != \"TD\" && i.nodeName != \"TH\"; )\n i = i.nextSibling;\n if (i) {\n let a = i;\n for (; ; ) {\n let l = a.firstChild;\n if (!l || l.nodeType != 1 || l.contentEditable == \"false\" || /^(BR|IMG)$/.test(l.nodeName))\n break;\n a = l;\n }\n a.insertBefore(o, a.firstChild), n == o && r.domSelection().collapse(o, s);\n } else\n o.parentNode.removeChild(o);\n }\n}\nfunction Y1(r, e, t) {\n let { node: n, fromOffset: s, toOffset: o, from: i, to: a } = r.docView.parseRange(e, t), l = r.domSelectionRange(), d, u = l.anchorNode;\n if (u && r.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (d = [{ node: u, offset: l.anchorOffset }], Ma(l) || d.push({ node: l.focusNode, offset: l.focusOffset })), jr && r.input.lastKeyCode === 8)\n for (let y = o; y > s; y--) {\n let C = n.childNodes[y - 1], E = C.pmViewDesc;\n if (C.nodeName == \"BR\" && !E) {\n o = y;\n break;\n }\n if (!E || E.size)\n break;\n }\n let f = r.state.doc, h = r.someProp(\"domParser\") || wo.fromSchema(r.state.schema), p = f.resolve(i), g = null, b = h.parse(n, {\n topNode: p.parent,\n topMatch: p.parent.contentMatchAt(p.index()),\n topOpen: !0,\n from: s,\n to: o,\n preserveWhitespace: p.parent.type.whitespace == \"pre\" ? \"full\" : !0,\n findPositions: d,\n ruleFromNode: X1,\n context: p\n });\n if (d && d[0].pos != null) {\n let y = d[0].pos, C = d[1] && d[1].pos;\n C == null && (C = y), g = { anchor: y + i, head: C + i };\n }\n return { doc: b, sel: g, from: i, to: a };\n}\nfunction X1(r) {\n let e = r.pmViewDesc;\n if (e)\n return e.parseRule();\n if (r.nodeName == \"BR\" && r.parentNode) {\n if (Br && /^(ul|ol)$/i.test(r.parentNode.nodeName)) {\n let t = document.createElement(\"div\");\n return t.appendChild(document.createElement(\"li\")), { skip: t };\n } else if (r.parentNode.lastChild == r || Br && /^(tr|table)$/i.test(r.parentNode.nodeName))\n return { ignore: !0 };\n } else if (r.nodeName == \"IMG\" && r.getAttribute(\"mark-placeholder\"))\n return { ignore: !0 };\n return null;\n}\nconst Q1 = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;\nfunction Z1(r, e, t, n, s) {\n let o = r.input.compositionPendingChanges || (r.composing ? r.input.compositionID : 0);\n if (r.input.compositionPendingChanges = 0, e < 0) {\n let P = r.input.lastSelectionTime > Date.now() - 50 ? r.input.lastSelectionOrigin : null, L = Fc(r, P);\n if (L && !r.state.selection.eq(L)) {\n if (jr && Ln && r.input.lastKeyCode === 13 && Date.now() - 100 < r.input.lastKeyCodeTime && r.someProp(\"handleKeyDown\", (J) => J(r, gs(13, \"Enter\"))))\n return;\n let $ = r.state.tr.setSelection(L);\n P == \"pointer\" ? $.setMeta(\"pointer\", !0) : P == \"key\" && $.scrollIntoView(), o && $.setMeta(\"composition\", o), r.dispatch($);\n }\n return;\n }\n let i = r.state.doc.resolve(e), a = i.sharedDepth(t);\n e = i.before(a + 1), t = r.state.doc.resolve(t).after(a + 1);\n let l = r.state.selection, d = Y1(r, e, t), u = r.state.doc, f = u.slice(d.from, d.to), h, p;\n r.input.lastKeyCode === 8 && Date.now() - 100 < r.input.lastKeyCodeTime ? (h = r.state.selection.to, p = \"end\") : (h = r.state.selection.from, p = \"start\"), r.input.lastKeyCode = null;\n let g = ry(f.content, d.doc.content, d.from, h, p);\n if (g && r.input.domChangeCount++, (eo && r.input.lastIOSEnter > Date.now() - 225 || Ln) && s.some((P) => P.nodeType == 1 && !Q1.test(P.nodeName)) && (!g || g.endA >= g.endB) && r.someProp(\"handleKeyDown\", (P) => P(r, gs(13, \"Enter\")))) {\n r.input.lastIOSEnter = 0;\n return;\n }\n if (!g)\n if (n && l instanceof ht && !l.empty && l.$head.sameParent(l.$anchor) && !r.composing && !(d.sel && d.sel.anchor != d.sel.head))\n g = { start: l.from, endA: l.to, endB: l.to };\n else {\n if (d.sel) {\n let P = Ou(r, r.state.doc, d.sel);\n if (P && !P.eq(r.state.selection)) {\n let L = r.state.tr.setSelection(P);\n o && L.setMeta(\"composition\", o), r.dispatch(L);\n }\n }\n return;\n }\n r.state.selection.from < r.state.selection.to && g.start == g.endB && r.state.selection instanceof ht && (g.start > r.state.selection.from && g.start <= r.state.selection.from + 2 && r.state.selection.from >= d.from ? g.start = r.state.selection.from : g.endA < r.state.selection.to && g.endA >= r.state.selection.to - 2 && r.state.selection.to <= d.to && (g.endB += r.state.selection.to - g.endA, g.endA = r.state.selection.to)), Gr && rs <= 11 && g.endB == g.start + 1 && g.endA == g.start && g.start > d.from && d.doc.textBetween(g.start - d.from - 1, g.start - d.from + 1) == \" \u00A0\" && (g.start--, g.endA--, g.endB--);\n let b = d.doc.resolveNoCache(g.start - d.from), y = d.doc.resolveNoCache(g.endB - d.from), C = u.resolve(g.start), E = b.sameParent(y) && b.parent.inlineContent && C.end() >= g.endA;\n if ((eo && r.input.lastIOSEnter > Date.now() - 225 && (!E || s.some((P) => P.nodeName == \"DIV\" || P.nodeName == \"P\")) || !E && b.pos < d.doc.content.size && (!b.sameParent(y) || !b.parent.inlineContent) && b.pos < y.pos && !/\\S/.test(d.doc.textBetween(b.pos, y.pos, \"\", \"\"))) && r.someProp(\"handleKeyDown\", (P) => P(r, gs(13, \"Enter\")))) {\n r.input.lastIOSEnter = 0;\n return;\n }\n if (r.state.selection.anchor > g.start && ty(u, g.start, g.endA, b, y) && r.someProp(\"handleKeyDown\", (P) => P(r, gs(8, \"Backspace\")))) {\n Ln && jr && r.domObserver.suppressSelectionUpdates();\n return;\n }\n jr && g.endB == g.start && (r.input.lastChromeDelete = Date.now()), Ln && !E && b.start() != y.start() && y.parentOffset == 0 && b.depth == y.depth && d.sel && d.sel.anchor == d.sel.head && d.sel.head == g.endA && (g.endB -= 2, y = d.doc.resolveNoCache(g.endB - d.from), setTimeout(() => {\n r.someProp(\"handleKeyDown\", function(P) {\n return P(r, gs(13, \"Enter\"));\n });\n }, 20));\n let R = g.start, q = g.endA, O = (P) => {\n let L = P || r.state.tr.replace(R, q, d.doc.slice(g.start - d.from, g.endB - d.from));\n if (d.sel) {\n let $ = Ou(r, L.doc, d.sel);\n $ && !(jr && r.composing && $.empty && (g.start != g.endB || r.input.lastChromeDelete < Date.now() - 100) && ($.head == R || $.head == L.mapping.map(q) - 1) || Gr && $.empty && $.head == R) && L.setSelection($);\n }\n return o && L.setMeta(\"composition\", o), L.scrollIntoView();\n }, M;\n if (E)\n if (b.pos == y.pos) {\n Gr && rs <= 11 && b.parentOffset == 0 && (r.domObserver.suppressSelectionUpdates(), setTimeout(() => Fn(r), 20));\n let P = O(r.state.tr.delete(R, q)), L = u.resolve(g.start).marksAcross(u.resolve(g.endA));\n L && P.ensureMarks(L), r.dispatch(P);\n } else if (\n // Adding or removing a mark\n g.endA == g.endB && (M = ey(b.parent.content.cut(b.parentOffset, y.parentOffset), C.parent.content.cut(C.parentOffset, g.endA - C.start())))\n ) {\n let P = O(r.state.tr);\n M.type == \"add\" ? P.addMark(R, q, M.mark) : P.removeMark(R, q, M.mark), r.dispatch(P);\n } else if (b.parent.child(b.index()).isText && b.index() == y.index() - (y.textOffset ? 0 : 1)) {\n let P = b.parent.textBetween(b.parentOffset, y.parentOffset), L = () => O(r.state.tr.insertText(P, R, q));\n r.someProp(\"handleTextInput\", ($) => $(r, R, q, P, L)) || r.dispatch(L());\n } else\n r.dispatch(O());\n else\n r.dispatch(O());\n}\nfunction Ou(r, e, t) {\n return Math.max(t.anchor, t.head) > e.content.size ? null : Bc(r, e.resolve(t.anchor), e.resolve(t.head));\n}\nfunction ey(r, e) {\n let t = r.firstChild.marks, n = e.firstChild.marks, s = t, o = n, i, a, l;\n for (let u = 0; u < n.length; u++)\n s = n[u].removeFromSet(s);\n for (let u = 0; u < t.length; u++)\n o = t[u].removeFromSet(o);\n if (s.length == 1 && o.length == 0)\n a = s[0], i = \"add\", l = (u) => u.mark(a.addToSet(u.marks));\n else if (s.length == 0 && o.length == 1)\n a = o[0], i = \"remove\", l = (u) => u.mark(a.removeFromSet(u.marks));\n else\n return null;\n let d = [];\n for (let u = 0; u < e.childCount; u++)\n d.push(l(e.child(u)));\n if (ye.from(d).eq(r))\n return { mark: a, type: i };\n}\nfunction ty(r, e, t, n, s) {\n if (\n // The content must have shrunk\n t - e <= s.pos - n.pos || // newEnd must point directly at or after the end of the block that newStart points into\n ll(n, !0, !1) < s.pos\n )\n return !1;\n let o = r.resolve(e);\n if (!n.parent.isTextblock) {\n let a = o.nodeAfter;\n return a != null && t == e + a.nodeSize;\n }\n if (o.parentOffset < o.parent.content.size || !o.parent.isTextblock)\n return !1;\n let i = r.resolve(ll(o, !0, !0));\n return !i.parent.isTextblock || i.pos > t || ll(i, !0, !1) < t ? !1 : n.parent.content.cut(n.parentOffset).eq(i.parent.content);\n}\nfunction ll(r, e, t) {\n let n = r.depth, s = e ? r.end() : r.pos;\n for (; n > 0 && (e || r.indexAfter(n) == r.node(n).childCount); )\n n--, s++, e = !1;\n if (t) {\n let o = r.node(n).maybeChild(r.indexAfter(n));\n for (; o && !o.isLeaf; )\n o = o.firstChild, s++;\n }\n return s;\n}\nfunction ry(r, e, t, n, s) {\n let o = r.findDiffStart(e, t);\n if (o == null)\n return null;\n let { a: i, b: a } = r.findDiffEnd(e, t + r.size, t + e.size);\n if (s == \"end\") {\n let l = Math.max(0, o - Math.min(i, a));\n n -= i + l - o;\n }\n if (i < o && r.size < e.size) {\n let l = n <= o && n >= i ? o - n : 0;\n o -= l, o && o < e.size && $u(e.textBetween(o - 1, o + 1)) && (o += l ? 1 : -1), a = o + (a - i), i = o;\n } else if (a < o) {\n let l = n <= o && n >= a ? o - n : 0;\n o -= l, o && o < r.size && $u(r.textBetween(o - 1, o + 1)) && (o += l ? 1 : -1), i = o + (i - a), a = o;\n }\n return { start: o, endA: i, endB: a };\n}\nfunction $u(r) {\n if (r.length != 2)\n return !1;\n let e = r.charCodeAt(0), t = r.charCodeAt(1);\n return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;\n}\nclass mh {\n /**\n Create a view. `place` may be a DOM node that the editor should\n be appended to, a function that will place it into the document,\n or an object whose `mount` property holds the node to use as the\n document container. If it is `null`, the editor will not be\n added to the document.\n */\n constructor(e, t) {\n this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new b1(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Lu), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement(\"div\"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == \"function\" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Ru(this), zu(this), this.nodeViews = ju(this), this.docView = hu(this.state.doc, Iu(this), al(this), this.dom, this), this.domObserver = new W1(this, (n, s, o, i) => Z1(this, n, s, o, i)), this.domObserver.start(), y1(this), this.updatePluginViews();\n }\n /**\n Holds `true` when a\n [composition](https://w3c.github.io/uievents/#events-compositionevents)\n is active.\n */\n get composing() {\n return this.input.composing;\n }\n /**\n The view's current [props](https://prosemirror.net/docs/ref/#view.EditorProps).\n */\n get props() {\n if (this._props.state != this.state) {\n let e = this._props;\n this._props = {};\n for (let t in e)\n this._props[t] = e[t];\n this._props.state = this.state;\n }\n return this._props;\n }\n /**\n Update the view's props. Will immediately cause an update to\n the DOM.\n */\n update(e) {\n e.handleDOMEvents != this._props.handleDOMEvents && ql(this);\n let t = this._props;\n this._props = e, e.plugins && (e.plugins.forEach(Lu), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);\n }\n /**\n Update the view by updating existing props object with the object\n given as argument. Equivalent to `view.update(Object.assign({},\n view.props, props))`.\n */\n setProps(e) {\n let t = {};\n for (let n in this._props)\n t[n] = this._props[n];\n t.state = this.state;\n for (let n in e)\n t[n] = e[n];\n this.update(t);\n }\n /**\n Update the editor's `state` prop, without touching any of the\n other props.\n */\n updateState(e) {\n this.updateStateInner(e, this._props);\n }\n updateStateInner(e, t) {\n var n;\n let s = this.state, o = !1, i = !1;\n e.storedMarks && this.composing && (lh(this), i = !0), this.state = e;\n let a = s.plugins != e.plugins || this._props.plugins != t.plugins;\n if (a || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {\n let p = ju(this);\n sy(p, this.nodeViews) && (this.nodeViews = p, o = !0);\n }\n (a || t.handleDOMEvents != this._props.handleDOMEvents) && ql(this), this.editable = Ru(this), zu(this);\n let l = al(this), d = Iu(this), u = s.plugins != e.plugins && !s.doc.eq(e.doc) ? \"reset\" : e.scrollToSelection > s.scrollToSelection ? \"to selection\" : \"preserve\", f = o || !this.docView.matchesNode(e.doc, d, l);\n (f || !e.selection.eq(s.selection)) && (i = !0);\n let h = u == \"preserve\" && i && this.dom.style.overflowAnchor == null && $0(this);\n if (i) {\n this.domObserver.stop();\n let p = f && (Gr || jr) && !this.composing && !s.selection.empty && !e.selection.empty && ny(s.selection, e.selection);\n if (f) {\n let g = jr ? this.trackWrites = this.domSelectionRange().focusNode : null;\n this.composing && (this.input.compositionNode = $1(this)), (o || !this.docView.update(e.doc, d, l, this)) && (this.docView.updateOuterDeco(d), this.docView.destroy(), this.docView = hu(e.doc, d, l, this.dom, this)), g && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (p = !0);\n }\n p || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && n1(this)) ? Fn(this, p) : (Yp(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();\n }\n this.updatePluginViews(s), !((n = this.dragging) === null || n === void 0) && n.node && !s.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, s), u == \"reset\" ? this.dom.scrollTop = 0 : u == \"to selection\" ? this.scrollToSelection() : h && I0(h);\n }\n /**\n @internal\n */\n scrollToSelection() {\n let e = this.domSelectionRange().focusNode;\n if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {\n if (!this.someProp(\"handleScrollToSelection\", (t) => t(this))) if (this.state.selection instanceof ot) {\n let t = this.docView.domAfterPos(this.state.selection.from);\n t.nodeType == 1 && lu(this, t.getBoundingClientRect(), e);\n } else\n lu(this, this.coordsAtPos(this.state.selection.head, 1), e);\n }\n }\n destroyPluginViews() {\n let e;\n for (; e = this.pluginViews.pop(); )\n e.destroy && e.destroy();\n }\n updatePluginViews(e) {\n if (!e || e.plugins != this.state.plugins || this.directPlugins != this.prevDirectPlugins) {\n this.prevDirectPlugins = this.directPlugins, this.destroyPluginViews();\n for (let t = 0; t < this.directPlugins.length; t++) {\n let n = this.directPlugins[t];\n n.spec.view && this.pluginViews.push(n.spec.view(this));\n }\n for (let t = 0; t < this.state.plugins.length; t++) {\n let n = this.state.plugins[t];\n n.spec.view && this.pluginViews.push(n.spec.view(this));\n }\n } else\n for (let t = 0; t < this.pluginViews.length; t++) {\n let n = this.pluginViews[t];\n n.update && n.update(this, e);\n }\n }\n updateDraggedNode(e, t) {\n let n = e.node, s = -1;\n if (n.from < this.state.doc.content.size && this.state.doc.nodeAt(n.from) == n.node)\n s = n.from;\n else {\n let o = n.from + (this.state.doc.content.size - t.doc.content.size);\n (o > 0 && o < this.state.doc.content.size && this.state.doc.nodeAt(o)) == n.node && (s = o);\n }\n this.dragging = new dh(e.slice, e.move, s < 0 ? void 0 : ot.create(this.state.doc, s));\n }\n someProp(e, t) {\n let n = this._props && this._props[e], s;\n if (n != null && (s = t ? t(n) : n))\n return s;\n for (let i = 0; i < this.directPlugins.length; i++) {\n let a = this.directPlugins[i].props[e];\n if (a != null && (s = t ? t(a) : a))\n return s;\n }\n let o = this.state.plugins;\n if (o)\n for (let i = 0; i < o.length; i++) {\n let a = o[i].props[e];\n if (a != null && (s = t ? t(a) : a))\n return s;\n }\n }\n /**\n Query whether the view has focus.\n */\n hasFocus() {\n if (Gr) {\n let e = this.root.activeElement;\n if (e == this.dom)\n return !0;\n if (!e || !this.dom.contains(e))\n return !1;\n for (; e && this.dom != e && this.dom.contains(e); ) {\n if (e.contentEditable == \"false\")\n return !1;\n e = e.parentElement;\n }\n return !0;\n }\n return this.root.activeElement == this.dom;\n }\n /**\n Focus the editor.\n */\n focus() {\n this.domObserver.stop(), this.editable && z0(this.dom), Fn(this), this.domObserver.start();\n }\n /**\n Get the document root in which the editor exists. This will\n usually be the top-level `document`, but might be a [shadow\n DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)\n root if the editor is inside one.\n */\n get root() {\n let e = this._root;\n if (e == null) {\n for (let t = this.dom.parentNode; t; t = t.parentNode)\n if (t.nodeType == 9 || t.nodeType == 11 && t.host)\n return t.getSelection || (Object.getPrototypeOf(t).getSelection = () => t.ownerDocument.getSelection()), this._root = t;\n }\n return e || document;\n }\n /**\n When an existing editor view is moved to a new document or\n shadow tree, call this to make it recompute its root.\n */\n updateRoot() {\n this._root = null;\n }\n /**\n Given a pair of viewport coordinates, return the document\n position that corresponds to them. May return null if the given\n coordinates aren't inside of the editor. When an object is\n returned, its `pos` property is the position nearest to the\n coordinates, and its `inside` property holds the position of the\n inner node that the position falls inside of, or -1 if it is at\n the top level, not in any node.\n */\n posAtCoords(e) {\n return F0(this, e);\n }\n /**\n Returns the viewport rectangle at a given document position.\n `left` and `right` will be the same number, as this returns a\n flat cursor-ish rectangle. If the position is between two things\n that aren't directly adjacent, `side` determines which element\n is used. When < 0, the element before the position is used,\n otherwise the element after.\n */\n coordsAtPos(e, t = 1) {\n return Hp(this, e, t);\n }\n /**\n Find the DOM position that corresponds to the given document\n position. When `side` is negative, find the position as close as\n possible to the content before the position. When positive,\n prefer positions close to the content after the position. When\n zero, prefer as shallow a position as possible.\n \n Note that you should **not** mutate the editor's internal DOM,\n only inspect it (and even that is usually not necessary).\n */\n domAtPos(e, t = 0) {\n return this.docView.domFromPos(e, t);\n }\n /**\n Find the DOM node that represents the document node after the\n given position. May return `null` when the position doesn't point\n in front of a node or if the node is inside an opaque node view.\n \n This is intended to be able to call things like\n `getBoundingClientRect` on that DOM node. Do **not** mutate the\n editor DOM directly, or add styling this way, since that will be\n immediately overriden by the editor as it redraws the node.\n */\n nodeDOM(e) {\n let t = this.docView.descAt(e);\n return t ? t.nodeDOM : null;\n }\n /**\n Find the document position that corresponds to a given DOM\n position. (Whenever possible, it is preferable to inspect the\n document structure directly, rather than poking around in the\n DOM, but sometimes\u2014for example when interpreting an event\n target\u2014you don't have a choice.)\n \n The `bias` parameter can be used to influence which side of a DOM\n node to use when the position is inside a leaf node.\n */\n posAtDOM(e, t, n = -1) {\n let s = this.docView.posFromDOM(e, t, n);\n if (s == null)\n throw new RangeError(\"DOM position not inside the editor\");\n return s;\n }\n /**\n Find out whether the selection is at the end of a textblock when\n moving in a given direction. When, for example, given `\"left\"`,\n it will return true if moving left from the current cursor\n position would leave that position's parent textblock. Will apply\n to the view's current state by default, but it is possible to\n pass a different state.\n */\n endOfTextblock(e, t) {\n return W0(this, t || this.state, e);\n }\n /**\n Run the editor's paste logic with the given HTML string. The\n `event`, if given, will be passed to the\n [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.\n */\n pasteHTML(e, t) {\n return Fo(this, \"\", e, !1, t || new ClipboardEvent(\"paste\"));\n }\n /**\n Run the editor's paste logic with the given plain-text input.\n */\n pasteText(e, t) {\n return Fo(this, e, null, !0, t || new ClipboardEvent(\"paste\"));\n }\n /**\n Serialize the given slice as it would be if it was copied from\n this editor. Returns a DOM element that contains a\n representation of the slice as its children, a textual\n representation, and the transformed slice (which can be\n different from the given input due to hooks like\n [`transformCopied`](https://prosemirror.net/docs/ref/#view.EditorProps.transformCopied)).\n */\n serializeForClipboard(e) {\n return Hc(this, e);\n }\n /**\n Removes the editor from the DOM and destroys all [node\n views](https://prosemirror.net/docs/ref/#view.NodeView).\n */\n destroy() {\n this.docView && (x1(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], al(this), this), this.dom.textContent = \"\") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, C0());\n }\n /**\n This is true when the view has been\n [destroyed](https://prosemirror.net/docs/ref/#view.EditorView.destroy) (and thus should not be\n used anymore).\n */\n get isDestroyed() {\n return this.docView == null;\n }\n /**\n Used for testing.\n */\n dispatchEvent(e) {\n return k1(this, e);\n }\n /**\n @internal\n */\n domSelectionRange() {\n let e = this.domSelection();\n return e ? Br && this.root.nodeType === 11 && M0(this.dom.ownerDocument) == this.dom && J1(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };\n }\n /**\n @internal\n */\n domSelection() {\n return this.root.getSelection();\n }\n}\nmh.prototype.dispatch = function(r) {\n let e = this._props.dispatchTransaction;\n e ? e.call(this, r) : this.updateState(this.state.apply(r));\n};\nfunction Iu(r) {\n let e = /* @__PURE__ */ Object.create(null);\n return e.class = \"ProseMirror\", e.contenteditable = String(r.editable), r.someProp(\"attributes\", (t) => {\n if (typeof t == \"function\" && (t = t(r.state)), t)\n for (let n in t)\n n == \"class\" ? e.class += \" \" + t[n] : n == \"style\" ? e.style = (e.style ? e.style + \";\" : \"\") + t[n] : !e[n] && n != \"contenteditable\" && n != \"nodeName\" && (e[n] = String(t[n]));\n }), e.translate || (e.translate = \"no\"), [qr.node(0, r.state.doc.content.size, e)];\n}\nfunction zu(r) {\n if (r.markCursor) {\n let e = document.createElement(\"img\");\n e.className = \"ProseMirror-separator\", e.setAttribute(\"mark-placeholder\", \"true\"), e.setAttribute(\"alt\", \"\"), r.cursorWrapper = { dom: e, deco: qr.widget(r.state.selection.from, e, { raw: !0, marks: r.markCursor }) };\n } else\n r.cursorWrapper = null;\n}\nfunction Ru(r) {\n return !r.someProp(\"editable\", (e) => e(r.state) === !1);\n}\nfunction ny(r, e) {\n let t = Math.min(r.$anchor.sharedDepth(r.head), e.$anchor.sharedDepth(e.head));\n return r.$anchor.start(t) != e.$anchor.start(t);\n}\nfunction ju(r) {\n let e = /* @__PURE__ */ Object.create(null);\n function t(n) {\n for (let s in n)\n Object.prototype.hasOwnProperty.call(e, s) || (e[s] = n[s]);\n }\n return r.someProp(\"nodeViews\", t), r.someProp(\"markViews\", t), e;\n}\nfunction sy(r, e) {\n let t = 0, n = 0;\n for (let s in r) {\n if (r[s] != e[s])\n return !0;\n t++;\n }\n for (let s in e)\n n++;\n return t != n;\n}\nfunction Lu(r) {\n if (r.spec.state || r.spec.filterTransaction || r.spec.appendTransaction)\n throw new RangeError(\"Plugins passed directly to the view must not have a state component\");\n}\nvar as = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 10: \"Enter\",\n 12: \"NumLock\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 44: \"PrintScreen\",\n 45: \"Insert\",\n 46: \"Delete\",\n 59: \";\",\n 61: \"=\",\n 91: \"Meta\",\n 92: \"Meta\",\n 106: \"*\",\n 107: \"+\",\n 108: \",\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 160: \"Shift\",\n 161: \"Shift\",\n 162: \"Control\",\n 163: \"Control\",\n 164: \"Alt\",\n 165: \"Alt\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\"\n}, Hi = {\n 48: \")\",\n 49: \"!\",\n 50: \"@\",\n 51: \"#\",\n 52: \"$\",\n 53: \"%\",\n 54: \"^\",\n 55: \"&\",\n 56: \"*\",\n 57: \"(\",\n 59: \":\",\n 61: \"+\",\n 173: \"_\",\n 186: \":\",\n 187: \"+\",\n 188: \"<\",\n 189: \"_\",\n 190: \">\",\n 191: \"?\",\n 192: \"~\",\n 219: \"{\",\n 220: \"|\",\n 221: \"}\",\n 222: '\"'\n}, oy = typeof navigator < \"u\" && /Mac/.test(navigator.platform), iy = typeof navigator < \"u\" && /MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);\nfor (var Rr = 0; Rr < 10; Rr++) as[48 + Rr] = as[96 + Rr] = String(Rr);\nfor (var Rr = 1; Rr <= 24; Rr++) as[Rr + 111] = \"F\" + Rr;\nfor (var Rr = 65; Rr <= 90; Rr++)\n as[Rr] = String.fromCharCode(Rr + 32), Hi[Rr] = String.fromCharCode(Rr);\nfor (var cl in as) Hi.hasOwnProperty(cl) || (Hi[cl] = as[cl]);\nfunction ay(r) {\n var e = oy && r.metaKey && r.shiftKey && !r.ctrlKey && !r.altKey || iy && r.shiftKey && r.key && r.key.length == 1 || r.key == \"Unidentified\", t = !e && r.key || (r.shiftKey ? Hi : as)[r.keyCode] || r.key || \"Unidentified\";\n return t == \"Esc\" && (t = \"Escape\"), t == \"Del\" && (t = \"Delete\"), t == \"Left\" && (t = \"ArrowLeft\"), t == \"Up\" && (t = \"ArrowUp\"), t == \"Right\" && (t = \"ArrowRight\"), t == \"Down\" && (t = \"ArrowDown\"), t;\n}\nconst ly = typeof navigator < \"u\" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), cy = typeof navigator < \"u\" && /Win/.test(navigator.platform);\nfunction dy(r) {\n let e = r.split(/-(?!$)/), t = e[e.length - 1];\n t == \"Space\" && (t = \" \");\n let n, s, o, i;\n for (let a = 0; a < e.length - 1; a++) {\n let l = e[a];\n if (/^(cmd|meta|m)$/i.test(l))\n i = !0;\n else if (/^a(lt)?$/i.test(l))\n n = !0;\n else if (/^(c|ctrl|control)$/i.test(l))\n s = !0;\n else if (/^s(hift)?$/i.test(l))\n o = !0;\n else if (/^mod$/i.test(l))\n ly ? i = !0 : s = !0;\n else\n throw new Error(\"Unrecognized modifier name: \" + l);\n }\n return n && (t = \"Alt-\" + t), s && (t = \"Ctrl-\" + t), i && (t = \"Meta-\" + t), o && (t = \"Shift-\" + t), t;\n}\nfunction uy(r) {\n let e = /* @__PURE__ */ Object.create(null);\n for (let t in r)\n e[dy(t)] = r[t];\n return e;\n}\nfunction dl(r, e, t = !0) {\n return e.altKey && (r = \"Alt-\" + r), e.ctrlKey && (r = \"Ctrl-\" + r), e.metaKey && (r = \"Meta-\" + r), t && e.shiftKey && (r = \"Shift-\" + r), r;\n}\nfunction fy(r) {\n return new mr({ props: { handleKeyDown: vh(r) } });\n}\nfunction vh(r) {\n let e = uy(r);\n return function(t, n) {\n let s = ay(n), o, i = e[dl(s, n)];\n if (i && i(t.state, t.dispatch, t))\n return !0;\n if (s.length == 1 && s != \" \") {\n if (n.shiftKey) {\n let a = e[dl(s, n, !1)];\n if (a && a(t.state, t.dispatch, t))\n return !0;\n }\n if ((n.altKey || n.metaKey || n.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows\n !(cy && n.ctrlKey && n.altKey) && (o = as[n.keyCode]) && o != s) {\n let a = e[dl(o, n)];\n if (a && a(t.state, t.dispatch, t))\n return !0;\n }\n }\n return !1;\n };\n}\nvar py = Object.defineProperty, Kc = (r, e) => {\n for (var t in e)\n py(r, t, { get: e[t], enumerable: !0 });\n};\nfunction Na(r) {\n const { state: e, transaction: t } = r;\n let { selection: n } = t, { doc: s } = t, { storedMarks: o } = t;\n return {\n ...e,\n apply: e.apply.bind(e),\n applyTransaction: e.applyTransaction.bind(e),\n plugins: e.plugins,\n schema: e.schema,\n reconfigure: e.reconfigure.bind(e),\n toJSON: e.toJSON.bind(e),\n get storedMarks() {\n return o;\n },\n get selection() {\n return n;\n },\n get doc() {\n return s;\n },\n get tr() {\n return n = t.selection, s = t.doc, o = t.storedMarks, t;\n }\n };\n}\nvar Oa = class {\n constructor(r) {\n this.editor = r.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = r.state;\n }\n get hasCustomState() {\n return !!this.customState;\n }\n get state() {\n return this.customState || this.editor.state;\n }\n get commands() {\n const { rawCommands: r, editor: e, state: t } = this, { view: n } = e, { tr: s } = t, o = this.buildProps(s);\n return Object.fromEntries(\n Object.entries(r).map(([i, a]) => [i, (...d) => {\n const u = a(...d)(o);\n return !s.getMeta(\"preventDispatch\") && !this.hasCustomState && n.dispatch(s), u;\n }])\n );\n }\n get chain() {\n return () => this.createChain();\n }\n get can() {\n return () => this.createCan();\n }\n createChain(r, e = !0) {\n const { rawCommands: t, editor: n, state: s } = this, { view: o } = n, i = [], a = !!r, l = r || s.tr, d = () => (!a && e && !l.getMeta(\"preventDispatch\") && !this.hasCustomState && o.dispatch(l), i.every((f) => f === !0)), u = {\n ...Object.fromEntries(\n Object.entries(t).map(([f, h]) => [f, (...g) => {\n const b = this.buildProps(l, e), y = h(...g)(b);\n return i.push(y), u;\n }])\n ),\n run: d\n };\n return u;\n }\n createCan(r) {\n const { rawCommands: e, state: t } = this, n = !1, s = r || t.tr, o = this.buildProps(s, n);\n return {\n ...Object.fromEntries(\n Object.entries(e).map(([a, l]) => [a, (...d) => l(...d)({ ...o, dispatch: void 0 })])\n ),\n chain: () => this.createChain(s, n)\n };\n }\n buildProps(r, e = !0) {\n const { rawCommands: t, editor: n, state: s } = this, { view: o } = n, i = {\n tr: r,\n editor: n,\n view: o,\n state: Na({\n state: s,\n transaction: r\n }),\n dispatch: e ? () => {\n } : void 0,\n chain: () => this.createChain(r, e),\n can: () => this.createCan(r),\n get commands() {\n return Object.fromEntries(\n Object.entries(t).map(([a, l]) => [a, (...d) => l(...d)(i)])\n );\n }\n };\n return i;\n }\n}, gh = {};\nKc(gh, {\n blur: () => hy,\n clearContent: () => my,\n clearNodes: () => vy,\n command: () => gy,\n createParagraphNear: () => by,\n cut: () => yy,\n deleteCurrentNode: () => xy,\n deleteNode: () => wy,\n deleteRange: () => ky,\n deleteSelection: () => Cy,\n enter: () => _y,\n exitCode: () => Sy,\n extendMarkRange: () => Ey,\n first: () => Ty,\n focus: () => Ay,\n forEach: () => Py,\n insertContent: () => Ny,\n insertContentAt: () => Iy,\n joinBackward: () => jy,\n joinDown: () => Ry,\n joinForward: () => Ly,\n joinItemBackward: () => Dy,\n joinItemForward: () => Fy,\n joinTextblockBackward: () => By,\n joinTextblockForward: () => Hy,\n joinUp: () => zy,\n keyboardShortcut: () => Vy,\n lift: () => Wy,\n liftEmptyBlock: () => Uy,\n liftListItem: () => Jy,\n newlineInCode: () => Ky,\n resetAttributes: () => Gy,\n scrollIntoView: () => Yy,\n selectAll: () => Xy,\n selectNodeBackward: () => Qy,\n selectNodeForward: () => Zy,\n selectParentNode: () => ex,\n selectTextblockEnd: () => tx,\n selectTextblockStart: () => rx,\n setContent: () => nx,\n setMark: () => Sx,\n setMeta: () => Ex,\n setNode: () => Tx,\n setNodeSelection: () => Mx,\n setTextDirection: () => Ax,\n setTextSelection: () => Px,\n sinkListItem: () => Nx,\n splitBlock: () => Ox,\n splitListItem: () => $x,\n toggleList: () => zx,\n toggleMark: () => Rx,\n toggleNode: () => jx,\n toggleWrap: () => Lx,\n undoInputRule: () => Dx,\n unsetAllMarks: () => Fx,\n unsetMark: () => Bx,\n unsetTextDirection: () => Hx,\n updateAttributes: () => qx,\n wrapIn: () => Vx,\n wrapInList: () => Wx\n});\nvar hy = () => ({ editor: r, view: e }) => (requestAnimationFrame(() => {\n var t;\n r.isDestroyed || (e.dom.blur(), (t = window?.getSelection()) == null || t.removeAllRanges());\n}), !0), my = (r = !0) => ({ commands: e }) => e.setContent(\"\", { emitUpdate: r }), vy = () => ({ state: r, tr: e, dispatch: t }) => {\n const { selection: n } = e, { ranges: s } = n;\n return t && s.forEach(({ $from: o, $to: i }) => {\n r.doc.nodesBetween(o.pos, i.pos, (a, l) => {\n if (a.type.isText)\n return;\n const { doc: d, mapping: u } = e, f = d.resolve(u.map(l)), h = d.resolve(u.map(l + a.nodeSize)), p = f.blockRange(h);\n if (!p)\n return;\n const g = so(p);\n if (a.type.isTextblock) {\n const { defaultType: b } = f.parent.contentMatchAt(f.index());\n e.setNodeMarkup(p.start, b);\n }\n (g || g === 0) && e.lift(p, g);\n });\n }), !0;\n}, gy = (r) => (e) => r(e), by = () => ({ state: r, dispatch: e }) => Np(r, e), yy = (r, e) => ({ editor: t, tr: n }) => {\n const { state: s } = t, o = s.doc.slice(r.from, r.to);\n n.deleteRange(r.from, r.to);\n const i = n.mapping.map(e);\n return n.insert(i, o.content), n.setSelection(new ht(n.doc.resolve(Math.max(i - 1, 0)))), !0;\n}, xy = () => ({ tr: r, dispatch: e }) => {\n const { selection: t } = r, n = t.$anchor.node();\n if (n.content.size > 0)\n return !1;\n const s = r.selection.$anchor;\n for (let o = s.depth; o > 0; o -= 1)\n if (s.node(o).type === n.type) {\n if (e) {\n const a = s.before(o), l = s.after(o);\n r.delete(a, l).scrollIntoView();\n }\n return !0;\n }\n return !1;\n};\nfunction _r(r, e) {\n if (typeof r == \"string\") {\n if (!e.nodes[r])\n throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);\n return e.nodes[r];\n }\n return r;\n}\nvar wy = (r) => ({ tr: e, state: t, dispatch: n }) => {\n const s = _r(r, t.schema), o = e.selection.$anchor;\n for (let i = o.depth; i > 0; i -= 1)\n if (o.node(i).type === s) {\n if (n) {\n const l = o.before(i), d = o.after(i);\n e.delete(l, d).scrollIntoView();\n }\n return !0;\n }\n return !1;\n}, ky = (r) => ({ tr: e, dispatch: t }) => {\n const { from: n, to: s } = r;\n return t && e.delete(n, s), !0;\n}, Cy = () => ({ state: r, dispatch: e }) => Ic(r, e), _y = () => ({ commands: r }) => r.keyboardShortcut(\"Enter\"), Sy = () => ({ state: r, dispatch: e }) => l0(r, e);\nfunction Gc(r) {\n return Object.prototype.toString.call(r) === \"[object RegExp]\";\n}\nfunction qi(r, e, t = { strict: !0 }) {\n const n = Object.keys(e);\n return n.length ? n.every((s) => t.strict ? e[s] === r[s] : Gc(e[s]) ? e[s].test(r[s]) : e[s] === r[s]) : !0;\n}\nfunction bh(r, e, t = {}) {\n return r.find((n) => n.type === e && qi(\n // Only check equality for the attributes that are provided\n Object.fromEntries(Object.keys(t).map((s) => [s, n.attrs[s]])),\n t\n ));\n}\nfunction Du(r, e, t = {}) {\n return !!bh(r, e, t);\n}\nfunction Yc(r, e, t) {\n if (!r || !e)\n return;\n let n = r.parent.childAfter(r.parentOffset);\n if ((!n.node || !n.node.marks.some((d) => d.type === e)) && (n = r.parent.childBefore(r.parentOffset)), !n.node || !n.node.marks.some((d) => d.type === e))\n return;\n if (!t) {\n const d = n.node.marks.find((u) => u.type === e);\n d && (t = d.attrs);\n }\n if (!bh([...n.node.marks], e, t))\n return;\n let o = n.index, i = r.start() + n.offset, a = o + 1, l = i + n.node.nodeSize;\n for (; o > 0 && Du([...r.parent.child(o - 1).marks], e, t); )\n o -= 1, i -= r.parent.child(o).nodeSize;\n for (; a < r.parent.childCount && Du([...r.parent.child(a).marks], e, t); )\n l += r.parent.child(a).nodeSize, a += 1;\n return {\n from: i,\n to: l\n };\n}\nfunction Bn(r, e) {\n if (typeof r == \"string\") {\n if (!e.marks[r])\n throw Error(`There is no mark type named '${r}'. Maybe you forgot to add the extension?`);\n return e.marks[r];\n }\n return r;\n}\nvar Ey = (r, e) => ({ tr: t, state: n, dispatch: s }) => {\n const o = Bn(r, n.schema), { doc: i, selection: a } = t, { $from: l, from: d, to: u } = a;\n if (s) {\n const f = Yc(l, o, e);\n if (f && f.from <= d && f.to >= u) {\n const h = ht.create(i, f.from, f.to);\n t.setSelection(h);\n }\n }\n return !0;\n}, Ty = (r) => (e) => {\n const t = typeof r == \"function\" ? r(e) : r;\n for (let n = 0; n < t.length; n += 1)\n if (t[n](e))\n return !0;\n return !1;\n};\nfunction yh(r) {\n return r instanceof ht;\n}\nfunction ks(r = 0, e = 0, t = 0) {\n return Math.min(Math.max(r, e), t);\n}\nfunction xh(r, e = null) {\n if (!e)\n return null;\n const t = St.atStart(r), n = St.atEnd(r);\n if (e === \"start\" || e === !0)\n return t;\n if (e === \"end\")\n return n;\n const s = t.from, o = n.to;\n return e === \"all\" ? ht.create(r, ks(0, s, o), ks(r.content.size, s, o)) : ht.create(r, ks(e, s, o), ks(e, s, o));\n}\nfunction Fu() {\n return navigator.platform === \"Android\" || /android/i.test(navigator.userAgent);\n}\nfunction Vi() {\n return [\"iPad Simulator\", \"iPhone Simulator\", \"iPod Simulator\", \"iPad\", \"iPhone\", \"iPod\"].includes(navigator.platform) || // iPad on iOS 13 detection\n navigator.userAgent.includes(\"Mac\") && \"ontouchend\" in document;\n}\nfunction My() {\n return typeof navigator < \"u\" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;\n}\nvar Ay = (r = null, e = {}) => ({ editor: t, view: n, tr: s, dispatch: o }) => {\n e = {\n scrollIntoView: !0,\n ...e\n };\n const i = () => {\n (Vi() || Fu()) && n.dom.focus(), My() && !Vi() && !Fu() && n.dom.focus({ preventScroll: !0 }), requestAnimationFrame(() => {\n t.isDestroyed || (n.focus(), e?.scrollIntoView && t.commands.scrollIntoView());\n });\n };\n try {\n if (n.hasFocus() && r === null || r === !1)\n return !0;\n } catch {\n return !1;\n }\n if (o && r === null && !yh(t.state.selection))\n return i(), !0;\n const a = xh(s.doc, r) || t.state.selection, l = t.state.selection.eq(a);\n return o && (l || s.setSelection(a), l && s.storedMarks && s.setStoredMarks(s.storedMarks), i()), !0;\n}, Py = (r, e) => (t) => r.every((n, s) => e(n, { ...t, index: s })), Ny = (r, e) => ({ tr: t, commands: n }) => n.insertContentAt({ from: t.selection.from, to: t.selection.to }, r, e), wh = (r) => {\n const e = r.childNodes;\n for (let t = e.length - 1; t >= 0; t -= 1) {\n const n = e[t];\n n.nodeType === 3 && n.nodeValue && /^(\\n\\s\\s|\\n)$/.test(n.nodeValue) ? r.removeChild(n) : n.nodeType === 1 && wh(n);\n }\n return r;\n};\nfunction ui(r) {\n if (typeof window > \"u\")\n throw new Error(\"[tiptap error]: there is no window object available, so this function cannot be used\");\n const e = `<body>${r}</body>`, t = new window.DOMParser().parseFromString(e, \"text/html\").body;\n return wh(t);\n}\nfunction Ho(r, e, t) {\n if (r instanceof gn || r instanceof ye)\n return r;\n t = {\n slice: !0,\n parseOptions: {},\n ...t\n };\n const n = typeof r == \"object\" && r !== null, s = typeof r == \"string\";\n if (n)\n try {\n if (Array.isArray(r) && r.length > 0)\n return ye.fromArray(r.map((a) => e.nodeFromJSON(a)));\n const i = e.nodeFromJSON(r);\n return t.errorOnInvalidContent && i.check(), i;\n } catch (o) {\n if (t.errorOnInvalidContent)\n throw new Error(\"[tiptap error]: Invalid JSON content\", { cause: o });\n return console.warn(\"[tiptap warn]: Invalid content.\", \"Passed value:\", r, \"Error:\", o), Ho(\"\", e, t);\n }\n if (s) {\n if (t.errorOnInvalidContent) {\n let i = !1, a = \"\";\n const l = new sp({\n topNode: e.spec.topNode,\n marks: e.spec.marks,\n // Prosemirror's schemas are executed such that: the last to execute, matches last\n // This means that we can add a catch-all node at the end of the schema to catch any content that we don't know how to handle\n nodes: e.spec.nodes.append({\n __tiptap__private__unknown__catch__all__node: {\n content: \"inline*\",\n group: \"block\",\n parseDOM: [\n {\n tag: \"*\",\n getAttrs: (d) => (i = !0, a = typeof d == \"string\" ? d : d.outerHTML, null)\n }\n ]\n }\n })\n });\n if (t.slice ? wo.fromSchema(l).parseSlice(ui(r), t.parseOptions) : wo.fromSchema(l).parse(ui(r), t.parseOptions), t.errorOnInvalidContent && i)\n throw new Error(\"[tiptap error]: Invalid HTML content\", {\n cause: new Error(`Invalid element found: ${a}`)\n });\n }\n const o = wo.fromSchema(e);\n return t.slice ? o.parseSlice(ui(r), t.parseOptions).content : o.parse(ui(r), t.parseOptions);\n }\n return Ho(\"\", e, t);\n}\nfunction Oy(r, e, t) {\n const n = r.steps.length - 1;\n if (n < e)\n return;\n const s = r.steps[n];\n if (!(s instanceof wr || s instanceof Pr))\n return;\n const o = r.mapping.maps[n];\n let i = 0;\n o.forEach((a, l, d, u) => {\n i === 0 && (i = u);\n }), r.setSelection(St.near(r.doc.resolve(i), t));\n}\nvar $y = (r) => !(\"type\" in r), Iy = (r, e, t) => ({ tr: n, dispatch: s, editor: o }) => {\n var i;\n if (s) {\n t = {\n parseOptions: o.options.parseOptions,\n updateSelection: !0,\n applyInputRules: !1,\n applyPasteRules: !1,\n ...t\n };\n let a;\n const l = (y) => {\n o.emit(\"contentError\", {\n editor: o,\n error: y,\n disableCollaboration: () => {\n \"collaboration\" in o.storage && typeof o.storage.collaboration == \"object\" && o.storage.collaboration && (o.storage.collaboration.isDisabled = !0);\n }\n });\n }, d = {\n preserveWhitespace: \"full\",\n ...t.parseOptions\n };\n if (!t.errorOnInvalidContent && !o.options.enableContentCheck && o.options.emitContentError)\n try {\n Ho(e, o.schema, {\n parseOptions: d,\n errorOnInvalidContent: !0\n });\n } catch (y) {\n l(y);\n }\n try {\n a = Ho(e, o.schema, {\n parseOptions: d,\n errorOnInvalidContent: (i = t.errorOnInvalidContent) != null ? i : o.options.enableContentCheck\n });\n } catch (y) {\n return l(y), !1;\n }\n let { from: u, to: f } = typeof r == \"number\" ? { from: r, to: r } : { from: r.from, to: r.to }, h = !0, p = !0;\n if (($y(a) ? a : [a]).forEach((y) => {\n y.check(), h = h ? y.isText && y.marks.length === 0 : !1, p = p ? y.isBlock : !1;\n }), u === f && p) {\n const { parent: y } = n.doc.resolve(u);\n y.isTextblock && !y.type.spec.code && !y.childCount && (u -= 1, f += 1);\n }\n let b;\n if (h) {\n if (Array.isArray(e))\n b = e.map((y) => y.text || \"\").join(\"\");\n else if (e instanceof ye) {\n let y = \"\";\n e.forEach((C) => {\n C.text && (y += C.text);\n }), b = y;\n } else typeof e == \"object\" && e && e.text ? b = e.text : b = e;\n n.insertText(b, u, f);\n } else {\n b = a;\n const y = n.doc.resolve(u), C = y.node(), E = y.parentOffset === 0, R = C.isText || C.isTextblock, q = C.content.size > 0;\n E && R && q && p && (u = Math.max(0, u - 1)), n.replaceWith(u, f, b);\n }\n t.updateSelection && Oy(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta(\"applyInputRules\", { from: u, text: b }), t.applyPasteRules && n.setMeta(\"applyPasteRules\", { from: u, text: b });\n }\n return !0;\n}, zy = () => ({ state: r, dispatch: e }) => o0(r, e), Ry = () => ({ state: r, dispatch: e }) => i0(r, e), jy = () => ({ state: r, dispatch: e }) => _p(r, e), Ly = () => ({ state: r, dispatch: e }) => Mp(r, e), Dy = () => ({ state: r, dispatch: e, tr: t }) => {\n try {\n const n = Sa(r.doc, r.selection.$from.pos, -1);\n return n == null ? !1 : (t.join(n, 2), e && e(t), !0);\n } catch {\n return !1;\n }\n}, Fy = () => ({ state: r, dispatch: e, tr: t }) => {\n try {\n const n = Sa(r.doc, r.selection.$from.pos, 1);\n return n == null ? !1 : (t.join(n, 2), e && e(t), !0);\n } catch {\n return !1;\n }\n}, By = () => ({ state: r, dispatch: e }) => n0(r, e), Hy = () => ({ state: r, dispatch: e }) => s0(r, e);\nfunction kh() {\n return typeof navigator < \"u\" ? /Mac/.test(navigator.platform) : !1;\n}\nfunction qy(r) {\n const e = r.split(/-(?!$)/);\n let t = e[e.length - 1];\n t === \"Space\" && (t = \" \");\n let n, s, o, i;\n for (let a = 0; a < e.length - 1; a += 1) {\n const l = e[a];\n if (/^(cmd|meta|m)$/i.test(l))\n i = !0;\n else if (/^a(lt)?$/i.test(l))\n n = !0;\n else if (/^(c|ctrl|control)$/i.test(l))\n s = !0;\n else if (/^s(hift)?$/i.test(l))\n o = !0;\n else if (/^mod$/i.test(l))\n Vi() || kh() ? i = !0 : s = !0;\n else\n throw new Error(`Unrecognized modifier name: ${l}`);\n }\n return n && (t = `Alt-${t}`), s && (t = `Ctrl-${t}`), i && (t = `Meta-${t}`), o && (t = `Shift-${t}`), t;\n}\nvar Vy = (r) => ({ editor: e, view: t, tr: n, dispatch: s }) => {\n const o = qy(r).split(/-(?!$)/), i = o.find((d) => ![\"Alt\", \"Ctrl\", \"Meta\", \"Shift\"].includes(d)), a = new KeyboardEvent(\"keydown\", {\n key: i === \"Space\" ? \" \" : i,\n altKey: o.includes(\"Alt\"),\n ctrlKey: o.includes(\"Ctrl\"),\n metaKey: o.includes(\"Meta\"),\n shiftKey: o.includes(\"Shift\"),\n bubbles: !0,\n cancelable: !0\n }), l = e.captureTransaction(() => {\n t.someProp(\"handleKeyDown\", (d) => d(t, a));\n });\n return l?.steps.forEach((d) => {\n const u = d.map(n.mapping);\n u && s && n.maybeStep(u);\n }), !0;\n};\nfunction ls(r, e, t = {}) {\n const { from: n, to: s, empty: o } = r.selection, i = e ? _r(e, r.schema) : null, a = [];\n r.doc.nodesBetween(n, s, (f, h) => {\n if (f.isText)\n return;\n const p = Math.max(n, h), g = Math.min(s, h + f.nodeSize);\n a.push({\n node: f,\n from: p,\n to: g\n });\n });\n const l = s - n, d = a.filter((f) => i ? i.name === f.node.type.name : !0).filter((f) => qi(f.node.attrs, t, { strict: !1 }));\n return o ? !!d.length : d.reduce((f, h) => f + h.to - h.from, 0) >= l;\n}\nvar Wy = (r, e = {}) => ({ state: t, dispatch: n }) => {\n const s = _r(r, t.schema);\n return ls(t, s, e) ? a0(t, n) : !1;\n}, Uy = () => ({ state: r, dispatch: e }) => Op(r, e), Jy = (r) => ({ state: e, dispatch: t }) => {\n const n = _r(r, e.schema);\n return y0(n)(e, t);\n}, Ky = () => ({ state: r, dispatch: e }) => Pp(r, e);\nfunction $a(r, e) {\n return e.nodes[r] ? \"node\" : e.marks[r] ? \"mark\" : null;\n}\nfunction Bu(r, e) {\n const t = typeof e == \"string\" ? [e] : e;\n return Object.keys(r).reduce((n, s) => (t.includes(s) || (n[s] = r[s]), n), {});\n}\nvar Gy = (r, e) => ({ tr: t, state: n, dispatch: s }) => {\n let o = null, i = null;\n const a = $a(\n typeof r == \"string\" ? r : r.name,\n n.schema\n );\n if (!a)\n return !1;\n a === \"node\" && (o = _r(r, n.schema)), a === \"mark\" && (i = Bn(r, n.schema));\n let l = !1;\n return t.selection.ranges.forEach((d) => {\n n.doc.nodesBetween(d.$from.pos, d.$to.pos, (u, f) => {\n o && o === u.type && (l = !0, s && t.setNodeMarkup(f, void 0, Bu(u.attrs, e))), i && u.marks.length && u.marks.forEach((h) => {\n i === h.type && (l = !0, s && t.addMark(f, f + u.nodeSize, i.create(Bu(h.attrs, e))));\n });\n });\n }), l;\n}, Yy = () => ({ tr: r, dispatch: e }) => (e && r.scrollIntoView(), !0), Xy = () => ({ tr: r, dispatch: e }) => {\n if (e) {\n const t = new Zr(r.doc);\n r.setSelection(t);\n }\n return !0;\n}, Qy = () => ({ state: r, dispatch: e }) => Ep(r, e), Zy = () => ({ state: r, dispatch: e }) => Ap(r, e), ex = () => ({ state: r, dispatch: e }) => u0(r, e), tx = () => ({ state: r, dispatch: e }) => h0(r, e), rx = () => ({ state: r, dispatch: e }) => p0(r, e);\nfunction Vl(r, e, t = {}, n = {}) {\n return Ho(r, e, {\n slice: !1,\n parseOptions: t,\n errorOnInvalidContent: n.errorOnInvalidContent\n });\n}\nvar nx = (r, { errorOnInvalidContent: e, emitUpdate: t = !0, parseOptions: n = {} } = {}) => ({ editor: s, tr: o, dispatch: i, commands: a }) => {\n const { doc: l } = o;\n if (n.preserveWhitespace !== \"full\") {\n const d = Vl(r, s.schema, n, {\n errorOnInvalidContent: e ?? s.options.enableContentCheck\n });\n return i && o.replaceWith(0, l.content.size, d).setMeta(\"preventUpdate\", !t), !0;\n }\n return i && o.setMeta(\"preventUpdate\", !t), a.insertContentAt({ from: 0, to: l.content.size }, r, {\n parseOptions: n,\n errorOnInvalidContent: e ?? s.options.enableContentCheck\n });\n};\nfunction Ch(r, e) {\n const t = Bn(e, r.schema), { from: n, to: s, empty: o } = r.selection, i = [];\n o ? (r.storedMarks && i.push(...r.storedMarks), i.push(...r.selection.$head.marks())) : r.doc.nodesBetween(n, s, (l) => {\n i.push(...l.marks);\n });\n const a = i.find((l) => l.type.name === t.name);\n return a ? { ...a.attrs } : {};\n}\nfunction _h(r, e) {\n const t = new xp(r);\n return e.forEach((n) => {\n n.steps.forEach((s) => {\n t.step(s);\n });\n }), t;\n}\nfunction sx(r) {\n for (let e = 0; e < r.edgeCount; e += 1) {\n const { type: t } = r.edge(e);\n if (t.isTextblock && !t.hasRequiredAttrs())\n return t;\n }\n return null;\n}\nfunction ox(r, e, t) {\n const n = [];\n return r.nodesBetween(e.from, e.to, (s, o) => {\n t(s) && n.push({\n node: s,\n pos: o\n });\n }), n;\n}\nfunction ix(r, e) {\n for (let t = r.depth; t > 0; t -= 1) {\n const n = r.node(t);\n if (e(n))\n return {\n pos: t > 0 ? r.before(t) : 0,\n start: r.start(t),\n depth: t,\n node: n\n };\n }\n}\nfunction Ia(r) {\n return (e) => ix(e.$from, r);\n}\nfunction Ke(r, e, t) {\n return r.config[e] === void 0 && r.parent ? Ke(r.parent, e, t) : typeof r.config[e] == \"function\" ? r.config[e].bind({\n ...t,\n parent: r.parent ? Ke(r.parent, e, t) : null\n }) : r.config[e];\n}\nfunction Xc(r) {\n return r.map((e) => {\n const t = {\n name: e.name,\n options: e.options,\n storage: e.storage\n }, n = Ke(e, \"addExtensions\", t);\n return n ? [e, ...Xc(n())] : e;\n }).flat(10);\n}\nfunction Qc(r, e) {\n const t = Is.fromSchema(e).serializeFragment(r), s = document.implementation.createHTMLDocument().createElement(\"div\");\n return s.appendChild(t), s.innerHTML;\n}\nfunction Sh(r) {\n return typeof r == \"function\";\n}\nfunction Wt(r, e = void 0, ...t) {\n return Sh(r) ? e ? r.bind(e)(...t) : r(...t) : r;\n}\nfunction ax(r = {}) {\n return Object.keys(r).length === 0 && r.constructor === Object;\n}\nfunction to(r) {\n const e = r.filter((s) => s.type === \"extension\"), t = r.filter((s) => s.type === \"node\"), n = r.filter((s) => s.type === \"mark\");\n return {\n baseExtensions: e,\n nodeExtensions: t,\n markExtensions: n\n };\n}\nfunction Eh(r) {\n const e = [], { nodeExtensions: t, markExtensions: n } = to(r), s = [...t, ...n], o = {\n default: null,\n validate: void 0,\n rendered: !0,\n renderHTML: null,\n parseHTML: null,\n keepOnSplit: !0,\n isRequired: !1\n }, i = t.filter((d) => d.name !== \"text\").map((d) => d.name), a = n.map((d) => d.name), l = [...i, ...a];\n return r.forEach((d) => {\n const u = {\n name: d.name,\n options: d.options,\n storage: d.storage,\n extensions: s\n }, f = Ke(\n d,\n \"addGlobalAttributes\",\n u\n );\n if (!f)\n return;\n f().forEach((p) => {\n let g;\n Array.isArray(p.types) ? g = p.types : p.types === \"*\" ? g = l : p.types === \"nodes\" ? g = i : p.types === \"marks\" ? g = a : g = [], g.forEach((b) => {\n Object.entries(p.attributes).forEach(([y, C]) => {\n e.push({\n type: b,\n name: y,\n attribute: {\n ...o,\n ...C\n }\n });\n });\n });\n });\n }), s.forEach((d) => {\n const u = {\n name: d.name,\n options: d.options,\n storage: d.storage\n }, f = Ke(\n d,\n \"addAttributes\",\n u\n );\n if (!f)\n return;\n const h = f();\n Object.entries(h).forEach(([p, g]) => {\n const b = {\n ...o,\n ...g\n };\n typeof b?.default == \"function\" && (b.default = b.default()), b?.isRequired && b?.default === void 0 && delete b.default, e.push({\n type: d.name,\n name: p,\n attribute: b\n });\n });\n }), e;\n}\nfunction lx(r) {\n const e = [];\n let t = \"\", n = !1, s = !1, o = 0;\n const i = r.length;\n for (let a = 0; a < i; a += 1) {\n const l = r[a];\n if (l === \"'\" && !s) {\n n = !n, t += l;\n continue;\n }\n if (l === '\"' && !n) {\n s = !s, t += l;\n continue;\n }\n if (!n && !s) {\n if (l === \"(\") {\n o += 1, t += l;\n continue;\n }\n if (l === \")\" && o > 0) {\n o -= 1, t += l;\n continue;\n }\n if (l === \";\" && o === 0) {\n e.push(t), t = \"\";\n continue;\n }\n }\n t += l;\n }\n return t && e.push(t), e;\n}\nfunction Hu(r) {\n const e = [], t = lx(r || \"\"), n = t.length;\n for (let s = 0; s < n; s += 1) {\n const o = t[s], i = o.indexOf(\":\");\n if (i === -1)\n continue;\n const a = o.slice(0, i).trim(), l = o.slice(i + 1).trim();\n a && l && e.push([a, l]);\n }\n return e;\n}\nfunction Ur(...r) {\n return r.filter((e) => !!e).reduce((e, t) => {\n const n = { ...e };\n return Object.entries(t).forEach(([s, o]) => {\n if (!n[s]) {\n n[s] = o;\n return;\n }\n if (s === \"class\") {\n const a = o ? String(o).split(\" \") : [], l = n[s] ? n[s].split(\" \") : [], d = a.filter((u) => !l.includes(u));\n n[s] = [...l, ...d].join(\" \");\n } else if (s === \"style\") {\n const a = new Map([...Hu(n[s]), ...Hu(o)]);\n n[s] = Array.from(a.entries()).map(([l, d]) => `${l}: ${d}`).join(\"; \");\n } else\n n[s] = o;\n }), n;\n }, {});\n}\nfunction qo(r, e) {\n return e.filter((t) => t.type === r.type.name).filter((t) => t.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(r.attrs) || {} : {\n [t.name]: r.attrs[t.name]\n }).reduce((t, n) => Ur(t, n), {});\n}\nfunction cx(r) {\n return typeof r != \"string\" ? r : r.match(/^[+-]?(?:\\d*\\.)?\\d+$/) ? Number(r) : r === \"true\" ? !0 : r === \"false\" ? !1 : r;\n}\nfunction qu(r, e) {\n return \"style\" in r ? r : {\n ...r,\n getAttrs: (t) => {\n const n = r.getAttrs ? r.getAttrs(t) : r.attrs;\n if (n === !1)\n return !1;\n const s = e.reduce((o, i) => {\n const a = i.attribute.parseHTML ? i.attribute.parseHTML(t) : cx(t.getAttribute(i.name));\n return a == null ? o : {\n ...o,\n [i.name]: a\n };\n }, {});\n return { ...n, ...s };\n }\n };\n}\nfunction Vu(r) {\n return Object.fromEntries(\n // @ts-ignore\n Object.entries(r).filter(([e, t]) => e === \"attrs\" && ax(t) ? !1 : t != null)\n );\n}\nfunction Wu(r) {\n var e, t;\n const n = {};\n return !((e = r?.attribute) != null && e.isRequired) && \"default\" in (r?.attribute || {}) && (n.default = r.attribute.default), ((t = r?.attribute) == null ? void 0 : t.validate) !== void 0 && (n.validate = r.attribute.validate), [r.name, n];\n}\nfunction dx(r, e) {\n var t;\n const n = Eh(r), { nodeExtensions: s, markExtensions: o } = to(r), i = (t = s.find((d) => Ke(d, \"topNode\"))) == null ? void 0 : t.name, a = Object.fromEntries(\n s.map((d) => {\n const u = n.filter((C) => C.type === d.name), f = {\n name: d.name,\n options: d.options,\n storage: d.storage,\n editor: e\n }, h = r.reduce((C, E) => {\n const R = Ke(E, \"extendNodeSchema\", f);\n return {\n ...C,\n ...R ? R(d) : {}\n };\n }, {}), p = Vu({\n ...h,\n content: Wt(Ke(d, \"content\", f)),\n marks: Wt(Ke(d, \"marks\", f)),\n group: Wt(Ke(d, \"group\", f)),\n inline: Wt(Ke(d, \"inline\", f)),\n atom: Wt(Ke(d, \"atom\", f)),\n selectable: Wt(Ke(d, \"selectable\", f)),\n draggable: Wt(Ke(d, \"draggable\", f)),\n code: Wt(Ke(d, \"code\", f)),\n whitespace: Wt(Ke(d, \"whitespace\", f)),\n linebreakReplacement: Wt(\n Ke(d, \"linebreakReplacement\", f)\n ),\n defining: Wt(Ke(d, \"defining\", f)),\n isolating: Wt(Ke(d, \"isolating\", f)),\n attrs: Object.fromEntries(u.map(Wu))\n }), g = Wt(Ke(d, \"parseHTML\", f));\n g && (p.parseDOM = g.map(\n (C) => qu(C, u)\n ));\n const b = Ke(d, \"renderHTML\", f);\n b && (p.toDOM = (C) => b({\n node: C,\n HTMLAttributes: qo(C, u)\n }));\n const y = Ke(d, \"renderText\", f);\n return y && (p.toText = y), [d.name, p];\n })\n ), l = Object.fromEntries(\n o.map((d) => {\n const u = n.filter((y) => y.type === d.name), f = {\n name: d.name,\n options: d.options,\n storage: d.storage,\n editor: e\n }, h = r.reduce((y, C) => {\n const E = Ke(C, \"extendMarkSchema\", f);\n return {\n ...y,\n ...E ? E(d) : {}\n };\n }, {}), p = Vu({\n ...h,\n inclusive: Wt(Ke(d, \"inclusive\", f)),\n excludes: Wt(Ke(d, \"excludes\", f)),\n group: Wt(Ke(d, \"group\", f)),\n spanning: Wt(Ke(d, \"spanning\", f)),\n code: Wt(Ke(d, \"code\", f)),\n attrs: Object.fromEntries(u.map(Wu))\n }), g = Wt(Ke(d, \"parseHTML\", f));\n g && (p.parseDOM = g.map(\n (y) => qu(y, u)\n ));\n const b = Ke(d, \"renderHTML\", f);\n return b && (p.toDOM = (y) => b({\n mark: y,\n HTMLAttributes: qo(y, u)\n })), [d.name, p];\n })\n );\n return new sp({\n topNode: i,\n nodes: a,\n marks: l\n });\n}\nfunction ux(r) {\n const e = r.filter((t, n) => r.indexOf(t) !== n);\n return Array.from(new Set(e));\n}\nfunction So(r) {\n return r.sort((t, n) => {\n const s = Ke(t, \"priority\") || 100, o = Ke(n, \"priority\") || 100;\n return s > o ? -1 : s < o ? 1 : 0;\n });\n}\nfunction Th(r) {\n const e = So(Xc(r)), t = ux(e.map((n) => n.name));\n return t.length && console.warn(\n `[tiptap warn]: Duplicate extension names found: [${t.map((n) => `'${n}'`).join(\", \")}]. This can lead to issues.`\n ), e;\n}\nfunction Mh(r, e, t) {\n const { from: n, to: s } = e, { blockSeparator: o = `\n\n`, textSerializers: i = {} } = t || {};\n let a = \"\";\n return r.nodesBetween(n, s, (l, d, u, f) => {\n var h;\n l.isBlock && d > n && (a += o);\n const p = i?.[l.type.name];\n if (p)\n return u && (a += p({\n node: l,\n pos: d,\n parent: u,\n index: f,\n range: e\n })), !1;\n l.isText && (a += (h = l?.text) == null ? void 0 : h.slice(Math.max(n, d) - d, s - d));\n }), a;\n}\nfunction fx(r, e) {\n const t = {\n from: 0,\n to: r.content.size\n };\n return Mh(r, t, e);\n}\nfunction Ah(r) {\n return Object.fromEntries(\n Object.entries(r.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText])\n );\n}\nfunction px(r, e) {\n const t = _r(e, r.schema), { from: n, to: s } = r.selection, o = [];\n r.doc.nodesBetween(n, s, (a) => {\n o.push(a);\n });\n const i = o.reverse().find((a) => a.type.name === t.name);\n return i ? { ...i.attrs } : {};\n}\nfunction Ph(r, e) {\n const t = $a(\n typeof e == \"string\" ? e : e.name,\n r.schema\n );\n return t === \"node\" ? px(r, e) : t === \"mark\" ? Ch(r, e) : {};\n}\nfunction hx(r, e = JSON.stringify) {\n const t = {};\n return r.filter((n) => {\n const s = e(n);\n return Object.prototype.hasOwnProperty.call(t, s) ? !1 : t[s] = !0;\n });\n}\nfunction mx(r) {\n const e = hx(r);\n return e.length === 1 ? e : e.filter((t, n) => !e.filter((o, i) => i !== n).some((o) => t.oldRange.from >= o.oldRange.from && t.oldRange.to <= o.oldRange.to && t.newRange.from >= o.newRange.from && t.newRange.to <= o.newRange.to));\n}\nfunction Nh(r) {\n const { mapping: e, steps: t } = r, n = [];\n return e.maps.forEach((s, o) => {\n const i = [];\n if (s.ranges.length)\n s.forEach((a, l) => {\n i.push({ from: a, to: l });\n });\n else {\n const { from: a, to: l } = t[o];\n if (a === void 0 || l === void 0)\n return;\n i.push({ from: a, to: l });\n }\n i.forEach(({ from: a, to: l }) => {\n const d = e.slice(o).map(a, -1), u = e.slice(o).map(l), f = e.invert().map(d, -1), h = e.invert().map(u);\n n.push({\n oldRange: {\n from: f,\n to: h\n },\n newRange: {\n from: d,\n to: u\n }\n });\n });\n }), mx(n);\n}\nfunction Zc(r, e, t) {\n const n = [];\n return r === e ? t.resolve(r).marks().forEach((s) => {\n const o = t.resolve(r), i = Yc(o, s.type);\n i && n.push({\n mark: s,\n ...i\n });\n }) : t.nodesBetween(r, e, (s, o) => {\n !s || s?.nodeSize === void 0 || n.push(\n ...s.marks.map((i) => ({\n from: o,\n to: o + s.nodeSize,\n mark: i\n }))\n );\n }), n;\n}\nvar vx = (r, e, t, n = 20) => {\n const s = r.doc.resolve(t);\n let o = n, i = null;\n for (; o > 0 && i === null; ) {\n const a = s.node(o);\n a?.type.name === e ? i = a : o -= 1;\n }\n return [i, o];\n};\nfunction ao(r, e) {\n return e.nodes[r] || e.marks[r] || null;\n}\nfunction Si(r, e, t) {\n return Object.fromEntries(\n Object.entries(t).filter(([n]) => {\n const s = r.find((o) => o.type === e && o.name === n);\n return s ? s.attribute.keepOnSplit : !1;\n })\n );\n}\nvar gx = (r, e = 500) => {\n let t = \"\";\n const n = r.parentOffset;\n return r.parent.nodesBetween(Math.max(0, n - e), n, (s, o, i, a) => {\n var l, d;\n const u = ((d = (l = s.type.spec).toText) == null ? void 0 : d.call(l, {\n node: s,\n pos: o,\n parent: i,\n index: a\n })) || s.textContent || \"%leaf%\";\n t += s.isAtom && !s.isText ? u : u.slice(0, Math.max(0, n - o));\n }), t;\n};\nfunction Wl(r, e, t = {}) {\n const { empty: n, ranges: s } = r.selection, o = e ? Bn(e, r.schema) : null;\n if (n)\n return !!(r.storedMarks || r.selection.$from.marks()).filter((f) => o ? o.name === f.type.name : !0).find((f) => qi(f.attrs, t, { strict: !1 }));\n let i = 0;\n const a = [];\n if (s.forEach(({ $from: f, $to: h }) => {\n const p = f.pos, g = h.pos;\n r.doc.nodesBetween(p, g, (b, y) => {\n if (o && b.inlineContent && !b.type.allowsMarkType(o))\n return !1;\n if (!b.isText && !b.marks.length)\n return;\n const C = Math.max(p, y), E = Math.min(g, y + b.nodeSize), R = E - C;\n i += R, a.push(\n ...b.marks.map((q) => ({\n mark: q,\n from: C,\n to: E\n }))\n );\n });\n }), i === 0)\n return !1;\n const l = a.filter((f) => o ? o.name === f.mark.type.name : !0).filter((f) => qi(f.mark.attrs, t, { strict: !1 })).reduce((f, h) => f + h.to - h.from, 0), d = a.filter((f) => o ? f.mark.type !== o && f.mark.type.excludes(o) : !0).reduce((f, h) => f + h.to - h.from, 0);\n return (l > 0 ? l + d : l) >= i;\n}\nfunction bx(r, e, t = {}) {\n if (!e)\n return ls(r, null, t) || Wl(r, null, t);\n const n = $a(e, r.schema);\n return n === \"node\" ? ls(r, e, t) : n === \"mark\" ? Wl(r, e, t) : !1;\n}\nvar yx = (r, e) => {\n const { $from: t, $to: n, $anchor: s } = r.selection;\n if (e) {\n const o = Ia((a) => a.type.name === e)(r.selection);\n if (!o)\n return !1;\n const i = r.doc.resolve(o.pos + 1);\n return s.pos + 1 === i.end();\n }\n return !(n.parentOffset < n.parent.nodeSize - 2 || t.pos !== n.pos);\n}, xx = (r) => {\n const { $from: e, $to: t } = r.selection;\n return !(e.parentOffset > 0 || e.pos !== t.pos);\n};\nfunction Uu(r, e) {\n return Array.isArray(e) ? e.some((t) => (typeof t == \"string\" ? t : t.name) === r.name) : e;\n}\nfunction ul(r, e) {\n const { nodeExtensions: t } = to(e), n = t.find((i) => i.name === r);\n if (!n)\n return !1;\n const s = {\n name: n.name,\n options: n.options,\n storage: n.storage\n }, o = Wt(Ke(n, \"group\", s));\n return typeof o != \"string\" ? !1 : o.split(\" \").includes(\"list\");\n}\nfunction za(r, {\n checkChildren: e = !0,\n ignoreWhitespace: t = !1\n} = {}) {\n var n;\n if (t) {\n if (r.type.name === \"hardBreak\")\n return !0;\n if (r.isText)\n return !/\\S/.test((n = r.text) != null ? n : \"\");\n }\n if (r.isText)\n return !r.text;\n if (r.isAtom || r.isLeaf)\n return !1;\n if (r.content.childCount === 0)\n return !0;\n if (e) {\n let s = !0;\n return r.content.forEach((o) => {\n s !== !1 && (za(o, { ignoreWhitespace: t, checkChildren: e }) || (s = !1));\n }), s;\n }\n return !1;\n}\nfunction wx(r) {\n return r instanceof ot;\n}\nvar Oh = class $h {\n constructor(e) {\n this.position = e;\n }\n /**\n * Creates a MappablePosition from a JSON object.\n */\n static fromJSON(e) {\n return new $h(e.position);\n }\n /**\n * Converts the MappablePosition to a JSON object.\n */\n toJSON() {\n return {\n position: this.position\n };\n }\n};\nfunction kx(r, e) {\n const t = e.mapping.mapResult(r.position);\n return {\n position: new Oh(t.pos),\n mapResult: t\n };\n}\nfunction Cx(r) {\n return new Oh(r);\n}\nfunction _x(r, e, t) {\n var n;\n const { selection: s } = e;\n let o = null;\n if (yh(s) && (o = s.$cursor), o) {\n const a = (n = r.storedMarks) != null ? n : o.marks();\n return o.parent.type.allowsMarkType(t) && (!!t.isInSet(a) || !a.some((d) => d.type.excludes(t)));\n }\n const { ranges: i } = s;\n return i.some(({ $from: a, $to: l }) => {\n let d = a.depth === 0 ? r.doc.inlineContent && r.doc.type.allowsMarkType(t) : !1;\n return r.doc.nodesBetween(a.pos, l.pos, (u, f, h) => {\n if (d)\n return !1;\n if (u.isInline) {\n const p = !h || h.type.allowsMarkType(t), g = !!t.isInSet(u.marks) || !u.marks.some((b) => b.type.excludes(t));\n d = p && g;\n }\n return !d;\n }), d;\n });\n}\nvar Sx = (r, e = {}) => ({ tr: t, state: n, dispatch: s }) => {\n const { selection: o } = t, { empty: i, ranges: a } = o, l = Bn(r, n.schema);\n if (s)\n if (i) {\n const d = Ch(n, l);\n t.addStoredMark(\n l.create({\n ...d,\n ...e\n })\n );\n } else\n a.forEach((d) => {\n const u = d.$from.pos, f = d.$to.pos;\n n.doc.nodesBetween(u, f, (h, p) => {\n const g = Math.max(p, u), b = Math.min(p + h.nodeSize, f);\n h.marks.find((C) => C.type === l) ? h.marks.forEach((C) => {\n l === C.type && t.addMark(\n g,\n b,\n l.create({\n ...C.attrs,\n ...e\n })\n );\n }) : t.addMark(g, b, l.create(e));\n });\n });\n return _x(n, t, l);\n}, Ex = (r, e) => ({ tr: t }) => (t.setMeta(r, e), !0), Tx = (r, e = {}) => ({ state: t, dispatch: n, chain: s }) => {\n const o = _r(r, t.schema);\n let i;\n return t.selection.$anchor.sameParent(t.selection.$head) && (i = t.selection.$anchor.parent.attrs), o.isTextblock ? s().command(({ commands: a }) => ou(o, { ...i, ...e })(t) ? !0 : a.clearNodes()).command(({ state: a }) => ou(o, { ...i, ...e })(a, n)).run() : (console.warn('[tiptap warn]: Currently \"setNode()\" only supports text block nodes.'), !1);\n}, Mx = (r) => ({ tr: e, dispatch: t }) => {\n if (t) {\n const { doc: n } = e, s = ks(r, 0, n.content.size), o = ot.create(n, s);\n e.setSelection(o);\n }\n return !0;\n}, Ax = (r, e) => ({ tr: t, state: n, dispatch: s }) => {\n const { selection: o } = n;\n let i, a;\n return typeof e == \"number\" ? (i = e, a = e) : e && \"from\" in e && \"to\" in e ? (i = e.from, a = e.to) : (i = o.from, a = o.to), s && t.doc.nodesBetween(i, a, (l, d) => {\n l.isText || t.setNodeMarkup(d, void 0, {\n ...l.attrs,\n dir: r\n });\n }), !0;\n}, Px = (r) => ({ tr: e, dispatch: t }) => {\n if (t) {\n const { doc: n } = e, { from: s, to: o } = typeof r == \"number\" ? { from: r, to: r } : r, i = ht.atStart(n).from, a = ht.atEnd(n).to, l = ks(s, i, a), d = ks(o, i, a), u = ht.create(n, l, d);\n e.setSelection(u);\n }\n return !0;\n}, Nx = (r) => ({ state: e, dispatch: t }) => {\n const n = _r(r, e.schema);\n return k0(n)(e, t);\n};\nfunction Ju(r, e) {\n const t = r.storedMarks || r.selection.$to.parentOffset && r.selection.$from.marks();\n if (t) {\n const n = t.filter((s) => e?.includes(s.type.name));\n r.tr.ensureMarks(n);\n }\n}\nvar Ox = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor: s }) => {\n const { selection: o, doc: i } = e, { $from: a, $to: l } = o, d = s.extensionManager.attributes, u = Si(d, a.node().type.name, a.node().attrs);\n if (o instanceof ot && o.node.isBlock)\n return !a.parentOffset || !Dn(i, a.pos) ? !1 : (n && (r && Ju(t, s.extensionManager.splittableMarks), e.split(a.pos).scrollIntoView()), !0);\n if (!a.parent.isBlock)\n return !1;\n const f = l.parentOffset === l.parent.content.size, h = a.depth === 0 ? void 0 : sx(a.node(-1).contentMatchAt(a.indexAfter(-1)));\n let p = f && h ? [\n {\n type: h,\n attrs: u\n }\n ] : void 0, g = Dn(e.doc, e.mapping.map(a.pos), 1, p);\n if (!p && !g && Dn(e.doc, e.mapping.map(a.pos), 1, h ? [{ type: h }] : void 0) && (g = !0, p = h ? [\n {\n type: h,\n attrs: u\n }\n ] : void 0), n) {\n if (g && (o instanceof ht && e.deleteSelection(), e.split(e.mapping.map(a.pos), 1, p), h && !f && !a.parentOffset && a.parent.type !== h)) {\n const b = e.mapping.map(a.before()), y = e.doc.resolve(b);\n a.node(-1).canReplaceWith(y.index(), y.index() + 1, h) && e.setNodeMarkup(e.mapping.map(a.before()), h);\n }\n r && Ju(t, s.extensionManager.splittableMarks), e.scrollIntoView();\n }\n return g;\n}, $x = (r, e = {}) => ({ tr: t, state: n, dispatch: s, editor: o }) => {\n var i;\n const a = _r(r, n.schema), { $from: l, $to: d } = n.selection, u = n.selection.node;\n if (u && u.isBlock || l.depth < 2 || !l.sameParent(d))\n return !1;\n const f = l.node(-1);\n if (f.type !== a)\n return !1;\n const h = o.extensionManager.attributes;\n if (l.parent.content.size === 0 && l.node(-1).childCount === l.indexAfter(-1)) {\n if (l.depth === 2 || l.node(-3).type !== a || l.index(-2) !== l.node(-2).childCount - 1)\n return !1;\n if (s) {\n let C = ye.empty;\n const E = l.index(-1) ? 1 : l.index(-2) ? 2 : 3;\n for (let L = l.depth - E; L >= l.depth - 3; L -= 1)\n C = ye.from(l.node(L).copy(C));\n const R = (\n // eslint-disable-next-line no-nested-ternary\n l.indexAfter(-1) < l.node(-2).childCount ? 1 : l.indexAfter(-2) < l.node(-3).childCount ? 2 : 3\n ), q = {\n ...Si(h, l.node().type.name, l.node().attrs),\n ...e\n }, O = ((i = a.contentMatch.defaultType) == null ? void 0 : i.createAndFill(q)) || void 0;\n C = C.append(ye.from(a.createAndFill(null, O) || void 0));\n const M = l.before(l.depth - (E - 1));\n t.replace(M, l.after(-R), new De(C, 4 - E, 0));\n let P = -1;\n t.doc.nodesBetween(M, t.doc.content.size, (L, $) => {\n if (P > -1)\n return !1;\n L.isTextblock && L.content.size === 0 && (P = $ + 1);\n }), P > -1 && t.setSelection(ht.near(t.doc.resolve(P))), t.scrollIntoView();\n }\n return !0;\n }\n const p = d.pos === l.end() ? f.contentMatchAt(0).defaultType : null, g = {\n ...Si(h, f.type.name, f.attrs),\n ...e\n }, b = {\n ...Si(h, l.node().type.name, l.node().attrs),\n ...e\n };\n t.delete(l.pos, d.pos);\n const y = p ? [\n { type: a, attrs: g },\n { type: p, attrs: b }\n ] : [{ type: a, attrs: g }];\n if (!Dn(t.doc, l.pos, 2))\n return !1;\n if (s) {\n const { selection: C, storedMarks: E } = n, { splittableMarks: R } = o.extensionManager, q = E || C.$to.parentOffset && C.$from.marks();\n if (t.split(l.pos, 2, y).scrollIntoView(), !q || !s)\n return !0;\n const O = q.filter((M) => R.includes(M.type.name));\n t.ensureMarks(O);\n }\n return !0;\n}, fl = (r, e) => {\n const t = Ia((i) => i.type === e)(r.selection);\n if (!t)\n return !0;\n const n = r.doc.resolve(Math.max(0, t.pos - 1)).before(t.depth);\n if (n === void 0)\n return !0;\n const s = r.doc.nodeAt(n);\n return t.node.type === s?.type && ds(r.doc, t.pos) && r.join(t.pos), !0;\n}, pl = (r, e) => {\n const t = Ia((i) => i.type === e)(r.selection);\n if (!t)\n return !0;\n const n = r.doc.resolve(t.start).after(t.depth);\n if (n === void 0)\n return !0;\n const s = r.doc.nodeAt(n);\n return t.node.type === s?.type && ds(r.doc, n) && r.join(n), !0;\n};\nfunction Ix(r) {\n const e = r.doc, t = e.firstChild;\n if (!t)\n return null;\n const n = e.resolve(1), s = e.resolve(t.nodeSize - 1);\n return ht.between(n, s);\n}\nvar zx = (r, e, t, n = {}) => ({ editor: s, tr: o, state: i, dispatch: a, chain: l, commands: d, can: u }) => {\n const { extensions: f, splittableMarks: h } = s.extensionManager, p = _r(r, i.schema), g = _r(e, i.schema), { selection: b, storedMarks: y } = i, { $from: C, $to: E } = b, R = C.blockRange(E), q = y || b.$to.parentOffset && b.$from.marks();\n if (!R)\n return !1;\n const O = Ia((z) => ul(z.type.name, f))(b), M = b.from === 0 && b.to === i.doc.content.size, P = i.doc.content.content, L = P.length === 1 ? P[0] : null, $ = M && L && ul(L.type.name, f) ? {\n node: L,\n pos: 0\n } : null, J = O ?? $, U = !!O && R.depth >= 1 && R.depth - O.depth <= 1, F = !!$;\n if ((U || F) && J) {\n if (J.node.type === p)\n return M && F ? l().command(({ tr: z, dispatch: _ }) => {\n const N = Ix(z);\n return N ? (z.setSelection(N), _ && _(z), !0) : !1;\n }).liftListItem(g).run() : d.liftListItem(g);\n if (ul(J.node.type.name, f) && p.validContent(J.node.content))\n return l().command(() => (o.setNodeMarkup(J.pos, p), !0)).command(() => fl(o, p)).command(() => pl(o, p)).run();\n }\n return !t || !q || !a ? l().command(() => u().wrapInList(p, n) ? !0 : d.clearNodes()).wrapInList(p, n).command(() => fl(o, p)).command(() => pl(o, p)).run() : l().command(() => {\n const z = u().wrapInList(p, n), _ = q.filter((N) => h.includes(N.type.name));\n return o.ensureMarks(_), z ? !0 : d.clearNodes();\n }).wrapInList(p, n).command(() => fl(o, p)).command(() => pl(o, p)).run();\n}, Rx = (r, e = {}, t = {}) => ({ state: n, commands: s }) => {\n const { extendEmptyMarkRange: o = !1 } = t, i = Bn(r, n.schema);\n return Wl(n, i, e) ? s.unsetMark(i, { extendEmptyMarkRange: o }) : s.setMark(i, e);\n}, jx = (r, e, t = {}) => ({ state: n, commands: s }) => {\n const o = _r(r, n.schema), i = _r(e, n.schema), a = ls(n, o, t);\n let l;\n return n.selection.$anchor.sameParent(n.selection.$head) && (l = n.selection.$anchor.parent.attrs), a ? s.setNode(i, l) : s.setNode(o, { ...l, ...t });\n}, Lx = (r, e = {}) => ({ state: t, commands: n }) => {\n const s = _r(r, t.schema);\n return ls(t, s, e) ? n.lift(s) : n.wrapIn(s, e);\n}, Dx = () => ({ state: r, dispatch: e }) => {\n const t = r.plugins;\n for (let n = 0; n < t.length; n += 1) {\n const s = t[n];\n let o;\n if (s.spec.isInputRules && (o = s.getState(r))) {\n if (e) {\n const i = r.tr, a = o.transform;\n for (let l = a.steps.length - 1; l >= 0; l -= 1)\n i.step(a.steps[l].invert(a.docs[l]));\n if (o.text) {\n const l = i.doc.resolve(o.from).marks();\n i.replaceWith(o.from, o.to, r.schema.text(o.text, l));\n } else\n i.delete(o.from, o.to);\n }\n return !0;\n }\n }\n return !1;\n}, Fx = () => ({ tr: r, dispatch: e }) => {\n const { selection: t } = r, { empty: n, ranges: s } = t;\n return n || e && s.forEach((o) => {\n r.removeMark(o.$from.pos, o.$to.pos);\n }), !0;\n}, Bx = (r, e = {}) => ({ tr: t, state: n, dispatch: s }) => {\n var o;\n const { extendEmptyMarkRange: i = !1 } = e, { selection: a } = t, l = Bn(r, n.schema), { $from: d, empty: u, ranges: f } = a;\n if (!s)\n return !0;\n if (u && i) {\n let { from: h, to: p } = a;\n const g = (o = d.marks().find((y) => y.type === l)) == null ? void 0 : o.attrs, b = Yc(d, l, g);\n b && (h = b.from, p = b.to), t.removeMark(h, p, l);\n } else\n f.forEach((h) => {\n t.removeMark(h.$from.pos, h.$to.pos, l);\n });\n return t.removeStoredMark(l), !0;\n}, Hx = (r) => ({ tr: e, state: t, dispatch: n }) => {\n const { selection: s } = t;\n let o, i;\n return typeof r == \"number\" ? (o = r, i = r) : r && \"from\" in r && \"to\" in r ? (o = r.from, i = r.to) : (o = s.from, i = s.to), n && e.doc.nodesBetween(o, i, (a, l) => {\n if (a.isText)\n return;\n const d = { ...a.attrs };\n delete d.dir, e.setNodeMarkup(l, void 0, d);\n }), !0;\n}, qx = (r, e = {}) => ({ tr: t, state: n, dispatch: s }) => {\n let o = null, i = null;\n const a = $a(\n typeof r == \"string\" ? r : r.name,\n n.schema\n );\n if (!a)\n return !1;\n a === \"node\" && (o = _r(r, n.schema)), a === \"mark\" && (i = Bn(r, n.schema));\n let l = !1;\n return t.selection.ranges.forEach((d) => {\n const u = d.$from.pos, f = d.$to.pos;\n let h, p, g, b;\n t.selection.empty ? n.doc.nodesBetween(u, f, (y, C) => {\n o && o === y.type && (l = !0, g = Math.max(C, u), b = Math.min(C + y.nodeSize, f), h = C, p = y);\n }) : n.doc.nodesBetween(u, f, (y, C) => {\n C < u && o && o === y.type && (l = !0, g = Math.max(C, u), b = Math.min(C + y.nodeSize, f), h = C, p = y), C >= u && C <= f && (o && o === y.type && (l = !0, s && t.setNodeMarkup(C, void 0, {\n ...y.attrs,\n ...e\n })), i && y.marks.length && y.marks.forEach((E) => {\n if (i === E.type && (l = !0, s)) {\n const R = Math.max(C, u), q = Math.min(C + y.nodeSize, f);\n t.addMark(\n R,\n q,\n i.create({\n ...E.attrs,\n ...e\n })\n );\n }\n }));\n }), p && (h !== void 0 && s && t.setNodeMarkup(h, void 0, {\n ...p.attrs,\n ...e\n }), i && p.marks.length && p.marks.forEach((y) => {\n i === y.type && s && t.addMark(\n g,\n b,\n i.create({\n ...y.attrs,\n ...e\n })\n );\n }));\n }), l;\n}, Vx = (r, e = {}) => ({ state: t, dispatch: n }) => {\n const s = _r(r, t.schema);\n return m0(s, e)(t, n);\n}, Wx = (r, e = {}) => ({ state: t, dispatch: n }) => {\n const s = _r(r, t.schema);\n return v0(s, e)(t, n);\n}, Ux = class {\n constructor() {\n this.callbacks = {};\n }\n on(r, e) {\n return this.callbacks[r] || (this.callbacks[r] = []), this.callbacks[r].push(e), this;\n }\n emit(r, ...e) {\n const t = this.callbacks[r];\n return t && t.forEach((n) => n.apply(this, e)), this;\n }\n off(r, e) {\n const t = this.callbacks[r];\n return t && (e ? this.callbacks[r] = t.filter((n) => n !== e) : delete this.callbacks[r]), this;\n }\n once(r, e) {\n const t = (...n) => {\n this.off(r, t), e.apply(this, n);\n };\n return this.on(r, t);\n }\n removeAllListeners() {\n this.callbacks = {};\n }\n}, Ra = class {\n constructor(r) {\n var e;\n this.find = r.find, this.handler = r.handler, this.undoable = (e = r.undoable) != null ? e : !0;\n }\n}, Jx = (r, e) => {\n if (Gc(e))\n return e.exec(r);\n const t = e(r);\n if (!t)\n return null;\n const n = [t.text];\n return n.index = t.index, n.input = r, n.data = t.data, t.replaceWith && (t.text.includes(t.replaceWith) || console.warn('[tiptap warn]: \"inputRuleMatch.replaceWith\" must be part of \"inputRuleMatch.text\".'), n.push(t.replaceWith)), n;\n};\nfunction fi(r) {\n var e;\n const { editor: t, from: n, to: s, text: o, rules: i, plugin: a } = r, { view: l } = t;\n if (l.composing)\n return !1;\n const d = l.state.doc.resolve(n);\n if (\n // check for code node\n d.parent.type.spec.code || (e = d.nodeBefore || d.nodeAfter) != null && e.marks.find((h) => h.type.spec.code)\n )\n return !1;\n let u = !1;\n const f = gx(d) + o;\n return i.forEach((h) => {\n if (u)\n return;\n const p = Jx(f, h.find);\n if (!p)\n return;\n const g = l.state.tr, b = Na({\n state: l.state,\n transaction: g\n }), y = {\n from: n - (p[0].length - o.length),\n to: s\n }, { commands: C, chain: E, can: R } = new Oa({\n editor: t,\n state: b\n });\n h.handler({\n state: b,\n range: y,\n match: p,\n commands: C,\n chain: E,\n can: R\n }) === null || !g.steps.length || (h.undoable && g.setMeta(a, {\n transform: g,\n from: n,\n to: s,\n text: o\n }), l.dispatch(g), u = !0);\n }), u;\n}\nfunction Kx(r) {\n const { editor: e, rules: t } = r, n = new mr({\n state: {\n init() {\n return null;\n },\n apply(s, o, i) {\n const a = s.getMeta(n);\n if (a)\n return a;\n const l = s.getMeta(\"applyInputRules\");\n return l && setTimeout(() => {\n let { text: u } = l;\n typeof u == \"string\" ? u = u : u = Qc(ye.from(u), i.schema);\n const { from: f } = l, h = f + u.length;\n fi({\n editor: e,\n from: f,\n to: h,\n text: u,\n rules: t,\n plugin: n\n });\n }), s.selectionSet || s.docChanged ? null : o;\n }\n },\n props: {\n handleTextInput(s, o, i, a) {\n return fi({\n editor: e,\n from: o,\n to: i,\n text: a,\n rules: t,\n plugin: n\n });\n },\n handleDOMEvents: {\n compositionend: (s) => (setTimeout(() => {\n const { $cursor: o } = s.state.selection;\n o && fi({\n editor: e,\n from: o.pos,\n to: o.pos,\n text: \"\",\n rules: t,\n plugin: n\n });\n }), !1)\n },\n // add support for input rules to trigger on enter\n // this is useful for example for code blocks\n handleKeyDown(s, o) {\n if (o.key !== \"Enter\")\n return !1;\n const { $cursor: i } = s.state.selection;\n return i ? fi({\n editor: e,\n from: i.pos,\n to: i.pos,\n text: `\n`,\n rules: t,\n plugin: n\n }) : !1;\n }\n },\n // @ts-ignore\n isInputRules: !0\n });\n return n;\n}\nfunction Gx(r) {\n return Object.prototype.toString.call(r).slice(8, -1);\n}\nfunction pi(r) {\n return Gx(r) !== \"Object\" ? !1 : r.constructor === Object && Object.getPrototypeOf(r) === Object.prototype;\n}\nfunction Ih(r, e) {\n const t = { ...r };\n return pi(r) && pi(e) && Object.keys(e).forEach((n) => {\n pi(e[n]) && pi(r[n]) ? t[n] = Ih(r[n], e[n]) : t[n] = e[n];\n }), t;\n}\nvar ed = class {\n constructor(r = {}) {\n this.type = \"extendable\", this.parent = null, this.child = null, this.name = \"\", this.config = {\n name: this.name\n }, this.config = {\n ...this.config,\n ...r\n }, this.name = this.config.name;\n }\n get options() {\n return {\n ...Wt(\n Ke(this, \"addOptions\", {\n name: this.name\n })\n ) || {}\n };\n }\n get storage() {\n return {\n ...Wt(\n Ke(this, \"addStorage\", {\n name: this.name,\n options: this.options\n })\n ) || {}\n };\n }\n configure(r = {}) {\n const e = this.extend({\n ...this.config,\n addOptions: () => Ih(this.options, r)\n });\n return e.name = this.name, e.parent = this.parent, this.child = null, e;\n }\n extend(r = {}) {\n const e = new this.constructor({ ...this.config, ...r });\n return e.parent = this, this.child = e, e.name = \"name\" in r ? r.name : e.parent.name, e;\n }\n}, ti = class zh extends ed {\n constructor() {\n super(...arguments), this.type = \"mark\";\n }\n /**\n * Create a new Mark instance\n * @param config - Mark configuration object or a function that returns a configuration object\n */\n static create(e = {}) {\n const t = typeof e == \"function\" ? e() : e;\n return new zh(t);\n }\n static handleExit({ editor: e, mark: t }) {\n const { tr: n } = e.state, s = e.state.selection.$from;\n if (s.pos === s.end()) {\n const i = s.marks();\n if (!!!i.find((d) => d?.type.name === t.name))\n return !1;\n const l = i.find((d) => d?.type.name === t.name);\n return l && n.removeStoredMark(l), n.insertText(\" \", s.pos), e.view.dispatch(n), !0;\n }\n return !1;\n }\n configure(e) {\n return super.configure(e);\n }\n extend(e) {\n const t = typeof e == \"function\" ? e() : e;\n return super.extend(t);\n }\n};\nfunction Yx(r) {\n return typeof r == \"number\";\n}\nvar Xx = class {\n constructor(r) {\n this.find = r.find, this.handler = r.handler;\n }\n}, Qx = (r, e, t) => {\n if (Gc(e))\n return [...r.matchAll(e)];\n const n = e(r, t);\n return n ? n.map((s) => {\n const o = [s.text];\n return o.index = s.index, o.input = r, o.data = s.data, s.replaceWith && (s.text.includes(s.replaceWith) || console.warn('[tiptap warn]: \"pasteRuleMatch.replaceWith\" must be part of \"pasteRuleMatch.text\".'), o.push(s.replaceWith)), o;\n }) : [];\n};\nfunction Zx(r) {\n const { editor: e, state: t, from: n, to: s, rule: o, pasteEvent: i, dropEvent: a } = r, { commands: l, chain: d, can: u } = new Oa({\n editor: e,\n state: t\n }), f = [];\n return t.doc.nodesBetween(n, s, (p, g) => {\n var b, y, C, E, R;\n if ((y = (b = p.type) == null ? void 0 : b.spec) != null && y.code || !(p.isText || p.isTextblock || p.isInline))\n return;\n const q = (R = (E = (C = p.content) == null ? void 0 : C.size) != null ? E : p.nodeSize) != null ? R : 0, O = Math.max(n, g), M = Math.min(s, g + q);\n if (O >= M)\n return;\n const P = p.isText ? p.text || \"\" : p.textBetween(O - g, M - g, void 0, \"\uFFFC\");\n Qx(P, o.find, i).forEach(($) => {\n if ($.index === void 0)\n return;\n const J = O + $.index + 1, U = J + $[0].length, F = {\n from: t.tr.mapping.map(J),\n to: t.tr.mapping.map(U)\n }, z = o.handler({\n state: t,\n range: F,\n match: $,\n commands: l,\n chain: d,\n can: u,\n pasteEvent: i,\n dropEvent: a\n });\n f.push(z);\n });\n }), f.every((p) => p !== null);\n}\nvar hi = null, ew = (r) => {\n var e;\n const t = new ClipboardEvent(\"paste\", {\n clipboardData: new DataTransfer()\n });\n return (e = t.clipboardData) == null || e.setData(\"text/html\", r), t;\n};\nfunction tw(r) {\n const { editor: e, rules: t } = r;\n let n = null, s = !1, o = !1, i = typeof ClipboardEvent < \"u\" ? new ClipboardEvent(\"paste\") : null, a;\n try {\n a = typeof DragEvent < \"u\" ? new DragEvent(\"drop\") : null;\n } catch {\n a = null;\n }\n const l = ({\n state: u,\n from: f,\n to: h,\n rule: p,\n pasteEvt: g\n }) => {\n const b = u.tr, y = Na({\n state: u,\n transaction: b\n });\n if (!(!Zx({\n editor: e,\n state: y,\n from: Math.max(f - 1, 0),\n to: h.b - 1,\n rule: p,\n pasteEvent: g,\n dropEvent: a\n }) || !b.steps.length)) {\n try {\n a = typeof DragEvent < \"u\" ? new DragEvent(\"drop\") : null;\n } catch {\n a = null;\n }\n return i = typeof ClipboardEvent < \"u\" ? new ClipboardEvent(\"paste\") : null, b;\n }\n };\n return t.map((u) => new mr({\n // we register a global drag handler to track the current drag source element\n view(f) {\n const h = (g) => {\n var b;\n n = (b = f.dom.parentElement) != null && b.contains(g.target) ? f.dom.parentElement : null, n && (hi = e);\n }, p = () => {\n hi && (hi = null);\n };\n return window.addEventListener(\"dragstart\", h), window.addEventListener(\"dragend\", p), {\n destroy() {\n window.removeEventListener(\"dragstart\", h), window.removeEventListener(\"dragend\", p);\n }\n };\n },\n props: {\n handleDOMEvents: {\n drop: (f, h) => {\n if (o = n === f.dom.parentElement, a = h, !o) {\n const p = hi;\n p?.isEditable && setTimeout(() => {\n const g = p.state.selection;\n g && p.commands.deleteRange({ from: g.from, to: g.to });\n }, 10);\n }\n return !1;\n },\n paste: (f, h) => {\n var p;\n const g = (p = h.clipboardData) == null ? void 0 : p.getData(\"text/html\");\n return i = h, s = !!g?.includes(\"data-pm-slice\"), !1;\n }\n }\n },\n appendTransaction: (f, h, p) => {\n const g = f[0], b = g.getMeta(\"uiEvent\") === \"paste\" && !s, y = g.getMeta(\"uiEvent\") === \"drop\" && !o, C = g.getMeta(\"applyPasteRules\"), E = !!C;\n if (!b && !y && !E)\n return;\n if (E) {\n let { text: O } = C;\n typeof O == \"string\" ? O = O : O = Qc(ye.from(O), p.schema);\n const { from: M } = C, P = M + O.length, L = ew(O);\n return l({\n rule: u,\n state: p,\n from: M,\n to: { b: P },\n pasteEvt: L\n });\n }\n const R = h.doc.content.findDiffStart(p.doc.content), q = h.doc.content.findDiffEnd(p.doc.content);\n if (!(!Yx(R) || !q || R === q.b))\n return l({\n rule: u,\n state: p,\n from: R,\n to: q,\n pasteEvt: i\n });\n }\n }));\n}\nvar ja = class {\n constructor(r, e) {\n this.splittableMarks = [], this.editor = e, this.baseExtensions = r, this.extensions = Th(r), this.schema = dx(this.extensions, e), this.setupExtensions();\n }\n /**\n * Get all commands from the extensions.\n * @returns An object with all commands where the key is the command name and the value is the command function\n */\n get commands() {\n return this.extensions.reduce((r, e) => {\n const t = {\n name: e.name,\n options: e.options,\n storage: this.editor.extensionStorage[e.name],\n editor: this.editor,\n type: ao(e.name, this.schema)\n }, n = Ke(e, \"addCommands\", t);\n return n ? {\n ...r,\n ...n()\n } : r;\n }, {});\n }\n /**\n * Get all registered Prosemirror plugins from the extensions.\n * @returns An array of Prosemirror plugins\n */\n get plugins() {\n const { editor: r } = this;\n return So([...this.extensions].reverse()).flatMap((n) => {\n const s = {\n name: n.name,\n options: n.options,\n storage: this.editor.extensionStorage[n.name],\n editor: r,\n type: ao(n.name, this.schema)\n }, o = [], i = Ke(\n n,\n \"addKeyboardShortcuts\",\n s\n );\n let a = {};\n if (n.type === \"mark\" && Ke(n, \"exitable\", s) && (a.ArrowRight = () => ti.handleExit({ editor: r, mark: n })), i) {\n const h = Object.fromEntries(\n Object.entries(i()).map(([p, g]) => [p, () => g({ editor: r })])\n );\n a = { ...a, ...h };\n }\n const l = fy(a);\n o.push(l);\n const d = Ke(n, \"addInputRules\", s);\n if (Uu(n, r.options.enableInputRules) && d) {\n const h = d();\n if (h && h.length) {\n const p = Kx({\n editor: r,\n rules: h\n }), g = Array.isArray(p) ? p : [p];\n o.push(...g);\n }\n }\n const u = Ke(n, \"addPasteRules\", s);\n if (Uu(n, r.options.enablePasteRules) && u) {\n const h = u();\n if (h && h.length) {\n const p = tw({ editor: r, rules: h });\n o.push(...p);\n }\n }\n const f = Ke(\n n,\n \"addProseMirrorPlugins\",\n s\n );\n if (f) {\n const h = f();\n o.push(...h);\n }\n return o;\n });\n }\n /**\n * Get all attributes from the extensions.\n * @returns An array of attributes\n */\n get attributes() {\n return Eh(this.extensions);\n }\n /**\n * Get all node views from the extensions.\n * @returns An object with all node views where the key is the node name and the value is the node view function\n */\n get nodeViews() {\n const { editor: r } = this, { nodeExtensions: e } = to(this.extensions);\n return Object.fromEntries(\n e.filter((t) => !!Ke(t, \"addNodeView\")).map((t) => {\n const n = this.attributes.filter((l) => l.type === t.name), s = {\n name: t.name,\n options: t.options,\n storage: this.editor.extensionStorage[t.name],\n editor: r,\n type: _r(t.name, this.schema)\n }, o = Ke(t, \"addNodeView\", s);\n if (!o)\n return [];\n const i = o();\n if (!i)\n return [];\n const a = (l, d, u, f, h) => {\n const p = qo(l, n);\n return i({\n // pass-through\n node: l,\n view: d,\n getPos: u,\n decorations: f,\n innerDecorations: h,\n // tiptap-specific\n editor: r,\n extension: t,\n HTMLAttributes: p\n });\n };\n return [t.name, a];\n })\n );\n }\n /**\n * Get the composed dispatchTransaction function from all extensions.\n * @param baseDispatch The base dispatch function (e.g. from the editor or user props)\n * @returns A composed dispatch function\n */\n dispatchTransaction(r) {\n const { editor: e } = this;\n return So([...this.extensions].reverse()).reduceRight((n, s) => {\n const o = {\n name: s.name,\n options: s.options,\n storage: this.editor.extensionStorage[s.name],\n editor: e,\n type: ao(s.name, this.schema)\n }, i = Ke(\n s,\n \"dispatchTransaction\",\n o\n );\n return i ? (a) => {\n i.call(o, { transaction: a, next: n });\n } : n;\n }, r);\n }\n /**\n * Get the composed transformPastedHTML function from all extensions.\n * @param baseTransform The base transform function (e.g. from the editor props)\n * @returns A composed transform function that chains all extension transforms\n */\n transformPastedHTML(r) {\n const { editor: e } = this;\n return So([...this.extensions]).reduce(\n (n, s) => {\n const o = {\n name: s.name,\n options: s.options,\n storage: this.editor.extensionStorage[s.name],\n editor: e,\n type: ao(s.name, this.schema)\n }, i = Ke(\n s,\n \"transformPastedHTML\",\n o\n );\n return i ? (a, l) => {\n const d = n(a, l);\n return i.call(o, d);\n } : n;\n },\n r || ((n) => n)\n );\n }\n get markViews() {\n const { editor: r } = this, { markExtensions: e } = to(this.extensions);\n return Object.fromEntries(\n e.filter((t) => !!Ke(t, \"addMarkView\")).map((t) => {\n const n = this.attributes.filter((a) => a.type === t.name), s = {\n name: t.name,\n options: t.options,\n storage: this.editor.extensionStorage[t.name],\n editor: r,\n type: Bn(t.name, this.schema)\n }, o = Ke(t, \"addMarkView\", s);\n if (!o)\n return [];\n const i = (a, l, d) => {\n const u = qo(a, n);\n return o()({\n // pass-through\n mark: a,\n view: l,\n inline: d,\n // tiptap-specific\n editor: r,\n extension: t,\n HTMLAttributes: u,\n updateAttributes: (f) => {\n vw(a, r, f);\n }\n });\n };\n return [t.name, i];\n })\n );\n }\n /**\n * Destroy the extension manager and clean up all extension references\n * to prevent memory leaks through parent/child extension chains.\n *\n * Walks each extension's full parent chain and nulls every forward\n * `parent.child \u2192 current` link where the parent still points to the\n * current node. This breaks the retention path from module-scope\n * singleton roots through deep extend() chains.\n *\n * Only ancestor `.child` links matching the current chain are cleared.\n * The `.parent` pointer on ancestors is never touched \u2014 extensions\n * may be shared across live editors, so their own backward references\n * and non-matching forward links must remain intact.\n */\n destroy() {\n this.extensions.forEach((r) => {\n let e = r;\n for (; e.parent; ) {\n const t = e.parent;\n t.child === e && (t.child = null), e = t;\n }\n }), this.extensions = [], this.baseExtensions = [], this.schema = null, this.editor = null;\n }\n /**\n * Go through all extensions, create extension storages & setup marks\n * & bind editor event listener.\n */\n setupExtensions() {\n const r = this.extensions;\n this.editor.extensionStorage = Object.fromEntries(\n r.map((e) => [e.name, e.storage])\n ), r.forEach((e) => {\n var t;\n const n = {\n name: e.name,\n options: e.options,\n storage: this.editor.extensionStorage[e.name],\n editor: this.editor,\n type: ao(e.name, this.schema)\n };\n e.type === \"mark\" && ((t = Wt(Ke(e, \"keepOnSplit\", n))) == null || t) && this.splittableMarks.push(e.name);\n const s = Ke(e, \"onBeforeCreate\", n), o = Ke(e, \"onCreate\", n), i = Ke(e, \"onUpdate\", n), a = Ke(\n e,\n \"onSelectionUpdate\",\n n\n ), l = Ke(e, \"onTransaction\", n), d = Ke(e, \"onFocus\", n), u = Ke(e, \"onBlur\", n), f = Ke(e, \"onDestroy\", n);\n s && this.editor.on(\"beforeCreate\", s), o && this.editor.on(\"create\", o), i && this.editor.on(\"update\", i), a && this.editor.on(\"selectionUpdate\", a), l && this.editor.on(\"transaction\", l), d && this.editor.on(\"focus\", d), u && this.editor.on(\"blur\", u), f && this.editor.on(\"destroy\", f);\n });\n }\n};\nja.resolve = Th;\nja.sort = So;\nja.flatten = Xc;\nvar rw = {};\nKc(rw, {\n ClipboardTextSerializer: () => jh,\n Commands: () => Lh,\n Delete: () => Dh,\n Drop: () => Fh,\n Editable: () => Bh,\n FocusEvents: () => qh,\n Keymap: () => Vh,\n Paste: () => Wh,\n Tabindex: () => Uh,\n TextDirection: () => Jh,\n focusEventsPluginKey: () => Hh\n});\nvar yr = class Rh extends ed {\n constructor() {\n super(...arguments), this.type = \"extension\";\n }\n /**\n * Create a new Extension instance\n * @param config - Extension configuration object or a function that returns a configuration object\n */\n static create(e = {}) {\n const t = typeof e == \"function\" ? e() : e;\n return new Rh(t);\n }\n configure(e) {\n return super.configure(e);\n }\n extend(e) {\n const t = typeof e == \"function\" ? e() : e;\n return super.extend(t);\n }\n}, jh = yr.create({\n name: \"clipboardTextSerializer\",\n addOptions() {\n return {\n blockSeparator: void 0\n };\n },\n addProseMirrorPlugins() {\n return [\n new mr({\n key: new Or(\"clipboardTextSerializer\"),\n props: {\n clipboardTextSerializer: () => {\n const { editor: r } = this, { state: e, schema: t } = r, { doc: n, selection: s } = e, { ranges: o } = s, i = Math.min(...o.map((u) => u.$from.pos)), a = Math.max(...o.map((u) => u.$to.pos)), l = Ah(t);\n return Mh(n, { from: i, to: a }, {\n ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},\n textSerializers: l\n });\n }\n }\n })\n ];\n }\n}), Lh = yr.create({\n name: \"commands\",\n addCommands() {\n return {\n ...gh\n };\n }\n}), Dh = yr.create({\n name: \"delete\",\n onUpdate({ transaction: r, appendedTransactions: e }) {\n var t, n, s;\n const o = () => {\n var i, a, l, d;\n if ((d = (l = (a = (i = this.editor.options.coreExtensionOptions) == null ? void 0 : i.delete) == null ? void 0 : a.filterTransaction) == null ? void 0 : l.call(a, r)) != null ? d : r.getMeta(\"y-sync$\"))\n return;\n const u = _h(r.before, [r, ...e]);\n Nh(u).forEach((p) => {\n u.mapping.mapResult(p.oldRange.from).deletedAfter && u.mapping.mapResult(p.oldRange.to).deletedBefore && u.before.nodesBetween(p.oldRange.from, p.oldRange.to, (g, b) => {\n const y = b + g.nodeSize - 2, C = p.oldRange.from <= b && y <= p.oldRange.to;\n this.editor.emit(\"delete\", {\n type: \"node\",\n node: g,\n from: b,\n to: y,\n newFrom: u.mapping.map(b),\n newTo: u.mapping.map(y),\n deletedRange: p.oldRange,\n newRange: p.newRange,\n partial: !C,\n editor: this.editor,\n transaction: r,\n combinedTransform: u\n });\n });\n });\n const h = u.mapping;\n u.steps.forEach((p, g) => {\n var b, y;\n if (p instanceof vn) {\n const C = h.slice(g).map(p.from, -1), E = h.slice(g).map(p.to), R = h.invert().map(C, -1), q = h.invert().map(E), O = C > 0 ? (b = u.doc.nodeAt(C - 1)) == null ? void 0 : b.marks.some((P) => P.eq(p.mark)) : !1, M = (y = u.doc.nodeAt(E)) == null ? void 0 : y.marks.some((P) => P.eq(p.mark));\n this.editor.emit(\"delete\", {\n type: \"mark\",\n mark: p.mark,\n from: p.from,\n to: p.to,\n deletedRange: {\n from: R,\n to: q\n },\n newRange: {\n from: C,\n to: E\n },\n partial: !!(M || O),\n editor: this.editor,\n transaction: r,\n combinedTransform: u\n });\n }\n });\n };\n (s = (n = (t = this.editor.options.coreExtensionOptions) == null ? void 0 : t.delete) == null ? void 0 : n.async) == null || s ? setTimeout(o, 0) : o();\n }\n}), Fh = yr.create({\n name: \"drop\",\n addProseMirrorPlugins() {\n return [\n new mr({\n key: new Or(\"tiptapDrop\"),\n props: {\n handleDrop: (r, e, t, n) => {\n this.editor.emit(\"drop\", {\n editor: this.editor,\n event: e,\n slice: t,\n moved: n\n });\n }\n }\n })\n ];\n }\n}), Bh = yr.create({\n name: \"editable\",\n addProseMirrorPlugins() {\n return [\n new mr({\n key: new Or(\"editable\"),\n props: {\n editable: () => this.editor.options.editable\n }\n })\n ];\n }\n}), Hh = new Or(\"focusEvents\"), qh = yr.create({\n name: \"focusEvents\",\n addProseMirrorPlugins() {\n const { editor: r } = this;\n return [\n new mr({\n key: Hh,\n props: {\n handleDOMEvents: {\n focus: (e, t) => {\n r.isFocused = !0;\n const n = r.state.tr.setMeta(\"focus\", { event: t }).setMeta(\"addToHistory\", !1);\n return e.dispatch(n), !1;\n },\n blur: (e, t) => {\n r.isFocused = !1;\n const n = r.state.tr.setMeta(\"blur\", { event: t }).setMeta(\"addToHistory\", !1);\n return e.dispatch(n), !1;\n }\n }\n }\n })\n ];\n }\n}), Vh = yr.create({\n name: \"keymap\",\n addKeyboardShortcuts() {\n const r = () => this.editor.commands.first(({ commands: i }) => [\n () => i.undoInputRule(),\n // maybe convert first text block node to default node\n () => i.command(({ tr: a }) => {\n const { selection: l, doc: d } = a, { empty: u, $anchor: f } = l, { pos: h, parent: p } = f, g = f.parent.isTextblock && h > 0 ? a.doc.resolve(h - 1) : f, b = g.parent.type.spec.isolating, y = f.pos - f.parentOffset, C = b && g.parent.childCount === 1 ? y === f.pos : St.atStart(d).from === h;\n return !u || !p.type.isTextblock || p.textContent.length || !C || C && f.parent.type.name === \"paragraph\" ? !1 : i.clearNodes();\n }),\n () => i.deleteSelection(),\n () => i.joinBackward(),\n () => i.selectNodeBackward()\n ]), e = () => this.editor.commands.first(({ commands: i }) => [\n () => i.deleteSelection(),\n () => i.deleteCurrentNode(),\n () => i.joinForward(),\n () => i.selectNodeForward()\n ]), n = {\n Enter: () => this.editor.commands.first(({ commands: i }) => [\n () => i.newlineInCode(),\n () => i.createParagraphNear(),\n () => i.liftEmptyBlock(),\n () => i.splitBlock()\n ]),\n \"Mod-Enter\": () => this.editor.commands.exitCode(),\n Backspace: r,\n \"Mod-Backspace\": r,\n \"Shift-Backspace\": r,\n Delete: e,\n \"Mod-Delete\": e,\n \"Mod-a\": () => this.editor.commands.selectAll()\n }, s = {\n ...n\n }, o = {\n ...n,\n \"Ctrl-h\": r,\n \"Alt-Backspace\": r,\n \"Ctrl-d\": e,\n \"Ctrl-Alt-Backspace\": e,\n \"Alt-Delete\": e,\n \"Alt-d\": e,\n \"Ctrl-a\": () => this.editor.commands.selectTextblockStart(),\n \"Ctrl-e\": () => this.editor.commands.selectTextblockEnd()\n };\n return Vi() || kh() ? o : s;\n },\n addProseMirrorPlugins() {\n return [\n // With this plugin we check if the whole document was selected and deleted.\n // In this case we will additionally call `clearNodes()` to convert e.g. a heading\n // to a paragraph if necessary.\n // This is an alternative to ProseMirror's `AllSelection`, which doesn\u2019t work well\n // with many other commands.\n new mr({\n key: new Or(\"clearDocument\"),\n appendTransaction: (r, e, t) => {\n if (r.some((b) => b.getMeta(\"composition\")))\n return;\n const n = r.some((b) => b.docChanged) && !e.doc.eq(t.doc), s = r.some((b) => b.getMeta(\"preventClearDocument\"));\n if (!n || s)\n return;\n const { empty: o, from: i, to: a } = e.selection, l = St.atStart(e.doc).from, d = St.atEnd(e.doc).to;\n if (o || !(i === l && a === d) || !za(t.doc))\n return;\n const h = t.tr, p = Na({\n state: t,\n transaction: h\n }), { commands: g } = new Oa({\n editor: this.editor,\n state: p\n });\n if (g.clearNodes(), !!h.steps.length)\n return h;\n }\n })\n ];\n }\n}), Wh = yr.create({\n name: \"paste\",\n addProseMirrorPlugins() {\n return [\n new mr({\n key: new Or(\"tiptapPaste\"),\n props: {\n handlePaste: (r, e, t) => {\n this.editor.emit(\"paste\", {\n editor: this.editor,\n event: e,\n slice: t\n });\n }\n }\n })\n ];\n }\n}), Uh = yr.create({\n name: \"tabindex\",\n addOptions() {\n return {\n value: void 0\n };\n },\n addProseMirrorPlugins() {\n return [\n new mr({\n key: new Or(\"tabindex\"),\n props: {\n attributes: () => {\n var r;\n return !this.editor.isEditable && this.options.value === void 0 ? {} : { tabindex: (r = this.options.value) != null ? r : \"0\" };\n }\n }\n })\n ];\n }\n}), Jh = yr.create({\n name: \"textDirection\",\n addOptions() {\n return {\n direction: void 0\n };\n },\n addGlobalAttributes() {\n if (!this.options.direction)\n return [];\n const { nodeExtensions: r } = to(this.extensions);\n return [\n {\n types: r.filter((e) => e.name !== \"text\").map((e) => e.name),\n attributes: {\n dir: {\n default: this.options.direction,\n parseHTML: (e) => {\n const t = e.getAttribute(\"dir\");\n return t && (t === \"ltr\" || t === \"rtl\" || t === \"auto\") ? t : this.options.direction;\n },\n renderHTML: (e) => e.dir ? {\n dir: e.dir\n } : {}\n }\n }\n }\n ];\n },\n addProseMirrorPlugins() {\n return [\n new mr({\n key: new Or(\"textDirection\"),\n props: {\n attributes: () => {\n const r = this.options.direction;\n return r ? {\n dir: r\n } : {};\n }\n }\n })\n ];\n }\n}), nw = class vo {\n constructor(e, t, n = !1, s = null) {\n this.currentNode = null, this.actualDepth = null, this.isBlock = n, this.resolvedPos = e, this.editor = t, this.currentNode = s;\n }\n get name() {\n return this.node.type.name;\n }\n get node() {\n return this.currentNode || this.resolvedPos.node();\n }\n get element() {\n return this.editor.view.domAtPos(this.pos).node;\n }\n get depth() {\n var e;\n return (e = this.actualDepth) != null ? e : this.resolvedPos.depth;\n }\n get pos() {\n return this.resolvedPos.pos;\n }\n get content() {\n return this.node.content;\n }\n set content(e) {\n let t = this.from, n = this.to;\n if (this.isBlock) {\n if (this.content.size === 0) {\n console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);\n return;\n }\n t = this.from + 1, n = this.to - 1;\n }\n this.editor.commands.insertContentAt({ from: t, to: n }, e);\n }\n get attributes() {\n return this.node.attrs;\n }\n get textContent() {\n return this.node.textContent;\n }\n get size() {\n return this.node.nodeSize;\n }\n get from() {\n return this.isBlock ? this.pos : this.resolvedPos.start(this.resolvedPos.depth);\n }\n get range() {\n return {\n from: this.from,\n to: this.to\n };\n }\n get to() {\n return this.isBlock ? this.pos + this.size : this.resolvedPos.end(this.resolvedPos.depth) + (this.node.isText ? 0 : 1);\n }\n get parent() {\n if (this.depth === 0)\n return null;\n const e = this.resolvedPos.start(this.resolvedPos.depth - 1), t = this.resolvedPos.doc.resolve(e);\n return new vo(t, this.editor);\n }\n get before() {\n let e = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));\n return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.from - 3)), new vo(e, this.editor);\n }\n get after() {\n let e = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));\n return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.to + 3)), new vo(e, this.editor);\n }\n get children() {\n const e = [];\n return this.node.content.forEach((t, n) => {\n const s = t.isBlock && !t.isTextblock, o = t.isAtom && !t.isText, i = t.isInline, a = this.pos + n + (o ? 0 : 1);\n if (a < 0 || a > this.resolvedPos.doc.nodeSize - 2)\n return;\n const l = this.resolvedPos.doc.resolve(a);\n if (!s && !i && l.depth <= this.depth)\n return;\n const d = new vo(l, this.editor, s, s || i ? t : null);\n s && (d.actualDepth = this.depth + 1), e.push(d);\n }), e;\n }\n get firstChild() {\n return this.children[0] || null;\n }\n get lastChild() {\n const e = this.children;\n return e[e.length - 1] || null;\n }\n closest(e, t = {}) {\n let n = null, s = this.parent;\n for (; s && !n; ) {\n if (s.node.type.name === e)\n if (Object.keys(t).length > 0) {\n const o = s.node.attrs, i = Object.keys(t);\n for (let a = 0; a < i.length; a += 1) {\n const l = i[a];\n if (o[l] !== t[l])\n break;\n }\n } else\n n = s;\n s = s.parent;\n }\n return n;\n }\n querySelector(e, t = {}) {\n return this.querySelectorAll(e, t, !0)[0] || null;\n }\n querySelectorAll(e, t = {}, n = !1) {\n let s = [];\n if (!this.children || this.children.length === 0)\n return s;\n const o = Object.keys(t);\n return this.children.forEach((i) => {\n n && s.length > 0 || (i.node.type.name === e && o.every((l) => t[l] === i.node.attrs[l]) && s.push(i), !(n && s.length > 0) && (s = s.concat(i.querySelectorAll(e, t, n))));\n }), s;\n }\n setAttribute(e) {\n const { tr: t } = this.editor.state;\n t.setNodeMarkup(this.from, void 0, {\n ...this.node.attrs,\n ...e\n }), this.editor.view.dispatch(t);\n }\n}, sw = `.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}`;\nfunction ow(r, e, t) {\n const n = document.querySelector(\"style[data-tiptap-style]\");\n if (n !== null)\n return n;\n const s = document.createElement(\"style\");\n return e && s.setAttribute(\"nonce\", e), s.setAttribute(\"data-tiptap-style\", \"\"), s.innerHTML = r, document.getElementsByTagName(\"head\")[0].appendChild(s), s;\n}\nvar Ul = class extends Ux {\n constructor(r = {}) {\n super(), this.css = null, this.className = \"tiptap\", this.editorView = null, this.isFocused = !1, this.destroyed = !1, this.isInitialized = !1, this.extensionStorage = {}, this.instanceId = Math.random().toString(36).slice(2, 9), this.options = {\n element: typeof document < \"u\" ? document.createElement(\"div\") : null,\n content: \"\",\n injectCSS: !0,\n injectNonce: void 0,\n extensions: [],\n autofocus: !1,\n editable: !0,\n textDirection: void 0,\n editorProps: {},\n parseOptions: {},\n coreExtensionOptions: {},\n enableInputRules: !0,\n enablePasteRules: !0,\n enableCoreExtensions: !0,\n enableContentCheck: !1,\n emitContentError: !1,\n onBeforeCreate: () => null,\n onCreate: () => null,\n onMount: () => null,\n onUnmount: () => null,\n onUpdate: () => null,\n onSelectionUpdate: () => null,\n onTransaction: () => null,\n onFocus: () => null,\n onBlur: () => null,\n onDestroy: () => null,\n onContentError: ({ error: n }) => {\n throw n;\n },\n onPaste: () => null,\n onDrop: () => null,\n onDelete: () => null,\n enableExtensionDispatchTransaction: !0\n }, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.utils = {\n getUpdatedPosition: kx,\n createMappablePosition: Cx\n }, this.setOptions(r), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on(\"beforeCreate\", this.options.onBeforeCreate), this.emit(\"beforeCreate\", { editor: this }), this.on(\"mount\", this.options.onMount), this.on(\"unmount\", this.options.onUnmount), this.on(\"contentError\", this.options.onContentError), this.on(\"create\", this.options.onCreate), this.on(\"update\", this.options.onUpdate), this.on(\"selectionUpdate\", this.options.onSelectionUpdate), this.on(\"transaction\", this.options.onTransaction), this.on(\"focus\", this.options.onFocus), this.on(\"blur\", this.options.onBlur), this.on(\"destroy\", this.options.onDestroy), this.on(\"drop\", ({ event: n, slice: s, moved: o }) => this.options.onDrop(n, s, o)), this.on(\"paste\", ({ event: n, slice: s }) => this.options.onPaste(n, s)), this.on(\"delete\", this.options.onDelete);\n const e = this.createDoc(), t = xh(e, this.options.autofocus);\n this.editorState = qs.create({\n doc: e,\n schema: this.schema,\n selection: t || void 0\n }), this.options.element && this.mount(this.options.element);\n }\n /**\n * Attach the editor to the DOM, creating a new editor view.\n */\n mount(r) {\n if (typeof document > \"u\")\n throw new Error(\n \"[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.\"\n );\n this.createView(r), this.emit(\"mount\", { editor: this }), this.css && !document.head.contains(this.css) && document.head.appendChild(this.css), window.setTimeout(() => {\n this.isDestroyed || (this.options.autofocus !== !1 && this.options.autofocus !== null && this.commands.focus(this.options.autofocus), this.emit(\"create\", { editor: this }), this.isInitialized = !0);\n }, 0);\n }\n /**\n * Remove the editor from the DOM, but still allow remounting at a different point in time\n */\n unmount() {\n if (this.editorView) {\n const r = this.editorView.dom;\n r?.editor && delete r.editor, this.editorView.destroy();\n }\n if (this.editorView = null, this.isInitialized = !1, this.css && !document.querySelectorAll(`.${this.className}`).length)\n try {\n typeof this.css.remove == \"function\" ? this.css.remove() : this.css.parentNode && this.css.parentNode.removeChild(this.css);\n } catch (r) {\n console.warn(\"Failed to remove CSS element:\", r);\n }\n this.css = null, this.emit(\"unmount\", { editor: this });\n }\n /**\n * Returns the editor storage.\n */\n get storage() {\n return this.extensionStorage;\n }\n /**\n * An object of all registered commands.\n */\n get commands() {\n return this.commandManager.commands;\n }\n /**\n * Create a command chain to call multiple commands at once.\n */\n chain() {\n return this.commandManager.chain();\n }\n /**\n * Check if a command or a command chain can be executed. Without executing it.\n */\n can() {\n return this.commandManager.can();\n }\n /**\n * Inject CSS styles.\n */\n injectCSS() {\n this.options.injectCSS && typeof document < \"u\" && (this.css = ow(sw, this.options.injectNonce));\n }\n /**\n * Update editor options.\n *\n * @param options A list of options\n */\n setOptions(r = {}) {\n this.options = {\n ...this.options,\n ...r\n }, !(!this.editorView || !this.state || this.isDestroyed) && (this.options.editorProps && this.view.setProps(this.options.editorProps), this.view.updateState(this.state));\n }\n /**\n * Update editable state of the editor.\n */\n setEditable(r, e = !0) {\n this.setOptions({ editable: r }), e && this.emit(\"update\", { editor: this, transaction: this.state.tr, appendedTransactions: [] });\n }\n /**\n * Returns whether the editor is editable.\n */\n get isEditable() {\n return this.options.editable && this.view && this.view.editable;\n }\n /**\n * Returns the editor view.\n */\n get view() {\n return this.editorView ? this.editorView : new Proxy(\n {\n state: this.editorState,\n updateState: (r) => {\n this.editorState = r;\n },\n dispatch: (r) => {\n this.dispatchTransaction(r);\n },\n // Stub some commonly accessed properties to prevent errors\n composing: !1,\n dragging: null,\n editable: !0,\n isDestroyed: !1\n },\n {\n get: (r, e) => {\n if (this.editorView)\n return this.editorView[e];\n if (e === \"state\")\n return this.editorState;\n if (e in r)\n return Reflect.get(r, e);\n throw new Error(\n `[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`\n );\n }\n }\n );\n }\n /**\n * Returns the editor state.\n */\n get state() {\n return this.editorView && (this.editorState = this.view.state), this.editorState;\n }\n /**\n * Register a ProseMirror plugin.\n *\n * @param plugin A ProseMirror plugin\n * @param handlePlugins Control how to merge the plugin into the existing plugins.\n * @returns The new editor state\n */\n registerPlugin(r, e) {\n const t = Sh(e) ? e(r, [...this.state.plugins]) : [...this.state.plugins, r], n = this.state.reconfigure({ plugins: t });\n return this.view.updateState(n), n;\n }\n /**\n * Unregister a ProseMirror plugin.\n *\n * @param nameOrPluginKeyToRemove The plugins name\n * @returns The new editor state or undefined if the editor is destroyed\n */\n unregisterPlugin(r) {\n if (this.isDestroyed)\n return;\n const e = this.state.plugins;\n let t = e;\n if ([].concat(r).forEach((s) => {\n const o = typeof s == \"string\" ? `${s}$` : s.key;\n t = t.filter((i) => !i.key.startsWith(o));\n }), e.length === t.length)\n return;\n const n = this.state.reconfigure({\n plugins: t\n });\n return this.view.updateState(n), n;\n }\n /**\n * Creates an extension manager.\n */\n createExtensionManager() {\n var r, e, t, n;\n const o = [...this.options.enableCoreExtensions ? [\n Bh,\n jh.configure({\n blockSeparator: (e = (r = this.options.coreExtensionOptions) == null ? void 0 : r.clipboardTextSerializer) == null ? void 0 : e.blockSeparator\n }),\n Lh,\n qh,\n Vh,\n Uh.configure({\n value: (n = (t = this.options.coreExtensionOptions) == null ? void 0 : t.tabindex) == null ? void 0 : n.value\n }),\n Fh,\n Wh,\n Dh,\n Jh.configure({\n direction: this.options.textDirection\n })\n ].filter((i) => typeof this.options.enableCoreExtensions == \"object\" ? this.options.enableCoreExtensions[i.name] !== !1 : !0) : [], ...this.options.extensions].filter((i) => [\"extension\", \"node\", \"mark\"].includes(i?.type));\n this.extensionManager = new ja(o, this);\n }\n /**\n * Creates an command manager.\n */\n createCommandManager() {\n this.commandManager = new Oa({\n editor: this\n });\n }\n /**\n * Creates a ProseMirror schema.\n */\n createSchema() {\n this.schema = this.extensionManager.schema;\n }\n /**\n * Creates the initial document.\n */\n createDoc() {\n let r;\n try {\n r = Vl(this.options.content, this.schema, this.options.parseOptions, {\n errorOnInvalidContent: this.options.enableContentCheck\n });\n } catch (e) {\n if (!(e instanceof Error) || ![\"[tiptap error]: Invalid JSON content\", \"[tiptap error]: Invalid HTML content\"].includes(e.message))\n throw e;\n this.emit(\"contentError\", {\n editor: this,\n error: e,\n disableCollaboration: () => {\n \"collaboration\" in this.storage && typeof this.storage.collaboration == \"object\" && this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((t) => t.name !== \"collaboration\"), this.createExtensionManager();\n }\n }), r = Vl(this.options.content, this.schema, this.options.parseOptions, {\n errorOnInvalidContent: !1\n });\n }\n return r;\n }\n /**\n * Creates a ProseMirror view.\n */\n createView(r) {\n const { editorProps: e, enableExtensionDispatchTransaction: t } = this.options, n = e.dispatchTransaction || this.dispatchTransaction.bind(this), s = t ? this.extensionManager.dispatchTransaction(n) : n, o = e.transformPastedHTML, i = this.extensionManager.transformPastedHTML(o);\n this.editorView = new mh(r, {\n ...e,\n attributes: {\n // add `role=\"textbox\"` to the editor element\n role: \"textbox\",\n ...e?.attributes\n },\n dispatchTransaction: s,\n transformPastedHTML: i,\n state: this.editorState,\n markViews: this.extensionManager.markViews,\n nodeViews: this.extensionManager.nodeViews\n });\n const a = this.state.reconfigure({\n plugins: this.extensionManager.plugins\n });\n this.view.updateState(a), this.prependClass(), this.injectCSS();\n const l = this.view.dom;\n l.editor = this;\n }\n /**\n * Creates all node and mark views.\n */\n createNodeViews() {\n this.view.isDestroyed || this.view.setProps({\n markViews: this.extensionManager.markViews,\n nodeViews: this.extensionManager.nodeViews\n });\n }\n /**\n * Prepend class name to element.\n */\n prependClass() {\n this.view.dom.className = `${this.className} ${this.view.dom.className}`;\n }\n captureTransaction(r) {\n this.isCapturingTransaction = !0, r(), this.isCapturingTransaction = !1;\n const e = this.capturedTransaction;\n return this.capturedTransaction = null, e;\n }\n /**\n * The callback over which to send transactions (state updates) produced by the view.\n *\n * @param transaction An editor state transaction\n */\n dispatchTransaction(r) {\n if (this.view.isDestroyed)\n return;\n if (this.isCapturingTransaction) {\n if (!this.capturedTransaction) {\n this.capturedTransaction = r;\n return;\n }\n r.steps.forEach((d) => {\n var u;\n return (u = this.capturedTransaction) == null ? void 0 : u.step(d);\n });\n return;\n }\n const { state: e, transactions: t } = this.state.applyTransaction(r), n = !this.state.selection.eq(e.selection), s = t.includes(r), o = this.state;\n if (this.emit(\"beforeTransaction\", {\n editor: this,\n transaction: r,\n nextState: e\n }), !s)\n return;\n this.view.updateState(e), this.emit(\"transaction\", {\n editor: this,\n transaction: r,\n appendedTransactions: t.slice(1)\n }), n && this.emit(\"selectionUpdate\", {\n editor: this,\n transaction: r\n });\n const i = t.findLast((d) => d.getMeta(\"focus\") || d.getMeta(\"blur\")), a = i?.getMeta(\"focus\"), l = i?.getMeta(\"blur\");\n a && this.emit(\"focus\", {\n editor: this,\n event: a.event,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n transaction: i\n }), l && this.emit(\"blur\", {\n editor: this,\n event: l.event,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n transaction: i\n }), !(r.getMeta(\"preventUpdate\") || !t.some((d) => d.docChanged) || o.doc.eq(e.doc)) && this.emit(\"update\", {\n editor: this,\n transaction: r,\n appendedTransactions: t.slice(1)\n });\n }\n /**\n * Get attributes of the currently selected node or mark.\n */\n getAttributes(r) {\n return Ph(this.state, r);\n }\n isActive(r, e) {\n const t = typeof r == \"string\" ? r : null, n = typeof r == \"string\" ? e : r;\n return bx(this.state, t, n);\n }\n /**\n * Get the document as JSON.\n */\n getJSON() {\n return this.state.doc.toJSON();\n }\n /**\n * Get the document as HTML.\n */\n getHTML() {\n return Qc(this.state.doc.content, this.schema);\n }\n /**\n * Get the document as text.\n */\n getText(r) {\n const { blockSeparator: e = `\n\n`, textSerializers: t = {} } = r || {};\n return fx(this.state.doc, {\n blockSeparator: e,\n textSerializers: {\n ...Ah(this.schema),\n ...t\n }\n });\n }\n /**\n * Check if there is no content.\n */\n get isEmpty() {\n return za(this.state.doc);\n }\n /**\n * Destroy the editor.\n */\n destroy() {\n this.destroyed || (this.destroyed = !0, this.emit(\"destroy\"), this.unmount(), this.removeAllListeners(), this.extensionManager.destroy(), this.extensionManager = null, this.schema = null, this.commandManager = null, this.extensionStorage = {});\n }\n /**\n * Check if the editor is already destroyed.\n */\n get isDestroyed() {\n var r, e;\n return (e = (r = this.editorView) == null ? void 0 : r.isDestroyed) != null ? e : !0;\n }\n $node(r, e) {\n var t;\n return ((t = this.$doc) == null ? void 0 : t.querySelector(r, e)) || null;\n }\n $nodes(r, e) {\n var t;\n return ((t = this.$doc) == null ? void 0 : t.querySelectorAll(r, e)) || null;\n }\n $pos(r) {\n const e = this.state.doc.resolve(r);\n return new nw(e, this);\n }\n get $doc() {\n return this.$pos(0);\n }\n};\nfunction Wi(r) {\n return new Ra({\n find: r.find,\n handler: ({ state: e, range: t, match: n }) => {\n const s = Wt(r.getAttributes, void 0, n);\n if (s === !1 || s === null)\n return null;\n const { tr: o } = e, i = n[n.length - 1], a = n[0];\n if (i) {\n const l = a.search(/\\S/), d = t.from + a.indexOf(i), u = d + i.length;\n if (Zc(t.from, t.to, e.doc).filter((p) => p.mark.type.excluded.find((b) => b === r.type && b !== p.mark.type)).filter((p) => p.to > d).length)\n return null;\n u < t.to && o.delete(u, t.to), d > t.from && o.delete(t.from + l, d);\n const h = t.from + l + i.length;\n o.addMark(t.from + l, h, r.type.create(s || {})), o.removeStoredMark(r.type);\n }\n },\n undoable: r.undoable\n });\n}\nfunction iw(r) {\n return new Ra({\n find: r.find,\n handler: ({ state: e, range: t, match: n }) => {\n const s = Wt(r.getAttributes, void 0, n) || {}, { tr: o } = e, i = t.from;\n let a = t.to;\n const l = r.type.create(s);\n if (n[1]) {\n const d = n[0].lastIndexOf(n[1]);\n let u = i + d;\n u > a ? u = a : a = u + n[1].length;\n const f = n[0][n[0].length - 1];\n o.insertText(f, i + n[0].length - 1), o.replaceWith(u, a, l);\n } else if (n[0]) {\n const d = r.type.isInline ? i : i - 1;\n o.insert(d, r.type.create(s)).delete(o.mapping.map(i), o.mapping.map(a));\n }\n o.scrollIntoView();\n },\n undoable: r.undoable\n });\n}\nfunction aw(r) {\n return new Ra({\n find: r.find,\n handler: ({ state: e, range: t, match: n }) => {\n const s = e.doc.resolve(t.from), o = Wt(r.getAttributes, void 0, n) || {};\n if (!s.node(-1).canReplaceWith(s.index(-1), s.indexAfter(-1), r.type))\n return null;\n e.tr.delete(t.from, t.to).setBlockType(t.from, t.from, r.type, o);\n },\n undoable: r.undoable\n });\n}\nfunction Vo(r) {\n return new Ra({\n find: r.find,\n handler: ({ state: e, range: t, match: n, chain: s }) => {\n const o = Wt(r.getAttributes, void 0, n) || {}, i = e.tr.delete(t.from, t.to), l = i.doc.resolve(t.from).blockRange(), d = l && Oc(l, r.type, o);\n if (!d)\n return null;\n if (i.wrap(l, d), r.keepMarks && r.editor) {\n const { selection: f, storedMarks: h } = e, { splittableMarks: p } = r.editor.extensionManager, g = h || f.$to.parentOffset && f.$from.marks();\n if (g) {\n const b = g.filter((y) => p.includes(y.type.name));\n i.ensureMarks(b);\n }\n }\n if (r.keepAttributes) {\n const f = r.type.name === \"bulletList\" || r.type.name === \"orderedList\" ? \"listItem\" : \"taskList\";\n s().updateAttributes(f, o).run();\n }\n const u = i.doc.resolve(t.from - 1).nodeBefore;\n u && u.type === r.type && ds(i.doc, t.from - 1) && (!r.joinPredicate || r.joinPredicate(n, u)) && i.join(t.from - 1);\n },\n undoable: r.undoable\n });\n}\nvar lw = (r) => \"touches\" in r, cw = class {\n /**\n * Creates a new ResizableNodeView instance.\n *\n * The constructor sets up the resize handles, applies initial sizing from\n * node attributes, and configures all resize behavior options.\n *\n * @param options - Configuration options for the resizable node view\n */\n constructor(r) {\n this.directions = [\"bottom-left\", \"bottom-right\", \"top-left\", \"top-right\"], this.minSize = {\n height: 8,\n width: 8\n }, this.preserveAspectRatio = !1, this.classNames = {\n container: \"\",\n wrapper: \"\",\n handle: \"\",\n resizing: \"\"\n }, this.initialWidth = 0, this.initialHeight = 0, this.aspectRatio = 1, this.isResizing = !1, this.activeHandle = null, this.startX = 0, this.startY = 0, this.startWidth = 0, this.startHeight = 0, this.isShiftKeyPressed = !1, this.lastEditableState = void 0, this.handleMap = /* @__PURE__ */ new Map(), this.handleMouseMove = (a) => {\n if (!this.isResizing || !this.activeHandle)\n return;\n const l = a.clientX - this.startX, d = a.clientY - this.startY;\n this.handleResize(l, d);\n }, this.handleTouchMove = (a) => {\n if (!this.isResizing || !this.activeHandle)\n return;\n const l = a.touches[0];\n if (!l)\n return;\n const d = l.clientX - this.startX, u = l.clientY - this.startY;\n this.handleResize(d, u);\n }, this.handleMouseUp = () => {\n if (!this.isResizing)\n return;\n const a = this.element.offsetWidth, l = this.element.offsetHeight;\n this.onCommit(a, l), this.isResizing = !1, this.activeHandle = null, this.container.dataset.resizeState = \"false\", this.classNames.resizing && this.container.classList.remove(this.classNames.resizing), document.removeEventListener(\"mousemove\", this.handleMouseMove), document.removeEventListener(\"mouseup\", this.handleMouseUp), document.removeEventListener(\"keydown\", this.handleKeyDown), document.removeEventListener(\"keyup\", this.handleKeyUp);\n }, this.handleKeyDown = (a) => {\n a.key === \"Shift\" && (this.isShiftKeyPressed = !0);\n }, this.handleKeyUp = (a) => {\n a.key === \"Shift\" && (this.isShiftKeyPressed = !1);\n };\n var e, t, n, s, o, i;\n this.node = r.node, this.editor = r.editor, this.element = r.element, this.contentElement = r.contentElement, this.getPos = r.getPos, this.onResize = r.onResize, this.onCommit = r.onCommit, this.onUpdate = r.onUpdate, (e = r.options) != null && e.min && (this.minSize = {\n ...this.minSize,\n ...r.options.min\n }), (t = r.options) != null && t.max && (this.maxSize = r.options.max), (n = r?.options) != null && n.directions && (this.directions = r.options.directions), (s = r.options) != null && s.preserveAspectRatio && (this.preserveAspectRatio = r.options.preserveAspectRatio), (o = r.options) != null && o.className && (this.classNames = {\n container: r.options.className.container || \"\",\n wrapper: r.options.className.wrapper || \"\",\n handle: r.options.className.handle || \"\",\n resizing: r.options.className.resizing || \"\"\n }), (i = r.options) != null && i.createCustomHandle && (this.createCustomHandle = r.options.createCustomHandle), this.wrapper = this.createWrapper(), this.container = this.createContainer(), this.applyInitialSize(), this.attachHandles(), this.editor.on(\"update\", this.handleEditorUpdate.bind(this));\n }\n /**\n * Returns the top-level DOM node that should be placed in the editor.\n *\n * This is required by the ProseMirror NodeView interface. The container\n * includes the wrapper, handles, and the actual content element.\n *\n * @returns The container element to be inserted into the editor\n */\n get dom() {\n return this.container;\n }\n get contentDOM() {\n var r;\n return (r = this.contentElement) != null ? r : null;\n }\n handleEditorUpdate() {\n const r = this.editor.isEditable;\n r !== this.lastEditableState && (this.lastEditableState = r, r ? r && this.handleMap.size === 0 && this.attachHandles() : this.removeHandles());\n }\n /**\n * Called when the node's content or attributes change.\n *\n * Updates the internal node reference. If a custom `onUpdate` callback\n * was provided, it will be called to handle additional update logic.\n *\n * @param node - The new/updated node\n * @param decorations - Node decorations\n * @param innerDecorations - Inner decorations\n * @returns `false` if the node type has changed (requires full rebuild), otherwise the result of `onUpdate` or `true`\n */\n update(r, e, t) {\n return r.type !== this.node.type ? !1 : (this.node = r, this.onUpdate ? this.onUpdate(r, e, t) : !0);\n }\n /**\n * Cleanup method called when the node view is being removed.\n *\n * Removes all event listeners to prevent memory leaks. This is required\n * by the ProseMirror NodeView interface. If a resize is active when\n * destroy is called, it will be properly cancelled.\n */\n destroy() {\n this.isResizing && (this.container.dataset.resizeState = \"false\", this.classNames.resizing && this.container.classList.remove(this.classNames.resizing), document.removeEventListener(\"mousemove\", this.handleMouseMove), document.removeEventListener(\"mouseup\", this.handleMouseUp), document.removeEventListener(\"keydown\", this.handleKeyDown), document.removeEventListener(\"keyup\", this.handleKeyUp), this.isResizing = !1, this.activeHandle = null), this.editor.off(\"update\", this.handleEditorUpdate.bind(this)), this.container.remove();\n }\n /**\n * Creates the outer container element.\n *\n * The container is the top-level element returned by the NodeView and\n * wraps the entire resizable node. It's set up with flexbox to handle\n * alignment and includes data attributes for styling and identification.\n *\n * @returns The container element\n */\n createContainer() {\n const r = document.createElement(\"div\");\n return r.dataset.resizeContainer = \"\", r.dataset.node = this.node.type.name, r.style.display = this.node.type.isInline ? \"inline-flex\" : \"flex\", this.classNames.container && (r.className = this.classNames.container), r.appendChild(this.wrapper), r;\n }\n /**\n * Creates the wrapper element that contains the content and handles.\n *\n * The wrapper uses relative positioning so that resize handles can be\n * positioned absolutely within it. This is the direct parent of the\n * content element being made resizable.\n *\n * @returns The wrapper element\n */\n createWrapper() {\n const r = document.createElement(\"div\");\n return r.style.position = \"relative\", r.style.display = \"block\", r.dataset.resizeWrapper = \"\", this.classNames.wrapper && (r.className = this.classNames.wrapper), r.appendChild(this.element), r;\n }\n /**\n * Creates a resize handle element for a specific direction.\n *\n * Each handle is absolutely positioned and includes a data attribute\n * identifying its direction for styling purposes.\n *\n * @param direction - The resize direction for this handle\n * @returns The handle element\n */\n createHandle(r) {\n const e = document.createElement(\"div\");\n return e.dataset.resizeHandle = r, e.style.position = \"absolute\", this.classNames.handle && (e.className = this.classNames.handle), e;\n }\n /**\n * Positions a handle element according to its direction.\n *\n * Corner handles (e.g., 'top-left') are positioned at the intersection\n * of two edges. Edge handles (e.g., 'top') span the full width or height.\n *\n * @param handle - The handle element to position\n * @param direction - The direction determining the position\n */\n positionHandle(r, e) {\n const t = e.includes(\"top\"), n = e.includes(\"bottom\"), s = e.includes(\"left\"), o = e.includes(\"right\");\n t && (r.style.top = \"0\"), n && (r.style.bottom = \"0\"), s && (r.style.left = \"0\"), o && (r.style.right = \"0\"), (e === \"top\" || e === \"bottom\") && (r.style.left = \"0\", r.style.right = \"0\"), (e === \"left\" || e === \"right\") && (r.style.top = \"0\", r.style.bottom = \"0\");\n }\n /**\n * Creates and attaches all resize handles to the wrapper.\n *\n * Iterates through the configured directions, creates a handle for each,\n * positions it, attaches the mousedown listener, and appends it to the DOM.\n */\n attachHandles() {\n this.directions.forEach((r) => {\n let e;\n this.createCustomHandle ? e = this.createCustomHandle(r) : e = this.createHandle(r), e instanceof HTMLElement || (console.warn(\n `[ResizableNodeView] createCustomHandle(\"${r}\") did not return an HTMLElement. Falling back to default handle.`\n ), e = this.createHandle(r)), this.createCustomHandle || this.positionHandle(e, r), e.addEventListener(\"mousedown\", (t) => this.handleResizeStart(t, r)), e.addEventListener(\"touchstart\", (t) => this.handleResizeStart(t, r)), this.handleMap.set(r, e), this.wrapper.appendChild(e);\n });\n }\n /**\n * Removes all resize handles from the wrapper.\n *\n * Cleans up the handle map and removes each handle element from the DOM.\n */\n removeHandles() {\n this.handleMap.forEach((r) => r.remove()), this.handleMap.clear();\n }\n /**\n * Applies initial sizing from node attributes to the element.\n *\n * If width/height attributes exist on the node, they're applied to the element.\n * Otherwise, the element's natural/current dimensions are measured. The aspect\n * ratio is calculated for later use in aspect-ratio-preserving resizes.\n */\n applyInitialSize() {\n const r = this.node.attrs.width, e = this.node.attrs.height;\n r ? (this.element.style.width = `${r}px`, this.initialWidth = r) : this.initialWidth = this.element.offsetWidth, e ? (this.element.style.height = `${e}px`, this.initialHeight = e) : this.initialHeight = this.element.offsetHeight, this.initialWidth > 0 && this.initialHeight > 0 && (this.aspectRatio = this.initialWidth / this.initialHeight);\n }\n /**\n * Initiates a resize operation when a handle is clicked.\n *\n * Captures the starting mouse position and element dimensions, sets up\n * the resize state, adds the resizing class and state attribute, and\n * attaches document-level listeners for mouse movement and keyboard input.\n *\n * @param event - The mouse down event\n * @param direction - The direction of the handle being dragged\n */\n handleResizeStart(r, e) {\n r.preventDefault(), r.stopPropagation(), this.isResizing = !0, this.activeHandle = e, lw(r) ? (this.startX = r.touches[0].clientX, this.startY = r.touches[0].clientY) : (this.startX = r.clientX, this.startY = r.clientY), this.startWidth = this.element.offsetWidth, this.startHeight = this.element.offsetHeight, this.startWidth > 0 && this.startHeight > 0 && (this.aspectRatio = this.startWidth / this.startHeight), this.getPos(), this.container.dataset.resizeState = \"true\", this.classNames.resizing && this.container.classList.add(this.classNames.resizing), document.addEventListener(\"mousemove\", this.handleMouseMove), document.addEventListener(\"touchmove\", this.handleTouchMove), document.addEventListener(\"mouseup\", this.handleMouseUp), document.addEventListener(\"keydown\", this.handleKeyDown), document.addEventListener(\"keyup\", this.handleKeyUp);\n }\n handleResize(r, e) {\n if (!this.activeHandle)\n return;\n const t = this.preserveAspectRatio || this.isShiftKeyPressed, { width: n, height: s } = this.calculateNewDimensions(this.activeHandle, r, e), o = this.applyConstraints(n, s, t);\n this.element.style.width = `${o.width}px`, this.element.style.height = `${o.height}px`, this.onResize && this.onResize(o.width, o.height);\n }\n /**\n * Calculates new dimensions based on mouse delta and resize direction.\n *\n * Takes the starting dimensions and applies the mouse movement delta\n * according to the handle direction. For corner handles, both dimensions\n * are affected. For edge handles, only one dimension changes. If aspect\n * ratio should be preserved, delegates to applyAspectRatio.\n *\n * @param direction - The active resize handle direction\n * @param deltaX - Horizontal mouse movement since resize start\n * @param deltaY - Vertical mouse movement since resize start\n * @returns The calculated width and height\n */\n calculateNewDimensions(r, e, t) {\n let n = this.startWidth, s = this.startHeight;\n const o = r.includes(\"right\"), i = r.includes(\"left\"), a = r.includes(\"bottom\"), l = r.includes(\"top\");\n return o ? n = this.startWidth + e : i && (n = this.startWidth - e), a ? s = this.startHeight + t : l && (s = this.startHeight - t), (r === \"right\" || r === \"left\") && (n = this.startWidth + (o ? e : -e)), (r === \"top\" || r === \"bottom\") && (s = this.startHeight + (a ? t : -t)), this.preserveAspectRatio || this.isShiftKeyPressed ? this.applyAspectRatio(n, s, r) : { width: n, height: s };\n }\n /**\n * Applies min/max constraints to dimensions.\n *\n * When aspect ratio is NOT preserved, constraints are applied independently\n * to width and height. When aspect ratio IS preserved, constraints are\n * applied while maintaining the aspect ratio\u2014if one dimension hits a limit,\n * the other is recalculated proportionally.\n *\n * This ensures that aspect ratio is never broken when constrained.\n *\n * @param width - The unconstrained width\n * @param height - The unconstrained height\n * @param preserveAspectRatio - Whether to maintain aspect ratio while constraining\n * @returns The constrained dimensions\n */\n applyConstraints(r, e, t) {\n var n, s, o, i;\n if (!t) {\n let d = Math.max(this.minSize.width, r), u = Math.max(this.minSize.height, e);\n return (n = this.maxSize) != null && n.width && (d = Math.min(this.maxSize.width, d)), (s = this.maxSize) != null && s.height && (u = Math.min(this.maxSize.height, u)), { width: d, height: u };\n }\n let a = r, l = e;\n return a < this.minSize.width && (a = this.minSize.width, l = a / this.aspectRatio), l < this.minSize.height && (l = this.minSize.height, a = l * this.aspectRatio), (o = this.maxSize) != null && o.width && a > this.maxSize.width && (a = this.maxSize.width, l = a / this.aspectRatio), (i = this.maxSize) != null && i.height && l > this.maxSize.height && (l = this.maxSize.height, a = l * this.aspectRatio), { width: a, height: l };\n }\n /**\n * Adjusts dimensions to maintain the original aspect ratio.\n *\n * For horizontal handles (left/right), uses width as the primary dimension\n * and calculates height from it. For vertical handles (top/bottom), uses\n * height as primary and calculates width. For corner handles, uses width\n * as the primary dimension.\n *\n * @param width - The new width\n * @param height - The new height\n * @param direction - The active resize direction\n * @returns Dimensions adjusted to preserve aspect ratio\n */\n applyAspectRatio(r, e, t) {\n const n = t === \"left\" || t === \"right\", s = t === \"top\" || t === \"bottom\";\n return n ? {\n width: r,\n height: r / this.aspectRatio\n } : s ? {\n width: e * this.aspectRatio,\n height: e\n } : {\n width: r,\n height: r / this.aspectRatio\n };\n }\n}, dw = {};\nKc(dw, {\n createAtomBlockMarkdownSpec: () => uw,\n createBlockMarkdownSpec: () => fw,\n createInlineMarkdownSpec: () => mw,\n parseAttributes: () => td,\n parseIndentedBlocks: () => Jl,\n renderNestedMarkdownContent: () => nd,\n serializeAttributes: () => rd\n});\nfunction td(r) {\n if (!r?.trim())\n return {};\n const e = {}, t = [], n = r.replace(/[\"']([^\"']*)[\"']/g, (d) => (t.push(d), `__QUOTED_${t.length - 1}__`)), s = n.match(/(?:^|\\s)\\.([a-zA-Z][\\w-]*)/g);\n if (s) {\n const d = s.map((u) => u.trim().slice(1));\n e.class = d.join(\" \");\n }\n const o = n.match(/(?:^|\\s)#([a-zA-Z][\\w-]*)/);\n o && (e.id = o[1]);\n const i = /([a-zA-Z][\\w-]*)\\s*=\\s*(__QUOTED_\\d+__)/g;\n Array.from(n.matchAll(i)).forEach(([, d, u]) => {\n var f;\n const h = parseInt(((f = u.match(/__QUOTED_(\\d+)__/)) == null ? void 0 : f[1]) || \"0\", 10), p = t[h];\n p && (e[d] = p.slice(1, -1));\n });\n const l = n.replace(/(?:^|\\s)\\.([a-zA-Z][\\w-]*)/g, \"\").replace(/(?:^|\\s)#([a-zA-Z][\\w-]*)/g, \"\").replace(/([a-zA-Z][\\w-]*)\\s*=\\s*__QUOTED_\\d+__/g, \"\").trim();\n return l && l.split(/\\s+/).filter(Boolean).forEach((u) => {\n u.match(/^[a-zA-Z][\\w-]*$/) && (e[u] = !0);\n }), e;\n}\nfunction rd(r) {\n if (!r || Object.keys(r).length === 0)\n return \"\";\n const e = [];\n return r.class && String(r.class).split(/\\s+/).filter(Boolean).forEach((n) => e.push(`.${n}`)), r.id && e.push(`#${r.id}`), Object.entries(r).forEach(([t, n]) => {\n t === \"class\" || t === \"id\" || (n === !0 ? e.push(t) : n !== !1 && n != null && e.push(`${t}=\"${String(n)}\"`));\n }), e.join(\" \");\n}\nfunction uw(r) {\n const {\n nodeName: e,\n name: t,\n parseAttributes: n = td,\n serializeAttributes: s = rd,\n defaultAttributes: o = {},\n requiredAttributes: i = [],\n allowedAttributes: a\n } = r, l = t || e, d = (u) => {\n if (!a)\n return u;\n const f = {};\n return a.forEach((h) => {\n h in u && (f[h] = u[h]);\n }), f;\n };\n return {\n parseMarkdown: (u, f) => {\n const h = { ...o, ...u.attributes };\n return f.createNode(e, h, []);\n },\n markdownTokenizer: {\n name: e,\n level: \"block\",\n start(u) {\n var f;\n const h = new RegExp(`^:::${l}(?:\\\\s|$)`, \"m\"), p = (f = u.match(h)) == null ? void 0 : f.index;\n return p !== void 0 ? p : -1;\n },\n tokenize(u, f, h) {\n const p = new RegExp(`^:::${l}(?:\\\\s+\\\\{([^}]*)\\\\})?\\\\s*:::(?:\\\\n|$)`), g = u.match(p);\n if (!g)\n return;\n const b = g[1] || \"\", y = n(b);\n if (!i.find((E) => !(E in y)))\n return {\n type: e,\n raw: g[0],\n attributes: y\n };\n }\n },\n renderMarkdown: (u) => {\n const f = d(u.attrs || {}), h = s(f), p = h ? ` {${h}}` : \"\";\n return `:::${l}${p} :::`;\n }\n };\n}\nfunction fw(r) {\n const {\n nodeName: e,\n name: t,\n getContent: n,\n parseAttributes: s = td,\n serializeAttributes: o = rd,\n defaultAttributes: i = {},\n content: a = \"block\",\n allowedAttributes: l\n } = r, d = t || e, u = (f) => {\n if (!l)\n return f;\n const h = {};\n return l.forEach((p) => {\n p in f && (h[p] = f[p]);\n }), h;\n };\n return {\n parseMarkdown: (f, h) => {\n let p;\n if (n) {\n const b = n(f);\n p = typeof b == \"string\" ? [{ type: \"text\", text: b }] : b;\n } else a === \"block\" ? p = h.parseChildren(f.tokens || []) : p = h.parseInline(f.tokens || []);\n const g = { ...i, ...f.attributes };\n return h.createNode(e, g, p);\n },\n markdownTokenizer: {\n name: e,\n level: \"block\",\n start(f) {\n var h;\n const p = new RegExp(`^:::${d}`, \"m\"), g = (h = f.match(p)) == null ? void 0 : h.index;\n return g !== void 0 ? g : -1;\n },\n tokenize(f, h, p) {\n var g;\n const b = new RegExp(`^:::${d}(?:\\\\s+\\\\{([^}]*)\\\\})?\\\\s*\\\\n`), y = f.match(b);\n if (!y)\n return;\n const [C, E = \"\"] = y, R = s(E);\n let q = 1;\n const O = C.length;\n let M = \"\";\n const P = /^:::([\\w-]*)(\\s.*)?/gm, L = f.slice(O);\n for (P.lastIndex = 0; ; ) {\n const $ = P.exec(L);\n if ($ === null)\n break;\n const J = $.index, U = $[1];\n if (!((g = $[2]) != null && g.endsWith(\":::\"))) {\n if (U)\n q += 1;\n else if (q -= 1, q === 0) {\n const F = L.slice(0, J);\n M = F.trim();\n const z = f.slice(0, O + J + $[0].length);\n let _ = [];\n if (M)\n if (a === \"block\")\n for (_ = p.blockTokens(F), _.forEach((N) => {\n N.text && (!N.tokens || N.tokens.length === 0) && (N.tokens = p.inlineTokens(N.text));\n }); _.length > 0; ) {\n const N = _[_.length - 1];\n if (N.type === \"paragraph\" && (!N.text || N.text.trim() === \"\"))\n _.pop();\n else\n break;\n }\n else\n _ = p.inlineTokens(M);\n return {\n type: e,\n raw: z,\n attributes: R,\n content: M,\n tokens: _\n };\n }\n }\n }\n }\n },\n renderMarkdown: (f, h) => {\n const p = u(f.attrs || {}), g = o(p), b = g ? ` {${g}}` : \"\", y = h.renderChildren(f.content || [], `\n\n`);\n return `:::${d}${b}\n\n${y}\n\n:::`;\n }\n };\n}\nfunction pw(r) {\n if (!r.trim())\n return {};\n const e = {}, t = /(\\w+)=(?:\"([^\"]*)\"|'([^']*)')/g;\n let n = t.exec(r);\n for (; n !== null; ) {\n const [, s, o, i] = n;\n e[s] = o || i, n = t.exec(r);\n }\n return e;\n}\nfunction hw(r) {\n return Object.entries(r).filter(([, e]) => e != null).map(([e, t]) => `${e}=\"${t}\"`).join(\" \");\n}\nfunction mw(r) {\n const {\n nodeName: e,\n name: t,\n getContent: n,\n parseAttributes: s = pw,\n serializeAttributes: o = hw,\n defaultAttributes: i = {},\n selfClosing: a = !1,\n allowedAttributes: l\n } = r, d = t || e, u = (h) => {\n if (!l)\n return h;\n const p = {};\n return l.forEach((g) => {\n const b = typeof g == \"string\" ? g : g.name, y = typeof g == \"string\" ? void 0 : g.skipIfDefault;\n if (b in h) {\n const C = h[b];\n if (y !== void 0 && C === y)\n return;\n p[b] = C;\n }\n }), p;\n }, f = d.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n return {\n parseMarkdown: (h, p) => {\n const g = { ...i, ...h.attributes };\n if (a)\n return p.createNode(e, g);\n const b = n ? n(h) : h.content || \"\";\n return b ? p.createNode(e, g, [p.createTextNode(b)]) : p.createNode(e, g, []);\n },\n markdownTokenizer: {\n name: e,\n level: \"inline\",\n start(h) {\n const p = a ? new RegExp(`\\\\[${f}\\\\s*[^\\\\]]*\\\\]`) : new RegExp(`\\\\[${f}\\\\s*[^\\\\]]*\\\\][\\\\s\\\\S]*?\\\\[\\\\/${f}\\\\]`), g = h.match(p), b = g?.index;\n return b !== void 0 ? b : -1;\n },\n tokenize(h, p, g) {\n const b = a ? new RegExp(`^\\\\[${f}\\\\s*([^\\\\]]*)\\\\]`) : new RegExp(`^\\\\[${f}\\\\s*([^\\\\]]*)\\\\]([\\\\s\\\\S]*?)\\\\[\\\\/${f}\\\\]`), y = h.match(b);\n if (!y)\n return;\n let C = \"\", E = \"\";\n if (a) {\n const [, q] = y;\n E = q;\n } else {\n const [, q, O] = y;\n E = q, C = O || \"\";\n }\n const R = s(E.trim());\n return {\n type: e,\n raw: y[0],\n content: C.trim(),\n attributes: R\n };\n }\n },\n renderMarkdown: (h) => {\n let p = \"\";\n n ? p = n(h) : h.content && h.content.length > 0 && (p = h.content.filter((C) => C.type === \"text\").map((C) => C.text).join(\"\"));\n const g = u(h.attrs || {}), b = o(g), y = b ? ` ${b}` : \"\";\n return a ? `[${d}${y}]` : `[${d}${y}]${p}[/${d}]`;\n }\n };\n}\nfunction Jl(r, e, t) {\n var n, s, o, i;\n const a = r.split(`\n`), l = [];\n let d = \"\", u = 0;\n const f = e.baseIndentSize || 2;\n for (; u < a.length; ) {\n const h = a[u], p = h.match(e.itemPattern);\n if (!p) {\n if (l.length > 0)\n break;\n if (h.trim() === \"\") {\n u += 1, d = `${d}${h}\n`;\n continue;\n } else\n return;\n }\n const g = e.extractItemData(p), { indentLevel: b, mainContent: y } = g;\n d = `${d}${h}\n`;\n const C = [y];\n for (u += 1; u < a.length; ) {\n const O = a[u];\n if (O.trim() === \"\") {\n const P = a.slice(u + 1).findIndex((J) => J.trim() !== \"\");\n if (P === -1)\n break;\n if ((((s = (n = a[u + 1 + P].match(/^(\\s*)/)) == null ? void 0 : n[1]) == null ? void 0 : s.length) || 0) > b) {\n C.push(O), d = `${d}${O}\n`, u += 1;\n continue;\n } else\n break;\n }\n if ((((i = (o = O.match(/^(\\s*)/)) == null ? void 0 : o[1]) == null ? void 0 : i.length) || 0) > b)\n C.push(O), d = `${d}${O}\n`, u += 1;\n else\n break;\n }\n let E;\n const R = C.slice(1);\n if (R.length > 0) {\n const O = R.map((M) => M.slice(b + f)).join(`\n`);\n O.trim() && (e.customNestedParser ? E = e.customNestedParser(O) : E = t.blockTokens(O));\n }\n const q = e.createToken(g, E);\n l.push(q);\n }\n if (l.length !== 0)\n return {\n items: l,\n raw: d\n };\n}\nfunction nd(r, e, t, n) {\n if (!r || !Array.isArray(r.content))\n return \"\";\n const s = typeof t == \"function\" ? t(n) : t, [o, ...i] = r.content, a = e.renderChildren([o]);\n let l = `${s}${a}`;\n return i && i.length > 0 && i.forEach((d, u) => {\n var f, h;\n const p = (h = (f = e.renderChild) == null ? void 0 : f.call(e, d, u + 1)) != null ? h : e.renderChildren([d]);\n if (p != null) {\n const g = p.split(`\n`).map((b) => b ? e.indent(b) : e.indent(\"\")).join(`\n`);\n l += d.type === \"paragraph\" ? `\n\n${g}` : `\n${g}`;\n }\n }), l;\n}\nfunction vw(r, e, t = {}) {\n const { state: n } = e, { doc: s, tr: o } = n, i = r;\n s.descendants((a, l) => {\n const d = o.mapping.map(l), u = o.mapping.map(l) + a.nodeSize;\n let f = null;\n if (a.marks.forEach((p) => {\n if (p !== i)\n return !1;\n f = p;\n }), !f)\n return;\n let h = !1;\n if (Object.keys(t).forEach((p) => {\n t[p] !== f.attrs[p] && (h = !0);\n }), h) {\n const p = r.type.create({\n ...r.attrs,\n ...t\n });\n o.removeMark(d, u, r.type), o.addMark(d, u, p);\n }\n }), o.docChanged && e.view.dispatch(o);\n}\nvar Tn = class Kh extends ed {\n constructor() {\n super(...arguments), this.type = \"node\";\n }\n /**\n * Create a new Node instance\n * @param config - Node configuration object or a function that returns a configuration object\n */\n static create(e = {}) {\n const t = typeof e == \"function\" ? e() : e;\n return new Kh(t);\n }\n configure(e) {\n return super.configure(e);\n }\n extend(e) {\n const t = typeof e == \"function\" ? e() : e;\n return super.extend(t);\n }\n};\nfunction Wo(r) {\n return new Xx({\n find: r.find,\n handler: ({ state: e, range: t, match: n, pasteEvent: s }) => {\n const o = Wt(r.getAttributes, void 0, n, s);\n if (o === !1 || o === null)\n return null;\n const { tr: i } = e, a = n[n.length - 1], l = n[0];\n let d = t.to;\n if (a) {\n const u = l.search(/\\S/), f = t.from + l.indexOf(a), h = f + a.length;\n if (Zc(t.from, t.to, e.doc).filter((b) => b.mark.type.excluded.find((C) => C === r.type && C !== b.mark.type)).filter((b) => b.to > f).length)\n return null;\n h < t.to && i.delete(h, t.to), f > t.from && i.delete(t.from + u, f), d = t.from + u + a.length, i.addMark(t.from + u, d, r.type.create(o || {})), n.index !== void 0 && n.input !== void 0 && n.index + n[0].length >= n.input.length || i.removeStoredMark(r.type);\n }\n }\n });\n}\nvar gw = Tn.create({\n name: \"doc\",\n topNode: !0,\n content: \"block+\",\n renderMarkdown: (r, e) => r.content ? e.renderChildren(r.content, `\n\n`) : \"\"\n}), Kl = gw, mi = \" \", hl = \"\u00A0\", bw = Tn.create({\n name: \"paragraph\",\n priority: 1e3,\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n group: \"block\",\n content: \"inline*\",\n parseHTML() {\n return [{ tag: \"p\" }];\n },\n renderHTML({ HTMLAttributes: r }) {\n return [\"p\", Ur(this.options.HTMLAttributes, r), 0];\n },\n parseMarkdown: (r, e) => {\n const t = r.tokens || [];\n if (t.length === 1 && t[0].type === \"image\")\n return e.parseChildren([t[0]]);\n const n = e.parseInline(t);\n return t.length === 1 && t[0].type === \"text\" && (t[0].raw === mi || t[0].text === mi || t[0].raw === hl || t[0].text === hl) && n.length === 1 && n[0].type === \"text\" && (n[0].text === mi || n[0].text === hl) ? e.createNode(\"paragraph\", void 0, []) : e.createNode(\"paragraph\", void 0, n);\n },\n renderMarkdown: (r, e, t) => {\n var n, s;\n if (!r)\n return \"\";\n const o = Array.isArray(r.content) ? r.content : [];\n if (o.length === 0) {\n const i = Array.isArray((n = t?.previousNode) == null ? void 0 : n.content) ? t.previousNode.content : [];\n return ((s = t?.previousNode) == null ? void 0 : s.type) === \"paragraph\" && i.length === 0 ? mi : \"\";\n }\n return e.renderChildren(o);\n },\n addCommands() {\n return {\n setParagraph: () => ({ commands: r }) => r.setNode(this.name)\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Alt-0\": () => this.editor.commands.setParagraph()\n };\n }\n}), Gl = bw, yw = Tn.create({\n name: \"text\",\n group: \"inline\",\n parseMarkdown: (r) => ({\n type: \"text\",\n text: r.text || \"\"\n }),\n renderMarkdown: (r) => r.text || \"\"\n}), Yl = yw, xw = Tn.create({\n name: \"heading\",\n addOptions() {\n return {\n levels: [1, 2, 3, 4, 5, 6],\n HTMLAttributes: {}\n };\n },\n content: \"inline*\",\n group: \"block\",\n defining: !0,\n addAttributes() {\n return {\n level: {\n default: 1,\n rendered: !1\n }\n };\n },\n parseHTML() {\n return this.options.levels.map((r) => ({\n tag: `h${r}`,\n attrs: { level: r }\n }));\n },\n renderHTML({ node: r, HTMLAttributes: e }) {\n return [`h${this.options.levels.includes(r.attrs.level) ? r.attrs.level : this.options.levels[0]}`, Ur(this.options.HTMLAttributes, e), 0];\n },\n parseMarkdown: (r, e) => e.createNode(\"heading\", { level: r.depth || 1 }, e.parseInline(r.tokens || [])),\n renderMarkdown: (r, e) => {\n var t;\n const n = (t = r.attrs) != null && t.level ? parseInt(r.attrs.level, 10) : 1, s = \"#\".repeat(n);\n return r.content ? `${s} ${e.renderChildren(r.content)}` : \"\";\n },\n addCommands() {\n return {\n setHeading: (r) => ({ commands: e }) => this.options.levels.includes(r.level) ? e.setNode(this.name, r) : !1,\n toggleHeading: (r) => ({ commands: e }) => this.options.levels.includes(r.level) ? e.toggleNode(this.name, \"paragraph\", r) : !1\n };\n },\n addKeyboardShortcuts() {\n return this.options.levels.reduce(\n (r, e) => ({\n ...r,\n [`Mod-Alt-${e}`]: () => this.editor.commands.toggleHeading({ level: e })\n }),\n {}\n );\n },\n addInputRules() {\n return this.options.levels.map((r) => aw({\n find: new RegExp(`^(#{${Math.min(...this.options.levels)},${r}})\\\\s$`),\n type: this.type,\n getAttributes: {\n level: r\n }\n }));\n }\n}), Gh = xw, ww = Object.defineProperty, kw = (r, e) => {\n for (var t in e)\n ww(r, t, { get: e[t], enumerable: !0 });\n}, Cw = \"listItem\", Ku = \"textStyle\", Gu = /^\\s*([-+*])\\s$/, Yh = Tn.create({\n name: \"bulletList\",\n addOptions() {\n return {\n itemTypeName: \"listItem\",\n HTMLAttributes: {},\n keepMarks: !1,\n keepAttributes: !1\n };\n },\n group: \"block list\",\n content() {\n return `${this.options.itemTypeName}+`;\n },\n parseHTML() {\n return [{ tag: \"ul\" }];\n },\n renderHTML({ HTMLAttributes: r }) {\n return [\"ul\", Ur(this.options.HTMLAttributes, r), 0];\n },\n markdownTokenName: \"list\",\n parseMarkdown: (r, e) => r.type !== \"list\" || r.ordered ? [] : {\n type: \"bulletList\",\n content: r.items ? e.parseChildren(r.items) : []\n },\n renderMarkdown: (r, e) => r.content ? e.renderChildren(r.content, `\n`) : \"\",\n markdownOptions: {\n indentsContent: !0\n },\n addCommands() {\n return {\n toggleBulletList: () => ({ commands: r, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Cw, this.editor.getAttributes(Ku)).run() : r.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Shift-8\": () => this.editor.commands.toggleBulletList()\n };\n },\n addInputRules() {\n let r = Vo({\n find: Gu,\n type: this.type\n });\n return (this.options.keepMarks || this.options.keepAttributes) && (r = Vo({\n find: Gu,\n type: this.type,\n keepMarks: this.options.keepMarks,\n keepAttributes: this.options.keepAttributes,\n getAttributes: () => this.editor.getAttributes(Ku),\n editor: this.editor\n })), [r];\n }\n});\nfunction _w(r) {\n var e, t;\n const n = (e = r.tokens) == null ? void 0 : e[0];\n return !!(r.text && ((t = r.tokens) == null ? void 0 : t.length) === 1 && n?.type === \"list\" && n.ordered && n.raw === r.text);\n}\nfunction Sw(r, e) {\n return e.tokenizeInline ? e.parseInline(e.tokenizeInline(r)) : e.parseInline([\n {\n type: \"text\",\n raw: r,\n text: r\n }\n ]);\n}\nvar Xh = Tn.create({\n name: \"listItem\",\n addOptions() {\n return {\n HTMLAttributes: {},\n bulletListTypeName: \"bulletList\",\n orderedListTypeName: \"orderedList\"\n };\n },\n content: \"paragraph block*\",\n defining: !0,\n parseHTML() {\n return [\n {\n tag: \"li\"\n }\n ];\n },\n renderHTML({ HTMLAttributes: r }) {\n return [\"li\", Ur(this.options.HTMLAttributes, r), 0];\n },\n markdownTokenName: \"list_item\",\n parseMarkdown: (r, e) => {\n var t;\n if (r.type !== \"list_item\")\n return [];\n const n = (t = e.parseBlockChildren) != null ? t : e.parseChildren;\n let s = [];\n if (r.tokens && r.tokens.length > 0) {\n if (_w(r))\n return {\n type: \"listItem\",\n content: [\n {\n type: \"paragraph\",\n content: Sw(r.text || \"\", e)\n }\n ]\n };\n if (r.tokens.some((i) => i.type === \"paragraph\"))\n s = n(r.tokens);\n else {\n const i = r.tokens[0];\n if (i && i.type === \"text\" && i.tokens && i.tokens.length > 0) {\n if (s = [\n {\n type: \"paragraph\",\n content: e.parseInline(i.tokens)\n }\n ], r.tokens.length > 1) {\n const l = r.tokens.slice(1), d = n(l);\n s.push(...d);\n }\n } else\n s = n(r.tokens);\n }\n }\n return s.length === 0 && (s = [\n {\n type: \"paragraph\",\n content: []\n }\n ]), {\n type: \"listItem\",\n content: s\n };\n },\n renderMarkdown: (r, e, t) => nd(\n r,\n e,\n (n) => {\n var s, o;\n return n.parentType === \"bulletList\" ? \"- \" : n.parentType === \"orderedList\" ? `${(((o = (s = n.meta) == null ? void 0 : s.parentAttrs) == null ? void 0 : o.start) || 1) + n.index}. ` : \"- \";\n },\n t\n ),\n addKeyboardShortcuts() {\n return {\n Enter: () => this.editor.commands.splitListItem(this.name),\n Tab: () => this.editor.commands.sinkListItem(this.name),\n \"Shift-Tab\": () => this.editor.commands.liftListItem(this.name)\n };\n }\n}), Ew = {};\nkw(Ew, {\n findListItemPos: () => ri,\n getNextListDepth: () => sd,\n handleBackspace: () => Xl,\n handleDelete: () => Ql,\n hasListBefore: () => Qh,\n hasListItemAfter: () => Tw,\n hasListItemBefore: () => Zh,\n listItemHasSubList: () => em,\n nextListIsDeeper: () => tm,\n nextListIsHigher: () => rm\n});\nvar ri = (r, e) => {\n const { $from: t } = e.selection, n = _r(r, e.schema);\n let s = null, o = t.depth, i = t.pos, a = null;\n for (; o > 0 && a === null; )\n s = t.node(o), s.type === n ? a = o : (o -= 1, i -= 1);\n return a === null ? null : { $pos: e.doc.resolve(i), depth: a };\n}, sd = (r, e) => {\n const t = ri(r, e);\n if (!t)\n return !1;\n const [, n] = vx(e, r, t.$pos.pos + 4);\n return n;\n}, Qh = (r, e, t) => {\n const { $anchor: n } = r.selection, s = Math.max(0, n.pos - 2), o = r.doc.resolve(s).node();\n return !(!o || !t.includes(o.type.name));\n}, Zh = (r, e) => {\n var t;\n const { $anchor: n } = e.selection, s = e.doc.resolve(n.pos - 2);\n return !(s.index() === 0 || ((t = s.nodeBefore) == null ? void 0 : t.type.name) !== r);\n}, em = (r, e, t) => {\n if (!t)\n return !1;\n const n = _r(r, e.schema);\n let s = !1;\n return t.descendants((o) => {\n o.type === n && (s = !0);\n }), s;\n}, Xl = (r, e, t) => {\n if (r.commands.undoInputRule())\n return !0;\n if (r.state.selection.from !== r.state.selection.to)\n return !1;\n if (!ls(r.state, e) && Qh(r.state, e, t)) {\n const { $anchor: a } = r.state.selection, l = r.state.doc.resolve(a.before() - 1), d = [];\n l.node().descendants((h, p) => {\n h.type.name === e && d.push({ node: h, pos: p });\n });\n const u = d.at(-1);\n if (!u)\n return !1;\n const f = r.state.doc.resolve(l.start() + u.pos + 1);\n return r.chain().cut({ from: a.start() - 1, to: a.end() + 1 }, f.end()).joinForward().run();\n }\n if (!ls(r.state, e) || !xx(r.state))\n return !1;\n const n = ri(e, r.state);\n if (!n)\n return !1;\n const o = r.state.doc.resolve(n.$pos.pos - 2).node(n.depth), i = em(e, r.state, o);\n return Zh(e, r.state) && !i ? r.commands.joinItemBackward() : r.chain().liftListItem(e).run();\n}, tm = (r, e) => {\n const t = sd(r, e), n = ri(r, e);\n return !n || !t ? !1 : t > n.depth;\n}, rm = (r, e) => {\n const t = sd(r, e), n = ri(r, e);\n return !n || !t ? !1 : t < n.depth;\n}, Ql = (r, e) => {\n if (!ls(r.state, e) || !yx(r.state, e))\n return !1;\n const { selection: t } = r.state, { $from: n, $to: s } = t;\n return !t.empty && n.sameParent(s) ? !1 : tm(e, r.state) ? r.chain().focus(r.state.selection.from + 4).lift(e).joinBackward().run() : rm(e, r.state) ? r.chain().joinForward().joinBackward().run() : r.commands.joinItemForward();\n}, Tw = (r, e) => {\n var t;\n const { $anchor: n } = e.selection, s = e.doc.resolve(n.pos - n.parentOffset - 2);\n return !(s.index() === s.parent.childCount - 1 || ((t = s.nodeAfter) == null ? void 0 : t.type.name) !== r);\n}, Mw = yr.create({\n name: \"listKeymap\",\n addOptions() {\n return {\n listTypes: [\n {\n itemName: \"listItem\",\n wrapperNames: [\"bulletList\", \"orderedList\"]\n },\n {\n itemName: \"taskItem\",\n wrapperNames: [\"taskList\"]\n }\n ]\n };\n },\n addKeyboardShortcuts() {\n return {\n Delete: ({ editor: r }) => {\n let e = !1;\n return this.options.listTypes.forEach(({ itemName: t }) => {\n r.state.schema.nodes[t] !== void 0 && Ql(r, t) && (e = !0);\n }), e;\n },\n \"Mod-Delete\": ({ editor: r }) => {\n let e = !1;\n return this.options.listTypes.forEach(({ itemName: t }) => {\n r.state.schema.nodes[t] !== void 0 && Ql(r, t) && (e = !0);\n }), e;\n },\n Backspace: ({ editor: r }) => {\n let e = !1;\n return this.options.listTypes.forEach(({ itemName: t, wrapperNames: n }) => {\n r.state.schema.nodes[t] !== void 0 && Xl(r, t, n) && (e = !0);\n }), e;\n },\n \"Mod-Backspace\": ({ editor: r }) => {\n let e = !1;\n return this.options.listTypes.forEach(({ itemName: t, wrapperNames: n }) => {\n r.state.schema.nodes[t] !== void 0 && Xl(r, t, n) && (e = !0);\n }), e;\n }\n };\n }\n}), Yu = /^(\\s*)(\\d+)\\.\\s+(.*)$/, Aw = /^\\s/;\nfunction Pw(r) {\n const e = r.trimStart();\n return /^[-+*]\\s+/.test(e) || /^\\d+\\.\\s+/.test(e) || /^>\\s?/.test(e) || /^```/.test(e) || /^~~~/.test(e);\n}\nfunction Nw(r) {\n const e = [], t = [];\n let n = !1;\n return r.forEach((s) => {\n if (n) {\n t.push(s);\n return;\n }\n if (s.trim() === \"\") {\n n = !0, t.push(s);\n return;\n }\n if (e.length > 0 && Pw(s)) {\n n = !0, t.push(s);\n return;\n }\n e.push(s);\n }), {\n paragraphLines: e,\n blockLines: t\n };\n}\nfunction Ow(r) {\n const e = [];\n let t = 0, n = 0;\n for (; t < r.length; ) {\n const s = r[t], o = s.match(Yu);\n if (!o)\n break;\n const [, i, a, l] = o, d = i.length, u = [l];\n let f = t + 1;\n const h = [s];\n let p = !1;\n for (; f < r.length; ) {\n const g = r[f];\n if (g.match(Yu))\n break;\n if (g.trim() === \"\")\n h.push(g), u.push(\"\"), p = !0, f += 1;\n else if (g.match(Aw))\n h.push(g), u.push(g.slice(d + 2)), f += 1;\n else {\n if (p)\n break;\n h.push(g), u.push(g), f += 1;\n }\n }\n e.push({\n indent: d,\n number: parseInt(a, 10),\n content: u.join(`\n`).trim(),\n contentLines: u,\n raw: h.join(`\n`)\n }), n = f, t = f;\n }\n return [e, n];\n}\nfunction nm(r, e, t) {\n const n = [];\n let s = 0;\n for (; s < r.length; ) {\n const o = r[s];\n if (o.indent === e) {\n const { paragraphLines: i, blockLines: a } = Nw(o.contentLines), l = i.join(`\n`).trim(), d = [];\n l && d.push({\n type: \"paragraph\",\n raw: l,\n tokens: t.inlineTokens(l)\n });\n const u = a.join(`\n`).trim();\n if (u) {\n const p = t.blockTokens(u);\n d.push(...p);\n }\n let f = s + 1;\n const h = [];\n for (; f < r.length && r[f].indent > e; )\n h.push(r[f]), f += 1;\n if (h.length > 0) {\n const p = Math.min(...h.map((b) => b.indent)), g = nm(h, p, t);\n d.push({\n type: \"list\",\n ordered: !0,\n start: h[0].number,\n items: g,\n raw: h.map((b) => b.raw).join(`\n`)\n });\n }\n n.push({\n type: \"list_item\",\n raw: o.raw,\n tokens: d\n }), s = f;\n } else\n s += 1;\n }\n return n;\n}\nfunction $w(r, e) {\n return r.map((t) => {\n if (t.type !== \"list_item\")\n return e.parseChildren([t])[0];\n const n = [];\n return t.tokens && t.tokens.length > 0 && t.tokens.forEach((s) => {\n if (s.type === \"paragraph\" || s.type === \"list\" || s.type === \"blockquote\" || s.type === \"code\")\n n.push(...e.parseChildren([s]));\n else if (s.type === \"text\" && s.tokens) {\n const o = e.parseChildren([s]);\n n.push({\n type: \"paragraph\",\n content: o\n });\n } else {\n const o = e.parseChildren([s]);\n o.length > 0 && n.push(...o);\n }\n }), {\n type: \"listItem\",\n content: n\n };\n });\n}\nvar Iw = \"listItem\", Xu = \"textStyle\", Qu = /^(\\d+)\\.\\s$/, sm = Tn.create({\n name: \"orderedList\",\n addOptions() {\n return {\n itemTypeName: \"listItem\",\n HTMLAttributes: {},\n keepMarks: !1,\n keepAttributes: !1\n };\n },\n group: \"block list\",\n content() {\n return `${this.options.itemTypeName}+`;\n },\n addAttributes() {\n return {\n start: {\n default: 1,\n parseHTML: (r) => r.hasAttribute(\"start\") ? parseInt(r.getAttribute(\"start\") || \"\", 10) : 1\n },\n type: {\n default: null,\n parseHTML: (r) => r.getAttribute(\"type\")\n }\n };\n },\n parseHTML() {\n return [\n {\n tag: \"ol\"\n }\n ];\n },\n renderHTML({ HTMLAttributes: r }) {\n const { start: e, ...t } = r;\n return e === 1 ? [\"ol\", Ur(this.options.HTMLAttributes, t), 0] : [\"ol\", Ur(this.options.HTMLAttributes, r), 0];\n },\n markdownTokenName: \"list\",\n parseMarkdown: (r, e) => {\n if (r.type !== \"list\" || !r.ordered)\n return [];\n const t = r.start || 1, n = r.items ? $w(r.items, e) : [];\n return t !== 1 ? {\n type: \"orderedList\",\n attrs: { start: t },\n content: n\n } : {\n type: \"orderedList\",\n content: n\n };\n },\n renderMarkdown: (r, e) => r.content ? e.renderChildren(r.content, `\n`) : \"\",\n markdownTokenizer: {\n name: \"orderedList\",\n level: \"block\",\n start: (r) => {\n const e = r.match(/^(\\s*)(\\d+)\\.\\s+/), t = e?.index;\n return t !== void 0 ? t : -1;\n },\n tokenize: (r, e, t) => {\n var n;\n const s = r.split(`\n`), [o, i] = Ow(s);\n if (o.length === 0)\n return;\n const a = nm(o, 0, t);\n return a.length === 0 ? void 0 : {\n type: \"list\",\n ordered: !0,\n start: ((n = o[0]) == null ? void 0 : n.number) || 1,\n items: a,\n raw: s.slice(0, i).join(`\n`)\n };\n }\n },\n markdownOptions: {\n indentsContent: !0\n },\n addCommands() {\n return {\n toggleOrderedList: () => ({ commands: r, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Iw, this.editor.getAttributes(Xu)).run() : r.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Shift-7\": () => this.editor.commands.toggleOrderedList()\n };\n },\n addInputRules() {\n let r = Vo({\n find: Qu,\n type: this.type,\n getAttributes: (e) => ({ start: +e[1] }),\n joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]\n });\n return (this.options.keepMarks || this.options.keepAttributes) && (r = Vo({\n find: Qu,\n type: this.type,\n keepMarks: this.options.keepMarks,\n keepAttributes: this.options.keepAttributes,\n getAttributes: (e) => ({ start: +e[1], ...this.editor.getAttributes(Xu) }),\n joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1],\n editor: this.editor\n })), [r];\n }\n}), zw = /^\\s*(\\[([( |x])?\\])\\s$/, Rw = Tn.create({\n name: \"taskItem\",\n addOptions() {\n return {\n nested: !1,\n HTMLAttributes: {},\n taskListTypeName: \"taskList\",\n a11y: void 0\n };\n },\n content() {\n return this.options.nested ? \"paragraph block*\" : \"paragraph+\";\n },\n defining: !0,\n addAttributes() {\n return {\n checked: {\n default: !1,\n keepOnSplit: !1,\n parseHTML: (r) => {\n const e = r.getAttribute(\"data-checked\");\n return e === \"\" || e === \"true\";\n },\n renderHTML: (r) => ({\n \"data-checked\": r.checked\n })\n }\n };\n },\n parseHTML() {\n return [\n {\n tag: `li[data-type=\"${this.name}\"]`,\n priority: 51\n }\n ];\n },\n renderHTML({ node: r, HTMLAttributes: e }) {\n return [\n \"li\",\n Ur(this.options.HTMLAttributes, e, {\n \"data-type\": this.name\n }),\n [\n \"label\",\n [\n \"input\",\n {\n type: \"checkbox\",\n checked: r.attrs.checked ? \"checked\" : null\n }\n ],\n [\"span\"]\n ],\n [\"div\", 0]\n ];\n },\n parseMarkdown: (r, e) => {\n const t = [];\n if (r.tokens && r.tokens.length > 0 ? t.push(e.createNode(\"paragraph\", {}, e.parseInline(r.tokens))) : r.text ? t.push(e.createNode(\"paragraph\", {}, [e.createNode(\"text\", { text: r.text })])) : t.push(e.createNode(\"paragraph\", {}, [])), r.nestedTokens && r.nestedTokens.length > 0) {\n const n = e.parseChildren(r.nestedTokens);\n t.push(...n);\n }\n return e.createNode(\"taskItem\", { checked: r.checked || !1 }, t);\n },\n renderMarkdown: (r, e) => {\n var t;\n const s = `- [${(t = r.attrs) != null && t.checked ? \"x\" : \" \"}] `;\n return nd(r, e, s);\n },\n addKeyboardShortcuts() {\n const r = {\n Enter: () => this.editor.commands.splitListItem(this.name),\n \"Shift-Tab\": () => this.editor.commands.liftListItem(this.name)\n };\n return this.options.nested ? {\n ...r,\n Tab: () => this.editor.commands.sinkListItem(this.name)\n } : r;\n },\n addNodeView() {\n return ({ node: r, HTMLAttributes: e, getPos: t, editor: n }) => {\n const s = document.createElement(\"li\"), o = document.createElement(\"label\"), i = document.createElement(\"span\"), a = document.createElement(\"input\"), l = document.createElement(\"div\"), d = (f) => {\n var h, p;\n a.ariaLabel = ((p = (h = this.options.a11y) == null ? void 0 : h.checkboxLabel) == null ? void 0 : p.call(h, f, a.checked)) || `Task item checkbox for ${f.textContent || \"empty task item\"}`;\n };\n d(r), o.contentEditable = \"false\", a.type = \"checkbox\", a.addEventListener(\"mousedown\", (f) => f.preventDefault()), a.addEventListener(\"change\", (f) => {\n if (!n.isEditable && !this.options.onReadOnlyChecked) {\n a.checked = !a.checked;\n return;\n }\n const { checked: h } = f.target;\n n.isEditable && typeof t == \"function\" && n.chain().focus(void 0, { scrollIntoView: !1 }).command(({ tr: p }) => {\n const g = t();\n if (typeof g != \"number\")\n return !1;\n const b = p.doc.nodeAt(g);\n return p.setNodeMarkup(g, void 0, {\n ...b?.attrs,\n checked: h\n }), !0;\n }).run(), !n.isEditable && this.options.onReadOnlyChecked && (this.options.onReadOnlyChecked(r, h) || (a.checked = !a.checked));\n }), Object.entries(this.options.HTMLAttributes).forEach(([f, h]) => {\n s.setAttribute(f, h);\n }), s.dataset.checked = r.attrs.checked, a.checked = r.attrs.checked, o.append(a, i), s.append(o, l), Object.entries(e).forEach(([f, h]) => {\n s.setAttribute(f, h);\n });\n let u = new Set(Object.keys(e));\n return {\n dom: s,\n contentDOM: l,\n update: (f) => {\n if (f.type !== this.type)\n return !1;\n s.dataset.checked = f.attrs.checked, a.checked = f.attrs.checked, d(f);\n const h = n.extensionManager.attributes, p = qo(f, h), g = new Set(Object.keys(p)), b = this.options.HTMLAttributes;\n return u.forEach((y) => {\n g.has(y) || (y in b ? s.setAttribute(y, b[y]) : s.removeAttribute(y));\n }), Object.entries(p).forEach(([y, C]) => {\n C == null ? y in b ? s.setAttribute(y, b[y]) : s.removeAttribute(y) : s.setAttribute(y, C);\n }), u = g, !0;\n }\n };\n };\n },\n addInputRules() {\n return [\n Vo({\n find: zw,\n type: this.type,\n getAttributes: (r) => ({\n checked: r[r.length - 1] === \"x\"\n })\n })\n ];\n }\n}), jw = Tn.create({\n name: \"taskList\",\n addOptions() {\n return {\n itemTypeName: \"taskItem\",\n HTMLAttributes: {}\n };\n },\n group: \"block list\",\n content() {\n return `${this.options.itemTypeName}+`;\n },\n parseHTML() {\n return [\n {\n tag: `ul[data-type=\"${this.name}\"]`,\n priority: 51\n }\n ];\n },\n renderHTML({ HTMLAttributes: r }) {\n return [\"ul\", Ur(this.options.HTMLAttributes, r, { \"data-type\": this.name }), 0];\n },\n parseMarkdown: (r, e) => e.createNode(\"taskList\", {}, e.parseChildren(r.items || [])),\n renderMarkdown: (r, e) => r.content ? e.renderChildren(r.content, `\n`) : \"\",\n markdownTokenizer: {\n name: \"taskList\",\n level: \"block\",\n start(r) {\n var e;\n const t = (e = r.match(/^\\s*[-+*]\\s+\\[([ xX])\\]\\s+/)) == null ? void 0 : e.index;\n return t !== void 0 ? t : -1;\n },\n tokenize(r, e, t) {\n const n = (o) => {\n const i = Jl(\n o,\n {\n itemPattern: /^(\\s*)([-+*])\\s+\\[([ xX])\\]\\s+(.*)$/,\n extractItemData: (a) => ({\n indentLevel: a[1].length,\n mainContent: a[4],\n checked: a[3].toLowerCase() === \"x\"\n }),\n createToken: (a, l) => ({\n type: \"taskItem\",\n raw: \"\",\n mainContent: a.mainContent,\n indentLevel: a.indentLevel,\n checked: a.checked,\n text: a.mainContent,\n tokens: t.inlineTokens(a.mainContent),\n nestedTokens: l\n }),\n // Allow recursive nesting\n customNestedParser: n\n },\n t\n );\n return i ? [\n {\n type: \"taskList\",\n raw: i.raw,\n items: i.items\n }\n ] : t.blockTokens(o);\n }, s = Jl(\n r,\n {\n itemPattern: /^(\\s*)([-+*])\\s+\\[([ xX])\\]\\s+(.*)$/,\n extractItemData: (o) => ({\n indentLevel: o[1].length,\n mainContent: o[4],\n checked: o[3].toLowerCase() === \"x\"\n }),\n createToken: (o, i) => ({\n type: \"taskItem\",\n raw: \"\",\n mainContent: o.mainContent,\n indentLevel: o.indentLevel,\n checked: o.checked,\n text: o.mainContent,\n tokens: t.inlineTokens(o.mainContent),\n nestedTokens: i\n }),\n // Use the recursive parser for nested content\n customNestedParser: n\n },\n t\n );\n if (s)\n return {\n type: \"taskList\",\n raw: s.raw,\n items: s.items\n };\n }\n },\n markdownOptions: {\n indentsContent: !0\n },\n addCommands() {\n return {\n toggleTaskList: () => ({ commands: r }) => r.toggleList(this.name, this.options.itemTypeName)\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Shift-9\": () => this.editor.commands.toggleTaskList()\n };\n }\n});\nyr.create({\n name: \"listKit\",\n addExtensions() {\n const r = [];\n return this.options.bulletList !== !1 && r.push(Yh.configure(this.options.bulletList)), this.options.listItem !== !1 && r.push(Xh.configure(this.options.listItem)), this.options.listKeymap !== !1 && r.push(Mw.configure(this.options.listKeymap)), this.options.orderedList !== !1 && r.push(sm.configure(this.options.orderedList)), this.options.taskItem !== !1 && r.push(Rw.configure(this.options.taskItem)), this.options.taskList !== !1 && r.push(jw.configure(this.options.taskList)), r;\n }\n});\nvar om = Xh, im = Yh, am = sm;\nconst Lw = \"aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\u00F6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2\", Dw = \"\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2\", Zl = \"numeric\", ec = \"ascii\", tc = \"alpha\", Eo = \"asciinumeric\", go = \"alphanumeric\", rc = \"domain\", lm = \"emoji\", Fw = \"scheme\", Bw = \"slashscheme\", ml = \"whitespace\";\nfunction Hw(r, e) {\n return r in e || (e[r] = []), e[r];\n}\nfunction Cs(r, e, t) {\n e[Zl] && (e[Eo] = !0, e[go] = !0), e[ec] && (e[Eo] = !0, e[tc] = !0), e[Eo] && (e[go] = !0), e[tc] && (e[go] = !0), e[go] && (e[rc] = !0), e[lm] && (e[rc] = !0);\n for (const n in e) {\n const s = Hw(n, t);\n s.indexOf(r) < 0 && s.push(r);\n }\n}\nfunction qw(r, e) {\n const t = {};\n for (const n in e)\n e[n].indexOf(r) >= 0 && (t[n] = !0);\n return t;\n}\nfunction Jr(r = null) {\n this.j = {}, this.jr = [], this.jd = null, this.t = r;\n}\nJr.groups = {};\nJr.prototype = {\n accepts() {\n return !!this.t;\n },\n /**\n * Follow an existing transition from the given input to the next state.\n * Does not mutate.\n * @param {string} input character or token type to transition on\n * @returns {?State<T>} the next state, if any\n */\n go(r) {\n const e = this, t = e.j[r];\n if (t)\n return t;\n for (let n = 0; n < e.jr.length; n++) {\n const s = e.jr[n][0], o = e.jr[n][1];\n if (o && s.test(r))\n return o;\n }\n return e.jd;\n },\n /**\n * Whether the state has a transition for the given input. Set the second\n * argument to true to only look for an exact match (and not a default or\n * regular-expression-based transition)\n * @param {string} input\n * @param {boolean} exactOnly\n */\n has(r, e = !1) {\n return e ? r in this.j : !!this.go(r);\n },\n /**\n * Short for \"transition all\"; create a transition from the array of items\n * in the given list to the same final resulting state.\n * @param {string | string[]} inputs Group of inputs to transition on\n * @param {Transition<T> | State<T>} [next] Transition options\n * @param {Flags} [flags] Collections flags to add token to\n * @param {Collections<T>} [groups] Master list of token groups\n */\n ta(r, e, t, n) {\n for (let s = 0; s < r.length; s++)\n this.tt(r[s], e, t, n);\n },\n /**\n * Short for \"take regexp transition\"; defines a transition for this state\n * when it encounters a token which matches the given regular expression\n * @param {RegExp} regexp Regular expression transition (populate first)\n * @param {T | State<T>} [next] Transition options\n * @param {Flags} [flags] Collections flags to add token to\n * @param {Collections<T>} [groups] Master list of token groups\n * @returns {State<T>} taken after the given input\n */\n tr(r, e, t, n) {\n n = n || Jr.groups;\n let s;\n return e && e.j ? s = e : (s = new Jr(e), t && n && Cs(e, t, n)), this.jr.push([r, s]), s;\n },\n /**\n * Short for \"take transitions\", will take as many sequential transitions as\n * the length of the given input and returns the\n * resulting final state.\n * @param {string | string[]} input\n * @param {T | State<T>} [next] Transition options\n * @param {Flags} [flags] Collections flags to add token to\n * @param {Collections<T>} [groups] Master list of token groups\n * @returns {State<T>} taken after the given input\n */\n ts(r, e, t, n) {\n let s = this;\n const o = r.length;\n if (!o)\n return s;\n for (let i = 0; i < o - 1; i++)\n s = s.tt(r[i]);\n return s.tt(r[o - 1], e, t, n);\n },\n /**\n * Short for \"take transition\", this is a method for building/working with\n * state machines.\n *\n * If a state already exists for the given input, returns it.\n *\n * If a token is specified, that state will emit that token when reached by\n * the linkify engine.\n *\n * If no state exists, it will be initialized with some default transitions\n * that resemble existing default transitions.\n *\n * If a state is given for the second argument, that state will be\n * transitioned to on the given input regardless of what that input\n * previously did.\n *\n * Specify a token group flags to define groups that this token belongs to.\n * The token will be added to corresponding entires in the given groups\n * object.\n *\n * @param {string} input character, token type to transition on\n * @param {T | State<T>} [next] Transition options\n * @param {Flags} [flags] Collections flags to add token to\n * @param {Collections<T>} [groups] Master list of groups\n * @returns {State<T>} taken after the given input\n */\n tt(r, e, t, n) {\n n = n || Jr.groups;\n const s = this;\n if (e && e.j)\n return s.j[r] = e, e;\n const o = e;\n let i, a = s.go(r);\n if (a ? (i = new Jr(), Object.assign(i.j, a.j), i.jr.push.apply(i.jr, a.jr), i.jd = a.jd, i.t = a.t) : i = new Jr(), o) {\n if (n)\n if (i.t && typeof i.t == \"string\") {\n const l = Object.assign(qw(i.t, n), t);\n Cs(o, l, n);\n } else t && Cs(o, t, n);\n i.t = o;\n }\n return s.j[r] = i, i;\n }\n};\nconst Ct = (r, e, t, n, s) => r.ta(e, t, n, s), fr = (r, e, t, n, s) => r.tr(e, t, n, s), Zu = (r, e, t, n, s) => r.ts(e, t, n, s), Ce = (r, e, t, n, s) => r.tt(e, t, n, s), In = \"WORD\", nc = \"UWORD\", cm = \"ASCIINUMERICAL\", dm = \"ALPHANUMERICAL\", Uo = \"LOCALHOST\", sc = \"TLD\", oc = \"UTLD\", Ei = \"SCHEME\", Hs = \"SLASH_SCHEME\", od = \"NUM\", ic = \"WS\", id = \"NL\", To = \"OPENBRACE\", Mo = \"CLOSEBRACE\", Ui = \"OPENBRACKET\", Ji = \"CLOSEBRACKET\", Ki = \"OPENPAREN\", Gi = \"CLOSEPAREN\", Yi = \"OPENANGLEBRACKET\", Xi = \"CLOSEANGLEBRACKET\", Qi = \"FULLWIDTHLEFTPAREN\", Zi = \"FULLWIDTHRIGHTPAREN\", ea = \"LEFTCORNERBRACKET\", ta = \"RIGHTCORNERBRACKET\", ra = \"LEFTWHITECORNERBRACKET\", na = \"RIGHTWHITECORNERBRACKET\", sa = \"FULLWIDTHLESSTHAN\", oa = \"FULLWIDTHGREATERTHAN\", ia = \"AMPERSAND\", aa = \"APOSTROPHE\", la = \"ASTERISK\", Kn = \"AT\", ca = \"BACKSLASH\", da = \"BACKTICK\", ua = \"CARET\", Xn = \"COLON\", ad = \"COMMA\", fa = \"DOLLAR\", wn = \"DOT\", pa = \"EQUALS\", ld = \"EXCLAMATION\", on = \"HYPHEN\", Ao = \"PERCENT\", ha = \"PIPE\", ma = \"PLUS\", va = \"POUND\", Po = \"QUERY\", cd = \"QUOTE\", um = \"FULLWIDTHMIDDLEDOT\", dd = \"SEMI\", kn = \"SLASH\", No = \"TILDE\", ga = \"UNDERSCORE\", fm = \"EMOJI\", ba = \"SYM\";\nvar pm = /* @__PURE__ */ Object.freeze({\n __proto__: null,\n ALPHANUMERICAL: dm,\n AMPERSAND: ia,\n APOSTROPHE: aa,\n ASCIINUMERICAL: cm,\n ASTERISK: la,\n AT: Kn,\n BACKSLASH: ca,\n BACKTICK: da,\n CARET: ua,\n CLOSEANGLEBRACKET: Xi,\n CLOSEBRACE: Mo,\n CLOSEBRACKET: Ji,\n CLOSEPAREN: Gi,\n COLON: Xn,\n COMMA: ad,\n DOLLAR: fa,\n DOT: wn,\n EMOJI: fm,\n EQUALS: pa,\n EXCLAMATION: ld,\n FULLWIDTHGREATERTHAN: oa,\n FULLWIDTHLEFTPAREN: Qi,\n FULLWIDTHLESSTHAN: sa,\n FULLWIDTHMIDDLEDOT: um,\n FULLWIDTHRIGHTPAREN: Zi,\n HYPHEN: on,\n LEFTCORNERBRACKET: ea,\n LEFTWHITECORNERBRACKET: ra,\n LOCALHOST: Uo,\n NL: id,\n NUM: od,\n OPENANGLEBRACKET: Yi,\n OPENBRACE: To,\n OPENBRACKET: Ui,\n OPENPAREN: Ki,\n PERCENT: Ao,\n PIPE: ha,\n PLUS: ma,\n POUND: va,\n QUERY: Po,\n QUOTE: cd,\n RIGHTCORNERBRACKET: ta,\n RIGHTWHITECORNERBRACKET: na,\n SCHEME: Ei,\n SEMI: dd,\n SLASH: kn,\n SLASH_SCHEME: Hs,\n SYM: ba,\n TILDE: No,\n TLD: sc,\n UNDERSCORE: ga,\n UTLD: oc,\n UWORD: nc,\n WORD: In,\n WS: ic\n});\nconst On = /[a-z]/, lo = new RegExp(\"\\\\p{L}\", \"u\"), vl = new RegExp(\"\\\\p{Emoji}\", \"u\"), $n = /\\d/, gl = /\\s/, ef = \"\\r\", bl = `\n`, Vw = \"\uFE0F\", Ww = \"\u200D\", yl = \"\uFFFC\";\nlet vi = null, gi = null;\nfunction Uw(r = []) {\n const e = {};\n Jr.groups = e;\n const t = new Jr();\n vi == null && (vi = tf(Lw)), gi == null && (gi = tf(Dw)), Ce(t, \"'\", aa), Ce(t, \"{\", To), Ce(t, \"}\", Mo), Ce(t, \"[\", Ui), Ce(t, \"]\", Ji), Ce(t, \"(\", Ki), Ce(t, \")\", Gi), Ce(t, \"<\", Yi), Ce(t, \">\", Xi), Ce(t, \"\uFF08\", Qi), Ce(t, \"\uFF09\", Zi), Ce(t, \"\u300C\", ea), Ce(t, \"\u300D\", ta), Ce(t, \"\u300E\", ra), Ce(t, \"\u300F\", na), Ce(t, \"\uFF1C\", sa), Ce(t, \"\uFF1E\", oa), Ce(t, \"&\", ia), Ce(t, \"*\", la), Ce(t, \"@\", Kn), Ce(t, \"`\", da), Ce(t, \"^\", ua), Ce(t, \":\", Xn), Ce(t, \",\", ad), Ce(t, \"$\", fa), Ce(t, \".\", wn), Ce(t, \"=\", pa), Ce(t, \"!\", ld), Ce(t, \"-\", on), Ce(t, \"%\", Ao), Ce(t, \"|\", ha), Ce(t, \"+\", ma), Ce(t, \"#\", va), Ce(t, \"?\", Po), Ce(t, '\"', cd), Ce(t, \"/\", kn), Ce(t, \";\", dd), Ce(t, \"~\", No), Ce(t, \"_\", ga), Ce(t, \"\\\\\", ca), Ce(t, \"\u30FB\", um);\n const n = fr(t, $n, od, {\n [Zl]: !0\n });\n fr(n, $n, n);\n const s = fr(n, On, cm, {\n [Eo]: !0\n }), o = fr(n, lo, dm, {\n [go]: !0\n }), i = fr(t, On, In, {\n [ec]: !0\n });\n fr(i, $n, s), fr(i, On, i), fr(s, $n, s), fr(s, On, s);\n const a = fr(t, lo, nc, {\n [tc]: !0\n });\n fr(a, On), fr(a, $n, o), fr(a, lo, a), fr(o, $n, o), fr(o, On), fr(o, lo, o);\n const l = Ce(t, bl, id, {\n [ml]: !0\n }), d = Ce(t, ef, ic, {\n [ml]: !0\n }), u = fr(t, gl, ic, {\n [ml]: !0\n });\n Ce(t, yl, u), Ce(d, bl, l), Ce(d, yl, u), fr(d, gl, u), Ce(u, ef), Ce(u, bl), fr(u, gl, u), Ce(u, yl, u);\n const f = fr(t, vl, fm, {\n [lm]: !0\n });\n Ce(f, \"#\"), fr(f, vl, f), Ce(f, Vw, f);\n const h = Ce(f, Ww);\n Ce(h, \"#\"), fr(h, vl, f);\n const p = [[On, i], [$n, s]], g = [[On, null], [lo, a], [$n, o]];\n for (let b = 0; b < vi.length; b++)\n Vn(t, vi[b], sc, In, p);\n for (let b = 0; b < gi.length; b++)\n Vn(t, gi[b], oc, nc, g);\n Cs(sc, {\n tld: !0,\n ascii: !0\n }, e), Cs(oc, {\n utld: !0,\n alpha: !0\n }, e), Vn(t, \"file\", Ei, In, p), Vn(t, \"mailto\", Ei, In, p), Vn(t, \"http\", Hs, In, p), Vn(t, \"https\", Hs, In, p), Vn(t, \"ftp\", Hs, In, p), Vn(t, \"ftps\", Hs, In, p), Cs(Ei, {\n scheme: !0,\n ascii: !0\n }, e), Cs(Hs, {\n slashscheme: !0,\n ascii: !0\n }, e), r = r.sort((b, y) => b[0] > y[0] ? 1 : -1);\n for (let b = 0; b < r.length; b++) {\n const y = r[b][0], E = r[b][1] ? {\n [Fw]: !0\n } : {\n [Bw]: !0\n };\n y.indexOf(\"-\") >= 0 ? E[rc] = !0 : On.test(y) ? $n.test(y) ? E[Eo] = !0 : E[ec] = !0 : E[Zl] = !0, Zu(t, y, y, E);\n }\n return Zu(t, \"localhost\", Uo, {\n ascii: !0\n }), t.jd = new Jr(ba), {\n start: t,\n tokens: Object.assign({\n groups: e\n }, pm)\n };\n}\nfunction hm(r, e) {\n const t = Jw(e.replace(/[A-Z]/g, (a) => a.toLowerCase())), n = t.length, s = [];\n let o = 0, i = 0;\n for (; i < n; ) {\n let a = r, l = null, d = 0, u = null, f = -1, h = -1;\n for (; i < n && (l = a.go(t[i])); )\n a = l, a.accepts() ? (f = 0, h = 0, u = a) : f >= 0 && (f += t[i].length, h++), d += t[i].length, o += t[i].length, i++;\n o -= f, i -= h, d -= f, s.push({\n t: u.t,\n // token type/name\n v: e.slice(o - d, o),\n // string value\n s: o - d,\n // start index\n e: o\n // end index (excluding)\n });\n }\n return s;\n}\nfunction Jw(r) {\n const e = [], t = r.length;\n let n = 0;\n for (; n < t; ) {\n let s = r.charCodeAt(n), o, i = s < 55296 || s > 56319 || n + 1 === t || (o = r.charCodeAt(n + 1)) < 56320 || o > 57343 ? r[n] : r.slice(n, n + 2);\n e.push(i), n += i.length;\n }\n return e;\n}\nfunction Vn(r, e, t, n, s) {\n let o;\n const i = e.length;\n for (let a = 0; a < i - 1; a++) {\n const l = e[a];\n r.j[l] ? o = r.j[l] : (o = new Jr(n), o.jr = s.slice(), r.j[l] = o), r = o;\n }\n return o = new Jr(t), o.jr = s.slice(), r.j[e[i - 1]] = o, o;\n}\nfunction tf(r) {\n const e = [], t = [];\n let n = 0, s = \"0123456789\";\n for (; n < r.length; ) {\n let o = 0;\n for (; s.indexOf(r[n + o]) >= 0; )\n o++;\n if (o > 0) {\n e.push(t.join(\"\"));\n for (let i = parseInt(r.substring(n, n + o), 10); i > 0; i--)\n t.pop();\n n += o;\n } else\n t.push(r[n]), n++;\n }\n return e;\n}\nconst Jo = {\n defaultProtocol: \"http\",\n events: null,\n format: rf,\n formatHref: rf,\n nl2br: !1,\n tagName: \"a\",\n target: null,\n rel: null,\n validate: !0,\n truncate: 1 / 0,\n className: null,\n attributes: null,\n ignoreTags: [],\n render: null\n};\nfunction ud(r, e = null) {\n let t = Object.assign({}, Jo);\n r && (t = Object.assign(t, r instanceof ud ? r.o : r));\n const n = t.ignoreTags, s = [];\n for (let o = 0; o < n.length; o++)\n s.push(n[o].toUpperCase());\n this.o = t, e && (this.defaultRender = e), this.ignoreTags = s;\n}\nud.prototype = {\n o: Jo,\n /**\n * @type string[]\n */\n ignoreTags: [],\n /**\n * @param {IntermediateRepresentation} ir\n * @returns {any}\n */\n defaultRender(r) {\n return r;\n },\n /**\n * Returns true or false based on whether a token should be displayed as a\n * link based on the user options.\n * @param {MultiToken} token\n * @returns {boolean}\n */\n check(r) {\n return this.get(\"validate\", r.toString(), r);\n },\n // Private methods\n /**\n * Resolve an option's value based on the value of the option and the given\n * params. If operator and token are specified and the target option is\n * callable, automatically calls the function with the given argument.\n * @template {keyof Opts} K\n * @param {K} key Name of option to use\n * @param {string} [operator] will be passed to the target option if it's a\n * function. If not specified, RAW function value gets returned\n * @param {MultiToken} [token] The token from linkify.tokenize\n * @returns {Opts[K] | any}\n */\n get(r, e, t) {\n const n = e != null;\n let s = this.o[r];\n return s && (typeof s == \"object\" ? (s = t.t in s ? s[t.t] : Jo[r], typeof s == \"function\" && n && (s = s(e, t))) : typeof s == \"function\" && n && (s = s(e, t.t, t)), s);\n },\n /**\n * @template {keyof Opts} L\n * @param {L} key Name of options object to use\n * @param {string} [operator]\n * @param {MultiToken} [token]\n * @returns {Opts[L] | any}\n */\n getObj(r, e, t) {\n let n = this.o[r];\n return typeof n == \"function\" && e != null && (n = n(e, t.t, t)), n;\n },\n /**\n * Convert the given token to a rendered element that may be added to the\n * calling-interface's DOM\n * @param {MultiToken} token Token to render to an HTML element\n * @returns {any} Render result; e.g., HTML string, DOM element, React\n * Component, etc.\n */\n render(r) {\n const e = r.render(this);\n return (this.get(\"render\", null, r) || this.defaultRender)(e, r.t, r);\n }\n};\nfunction rf(r) {\n return r;\n}\nfunction mm(r, e) {\n this.t = \"token\", this.v = r, this.tk = e;\n}\nmm.prototype = {\n isLink: !1,\n /**\n * Return the string this token represents.\n * @return {string}\n */\n toString() {\n return this.v;\n },\n /**\n * What should the value for this token be in the `href` HTML attribute?\n * Returns the `.toString` value by default.\n * @param {string} [scheme]\n * @return {string}\n */\n toHref(r) {\n return this.toString();\n },\n /**\n * @param {Options} options Formatting options\n * @returns {string}\n */\n toFormattedString(r) {\n const e = this.toString(), t = r.get(\"truncate\", e, this), n = r.get(\"format\", e, this);\n return t && n.length > t ? n.substring(0, t) + \"\u2026\" : n;\n },\n /**\n *\n * @param {Options} options\n * @returns {string}\n */\n toFormattedHref(r) {\n return r.get(\"formatHref\", this.toHref(r.get(\"defaultProtocol\")), this);\n },\n /**\n * The start index of this token in the original input string\n * @returns {number}\n */\n startIndex() {\n return this.tk[0].s;\n },\n /**\n * The end index of this token in the original input string (up to this\n * index but not including it)\n * @returns {number}\n */\n endIndex() {\n return this.tk[this.tk.length - 1].e;\n },\n /**\n \tReturns an object of relevant values for this token, which includes keys\n \t* type - Kind of token ('url', 'email', etc.)\n \t* value - Original text\n \t* href - The value that should be added to the anchor tag's href\n \t\tattribute\n \t\t@method toObject\n \t@param {string} [protocol] `'http'` by default\n */\n toObject(r = Jo.defaultProtocol) {\n return {\n type: this.t,\n value: this.toString(),\n isLink: this.isLink,\n href: this.toHref(r),\n start: this.startIndex(),\n end: this.endIndex()\n };\n },\n /**\n *\n * @param {Options} options Formatting option\n */\n toFormattedObject(r) {\n return {\n type: this.t,\n value: this.toFormattedString(r),\n isLink: this.isLink,\n href: this.toFormattedHref(r),\n start: this.startIndex(),\n end: this.endIndex()\n };\n },\n /**\n * Whether this token should be rendered as a link according to the given options\n * @param {Options} options\n * @returns {boolean}\n */\n validate(r) {\n return r.get(\"validate\", this.toString(), this);\n },\n /**\n * Return an object that represents how this link should be rendered.\n * @param {Options} options Formattinng options\n */\n render(r) {\n const e = this, t = this.toHref(r.get(\"defaultProtocol\")), n = r.get(\"formatHref\", t, this), s = r.get(\"tagName\", t, e), o = this.toFormattedString(r), i = {}, a = r.get(\"className\", t, e), l = r.get(\"target\", t, e), d = r.get(\"rel\", t, e), u = r.getObj(\"attributes\", t, e), f = r.getObj(\"events\", t, e);\n return i.href = n, a && (i.class = a), l && (i.target = l), d && (i.rel = d), u && Object.assign(i, u), {\n tagName: s,\n attributes: i,\n content: o,\n eventListeners: f\n };\n }\n};\nfunction La(r, e) {\n class t extends mm {\n constructor(s, o) {\n super(s, o), this.t = r;\n }\n }\n for (const n in e)\n t.prototype[n] = e[n];\n return t.t = r, t;\n}\nconst nf = La(\"email\", {\n isLink: !0,\n toHref() {\n return \"mailto:\" + this.toString();\n }\n}), sf = La(\"text\"), Kw = La(\"nl\"), bi = La(\"url\", {\n isLink: !0,\n /**\n \tLowercases relevant parts of the domain and adds the protocol if\n \trequired. Note that this will not escape unsafe HTML characters in the\n \tURL.\n \t\t@param {string} [scheme] default scheme (e.g., 'https')\n \t@return {string} the full href\n */\n toHref(r = Jo.defaultProtocol) {\n return this.hasProtocol() ? this.v : `${r}://${this.v}`;\n },\n /**\n * Check whether this URL token has a protocol\n * @return {boolean}\n */\n hasProtocol() {\n const r = this.tk;\n return r.length >= 2 && r[0].t !== Uo && r[1].t === Xn;\n }\n}), sn = (r) => new Jr(r);\nfunction Gw({\n groups: r\n}) {\n const e = r.domain.concat([ia, la, Kn, ca, da, ua, fa, pa, on, od, Ao, ha, ma, va, kn, ba, No, ga]), t = [aa, Xn, ad, wn, ld, Ao, Po, cd, dd, Yi, Xi, To, Mo, Ji, Ui, Ki, Gi, Qi, Zi, ea, ta, ra, na, sa, oa], n = [ia, aa, la, ca, da, ua, fa, pa, on, To, Mo, Ao, ha, ma, va, Po, kn, ba, No, ga], s = sn(), o = Ce(s, No);\n Ct(o, n, o), Ct(o, r.domain, o);\n const i = sn(), a = sn(), l = sn();\n Ct(s, r.domain, i), Ct(s, r.scheme, a), Ct(s, r.slashscheme, l), Ct(i, n, o), Ct(i, r.domain, i);\n const d = Ce(i, Kn);\n Ce(o, Kn, d), Ce(a, Kn, d), Ce(l, Kn, d);\n const u = Ce(o, wn);\n Ct(u, n, o), Ct(u, r.domain, o);\n const f = sn();\n Ct(d, r.domain, f), Ct(f, r.domain, f);\n const h = Ce(f, wn);\n Ct(h, r.domain, f);\n const p = sn(nf);\n Ct(h, r.tld, p), Ct(h, r.utld, p), Ce(d, Uo, p);\n const g = Ce(f, on);\n Ce(g, on, g), Ct(g, r.domain, f), Ct(p, r.domain, f), Ce(p, wn, h), Ce(p, on, g);\n const b = Ce(p, Xn);\n Ct(b, r.numeric, nf);\n const y = Ce(i, on), C = Ce(i, wn);\n Ce(y, on, y), Ct(y, r.domain, i), Ct(C, n, o), Ct(C, r.domain, i);\n const E = sn(bi);\n Ct(C, r.tld, E), Ct(C, r.utld, E), Ct(E, r.domain, i), Ct(E, n, o), Ce(E, wn, C), Ce(E, on, y), Ce(E, Kn, d);\n const R = Ce(E, Xn), q = sn(bi);\n Ct(R, r.numeric, q);\n const O = sn(bi), M = sn();\n Ct(O, e, O), Ct(O, t, M), Ct(M, e, O), Ct(M, t, M), Ce(E, kn, O), Ce(q, kn, O);\n const P = Ce(a, Xn), L = Ce(l, Xn), $ = Ce(L, kn), J = Ce($, kn);\n Ct(a, r.domain, i), Ce(a, wn, C), Ce(a, on, y), Ct(l, r.domain, i), Ce(l, wn, C), Ce(l, on, y), Ct(P, r.domain, O), Ce(P, kn, O), Ce(P, Po, O), Ct(J, r.domain, O), Ct(J, e, O), Ce(J, kn, O);\n const U = [\n [To, Mo],\n // {}\n [Ui, Ji],\n // []\n [Ki, Gi],\n // ()\n [Yi, Xi],\n // <>\n [Qi, Zi],\n // \uFF08\uFF09\n [ea, ta],\n // \u300C\u300D\n [ra, na],\n // \u300E\u300F\n [sa, oa]\n // \uFF1C\uFF1E\n ];\n for (let F = 0; F < U.length; F++) {\n const [z, _] = U[F], N = Ce(O, z);\n Ce(M, z, N), Ce(N, _, O);\n const Q = sn(bi);\n Ct(N, e, Q);\n const T = sn();\n Ct(N, t), Ct(Q, e, Q), Ct(Q, t, T), Ct(T, e, Q), Ct(T, t, T), Ce(Q, _, O), Ce(T, _, O);\n }\n return Ce(s, Uo, E), Ce(s, id, Kw), {\n start: s,\n tokens: pm\n };\n}\nfunction Yw(r, e, t) {\n let n = t.length, s = 0, o = [], i = [];\n for (; s < n; ) {\n let a = r, l = null, d = null, u = 0, f = null, h = -1;\n for (; s < n && !(l = a.go(t[s].t)); )\n i.push(t[s++]);\n for (; s < n && (d = l || a.go(t[s].t)); )\n l = null, a = d, a.accepts() ? (h = 0, f = a) : h >= 0 && h++, s++, u++;\n if (h < 0)\n s -= u, s < n && (i.push(t[s]), s++);\n else {\n i.length > 0 && (o.push(xl(sf, e, i)), i = []), s -= h, u -= h;\n const p = f.t, g = t.slice(s - u, s);\n o.push(xl(p, e, g));\n }\n }\n return i.length > 0 && o.push(xl(sf, e, i)), o;\n}\nfunction xl(r, e, t) {\n const n = t[0].s, s = t[t.length - 1].e, o = e.slice(n, s);\n return new r(o, t);\n}\nconst Xw = typeof console < \"u\" && console && console.warn || (() => {\n}), Qw = \"until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.\", rr = {\n scanner: null,\n parser: null,\n tokenQueue: [],\n pluginQueue: [],\n customSchemes: [],\n initialized: !1\n};\nfunction Zw() {\n return Jr.groups = {}, rr.scanner = null, rr.parser = null, rr.tokenQueue = [], rr.pluginQueue = [], rr.customSchemes = [], rr.initialized = !1, rr;\n}\nfunction of(r, e = !1) {\n if (rr.initialized && Xw(`linkifyjs: already initialized - will not register custom scheme \"${r}\" ${Qw}`), !/^[0-9a-z]+(-[0-9a-z]+)*$/.test(r))\n throw new Error(`linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or \"-\"\n2. Cannot start or end with \"-\"\n3. \"-\" cannot repeat`);\n rr.customSchemes.push([r, e]);\n}\nfunction ek() {\n rr.scanner = Uw(rr.customSchemes);\n for (let r = 0; r < rr.tokenQueue.length; r++)\n rr.tokenQueue[r][1]({\n scanner: rr.scanner\n });\n rr.parser = Gw(rr.scanner.tokens);\n for (let r = 0; r < rr.pluginQueue.length; r++)\n rr.pluginQueue[r][1]({\n scanner: rr.scanner,\n parser: rr.parser\n });\n return rr.initialized = !0, rr;\n}\nfunction fd(r) {\n return rr.initialized || ek(), Yw(rr.parser.start, r, hm(rr.scanner.start, r));\n}\nfd.scan = hm;\nfunction vm(r, e = null, t = null) {\n if (e && typeof e == \"object\") {\n if (t)\n throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);\n t = e, e = null;\n }\n const n = new ud(t), s = fd(r), o = [];\n for (let i = 0; i < s.length; i++) {\n const a = s[i];\n a.isLink && (!e || a.t === e) && n.check(a) && o.push(a.toFormattedObject(n));\n }\n return o;\n}\nvar pd = \"[\\0- \u00A0\u1680\u180E\u2000-\\u2029\u205F\u3000]\", tk = new RegExp(pd), rk = new RegExp(`${pd}$`), nk = new RegExp(pd, \"g\");\nfunction sk(r) {\n return r.length === 1 ? r[0].isLink : r.length === 3 && r[1].isLink ? [\"()\", \"[]\"].includes(r[0].value + r[2].value) : !1;\n}\nfunction ok(r) {\n return new mr({\n key: new Or(\"autolink\"),\n appendTransaction: (e, t, n) => {\n const s = e.some((d) => d.docChanged) && !t.doc.eq(n.doc), o = e.some((d) => d.getMeta(\"preventAutolink\"));\n if (!s || o)\n return;\n const { tr: i } = n, a = _h(t.doc, [...e]);\n if (Nh(a).forEach(({ newRange: d }) => {\n const u = ox(n.doc, d, (p) => p.isTextblock);\n let f, h;\n if (u.length > 1)\n f = u[0], h = n.doc.textBetween(\n f.pos,\n f.pos + f.node.nodeSize,\n void 0,\n \" \"\n );\n else if (u.length) {\n const p = n.doc.textBetween(d.from, d.to, \" \", \" \");\n if (!rk.test(p))\n return;\n f = u[0], h = n.doc.textBetween(f.pos, d.to, void 0, \" \");\n }\n if (f && h) {\n const p = h.split(tk).filter(Boolean);\n if (p.length <= 0)\n return !1;\n const g = p[p.length - 1], b = f.pos + h.lastIndexOf(g);\n if (!g)\n return !1;\n const y = fd(g).map((C) => C.toObject(r.defaultProtocol));\n if (!sk(y))\n return !1;\n y.filter((C) => C.isLink).map((C) => ({\n ...C,\n from: b + C.start + 1,\n to: b + C.end + 1\n })).filter((C) => n.schema.marks.code ? !n.doc.rangeHasMark(C.from, C.to, n.schema.marks.code) : !0).filter((C) => r.validate(C.value)).filter((C) => r.shouldAutoLink(C.value)).forEach((C) => {\n Zc(C.from, C.to, n.doc).some((E) => E.mark.type === r.type) || i.addMark(\n C.from,\n C.to,\n r.type.create({\n href: C.href\n })\n );\n });\n }\n }), !!i.steps.length)\n return i;\n }\n });\n}\nfunction ik(r) {\n return new mr({\n key: new Or(\"handleClickLink\"),\n props: {\n handleClick: (e, t, n) => {\n var s, o;\n if (n.button !== 0 || !e.editable)\n return !1;\n let i = null;\n if (n.target instanceof HTMLAnchorElement)\n i = n.target;\n else {\n const l = n.target;\n if (!l)\n return !1;\n const d = r.editor.view.dom;\n i = l.closest(\"a\"), i && !d.contains(i) && (i = null);\n }\n if (!i)\n return !1;\n let a = !1;\n if (r.enableClickSelection && (a = r.editor.commands.extendMarkRange(r.type.name)), r.openOnClick) {\n const l = Ph(e.state, r.type.name), d = (s = i.href) != null ? s : l.href, u = (o = i.target) != null ? o : l.target;\n d && (window.open(d, u), a = !0);\n }\n return a;\n }\n }\n });\n}\nfunction ak(r) {\n return new mr({\n key: new Or(\"handlePasteLink\"),\n props: {\n handlePaste: (e, t, n) => {\n const { shouldAutoLink: s } = r, { state: o } = e, { selection: i } = o, { empty: a } = i;\n if (a)\n return !1;\n let l = \"\";\n n.content.forEach((u) => {\n l += u.textContent;\n });\n const d = vm(l, { defaultProtocol: r.defaultProtocol }).find(\n (u) => u.isLink && u.value === l\n );\n return !l || !d || s !== void 0 && !s(d.value) ? !1 : r.editor.commands.setMark(r.type, {\n href: d.href\n });\n }\n }\n });\n}\nfunction hs(r, e) {\n const t = [\"http\", \"https\", \"ftp\", \"ftps\", \"mailto\", \"tel\", \"callto\", \"sms\", \"cid\", \"xmpp\"];\n return e && e.forEach((n) => {\n const s = typeof n == \"string\" ? n : n.scheme;\n s && t.push(s);\n }), !r || r.replace(nk, \"\").match(\n new RegExp(\n // eslint-disable-next-line no-useless-escape\n `^(?:(?:${t.join(\"|\")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,\n \"i\"\n )\n );\n}\nvar lk = ti.create({\n name: \"link\",\n priority: 1e3,\n keepOnSplit: !1,\n exitable: !0,\n onCreate() {\n this.options.validate && !this.options.shouldAutoLink && (this.options.shouldAutoLink = this.options.validate, console.warn(\"The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.\")), this.options.protocols.forEach((r) => {\n if (typeof r == \"string\") {\n of(r);\n return;\n }\n of(r.scheme, r.optionalSlashes);\n });\n },\n onDestroy() {\n Zw();\n },\n inclusive() {\n return this.options.autolink;\n },\n addOptions() {\n return {\n openOnClick: !0,\n enableClickSelection: !1,\n linkOnPaste: !0,\n autolink: !0,\n protocols: [],\n defaultProtocol: \"http\",\n HTMLAttributes: {\n target: \"_blank\",\n rel: \"noopener noreferrer nofollow\",\n class: null\n },\n isAllowedUri: (r, e) => !!hs(r, e.protocols),\n validate: (r) => !!r,\n shouldAutoLink: (r) => {\n const e = /^[a-z][a-z0-9+.-]*:\\/\\//i.test(r), t = /^[a-z][a-z0-9+.-]*:/i.test(r);\n if (e || t && !r.includes(\"@\"))\n return !0;\n const s = (r.includes(\"@\") ? r.split(\"@\").pop() : r).split(/[/?#:]/)[0];\n return !(/^\\d{1,3}(\\.\\d{1,3}){3}$/.test(s) || !/\\./.test(s));\n }\n };\n },\n addAttributes() {\n return {\n href: {\n default: null,\n parseHTML(r) {\n return r.getAttribute(\"href\");\n }\n },\n target: {\n default: this.options.HTMLAttributes.target\n },\n rel: {\n default: this.options.HTMLAttributes.rel\n },\n class: {\n default: this.options.HTMLAttributes.class\n },\n title: {\n default: null\n }\n };\n },\n parseHTML() {\n return [\n {\n tag: \"a[href]\",\n getAttrs: (r) => {\n const e = r.getAttribute(\"href\");\n return !e || !this.options.isAllowedUri(e, {\n defaultValidate: (t) => !!hs(t, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol\n }) ? !1 : null;\n }\n }\n ];\n },\n renderHTML({ HTMLAttributes: r }) {\n return this.options.isAllowedUri(r.href, {\n defaultValidate: (e) => !!hs(e, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol\n }) ? [\"a\", Ur(this.options.HTMLAttributes, r), 0] : [\"a\", Ur(this.options.HTMLAttributes, { ...r, href: \"\" }), 0];\n },\n markdownTokenName: \"link\",\n parseMarkdown: (r, e) => e.applyMark(\"link\", e.parseInline(r.tokens || []), {\n href: r.href,\n title: r.title || null\n }),\n renderMarkdown: (r, e) => {\n var t, n, s, o;\n const i = (n = (t = r.attrs) == null ? void 0 : t.href) != null ? n : \"\", a = (o = (s = r.attrs) == null ? void 0 : s.title) != null ? o : \"\", l = e.renderChildren(r);\n return a ? `[${l}](${i} \"${a}\")` : `[${l}](${i})`;\n },\n addCommands() {\n return {\n setLink: (r) => ({ chain: e }) => {\n const { href: t } = r;\n return this.options.isAllowedUri(t, {\n defaultValidate: (n) => !!hs(n, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol\n }) ? e().setMark(this.name, r).setMeta(\"preventAutolink\", !0).run() : !1;\n },\n toggleLink: (r) => ({ chain: e }) => {\n const { href: t } = r || {};\n return t && !this.options.isAllowedUri(t, {\n defaultValidate: (n) => !!hs(n, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol\n }) ? !1 : e().toggleMark(this.name, r, { extendEmptyMarkRange: !0 }).setMeta(\"preventAutolink\", !0).run();\n },\n unsetLink: () => ({ chain: r }) => r().unsetMark(this.name, { extendEmptyMarkRange: !0 }).setMeta(\"preventAutolink\", !0).run()\n };\n },\n addPasteRules() {\n return [\n Wo({\n find: (r) => {\n const e = [];\n if (r) {\n const { protocols: t, defaultProtocol: n } = this.options, s = vm(r).filter(\n (o) => o.isLink && this.options.isAllowedUri(o.value, {\n defaultValidate: (i) => !!hs(i, t),\n protocols: t,\n defaultProtocol: n\n })\n );\n s.length && s.forEach((o) => {\n this.options.shouldAutoLink(o.value) && e.push({\n text: o.value,\n data: {\n href: o.href\n },\n index: o.start\n });\n });\n }\n return e;\n },\n type: this.type,\n getAttributes: (r) => {\n var e;\n return {\n href: (e = r.data) == null ? void 0 : e.href\n };\n }\n })\n ];\n },\n addProseMirrorPlugins() {\n const r = [], { protocols: e, defaultProtocol: t } = this.options;\n return this.options.autolink && r.push(\n ok({\n type: this.type,\n defaultProtocol: this.options.defaultProtocol,\n validate: (n) => this.options.isAllowedUri(n, {\n defaultValidate: (s) => !!hs(s, e),\n protocols: e,\n defaultProtocol: t\n }),\n shouldAutoLink: this.options.shouldAutoLink\n })\n ), r.push(\n ik({\n type: this.type,\n editor: this.editor,\n openOnClick: this.options.openOnClick === \"whenNotEditable\" ? !0 : this.options.openOnClick,\n enableClickSelection: this.options.enableClickSelection\n })\n ), this.options.linkOnPaste && r.push(\n ak({\n editor: this.editor,\n defaultProtocol: this.options.defaultProtocol,\n type: this.type,\n shouldAutoLink: this.options.shouldAutoLink\n })\n ), r;\n }\n}), ac = lk, ck = /(?:^|\\s)(!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\))$/, dk = Tn.create({\n name: \"image\",\n addOptions() {\n return {\n inline: !1,\n allowBase64: !1,\n HTMLAttributes: {},\n resize: !1\n };\n },\n inline() {\n return this.options.inline;\n },\n group() {\n return this.options.inline ? \"inline\" : \"block\";\n },\n draggable: !0,\n addAttributes() {\n return {\n src: {\n default: null\n },\n alt: {\n default: null\n },\n title: {\n default: null\n },\n width: {\n default: null\n },\n height: {\n default: null\n }\n };\n },\n parseHTML() {\n return [\n {\n tag: this.options.allowBase64 ? \"img[src]\" : 'img[src]:not([src^=\"data:\"])'\n }\n ];\n },\n renderHTML({ HTMLAttributes: r }) {\n return [\"img\", Ur(this.options.HTMLAttributes, r)];\n },\n parseMarkdown: (r, e) => e.createNode(\"image\", {\n src: r.href,\n title: r.title,\n alt: r.text\n }),\n renderMarkdown: (r) => {\n var e, t, n, s, o, i;\n const a = (t = (e = r.attrs) == null ? void 0 : e.src) != null ? t : \"\", l = (s = (n = r.attrs) == null ? void 0 : n.alt) != null ? s : \"\", d = (i = (o = r.attrs) == null ? void 0 : o.title) != null ? i : \"\";\n return d ? `` : ``;\n },\n addNodeView() {\n if (!this.options.resize || !this.options.resize.enabled || typeof document > \"u\")\n return null;\n const { directions: r, minWidth: e, minHeight: t, alwaysPreserveAspectRatio: n } = this.options.resize;\n return ({ node: s, getPos: o, HTMLAttributes: i, editor: a }) => {\n const l = document.createElement(\"img\");\n Object.entries(i).forEach(([f, h]) => {\n if (h != null)\n switch (f) {\n case \"width\":\n case \"height\":\n break;\n default:\n l.setAttribute(f, h);\n break;\n }\n }), l.src = i.src;\n const d = new cw({\n element: l,\n editor: a,\n node: s,\n getPos: o,\n onResize: (f, h) => {\n l.style.width = `${f}px`, l.style.height = `${h}px`;\n },\n onCommit: (f, h) => {\n const p = o();\n p !== void 0 && this.editor.chain().setNodeSelection(p).updateAttributes(this.name, {\n width: f,\n height: h\n }).run();\n },\n onUpdate: (f, h, p) => f.type === s.type,\n options: {\n directions: r,\n min: {\n width: e,\n height: t\n },\n preserveAspectRatio: n === !0\n }\n }), u = d.dom;\n return u.style.visibility = \"hidden\", u.style.pointerEvents = \"none\", l.onload = () => {\n u.style.visibility = \"\", u.style.pointerEvents = \"\";\n }, d;\n };\n },\n addCommands() {\n return {\n setImage: (r) => ({ commands: e }) => e.insertContent({\n type: this.name,\n attrs: r\n })\n };\n },\n addInputRules() {\n return [\n iw({\n find: ck,\n type: this.type,\n getAttributes: (r) => {\n const [, , e, t, n] = r;\n return { src: t, alt: e, title: n };\n }\n })\n ];\n }\n}), gm = dk, af = (r, e) => {\n if (r === \"slot\")\n return 0;\n if (r instanceof Function)\n return r(e);\n const { children: t, ...n } = e ?? {};\n if (r === \"svg\")\n throw new Error(\"SVG elements are not supported in the JSX syntax, use the array syntax instead\");\n return [r, n, t];\n}, uk = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/, fk = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g, pk = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/, hk = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g, mk = ti.create({\n name: \"bold\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n parseHTML() {\n return [\n {\n tag: \"strong\"\n },\n {\n tag: \"b\",\n getAttrs: (r) => r.style.fontWeight !== \"normal\" && null\n },\n {\n style: \"font-weight=400\",\n clearMark: (r) => r.type.name === this.name\n },\n {\n style: \"font-weight\",\n getAttrs: (r) => /^(bold(er)?|[5-9]\\d{2,})$/.test(r) && null\n }\n ];\n },\n renderHTML({ HTMLAttributes: r }) {\n return /* @__PURE__ */ af(\"strong\", { ...Ur(this.options.HTMLAttributes, r), children: /* @__PURE__ */ af(\"slot\", {}) });\n },\n markdownTokenName: \"strong\",\n parseMarkdown: (r, e) => e.applyMark(\"bold\", e.parseInline(r.tokens || [])),\n markdownOptions: {\n htmlReopen: {\n open: \"<strong>\",\n close: \"</strong>\"\n }\n },\n renderMarkdown: (r, e) => `**${e.renderChildren(r)}**`,\n addCommands() {\n return {\n setBold: () => ({ commands: r }) => r.setMark(this.name),\n toggleBold: () => ({ commands: r }) => r.toggleMark(this.name),\n unsetBold: () => ({ commands: r }) => r.unsetMark(this.name)\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-b\": () => this.editor.commands.toggleBold(),\n \"Mod-B\": () => this.editor.commands.toggleBold()\n };\n },\n addInputRules() {\n return [\n Wi({\n find: uk,\n type: this.type\n }),\n Wi({\n find: pk,\n type: this.type\n })\n ];\n },\n addPasteRules() {\n return [\n Wo({\n find: fk,\n type: this.type\n }),\n Wo({\n find: hk,\n type: this.type\n })\n ];\n }\n}), lc = mk, vk = /(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))$/, gk = /(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))/g, bk = /(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))$/, yk = /(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))/g, xk = ti.create({\n name: \"italic\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n parseHTML() {\n return [\n {\n tag: \"em\"\n },\n {\n tag: \"i\",\n getAttrs: (r) => r.style.fontStyle !== \"normal\" && null\n },\n {\n style: \"font-style=normal\",\n clearMark: (r) => r.type.name === this.name\n },\n {\n style: \"font-style=italic\"\n }\n ];\n },\n renderHTML({ HTMLAttributes: r }) {\n return [\"em\", Ur(this.options.HTMLAttributes, r), 0];\n },\n addCommands() {\n return {\n setItalic: () => ({ commands: r }) => r.setMark(this.name),\n toggleItalic: () => ({ commands: r }) => r.toggleMark(this.name),\n unsetItalic: () => ({ commands: r }) => r.unsetMark(this.name)\n };\n },\n markdownTokenName: \"em\",\n parseMarkdown: (r, e) => e.applyMark(\"italic\", e.parseInline(r.tokens || [])),\n markdownOptions: {\n htmlReopen: {\n open: \"<em>\",\n close: \"</em>\"\n }\n },\n renderMarkdown: (r, e) => `*${e.renderChildren(r)}*`,\n addKeyboardShortcuts() {\n return {\n \"Mod-i\": () => this.editor.commands.toggleItalic(),\n \"Mod-I\": () => this.editor.commands.toggleItalic()\n };\n },\n addInputRules() {\n return [\n Wi({\n find: vk,\n type: this.type\n }),\n Wi({\n find: bk,\n type: this.type\n })\n ];\n },\n addPasteRules() {\n return [\n Wo({\n find: gk,\n type: this.type\n }),\n Wo({\n find: yk,\n type: this.type\n })\n ];\n }\n}), cc = xk, wk = ti.create({\n name: \"underline\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n parseHTML() {\n return [\n {\n tag: \"u\"\n },\n {\n style: \"text-decoration\",\n consuming: !1,\n getAttrs: (r) => r.includes(\"underline\") ? {} : !1\n }\n ];\n },\n renderHTML({ HTMLAttributes: r }) {\n return [\"u\", Ur(this.options.HTMLAttributes, r), 0];\n },\n parseMarkdown(r, e) {\n return e.applyMark(this.name || \"underline\", e.parseInline(r.tokens || []));\n },\n renderMarkdown(r, e) {\n return `++${e.renderChildren(r)}++`;\n },\n markdownTokenizer: {\n name: \"underline\",\n level: \"inline\",\n start(r) {\n return r.indexOf(\"++\");\n },\n tokenize(r, e, t) {\n const s = /^(\\+\\+)([\\s\\S]+?)(\\+\\+)/.exec(r);\n if (!s)\n return;\n const o = s[2].trim();\n return {\n type: \"underline\",\n raw: s[0],\n text: o,\n tokens: t.inlineTokens(o)\n };\n }\n },\n addCommands() {\n return {\n setUnderline: () => ({ commands: r }) => r.setMark(this.name),\n toggleUnderline: () => ({ commands: r }) => r.toggleMark(this.name),\n unsetUnderline: () => ({ commands: r }) => r.unsetMark(this.name)\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-u\": () => this.editor.commands.toggleUnderline(),\n \"Mod-U\": () => this.editor.commands.toggleUnderline()\n };\n }\n}), dc = wk;\nfunction kk(r = {}) {\n return new mr({\n view(e) {\n return new Ck(e, r);\n }\n });\n}\nclass Ck {\n constructor(e, t) {\n var n;\n this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = (n = t.width) !== null && n !== void 0 ? n : 1, this.color = t.color === !1 ? void 0 : t.color || \"black\", this.class = t.class, this.handlers = [\"dragover\", \"dragend\", \"drop\", \"dragleave\"].map((s) => {\n let o = (i) => {\n this[s](i);\n };\n return e.dom.addEventListener(s, o), { name: s, handler: o };\n });\n }\n destroy() {\n this.handlers.forEach(({ name: e, handler: t }) => this.editorView.dom.removeEventListener(e, t));\n }\n update(e, t) {\n this.cursorPos != null && t.doc != e.state.doc && (this.cursorPos > e.state.doc.content.size ? this.setCursor(null) : this.updateOverlay());\n }\n setCursor(e) {\n e != this.cursorPos && (this.cursorPos = e, e == null ? (this.element.parentNode.removeChild(this.element), this.element = null) : this.updateOverlay());\n }\n updateOverlay() {\n let e = this.editorView.state.doc.resolve(this.cursorPos), t = !e.parent.inlineContent, n, s = this.editorView.dom, o = s.getBoundingClientRect(), i = o.width / s.offsetWidth, a = o.height / s.offsetHeight;\n if (t) {\n let f = e.nodeBefore, h = e.nodeAfter;\n if (f || h) {\n let p = this.editorView.nodeDOM(this.cursorPos - (f ? f.nodeSize : 0));\n if (p) {\n let g = p.getBoundingClientRect(), b = f ? g.bottom : g.top;\n f && h && (b = (b + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);\n let y = this.width / 2 * a;\n n = { left: g.left, right: g.right, top: b - y, bottom: b + y };\n }\n }\n }\n if (!n) {\n let f = this.editorView.coordsAtPos(this.cursorPos), h = this.width / 2 * i;\n n = { left: f.left - h, right: f.left + h, top: f.top, bottom: f.bottom };\n }\n let l = this.editorView.dom.offsetParent;\n this.element || (this.element = l.appendChild(document.createElement(\"div\")), this.class && (this.element.className = this.class), this.element.style.cssText = \"position: absolute; z-index: 50; pointer-events: none;\", this.color && (this.element.style.backgroundColor = this.color)), this.element.classList.toggle(\"prosemirror-dropcursor-block\", t), this.element.classList.toggle(\"prosemirror-dropcursor-inline\", !t);\n let d, u;\n if (!l || l == document.body && getComputedStyle(l).position == \"static\")\n d = -pageXOffset, u = -pageYOffset;\n else {\n let f = l.getBoundingClientRect(), h = f.width / l.offsetWidth, p = f.height / l.offsetHeight;\n d = f.left - l.scrollLeft * h, u = f.top - l.scrollTop * p;\n }\n this.element.style.left = (n.left - d) / i + \"px\", this.element.style.top = (n.top - u) / a + \"px\", this.element.style.width = (n.right - n.left) / i + \"px\", this.element.style.height = (n.bottom - n.top) / a + \"px\";\n }\n scheduleRemoval(e) {\n clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(null), e);\n }\n dragover(e) {\n if (!this.editorView.editable)\n return;\n let t = this.editorView.posAtCoords({ left: e.clientX, top: e.clientY }), n = t && t.inside >= 0 && this.editorView.state.doc.nodeAt(t.inside), s = n && n.type.spec.disableDropCursor, o = typeof s == \"function\" ? s(this.editorView, t, e) : s;\n if (t && !o) {\n let i = t.pos;\n if (this.editorView.dragging && this.editorView.dragging.slice) {\n let a = mp(this.editorView.state.doc, i, this.editorView.dragging.slice);\n a != null && (i = a);\n }\n this.setCursor(i), this.scheduleRemoval(5e3);\n }\n }\n dragend() {\n this.scheduleRemoval(20);\n }\n drop() {\n this.scheduleRemoval(20);\n }\n dragleave(e) {\n this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);\n }\n}\nclass pr extends St {\n /**\n Create a gap cursor.\n */\n constructor(e) {\n super(e, e);\n }\n map(e, t) {\n let n = e.resolve(t.map(this.head));\n return pr.valid(n) ? new pr(n) : St.near(n);\n }\n content() {\n return De.empty;\n }\n eq(e) {\n return e instanceof pr && e.head == this.head;\n }\n toJSON() {\n return { type: \"gapcursor\", pos: this.head };\n }\n /**\n @internal\n */\n static fromJSON(e, t) {\n if (typeof t.pos != \"number\")\n throw new RangeError(\"Invalid input for GapCursor.fromJSON\");\n return new pr(e.resolve(t.pos));\n }\n /**\n @internal\n */\n getBookmark() {\n return new hd(this.anchor);\n }\n /**\n @internal\n */\n static valid(e) {\n let t = e.parent;\n if (t.inlineContent || !_k(e) || !Sk(e))\n return !1;\n let n = t.type.spec.allowGapCursor;\n if (n != null)\n return n;\n let s = t.contentMatchAt(e.index()).defaultType;\n return s && s.isTextblock;\n }\n /**\n @internal\n */\n static findGapCursorFrom(e, t, n = !1) {\n e: for (; ; ) {\n if (!n && pr.valid(e))\n return e;\n let s = e.pos, o = null;\n for (let i = e.depth; ; i--) {\n let a = e.node(i);\n if (t > 0 ? e.indexAfter(i) < a.childCount : e.index(i) > 0) {\n o = a.child(t > 0 ? e.indexAfter(i) : e.index(i) - 1);\n break;\n } else if (i == 0)\n return null;\n s += t;\n let l = e.doc.resolve(s);\n if (pr.valid(l))\n return l;\n }\n for (; ; ) {\n let i = t > 0 ? o.firstChild : o.lastChild;\n if (!i) {\n if (o.isAtom && !o.isText && !ot.isSelectable(o)) {\n e = e.doc.resolve(s + o.nodeSize * t), n = !1;\n continue e;\n }\n break;\n }\n o = i, s += t;\n let a = e.doc.resolve(s);\n if (pr.valid(a))\n return a;\n }\n return null;\n }\n }\n}\npr.prototype.visible = !1;\npr.findFrom = pr.findGapCursorFrom;\nSt.jsonID(\"gapcursor\", pr);\nclass hd {\n constructor(e) {\n this.pos = e;\n }\n map(e) {\n return new hd(e.map(this.pos));\n }\n resolve(e) {\n let t = e.resolve(this.pos);\n return pr.valid(t) ? new pr(t) : St.near(t);\n }\n}\nfunction bm(r) {\n return r.isAtom || r.spec.isolating || r.spec.createGapCursor;\n}\nfunction _k(r) {\n for (let e = r.depth; e >= 0; e--) {\n let t = r.index(e), n = r.node(e);\n if (t == 0) {\n if (n.type.spec.isolating)\n return !0;\n continue;\n }\n for (let s = n.child(t - 1); ; s = s.lastChild) {\n if (s.childCount == 0 && !s.inlineContent || bm(s.type))\n return !0;\n if (s.inlineContent)\n return !1;\n }\n }\n return !0;\n}\nfunction Sk(r) {\n for (let e = r.depth; e >= 0; e--) {\n let t = r.indexAfter(e), n = r.node(e);\n if (t == n.childCount) {\n if (n.type.spec.isolating)\n return !0;\n continue;\n }\n for (let s = n.child(t); ; s = s.firstChild) {\n if (s.childCount == 0 && !s.inlineContent || bm(s.type))\n return !0;\n if (s.inlineContent)\n return !1;\n }\n }\n return !0;\n}\nfunction Ek() {\n return new mr({\n props: {\n decorations: Pk,\n createSelectionBetween(r, e, t) {\n return e.pos == t.pos && pr.valid(t) ? new pr(t) : null;\n },\n handleClick: Mk,\n handleKeyDown: Tk,\n handleDOMEvents: { beforeinput: Ak }\n }\n });\n}\nconst Tk = vh({\n ArrowLeft: yi(\"horiz\", -1),\n ArrowRight: yi(\"horiz\", 1),\n ArrowUp: yi(\"vert\", -1),\n ArrowDown: yi(\"vert\", 1)\n});\nfunction yi(r, e) {\n const t = r == \"vert\" ? e > 0 ? \"down\" : \"up\" : e > 0 ? \"right\" : \"left\";\n return function(n, s, o) {\n let i = n.selection, a = e > 0 ? i.$to : i.$from, l = i.empty;\n if (i instanceof ht) {\n if (!o.endOfTextblock(t) || a.depth == 0)\n return !1;\n l = !1, a = n.doc.resolve(e > 0 ? a.after() : a.before());\n }\n let d = pr.findGapCursorFrom(a, e, l);\n return d ? (s && s(n.tr.setSelection(new pr(d))), !0) : !1;\n };\n}\nfunction Mk(r, e, t) {\n if (!r || !r.editable)\n return !1;\n let n = r.state.doc.resolve(e);\n if (!pr.valid(n))\n return !1;\n let s = r.posAtCoords({ left: t.clientX, top: t.clientY });\n return s && s.inside > -1 && ot.isSelectable(r.state.doc.nodeAt(s.inside)) ? !1 : (r.dispatch(r.state.tr.setSelection(new pr(n))), !0);\n}\nfunction Ak(r, e) {\n if (e.inputType != \"insertCompositionText\" || !(r.state.selection instanceof pr))\n return !1;\n let { $from: t } = r.state.selection, n = t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);\n if (!n)\n return !1;\n let s = ye.empty;\n for (let i = n.length - 1; i >= 0; i--)\n s = ye.from(n[i].createAndFill(null, s));\n let o = r.state.tr.replace(t.pos, t.pos, new De(s, 0, 0));\n return o.setSelection(ht.near(o.doc.resolve(t.pos + 1))), r.dispatch(o), !1;\n}\nfunction Pk(r) {\n if (!(r.selection instanceof pr))\n return null;\n let e = document.createElement(\"div\");\n return e.className = \"ProseMirror-gapcursor\", lr.create(r.doc, [qr.widget(r.selection.head, e, { key: \"gapcursor\" })]);\n}\nvar ya = 200, Nr = function() {\n};\nNr.prototype.append = function(e) {\n return e.length ? (e = Nr.from(e), !this.length && e || e.length < ya && this.leafAppend(e) || this.length < ya && e.leafPrepend(this) || this.appendInner(e)) : this;\n};\nNr.prototype.prepend = function(e) {\n return e.length ? Nr.from(e).append(this) : this;\n};\nNr.prototype.appendInner = function(e) {\n return new Nk(this, e);\n};\nNr.prototype.slice = function(e, t) {\n return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? Nr.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));\n};\nNr.prototype.get = function(e) {\n if (!(e < 0 || e >= this.length))\n return this.getInner(e);\n};\nNr.prototype.forEach = function(e, t, n) {\n t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);\n};\nNr.prototype.map = function(e, t, n) {\n t === void 0 && (t = 0), n === void 0 && (n = this.length);\n var s = [];\n return this.forEach(function(o, i) {\n return s.push(e(o, i));\n }, t, n), s;\n};\nNr.from = function(e) {\n return e instanceof Nr ? e : e && e.length ? new ym(e) : Nr.empty;\n};\nvar ym = /* @__PURE__ */ (function(r) {\n function e(n) {\n r.call(this), this.values = n;\n }\n r && (e.__proto__ = r), e.prototype = Object.create(r && r.prototype), e.prototype.constructor = e;\n var t = { length: { configurable: !0 }, depth: { configurable: !0 } };\n return e.prototype.flatten = function() {\n return this.values;\n }, e.prototype.sliceInner = function(s, o) {\n return s == 0 && o == this.length ? this : new e(this.values.slice(s, o));\n }, e.prototype.getInner = function(s) {\n return this.values[s];\n }, e.prototype.forEachInner = function(s, o, i, a) {\n for (var l = o; l < i; l++)\n if (s(this.values[l], a + l) === !1)\n return !1;\n }, e.prototype.forEachInvertedInner = function(s, o, i, a) {\n for (var l = o - 1; l >= i; l--)\n if (s(this.values[l], a + l) === !1)\n return !1;\n }, e.prototype.leafAppend = function(s) {\n if (this.length + s.length <= ya)\n return new e(this.values.concat(s.flatten()));\n }, e.prototype.leafPrepend = function(s) {\n if (this.length + s.length <= ya)\n return new e(s.flatten().concat(this.values));\n }, t.length.get = function() {\n return this.values.length;\n }, t.depth.get = function() {\n return 0;\n }, Object.defineProperties(e.prototype, t), e;\n})(Nr);\nNr.empty = new ym([]);\nvar Nk = /* @__PURE__ */ (function(r) {\n function e(t, n) {\n r.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;\n }\n return r && (e.__proto__ = r), e.prototype = Object.create(r && r.prototype), e.prototype.constructor = e, e.prototype.flatten = function() {\n return this.left.flatten().concat(this.right.flatten());\n }, e.prototype.getInner = function(n) {\n return n < this.left.length ? this.left.get(n) : this.right.get(n - this.left.length);\n }, e.prototype.forEachInner = function(n, s, o, i) {\n var a = this.left.length;\n if (s < a && this.left.forEachInner(n, s, Math.min(o, a), i) === !1 || o > a && this.right.forEachInner(n, Math.max(s - a, 0), Math.min(this.length, o) - a, i + a) === !1)\n return !1;\n }, e.prototype.forEachInvertedInner = function(n, s, o, i) {\n var a = this.left.length;\n if (s > a && this.right.forEachInvertedInner(n, s - a, Math.max(o, a) - a, i + a) === !1 || o < a && this.left.forEachInvertedInner(n, Math.min(s, a), o, i) === !1)\n return !1;\n }, e.prototype.sliceInner = function(n, s) {\n if (n == 0 && s == this.length)\n return this;\n var o = this.left.length;\n return s <= o ? this.left.slice(n, s) : n >= o ? this.right.slice(n - o, s - o) : this.left.slice(n, o).append(this.right.slice(0, s - o));\n }, e.prototype.leafAppend = function(n) {\n var s = this.right.leafAppend(n);\n if (s)\n return new e(this.left, s);\n }, e.prototype.leafPrepend = function(n) {\n var s = this.left.leafPrepend(n);\n if (s)\n return new e(s, this.right);\n }, e.prototype.appendInner = function(n) {\n return this.left.depth >= Math.max(this.right.depth, n.depth) + 1 ? new e(this.left, new e(this.right, n)) : new e(this, n);\n }, e;\n})(Nr);\nconst Ok = 500;\nclass mn {\n constructor(e, t) {\n this.items = e, this.eventCount = t;\n }\n // Pop the latest event off the branch's history and apply it\n // to a document transform.\n popEvent(e, t) {\n if (this.eventCount == 0)\n return null;\n let n = this.items.length;\n for (; ; n--)\n if (this.items.get(n - 1).selection) {\n --n;\n break;\n }\n let s, o;\n t && (s = this.remapping(n, this.items.length), o = s.maps.length);\n let i = e.tr, a, l, d = [], u = [];\n return this.items.forEach((f, h) => {\n if (!f.step) {\n s || (s = this.remapping(n, h + 1), o = s.maps.length), o--, u.push(f);\n return;\n }\n if (s) {\n u.push(new Cn(f.map));\n let p = f.step.map(s.slice(o)), g;\n p && i.maybeStep(p).doc && (g = i.mapping.maps[i.mapping.maps.length - 1], d.push(new Cn(g, void 0, void 0, d.length + u.length))), o--, g && s.appendMap(g, o);\n } else\n i.maybeStep(f.step);\n if (f.selection)\n return a = s ? f.selection.map(s.slice(o)) : f.selection, l = new mn(this.items.slice(0, n).append(u.reverse().concat(d)), this.eventCount - 1), !1;\n }, this.items.length, 0), { remaining: l, transform: i, selection: a };\n }\n // Create a new branch with the given transform added.\n addTransform(e, t, n, s) {\n let o = [], i = this.eventCount, a = this.items, l = !s && a.length ? a.get(a.length - 1) : null;\n for (let u = 0; u < e.steps.length; u++) {\n let f = e.steps[u].invert(e.docs[u]), h = new Cn(e.mapping.maps[u], f, t), p;\n (p = l && l.merge(h)) && (h = p, u ? o.pop() : a = a.slice(0, a.length - 1)), o.push(h), t && (i++, t = void 0), s || (l = h);\n }\n let d = i - n.depth;\n return d > Ik && (a = $k(a, d), i -= d), new mn(a.append(o), i);\n }\n remapping(e, t) {\n let n = new jo();\n return this.items.forEach((s, o) => {\n let i = s.mirrorOffset != null && o - s.mirrorOffset >= e ? n.maps.length - s.mirrorOffset : void 0;\n n.appendMap(s.map, i);\n }, e, t), n;\n }\n addMaps(e) {\n return this.eventCount == 0 ? this : new mn(this.items.append(e.map((t) => new Cn(t))), this.eventCount);\n }\n // When the collab module receives remote changes, the history has\n // to know about those, so that it can adjust the steps that were\n // rebased on top of the remote changes, and include the position\n // maps for the remote changes in its array of items.\n rebased(e, t) {\n if (!this.eventCount)\n return this;\n let n = [], s = Math.max(0, this.items.length - t), o = e.mapping, i = e.steps.length, a = this.eventCount;\n this.items.forEach((h) => {\n h.selection && a--;\n }, s);\n let l = t;\n this.items.forEach((h) => {\n let p = o.getMirror(--l);\n if (p == null)\n return;\n i = Math.min(i, p);\n let g = o.maps[p];\n if (h.step) {\n let b = e.steps[p].invert(e.docs[p]), y = h.selection && h.selection.map(o.slice(l + 1, p));\n y && a++, n.push(new Cn(g, b, y));\n } else\n n.push(new Cn(g));\n }, s);\n let d = [];\n for (let h = t; h < i; h++)\n d.push(new Cn(o.maps[h]));\n let u = this.items.slice(0, s).append(d).append(n), f = new mn(u, a);\n return f.emptyItemCount() > Ok && (f = f.compress(this.items.length - n.length)), f;\n }\n emptyItemCount() {\n let e = 0;\n return this.items.forEach((t) => {\n t.step || e++;\n }), e;\n }\n // Compressing a branch means rewriting it to push the air (map-only\n // items) out. During collaboration, these naturally accumulate\n // because each remote change adds one. The `upto` argument is used\n // to ensure that only the items below a given level are compressed,\n // because `rebased` relies on a clean, untouched set of items in\n // order to associate old items with rebased steps.\n compress(e = this.items.length) {\n let t = this.remapping(0, e), n = t.maps.length, s = [], o = 0;\n return this.items.forEach((i, a) => {\n if (a >= e)\n s.push(i), i.selection && o++;\n else if (i.step) {\n let l = i.step.map(t.slice(n)), d = l && l.getMap();\n if (n--, d && t.appendMap(d, n), l) {\n let u = i.selection && i.selection.map(t.slice(n));\n u && o++;\n let f = new Cn(d.invert(), l, u), h, p = s.length - 1;\n (h = s.length && s[p].merge(f)) ? s[p] = h : s.push(f);\n }\n } else i.map && n--;\n }, this.items.length, 0), new mn(Nr.from(s.reverse()), o);\n }\n}\nmn.empty = new mn(Nr.empty, 0);\nfunction $k(r, e) {\n let t;\n return r.forEach((n, s) => {\n if (n.selection && e-- == 0)\n return t = s, !1;\n }), r.slice(t);\n}\nclass Cn {\n constructor(e, t, n, s) {\n this.map = e, this.step = t, this.selection = n, this.mirrorOffset = s;\n }\n merge(e) {\n if (this.step && e.step && !e.selection) {\n let t = e.step.merge(this.step);\n if (t)\n return new Cn(t.getMap().invert(), t, this.selection);\n }\n }\n}\nclass Gn {\n constructor(e, t, n, s, o) {\n this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = s, this.prevComposition = o;\n }\n}\nconst Ik = 20;\nfunction zk(r, e, t, n) {\n let s = t.getMeta(As), o;\n if (s)\n return s.historyState;\n t.getMeta(Lk) && (r = new Gn(r.done, r.undone, null, 0, -1));\n let i = t.getMeta(\"appendedTransaction\");\n if (t.steps.length == 0)\n return r;\n if (i && i.getMeta(As))\n return i.getMeta(As).redo ? new Gn(r.done.addTransform(t, void 0, n, Ti(e)), r.undone, lf(t.mapping.maps), r.prevTime, r.prevComposition) : new Gn(r.done, r.undone.addTransform(t, void 0, n, Ti(e)), null, r.prevTime, r.prevComposition);\n if (t.getMeta(\"addToHistory\") !== !1 && !(i && i.getMeta(\"addToHistory\") === !1)) {\n let a = t.getMeta(\"composition\"), l = r.prevTime == 0 || !i && r.prevComposition != a && (r.prevTime < (t.time || 0) - n.newGroupDelay || !Rk(t, r.prevRanges)), d = i ? wl(r.prevRanges, t.mapping) : lf(t.mapping.maps);\n return new Gn(r.done.addTransform(t, l ? e.selection.getBookmark() : void 0, n, Ti(e)), mn.empty, d, t.time, a ?? r.prevComposition);\n } else return (o = t.getMeta(\"rebased\")) ? new Gn(r.done.rebased(t, o), r.undone.rebased(t, o), wl(r.prevRanges, t.mapping), r.prevTime, r.prevComposition) : new Gn(r.done.addMaps(t.mapping.maps), r.undone.addMaps(t.mapping.maps), wl(r.prevRanges, t.mapping), r.prevTime, r.prevComposition);\n}\nfunction Rk(r, e) {\n if (!e)\n return !1;\n if (!r.docChanged)\n return !0;\n let t = !1;\n return r.mapping.maps[0].forEach((n, s) => {\n for (let o = 0; o < e.length; o += 2)\n n <= e[o + 1] && s >= e[o] && (t = !0);\n }), t;\n}\nfunction lf(r) {\n let e = [];\n for (let t = r.length - 1; t >= 0 && e.length == 0; t--)\n r[t].forEach((n, s, o, i) => e.push(o, i));\n return e;\n}\nfunction wl(r, e) {\n if (!r)\n return null;\n let t = [];\n for (let n = 0; n < r.length; n += 2) {\n let s = e.map(r[n], 1), o = e.map(r[n + 1], -1);\n s <= o && t.push(s, o);\n }\n return t;\n}\nfunction jk(r, e, t) {\n let n = Ti(e), s = As.get(e).spec.config, o = (t ? r.undone : r.done).popEvent(e, n);\n if (!o)\n return null;\n let i = o.selection.resolve(o.transform.doc), a = (t ? r.done : r.undone).addTransform(o.transform, e.selection.getBookmark(), s, n), l = new Gn(t ? a : o.remaining, t ? o.remaining : a, null, 0, -1);\n return o.transform.setSelection(i).setMeta(As, { redo: t, historyState: l });\n}\nlet kl = !1, cf = null;\nfunction Ti(r) {\n let e = r.plugins;\n if (cf != e) {\n kl = !1, cf = e;\n for (let t = 0; t < e.length; t++)\n if (e[t].spec.historyPreserveItems) {\n kl = !0;\n break;\n }\n }\n return kl;\n}\nconst As = new Or(\"history\"), Lk = new Or(\"closeHistory\");\nfunction Dk(r = {}) {\n return r = {\n depth: r.depth || 100,\n newGroupDelay: r.newGroupDelay || 500\n }, new mr({\n key: As,\n state: {\n init() {\n return new Gn(mn.empty, mn.empty, null, 0, -1);\n },\n apply(e, t, n) {\n return zk(t, n, e, r);\n }\n },\n config: r,\n props: {\n handleDOMEvents: {\n beforeinput(e, t) {\n let n = t.inputType, s = n == \"historyUndo\" ? wm : n == \"historyRedo\" ? km : null;\n return !s || !e.editable ? !1 : (t.preventDefault(), s(e.state, e.dispatch));\n }\n }\n }\n });\n}\nfunction xm(r, e) {\n return (t, n) => {\n let s = As.getState(t);\n if (!s || (r ? s.undone : s.done).eventCount == 0)\n return !1;\n if (n) {\n let o = jk(s, t, r);\n o && n(e ? o.scrollIntoView() : o);\n }\n return !0;\n };\n}\nconst wm = xm(!1, !0), km = xm(!0, !0);\nyr.create({\n name: \"characterCount\",\n addOptions() {\n return {\n limit: null,\n mode: \"textSize\",\n textCounter: (r) => r.length,\n wordCounter: (r) => r.split(\" \").filter((e) => e !== \"\").length\n };\n },\n addStorage() {\n return {\n characters: () => 0,\n words: () => 0\n };\n },\n onBeforeCreate() {\n this.storage.characters = (r) => {\n const e = r?.node || this.editor.state.doc;\n if ((r?.mode || this.options.mode) === \"textSize\") {\n const n = e.textBetween(0, e.content.size, void 0, \" \");\n return this.options.textCounter(n);\n }\n return e.nodeSize;\n }, this.storage.words = (r) => {\n const e = r?.node || this.editor.state.doc, t = e.textBetween(0, e.content.size, \" \", \" \");\n return this.options.wordCounter(t);\n };\n },\n addProseMirrorPlugins() {\n let r = !1;\n return [\n new mr({\n key: new Or(\"characterCount\"),\n appendTransaction: (e, t, n) => {\n if (r)\n return;\n const s = this.options.limit;\n if (s == null || s === 0) {\n r = !0;\n return;\n }\n const o = this.storage.characters({ node: n.doc });\n if (o > s) {\n const i = o - s, a = 0, l = i;\n console.warn(\n `[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`\n );\n const d = n.tr.deleteRange(a, l);\n return r = !0, d;\n }\n r = !0;\n },\n filterTransaction: (e, t) => {\n const n = this.options.limit;\n if (!e.docChanged || n === 0 || n === null || n === void 0)\n return !0;\n const s = this.storage.characters({ node: t.doc }), o = this.storage.characters({ node: e.doc });\n if (o <= n || s > n && o > n && o <= s)\n return !0;\n if (s > n && o > n && o > s || !e.getMeta(\"paste\"))\n return !1;\n const a = e.selection.$head.pos, l = o - n, d = a - l, u = a;\n return e.deleteRange(d, u), !(this.storage.characters({ node: e.doc }) > n);\n }\n })\n ];\n }\n});\nyr.create({\n name: \"dropCursor\",\n addOptions() {\n return {\n color: \"currentColor\",\n width: 1,\n class: void 0\n };\n },\n addProseMirrorPlugins() {\n return [kk(this.options)];\n }\n});\nyr.create({\n name: \"focus\",\n addOptions() {\n return {\n className: \"has-focus\",\n mode: \"all\"\n };\n },\n addProseMirrorPlugins() {\n return [\n new mr({\n key: new Or(\"focus\"),\n props: {\n decorations: ({ doc: r, selection: e }) => {\n const { isEditable: t, isFocused: n } = this.editor, { anchor: s } = e, o = [];\n if (!t || !n)\n return lr.create(r, []);\n let i = 0;\n this.options.mode === \"deepest\" && r.descendants((l, d) => {\n if (l.isText)\n return;\n if (!(s >= d && s <= d + l.nodeSize - 1))\n return !1;\n i += 1;\n });\n let a = 0;\n return r.descendants((l, d) => {\n if (l.isText || !(s >= d && s <= d + l.nodeSize - 1))\n return !1;\n if (a += 1, this.options.mode === \"deepest\" && i - a > 0 || this.options.mode === \"shallowest\" && a > 1)\n return this.options.mode === \"deepest\";\n o.push(\n qr.node(d, d + l.nodeSize, {\n class: this.options.className\n })\n );\n }), lr.create(r, o);\n }\n }\n })\n ];\n }\n});\nvar Fk = yr.create({\n name: \"gapCursor\",\n addProseMirrorPlugins() {\n return [Ek()];\n },\n extendNodeSchema(r) {\n var e;\n const t = {\n name: r.name,\n options: r.options,\n storage: r.storage\n };\n return {\n allowGapCursor: (e = Wt(Ke(r, \"allowGapCursor\", t))) != null ? e : null\n };\n }\n}), df = \"placeholder\";\nfunction Bk(r) {\n return r.replace(/\\s+/g, \"-\").replace(/[^a-zA-Z0-9-]/g, \"\").replace(/^[0-9-]+/, \"\").replace(/^-+/, \"\").toLowerCase();\n}\nyr.create({\n name: \"placeholder\",\n addOptions() {\n return {\n emptyEditorClass: \"is-editor-empty\",\n emptyNodeClass: \"is-empty\",\n dataAttribute: df,\n placeholder: \"Write something \u2026\",\n showOnlyWhenEditable: !0,\n showOnlyCurrent: !0,\n includeChildren: !1\n };\n },\n addProseMirrorPlugins() {\n const r = this.options.dataAttribute ? `data-${Bk(this.options.dataAttribute)}` : `data-${df}`;\n return [\n new mr({\n key: new Or(\"placeholder\"),\n props: {\n decorations: ({ doc: e, selection: t }) => {\n const n = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: s } = t, o = [];\n if (!n)\n return null;\n const i = this.editor.isEmpty;\n return e.descendants((a, l) => {\n const d = s >= l && s <= l + a.nodeSize, u = !a.isLeaf && za(a);\n if (!a.type.isTextblock)\n return this.options.includeChildren;\n if ((d || !this.options.showOnlyCurrent) && u) {\n const f = [this.options.emptyNodeClass];\n i && f.push(this.options.emptyEditorClass);\n const h = qr.node(l, l + a.nodeSize, {\n class: f.join(\" \"),\n [r]: typeof this.options.placeholder == \"function\" ? this.options.placeholder({\n editor: this.editor,\n node: a,\n pos: l,\n hasAnchor: d\n }) : this.options.placeholder\n });\n o.push(h);\n }\n return this.options.includeChildren;\n }), lr.create(e, o);\n }\n }\n })\n ];\n }\n});\nyr.create({\n name: \"selection\",\n addOptions() {\n return {\n className: \"selection\"\n };\n },\n addProseMirrorPlugins() {\n const { editor: r, options: e } = this;\n return [\n new mr({\n key: new Or(\"selection\"),\n props: {\n decorations(t) {\n return t.selection.empty || r.isFocused || !r.isEditable || wx(t.selection) || r.view.dragging ? null : lr.create(t.doc, [\n qr.inline(t.selection.from, t.selection.to, {\n class: e.className\n })\n ]);\n }\n }\n })\n ];\n }\n});\nvar Hk = \"skipTrailingNode\";\nfunction uf({ types: r, node: e }) {\n return e && Array.isArray(r) && r.includes(e.type) || e?.type === r;\n}\nyr.create({\n name: \"trailingNode\",\n addOptions() {\n return {\n node: void 0,\n notAfter: []\n };\n },\n addProseMirrorPlugins() {\n var r;\n const e = new Or(this.name), t = this.options.node || ((r = this.editor.schema.topNodeType.contentMatch.defaultType) == null ? void 0 : r.name) || \"paragraph\", n = Object.entries(this.editor.schema.nodes).map(([, s]) => s).filter((s) => (this.options.notAfter || []).concat(t).includes(s.name));\n return [\n new mr({\n key: e,\n appendTransaction: (s, o, i) => {\n const { doc: a, tr: l, schema: d } = i, u = e.getState(i), f = a.content.size, h = d.nodes[t];\n if (!s.some((p) => p.getMeta(Hk)) && u)\n return l.insert(f, h.create());\n },\n state: {\n init: (s, o) => {\n const i = o.tr.doc.lastChild;\n return !uf({ node: i, types: n });\n },\n apply: (s, o) => {\n if (!s.docChanged || s.getMeta(\"__uniqueIDTransaction\"))\n return o;\n const i = s.doc.lastChild;\n return !uf({ node: i, types: n });\n }\n }\n })\n ];\n }\n});\nvar qk = yr.create({\n name: \"undoRedo\",\n addOptions() {\n return {\n depth: 100,\n newGroupDelay: 500\n };\n },\n addCommands() {\n return {\n undo: () => ({ state: r, dispatch: e }) => wm(r, e),\n redo: () => ({ state: r, dispatch: e }) => km(r, e)\n };\n },\n addProseMirrorPlugins() {\n return [Dk(this.options)];\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-z\": () => this.editor.commands.undo(),\n \"Shift-Mod-z\": () => this.editor.commands.redo(),\n \"Mod-y\": () => this.editor.commands.redo(),\n // Russian keyboard layouts\n \"Mod-\u044F\": () => this.editor.commands.undo(),\n \"Shift-Mod-\u044F\": () => this.editor.commands.redo()\n };\n }\n}), uc = qk, Vk = yr.create({\n name: \"textAlign\",\n addOptions() {\n return {\n types: [],\n alignments: [\"left\", \"center\", \"right\", \"justify\"],\n defaultAlignment: null\n };\n },\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n textAlign: {\n default: this.options.defaultAlignment,\n parseHTML: (r) => {\n const e = r.style.textAlign;\n return this.options.alignments.includes(e) ? e : this.options.defaultAlignment;\n },\n renderHTML: (r) => r.textAlign ? { style: `text-align: ${r.textAlign}` } : {}\n }\n }\n }\n ];\n },\n addCommands() {\n return {\n setTextAlign: (r) => ({ commands: e }) => this.options.alignments.includes(r) ? this.options.types.map((t) => e.updateAttributes(t, { textAlign: r })).some((t) => t) : !1,\n unsetTextAlign: () => ({ commands: r }) => this.options.types.map((e) => r.resetAttributes(e, \"textAlign\")).some((e) => e),\n toggleTextAlign: (r) => ({ editor: e, commands: t }) => this.options.alignments.includes(r) ? e.isActive({ textAlign: r }) ? t.unsetTextAlign() : t.setTextAlign(r) : !1\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Shift-l\": () => this.editor.commands.setTextAlign(\"left\"),\n \"Mod-Shift-e\": () => this.editor.commands.setTextAlign(\"center\"),\n \"Mod-Shift-r\": () => this.editor.commands.setTextAlign(\"right\"),\n \"Mod-Shift-j\": () => this.editor.commands.setTextAlign(\"justify\")\n };\n }\n}), Cm = Vk, _m = Fk, Wk = S('<button type=\"button\" class=\"text-style-button svelte-6hrxe2\" aria-haspopup=\"listbox\"><span class=\"text-style-label\"> </span> <!></button>'), Uk = S('<button type=\"button\" role=\"option\"><span class=\"text-style-item-label\"> </span> <!></button>'), Jk = S('<div class=\"text-style-panel svelte-6hrxe2\" role=\"listbox\" tabindex=\"-1\"></div>'), Kk = S('<button type=\"button\" aria-label=\"Align Left\" title=\"Align Left\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M0 2h16v2H0V2zm0 4h10v2H0V6zm0 4h16v2H0v-2zm0 4h10v2H0v-2z\"></path></svg></button> <button type=\"button\" aria-label=\"Align Center\" title=\"Align Center\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M0 2h16v2H0V2zm3 4h10v2H3V6zm-3 4h16v2H0v-2zm3 4h10v2H3v-2z\"></path></svg></button> <button type=\"button\" aria-label=\"Align Right\" title=\"Align Right\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M0 2h16v2H0V2zm6 4h10v2H6V6zm-6 4h16v2H0v-2zm6 4h10v2H6v-2z\"></path></svg></button>', 1), Gk = S('<div class=\"separator svelte-6hrxe2\"></div> <button title=\"Image Width\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M0 3v10h16V3H0zm14 8H2V5h12v6z\"></path><path d=\"M3 6h2v4H3zM11 6h2v4h-2z\"></path></svg></button>', 1), Yk = S('<div class=\"image-popover svelte-6hrxe2\"><div class=\"image-popover-header svelte-6hrxe2\"><span class=\"image-popover-title svelte-6hrxe2\">Image Settings</span> <button type=\"button\" class=\"image-popover-close svelte-6hrxe2\" aria-label=\"Close\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z\"></path></svg></button></div> <div class=\"image-popover-body svelte-6hrxe2\"><div class=\"image-size-presets svelte-6hrxe2\"><button>Full</button> <button>400px</button> <button>300px</button> <button>200px</button></div> <div class=\"image-custom-width svelte-6hrxe2\"><label for=\"image-width-custom\" class=\"svelte-6hrxe2\">Custom width</label> <div class=\"custom-width-input svelte-6hrxe2\"><input type=\"text\" id=\"image-width-custom\" placeholder=\"e.g. 400px\" class=\"svelte-6hrxe2\"/> <button class=\"apply-width-btn svelte-6hrxe2\">Apply</button></div></div></div></div>'), Xk = S('<div class=\"button-options svelte-6hrxe2\"><div class=\"button-options-row svelte-6hrxe2\"><div class=\"button-option svelte-6hrxe2\"><label for=\"btn-bg\" class=\"svelte-6hrxe2\">Fill</label> <div class=\"color-input-wrapper svelte-6hrxe2\"><input type=\"color\" id=\"btn-bg\" class=\"svelte-6hrxe2\"/> <span class=\"color-value svelte-6hrxe2\"> </span></div></div> <div class=\"button-option svelte-6hrxe2\"><label for=\"btn-border\" class=\"svelte-6hrxe2\">Border</label> <div class=\"color-input-wrapper svelte-6hrxe2\"><input type=\"color\" id=\"btn-border\" class=\"svelte-6hrxe2\"/> <span class=\"color-value svelte-6hrxe2\"> </span></div></div></div> <div class=\"button-options-row svelte-6hrxe2\"><div class=\"button-option svelte-6hrxe2\"><label for=\"btn-width\" class=\"svelte-6hrxe2\">Width</label> <input type=\"text\" id=\"btn-width\" placeholder=\"1px\" class=\"svelte-6hrxe2\"/></div> <div class=\"button-option svelte-6hrxe2\"><label for=\"btn-radius\" class=\"svelte-6hrxe2\">Radius</label> <input type=\"text\" id=\"btn-radius\" placeholder=\"5px\" class=\"svelte-6hrxe2\"/></div></div></div>'), Qk = S('<div class=\"link-popover svelte-6hrxe2\"><div class=\"link-popover-header svelte-6hrxe2\"><span class=\"link-popover-title svelte-6hrxe2\">Insert Link</span> <button type=\"button\" class=\"link-popover-close svelte-6hrxe2\" aria-label=\"Close\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z\"></path></svg></button></div> <div class=\"link-popover-body svelte-6hrxe2\"><div class=\"link-type-tabs svelte-6hrxe2\"><button type=\"button\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg> <span>Inline</span></button> <button type=\"button\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M1 4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4Zm1.5 1.5v5h11v-5h-11Z\"></path></svg> <span>Button</span></button></div> <div class=\"link-input-group svelte-6hrxe2\"><label for=\"link-url-input\" class=\"svelte-6hrxe2\">URL</label> <input type=\"text\" id=\"link-url-input\" placeholder=\"https://example.com\" class=\"svelte-6hrxe2\"/></div> <!></div> <div class=\"link-popover-footer svelte-6hrxe2\"><button type=\"button\" class=\"link-cancel-btn svelte-6hrxe2\">Cancel</button> <button type=\"button\" class=\"link-insert-btn svelte-6hrxe2\">Insert Link</button></div></div>'), Zk = S('<div class=\"modal-backdrop svelte-6hrxe2\" role=\"presentation\"><div class=\"modal image-modal svelte-6hrxe2\" role=\"dialog\" aria-modal=\"true\" tabindex=\"-1\"><div class=\"modal-header svelte-6hrxe2\"><h3>Insert Image</h3> <button class=\"close-btn svelte-6hrxe2\"><!></button></div> <div class=\"modal-body image-modal-body svelte-6hrxe2\"><!></div> <div class=\"modal-footer svelte-6hrxe2\"><!> <!></div></div></div>'), e2 = S('<div class=\"modal-backdrop svelte-6hrxe2\" role=\"presentation\"><div class=\"modal svelte-6hrxe2\" role=\"dialog\" aria-modal=\"true\" tabindex=\"-1\"><div class=\"modal-header svelte-6hrxe2\"><h3>Send Test Email</h3> <button class=\"close-btn svelte-6hrxe2\"><!></button></div> <div class=\"modal-body svelte-6hrxe2\"><p class=\"help-text\">Send a test email to preview how your newsletter will look.</p> <div class=\"field svelte-6hrxe2\"><label for=\"testEmail\" class=\"svelte-6hrxe2\">Test Email Address</label> <input type=\"email\" id=\"testEmail\" placeholder=\"your@email.com\" class=\"test-email-input svelte-6hrxe2\"/></div></div> <div class=\"modal-footer svelte-6hrxe2\"><!> <!></div></div></div>'), t2 = S('<div class=\"email-composer svelte-6hrxe2\"><div class=\"split-container svelte-6hrxe2\"><div class=\"preview-pane svelte-6hrxe2\"><div class=\"pane-header svelte-6hrxe2\"><h3 class=\"svelte-6hrxe2\">Preview</h3></div> <div class=\"preview-wrapper svelte-6hrxe2\"><iframe class=\"email-preview svelte-6hrxe2\" title=\"Email Preview\" frameborder=\"0\"></iframe></div></div> <div><div class=\"mobile-sheet-header svelte-6hrxe2\"><button type=\"button\" class=\"sheet-grabber svelte-6hrxe2\"><span class=\"sheet-grabber-handle svelte-6hrxe2\"></span> <span class=\"sheet-grabber-title svelte-6hrxe2\">Edit Newsletter</span></button></div> <div class=\"pane-header svelte-6hrxe2\"><h3 class=\"svelte-6hrxe2\">Editor</h3> <div class=\"header-actions svelte-6hrxe2\"><!> <!> <!></div></div> <div class=\"editor-content svelte-6hrxe2\"><div class=\"field svelte-6hrxe2\"><div class=\"field-label-row svelte-6hrxe2\"><label for=\"subject\" class=\"svelte-6hrxe2\">Subject Line</label></div> <input type=\"text\" id=\"subject\" placeholder=\"e.g., Our latest updates\" class=\"svelte-6hrxe2\"/></div> <div class=\"field svelte-6hrxe2\"><div class=\"field-label-row svelte-6hrxe2\"><span class=\"field-label svelte-6hrxe2\">Main Content</span> <!></div> <div class=\"rich-text-container svelte-6hrxe2\"><div class=\"toolbar svelte-6hrxe2\"><div class=\"text-style-selector svelte-6hrxe2\"><!> <!></div> <div class=\"separator svelte-6hrxe2\"></div> <!> <div class=\"separator svelte-6hrxe2\"></div> <button title=\"Bold\"><!></button> <button title=\"Italic\"><!></button> <button title=\"Underline\" aria-label=\"Underline\"><span style=\"text-decoration: underline; font-weight: 600;\">U</span></button> <div class=\"separator svelte-6hrxe2\"></div> <button title=\"Bullet List\"><!></button> <button title=\"Numbered List\"><!></button> <div class=\"separator svelte-6hrxe2\"></div> <button title=\"Insert Link\"><!></button> <button title=\"Insert Image\" class=\"svelte-6hrxe2\"><!></button> <!> <!> <!></div> <div class=\"rich-editor svelte-6hrxe2\"></div></div></div> <div class=\"field svelte-6hrxe2\"><div class=\"field-label-row svelte-6hrxe2\"><span class=\"field-label svelte-6hrxe2\">Footer</span> <!></div> <p class=\"field-description svelte-6hrxe2\">Additional footer text before unsubscribe link</p> <div class=\"rich-text-container footer-container svelte-6hrxe2\"><div class=\"toolbar footer-toolbar svelte-6hrxe2\"><div class=\"toolbar-group svelte-6hrxe2\"><button title=\"Bold\"><!></button> <button title=\"Italic\"><!></button> <button title=\"Link\"><!></button></div></div> <div class=\"rich-editor footer-editor svelte-6hrxe2\"></div></div></div></div></div></div></div> <!> <!>', 1);\nconst r2 = {\n hash: \"svelte-6hrxe2\",\n code: `.email-composer.svelte-6hrxe2 {display:flex;flex-direction:column;flex:1;min-height:0;position:relative;}.header-actions.svelte-6hrxe2 {display:flex;align-items:center;gap:0.5rem;}.template-cards {display:flex;gap:0.75rem;margin:0.75rem 0;}.template-card {display:flex;flex-direction:column;padding:0.625rem 0.875rem;background:var(--bgColor-muted);border:1px solid var(--borderColor-default);border-radius:6px;text-decoration:none;color:inherit;min-width:140px;transition:all 0.2s ease;}.template-card:hover {border-color:var(--borderColor-emphasis);background:var(--bgColor-default);}.template-card.active {border-color:var(--fgColor-accent);background:var(--bgColor-accent-muted);box-shadow:0 0 0 1px var(--fgColor-accent);}.card-title {font-size:0.8125rem;font-weight:600;margin-bottom:0.125rem;}.card-desc {font-size:0.6875rem;color:var(--fgColor-muted);}.related-link {display:inline-flex;align-items:center;gap:0.375rem;font-size:0.75rem;color:var(--fgColor-accent);text-decoration:none;margin-top:0.25rem;}.related-link:hover {text-decoration:underline;}\n\n\n\n\t/* Split container */.split-container.svelte-6hrxe2 {display:grid;grid-template-columns:minmax(0, 1fr) minmax(380px, 520px);grid-template-rows:minmax(0, 1fr);flex:1;gap:0;min-height:0;overflow:hidden;position:relative;margin:0 -2rem;}.editor-pane.svelte-6hrxe2, .preview-pane.svelte-6hrxe2 {display:flex;flex-direction:column;min-width:0;min-height:0;background-color:var(--bgColor-default);}.editor-pane.svelte-6hrxe2 {border-left:1px solid var(--borderColor-default);}\n\n\t/* Mobile bottom sheet is hidden on desktop */.mobile-sheet-header.svelte-6hrxe2,\n\t.sheet-grabber.svelte-6hrxe2 {display:none;}\n\n\t@media (max-width: 900px) {.split-container.svelte-6hrxe2 {display:block;position:relative;margin:0;}.preview-pane.svelte-6hrxe2 {height:100%;}.editor-pane.svelte-6hrxe2 {--sheet-header-height: 3.5rem;--sheet-collapsed: 3.5rem;--sheet-max-height: 85dvh;--sheet-drag-offset: 0px;position:absolute;left:0;right:0;bottom:0;z-index:5;height:var(--sheet-max-height);border:1px solid var(--borderColor-default);border-left:0;border-right:0;border-bottom:0;border-radius:1.25rem 1.25rem 0 0;box-shadow:0 -8px 32px rgba(31, 35, 40, 0.12);transform:translateY(max(0px, var(--sheet-drag-offset)));transition:transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),\n\t\t\t\tbox-shadow 180ms ease;will-change:transform;overflow:hidden;}.editor-pane.sheet-collapsed.svelte-6hrxe2 {transform:translateY(calc(100% - var(--sheet-collapsed) + min(0px, var(--sheet-drag-offset))));box-shadow:0 10px 28px rgba(31, 35, 40, 0.18);}.editor-pane.sheet-dragging.svelte-6hrxe2 {transition:none;}.mobile-sheet-header.svelte-6hrxe2 {display:flex;align-items:center;flex-direction:column;flex-shrink:0;height:var(--sheet-header-height);width:100%;padding:0.625rem 0.75rem 0;border-radius:1.25rem 1.25rem 0 0;background:var(--bgColor-default);}.sheet-grabber.svelte-6hrxe2 {appearance:none;display:flex;align-items:center;flex-direction:column;gap:0.375rem;justify-content:center;width:100%;min-height:2.25rem;padding:0;border:0;background:transparent;cursor:grab;touch-action:none;}.sheet-grabber.svelte-6hrxe2:active {cursor:grabbing;}.sheet-grabber-handle.svelte-6hrxe2 {width:2.5rem;height:0.3125rem;border-radius:999px;background:var(--borderColor-emphasis, #8c959f);opacity:0.72;}.sheet-grabber-title.svelte-6hrxe2 {max-width:calc(100% - 2rem);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--fgColor-default);font-size:0.9375rem;font-weight:600;line-height:1.2;}.editor-pane.svelte-6hrxe2 .pane-header:where(.svelte-6hrxe2) h3:where(.svelte-6hrxe2) {display:none;}.header-actions.svelte-6hrxe2 .primer-button {flex:1;justify-content:center;text-align:center;}\n\t}.pane-header.svelte-6hrxe2 {padding:0.75rem 1rem;background-color:var(--bgColor-muted);border-bottom:1px solid var(--borderColor-default);display:flex;justify-content:space-between;align-items:center;gap:0.5rem;flex-shrink:0;flex-wrap:wrap;}.pane-header.svelte-6hrxe2 h3:where(.svelte-6hrxe2) {margin:0;font-size:0.875rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--fgColor-muted);}.editor-content.svelte-6hrxe2, .editor-content-scroll {flex:1;overflow-y:auto;padding:1.5rem 2rem;display:flex;flex-direction:column;gap:1.5rem;}\n\t\n\t/* Hide scrollbars */.editor-content.svelte-6hrxe2::-webkit-scrollbar, \n\t.editor-content-scroll::-webkit-scrollbar,\n\t.preview-wrapper.svelte-6hrxe2::-webkit-scrollbar {display:none;}.editor-content.svelte-6hrxe2, .editor-content-scroll, .preview-wrapper.svelte-6hrxe2 {-ms-overflow-style:none;scrollbar-width:none;}.field.svelte-6hrxe2 {display:flex;flex-direction:column;gap:var(--base-size-8, 0.5rem);}.field-label-row.svelte-6hrxe2 {display:flex;align-items:center;justify-content:space-between;gap:0.5rem;}.field-label-row.svelte-6hrxe2 label:where(.svelte-6hrxe2),\n\t.field-label.svelte-6hrxe2 {margin-bottom:0;}label.svelte-6hrxe2,\n\t.field-label.svelte-6hrxe2 {font-weight:var(--base-text-weight-medium, 500);font-size:var(--text-body-size-medium, 0.875rem);color:var(--fgColor-default);display:block;margin-bottom:var(--base-size-4, 0.25rem);}.field-description.svelte-6hrxe2 {margin:-0.25rem 0 0.5rem;font-size:0.75rem;color:var(--fgColor-muted);}input[type=\"text\"].svelte-6hrxe2,\n\tinput[type=\"email\"].svelte-6hrxe2, \n\tinput[type=\"url\"], \n\t.form-select,\n\t.test-email-input.svelte-6hrxe2 {width:100%;padding:var(--control-medium-paddingBlock, 0.375rem)\n\t\t\tvar(--control-medium-paddingInline-normal, 0.75rem);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);font-size:var(--text-body-size-medium, 0.875rem);line-height:var(--text-body-lineHeight-medium, 1.4285);font-family:inherit;background-color:var(--bgColor-default);color:var(--fgColor-default);transition:border-color 0.2s ease;box-shadow:var(--shadow-inset, inset 0 1px 0 rgba(208, 215, 222, 0.2));}input.svelte-6hrxe2:focus-visible {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;border-color:var(--fgColor-accent);box-shadow:none;}\n\n\t/* Rich Text Container */.rich-text-container.svelte-6hrxe2 {display:flex;flex-direction:column;border-radius:var(--borderRadius-medium, 0.375rem);}.rich-text-container.svelte-6hrxe2:focus-within {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;}.rich-text-container.svelte-6hrxe2:focus-within .toolbar:where(.svelte-6hrxe2) {border-color:var(--fgColor-accent);}.rich-text-container.svelte-6hrxe2:focus-within .rich-editor:where(.svelte-6hrxe2) {border-color:var(--fgColor-accent);}\n\n\t/* Toolbar */.toolbar.svelte-6hrxe2 {display:flex;align-items:center;gap:var(--base-size-4, 0.25rem);padding:var(--base-size-8, 0.5rem);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-bottom:none;border-radius:var(--borderRadius-medium, 0.375rem) var(--borderRadius-medium, 0.375rem) 0 0;background:var(--bgColor-muted);flex-wrap:wrap;position:relative;transition:border-color 0.2s ease;}.toolbar-group.svelte-6hrxe2 {display:flex;gap:0.25rem;align-items:center;padding-right:0.5rem;border-right:1px solid var(--borderColor-muted);}.toolbar-group.svelte-6hrxe2:last-child {border-right:none;}.separator.svelte-6hrxe2 {width:var(--borderWidth-thin, 1px);height:var(--base-size-20, 1.25rem);background:var(--borderColor-default);margin-inline:var(--base-size-4, 0.25rem);}.toolbar.svelte-6hrxe2 button:where(.svelte-6hrxe2), .toolbar-btn.svelte-6hrxe2 {padding:var(--base-size-4, 0.25rem) var(--base-size-8, 0.5rem);border:none;background:transparent;cursor:pointer;border-radius:var(--borderRadius-small, 0.25rem);color:var(--fgColor-default);display:flex;align-items:center;justify-content:center;transition:background-color 0.2s ease;min-width:28px;min-height:28px;}.toolbar.svelte-6hrxe2 button:where(.svelte-6hrxe2):hover, .toolbar-btn.svelte-6hrxe2:hover {background:var(--control-transparent-bgColor-hover);}.toolbar.svelte-6hrxe2 button.active:where(.svelte-6hrxe2), .toolbar-btn.active.svelte-6hrxe2 {background:var(--control-transparent-bgColor-selected, rgba(9, 105, 218, 0.08));color:var(--fgColor-accent);}.toolbar.svelte-6hrxe2 button:where(.svelte-6hrxe2):focus-visible, .toolbar-btn.svelte-6hrxe2:focus-visible {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;}\n\n\t/* Rich Editor */.rich-editor.svelte-6hrxe2 {border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-top:none;border-radius:0 0 var(--borderRadius-medium, 0.375rem) var(--borderRadius-medium, 0.375rem);padding:var(--control-medium-paddingBlock, 0.375rem)\n\t\t\tvar(--control-medium-paddingInline-normal, 0.75rem);background-color:var(--bgColor-default);color:var(--fgColor-default);min-height:10rem;font-size:var(--text-body-size-medium, 0.875rem);line-height:var(--text-body-lineHeight-medium, 1.4285);transition:border-color 0.2s ease;box-shadow:var(--shadow-inset, inset 0 1px 0 rgba(208, 215, 222, 0.2));outline:none;}.footer-editor.svelte-6hrxe2 {min-height:100px;}\n\n\t/* Text Style Selector */.text-style-selector.svelte-6hrxe2 {position:relative;display:inline-block;height:36px;display:flex;}.text-style-button.svelte-6hrxe2 {display:inline-flex;align-items:center;justify-content:space-between;gap:4px;width:125px;padding:6px 8px;font-size:14px;font-weight:500;line-height:1.5;color:var(--button-default-fgColor-rest, #24292f);background:var(--button-default-bgColor-rest, #f6f8fa);border:1px solid var(--button-default-borderColor-rest, rgba(31, 35, 40, 0.15));border-radius:var(--borderRadius-medium, 6px);cursor:pointer;transition:background 0.2s cubic-bezier(0.3, 0, 0.5, 1);}.text-style-button.svelte-6hrxe2:hover {background-color:var(--button-default-bgColor-hover, #f3f4f6);}.text-style-panel.svelte-6hrxe2 {position:absolute;top:calc(100% + 4px);left:0;z-index:100;min-width:180px;background-color:var(--overlay-bgColor, #ffffff);border:1px solid var(--borderColor-default, #d0d7de);border-radius:var(--borderRadius-medium, 6px);box-shadow:0 8px 24px rgba(140, 149, 159, 0.2);padding:4px;}.text-style-item.svelte-6hrxe2 {display:flex;align-items:center;justify-content:space-between;width:100%;padding:6px 8px;font-size:14px;color:var(--fgColor-default, #24292f);background:transparent;border:none;border-radius:var(--borderRadius-medium, 6px);cursor:pointer;transition:background 33.333ms linear;}.text-style-item.svelte-6hrxe2:hover {background-color:var(--control-transparent-bgColor-hover, rgba(208, 215, 222, 0.32));}.text-style-item.selected.svelte-6hrxe2 {background-color:var(--control-transparent-bgColor-selected, rgba(9, 105, 218, 0.08));font-weight:600;}\n\n\t/* Popovers */.image-popover.svelte-6hrxe2, .link-popover.svelte-6hrxe2 {position:absolute;top:100%;left:0;margin-top:0.5rem;background:var(--bgColor-default);border:1px solid var(--borderColor-default);border-radius:0.75rem;box-shadow:0 8px 24px rgba(31, 35, 40, 0.15);z-index:100;overflow:hidden;}.image-popover.svelte-6hrxe2 {width:280px;}.link-popover.svelte-6hrxe2 {width:320px;}.image-popover-header.svelte-6hrxe2, .link-popover-header.svelte-6hrxe2 {display:flex;align-items:center;justify-content:space-between;padding:0.75rem 1rem;border-bottom:1px solid var(--borderColor-muted);background:var(--bgColor-muted);}.image-popover-title.svelte-6hrxe2, .link-popover-title.svelte-6hrxe2 {font-size:0.875rem;font-weight:600;color:var(--fgColor-default);}.image-popover-close.svelte-6hrxe2, .link-popover-close.svelte-6hrxe2 {display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;background:transparent;border:none;border-radius:0.375rem;color:var(--fgColor-muted);cursor:pointer;}.image-popover-close.svelte-6hrxe2:hover, .link-popover-close.svelte-6hrxe2:hover {background:var(--bgColor-neutral-muted, rgba(175, 184, 193, 0.2));}.image-popover-body.svelte-6hrxe2, .link-popover-body.svelte-6hrxe2 {padding:1rem;display:flex;flex-direction:column;gap:1rem;}\n\n\t/* Preview Pane */.preview-wrapper.svelte-6hrxe2 {flex:1;background-color:#f6f8fa;position:relative;overflow-y:auto;min-height:0;}\n\n\t/* Hide scrollbars for preview-wrapper */.preview-wrapper.svelte-6hrxe2::-webkit-scrollbar {display:none;}.email-preview.svelte-6hrxe2 {width:100%;height:100%;border:none;background:white;}\n\n\t/* Buttons */\n\t\n\t\n\t\n\t\n\t\n\t/* Modal */.modal-backdrop.svelte-6hrxe2 {position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000;}.modal.svelte-6hrxe2 {background-color:var(--bgColor-default);border-radius:0.5rem;width:90%;max-width:500px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.2);display:flex;flex-direction:column;max-height:90vh;}.image-modal.svelte-6hrxe2 {max-width:800px;width:90vw;}.image-modal-body.svelte-6hrxe2 {max-height:60vh;overflow-y:auto;}.modal-header.svelte-6hrxe2 {padding:1.5rem;border-bottom:1px solid var(--borderColor-default);display:flex;justify-content:space-between;align-items:center;}.close-btn.svelte-6hrxe2 {background:none;border:none;padding:0.25rem;cursor:pointer;color:var(--fgColor-muted);display:flex;align-items:center;justify-content:center;}.modal-body.svelte-6hrxe2 {padding:1.5rem;}.modal-footer.svelte-6hrxe2 {padding:1.5rem;border-top:1px solid var(--borderColor-default);display:flex;justify-content:flex-end;gap:0.75rem;}\n\t\n\t/* Link Popover Content */.link-type-tabs.svelte-6hrxe2 {display:flex;gap:0.5rem;padding:0.25rem;background:var(--bgColor-muted);border-radius:0.5rem;}.link-type-tab.svelte-6hrxe2 {flex:1;display:flex;align-items:center;justify-content:center;gap:0.375rem;padding:0.5rem 0.75rem;background:transparent;border:none;border-radius:0.375rem;font-size:0.8125rem;font-weight:500;color:var(--fgColor-muted);cursor:pointer;transition:all 0.15s ease;}.link-type-tab.active.svelte-6hrxe2 {background:var(--bgColor-default);color:var(--fgColor-default);box-shadow:0 1px 2px rgba(31, 35, 40, 0.1);}.link-input-group.svelte-6hrxe2 {display:flex;flex-direction:column;gap:0.375rem;}.button-options.svelte-6hrxe2 {display:flex;flex-direction:column;gap:0.75rem;padding:0.75rem;background:var(--bgColor-muted);border-radius:0.5rem;}.button-options-row.svelte-6hrxe2 {display:flex;gap:0.75rem;}.button-option.svelte-6hrxe2 {flex:1;display:flex;flex-direction:column;gap:0.25rem;}.color-input-wrapper.svelte-6hrxe2 {display:flex;align-items:center;gap:0.5rem;padding:0.25rem;background:var(--bgColor-default);border:1px solid var(--borderColor-default);border-radius:0.375rem;}.color-input-wrapper.svelte-6hrxe2 input[type=\"color\"]:where(.svelte-6hrxe2) {width:1.5rem;height:1.5rem;padding:0;border:none;border-radius:0.25rem;cursor:pointer;}.color-value.svelte-6hrxe2 {font-size:0.75rem;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;color:var(--fgColor-muted);text-transform:uppercase;}.link-popover-footer.svelte-6hrxe2 {display:flex;justify-content:flex-end;gap:0.5rem;padding:0.75rem 1rem;border-top:1px solid var(--borderColor-muted);background:var(--bgColor-muted);}.link-cancel-btn.svelte-6hrxe2 {padding:0.5rem 0.875rem;font-size:0.8125rem;font-weight:500;color:var(--fgColor-default);background:var(--bgColor-default);border:1px solid var(--borderColor-default);border-radius:0.375rem;cursor:pointer;}.link-insert-btn.svelte-6hrxe2 {padding:0.5rem 0.875rem;font-size:0.8125rem;font-weight:500;color:var(--fgColor-onEmphasis, #ffffff);background:var(--button-primary-bgColor-rest, var(--bgColor-success-emphasis, #1f883d));border:1px solid var(--button-primary-borderColor-rest, transparent);border-radius:0.375rem;cursor:pointer;}.link-insert-btn.svelte-6hrxe2:hover:not(:disabled) {background:var(--button-primary-bgColor-hover, #1c8139);border-color:var(--button-primary-borderColor-hover, transparent);}.link-insert-btn.svelte-6hrxe2:disabled {opacity:0.5;cursor:not-allowed;}\n\t\n\t/* Image size presets */.image-size-presets.svelte-6hrxe2 {display:flex;gap:0.5rem;}.size-preset.svelte-6hrxe2 {flex:1;padding:0.5rem 0.25rem;font-size:0.75rem;font-weight:500;color:var(--fgColor-muted);background:var(--bgColor-muted);border:1px solid var(--borderColor-default);border-radius:0.375rem;cursor:pointer;}.size-preset.active.svelte-6hrxe2 {background:var(--button-primary-bgColor-rest, var(--bgColor-success-emphasis, #1f883d));border-color:var(--button-primary-borderColor-rest, var(--borderColor-success-emphasis, #1f883d));color:var(--fgColor-onEmphasis, #ffffff);}.image-custom-width.svelte-6hrxe2 {display:flex;flex-direction:column;gap:0.375rem;}.custom-width-input.svelte-6hrxe2 {display:flex;gap:0.5rem;}.apply-width-btn.svelte-6hrxe2 {padding:0.5rem 0.75rem;font-size:0.8125rem;font-weight:500;color:var(--fgColor-onEmphasis, #ffffff);background:var(--button-primary-bgColor-rest, var(--bgColor-success-emphasis, #1f883d));border:1px solid var(--button-primary-borderColor-rest, transparent);border-radius:0.375rem;cursor:pointer;}.apply-width-btn.svelte-6hrxe2:hover:not(:disabled) {background:var(--button-primary-bgColor-hover, #1c8139);border-color:var(--button-primary-borderColor-hover, transparent);}\n\n\t/* TipTap editor content styling - matching CMS Record.svelte */.rich-editor.svelte-6hrxe2 .ProseMirror {outline:none;min-height:9rem;}.rich-editor.svelte-6hrxe2 .ProseMirror p {margin:0 0 var(--base-size-8, 0.5rem) 0;}.rich-editor.svelte-6hrxe2 .ProseMirror p:last-child {margin-bottom:0;}.rich-editor.svelte-6hrxe2 .ProseMirror h1,\n\t.rich-editor.svelte-6hrxe2 .ProseMirror h2,\n\t.rich-editor.svelte-6hrxe2 .ProseMirror h3,\n\t.rich-editor.svelte-6hrxe2 .ProseMirror h4 {margin:var(--base-size-16, 1rem) 0 var(--base-size-8, 0.5rem) 0;font-weight:var(--base-text-weight-semibold, 600);line-height:var(--text-title-lineHeight-medium, 1.5);}.rich-editor.svelte-6hrxe2 .ProseMirror h1:first-child,\n\t.rich-editor.svelte-6hrxe2 .ProseMirror h2:first-child,\n\t.rich-editor.svelte-6hrxe2 .ProseMirror h3:first-child,\n\t.rich-editor.svelte-6hrxe2 .ProseMirror h4:first-child {margin-top:0;}.rich-editor.svelte-6hrxe2 .ProseMirror h1 {font-size:var(--text-title-size-large, 2rem);}.rich-editor.svelte-6hrxe2 .ProseMirror h2 {font-size:var(--text-title-size-medium, 1.5rem);}.rich-editor.svelte-6hrxe2 .ProseMirror h3 {font-size:var(--text-body-size-large, 1.25rem);}.rich-editor.svelte-6hrxe2 .ProseMirror h4 {font-size:var(--text-body-size-medium, 0.875rem);text-transform:uppercase;letter-spacing:0.05em;}.rich-editor.svelte-6hrxe2 .ProseMirror ul,\n\t.rich-editor.svelte-6hrxe2 .ProseMirror ol {margin:0 0 var(--base-size-8, 0.5rem) 0;padding-left:var(--base-size-24, 1.5rem);}.rich-editor.svelte-6hrxe2 .ProseMirror li {margin:0 0 var(--base-size-4, 0.25rem) 0;}.rich-editor.svelte-6hrxe2 .ProseMirror li:last-child {margin-bottom:0;}.rich-editor.svelte-6hrxe2 .ProseMirror a {color:var(--fgColor-accent);text-decoration:underline;}.rich-editor.svelte-6hrxe2 .ProseMirror a:hover {text-decoration:none;}.rich-editor.svelte-6hrxe2 .ProseMirror img {max-width:100%;height:auto;border-radius:var(--borderRadius-medium, 0.375rem);cursor:pointer;transition:box-shadow 0.15s ease;display:block;margin:0 auto;}.rich-editor.svelte-6hrxe2 .ProseMirror img:hover {box-shadow:0 0 0 2px var(--borderColor-default, rgba(31, 35, 40, 0.15));}.rich-editor.svelte-6hrxe2 .ProseMirror img.ProseMirror-selectednode {outline:none;box-shadow:0 0 0 3px var(--fgColor-accent);}.rich-text-container.svelte-6hrxe2:focus-within .rich-editor:where(.svelte-6hrxe2) {box-shadow:none;}`\n};\nfunction fc(r, e) {\n nt(e, !0), bt(r, r2);\n let t = ce(e, \"id\", 7);\n function n(be) {\n return be.replace(/&/g, \"&\").replace(/\"/g, \""\").replace(/</g, \"<\").replace(/>/g, \">\");\n }\n const s = `<h2>Newsletter Title</h2>\n<p>Dear Reader,</p>\n<p>Here is your regular update.</p>\n<h3>Latest News</h3>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n<h3>Feature Highlight</h3>\n<p>Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>\n<p>Best regards,<br>The Team</p>`, o = no(), { emails: i, notifications: a } = o, { repoFiles: l } = yn();\n let d = W(\"\"), u = ie(() => c(d)), f = W(null), h, p = W(null), g, b = W(!1), y = W(\"\"), C = W(\"inline\"), E = W(\"#3498db\"), R = W(\"#3498db\"), q = W(\"1px\"), O = W(\"5px\"), M = W(!1), P = W(!1), L = W(\"\"), $ = W(!1), J = W(!1), U = W(0), F = W(!1), z = W(void 0), _ = W(!1), N = W(\"300px\"), Q = W(!0), T = W(!1), I = W(0), te = 0, A = null;\n function V(be) {\n window.matchMedia(\"(max-width: 900px)\").matches && (A = be.pointerId, te = be.clientY, k(I, 0), k(T, !0), be.currentTarget.setPointerCapture?.(be.pointerId), window.addEventListener(\"pointermove\", H), window.addEventListener(\"pointerup\", ne), window.addEventListener(\"pointercancel\", ne));\n }\n function H(be) {\n if (!c(T) || A !== null && be.pointerId !== A) return;\n const Oe = be.clientY - te, $e = Math.max(180, window.innerHeight * 0.75);\n k(I, Math.max(-$e, Math.min($e, Oe)), !0);\n }\n function ne(be) {\n if (A !== null && be.pointerId !== A) return;\n const Oe = 42;\n Math.abs(c(I)) < 8 ? k(Q, !c(Q)) : c(I) > Oe ? k(Q, !1) : c(I) < -Oe && k(Q, !0), X();\n }\n function X() {\n window.removeEventListener(\"pointermove\", H), window.removeEventListener(\"pointerup\", ne), window.removeEventListener(\"pointercancel\", ne), k(T, !1), k(I, 0), A = null;\n }\n let G = W(\"\"), Y = W(\"\");\n const se = {\n title: \"Newsletter\",\n description: \"Email newsletter draft\",\n fields: {\n subject: { label: \"Subject Line\", widget: \"string\" },\n body: { label: \"Main Content\", widget: \"richtext\" },\n footer: { label: \"Footer\", widget: \"richtext\" }\n }\n }, ue = ie(() => ({\n name: c(u),\n subject: c(d),\n body: c(G),\n footer: c(Y)\n }));\n kr(() => {\n c(G) || (k(G, s), c(f) && c(f).commands.setContent(s));\n });\n function le(be, Oe) {\n const $e = be.getAttribute(\"style\") || \"\";\n $e ? be.setAttribute(\"style\", `${Oe} ${$e}`) : be.setAttribute(\"style\", Oe);\n }\n let re = ie(() => {\n const be = c(G), $e = new DOMParser().parseFromString(be, \"text/html\");\n $e.querySelectorAll(\"h1\").forEach((zt) => le(zt, `color: ${i.emailTemplate.primaryColor};`)), $e.querySelectorAll(\"h2\").forEach((zt) => le(zt, `color: ${i.emailTemplate.primaryColor};`)), $e.querySelectorAll(\"h3\").forEach((zt) => le(zt, `color: ${i.emailTemplate.primaryColor};`)), $e.querySelectorAll(\"h4\").forEach((zt) => le(zt, `color: ${i.emailTemplate.primaryColor};`)), $e.querySelectorAll(\"img\").forEach((zt) => {\n let Ht = zt.getAttribute(\"style\") || \"\";\n Ht.includes(\"max-width\") || (Ht = Ht ? `${Ht}; max-width: 300px;` : \"max-width: 300px;\"), (!Ht.includes(\"margin\") || !Ht.includes(\"auto\")) && (Ht = `${Ht}; display: block; margin: 0 auto;`), zt.setAttribute(\"style\", Ht);\n });\n const et = $e.body.innerHTML, gt = i.logo ? `<div style=\"text-align:center;margin:0 0 20px 0;\"><img src=\"${i.logo}\" alt=\"Logo\" style=\"max-width:120px;max-height:80px;height:auto;\" /></div>` : \"\";\n return i.emailTemplate.html.replaceAll(\"{{content}}\", et).replaceAll(\"{{logo}}\", gt).replaceAll(\"{{footer}}\", c(Y) || i.emailTemplate.footerHtml || \"\").replaceAll(\"{{unsubscribe}}\", '<p style=\"margin:10px 0 0 0;\"><a href=\"#\" style=\"color:inherit;text-decoration:underline;\">Unsubscribe</a></p>').replaceAll(\"{{unsubscribe_url}}\", \"#\");\n });\n async function ae() {\n if (!c(d).trim() || !c(G).trim()) {\n a.warning(\"Please fill in all fields\");\n return;\n }\n k($, !0);\n try {\n await i.createCampaign({\n name: c(d).trim(),\n subject: c(d).trim(),\n bodyHtml: c(G)\n }), a.success(\"Newsletter saved\"), window.location.hash = \"#emails/newsletters\";\n } catch {\n a.error(\"Failed to save newsletter\");\n } finally {\n k($, !1);\n }\n }\n async function ge() {\n if (!c(d).trim() || !c(G).trim()) {\n a.warning(\"Please fill in all fields\");\n return;\n }\n if (confirm(`Send this email to all ${i.subscribedCount} subscribers?`)) {\n k(M, !0);\n try {\n const be = await i.sendBulkEmail(c(d).trim(), c(G));\n a.success(`Newsletter sent to ${be} subscribers`), k(d, \"\"), k(G, \"<p>Write your email content here...</p>\"), window.location.hash = \"#emails/newsletters\";\n } catch {\n a.error(\"Failed to send newsletter\");\n } finally {\n k(M, !1);\n }\n }\n }\n async function Se() {\n if (!c(L).trim()) {\n a.warning(\"Please enter a test email address\");\n return;\n }\n if (!c(d).trim() || !c(G).trim()) {\n a.warning(\"Please fill in subject and body first\");\n return;\n }\n try {\n const be = Be(c(G)), Oe = We(c(G)), at = (await Promise.all(be.map(async (et) => {\n const gt = l.staticAssets.find((kt) => kt.name === et || kt.path === `frontend/static/emails/${et}`);\n return gt ? {\n id: gt.name,\n content: gt.content,\n filename: gt.name,\n type: gt.mimeType,\n disposition: \"inline\"\n } : null;\n }))).filter((et) => et !== null);\n await i.sendTestEmail(c(L).trim(), c(d).trim(), Oe), a.success(`Test email sent to ${c(L)}`), k(P, !1), k(L, \"\");\n } catch {\n a.error(\"Failed to send test email\");\n }\n }\n Ar(async () => {\n k(\n f,\n new Ul({\n element: h,\n extensions: [\n Kl,\n Gl,\n Yl,\n Gh.configure({ levels: [1, 2, 3, 4] }),\n om,\n im,\n am,\n ac.configure({\n openOnClick: !0,\n HTMLAttributes: { target: \"_blank\", rel: \"noopener noreferrer\" }\n }),\n gm.extend({\n addAttributes() {\n return {\n ...this.parent?.(),\n \"data-asset-name\": { default: null },\n \"data-image-id\": { default: null },\n style: { default: null }\n };\n }\n }).configure({ allowBase64: !0 }),\n lc,\n cc,\n dc,\n uc,\n Cm.configure({ types: [\"heading\", \"paragraph\"] }),\n _m\n ],\n content: s,\n onCreate: () => {\n k(G, s);\n },\n onUpdate: () => {\n c(f) && k(G, c(f).getHTML(), !0), Ai(U);\n },\n onSelectionUpdate: () => {\n if (Ai(U), !c(f)) return;\n const { selection: be } = c(f).state, { from: Oe } = be, $e = c(f).state.doc.nodeAt(Oe);\n if ($e && $e.type.name === \"image\") {\n const at = $e.attrs;\n if (at.style) {\n const et = at.style.match(/max-width:\\s*([^;]+)/);\n k(N, et ? et[1].trim() : \"300px\", !0);\n } else\n k(N, \"300px\");\n k(_, !0), k(b, !1);\n } else\n k(_, !1);\n }\n }),\n !0\n ), k(\n p,\n new Ul({\n element: g,\n extensions: [\n Kl,\n Gl,\n Yl,\n lc,\n cc,\n dc,\n ac.configure({\n openOnClick: !0,\n HTMLAttributes: { target: \"_blank\", rel: \"noopener noreferrer\" }\n }),\n uc\n ],\n content: i.emailTemplate.footerHtml || \"<p>You are receiving this email because you subscribed to updates from us.</p>\",\n onCreate: () => {\n c(p) && k(Y, c(p).getHTML(), !0);\n },\n onUpdate: () => {\n c(p) && k(Y, c(p).getHTML(), !0);\n }\n }),\n !0\n );\n });\n const _e = [\n { value: \"paragraph\", label: \"Paragraph\" },\n { value: \"h1\", label: \"Heading 1\" },\n { value: \"h2\", label: \"Heading 2\" },\n { value: \"h3\", label: \"Heading 3\" },\n { value: \"h4\", label: \"Heading 4\" }\n ];\n function Re() {\n return c(U), c(f) ? c(f).isActive(\"heading\", { level: 1 }) ? \"Heading 1\" : c(f).isActive(\"heading\", { level: 2 }) ? \"Heading 2\" : c(f).isActive(\"heading\", { level: 3 }) ? \"Heading 3\" : c(f).isActive(\"heading\", { level: 4 }) ? \"Heading 4\" : \"Paragraph\" : \"Paragraph\";\n }\n function Ie() {\n return c(U), c(f) ? c(f).isActive(\"heading\", { level: 1 }) ? \"h1\" : c(f).isActive(\"heading\", { level: 2 }) ? \"h2\" : c(f).isActive(\"heading\", { level: 3 }) ? \"h3\" : c(f).isActive(\"heading\", { level: 4 }) ? \"h4\" : \"paragraph\" : \"paragraph\";\n }\n function Fe() {\n return c(U), c(f) ? c(f).isActive({ textAlign: \"center\" }) ? \"center\" : c(f).isActive({ textAlign: \"right\" }) ? \"right\" : \"left\" : \"left\";\n }\n function j(be) {\n if (!c(f)) return;\n const Oe = c(f).chain().focus();\n switch (be) {\n case \"paragraph\":\n Oe.setParagraph().run();\n break;\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n Oe.toggleHeading({ level: parseInt(be.slice(1)) }).run();\n break;\n }\n k(J, !1);\n }\n function oe() {\n if (c(U), !c(f)) return !1;\n const { selection: be } = c(f).state, { from: Oe } = be, $e = be.$from, at = c(f).state.doc.nodeAt(Oe);\n return !!(at && at.type.name === \"image\" || $e.parent.type.name === \"image\");\n }\n function he() {\n if (!c(f) || !c(N).trim()) return;\n const { state: be, view: Oe } = c(f), { selection: $e } = be, { from: at } = $e, et = be.doc.nodeAt(at);\n if (et && et.type.name === \"image\") {\n const kt = (et.attrs.style || \"\").replace(/max-width:\\s*([^;]+)/g, \"\").trim(), zt = kt ? `${kt}; max-width: ${c(N)};` : `max-width: ${c(N)};`, Ht = be.tr.setNodeMarkup(at, null, { ...et.attrs, style: zt });\n Oe.dispatch(Ht);\n }\n k(_, !1);\n }\n function Z() {\n if (!c(y).trim() || !c(f)) return;\n if (/\\.(jpg|jpeg|png|gif|webp|svg)$/i.test(c(y)))\n c(f).chain().focus().setImage({ src: c(y) }).run();\n else if (c(C) === \"inline\")\n c(f).chain().focus().setLink({ href: c(y) }).run();\n else {\n const { from: Oe, to: $e } = c(f).state.selection, at = c(f).state.doc.textBetween(Oe, $e, \" \") || \"Click Here\", et = `<p style=\"text-align: center; margin: 15px 0;\"><a href=\"${c(y)}\" style=\"color: #ffffff; text-decoration: none; background-color: ${c(E)}; border-radius: ${c(O)}; box-sizing: border-box; cursor: pointer; display: inline-block; font-size: 14px; font-weight: bold; text-transform: capitalize; padding: 12px 25px; border: ${c(q)} solid ${c(R)};\">${at}</a></p>`;\n Oe !== $e && c(f).chain().focus().deleteSelection().run(), c(f).chain().focus().insertContent(et).run();\n }\n k(y, \"\"), k(b, !1);\n }\n function pe(be) {\n k(z, be, !0);\n }\n async function xe() {\n if (!c(z) || !c(f)) return;\n const be = l.getStaticAssetDataURL(c(z).path) ?? l.getAssetDataURLByName(c(z).name);\n if (!be) {\n a.error(\"Failed to load image\");\n return;\n }\n const Oe = n(be), $e = n(c(z).name), at = n(c(z).name);\n c(f).chain().focus().insertContent(`<img src=\"${Oe}\" alt=\"${$e}\" data-image-id=\"${at}\" style=\"max-width: 300px; display: block; margin: 0 auto;\">`).run(), k(F, !1), k(z, void 0);\n }\n function Be(be) {\n const at = new DOMParser().parseFromString(be, \"text/html\").querySelectorAll(\"img[data-image-id]\"), et = [];\n return at.forEach((gt) => {\n const kt = gt.getAttribute(\"data-image-id\");\n kt && et.push(kt);\n }), [...new Set(et)];\n }\n function We(be) {\n const $e = new DOMParser().parseFromString(be, \"text/html\");\n return $e.querySelectorAll(\"img[data-image-id]\").forEach((et) => {\n const gt = et.getAttribute(\"data-image-id\");\n gt && et.setAttribute(\"src\", `cid:${gt}`);\n }), $e.body.innerHTML;\n }\n ka(() => {\n c(f)?.destroy(), c(p)?.destroy(), X();\n });\n var ee = {\n get id() {\n return t();\n },\n set id(be) {\n t(be), de();\n }\n }, He = t2(), ve = ke(He), Te = v(ve), Me = v(Te), Xe = x(v(Me), 2), mt = v(Xe);\n m(Xe), m(Me);\n var Et = x(Me, 2);\n let Dt, Rt;\n var er = v(Et), ct = v(er);\n m(er);\n var vt = x(er, 2), yt = x(v(vt), 2), Ae = v(yt);\n {\n let be = ie(() => !c(d).trim() || !c(G).trim());\n Je(Ae, {\n onclick: () => k(P, !0),\n get disabled() {\n return c(be);\n },\n children: (Oe, $e) => {\n Pe();\n var at = qe(\"Send Test\");\n w(Oe, at);\n },\n $$slots: { default: !0 }\n });\n }\n var Ye = x(Ae, 2);\n Je(Ye, {\n onclick: ae,\n get disabled() {\n return c($);\n },\n children: (be, Oe) => {\n Pe();\n var $e = qe();\n B(() => D($e, c($) ? \"Saving...\" : \"Save Draft\")), w(be, $e);\n },\n $$slots: { default: !0 }\n });\n var xt = x(Ye, 2);\n {\n let be = ie(() => c(M) || i.subscribedCount === 0);\n Je(xt, {\n variant: \"primary\",\n onclick: ge,\n get disabled() {\n return c(be);\n },\n children: (Oe, $e) => {\n Pe();\n var at = qe();\n B(() => D(at, c(M) ? \"Sending...\" : `Send to ${i.subscribedCount}`)), w(Oe, at);\n },\n $$slots: { default: !0 }\n });\n }\n m(yt), m(vt);\n var ut = x(vt, 2), me = v(ut), we = x(v(me), 2);\n Ut(we), m(me);\n var Ee = x(me, 2), je = v(Ee), ze = x(v(je), 2);\n Ni(ze, {\n fieldName: \"body\",\n get fieldConfig() {\n return se.fields.body;\n },\n get contentConfig() {\n return se;\n },\n get currentRecord() {\n return c(ue);\n },\n get currentValue() {\n return c(G);\n },\n onAccept: (be) => {\n k(G, String(be ?? \"\"), !0), c(f)?.commands.setContent(c(G));\n }\n }), m(je);\n var Ve = x(je, 2), it = v(Ve), _t = v(it), Qe = v(_t);\n _s(Qe, () => c(U), (be) => {\n var Oe = Wk(), $e = v(Oe), at = v($e, !0);\n m($e);\n var et = x($e, 2);\n tr(et, { icon: \"triangle-down\", size: 12 }), m(Oe), B(\n (gt, kt) => {\n Ge(Oe, \"aria-expanded\", c(J)), Ge($e, \"data-style\", gt), D(at, kt);\n },\n [() => Ie(), () => Re()]\n ), fe(\"click\", Oe, (gt) => {\n gt.stopPropagation(), k(J, !c(J));\n }), w(be, Oe);\n });\n var sr = x(Qe, 2);\n {\n var vr = (be) => {\n var Oe = Jk();\n tt(Oe, 21, () => _e, pt, ($e, at) => {\n var et = Uk();\n let gt;\n var kt = v(et), zt = v(kt, !0);\n m(kt);\n var Ht = x(kt, 2);\n {\n var $r = (Qt) => {\n tr(Qt, { icon: \"check\", size: 16 });\n }, Lr = ie(() => Re() === c(at).label);\n K(Ht, (Qt) => {\n c(Lr) && Qt($r);\n });\n }\n m(et), B(\n (Qt, Er) => {\n gt = Ne(et, 1, \"text-style-item svelte-6hrxe2\", null, gt, Qt), Ge(et, \"aria-selected\", Er), Ge(kt, \"data-style\", c(at).value), D(zt, c(at).label);\n },\n [\n () => ({ selected: Re() === c(at).label }),\n () => Re() === c(at).label\n ]\n ), fe(\"click\", et, (Qt) => {\n Qt.stopPropagation(), j(c(at).value);\n }), w($e, et);\n }), m(Oe), fe(\"click\", Oe, ($e) => $e.stopPropagation()), fe(\"mousedown\", Oe, ($e) => $e.stopPropagation()), w(be, Oe);\n };\n K(sr, (be) => {\n c(J) && be(vr);\n });\n }\n m(_t);\n var $t = x(_t, 4);\n _s($t, () => c(U), (be) => {\n var Oe = Kk(), $e = ke(Oe);\n let at;\n var et = x($e, 2);\n let gt;\n var kt = x(et, 2);\n let zt;\n B(\n (Ht, $r, Lr) => {\n at = Ne($e, 1, \"svelte-6hrxe2\", null, at, Ht), gt = Ne(et, 1, \"svelte-6hrxe2\", null, gt, $r), zt = Ne(kt, 1, \"svelte-6hrxe2\", null, zt, Lr);\n },\n [\n () => ({ active: Fe() === \"left\" }),\n () => ({ active: Fe() === \"center\" }),\n () => ({ active: Fe() === \"right\" })\n ]\n ), fe(\"click\", $e, () => c(f)?.chain().focus().setTextAlign(\"left\").run()), fe(\"click\", et, () => c(f)?.chain().focus().setTextAlign(\"center\").run()), fe(\"click\", kt, () => c(f)?.chain().focus().setTextAlign(\"right\").run()), w(be, Oe);\n });\n var At = x($t, 4);\n let wt;\n var Ft = v(At);\n tr(Ft, { icon: \"bold\", size: 16 }), m(At);\n var Yt = x(At, 2);\n let or;\n var cr = v(Yt);\n tr(cr, { icon: \"italic\", size: 16 }), m(Yt);\n var dt = x(Yt, 2);\n let Nt;\n var Mt = x(dt, 4);\n let jt;\n var Xt = v(Mt);\n tr(Xt, { icon: \"list-unordered\", size: 16 }), m(Mt);\n var Lt = x(Mt, 2);\n let Bt;\n var qt = v(Lt);\n tr(qt, { icon: \"list-ordered\", size: 16 }), m(Lt);\n var gr = x(Lt, 4);\n let Sr;\n var tn = v(gr);\n tr(tn, { icon: \"link\", size: 16 }), m(gr);\n var Mr = x(gr, 2), rn = v(Mr);\n tr(rn, { icon: \"image\", size: 16 }), m(Mr);\n var dr = x(Mr, 2);\n _s(dr, () => c(U), (be) => {\n var Oe = lt(), $e = ke(Oe);\n {\n var at = (gt) => {\n var kt = Gk(), zt = x(ke(kt), 2);\n let Ht;\n B(() => Ht = Ne(zt, 1, \"svelte-6hrxe2\", null, Ht, { active: c(_) })), fe(\"click\", zt, ($r) => {\n $r.stopPropagation(), k(_, !c(_));\n }), w(gt, kt);\n }, et = ie(() => oe());\n K($e, (gt) => {\n c(et) && gt(at);\n });\n }\n w(be, Oe);\n });\n var ur = x(dr, 2);\n {\n var Ot = (be) => {\n var Oe = Yk(), $e = v(Oe), at = x(v($e), 2);\n m($e);\n var et = x($e, 2), gt = v(et), kt = v(gt);\n let zt;\n var Ht = x(kt, 2);\n let $r;\n var Lr = x(Ht, 2);\n let Qt;\n var Er = x(Lr, 2);\n let Pn;\n m(gt);\n var fn = x(gt, 2), oo = x(v(fn), 2), fs = v(oo);\n Ut(fs);\n var Dr = x(fs, 2);\n m(oo), m(fn), m(et), m(Oe), B(() => {\n zt = Ne(kt, 1, \"size-preset svelte-6hrxe2\", null, zt, { active: c(N) === \"100%\" }), $r = Ne(Ht, 1, \"size-preset svelte-6hrxe2\", null, $r, { active: c(N) === \"400px\" }), Qt = Ne(Lr, 1, \"size-preset svelte-6hrxe2\", null, Qt, { active: c(N) === \"300px\" }), Pn = Ne(Er, 1, \"size-preset svelte-6hrxe2\", null, Pn, { active: c(N) === \"200px\" });\n }), fe(\"click\", Oe, (pn) => pn.stopPropagation()), fe(\"mousedown\", Oe, (pn) => pn.stopPropagation()), fe(\"click\", at, () => k(_, !1)), fe(\"click\", kt, () => {\n k(N, \"100%\"), he();\n }), fe(\"click\", Ht, () => {\n k(N, \"400px\"), he();\n }), fe(\"click\", Lr, () => {\n k(N, \"300px\"), he();\n }), fe(\"click\", Er, () => {\n k(N, \"200px\"), he();\n }), fe(\"keydown\", fs, (pn) => pn.key === \"Enter\" && he()), nr(fs, () => c(N), (pn) => k(N, pn)), fe(\"click\", Dr, he), w(be, Oe);\n };\n K(ur, (be) => {\n c(_) && be(Ot);\n });\n }\n var Pt = x(ur, 2);\n {\n var Jt = (be) => {\n var Oe = Qk(), $e = v(Oe), at = x(v($e), 2);\n m($e);\n var et = x($e, 2), gt = v(et), kt = v(gt);\n let zt;\n var Ht = x(kt, 2);\n let $r;\n m(gt);\n var Lr = x(gt, 2), Qt = x(v(Lr), 2);\n Ut(Qt), m(Lr);\n var Er = x(Lr, 2);\n {\n var Pn = (Dr) => {\n var pn = Xk(), Ba = v(pn), Ha = v(Ba), kd = x(v(Ha), 2), qa = v(kd);\n Ut(qa);\n var Cd = x(qa, 2), wv = v(Cd, !0);\n m(Cd), m(kd), m(Ha);\n var _d = x(Ha, 2), Sd = x(v(_d), 2), Va = v(Sd);\n Ut(Va);\n var Ed = x(Va, 2), kv = v(Ed, !0);\n m(Ed), m(Sd), m(_d), m(Ba);\n var Td = x(Ba, 2), Wa = v(Td), Md = x(v(Wa), 2);\n Ut(Md), m(Wa);\n var Ad = x(Wa, 2), Pd = x(v(Ad), 2);\n Ut(Pd), m(Ad), m(Td), m(pn), B(() => {\n D(wv, c(E)), D(kv, c(R));\n }), nr(qa, () => c(E), (ps) => k(E, ps)), nr(Va, () => c(R), (ps) => k(R, ps)), nr(Md, () => c(q), (ps) => k(q, ps)), nr(Pd, () => c(O), (ps) => k(O, ps)), w(Dr, pn);\n };\n K(Er, (Dr) => {\n c(C) === \"button\" && Dr(Pn);\n });\n }\n m(et);\n var fn = x(et, 2), oo = v(fn), fs = x(oo, 2);\n m(fn), m(Oe), B(\n (Dr) => {\n zt = Ne(kt, 1, \"link-type-tab svelte-6hrxe2\", null, zt, { active: c(C) === \"inline\" }), $r = Ne(Ht, 1, \"link-type-tab svelte-6hrxe2\", null, $r, { active: c(C) === \"button\" }), fs.disabled = Dr;\n },\n [() => !c(y).trim()]\n ), fe(\"click\", Oe, (Dr) => Dr.stopPropagation()), fe(\"mousedown\", Oe, (Dr) => Dr.stopPropagation()), fe(\"click\", at, () => k(b, !1)), fe(\"click\", kt, () => k(C, \"inline\")), fe(\"click\", Ht, () => k(C, \"button\")), fe(\"keydown\", Qt, (Dr) => {\n Dr.key === \"Enter\" && (Dr.preventDefault(), Z());\n }), nr(Qt, () => c(y), (Dr) => k(y, Dr)), fe(\"click\", oo, () => k(b, !1)), fe(\"click\", fs, () => Z()), w(be, Oe);\n };\n K(Pt, (be) => {\n c(b) && be(Jt);\n });\n }\n m(it);\n var Tt = x(it, 2);\n bn(Tt, (be) => h = be, () => h), m(Ve), m(Ee);\n var It = x(Ee, 2), ir = v(It), xr = x(v(ir), 2);\n Ni(xr, {\n fieldName: \"footer\",\n get fieldConfig() {\n return se.fields.footer;\n },\n get contentConfig() {\n return se;\n },\n get currentRecord() {\n return c(ue);\n },\n get currentValue() {\n return c(Y);\n },\n onAccept: (be) => {\n k(Y, String(be ?? \"\"), !0), c(p)?.commands.setContent(c(Y));\n }\n }), m(ir);\n var Xr = x(ir, 4), An = v(Xr), Hn = v(An), ar = v(Hn);\n let br;\n var nn = v(ar);\n tr(nn, { icon: \"bold\", size: 16 }), m(ar);\n var un = x(ar, 2);\n let Rs;\n var mv = v(un);\n tr(mv, { icon: \"italic\", size: 16 }), m(un);\n var si = x(un, 2);\n let xd;\n var vv = v(si);\n tr(vv, { icon: \"link\", size: 16 }), m(si), m(Hn), m(An);\n var gv = x(An, 2);\n bn(gv, (be) => g = be, () => g), m(Xr), m(It), m(ut), m(Et), m(Te), m(ve);\n var wd = x(ve, 2);\n {\n var bv = (be) => {\n var Oe = Zk(), $e = v(Oe), at = v($e), et = x(v(at), 2), gt = v(et);\n tr(gt, { icon: \"x\", size: 16 }), m(et), m(at);\n var kt = x(at, 2), zt = v(kt);\n {\n let Qt = ie(() => c(z)?.name);\n Hf(zt, {\n handleImageChange: pe,\n get preselected() {\n return c(Qt);\n }\n });\n }\n m(kt);\n var Ht = x(kt, 2), $r = v(Ht);\n Je($r, {\n onclick: () => k(F, !1),\n children: (Qt, Er) => {\n Pe();\n var Pn = qe(\"Cancel\");\n w(Qt, Pn);\n },\n $$slots: { default: !0 }\n });\n var Lr = x($r, 2);\n {\n let Qt = ie(() => !c(z));\n Je(Lr, {\n variant: \"primary\",\n onclick: xe,\n get disabled() {\n return c(Qt);\n },\n children: (Er, Pn) => {\n Pe();\n var fn = qe(\"Insert\");\n w(Er, fn);\n },\n $$slots: { default: !0 }\n });\n }\n m(Ht), m($e), m(Oe), fe(\"click\", Oe, () => k(F, !1)), fe(\"click\", $e, (Qt) => Qt.stopPropagation()), fe(\"keydown\", $e, (Qt) => Qt.stopPropagation()), fe(\"click\", et, () => k(F, !1)), w(be, Oe);\n };\n K(wd, (be) => {\n c(F) && be(bv);\n });\n }\n var yv = x(wd, 2);\n {\n var xv = (be) => {\n var Oe = e2(), $e = v(Oe), at = v($e), et = x(v(at), 2), gt = v(et);\n tr(gt, { icon: \"x\", size: 16 }), m(et), m(at);\n var kt = x(at, 2), zt = x(v(kt), 2), Ht = x(v(zt), 2);\n Ut(Ht), m(zt), m(kt);\n var $r = x(kt, 2), Lr = v($r);\n Je(Lr, {\n onclick: () => k(P, !1),\n children: (Er, Pn) => {\n Pe();\n var fn = qe(\"Cancel\");\n w(Er, fn);\n },\n $$slots: { default: !0 }\n });\n var Qt = x(Lr, 2);\n Je(Qt, {\n variant: \"primary\",\n onclick: Se,\n children: (Er, Pn) => {\n Pe();\n var fn = qe(\"Send Test\");\n w(Er, fn);\n },\n $$slots: { default: !0 }\n }), m($r), m($e), m(Oe), fe(\"click\", Oe, () => k(P, !1)), fe(\"click\", $e, (Er) => Er.stopPropagation()), fe(\"keydown\", $e, (Er) => Er.stopPropagation()), fe(\"click\", et, () => k(P, !1)), nr(Ht, () => c(L), (Er) => k(L, Er)), w(be, Oe);\n };\n K(yv, (be) => {\n c(P) && be(xv);\n });\n }\n return B(\n (be, Oe, $e, at, et, gt, kt, zt) => {\n Ge(mt, \"srcdoc\", c(re)), Dt = Ne(Et, 1, \"editor-pane svelte-6hrxe2\", null, Dt, {\n \"sheet-expanded\": c(Q),\n \"sheet-collapsed\": !c(Q),\n \"sheet-dragging\": c(T)\n }), Rt = Vs(Et, \"\", Rt, { \"--sheet-drag-offset\": `${c(I) ?? \"\"}px` }), Ge(ct, \"aria-label\", c(Q) ? \"Hide editor\" : \"Show editor\"), Ge(ct, \"aria-expanded\", c(Q)), wt = Ne(At, 1, \"svelte-6hrxe2\", null, wt, be), or = Ne(Yt, 1, \"svelte-6hrxe2\", null, or, Oe), Nt = Ne(dt, 1, \"svelte-6hrxe2\", null, Nt, $e), jt = Ne(Mt, 1, \"svelte-6hrxe2\", null, jt, at), Bt = Ne(Lt, 1, \"svelte-6hrxe2\", null, Bt, et), Sr = Ne(gr, 1, \"svelte-6hrxe2\", null, Sr, { active: c(b) }), br = Ne(ar, 1, \"toolbar-btn svelte-6hrxe2\", null, br, gt), Rs = Ne(un, 1, \"toolbar-btn svelte-6hrxe2\", null, Rs, kt), xd = Ne(si, 1, \"toolbar-btn svelte-6hrxe2\", null, xd, zt);\n },\n [\n () => ({ active: c(f)?.isActive(\"bold\") }),\n () => ({ active: c(f)?.isActive(\"italic\") }),\n () => ({ active: c(f)?.isActive(\"underline\") }),\n () => ({ active: c(f)?.isActive(\"bulletList\") }),\n () => ({ active: c(f)?.isActive(\"orderedList\") }),\n () => ({ active: c(p)?.isActive(\"bold\") }),\n () => ({ active: c(p)?.isActive(\"italic\") }),\n () => ({ active: c(p)?.isActive(\"link\") })\n ]\n ), fe(\"pointerdown\", ct, V), nr(we, () => c(d), (be) => k(d, be)), fe(\"mousedown\", it, (be) => {\n c(J) && (be.preventDefault(), k(J, !1)), k(b, !1), k(_, !1);\n }), fe(\"click\", At, () => c(f)?.chain().focus().toggleBold().run()), fe(\"click\", Yt, () => c(f)?.chain().focus().toggleItalic().run()), fe(\"click\", dt, () => c(f)?.chain().focus().toggleUnderline().run()), fe(\"click\", Mt, () => c(f)?.chain().focus().toggleBulletList().run()), fe(\"click\", Lt, () => c(f)?.chain().focus().toggleOrderedList().run()), fe(\"click\", gr, (be) => {\n be.stopPropagation(), k(b, !c(b));\n }), fe(\"click\", Mr, () => k(F, !0)), fe(\"mousedown\", Tt, (be) => {\n c(J) && (be.preventDefault(), k(J, !1)), k(b, !1), k(_, !1);\n }), fe(\"click\", ar, () => c(p)?.chain().focus().toggleBold().run()), fe(\"click\", un, () => c(p)?.chain().focus().toggleItalic().run()), fe(\"click\", si, () => {\n const be = window.prompt(\"Enter URL\");\n be && c(p)?.chain().focus().setLink({ href: be }).run();\n }), w(r, He), st(ee);\n}\nhr([\"pointerdown\", \"mousedown\", \"click\", \"keydown\"]);\nrt(fc, { id: {} }, [], [], { mode: \"open\" });\nconst Sm = \"frontend/DESIGN.md\", Em = \"frontend/src/lib/shop/settings.json\";\nfunction n2(r) {\n return `You are the Hintergrund email design agent. You design the shared email\nwrapper template and the transactional email texts for this project.\n\nThe wrapper template is an HTML document with these placeholders (all required, keep every one of them):\n- {{content}} \u2014 the email body is injected here\n- {{logo}} \u2014 the site logo (may render empty)\n- {{footer}} \u2014 the footer text\n- {{unsubscribe}} \u2014 the unsubscribe link (newsletters)\n\nEvery email \u2014 newsletters, welcome/confirmation emails, and shop order/payment\nemails \u2014 is rendered through this one wrapper, so it defines the brand of ALL\noutgoing mail.\n\nEmail HTML constraints:\n- Inline styles only; no <style> blocks, no classes, no external CSS.\n- No webfonts: use system font stacks (a named font may lead the stack as a hint).\n- Keep a single centered column, max-width around 580px.\n- Use simple, well-supported CSS (backgrounds, borders, border-radius, padding).\n\nTransactional emails and their available variables:\n- welcome \u2014 sent after a subscriber confirms. No variables.\n- confirmation \u2014 double-opt-in email. Must contain a link to {{confirm_url}}.\n- purchase \u2014 shop order received. Variables: {{order_number}}, {{invoice_number}}, {{amount}}. Payment instructions and the invoice PDF are appended automatically \u2014 do not write them yourself.\n- payment_confirmed \u2014 shop payment received. Variables: {{order_number}}, {{amount}}.\nTransactional bodies are HTML fragments (headings, paragraphs, links) that get injected into the wrapper \u2014 never full documents.\n\n${r ? `Design guide (frontend/DESIGN.md) \u2014 match it exactly; use its color tokens and font intent, do not invent new colors:\n${r}` : \"No design guide exists yet (the website setup has not decided a design). Use restrained, neutral styling.\"}\n\nWorking rules:\n- Read the current template before changing it; make targeted changes.\n- set_email_template replaces the fields you pass entirely \u2014 always pass complete values.\n- After each change, tell the user in one or two plain sentences what changed. The preview updates automatically.\n- Changes are staged locally; the user publishes them with the Save button. Do not claim anything was sent or published.`;\n}\nfunction s2(r, e) {\n return [{\n name: \"get_design_guide\",\n label: \"Read design guide\",\n description: \"Read the website design guide (frontend/DESIGN.md), if the project has one.\",\n parameters: Cl,\n execute: async () => {\n const a = e.getFileContent(Sm);\n return co(a ?? \"No DESIGN.md exists in this project.\", { exists: a !== null });\n }\n }, {\n name: \"get_email_template\",\n label: \"Read email template\",\n description: \"Read the current shared email wrapper template (html, primaryColor, footerHtml) and logo path.\",\n parameters: Cl,\n execute: async () => co(JSON.stringify({\n html: r.emailTemplate.html,\n primaryColor: r.emailTemplate.primaryColor,\n footerHtml: r.emailTemplate.footerHtml,\n logoPath: r.logoPath ?? null\n }, null, 2), {})\n }, {\n name: \"set_email_template\",\n label: \"Update email template\",\n description: \"Update the shared email wrapper template. Pass only the fields to change, each as a complete value. html must keep the {{content}}, {{logo}}, {{footer}} and {{unsubscribe}} placeholders.\",\n parameters: i2,\n executionMode: \"sequential\",\n execute: async (a, l) => {\n if (l.html !== void 0) {\n for (const u of [\"{{content}}\", \"{{logo}}\", \"{{footer}}\", \"{{unsubscribe}}\"])\n if (!l.html.includes(u)) throw new Error(`Template html is missing the ${u} placeholder.`);\n }\n r.updateEmailTemplate({\n ...l.html !== void 0 ? { html: l.html } : {},\n ...l.primaryColor !== void 0 ? { primaryColor: l.primaryColor } : {},\n ...l.footerHtml !== void 0 ? { footerHtml: l.footerHtml } : {}\n });\n const d = await r.saveSettings();\n if (!d.success) throw new Error(d.error ?? \"Failed to stage email template\");\n return co(\"Staged the updated email template. The preview reflects it now.\", {});\n }\n }, {\n name: \"get_transactional_emails\",\n label: \"Read transactional emails\",\n description: \"Read subject and body of all transactional emails: welcome, confirmation (newsletter) and purchase, payment_confirmed (shop).\",\n parameters: Cl,\n execute: async () => co(JSON.stringify(Tm(r, e), null, 2), {})\n }, {\n name: \"set_transactional_email\",\n label: \"Update transactional email\",\n description: \"Update subject and body of one transactional email. bodyHtml is an HTML fragment injected into the wrapper.\",\n parameters: a2,\n executionMode: \"sequential\",\n execute: async (a, l) => {\n const d = l.kind;\n if (d === \"confirmation\" && !l.bodyHtml.includes(\"{{confirm_url}}\"))\n throw new Error(\"The confirmation email must link to {{confirm_url}}.\");\n if (d === \"welcome\" || d === \"confirmation\") {\n r.updateAutomation({ [d]: { subject: l.subject, bodyHtml: l.bodyHtml } });\n const u = await r.saveSettings();\n if (!u.success) throw new Error(u.error ?? \"Failed to stage email settings\");\n } else\n o2(e, d, l.subject, l.bodyHtml);\n return co(`Staged the ${d.replace(\"_\", \" \")} email.`, { kind: d });\n }\n }];\n}\nfunction Tm(r, e) {\n const t = Mm(e);\n return {\n welcome: r.automation.welcome,\n confirmation: r.automation.confirmation,\n purchase: {\n subject: t.emailTemplates?.purchase?.subject ?? \"Your order {{order_number}}\",\n bodyHtml: t.emailTemplates?.purchase?.bodyHtml ?? \"<h2>Thank you for your order.</h2><p>Please find your invoice and payment instructions below.</p>\"\n },\n payment_confirmed: {\n subject: t.emailTemplates?.paymentConfirmed?.subject ?? \"Payment confirmed - {{order_number}}\",\n bodyHtml: t.emailTemplates?.paymentConfirmed?.bodyHtml ?? \"<h2>Payment confirmed</h2><p>We have received your payment of {{amount}} for order {{order_number}}. Thank you.</p>\"\n }\n };\n}\nfunction Mm(r) {\n try {\n return JSON.parse(r.getFileContent(Em) ?? \"{}\");\n } catch {\n return {};\n }\n}\nfunction o2(r, e, t, n) {\n const s = Mm(r), o = e === \"purchase\" ? \"purchase\" : \"paymentConfirmed\", i = {\n ...s,\n emailTemplates: {\n ...s.emailTemplates ?? {},\n [o]: { subject: t, bodyHtml: n }\n }\n };\n r.writeFile(Em, JSON.stringify(i, null, 2), {\n source: \"shop\",\n label: \"Update shop email text\"\n });\n}\nconst Cl = Xo({}), i2 = Xo({\n html: Ja(Us({ description: \"Complete wrapper HTML document including all placeholders.\" })),\n primaryColor: Ja(Us({ description: \"CSS color applied to headings in email bodies.\" })),\n footerHtml: Ja(Us({ description: \"HTML fragment shown in the footer of every email.\" }))\n}), a2 = Xo({\n kind: ig([\n oi(\"welcome\"),\n oi(\"confirmation\"),\n oi(\"purchase\"),\n oi(\"payment_confirmed\")\n ]),\n subject: Us(),\n bodyHtml: Us({ description: \"HTML fragment (headings, paragraphs, links) injected into the wrapper.\" })\n});\nfunction co(r, e) {\n return { content: [{ type: \"text\", text: r }], details: e };\n}\nvar l2 = S(\"<option> </option>\"), c2 = S(\"<!> Match website\", 1), d2 = S('<div class=\"empty-state svelte-7niise\"><!> <h3 class=\"svelte-7niise\">Design your emails</h3> <p class=\"svelte-7niise\">Every email \u2014 newsletters, welcome mails, and shop order emails \u2014 shares one template. Ask for changes (\"darker background\", \"rounder corners\", \"rewrite the order email friendlier\") and watch the preview update.</p></div>'), u2 = S('<div class=\"message-text svelte-7niise\"></div>'), f2 = S('<small class=\"svelte-7niise\">running</small>'), p2 = S('<div class=\"tool-call svelte-7niise\"><span class=\"tool-dot svelte-7niise\"></span> <span> </span> <!></div>'), h2 = S('<div class=\"message-error svelte-7niise\"> </div>'), m2 = S(\"<!> <!>\", 1), v2 = S('<article class=\"message svelte-7niise\"><div class=\"avatar svelte-7niise\" aria-hidden=\"true\"><!></div> <div class=\"message-body svelte-7niise\"><div class=\"message-meta svelte-7niise\"> </div> <!> <!></div></article>'), g2 = S('<div class=\"status-bar svelte-7niise\"><span class=\"status-spinner svelte-7niise\"></span> <span> </span></div>'), b2 = S('<div class=\"email-design svelte-7niise\"><div class=\"preview-pane svelte-7niise\"><div class=\"pane-header svelte-7niise\"><h3 class=\"svelte-7niise\">Preview</h3> <div class=\"preview-controls svelte-7niise\"><select aria-label=\"Preview email type\" class=\"svelte-7niise\"></select> <!></div></div> <div class=\"preview-subject svelte-7niise\"> </div> <div class=\"preview-wrapper svelte-7niise\"><iframe class=\"email-preview svelte-7niise\" title=\"Email preview\" frameborder=\"0\"></iframe></div></div> <div class=\"chat-pane svelte-7niise\"><header class=\"agent-header svelte-7niise\"><h2 class=\"svelte-7niise\">Design chat</h2></header> <div class=\"messages svelte-7niise\" aria-live=\"polite\"><!></div> <!> <form class=\"composer svelte-7niise\"><textarea placeholder=\"Describe how your emails should look...\" rows=\"1\" class=\"svelte-7niise\"></textarea> <div class=\"composer-actions svelte-7niise\"><span class=\"composer-hint svelte-7niise\">Shift Enter for a new line</span> <!></div></form></div></div>');\nconst y2 = {\n hash: \"svelte-7niise\",\n code: `.email-design.svelte-7niise {display:grid;grid-template-columns:minmax(0, 1fr) minmax(320px, 420px);gap:0;flex:1;min-height:0;border:1px solid var(--borderColor-default, #d0d7de);border-radius:8px;overflow:hidden;margin:1rem 0;background:var(--bgColor-default, #ffffff);}.preview-pane.svelte-7niise {display:flex;flex-direction:column;min-width:0;min-height:0;border-right:1px solid var(--borderColor-default, #d0d7de);background:var(--bgColor-muted, #f6f8fa);}.pane-header.svelte-7niise {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px;border-bottom:1px solid var(--borderColor-default, #d0d7de);background:var(--bgColor-default, #ffffff);}.pane-header.svelte-7niise h3:where(.svelte-7niise) {margin:0;font-size:14px;}.preview-controls.svelte-7niise {display:flex;align-items:center;gap:8px;}.preview-controls.svelte-7niise select:where(.svelte-7niise) {padding:4px 8px;border:1px solid var(--borderColor-default, #d0d7de);border-radius:6px;background:var(--bgColor-default, #ffffff);color:var(--fgColor-default, #24292f);font-size:13px;}.preview-subject.svelte-7niise {padding:8px 16px;font-size:13px;color:var(--fgColor-muted, #656d76);border-bottom:1px solid var(--borderColor-muted, #d8dee4);background:var(--bgColor-default, #ffffff);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.preview-wrapper.svelte-7niise {flex:1;min-height:0;}.email-preview.svelte-7niise {width:100%;height:100%;border:0;background:transparent;}.chat-pane.svelte-7niise {display:grid;grid-template-rows:auto minmax(0, 1fr) auto auto;min-height:0;background:var(--bgColor-default, #ffffff);}.agent-header.svelte-7niise {display:flex;align-items:center;padding:12px 16px;border-bottom:1px solid var(--borderColor-default, #d0d7de);}.agent-header.svelte-7niise h2:where(.svelte-7niise) {margin:0;font-size:16px;line-height:24px;}.messages.svelte-7niise {min-height:0;overflow-y:auto;padding:16px;}.empty-state.svelte-7niise {display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:16px;border:1px solid var(--borderColor-default, #d0d7de);border-radius:6px;background:var(--bgColor-muted, #f6f8fa);color:var(--fgColor-muted, #656d76);}.empty-state.svelte-7niise h3:where(.svelte-7niise) {margin:0;color:var(--fgColor-default, #24292f);font-size:16px;}.empty-state.svelte-7niise p:where(.svelte-7niise) {margin:0;font-size:14px;line-height:20px;}.message.svelte-7niise {display:grid;grid-template-columns:28px minmax(0, 1fr);gap:10px;margin-bottom:16px;}.avatar.svelte-7niise {display:grid;place-items:center;width:28px;height:28px;border:1px solid var(--borderColor-default, #d0d7de);border-radius:50%;background:var(--bgColor-default, #ffffff);color:var(--fgColor-muted, #656d76);}.message[data-role='assistant'].svelte-7niise .avatar:where(.svelte-7niise) {background:var(--bgColor-accent-muted, #ddf4ff);color:var(--fgColor-accent, #0969da);border-color:var(--borderColor-accent-muted, #54aeff66);}.message-body.svelte-7niise {min-width:0;}.message-meta.svelte-7niise {margin-bottom:4px;color:var(--fgColor-muted, #656d76);font-size:12px;font-weight:600;}.message-text.svelte-7niise {font-size:14px;line-height:1.5;}.message-text.svelte-7niise p {margin:0 0 12px;}.message-text.svelte-7niise p:last-child {margin-bottom:0;}.message-text.svelte-7niise code {font-family:var(--fontStack-monospace, monospace);background:var(--bgColor-muted, #f6f8fa);padding:0.2em 0.4em;border-radius:3px;font-size:85%;}.message[data-role='user'].svelte-7niise .message-text:where(.svelte-7niise) {display:inline-block;max-width:100%;padding:8px 12px;border:1px solid var(--borderColor-default, #d0d7de);border-radius:6px;background:var(--bgColor-muted, #f6f8fa);}.tool-call.svelte-7niise,\n\t.status-bar.svelte-7niise {display:inline-flex;align-items:center;gap:8px;margin-top:8px;padding:5px 8px;border:1px solid var(--borderColor-default, #d0d7de);border-radius:6px;background:var(--bgColor-muted, #f6f8fa);color:var(--fgColor-muted, #656d76);font-size:12px;line-height:18px;}.tool-call.svelte-7niise small:where(.svelte-7niise) {color:var(--fgColor-accent, #0969da);}.tool-dot.svelte-7niise {width:8px;height:8px;border-radius:50%;background:var(--fgColor-success, #1a7f37);}.tool-call[data-pending='true'].svelte-7niise .tool-dot:where(.svelte-7niise),\n\t.status-spinner.svelte-7niise {width:10px;height:10px;border:2px solid var(--borderColor-muted, #d8dee4);border-top-color:var(--fgColor-accent, #0969da);border-radius:50%;\n\t\tanimation: svelte-7niise-spin 0.8s linear infinite;}.message-error.svelte-7niise {margin-top:8px;padding:8px;border:1px solid var(--borderColor-danger-muted, #ff818266);border-radius:6px;background:var(--bgColor-danger-muted, #ffebe9);color:var(--fgColor-danger, #cf222e);font-size:13px;}.status-bar.svelte-7niise {margin:0 16px 12px;}.composer.svelte-7niise {display:flex;flex-direction:column;gap:8px;padding:12px 16px 16px;border-top:1px solid var(--borderColor-default, #d0d7de);}.composer.svelte-7niise textarea:where(.svelte-7niise) {width:100%;min-height:40px;max-height:180px;resize:none;padding:9px 10px;border:1px solid var(--borderColor-default, #d0d7de);border-radius:6px;background:var(--bgColor-default, #ffffff);color:var(--fgColor-default, #24292f);font:inherit;font-size:14px;line-height:20px;}.composer.svelte-7niise textarea:where(.svelte-7niise):focus {border-color:var(--focus-outlineColor, #0969da);outline:2px solid var(--focus-outlineColor, #0969da);outline-offset:-1px;}.composer-actions.svelte-7niise {display:flex;align-items:center;justify-content:space-between;gap:8px;}.composer-hint.svelte-7niise {color:var(--fgColor-muted, #656d76);font-size:12px;}\n\n\t@keyframes svelte-7niise-spin {\n\t\tto {\n\t\t\ttransform: rotate(360deg);\n\t\t}\n\t}\n\n\t@media (max-width: 900px) {.email-design.svelte-7niise {grid-template-columns:1fr;grid-template-rows:minmax(280px, 45%) minmax(0, 1fr);}.preview-pane.svelte-7niise {border-right:0;border-bottom:1px solid var(--borderColor-default, #d0d7de);}\n\t}`\n};\nfunction Am(r, e) {\n nt(e, !0), bt(r, y2);\n const { emails: t, notifications: n } = no(), { repoFiles: s } = yn();\n let o = W(\"newsletter\");\n const i = [\n { id: \"newsletter\", label: \"Newsletter\" },\n { id: \"welcome\", label: \"Welcome\" },\n { id: \"confirmation\", label: \"Confirmation\" },\n { id: \"purchase\", label: \"Order received\" },\n { id: \"payment_confirmed\", label: \"Payment confirmed\" }\n ], a = {\n order_number: \"ORD-1042\",\n invoice_number: \"INV-1042\",\n amount: \"\u20AC49.00\",\n confirm_url: \"#\"\n }, l = {\n subject: \"Our latest updates\",\n bodyHtml: `<h2>Newsletter Title</h2>\n<p>Dear Reader,</p>\n<p>Here is your regular update with the latest news and highlights.</p>\n<h3>Latest News</h3>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n<p>Best regards,<br>The Team</p>`\n };\n function d(Z) {\n return Z.replace(/\\{\\{(\\w+)\\}\\}/g, (pe, xe) => a[xe] ?? pe);\n }\n function u(Z, pe) {\n return Z.replace(/<(h[1-4])([^>]*)>/gi, (xe, Be, We) => /style=/i.test(We) ? xe.replace(/style=([\"'])(.*?)\\1/i, `style=$1color:${pe};$2$1`) : `<${Be}${We} style=\"color:${pe};\">`);\n }\n const f = ie(() => c(o) === \"newsletter\" ? l : Tm(t, s)[c(o)]), h = ie(() => {\n const Z = t.emailTemplate, pe = u(d(c(f).bodyHtml), Z.primaryColor), xe = t.logo ? `<div style=\"text-align:center;margin:0 0 20px 0;\"><img src=\"${t.logo}\" alt=\"Logo\" style=\"max-width:120px;max-height:80px;height:auto;\"></div>` : \"\", Be = c(o) === \"newsletter\" ? '<p style=\"margin:10px 0 0 0;\"><a href=\"#\" style=\"color:inherit;text-decoration:underline;\">Unsubscribe</a></p>' : \"\";\n return Z.html.replaceAll(\"{{content}}\", pe).replaceAll(\"{{logo}}\", xe).replaceAll(\"{{footer}}\", Z.footerHtml ?? \"\").replaceAll(\"{{unsubscribe}}\", Be).replaceAll(\"{{unsubscribe_url}}\", \"#\");\n });\n let p, g, b = W(\"\"), y = W(ft([])), C = W(void 0), E = W(ft(/* @__PURE__ */ new Set())), R = W(!1), q = W(null), O = W(void 0), M = W(void 0);\n const P = ie(() => [\n ...c(y),\n ...c(C) ? [c(C)] : []\n ].filter((Z) => Z.role === \"user\" || Z.role === \"assistant\")), L = ie(() => c(b).trim().length > 0 && !c(R) && !!p);\n Ar(() => {\n t.hasStoredTemplate || (t.ensureTemplateStaged(), n.info(\"Email template designed from your website design. Review and save to publish.\")), p = new Ec({\n initialState: {\n systemPrompt: n2(s.getFileContent(Sm)),\n model: lg(),\n thinkingLevel: \"off\",\n messages: [],\n tools: s2(t, s)\n },\n convertToLlm: (Z) => Z.filter((pe) => pe.role === \"user\" || pe.role === \"assistant\" || pe.role === \"toolResult\"),\n getApiKey: ag,\n toolExecution: \"sequential\"\n }), g = p.subscribe(async (Z) => {\n Z.type === \"tool_execution_start\" ? k(q, `${Q(Z.toolName)} running`) : Z.type === \"tool_execution_end\" ? k(\n q,\n Z.isError ? `${Q(Z.toolName)} failed` : `${Q(Z.toolName)} finished`,\n !0\n ) : Z.type === \"agent_end\" && k(q, null), $(), await z();\n }), $();\n }), ka(() => {\n g?.(), p?.abort();\n });\n function $() {\n p && (k(y, [...p.state.messages], !0), k(C, p.state.streamingMessage, !0), k(E, new Set(p.state.pendingToolCalls), !0), k(R, p.state.isStreaming, !0));\n }\n async function J() {\n if (!p || !c(L)) return;\n const Z = c(b).trim();\n k(b, \"\"), F();\n try {\n await p.prompt(Z);\n } catch (pe) {\n n.error(pe instanceof Error ? pe.message : String(pe));\n } finally {\n $();\n }\n }\n function U(Z) {\n Z.key === \"Enter\" && !Z.shiftKey && (Z.preventDefault(), J());\n }\n function F() {\n c(M) && (c(M).style.height = \"0px\", c(M).style.height = `${Math.min(c(M).scrollHeight, 180)}px`);\n }\n async function z() {\n await Cc(), c(O) && (c(O).scrollTop = c(O).scrollHeight);\n }\n function _(Z) {\n const pe = Z.content;\n return typeof pe == \"string\" ? pe : Array.isArray(pe) ? pe.filter((xe) => xe?.type === \"text\" || xe?.type === \"thinking\").map((xe) => xe.text ?? xe.thinking ?? \"\").filter(Boolean).join(`\n\n`) : \"\";\n }\n function N(Z) {\n const pe = Z.content;\n return Array.isArray(pe) ? pe.filter((xe) => xe?.type === \"toolCall\") : [];\n }\n function Q(Z) {\n return p?.state.tools.find((xe) => xe.name === Z)?.label ?? Z.replaceAll(\"_\", \" \");\n }\n function T() {\n t.applyWebsiteDesign() ? n.success(\"Email template matched to the website design.\") : n.warning(\"No website design found. Complete the website setup first.\");\n }\n var I = b2(), te = v(I), A = v(te), V = x(v(A), 2), H = v(V);\n tt(H, 21, () => i, (Z) => Z.id, (Z, pe) => {\n var xe = l2(), Be = v(xe, !0);\n m(xe);\n var We = {};\n B(() => {\n D(Be, c(pe).label), We !== (We = c(pe).id) && (xe.value = (xe.__value = c(pe).id) ?? \"\");\n }), w(Z, xe);\n }), m(H);\n var ne = x(H, 2);\n Je(ne, {\n variant: \"default\",\n size: \"small\",\n onclick: T,\n children: (Z, pe) => {\n var xe = c2(), Be = ke(xe);\n tr(Be, { icon: \"sync\" }), Pe(), w(Z, xe);\n },\n $$slots: { default: !0 }\n }), m(V), m(A);\n var X = x(A, 2), G = v(X);\n m(X);\n var Y = x(X, 2), se = v(Y);\n m(Y), m(te);\n var ue = x(te, 2), le = x(v(ue), 2), re = v(le);\n {\n var ae = (Z) => {\n var pe = d2(), xe = v(pe);\n tr(xe, { icon: \"comment-discussion\", size: 24 }), Pe(4), m(pe), w(Z, pe);\n }, ge = (Z) => {\n var pe = lt(), xe = ke(pe);\n tt(xe, 19, () => c(P), (Be, We) => `${Be.role}-${Be.timestamp ?? We}-${We}`, (Be, We) => {\n var ee = v2(), He = v(ee), ve = v(He);\n {\n var Te = (yt) => {\n tr(yt, { icon: \"person\", size: 16 });\n }, Me = (yt) => {\n tr(yt, { icon: \"sparkle-fill\", size: 16 });\n };\n K(ve, (yt) => {\n c(We).role === \"user\" ? yt(Te) : yt(Me, -1);\n });\n }\n m(He);\n var Xe = x(He, 2), mt = v(Xe), Et = v(mt, !0);\n m(mt);\n var Dt = x(mt, 2);\n {\n var Rt = (yt) => {\n var Ae = u2();\n Af(Ae, () => cg.parse(_(c(We))), !0), m(Ae), w(yt, Ae);\n }, er = ie(() => _(c(We)));\n K(Dt, (yt) => {\n c(er) && yt(Rt);\n });\n }\n var ct = x(Dt, 2);\n {\n var vt = (yt) => {\n var Ae = m2(), Ye = ke(Ae);\n tt(Ye, 17, () => N(c(We)), (me) => me.id, (me, we) => {\n var Ee = p2(), je = x(v(Ee), 2), ze = v(je, !0);\n m(je);\n var Ve = x(je, 2);\n {\n var it = (Qe) => {\n var sr = f2();\n w(Qe, sr);\n }, _t = ie(() => c(E).has(c(we).id));\n K(Ve, (Qe) => {\n c(_t) && Qe(it);\n });\n }\n m(Ee), B(\n (Qe, sr) => {\n Ge(Ee, \"data-pending\", Qe), D(ze, sr);\n },\n [\n () => c(E).has(c(we).id),\n () => Q(c(we).name)\n ]\n ), w(me, Ee);\n });\n var xt = x(Ye, 2);\n {\n var ut = (me) => {\n var we = h2(), Ee = v(we, !0);\n m(we), B(() => D(Ee, c(We).errorMessage)), w(me, we);\n };\n K(xt, (me) => {\n c(We).errorMessage && me(ut);\n });\n }\n w(yt, Ae);\n };\n K(ct, (yt) => {\n c(We).role === \"assistant\" && yt(vt);\n });\n }\n m(Xe), m(ee), B(() => {\n Ge(ee, \"data-role\", c(We).role), D(Et, c(We).role === \"user\" ? \"You\" : \"Email design\");\n }), w(Be, ee);\n }), w(Z, pe);\n };\n K(re, (Z) => {\n c(P).length === 0 ? Z(ae) : Z(ge, -1);\n });\n }\n m(le), bn(le, (Z) => k(O, Z), () => c(O));\n var Se = x(le, 2);\n {\n var _e = (Z) => {\n var pe = g2(), xe = x(v(pe), 2), Be = v(xe, !0);\n m(xe), m(pe), B(() => D(Be, c(q))), w(Z, pe);\n };\n K(Se, (Z) => {\n c(q) && Z(_e);\n });\n }\n var Re = x(Se, 2), Ie = v(Re);\n Go(Ie), bn(Ie, (Z) => k(M, Z), () => c(M));\n var Fe = x(Ie, 2), j = x(v(Fe), 2);\n {\n var oe = (Z) => {\n Je(Z, {\n variant: \"default\",\n onclick: () => p?.abort(),\n leadingIcon: \"stop\",\n children: (pe, xe) => {\n Pe();\n var Be = qe(\"Stop\");\n w(pe, Be);\n },\n $$slots: { default: !0 }\n });\n }, he = (Z) => {\n {\n let pe = ie(() => !c(L));\n Je(Z, {\n type: \"submit\",\n variant: \"primary\",\n get disabled() {\n return c(pe);\n },\n leadingIcon: \"paper-airplane\",\n children: (xe, Be) => {\n Pe();\n var We = qe(\"Send\");\n w(xe, We);\n },\n $$slots: { default: !0 }\n });\n }\n };\n K(j, (Z) => {\n c(R) ? Z(oe) : Z(he, -1);\n });\n }\n m(Fe), m(Re), m(ue), m(I), B(\n (Z) => {\n D(G, `Subject: ${Z ?? \"\"}`), Ge(se, \"srcdoc\", c(h)), Ie.disabled = c(R);\n },\n [() => d(c(f).subject)]\n ), Tc(H, () => c(o), (Z) => k(o, Z)), jn(\"submit\", Re, (Z) => (Z.preventDefault(), J())), fe(\"input\", Ie, F), fe(\"keydown\", Ie, U), nr(Ie, () => c(b), (Z) => k(b, Z)), w(r, I), st();\n}\nhr([\"input\", \"keydown\"]);\nrt(Am, {}, [], [], { mode: \"open\" });\nvar x2 = S('<div class=\"conflict-banner svelte-1ebl7ka\"><span> </span> <!></div>'), w2 = S('<p class=\"empty-state svelte-1ebl7ka\">No unsaved changes.</p>'), k2 = S('<button type=\"button\" class=\"cs-expand svelte-1ebl7ka\"><span class=\"cs-caret svelte-1ebl7ka\"> </span> <span class=\"cs-label svelte-1ebl7ka\"> </span></button>'), C2 = S('<div class=\"cs-title-static svelte-1ebl7ka\"><span class=\"cs-label svelte-1ebl7ka\"> </span></div>'), _2 = S('<span class=\"file-chip svelte-1ebl7ka\"> </span>'), S2 = S('<span class=\"file-list svelte-1ebl7ka\"></span>'), E2 = S('<button type=\"button\" class=\"cs-expand svelte-1ebl7ka\"><span class=\"cs-caret svelte-1ebl7ka\"> </span> <span class=\"cs-label svelte-1ebl7ka\"> </span> <!></button>'), T2 = S('<div class=\"diff-block diff-old svelte-1ebl7ka\"><div class=\"diff-label svelte-1ebl7ka\">Current</div> <div class=\"diff-value svelte-1ebl7ka\"> </div></div>'), M2 = S('<div class=\"diff-block diff-new svelte-1ebl7ka\"><div class=\"diff-label svelte-1ebl7ka\">Proposed</div> <div class=\"diff-value svelte-1ebl7ka\"> </div></div>'), A2 = S('<div class=\"diff-row svelte-1ebl7ka\"><div class=\"diff-row-header svelte-1ebl7ka\"><div class=\"diff-row-key svelte-1ebl7ka\"> </div> <div class=\"diff-row-actions svelte-1ebl7ka\"><!> <!></div></div> <!> <!></div>'), P2 = S('<div class=\"diff-section-title svelte-1ebl7ka\"> </div> <!>', 1), N2 = S('<div class=\"diff-block diff-old svelte-1ebl7ka\"><div class=\"diff-label svelte-1ebl7ka\">Current</div> <div class=\"diff-value svelte-1ebl7ka\"> </div></div>'), O2 = S('<div class=\"diff-block diff-new svelte-1ebl7ka\"><div class=\"diff-label svelte-1ebl7ka\">Proposed</div> <div class=\"diff-value svelte-1ebl7ka\"> </div></div>'), $2 = S('<div class=\"diff-row svelte-1ebl7ka\"><div class=\"diff-row-header svelte-1ebl7ka\"><div class=\"diff-row-key svelte-1ebl7ka\"> </div> <div class=\"diff-row-actions svelte-1ebl7ka\"><!> <!></div></div> <!> <!></div>'), I2 = S('<div class=\"diff-section-title svelte-1ebl7ka\"> </div> <!>', 1), z2 = S('<div class=\"diff-row-key svelte-1ebl7ka\" style=\"padding: 0.5rem 1rem; color: var(--fgColor-muted, #656d76);\"> </div>'), R2 = S('<div class=\"diff-row-key svelte-1ebl7ka\" style=\"padding: 0.5rem 1rem; color: var(--fgColor-muted, #656d76);\"> </div>'), j2 = S('<div class=\"cs-cms-diffs svelte-1ebl7ka\"></div>'), L2 = S('<div class=\"diff-block diff-old svelte-1ebl7ka\"><div class=\"diff-label svelte-1ebl7ka\">Current</div> <div class=\"diff-value svelte-1ebl7ka\"> </div></div>'), D2 = S('<div class=\"diff-block diff-new svelte-1ebl7ka\"><div class=\"diff-label svelte-1ebl7ka\">Proposed</div> <div class=\"diff-value svelte-1ebl7ka\"> </div></div>'), F2 = S('<div class=\"diff-row compact svelte-1ebl7ka\"><div class=\"diff-row-key svelte-1ebl7ka\"> </div> <!> <!></div>'), B2 = S('<div class=\"product-diff svelte-1ebl7ka\"><div class=\"diff-row-header svelte-1ebl7ka\"><div><div class=\"product-title svelte-1ebl7ka\"> </div> <div class=\"product-kind svelte-1ebl7ka\"> </div></div> <div class=\"diff-row-actions svelte-1ebl7ka\"><!> <!></div></div> <!></div>'), H2 = S('<div class=\"diff-section-title svelte-1ebl7ka\">Products</div> <!>', 1), q2 = S('<div class=\"diff-block diff-old svelte-1ebl7ka\"><div class=\"diff-label svelte-1ebl7ka\">Current</div> <pre class=\"diff-value svelte-1ebl7ka\"> </pre></div>'), V2 = S('<div class=\"diff-block diff-new svelte-1ebl7ka\"><div class=\"diff-label svelte-1ebl7ka\">Proposed</div> <pre class=\"diff-value svelte-1ebl7ka\"> </pre></div>'), W2 = S('<div class=\"diff-section-title svelte-1ebl7ka\"> </div> <div class=\"diff-row svelte-1ebl7ka\"><div class=\"diff-row-header svelte-1ebl7ka\"><div class=\"diff-row-key svelte-1ebl7ka\"> </div> <div class=\"diff-row-actions svelte-1ebl7ka\"><!></div></div> <!> <!></div>', 1), U2 = S('<div class=\"cs-cms-diffs svelte-1ebl7ka\"></div>'), J2 = S('<div class=\"change-set svelte-1ebl7ka\"><div class=\"cs-header svelte-1ebl7ka\"><!> <div class=\"cs-meta svelte-1ebl7ka\"><span> </span> <span class=\"cs-bullet svelte-1ebl7ka\">\u00B7</span> <span> </span> <span class=\"cs-bullet svelte-1ebl7ka\">\u00B7</span> <span> </span></div> <div class=\"cs-actions svelte-1ebl7ka\"><!> <!></div></div> <!></div>'), K2 = S('<span class=\"btn-content\"><!> Saving...</span>'), G2 = S('<div class=\"backdrop svelte-1ebl7ka\" tabindex=\"-1\" role=\"dialog\" aria-modal=\"true\" aria-label=\"Review your changes\"><div class=\"modal svelte-1ebl7ka\" tabindex=\"-1\"><div class=\"modal-header svelte-1ebl7ka\"><h2 class=\"svelte-1ebl7ka\">Review your changes</h2> <button type=\"button\" class=\"close-btn svelte-1ebl7ka\" aria-label=\"Close\">\u00D7</button></div> <!> <div class=\"modal-body svelte-1ebl7ka\"><!></div> <div class=\"modal-footer svelte-1ebl7ka\"><!> <!></div></div></div>');\nconst Y2 = {\n hash: \"svelte-1ebl7ka\",\n code: `.backdrop.svelte-1ebl7ka {position:fixed;inset:0;background:rgba(175, 184, 193, 0.2);display:flex;align-items:center;justify-content:center;z-index:999;}.modal.svelte-1ebl7ka {background:var(--bgColor-default, #fff);border-radius:0.75rem;box-shadow:0 1px 3px rgba(31,35,40,0.12), 0 8px 24px rgba(66,74,83,0.12);display:flex;flex-direction:column;width:min(800px, 100vw - 4rem);max-height:min(100vh - 2rem, 760px);min-height:0;overflow:hidden;}.modal-header.svelte-1ebl7ka {display:flex;align-items:center;justify-content:space-between;padding:1rem 1.5rem;border-bottom:1px solid var(--borderColor-default, #d0d7de);flex-shrink:0;}.modal-header.svelte-1ebl7ka h2:where(.svelte-1ebl7ka) {margin:0;font-size:1rem;font-weight:500;}.close-btn.svelte-1ebl7ka {border:0;background:transparent;font-size:1.5rem;line-height:1;cursor:pointer;color:var(--fgColor-muted, #656d76);padding:0 0.25rem;}.conflict-banner.svelte-1ebl7ka {display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:0.75rem 1.5rem;background:var(--bgColor-danger-muted, #ffebe9);border-bottom:1px solid var(--borderColor-danger-muted, #ffa198);font-size:0.875rem;color:var(--fgColor-danger, #cf222e);flex-shrink:0;}.modal-body.svelte-1ebl7ka {flex:1;overflow-y:auto;min-height:0;padding:1rem;display:flex;flex-direction:column;gap:0.75rem;}.empty-state.svelte-1ebl7ka {text-align:center;color:var(--fgColor-muted, #656d76);padding:2rem;margin:0;}.change-set.svelte-1ebl7ka {border:1px solid var(--borderColor-default, #d0d7de);border-radius:0.5rem;overflow:hidden;}.cs-header.svelte-1ebl7ka {display:flex;align-items:flex-start;gap:0.75rem;padding:0.75rem 1rem;background:var(--bgColor-muted, #f6f8fa);flex-wrap:wrap;}.cs-expand.svelte-1ebl7ka {display:flex;align-items:center;gap:0.375rem;background:none;border:none;cursor:pointer;font-size:0.875rem;font-weight:600;color:var(--fgColor-default, #1f2328);flex:1;min-width:0;text-align:left;padding:0;}.cs-title-static.svelte-1ebl7ka {display:flex;align-items:center;gap:0.375rem;font-size:0.875rem;font-weight:600;color:var(--fgColor-default, #1f2328);flex:1;min-width:0;padding:0;}.cs-title {display:flex;flex-direction:column;gap:0.375rem;flex:1;min-width:0;}.cs-caret.svelte-1ebl7ka {flex-shrink:0;font-size:0.75rem;opacity:0.6;}.cs-label.svelte-1ebl7ka {font-size:0.875rem;font-weight:600;color:var(--fgColor-default, #1f2328);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.file-list.svelte-1ebl7ka {display:flex;flex-wrap:wrap;gap:0.25rem;}.file-chip.svelte-1ebl7ka {font-size:0.6875rem;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, Menlo, monospace);background:var(--bgColor-default, #fff);border:1px solid var(--borderColor-muted, #d8dee4);border-radius:0.25rem;padding:0.125rem 0.375rem;color:var(--fgColor-muted, #656d76);}.cs-meta.svelte-1ebl7ka {display:flex;gap:0.375rem;font-size:0.75rem;color:var(--fgColor-muted, #656d76);flex-shrink:0;align-items:center;padding-top:0.125rem;}.cs-bullet.svelte-1ebl7ka {opacity:0.4;}.cs-actions.svelte-1ebl7ka {display:flex;gap:0.375rem;flex-shrink:0;}\n\n\t/* CMS diff styles \u2014 mirrors Header.svelte */.cs-cms-diffs.svelte-1ebl7ka {padding:0.75rem 1rem;display:flex;flex-direction:column;gap:0.5rem;border-top:1px solid var(--borderColor-muted, #d8dee4);}.diff-section-title.svelte-1ebl7ka {font-size:0.8125rem;font-weight:600;color:var(--fgColor-default, #1f2328);margin-top:0.25rem;}.diff-row.svelte-1ebl7ka {display:flex;flex-direction:column;gap:0.375rem;padding:0.625rem 0.75rem;border:1px solid var(--borderColor-muted, #d8dee4);border-radius:0.375rem;background:var(--bgColor-muted, #f6f8fa);}.diff-row.compact.svelte-1ebl7ka {padding:0.5rem;background:var(--bgColor-default, #fff);}.product-diff.svelte-1ebl7ka {border:1px solid var(--borderColor-muted, #d8dee4);border-radius:0.375rem;padding:0.75rem;background:var(--bgColor-muted, #f6f8fa);}.product-diff.svelte-1ebl7ka {display:flex;flex-direction:column;gap:0.5rem;}.product-title.svelte-1ebl7ka {font-weight:600;color:var(--fgColor-default, #1f2328);}.product-kind.svelte-1ebl7ka {margin-top:0.125rem;font-size:0.6875rem;text-transform:uppercase;color:var(--fgColor-muted, #656d76);}.diff-row-header.svelte-1ebl7ka {display:flex;align-items:center;justify-content:space-between;gap:0.5rem;}.diff-row-key.svelte-1ebl7ka {font-size:0.75rem;font-weight:600;color:var(--fgColor-muted, #656d76);text-transform:uppercase;letter-spacing:0.04em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.diff-row-actions.svelte-1ebl7ka {display:flex;gap:0.375rem;flex-shrink:0;}.diff-block.svelte-1ebl7ka {border:1px solid var(--borderColor-muted, #d8dee4);border-radius:0.375rem;padding:0.5rem 0.625rem;background:var(--bgColor-default, #fff);font-size:0.8125rem;}.diff-label.svelte-1ebl7ka {font-size:0.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:var(--fgColor-muted, #656d76);margin-bottom:0.25rem;}.diff-value.svelte-1ebl7ka {margin:0;white-space:pre-wrap;word-break:break-word;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:0.75rem;line-height:1.45;max-height:12rem;overflow-y:auto;}.diff-old.svelte-1ebl7ka .diff-value:where(.svelte-1ebl7ka) {color:var(--fgColor-muted, #656d76);text-decoration:line-through;text-decoration-color:rgba(207, 34, 46, 0.4);}.diff-new.svelte-1ebl7ka {background:var(--bgColor-success-muted, #dafbe1);border-color:rgba(26, 127, 55, 0.4);}.diff-row[data-kind='deleted'].svelte-1ebl7ka .diff-old:where(.svelte-1ebl7ka) .diff-value:where(.svelte-1ebl7ka) {color:var(--fgColor-danger, #d1242f);}.modal-footer.svelte-1ebl7ka {display:flex;justify-content:flex-end;gap:0.75rem;padding:1rem 1.5rem;border-top:1px solid var(--borderColor-default, #d0d7de);flex-shrink:0;}.btn-content {display:flex;align-items:center;gap:0.5rem;}\n\n\t@media (max-width: 640px) {.modal.svelte-1ebl7ka {width:100vw;max-height:100dvh;border-radius:0;margin:0;}\n\t}`\n};\nfunction ni(r, e) {\n nt(e, !0), bt(r, Y2);\n let t = ce(e, \"open\", 7), n = ce(e, \"onClose\", 7);\n const { repoFiles: s, notifications: o } = yn();\n let i = W(null);\n try {\n k(\n i,\n ro(),\n /* not in CMS tree */\n !0\n );\n } catch {\n }\n let a = W(ft(/* @__PURE__ */ new Set())), l = W(!1), d = W(null);\n function u(A) {\n const V = new Set(c(a));\n V.has(A) ? V.delete(A) : V.add(A), k(a, V, !0);\n }\n function f(A) {\n if (A.length === 0) return \"Save changes\";\n const V = A.map((H) => H.label);\n if (V.length <= 3) {\n const H = V.join(\", \");\n return H.length > 72 ? H.slice(0, 69) + \"...\" : H;\n }\n return `${V[0].slice(0, 40)} and ${V.length - 1} more changes`;\n }\n async function h() {\n k(l, !0), k(d, null);\n try {\n const A = f(s.changeSets);\n await s.commitDirty(A), o.success(\"Changes saved successfully\"), n()();\n } catch (A) {\n A instanceof Kv ? k(d, \"The repository was updated upstream. Sync to continue.\") : o.error(`Save failed: ${A instanceof Error ? A.message : \"Unknown error\"}`);\n } finally {\n k(l, !1);\n }\n }\n async function p() {\n k(d, null);\n try {\n await s.syncFromAPI(), o.success(\"Synced latest changes. Review and save again.\");\n } catch {\n o.error(\"Sync failed.\");\n }\n }\n function g(A) {\n s.discardChangeSet(A), s.changeSets.length === 0 && n()();\n }\n function b(A) {\n if (A.source === \"builder\") return \"#website/chat\";\n if (A.source === \"shop\") return \"#shop/products\";\n if (A.source === \"emails\") return \"#settings/emails\";\n const H = (A.paths[0] ?? \"\").match(/frontend\\/src\\/lib\\/content\\/(.+)\\.json$/);\n return H ? `#website/content/${H[1]}` : \"#website/content\";\n }\n function y(A) {\n const V = Date.now() - A;\n if (V < 6e4) return \"just now\";\n if (V < 36e5) return `${Math.floor(V / 6e4)}m ago`;\n if (V < 864e5) return `${Math.floor(V / 36e5)}h ago`;\n const H = Math.floor(V / 864e5), ne = Math.floor(V % 864e5 / 36e5);\n return ne === 0 ? `${H}d ago` : `${H}d ${ne}h ago`;\n }\n function C(A, V) {\n return c(i)?.collections.config[A]?.fields?.[V]?.label ?? V;\n }\n function E(A) {\n if (A == null) return \"\";\n if (typeof A == \"string\") return A;\n try {\n return JSON.stringify(A, null, 2);\n } catch {\n return String(A);\n }\n }\n function R(A, V, H) {\n if (!c(i)) return [];\n if (H === \"delete\") return [];\n const ne = c(i).collections.gitData[A]?.[V], X = [];\n if (!ne) {\n for (const Y of Object.keys(H))\n X.push({ key: Y, old: void 0, new: H[Y], kind: \"added\" });\n return X;\n }\n const G = /* @__PURE__ */ new Set([...Object.keys(ne), ...Object.keys(H)]);\n for (const Y of G) {\n const se = Y in ne, ue = Y in H;\n !se && ue ? X.push({ key: Y, old: void 0, new: H[Y], kind: \"added\" }) : se && !ue ? X.push({ key: Y, old: ne[Y], new: void 0, kind: \"deleted\" }) : se && ue && JSON.stringify(ne[Y]) !== JSON.stringify(H[Y]) && X.push({\n key: Y,\n old: ne[Y],\n new: H[Y],\n kind: \"modified\"\n });\n }\n return X;\n }\n function q(A) {\n if (!c(i)) return [];\n const V = c(i).collections.gitData[A], H = c(i).collections.data[A], ne = [];\n if (!V) {\n for (const G of Object.keys(H || {}))\n ne.push({\n key: G,\n old: void 0,\n new: H?.[G],\n kind: \"added\"\n });\n return ne;\n }\n const X = /* @__PURE__ */ new Set([\n ...Object.keys(V),\n ...Object.keys(H || {})\n ]);\n for (const G of X) {\n const Y = G in V, se = H && G in H;\n !Y && se ? ne.push({ key: G, old: void 0, new: H[G], kind: \"added\" }) : Y && !se ? ne.push({\n key: G,\n old: V[G],\n new: void 0,\n kind: \"deleted\"\n }) : Y && se && JSON.stringify(V[G]) !== JSON.stringify(H[G]) && ne.push({\n key: G,\n old: V[G],\n new: H[G],\n kind: \"modified\"\n });\n }\n return ne;\n }\n function O(A) {\n s.discardPaths([A]), o.success(\"Change discarded\");\n }\n function M(A) {\n const V = s.cleanSrcFiles.find((ne) => ne.path === A);\n if (V) return V.content;\n const H = s.cleanStaticAssets.find((ne) => ne.path === A);\n return H ? `[binary ${H.mimeType}]` : null;\n }\n function P(A) {\n const V = s.srcFiles.find((ne) => ne.path === A);\n if (V) return V.content;\n const H = s.staticAssets.find((ne) => ne.path === A);\n return H ? `[binary ${H.mimeType}]` : null;\n }\n function L(A) {\n if (A == null) return \"(deleted)\";\n try {\n return JSON.stringify(JSON.parse(A), null, 2);\n } catch {\n return A || \"(empty)\";\n }\n }\n function $(A) {\n if (A == null) return null;\n try {\n return JSON.parse(A);\n } catch {\n return null;\n }\n }\n function J(A) {\n return A === \"frontend/src/lib/shop/products.json\";\n }\n function U(A) {\n return String(A?.id ?? A?.slug ?? A?.name ?? JSON.stringify(A));\n }\n function F(A, V) {\n return String(A?.name ?? A?.slug ?? A?.id ?? V);\n }\n function z(A, V) {\n const H = A ?? {}, ne = V ?? {}, X = /* @__PURE__ */ new Set([\"id\", \"createdAt\", \"updatedAt\"]), G = new Set([...Object.keys(H), ...Object.keys(ne)].filter((se) => !X.has(se))), Y = [];\n for (const se of G) {\n const ue = A != null && se in H, le = V != null && se in ne;\n !ue && le ? Y.push({ key: se, old: void 0, new: ne[se], kind: \"added\" }) : ue && !le ? Y.push({ key: se, old: H[se], new: void 0, kind: \"deleted\" }) : JSON.stringify(H[se]) !== JSON.stringify(ne[se]) && Y.push({ key: se, old: H[se], new: ne[se], kind: \"modified\" });\n }\n return Y;\n }\n function _(A, V) {\n const H = $(A)?.products ?? [], ne = $(V)?.products ?? [], X = new Map(H.map((ue) => [U(ue), ue])), G = new Map(ne.map((ue) => [U(ue), ue])), Y = /* @__PURE__ */ new Set([...X.keys(), ...G.keys()]), se = [];\n for (const ue of Y) {\n const le = X.get(ue) ?? null, re = G.get(ue) ?? null, ae = z(le, re);\n le && !re ? se.push({\n id: String(ue),\n title: F(le, String(ue)),\n kind: \"deleted\",\n fields: ae\n }) : !le && re ? se.push({\n id: String(ue),\n title: F(re, String(ue)),\n kind: \"added\",\n fields: ae\n }) : ae.length > 0 && se.push({\n id: String(ue),\n title: F(re, String(ue)),\n kind: \"modified\",\n fields: ae\n });\n }\n return se;\n }\n async function N(A, V, H) {\n if (c(i)) {\n if (V) {\n const ne = c(i).collections.gitData[A], X = { ...c(i).collections.data[A] }, G = { ...X[V] ?? {} }, Y = ne?.[V];\n Y && H in Y ? G[H] = Y[H] : delete G[H], X[V] = G, await c(i).collections.updateContent(A, JSON.parse(JSON.stringify(X)));\n } else {\n const ne = c(i).collections.gitData[A], X = { ...c(i).collections.data[A] ?? {} };\n ne && H in ne ? X[H] = ne[H] : delete X[H], await c(i).collections.updateContent(A, JSON.parse(JSON.stringify(X)));\n }\n o.success(\"Field discarded\");\n }\n }\n var Q = {\n get open() {\n return t();\n },\n set open(A) {\n t(A), de();\n },\n get onClose() {\n return n();\n },\n set onClose(A) {\n n(A), de();\n }\n }, T = lt(), I = ke(T);\n {\n var te = (A) => {\n var V = G2(), H = v(V), ne = v(H), X = x(v(ne), 2);\n m(ne);\n var G = x(ne, 2);\n {\n var Y = (_e) => {\n var Re = x2(), Ie = v(Re), Fe = v(Ie, !0);\n m(Ie);\n var j = x(Ie, 2);\n Je(j, {\n onclick: p,\n children: (oe, he) => {\n Pe();\n var Z = qe(\"Sync from GitHub\");\n w(oe, Z);\n },\n $$slots: { default: !0 }\n }), m(Re), B(() => D(Fe, c(d))), w(_e, Re);\n };\n K(G, (_e) => {\n c(d) && _e(Y);\n });\n }\n var se = x(G, 2), ue = v(se);\n {\n var le = (_e) => {\n var Re = w2();\n w(_e, Re);\n }, re = (_e) => {\n var Re = lt(), Ie = ke(Re);\n tt(Ie, 17, () => s.changeSets, (Fe) => Fe.id, (Fe, j) => {\n var oe = J2(), he = v(oe), Z = v(he);\n {\n var pe = (Ae) => {\n var Ye = k2(), xt = v(Ye), ut = v(xt, !0);\n m(xt);\n var me = x(xt, 2), we = v(me, !0);\n m(me), m(Ye), B(\n (Ee, je) => {\n Ge(Ye, \"aria-expanded\", Ee), D(ut, je), D(we, c(j).label);\n },\n [\n () => c(a).has(c(j).id),\n () => c(a).has(c(j).id) ? \"\u25BE\" : \"\u25B8\"\n ]\n ), fe(\"click\", Ye, () => u(c(j).id)), w(Ae, Ye);\n }, xe = (Ae) => {\n var Ye = C2(), xt = v(Ye), ut = v(xt, !0);\n m(xt), m(Ye), B(() => D(ut, c(j).label)), w(Ae, Ye);\n }, Be = (Ae) => {\n var Ye = E2(), xt = v(Ye), ut = v(xt, !0);\n m(xt);\n var me = x(xt, 2), we = v(me, !0);\n m(me);\n var Ee = x(me, 2);\n {\n var je = (ze) => {\n var Ve = S2();\n tt(Ve, 21, () => c(j).paths, pt, (it, _t) => {\n var Qe = _2(), sr = v(Qe, !0);\n m(Qe), B((vr) => D(sr, vr), [() => c(_t).split(\"/\").pop()]), w(it, Qe);\n }), m(Ve), w(ze, Ve);\n };\n K(Ee, (ze) => {\n c(j).paths.length > 0 && ze(je);\n });\n }\n m(Ye), B(\n (ze, Ve) => {\n Ge(Ye, \"aria-expanded\", ze), D(ut, Ve), D(we, c(j).label);\n },\n [\n () => c(a).has(c(j).id),\n () => c(a).has(c(j).id) ? \"\u25BE\" : \"\u25B8\"\n ]\n ), fe(\"click\", Ye, () => u(c(j).id)), w(Ae, Ye);\n };\n K(Z, (Ae) => {\n c(j).source === \"cms\" ? Ae(pe) : c(j).source === \"builder\" ? Ae(xe, 1) : Ae(Be, -1);\n });\n }\n var We = x(Z, 2), ee = v(We), He = v(ee);\n m(ee);\n var ve = x(ee, 4), Te = v(ve, !0);\n m(ve);\n var Me = x(ve, 4), Xe = v(Me, !0);\n m(Me), m(We);\n var mt = x(We, 2), Et = v(mt);\n {\n let Ae = ie(() => b(c(j)));\n Je(Et, {\n get href() {\n return c(Ae);\n },\n get onclick() {\n return n();\n },\n children: (Ye, xt) => {\n Pe();\n var ut = qe(\"Edit\");\n w(Ye, ut);\n },\n $$slots: { default: !0 }\n });\n }\n var Dt = x(Et, 2);\n Je(Dt, {\n variant: \"danger-invisible\",\n onclick: () => g(c(j).id),\n children: (Ae, Ye) => {\n Pe();\n var xt = qe(\"Discard\");\n w(Ae, xt);\n },\n $$slots: { default: !0 }\n }), m(mt), m(he);\n var Rt = x(he, 2);\n {\n var er = (Ae) => {\n var Ye = j2();\n tt(Ye, 21, () => c(j).paths, pt, (xt, ut) => {\n const me = ie(() => c(ut).match(/frontend\\/src\\/lib\\/content\\/(.+)\\.json$/));\n var we = lt(), Ee = ke(we);\n {\n var je = (Ve) => {\n const it = ie(() => c(me)[1]), _t = ie(() => c(i).collections.config[c(it)]);\n var Qe = lt(), sr = ke(Qe);\n {\n var vr = (wt) => {\n var Ft = lt(), Yt = ke(Ft);\n tt(Yt, 17, () => Object.entries(c(i).changes[c(it)] ?? {}), pt, (or, cr) => {\n var dt = ie(() => is(c(cr), 2));\n let Nt = () => c(dt)[0], Mt = () => c(dt)[1];\n const jt = ie(() => R(c(it), Nt(), Mt()));\n var Xt = lt(), Lt = ke(Xt);\n {\n var Bt = (qt) => {\n var gr = P2(), Sr = ke(gr), tn = v(Sr);\n m(Sr);\n var Mr = x(Sr, 2);\n tt(Mr, 17, () => c(jt), pt, (rn, dr) => {\n var ur = A2(), Ot = v(ur), Pt = v(Ot), Jt = v(Pt, !0);\n m(Pt);\n var Tt = x(Pt, 2), It = v(Tt);\n {\n let ar = ie(() => `#website/content/${c(it)}/${Nt()}`);\n Je(It, {\n size: \"small\",\n get href() {\n return c(ar);\n },\n get onclick() {\n return n();\n },\n children: (br, nn) => {\n Pe();\n var un = qe(\"Edit\");\n w(br, un);\n },\n $$slots: { default: !0 }\n });\n }\n var ir = x(It, 2);\n Je(ir, {\n size: \"small\",\n variant: \"danger-invisible\",\n onclick: () => N(c(it), Nt(), c(dr).key),\n children: (ar, br) => {\n Pe();\n var nn = qe(\"Discard\");\n w(ar, nn);\n },\n $$slots: { default: !0 }\n }), m(Tt), m(Ot);\n var xr = x(Ot, 2);\n {\n var Xr = (ar) => {\n var br = T2(), nn = x(v(br), 2), un = v(nn, !0);\n m(nn), m(br), B((Rs) => D(un, Rs), [() => E(c(dr).old) || \"(empty)\"]), w(ar, br);\n };\n K(xr, (ar) => {\n c(dr).kind !== \"added\" && ar(Xr);\n });\n }\n var An = x(xr, 2);\n {\n var Hn = (ar) => {\n var br = M2(), nn = x(v(br), 2), un = v(nn, !0);\n m(nn), m(br), B((Rs) => D(un, Rs), [() => E(c(dr).new) || \"(empty)\"]), w(ar, br);\n };\n K(An, (ar) => {\n c(dr).kind !== \"deleted\" && ar(Hn);\n });\n }\n m(ur), B(\n (ar) => {\n Ge(ur, \"data-kind\", c(dr).kind), D(Jt, ar);\n },\n [() => C(c(it), c(dr).key)]\n ), w(rn, ur);\n }), B(() => D(tn, `${c(_t).title ?? \"\"}: ${(typeof Mt() == \"object\" && Mt().title ? Mt().title : Nt()) ?? \"\"}`)), w(qt, gr);\n };\n K(Lt, (qt) => {\n c(jt).length > 0 && qt(Bt);\n });\n }\n w(or, Xt);\n }), w(wt, Ft);\n }, $t = (wt) => {\n const Ft = ie(() => q(c(it)));\n var Yt = lt(), or = ke(Yt);\n {\n var cr = (dt) => {\n var Nt = I2(), Mt = ke(Nt), jt = v(Mt, !0);\n m(Mt);\n var Xt = x(Mt, 2);\n tt(Xt, 17, () => c(Ft), pt, (Lt, Bt) => {\n var qt = $2(), gr = v(qt), Sr = v(gr), tn = v(Sr, !0);\n m(Sr);\n var Mr = x(Sr, 2), rn = v(Mr);\n {\n let Tt = ie(() => `#website/content/${c(it)}`);\n Je(rn, {\n size: \"small\",\n get href() {\n return c(Tt);\n },\n get onclick() {\n return n();\n },\n children: (It, ir) => {\n Pe();\n var xr = qe(\"Edit\");\n w(It, xr);\n },\n $$slots: { default: !0 }\n });\n }\n var dr = x(rn, 2);\n Je(dr, {\n size: \"small\",\n variant: \"danger-invisible\",\n onclick: () => N(c(it), null, c(Bt).key),\n children: (Tt, It) => {\n Pe();\n var ir = qe(\"Discard\");\n w(Tt, ir);\n },\n $$slots: { default: !0 }\n }), m(Mr), m(gr);\n var ur = x(gr, 2);\n {\n var Ot = (Tt) => {\n var It = N2(), ir = x(v(It), 2), xr = v(ir, !0);\n m(ir), m(It), B((Xr) => D(xr, Xr), [() => E(c(Bt).old) || \"(empty)\"]), w(Tt, It);\n };\n K(ur, (Tt) => {\n c(Bt).kind !== \"added\" && Tt(Ot);\n });\n }\n var Pt = x(ur, 2);\n {\n var Jt = (Tt) => {\n var It = O2(), ir = x(v(It), 2), xr = v(ir, !0);\n m(ir), m(It), B((Xr) => D(xr, Xr), [() => E(c(Bt).new) || \"(empty)\"]), w(Tt, It);\n };\n K(Pt, (Tt) => {\n c(Bt).kind !== \"deleted\" && Tt(Jt);\n });\n }\n m(qt), B(\n (Tt) => {\n Ge(qt, \"data-kind\", c(Bt).kind), D(tn, Tt);\n },\n [() => C(c(it), c(Bt).key)]\n ), w(Lt, qt);\n }), B(() => D(jt, c(_t).title)), w(dt, Nt);\n };\n K(or, (dt) => {\n c(Ft).length > 0 && dt(cr);\n });\n }\n w(wt, Yt);\n }, At = (wt) => {\n var Ft = z2(), Yt = v(Ft, !0);\n m(Ft), B(() => D(Yt, c(ut))), w(wt, Ft);\n };\n K(sr, (wt) => {\n c(_t)?.isCollection ? wt(vr) : c(_t) ? wt($t, 1) : wt(At, -1);\n });\n }\n w(Ve, Qe);\n }, ze = (Ve) => {\n var it = R2(), _t = v(it, !0);\n m(it), B(() => D(_t, c(ut))), w(Ve, it);\n };\n K(Ee, (Ve) => {\n c(me) ? Ve(je) : Ve(ze, -1);\n });\n }\n w(xt, we);\n }), m(Ye), w(Ae, Ye);\n }, ct = ie(() => c(j).source === \"cms\" && c(a).has(c(j).id) && c(i)), vt = (Ae) => {\n var Ye = U2();\n tt(Ye, 21, () => c(j).paths, pt, (xt, ut) => {\n const me = ie(() => M(c(ut))), we = ie(() => P(c(ut)));\n var Ee = lt(), je = ke(Ee);\n {\n var ze = (_t) => {\n var Qe = H2(), sr = x(ke(Qe), 2);\n tt(sr, 17, () => _(c(me), c(we)), (vr) => vr.id, (vr, $t) => {\n var At = B2(), wt = v(At), Ft = v(wt), Yt = v(Ft), or = v(Yt, !0);\n m(Yt);\n var cr = x(Yt, 2), dt = v(cr, !0);\n m(cr), m(Ft);\n var Nt = x(Ft, 2), Mt = v(Nt);\n Je(Mt, {\n size: \"small\",\n href: \"#shop/products\",\n get onclick() {\n return n();\n },\n children: (Lt, Bt) => {\n Pe();\n var qt = qe(\"Edit\");\n w(Lt, qt);\n },\n $$slots: { default: !0 }\n });\n var jt = x(Mt, 2);\n Je(jt, {\n size: \"small\",\n variant: \"danger-invisible\",\n onclick: () => O(c(ut)),\n children: (Lt, Bt) => {\n Pe();\n var qt = qe(\"Discard file\");\n w(Lt, qt);\n },\n $$slots: { default: !0 }\n }), m(Nt), m(wt);\n var Xt = x(wt, 2);\n tt(Xt, 17, () => c($t).fields, pt, (Lt, Bt) => {\n var qt = F2(), gr = v(qt), Sr = v(gr, !0);\n m(gr);\n var tn = x(gr, 2);\n {\n var Mr = (ur) => {\n var Ot = L2(), Pt = x(v(Ot), 2), Jt = v(Pt, !0);\n m(Pt), m(Ot), B((Tt) => D(Jt, Tt), [() => E(c(Bt).old) || \"(empty)\"]), w(ur, Ot);\n };\n K(tn, (ur) => {\n c(Bt).kind !== \"added\" && ur(Mr);\n });\n }\n var rn = x(tn, 2);\n {\n var dr = (ur) => {\n var Ot = D2(), Pt = x(v(Ot), 2), Jt = v(Pt, !0);\n m(Pt), m(Ot), B((Tt) => D(Jt, Tt), [() => E(c(Bt).new) || \"(empty)\"]), w(ur, Ot);\n };\n K(rn, (ur) => {\n c(Bt).kind !== \"deleted\" && ur(dr);\n });\n }\n m(qt), B(() => {\n Ge(qt, \"data-kind\", c(Bt).kind), D(Sr, c(Bt).key);\n }), w(Lt, qt);\n }), m(At), B(() => {\n Ge(At, \"data-kind\", c($t).kind), D(or, c($t).title), D(dt, c($t).kind);\n }), w(vr, At);\n }), w(_t, Qe);\n }, Ve = ie(() => J(c(ut))), it = (_t) => {\n var Qe = W2(), sr = ke(Qe), vr = v(sr, !0);\n m(sr);\n var $t = x(sr, 2), At = v($t), wt = v(At), Ft = v(wt, !0);\n m(wt);\n var Yt = x(wt, 2), or = v(Yt);\n Je(or, {\n size: \"small\",\n variant: \"danger-invisible\",\n onclick: () => O(c(ut)),\n children: (jt, Xt) => {\n Pe();\n var Lt = qe(\"Discard\");\n w(jt, Lt);\n },\n $$slots: { default: !0 }\n }), m(Yt), m(At);\n var cr = x(At, 2);\n {\n var dt = (jt) => {\n var Xt = q2(), Lt = x(v(Xt), 2), Bt = v(Lt, !0);\n m(Lt), m(Xt), B((qt) => D(Bt, qt), [() => L(c(me))]), w(jt, Xt);\n };\n K(cr, (jt) => {\n c(me) !== null && jt(dt);\n });\n }\n var Nt = x(cr, 2);\n {\n var Mt = (jt) => {\n var Xt = V2(), Lt = x(v(Xt), 2), Bt = v(Lt, !0);\n m(Lt), m(Xt), B((qt) => D(Bt, qt), [() => L(c(we))]), w(jt, Xt);\n };\n K(Nt, (jt) => {\n c(we) !== null && jt(Mt);\n });\n }\n m($t), B(\n (jt) => {\n D(vr, c(ut)), Ge($t, \"data-kind\", c(me) == null ? \"added\" : c(we) == null ? \"deleted\" : \"modified\"), D(Ft, jt);\n },\n [() => c(ut).split(\"/\").pop()]\n ), w(_t, Qe);\n };\n K(je, (_t) => {\n c(Ve) ? _t(ze) : _t(it, -1);\n });\n }\n w(xt, Ee);\n }), m(Ye), w(Ae, Ye);\n }, yt = ie(() => c(j).source !== \"cms\" && c(j).source !== \"builder\" && c(a).has(c(j).id));\n K(Rt, (Ae) => {\n c(ct) ? Ae(er) : c(yt) && Ae(vt, 1);\n });\n }\n m(oe), B(\n (Ae) => {\n D(He, `${c(j).paths.length ?? \"\"} file${c(j).paths.length !== 1 ? \"s\" : \"\"}`), D(Te, c(j).source), D(Xe, Ae);\n },\n [() => y(c(j).createdAt)]\n ), w(Fe, oe);\n }), w(_e, Re);\n };\n K(ue, (_e) => {\n s.changeSets.length === 0 ? _e(le) : _e(re, -1);\n });\n }\n m(se);\n var ae = x(se, 2), ge = v(ae);\n Je(ge, {\n get onclick() {\n return n();\n },\n get disabled() {\n return c(l);\n },\n children: (_e, Re) => {\n Pe();\n var Ie = qe(\"Cancel\");\n w(_e, Ie);\n },\n $$slots: { default: !0 }\n });\n var Se = x(ge, 2);\n {\n let _e = ie(() => c(l) || s.changeSets.length === 0);\n Je(Se, {\n variant: \"primary\",\n onclick: h,\n get disabled() {\n return c(_e);\n },\n children: (Re, Ie) => {\n var Fe = lt(), j = ke(Fe);\n {\n var oe = (Z) => {\n var pe = K2(), xe = v(pe);\n Pf(xe, { size: \"small\" }), Pe(), m(pe), w(Z, pe);\n }, he = (Z) => {\n var pe = qe();\n B(() => D(pe, `Save (${s.changeSets.length ?? \"\"})`)), w(Z, pe);\n };\n K(j, (Z) => {\n c(l) ? Z(oe) : Z(he, -1);\n });\n }\n w(Re, Fe);\n },\n $$slots: { default: !0 }\n });\n }\n m(ae), m(H), m(V), fe(\"click\", V, (_e) => {\n _e.target === _e.currentTarget && n()();\n }), fe(\"click\", X, function(..._e) {\n n()?.apply(this, _e);\n }), w(A, V);\n };\n K(I, (A) => {\n t() && A(te);\n });\n }\n return w(r, T), st(Q);\n}\nhr([\"click\"]);\nrt(ni, { open: {}, onClose: {} }, [], [], { mode: \"open\" });\nvar X2 = S('<div class=\"array-item svelte-1e6y1ur\"><!></div>'), Q2 = S('<div class=\"json-group svelte-1e6y1ur\"><div class=\"group-heading svelte-1e6y1ur\"> </div> <!></div>'), Z2 = S('<div class=\"json-group svelte-1e6y1ur\"><div class=\"group-heading svelte-1e6y1ur\"> </div> <div class=\"group-fields svelte-1e6y1ur\"></div></div>'), eC = S('<label class=\"field boolean-field svelte-1e6y1ur\"><span class=\"field-label svelte-1e6y1ur\"> </span> <input type=\"checkbox\"/></label>'), tC = S('<input type=\"number\" class=\"svelte-1e6y1ur\"/>'), rC = S('<textarea class=\"svelte-1e6y1ur\"></textarea>'), nC = S('<input type=\"text\" class=\"svelte-1e6y1ur\"/>'), sC = S('<label class=\"field svelte-1e6y1ur\"><span class=\"field-heading svelte-1e6y1ur\"><span class=\"field-label svelte-1e6y1ur\"> </span></span> <!></label>'), oC = S('<div class=\"json-settings-editor svelte-1e6y1ur\"></div>');\nconst iC = {\n hash: \"svelte-1e6y1ur\",\n code: `.json-settings-editor.svelte-1e6y1ur {display:grid;gap:1rem;padding:1rem;}.json-group.svelte-1e6y1ur {display:grid;gap:0.75rem;padding:1rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:8px;background:var(--bgColor-default, #ffffff);}.group-heading.svelte-1e6y1ur {font-size:0.875rem;font-weight:600;}.group-fields.svelte-1e6y1ur {display:grid;gap:0.75rem;}.array-item.svelte-1e6y1ur {padding-left:0.75rem;border-left:2px solid var(--borderColor-muted, #d8dee4);}.field.svelte-1e6y1ur {display:grid;gap:0.375rem;}.field-heading.svelte-1e6y1ur,\n\t.boolean-field.svelte-1e6y1ur {display:flex;gap:0.5rem;align-items:center;}.field-label.svelte-1e6y1ur {font-size:0.8125rem;font-weight:500;color:var(--fgColor-default, #24292f);}input[type='text'].svelte-1e6y1ur,\n\tinput[type='number'].svelte-1e6y1ur,\n\ttextarea.svelte-1e6y1ur {width:100%;padding:0.375rem 0.625rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:6px;background:var(--bgColor-default, #ffffff);color:var(--fgColor-default, #24292f);font:inherit;}textarea.svelte-1e6y1ur {min-height:5rem;resize:vertical;}`\n};\nfunction Da(r, e) {\n nt(e, !0), bt(r, iC);\n const t = (u, f = Kr, h = Kr) => {\n var p = lt(), g = ke(p);\n {\n var b = (q) => {\n var O = Q2(), M = v(O), P = v(M, !0);\n m(M);\n var L = x(M, 2);\n tt(L, 17, h, pt, ($, J, U) => {\n var F = X2(), z = v(F);\n {\n let _ = ie(() => [...f(), U]);\n t(z, () => c(_), () => c(J));\n }\n m(F), w($, F);\n }), m(O), B(($) => D(P, $), [() => o(String(f()[f().length - 1]))]), w(q, O);\n }, y = ie(() => Array.isArray(h())), C = (q) => {\n var O = Z2(), M = v(O), P = v(M, !0);\n m(M);\n var L = x(M, 2);\n tt(L, 21, () => Object.entries(h()), pt, ($, J) => {\n var U = ie(() => is(c(J), 2));\n let F = () => c(U)[0], z = () => c(U)[1];\n {\n let _ = ie(() => [...f(), F()]);\n t($, () => c(_), z);\n }\n }), m(L), m(O), B(($) => D(P, $), [() => o(String(f()[f().length - 1]))]), w(q, O);\n }, E = (q) => {\n var O = eC(), M = v(O), P = v(M, !0);\n m(M);\n var L = x(M, 2);\n Ut(L), m(O), B(\n ($) => {\n D(P, $), Nf(L, h());\n },\n [() => o(String(f()[f().length - 1]))]\n ), fe(\"change\", L, ($) => a(f(), $.currentTarget.checked)), w(q, O);\n }, R = (q) => {\n var O = sC(), M = v(O), P = v(M), L = v(P, !0);\n m(P), m(M);\n var $ = x(M, 2);\n {\n var J = (_) => {\n var N = tC();\n Ut(N), B(() => wi(N, h())), fe(\"input\", N, (Q) => a(f(), Number(Q.currentTarget.value))), w(_, N);\n }, U = (_) => {\n var N = rC();\n Go(N), B(() => wi(N, h())), fe(\"input\", N, (Q) => a(f(), Q.currentTarget.value)), w(_, N);\n }, F = ie(() => typeof h() == \"string\" && (h().length > 80 || h().includes(`\n`))), z = (_) => {\n var N = nC();\n Ut(N), B((Q) => wi(N, Q), [() => String(h() ?? \"\")]), fe(\"input\", N, (Q) => a(f(), Q.currentTarget.value)), w(_, N);\n };\n K($, (_) => {\n typeof h() == \"number\" ? _(J) : c(F) ? _(U, 1) : _(z, -1);\n });\n }\n m(O), B((_) => D(L, _), [() => o(String(f()[f().length - 1]))]), w(q, O);\n };\n K(g, (q) => {\n c(y) ? q(b) : h() && typeof h() == \"object\" ? q(C, 1) : typeof h() == \"boolean\" ? q(E, 2) : q(R, -1);\n });\n }\n w(u, p);\n };\n let n = ce(e, \"value\", 15), s = ce(e, \"onChange\", 7);\n function o(u) {\n return u.replace(/([a-z0-9])([A-Z])/g, \"$1 $2\").replace(/[_-]+/g, \" \").replace(/\\b\\w/g, (f) => f.toUpperCase());\n }\n function i(u) {\n return JSON.parse(JSON.stringify(u ?? {}));\n }\n function a(u, f) {\n const h = i(n());\n let p = h;\n for (const g of u.slice(0, -1))\n p = p[g];\n p[u[u.length - 1]] = f, s()(h);\n }\n var l = {\n get value() {\n return n();\n },\n set value(u) {\n n(u), de();\n },\n get onChange() {\n return s();\n },\n set onChange(u) {\n s(u), de();\n }\n }, d = oC();\n return tt(d, 21, () => Object.entries(n() ?? {}), pt, (u, f) => {\n var h = ie(() => is(c(f), 2));\n let p = () => c(h)[0];\n t(u, () => [p()], () => c(h)[1]);\n }), m(d), w(r, d), st(l);\n}\nhr([\"change\", \"input\"]);\nrt(Da, { value: {}, onChange: {} }, [], [], { mode: \"open\" });\nfunction aC() {\n return [];\n}\nconst ms = {\n id: \"shop\",\n label: \"Shop\",\n description: \"Checkout, payment, numbering, and shipping settings.\",\n path: \"frontend/src/lib/shop/settings.json\",\n source: \"shop\"\n}, vs = {\n id: \"emails\",\n label: \"Emails\",\n description: \"Generated email template, invoice settings, and automated email text.\",\n path: \"frontend/src/lib/emails/settings.json\",\n source: \"emails\"\n};\nvar lC = S('<button type=\"button\" class=\"btn primary save-btn svelte-1icl0f0\">Save <div class=\"btn-notification svelte-1icl0f0\"> </div></button>'), cC = S('<div><span class=\"svelte-1icl0f0\"> </span> <button type=\"button\" class=\"notification-close svelte-1icl0f0\" aria-label=\"Close notification\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" class=\"svelte-1icl0f0\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" class=\"svelte-1icl0f0\"></path><path d=\"M18 6l-12 12\" class=\"svelte-1icl0f0\"></path><path d=\"M6 6l12 12\" class=\"svelte-1icl0f0\"></path></svg></button></div>'), dC = S('<a href=\"#emails/newsletters\">Newsletters</a>'), uC = S('<section class=\"module-settings-section svelte-1icl0f0\"><div class=\"section-heading svelte-1icl0f0\"><div class=\"svelte-1icl0f0\"><h1 class=\"svelte-1icl0f0\"> </h1> <p class=\"svelte-1icl0f0\"> </p></div> <!></div> <label class=\"newsletter-toggle svelte-1icl0f0\"><input type=\"checkbox\" class=\"svelte-1icl0f0\"/> <span class=\"svelte-1icl0f0\"><strong class=\"svelte-1icl0f0\">Newsletter</strong> <span class=\"newsletter-toggle-hint svelte-1icl0f0\">Enable campaigns and newsletter sends. When off, only transactional emails are available.</span></span></label> <div class=\"module-settings-host svelte-1icl0f0\"><!></div></section>'), fC = S('<nav class=\"email-tabs svelte-1icl0f0\" aria-label=\"Email sections\"><!> <a href=\"#emails/subscribers\">Subscribers</a> <a href=\"#emails/design\">Design</a> <a href=\"#emails/settings\">Settings</a></nav> <!>', 1), pC = S('<div class=\"loading-state svelte-1icl0f0\"><span class=\"loading-spinner svelte-1icl0f0\"></span> <span class=\"svelte-1icl0f0\">Loading...</span></div>'), hC = S('<div class=\"emails-root svelte-1icl0f0\"><!> <div class=\"emails-content svelte-1icl0f0\"><main class=\"svelte-1icl0f0\"><div class=\"notifications-container svelte-1icl0f0\"></div> <div class=\"main-content svelte-1icl0f0\"><!></div></main></div> <!></div>');\nconst mC = {\n hash: \"svelte-1icl0f0\",\n code: `\n\t/* Component root styles */.emails-root.svelte-1icl0f0 :where(.svelte-1icl0f0),\n\t.emails-root.svelte-1icl0f0 :where(.svelte-1icl0f0)::before,\n\t.emails-root.svelte-1icl0f0 :where(.svelte-1icl0f0)::after {box-sizing:border-box;}.emails-root.svelte-1icl0f0 {font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;color:var(--fgColor-default);display:flex;flex-direction:column;height:100vh;background-color:var(--bgColor-default);overflow:hidden;}.emails-content.svelte-1icl0f0 {display:flex;flex-direction:row;flex:1;min-height:0;overflow:hidden;}main.svelte-1icl0f0 {min-width:0px;width:100%;display:flex;flex-direction:column;overflow:hidden;}.main-content.svelte-1icl0f0 {padding:0 2rem;flex:1;min-height:0;display:flex;flex-direction:column;}.email-tabs.svelte-1icl0f0 {display:flex;gap:1rem;border-bottom:1px solid var(--borderColor-default);margin-top:1rem;overflow-x:auto;flex-shrink:0;}.email-tabs.svelte-1icl0f0 a:where(.svelte-1icl0f0) {padding:0.75rem 0;color:var(--fgColor-muted);text-decoration:none;font-size:0.875rem;border-bottom:2px solid transparent;white-space:nowrap;}.email-tabs.svelte-1icl0f0 a.active:where(.svelte-1icl0f0) {color:var(--fgColor-default);border-bottom-color:var(--fgColor-accent);}.module-settings-section.svelte-1icl0f0 {display:grid;gap:1rem;padding:1rem 0;overflow-y:auto;flex:1;}.section-heading.svelte-1icl0f0 {display:flex;gap:0.25rem;justify-content:space-between;align-items:flex-start;}.section-heading.svelte-1icl0f0 h1:where(.svelte-1icl0f0) {margin:0;font-size:1.5rem;line-height:1.25;}.section-heading.svelte-1icl0f0 p:where(.svelte-1icl0f0) {margin:0;color:var(--fgColor-muted);}.module-settings-host.svelte-1icl0f0 {border:1px solid var(--borderColor-default);border-radius:8px;overflow:visible;}.newsletter-toggle.svelte-1icl0f0 {display:flex;align-items:flex-start;gap:0.625rem;padding:1rem;border:1px solid var(--borderColor-default);border-radius:8px;cursor:pointer;}.newsletter-toggle.svelte-1icl0f0 input:where(.svelte-1icl0f0) {margin-top:0.2rem;}.newsletter-toggle.svelte-1icl0f0 span:where(.svelte-1icl0f0) {display:flex;flex-direction:column;gap:0.25rem;}.newsletter-toggle-hint.svelte-1icl0f0 {font-size:0.8125rem;color:var(--fgColor-muted);}\n\n\t/* Notifications - Top of main content area */.notifications-container.svelte-1icl0f0 {min-height:calc(2rem + 2px + 1rem);overflow:hidden;}.notification-banner.svelte-1icl0f0 {background-color:#ddf4ff;border:1px solid #54aeff66;border-top:none;border-left:none;border-right:none;padding:1rem 2rem;margin-bottom:1rem;display:flex;justify-content:space-between;align-items:center;font-size:0.875rem;box-shadow:0 1px 3px rgba(31, 35, 40, 0.12);word-wrap:break-word;overflow-wrap:break-word;}.notification-banner.danger.svelte-1icl0f0 {background-color:#fde8e8;border-color:#ff4d4d66;}.notification-banner.success.svelte-1icl0f0 {background-color:#e6f9e6;border-color:#00b30066;}.notification-banner.warning.svelte-1icl0f0 {background-color:#fff7e6;border-color:#ff9f0066;}.notification-close.svelte-1icl0f0 {background:none;border:none;padding:0.25rem;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:0.25rem;}.notification-close.svelte-1icl0f0:hover {background-color:rgba(0, 0, 0, 0.1);}.notification-close.svelte-1icl0f0:focus-visible {outline:2px solid currentColor;outline-offset:2px;}\n\n\t/* Loading state */.loading-state.svelte-1icl0f0 {display:flex;align-items:center;gap:0.75rem;padding:2rem 0;color:var(--fgColor-muted);}.loading-spinner.svelte-1icl0f0 {width:1rem;height:1rem;border:2px solid var(--borderColor-default);border-top-color:var(--fgColor-accent);border-radius:50%;\n\t\tanimation: svelte-1icl0f0-spin 0.8s linear infinite;}\n\n\t@keyframes svelte-1icl0f0-spin {\n\t\tto {\n\t\t\ttransform: rotate(360deg);\n\t\t}\n\t}`\n};\nfunction Pm(r, e) {\n nt(e, !0), bt(r, mC);\n let t = ce(e, \"route\", 7, \"\"), n = ce(e, \"availableModules\", 23, () => []), s = ce(e, \"onSettings\", 7);\n const o = no(), { repoFiles: i } = yn(), a = ie(() => !o.emails.automation.newsletterEnabled);\n function l() {\n const N = i.getFileContent(vs.path);\n if (!N) return {};\n try {\n return JSON.parse(N);\n } catch {\n return {};\n }\n }\n function d(N) {\n i.writeFile(vs.path, JSON.stringify(N, null, 2), {\n source: vs.source,\n label: `Update ${vs.label.toLowerCase()} settings`\n });\n }\n const { emails: u, notifications: f } = o, h = ie(() => {\n const N = t().split(\"/\").filter(Boolean);\n if (N.length === 0)\n return {\n location: c(a) ? \"subscribers\" : \"newsletters\",\n subLocation: void 0,\n recordId: void 0\n };\n let Q = N[0];\n Q === \"campaigns\" && (Q = \"newsletters\"), Q === \"contacts\" && (Q = \"subscribers\");\n const T = N.length > 1 ? N[1] : void 0, I = N.length > 2 ? N[2] : void 0;\n return { location: Q, subLocation: T, recordId: I };\n }), p = ie(() => c(h).location), g = ie(() => c(h).subLocation), b = ie(() => c(h).recordId);\n kr(() => {\n o.location = c(p), o.subLocation = c(g);\n });\n let y = W(!1), C = W(!1);\n const E = ie(() => i.changeSets.length);\n Ar(async () => {\n await u.initialize(), k(y, !0);\n });\n var R = {\n get route() {\n return t();\n },\n set route(N = \"\") {\n t(N), de();\n },\n get availableModules() {\n return n();\n },\n set availableModules(N = []) {\n n(N), de();\n },\n get onSettings() {\n return s();\n },\n set onSettings(N) {\n s(N), de();\n }\n }, q = hC(), O = v(q);\n Oo(O, {\n get modules() {\n return n();\n },\n currentModule: \"emails\",\n get onSettings() {\n return s();\n },\n children: (N, Q) => {\n var T = lt(), I = ke(T);\n {\n var te = (A) => {\n var V = lC(), H = x(v(V)), ne = v(H, !0);\n m(H), m(V), B(() => D(ne, c(E))), fe(\"click\", V, () => k(C, !0)), w(A, V);\n };\n K(I, (A) => {\n c(E) > 0 && A(te);\n });\n }\n w(N, T);\n },\n $$slots: { default: !0 }\n });\n var M = x(O, 2), P = v(M), L = v(P);\n tt(L, 21, () => f.notifications, pt, (N, Q) => {\n var T = cC();\n let I;\n var te = v(T), A = v(te, !0);\n m(te);\n var V = x(te, 2);\n m(T), B(() => {\n I = Ne(T, 1, \"notification-banner svelte-1icl0f0\", null, I, {\n danger: c(Q).type === \"danger\",\n success: c(Q).type === \"success\",\n warning: c(Q).type === \"warning\"\n }), D(A, c(Q).message);\n }), fe(\"click\", V, () => f.removeNotification(c(Q).id)), Ca(2, T, () => Ac, () => ({ duration: 1500 })), w(N, T);\n }), m(L);\n var $ = x(L, 2), J = v($);\n {\n var U = (N) => {\n var Q = fC(), T = ke(Q), I = v(T);\n {\n var te = (ge) => {\n var Se = dC();\n let _e;\n B(() => _e = Ne(Se, 1, \"svelte-1icl0f0\", null, _e, {\n active: c(p) === \"newsletters\" && c(g) !== \"compose\" && !c(b)\n })), w(ge, Se);\n };\n K(I, (ge) => {\n c(a) || ge(te);\n });\n }\n var A = x(I, 2);\n let V;\n var H = x(A, 2);\n let ne;\n var X = x(H, 2);\n let G;\n m(T);\n var Y = x(T, 2);\n {\n var se = (ge) => {\n Am(ge, {});\n }, ue = (ge) => {\n var Se = uC(), _e = v(Se), Re = v(_e), Ie = v(Re), Fe = v(Ie, !0);\n m(Ie);\n var j = x(Ie, 2), oe = v(j, !0);\n m(j), m(Re);\n var he = x(Re, 2);\n {\n var Z = (ee) => {\n Je(ee, {\n variant: \"primary\",\n onclick: () => k(C, !0),\n children: (He, ve) => {\n Pe();\n var Te = qe(\"Save\");\n w(He, Te);\n },\n $$slots: { default: !0 }\n });\n };\n K(he, (ee) => {\n c(E) > 0 && ee(Z);\n });\n }\n m(_e);\n var pe = x(_e, 2), xe = v(pe);\n Ut(xe), Pe(2), m(pe);\n var Be = x(pe, 2), We = v(Be);\n {\n let ee = ie(l);\n Da(We, {\n get file() {\n return vs;\n },\n get value() {\n return c(ee);\n },\n onChange: (He) => d(He)\n });\n }\n m(Be), m(Se), B(() => {\n D(Fe, vs.label), D(oe, vs.description), Nf(xe, u.automation.newsletterEnabled);\n }), fe(\"change\", xe, (ee) => u.updateAutomation({ newsletterEnabled: ee.currentTarget.checked })), w(ge, Se);\n }, le = (ge) => {\n var Se = lt(), _e = ke(Se);\n {\n var Re = (j) => {\n fc(j, {});\n }, Ie = (j) => {\n El(j, {});\n }, Fe = (j) => {\n fc(j, {\n get id() {\n return c(g);\n }\n });\n };\n K(_e, (j) => {\n c(g) === \"compose\" ? j(Re) : !c(g) || c(g) === \"list\" ? j(Ie, 1) : c(g) && j(Fe, 2);\n });\n }\n w(ge, Se);\n }, re = (ge) => {\n Bf(ge, {});\n }, ae = (ge) => {\n El(ge, {});\n };\n K(Y, (ge) => {\n c(p) === \"design\" ? ge(se) : c(p) === \"settings\" ? ge(ue, 1) : c(p) === \"newsletters\" && !c(a) ? ge(le, 2) : c(p) === \"subscribers\" ? ge(re, 3) : ge(ae, -1);\n });\n }\n B(() => {\n V = Ne(A, 1, \"svelte-1icl0f0\", null, V, { active: c(p) === \"subscribers\" }), ne = Ne(H, 1, \"svelte-1icl0f0\", null, ne, { active: c(p) === \"design\" }), G = Ne(X, 1, \"svelte-1icl0f0\", null, G, { active: c(p) === \"settings\" });\n }), w(N, Q);\n }, F = (N) => {\n var Q = pC();\n w(N, Q);\n };\n K(J, (N) => {\n c(y) ? N(U) : N(F, -1);\n });\n }\n m($), m(P), m(M);\n var z = x(M, 2);\n {\n var _ = (N) => {\n ni(N, {\n get open() {\n return c(C);\n },\n onClose: () => k(C, !1)\n });\n };\n K(z, (N) => {\n c(C) && N(_);\n });\n }\n return m(q), w(r, q), st(R);\n}\nhr([\"click\", \"change\"]);\ncustomElements.define(\"hintergrund-emails\", rt(Pm, { route: {}, availableModules: {}, onSettings: {} }, [], []));\nconst ff = \"frontend/src/lib/shop/products.json\", pf = \"frontend/src/lib/shop/settings.json\", Un = {\n currency: \"eur\",\n enabledPaymentMethods: [\"bank_transfer\"],\n bankTransfer: {\n accountHolder: \"\",\n iban: \"\",\n bic: \"\",\n bankName: \"\",\n instructions: \"Please use your order number as the payment reference.\"\n },\n shippingFlatRate: 0,\n freeShippingThreshold: 0,\n orderNumberPrefix: \"ORD\",\n invoiceNumberPrefix: \"INV\",\n emailTemplates: {\n purchase: {\n subject: \"Your order {{order_number}}\",\n bodyHtml: \"<h2>Thank you for your order.</h2><p>Please find your invoice and payment instructions below.</p>\"\n },\n paymentConfirmed: {\n subject: \"Payment confirmed - {{order_number}}\",\n bodyHtml: \"<h2>Payment confirmed</h2><p>We have received your payment of {{amount}} for order {{order_number}}. Thank you.</p>\"\n }\n }\n};\nfunction hf(r) {\n return {\n ...Un,\n ...r ?? {},\n enabledPaymentMethods: r?.enabledPaymentMethods ?? Un.enabledPaymentMethods,\n bankTransfer: {\n ...Un.bankTransfer,\n ...r?.bankTransfer ?? {}\n },\n shippingFlatRate: r?.shippingFlatRate ?? Un.shippingFlatRate,\n freeShippingThreshold: r?.freeShippingThreshold ?? Un.freeShippingThreshold,\n emailTemplates: {\n purchase: {\n ...Un.emailTemplates.purchase,\n ...r?.emailTemplates?.purchase ?? {}\n },\n paymentConfirmed: {\n ...Un.emailTemplates.paymentConfirmed,\n ...r?.emailTemplates?.paymentConfirmed ?? {}\n }\n }\n };\n}\nclass vC {\n #t;\n get products() {\n return c(this.#t);\n }\n set products(e) {\n k(this.#t, e, !0);\n }\n #r;\n get orders() {\n return c(this.#r);\n }\n set orders(e) {\n k(this.#r, e, !0);\n }\n #n;\n get settings() {\n return c(this.#n);\n }\n set settings(e) {\n k(this.#n, e, !0);\n }\n #e;\n get catalogCommitSha() {\n return c(this.#e);\n }\n set catalogCommitSha(e) {\n k(this.#e, e, !0);\n }\n #s;\n get settingsCommitSha() {\n return c(this.#s);\n }\n set settingsCommitSha(e) {\n k(this.#s, e, !0);\n }\n #o;\n get stripeConfigured() {\n return c(this.#o);\n }\n set stripeConfigured(e) {\n k(this.#o, e, !0);\n }\n #a;\n get loadingState() {\n return c(this.#a);\n }\n set loadingState(e) {\n k(this.#a, e, !0);\n }\n #i;\n get productsLoading() {\n return c(this.#i);\n }\n set productsLoading(e) {\n k(this.#i, e, !0);\n }\n #l;\n get hasMoreProducts() {\n return c(this.#l);\n }\n set hasMoreProducts(e) {\n k(this.#l, e, !0);\n }\n constructor(e) {\n this.repoFiles = e, this.#t = W(ft([])), this.#r = W(ft([])), this.#n = W(null), this.#e = W(void 0), this.#s = W(void 0), this.#o = W(!1), this.#a = W(ft({ loading: !1, error: null })), this.#i = W(ft({ loading: !1, error: null })), this.#l = W(!1), this.initPromise = null;\n }\n get isLoading() {\n return this.loadingState.loading;\n }\n get error() {\n return this.loadingState.error;\n }\n get activeProducts() {\n return this.products.filter((e) => e.active);\n }\n get archivedProducts() {\n return this.products.filter((e) => !e.active);\n }\n parseRepoJson(e, t) {\n const n = this.repoFiles.getFileContent(e);\n if (!n) return t;\n try {\n return JSON.parse(n);\n } catch (s) {\n return console.error(`Failed to parse ${e}:`, s), t;\n }\n }\n writeProducts(e) {\n this.repoFiles.writeFile(ff, JSON.stringify({ products: this.products, updatedAt: Date.now() }, null, 2), { source: \"shop\", label: e });\n }\n writeSettings(e) {\n this.settings && this.repoFiles.writeFile(pf, JSON.stringify(this.settings, null, 2), { source: \"shop\", label: e });\n }\n nowSeconds() {\n return Math.floor(Date.now() / 1e3);\n }\n slugify(e) {\n return e.toLowerCase().trim().replace(/[^a-z0-9]+/g, \"-\").replace(/^-+|-+$/g, \"\") || `product-${Date.now()}`;\n }\n createId(e) {\n return `${e}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;\n }\n normalizeProduct(e, t) {\n const n = this.nowSeconds(), s = e.name?.trim() || t?.name || \"Untitled product\";\n return {\n id: t?.id ?? this.createId(\"prod\"),\n slug: e.slug?.trim() || t?.slug || this.slugify(s),\n name: s,\n description: e.description ?? t?.description ?? \"\",\n active: e.active ?? t?.active ?? !0,\n images: e.images ?? t?.images ?? [],\n prices: (e.prices ?? t?.prices ?? []).map((o) => ({\n ...o,\n id: o.id || this.createId(\"price\"),\n label: o.label || \"Standard\",\n currency: o.currency.toLowerCase(),\n unitAmount: Math.round(o.unitAmount),\n active: o.active ?? !0\n })),\n metadata: e.metadata ?? t?.metadata ?? {},\n createdAt: t?.createdAt ?? n,\n updatedAt: n\n };\n }\n // =========================================================================\n // Products\n // =========================================================================\n /**\n * Fetch all products from the GitHub catalog\n */\n async fetchProducts(e) {\n this.productsLoading = { loading: !0, error: null };\n try {\n const t = this.parseRepoJson(ff, { products: [] });\n this.products = e?.active === void 0 ? t.products : t.products.filter((n) => n.active === e.active), this.hasMoreProducts = !1, this.catalogCommitSha = this.repoFiles.commitSha, this.productsLoading = { loading: !1, error: null };\n } catch (t) {\n const n = t instanceof Error ? t.message : \"Failed to fetch products\";\n this.productsLoading = { loading: !1, error: n }, console.error(\"Failed to fetch products:\", t);\n }\n }\n /**\n * Fetch a single product with all prices\n */\n async fetchProduct(e) {\n try {\n const t = this.products.find((n) => n.id === e || n.slug === e);\n return t ? { ...t, prices: t.prices ?? [] } : null;\n } catch (t) {\n throw console.error(\"Failed to fetch product:\", t), t;\n }\n }\n /**\n * Create a new product\n */\n async createProduct(e) {\n try {\n const t = this.normalizeProduct(e);\n if (this.products.some((n) => n.id === t.id || n.slug === t.slug))\n throw new Error(\"Product id or slug already exists\");\n return this.products = [t, ...this.products], this.writeProducts(`Create shop product ${t.name}`), t;\n } catch (t) {\n throw console.error(\"Failed to create product:\", t), t;\n }\n }\n /**\n * Update a product\n */\n async updateProduct(e, t) {\n try {\n const n = this.products.findIndex((i) => i.id === e || i.slug === e);\n if (n === -1) throw new Error(\"Product not found\");\n const s = this.normalizeProduct(t, this.products[n]);\n if (this.products.find((i, a) => a !== n && i.slug === s.slug)) throw new Error(\"Product slug already exists\");\n return this.products[n] = s, this.products = [...this.products], this.writeProducts(`Update shop product ${s.name}`), s;\n } catch (n) {\n throw console.error(\"Failed to update product:\", n), n;\n }\n }\n /**\n * Archive a product (set active = false)\n */\n async archiveProduct(e) {\n await this.updateProduct(e, { active: !1 });\n }\n /**\n * Activate a product (set active = true)\n */\n async activateProduct(e) {\n await this.updateProduct(e, { active: !0 });\n }\n /**\n * Delete a product (only works if no prices/subscriptions)\n */\n async deleteProduct(e) {\n try {\n const t = this.products.find((n) => n.id === e || n.slug === e);\n if (!t) throw new Error(\"Product not found\");\n this.products = this.products.filter((n) => n.id !== e && n.slug !== e), this.writeProducts(`Delete shop product ${t.name}`);\n } catch (t) {\n throw console.error(\"Failed to delete product:\", t), t;\n }\n }\n async fetchOrders(e) {\n try {\n const t = new URLSearchParams();\n e?.status && t.set(\"status\", e.status), e?.paymentMethod && t.set(\"paymentMethod\", e.paymentMethod);\n const n = await fetch(`/api/shop/admin/orders${t.toString() ? `?${t}` : \"\"}`);\n if (!n.ok) {\n const o = await n.json();\n throw new Error(o.error || \"Failed to fetch orders\");\n }\n const s = await n.json();\n this.orders = s.orders;\n } catch (t) {\n throw console.error(\"Failed to fetch orders:\", t), t;\n }\n }\n async updateOrderStatus(e, t) {\n const n = await fetch(`/api/shop/admin/orders/${e}/status`, {\n method: \"PATCH\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ status: t })\n });\n if (!n.ok) {\n const a = await n.json();\n throw new Error(a.error || \"Failed to update order\");\n }\n const o = (await n.json()).order, i = this.orders.findIndex((a) => a.id === o.id);\n return i !== -1 && (this.orders[i] = o), o;\n }\n async fetchSettings() {\n this.settings = hf(this.parseRepoJson(pf, Un)), this.settingsCommitSha = this.repoFiles.commitSha, this.stripeConfigured = !1;\n }\n async updateSettings(e) {\n return this.settings = hf(e), this.settingsCommitSha = this.repoFiles.commitSha, this.writeSettings(\"Update shop settings\"), this.settings;\n }\n /**\n * Initialize store - fetch products\n */\n async initialize() {\n return this.initPromise ? this.initPromise : (this.initPromise = Promise.all([\n this.fetchProducts(),\n this.fetchSettings(),\n this.fetchOrders()\n ]).then(() => {\n }), this.initPromise);\n }\n}\nconst Nm = /* @__PURE__ */ Symbol(\"shop-context\");\nfunction gC(r) {\n const e = new vC(r), t = new Mf();\n let n = W(void 0), s = W(void 0), o = W(void 0), i = W(void 0);\n const a = {\n shop: e,\n notifications: t,\n get location() {\n return c(n);\n },\n set location(l) {\n k(n, l, !0);\n },\n get productId() {\n return c(s);\n },\n set productId(l) {\n k(s, l, !0);\n },\n get orderId() {\n return c(o);\n },\n set orderId(l) {\n k(o, l, !0);\n },\n get customerId() {\n return c(i);\n },\n set customerId(l) {\n k(i, l, !0);\n }\n };\n return wc(Nm, a), a;\n}\nfunction Fa() {\n const r = wa(Nm);\n if (!r)\n throw new Error(\"Shop context not found. Make sure to call createShopContext() in a parent component.\");\n return r;\n}\nvar bC = S(\"<img/>\");\nconst yC = {\n hash: \"svelte-1onxhd9\",\n code: \"img.svelte-1onxhd9 {display:block;width:100%;height:100%;object-fit:cover;}\"\n};\nfunction md(r, e) {\n nt(e, !0), bt(r, yC);\n let t = ce(e, \"src\", 7, \"\"), n = ce(e, \"alt\", 7), s = ce(e, \"class\", 7, \"\");\n const { repoFiles: o } = yn(), i = ie(() => {\n if (!t()) return \"\";\n let f = t();\n if (!f.startsWith(\"frontend/static/\") && !f.startsWith(\"/\"))\n f = `frontend/static/shop/${f}`;\n else if (f.startsWith(\"/\")) {\n const h = f.split(\"/\").filter(Boolean);\n h.length >= 2 && (f = `frontend/static/${h[0]}/${h.slice(1).join(\"/\")}`);\n }\n return o.getStaticAssetDataURL(f) ?? t();\n });\n var a = {\n get src() {\n return t();\n },\n set src(f = \"\") {\n t(f), de();\n },\n get alt() {\n return n();\n },\n set alt(f) {\n n(f), de();\n },\n get class() {\n return s();\n },\n set class(f = \"\") {\n s(f), de();\n }\n }, l = lt(), d = ke(l);\n {\n var u = (f) => {\n var h = bC();\n B(() => {\n Ge(h, \"src\", c(i)), Ge(h, \"alt\", n()), Ne(h, 1, cs(s()), \"svelte-1onxhd9\");\n }), w(f, h);\n };\n K(d, (f) => {\n c(i) && f(u);\n });\n }\n return w(r, l), st(a);\n}\nrt(md, { src: {}, alt: {}, class: {} }, [], [], { mode: \"open\" });\nconst pc = \"google\", mf = \"gemini-2.5-flash\";\nasync function xC(r) {\n const { prompt: e, currentProduct: t, signal: n, getUserApiKey: s } = r;\n let o = null;\n const a = {\n name: \"proposePatch\",\n label: \"Propose patch\",\n description: \"Return a patch object containing ONLY changed product fields. Call exactly once.\",\n parameters: Xo({\n patch: dg(Us(), $f(), {\n description: \"Object containing ONLY product fields to change.\"\n })\n }),\n execute: async (l, d) => (o = { patch: CC(d.patch ?? {}) }, { content: [{ type: \"text\", text: \"Patch recorded.\" }], details: {} })\n };\n if (await wC({\n systemPrompt: kC(t),\n tools: [a],\n userPrompt: e,\n signal: n,\n getUserApiKey: s\n }), !o) throw new Error(\"The model did not return a patch.\");\n return o;\n}\nasync function wC(r) {\n const e = new Ec({\n initialState: {\n systemPrompt: r.systemPrompt,\n model: SC(),\n thinkingLevel: \"off\",\n messages: [],\n tools: r.tools\n },\n convertToLlm: (s) => s.filter((o) => o.role === \"user\" || o.role === \"assistant\" || o.role === \"toolResult\"),\n getApiKey: async (s) => {\n if (s !== pc) return;\n const o = r.getUserApiKey?.()?.trim();\n if (o) return o;\n const i = await fetch(\"/api/admin/agent/api-key\");\n if (i.ok)\n return (await i.json()).apiKey;\n },\n toolExecution: \"sequential\"\n }), t = e.subscribe((s) => {\n s.type === \"tool_execution_end\" && !s.isError && e.abort();\n }), n = () => e.abort();\n r.signal?.addEventListener(\"abort\", n);\n try {\n await e.prompt(r.userPrompt);\n } catch (s) {\n if (r.signal?.aborted || !(s instanceof Error && /abort/i.test(s.message))) throw s;\n } finally {\n r.signal?.removeEventListener(\"abort\", n), t();\n }\n}\nfunction kC(r) {\n return [\n \"You are a one-shot product editor. Produce a patch for this shop product and stop.\",\n \"\",\n \"Editable fields: name, description, slug, active, images, prices.\",\n \"Do not change images unless the user explicitly asks.\",\n \"For prices, unitAmount is in minor units, e.g. cents.\",\n 'If you add prices, create ids using \"price_\" plus a short lowercase slug.',\n \"\",\n \"Current product:\",\n \"```json\",\n JSON.stringify(r, null, 2),\n \"```\",\n \"\",\n \"Call proposePatch exactly once with ONLY changed fields. Match each field's expected type.\"\n ].join(`\n`);\n}\nfunction CC(r) {\n if (!r || typeof r != \"object\") return {};\n const e = r, t = {};\n return typeof e.name == \"string\" && (t.name = e.name), typeof e.description == \"string\" && (t.description = e.description), typeof e.slug == \"string\" && (t.slug = e.slug), typeof e.active == \"boolean\" && (t.active = e.active), Array.isArray(e.images) && e.images.every((n) => typeof n == \"string\") && (t.images = e.images), Array.isArray(e.prices) && (t.prices = e.prices.filter(_C)), t;\n}\nfunction _C(r) {\n if (!r || typeof r != \"object\") return !1;\n const e = r;\n return typeof e.id == \"string\" && typeof e.label == \"string\" && typeof e.currency == \"string\" && typeof e.unitAmount == \"number\" && typeof e.active == \"boolean\";\n}\nfunction SC() {\n const r = If(pc, mf);\n return r || {\n id: mf,\n name: \"Product Edit\",\n api: \"google-generative-ai\",\n provider: pc,\n baseUrl: \"https://generativelanguage.googleapis.com/v1beta\",\n reasoning: !1,\n input: [\"text\", \"image\"],\n cost: { input: 0.25, output: 1.5, cacheRead: 0.025, cacheWrite: 1 },\n contextWindow: 1048576,\n maxTokens: 65536\n };\n}\nvar EC = S('<div class=\"popover-error svelte-dat3ba\"> </div>'), TC = S('<div class=\"empty-state svelte-dat3ba\">The model did not propose any changes.</div>'), MC = S('<label class=\"diff-row svelte-dat3ba\"><input type=\"checkbox\" class=\"svelte-dat3ba\"/> <div class=\"diff-row-body svelte-dat3ba\"><div class=\"diff-row-key svelte-dat3ba\"> </div> <div class=\"diff-old svelte-dat3ba\"> </div> <div class=\"diff-new svelte-dat3ba\"> </div></div></label>'), AC = S('<div class=\"diff svelte-dat3ba\"></div> <div class=\"popover-actions svelte-dat3ba\"><button type=\"button\" class=\"reject-btn svelte-dat3ba\">Discard</button> <button type=\"button\" class=\"accept-btn svelte-dat3ba\"> </button></div>', 1), PC = S('<div class=\"popover-backdrop svelte-dat3ba\"></div> <div class=\"popover svelte-dat3ba\" role=\"dialog\" aria-label=\"AI product edit\"><div class=\"popover-row svelte-dat3ba\"><input placeholder=\"e.g. improve copy, fill missing fields, suggest a price...\" class=\"svelte-dat3ba\"/> <button type=\"button\" class=\"run-btn svelte-dat3ba\"><!></button></div> <!> <!> <!></div>', 1), NC = S('<div class=\"product-ai-root svelte-dat3ba\"><button type=\"button\" class=\"product-ai-trigger svelte-dat3ba\"><svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 3l1.9 4.6L18.5 9l-4.6 1.9L12 15l-1.9-4.1L5.5 9l4.6-1.4z\"></path><path d=\"M19 14l.7 1.6L21.5 16l-1.8.4L19 18l-.7-1.6L16.5 16l1.8-.4z\"></path></svg> Edit with AI</button> <!></div>');\nconst OC = {\n hash: \"svelte-dat3ba\",\n code: \".product-ai-root.svelte-dat3ba {position:relative;display:inline-flex;}.product-ai-trigger.svelte-dat3ba {display:inline-flex;align-items:center;gap:0.375rem;padding:0.375rem 0.75rem;border:1px solid var(--borderColor-accent-muted, #54aeff66);border-radius:0.375rem;background:var(--bgColor-accent-muted, #ddf4ff);color:var(--fgColor-accent, #0969da);font:inherit;font-size:0.8125rem;font-weight:500;cursor:pointer;}.product-ai-trigger.svelte-dat3ba:hover {background:var(--bgColor-default, #fff);}.popover-backdrop.svelte-dat3ba {position:fixed;inset:0;background:transparent;z-index:999;}.popover.svelte-dat3ba {position:absolute;top:calc(100% + 4px);right:0;z-index:1000;min-width:26rem;max-width:min(34rem, 92vw);padding:0.75rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:0.5rem;background:var(--bgColor-default, #fff);box-shadow:0 8px 24px rgba(140, 149, 159, 0.2);display:flex;flex-direction:column;gap:0.5rem;}.popover-row.svelte-dat3ba {display:flex;gap:0.5rem;}.popover.svelte-dat3ba input:where(.svelte-dat3ba):not([type]) {flex:1;min-width:0;padding:0.375rem 0.5rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:0.375rem;font:inherit;font-size:0.8125rem;}.run-btn.svelte-dat3ba, .reject-btn.svelte-dat3ba, .accept-btn.svelte-dat3ba {padding:0.375rem 0.75rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:0.375rem;font:inherit;font-size:0.8125rem;cursor:pointer;}.run-btn.svelte-dat3ba, .accept-btn.svelte-dat3ba {background:var(--button-primary-bgColor-rest, #1f883d);color:#fff;}.run-btn.svelte-dat3ba:disabled, .accept-btn.svelte-dat3ba:disabled {opacity:0.6;cursor:not-allowed;}.reject-btn.svelte-dat3ba {background:var(--bgColor-default, #fff);color:var(--fgColor-default, #24292f);}.popover-error.svelte-dat3ba, .empty-state.svelte-dat3ba {padding:0.5rem;border-radius:0.375rem;font-size:0.8125rem;}.popover-error.svelte-dat3ba {border:1px solid var(--borderColor-danger-emphasis, #cf222e);background:var(--bgColor-danger-muted, #ffebe9);color:var(--fgColor-danger, #d1242f);}.empty-state.svelte-dat3ba {background:var(--bgColor-muted, #f6f8fa);color:var(--fgColor-muted, #656d76);}.diff.svelte-dat3ba {display:flex;flex-direction:column;gap:0.375rem;max-height:50vh;overflow-y:auto;}.diff-row.svelte-dat3ba {display:flex;align-items:flex-start;gap:0.5rem;padding:0.5rem;border:1px solid var(--borderColor-muted, #d8dee4);border-radius:0.375rem;cursor:pointer;}.diff-row.svelte-dat3ba input[type='checkbox']:where(.svelte-dat3ba) {margin-top:0.25rem;}.diff-row-body.svelte-dat3ba {flex:1;min-width:0;}.diff-row-key.svelte-dat3ba {margin-bottom:0.25rem;font-size:0.75rem;font-weight:600;color:var(--fgColor-muted, #656d76);}.diff-old.svelte-dat3ba, .diff-new.svelte-dat3ba {white-space:pre-wrap;overflow-wrap:anywhere;padding:0.375rem;border-radius:0.25rem;font-size:0.8125rem;}.diff-old.svelte-dat3ba {background:var(--bgColor-muted, #f6f8fa);}.diff-new.svelte-dat3ba {background:var(--bgColor-success-muted, #dafbe1);margin-top:0.25rem;}.popover-actions.svelte-dat3ba {display:flex;justify-content:flex-end;gap:0.5rem;}\"\n};\nfunction Om(r, e) {\n nt(e, !0), bt(r, OC);\n let t = ce(e, \"currentProduct\", 7), n = ce(e, \"onApplyPatch\", 7), s = W(!1), o = W(\"\"), i = W(!1), a = W(null), l = W(null), d = W(ft({})), u, f = W(void 0);\n async function h() {\n k(s, !c(s)), c(s) ? (await Cc(), c(f)?.focus()) : p();\n }\n function p() {\n u?.abort(), u = void 0, k(s, !1), k(o, \"\"), k(a, null), k(l, null), k(d, {}, !0), k(i, !1);\n }\n async function g() {\n const $ = c(o).trim();\n if (!(!$ || c(i))) {\n u?.abort(), u = new AbortController(), k(i, !0), k(a, null), k(l, null), k(d, {}, !0);\n try {\n const J = await xC({\n prompt: $,\n currentProduct: t(),\n signal: u.signal,\n getUserApiKey: () => typeof localStorage < \"u\" ? localStorage.getItem(\"hintergrund_user_gemini_api_key\") ?? void 0 : void 0\n }), U = {};\n for (const [F, z] of Object.entries(J.patch)) {\n const _ = t()[F];\n JSON.stringify(_) !== JSON.stringify(z) && (U[F] = z, c(d)[F] = !0);\n }\n k(l, U, !0);\n } catch (J) {\n if (u?.signal.aborted) return;\n k(a, J instanceof Error ? J.message : String(J), !0);\n } finally {\n k(i, !1);\n }\n }\n }\n function b() {\n if (!c(l)) return;\n const $ = {};\n for (const [J, U] of Object.entries(c(l)))\n c(d)[J] && ($[J] = U);\n Object.keys($).length > 0 && n()($), p();\n }\n function y($) {\n $.key === \"Enter\" && !$.shiftKey ? ($.preventDefault(), g()) : $.key === \"Escape\" && p();\n }\n function C($) {\n if ($ == null) return \"\";\n if (typeof $ == \"string\") return $;\n try {\n return JSON.stringify($, null, 2);\n } catch {\n return String($);\n }\n }\n const E = ie(() => c(l) ? Object.entries(c(l)) : []), R = ie(() => c(E).filter(([$]) => c(d)[$]).length);\n var q = {\n get currentProduct() {\n return t();\n },\n set currentProduct($) {\n t($), de();\n },\n get onApplyPatch() {\n return n();\n },\n set onApplyPatch($) {\n n($), de();\n }\n }, O = NC(), M = v(O), P = x(M, 2);\n {\n var L = ($) => {\n var J = PC(), U = ke(J), F = x(U, 2), z = v(F), _ = v(z);\n Ut(_), bn(_, (G) => k(f, G), () => c(f));\n var N = x(_, 2), Q = v(N);\n {\n var T = (G) => {\n var Y = qe(\"...\");\n w(G, Y);\n }, I = (G) => {\n var Y = qe(\"Run\");\n w(G, Y);\n };\n K(Q, (G) => {\n c(i) ? G(T) : G(I, -1);\n });\n }\n m(N), m(z);\n var te = x(z, 2);\n {\n var A = (G) => {\n var Y = EC(), se = v(Y, !0);\n m(Y), B(() => D(se, c(a))), w(G, Y);\n };\n K(te, (G) => {\n c(a) && G(A);\n });\n }\n var V = x(te, 2);\n {\n var H = (G) => {\n var Y = TC();\n w(G, Y);\n };\n K(V, (G) => {\n c(l) && c(E).length === 0 && !c(i) && G(H);\n });\n }\n var ne = x(V, 2);\n {\n var X = (G) => {\n var Y = AC(), se = ke(Y);\n tt(se, 21, () => c(E), pt, (ge, Se) => {\n var _e = ie(() => is(c(Se), 2));\n let Re = () => c(_e)[0], Ie = () => c(_e)[1];\n var Fe = MC(), j = v(Fe);\n Ut(j);\n var oe = x(j, 2), he = v(oe), Z = v(he, !0);\n m(he);\n var pe = x(he, 2), xe = v(pe, !0);\n m(pe);\n var Be = x(pe, 2), We = v(Be, !0);\n m(Be), m(oe), m(Fe), B(\n (ee, He) => {\n D(Z, Re()), D(xe, ee), D(We, He);\n },\n [\n () => C(t()[Re()]) || \"(empty)\",\n () => C(Ie()) || \"(empty)\"\n ]\n ), _c(j, () => c(d)[Re()], (ee) => c(d)[Re()] = ee), w(ge, Fe);\n }), m(se);\n var ue = x(se, 2), le = v(ue), re = x(le, 2), ae = v(re);\n m(re), m(ue), B(() => {\n re.disabled = c(R) === 0, D(ae, `Apply ${c(R) > 0 ? `(${c(R)})` : \"\"}`);\n }), fe(\"click\", le, p), fe(\"click\", re, b), w(G, Y);\n };\n K(ne, (G) => {\n c(E).length > 0 && G(X);\n });\n }\n m(F), B(\n (G) => {\n _.disabled = c(i), N.disabled = G;\n },\n [() => c(i) || !c(o).trim()]\n ), fe(\"click\", U, p), fe(\"keydown\", _, y), nr(_, () => c(o), (G) => k(o, G)), fe(\"click\", N, g), w($, J);\n };\n K(P, ($) => {\n c(s) && $(L);\n });\n }\n return m(O), fe(\"click\", M, h), w(r, O), st(q);\n}\nhr([\"click\", \"keydown\"]);\nrt(Om, { currentProduct: {}, onApplyPatch: {} }, [], [], { mode: \"open\" });\nvar $C = S('<div class=\"loading svelte-1vpxcyj\">Loading product...</div>'), IC = S('<div class=\"image-item svelte-1vpxcyj\"><!> <button type=\"button\" class=\"remove-btn svelte-1vpxcyj\" aria-label=\"Remove image\"><svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"currentColor\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"></path></svg></button></div>'), zC = S(\"<option> </option>\"), RC = S('<span class=\"badge inactive svelte-1vpxcyj\">Inactive</span>'), jC = S('<button class=\"action-btn svelte-1vpxcyj\" title=\"Deactivate\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M0 2a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1v7.5a2.5 2.5 0 0 1-2.5 2.5h-9A2.5 2.5 0 0 1 1 12.5V5a1 1 0 0 1-1-1V2zm2 3v7.5A1.5 1.5 0 0 0 3.5 14h9a1.5 1.5 0 0 0 1.5-1.5V5H2zm13-3H1v2h14V2zM5 7.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5z\"></path></svg></button>'), LC = S('<div><div class=\"price-info svelte-1vpxcyj\"><span class=\"price-amount svelte-1vpxcyj\"> </span> <div class=\"price-badges svelte-1vpxcyj\"><span class=\"badge default svelte-1vpxcyj\"> </span> <!></div></div> <div class=\"price-actions svelte-1vpxcyj\"><!></div></div>'), DC = S('<div class=\"prices-list svelte-1vpxcyj\"></div>'), FC = S('<p class=\"no-prices svelte-1vpxcyj\">No prices configured for this product.</p>'), BC = S('<div class=\"editor-form svelte-1vpxcyj\"><div class=\"field svelte-1vpxcyj\"><div class=\"field-label\">Product Images</div> <div class=\"image-grid svelte-1vpxcyj\"><!> <!></div></div> <div class=\"field svelte-1vpxcyj\"><div class=\"field-label-row svelte-1vpxcyj\"><label for=\"name\" class=\"svelte-1vpxcyj\">Name <span class=\"required svelte-1vpxcyj\">*</span></label></div> <!></div> <div class=\"field svelte-1vpxcyj\"><div class=\"field-label-row svelte-1vpxcyj\"><label for=\"description\" class=\"svelte-1vpxcyj\">Description</label></div> <textarea id=\"description\" placeholder=\"Product description\" rows=\"4\" class=\"svelte-1vpxcyj\"></textarea></div> <div class=\"field-group svelte-1vpxcyj\"><div class=\"field svelte-1vpxcyj\"><div class=\"field-label-row svelte-1vpxcyj\"><label for=\"slug\" class=\"svelte-1vpxcyj\">Slug</label></div> <!></div> <div class=\"field checkbox-group svelte-1vpxcyj\"><div class=\"field-label-row svelte-1vpxcyj\"><label class=\"svelte-1vpxcyj\"><input type=\"checkbox\"/> Active</label></div></div></div> <div class=\"field svelte-1vpxcyj\"><div class=\"prices-header svelte-1vpxcyj\"><div class=\"field-label-row svelte-1vpxcyj\"><div class=\"field-label svelte-1vpxcyj\">Prices</div></div></div> <div class=\"add-price-form svelte-1vpxcyj\"><div class=\"field-group svelte-1vpxcyj\"><div class=\"field svelte-1vpxcyj\"><label for=\"newPriceLabel\" class=\"svelte-1vpxcyj\">Label</label> <!></div> <div class=\"field svelte-1vpxcyj\"><label for=\"newPriceAmount\" class=\"svelte-1vpxcyj\">Amount</label> <!></div> <div class=\"field svelte-1vpxcyj\"><label for=\"newPriceCurrency\" class=\"svelte-1vpxcyj\">Currency</label> <select id=\"newPriceCurrency\" class=\"svelte-1vpxcyj\"></select></div></div> <!></div> <!></div></div>'), HC = S('<div class=\"product-editor svelte-1vpxcyj\"><div class=\"page-header svelte-1vpxcyj\"><h1 class=\"svelte-1vpxcyj\"> </h1> <div class=\"header-actions svelte-1vpxcyj\"><!> <!></div></div> <!> <div class=\"page-footer svelte-1vpxcyj\"><div class=\"footer-actions svelte-1vpxcyj\"><!> <!></div></div></div>');\nconst qC = {\n hash: \"svelte-1vpxcyj\",\n code: `.product-editor.svelte-1vpxcyj {width:100%;display:flex;flex-direction:column;height:100%;overflow:hidden;}.page-header.svelte-1vpxcyj {display:flex;align-items:center;justify-content:space-between;padding:1.25rem 2rem;border-bottom:1px solid var(--borderColor-default);background-color:var(--bgColor-default);border-top-left-radius:0.5rem;border-top-right-radius:0.5rem;flex-shrink:0;}.page-header.svelte-1vpxcyj h1:where(.svelte-1vpxcyj) {margin:0;font-size:1.5rem;font-weight:600;}.header-actions.svelte-1vpxcyj {display:flex;align-items:center;gap:0.5rem;}.loading.svelte-1vpxcyj {padding:4rem 2rem;text-align:center;color:var(--fgColor-muted);}.editor-form.svelte-1vpxcyj {display:flex;flex-direction:column;gap:1.5rem;padding:2rem;flex:1;overflow-y:auto;}.field.svelte-1vpxcyj {display:flex;flex-direction:column;gap:0.375rem;}.field.svelte-1vpxcyj label:where(.svelte-1vpxcyj) {font-size:0.875rem;font-weight:500;color:var(--fgColor-default);}.field-label-row.svelte-1vpxcyj {display:flex;align-items:center;gap:0.375rem;min-height:1.5rem;}.field-label-row.svelte-1vpxcyj label:where(.svelte-1vpxcyj) {margin:0;}.required.svelte-1vpxcyj {color:var(--fgColor-danger);}.field-group.svelte-1vpxcyj {display:grid;grid-template-columns:1fr 1fr;gap:1rem;}textarea.svelte-1vpxcyj {width:100%;padding:0.5rem 0.75rem;font-size:0.875rem;line-height:1.5;border:1px solid var(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);background-color:var(--bgColor-default);color:var(--fgColor-default);resize:vertical;font-family:inherit;}textarea.svelte-1vpxcyj:focus-visible {outline:2px solid var(--fgColor-accent);outline-offset:-1px;border-color:var(--fgColor-accent);}select.svelte-1vpxcyj {width:100%;padding:0.5rem 0.75rem;font-size:0.875rem;border:1px solid var(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);background-color:var(--bgColor-default);color:var(--fgColor-default);cursor:pointer;}select.svelte-1vpxcyj:focus-visible {outline:2px solid var(--fgColor-accent);outline-offset:-1px;border-color:var(--fgColor-accent);}.checkbox-group.svelte-1vpxcyj label:where(.svelte-1vpxcyj) {display:flex;align-items:center;gap:0.5rem;cursor:pointer;font-weight:400;}.image-grid.svelte-1vpxcyj {display:grid;grid-template-columns:repeat(auto-fill, minmax(100px, 1fr));gap:1rem;margin-top:0.5rem;}.image-item.svelte-1vpxcyj {position:relative;aspect-ratio:1;border-radius:0.5rem;overflow:hidden;border:1px solid var(--borderColor-default);}.remove-btn.svelte-1vpxcyj {position:absolute;top:4px;right:4px;background:rgba(0,0,0,0.5);color:white;border:none;border-radius:50%;width:24px;height:24px;display:flex;align-items:center;justify-content:center;cursor:pointer;}.add-image-btn {aspect-ratio:1;border:2px dashed var(--borderColor-default);border-radius:0.5rem;background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;cursor:pointer;color:var(--fgColor-muted);}:global(.add-image-btn):hover {border-color:var(--fgColor-accent);color:var(--fgColor-accent);}\n\n\t/* Prices section */.prices-header.svelte-1vpxcyj {display:flex;align-items:center;justify-content:space-between;margin-bottom:0.5rem;}.prices-header.svelte-1vpxcyj .field-label:where(.svelte-1vpxcyj) {margin:0;}.add-price-form.svelte-1vpxcyj {background-color:var(--bgColor-muted);border-radius:var(--borderRadius-medium, 0.375rem);padding:1rem;margin-bottom:0.75rem;display:flex;flex-direction:column;gap:0.75rem;}.prices-list.svelte-1vpxcyj {display:flex;flex-direction:column;gap:0.5rem;}.price-item.svelte-1vpxcyj {display:flex;align-items:center;justify-content:space-between;padding:0.75rem 1rem;background-color:var(--bgColor-muted);border-radius:var(--borderRadius-medium, 0.375rem);}.price-item.inactive.svelte-1vpxcyj {opacity:0.6;}.price-info.svelte-1vpxcyj {display:flex;flex-direction:column;gap:0.25rem;}.price-amount.svelte-1vpxcyj {font-weight:600;}.price-badges.svelte-1vpxcyj {display:flex;gap:0.375rem;}.badge.svelte-1vpxcyj {display:inline-block;padding:0.125rem 0.375rem;font-size:0.625rem;font-weight:500;border-radius:var(--borderRadius-small, 0.25rem);text-transform:uppercase;}.badge.default.svelte-1vpxcyj {background-color:rgba(99, 102, 241, 0.1);color:rgb(99, 102, 241);}.badge.inactive.svelte-1vpxcyj {background-color:var(--bgColor-neutral-muted, rgba(175, 184, 193, 0.2));color:var(--fgColor-muted);}.price-actions.svelte-1vpxcyj {display:flex;gap:0.25rem;}.action-btn.svelte-1vpxcyj {display:flex;align-items:center;justify-content:center;width:28px;height:28px;background:none;border:none;border-radius:var(--borderRadius-small, 0.25rem);cursor:pointer;color:var(--fgColor-muted);transition:background-color 0.15s ease;}.action-btn.svelte-1vpxcyj:hover {background-color:var(--bgColor-default);color:var(--fgColor-default);}.no-prices.svelte-1vpxcyj {color:var(--fgColor-muted);font-size:0.875rem;margin:0;}.page-footer.svelte-1vpxcyj {padding:1.25rem 2rem;border-bottom-left-radius:0.5rem;border-bottom-right-radius:0.5rem;display:flex;justify-content:flex-end;flex-shrink:0;}.footer-actions.svelte-1vpxcyj {display:flex;align-items:center;gap:0.5rem;}`\n};\nfunction $m(r, e) {\n nt(e, !0), bt(r, qC);\n let t = ce(e, \"productId\", 7), n = ce(e, \"isNew\", 7, !1), s = ce(e, \"onClose\", 7);\n const o = Fa(), { shop: i, notifications: a } = o;\n let l = W(\"\"), d = W(\"\"), u = W(\"\"), f = W(!0), h = W(ft([])), p = W(ft([])), g = W(!1), b = W(!1), y = W(null), C = W(\"Standard\"), E = W(\"\"), R = W(\"eur\");\n Ar(async () => {\n if (!n() && t()) {\n k(g, !0);\n try {\n k(y, await i.fetchProduct(t()), !0), c(y) && (k(l, c(y).name, !0), k(d, c(y).description || \"\", !0), k(u, c(y).slug, !0), k(f, c(y).active, !0), k(h, [...c(y).images], !0), k(p, [...c(y).prices], !0));\n } catch {\n a.error(\"Failed to load product\");\n } finally {\n k(g, !1);\n }\n }\n });\n async function q() {\n if (!c(l).trim()) {\n a.error(\"Product name is required\");\n return;\n }\n k(b, !0);\n try {\n n() ? (await i.createProduct({\n slug: c(u).trim() || void 0,\n name: c(l).trim(),\n description: c(d).trim() || void 0,\n images: c(h).length > 0 ? c(h) : void 0,\n active: c(f),\n prices: c(p)\n }), a.success(\"Product created successfully\"), s()()) : t() && (await i.updateProduct(t(), {\n slug: c(u).trim() || void 0,\n name: c(l).trim(),\n description: c(d).trim() || void 0,\n images: c(h),\n active: c(f),\n prices: c(p)\n }), a.success(\"Product updated successfully\"), s()());\n } catch (re) {\n a.error(`Failed to save product: ${re instanceof Error ? re.message : \"Unknown error\"}`);\n } finally {\n k(b, !1);\n }\n }\n function O() {\n c(E) && (k(\n p,\n [\n ...c(p),\n {\n id: `price_${Date.now().toString(36)}`,\n label: c(C).trim() || \"Standard\",\n currency: c(R),\n unitAmount: Math.round(parseFloat(c(E)) * 100),\n active: !0\n }\n ],\n !0\n ), k(C, \"Standard\"), k(E, \"\"));\n }\n async function M(re) {\n k(p, c(p).map((ae) => ae.id === re.id ? { ...ae, active: !1 } : ae), !0);\n }\n function P(re, ae) {\n return new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: ae.toUpperCase() }).format(re / 100);\n }\n function L(re) {\n k(h, c(h).filter((ae, ge) => ge !== re), !0);\n }\n function $(re) {\n if (re) {\n const ae = `/${re.module}/${re.name}`;\n c(h).includes(ae) || k(h, [...c(h), ae], !0);\n }\n }\n const J = [\"usd\", \"eur\", \"gbp\", \"cad\", \"aud\", \"jpy\", \"chf\"], U = ie(() => ({\n name: c(l),\n description: c(d),\n slug: c(u),\n active: c(f),\n images: c(h),\n prices: c(p)\n }));\n function F(re, ae) {\n re === \"name\" && typeof ae == \"string\" && k(l, ae, !0), re === \"description\" && typeof ae == \"string\" && k(d, ae, !0), re === \"slug\" && typeof ae == \"string\" && k(u, ae, !0), re === \"active\" && typeof ae == \"boolean\" && k(f, ae, !0), re === \"images\" && Array.isArray(ae) && ae.every((ge) => typeof ge == \"string\") && k(h, ae, !0), re === \"prices\" && Array.isArray(ae) && ae.every(_) && k(p, ae, !0);\n }\n function z(re) {\n for (const [ae, ge] of Object.entries(re))\n F(ae, ge);\n }\n function _(re) {\n if (!re || typeof re != \"object\") return !1;\n const ae = re;\n return typeof ae.id == \"string\" && typeof ae.label == \"string\" && typeof ae.currency == \"string\" && typeof ae.unitAmount == \"number\" && typeof ae.active == \"boolean\";\n }\n var N = {\n get productId() {\n return t();\n },\n set productId(re) {\n t(re), de();\n },\n get isNew() {\n return n();\n },\n set isNew(re = !1) {\n n(re), de();\n },\n get onClose() {\n return s();\n },\n set onClose(re) {\n s(re), de();\n }\n }, Q = HC(), T = v(Q), I = v(T), te = v(I, !0);\n m(I);\n var A = x(I, 2), V = v(A);\n Om(V, {\n get currentProduct() {\n return c(U);\n },\n onApplyPatch: z\n });\n var H = x(V, 2);\n Gv(H, {\n icon: \"x\",\n ariaLabel: \"Close\",\n get onclick() {\n return s();\n },\n variant: \"invisible\"\n }), m(A), m(T);\n var ne = x(T, 2);\n {\n var X = (re) => {\n var ae = $C();\n w(re, ae);\n }, G = (re) => {\n var ae = BC(), ge = v(ae), Se = x(v(ge), 2), _e = v(Se);\n tt(_e, 17, () => c(h), pt, (Ae, Ye, xt) => {\n var ut = IC(), me = v(ut);\n md(me, {\n get src() {\n return c(Ye);\n },\n alt: \"Product\"\n });\n var we = x(me, 2);\n m(ut), fe(\"click\", we, () => L(xt)), w(Ae, ut);\n });\n var Re = x(_e, 2);\n Of(Re, {\n module: \"shop\",\n label: \"\",\n get notifications() {\n return a;\n },\n onAssetChange: $,\n width: \"100px\",\n height: \"100px\"\n }), m(Se), m(ge);\n var Ie = x(ge, 2), Fe = x(v(Ie), 2);\n Qn(Fe, {\n id: \"name\",\n placeholder: \"Product name\",\n block: !0,\n get value() {\n return c(l);\n },\n set value(Ae) {\n k(l, Ae, !0);\n }\n }), m(Ie);\n var j = x(Ie, 2), oe = x(v(j), 2);\n Go(oe), m(j);\n var he = x(j, 2), Z = v(he), pe = x(v(Z), 2);\n Qn(pe, {\n id: \"slug\",\n placeholder: \"product-slug\",\n block: !0,\n get value() {\n return c(u);\n },\n set value(Ae) {\n k(u, Ae, !0);\n }\n }), m(Z);\n var xe = x(Z, 2), Be = v(xe), We = v(Be), ee = v(We);\n Ut(ee), Pe(), m(We), m(Be), m(xe), m(he);\n var He = x(he, 2), ve = x(v(He), 2), Te = v(ve), Me = v(Te), Xe = x(v(Me), 2);\n Qn(Xe, {\n id: \"newPriceLabel\",\n placeholder: \"Standard\",\n block: !0,\n get value() {\n return c(C);\n },\n set value(Ae) {\n k(C, Ae, !0);\n }\n }), m(Me);\n var mt = x(Me, 2), Et = x(v(mt), 2);\n Qn(Et, {\n id: \"newPriceAmount\",\n placeholder: \"0.00\",\n block: !0,\n get value() {\n return c(E);\n },\n set value(Ae) {\n k(E, Ae, !0);\n }\n }), m(mt);\n var Dt = x(mt, 2), Rt = x(v(Dt), 2);\n tt(Rt, 21, () => J, pt, (Ae, Ye) => {\n var xt = zC(), ut = v(xt, !0);\n m(xt);\n var me = {};\n B(\n (we) => {\n D(ut, we), me !== (me = c(Ye)) && (xt.value = (xt.__value = c(Ye)) ?? \"\");\n },\n [() => c(Ye).toUpperCase()]\n ), w(Ae, xt);\n }), m(Rt), m(Dt), m(Te);\n var er = x(Te, 2);\n Je(er, {\n variant: \"primary\",\n onclick: O,\n children: (Ae, Ye) => {\n Pe();\n var xt = qe(\"Add Price\");\n w(Ae, xt);\n },\n $$slots: { default: !0 }\n }), m(ve);\n var ct = x(ve, 2);\n {\n var vt = (Ae) => {\n var Ye = DC();\n tt(Ye, 21, () => c(p), pt, (xt, ut) => {\n var me = LC();\n let we;\n var Ee = v(me), je = v(Ee), ze = v(je, !0);\n m(je);\n var Ve = x(je, 2), it = v(Ve), _t = v(it, !0);\n m(it);\n var Qe = x(it, 2);\n {\n var sr = (wt) => {\n var Ft = RC();\n w(wt, Ft);\n };\n K(Qe, (wt) => {\n c(ut).active || wt(sr);\n });\n }\n m(Ve), m(Ee);\n var vr = x(Ee, 2), $t = v(vr);\n {\n var At = (wt) => {\n var Ft = jC();\n fe(\"click\", Ft, () => M(c(ut))), w(wt, Ft);\n };\n K($t, (wt) => {\n c(ut).active && wt(At);\n });\n }\n m(vr), m(me), B(\n (wt) => {\n we = Ne(me, 1, \"price-item svelte-1vpxcyj\", null, we, { inactive: !c(ut).active }), D(ze, wt), D(_t, c(ut).label);\n },\n [\n () => P(c(ut).unitAmount, c(ut).currency)\n ]\n ), w(xt, me);\n }), m(Ye), w(Ae, Ye);\n }, yt = (Ae) => {\n var Ye = FC();\n w(Ae, Ye);\n };\n K(ct, (Ae) => {\n c(p).length > 0 ? Ae(vt) : Ae(yt, -1);\n });\n }\n m(He), m(ae), nr(oe, () => c(d), (Ae) => k(d, Ae)), _c(ee, () => c(f), (Ae) => k(f, Ae)), Tc(Rt, () => c(R), (Ae) => k(R, Ae)), w(re, ae);\n };\n K(ne, (re) => {\n c(g) ? re(X) : re(G, -1);\n });\n }\n var Y = x(ne, 2), se = v(Y), ue = v(se);\n Je(ue, {\n variant: \"default\",\n get onclick() {\n return s();\n },\n children: (re, ae) => {\n Pe();\n var ge = qe(\"Cancel\");\n w(re, ge);\n },\n $$slots: { default: !0 }\n });\n var le = x(ue, 2);\n return Je(le, {\n variant: \"primary\",\n onclick: q,\n get disabled() {\n return c(b);\n },\n children: (re, ae) => {\n Pe();\n var ge = qe();\n B(() => D(ge, c(b) ? \"Saving...\" : \"Save Product\")), w(re, ge);\n },\n $$slots: { default: !0 }\n }), m(se), m(Y), m(Q), B(() => D(te, n() ? \"New Product\" : \"Edit Product\")), w(r, Q), st(N);\n}\nhr([\"click\"]);\nrt($m, { productId: {}, isNew: {}, onClose: {} }, [], [], { mode: \"open\" });\nvar VC = S('<div class=\"loading svelte-1mf7mo0\">Loading products...</div>'), WC = S('<div class=\"error svelte-1mf7mo0\"> </div>'), UC = S('<p class=\"svelte-1mf7mo0\">No products match your search.</p>'), JC = S('<svg width=\"48\" height=\"48\" viewBox=\"0 0 16 16\" fill=\"currentColor\" opacity=\"0.3\"><path d=\"M8 1a2.5 2.5 0 0 1 2.5 2.5V4h-5v-.5A2.5 2.5 0 0 1 8 1zm3.5 3v-.5a3.5 3.5 0 1 0-7 0V4H1v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4h-3.5z\"></path></svg> <h3 class=\"svelte-1mf7mo0\">No products yet</h3> <p class=\"svelte-1mf7mo0\">Create your first product to get started.</p> <!>', 1), KC = S('<div class=\"empty-state svelte-1mf7mo0\"><!></div>'), GC = S('<div class=\"product-thumb svelte-1mf7mo0\"><!></div>'), YC = S('<div class=\"product-thumb placeholder svelte-1mf7mo0\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 16 16\" fill=\"currentColor\" opacity=\"0.5\"><path d=\"M8 1a2.5 2.5 0 0 1 2.5 2.5V4h-5v-.5A2.5 2.5 0 0 1 8 1zm3.5 3v-.5a3.5 3.5 0 1 0-7 0V4H1v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4h-3.5z\"></path></svg></div>'), XC = S('<span class=\"price svelte-1mf7mo0\"> </span>'), QC = S('<span class=\"no-price svelte-1mf7mo0\">-</span>'), ZC = S('<tr class=\"svelte-1mf7mo0\"><td class=\"list-item-item product-col svelte-1mf7mo0\"><div class=\"product-cell svelte-1mf7mo0\"><!> <div class=\"product-details svelte-1mf7mo0\"><button class=\"product-name btn-link svelte-1mf7mo0\"> </button></div></div></td><td class=\"list-item-item price-col svelte-1mf7mo0\"><!></td><td class=\"list-item-item svelte-1mf7mo0\"><span> </span></td><td class=\"list-item-item date-col svelte-1mf7mo0\"> </td><td class=\"list-item-item actions-col svelte-1mf7mo0\"><div class=\"actions svelte-1mf7mo0\"><!> <!> <!></div></td></tr>'), e_ = S('<div class=\"table-container svelte-1mf7mo0\"><table class=\"svelte-1mf7mo0\"><thead><tr><th class=\"list-heading-item svelte-1mf7mo0\">Product</th><th class=\"list-heading-item svelte-1mf7mo0\">Price</th><th class=\"list-heading-item svelte-1mf7mo0\">Status</th><th class=\"list-heading-item svelte-1mf7mo0\">Created</th><th class=\"list-heading-item svelte-1mf7mo0\">Actions</th></tr></thead><tbody class=\"svelte-1mf7mo0\"></tbody></table></div>'), t_ = S('<div class=\"modal-overlay svelte-1mf7mo0\" role=\"presentation\"><div class=\"modal-container svelte-1mf7mo0\" role=\"dialog\" aria-modal=\"true\" tabindex=\"-1\"><!></div></div>'), r_ = S('<div class=\"product-list svelte-1mf7mo0\"><div class=\"header svelte-1mf7mo0\"><div><h2 class=\"svelte-1mf7mo0\">Products</h2> <p class=\"subtitle svelte-1mf7mo0\"> </p></div> <div class=\"header-actions svelte-1mf7mo0\"><!></div></div> <div class=\"filters svelte-1mf7mo0\"><div class=\"filter-input svelte-1mf7mo0\"><!></div> <!></div> <!></div> <!>', 1);\nconst n_ = {\n hash: \"svelte-1mf7mo0\",\n code: `.product-list.svelte-1mf7mo0 {padding:0;max-width:100%;}.header.svelte-1mf7mo0 {display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--base-size-16, 1rem);gap:var(--base-size-16, 1rem);}h2.svelte-1mf7mo0 {margin:var(--stack-gap-normal, 1.5rem) 0 0;scroll-margin-top:var(--base-size-64, 4rem);line-height:var(--text-title-lineHeight-medium, 1.25);font-size:var(--text-title-size-medium, 1.5rem);font-weight:var(--base-text-weight-medium, 500);color:var(--fgColor-default);}.subtitle.svelte-1mf7mo0 {margin:0;font-size:var(--text-body-size-medium, 0.875rem);color:var(--fgColor-muted);}.header-actions.svelte-1mf7mo0 {display:flex;gap:0.5rem;}.filters.svelte-1mf7mo0 {display:flex;gap:var(--base-size-8, 0.5rem);margin-bottom:var(--base-size-16, 1rem);}.filter-input.svelte-1mf7mo0 {flex:1;max-width:300px;}.loading.svelte-1mf7mo0, .error.svelte-1mf7mo0 {padding:2rem;text-align:center;color:var(--fgColor-muted);}.error.svelte-1mf7mo0 {color:var(--fgColor-danger);}.empty-state.svelte-1mf7mo0 {text-align:center;padding:var(--base-size-64, 4rem) var(--base-size-16, 1rem);color:var(--fgColor-muted);display:flex;flex-direction:column;align-items:center;}.empty-state.svelte-1mf7mo0 h3:where(.svelte-1mf7mo0) {margin:1rem 0 0.5rem;font-size:1.125rem;font-weight:600;color:var(--fgColor-default);}.empty-state.svelte-1mf7mo0 p:where(.svelte-1mf7mo0) {margin:0 0 1.5rem;}.table-container.svelte-1mf7mo0 {overflow-x:auto;border:1px solid var(--borderColor-default);border-radius:0.375rem;}table.svelte-1mf7mo0 {width:100%;background-color:var(--bgColor-default);border-spacing:0;border-collapse:collapse;font-size:var(--text-body-size-medium, 0.875rem);table-layout:auto;}th.svelte-1mf7mo0 {color:var(--fgColor-muted);font-weight:var(--base-text-weight-semibold, 600);padding:0.75rem 1rem;text-align:left;background-color:var(--bgColor-muted);border-bottom:1px solid var(--borderColor-default);white-space:nowrap;}td.svelte-1mf7mo0 {padding:0.75rem 1rem;border-bottom:1px solid var(--borderColor-default);vertical-align:middle;}tr.svelte-1mf7mo0:last-child td:where(.svelte-1mf7mo0) {border-bottom:none;}tbody.svelte-1mf7mo0 tr:where(.svelte-1mf7mo0) {transition:background-color 150ms ease;}tbody.svelte-1mf7mo0 tr:where(.svelte-1mf7mo0):hover {background-color:var(--bgColor-muted);}.product-cell.svelte-1mf7mo0 {display:flex;align-items:center;gap:1rem;}.product-thumb.svelte-1mf7mo0 {width:40px;height:40px;border-radius:4px;overflow:hidden;background-color:var(--bgColor-muted);border:1px solid var(--borderColor-default);flex-shrink:0;}.product-thumb.placeholder.svelte-1mf7mo0 {display:flex;align-items:center;justify-content:center;}.product-details.svelte-1mf7mo0 {display:flex;flex-direction:column;gap:0.125rem;}.product-name.svelte-1mf7mo0 {font-weight:600;color:var(--fgColor-default);text-decoration:none;text-align:left;}.btn-link.svelte-1mf7mo0 {background:none;border:none;padding:0;cursor:pointer;}.product-name.svelte-1mf7mo0:hover {text-decoration:underline;color:var(--fgColor-accent);}.price-col.svelte-1mf7mo0 {white-space:nowrap;}.price.svelte-1mf7mo0 {font-weight:500;}.no-price.svelte-1mf7mo0 {color:var(--fgColor-muted);}.status-badge.svelte-1mf7mo0 {display:inline-block;padding:0.125rem 0.5rem;border-radius:var(--borderRadius-small, 0.25rem);font-size:0.75rem;font-weight:500;text-transform:capitalize;}.status-badge.active.svelte-1mf7mo0 {background-color:rgba(16, 185, 129, 0.1);color:rgb(16, 185, 129);}.status-badge.archived.svelte-1mf7mo0 {background-color:var(--bgColor-neutral-muted, rgba(175, 184, 193, 0.2));color:var(--fgColor-muted);}.date-col.svelte-1mf7mo0 {color:var(--fgColor-muted);white-space:nowrap;}.actions.svelte-1mf7mo0 {display:flex;gap:1rem;justify-content:flex-end;}\n\n\n\n\n\t/* Modal Styles */.modal-overlay.svelte-1mf7mo0 {position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0, 0, 0, 0.5);z-index:100;display:flex;justify-content:center;align-items:center;padding:2rem;backdrop-filter:blur(2px);}.modal-container.svelte-1mf7mo0 {background:var(--bgColor-default, #ffffff);width:100%;max-width:900px;max-height:90vh;display:flex;flex-direction:column;border-radius:0.5rem;box-shadow:0 4px 24px rgba(0, 0, 0, 0.15);padding:0;}`\n};\nfunction Im(r, e) {\n nt(e, !0), bt(r, n_);\n const t = Fa(), { shop: n, notifications: s } = t;\n let o = W(\"\"), i = W(\"active\"), a = W(!1), l = W(null);\n const d = [\n { id: \"active\", text: \"Active\" },\n { id: \"archived\", text: \"Archived\" },\n { id: \"all\", text: \"All Statuses\" }\n ], u = ie(() => d.find((X) => X.id === c(i)) || d[0]), f = ie(() => () => {\n let X = n.products;\n if (c(i) === \"active\" ? X = n.activeProducts : c(i) === \"archived\" && (X = X.filter((Y) => !Y.active)), !c(o).trim())\n return X;\n const G = c(o).toLowerCase().trim();\n return X.filter((Y) => {\n const se = Y.name.toLowerCase().includes(G), ue = Y.description?.toLowerCase().includes(G) ?? !1;\n return se || ue;\n });\n });\n function h(X, G = \"usd\") {\n return X === null ? \"N/A\" : new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: G.toUpperCase() }).format(X / 100);\n }\n function p(X) {\n return new Date(X).toLocaleDateString(\"en-US\", { month: \"short\", day: \"numeric\", year: \"numeric\" });\n }\n function g(X) {\n return X.prices.find((G) => G.active);\n }\n async function b(X) {\n try {\n await n.archiveProduct(X.id), s.success(`${X.name} has been archived`);\n } catch (G) {\n s.error(`Failed to archive product: ${G instanceof Error ? G.message : \"Unknown error\"}`);\n }\n }\n async function y(X) {\n try {\n await n.activateProduct(X.id), s.success(`${X.name} has been activated`);\n } catch (G) {\n s.error(`Failed to activate product: ${G instanceof Error ? G.message : \"Unknown error\"}`);\n }\n }\n async function C(X) {\n if (confirm(`Are you sure you want to delete \"${X.name}\"? This action cannot be undone.`))\n try {\n await n.deleteProduct(X.id), s.success(\"Product deleted successfully\");\n } catch (G) {\n const Y = G instanceof Error ? G.message : \"Unknown error\";\n Y.includes(\"archived\") ? (s.warning(Y), await n.fetchProducts()) : s.error(`Failed to delete product: ${Y}`);\n }\n }\n function E(X) {\n k(l, { id: X, isNew: !X }, !0);\n }\n function R() {\n k(l, null);\n }\n var q = r_(), O = ke(q), M = v(O), P = v(M), L = x(v(P), 2), $ = v(L);\n m(L), m(P);\n var J = x(P, 2), U = v(J);\n Je(U, {\n variant: \"primary\",\n onclick: () => E(),\n children: (X, G) => {\n Pe();\n var Y = qe(\"New Product\");\n w(X, Y);\n },\n $$slots: { default: !0 }\n }), m(J), m(M);\n var F = x(M, 2), z = v(F), _ = v(z);\n Qn(_, {\n placeholder: \"Filter products...\",\n block: !0,\n get value() {\n return c(o);\n },\n set value(X) {\n k(o, X, !0);\n }\n }), m(z);\n var N = x(z, 2);\n bs(N, {\n get items() {\n return d;\n },\n get selected() {\n return c(u);\n },\n placeholder: \"Active\",\n align: \"right\",\n onSelectedChange: (X) => {\n X && !Array.isArray(X) && k(i, X.id || \"active\", !0);\n },\n get open() {\n return c(a);\n },\n set open(X) {\n k(a, X, !0);\n }\n }), m(F);\n var Q = x(F, 2);\n {\n var T = (X) => {\n var G = VC();\n w(X, G);\n }, I = (X) => {\n var G = WC(), Y = v(G, !0);\n m(G), B(() => D(Y, n.productsLoading.error)), w(X, G);\n }, te = (X) => {\n var G = KC(), Y = v(G);\n {\n var se = (le) => {\n var re = UC();\n w(le, re);\n }, ue = (le) => {\n var re = JC(), ae = x(ke(re), 6);\n Je(ae, {\n variant: \"primary\",\n onclick: () => E(),\n children: (ge, Se) => {\n Pe();\n var _e = qe(\"Create Product\");\n w(ge, _e);\n },\n $$slots: { default: !0 }\n }), w(le, re);\n };\n K(Y, (le) => {\n c(o) || c(i) !== \"active\" ? le(se) : le(ue, -1);\n });\n }\n m(G), w(X, G);\n }, A = ie(() => c(f)().length === 0), V = (X) => {\n var G = e_(), Y = v(G), se = x(v(Y));\n tt(se, 21, () => c(f)(), pt, (ue, le) => {\n var re = ZC(), ae = v(re), ge = v(ae), Se = v(ge);\n {\n var _e = (ct) => {\n var vt = GC(), yt = v(vt);\n md(yt, {\n get src() {\n return c(le).images[0];\n },\n get alt() {\n return c(le).name;\n }\n }), m(vt), w(ct, vt);\n }, Re = (ct) => {\n var vt = YC();\n w(ct, vt);\n };\n K(Se, (ct) => {\n c(le).images.length > 0 ? ct(_e) : ct(Re, -1);\n });\n }\n var Ie = x(Se, 2), Fe = v(Ie), j = v(Fe, !0);\n m(Fe), m(Ie), m(ge), m(ae);\n var oe = x(ae), he = v(oe);\n {\n var Z = (ct) => {\n var vt = XC(), yt = v(vt, !0);\n m(vt), B((Ae) => D(yt, Ae), [\n () => h(g(c(le)).unitAmount, g(c(le)).currency)\n ]), w(ct, vt);\n }, pe = ie(() => g(c(le))), xe = (ct) => {\n var vt = QC();\n w(ct, vt);\n };\n K(he, (ct) => {\n c(pe) ? ct(Z) : ct(xe, -1);\n });\n }\n m(oe);\n var Be = x(oe), We = v(Be);\n let ee;\n var He = v(We, !0);\n m(We), m(Be);\n var ve = x(Be), Te = v(ve, !0);\n m(ve);\n var Me = x(ve), Xe = v(Me), mt = v(Xe);\n Je(mt, {\n size: \"small\",\n variant: \"invisible\",\n onclick: () => E(c(le).id),\n children: (ct, vt) => {\n Pe();\n var yt = qe(\"Edit\");\n w(ct, yt);\n },\n $$slots: { default: !0 }\n });\n var Et = x(mt, 2);\n {\n var Dt = (ct) => {\n Je(ct, {\n size: \"small\",\n variant: \"danger-invisible\",\n onclick: () => b(c(le)),\n children: (vt, yt) => {\n Pe();\n var Ae = qe(\"Archive\");\n w(vt, Ae);\n },\n $$slots: { default: !0 }\n });\n }, Rt = (ct) => {\n Je(ct, {\n size: \"small\",\n variant: \"invisible\",\n onclick: () => y(c(le)),\n children: (vt, yt) => {\n Pe();\n var Ae = qe(\"Activate\");\n w(vt, Ae);\n },\n $$slots: { default: !0 }\n });\n };\n K(Et, (ct) => {\n c(le).active ? ct(Dt) : ct(Rt, -1);\n });\n }\n var er = x(Et, 2);\n Je(er, {\n size: \"small\",\n variant: \"danger-invisible\",\n onclick: () => C(c(le)),\n children: (ct, vt) => {\n Pe();\n var yt = qe(\"Delete\");\n w(ct, yt);\n },\n $$slots: { default: !0 }\n }), m(Xe), m(Me), m(re), B(\n (ct) => {\n D(j, c(le).name), ee = Ne(We, 1, \"status-badge svelte-1mf7mo0\", null, ee, {\n active: c(le).active,\n archived: !c(le).active\n }), D(He, c(le).active ? \"Active\" : \"Archived\"), D(Te, ct);\n },\n [() => p(c(le).createdAt)]\n ), fe(\"click\", Fe, () => E(c(le).id)), w(ue, re);\n }), m(se), m(Y), m(G), w(X, G);\n };\n K(Q, (X) => {\n n.productsLoading.loading ? X(T) : n.productsLoading.error ? X(I, 1) : c(A) ? X(te, 2) : X(V, -1);\n });\n }\n m(O);\n var H = x(O, 2);\n {\n var ne = (X) => {\n var G = t_(), Y = v(G), se = v(Y);\n $m(se, {\n get productId() {\n return c(l).id;\n },\n get isNew() {\n return c(l).isNew;\n },\n onClose: R\n }), m(Y), m(G), fe(\"click\", G, R), fe(\"click\", Y, (ue) => ue.stopPropagation()), fe(\"keydown\", Y, (ue) => ue.stopPropagation()), w(X, G);\n };\n K(H, (X) => {\n c(l) && X(ne);\n });\n }\n B(() => D($, `${n.activeProducts.length ?? \"\"} active product${n.activeProducts.length !== 1 ? \"s\" : \"\"}`)), w(r, q), st();\n}\nhr([\"click\", \"keydown\"]);\nrt(Im, {}, [], [], { mode: \"open\" });\nvar s_ = S('<div class=\"loading svelte-u4ynvd\">Loading orders...</div>'), o_ = S('<div class=\"empty-state svelte-u4ynvd\">No orders found.</div>'), i_ = S('<div class=\"muted svelte-u4ynvd\"> </div>'), a_ = S('<div class=\"muted svelte-u4ynvd\"> </div>'), l_ = S('<tr><td class=\"svelte-u4ynvd\"> </td><td class=\"svelte-u4ynvd\"><div> </div> <div class=\"muted svelte-u4ynvd\"> </div> <!></td><td class=\"svelte-u4ynvd\"><div> </div> <!></td><td class=\"svelte-u4ynvd\"> </td><td class=\"svelte-u4ynvd\"> </td><td class=\"svelte-u4ynvd\"><span class=\"status-badge svelte-u4ynvd\"> </span></td><td class=\"svelte-u4ynvd\"> </td><td class=\"svelte-u4ynvd\"><div class=\"actions svelte-u4ynvd\"><!> <!> <!></div></td></tr>'), c_ = S('<div class=\"table-container svelte-u4ynvd\"><table class=\"svelte-u4ynvd\"><thead><tr><th class=\"svelte-u4ynvd\">Order</th><th class=\"svelte-u4ynvd\">Customer</th><th class=\"svelte-u4ynvd\">Shipping</th><th class=\"svelte-u4ynvd\">Total</th><th class=\"svelte-u4ynvd\">Payment</th><th class=\"svelte-u4ynvd\">Status</th><th class=\"svelte-u4ynvd\">Created</th><th class=\"svelte-u4ynvd\">Actions</th></tr></thead><tbody></tbody></table></div>'), d_ = S('<section class=\"orders-view\"><div class=\"header svelte-u4ynvd\"><div><h2 class=\"svelte-u4ynvd\">Orders</h2> <p class=\"subtitle svelte-u4ynvd\"> </p></div> <select aria-label=\"Filter orders by status\" class=\"svelte-u4ynvd\"><option>All</option><option>Pending</option><option>Approved</option><option>Successful</option><option>Aborted</option><option>Failed</option></select></div> <!></section>');\nconst u_ = {\n hash: \"svelte-u4ynvd\",\n code: `.header.svelte-u4ynvd {display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem;}h2.svelte-u4ynvd {margin:1.5rem 0 0;font-size:1.5rem;font-weight:500;}.subtitle.svelte-u4ynvd {margin:0;color:var(--fgColor-muted);font-size:0.875rem;}select.svelte-u4ynvd {height:2rem;border:1px solid var(--borderColor-default);border-radius:0.375rem;background:var(--bgColor-default);color:inherit;}.table-container.svelte-u4ynvd {overflow-x:auto;border:1px solid var(--borderColor-default);border-radius:0.375rem;}table.svelte-u4ynvd {width:100%;border-collapse:collapse;font-size:0.875rem;}th.svelte-u4ynvd,\n\ttd.svelte-u4ynvd {padding:0.75rem 1rem;border-bottom:1px solid var(--borderColor-default);text-align:left;vertical-align:middle;}th.svelte-u4ynvd {background:var(--bgColor-muted);color:var(--fgColor-muted);font-weight:600;}.actions.svelte-u4ynvd {display:flex;gap:0.5rem;align-items:center;}.status-badge.svelte-u4ynvd {text-transform:capitalize;font-size:0.75rem;padding:0.125rem 0.5rem;border-radius:0.25rem;background:var(--bgColor-neutral-muted, rgba(175, 184, 193, 0.2));}.muted.svelte-u4ynvd {margin-top:0.25rem;color:var(--fgColor-muted);font-size:0.75rem;line-height:1.35;}.loading.svelte-u4ynvd,\n\t.empty-state.svelte-u4ynvd {padding:2rem;color:var(--fgColor-muted);}`\n};\nfunction zm(r, e) {\n nt(e, !0), bt(r, u_);\n const { shop: t, notifications: n } = Fa();\n let s = W(!1), o = W(\"all\");\n const i = ie(() => c(o) === \"all\" ? t.orders : t.orders.filter((z) => z.status === c(o)));\n Ar(async () => {\n k(s, !0);\n try {\n await t.fetchOrders();\n } catch {\n n.error(\"Failed to load orders\");\n } finally {\n k(s, !1);\n }\n });\n function a(z, _) {\n return new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: _.toUpperCase() }).format(z / 100);\n }\n function l(z) {\n return new Date(z).toLocaleString();\n }\n function d(z) {\n const _ = z.customer.shippingAddress;\n return _ ? [\n _.line1,\n _.line2,\n `${_.postalCode} ${_.city}`,\n _.country\n ].filter(Boolean).join(\", \") : z.customer.address || \"\";\n }\n async function u(z, _) {\n try {\n await t.updateOrderStatus(z.id, _), n.success(`Order ${z.orderNumber} updated`);\n } catch (N) {\n n.error(N instanceof Error ? N.message : \"Failed to update order\");\n }\n }\n async function f(z) {\n try {\n if (!(await fetch(`/api/shop/admin/orders/${z.id}/send-invoice`, { method: \"POST\" })).ok) throw new Error(\"Failed to send invoice\");\n await t.fetchOrders(), n.success(`Invoice sent for ${z.orderNumber}`);\n } catch (_) {\n n.error(_ instanceof Error ? _.message : \"Failed to send invoice\");\n }\n }\n async function h(z) {\n try {\n if (!(await fetch(`/api/shop/admin/orders/${z.id}/confirm-payment`, { method: \"POST\" })).ok) throw new Error(\"Failed to confirm payment\");\n await t.fetchOrders(), n.success(`Payment confirmed for ${z.orderNumber} \u2014 confirmation email sent`);\n } catch (_) {\n n.error(_ instanceof Error ? _.message : \"Failed to confirm payment\");\n }\n }\n var p = d_(), g = v(p), b = v(g), y = x(v(b), 2), C = v(y);\n m(y), m(b);\n var E = x(b, 2), R = v(E);\n R.value = R.__value = \"all\";\n var q = x(R);\n q.value = q.__value = \"pending\";\n var O = x(q);\n O.value = O.__value = \"approved\";\n var M = x(O);\n M.value = M.__value = \"successful\";\n var P = x(M);\n P.value = P.__value = \"aborted\";\n var L = x(P);\n L.value = L.__value = \"failed\", m(E), m(g);\n var $ = x(g, 2);\n {\n var J = (z) => {\n var _ = s_();\n w(z, _);\n }, U = (z) => {\n var _ = o_();\n w(z, _);\n }, F = (z) => {\n var _ = c_(), N = v(_), Q = x(v(N));\n tt(Q, 21, () => c(i), pt, (T, I) => {\n var te = l_(), A = v(te), V = v(A, !0);\n m(A);\n var H = x(A), ne = v(H), X = v(ne, !0);\n m(ne);\n var G = x(ne, 2), Y = v(G, !0);\n m(G);\n var se = x(G, 2);\n {\n var ue = (Me) => {\n var Xe = i_(), mt = v(Xe, !0);\n m(Xe), B(() => D(mt, c(I).customer.phone)), w(Me, Xe);\n };\n K(se, (Me) => {\n c(I).customer.phone && Me(ue);\n });\n }\n m(H);\n var le = x(H), re = v(le), ae = v(re, !0);\n m(re);\n var ge = x(re, 2);\n {\n var Se = (Me) => {\n var Xe = a_(), mt = v(Xe, !0);\n m(Xe), B((Et) => D(mt, Et), [() => d(c(I))]), w(Me, Xe);\n }, _e = ie(() => d(c(I)));\n K(ge, (Me) => {\n c(_e) && Me(Se);\n });\n }\n m(le);\n var Re = x(le), Ie = v(Re, !0);\n m(Re);\n var Fe = x(Re), j = v(Fe, !0);\n m(Fe);\n var oe = x(Fe), he = v(oe), Z = v(he, !0);\n m(he), m(oe);\n var pe = x(oe), xe = v(pe, !0);\n m(pe);\n var Be = x(pe), We = v(Be), ee = v(We);\n {\n var He = (Me) => {\n var Xe = lt(), mt = ke(Xe);\n {\n var Et = (Rt) => {\n Je(Rt, {\n size: \"small\",\n variant: \"primary\",\n onclick: () => h(c(I)),\n children: (er, ct) => {\n Pe();\n var vt = qe(\"Mark Paid\");\n w(er, vt);\n },\n $$slots: { default: !0 }\n });\n }, Dt = (Rt) => {\n Je(Rt, {\n size: \"small\",\n onclick: () => u(c(I), \"successful\"),\n children: (er, ct) => {\n Pe();\n var vt = qe(\"Mark Successful\");\n w(er, vt);\n },\n $$slots: { default: !0 }\n });\n };\n K(mt, (Rt) => {\n c(I).paymentMethod === \"bank_transfer\" ? Rt(Et) : Rt(Dt, -1);\n });\n }\n w(Me, Xe);\n };\n K(ee, (Me) => {\n c(I).status !== \"successful\" && Me(He);\n });\n }\n var ve = x(ee, 2);\n Je(ve, {\n size: \"small\",\n onclick: () => f(c(I)),\n children: (Me, Xe) => {\n Pe();\n var mt = qe(\"Resend Invoice\");\n w(Me, mt);\n },\n $$slots: { default: !0 }\n });\n var Te = x(ve, 2);\n {\n let Me = ie(() => `/api/shop/admin/orders/${c(I).id}/invoice`);\n Je(Te, {\n size: \"small\",\n get href() {\n return c(Me);\n },\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: (Xe, mt) => {\n Pe();\n var Et = qe(\"PDF\");\n w(Xe, Et);\n },\n $$slots: { default: !0 }\n });\n }\n m(We), m(Be), m(te), B(\n (Me, Xe, mt) => {\n D(V, c(I).orderNumber), D(X, c(I).customer.name || c(I).customer.email), D(Y, c(I).customer.email), D(ae, c(I).customer.shippingAddress ? c(I).totals.shipping > 0 ? \"Shipping\" : \"Free Shipping\" : \"No shipping\"), D(Ie, Me), D(j, Xe), D(Z, c(I).status), D(xe, mt);\n },\n [\n () => a(c(I).totals.total, c(I).totals.currency),\n () => c(I).paymentMethod.replace(\"_\", \" \"),\n () => l(c(I).createdAt)\n ]\n ), w(T, te);\n }), m(Q), m(N), m(_), w(z, _);\n };\n K($, (z) => {\n c(s) ? z(J) : c(i).length === 0 ? z(U, 1) : z(F, -1);\n });\n }\n m(p), B(() => D(C, `${t.orders.length ?? \"\"} order${t.orders.length !== 1 ? \"s\" : \"\"}`)), Tc(E, () => c(o), (z) => k(o, z)), w(r, p), st();\n}\nrt(zm, {}, [], [], { mode: \"open\" });\nvar f_ = S('<button type=\"button\" class=\"btn primary save-btn svelte-1pzn9py\">Save <div class=\"btn-notification svelte-1pzn9py\"> </div></button>'), p_ = S('<div><span class=\"svelte-1pzn9py\"> </span> <button type=\"button\" class=\"notification-close svelte-1pzn9py\" aria-label=\"Close notification\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" class=\"svelte-1pzn9py\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" class=\"svelte-1pzn9py\"></path><path d=\"M18 6l-12 12\" class=\"svelte-1pzn9py\"></path><path d=\"M6 6l12 12\" class=\"svelte-1pzn9py\"></path></svg></button></div>'), h_ = S('<section class=\"module-settings-section svelte-1pzn9py\"><div class=\"section-heading svelte-1pzn9py\"><div class=\"svelte-1pzn9py\"><h1 class=\"svelte-1pzn9py\"> </h1> <p class=\"svelte-1pzn9py\"> </p></div> <!></div> <div class=\"module-settings-host svelte-1pzn9py\"><!></div></section>'), m_ = S('<nav class=\"shop-tabs svelte-1pzn9py\" aria-label=\"Shop sections\"><a href=\"#shop/products\">Products</a> <a href=\"#shop/orders\">Orders</a> <a href=\"#shop/settings\">Settings</a></nav> <!>', 1), v_ = S('<div class=\"loading-state svelte-1pzn9py\"><span class=\"loading-spinner svelte-1pzn9py\"></span> <span class=\"svelte-1pzn9py\">Loading...</span></div>'), g_ = S('<div class=\"shop-root svelte-1pzn9py\"><!> <div class=\"shop-content svelte-1pzn9py\"><main class=\"svelte-1pzn9py\"><div class=\"notifications-container svelte-1pzn9py\"></div> <div class=\"main-content svelte-1pzn9py\"><!></div></main></div> <!></div>');\nconst b_ = {\n hash: \"svelte-1pzn9py\",\n code: `.shop-root.svelte-1pzn9py :where(.svelte-1pzn9py),\n\t.shop-root.svelte-1pzn9py :where(.svelte-1pzn9py)::before,\n\t.shop-root.svelte-1pzn9py :where(.svelte-1pzn9py)::after {box-sizing:border-box;}.shop-root.svelte-1pzn9py {font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;color:var(--fgColor-default);display:flex;flex-direction:column;min-height:100vh;background-color:var(--bgColor-default);}.shop-content.svelte-1pzn9py {display:flex;flex-direction:row;flex:1;min-height:0;}main.svelte-1pzn9py {min-width:0px;width:100%;overflow-x:hidden;}.main-content.svelte-1pzn9py {padding:0 2rem;display:flex;flex-direction:column;min-height:0;}.shop-tabs.svelte-1pzn9py {display:flex;gap:1rem;border-bottom:1px solid var(--borderColor-default);margin-top:1rem;}.shop-tabs.svelte-1pzn9py a:where(.svelte-1pzn9py) {padding:0.75rem 0;color:var(--fgColor-muted);text-decoration:none;font-size:0.875rem;border-bottom:2px solid transparent;}.shop-tabs.svelte-1pzn9py a.active:where(.svelte-1pzn9py) {color:var(--fgColor-default);border-bottom-color:var(--fgColor-accent);}.module-settings-section.svelte-1pzn9py {display:grid;gap:1rem;padding:1rem 0;}.section-heading.svelte-1pzn9py {display:flex;gap:0.25rem;justify-content:space-between;align-items:flex-start;}.section-heading.svelte-1pzn9py h1:where(.svelte-1pzn9py) {margin:0;font-size:1.5rem;line-height:1.25;}.section-heading.svelte-1pzn9py p:where(.svelte-1pzn9py) {margin:0;color:var(--fgColor-muted);}.module-settings-host.svelte-1pzn9py {border:1px solid var(--borderColor-default);border-radius:8px;overflow:visible;}.notifications-container.svelte-1pzn9py {min-height:calc(2rem + 2px + 1rem);overflow:hidden;}.notification-banner.svelte-1pzn9py {background-color:#ddf4ff;border:1px solid #54aeff66;border-top:none;border-left:none;border-right:none;padding:1rem 2rem;margin-bottom:1rem;display:flex;justify-content:space-between;align-items:center;font-size:0.875rem;box-shadow:0 1px 3px rgba(31, 35, 40, 0.12);word-wrap:break-word;overflow-wrap:break-word;}.notification-banner.danger.svelte-1pzn9py {background-color:#fde8e8;border-color:#ff4d4d66;}.notification-banner.success.svelte-1pzn9py {background-color:#e6f9e6;border-color:#00b30066;}.notification-banner.warning.svelte-1pzn9py {background-color:#fff7e6;border-color:#ff9f0066;}.notification-close.svelte-1pzn9py {background:none;border:none;padding:0.25rem;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:0.25rem;}.notification-close.svelte-1pzn9py:hover {background-color:rgba(0, 0, 0, 0.1);}.notification-close.svelte-1pzn9py:focus-visible {outline:2px solid currentColor;outline-offset:2px;}.loading-state.svelte-1pzn9py {display:flex;align-items:center;gap:0.75rem;padding:2rem 0;color:var(--fgColor-muted);}.loading-spinner.svelte-1pzn9py {width:1rem;height:1rem;border:2px solid var(--borderColor-default);border-top-color:var(--fgColor-accent);border-radius:50%;\n\t\tanimation: svelte-1pzn9py-spin 0.8s linear infinite;}\n\n\t@keyframes svelte-1pzn9py-spin {\n\t\tto {\n\t\t\ttransform: rotate(360deg);\n\t\t}\n\t}`\n};\nfunction Rm(r, e) {\n nt(e, !0), bt(r, b_);\n let t = ce(e, \"route\", 7, \"\"), n = ce(e, \"availableModules\", 23, () => []), s = ce(e, \"onSettings\", 7);\n const o = Fa(), { shop: i, notifications: a } = o, { repoFiles: l } = yn();\n function d() {\n const z = l.getFileContent(ms.path);\n if (!z) return {};\n try {\n return JSON.parse(z);\n } catch {\n return {};\n }\n }\n function u(z) {\n l.writeFile(ms.path, JSON.stringify(z, null, 2), {\n source: ms.source,\n label: `Update ${ms.label.toLowerCase()} settings`\n });\n }\n const f = ie(() => {\n const z = t().split(\"/\").filter(Boolean);\n if (z.length === 0)\n return { location: \"products\", recordId: void 0 };\n const _ = z[0], N = z[1];\n return { location: _, recordId: N };\n }), h = ie(() => c(f).location), p = ie(() => c(f).recordId);\n kr(() => {\n o.location = c(h), o.productId = c(p);\n });\n let g = W(!1), b = W(!1);\n const y = ie(() => l.changeSets.length);\n Ar(async () => {\n await i.initialize(), k(g, !0);\n });\n var C = {\n get route() {\n return t();\n },\n set route(z = \"\") {\n t(z), de();\n },\n get availableModules() {\n return n();\n },\n set availableModules(z = []) {\n n(z), de();\n },\n get onSettings() {\n return s();\n },\n set onSettings(z) {\n s(z), de();\n }\n }, E = g_(), R = v(E);\n Oo(R, {\n get modules() {\n return n();\n },\n currentModule: \"shop\",\n get onSettings() {\n return s();\n },\n children: (z, _) => {\n var N = lt(), Q = ke(N);\n {\n var T = (I) => {\n var te = f_(), A = x(v(te)), V = v(A, !0);\n m(A), m(te), B(() => D(V, c(y))), fe(\"click\", te, () => k(b, !0)), w(I, te);\n };\n K(Q, (I) => {\n c(y) > 0 && I(T);\n });\n }\n w(z, N);\n },\n $$slots: { default: !0 }\n });\n var q = x(R, 2), O = v(q), M = v(O);\n tt(M, 21, () => a.notifications, pt, (z, _) => {\n var N = p_();\n let Q;\n var T = v(N), I = v(T, !0);\n m(T);\n var te = x(T, 2);\n m(N), B(() => {\n Q = Ne(N, 1, \"notification-banner svelte-1pzn9py\", null, Q, {\n danger: c(_).type === \"danger\",\n success: c(_).type === \"success\",\n warning: c(_).type === \"warning\"\n }), D(I, c(_).message);\n }), fe(\"click\", te, () => a.removeNotification(c(_).id)), Ca(2, N, () => Ac, () => ({ duration: 1500 })), w(z, N);\n }), m(M);\n var P = x(M, 2), L = v(P);\n {\n var $ = (z) => {\n var _ = m_(), N = ke(_), Q = v(N);\n let T;\n var I = x(Q, 2);\n let te;\n var A = x(I, 2);\n let V;\n m(N);\n var H = x(N, 2);\n {\n var ne = (Y) => {\n var se = h_(), ue = v(se), le = v(ue), re = v(le), ae = v(re, !0);\n m(re);\n var ge = x(re, 2), Se = v(ge, !0);\n m(ge), m(le);\n var _e = x(le, 2);\n {\n var Re = (j) => {\n Je(j, {\n variant: \"primary\",\n onclick: () => k(b, !0),\n children: (oe, he) => {\n Pe();\n var Z = qe(\"Save\");\n w(oe, Z);\n },\n $$slots: { default: !0 }\n });\n };\n K(_e, (j) => {\n c(y) > 0 && j(Re);\n });\n }\n m(ue);\n var Ie = x(ue, 2), Fe = v(Ie);\n {\n let j = ie(d);\n Da(Fe, {\n get file() {\n return ms;\n },\n get value() {\n return c(j);\n },\n onChange: (oe) => u(oe)\n });\n }\n m(Ie), m(se), B(() => {\n D(ae, ms.label), D(Se, ms.description);\n }), w(Y, se);\n }, X = (Y) => {\n zm(Y, {});\n }, G = (Y) => {\n Im(Y, {});\n };\n K(H, (Y) => {\n c(h) === \"settings\" ? Y(ne) : c(h) === \"orders\" ? Y(X, 1) : Y(G, -1);\n });\n }\n B(() => {\n T = Ne(Q, 1, \"svelte-1pzn9py\", null, T, { active: c(h) === \"products\" }), te = Ne(I, 1, \"svelte-1pzn9py\", null, te, { active: c(h) === \"orders\" }), V = Ne(A, 1, \"svelte-1pzn9py\", null, V, { active: c(h) === \"settings\" });\n }), w(z, _);\n }, J = (z) => {\n var _ = v_();\n w(z, _);\n };\n K(L, (z) => {\n c(g) ? z($) : z(J, -1);\n });\n }\n m(P), m(O), m(q);\n var U = x(q, 2);\n {\n var F = (z) => {\n ni(z, {\n get open() {\n return c(b);\n },\n onClose: () => k(b, !1)\n });\n };\n K(U, (z) => {\n c(b) && z(F);\n });\n }\n return m(E), w(r, E), st(C);\n}\nhr([\"click\"]);\ncustomElements.define(\"hintergrund-shop\", rt(Rm, { route: {}, availableModules: {}, onSettings: {} }, [], []));\nconst jm = \"frontend/.hintergrund-template.json\", y_ = 64 * 1024 * 1024, x_ = 500;\nclass Lm extends Error {\n constructor(e) {\n super(`Changing templates will replace ${e.length} customized file${e.length === 1 ? \"\" : \"s\"}.`), this.paths = e, this.name = \"TemplateCustomizationError\";\n }\n}\nasync function w_() {\n const r = await fetch(\"/api/admin/website/templates\");\n if (!r.ok) throw new Error(\"Could not load website templates\");\n const e = await r.json();\n if (!Array.isArray(e.templates)) throw new Error(\"Template catalogue is invalid\");\n return e;\n}\nfunction Dm(r, e) {\n return `/api/admin/website/templates/${encodeURIComponent(r.id)}/${encodeURIComponent(r.version)}/files/${e.split(\"/\").map(encodeURIComponent).join(\"/\")}`;\n}\nasync function k_(r) {\n const e = await fetch(`/api/admin/website/templates/${encodeURIComponent(r.id)}/${encodeURIComponent(r.version)}/manifest`);\n if (!e.ok) throw new Error(`Could not load the ${r.name} template`);\n const t = await e.json();\n if (t.id !== r.id || t.version !== r.version || !Array.isArray(t.files))\n throw new Error(\"Template manifest is invalid\");\n if (t.files.length > x_ || t.files.reduce((n, s) => n + s.size, 0) > y_)\n throw new Error(\"Template exceeds the supported size\");\n for (const n of t.files) C_(n);\n return t;\n}\nfunction C_(r) {\n if (!r.path.startsWith(\"frontend/\") || r.path.includes(\"..\") || r.path.includes(\"\\\\\") || r.path.includes(\"\\0\"))\n throw new Error(`Template contains an invalid path: ${r.path}`);\n if (r.encoding !== \"utf8\" && r.encoding !== \"base64\") throw new Error(`Template contains an invalid encoding: ${r.path}`);\n if (!/^[a-f0-9]{64}$/.test(r.sha256) || !Number.isSafeInteger(r.size) || r.size < 0)\n throw new Error(`Template contains invalid file metadata: ${r.path}`);\n}\nasync function hc(r) {\n const e = await crypto.subtle.digest(\"SHA-256\", Uint8Array.from(r).buffer);\n return [...new Uint8Array(e)].map((t) => t.toString(16).padStart(2, \"0\")).join(\"\");\n}\nfunction __(r) {\n let e = \"\";\n for (let n = 0; n < r.length; n += 32768)\n e += String.fromCharCode(...r.subarray(n, n + 32768));\n return btoa(e);\n}\nfunction S_(r) {\n const e = atob(r);\n return Uint8Array.from(e, (t) => t.charCodeAt(0));\n}\nfunction E_(r) {\n const e = r.split(\".\").pop()?.toLowerCase();\n return {\n jpg: \"image/jpeg\",\n jpeg: \"image/jpeg\",\n png: \"image/png\",\n gif: \"image/gif\",\n svg: \"image/svg+xml\",\n webp: \"image/webp\",\n ico: \"image/x-icon\",\n avif: \"image/avif\"\n }[e ?? \"\"] ?? \"application/octet-stream\";\n}\nasync function T_(r, e) {\n const t = await fetch(Dm(r, e.path));\n if (!t.ok) throw new Error(`Could not download ${e.path}`);\n const n = new Uint8Array(await t.arrayBuffer());\n if (n.byteLength !== e.size || await hc(n) !== e.sha256) throw new Error(`Template integrity check failed for ${e.path}`);\n return { file: e, bytes: n };\n}\nasync function M_(r, e) {\n const t = [];\n let n = 0;\n const s = Array.from({ length: Math.min(6, e.length) }, async () => {\n for (; n < e.length; ) {\n const o = n++;\n t[o] = await T_(r, e[o]);\n }\n });\n return await Promise.all(s), t;\n}\nfunction Fm(r) {\n try {\n const e = JSON.parse(r.getFileContent(jm) ?? \"null\");\n return e?.templateId && e.templateVersion && e.managedFiles && typeof e.managedFiles == \"object\" ? e : null;\n } catch {\n return null;\n }\n}\nasync function A_(r, e) {\n const t = [];\n for (const [n, s] of Object.entries(e.managedFiles)) {\n const o = r.getFileContent(n);\n if (o !== null) {\n await hc(new TextEncoder().encode(o)) !== s && t.push(n);\n continue;\n }\n const i = r.staticAssets.find((a) => a.path === n);\n i?.content && await hc(S_(i.content)) !== s && t.push(n);\n }\n return t;\n}\nasync function P_(r, e, t = {}) {\n if (r.isDirty) throw new Error(\"Save or discard your current changes before changing templates.\");\n const n = await k_(e), s = Fm(r);\n if (s && !t.force) {\n const f = await A_(r, s);\n if (f.length > 0) throw new Lm(f);\n }\n const o = await M_(e, n.files), i = r.beginChangeSet(\"builder\", `Apply ${e.name} template`), a = new Set(n.files.map((f) => f.path));\n for (const f of Object.keys(s?.managedFiles ?? {}))\n a.has(f) || r.removePath(f, { changeSetId: i, source: \"builder\" });\n for (const { file: f, bytes: h } of o)\n if (f.encoding === \"utf8\")\n r.writeFile(f.path, new TextDecoder().decode(h), { changeSetId: i, source: \"builder\" });\n else {\n const p = {\n name: f.path.split(\"/\").pop(),\n path: f.path,\n content: __(h),\n mimeType: E_(f.path)\n };\n r.writeAsset(p, { changeSetId: i, source: \"builder\" });\n }\n const l = Date.now(), d = {\n templateId: e.id,\n templateVersion: e.version,\n appliedAt: l,\n managedFiles: Object.fromEntries(n.files.map((f) => [f.path, f.sha256]))\n };\n r.writeFile(jm, JSON.stringify(d, null, 2), { changeSetId: i, source: \"builder\" });\n let u;\n try {\n u = Sl(JSON.parse(r.getFileContent(Pi) ?? \"{}\"));\n } catch {\n u = Sl({});\n }\n r.writeFile(Pi, JSON.stringify({\n ...u,\n complete: !0,\n template: { id: e.id, version: e.version },\n updatedAt: l\n }, null, 2), { changeSetId: i, source: \"builder\" }), r.refreshPreview(\"Website template applied\");\n}\nfunction N_(r) {\n const e = Fm(r);\n return e ? { id: e.templateId, version: e.templateVersion } : null;\n}\nvar O_ = S('<div class=\"state svelte-ad84ik\">Loading templates\u2026</div>'), $_ = S('<div class=\"state error svelte-ad84ik\" role=\"alert\"><p> </p> <!></div>'), I_ = S('<img alt=\"\" loading=\"lazy\" class=\"svelte-ad84ik\"/>'), z_ = S('<span class=\"preview-placeholder svelte-ad84ik\">Aa</span>'), R_ = S('<span class=\"current-badge svelte-ad84ik\">Current</span>'), j_ = S('<button type=\"button\" role=\"radio\"><span class=\"card-preview svelte-ad84ik\"><!> <!></span> <span class=\"card-copy svelte-ad84ik\"><strong class=\"svelte-ad84ik\"> </strong> <span class=\"svelte-ad84ik\"> </span></span></button>'), L_ = S('<p class=\"error svelte-ad84ik\" role=\"alert\"> </p>'), D_ = S('<span class=\"svelte-ad84ik\">Save or discard the current staged changes first.</span>'), F_ = S('<div class=\"template-grid svelte-ad84ik\" role=\"radiogroup\" aria-label=\"Website templates\"></div> <section class=\"apply-panel svelte-ad84ik\"><div><strong> </strong> <p class=\"svelte-ad84ik\">All template files will be loaded into IndexedDB as unsaved changes. The preview, Content editor, and Chat builder use those staged files immediately; nothing is published until you click Save.</p></div> <!> <div class=\"actions svelte-ad84ik\"><!> <!></div></section>', 1), B_ = S('<div class=\"setup svelte-ad84ik\"><header class=\"setup-intro svelte-ad84ik\"><h1 class=\"svelte-ad84ik\"> </h1> <p class=\"svelte-ad84ik\">Selecting a template stages its complete frontend\u2014including content, products, components, styles, and assets\u2014in your local workspace. Runtime configuration and secrets stay untouched.</p></header> <!></div>');\nconst H_ = {\n hash: \"svelte-ad84ik\",\n code: `.setup.svelte-ad84ik {display:flex;flex-direction:column;gap:1.5rem;height:100%;overflow-y:auto;padding:2rem 1.5rem 4rem;}.setup-intro.svelte-ad84ik h1:where(.svelte-ad84ik) {margin:0 0 0.5rem;font-size:1.5rem;}.setup-intro.svelte-ad84ik p:where(.svelte-ad84ik) {max-width:680px;margin:0;color:var(--fgColor-muted);line-height:1.5;}.template-grid.svelte-ad84ik {display:grid;grid-template-columns:repeat(auto-fill, minmax(230px, 1fr));gap:1rem;}.template-card.svelte-ad84ik {display:flex;flex-direction:column;min-width:0;padding:0;overflow:hidden;border:2px solid var(--borderColor-default);border-radius:0.75rem;background:var(--bgColor-default);color:var(--fgColor-default);text-align:left;cursor:pointer;}.template-card.svelte-ad84ik:hover,\n\t.template-card.selected.svelte-ad84ik {border-color:var(--fgColor-accent);}.template-card.selected.svelte-ad84ik {box-shadow:0 0 0 3px color-mix(in srgb, var(--fgColor-accent) 22%, transparent);}.card-preview.svelte-ad84ik {position:relative;display:block;width:100%;aspect-ratio:16 / 10;overflow:hidden;background:var(--bgColor-muted);border-bottom:1px solid var(--borderColor-muted);}.card-preview.svelte-ad84ik img:where(.svelte-ad84ik) {width:100%;height:100%;object-fit:cover;}.preview-placeholder.svelte-ad84ik {display:grid;place-items:center;height:100%;font-size:2.5rem;font-weight:700;}.current-badge.svelte-ad84ik {position:absolute;top:0.625rem;right:0.625rem;padding:0.2rem 0.5rem;border-radius:999px;background:var(--bgColor-success-emphasis, #1f883d);color:white;font-size:0.7rem;font-weight:700;}.card-copy.svelte-ad84ik {display:grid;gap:0.3rem;padding:0.875rem 1rem 1rem;}.card-copy.svelte-ad84ik strong:where(.svelte-ad84ik) {font-size:0.95rem;}.card-copy.svelte-ad84ik span:where(.svelte-ad84ik) {color:var(--fgColor-muted);font-size:0.8rem;line-height:1.4;}.apply-panel.svelte-ad84ik {display:grid;gap:1rem;max-width:700px;padding:1rem;border:1px solid var(--borderColor-default);border-radius:0.75rem;background:var(--bgColor-muted);}.apply-panel.svelte-ad84ik p:where(.svelte-ad84ik) {margin:0.25rem 0 0;color:var(--fgColor-muted);font-size:0.875rem;}.actions.svelte-ad84ik {display:flex;align-items:center;flex-wrap:wrap;gap:0.75rem;}.actions.svelte-ad84ik span:where(.svelte-ad84ik) {color:var(--fgColor-muted);font-size:0.8rem;}.state.svelte-ad84ik {padding:2rem;color:var(--fgColor-muted);text-align:center;}.error.svelte-ad84ik {color:var(--fgColor-danger) !important;}`\n};\nfunction vd(r, e) {\n nt(e, !0), bt(r, H_);\n const { repoFiles: t, notifications: n } = yn();\n let s = W(ft([])), o = W(null), i = W(!0), a = W(!1), l = W(\"\");\n const d = ie(() => N_(t)), u = ie(() => c(s).find((O) => O.id === c(o)) ?? null);\n Ar(() => {\n f();\n });\n async function f() {\n k(i, !0), k(l, \"\");\n try {\n const O = await w_();\n k(s, O.templates, !0), k(o, c(d)?.id ?? c(s)[0]?.id ?? null, !0);\n } catch (O) {\n k(l, O instanceof Error ? O.message : \"Could not load website templates\", !0);\n } finally {\n k(i, !1);\n }\n }\n async function h(O = !1) {\n if (!(!c(u) || c(a))) {\n k(a, !0), k(l, \"\");\n try {\n await P_(t, c(u), { force: O }), n.success(`${c(u).name} is staged. Edit it with Content or Chat, then click Save to publish everything together.`), window.location.hash = \"#website/templates\";\n } catch (M) {\n if (M instanceof Lm) {\n if (confirm(`${M.message}\n\nThe previous version remains available in Git history. Continue?`)) {\n k(a, !1), await h(!0);\n return;\n }\n } else\n k(l, M instanceof Error ? M.message : \"Could not apply the template\", !0);\n } finally {\n k(a, !1);\n }\n }\n }\n var p = B_(), g = v(p), b = v(g), y = v(b, !0);\n m(b), Pe(2), m(g);\n var C = x(g, 2);\n {\n var E = (O) => {\n var M = O_();\n w(O, M);\n }, R = (O) => {\n var M = $_(), P = v(M), L = v(P, !0);\n m(P);\n var $ = x(P, 2);\n Je($, {\n onclick: () => {\n f();\n },\n children: (J, U) => {\n Pe();\n var F = qe(\"Try again\");\n w(J, F);\n },\n $$slots: { default: !0 }\n }), m(M), B(() => D(L, c(l))), w(O, M);\n }, q = (O) => {\n var M = F_(), P = ke(M);\n tt(P, 21, () => c(s), (I) => I.id, (I, te) => {\n var A = j_();\n let V;\n var H = v(A), ne = v(H);\n {\n var X = (Se) => {\n var _e = I_();\n B((Re) => Ge(_e, \"src\", Re), [\n () => Dm(c(te), c(te).thumbnailPath)\n ]), w(Se, _e);\n }, G = (Se) => {\n var _e = z_();\n w(Se, _e);\n };\n K(ne, (Se) => {\n c(te).thumbnailPath ? Se(X) : Se(G, -1);\n });\n }\n var Y = x(ne, 2);\n {\n var se = (Se) => {\n var _e = R_();\n w(Se, _e);\n };\n K(Y, (Se) => {\n c(d)?.id === c(te).id && Se(se);\n });\n }\n m(H);\n var ue = x(H, 2), le = v(ue), re = v(le, !0);\n m(le);\n var ae = x(le, 2), ge = v(ae, !0);\n m(ae), m(ue), m(A), B(() => {\n V = Ne(A, 1, \"template-card svelte-ad84ik\", null, V, { selected: c(o) === c(te).id }), Ge(A, \"aria-checked\", c(o) === c(te).id), D(re, c(te).name), D(ge, c(te).description);\n }), fe(\"click\", A, () => k(o, c(te).id, !0)), w(I, A);\n }), m(P);\n var L = x(P, 2), $ = v(L), J = v($), U = v(J, !0);\n m(J), Pe(2), m($);\n var F = x($, 2);\n {\n var z = (I) => {\n var te = L_(), A = v(te, !0);\n m(te), B(() => D(A, c(l))), w(I, te);\n };\n K(F, (I) => {\n c(l) && I(z);\n });\n }\n var _ = x(F, 2), N = v(_);\n {\n let I = ie(() => !c(u) || c(a) || t.isDirty);\n Je(N, {\n variant: \"primary\",\n get disabled() {\n return c(I);\n },\n onclick: () => {\n h();\n },\n children: (te, A) => {\n Pe();\n var V = qe();\n B(() => D(V, c(a) ? \"Loading template\u2026\" : c(d)?.id === c(u)?.id ? \"Reapply template\" : \"Apply template\")), w(te, V);\n },\n $$slots: { default: !0 }\n });\n }\n var Q = x(N, 2);\n {\n var T = (I) => {\n var te = D_();\n w(I, te);\n };\n K(Q, (I) => {\n t.isDirty && I(T);\n });\n }\n m(_), m(L), B(() => D(U, c(u)?.name ?? \"Select a template\")), w(O, M);\n };\n K(C, (O) => {\n c(i) ? O(E) : c(l) && c(s).length === 0 ? O(R, 1) : O(q, -1);\n });\n }\n m(p), B(() => D(y, c(d) ? \"Change website template\" : \"Choose a website template\")), w(r, p), st();\n}\nhr([\"click\"]);\nrt(vd, {}, [], [], { mode: \"open\" });\nvar q_ = S('<button type=\"button\"> </button>'), V_ = S('<div class=\"flash danger\"> </div>'), W_ = S('<div class=\"flash success\"> </div>'), U_ = S('<section class=\"section module-settings-section svelte-rmsj8h\"><div class=\"section-heading svelte-rmsj8h\"><div><h1 class=\"svelte-rmsj8h\"> </h1> <p class=\"svelte-rmsj8h\"> </p></div> <!></div> <div class=\"module-settings-host svelte-rmsj8h\"><!></div></section>'), J_ = S('<p class=\"svelte-rmsj8h\">Loading GitHub secrets...</p>'), K_ = S('<div class=\"secret-row svelte-rmsj8h\"><span class=\"svelte-rmsj8h\"><strong> </strong><small class=\"svelte-rmsj8h\"> </small></span> <!></div>'), G_ = S('<div class=\"secret-list svelte-rmsj8h\"></div>'), Y_ = S('<section class=\"section svelte-rmsj8h\"><h1 class=\"svelte-rmsj8h\">Integrations</h1> <div class=\"status-grid svelte-rmsj8h\"><div class=\"svelte-rmsj8h\"><span>Stripe publishable key</span><strong> </strong></div> <div class=\"svelte-rmsj8h\"><span>Stripe secret key</span><strong> </strong></div> <div class=\"svelte-rmsj8h\"><span>Stripe webhook secret</span><strong> </strong></div> <div class=\"svelte-rmsj8h\"><span>Email provider API key</span><strong> </strong></div> <div class=\"svelte-rmsj8h\"><span>Gemini API key (platform)</span><strong> </strong></div></div> <div class=\"github-secrets-form svelte-rmsj8h\"><div><h2 class=\"svelte-rmsj8h\">GitHub Actions secrets</h2> <p class=\"svelte-rmsj8h\">Values are stored in GitHub and synchronized to Cloudflare during deployment. Supported names: API_KEY, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, SECRET, APP_PRIVATE_KEY, and SETUP_TOKEN.</p></div> <form class=\"secret-form svelte-rmsj8h\"><input class=\"form-control\" placeholder=\"SECRET_NAME\" aria-label=\"GitHub Actions secret name\"/> <input class=\"form-control\" type=\"password\" placeholder=\"Secret value\" aria-label=\"GitHub Actions secret value\"/> <label class=\"deploy-option svelte-rmsj8h\"><input type=\"checkbox\"/> Deploy after saving</label> <!></form> <!></div> <div class=\"gemini-key-form svelte-rmsj8h\"><label class=\"gemini-key-label svelte-rmsj8h\" for=\"userGeminiKey\">Your Gemini API key</label> <p class=\"gemini-key-hint svelte-rmsj8h\">Stored only in this browser. Overrides the platform key for AI features.</p> <div class=\"gemini-key-row svelte-rmsj8h\"><input type=\"password\" id=\"userGeminiKey\" placeholder=\"AIzaSy...\" class=\"form-control\"/> <!> <!></div></div></section>'), X_ = S('<div class=\"field full svelte-rmsj8h\"><!></div>'), Q_ = S('<p class=\"svelte-rmsj8h\">Loading users...</p>'), Z_ = S('<div class=\"user-row svelte-rmsj8h\"><div class=\"user-meta svelte-rmsj8h\"><strong> </strong> <span class=\"svelte-rmsj8h\"> <!></span></div> <div class=\"row-actions svelte-rmsj8h\"><!> <!></div></div>'), eS = S('<div class=\"users svelte-rmsj8h\"></div>'), tS = S('<section class=\"section svelte-rmsj8h\"><div class=\"section-heading svelte-rmsj8h\"><h1 class=\"svelte-rmsj8h\">Admins</h1></div> <form class=\"create-form svelte-rmsj8h\"><div class=\"field svelte-rmsj8h\"><!></div> <div class=\"field svelte-rmsj8h\"><!></div> <div class=\"field svelte-rmsj8h\"><!></div> <!> <div class=\"full submit-row svelte-rmsj8h\"><!></div></form> <!></section>'), rS = S('<div class=\"settings-root svelte-rmsj8h\"><div class=\"main-content svelte-rmsj8h\"><nav class=\"tabs svelte-rmsj8h\" aria-label=\"Admin settings sections\"><!> <button type=\"button\">Admins</button> <button type=\"button\">Integrations</button></nav> <!> <!> <!></div> <!></div>');\nconst nS = {\n hash: \"svelte-rmsj8h\",\n code: `.settings-root.svelte-rmsj8h {color:var(--fgColor-default, #24292f);font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;}.main-content.svelte-rmsj8h {max-width:1120px;margin:0 auto;}.tabs.svelte-rmsj8h {display:flex;gap:1rem;border-bottom:1px solid var(--borderColor-default, #d0d7de);margin:0 0 1.5rem;overflow-x:auto;}.tabs.svelte-rmsj8h button:where(.svelte-rmsj8h) {padding:0.75rem 0;color:var(--fgColor-muted, #57606a);background:none;border:none;border-bottom:2px solid transparent;cursor:pointer;font-size:0.875rem;white-space:nowrap;}.tabs.svelte-rmsj8h button.active:where(.svelte-rmsj8h) {color:var(--fgColor-default, #24292f);border-bottom-color:var(--fgColor-accent, #0969da);}.section.svelte-rmsj8h {display:grid;gap:1rem;}.section-heading.svelte-rmsj8h {display:flex;gap:0.25rem;justify-content:space-between;align-items:flex-start;}.module-settings-section.svelte-rmsj8h {min-height:0;}.module-settings-host.svelte-rmsj8h {border:1px solid var(--borderColor-default, #d0d7de);border-radius:8px;overflow:visible;}h1.svelte-rmsj8h,\n\tp.svelte-rmsj8h {margin:0;}h1.svelte-rmsj8h {font-size:1.5rem;line-height:1.25;}p.svelte-rmsj8h,\n\t.user-row.svelte-rmsj8h span:where(.svelte-rmsj8h) {color:var(--fgColor-muted, #57606a);}.create-form.svelte-rmsj8h,\n\t.user-row.svelte-rmsj8h,\n\t.status-grid.svelte-rmsj8h div:where(.svelte-rmsj8h) {display:grid;gap:0.75rem;padding:1rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:8px;}.create-form.svelte-rmsj8h {grid-template-columns:repeat(3, minmax(0, 1fr));align-items:start;}.create-form.svelte-rmsj8h .full:where(.svelte-rmsj8h) {grid-column:1 / -1;}.field.svelte-rmsj8h {display:flex;}.submit-row.svelte-rmsj8h {display:flex;justify-content:flex-end;}.users.svelte-rmsj8h,\n\t.status-grid.svelte-rmsj8h {display:grid;gap:0.75rem;}.status-grid.svelte-rmsj8h {grid-template-columns:repeat(2, minmax(0, 1fr));}.status-grid.svelte-rmsj8h div:where(.svelte-rmsj8h) {gap:0.25rem;}.github-secrets-form.svelte-rmsj8h,\n\t.gemini-key-form.svelte-rmsj8h {display:grid;gap:0.5rem;padding:1rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:8px;}.github-secrets-form.svelte-rmsj8h h2:where(.svelte-rmsj8h) {margin:0;font-size:1rem;}.secret-form.svelte-rmsj8h {display:grid;grid-template-columns:minmax(150px, 0.8fr) minmax(200px, 1.5fr) auto auto;gap:0.5rem;align-items:center;}.deploy-option.svelte-rmsj8h {display:flex;gap:0.35rem;align-items:center;font-size:0.8rem;white-space:nowrap;}.secret-list.svelte-rmsj8h {display:grid;gap:0.5rem;}.secret-row.svelte-rmsj8h {display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:0.75rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:6px;}.secret-row.svelte-rmsj8h span:where(.svelte-rmsj8h) {display:grid;gap:0.2rem;}.secret-row.svelte-rmsj8h small:where(.svelte-rmsj8h) {color:var(--fgColor-muted, #57606a);}.gemini-key-label.svelte-rmsj8h {font-size:0.875rem;font-weight:600;}.gemini-key-hint.svelte-rmsj8h {font-size:0.75rem;color:var(--fgColor-muted, #57606a);}.gemini-key-row.svelte-rmsj8h {display:flex;gap:0.5rem;align-items:center;}.gemini-key-row.svelte-rmsj8h .form-control {flex:1;}.user-row.svelte-rmsj8h {grid-template-columns:1fr auto;align-items:center;}.user-meta.svelte-rmsj8h {display:grid;gap:0.25rem;}.row-actions.svelte-rmsj8h {display:flex;flex-wrap:wrap;gap:0.5rem;align-items:center;}\n\n\t@media (max-width: 860px) {.create-form.svelte-rmsj8h,\n\t\t.user-row.svelte-rmsj8h,\n\t\t.status-grid.svelte-rmsj8h,\n\t\t.secret-form.svelte-rmsj8h {grid-template-columns:1fr;}\n\t}`\n};\nfunction Bm(r, e) {\n nt(e, !0), bt(r, nS);\n let t = ce(e, \"config\", 7), n = ce(e, \"settingsFiles\", 23, () => []);\n const { repoFiles: s } = yn(), o = [\"users\", \"integrations\"], i = \"module:\", a = ie(() => [\n ...n().map((ve) => `${i}${ve.id}`),\n ...o\n ]);\n let l = W(\"users\");\n kr(() => {\n c(a).includes(c(l)) || k(l, c(a)[0] ?? \"users\", !0);\n });\n const d = ie(() => c(l).startsWith(i) ? n().find((ve) => `${i}${ve.id}` === c(l)) : void 0), u = [\n { id: \"otp\", text: \"Email code\" },\n { id: \"password\", text: \"Password\" }\n ];\n let f = W(ft([])), h = W(!1), p = W(!1), g = W(\"\"), b = W(\"\"), y = W(\"\"), C = W(\"\"), E = W(\"\"), R = W(\"otp\"), q = W(!1);\n const O = ie(() => u.find((ve) => ve.id === c(R)));\n Ar(async () => {\n await Promise.all([M(), F()]);\n }), Ar(() => {\n if (typeof window > \"u\") return;\n const ve = () => {\n const [, Te] = window.location.hash.match(/^#settings\\/([^/]+)/) ?? [];\n if (!Te) return;\n const Me = `${i}${Te}`;\n c(a).includes(Me) ? k(l, Me) : c(a).includes(Te) && k(l, Te, !0);\n };\n return ve(), window.addEventListener(\"hashchange\", ve), () => window.removeEventListener(\"hashchange\", ve);\n });\n async function M() {\n k(h, !0), k(g, \"\");\n try {\n const ve = await fetch(\"/api/admin/users\");\n if (!ve.ok) {\n const Me = await ve.json().catch(() => ({}));\n throw new Error(Me.error || \"Failed to load admin users\");\n }\n const Te = await ve.json();\n k(f, Te.users, !0);\n } catch (ve) {\n k(g, ve instanceof Error ? ve.message : \"Failed to load admin users\", !0);\n } finally {\n k(h, !1);\n }\n }\n let P = W(ft([])), L = W(!1), $ = W(\"\"), J = W(\"\"), U = W(!0);\n async function F() {\n k(L, !0);\n try {\n const ve = await fetch(\"/api/admin/github/secrets\");\n if (!ve.ok) {\n const Me = await ve.json().catch(() => ({}));\n throw new Error(Me.error || \"Failed to load GitHub secrets\");\n }\n const Te = await ve.json();\n k(P, Te.secrets.sort((Me, Xe) => Me.name.localeCompare(Xe.name)), !0);\n } catch (ve) {\n k(g, ve instanceof Error ? ve.message : \"Failed to load GitHub secrets\", !0);\n } finally {\n k(L, !1);\n }\n }\n async function z() {\n const ve = c($).trim().toUpperCase();\n if (!ve || !c(J)) {\n k(g, \"Enter a secret name and value.\");\n return;\n }\n k(p, !0), k(g, \"\"), k(b, \"\");\n try {\n const Te = await fetch(`/api/admin/github/secrets/${encodeURIComponent(ve)}`, {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n value: c(J),\n deploy: c(U)\n })\n });\n if (!Te.ok) {\n const Xe = await Te.json().catch(() => ({}));\n throw new Error(Xe.error || \"Failed to save GitHub secret\");\n }\n const Me = await Te.json().catch(() => ({}));\n k(J, \"\"), k(\n b,\n Me.deploymentStarted ? \"Secret saved and deployment started.\" : \"Secret saved.\",\n !0\n ), await F();\n } catch (Te) {\n k(g, Te instanceof Error ? Te.message : \"Failed to save GitHub secret\", !0);\n } finally {\n k(p, !1);\n }\n }\n async function _(ve) {\n if (confirm(`Delete GitHub Actions secret ${ve.name}?`)) {\n k(p, !0), k(g, \"\"), k(b, \"\");\n try {\n const Te = await fetch(`/api/admin/github/secrets/${encodeURIComponent(ve.name)}`, { method: \"DELETE\" });\n if (!Te.ok) {\n const Xe = await Te.json().catch(() => ({}));\n throw new Error(Xe.error || \"Failed to delete GitHub secret\");\n }\n const Me = await Te.json().catch(() => ({}));\n k(\n b,\n Me.deploymentStarted ? \"Secret deleted and deployment started.\" : \"Secret deleted.\",\n !0\n ), await F();\n } catch (Te) {\n k(g, Te instanceof Error ? Te.message : \"Failed to delete GitHub secret\", !0);\n } finally {\n k(p, !1);\n }\n }\n }\n async function N() {\n k(p, !0), k(g, \"\"), k(b, \"\");\n try {\n const ve = await fetch(\"/api/admin/users\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n email: c(y),\n name: c(C) || void 0,\n password: c(E) || void 0,\n loginMethod: c(R)\n })\n });\n if (!ve.ok) {\n const Te = await ve.json().catch(() => ({}));\n throw new Error(Te.error || \"Failed to create admin user\");\n }\n k(y, \"\"), k(C, \"\"), k(E, \"\"), k(R, \"otp\"), k(b, \"Admin user created\"), await M();\n } catch (ve) {\n k(g, ve instanceof Error ? ve.message : \"Failed to create admin user\", !0);\n } finally {\n k(p, !1);\n }\n }\n async function Q(ve, Te) {\n k(p, !0), k(g, \"\"), k(b, \"\");\n try {\n const Me = await fetch(`/api/admin/users/${ve.id}`, {\n method: \"PATCH\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(Te)\n });\n if (!Me.ok) {\n const Xe = await Me.json().catch(() => ({}));\n throw new Error(Xe.error || \"Failed to update admin user\");\n }\n k(b, \"Admin user updated\"), await M();\n } catch (Me) {\n k(g, Me instanceof Error ? Me.message : \"Failed to update admin user\", !0);\n } finally {\n k(p, !1);\n }\n }\n async function T(ve) {\n if (confirm(`Delete admin user ${ve.email}?`)) {\n k(p, !0), k(g, \"\"), k(b, \"\");\n try {\n const Te = await fetch(`/api/admin/users/${ve.id}`, { method: \"DELETE\" });\n if (!Te.ok) {\n const Me = await Te.json().catch(() => ({}));\n throw new Error(Me.error || \"Failed to delete admin user\");\n }\n k(b, \"Admin user deleted\"), await M();\n } catch (Te) {\n k(g, Te instanceof Error ? Te.message : \"Failed to delete admin user\", !0);\n } finally {\n k(p, !1);\n }\n }\n }\n function I(ve) {\n return ve ? \"Configured\" : \"Not configured\";\n }\n const te = ie(() => t().integrations), A = \"hintergrund_user_gemini_api_key\";\n let V = W(ft(typeof localStorage < \"u\" ? localStorage.getItem(A) ?? \"\" : \"\")), H = W(!1), ne = W(!1);\n const X = ie(() => s.changeSets.length);\n function G() {\n localStorage.setItem(A, c(V).trim()), k(H, !0), setTimeout(() => k(H, !1), 2e3);\n }\n function Y() {\n localStorage.removeItem(A), k(V, \"\");\n }\n function se(ve) {\n const Te = s.getFileContent(ve.path);\n if (!Te) return {};\n try {\n return JSON.parse(Te);\n } catch {\n return {};\n }\n }\n function ue(ve, Te) {\n s.writeFile(ve.path, JSON.stringify(Te, null, 2), {\n source: ve.source,\n label: `Update ${ve.label.toLowerCase()} settings`\n });\n }\n var le = {\n get config() {\n return t();\n },\n set config(ve) {\n t(ve), de();\n },\n get settingsFiles() {\n return n();\n },\n set settingsFiles(ve = []) {\n n(ve), de();\n }\n }, re = rS(), ae = v(re), ge = v(ae), Se = v(ge);\n tt(Se, 17, n, pt, (ve, Te) => {\n var Me = q_();\n let Xe;\n var mt = v(Me, !0);\n m(Me), B(() => {\n Xe = Ne(Me, 1, \"svelte-rmsj8h\", null, Xe, {\n active: c(l) === `${i}${c(Te).id}`\n }), D(mt, c(Te).label);\n }), fe(\"click\", Me, () => k(l, `${i}${c(Te).id}`)), w(ve, Me);\n });\n var _e = x(Se, 2);\n let Re;\n var Ie = x(_e, 2);\n let Fe;\n m(ge);\n var j = x(ge, 2);\n {\n var oe = (ve) => {\n var Te = V_(), Me = v(Te, !0);\n m(Te), B(() => D(Me, c(g))), w(ve, Te);\n };\n K(j, (ve) => {\n c(g) && ve(oe);\n });\n }\n var he = x(j, 2);\n {\n var Z = (ve) => {\n var Te = W_(), Me = v(Te, !0);\n m(Te), B(() => D(Me, c(b))), w(ve, Te);\n };\n K(he, (ve) => {\n c(b) && ve(Z);\n });\n }\n var pe = x(he, 2);\n {\n var xe = (ve) => {\n var Te = U_(), Me = v(Te), Xe = v(Me), mt = v(Xe), Et = v(mt, !0);\n m(mt);\n var Dt = x(mt, 2), Rt = v(Dt, !0);\n m(Dt), m(Xe);\n var er = x(Xe, 2);\n {\n var ct = (Ae) => {\n Je(Ae, {\n variant: \"primary\",\n onclick: () => k(ne, !0),\n children: (Ye, xt) => {\n Pe();\n var ut = qe(\"Save\");\n w(Ye, ut);\n },\n $$slots: { default: !0 }\n });\n };\n K(er, (Ae) => {\n c(X) > 0 && Ae(ct);\n });\n }\n m(Me);\n var vt = x(Me, 2), yt = v(vt);\n {\n let Ae = ie(() => se(c(d)));\n Da(yt, {\n get file() {\n return c(d);\n },\n get value() {\n return c(Ae);\n },\n onChange: (Ye) => ue(c(d), Ye)\n });\n }\n m(vt), m(Te), B(() => {\n D(Et, c(d).label), D(Rt, c(d).description);\n }), w(ve, Te);\n }, Be = (ve) => {\n var Te = Y_(), Me = x(v(Te), 2), Xe = v(Me), mt = x(v(Xe)), Et = v(mt, !0);\n m(mt), m(Xe);\n var Dt = x(Xe, 2), Rt = x(v(Dt)), er = v(Rt, !0);\n m(Rt), m(Dt);\n var ct = x(Dt, 2), vt = x(v(ct)), yt = v(vt, !0);\n m(vt), m(ct);\n var Ae = x(ct, 2), Ye = x(v(Ae)), xt = v(Ye, !0);\n m(Ye), m(Ae);\n var ut = x(Ae, 2), me = x(v(ut)), we = v(me, !0);\n m(me), m(ut), m(Me);\n var Ee = x(Me, 2), je = x(v(Ee), 2), ze = v(je);\n Ut(ze);\n var Ve = x(ze, 2);\n Ut(Ve);\n var it = x(Ve, 2), _t = v(it);\n Ut(_t), Pe(), m(it);\n var Qe = x(it, 2);\n Je(Qe, {\n type: \"submit\",\n variant: \"primary\",\n get disabled() {\n return c(p);\n },\n children: (dt, Nt) => {\n Pe();\n var Mt = qe(\"Save secret\");\n w(dt, Mt);\n },\n $$slots: { default: !0 }\n }), m(je);\n var sr = x(je, 2);\n {\n var vr = (dt) => {\n var Nt = J_();\n w(dt, Nt);\n }, $t = (dt) => {\n var Nt = G_();\n tt(Nt, 21, () => c(P), (Mt) => Mt.name, (Mt, jt) => {\n var Xt = K_(), Lt = v(Xt), Bt = v(Lt), qt = v(Bt, !0);\n m(Bt);\n var gr = x(Bt), Sr = v(gr);\n m(gr), m(Lt);\n var tn = x(Lt, 2);\n {\n var Mr = (dr) => {\n Je(dr, {\n variant: \"danger\",\n get disabled() {\n return c(p);\n },\n onclick: () => _(c(jt)),\n children: (ur, Ot) => {\n Pe();\n var Pt = qe(\"Delete\");\n w(ur, Pt);\n },\n $$slots: { default: !0 }\n });\n }, rn = ie(() => [\"API_KEY\", \"STRIPE_SECRET_KEY\", \"STRIPE_WEBHOOK_SECRET\"].includes(c(jt).name));\n K(tn, (dr) => {\n c(rn) && dr(Mr);\n });\n }\n m(Xt), B(\n (dr) => {\n D(qt, c(jt).name), D(Sr, `Updated ${dr ?? \"\"}`);\n },\n [() => new Date(c(jt).updatedAt).toLocaleString()]\n ), w(Mt, Xt);\n }), m(Nt), w(dt, Nt);\n };\n K(sr, (dt) => {\n c(L) ? dt(vr) : c(P).length > 0 && dt($t, 1);\n });\n }\n m(Ee);\n var At = x(Ee, 2), wt = x(v(At), 4), Ft = v(wt);\n Ut(Ft);\n var Yt = x(Ft, 2);\n Je(Yt, {\n variant: \"primary\",\n onclick: G,\n get disabled() {\n return c(H);\n },\n children: (dt, Nt) => {\n Pe();\n var Mt = qe();\n B(() => D(Mt, c(H) ? \"Saved\" : \"Save\")), w(dt, Mt);\n },\n $$slots: { default: !0 }\n });\n var or = x(Yt, 2);\n {\n var cr = (dt) => {\n Je(dt, {\n onclick: Y,\n children: (Nt, Mt) => {\n Pe();\n var jt = qe(\"Clear\");\n w(Nt, jt);\n },\n $$slots: { default: !0 }\n });\n };\n K(or, (dt) => {\n c(V) && dt(cr);\n });\n }\n m(wt), m(At), m(Te), B(\n (dt, Nt, Mt, jt, Xt) => {\n D(Et, dt), D(er, Nt), D(yt, Mt), D(xt, jt), D(we, Xt);\n },\n [\n () => I(c(te)?.stripePublishableKeySet),\n () => I(c(te)?.stripeSecretKeySet),\n () => I(c(te)?.stripeWebhookSecretSet),\n () => I(c(te)?.emailProviderApiKeySet),\n () => I(c(te)?.geminiApiKeySet)\n ]\n ), jn(\"submit\", je, (dt) => {\n dt.preventDefault(), z();\n }), nr(ze, () => c($), (dt) => k($, dt)), nr(Ve, () => c(J), (dt) => k(J, dt)), _c(_t, () => c(U), (dt) => k(U, dt)), nr(Ft, () => c(V), (dt) => k(V, dt)), w(ve, Te);\n }, We = (ve) => {\n var Te = tS(), Me = x(v(Te), 2), Xe = v(Me), mt = v(Xe);\n Qn(mt, {\n placeholder: \"email@example.com\",\n block: !0,\n ariaLabel: \"Email\",\n get value() {\n return c(y);\n },\n set value(me) {\n k(y, me, !0);\n }\n }), m(Xe);\n var Et = x(Xe, 2), Dt = v(Et);\n Qn(Dt, {\n placeholder: \"Name\",\n block: !0,\n ariaLabel: \"Name\",\n get value() {\n return c(C);\n },\n set value(me) {\n k(C, me, !0);\n }\n }), m(Et);\n var Rt = x(Et, 2), er = v(Rt);\n bs(er, {\n get items() {\n return u;\n },\n get selected() {\n return c(O);\n },\n onSelectedChange: (me) => {\n me && !Array.isArray(me) && k(R, me.id, !0);\n },\n get open() {\n return c(q);\n },\n set open(me) {\n k(q, me, !0);\n }\n }), m(Rt);\n var ct = x(Rt, 2);\n {\n var vt = (me) => {\n var we = X_(), Ee = v(we);\n Qn(Ee, {\n placeholder: \"Password\",\n block: !0,\n ariaLabel: \"Password\",\n get value() {\n return c(E);\n },\n set value(je) {\n k(E, je, !0);\n }\n }), m(we), w(me, we);\n };\n K(ct, (me) => {\n c(R) === \"password\" && me(vt);\n });\n }\n var yt = x(ct, 2), Ae = v(yt);\n Je(Ae, {\n type: \"submit\",\n variant: \"primary\",\n get disabled() {\n return c(p);\n },\n children: (me, we) => {\n Pe();\n var Ee = qe(\"Add user\");\n w(me, Ee);\n },\n $$slots: { default: !0 }\n }), m(yt), m(Me);\n var Ye = x(Me, 2);\n {\n var xt = (me) => {\n var we = Q_();\n w(me, we);\n }, ut = (me) => {\n var we = eS();\n tt(we, 21, () => c(f), (Ee) => Ee.id, (Ee, je) => {\n var ze = Z_(), Ve = v(ze), it = v(Ve), _t = v(it, !0);\n m(it);\n var Qe = x(it, 2), sr = v(Qe), vr = x(sr);\n {\n var $t = (or) => {\n var cr = qe(\"\u00B7 original owner\");\n w(or, cr);\n };\n K(vr, (or) => {\n c(je).isFirst && or($t);\n });\n }\n m(Qe), m(Ve);\n var At = x(Ve, 2), wt = v(At);\n {\n let or = ie(() => c(p) || c(je).isFirst);\n Je(wt, {\n get disabled() {\n return c(or);\n },\n onclick: () => Q(c(je), { disabled: !c(je).disabledAt }),\n children: (cr, dt) => {\n Pe();\n var Nt = qe();\n B(() => D(Nt, c(je).disabledAt ? \"Enable\" : \"Disable\")), w(cr, Nt);\n },\n $$slots: { default: !0 }\n });\n }\n var Ft = x(wt, 2);\n {\n var Yt = (or) => {\n Je(or, {\n variant: \"danger\",\n get disabled() {\n return c(p);\n },\n onclick: () => T(c(je)),\n children: (cr, dt) => {\n Pe();\n var Nt = qe(\"Delete\");\n w(cr, Nt);\n },\n $$slots: { default: !0 }\n });\n };\n K(Ft, (or) => {\n c(je).isFirst || or(Yt);\n });\n }\n m(At), m(ze), B(() => {\n D(_t, c(je).email), D(sr, `${(c(je).name || \"No name\") ?? \"\"} \u00B7 ${c(je).loginMethod ?? \"\"} `);\n }), w(Ee, ze);\n }), m(we), w(me, we);\n };\n K(Ye, (me) => {\n c(h) ? me(xt) : me(ut, -1);\n });\n }\n m(Te), jn(\"submit\", Me, (me) => {\n me.preventDefault(), N();\n }), w(ve, Te);\n };\n K(pe, (ve) => {\n c(d) ? ve(xe) : c(l) === \"integrations\" ? ve(Be, 1) : ve(We, -1);\n });\n }\n m(ae);\n var ee = x(ae, 2);\n {\n var He = (ve) => {\n ni(ve, {\n get open() {\n return c(ne);\n },\n onClose: () => k(ne, !1)\n });\n };\n K(ee, (ve) => {\n c(ne) && ve(He);\n });\n }\n return m(re), B(() => {\n Re = Ne(_e, 1, \"svelte-rmsj8h\", null, Re, { active: c(l) === \"users\" }), Fe = Ne(Ie, 1, \"svelte-rmsj8h\", null, Fe, { active: c(l) === \"integrations\" });\n }), fe(\"click\", _e, () => k(l, \"users\")), fe(\"click\", Ie, () => k(l, \"integrations\")), w(r, re), st(le);\n}\nhr([\"click\"]);\nrt(Bm, { config: {}, settingsFiles: {} }, [], [], { mode: \"open\" });\nconst sS = [\"home\", \"index\", \"page_home\", \"page_index\", \"landing\"];\nfunction Hm(r) {\n if (!r) return null;\n for (const t of sS)\n if (r[t]) return t;\n return Object.entries(r).find(([, t]) => t.category === \"page\" || !t.isCollection)?.[0] ?? null;\n}\nfunction mc(r) {\n const e = Hm(r);\n return e ? `/${e}` : \"\";\n}\nconst oS = /* @__PURE__ */ Symbol(\"repl\");\nfunction iS() {\n return wa(oS);\n}\nvar aS = S(\"<div><!></div>\");\nconst lS = {\n hash: \"svelte-k93cma\",\n code: \".message.svelte-k93cma {position:relative;color:white;padding:12px 16px 12px 44px;font:var(--sk-font-ui-small);margin:0;border-top:1px solid var(--sk-border);}.message.svelte-k93cma::before {content:'!';position:absolute;left:12px;top:10px;text-align:center;line-height:1;padding:4px;border-radius:50%;color:white;border:2px solid white;box-sizing:content-box;width:10px;height:10px;font-size:11px;font-weight:700;}.truncate.svelte-k93cma {white-space:pre;overflow-x:hidden;text-overflow:ellipsis;}.error.svelte-k93cma {background-color:#da106e;}.info.svelte-k93cma {background-color:var(--sk-fg-4);}\"\n};\nfunction qm(r, e) {\n nt(e, !0), bt(r, lS);\n let t = ce(e, \"kind\", 7, \"info\"), n = ce(e, \"details\", 7, void 0), s = ce(e, \"filename\", 7, void 0), o = ce(e, \"truncate\", 7, !1), i = ce(e, \"children\", 7);\n function a(g) {\n let b = g.message || \"[missing message]\", y = [];\n return g.filename && g.filename !== s() && y.push(g.filename), g.start && y.push(g.start.line, g.start.column), b + (y.length ? ` (${y.join(\":\")})` : \"\");\n }\n var l = {\n get kind() {\n return t();\n },\n set kind(g = \"info\") {\n t(g), de();\n },\n get details() {\n return n();\n },\n set details(g = void 0) {\n n(g), de();\n },\n get filename() {\n return s();\n },\n set filename(g = void 0) {\n s(g), de();\n },\n get truncate() {\n return o();\n },\n set truncate(g = !1) {\n o(g), de();\n },\n get children() {\n return i();\n },\n set children(g) {\n i(g), de();\n }\n }, d = aS();\n let u;\n var f = v(d);\n {\n var h = (g) => {\n var b = qe();\n B((y) => D(b, y), [() => a(n())]), w(g, b);\n }, p = (g) => {\n var b = lt(), y = ke(b);\n Ws(y, () => i() ?? Kr), w(g, b);\n };\n K(f, (g) => {\n n() ? g(h) : g(p, -1);\n });\n }\n return m(d), B(() => u = Ne(d, 1, \"message svelte-k93cma\", null, u, {\n info: t() === \"info\",\n error: t() === \"error\",\n truncate: o()\n })), Ca(3, d, () => Pg, () => ({ duration: 100 })), w(r, d), st(l);\n}\nrt(\n qm,\n {\n kind: {},\n details: {},\n filename: {},\n truncate: {},\n children: {}\n },\n [],\n [],\n { mode: \"open\" }\n);\nfunction vf(r) {\n return Object.prototype.toString.call(r) === \"[object Date]\";\n}\nfunction vc(r, e, t, n) {\n if (typeof t == \"number\" || vf(t)) {\n const s = n - t, o = (t - e) / (r.dt || 1 / 60), i = r.opts.stiffness * s, a = r.opts.damping * o, l = (i - a) * r.inv_mass, d = (o + l) * r.dt;\n return Math.abs(d) < r.opts.precision && Math.abs(s) < r.opts.precision ? n : (r.settled = !1, vf(t) ? new Date(t.getTime() + d) : t + d);\n } else {\n if (Array.isArray(t))\n return t.map(\n (s, o) => (\n // @ts-ignore\n vc(r, e[o], t[o], n[o])\n )\n );\n if (typeof t == \"object\") {\n const s = {};\n for (const o in t)\n s[o] = vc(r, e[o], t[o], n[o]);\n return s;\n } else\n throw new Error(`Cannot spring ${typeof t} values`);\n }\n}\nclass gd {\n #t = W(0.15);\n #r = W(0.8);\n #n = W(0.01);\n #e;\n #s;\n #o = (\n /** @type {T} */\n void 0\n );\n #a = 0;\n #i = 1;\n #l = 0;\n /** @type {import('../internal/client/types').Task | null} */\n #c = null;\n /** @type {ReturnType<typeof deferred> | null} */\n #d = null;\n /**\n * @param {T} value\n * @param {SpringOptions} [options]\n */\n constructor(e, t = {}) {\n this.#e = W(e), this.#s = W(e), typeof t.stiffness == \"number\" && (this.#t.v = xi(t.stiffness, 0, 1)), typeof t.damping == \"number\" && (this.#r.v = xi(t.damping, 0, 1)), typeof t.precision == \"number\" && (this.#n.v = t.precision);\n }\n /**\n * Create a spring whose value is bound to the return value of `fn`. This must be called\n * inside an effect root (for example, during component initialisation).\n *\n * ```svelte\n * <script>\n * \timport { Spring } from 'svelte/motion';\n *\n * \tlet { number } = $props();\n *\n * \tconst spring = Spring.of(() => number);\n * <\\/script>\n * ```\n * @template U\n * @param {() => U} fn\n * @param {SpringOptions} [options]\n */\n static of(e, t) {\n const n = new gd(e(), t);\n return Ef(() => {\n n.set(e());\n }), n;\n }\n /** @param {T} value */\n #u(e) {\n if (k(this.#s, e), this.#e.v ??= e, this.#o ??= this.#e.v, !this.#c) {\n this.#a = _n.now();\n var t = 1e3 / (this.#l * 60);\n this.#c ??= Rf((n) => {\n this.#i = Math.min(this.#i + t, 1);\n const s = Math.min(n - this.#a, 1e3 / 30), o = {\n inv_mass: this.#i,\n opts: {\n stiffness: this.#t.v,\n damping: this.#r.v,\n precision: this.#n.v\n },\n settled: !0,\n dt: s * 60 / 1e3\n };\n var i = vc(o, this.#o, this.#e.v, this.#s.v);\n return this.#o = this.#e.v, this.#a = n, k(this.#e, i), o.settled && (this.#c = null), !o.settled;\n });\n }\n return this.#c.promise;\n }\n /**\n * Sets `spring.target` to `value` and returns a `Promise` that resolves if and when `spring.current` catches up to it.\n *\n * If `options.instant` is `true`, `spring.current` immediately matches `spring.target`.\n *\n * If `options.preserveMomentum` is provided, the spring will continue on its current trajectory for\n * the specified number of milliseconds. This is useful for things like 'fling' gestures.\n *\n * @param {T} value\n * @param {SpringUpdateOptions} [options]\n */\n set(e, t) {\n if (this.#d?.reject(new Error(\"Aborted\")), t?.instant || this.#e.v === void 0)\n return this.#c?.abort(), this.#c = null, k(this.#e, k(this.#s, e)), this.#o = e, Promise.resolve();\n t?.preserveMomentum && (this.#i = 0, this.#l = t.preserveMomentum);\n var n = this.#d = Yv();\n return n.promise.catch(Kr), this.#u(e).then(() => {\n n === this.#d && n.resolve(void 0);\n }), n.promise;\n }\n get current() {\n return c(this.#e);\n }\n get damping() {\n return c(this.#r);\n }\n set damping(e) {\n k(this.#r, xi(e, 0, 1));\n }\n get precision() {\n return c(this.#n);\n }\n set precision(e) {\n k(this.#n, e);\n }\n get stiffness() {\n return c(this.#t);\n }\n set stiffness(e) {\n k(this.#t, xi(e, 0, 1));\n }\n get target() {\n return c(this.#s);\n }\n set target(e) {\n this.set(e);\n }\n}\nfunction xi(r, e, t) {\n return Math.max(e, Math.min(t, r));\n}\nvar cS = S(\"<svelte-split-pane-mousecatcher></svelte-split-pane-mousecatcher>\", 2), dS = S(\"<svelte-split-pane><svelte-split-pane-section><!></svelte-split-pane-section> <svelte-split-pane-section><!></svelte-split-pane-section> <svelte-split-pane-divider></svelte-split-pane-divider></svelte-split-pane> <!>\", 3);\nconst uS = {\n hash: \"svelte-jsl05d\",\n code: \"svelte-split-pane.svelte-jsl05d {--sp-thickness: var(--thickness, 8px);--sp-color: var(--color, transparent);--sp-clamped: clamp(var(--min), var(--pos), var(--max));display:grid;position:relative;width:100%;height:100%;}svelte-split-pane[data-orientation='rows'].svelte-jsl05d {grid-template-rows:var(--sp-clamped) 1fr;}svelte-split-pane[data-orientation='columns'].svelte-jsl05d {grid-template-columns:var(--sp-clamped) 1fr;}svelte-split-pane-section.svelte-jsl05d {width:100%;height:100%;overflow:auto;}svelte-split-pane-section.svelte-jsl05d > * {width:100%;height:100%;overflow:hidden;}svelte-split-pane-mousecatcher.svelte-jsl05d {position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(255, 255, 255, 0.0001);}svelte-split-pane-divider.svelte-jsl05d {position:absolute;touch-action:none !important;}svelte-split-pane-divider.svelte-jsl05d::after {content:'';position:absolute;background-color:var(--sp-color);}[data-orientation='columns'].svelte-jsl05d > svelte-split-pane-divider:where(.svelte-jsl05d) {padding:0 calc(0.5 * var(--sp-thickness));width:0;height:100%;cursor:ew-resize;left:var(--sp-clamped);transform:translate(calc(-0.5 * var(--sp-thickness)), 0);}[data-orientation='columns'].svelte-jsl05d > svelte-split-pane-divider.disabled:where(.svelte-jsl05d) {cursor:default;}[data-orientation='columns'].svelte-jsl05d > svelte-split-pane-divider:where(.svelte-jsl05d)::after {left:50%;top:0;width:1px;height:100%;}[data-orientation='rows'].svelte-jsl05d > svelte-split-pane-divider:where(.svelte-jsl05d) {padding:calc(0.5 * var(--sp-thickness)) 0;width:100%;height:0;cursor:ns-resize;top:var(--sp-clamped);transform:translate(0, calc(-0.5 * var(--sp-thickness)));}[data-orientation='rows'].svelte-jsl05d > svelte-split-pane-divider.disabled:where(.svelte-jsl05d) {cursor:default;}[data-orientation='rows'].svelte-jsl05d > svelte-split-pane-divider:where(.svelte-jsl05d)::after {top:50%;left:0;width:100%;height:1px;}\"\n};\nfunction Vm(r, e) {\n nt(e, !0), bt(r, uS);\n let t = ce(e, \"id\", 7, void 0), n = ce(e, \"type\", 7), s = ce(e, \"pos\", 15, \"50%\"), o = ce(e, \"min\", 7, \"0%\"), i = ce(e, \"max\", 7, \"100%\"), a = ce(e, \"disabled\", 7, !1), l = ce(e, \"a\", 7), d = ce(e, \"b\", 7), u, f = W(!1), h = ie(s);\n function p(U) {\n return U[0] === \"-\" ? `calc(100% - ${U.slice(1)})` : U;\n }\n function g(U, F) {\n if (a()) return;\n const { top: z, left: _, width: N, height: Q } = u.getBoundingClientRect();\n let T = n() === \"columns\" ? (U - _) / N : (F - z) / Q;\n T < 0 && (T = 0), T > 1 && (T = 1), k(h, `${100 * T}%`);\n }\n function b(U, F) {\n const z = (_) => {\n if (_.pointerType === \"mouse\" && _.button === 2 || _.pointerType !== \"mouse\" && !_.isPrimary)\n return;\n U.setPointerCapture(_.pointerId), _.preventDefault(), k(f, !0);\n const N = () => {\n k(f, !1), U.setPointerCapture(_.pointerId), window.removeEventListener(\"pointermove\", F, !1), window.removeEventListener(\"pointerup\", N, !1);\n };\n window.addEventListener(\"pointermove\", F, !1), window.addEventListener(\"pointerup\", N, !1);\n };\n kr(() => (U.addEventListener(\"pointerdown\", z, { capture: !0, passive: !1 }), () => {\n U.removeEventListener(\"pointerdown\", z);\n }));\n }\n var y = {\n get id() {\n return t();\n },\n set id(U = void 0) {\n t(U), de();\n },\n get type() {\n return n();\n },\n set type(U) {\n n(U), de();\n },\n get pos() {\n return s();\n },\n set pos(U = \"50%\") {\n s(U), de();\n },\n get min() {\n return o();\n },\n set min(U = \"0%\") {\n o(U), de();\n },\n get max() {\n return i();\n },\n set max(U = \"100%\") {\n i(U), de();\n },\n get disabled() {\n return a();\n },\n set disabled(U = !1) {\n a(U), de();\n },\n get a() {\n return l();\n },\n set a(U) {\n l(U), de();\n },\n get b() {\n return d();\n },\n set b(U) {\n d(U), de();\n }\n }, C = dS(), E = ke(C);\n B(() => $d(E, \"data-pane\", t())), B(() => $d(E, \"data-orientation\", n())), Ne(E, 1, \"svelte-jsl05d\");\n var R = v(E);\n Ne(R, 1, \"svelte-jsl05d\");\n var q = v(R);\n Ws(q, () => l() ?? Kr), m(R);\n var O = x(R, 2);\n Ne(O, 1, \"svelte-jsl05d\");\n var M = v(O);\n Ws(M, () => d() ?? Kr), m(O);\n var P = x(O, 2);\n let L;\n yg(P, (U, F) => b?.(U, F), () => (U) => g(U.clientX, U.clientY)), m(E), bn(E, (U) => u = U, () => u);\n var $ = x(E, 2);\n {\n var J = (U) => {\n var F = cS();\n Ne(F, 1, \"svelte-jsl05d\"), w(U, F);\n };\n K($, (U) => {\n c(f) && U(J);\n });\n }\n return B(\n (U, F, z) => {\n Vs(E, `--pos: ${U ?? \"\"}; --min: ${F ?? \"\"}; --max: ${z ?? \"\"}`), L = Ne(P, 1, \"svelte-jsl05d\", null, L, { disabled: a() });\n },\n [\n () => p(c(h)),\n () => p(o()),\n () => p(i())\n ]\n ), kg(R, \"contentRect\", (U) => {\n if (!c(f)) return;\n const F = u.getBoundingClientRect(), z = s().startsWith(\"-\"), _ = n() === \"columns\" ? U.width : U.height, N = n() === \"columns\" ? F.width : F.height;\n if (s().endsWith(\"%\")) {\n const Q = 100 * _ / N;\n s(`${z ? Q - 100 : Q}%`);\n } else {\n const Q = z ? _ - N : _;\n if (s().endsWith(\"px\"))\n s(`${Q}px`);\n else if (s().endsWith(\"em\")) {\n const T = s().endsWith(\"rem\"), I = parseFloat(getComputedStyle(T ? document.documentElement : u).fontSize), te = Q / I;\n s(`${te}${T ? \"rem\" : \"em\"}`);\n }\n }\n }), w(r, C), st(y);\n}\nrt(\n Vm,\n {\n id: {},\n type: {},\n pos: {},\n min: {},\n max: {},\n disabled: {},\n a: {},\n b: {}\n },\n [],\n [],\n { mode: \"open\" }\n);\nvar fS = S('<section class=\"svelte-1l0xxfv\"><!></section>'), pS = S('<section class=\"svelte-1l0xxfv\"><div class=\"panel-header svelte-1l0xxfv\"><button class=\"panel-heading raised svelte-1l0xxfv\"><svg width=\"1.8rem\" height=\"1.8rem\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m7 15 5 5 5-5\"></path><path d=\"m7 9 5-5 5 5\"></path></svg> </button> <!></div> <div class=\"panel-body svelte-1l0xxfv\"><!></div></section>'), hS = S('<div class=\"container svelte-1l0xxfv\"><!></div>');\nconst mS = {\n hash: \"svelte-1l0xxfv\",\n code: `.container.svelte-1l0xxfv {width:100%;height:100%;}.panel-header.svelte-1l0xxfv {height:var(--sk-pane-controls-height);display:flex;justify-content:space-between;align-items:center;padding:0.5rem 0.5rem 0.5rem 1rem;}.panel-body.svelte-1l0xxfv {overflow:auto;max-height:calc(100% - var(--sk-pane-controls-height));}.panel-heading.svelte-1l0xxfv {font:var(--sk-font-ui-small);text-transform:uppercase;height:3.2rem;padding:0 0.8rem;\n\t\t/* flex: 1; */text-align:left;display:flex;align-items:center;gap:0.4rem;}section.svelte-1l0xxfv {position:relative;overflow:hidden;}`\n};\nfunction Wm(r, e) {\n nt(e, !0), bt(r, mS);\n const t = /(\\d+)(?:(px|rem|%|em))/i;\n let n = ce(e, \"panel\", 7), s = ce(e, \"pos\", 15, \"90%\"), o = ce(e, \"min\", 7, \"4.2rem\"), i = ce(e, \"max\", 7, \"-4.2rem\"), a = ce(e, \"main\", 7), l = ce(e, \"header\", 7), d = ce(e, \"body\", 7), u = Math.min(g(s()), 70), f;\n const h = new gd(g(s()), { stiffness: 0.2, damping: 0.5 });\n kr(() => {\n s(h.current + \"%\");\n });\n const p = () => {\n const E = g(s()), R = E * 0.01 * f.clientHeight, q = f.clientHeight - R > 42;\n h.set(E, { hard: !0 }), q ? (u = E, h.set(100)) : h.set(u);\n };\n function g(E) {\n let R = +E.replace(t, \"$1\");\n return R < 0 && (R += 100), R;\n }\n var b = {\n get panel() {\n return n();\n },\n set panel(E) {\n n(E), de();\n },\n get pos() {\n return s();\n },\n set pos(E = \"90%\") {\n s(E), de();\n },\n get min() {\n return o();\n },\n set min(E = \"4.2rem\") {\n o(E), de();\n },\n get max() {\n return i();\n },\n set max(E = \"-4.2rem\") {\n i(E), de();\n },\n get main() {\n return a();\n },\n set main(E) {\n a(E), de();\n },\n get header() {\n return l();\n },\n set header(E) {\n l(E), de();\n },\n get body() {\n return d();\n },\n set body(E) {\n d(E), de();\n }\n }, y = hS(), C = v(y);\n return Vm(C, {\n get min() {\n return o();\n },\n get max() {\n return i();\n },\n type: \"rows\",\n get pos() {\n return s();\n },\n set pos(q) {\n s(q);\n },\n a: (q) => {\n var O = fS(), M = v(O);\n Ws(M, () => a() ?? Kr), m(O), w(q, O);\n },\n b: (q) => {\n var O = pS(), M = v(O), P = v(M), L = x(v(P));\n m(P);\n var $ = x(P, 2);\n Ws($, () => l() ?? Kr), m(M);\n var J = x(M, 2), U = v(J);\n Ws(U, () => d() ?? Kr), m(J), m(O), B(() => D(L, ` ${n() ?? \"\"}`)), fe(\"click\", P, p), w(q, O);\n },\n $$slots: { a: !0, b: !0 }\n }), m(y), bn(y, (E) => f = E, () => f), w(r, y), st(b);\n}\nhr([\"click\"]);\nrt(\n Wm,\n {\n panel: {},\n pos: {},\n min: {},\n max: {},\n main: {},\n header: {},\n body: {}\n },\n [],\n [],\n { mode: \"open\" }\n);\nlet vS = 1;\nclass gS {\n constructor(e, t) {\n this.pending_cmds = /* @__PURE__ */ new Map(), this.handle_event = (n) => {\n if (n.source !== this.iframe.contentWindow) return;\n const { action: s, args: o } = n.data;\n switch (s) {\n case \"cmd_error\":\n case \"cmd_ok\":\n return this.handle_command_message(n.data);\n case \"fetch_progress\":\n return this.handlers.on_fetch_progress(o.remaining);\n case \"error\":\n return this.handlers.on_error(n.data);\n case \"unhandledrejection\":\n return this.handlers.on_unhandled_rejection(n.data);\n case \"iframe_reload\":\n return this.handlers.on_iframe_reload(n.data);\n case \"console\":\n if (n.data.command === \"info\" && n.data.args[0]?.type === \"__error\") {\n const i = n.data.args[0], a = new Error(i.message);\n a.name = i.name, a.stack = i.stack, n.data.args[0] = a;\n }\n return this.handlers.on_console(n.data);\n }\n }, this.iframe = e, this.handlers = t, window.addEventListener(\"message\", this.handle_event, !1);\n }\n destroy() {\n window.removeEventListener(\"message\", this.handle_event);\n }\n iframe_command(e, t) {\n return new Promise((n, s) => {\n const o = vS++;\n this.pending_cmds.set(o, { resolve: n, reject: s }), this.iframe.contentWindow?.postMessage({ action: e, cmd_id: o, args: t }, \"*\");\n });\n }\n handle_command_message(e) {\n let t = e.action, n = e.cmd_id;\n if (n === void 0) return;\n let s = this.pending_cmds.get(n);\n if (s) {\n if (this.pending_cmds.delete(n), t === \"cmd_error\") {\n let { message: o, stack: i } = e, a = new Error(o);\n a.stack = i, s.reject(a);\n }\n t === \"cmd_ok\" && s.resolve(e.args);\n } else\n console.error(\"command not found\", n, e, [...this.pending_cmds.keys()]);\n }\n eval(e, t) {\n return this.iframe_command(\"eval\", { script: e, style: t });\n }\n handle_links() {\n return this.iframe_command(\"catch_clicks\", {});\n }\n}\nXv();\nconst gf = {};\nfunction Mn(r, e) {\n const t = wa(gf), n = typeof r == \"function\" ? r(t) : r, s = { ...t, ...n };\n return e?.expandable && (s.isParentExpanded = s.expanded), wc(gf, s), t;\n}\nvar bS = S('<span class=\"container svelte-17a1or2\"><span></span></span>');\nconst yS = {\n hash: \"svelte-17a1or2\",\n code: \".container.svelte-17a1or2 {display:inline-block;transform:translate(calc(0px - var(--li-identation)), -50%);position:absolute;top:50%;padding-right:100%;}.arrow.svelte-17a1or2 {transform-origin:25% 50%;position:relative;line-height:1.1em;font-size:0.75em;margin-left:0;transition:150ms;color:var(--arrow-color);user-select:none;font-family:'Courier New', Courier, monospace;display:block;}.expanded.svelte-17a1or2 {transform:rotateZ(90deg) translateX(-3px);}\"\n};\nfunction gc(r, e) {\n nt(e, !1), bt(r, yS);\n const t = () => Gs(a, \"$expandable\", s), n = () => Gs(l(), \"$expanded\", s), [s, o] = Yo(), { expanded: i, expandable: a } = Mn();\n let l = ce(e, \"expanded\", 12, i);\n var d = {\n get expanded() {\n return l();\n },\n set expanded(g) {\n l(g), de();\n }\n };\n Tr();\n var u = lt(), f = ke(u);\n {\n var h = (g) => {\n var b = bS(), y = v(b);\n let C;\n y.textContent = \"\u25B6\", m(b), B(() => C = Ne(y, 1, \"arrow svelte-17a1or2\", null, C, { expanded: n() })), jn(\"click\", b, (E) => {\n E.stopPropagation(), Ys(l(), !n());\n }), w(g, b);\n };\n K(f, (g) => {\n t() && g(h);\n });\n }\n w(r, u);\n var p = st(d);\n return o(), p;\n}\nrt(gc, { expanded: {} }, [], [], { mode: \"open\" });\nfunction Um(r, e) {\n nt(e, !1), Mn({ displayMode: \"summary\" }), Tr();\n var t = lt(), n = ke(t);\n ys(n, e, \"default\", {}), w(r, t), st();\n}\nrt(Um, {}, [\"default\"], [], { mode: \"open\" });\nfunction bd(r, e) {\n nt(e, !1);\n let t = ce(e, \"expanded\", 12), n = ce(e, \"key\", 12);\n const s = $o(!1);\n Mn(({ keyPath: l, level: d }) => (n() !== \"[[Entries]]\" && (l = [...l, n()], d = d + 1), { keyPath: l, level: d, expanded: t(), expandable: s }));\n var o = {\n get expanded() {\n return t();\n },\n set expanded(l) {\n t(l), de();\n },\n get key() {\n return n();\n },\n set key(l) {\n n(l), de();\n }\n };\n Tr();\n var i = lt(), a = ke(i);\n return ys(a, e, \"default\", {}), w(r, i), st(o);\n}\nrt(bd, { expanded: {}, key: {} }, [\"default\"], [], { mode: \"open\" });\nvar xS = S('<span class=\"operator\"></span>'), wS = S('<span class=\"label svelte-1vbtrxa\"><!><!><!></span><!>', 1), kS = S(\"<li><!></li>\"), CS = S(\"<ul></ul>\"), _S = S('<span class=\"root svelte-1vbtrxa\"><!> <!></span> <!>', 1);\nconst SS = {\n hash: \"svelte-1vbtrxa\",\n code: \".root.svelte-1vbtrxa {display:inline-block;position:relative;}.indent.svelte-1vbtrxa {padding-left:var(--li-identation);}.label.svelte-1vbtrxa {position:relative;}\"\n};\nfunction en(r, e) {\n nt(e, !1), bt(r, SS);\n const t = () => Gs(p, \"$expanded\", n), [n, s] = Yo(), o = Vt();\n let i = ce(e, \"keys\", 12), a = ce(e, \"shouldShowColon\", 28, () => {\n }), l = ce(e, \"expandKey\", 12, ($) => $), d = ce(e, \"defaultExpanded\", 12, !1);\n const {\n isParentExpanded: u,\n displayMode: f,\n root: h,\n expanded: p,\n expandable: g,\n keyPath: b,\n level: y,\n shouldExpandNode: C\n } = Mn({ root: !1 }, { expandable: !0 });\n if (Ys(g, !0), f !== \"summary\") {\n if (!d()) {\n const $ = C({ keyPath: b, level: y });\n $ !== void 0 && d($);\n }\n Ar(() => u.subscribe(($) => {\n $ ? p.set(d()) : p.set(!1);\n }));\n }\n function E() {\n Ys(p, !t());\n }\n Kt(() => (Le(i()), $o), () => {\n k(o, i().map(() => $o(!1)));\n }), Yr();\n var R = {\n get keys() {\n return i();\n },\n set keys($) {\n i($), de();\n },\n get shouldShowColon() {\n return a();\n },\n set shouldShowColon($) {\n a($), de();\n },\n get expandKey() {\n return l();\n },\n set expandKey($) {\n l($), de();\n },\n get defaultExpanded() {\n return d();\n },\n set defaultExpanded($) {\n d($), de();\n }\n };\n Tr();\n var q = lt(), O = ke(q);\n {\n var M = ($) => {\n var J = lt(), U = ke(J);\n ys(U, e, \"summary\", {}), w($, J);\n }, P = ($) => {\n var J = _S(), U = ke(J), F = v(U);\n {\n var z = (T) => {\n gc(T, {\n get expanded() {\n return p;\n }\n });\n };\n K(F, (T) => {\n h && T(z);\n });\n }\n var _ = x(F, 2);\n Um(_, {\n children: (T, I) => {\n var te = lt(), A = ke(te);\n ys(\n A,\n e,\n \"preview\",\n {\n get root() {\n return h;\n }\n }\n ), w(T, te);\n },\n $$slots: { default: !0 }\n }), m(U);\n var N = x(U, 2);\n {\n var Q = (T) => {\n var I = CS();\n tt(I, 5, i, pt, (te, A, V) => {\n var H = kS();\n let ne;\n var X = v(H);\n {\n let G = Ze(() => (Le(l()), c(A), Ue(() => l()(c(A)))));\n bd(X, {\n get key() {\n return c(G);\n },\n get expanded() {\n return c(o), Ue(() => c(o)[V]);\n },\n children: (Y, se) => {\n var ue = wS(), le = ke(ue), re = v(le);\n gc(re, {});\n var ae = x(re);\n ys(\n ae,\n e,\n \"item_key\",\n {\n get key() {\n return c(A);\n },\n index: V\n }\n );\n var ge = x(ae);\n {\n var Se = (Ie) => {\n var Fe = xS();\n Fe.textContent = \": \", w(Ie, Fe);\n }, _e = ie(() => (Le(a()), c(A), Ue(() => !a() || a()(c(A)))));\n K(ge, (Ie) => {\n c(_e) && Ie(Se);\n });\n }\n m(le);\n var Re = x(le);\n ys(\n Re,\n e,\n \"item_value\",\n {\n get key() {\n return c(A);\n },\n index: V\n }\n ), jn(\"click\", le, () => c(o)[V].update((Ie) => !Ie)), w(Y, ue);\n },\n $$slots: { default: !0 }\n });\n }\n m(H), B(() => ne = Ne(H, 1, \"svelte-1vbtrxa\", null, ne, { indent: t() })), jn(\"click\", H, zd(() => {\n })), w(te, H);\n }), m(I), jn(\"click\", I, zd(E)), w(T, I);\n };\n K(N, (T) => {\n t() && T(Q);\n });\n }\n jn(\"click\", U, E), w($, J);\n };\n K(O, ($) => {\n f === \"summary\" ? $(M) : $(P, -1);\n });\n }\n w(r, q);\n var L = st(R);\n return s(), L;\n}\nrt(\n en,\n {\n keys: {},\n shouldShowColon: {},\n expandKey: {},\n defaultExpanded: {}\n },\n [\"summary\", \"preview\", \"item_key\", \"item_value\"],\n [],\n { mode: \"open\" }\n);\nvar ES = S('<span class=\"label\"> </span>'), TS = S('<!><span class=\"operator\"> </span>', 1), MS = S('<span class=\"comma operator svelte-10uy8pn\">,</span>'), AS = S(\"<!> <!>\", 1), PS = S('<span class=\"comma operator svelte-10uy8pn\">,</span> <span class=\"operator\">\u2026</span>', 1), NS = S('<span class=\"operator\"> </span>'), OS = S(\"<!> <!> <!> <!>\", 1);\nconst $S = {\n hash: \"svelte-10uy8pn\",\n code: \".comma.svelte-10uy8pn {margin-left:-0.5em;margin-right:0.5em;}\"\n};\nfunction zs(r, e) {\n nt(e, !1), bt(r, $S);\n let t = ce(e, \"list\", 12), n = ce(e, \"hasMore\", 12), s = ce(e, \"label\", 28, () => {\n }), o = ce(e, \"prefix\", 28, () => {\n }), i = ce(e, \"postfix\", 28, () => {\n }), a = ce(e, \"root\", 12, !1);\n const { showPreview: l } = Mn();\n var d = {\n get list() {\n return t();\n },\n set list(p) {\n t(p), de();\n },\n get hasMore() {\n return n();\n },\n set hasMore(p) {\n n(p), de();\n },\n get label() {\n return s();\n },\n set label(p) {\n s(p), de();\n },\n get prefix() {\n return o();\n },\n set prefix(p) {\n o(p), de();\n },\n get postfix() {\n return i();\n },\n set postfix(p) {\n i(p), de();\n },\n get root() {\n return a();\n },\n set root(p) {\n a(p), de();\n }\n };\n Tr();\n var u = lt(), f = ke(u);\n {\n var h = (p) => {\n var g = OS(), b = ke(g);\n {\n var y = (M) => {\n var P = TS(), L = ke(P);\n {\n var $ = (F) => {\n var z = ES(), _ = v(z, !0);\n m(z), B(() => D(_, s())), w(F, z);\n };\n K(L, (F) => {\n s() && F($);\n });\n }\n var J = x(L), U = v(J, !0);\n m(J), B(() => D(U, o())), w(M, P);\n };\n K(b, (M) => {\n o() && M(y);\n });\n }\n var C = x(b, 2);\n tt(C, 1, t, pt, (M, P, L) => {\n var $ = AS(), J = ke($);\n ys(\n J,\n e,\n \"item\",\n {\n get item() {\n return c(P);\n },\n index: L\n }\n );\n var U = x(J, 2);\n {\n var F = (z) => {\n var _ = MS();\n w(z, _);\n };\n K(U, (z) => {\n Le(t()), Ue(() => L < t().length - 1) && z(F);\n });\n }\n w(M, $);\n });\n var E = x(C, 2);\n {\n var R = (M) => {\n var P = PS();\n Pe(2), w(M, P);\n };\n K(E, (M) => {\n n() && M(R);\n });\n }\n var q = x(E, 2);\n {\n var O = (M) => {\n var P = NS(), L = v(P, !0);\n m(P), B(() => D(L, i())), w(M, P);\n };\n K(q, (M) => {\n i() && M(O);\n });\n }\n w(p, g);\n };\n K(f, (p) => {\n (a() || l) && p(h);\n });\n }\n return w(r, u), st(d);\n}\nrt(\n zs,\n {\n list: {},\n hasMore: {},\n label: {},\n prefix: {},\n postfix: {},\n root: {}\n },\n [\"item\"],\n [],\n { mode: \"open\" }\n);\nvar IS = S('<span class=\"label\"> </span>'), zS = S('<span class=\"property\"> </span><span class=\"operator\"></span><!>', 1), RS = S('<span class=\"property\"> </span>');\nfunction xa(r, e) {\n nt(e, !1);\n const t = Vt(), n = Vt();\n let s = ce(e, \"value\", 12), o = ce(e, \"summary\", 12);\n Kt(() => Le(s()), () => {\n k(t, Object.getOwnPropertyNames(s()));\n }), Kt(() => c(t), () => {\n k(n, c(t).slice(0, 5));\n }), Yr();\n var i = {\n get value() {\n return s();\n },\n set value(a) {\n s(a), de();\n },\n get summary() {\n return o();\n },\n set summary(a) {\n o(a), de();\n }\n };\n return Tr(), en(r, {\n get keys() {\n return c(t);\n },\n $$slots: {\n summary: (a, l) => {\n var d = IS(), u = v(d, !0);\n m(d), B(() => D(u, o() ?? \"{\u2026}\")), w(a, d);\n },\n preview: (a, l) => {\n const d = Ze(() => l.root);\n {\n let u = Ze(() => (c(n), c(t), Ue(() => c(n).length < c(t).length))), f = Ze(() => o() ? `${o()} {` : \"{\");\n zs(a, {\n get list() {\n return c(n);\n },\n get hasMore() {\n return c(u);\n },\n get prefix() {\n return c(f);\n },\n postfix: \"}\",\n get root() {\n return c(d);\n },\n $$slots: {\n item: (h, p) => {\n const g = Ze(() => p.item);\n var b = zS(), y = ke(b), C = v(y, !0);\n m(y);\n var E = x(y);\n E.textContent = \": \";\n var R = x(E);\n Zt(R, {\n get value() {\n return Le(s()), Le(c(g)), Ue(() => s()[c(g)]);\n }\n }), B(() => D(C, c(g))), w(h, b);\n }\n }\n });\n }\n },\n item_key: (a, l) => {\n const d = Ze(() => l.key);\n var u = RS(), f = v(u, !0);\n m(u), B(() => D(f, c(d))), w(a, u);\n },\n item_value: (a, l) => {\n const d = Ze(() => l.key);\n Zt(a, {\n get value() {\n return Le(s()), Le(c(d)), Ue(() => s()[c(d)]);\n }\n });\n }\n }\n }), st(i);\n}\nrt(xa, { value: {}, summary: {} }, [], [], { mode: \"open\" });\nvar jS = S('<span class=\"label\"> </span>'), LS = S('<span class=\"property\"> </span>');\nfunction Jm(r, e) {\n nt(e, !1);\n const t = Vt(), n = Vt();\n let s = ce(e, \"value\", 12);\n Kt(() => Le(s()), () => {\n k(t, Object.getOwnPropertyNames(s()));\n }), Kt(() => Le(s()), () => {\n k(n, s().slice(0, 5));\n }), Yr();\n var o = {\n get value() {\n return s();\n },\n set value(i) {\n s(i), de();\n }\n };\n return Tr(), en(r, {\n get keys() {\n return c(t);\n },\n $$slots: {\n summary: (i, a) => {\n var l = jS(), d = v(l);\n m(l), B(() => D(d, `Array(${Le(s()), Ue(() => s().length) ?? \"\"})`)), w(i, l);\n },\n preview: (i, a) => {\n const l = Ze(() => a.root);\n {\n let d = Ze(() => (c(n), Le(s()), Ue(() => c(n).length < s().length)));\n zs(i, {\n get list() {\n return c(n);\n },\n get hasMore() {\n return c(d);\n },\n get label() {\n return `(${Le(s()), Ue(() => s().length) ?? \"\"}) `;\n },\n prefix: \"[\",\n postfix: \"]\",\n get root() {\n return c(l);\n },\n $$slots: {\n item: (u, f) => {\n const h = Ze(() => f.item);\n Zt(u, {\n get value() {\n return c(h);\n }\n });\n }\n }\n });\n }\n },\n item_key: (i, a) => {\n const l = Ze(() => a.key);\n var d = LS(), u = v(d, !0);\n m(d), B((f) => D(u, f), [\n () => (Le(c(l)), Ue(() => String(c(l))))\n ]), w(i, d);\n },\n item_value: (i, a) => {\n const l = Ze(() => a.key);\n Zt(i, {\n get value() {\n return Le(s()), Le(c(l)), Ue(() => s()[c(l)]);\n }\n });\n }\n }\n }), st(o);\n}\nrt(Jm, { value: {} }, [], [], { mode: \"open\" });\nvar DS = S('<span class=\"label\"> </span>'), FS = S(\"<span> </span>\"), BS = S('<span class=\"property\"> </span>');\nfunction Km(r, e) {\n nt(e, !1);\n const t = Vt();\n let n = ce(e, \"value\", 12), s = ce(e, \"nodeType\", 12), o = Vt([]), i = Vt([]);\n const a = \"[[Entries]]\";\n Kt(() => Le(n()), () => {\n let d = [], u = [], f = 0;\n for (const h of n())\n d.push(f++), u.push(h);\n k(o, d), k(i, u);\n }), Kt(() => c(i), () => {\n k(t, c(i).slice(0, 5));\n }), Yr();\n var l = {\n get value() {\n return n();\n },\n set value(d) {\n n(d), de();\n },\n get nodeType() {\n return s();\n },\n set nodeType(d) {\n s(d), de();\n }\n };\n return Tr(), en(r, {\n keys: [a, \"size\"],\n shouldShowColon: (d) => d !== a,\n $$slots: {\n summary: (d, u) => {\n var f = DS(), h = v(f);\n m(f), B(() => D(h, `${s() ?? \"\"}(${c(o), Ue(() => c(o).length) ?? \"\"})`)), w(d, f);\n },\n preview: (d, u) => {\n const f = Ze(() => u.root);\n {\n let h = Ze(() => (c(t), c(i), Ue(() => c(t).length < c(i).length))), p = Ze(() => (Le(s()), c(o), Ue(() => `${s()}(${c(o).length}) `)));\n zs(d, {\n get list() {\n return c(t);\n },\n get hasMore() {\n return c(h);\n },\n get label() {\n return c(p);\n },\n prefix: \"{\",\n postfix: \"}\",\n get root() {\n return c(f);\n },\n $$slots: {\n item: (g, b) => {\n const y = Ze(() => b.item);\n Zt(g, {\n get value() {\n return c(y);\n }\n });\n }\n }\n });\n }\n },\n item_key: (d, u) => {\n const f = Ze(() => u.key);\n var h = FS(), p = v(h, !0);\n m(h), B(() => {\n Ne(h, 1, cs(c(f) === a ? \"internal\" : \"property\")), D(p, c(f));\n }), w(d, h);\n },\n item_value: (d, u) => {\n const f = Ze(() => u.key);\n var h = lt(), p = ke(h);\n {\n var g = (y) => {\n en(y, {\n get keys() {\n return c(o);\n },\n defaultExpanded: !0,\n $$slots: {\n item_key: (C, E) => {\n const R = Ze(() => E.key);\n var q = BS(), O = v(q, !0);\n m(q), B(() => D(O, c(R))), w(C, q);\n },\n item_value: (C, E) => {\n const R = Ze(() => E.key);\n Zt(C, {\n get value() {\n return c(i), Le(c(R)), Ue(() => c(i)[c(R)]);\n }\n });\n }\n }\n });\n }, b = (y) => {\n Zt(y, {\n get value() {\n return Le(n()), Le(c(f)), Ue(() => n()[c(f)]);\n }\n });\n };\n K(p, (y) => {\n c(f) === a ? y(g) : y(b, -1);\n });\n }\n w(d, h);\n }\n }\n }), st(l);\n}\nrt(Km, { value: {}, nodeType: {} }, [], [], { mode: \"open\" });\nvar HS = S('<span color=\"label\"> </span>'), qS = S('<!><span class=\"operator\"></span><!>', 1), VS = S(\"<span> </span>\"), WS = S('<span class=\"property\"> </span>'), US = S('<span class=\"operator\"></span><!><span class=\"operator\"></span><!><span class=\"operator\"></span>', 1), JS = S('<span class=\"property\"> </span>');\nfunction Gm(r, e) {\n nt(e, !1);\n const t = Vt();\n let n = ce(e, \"value\", 12);\n Mn();\n let s = Vt([]), o = Vt([]), i = Vt([]);\n const a = \"[[Entries]]\";\n Kt(() => Le(n()), () => {\n let d = [], u = [], f = [], h = 0;\n for (const p of n())\n d.push(h++), u.push(p[0]), f.push(p[1]);\n k(s, d), k(o, u), k(i, f);\n }), Kt(() => Le(n()), () => {\n k(t, Array.from(n().keys()).slice(0, 5));\n }), Yr();\n var l = {\n get value() {\n return n();\n },\n set value(d) {\n n(d), de();\n }\n };\n return Tr(), en(r, {\n keys: [a, \"size\"],\n shouldShowColon: (d) => d !== a,\n $$slots: {\n summary: (d, u) => {\n var f = HS(), h = v(f);\n m(f), B(() => D(h, `Map(${c(o), Ue(() => c(o).length) ?? \"\"})`)), w(d, f);\n },\n preview: (d, u) => {\n const f = Ze(() => u.root);\n {\n let h = Ze(() => (c(t), Le(n()), Ue(() => c(t).length < n().size))), p = Ze(() => (c(o), Ue(() => `Map(${c(o).length}) `)));\n zs(d, {\n get list() {\n return c(t);\n },\n get hasMore() {\n return c(h);\n },\n get label() {\n return c(p);\n },\n prefix: \"{\",\n postfix: \"}\",\n get root() {\n return c(f);\n },\n $$slots: {\n item: (g, b) => {\n const y = Ze(() => b.item);\n var C = qS(), E = ke(C);\n Zt(E, {\n get value() {\n return c(y);\n }\n });\n var R = x(E);\n R.textContent = \" => \";\n var q = x(R);\n {\n let O = Ze(() => (Le(n()), Le(c(y)), Ue(() => n().get(c(y)))));\n Zt(q, {\n get value() {\n return c(O);\n }\n });\n }\n w(g, C);\n }\n }\n });\n }\n },\n item_key: (d, u) => {\n const f = Ze(() => u.key);\n var h = VS(), p = v(h, !0);\n m(h), B(() => {\n Ne(h, 1, cs(c(f) === a ? \"internal\" : \"property\")), D(p, c(f));\n }), w(d, h);\n },\n item_value: (d, u) => {\n const f = Ze(() => u.key);\n var h = lt(), p = ke(h);\n {\n var g = (y) => {\n en(y, {\n get keys() {\n return c(s);\n },\n expandKey: (C) => c(o)[C],\n defaultExpanded: !0,\n $$slots: {\n item_key: (C, E) => {\n const R = Ze(() => E.key);\n var q = WS(), O = v(q, !0);\n m(q), B(() => D(O, c(R))), w(C, q);\n },\n item_value: (C, E) => {\n const R = Ze(() => E.key);\n en(C, {\n keys: [\"key\", \"value\"],\n $$slots: {\n preview: (q, O) => {\n var M = US(), P = ke(M);\n P.textContent = \"{ \";\n var L = x(P);\n Zt(L, {\n get value() {\n return c(o), Le(c(R)), Ue(() => c(o)[c(R)]);\n }\n });\n var $ = x(L);\n $.textContent = \" => \";\n var J = x($);\n Zt(J, {\n get value() {\n return c(i), Le(c(R)), Ue(() => c(i)[c(R)]);\n }\n });\n var U = x(J);\n U.textContent = \" }\", w(q, M);\n },\n item_key: (q, O) => {\n const M = Ze(() => O.key);\n var P = JS(), L = v(P, !0);\n m(P), B(() => D(L, c(M))), w(q, P);\n },\n item_value: (q, O) => {\n const M = Ze(() => O.key);\n {\n let P = Ze(() => (Le(c(M)), c(o), Le(c(R)), c(i), Ue(() => c(M) === \"key\" ? c(o)[c(R)] : c(i)[c(R)])));\n Zt(q, {\n get value() {\n return c(P);\n }\n });\n }\n }\n }\n });\n }\n }\n });\n }, b = (y) => {\n Zt(y, {\n get value() {\n return Le(n()), Le(c(f)), Ue(() => n()[c(f)]);\n }\n });\n };\n K(p, (y) => {\n c(f) === a ? y(g) : y(b, -1);\n });\n }\n w(d, h);\n }\n }\n }), st(l);\n}\nrt(Gm, { value: {} }, [], [], { mode: \"open\" });\nvar KS = S(\"<span> </span>\");\nconst GS = {\n hash: \"svelte-1hpjph2\",\n code: \".Date.svelte-1hpjph2 {color:var(--date-color);}.BigInt.svelte-1hpjph2 {color:var(--number-color);}.Number.svelte-1hpjph2 {color:var(--number-color);}.Boolean.svelte-1hpjph2 {color:var(--boolean-color);}.Null.svelte-1hpjph2 {color:var(--null-color);}.Undefined.svelte-1hpjph2 {color:var(--undefined-color);}.Symbol.svelte-1hpjph2 {color:var(--symbol-color);}\"\n};\nfunction zn(r, e) {\n nt(e, !1), bt(r, GS);\n let t = ce(e, \"value\", 12), n = ce(e, \"nodeType\", 12);\n var s = {\n get value() {\n return t();\n },\n set value(a) {\n t(a), de();\n },\n get nodeType() {\n return n();\n },\n set nodeType(a) {\n n(a), de();\n }\n }, o = KS(), i = v(o, !0);\n return m(o), B(() => {\n Ne(o, 1, cs(n()), \"svelte-1hpjph2\"), D(i, t());\n }), w(r, o), st(s);\n}\nrt(zn, { value: {}, nodeType: {} }, [], [], { mode: \"open\" });\nvar YS = S('<span><!><span class=\"operator\"> </span></span><br/>', 1), XS = S(\"<span><!></span>\"), QS = S(\"<span><!></span>\");\nconst ZS = {\n hash: \"svelte-lj6btt\",\n code: \".indent.svelte-lj6btt {padding-left:var(--li-identation);}\"\n};\nfunction Ym(r, e) {\n nt(e, !1), bt(r, ZS);\n const t = () => Gs(i, \"$expanded\", n), [n, s] = Yo();\n let o = ce(e, \"stack\", 12);\n const { expanded: i, expandable: a } = Mn();\n Ys(a, !0);\n var l = {\n get stack() {\n return o();\n },\n set stack(g) {\n o(g), de();\n }\n };\n Tr();\n var d = QS(), u = v(d);\n {\n var f = (g) => {\n var b = lt(), y = ke(b);\n tt(y, 1, o, pt, (C, E, R) => {\n const q = Ze(() => (Le(o()), Ue(() => R < o().length - 1)));\n var O = YS(), M = ke(O);\n Ne(M, 1, \"svelte-lj6btt\", null, {}, { indent: R > 0 });\n var P = v(M);\n {\n let J = Ze(() => c(E) + (c(q) ? \"\\\\n\" : \"\"));\n Zt(P, {\n get value() {\n return c(J);\n }\n });\n }\n var L = x(P), $ = v(L, !0);\n m(L), m(M), Pe(), B(() => D($, c(q) ? \" +\" : \"\")), w(C, O);\n }), w(g, b);\n }, h = (g) => {\n var b = XS(), y = v(b);\n {\n let C = Ze(() => (Le(o()), Ue(() => o()[0] + \"\u2026\")));\n Zt(y, {\n get value() {\n return c(C);\n }\n });\n }\n m(b), w(g, b);\n };\n K(u, (g) => {\n t() ? g(f) : g(h, -1);\n });\n }\n m(d), jn(\"click\", d, () => Ys(i, !t())), w(r, d);\n var p = st(l);\n return s(), p;\n}\nrt(Ym, { stack: {} }, [], [], { mode: \"open\" });\nvar e5 = S('<span class=\"label\"> </span>'), t5 = S('<span class=\"label\"> </span>'), r5 = S('<span class=\"property\"> </span>');\nfunction Xm(r, e) {\n nt(e, !1);\n const t = Vt();\n let n = ce(e, \"value\", 12);\n Kt(() => Le(n()), () => {\n k(t, n().stack.split(`\n`));\n }), Yr();\n var s = {\n get value() {\n return n();\n },\n set value(o) {\n n(o), de();\n }\n };\n return Tr(), en(r, {\n keys: [\"message\", \"stack\"],\n $$slots: {\n summary: (o, i) => {\n var a = e5(), l = v(a);\n m(a), B((d) => D(l, `Error: ${d ?? \"\"}`), [\n () => (Le(n()), Ue(() => String(n().message)))\n ]), w(o, a);\n },\n preview: (o, i) => {\n var a = t5(), l = v(a);\n m(a), B((d) => D(l, `Error: ${d ?? \"\"}`), [\n () => (Le(n()), Ue(() => String(n().message)))\n ]), w(o, a);\n },\n item_key: (o, i) => {\n const a = Ze(() => i.key);\n var l = r5(), d = v(l, !0);\n m(l), B(() => D(d, c(a))), w(o, l);\n },\n item_value: (o, i) => {\n const a = Ze(() => i.key);\n var l = lt(), d = ke(l);\n {\n var u = (h) => {\n Ym(h, {\n get stack() {\n return c(t);\n }\n });\n }, f = (h) => {\n Zt(h, {\n get value() {\n return Le(n()), Le(c(a)), Ue(() => n()[c(a)]);\n }\n });\n };\n K(d, (h) => {\n c(a) === \"stack\" ? h(u) : h(f, -1);\n });\n }\n w(o, l);\n }\n }\n }), st(s);\n}\nrt(Xm, { value: {} }, [], [], { mode: \"open\" });\nfunction n5(r, e) {\n const t = Object.prototype.toString.call(r).slice(8, -1);\n return t === \"Object\" ? !e && typeof r[Symbol.iterator] == \"function\" ? \"Iterable\" : r.constructor.name : t;\n}\nvar s5 = S('<span class=\"svelte-oxbp2k\"> </span>'), o5 = S('<span class=\"svelte-oxbp2k\"> </span>');\nconst i5 = {\n hash: \"svelte-oxbp2k\",\n code: \"span.svelte-oxbp2k {color:var(--string-color);word-break:break-all;word-wrap:break-word;}\"\n};\nfunction Qm(r, e) {\n nt(e, !1), bt(r, i5);\n const t = Vt();\n let n = ce(e, \"value\", 12);\n const s = { \"\\n\": \"\\\\n\", \"\t\": \"\\\\t\", \"\\r\": \"\\\\r\" }, { displayMode: o } = Mn();\n Kt(() => Le(n()), () => {\n k(t, n().replace(/[\\n\\t\\r]/g, (f) => s[f]));\n }), Yr();\n var i = {\n get value() {\n return n();\n },\n set value(f) {\n n(f), de();\n }\n };\n Tr();\n var a = lt(), l = ke(a);\n {\n var d = (f) => {\n var h = s5(), p = v(h);\n m(h), B((g) => D(p, `\"${g ?? \"\"}\"`), [\n () => (c(t), Ue(() => c(t).slice(0, 30) + (c(t).length > 30 ? \"\u2026\" : \"\")))\n ]), w(f, h);\n }, u = (f) => {\n var h = o5(), p = v(h);\n m(h), B(() => D(p, `\"${c(t) ?? \"\"}\"`)), w(f, h);\n };\n K(l, (f) => {\n o === \"summary\" ? f(d) : f(u, -1);\n });\n }\n return w(r, a), st(i);\n}\nrt(Qm, { value: {} }, [], [], { mode: \"open\" });\nvar a5 = S('<span class=\"i svelte-rbhvl9\">\u0192</span>'), l5 = S('<span class=\"fn i svelte-rbhvl9\"> </span>'), c5 = S('<span class=\"i svelte-rbhvl9\"> </span>'), d5 = S(\"<!><!>\", 1), u5 = S(\"<span> </span>\"), f5 = S('<span class=\"i svelte-rbhvl9\"> </span>');\nconst p5 = {\n hash: \"svelte-rbhvl9\",\n code: `.i.svelte-rbhvl9 {font-style:italic;}.fn.svelte-rbhvl9,\n .i.svelte-rbhvl9 {color:var(--function-color);}`\n};\nfunction Zm(r, e) {\n nt(e, !1), bt(r, p5);\n const t = Vt(), n = Vt(), s = Vt();\n let o = ce(e, \"value\", 12);\n function i(b) {\n const y = b.match(/^(?:(async)\\s+)?(?:function)?(\\*)?\\s*([^(]+)?(\\([^)]*\\))\\s*(=>)?/), C = y?.[1], E = y?.[2], R = y?.[3], q = y?.[4], O = y?.[5], P = b.match(/^class\\s+([^\\s]+)/)?.[1];\n return { args: q, isAsync: C, isGenerator: E, fnName: R, isArrow: O, isClass: P };\n }\n function a({ isGenerator: b, isAsync: y, isClass: C }) {\n return C ? `class ${C}` : (y ? \"async \" : \"\") + \"\u0192\" + (b ? \"*\" : \"\");\n }\n function l({ isAsync: b, isArrow: y, fnName: C, args: E }) {\n return (y && b ? \"async\" : \"\") + \" \" + (C ?? \"\") + E + (y ? \" => \u2026\" : \"\");\n }\n const d = \"[[Function]]\", u = \"[[Prototype]]\";\n function f(b) {\n return b === u ? o().__proto__ : o()[b];\n }\n function h(b) {\n return b === d ? !0 : f(b);\n }\n function p(b) {\n try {\n return b.toString();\n } catch {\n switch (b.constructor.name) {\n case \"AsyncFunction\":\n return \"async function () {}\";\n case \"AsyncGeneratorFunction\":\n return \"async function * () {}\";\n case \"GeneratorFunction:\":\n return \"function * () {}\";\n default:\n return \"function () {}\";\n }\n }\n }\n Kt(() => Le(o()), () => {\n k(t, p(o()));\n }), Kt(() => c(t), () => {\n k(n, i(c(t)));\n }), Kt(() => {\n }, () => {\n k(s, [\"length\", \"name\", \"prototype\", d, u].filter(h));\n }), Yr();\n var g = {\n get value() {\n return o();\n },\n set value(b) {\n o(b), de();\n }\n };\n return Tr(), en(r, {\n get keys() {\n return c(s);\n },\n $$slots: {\n summary: (b, y) => {\n var C = a5();\n w(b, C);\n },\n preview: (b, y) => {\n var C = d5(), E = ke(C);\n {\n var R = (M) => {\n var P = l5(), L = v(P, !0);\n m(P), B(($) => D(L, $), [() => (c(n), Ue(() => a(c(n))))]), w(M, P);\n };\n K(E, (M) => {\n c(n), Ue(() => !c(n).isArrow) && M(R);\n });\n }\n var q = x(E);\n {\n var O = (M) => {\n var P = c5(), L = v(P, !0);\n m(P), B(($) => D(L, $), [() => (c(n), Ue(() => l(c(n))))]), w(M, P);\n };\n K(q, (M) => {\n c(n), Ue(() => !c(n).isClass) && M(O);\n });\n }\n w(b, C);\n },\n item_key: (b, y) => {\n const C = Ze(() => y.key);\n var E = u5(), R = v(E, !0);\n m(E), B(() => {\n Ne(E, 1, cs(c(C) === d || c(C) === u ? \"internal\" : \"property\")), D(R, c(C));\n }), w(b, E);\n },\n item_value: (b, y) => {\n const C = Ze(() => y.key);\n var E = lt(), R = ke(E);\n {\n var q = (P) => {\n var L = f5(), $ = v(L, !0);\n m(L), B(() => D($, c(t))), w(P, L);\n }, O = (P) => {\n {\n let L = Ze(() => (Le(c(C)), Ue(() => f(c(C)))));\n xa(P, {\n get value() {\n return c(L);\n }\n });\n }\n }, M = (P) => {\n {\n let L = Ze(() => (Le(c(C)), Ue(() => f(c(C)))));\n Zt(P, {\n get value() {\n return c(L);\n }\n });\n }\n };\n K(R, (P) => {\n c(C) === d ? P(q) : c(C) === \"prototype\" ? P(O, 1) : P(M, -1);\n });\n }\n w(b, E);\n }\n }\n }), st(g);\n}\nrt(Zm, { value: {} }, [], [], { mode: \"open\" });\nvar h5 = S('<span class=\"label\"> <!> </span>'), m5 = S('<span class=\"property\"> </span><span class=\"operator\"></span><!>', 1), v5 = S(\"<span> </span>\");\nfunction ev(r, e) {\n nt(e, !1);\n const t = () => Gs(u(), \"$value\", n), [n, s] = Yo(), o = Vt(), i = Vt(), a = Vt(), l = Vt(), d = Vt();\n let u = ce(e, \"value\", 12);\n const f = \"$value\";\n function h(b) {\n return b === f ? c(l) : u()[b];\n }\n Kt(() => Le(u()), () => {\n k(o, Object.getOwnPropertyNames(u()));\n }), Kt(() => c(o), () => {\n k(i, [f, ...c(o)]);\n }), Kt(() => c(o), () => {\n k(a, c(o).slice(0, 5));\n }), Kt(() => t(), () => {\n k(l, t());\n }), Kt(() => Le(u()), () => {\n k(d, typeof u().set == \"function\");\n }), Yr();\n var p = {\n get value() {\n return u();\n },\n set value(b) {\n u(b), de();\n }\n };\n Tr(), en(r, {\n get keys() {\n return c(i);\n },\n $$slots: {\n summary: (b, y) => {\n var C = h5(), E = v(C, !0), R = x(E);\n Zt(R, {\n get value() {\n return c(l);\n }\n });\n var q = x(R, 1, !0);\n q.nodeValue = \")\", m(C), B(() => D(E, c(d) ? \"writable(\" : \"readable(\")), w(b, C);\n },\n preview: (b, y) => {\n const C = Ze(() => y.root);\n {\n let E = Ze(() => (c(a), c(o), Ue(() => c(a).length < c(o).length)));\n zs(b, {\n get list() {\n return c(a);\n },\n get hasMore() {\n return c(E);\n },\n prefix: \"{\",\n postfix: \"}\",\n get root() {\n return c(C);\n },\n $$slots: {\n item: (R, q) => {\n const O = Ze(() => q.item);\n var M = m5(), P = ke(M), L = v(P, !0);\n m(P);\n var $ = x(P);\n $.textContent = \": \";\n var J = x($);\n Zt(J, {\n get value() {\n return Le(u()), Le(c(O)), Ue(() => u()[c(O)]);\n }\n }), B(() => D(L, c(O))), w(R, M);\n }\n }\n });\n }\n },\n item_key: (b, y) => {\n const C = Ze(() => y.key);\n var E = v5(), R = v(E, !0);\n m(E), B(() => {\n Ne(E, 1, cs(c(C) === f ? \"internal\" : \"property\")), D(R, c(C));\n }), w(b, E);\n },\n item_value: (b, y) => {\n const C = Ze(() => y.key);\n {\n let E = Ze(() => (Le(c(C)), Ue(() => h(c(C)))));\n Zt(b, {\n get value() {\n return c(E);\n }\n });\n }\n }\n }\n });\n var g = st(p);\n return s(), g;\n}\nrt(ev, { value: {} }, [], [], { mode: \"open\" });\nvar g5 = S('<span class=\"label\"> </span>'), b5 = S(\"<span> </span>\");\nfunction tv(r, e) {\n nt(e, !1);\n const t = Vt(), n = Vt();\n let s = ce(e, \"value\", 12), o = ce(e, \"nodeType\", 12);\n const i = \"Symbol(Symbol.toStringTag)\", a = [\n \"buffer\",\n \"byteLength\",\n \"byteOffset\",\n \"length\",\n i\n ];\n function l(u) {\n return u === i ? s()[Symbol.toStringTag] : s()[u];\n }\n Kt(() => Le(s()), () => {\n k(t, [...Object.getOwnPropertyNames(s()), ...a]);\n }), Kt(() => Le(s()), () => {\n k(n, s().slice(0, 5));\n }), Yr();\n var d = {\n get value() {\n return s();\n },\n set value(u) {\n s(u), de();\n },\n get nodeType() {\n return o();\n },\n set nodeType(u) {\n o(u), de();\n }\n };\n return Tr(), en(r, {\n get keys() {\n return c(t);\n },\n $$slots: {\n summary: (u, f) => {\n var h = g5(), p = v(h);\n m(h), B(() => D(p, `${o() ?? \"\"}(${Le(s()), Ue(() => s().length) ?? \"\"})`)), w(u, h);\n },\n preview: (u, f) => {\n const h = Ze(() => f.root);\n {\n let p = Ze(() => (c(n), Le(s()), Ue(() => c(n).length < s().length)));\n zs(u, {\n get list() {\n return c(n);\n },\n get hasMore() {\n return c(p);\n },\n get label() {\n return `${o() ?? \"\"}(${Le(s()), Ue(() => s().length) ?? \"\"}) `;\n },\n prefix: \"[\",\n postfix: \"]\",\n get root() {\n return c(h);\n },\n $$slots: {\n item: (g, b) => {\n const y = Ze(() => b.item);\n Zt(g, {\n get value() {\n return c(y);\n }\n });\n }\n }\n });\n }\n },\n item_key: (u, f) => {\n const h = Ze(() => f.key);\n var p = b5(), g = v(p, !0);\n m(p), B(\n (b, y) => {\n Ne(p, 1, b), D(g, y);\n },\n [\n () => cs((Le(c(h)), Ue(() => a.includes(c(h)) ? \"internal\" : \"property\"))),\n () => (Le(c(h)), Ue(() => String(c(h))))\n ]\n ), w(u, p);\n },\n item_value: (u, f) => {\n const h = Ze(() => f.key);\n {\n let p = Ze(() => (Le(c(h)), Ue(() => l(c(h)))));\n Zt(u, {\n get value() {\n return c(p);\n }\n });\n }\n }\n }\n }), st(d);\n}\nrt(tv, { value: {}, nodeType: {} }, [], [], { mode: \"open\" });\nvar y5 = S('<span class=\"regex svelte-1j2saaa\"> </span>'), x5 = S('<span class=\"regex svelte-1j2saaa\"> </span>'), w5 = S('<span class=\"internal\"> </span>');\nconst k5 = {\n hash: \"svelte-1j2saaa\",\n code: \".regex.svelte-1j2saaa {color:var(--regex-color);}\"\n};\nfunction rv(r, e) {\n nt(e, !1), bt(r, k5);\n const t = Vt();\n let n = ce(e, \"value\", 12);\n const s = [\n \"lastIndex\",\n \"dotAll\",\n \"flags\",\n \"global\",\n \"hasIndices\",\n \"ignoreCase\",\n \"multiline\",\n \"source\",\n \"sticky\",\n \"unicode\"\n ];\n Kt(() => Le(n()), () => {\n k(t, n().toString());\n }), Yr();\n var o = {\n get value() {\n return n();\n },\n set value(i) {\n n(i), de();\n }\n };\n return Tr(), en(r, {\n get keys() {\n return s;\n },\n $$slots: {\n summary: (i, a) => {\n var l = y5(), d = v(l, !0);\n m(l), B(() => D(d, c(t))), w(i, l);\n },\n preview: (i, a) => {\n var l = x5(), d = v(l, !0);\n m(l), B(() => D(d, c(t))), w(i, l);\n },\n item_key: (i, a) => {\n const l = Ze(() => a.key);\n var d = w5(), u = v(d, !0);\n m(d), B((f) => D(u, f), [\n () => (Le(c(l)), Ue(() => String(c(l))))\n ]), w(i, d);\n },\n item_value: (i, a) => {\n const l = Ze(() => a.key);\n Zt(i, {\n get value() {\n return Le(n()), Le(c(l)), Ue(() => n()[c(l)]);\n }\n });\n }\n }\n }), st(o);\n}\nrt(rv, { value: {} }, [], [], { mode: \"open\" });\nfunction Zt(r, e) {\n nt(e, !1);\n const t = () => Gs(l, \"$nodeType\", n), [n, s] = Yo(), o = Vt(), i = Vt();\n let a = ce(e, \"value\", 12);\n const l = $o(), { shouldTreatIterableAsObject: d } = Mn();\n function u(b, y) {\n switch (b) {\n case \"Object\":\n return typeof y.subscribe == \"function\" ? [ev] : [xa];\n case \"Error\":\n return [Xm];\n case \"Array\":\n return [Jm];\n case \"Map\":\n return [Gm];\n case \"Iterable\":\n case \"Set\":\n return [Km, { nodeType: b }];\n case \"Number\":\n return [zn, { nodeType: b }];\n case \"String\":\n return [Qm];\n case \"Boolean\":\n return [\n zn,\n { nodeType: b, value: y ? \"true\" : \"false\" }\n ];\n case \"Date\":\n return [\n zn,\n { nodeType: b, value: y.toISOString() }\n ];\n case \"Null\":\n return [zn, { nodeType: b, value: \"null\" }];\n case \"Undefined\":\n return [zn, { nodeType: b, value: \"undefined\" }];\n case \"Function\":\n case \"AsyncFunction\":\n case \"AsyncGeneratorFunction\":\n case \"GeneratorFunction\":\n return [Zm];\n case \"Symbol\":\n return [\n zn,\n { nodeType: b, value: y.toString() }\n ];\n case \"BigInt\":\n return [\n zn,\n { nodeType: b, value: String(y) + \"n\" }\n ];\n case \"ArrayBuffer\":\n return [\n zn,\n {\n nodeType: b,\n value: `ArrayBuffer(${y.byteLength})`\n }\n ];\n case \"BigInt64Array\":\n case \"BigUint64Array\":\n case \"Float32Array\":\n case \"Float64Array\":\n case \"Int8Array\":\n case \"Int16Array\":\n case \"Int32Array\":\n case \"Uint8Array\":\n case \"Uint8ClampedArray\":\n case \"Uint16Array\":\n case \"Uint32Array\":\n return [tv, { nodeType: b }];\n case \"RegExp\":\n return [rv];\n default:\n return [xa, { summary: b }];\n }\n }\n Kt(() => Le(a()), () => {\n Ys(l, n5(a(), d));\n }), Kt(\n () => (c(o), c(i), t(), Le(a())),\n () => {\n ((b) => {\n var y = is(b, 2);\n k(o, y[0]), k(i, y[1]);\n })(u(t(), a()));\n }\n ), Yr();\n var f = {\n get value() {\n return a();\n },\n set value(b) {\n a(b), de();\n }\n };\n Tr();\n var h = lt(), p = ke(h);\n mg(p, () => c(o), (b, y) => {\n y(b, Qv(\n {\n get value() {\n return a();\n }\n },\n () => c(i)\n ));\n }), w(r, h);\n var g = st(f);\n return s(), g;\n}\nrt(Zt, { value: {} }, [], [], { mode: \"open\" });\nfunction C5({ defaultExpandedPaths: r, defaultExpandedLevel: e }) {\n const t = r.map((s) => s.split(\".\"));\n function n(s) {\n e: for (const o of t) {\n if (s.length > o.length)\n continue;\n const i = Math.min(s.length, o.length);\n for (let a = 0; a < i; a++)\n if (o[a] !== \"*\" && o[a] !== String(s[a]))\n continue e;\n return !0;\n }\n return !1;\n }\n return function({ keyPath: s, level: o }) {\n return o <= e || n(s);\n };\n}\nvar _5 = S('<span class=\"svelte-1ozhyqj\"> </span>'), S5 = S(\"<span><!></span>\");\nconst E5 = {\n hash: \"svelte-1ozhyqj\",\n code: `span.svelte-1ozhyqj {--string-color: var(--json-tree-string-color, #cb3f41);--symbol-color: var(--json-tree-symbol-color, #cb3f41);--boolean-color: var(--json-tree-boolean-color, #112aa7);--function-color: var(--json-tree-function-color, #112aa7);--number-color: var(--json-tree-number-color, #3029cf);--label-color: var(--json-tree-label-color, #871d8f);--property-color: var(--json-tree-property-color, #000000);--arrow-color: var(--json-tree-arrow-color, #727272);--operator-color: var(--json-tree-operator-color, #727272);--null-color: var(--json-tree-null-color, #8d8d8d);--undefined-color: var(--json-tree-undefined-color, #8d8d8d);--date-color: var(--json-tree-date-color, #8d8d8d);--internal-color: var(--json-tree-internal-color, grey);--regex-color: var(--json-tree-regex-color, var(--string-color));--li-identation: var(--json-tree-li-indentation, 1em);--li-line-height: var(--json-tree-li-line-height, 1.3);font-size:var(--json-tree-font-size, 12px);font-family:var(--json-tree-font-family, 'Courier New', Courier, monospace);}span.svelte-1ozhyqj li {line-height:var(--li-line-height);display:var(--li-display, list-item);list-style:none;}span.svelte-1ozhyqj,\n span.svelte-1ozhyqj ul {padding:0;margin:0;}.expandable.svelte-1ozhyqj {margin-left:var(--li-identation);}span.svelte-1ozhyqj {cursor:default;}span.svelte-1ozhyqj .label {color:var(--label-color);}span.svelte-1ozhyqj .property {color:var(--property-color);}span.svelte-1ozhyqj .internal {color:var(--internal-color);}span.svelte-1ozhyqj .operator {color:var(--operator-color);}span.svelte-1ozhyqj > span:where(.svelte-1ozhyqj) {white-space:pre-wrap;}`\n};\nfunction Ko(r, e) {\n nt(e, !1), bt(r, E5);\n const t = Vt(), n = Vt();\n let s = ce(e, \"value\", 12), o = ce(e, \"shouldShowPreview\", 12, !0), i = ce(e, \"shouldTreatIterableAsObject\", 12, !1), a = ce(e, \"defaultExpandedPaths\", 28, () => []), l = ce(e, \"defaultExpandedLevel\", 12, 0);\n const d = $o(!0);\n Mn({\n expanded: d,\n isParentExpanded: Zv(!0),\n root: !0,\n shouldExpandNode: (C) => c(n)(C),\n level: 0,\n keyPath: [],\n showPreview: o(),\n shouldTreatIterableAsObject: i()\n }), Kt(() => Le(s()), () => {\n k(t, s() && typeof s() == \"object\");\n }), Kt(\n () => (Le(a()), Le(l())),\n () => {\n k(n, C5({\n defaultExpandedPaths: a(),\n defaultExpandedLevel: l()\n }));\n }\n ), Yr();\n var u = {\n get value() {\n return s();\n },\n set value(C) {\n s(C), de();\n },\n get shouldShowPreview() {\n return o();\n },\n set shouldShowPreview(C) {\n o(C), de();\n },\n get shouldTreatIterableAsObject() {\n return i();\n },\n set shouldTreatIterableAsObject(C) {\n i(C), de();\n },\n get defaultExpandedPaths() {\n return a();\n },\n set defaultExpandedPaths(C) {\n a(C), de();\n },\n get defaultExpandedLevel() {\n return l();\n },\n set defaultExpandedLevel(C) {\n l(C), de();\n }\n };\n Tr();\n var f = S5();\n let h;\n var p = v(f);\n {\n var g = (C) => {\n bd(C, {\n key: \"$\",\n get expanded() {\n return d;\n },\n children: (E, R) => {\n Zt(E, {\n get value() {\n return s();\n }\n });\n },\n $$slots: { default: !0 }\n });\n }, b = (C) => {\n var E = _5(), R = v(E, !0);\n m(E), B(() => D(R, s())), w(C, E);\n }, y = (C) => {\n Zt(C, {\n get value() {\n return s();\n }\n });\n };\n K(p, (C) => {\n c(t) ? C(g) : typeof s() == \"string\" ? C(b, 1) : C(y, -1);\n });\n }\n return m(f), B(() => h = Ne(f, 1, \"svelte-1ozhyqj\", null, h, { expandable: c(t) })), w(r, f), st(u);\n}\nrt(\n Ko,\n {\n value: {},\n shouldShowPreview: {},\n shouldTreatIterableAsObject: {},\n defaultExpandedPaths: {},\n defaultExpandedLevel: {}\n },\n [],\n [],\n { mode: \"open\" }\n);\nvar T5 = S('<th class=\"svelte-1fg7vme\"> </th>'), M5 = S('<td class=\"svelte-1fg7vme\"><!></td>'), A5 = S('<tr class=\"svelte-1fg7vme\"><td class=\"svelte-1fg7vme\"><!></td><!></tr>'), P5 = S('<div class=\"table svelte-1fg7vme\"><table class=\"svelte-1fg7vme\"><thead><tr class=\"svelte-1fg7vme\"><th class=\"svelte-1fg7vme\">(index)</th><!></tr></thead><tbody></tbody></table></div>');\nconst N5 = {\n hash: \"svelte-1fg7vme\",\n code: `.table.svelte-1fg7vme {--json-tree-font-size: 1.2rem;--json-tree-font-family: var(--sk-font-family-mono);margin:8px;overflow:auto;max-height:200px;border:1px solid var(--sk-border);border-radius:2px;overscroll-behavior:none;}table.svelte-1fg7vme {border-collapse:collapse;line-height:1;font-family:var(--sk-font-family-mono);}th.svelte-1fg7vme {background:var(--sk-bg-3);padding:0.5rem 1rem;border:none;position:sticky;font-weight:normal;font-size:1.4rem;top:0;}td.svelte-1fg7vme {font-family:var(--sk-font-family-mono);font-size:1.2rem;padding:0.5rem 1rem;border-bottom:none;}tr.svelte-1fg7vme {background:var(--sk-bg-1);}tr.svelte-1fg7vme:nth-child(2n) {background:var(--sk-bg-3);}th.svelte-1fg7vme,\n\ttd.svelte-1fg7vme {border-right:1px solid var(--sk-bg-3);}`\n};\nfunction nv(r, e) {\n nt(e, !1), bt(r, N5);\n const t = Vt();\n let n = ce(e, \"data\", 12), s = ce(e, \"columns\", 12);\n function o(p, g) {\n let b = !1;\n const y = /* @__PURE__ */ new Set();\n if (g)\n g.forEach((R) => y.add(R));\n else\n for (const R in p) {\n const q = p[R];\n typeof q == \"object\" ? Object.keys(q).forEach((O) => y.add(O)) : b = !0;\n }\n const C = Array.isArray(p), E = Object.keys(p).map((R) => {\n const q = p[R], O = [];\n for (const M of y)\n O.push(typeof q == \"object\" && M in q ? q[M] : \"\");\n return b && O.push(typeof q != \"object\" ? q : \"\"), { key: C ? parseInt(R) : R, values: O };\n });\n return b && y.add(\"Value\"), { columns: y, rows: E };\n }\n Kt(() => (Le(n()), Le(s())), () => {\n k(t, o(n(), s()));\n }), Yr();\n var i = {\n get data() {\n return n();\n },\n set data(p) {\n n(p), de();\n },\n get columns() {\n return s();\n },\n set columns(p) {\n s(p), de();\n }\n };\n Tr();\n var a = P5(), l = v(a), d = v(l), u = v(d), f = x(v(u));\n tt(f, 1, () => (c(t), Ue(() => c(t).columns)), pt, (p, g) => {\n var b = T5(), y = v(b, !0);\n m(b), B(() => D(y, c(g))), w(p, b);\n }), m(u), m(d);\n var h = x(d);\n return tt(h, 5, () => (c(t), Ue(() => c(t).rows)), pt, (p, g) => {\n var b = A5(), y = v(b), C = v(y);\n {\n var E = (O) => {\n var M = qe();\n B(() => D(M, (c(g), Ue(() => c(g).key)))), w(O, M);\n }, R = (O) => {\n Ko(O, {\n get value() {\n return c(g), Ue(() => c(g).key);\n }\n });\n };\n K(C, (O) => {\n c(g), Ue(() => typeof c(g).key == \"string\") ? O(E) : O(R, -1);\n });\n }\n m(y);\n var q = x(y);\n tt(q, 1, () => (c(g), Ue(() => c(g).values)), pt, (O, M) => {\n var P = M5(), L = v(P);\n {\n var $ = (U) => {\n var F = qe();\n B(() => D(F, c(M))), w(U, F);\n }, J = (U) => {\n Ko(U, {\n get value() {\n return c(M);\n }\n });\n };\n K(L, (U) => {\n typeof c(M) == \"string\" ? U($) : U(J, -1);\n });\n }\n m(P), w(O, P);\n }), m(b), w(p, b);\n }), m(h), m(l), m(a), w(r, a), st(i);\n}\nrt(nv, { data: {}, columns: {} }, [], [], { mode: \"open\" });\nvar O5 = S('<span class=\"count svelte-xc1wig\"> </span>'), $5 = S(\"<span></span>\"), I5 = S('<span class=\"meta svelte-xc1wig\">Console was cleared</span>'), z5 = S('<span class=\"meta meta-error svelte-xc1wig\">Message could not be cloned. Open devtools to see it</span>'), R5 = S(\"<pre> </pre>\"), j5 = S('<span class=\"styled svelte-xc1wig\"></span>'), L5 = S(\"<!><!>\", 1), D5 = S('<span class=\"values svelte-xc1wig\"></span>'), F5 = S('<span> </span> <span class=\"location svelte-xc1wig\"> </span>', 1), B5 = S('<div class=\"stack svelte-xc1wig\"></div>'), H5 = S('<div class=\"outline svelte-xc1wig\"></div>'), q5 = S('<!> <div><div role=\"button\" tabindex=\"0\"><!> <!> <!></div> <!> <!></div> <!>', 1);\nconst V5 = {\n hash: \"svelte-xc1wig\",\n code: `.line.svelte-xc1wig {--bg: var(--sk-bg-1);--border: var(--sk-bg-3);font:var(--sk-font-mono);display:block;position:relative;width:100%;text-align:left;border-width:1px;border-style:solid none none none;border-color:var(--border);background:var(--bg);}.warn.svelte-xc1wig {--bg: var(--warning-bg);--border: var(--warning-border);}.error.svelte-xc1wig {--bg: var(--error-bg);--border: var(--error-border);}.warn.svelte-xc1wig,\n\t.error.svelte-xc1wig {border-style:solid none;& + & {border-top:none;}}.log.svelte-xc1wig {padding:0.5rem 1rem 0.5rem calc(1rem + var(--indent));display:flex;gap:1rem;width:100%;font-size:1.2rem;align-items:start;}.log.expandable.svelte-xc1wig {cursor:pointer;}.values.svelte-xc1wig {display:block;flex:1;}.stack.svelte-xc1wig {display:grid;grid-template-columns:minmax(0, auto) minmax(auto, 1fr);grid-gap:0 2rem;font-size:1.2rem;margin:0 1rem 0.4rem calc(1em + var(--indent));overflow:hidden;line-height:1.5;.location:where(.svelte-xc1wig) {position:relative;background:var(--bg);&::before {content:'';position:absolute;width:1rem;height:100%;left:-1rem;top:0;background:linear-gradient(to right, transparent, var(--bg));}}}.count.svelte-xc1wig {position:relative;display:flex;justify-content:center;align-items:center;min-width:1.5em;height:1.4em;padding:0.5em;border-radius:0.4rem;background-color:var(--sk-fg-3);color:var(--sk-bg-1);font-size:1rem;}.meta.svelte-xc1wig {color:var(--sk-fg-4);font:var(--sk-font-ui-small);}.meta-error.svelte-xc1wig {color:var(--error-fg);}.outline.svelte-xc1wig {border-left:1px solid #9c9cab;position:absolute;top:0;bottom:-1px;}.arrow.svelte-xc1wig {font-size:0.9rem;transition:150ms;transform-origin:50% 50%;transform:translateY(2px);}.arrow.expand.svelte-xc1wig {transform:translateY(2px) rotateZ(90deg);}.styled.svelte-xc1wig {white-space:pre-wrap;}`\n};\nfunction yd(r, e) {\n nt(e, !0), bt(r, V5);\n let t = ce(e, \"log\", 7), n = ce(e, \"depth\", 7, 0);\n function s() {\n t().collapsed = !t().collapsed;\n }\n let o;\n function i(T) {\n o ??= document.createElement(\"span\").style, o.cssText = T;\n for (const I in o) {\n const te = o[I];\n typeof te == \"string\" && te.includes(\"url(\") && (o[I] = te.replace(/url\\([^)]+\\)/g, \"\"));\n }\n return o.position = \"static\", o.cssText;\n }\n function a(T = []) {\n if (T.length === 0) return T;\n if (typeof T[0] != \"string\")\n return T.map((A) => ({ type: \"value\", value: A }));\n T = T.slice();\n const I = T.shift().split(/(%[sdifoOc])/g), te = [];\n I[0] !== \"\" && te.push({ type: \"value\", value: I[0] });\n for (let A = 1; A < I.length; A += 2) {\n const V = I[A], H = I[A + 1], ne = T.shift();\n switch (V) {\n case \"%s\":\n te.push({ type: \"value\", value: String(ne), formatted: !0 });\n break;\n case \"%d\":\n case \"%i\":\n te.push({\n type: \"value\",\n value: typeof ne == \"symbol\" ? NaN : parseInt(ne, 10),\n formatted: !0\n });\n break;\n case \"%f\":\n te.push({\n type: \"value\",\n value: typeof ne == \"symbol\" ? NaN : parseFloat(ne),\n formatted: !0\n });\n break;\n case \"%o\":\n case \"%O\":\n te.push({ type: \"value\", value: ne, formatted: !0 });\n break;\n case \"%c\":\n te.push({\n type: \"style\",\n style: i(String(ne)),\n value: H,\n formatted: !0\n });\n break;\n }\n V !== \"%c\" && H !== \"\" && te.push({ type: \"value\", value: H, formatted: !0 });\n }\n for (const A of T)\n te.push({ type: \"value\", value: A });\n return te;\n }\n const l = { \"&\": \"&\", \"<\": \"<\", \">\": \">\" };\n function d(T) {\n return T.replace(/[&<>]/g, (I) => l[I]);\n }\n function u(T) {\n return T.replace(/(http|ftp|https):\\/\\/([\\w_-]+(?:(?:\\.[\\w_-]+)+))([\\w.,@?^=%&:\\/~+#-]*[\\w@?^=%&\\/~+#-])/g, (I) => `<a target=\"_blank\" href=\"${I}\">${I}</a>`);\n }\n function f(T) {\n return T.name + `\n` + (T.stack ?? T.message ?? \"\").replace(/^\\n+/, \"\");\n }\n var h = {\n get log() {\n return t();\n },\n set log(T) {\n t(T), de();\n },\n get depth() {\n return n();\n },\n set depth(T = 0) {\n n(T), de();\n }\n }, p = q5(), g = ke(p);\n {\n var b = (T) => {\n nv(T, {\n get data() {\n return t().data;\n },\n get columns() {\n return t().columns;\n }\n });\n };\n K(g, (T) => {\n t().command === \"table\" && T(b);\n });\n }\n var y = x(g, 2), C = v(y);\n let E;\n var R = v(C);\n {\n var q = (T) => {\n var I = O5(), te = v(I, !0);\n m(I), B(() => D(te, t().count)), w(T, I);\n };\n K(R, (T) => {\n t().count && t().count > 1 && T(q);\n });\n }\n var O = x(R, 2);\n {\n var M = (T) => {\n var I = $5();\n let te;\n I.textContent = \"\u25B6\", B(() => te = Ne(I, 1, \"arrow svelte-xc1wig\", null, te, { expand: !t().collapsed })), w(T, I);\n };\n K(O, (T) => {\n (t().stack || t().command === \"group\") && T(M);\n });\n }\n var P = x(O, 2);\n {\n var L = (T) => {\n var I = I5();\n w(T, I);\n }, $ = (T) => {\n var I = z5();\n w(T, I);\n }, J = (T) => {\n Ko(T, {\n get value() {\n return t().data;\n }\n });\n }, U = (T) => {\n var I = D5();\n tt(I, 21, () => a(t().args), pt, (te, A) => {\n var V = L5(), H = ke(V);\n {\n var ne = (se) => {\n var ue = qe();\n ue.nodeValue = \" \", w(se, ue);\n };\n K(H, (se) => {\n c(A).formatted || se(ne);\n });\n }\n var X = x(H);\n {\n var G = (se) => {\n var ue = lt(), le = ke(ue);\n {\n var re = (ge) => {\n var Se = R5(), _e = v(Se, !0);\n m(Se), B((Re) => D(_e, Re), [() => f(c(A).value)]), w(ge, Se);\n }, ae = (ge) => {\n {\n let Se = ie(() => t().expanded ? 1 : 0);\n Ko(ge, {\n get value() {\n return c(A).value;\n },\n get defaultExpandedLevel() {\n return c(Se);\n }\n });\n }\n };\n K(le, (ge) => {\n c(A).value instanceof Error ? ge(re) : ge(ae, -1);\n });\n }\n w(se, ue);\n }, Y = (se) => {\n var ue = j5();\n Af(ue, () => u(d(c(A).value)), !0), m(ue), B(() => Vs(ue, c(A).style)), fe(\"click\", ue, (le) => le.stopPropagation()), w(se, ue);\n };\n K(X, (se) => {\n c(A).type === \"value\" ? se(G) : se(Y, -1);\n });\n }\n w(te, V);\n }), m(I), w(T, I);\n };\n K(P, (T) => {\n t().command === \"clear\" ? T(L) : t().command === \"unclonable\" ? T($, 1) : t().command === \"table\" ? T(J, 2) : T(U, -1);\n });\n }\n m(C);\n var F = x(C, 2);\n {\n var z = (T) => {\n var I = B5();\n tt(I, 21, () => t().stack, pt, (te, A) => {\n var V = F5(), H = ke(V), ne = v(H, !0);\n m(H);\n var X = x(H, 2), G = v(X, !0);\n m(X), B(() => {\n D(ne, c(A).label), D(G, c(A).location);\n }), w(te, V);\n }), m(I), w(T, I);\n };\n K(F, (T) => {\n t().stack && !t().collapsed && T(z);\n });\n }\n var _ = x(F, 2);\n tt(_, 17, () => new Array(n()), pt, (T, I, te) => {\n var A = H5();\n Vs(A, `left: ${te * 15 + 15}px`), w(T, A);\n }), m(y);\n var N = x(y, 2);\n {\n var Q = (T) => {\n var I = lt(), te = ke(I);\n tt(te, 17, () => t().logs ?? [], pt, (A, V) => {\n {\n let H = ie(() => n() + 1);\n yd(A, {\n get log() {\n return c(V);\n },\n get depth() {\n return c(H);\n }\n });\n }\n }), w(T, I);\n };\n K(N, (T) => {\n t().command === \"group\" && !t().collapsed && T(Q);\n });\n }\n return B(() => {\n Ne(y, 1, `${t().command ?? \"\"} line`, \"svelte-xc1wig\"), Vs(y, `--indent: ${n() * 15}px`), E = Ne(C, 1, \"log svelte-xc1wig\", null, E, { expandable: t().stack || t().command === \"group\" });\n }), fe(\"click\", C, s), w(r, p), st(h);\n}\nhr([\"click\"]);\nrt(yd, { log: {}, depth: {} }, [], [], { mode: \"open\" });\nvar W5 = S('<div class=\"container svelte-15n5q7y\"></div>');\nconst U5 = {\n hash: \"svelte-15n5q7y\",\n code: `.container.svelte-15n5q7y {--error-fg: #da106e;--error-bg: #fff0f0;--error-border: rgb(242, 214, 219);--warning-bg: rgb(254, 251, 218);--warning-border: rgb(242, 232, 163);--json-tree-string-color: var(--shiki-token-string);--json-tree-font-family: var(--sk-font-family-mono);--json-tree-font-size: 1.2rem;--json-tree-li-line-height: 1.5;:root.dark & {--error-fg: rgb(235, 78, 109);--error-bg: rgb(71, 48, 54);--error-border: rgb(109, 65, 76);--warning-bg: rgb(64, 56, 34);--warning-border: rgb(86, 86, 51);--json-tree-property-color: #72a2d3;--json-tree-string-color: #6cd1c7;--json-tree-symbol-color: #6cd1c7;--json-tree-boolean-color: #9681f7;--json-tree-function-color: #e59b6f;--json-tree-number-color: #9681f7;--json-tree-label-color: #9ca0a5;--json-tree-arrow-color: #e8eaed;--json-tree-null-color: #81868a;--json-tree-undefined-color: #81868a;--json-tree-date-color: #9ca0a5;--json-tree-operator-color: #e8eaed;--json-tree-regex-color: #6cd1c7;}p,\n\t\t\tol,\n\t\t\tul {font:var(--json-tree-font-family);font-size:var(--json-tree-font-size);line-height:1.5;}}`\n};\nfunction sv(r, e) {\n nt(e, !1), bt(r, U5);\n let t = ce(e, \"logs\", 12);\n var n = {\n get logs() {\n return t();\n },\n set logs(o) {\n t(o), de();\n }\n }, s = W5();\n return tt(s, 5, t, pt, (o, i) => {\n yd(o, {\n get log() {\n return c(i);\n }\n });\n }), m(s), w(r, s), st(n);\n}\nrt(sv, { logs: {} }, [], [], { mode: \"open\" });\nvar J5 = 44, bf = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\", K5 = new Uint8Array(64), ov = new Uint8Array(128);\nfor (let r = 0; r < bf.length; r++) {\n const e = bf.charCodeAt(r);\n K5[r] = e, ov[e] = r;\n}\nfunction uo(r, e) {\n let t = 0, n = 0, s = 0;\n do {\n const i = r.next();\n s = ov[i], t |= (s & 31) << n, n += 5;\n } while (s & 32);\n const o = t & 1;\n return t >>>= 1, o && (t = -2147483648 | -t), e + t;\n}\nfunction yf(r, e) {\n return r.pos >= e ? !1 : r.peek() !== J5;\n}\nvar G5 = class {\n constructor(r) {\n this.pos = 0, this.buffer = r;\n }\n next() {\n return this.buffer.charCodeAt(this.pos++);\n }\n peek() {\n return this.buffer.charCodeAt(this.pos);\n }\n indexOf(r) {\n const { buffer: e, pos: t } = this, n = e.indexOf(r, t);\n return n === -1 ? e.length : n;\n }\n};\nfunction Y5(r) {\n const { length: e } = r, t = new G5(r), n = [];\n let s = 0, o = 0, i = 0, a = 0, l = 0;\n do {\n const d = t.indexOf(\";\"), u = [];\n let f = !0, h = 0;\n for (s = 0; t.pos < d; ) {\n let p;\n s = uo(t, s), s < h && (f = !1), h = s, yf(t, d) ? (o = uo(t, o), i = uo(t, i), a = uo(t, a), yf(t, d) ? (l = uo(t, l), p = [s, o, i, a, l]) : p = [s, o, i, a]) : p = [s], u.push(p), t.pos++;\n }\n f || X5(u), n.push(u), t.pos = d + 1;\n } while (t.pos <= e);\n return n;\n}\nfunction X5(r) {\n r.sort(Q5);\n}\nfunction Q5(r, e) {\n return r[0] - e[0];\n}\nfunction Z5(r, e) {\n if (!r) return;\n const t = r.split(`\n`)[1], n = /<anonymous>:(\\d+):(\\d+)\\)$/.exec(t);\n if (!n) return null;\n const s = +n[1], o = +n[2];\n return eE({ line: s, column: o }, e);\n}\nfunction eE(r, e) {\n const n = Y5(e.mappings)[r.line - 1];\n for (let s = 0; s < n.length; s += 1) {\n const o = n[s];\n if (o[0] === r.column) {\n const [, i, a, l] = o;\n return { source: e.sources[i ?? 0].slice(2), line: (a ?? 0) + 1, column: l };\n }\n }\n return null;\n}\nconst tE = `<!doctype html>\n<html>\n\t<head>\n\t\t<style id=\"injected\"></style>\n\n\t\t<script>\n\t\t\t(function () {\n\t\t\t\tconst style = document.querySelector('style#injected');\n\t\t\t\tlet styles = '';\n\n\t\t\t\tfunction send(payload, origin = '*') {\n\t\t\t\t\tif (payload.command === 'info' && payload.args[0] instanceof Error) {\n\t\t\t\t\t\tconst error = payload.args[0];\n\n\t\t\t\t\t\tif (/^(CreatedAt|UpdatedAt|TracedAt)Error$/.test(error.name)) {\n\t\t\t\t\t\t\t// structuredClone obliterates useful info\n\t\t\t\t\t\t\t// TODO do this for all errors?\n\t\t\t\t\t\t\tpayload.args[0] = {\n\t\t\t\t\t\t\t\ttype: '__error',\n\t\t\t\t\t\t\t\tname: error.name,\n\t\t\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t\t\t\tstack: error.stack\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tparent.postMessage(payload, origin);\n\t\t\t\t}\n\n\t\t\t\twindow.addEventListener('message', ({ origin, data }) => {\n\t\t\t\t\tlet { action, cmd_id } = data;\n\n\t\t\t\t\tconst reply = (payload) => send({ ...payload, cmd_id }, origin);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (action === 'set_theme') {\n\t\t\t\t\t\t\tdocument.body.classList.toggle('dark', data.args.theme === 'dark');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (action === 'eval') {\n\t\t\t\t\t\t\tif (data.args.style !== undefined && styles !== (styles = data.args.style)) {\n\t\t\t\t\t\t\t\tstyle.textContent = styles;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t(0, eval)(data.args.script);\n\n\t\t\t\t\t\t\t// hand focus back to the editor if it's taken in an effect\n\t\t\t\t\t\t\t// that runs immediately (for focuses in effects, this is\n\t\t\t\t\t\t\t// more effective than listening for the focusin event)\n\t\t\t\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\t\t\t\tif (document.activeElement !== null && document.activeElement !== document.body) {\n\t\t\t\t\t\t\t\t\tsend({ type: 'iframe_took_focus' });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (action === 'catch_clicks') {\n\t\t\t\t\t\t\tdocument.body.addEventListener('click', (event) => {\n\t\t\t\t\t\t\t\tif (event.which !== 1) return;\n\t\t\t\t\t\t\t\tif (event.metaKey || event.ctrlKey || event.shiftKey) return;\n\t\t\t\t\t\t\t\tif (event.defaultPrevented) return;\n\n\t\t\t\t\t\t\t\t// ensure target is a link\n\t\t\t\t\t\t\t\tlet el = event.target;\n\t\t\t\t\t\t\t\twhile (el && el.nodeName !== 'A') el = el.parentNode;\n\t\t\t\t\t\t\t\tif (!el || el.nodeName !== 'A') return;\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tel.hasAttribute('download') ||\n\t\t\t\t\t\t\t\t\tel.getAttribute('rel') === 'external' ||\n\t\t\t\t\t\t\t\t\tel.target\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t\t\tconst href = el.getAttribute('href') || '';\n\t\t\t\t\t\t\t\tconst url = new URL(href, 'https://preview.local');\n\t\t\t\t\t\t\t\tif (url.origin === 'https://preview.local') {\n\t\t\t\t\t\t\t\t\tif (url.hash[0] === '#') {\n\t\t\t\t\t\t\t\t\t\twindow.location.hash = url.hash;\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tconst getVirtualPath = () => {\n\t\t\t\t\t\t\t\t\t\tconst hash = window.location.hash;\n\t\t\t\t\t\t\t\t\t\tif (hash.startsWith('#')) {\n\t\t\t\t\t\t\t\t\t\t\tconst rawPath = hash.substring(1).split('?')[0].split('#')[0];\n\t\t\t\t\t\t\t\t\t\t\treturn rawPath || '/';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn '/';\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\tconst virtualPathname = getVirtualPath();\n\t\t\t\t\t\t\t\t\tif (url.pathname && url.pathname !== virtualPathname) {\n\t\t\t\t\t\t\t\t\t\twindow.location.hash = url.pathname + url.search + url.hash;\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Same-site link to current virtual path; do nothing\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\twindow.open(el.href, '_blank');\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treply({ action: 'cmd_ok' });\n\t\t\t\t\t} catch ({ message, stack }) {\n\t\t\t\t\t\treply({ action: 'cmd_error', message, stack });\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\twindow.onerror = function (msg, url, lineNo, columnNo, error) {\n\t\t\t\t\tsend({ action: 'error', value: error });\n\t\t\t\t};\n\n\t\t\t\twindow.addEventListener('unhandledrejection', (event) => {\n\t\t\t\t\tsend({ action: 'unhandledrejection', value: event.reason });\n\t\t\t\t});\n\n\t\t\t\t// Intercept console methods\n\t\t\t\tconst timers = new Map();\n\t\t\t\tconst counters = new Map();\n\n\t\t\t\tfunction log(command, opts) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsend({ action: 'console', command, ...opts });\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tsend({ action: 'console', command: 'unclonable' });\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction stringify(args) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn JSON.stringify(args, (key, value) => {\n\t\t\t\t\t\t\t// if we don't do this, our Set/Map from svelte/reactivity would show up wrong in the console\n\t\t\t\t\t\t\tif (value instanceof Map) {\n\t\t\t\t\t\t\t\treturn { type: 'Map', value };\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (value instanceof Set) {\n\t\t\t\t\t\t\t\treturn { type: 'Set', value };\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// if we don't handle bigints separately, they will cause JSON.stringify to blow up\n\t\t\t\t\t\t\tif (typeof value === 'bigint') {\n\t\t\t\t\t\t\t\treturn { type: 'BigInt', value: value + '' };\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/** @param {string} method */\n\t\t\t\tfunction stack(method) {\n\t\t\t\t\treturn new Error().stack\n\t\t\t\t\t\t.split('\\\\n')\n\t\t\t\t\t\t.filter((line) => {\n\t\t\t\t\t\t\tif (/[(@]about:srcdoc/.test(line)) return false;\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.slice(1)\n\t\t\t\t\t\t.map((line) => {\n\t\t\t\t\t\t\tline = line\n\t\t\t\t\t\t\t\t.replace('console[method]', \\`console.\\${method}\\`)\n\t\t\t\t\t\t\t\t.replace(/console\\\\.<computed> \\\\[as \\\\w+\\\\]/, \\`console.\\${method}\\`);\n\n\t\t\t\t\t\t\tlet match =\n\t\t\t\t\t\t\t\t/^\\\\s+at (.+) \\\\((.+:\\\\d+:\\\\d+)\\\\)/.exec(line) || /^(.+)@(.+:\\\\d+:\\\\d+)?/.exec(line);\n\n\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tlabel: match[1],\n\t\t\t\t\t\t\t\t\tlocation: match[2]\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.filter((x) => x);\n\t\t\t\t}\n\n\t\t\t\tconst can_dedupe = ['log', 'info', 'dir', 'warn', 'error', 'assert', 'trace'];\n\n\t\t\t\tconst methods = {\n\t\t\t\t\tclear: () => log('clear'),\n\t\t\t\t\t// TODO make the command 'push' and the level/type 'info'\n\t\t\t\t\tlog: (...args) => log('info', { args }),\n\t\t\t\t\tinfo: (...args) => log('info', { args }),\n\t\t\t\t\tdir: (...args) => log('info', { args: [args[0]], expanded: true }),\n\t\t\t\t\twarn: (...args) => log('warn', { args, stack: stack('warn'), collapsed: true }),\n\t\t\t\t\terror: (...args) => log('error', { args, stack: stack('error'), collapsed: true }),\n\t\t\t\t\tassert: (condition, ...args) => {\n\t\t\t\t\t\tif (condition) return;\n\t\t\t\t\t\tlog('error', {\n\t\t\t\t\t\t\targs: ['Assertion failed:', ...args],\n\t\t\t\t\t\t\tstack: stack('assert'),\n\t\t\t\t\t\t\tcollapsed: true\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\tgroup: (...args) => log('group', { args, collapsed: false }),\n\t\t\t\t\tgroupCollapsed: (...args) => log('group', { args, collapsed: true }),\n\t\t\t\t\tgroupEnd: () => log('groupEnd'),\n\t\t\t\t\ttable: (...args) => {\n\t\t\t\t\t\tconst data = args[0];\n\t\t\t\t\t\tif (data && typeof data === 'object') {\n\t\t\t\t\t\t\tlog('table', { data, columns: args[1] });\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog('info', { args });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\ttime: (label = 'default') => timers.set(label, performance.now()),\n\t\t\t\t\ttimeLog: (label = 'default') => {\n\t\t\t\t\t\tconst now = performance.now();\n\t\t\t\t\t\tif (timers.has(label)) {\n\t\t\t\t\t\t\tlog('info', { args: [\\`\\${label}: \\${now - timers.get(label)}ms\\`] });\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog('warn', { args: [\\`Timer '\\${label}' does not exist\\`] });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\ttimeEnd: (label = 'default') => {\n\t\t\t\t\t\tconst now = performance.now();\n\t\t\t\t\t\tif (timers.has(label)) {\n\t\t\t\t\t\t\tlog('info', { args: [\\`\\${label}: \\${now - timers.get(label)}ms\\`] });\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog('warn', { args: [\\`Timer '\\${label}' does not exist\\`] });\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimers.delete(label);\n\t\t\t\t\t},\n\t\t\t\t\tcount: (label = 'default') => {\n\t\t\t\t\t\tcounters.set(label, (counters.get(label) || 0) + 1);\n\t\t\t\t\t\tlog('info', { args: [\\`\\${label}: \\${counters.get(label)}\\`] });\n\t\t\t\t\t},\n\t\t\t\t\tcountReset: (label = 'default') => {\n\t\t\t\t\t\tif (counters.has(label)) {\n\t\t\t\t\t\t\tcounters.set(label, 0);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog('warn', { args: [\\`Count for '\\${label}' does not exist\\`] });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\ttrace: (...args) => {\n\t\t\t\t\t\tlog('info', {\n\t\t\t\t\t\t\targs: args.length === 0 ? ['console.trace'] : args,\n\t\t\t\t\t\t\tstack: stack('trace'),\n\t\t\t\t\t\t\tcollapsed: false\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tlet previous = '';\n\n\t\t\t\tfor (const method in methods) {\n\t\t\t\t\tconst original = console[method];\n\n\t\t\t\t\tconsole[method] = (...args) => {\n\t\t\t\t\t\tconst stack = new Error().stack;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tprevious === (previous = stringify({ method, args, stack })) &&\n\t\t\t\t\t\t\tcan_dedupe.includes(method) &&\n\t\t\t\t\t\t\targs.every((arg) => !arg || typeof arg !== 'object')\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tsend({ action: 'console', command: 'duplicate' });\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmethods[method](...args);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\toriginal(...args);\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Focus management\n\t\t\t\tlet can_focus = false;\n\n\t\t\t\twindow.addEventListener('pointerdown', (e) => (can_focus = true));\n\t\t\t\twindow.addEventListener('pointerup', (e) => (can_focus = false));\n\t\t\t\twindow.addEventListener('keydown', (e) => (can_focus = true));\n\t\t\t\twindow.addEventListener('keyup', (e) => (can_focus = false));\n\n\t\t\t\twindow.addEventListener('focusin', (e) => {\n\t\t\t\t\t// if focusin happened as a result of a mouse/keyboard event, allow it\n\t\t\t\t\tif (can_focus) return;\n\n\t\t\t\t\t// if \\`e.target\\` is the \\`<body>\\` and there's a \\`relatedTarget\\`,\n\t\t\t\t\t// assume the focusin was the result of a user navigation - allow it\n\t\t\t\t\tif (e.target.tagName === 'BODY' && e.relatedTarget) return;\n\n\t\t\t\t\t// otherwise, broadcast an event that causes the editor to reclaim focus\n\t\t\t\t\tsend({ type: 'iframe_took_focus' });\n\t\t\t\t});\n\t\t\t})();\n\t\t<\\/script>\n\t</head>\n\t<body></body>\n</html>\n`, rE = `body {\n\t--bg-1: hsl(0, 0%, 100%);\n\t--bg-2: hsl(206, 20%, 90%);\n\t--bg-3: hsl(206, 20%, 80%);\n\t--fg-1: hsl(0, 0%, 13%);\n\t--fg-2: hsl(0, 0%, 20%);\n\t--fg-2: hsl(0, 0%, 30%);\n\t--link: hsl(208, 77%, 47%);\n\t--link-hover: hsl(208, 77%, 55%);\n\t--link-active: hsl(208, 77%, 40%);\n\t--border-radius: 4px;\n\t--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,\n\t\t'Open Sans', 'Helvetica Neue', sans-serif;\n\t--font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono',\n\t\tmonospace;\n\tcolor-scheme: light;\n\tbackground: var(--bg-1);\n\tcolor: var(--fg-1);\n\tfont-family: var(--font);\n\tline-height: 1.5;\n\tmargin: 1rem;\n\theight: calc(100vh - 2rem);\n\taccent-color: var(--hover) !important;\n}\n\na {\n\tcolor: var(--link);\n}\n\na:hover {\n\tcolor: var(--link-hover);\n}\n\na:active {\n\tcolor: var(--link-active);\n}\n\ncode {\n\tbackground: var(--bg-2);\n\tfont-family: var(--font-mono);\n\tfont-size: 0.9em;\n\tpadding: 0.15rem 0.3rem;\n\tborder-radius: var(--border-radius);\n}\n\nul.todos {\n\tpadding: 0;\n}\n\nbody.dark {\n\tcolor-scheme: dark;\n\t--bg-1: hsl(0, 0%, 18%);\n\t--bg-2: hsl(0, 0%, 30%);\n\t--bg-3: hsl(0, 0%, 40%);\n\t--fg-1: hsl(0, 0%, 90%);\n\t--fg-2: hsl(0, 0%, 70%);\n\t--fg-3: hsl(0, 0%, 60%);\n\t--link: hsl(206, 96%, 72%);\n\t--link-hover: hsl(206, 96%, 78%);\n\t--link-active: hsl(206, 96%, 64%);\n}\n`;\nvar nE = S('<small class=\"svelte-1tjw7kt\"> </small>'), sE = S('<div class=\"error-overlay svelte-1tjw7kt\"><div class=\"error svelte-1tjw7kt\"><h2> </h2> <pre class=\"svelte-1tjw7kt\"><code> </code></pre> <!></div></div>');\nconst oE = {\n hash: \"svelte-1tjw7kt\",\n code: \".error-overlay.svelte-1tjw7kt {position:absolute;width:100%;height:100%;top:0;padding:1em;background:rgba(0, 0, 0, 0.1);backdrop-filter:blur(5px);}.error.svelte-1tjw7kt {display:flex;flex-direction:column;gap:1em;background:var(--sk-bg-1);padding:1em;border-top:4px solid var(--sk-fg-accent);border-radius:4px;filter:drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.1));}pre.svelte-1tjw7kt {padding:0.5em;background:var(--sk-bg-3);}small.svelte-1tjw7kt {color:var(--sk-fg-4);}\"\n};\nfunction iv(r, e) {\n nt(e, !0), bt(r, oE);\n let t = ce(e, \"error\", 7);\n var n = {\n get error() {\n return t();\n },\n set error(p) {\n t(p), de();\n }\n }, s = sE(), o = v(s), i = v(o), a = v(i);\n m(i);\n var l = x(i, 2), d = v(l), u = v(d, !0);\n m(d), m(l);\n var f = x(l, 2);\n {\n var h = (p) => {\n var g = nE(), b = v(g);\n m(g), B(() => D(b, `line ${t().start.line ?? \"\"} column ${t().start.column ?? \"\"}`)), w(p, g);\n };\n K(f, (p) => {\n t().start && p(h);\n });\n }\n return m(o), m(s), B(() => {\n D(a, `Error compiling ${t().filename ?? \"component\" ?? \"\"}`), D(u, t().message);\n }), w(r, s), st(n);\n}\nrt(iv, { error: {} }, [], [], { mode: \"open\" });\nclass xf {\n #t;\n get collapsed() {\n return c(this.#t);\n }\n set collapsed(e) {\n k(this.#t, e, !0);\n }\n #r;\n get expanded() {\n return c(this.#r);\n }\n set expanded(e) {\n k(this.#r, e, !0);\n }\n #n;\n get count() {\n return c(this.#n);\n }\n set count(e) {\n k(this.#n, e, !0);\n }\n #e;\n get logs() {\n return c(this.#e);\n }\n set logs(e) {\n k(this.#e, e, !0);\n }\n constructor(e) {\n this.#t = W(!1), this.#r = W(!1), this.#n = W(1), this.#e = W(ft([])), this.command = e.command, Object.assign(this, e);\n }\n}\nvar iE = S('<div class=\"overlay svelte-rmqdm9\"><!></div>'), aE = S('<iframe title=\"Result\" frameborder=\"0\" style=\"border: none !important;\"></iframe> <!>', 1), lE = S('<button class=\"raised svelte-rmqdm9\"><!> Clear</button>'), cE = S('<div class=\"iframe-container svelte-rmqdm9\"><!></div>');\nconst dE = {\n hash: \"svelte-rmqdm9\",\n code: `.iframe-container.svelte-rmqdm9 {position:absolute;background-color:var(--sk-bg-1, white);border:none !important;border-top:none !important;width:100%;height:100%;}iframe.svelte-rmqdm9 {width:100%;height:100%;border:none !important;display:block;}.greyed-out.svelte-rmqdm9 {filter:grayscale(50%) blur(1px);opacity:0.25;}\n\n\t/* TODO this stuff should live in global styles */button.svelte-rmqdm9 {font:var(--sk-font-ui-small);text-transform:uppercase;display:block;padding:0.3rem 0.8rem;&:disabled {color:var(--sk-fg-4);}}.overlay.svelte-rmqdm9 {position:absolute;top:0;width:100%;}`\n};\nfunction av(r, e) {\n nt(e, !0), bt(r, dE);\n const t = (A) => {\n var V = aE(), H = ke(V);\n let ne;\n bn(H, (Y) => k(E, Y), () => c(E));\n var X = x(H, 2);\n {\n var G = (Y) => {\n var se = iE(), ue = v(se);\n {\n var le = (ae) => {\n iv(ae, {\n get error() {\n return c(p).error;\n }\n });\n }, re = (ae) => {\n qm(ae, {\n kind: \"error\",\n get details() {\n return n();\n }\n });\n };\n K(ue, (ae) => {\n c(p)?.error ? ae(le) : n() && ae(re, 1);\n });\n }\n m(se), w(Y, se);\n };\n K(X, (Y) => {\n (c(p)?.error || n()) && Y(G);\n });\n }\n B(\n (Y) => {\n Ge(H, \"sandbox\", Y), ne = Ne(H, 1, cs(n() || q || c(R) ? \"greyed-out\" : \"\"), \"svelte-rmqdm9\", ne, { inited: c(P) }), Ge(H, \"srcdoc\", tE);\n },\n [\n () => [\n \"allow-scripts\",\n \"allow-popups\",\n \"allow-forms\",\n \"allow-pointer-lock\",\n \"allow-modals\",\n i() ? \"allow-popups-to-escape-sandbox\" : \"\",\n o() ? \"allow-same-origin\" : \"\"\n ].join(\" \")\n ]\n ), w(A, V);\n };\n let n = ce(e, \"error\", 15), s = ce(e, \"status\", 7), o = ce(e, \"relaxed\", 7, !1), i = ce(e, \"can_escape\", 7, !1), a = ce(e, \"injectedJS\", 7, \"\"), l = ce(e, \"injectedCSS\", 7, \"\"), d = ce(e, \"theme\", 7), u = ce(e, \"bundler\", 7), f = ce(e, \"onLog\", 7, void 0), h = iS(), p = ie(() => (u() ?? h?.bundler)?.result ?? null), g = W(ft([])), b = [], y = c(g), C, E = W(void 0), R = W(0), q = !1, O = W(null), M = W(!1), P = W(!1);\n Ar(() => {\n k(O, new gS(c(E), {\n on_fetch_progress: (V) => {\n k(R, V, !0);\n },\n on_error: (V) => {\n J({ command: \"error\", args: [V.value] }), $(V.value);\n },\n on_unhandled_rejection: (V) => {\n let H = V.value;\n typeof H == \"string\" && (H = { message: H }), H.message = \"Uncaught (in promise): \" + H.message, J({ command: \"error\", args: [H] }), $(H);\n },\n on_iframe_reload: () => {\n k(M, !1);\n },\n on_console: (V) => {\n switch (V.command) {\n case \"clear\":\n _(), J(V);\n break;\n case \"group\":\n U(V);\n break;\n case \"groupEnd\":\n F();\n break;\n case \"duplicate\":\n z();\n break;\n default:\n J(V);\n }\n }\n }));\n const A = () => {\n c(O)?.handle_links(), k(M, !0), Ue(() => {\n L(c(p));\n });\n };\n return c(E).addEventListener(\"load\", A), c(E).contentDocument?.readyState === \"complete\" && A(), () => {\n c(O)?.destroy();\n };\n }), kr(() => {\n c(M) && c(O)?.iframe_command(\"set_theme\", { theme: d() });\n });\n async function L(A) {\n if (A) {\n try {\n _(), A.error || (await c(O)?.eval(\n `\n\t\t\t\t\t${a()}\n\n\t\t\t\t\tif (!window.__setup_focus_handling) {\n\t\t\t\t\t\tlet can_focus = false;\n\n\t\t\t\t\t\twindow.addEventListener('pointerdown', (e) => (can_focus = true));\n\t\t\t\t\t\twindow.addEventListener('pointerup', (e) => (can_focus = false));\n\t\t\t\t\t\twindow.addEventListener('keydown', (e) => (can_focus = true));\n\t\t\t\t\t\twindow.addEventListener('keyup', (e) => (can_focus = false));\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The iframe sometimes takes focus control in ways we can't prevent\n\t\t\t\t\t\t * while the editor is focused. Refocus the editor in these cases.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twindow.addEventListener('focusin', (e) => {\n\t\t\t\t\t\t\t// if focusin happened as a result of a mouse/keyboard event, allow it\n\t\t\t\t\t\t\tif (can_focus) return;\n\n\t\t\t\t\t\t\t// if \\`e.target\\` is the \\`<body>\\` and there's a \\`relatedTarget\\`,\n\t\t\t\t\t\t\t// assume the focusin was the result of a user navigation \u2014 allow it\n\t\t\t\t\t\t\tif (e.target.tagName === 'BODY' && e.relatedTarget) return;\n\n\t\t\t\t\t\t\t// otherwise, broadcast an event that causes the editor to reclaim focus\n\t\t\t\t\t\t\tparent.postMessage({ type: 'iframe_took_focus' }, '*');\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\twindow.__setup_focus_handling = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t{\n\t\t\t\t\t\tif (window.__unmount_previous) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\twindow.__unmount_previous();\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// The preview bundler injects component CSS as anonymous style\n\t\t\t\t\t\t// tags. Make rebuilds deterministic by clearing old component\n\t\t\t\t\t\t// styles after unmount, while keeping the base injected stylesheet.\n\t\t\t\t\t\tdocument.head.querySelectorAll('style:not(#injected)').forEach((style) => style.remove());\n\t\t\t\t\t\twindow.__reset_custom_elements?.();\n\n\t\t\t\t\t\tdocument.body.innerHTML = '';\n\t\t\t\t\t\twindow._svelteTransitionManager = null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!window.__reset_custom_elements) {\n\t\t\t\t\t\tconst registered = new Map();\n\t\t\t\t\t\tconst define = CustomElementRegistry.prototype.define;\n\t\t\t\t\t\tCustomElementRegistry.prototype.define = function(name, el, options) {\n\t\t\t\t\t\t\tlet ce = registered.get(name);\n\t\t\t\t\t\t\tif (ce) {\n\t\t\t\t\t\t\t\tif (ce.registered) {\n\t\t\t\t\t\t\t\t\t// trigger error of re-registering\n\t\t\t\t\t\t\t\t\tdefine.call(this, name, ce.el, options);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (ce.options?.extends != options?.extends) {\n\t\t\t\t\t\t\t\t\tparent.postMessage({ action: 'iframe_reload' }, '*');\n\t\t\t\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tce.el = el;\n\t\t\t\t\t\t\t\tce.registered = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tce = { el, options, registered: true };\n\t\t\t\t\t\t\t\tregistered.set(name, ce);\n\t\t\t\t\t\t\t\tconst Wrapper = class extends el {\n\t\t\t\t\t\t\t\t\tconnectedCallback() {\n\t\t\t\t\t\t\t\t\t\tce.el.prototype.connectedCallback?.apply(this, arguments);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdisconnectedCallback() {\n\t\t\t\t\t\t\t\t\t\tce.el.prototype.disconnectedCallback?.apply(this, arguments);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tadoptedCallback() {\n\t\t\t\t\t\t\t\t\t\tce.el.prototype.adoptedCallback?.apply(this, arguments);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tconst DynamicWrapper = new Proxy(Wrapper, {\n\t\t\t\t\t\t\t\t\tconstruct: function (_, args, newTarget) {\n\t\t\t\t\t\t\t\t\t\treturn Reflect.construct(ce.el, args, newTarget);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tdefine.call(this, name, DynamicWrapper, options);\n\t\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\t\tconsole.error(error);\n\t\t\t\t\t\t\t\t\tthrow new Error('Failed to define a custom element '+name);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\twindow.__reset_custom_elements = () => {\n\t\t\t\t\t\t\tfor (const ce of registered.values()) {\n\t\t\t\t\t\t\t\tif (ce.registered) {\n\t\t\t\t\t\t\t\t\tce.el = HTMLElement;\n\t\t\t\t\t\t\t\t\tce.registered = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst __repl_exports = ${A.client?.code};\n\t\t\t\t\t{\n\t\t\t\t\t\tconst { mount, unmount, App, untrack } = __repl_exports;\n\n\t\t\t\t\t\tconst console_methods = ['log', 'error', 'trace', 'assert', 'warn', 'table', 'group'];\n\n\t\t\t\t\t\t// The REPL hooks up to the console to provide a virtual console. However, the implementation\n\t\t\t\t\t\t// needs to stringify the console to pass over a MessageChannel, which means that the object\n\t\t\t\t\t\t// can get deeply read and tracked by accident when using the console. We can avoid this by\n\t\t\t\t\t\t// ensuring we untrack the main console methods.\n\n\t\t\t\t\t\tconst original = {};\n\n\t\t\t\t\t\tfor (const method of console_methods) {\n\t\t\t\t\t\t\toriginal[method] = console[method];\n\t\t\t\t\t\t\tconsole[method] = function (...v) {\n\t\t\t\t\t\t\t\treturn untrack(() => original[method].apply(this, v));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet component;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcomponent = mount(App, { target: document.body });\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\twindow.__unmount_previous = () => {\n\t\t\t\t\t\t\t\tfor (const method of console_methods) {\n\t\t\t\t\t\t\t\t\tconsole[method] = original[method];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (component) unmount(component);\n\t\t\t\t\t\t\t\twindow.__unmount_previous = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//# sourceURL=playground:output\n\t\t\t\t`,\n A?.css ?? rE\n ), n(null));\n } catch (V) {\n console.error(V), $(V);\n }\n k(P, !0);\n }\n }\n kr(() => {\n if (c(M)) {\n const A = c(p);\n Ue(() => {\n L(A);\n });\n }\n }), kr(() => {\n l() && c(O) && c(M) && c(O).eval(`{\n\t\t\t\t\tconst style = document.createElement('style');\n\t\t\t\t\tstyle.textContent = ${JSON.stringify(l())};\n\t\t\t\t\tdocument.head.appendChild(style);\n\t\t\t\t}`);\n });\n function $(A) {\n const V = c(p)?.client?.map, H = V && Z5(A.stack, V);\n H && (A.filename = H.source, A.loc = { line: H.line, column: H.column ?? 0 }), n(A);\n }\n function J(A) {\n const V = new xf(A);\n y.push(C = V), f()?.(c(g));\n }\n function U(A) {\n const V = new xf(A);\n y.push(V), b.push(y), y = V.logs, f()?.(c(g));\n }\n function F() {\n const A = b.pop();\n A && (y = A);\n }\n function z() {\n C.count += 1, y.includes(C) ? f()?.(c(g)) : J(C);\n }\n function _() {\n y = k(g, [], !0), f()?.(c(g));\n }\n var N = {\n get error() {\n return n();\n },\n set error(A) {\n n(A), de();\n },\n get status() {\n return s();\n },\n set status(A) {\n s(A), de();\n },\n get relaxed() {\n return o();\n },\n set relaxed(A = !1) {\n o(A), de();\n },\n get can_escape() {\n return i();\n },\n set can_escape(A = !1) {\n i(A), de();\n },\n get injectedJS() {\n return a();\n },\n set injectedJS(A = \"\") {\n a(A), de();\n },\n get injectedCSS() {\n return l();\n },\n set injectedCSS(A = \"\") {\n l(A), de();\n },\n get theme() {\n return d();\n },\n set theme(A) {\n d(A), de();\n },\n get bundler() {\n return u();\n },\n set bundler(A) {\n u(A), de();\n },\n get onLog() {\n return f();\n },\n set onLog(A = void 0) {\n f(A), de();\n }\n }, Q = cE(), T = v(Q);\n {\n var I = (A) => {\n Wm(A, {\n pos: \"100%\",\n panel: \"Console\",\n get main() {\n return t;\n },\n header: (ne) => {\n var X = lE(), G = v(X);\n {\n var Y = (se) => {\n var ue = qe();\n B(() => D(ue, `(${c(g).length ?? \"\"})`)), w(se, ue);\n };\n K(G, (se) => {\n c(g).length > 0 && se(Y);\n });\n }\n Pe(), m(X), B(() => X.disabled = c(g).length === 0), fe(\"click\", X, (se) => {\n se.stopPropagation(), _();\n }), w(ne, X);\n },\n body: (ne) => {\n sv(ne, {\n get logs() {\n return c(g);\n }\n });\n },\n $$slots: { header: !0, body: !0 }\n });\n }, te = (A) => {\n t(A);\n };\n K(T, (A) => {\n f() ? A(te, -1) : A(I);\n });\n }\n return m(Q), w(r, Q), st(N);\n}\nhr([\"click\"]);\nrt(\n av,\n {\n error: {},\n status: {},\n relaxed: {},\n can_escape: {},\n injectedJS: {},\n injectedCSS: {},\n theme: {},\n bundler: {},\n onLog: {}\n },\n [],\n [],\n { mode: \"open\" }\n);\nvar uE = S('<div class=\"preview-loading svelte-i6xel3\"><!> <p class=\"svelte-i6xel3\">Loading files...</p></div>'), fE = S('<div class=\"preview-root svelte-i6xel3\"><div class=\"preview-content svelte-i6xel3\"><!></div></div>');\nconst pE = {\n hash: \"svelte-i6xel3\",\n code: `.preview-root.svelte-i6xel3 {display:flex;flex-direction:column;height:100%;background:var(--bgColor-default, #ffffff);flex:1;overflow:hidden;border-top:none !important;}.preview-content.svelte-i6xel3 {flex:1;position:relative;overflow:hidden;border-top:none !important;}.preview-loading.svelte-i6xel3 {display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:var(--base-size-16, 1rem);}.preview-loading.svelte-i6xel3 p:where(.svelte-i6xel3) {color:var(--fgColor-muted, #656d76);font-size:var(--text-body-size-medium, 0.875rem);margin:0;}\n\n\t@media (max-width: 900px) {.preview-root.svelte-i6xel3 {\n\t\t\t/* keep content above the collapsed sheet grabber (3.5rem header) */padding-bottom:3.5rem;}\n\t}`\n};\nfunction lv(r, e) {\n nt(e, !0), bt(r, pE);\n const t = eg;\n let n = ce(e, \"onClose\", 7, () => {\n });\n const { repoFiles: s, cms: o, preview: i } = yn();\n let a = W(void 0);\n const l = `\n\t\t(function() {\n\t\t\t// Helper to get active path from iframe's hash (e.g. \"#/about\" -> \"/about\")\n\t\t\tconst getIframePath = () => {\n\t\t\t\tconst hash = window.location.hash;\n\t\t\t\tif (hash.startsWith('#')) {\n\t\t\t\t\treturn hash.substring(1);\n\t\t\t\t}\n\t\t\t\treturn '/';\n\t\t\t};\n\n\t\t\t// 1. Mount initially at correct parent route before SvelteKit boots\n\t\t\tlet initialPath = '/';\n\t\t\ttry {\n\t\t\t\tconst parentHash = window.parent.location.hash;\n\t\t\t\tif (parentHash && parentHash.includes('#website/content')) {\n\t\t\t\t\tconst parts = parentHash.replace('#website/content', '').split('/').filter(Boolean);\n\t\t\t\t\tif (parts.length > 0) {\n\t\t\t\t\t\tconst contentId = parts[0];\n\t\t\t\t\t\tconst recordId = parts[1] || null;\n\t\t\t\t\t\tif (contentId === 'home' || contentId === 'index' || contentId === 'page_home' || contentId === 'landing') {\n\t\t\t\t\t\t\tinitialPath = '/';\n\t\t\t\t\t\t} else if (recordId) {\n\t\t\t\t\t\t\tinitialPath = '/' + contentId + '/' + recordId;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinitialPath = '/' + contentId;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn('[Preview] Could not read parent hash:', e);\n\t\t\t}\n\n\t\t\tif (getIframePath() !== initialPath) {\n\t\t\t\twindow.location.hash = initialPath;\n\t\t\t}\n\n\t\t\t// 2. Track URL changes and report to parent window\n\t\t\tconst handleUrlChange = () => {\n\t\t\t\tconst pathname = getIframePath();\n\t\t\t\twindow.parent.postMessage({\n\t\t\t\t\ttype: 'preview_navigation',\n\t\t\t\t\tpathname\n\t\t\t\t}, '*');\n\t\t\t};\n\n\t\t\twindow.addEventListener('hashchange', handleUrlChange);\n\n\t\t\tif (document.readyState === 'complete') {\n\t\t\t\thandleUrlChange();\n\t\t\t} else {\n\t\t\t\twindow.addEventListener('load', handleUrlChange);\n\t\t\t}\n\n\t\t\t// 3. Listen to navigate requests from parent\n\t\t\twindow.addEventListener('message', (event) => {\n\t\t\t\tif (event.data && event.data.type === 'preview_navigate_to') {\n\t\t\t\t\tconst targetPath = event.data.path;\n\t\t\t\t\tif (getIframePath() !== targetPath) {\n\t\t\t\t\t\twindow.location.hash = targetPath;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t})();\n\t`;\n function d(M, P, L) {\n if (!P) return null;\n const $ = M.replace(/^\\/+|\\/+$/g, \"\"), J = $.split(\"/\").filter(Boolean);\n if (J.length === 0) {\n const z = Hm(P);\n return z ? { contentId: z, recordId: null } : null;\n }\n const U = J[0];\n if (P[U] && P[U].isCollection) {\n const z = U;\n if (J.length > 1) {\n const _ = J[1], N = L[z] || {};\n if (N[_])\n return { contentId: z, recordId: _ };\n for (const [Q, T] of Object.entries(N))\n if (T.slug === _ || T.id === _)\n return { contentId: z, recordId: Q };\n return { contentId: z, recordId: null };\n }\n return { contentId: z, recordId: null };\n }\n if (P[U])\n return { contentId: U, recordId: null };\n const F = J[J.length - 1];\n for (const [z, _] of Object.entries(P))\n if (_.isCollection) {\n const N = L[z] || {};\n if (N[F])\n return { contentId: z, recordId: F };\n for (const [Q, T] of Object.entries(N))\n if (T.slug === F || T.slug === $)\n return { contentId: z, recordId: Q };\n }\n return P[F] ? { contentId: F, recordId: null } : null;\n }\n function u(M, P, L, $) {\n if (!M) return \"/\";\n if ((L?.[M]?.isCollection ?? !1) && P) {\n const _ = $?.[M]?.[P]?.slug || P;\n return M === \"posts\" || M === \"articles\" ? `/blog/${_}` : `/${M}/${_}`;\n }\n return [\"home\", \"index\", \"page_home\", \"page_index\", \"landing\"].includes(M) ? \"/\" : `/${M}`;\n }\n function f(M) {\n let P = 5381;\n for (let L = 0; L < M.length; L++)\n P = (P << 5) + P ^ M.charCodeAt(L);\n return (P >>> 0).toString(36);\n }\n function h(M) {\n const P = M.path.replace(/^\\/+/, \"\"), L = P.startsWith(\"frontend/static/\") ? P.slice(16) : P, $ = /* @__PURE__ */ new Set();\n return L && ($.add(`/${L}`), $.add(`/${L.split(\"/\").map(encodeURIComponent).join(\"/\")}`)), $.add(`/${M.name}`), $.add(`/${encodeURIComponent(M.name)}`), [...$];\n }\n function p(M, P) {\n if (P.length === 0) return M;\n const L = [];\n for (const $ of P)\n !$.content || !$.mimeType || L.push({\n candidates: h($),\n dataUrl: `data:${$.mimeType};base64,${$.content}`\n });\n return L.length === 0 ? M : M.map(($) => {\n let J = $.content;\n for (const { candidates: U, dataUrl: F } of L)\n for (const z of U)\n J.includes(z) && (J = J.split(z).join(F));\n return { path: $.path, content: J };\n });\n }\n const g = ie(() => {\n s.previewVersion;\n const M = s.srcFiles.map((L) => ({ path: L.path, content: L.content })), P = s.staticAssets.map((L) => ({\n name: L.name,\n path: L.path,\n content: L.content,\n mimeType: L.mimeType\n }));\n return Tg(p(M, P), { debug: t });\n }), b = ie(() => (s.previewVersion, JSON.stringify({\n src: s.srcFiles.map((M) => [M.path, M.sha, f(M.content)]),\n static: s.staticAssets.map((M) => [M.path, f(M.content), M.mimeType])\n })));\n Ar(() => {\n const M = (P) => {\n if (!o) return;\n const L = P.data;\n if (L && L.type === \"preview_navigation\") {\n if (!window.location.hash.startsWith(\"#website/content\")) return;\n const { pathname: $ } = L, J = o.collections.config, U = o.collections.data, F = d($, J, U);\n if (F) {\n const { contentId: z, recordId: _ } = F;\n (o.contentId !== z || o.recordId !== _) && (_ ? window.location.hash = `#website/content/${z}/${_}` : window.location.hash = `#website/content/${z}`);\n }\n }\n };\n return window.addEventListener(\"message\", M), i.ensureBundler(), () => {\n window.removeEventListener(\"message\", M);\n };\n }), kr(() => {\n if (!i.bundler || c(g).length === 0) return;\n const M = c(g), P = c(b);\n Ue(() => {\n i.compile(M, P, {\n svelte_version: \"latest\",\n runes: !0,\n tailwind: !0,\n aliases: { $lib: \"lib\" }\n });\n });\n }), kr(() => {\n if (!o) return;\n const M = o.contentId, P = o.recordId;\n if (!M) return;\n const L = o.collections.config, $ = o.collections.data, J = u(M, P ?? null, L, $), U = c(a)?.querySelector(\"iframe\");\n U && U.contentWindow && U.contentWindow.postMessage({ type: \"preview_navigate_to\", path: J }, \"*\");\n });\n var y = {\n get onClose() {\n return n();\n },\n set onClose(M = () => {\n }) {\n n(M), de();\n }\n }, C = fE(), E = v(C), R = v(E);\n {\n var q = (M) => {\n var P = uE(), L = v(P);\n Pf(L, {}), Pe(2), m(P), w(M, P);\n }, O = (M) => {\n av(M, {\n get bundler() {\n return i.bundler;\n },\n get status() {\n return i.status;\n },\n theme: \"light\",\n can_escape: !0,\n relaxed: !0,\n injectedJS: l,\n onLog: () => {\n },\n get error() {\n return i.compileError;\n },\n set error(P) {\n i.compileError = P;\n }\n });\n };\n K(R, (M) => {\n !i.bundler || s.isLoading || s.isSyncing ? M(q) : M(O, -1);\n });\n }\n return m(E), m(C), bn(C, (M) => k(a, M), () => c(a)), w(r, C), st(y);\n}\nrt(lv, { onClose: {} }, [], [], { mode: \"open\" });\nfunction cv(r, e) {\n nt(e, !0);\n const t = ro(), { notifications: n, collections: s } = t;\n let o = ce(e, \"handleAssetChange\", 7, (l) => {\n }), i = ce(e, \"preselected\", 7, \"\");\n var a = {\n get handleAssetChange() {\n return o();\n },\n set handleAssetChange(l = (d) => {\n }) {\n o(l), de();\n },\n get preselected() {\n return i();\n },\n set preselected(l = \"\") {\n i(l), de();\n }\n };\n return kc(r, {\n get handleAssetChange() {\n return o();\n },\n get preselected() {\n return i();\n },\n currentModule: \"cms\",\n get notifications() {\n return n;\n },\n get collections() {\n return s;\n }\n }), st(a);\n}\nrt(cv, { handleAssetChange: {}, preselected: {} }, [], [], { mode: \"open\" });\nvar hE = S(\"<!> <!>\", 1), mE = S('<div class=\"reference-item restrict svelte-1m4gq13\"><div class=\"reference-path svelte-1m4gq13\"><span class=\"collection-name svelte-1m4gq13\"> </span> \u2192 <span class=\"record-name svelte-1m4gq13\"> </span> \u2192 <span class=\"field-name svelte-1m4gq13\"> </span></div> <div class=\"action-label restrict-label svelte-1m4gq13\">Restricted</div></div>'), vE = S('<p class=\"info-text svelte-1m4gq13\">The following records reference this record:</p> <div class=\"references-list svelte-1m4gq13\"></div>', 1), gE = S(\n `<p class=\"warning-text svelte-1m4gq13\">Cannot delete <strong> </strong> because it is referenced by other records with\n\t\t\trestricted deletion.</p> <!> <p class=\"help-text svelte-1m4gq13\">To delete this record, you must first remove these references or change the field\n\t\t\tconfiguration.</p>`,\n 1\n), bE = S('<div class=\"reference-item set-null svelte-1m4gq13\"><div class=\"reference-path svelte-1m4gq13\"><span class=\"collection-name svelte-1m4gq13\"> </span> \u2192 <span class=\"record-name svelte-1m4gq13\"> </span> \u2192 <span class=\"field-name svelte-1m4gq13\"> </span></div> <div class=\"action-label set-null-label svelte-1m4gq13\">Clear reference</div></div>'), yE = S('<div class=\"action-section svelte-1m4gq13\"><h3 class=\"action-title svelte-1m4gq13\">References will be cleared:</h3> <div class=\"references-list svelte-1m4gq13\"></div></div>'), xE = S('<div class=\"reference-item cascade svelte-1m4gq13\"><div class=\"reference-path svelte-1m4gq13\"><span class=\"collection-name svelte-1m4gq13\"> </span> \u2192 <span class=\"record-name svelte-1m4gq13\"> </span> \u2192 <span class=\"field-name svelte-1m4gq13\"> </span></div> <div class=\"action-label cascade-label svelte-1m4gq13\">Will delete</div></div>'), wE = S('<div class=\"action-section svelte-1m4gq13\"><h3 class=\"action-title cascade-title svelte-1m4gq13\">Records will also be deleted:</h3> <div class=\"references-list svelte-1m4gq13\"></div></div>'), kE = S('<p class=\"svelte-1m4gq13\">Are you sure you want to delete <strong> </strong>?</p> <p class=\"warning-text svelte-1m4gq13\">This will affect the following records:</p> <!> <!> <p class=\"warning-text svelte-1m4gq13\">This action cannot be undone.</p>', 1), CE = S('<p class=\"svelte-1m4gq13\">Are you sure you want to delete <strong> </strong>?</p> <p class=\"warning-text svelte-1m4gq13\">This action cannot be undone.</p>', 1);\nconst _E = {\n hash: \"svelte-1m4gq13\",\n code: `p.svelte-1m4gq13 {margin:0 0 var(--base-size-12, 0.75rem) 0;color:var(--fgColor-default);line-height:1.5;}.warning-text.svelte-1m4gq13 {color:var(--fgColor-danger);font-weight:var(--base-text-weight-medium, 500);}.info-text.svelte-1m4gq13 {margin-top:var(--base-size-12, 0.75rem);font-weight:var(--base-text-weight-medium, 500);}.help-text.svelte-1m4gq13 {margin-top:var(--base-size-12, 0.75rem);color:var(--fgColor-muted);font-size:var(--text-body-size-small, 0.75rem);}.action-section.svelte-1m4gq13 {margin:var(--base-size-16, 1rem) 0;}.action-title.svelte-1m4gq13 {margin:0 0 var(--base-size-8, 0.5rem) 0;font-size:var(--text-body-size-medium, 0.875rem);font-weight:var(--base-text-weight-semibold, 600);color:var(--fgColor-default);}.action-title.cascade-title.svelte-1m4gq13 {color:var(--fgColor-danger);}.references-list.svelte-1m4gq13 {margin:var(--base-size-8, 0.5rem) 0;max-height:12rem;overflow-y:auto;border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);background:var(--bgColor-muted);}.reference-item.svelte-1m4gq13 {padding:var(--base-size-8, 0.5rem) var(--base-size-12, 0.75rem);border-bottom:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);display:flex;justify-content:space-between;align-items:center;gap:var(--base-size-12, 0.75rem);}.reference-item.svelte-1m4gq13:last-child {border-bottom:none;}.reference-item.restrict.svelte-1m4gq13 {background:var(--bgColor-danger-muted, rgba(255, 129, 130, 0.1));}.reference-item.cascade.svelte-1m4gq13 {background:var(--bgColor-danger-muted, rgba(255, 129, 130, 0.1));}.reference-item.set-null.svelte-1m4gq13 {background:var(--bgColor-attention-muted, rgba(187, 128, 9, 0.1));}.reference-path.svelte-1m4gq13 {font-size:var(--text-body-size-small, 0.75rem);color:var(--fgColor-default);display:flex;align-items:center;gap:var(--base-size-4, 0.25rem);flex-wrap:wrap;flex:1;}.collection-name.svelte-1m4gq13 {font-weight:var(--base-text-weight-semibold, 600);color:var(--fgColor-accent);}.record-name.svelte-1m4gq13 {font-weight:var(--base-text-weight-medium, 500);}.field-name.svelte-1m4gq13 {color:var(--fgColor-muted);font-style:italic;}.action-label.svelte-1m4gq13 {font-size:var(--text-body-size-small, 0.75rem);font-weight:var(--base-text-weight-medium, 500);padding:var(--base-size-2, 0.125rem) var(--base-size-8, 0.5rem);border-radius:var(--borderRadius-small, 0.25rem);white-space:nowrap;}.restrict-label.svelte-1m4gq13 {background:var(--bgColor-danger-emphasis);color:var(--fgColor-onEmphasis);}.cascade-label.svelte-1m4gq13 {background:var(--bgColor-danger-emphasis);color:var(--fgColor-onEmphasis);}.set-null-label.svelte-1m4gq13 {background:var(--bgColor-attention-emphasis);color:var(--fgColor-onEmphasis);}`\n};\nfunction dv(r, e) {\n nt(e, !0), bt(r, _E);\n const t = ro(), n = ie(() => t.collections);\n let s = ce(e, \"recordName\", 7), o = ce(e, \"canDelete\", 7), i = ce(e, \"restrictReferences\", 7), a = ce(e, \"cascadeReferences\", 7), l = ce(e, \"setNullReferences\", 7), d = ce(e, \"config\", 7), u = ce(e, \"onCancel\", 7), f = ce(e, \"onDelete\", 7);\n function h(y, C) {\n return !d() || !y || !C ? C || \"Unknown Field\" : d()[y]?.fields?.[C]?.label || C;\n }\n function p(y) {\n return !d() || !y ? y || \"Unknown\" : d()[y]?.title || y;\n }\n const g = ie(() => i().length > 0 || a().length > 0 || l().length > 0);\n var b = {\n get recordName() {\n return s();\n },\n set recordName(y) {\n s(y), de();\n },\n get canDelete() {\n return o();\n },\n set canDelete(y) {\n o(y), de();\n },\n get restrictReferences() {\n return i();\n },\n set restrictReferences(y) {\n i(y), de();\n },\n get cascadeReferences() {\n return a();\n },\n set cascadeReferences(y) {\n a(y), de();\n },\n get setNullReferences() {\n return l();\n },\n set setNullReferences(y) {\n l(y), de();\n },\n get config() {\n return d();\n },\n set config(y) {\n d(y), de();\n },\n get onCancel() {\n return u();\n },\n set onCancel(y) {\n u(y), de();\n },\n get onDelete() {\n return f();\n },\n set onDelete(y) {\n f(y), de();\n }\n };\n return Sc(r, {\n open: !0,\n title: \"Delete Record\",\n get onClose() {\n return u();\n },\n maxWidth: \"45rem\",\n footer: (C) => {\n var E = hE(), R = ke(E);\n Je(R, {\n variant: \"default\",\n get onclick() {\n return u();\n },\n children: (M, P) => {\n Pe();\n var L = qe(\"Cancel\");\n w(M, L);\n },\n $$slots: { default: !0 }\n });\n var q = x(R, 2);\n {\n var O = (M) => {\n Je(M, {\n variant: \"danger\",\n get onclick() {\n return f();\n },\n children: (P, L) => {\n Pe();\n var $ = qe(\"Delete\");\n w(P, $);\n },\n $$slots: { default: !0 }\n });\n };\n K(q, (M) => {\n o() && M(O);\n });\n }\n w(C, E);\n },\n children: (C, E) => {\n var R = lt(), q = ke(R);\n {\n var O = (L) => {\n var $ = gE(), J = ke($), U = x(v(J)), F = v(U, !0);\n m(U), Pe(), m(J);\n var z = x(J, 2);\n {\n var _ = (N) => {\n var Q = vE(), T = x(ke(Q), 2);\n tt(T, 21, i, pt, (I, te) => {\n var A = mE(), V = v(A), H = v(V), ne = v(H, !0);\n m(H);\n var X = x(H, 2), G = v(X, !0);\n m(X);\n var Y = x(X, 2), se = v(Y, !0);\n m(Y), m(V), Pe(2), m(A), B(\n (ue, le, re) => {\n D(ne, ue), D(G, le), D(se, re);\n },\n [\n () => p(c(te).contentId),\n () => bo(c(n).data, d(), c(te).contentId, c(te).recordId),\n () => h(c(te).contentId, c(te).fieldName)\n ]\n ), w(I, A);\n }), m(T), w(N, Q);\n };\n K(z, (N) => {\n i().length > 0 && N(_);\n });\n }\n Pe(2), B(() => D(F, s())), w(L, $);\n }, M = (L) => {\n var $ = kE(), J = ke($), U = x(v(J)), F = v(U, !0);\n m(U), Pe(), m(J);\n var z = x(J, 4);\n {\n var _ = (T) => {\n var I = yE(), te = x(v(I), 2);\n tt(te, 21, l, pt, (A, V) => {\n var H = bE(), ne = v(H), X = v(ne), G = v(X, !0);\n m(X);\n var Y = x(X, 2), se = v(Y, !0);\n m(Y);\n var ue = x(Y, 2), le = v(ue, !0);\n m(ue), m(ne), Pe(2), m(H), B(\n (re, ae, ge) => {\n D(G, re), D(se, ae), D(le, ge);\n },\n [\n () => p(c(V).contentId),\n () => bo(c(n).data, d(), c(V).contentId, c(V).recordId),\n () => h(c(V).contentId, c(V).fieldName)\n ]\n ), w(A, H);\n }), m(te), m(I), w(T, I);\n };\n K(z, (T) => {\n l().length > 0 && T(_);\n });\n }\n var N = x(z, 2);\n {\n var Q = (T) => {\n var I = wE(), te = x(v(I), 2);\n tt(te, 21, a, pt, (A, V) => {\n var H = xE(), ne = v(H), X = v(ne), G = v(X, !0);\n m(X);\n var Y = x(X, 2), se = v(Y, !0);\n m(Y);\n var ue = x(Y, 2), le = v(ue, !0);\n m(ue), m(ne), Pe(2), m(H), B(\n (re, ae, ge) => {\n D(G, re), D(se, ae), D(le, ge);\n },\n [\n () => p(c(V).contentId),\n () => bo(c(n).data, d(), c(V).contentId, c(V).recordId),\n () => h(c(V).contentId, c(V).fieldName)\n ]\n ), w(A, H);\n }), m(te), m(I), w(T, I);\n };\n K(N, (T) => {\n a().length > 0 && T(Q);\n });\n }\n Pe(2), B(() => D(F, s())), w(L, $);\n }, P = (L) => {\n var $ = CE(), J = ke($), U = x(v(J)), F = v(U, !0);\n m(U), Pe(), m(J), Pe(2), B(() => D(F, s())), w(L, $);\n };\n K(q, (L) => {\n o() ? c(g) ? L(M, 1) : L(P, -1) : L(O);\n });\n }\n w(C, R);\n },\n $$slots: { footer: !0, default: !0 }\n }), st(b);\n}\nrt(\n dv,\n {\n recordName: {},\n canDelete: {},\n restrictReferences: {},\n cascadeReferences: {},\n setNullReferences: {},\n config: {},\n onCancel: {},\n onDelete: {}\n },\n [],\n [],\n { mode: \"open\" }\n);\nvar SE = S('<div class=\"error-message svelte-1xrtkws\"><h3 class=\"svelte-1xrtkws\">Configuration Error</h3> <p class=\"svelte-1xrtkws\"> </p></div>'), EE = S('<span class=\"item-secondary svelte-1xrtkws\"> </span>'), TE = S('<li><div class=\"record-item svelte-1xrtkws\"><a class=\"item-link svelte-1xrtkws\"><span class=\"item-body svelte-1xrtkws\"><span class=\"item-primary svelte-1xrtkws\"> </span> <!></span> <svg class=\"item-chevron svelte-1xrtkws\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M9 18l6-6-6-6\"></path></svg></a> <button type=\"button\" class=\"delete-btn svelte-1xrtkws\" aria-label=\"Delete record\"><svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6\"></path></svg></button></div></li>'), ME = S('<!> <ul class=\"record-list svelte-1xrtkws\"><li><button type=\"button\" class=\"record-item new-item svelte-1xrtkws\"><span class=\"item-icon new-icon svelte-1xrtkws\" aria-hidden=\"true\"><svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 5v14M5 12h14\"></path></svg></span> <span class=\"item-body svelte-1xrtkws\"><span class=\"item-primary svelte-1xrtkws\"> </span></span></button></li> <!></ul>', 1);\nconst AE = {\n hash: \"svelte-1xrtkws\",\n code: \".record-list.svelte-1xrtkws {list-style:none;margin:0;padding:0;}.record-item.svelte-1xrtkws {display:flex;align-items:center;border-bottom:1px solid var(--borderColor-muted, #d8dee4);transition:background-color 0.1s;}.record-item.svelte-1xrtkws:hover {background-color:var(--bgColor-muted, #f6f8fa);}.item-link.svelte-1xrtkws {display:flex;align-items:center;flex:1;min-width:0;gap:0.5rem;padding:0.75rem 0.5rem 0.75rem 1rem;text-decoration:none;color:var(--fgColor-default, #24292f);}.item-link.svelte-1xrtkws:focus-visible {outline:2px solid var(--fgColor-accent, #0969da);outline-offset:-2px;border-radius:0.25rem;}.item-body.svelte-1xrtkws {flex:1;min-width:0;display:flex;flex-direction:column;gap:0.125rem;}.item-primary.svelte-1xrtkws {font-size:0.9375rem;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--fgColor-default, #24292f);}.item-secondary.svelte-1xrtkws {font-size:0.8125rem;color:var(--fgColor-muted, #656d76);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.item-chevron.svelte-1xrtkws {flex-shrink:0;color:var(--fgColor-muted, #656d76);}.delete-btn.svelte-1xrtkws {flex-shrink:0;display:flex;align-items:center;justify-content:center;background:none;border:none;padding:0.5rem 0.75rem;cursor:pointer;color:var(--fgColor-muted, #656d76);border-radius:0.25rem;opacity:0;transition:opacity 0.1s, color 0.1s, background-color 0.1s;}.record-item.svelte-1xrtkws:hover .delete-btn:where(.svelte-1xrtkws) {opacity:1;}.delete-btn.svelte-1xrtkws:hover {color:var(--fgColor-danger, #cf222e);background-color:var(--bgColor-danger-muted, #ffebe9);}.delete-btn.svelte-1xrtkws:focus-visible {opacity:1;outline:2px solid var(--fgColor-accent, #0969da);outline-offset:-2px;}.new-item.svelte-1xrtkws {width:100%;background:none;border:none;cursor:pointer;gap:0.5rem;padding:0.75rem 1rem;text-align:left;font-family:inherit;font-size:inherit;color:var(--fgColor-accent, #0969da);}.new-item.svelte-1xrtkws:hover {background-color:var(--bgColor-muted, #f6f8fa);}.new-item.svelte-1xrtkws .item-primary:where(.svelte-1xrtkws) {color:var(--fgColor-accent, #0969da);font-weight:500;}.item-icon.svelte-1xrtkws {flex-shrink:0;display:flex;align-items:center;justify-content:center;}.new-icon.svelte-1xrtkws {color:var(--fgColor-accent, #0969da);}.error-message.svelte-1xrtkws {padding:1.5rem;border:1px solid var(--borderColor-danger-emphasis, #cf222e);border-radius:0.375rem;background-color:var(--bgColor-danger-muted, #ffebe9);color:var(--fgColor-danger, #d1242f);}.error-message.svelte-1xrtkws h3:where(.svelte-1xrtkws) {margin:0 0 0.5rem 0;font-size:1rem;font-weight:600;}.error-message.svelte-1xrtkws p:where(.svelte-1xrtkws) {margin:0;line-height:1.5;}\"\n};\nfunction uv(r, e) {\n nt(e, !0), bt(r, AE);\n let t = ce(e, \"config\", 7), n = ce(e, \"content\", 7), s = ce(e, \"collectionId\", 7), o = ce(e, \"onNewRecord\", 7);\n function i() {\n if (!n() || typeof n() != \"object\")\n throw new Error(\"[RecordList] Component requires valid content object\");\n if (!t() || !t().fields)\n throw new Error(\"[RecordList] Component requires config with fields\");\n if (!t().isCollection)\n throw new Error(\"[RecordList] Cannot render non-collection content (use Record component for globals)\");\n }\n i();\n const a = ro(), { notifications: l, collections: d } = a;\n let u = W(!1), f = W(!1), h = W(null), p = W(!0), g = W(ft([])), b = W(ft([])), y = W(ft([]));\n function C(F, z = 30) {\n return typeof F != \"string\" ? String(F) : F.length > z ? `${F.slice(0, z)}...` : F;\n }\n function E(F) {\n if (!a.contentId) return;\n const z = tg(d.data, d.config, a.contentId, F);\n k(h, F, !0), k(p, z.canDelete, !0), k(g, z.restrictReferences, !0), k(b, z.cascadeReferences, !0), k(y, z.setNullReferences, !0), k(u, !0);\n }\n async function R() {\n if (!(!a.contentId || !c(h) || c(f))) {\n k(f, !0);\n try {\n if (c(y).length > 0)\n for (const _ of c(y)) {\n const N = d.data[_.contentId];\n if (!N) continue;\n const Q = N[_.recordId];\n if (!Q) continue;\n const T = d.config[_.contentId]?.fields?.[_.fieldName];\n T && (rg(Q, _.fieldName, T.widget, c(h)), await d.updateContent(_.contentId, N));\n }\n const F = /* @__PURE__ */ new Set([c(h)]);\n if (c(b).length > 0) {\n for (const _ of c(b))\n if (F.add(_.recordId), _.contentId !== a.contentId) {\n const N = d.data[_.contentId];\n N && (delete N[_.recordId], await d.updateContent(_.contentId, N));\n }\n }\n const z = Object.fromEntries(Object.entries(n()).filter(([_]) => !F.has(_)));\n await d.updateContent(a.contentId, z), n(z), k(u, !1), l.success(\"Record marked for deletion. Click Save to commit changes.\");\n } catch (F) {\n console.error(\"Delete failed:\", F), l.error(\"Failed to delete record\");\n } finally {\n k(f, !1), k(h, null), k(g, [], !0), k(b, [], !0), k(y, [], !0);\n }\n }\n }\n function q() {\n k(u, !1), k(h, null), k(g, [], !0), k(b, [], !0), k(y, [], !0);\n }\n function O(F) {\n return (t().listFields ?? Object.keys(t().fields)).slice(1).map((_) => {\n const N = F[_];\n return N == null || N === \"\" ? \"\" : C(N, 24);\n }).filter(Boolean).join(\" \u00B7 \");\n }\n function M(F) {\n const z = t().listFields ? t().listFields[0] : Object.keys(t().fields)[0];\n return C(F[z]);\n }\n var P = {\n get config() {\n return t();\n },\n set config(F) {\n t(F), de();\n },\n get content() {\n return n();\n },\n set content(F) {\n n(F), de();\n },\n get collectionId() {\n return s();\n },\n set collectionId(F) {\n s(F), de();\n },\n get onNewRecord() {\n return o();\n },\n set onNewRecord(F) {\n o(F), de();\n }\n }, L = lt(), $ = ke(L);\n {\n var J = (F) => {\n var z = SE(), _ = x(v(z), 2), N = v(_);\n m(_), m(z), B(() => D(N, `RecordList component was rendered for global content \"${t().title ?? \"\"}\". This component only works with collections.`)), w(F, z);\n }, U = (F) => {\n var z = ME(), _ = ke(z);\n {\n var N = (ne) => {\n {\n let X = ie(() => bo(d.data, d.config, a.contentId || \"\", c(h)));\n dv(ne, {\n get recordName() {\n return c(X);\n },\n get canDelete() {\n return c(p);\n },\n get restrictReferences() {\n return c(g);\n },\n get cascadeReferences() {\n return c(b);\n },\n get setNullReferences() {\n return c(y);\n },\n get config() {\n return d.config;\n },\n onCancel: q,\n onDelete: R\n });\n }\n };\n K(_, (ne) => {\n c(u) && c(h) && ne(N);\n });\n }\n var Q = x(_, 2), T = v(Q), I = v(T), te = x(v(I), 2), A = v(te), V = v(A);\n m(A), m(te), m(I), m(T);\n var H = x(T, 2);\n tt(H, 17, () => Object.entries(n()), pt, (ne, X) => {\n var G = ie(() => is(c(X), 2));\n let Y = () => c(G)[0], se = () => c(G)[1];\n const ue = ie(() => O(se()));\n var le = TE(), re = v(le), ae = v(re), ge = v(ae), Se = v(ge), _e = v(Se, !0);\n m(Se);\n var Re = x(Se, 2);\n {\n var Ie = (j) => {\n var oe = EE(), he = v(oe, !0);\n m(oe), B(() => D(he, c(ue))), w(j, oe);\n };\n K(Re, (j) => {\n c(ue) && j(Ie);\n });\n }\n m(ge), Pe(2), m(ae);\n var Fe = x(ae, 2);\n m(re), m(le), B(\n (j) => {\n Ge(ae, \"href\", `#website/content/${s() ?? \"\"}/${Y() ?? \"\"}`), D(_e, j);\n },\n [() => M(se())]\n ), fe(\"click\", Fe, () => E(Y())), w(ne, le);\n }), m(Q), B(() => D(V, `New ${t().title ?? \"\"}`)), fe(\"click\", I, function(...ne) {\n o()?.apply(this, ne);\n }), w(F, z);\n };\n K($, (F) => {\n t().isCollection ? F(U, -1) : F(J);\n });\n }\n return w(r, L), st(P);\n}\nhr([\"click\"]);\nrt(uv, { config: {}, content: {}, collectionId: {}, onNewRecord: {} }, [], [], { mode: \"open\" });\nvar PE = S('<input type=\"hidden\" class=\"svelte-hre9ug\"/>'), NE = S('<div class=\"field svelte-hre9ug\"><div class=\"field-label-row svelte-hre9ug\"><label class=\"svelte-hre9ug\"> </label></div> <input type=\"text\" class=\"svelte-hre9ug\"/></div>'), OE = S('<div class=\"field svelte-hre9ug\"><div class=\"field-label-row svelte-hre9ug\"><label class=\"svelte-hre9ug\"> </label></div> <textarea rows=\"4\" class=\"svelte-hre9ug\"></textarea></div>'), $E = S('<div class=\"field small svelte-hre9ug\"><label class=\"svelte-hre9ug\"> </label> <input type=\"number\" class=\"svelte-hre9ug\"/></div>'), IE = S('<button type=\"button\" class=\"text-style-button svelte-hre9ug\" aria-haspopup=\"listbox\"><span class=\"text-style-label svelte-hre9ug\"> </span> <!></button>'), zE = S('<button type=\"button\" role=\"option\"><span class=\"text-style-item-label svelte-hre9ug\"> </span> <!></button>'), RE = S('<div class=\"text-style-panel svelte-hre9ug\" role=\"listbox\" tabindex=\"-1\"></div>'), jE = S('<button type=\"button\" aria-label=\"Align left\" title=\"Align left\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M0 2h16v2H0V2zm0 4h10v2H0V6zm0 4h16v2H0v-2zm0 4h10v2H0v-2z\"></path></svg></button> <button type=\"button\" aria-label=\"Align center\" title=\"Align center\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M0 2h16v2H0V2zm3 4h10v2H3V6zm-3 4h16v2H0v-2zm3 4h10v2H3v-2z\"></path></svg></button> <button type=\"button\" aria-label=\"Align right\" title=\"Align right\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M0 2h16v2H0V2zm6 4h10v2H6V6zm-6 4h16v2H0v-2zm6 4h10v2H6v-2z\"></path></svg></button>', 1), LE = S('<div class=\"link-widget svelte-hre9ug\"><input type=\"text\" placeholder=\"Link\" class=\"svelte-hre9ug\"/> <button type=\"button\" class=\"add svelte-hre9ug\">Add</button></div>'), DE = S('<div class=\"toolbar svelte-hre9ug\"><div class=\"text-style-selector svelte-hre9ug\"><!> <!></div> <div class=\"separator svelte-hre9ug\"></div> <!> <div class=\"separator svelte-hre9ug\"></div> <button type=\"button\" aria-label=\"Bold\" class=\"svelte-hre9ug\"><!></button> <button type=\"button\" aria-label=\"Italic\" class=\"svelte-hre9ug\"><!></button> <button type=\"button\" aria-label=\"Underline\" class=\"svelte-hre9ug\"><span style=\"text-decoration: underline; font-weight: 600;\">U</span></button> <div class=\"separator svelte-hre9ug\"></div> <button type=\"button\" aria-label=\"Bullet list\" class=\"svelte-hre9ug\"><!></button> <button type=\"button\" aria-label=\"Numbered list\" class=\"svelte-hre9ug\"><!></button> <div class=\"separator svelte-hre9ug\"></div> <button type=\"button\" class=\"link svelte-hre9ug\" aria-label=\"Insert link\"><!></button> <button type=\"button\" class=\"image svelte-hre9ug\" aria-label=\"Insert image\"><!></button> <!></div>'), FE = S('<div class=\"field svelte-hre9ug\"><div class=\"field-label-row svelte-hre9ug\"><label class=\"svelte-hre9ug\"> </label> <!></div> <div class=\"rich-text-container svelte-hre9ug\"><!> <div class=\"rich-editor svelte-hre9ug\" role=\"textbox\" aria-multiline=\"true\" tabindex=\"0\"></div></div></div>'), BE = S('<div class=\"field small svelte-hre9ug\"><!></div>'), HE = S('<div class=\"field small svelte-hre9ug\"><label class=\"svelte-hre9ug\"> </label> <input type=\"date\" class=\"svelte-hre9ug\"/></div>'), qE = S('<div class=\"field small svelte-hre9ug\"><label class=\"svelte-hre9ug\"> </label> <input type=\"datetime-local\" class=\"svelte-hre9ug\"/></div>'), VE = S('<div class=\"field small svelte-hre9ug\"><!></div>'), WE = S('<div class=\"field small svelte-hre9ug\"><!></div>'), UE = S('<div class=\"field svelte-hre9ug\"><label class=\"svelte-hre9ug\"> </label> <!></div>'), JE = S('<div class=\"field svelte-hre9ug\"><label class=\"svelte-hre9ug\"> </label> <input type=\"text\" readonly=\"\" class=\"svelte-hre9ug\"/></div>'), KE = S('<div class=\"field small svelte-hre9ug\"><!></div>'), GE = S('<div class=\"field small svelte-hre9ug\"><!></div>'), YE = S('<div class=\"record-container svelte-hre9ug\"></div> <!>', 1);\nconst XE = {\n hash: \"svelte-hre9ug\",\n code: `.record-container.svelte-hre9ug {display:flex;flex-direction:column;gap:var(--base-size-16, 1rem);}\n\n\t/* FormControl container */.field.svelte-hre9ug {display:flex;flex-direction:column;gap:var(--base-size-8, 0.5rem);}.field.small.svelte-hre9ug {max-width:var(--base-size-400, 25rem);}.field-label-row.svelte-hre9ug {display:flex;align-items:center;justify-content:space-between;gap:var(--base-size-8, 0.5rem);}.field-label-row.svelte-hre9ug label:where(.svelte-hre9ug) {margin-bottom:0;}\n\n\t/* Labels - descriptive and concise, sentence case */label.svelte-hre9ug {font-weight:var(--base-text-weight-medium, 500);font-size:var(--text-body-size-medium, 0.875rem);color:var(--fgColor-default);display:block;margin-bottom:var(--base-size-4, 0.25rem);}\n\n\t/* Input elements - properly sized with consistent padding */input[type='text'].svelte-hre9ug,\n\tinput[type='number'].svelte-hre9ug,\n\tinput[type='date'].svelte-hre9ug,\n\tinput[type='datetime-local'].svelte-hre9ug,\n\ttextarea.svelte-hre9ug, \n\tselect {padding:var(--control-medium-paddingBlock, 0.375rem)\n\t\t\tvar(--control-medium-paddingInline-normal, 0.75rem);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);font-size:var(--text-body-size-medium, 0.875rem);line-height:var(--text-body-lineHeight-medium, 1.4285);font-family:inherit;background-color:var(--bgColor-default);color:var(--fgColor-default);transition:border-color 0.2s ease;box-shadow:var(--shadow-inset, inset 0 1px 0 rgba(208, 215, 222, 0.2));}\n\n\t/* Focus states */input.svelte-hre9ug:focus-visible,\n\ttextarea.svelte-hre9ug:focus-visible, \n\tselect:focus-visible {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;border-color:var(--fgColor-accent);box-shadow:none;}\n\t/* Checkbox and Radio controls - Primer UI style */.checkbox-container {display:flex;align-items:center;gap:var(--base-size-8, 0.5rem);padding:var(--base-size-8, 0.5rem) 0;}.checkbox-input {display:flex;align-items:center;}.primer-checkbox {width:var(--base-size-16, 1rem);height:var(--base-size-16, 1rem);margin:0;cursor:pointer;border-radius:var(--borderRadius-small, 0.25rem);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);}.checkbox-label {display:flex;align-items:center;}.checkbox-label label {font-weight:var(--base-text-weight-normal, 400);margin-bottom:0;cursor:pointer;}\n\n\t/* CheckboxGroup / RadioGroup - Select multiple */.select-multiple {border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);padding:var(--base-size-8, 0.5rem);display:flex;flex-direction:column;gap:var(--base-size-8, 0.5rem);background-color:var(--bgColor-default);}.select-multiple div.svelte-hre9ug {display:flex;align-items:center;gap:var(--base-size-8, 0.5rem);padding:var(--base-size-4, 0.25rem);}.select-multiple input[type='checkbox'] {width:var(--base-size-16, 1rem);height:var(--base-size-16, 1rem);margin:0;cursor:pointer;}.select-multiple label.svelte-hre9ug {font-weight:var(--base-text-weight-normal, 400);margin-bottom:0;cursor:pointer;}\n\t/* Rich text editor container - no gap between toolbar and editor */.rich-text-container.svelte-hre9ug {display:flex;flex-direction:column;border-radius:var(--borderRadius-medium, 0.375rem);}.rich-text-container.svelte-hre9ug:focus-within {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;}.rich-text-container.svelte-hre9ug:focus-within .toolbar:where(.svelte-hre9ug) {border-color:var(--fgColor-accent);}.rich-text-container.svelte-hre9ug:focus-within .rich-editor:where(.svelte-hre9ug) {border-color:var(--fgColor-accent);}\n\n\t/* Rich text editor toolbar */.toolbar.svelte-hre9ug {display:flex;align-items:center;gap:var(--base-size-4, 0.25rem);padding:var(--base-size-8, 0.5rem);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-bottom:none;border-radius:var(--borderRadius-medium, 0.375rem) var(--borderRadius-medium, 0.375rem) 0 0;background:var(--bgColor-muted);flex-wrap:wrap;position:relative;transition:border-color 0.2s ease;}.toolbar select {font-size:var(--text-body-size-small, 0.75rem);padding:var(--base-size-4, 0.25rem) var(--base-size-8, 0.5rem);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-radius:var(--borderRadius-small, 0.25rem);background-color:var(--bgColor-default);cursor:pointer;}.toolbar.svelte-hre9ug button:where(.svelte-hre9ug) {padding:var(--base-size-4, 0.25rem) var(--base-size-8, 0.5rem);border:none;background:transparent;cursor:pointer;border-radius:var(--borderRadius-small, 0.25rem);color:var(--fgColor-default);display:flex;align-items:center;justify-content:center;transition:background-color 0.2s ease;}.toolbar.svelte-hre9ug button:where(.svelte-hre9ug):hover {background:var(\n\t\t\t--control-transparent-bgColor-hover,\n\t\t\tvar(--color-action-list-item-default-hover-bg)\n\t\t);}.toolbar.svelte-hre9ug button.active:where(.svelte-hre9ug) {background:var(\n\t\t\t--control-transparent-bgColor-selected,\n\t\t\trgba(9, 105, 218, 0.08)\n\t\t);color:var(--fgColor-accent);}.toolbar.svelte-hre9ug button:where(.svelte-hre9ug):focus-visible {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;}.separator.svelte-hre9ug {width:var(--borderWidth-thin, 1px);height:var(--base-size-20, 1.25rem);background:var(--borderColor-default);margin-inline:var(--base-size-4, 0.25rem);}\n\t/* Toolbar widgets (link and image) */.link-widget.svelte-hre9ug, \n\t.image-widget {position:absolute;top:100%;left:0;margin-top:var(--base-size-4, 0.25rem);background:var(--bgColor-default);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);padding:var(--base-size-8, 0.5rem);display:flex;gap:var(--base-size-8, 0.5rem);z-index:10;box-shadow:var(--shadow-floating-medium, 0 6px 16px rgba(31, 35, 40, 0.12));}.link-widget.svelte-hre9ug input:where(.svelte-hre9ug), \n\t.image-widget input {min-width:15rem;}.link-widget.svelte-hre9ug button.add:where(.svelte-hre9ug), \n\t.image-widget button.add {padding:var(--base-size-4, 0.25rem) var(--base-size-12, 0.75rem);background:var(--button-default-bgColor-rest);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--button-default-borderColor-rest);border-radius:var(--borderRadius-medium, 0.375rem);color:var(--button-default-fgColor-rest);font-size:var(--text-body-size-medium, 0.875rem);font-weight:var(--base-text-weight-medium, 500);cursor:pointer;}.link-widget.svelte-hre9ug button.add:where(.svelte-hre9ug):hover, \n\t.image-widget button.add:hover {background:var(--button-default-bgColor-hover);}.image-widget.second {position:relative;top:0;margin-top:var(--base-size-8, 0.5rem);}.image-widget button.assets {padding:var(--base-size-4, 0.25rem) var(--base-size-12, 0.75rem);background:var(--button-default-bgColor-rest);border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--button-default-borderColor-rest);border-radius:var(--borderRadius-medium, 0.375rem);color:var(--button-default-fgColor-rest);font-size:var(--text-body-size-medium, 0.875rem);font-weight:var(--base-text-weight-medium, 500);cursor:pointer;}\n\n\t/* Asset button */.asset-btn {padding:0;border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-radius:var(--borderRadius-medium, 0.375rem);background:var(--bgColor-default);cursor:pointer;transition:all 0.2s ease;width:fit-content;}.asset-btn:hover {border-color:var(--borderColor-emphasis);box-shadow:var(--shadow-resting-small, 0 1px 0 rgba(31, 35, 40, 0.04));}.asset-btn:focus-visible {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;border-color:var(--fgColor-accent);}.asset-preview {width:120px;height:120px;display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--borderRadius-medium, 0.375rem);}.asset-preview img, \n\t.asset-preview video {width:100%;height:100%;object-fit:cover;display:block;}.video-thumbnail {position:relative;width:100%;height:100%;cursor:pointer;}.video-thumbnail video {width:100%;height:100%;object-fit:cover;border-radius:var(--borderRadius-medium, 0.375rem);pointer-events:none;}.play-button {position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);background:none;border:none;padding:0;cursor:pointer;transition:transform 150ms ease,\n\t\t\topacity 150ms ease;opacity:0.9;display:flex;align-items:center;justify-content:center;}.play-button:hover {transform:translate(-50%, -50%) scale(1.1);opacity:1;}.play-button:focus-visible {outline:2px solid white;outline-offset:4px;border-radius:50%;}.asset-preview.placeholder, \n\t.asset-preview.empty {background:var(--bgColor-muted);color:var(--fgColor-muted);}.asset-preview.empty {border:2px dashed var(--borderColor-default);}.overlay-backdrop {position:fixed;inset:0;background:var(--overlay-backdrop, rgba(175, 184, 193, 0.2));display:flex;align-items:center;justify-content:center;z-index:999;}.overlay {background:var(--bgColor-default);border-radius:var(--borderRadius-large, 0.75rem);box-shadow:var(\n\t\t\t--shadow-floating-large,\n\t\t\t0 1px 3px rgba(31, 35, 40, 0.12),\n\t\t\t0 8px 24px rgba(66, 74, 83, 0.12)\n\t\t);max-width:min(var(--base-size-800, 50rem), 90vw);max-height:90vh;display:flex;flex-direction:column;}.overlay h2 {padding:var(--base-size-16, 1rem) var(--base-size-24, 1.5rem);margin:0;border-bottom:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);color:var(--fgColor-default);}.assets {padding:var(--base-size-16, 1rem);overflow-y:auto;}.btn-end {display:flex;justify-content:flex-end;gap:var(--stack-gap-normal, 1rem);padding:var(--base-size-16, 1rem);border-top:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);}\n\t/* Rich text editor input area */.rich-editor.svelte-hre9ug {border:var(--borderWidth-thin, 1px) solid\n\t\t\tvar(--borderColor-default);border-top:none;border-radius:0 0 var(--borderRadius-medium, 0.375rem) var(--borderRadius-medium, 0.375rem);padding:var(--control-medium-paddingBlock, 0.375rem)\n\t\t\tvar(--control-medium-paddingInline-normal, 0.75rem);background-color:var(--bgColor-default);color:var(--fgColor-default);min-height:10rem;font-size:var(--text-body-size-medium, 0.875rem);line-height:var(--text-body-lineHeight-medium, 1.4285);transition:border-color 0.2s ease;box-shadow:var(--shadow-inset, inset 0 1px 0 rgba(208, 215, 222, 0.2));}.rich-text-container.svelte-hre9ug:focus-within .rich-editor:where(.svelte-hre9ug) {box-shadow:none;}\n\n\t/* TipTap editor content styling */.rich-editor.svelte-hre9ug .ProseMirror {outline:none;min-height:9rem;}.rich-editor.svelte-hre9ug .ProseMirror p {margin:0 0 var(--base-size-8, 0.5rem) 0;}.rich-editor.svelte-hre9ug .ProseMirror p:last-child {margin-bottom:0;}.rich-editor.svelte-hre9ug .ProseMirror h1,\n\t.rich-editor.svelte-hre9ug .ProseMirror h2,\n\t.rich-editor.svelte-hre9ug .ProseMirror h3,\n\t.rich-editor.svelte-hre9ug .ProseMirror h4,\n\t.rich-editor.svelte-hre9ug .ProseMirror h5,\n\t.rich-editor.svelte-hre9ug .ProseMirror h6 {margin:var(--base-size-16, 1rem) 0 var(--base-size-8, 0.5rem) 0;font-weight:var(--base-text-weight-semibold, 600);line-height:var(--text-title-lineHeight-medium, 1.5);}.rich-editor.svelte-hre9ug .ProseMirror h1 {font-size:var(--text-title-size-large, 2rem);}.rich-editor.svelte-hre9ug .ProseMirror h2 {font-size:var(--text-title-size-medium, 1.5rem);}.rich-editor.svelte-hre9ug .ProseMirror h3 {font-size:1.25rem;}.rich-editor.svelte-hre9ug .ProseMirror h4 {font-size:1rem;}.rich-editor.svelte-hre9ug .ProseMirror ul,\n\t.rich-editor.svelte-hre9ug .ProseMirror ol {padding-left:var(--base-size-24, 1.5rem);margin:0 0 var(--base-size-8, 0.5rem) 0;}.rich-editor.svelte-hre9ug .ProseMirror a {color:var(--fgColor-accent);text-decoration:underline;}.rich-editor.svelte-hre9ug .ProseMirror img {max-width:20rem;max-height:20rem;height:auto;border-radius:var(--borderRadius-medium, 0.375rem);}.rich-editor.svelte-hre9ug .ProseMirror img.ProseMirror-selectednode {outline:var(--borderWidth-thick, 2px) solid var(--fgColor-accent);outline-offset:-1px;}.rich-editor.svelte-hre9ug .ProseMirror video {max-width:20rem;max-height:20rem;border-radius:var(--borderRadius-medium, 0.375rem);}\n\n\t/* GitHub-style text style selector */.text-style-selector.svelte-hre9ug {position:relative;display:inline-block;height:36px;display:flex;}.text-style-button.svelte-hre9ug {display:inline-flex;align-items:center;justify-content:space-between;gap:4px;width:125px;padding:6px 8px;font-size:14px;font-weight:500;line-height:1.5;color:var(--button-default-fgColor-rest, #24292f);background:var(--button-default-bgColor-rest, #f6f8fa);border:1px solid var(--button-default-borderColor-rest, rgba(31, 35, 40, 0.15));border-radius:var(--borderRadius-medium, 6px);cursor:pointer;transition:background 0.2s cubic-bezier(0.3, 0, 0.5, 1),\n\t\t\tborder-color 0.2s cubic-bezier(0.3, 0, 0.5, 1);}.text-style-button.svelte-hre9ug:hover {background-color:var(--button-default-bgColor-hover, #f3f4f6);border-color:var(--button-default-borderColor-hover, rgba(31, 35, 40, 0.15));}.text-style-button.svelte-hre9ug:focus-visible {outline:2px solid var(--focus-outlineColor, #0969da);outline-offset:0;box-shadow:0 0 0 3px rgba(9, 105, 218, 0.3);}.text-style-label.svelte-hre9ug {flex:1;text-align:left;}.text-style-label[data-style=\"h1\"].svelte-hre9ug {font-size:1.5rem;font-weight:600;}.text-style-label[data-style=\"h2\"].svelte-hre9ug {font-size:1.25rem;font-weight:600;}.text-style-label[data-style=\"h3\"].svelte-hre9ug {font-size:1.1rem;font-weight:600;}.text-style-label[data-style=\"h4\"].svelte-hre9ug {font-size:0.95rem;font-weight:600;}.text-style-panel.svelte-hre9ug {position:absolute;top:calc(100% + 4px);left:0;z-index:100;min-width:180px;background-color:var(--overlay-bgColor, #ffffff);border:1px solid var(--borderColor-default, #d0d7de);border-radius:var(--borderRadius-medium, 6px);box-shadow:0 8px 24px rgba(140, 149, 159, 0.2),\n\t\t\t0 1px 3px rgba(27, 31, 36, 0.12);padding:4px;\n\t\tanimation: svelte-hre9ug-text-style-panel-appear 0.15s ease-out;}\n\n\t@keyframes svelte-hre9ug-text-style-panel-appear {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(-8px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}.text-style-item.svelte-hre9ug {display:flex;align-items:center;justify-content:space-between;width:100%;padding:6px 8px;font-size:14px;color:var(--fgColor-default, #24292f);background:transparent;border:none;border-radius:var(--borderRadius-medium, 6px);cursor:pointer;transition:background 33.333ms linear;}.text-style-item.svelte-hre9ug:hover {background-color:var(--control-transparent-bgColor-hover, rgba(208, 215, 222, 0.32));}.text-style-item.selected.svelte-hre9ug {background-color:var(--control-transparent-bgColor-selected, rgba(9, 105, 218, 0.08));font-weight:600;}.text-style-item.selected.svelte-hre9ug svg {color:var(--fgColor-accent, #0969da);}.text-style-item.svelte-hre9ug:focus-visible {outline:2px solid var(--focus-outlineColor, #0969da);outline-offset:-2px;}.text-style-item-label.svelte-hre9ug {flex:1;text-align:left;}.text-style-item-label[data-style=\"h1\"].svelte-hre9ug {font-size:1.5rem;font-weight:600;}.text-style-item-label[data-style=\"h2\"].svelte-hre9ug {font-size:1.25rem;font-weight:600;}.text-style-item-label[data-style=\"h3\"].svelte-hre9ug {font-size:1.1rem;font-weight:600;}.text-style-item-label[data-style=\"h4\"].svelte-hre9ug {font-size:0.95rem;font-weight:600;}\n\n\t/* GapCursor styling */.ProseMirror-gapcursor {display:none;pointer-events:none;position:absolute;}.ProseMirror-gapcursor:after {content:\"\";display:block;position:absolute;top:-2px;width:20px;border-top:1px solid var(--fgColor-default, #000);\n\t\tanimation: svelte-hre9ug-ProseMirror-cursor-blink 1.1s steps(2, start) infinite;}\n\n\t@keyframes svelte-hre9ug-ProseMirror-cursor-blink {\n\t\tto {\n\t\t\tvisibility: hidden;\n\t\t}\n\t}.ProseMirror-focused .ProseMirror-gapcursor {display:block;}`\n};\nfunction bc(r, e) {\n nt(e, !0), bt(r, XE);\n const t = ro(), { collections: n, assets: s } = t;\n let o = ce(e, \"record\", 15), i = ce(e, \"config\", 7);\n kr(() => {\n o(), i();\n });\n function a() {\n (!i() || !i().fields) && console.warn(\"[Record] Missing config or fields, rendering nothing:\", { config: i() });\n }\n a();\n let l = W(ft({})), d = W(ft({})), u = W(ft({})), f = W(ft({})), h = W(ft({})), p = W(0), g = W(ft({ name: \"\", path: \"\", download_url: null })), b = W(\"\"), y = W(ft({})), C = null, E = /* @__PURE__ */ new Map();\n function R(j) {\n return j.replace(/&/g, \"&\").replace(/\"/g, \""\").replace(/</g, \"<\").replace(/>/g, \">\");\n }\n function q(j) {\n return j ? j.startsWith(\"/\") || j.startsWith(\"http://\") || j.startsWith(\"https://\") ? j : `/${s.assets.find((Z) => Z.name === j)?.module || s.defaultModule || \"cms\"}/${j}` : \"\";\n }\n const O = [\n { value: \"paragraph\", label: \"Paragraph\" },\n { value: \"h1\", label: \"Heading 1\" },\n { value: \"h2\", label: \"Heading 2\" },\n { value: \"h3\", label: \"Heading 3\" },\n { value: \"h4\", label: \"Heading 4\" }\n ];\n function M(j) {\n c(p);\n const oe = c(l)[j];\n return oe ? oe.isActive(\"heading\", { level: 1 }) ? \"Heading 1\" : oe.isActive(\"heading\", { level: 2 }) ? \"Heading 2\" : oe.isActive(\"heading\", { level: 3 }) ? \"Heading 3\" : oe.isActive(\"heading\", { level: 4 }) ? \"Heading 4\" : \"Paragraph\" : \"Paragraph\";\n }\n function P(j) {\n c(p);\n const oe = c(l)[j];\n return oe ? oe.isActive(\"heading\", { level: 1 }) ? \"h1\" : oe.isActive(\"heading\", { level: 2 }) ? \"h2\" : oe.isActive(\"heading\", { level: 3 }) ? \"h3\" : oe.isActive(\"heading\", { level: 4 }) ? \"h4\" : \"paragraph\" : \"paragraph\";\n }\n function L(j) {\n c(p);\n const oe = c(l)[j];\n return oe ? oe.isActive({ textAlign: \"center\" }) ? \"center\" : oe.isActive({ textAlign: \"right\" }) ? \"right\" : \"left\" : \"left\";\n }\n function $(j, oe) {\n const he = c(l)[j];\n if (!he) return;\n const Z = he.chain().focus();\n switch (oe) {\n case \"paragraph\":\n Z.setParagraph().run();\n break;\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n Z.toggleHeading({ level: parseInt(oe.slice(1)) }).run();\n break;\n }\n c(h)[j] = !1;\n }\n kr(() => {\n if (!o() || !i()?.fields) return;\n const j = {};\n Object.entries(i().fields).forEach(([oe, he]) => {\n if (he.widget === \"derived\" && he.source) {\n let Z = o()[he.source];\n he.mode === \"slug\" && typeof Z == \"string\" && (Z = Z.toLowerCase().replace(/\\s+/g, \"-\").replace(/[^\\w-]+/g, \"\").replace(/--+/g, \"-\").replace(/^-+|-+$/g, \"\")), o()[oe] !== Z && (j[oe] = Z);\n }\n }), Object.keys(j).length > 0 && Object.assign(o(), j);\n }), kr(() => {\n !o() || !i()?.fields || Object.entries(i().fields).forEach(([j, oe]) => {\n oe.widget === \"asset\" && o()[j] && !c(y)[j] && U(j, o()[j]);\n });\n });\n function J() {\n if (!o()) return;\n const j = t.contentId, oe = t.recordId;\n if (!j) {\n console.error(\"Cannot persist: contentId is undefined\");\n return;\n }\n C && clearTimeout(C), C = setTimeout(\n async () => {\n const he = { ...o() };\n if (i()?.fields)\n for (const [Z, pe] of Object.entries(i().fields))\n pe.widget === \"richtext\" && he[Z] && (he[Z] = await F(he[Z]));\n if (oe) {\n const Z = n.data[j], pe = JSON.parse(JSON.stringify({ ...Z, [oe]: he }));\n await n.updateContent(j, pe);\n } else {\n const Z = JSON.parse(JSON.stringify(he));\n await n.updateContent(j, Z);\n }\n C = null;\n },\n 300\n );\n }\n async function U(j, oe) {\n if (!oe) return;\n const he = E.get(j);\n he && he.abort();\n const Z = new AbortController();\n E.set(j, Z);\n try {\n const pe = await s.getAssetDataURL(oe);\n !Z.signal.aborted && pe && (c(y)[j] = pe);\n } catch (pe) {\n Z.signal.aborted || console.error(\"Failed to load asset preview:\", pe);\n } finally {\n E.get(j) === Z && E.delete(j);\n }\n }\n async function F(j) {\n if (!j || !j.includes(\"data-asset-name\")) return j;\n try {\n const he = new DOMParser().parseFromString(j, \"text/html\"), Z = he.querySelectorAll(\"img[data-asset-name]\");\n for (const xe of Z) {\n const Be = xe.getAttribute(\"data-asset-name\");\n Be && xe.setAttribute(\"src\", q(Be));\n }\n const pe = he.querySelectorAll(\"video[data-asset-name]\");\n for (const xe of pe) {\n const Be = xe.getAttribute(\"data-asset-name\");\n Be && xe.setAttribute(\"src\", q(Be));\n }\n return he.body.innerHTML;\n } catch (oe) {\n return console.error(\"Failed to convert rich text for storage:\", oe), j;\n }\n }\n async function z(j) {\n if (!j) return j;\n const he = new DOMParser().parseFromString(j, \"text/html\"), Z = he.querySelectorAll(\"img[data-asset-name]\");\n for (const xe of Z) {\n const Be = xe.getAttribute(\"data-asset-name\");\n if (Be) {\n const We = await s.getAssetDataURL(Be);\n We && xe.setAttribute(\"src\", We);\n }\n }\n const pe = he.querySelectorAll(\"video[data-asset-name]\");\n for (const xe of pe) {\n const Be = xe.getAttribute(\"data-asset-name\");\n if (Be) {\n const We = await s.getAssetDataURL(Be);\n We && xe.setAttribute(\"src\", We);\n }\n }\n return he.body.innerHTML;\n }\n async function _() {\n if (!(!c(b) || !c(g).name))\n try {\n const j = await s.getAssetDataURL(c(g).name);\n if (!j) throw new Error(\"Failed to load asset preview\");\n const oe = c(l)[c(b)];\n if (!oe) return;\n const he = R(j), Z = R(c(g).name);\n oe.chain().focus().insertContent(`<img src=\"${he}\" alt=\"${Z}\" data-asset-name=\"${Z}\">`).run(), k(b, \"\"), J();\n } catch (j) {\n console.error(\"Failed to set rich text asset:\", j);\n }\n }\n kr(() => {\n !o() || !i()?.fields || Object.entries(i().fields).forEach(async ([j, oe]) => {\n if (oe.widget === \"richtext\" && c(l)[j]) {\n const he = c(l)[j], Z = he.getHTML(), pe = o()?.[j];\n if (pe && Z !== pe) {\n if (pe === \"\" && Z === \"<p></p>\") return;\n const xe = await z(pe);\n he.commands.setContent(xe, { emitUpdate: !1 });\n }\n }\n });\n }), Ar(() => {\n i()?.fields && Object.entries(i().fields).forEach(([j, oe]) => {\n if (oe.widget === \"richtext\") {\n if (!c(d)[j]) {\n console.warn(`[Record] Rich text element for ${j} not found`);\n return;\n }\n c(l)[j] = new Ul({\n element: c(d)[j],\n extensions: [\n Kl,\n Gl,\n Yl,\n Gh,\n om,\n im,\n am,\n ac.configure({\n openOnClick: !0,\n HTMLAttributes: { target: \"_blank\", rel: \"noopener noreferrer\" }\n }),\n gm.extend({\n addAttributes() {\n return { ...this.parent?.(), \"data-asset-name\": { default: null } };\n }\n }).configure({ allowBase64: !0 }),\n lc,\n cc,\n dc,\n uc,\n Cm.configure({ types: [\"heading\", \"paragraph\"] }),\n _m\n ],\n onUpdate: () => {\n c(l)[j] && o() && (o(o()[j] = c(l)[j].getHTML(), !0), J()), Ai(p);\n },\n onSelectionUpdate: () => {\n Ai(p);\n },\n onCreate: async () => {\n const he = o()?.[j] || \"\", Z = await z(he);\n c(l)[j]?.commands.setContent(Z);\n }\n });\n }\n });\n }), ka(() => {\n Object.values(c(l)).forEach((j) => {\n j?.destroy();\n });\n });\n let N = W(ft({})), Q = W(ft({})), T = W(ft({})), I = W(ft({}));\n function te() {\n i()?.fields && Object.entries(i().fields).forEach(([j, oe]) => {\n oe.widget === \"select-single\" && (c(N)[j] = { open: !1, filter: \"\" }, o() && !o()[j] && oe.options && oe.options.length > 0 && o(o()[j] = oe.options[0].value, !0)), oe.widget === \"select-multiple\" && (c(Q)[j] = { open: !1, filter: \"\" }, o() && !Array.isArray(o()[j]) && o(o()[j] = [], !0)), oe.widget === \"reference\" && (c(T)[j] = { open: !1, filter: \"\" }), oe.widget === \"reference-multiple\" && (c(I)[j] = { open: !1, filter: \"\" }, o() && !Array.isArray(o()[j]) && o(o()[j] = [], !0));\n });\n }\n te();\n function A(j) {\n return j ? j.map((oe) => ({ text: oe.label, id: oe.value })) : [];\n }\n function V(j, oe) {\n const he = A(oe), Z = c(N)[j]?.filter || \"\", pe = o() ? o()[j] : void 0;\n return he.filter((xe) => xe.id === pe || xe.text.toLowerCase().startsWith(Z.toLowerCase()));\n }\n function H(j, oe) {\n const he = A(oe), Z = c(Q)[j]?.filter || \"\", pe = o() && Array.isArray(o()[j]) ? o()[j] : [];\n return he.filter((xe) => pe.includes(xe.id) || xe.text.toLowerCase().startsWith(Z.toLowerCase()));\n }\n function ne(j, oe) {\n o() && oe && !Array.isArray(oe) && (o(o()[j] = oe.id, !0), J());\n }\n function X(j, oe) {\n o() && Array.isArray(oe) && (o(o()[j] = oe.map((he) => he.id), !0), J());\n }\n function G(j, oe) {\n if (!o()) return;\n const he = A(oe), Z = o()[j];\n return he.find((pe) => pe.id === Z);\n }\n function Y(j, oe) {\n if (!o()) return [];\n const he = A(oe), Z = Array.isArray(o()[j]) ? o()[j] : [];\n return he.filter((pe) => Z.includes(pe.id));\n }\n function se(j, oe) {\n if (!j) return [];\n const he = n.data[j];\n return he ? Object.keys(he).map((Z) => ({\n id: Z,\n text: bo(n.data, n.config, j, Z, oe)\n })) : [];\n }\n function ue(j, oe, he) {\n const Z = se(oe, he), pe = c(T)[j]?.filter || \"\", xe = o() ? o()[j] : void 0;\n return Z.filter((Be) => Be.id === xe || Be.text.toLowerCase().includes(pe.toLowerCase()));\n }\n function le(j, oe, he) {\n const Z = se(oe, he), pe = c(I)[j]?.filter || \"\", xe = o() && Array.isArray(o()[j]) ? o()[j] : [];\n return Z.filter((Be) => xe.includes(Be.id) || Be.text.toLowerCase().includes(pe.toLowerCase()));\n }\n function re(j, oe) {\n o() && oe && !Array.isArray(oe) && (o(o()[j] = oe.id, !0), J());\n }\n function ae(j, oe) {\n o() && Array.isArray(oe) && (o(o()[j] = oe.map((he) => he.id), !0), J());\n }\n function ge(j, oe, he) {\n if (!o()) return;\n const Z = se(oe, he), pe = o()[j];\n return Z.find((xe) => xe.id === pe);\n }\n function Se(j, oe, he) {\n if (!o()) return [];\n const Z = se(oe, he), pe = Array.isArray(o()[j]) ? o()[j] : [];\n return Z.filter((xe) => pe.includes(xe.id));\n }\n var _e = {\n get record() {\n return o();\n },\n set record(j) {\n o(j), de();\n },\n get config() {\n return i();\n },\n set config(j) {\n i(j), de();\n }\n }, Re = lt(), Ie = ke(Re);\n {\n var Fe = (j) => {\n var oe = YE(), he = ke(oe);\n tt(he, 21, () => Object.entries(i().fields), pt, (xe, Be) => {\n var We = ie(() => is(c(Be), 2));\n let ee = () => c(We)[0], He = () => c(We)[1];\n var ve = lt(), Te = ke(ve);\n {\n var Me = (me) => {\n var we = PE();\n Ut(we), nr(we, () => o()[ee()], (Ee) => o(o()[ee()] = Ee, !0)), w(me, we);\n }, Xe = (me) => {\n var we = NE(), Ee = v(we), je = v(Ee), ze = v(je, !0);\n m(je), m(Ee);\n var Ve = x(Ee, 2);\n Ut(Ve), m(we), B(() => {\n Ge(je, \"for\", ee()), D(ze, He().label ?? ee()), Ge(Ve, \"name\", ee()), Ge(Ve, \"id\", ee());\n }), fe(\"input\", Ve, J), nr(Ve, () => o()[ee()], (it) => o(o()[ee()] = it, !0)), w(me, we);\n }, mt = (me) => {\n var we = OE(), Ee = v(we), je = v(Ee), ze = v(je, !0);\n m(je), m(Ee);\n var Ve = x(Ee, 2);\n Go(Ve), m(we), B(() => {\n Ge(je, \"for\", ee()), D(ze, He().label ?? ee()), Ge(Ve, \"name\", ee()), Ge(Ve, \"id\", ee());\n }), fe(\"input\", Ve, J), nr(Ve, () => o()[ee()], (it) => o(o()[ee()] = it, !0)), w(me, we);\n }, Et = (me) => {\n var we = $E(), Ee = v(we), je = v(Ee, !0);\n m(Ee);\n var ze = x(Ee, 2);\n Ut(ze), m(we), B(() => {\n Ge(Ee, \"for\", ee()), D(je, He().label ?? ee()), Ge(ze, \"name\", ee()), Ge(ze, \"id\", ee());\n }), fe(\"input\", ze, J), nr(ze, () => o()[ee()], (Ve) => o(o()[ee()] = Ve, !0)), w(me, we);\n }, Dt = (me) => {\n var we = FE(), Ee = v(we), je = v(Ee), ze = v(je, !0);\n m(je);\n var Ve = x(je, 2);\n {\n var it = ($t) => {\n Ni($t, {\n get fieldName() {\n return ee();\n },\n get fieldConfig() {\n return He();\n },\n get contentConfig() {\n return i();\n },\n get currentRecord() {\n return o();\n },\n get currentValue() {\n return o()[ee()];\n },\n onAccept: (At) => {\n o() && (o(o()[ee()] = typeof At == \"string\" ? At : String(At ?? \"\"), !0), J());\n }\n });\n };\n K(Ve, ($t) => {\n i() && o() && $t(it);\n });\n }\n m(Ee);\n var _t = x(Ee, 2), Qe = v(_t);\n {\n var sr = ($t) => {\n var At = DE(), wt = v(At), Ft = v(wt);\n _s(Ft, () => c(p), (Ot) => {\n var Pt = IE(), Jt = v(Pt), Tt = v(Jt, !0);\n m(Jt);\n var It = x(Jt, 2);\n tr(It, { icon: \"triangle-down\", size: 12 }), m(Pt), B(\n (ir, xr) => {\n Ge(Pt, \"aria-expanded\", c(h)[ee()] || !1), Ge(Jt, \"data-style\", ir), D(Tt, xr);\n },\n [\n () => P(ee()),\n () => M(ee())\n ]\n ), fe(\"click\", Pt, (ir) => {\n ir.stopPropagation(), c(h)[ee()] = !c(h)[ee()];\n }), w(Ot, Pt);\n });\n var Yt = x(Ft, 2);\n {\n var or = (Ot) => {\n var Pt = RE();\n tt(Pt, 21, () => O, pt, (Jt, Tt) => {\n var It = zE();\n let ir;\n var xr = v(It), Xr = v(xr, !0);\n m(xr);\n var An = x(xr, 2);\n {\n var Hn = (br) => {\n tr(br, { icon: \"check\", size: 16 });\n }, ar = ie(() => M(ee()) === c(Tt).label);\n K(An, (br) => {\n c(ar) && br(Hn);\n });\n }\n m(It), B(\n (br, nn) => {\n ir = Ne(It, 1, \"text-style-item svelte-hre9ug\", null, ir, br), Ge(It, \"aria-selected\", nn), Ge(xr, \"data-style\", c(Tt).value), D(Xr, c(Tt).label);\n },\n [\n () => ({ selected: M(ee()) === c(Tt).label }),\n () => M(ee()) === c(Tt).label\n ]\n ), fe(\"click\", It, (br) => {\n br.stopPropagation(), $(ee(), c(Tt).value);\n }), w(Jt, It);\n }), m(Pt), fe(\"click\", Pt, (Jt) => Jt.stopPropagation()), fe(\"mousedown\", Pt, (Jt) => Jt.stopPropagation()), w(Ot, Pt);\n };\n K(Yt, (Ot) => {\n c(h)[ee()] && Ot(or);\n });\n }\n m(wt);\n var cr = x(wt, 4);\n _s(cr, () => c(p), (Ot) => {\n var Pt = jE(), Jt = ke(Pt);\n let Tt;\n var It = x(Jt, 2);\n let ir;\n var xr = x(It, 2);\n let Xr;\n B(\n (An, Hn, ar) => {\n Tt = Ne(Jt, 1, \"svelte-hre9ug\", null, Tt, An), ir = Ne(It, 1, \"svelte-hre9ug\", null, ir, Hn), Xr = Ne(xr, 1, \"svelte-hre9ug\", null, Xr, ar);\n },\n [\n () => ({ active: L(ee()) === \"left\" }),\n () => ({ active: L(ee()) === \"center\" }),\n () => ({ active: L(ee()) === \"right\" })\n ]\n ), fe(\"click\", Jt, () => c(l)[ee()].chain().focus().setTextAlign(\"left\").run()), fe(\"click\", It, () => c(l)[ee()].chain().focus().setTextAlign(\"center\").run()), fe(\"click\", xr, () => c(l)[ee()].chain().focus().setTextAlign(\"right\").run()), w(Ot, Pt);\n });\n var dt = x(cr, 4), Nt = v(dt);\n tr(Nt, { icon: \"bold\", size: 16 }), m(dt);\n var Mt = x(dt, 2), jt = v(Mt);\n tr(jt, { icon: \"italic\", size: 16 }), m(Mt);\n var Xt = x(Mt, 2), Lt = x(Xt, 4), Bt = v(Lt);\n tr(Bt, { icon: \"list-unordered\", size: 16 }), m(Lt);\n var qt = x(Lt, 2), gr = v(qt);\n tr(gr, { icon: \"list-ordered\", size: 16 }), m(qt);\n var Sr = x(qt, 4), tn = v(Sr);\n tr(tn, { icon: \"link\", size: 16 }), m(Sr);\n var Mr = x(Sr, 2), rn = v(Mr);\n tr(rn, { icon: \"image\", size: 16 }), m(Mr);\n var dr = x(Mr, 2);\n {\n var ur = (Ot) => {\n var Pt = LE(), Jt = v(Pt);\n Ut(Jt);\n var Tt = x(Jt, 2);\n m(Pt), fe(\"click\", Pt, (It) => It.stopPropagation()), nr(Jt, () => c(f)[ee()], (It) => c(f)[ee()] = It), fe(\"click\", Tt, () => {\n c(l)[ee()].chain().focus().extendMarkRange(\"link\").setLink({ href: c(f)[ee()] }).run(), c(u)[ee()] = !1;\n }), w(Ot, Pt);\n };\n K(dr, (Ot) => {\n c(u)[ee()] && Ot(ur);\n });\n }\n m(At), fe(\"mousedown\", At, (Ot) => {\n c(h)[ee()] && (Ot.preventDefault(), c(h)[ee()] = !1), c(u)[ee()] = !1;\n }), fe(\"click\", dt, () => c(l)[ee()].chain().focus().toggleBold().run()), fe(\"click\", Mt, () => c(l)[ee()].chain().focus().toggleItalic().run()), fe(\"click\", Xt, () => c(l)[ee()].chain().focus().toggleUnderline().run()), fe(\"click\", Lt, () => c(l)[ee()].chain().focus().toggleBulletList().run()), fe(\"click\", qt, () => c(l)[ee()].chain().focus().toggleOrderedList().run()), fe(\"click\", Sr, (Ot) => {\n Ot.stopPropagation(), c(u)[ee()] = !c(u)[ee()];\n }), fe(\"click\", Mr, (Ot) => {\n Ot.stopPropagation(), k(b, ee(), !0);\n }), w($t, At);\n };\n K(Qe, ($t) => {\n c(l)[ee()] && $t(sr);\n });\n }\n var vr = x(Qe, 2);\n bn(vr, ($t, At) => c(d)[At] = $t, ($t) => c(d)?.[$t], () => [ee()]), m(_t), m(we), B(() => {\n Ge(je, \"for\", ee()), D(ze, He().label ?? ee());\n }), fe(\"mousedown\", vr, ($t) => {\n c(h)[ee()] && ($t.preventDefault(), c(h)[ee()] = !1), c(u)[ee()] = !1;\n }), w(me, we);\n }, Rt = (me) => {\n var we = BE(), Ee = v(we);\n {\n let je = ie(() => He().label ?? ee());\n ng(Ee, {\n get label() {\n return c(je);\n },\n get id() {\n return ee();\n },\n onchange: J,\n get checked() {\n return o()[ee()];\n },\n set checked(ze) {\n o(o()[ee()] = ze, !0);\n }\n });\n }\n m(we), w(me, we);\n }, er = (me) => {\n var we = HE(), Ee = v(we), je = v(Ee, !0);\n m(Ee);\n var ze = x(Ee, 2);\n Ut(ze), m(we), B(() => {\n Ge(Ee, \"for\", ee()), D(je, He().label ?? ee()), Ge(ze, \"name\", ee()), Ge(ze, \"id\", ee());\n }), fe(\"change\", ze, J), nr(ze, () => o()[ee()], (Ve) => o(o()[ee()] = Ve, !0)), w(me, we);\n }, ct = (me) => {\n var we = qE(), Ee = v(we), je = v(Ee, !0);\n m(Ee);\n var ze = x(Ee, 2);\n Ut(ze), m(we), B(() => {\n Ge(Ee, \"for\", ee()), D(je, He().label ?? ee()), Ge(ze, \"name\", ee()), Ge(ze, \"id\", ee());\n }), fe(\"change\", ze, J), nr(ze, () => o()[ee()], (Ve) => o(o()[ee()] = Ve, !0)), w(me, we);\n }, vt = (me) => {\n var we = VE(), Ee = v(we);\n {\n var je = (ze) => {\n {\n let Ve = ie(() => He().label ?? ee()), it = ie(() => V(ee(), He().options)), _t = ie(() => G(ee(), He().options));\n bs(ze, {\n get label() {\n return c(Ve);\n },\n get items() {\n return c(it);\n },\n get selected() {\n return c(_t);\n },\n onFilterChange: (Qe) => {\n c(N)[ee()] && (c(N)[ee()].filter = Qe);\n },\n placeholder: \"Pick one choice\",\n onSelectedChange: (Qe) => ne(ee(), Qe),\n get open() {\n return c(N)[ee()].open;\n },\n set open(Qe) {\n c(N)[ee()].open = Qe;\n }\n });\n }\n };\n K(Ee, (ze) => {\n c(N)[ee()] && ze(je);\n });\n }\n m(we), w(me, we);\n }, yt = (me) => {\n var we = WE(), Ee = v(we);\n {\n var je = (ze) => {\n {\n let Ve = ie(() => He().label ?? ee()), it = ie(() => H(ee(), He().options)), _t = ie(() => Y(ee(), He().options));\n bs(ze, {\n get label() {\n return c(Ve);\n },\n get items() {\n return c(it);\n },\n get selected() {\n return c(_t);\n },\n onFilterChange: (Qe) => {\n c(Q)[ee()] && (c(Q)[ee()].filter = Qe);\n },\n placeholder: \"Pick choices\",\n multiSelect: !0,\n onSelectedChange: (Qe) => X(ee(), Qe),\n get open() {\n return c(Q)[ee()].open;\n },\n set open(Qe) {\n c(Q)[ee()].open = Qe;\n }\n });\n }\n };\n K(Ee, (ze) => {\n c(Q)[ee()] && ze(je);\n });\n }\n m(we), w(me, we);\n }, Ae = (me) => {\n var we = UE(), Ee = v(we), je = v(Ee, !0);\n m(Ee);\n var ze = x(Ee, 2);\n Of(ze, {\n module: \"cms\",\n label: \"\",\n get notifications() {\n return t.notifications;\n },\n onAssetChange: (Ve) => {\n Ve && o(o()[ee()] = q(Ve.name), !0), J();\n },\n width: \"200px\",\n height: \"200px\",\n get value() {\n return o()[ee()];\n },\n set value(Ve) {\n o(o()[ee()] = Ve, !0);\n }\n }), m(we), B(() => {\n Ge(Ee, \"for\", ee()), D(je, He().label ?? ee());\n }), w(me, we);\n }, Ye = (me) => {\n var we = JE(), Ee = v(we), je = v(Ee, !0);\n m(Ee);\n var ze = x(Ee, 2);\n Ut(ze), m(we), B(() => {\n Ge(Ee, \"for\", ee()), D(je, He().label ?? ee()), Ge(ze, \"name\", ee()), Ge(ze, \"id\", ee()), wi(ze, o()[ee()]);\n }), w(me, we);\n }, xt = (me) => {\n var we = KE(), Ee = v(we);\n {\n var je = (ze) => {\n {\n let Ve = ie(() => He().label ?? ee()), it = ie(() => ue(ee(), He().referenceCollection, He().referenceDisplayField)), _t = ie(() => ge(ee(), He().referenceCollection, He().referenceDisplayField));\n bs(ze, {\n get label() {\n return c(Ve);\n },\n get items() {\n return c(it);\n },\n get selected() {\n return c(_t);\n },\n onFilterChange: (Qe) => {\n c(T)[ee()] && (c(T)[ee()].filter = Qe);\n },\n placeholder: \"Select a record\",\n onSelectedChange: (Qe) => re(ee(), Qe),\n get open() {\n return c(T)[ee()].open;\n },\n set open(Qe) {\n c(T)[ee()].open = Qe;\n }\n });\n }\n };\n K(Ee, (ze) => {\n c(T)[ee()] && ze(je);\n });\n }\n m(we), w(me, we);\n }, ut = (me) => {\n var we = GE(), Ee = v(we);\n {\n var je = (ze) => {\n {\n let Ve = ie(() => He().label ?? ee()), it = ie(() => le(ee(), He().referenceCollection, He().referenceDisplayField)), _t = ie(() => Se(ee(), He().referenceCollection, He().referenceDisplayField));\n bs(ze, {\n get label() {\n return c(Ve);\n },\n get items() {\n return c(it);\n },\n get selected() {\n return c(_t);\n },\n onFilterChange: (Qe) => {\n c(I)[ee()] && (c(I)[ee()].filter = Qe);\n },\n placeholder: \"Select records\",\n multiSelect: !0,\n onSelectedChange: (Qe) => ae(ee(), Qe),\n get open() {\n return c(I)[ee()].open;\n },\n set open(Qe) {\n c(I)[ee()].open = Qe;\n }\n });\n }\n };\n K(Ee, (ze) => {\n c(I)[ee()] && ze(je);\n });\n }\n m(we), w(me, we);\n };\n K(Te, (me) => {\n He().hidden ? me(Me) : He().widget === \"string\" ? me(Xe, 1) : He().widget === \"text\" ? me(mt, 2) : He().widget === \"number\" ? me(Et, 3) : He().widget === \"richtext\" ? me(Dt, 4) : He().widget === \"checkbox\" ? me(Rt, 5) : He().widget === \"date\" ? me(er, 6) : He().widget === \"datetime\" ? me(ct, 7) : He().widget === \"select-single\" ? me(vt, 8) : He().widget === \"select-multiple\" ? me(yt, 9) : He().widget === \"asset\" ? me(Ae, 10) : He().widget === \"derived\" ? me(Ye, 11) : He().widget === \"reference\" ? me(xt, 12) : He().widget === \"reference-multiple\" && me(ut, 13);\n });\n }\n w(xe, ve);\n }), m(he);\n var Z = x(he, 2);\n {\n var pe = (xe) => {\n Sc(xe, {\n open: !0,\n title: \"Insert Asset\",\n onClose: () => k(b, \"\"),\n maxWidth: \"64rem\",\n children: (Be, We) => {\n kc(Be, {\n handleAssetChange: (ee) => {\n ee && (k(g, ee, !0), _());\n },\n currentModule: \"cms\",\n get notifications() {\n return t.notifications;\n },\n get collections() {\n return n;\n }\n });\n },\n $$slots: { default: !0 }\n });\n };\n K(Z, (xe) => {\n c(b) && xe(pe);\n });\n }\n w(j, oe);\n };\n K(Ie, (j) => {\n i() && i().fields && o() && j(Fe);\n });\n }\n return w(r, Re), st(_e);\n}\nhr([\"input\", \"mousedown\", \"click\", \"change\"]);\nrt(bc, { record: {}, config: {} }, [], [], { mode: \"open\" });\nvar QE = S('<div><span> </span> <button type=\"button\" class=\"notification-close svelte-2q1rwy\" aria-label=\"Close notification\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"></path><path d=\"M18 6l-12 12\"></path><path d=\"M6 6l12 12\"></path></svg></button></div>'), ZE = S('<span class=\"menu-item-badge svelte-2q1rwy\">Collection</span>'), eT = S('<li><a><span class=\"menu-item-label svelte-2q1rwy\"> </span> <!> <svg class=\"menu-item-chevron svelte-2q1rwy\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M9 18l6-6-6-6\"></path></svg></a></li>'), tT = S('<li class=\"menu-category-header svelte-2q1rwy\"> </li> <!>', 1), rT = S('<nav class=\"menu-panel svelte-2q1rwy\" aria-label=\"CMS navigation\"><ul class=\"menu-list svelte-2q1rwy\"><!> <li class=\"menu-divider svelte-2q1rwy\" role=\"separator\"></li> <li><a href=\"#website/content/assets\"><span class=\"menu-item-label svelte-2q1rwy\">Assets</span> <span class=\"menu-item-desc svelte-2q1rwy\">Images, PDFs and other files</span> <svg class=\"menu-item-chevron svelte-2q1rwy\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M9 18l6-6-6-6\"></path></svg></a></li></ul></nav>'), nT = S('<button type=\"button\" class=\"back-btn svelte-2q1rwy\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M15 18l-6-6 6-6\"></path></svg> </button>'), sT = S('<button type=\"button\" class=\"back-btn svelte-2q1rwy\" aria-label=\"Back to menu\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M15 18l-6-6 6-6\"></path></svg> Menu</button>'), oT = S('<div class=\"padded svelte-2q1rwy\"><!></div>'), iT = S('<p class=\"padded svelte-2q1rwy\">Loading record...</p>'), aT = S('<p class=\"padded svelte-2q1rwy\">Record not found.</p>'), lT = S('<p class=\"padded svelte-2q1rwy\">Loading content...</p>'), cT = S('<p class=\"padded svelte-2q1rwy\">Loading content...</p>'), dT = S('<div class=\"padded svelte-2q1rwy\"><!></div>'), uT = S('<p class=\"padded svelte-2q1rwy\">Loading global...</p>'), fT = S('<p class=\"padded svelte-2q1rwy\">Loading...</p>'), pT = S('<div class=\"error-message padded svelte-2q1rwy\"><p class=\"svelte-2q1rwy\"> </p></div>'), hT = S('<p class=\"padded svelte-2q1rwy\">No content configured. Check your configuration files.</p>'), mT = S('<div class=\"content-panel svelte-2q1rwy\"><div class=\"content-topbar svelte-2q1rwy\"><!></div> <div class=\"content-scroll svelte-2q1rwy\"><!></div></div>'), vT = S('<div class=\"cms-editor svelte-2q1rwy\"><div class=\"notifications-container svelte-2q1rwy\"></div> <div class=\"panel-body svelte-2q1rwy\"><!></div></div>');\nconst gT = {\n hash: \"svelte-2q1rwy\",\n code: `.cms-editor.svelte-2q1rwy {display:flex;flex-direction:column;flex:1;min-height:0;background:var(--bgColor-default, #ffffff);}.notifications-container.svelte-2q1rwy {flex-shrink:0;pointer-events:none;}.notification-banner.svelte-2q1rwy {width:100%;background-color:#ddf4ff;border-bottom:1px solid #54aeff66;padding:0.75rem 1rem;display:flex;justify-content:space-between;align-items:center;font-size:0.875rem;pointer-events:auto;}.notification-banner.danger.svelte-2q1rwy {background-color:#fde8e8;border-color:#ff4d4d66;}.notification-banner.success.svelte-2q1rwy {background-color:#e6f9e6;border-color:#00b30066;}.notification-banner.warning.svelte-2q1rwy {background-color:#fff7e6;border-color:#ff9f0066;}.notification-close.svelte-2q1rwy {background:none;border:none;padding:0.25rem;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:0.25rem;flex-shrink:0;}.notification-close.svelte-2q1rwy:hover {background-color:rgba(0, 0, 0, 0.1);}.panel-body.svelte-2q1rwy {flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;}.menu-panel.svelte-2q1rwy {flex:1;overflow-y:auto;padding:0.5rem 0;}.menu-list.svelte-2q1rwy {list-style:none;margin:0;padding:0;}.menu-item.svelte-2q1rwy {display:flex;align-items:center;gap:0.5rem;padding:0.75rem 1rem;text-decoration:none;color:var(--fgColor-default, #24292f);border-bottom:1px solid var(--borderColor-muted, #d8dee4);transition:background-color 0.1s;cursor:pointer;}.menu-item.svelte-2q1rwy:hover,\n\t.menu-item.active.svelte-2q1rwy {background-color:var(--bgColor-muted, #f6f8fa);}.menu-item-label.svelte-2q1rwy {font-weight:500;font-size:0.9375rem;flex:1;}.menu-item-desc.svelte-2q1rwy {font-size:0.8125rem;color:var(--fgColor-muted, #656d76);flex:1;}.menu-item-badge.svelte-2q1rwy {font-size:0.6875rem;font-weight:500;color:var(--fgColor-muted, #656d76);background:var(--bgColor-neutral-muted, rgba(175,184,193,0.2));border-radius:2rem;padding:0.125rem 0.5rem;flex-shrink:0;}.menu-item-chevron.svelte-2q1rwy {flex-shrink:0;color:var(--fgColor-muted, #656d76);}.menu-category-header.svelte-2q1rwy {padding:0.625rem 1rem 0.25rem;font-size:0.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:var(--fgColor-muted, #656d76);}.menu-divider.svelte-2q1rwy {height:1px;background:var(--borderColor-default, #d0d7de);margin:0.25rem 0;}.content-panel.svelte-2q1rwy {flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;}.content-topbar.svelte-2q1rwy {display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;border-bottom:1px solid var(--borderColor-default, #d0d7de);flex-shrink:0;min-height:3rem;min-width:0;}.back-btn.svelte-2q1rwy {display:flex;align-items:center;gap:0.25rem;background:none;border:none;padding:0.375rem 0.5rem;cursor:pointer;font-size:0.875rem;color:var(--fgColor-muted, #656d76);border-radius:0.375rem;flex-shrink:0;transition:background-color 0.1s, color 0.1s;}.back-btn.svelte-2q1rwy:hover {background-color:var(--bgColor-neutral-muted, rgba(175,184,193,0.2));color:var(--fgColor-default, #24292f);}.content-scroll.svelte-2q1rwy {flex:1;overflow-y:auto;padding:0 0 2rem;min-width:0;}.padded.svelte-2q1rwy {padding:1rem 1.5rem 0;}.error-message.svelte-2q1rwy {padding:1rem;border:1px solid var(--borderColor-danger-emphasis, #cf222e);border-radius:0.375rem;background-color:var(--bgColor-danger-muted, #ffebe9);color:var(--fgColor-danger, #d1242f);}.error-message.svelte-2q1rwy p:where(.svelte-2q1rwy) {margin:0;}\n\n\t@media (max-width: 640px) {.content-topbar.svelte-2q1rwy {padding:0.5rem 0.75rem;}.menu-item.svelte-2q1rwy {align-items:flex-start;padding:0.875rem 1rem;}.menu-item-label.svelte-2q1rwy,\n\t\t.menu-item-desc.svelte-2q1rwy {min-width:0;}.menu-item-badge.svelte-2q1rwy {display:none;}\n\n\t}`\n};\nfunction fv(r, e) {\n nt(e, !0), bt(r, gT);\n let t = ce(e, \"route\", 7, \"\");\n const n = ro(), { collections: s, notifications: o } = n, i = ie(() => s.data), a = ie(() => s.config), l = [\"page\", \"collection\", \"global\"], d = {\n global: \"Global Data\",\n page: \"Pages\",\n collection: \"Collections\"\n };\n function u(_) {\n return d[_] ?? _.charAt(0).toUpperCase() + _.slice(1) + \"s\";\n }\n const f = ie(() => {\n const _ = {};\n for (const N of Object.entries(c(a))) {\n const Q = N[1].isCollection ? \"collection\" : N[1].category ?? \"global\";\n _[Q] || (_[Q] = []), _[Q].push(N);\n }\n return _;\n }), h = ie(() => {\n const _ = Object.keys(c(f)).filter((N) => !l.includes(N));\n return [...l, ..._];\n }), p = ie(() => {\n const _ = t().split(\"/\").filter(Boolean);\n if (_.length === 0)\n return { location: \"\", contentId: null, recordId: null };\n if (_[0] === \"assets\")\n return { location: \"assets\", contentId: null, recordId: null };\n const N = _[0], Q = _[1] || null;\n return { location: \"content\", contentId: N, recordId: Q };\n }), g = ie(() => c(p).location), b = ie(() => c(p).contentId), y = ie(() => c(p).recordId);\n let C = W(!1);\n kr(() => {\n c(g) && c(g) !== \"\" ? k(C, !1) : k(C, !0);\n });\n let E = W(void 0), R = W(null), q = W(null);\n kr(() => {\n const _ = c(b), N = c(y), Q = c(g);\n if (n.location = Q || void 0, n.contentId = _ || void 0, n.recordId = N || void 0, _ === c(R) && N === c(q) && c(E) !== void 0) return;\n (_ !== c(R) || N !== c(q)) && k(E, void 0), k(R, _, !0), k(q, N, !0);\n const T = _ ? c(a)[_] : null;\n if (_ && !T) {\n k(E, void 0);\n return;\n }\n const I = T?.isCollection ?? !1;\n _ && N && c(i)[_] && c(i)[_][N] ? k(E, JSON.parse(JSON.stringify(c(i)[_][N])), !0) : _ && !I && c(i)[_] ? k(E, JSON.parse(JSON.stringify(c(i)[_])), !0) : k(E, void 0);\n });\n async function O(_) {\n const N = c(a)[_];\n if (!N?.isCollection) {\n console.error(`Cannot create record in \"${_}\": not a collection`), o.error(`Cannot create records in global content \"${N?.title || _}\"`);\n return;\n }\n const Q = M(), T = {};\n for (const [te, A] of Object.entries(N.fields))\n T[te] = A.default !== void 0 ? A.default : \"\";\n const I = { ...c(i)[_], [Q]: T };\n await s.updateContent(_, I, { label: `New ${N.title}` }), window.location.href = `#website/content/${_}/${Q}`;\n }\n function M() {\n return Math.random().toString(36).substring(2, 12);\n }\n var P = {\n get route() {\n return t();\n },\n set route(_ = \"\") {\n t(_), de();\n }\n }, L = vT(), $ = v(L);\n tt($, 21, () => o.notifications, pt, (_, N) => {\n var Q = QE();\n let T;\n var I = v(Q), te = v(I, !0);\n m(I);\n var A = x(I, 2);\n m(Q), B(() => {\n T = Ne(Q, 1, \"notification-banner svelte-2q1rwy\", null, T, {\n danger: c(N).type === \"danger\",\n success: c(N).type === \"success\",\n warning: c(N).type === \"warning\"\n }), D(te, c(N).message);\n }), fe(\"click\", A, () => o.removeNotification(c(N).id)), Ca(2, Q, () => Ac, () => ({ duration: 1500 })), w(_, Q);\n }), m($);\n var J = x($, 2), U = v(J);\n {\n var F = (_) => {\n var N = rT(), Q = v(N), T = v(Q);\n tt(T, 17, () => c(h), pt, (V, H) => {\n var ne = lt(), X = ke(ne);\n {\n var G = (Y) => {\n var se = tT(), ue = ke(se), le = v(ue, !0);\n m(ue);\n var re = x(ue, 2);\n tt(re, 17, () => c(f)[c(H)], pt, (ae, ge) => {\n var Se = ie(() => is(c(ge), 2));\n let _e = () => c(Se)[0], Re = () => c(Se)[1];\n var Ie = eT(), Fe = v(Ie);\n let j;\n var oe = v(Fe), he = v(oe, !0);\n m(oe);\n var Z = x(oe, 2);\n {\n var pe = (xe) => {\n var Be = ZE();\n w(xe, Be);\n };\n K(Z, (xe) => {\n Re().isCollection && xe(pe);\n });\n }\n Pe(2), m(Fe), m(Ie), B(() => {\n j = Ne(Fe, 1, \"menu-item svelte-2q1rwy\", null, j, { active: n.location === \"content\" && n.contentId === _e() }), Ge(Fe, \"href\", `#website/content/${_e() ?? \"\"}`), D(he, Re().title);\n }), fe(\"click\", Fe, () => k(C, !1)), w(ae, Ie);\n }), B((ae) => D(le, ae), [() => u(c(H))]), w(Y, se);\n };\n K(X, (Y) => {\n c(f)[c(H)]?.length && Y(G);\n });\n }\n w(V, ne);\n });\n var I = x(T, 4), te = v(I);\n let A;\n m(I), m(Q), m(N), B(() => A = Ne(te, 1, \"menu-item svelte-2q1rwy\", null, A, { active: n.location === \"assets\" })), fe(\"click\", te, () => k(C, !1)), w(_, N);\n }, z = (_) => {\n var N = mT(), Q = v(N), T = v(Q);\n {\n var I = (Y) => {\n var se = nT(), ue = x(v(se));\n m(se), B(() => {\n Ge(se, \"aria-label\", `Back to ${c(a)[c(b)]?.title ?? c(b) ?? \"\"}`), D(ue, ` ${c(a)[c(b)]?.title ?? c(b) ?? \"\"}`);\n }), fe(\"click\", se, () => {\n window.location.href = `#website/content/${c(b)}`;\n }), w(Y, se);\n }, te = (Y) => {\n var se = sT();\n fe(\"click\", se, () => {\n k(C, !0), window.location.href = \"#website/content\";\n }), w(Y, se);\n };\n K(T, (Y) => {\n c(g) === \"content\" && c(b) && c(y) ? Y(I) : Y(te, -1);\n });\n }\n m(Q);\n var A = x(Q, 2), V = v(A);\n {\n var H = (Y) => {\n var se = lt(), ue = ke(se);\n {\n var le = (Se) => {\n var _e = lt(), Re = ke(_e);\n {\n var Ie = (oe) => {\n var he = lt(), Z = ke(he);\n {\n var pe = (We) => {\n var ee = lt(), He = ke(ee);\n _s(He, () => c(b) + \"/\" + c(y), (ve) => {\n var Te = lt(), Me = ke(Te);\n {\n var Xe = (Et) => {\n var Dt = oT(), Rt = v(Dt);\n bc(Rt, {\n get config() {\n return c(a)[c(b)];\n },\n get record() {\n return c(E);\n },\n set record(er) {\n k(E, er, !0);\n }\n }), m(Dt), w(Et, Dt);\n }, mt = (Et) => {\n var Dt = iT();\n w(Et, Dt);\n };\n K(Me, (Et) => {\n c(E) ? Et(Xe) : Et(mt, -1);\n });\n }\n w(ve, Te);\n }), w(We, ee);\n }, xe = (We) => {\n var ee = aT();\n w(We, ee);\n }, Be = (We) => {\n var ee = lT();\n w(We, ee);\n };\n K(Z, (We) => {\n c(i)[c(b)] && c(i)[c(b)][c(y)] && c(a)[c(b)]?.fields ? We(pe) : c(i)[c(b)] ? We(xe, 1) : We(Be, -1);\n });\n }\n w(oe, he);\n }, Fe = (oe) => {\n uv(oe, {\n get content() {\n return c(i)[c(b)];\n },\n get config() {\n return c(a)[c(b)];\n },\n get collectionId() {\n return c(b);\n },\n onNewRecord: () => O(c(b))\n });\n }, j = (oe) => {\n var he = cT();\n w(oe, he);\n };\n K(Re, (oe) => {\n c(y) ? oe(Ie) : c(i)[c(b)] ? oe(Fe, 1) : oe(j, -1);\n });\n }\n w(Se, _e);\n }, re = ie(() => c(a)[c(b)] && c(a)[c(b)].hasOwnProperty(\"isCollection\") && c(a)[c(b)].isCollection), ae = (Se) => {\n var _e = lt(), Re = ke(_e);\n _s(Re, () => c(b), (Ie) => {\n var Fe = lt(), j = ke(Fe);\n {\n var oe = (Z) => {\n var pe = dT(), xe = v(pe);\n bc(xe, {\n get config() {\n return c(a)[c(b)];\n },\n get record() {\n return c(E);\n },\n set record(Be) {\n k(E, Be, !0);\n }\n }), m(pe), w(Z, pe);\n }, he = (Z) => {\n var pe = uT();\n w(Z, pe);\n };\n K(j, (Z) => {\n c(E) ? Z(oe) : Z(he, -1);\n });\n }\n w(Ie, Fe);\n }), w(Se, _e);\n }, ge = (Se) => {\n var _e = fT();\n w(Se, _e);\n };\n K(ue, (Se) => {\n c(re) ? Se(le) : c(i)[c(b)] && c(a)[c(b)]?.fields ? Se(ae, 1) : c(b) && Se(ge, 2);\n });\n }\n w(Y, se);\n }, ne = (Y) => {\n cv(Y, {});\n }, X = (Y) => {\n var se = pT(), ue = v(se), le = v(ue);\n m(ue), m(se), B(() => D(le, `Error loading data: ${s.error ?? \"\"}`)), w(Y, se);\n }, G = (Y) => {\n var se = hT();\n w(Y, se);\n };\n K(V, (Y) => {\n c(g) === \"content\" && c(a) && c(b) ? Y(H) : c(g) === \"assets\" ? Y(ne, 1) : s.error ? Y(X, 2) : Y(G, -1);\n });\n }\n m(A), m(N), w(_, N);\n };\n K(U, (_) => {\n c(C) ? _(F) : _(z, -1);\n });\n }\n return m(J), m(L), w(r, L), st(P);\n}\nhr([\"click\"]);\nrt(fv, { route: {} }, [], [], { mode: \"open\" });\nvar bT = S('<nav class=\"website-switcher mobile-website-switcher svelte-1oelwps\" aria-label=\"Website tools\"><a href=\"#website/chat\">Chat</a> <a>Content</a> <a href=\"#website/templates\">Templates</a></nav>'), yT = S('<nav class=\"website-switcher svelte-1oelwps\" aria-label=\"Website tools\"><a href=\"#website/chat\">Chat</a> <a>Content</a> <a href=\"#website/templates\">Templates</a></nav>'), xT = S('<div><div class=\"mobile-sheet-header svelte-1oelwps\"><button type=\"button\" class=\"sheet-grabber svelte-1oelwps\"><span class=\"sheet-grabber-handle svelte-1oelwps\"></span> <span class=\"sheet-grabber-title svelte-1oelwps\">Edit Website</span></button> <!></div> <div class=\"sidebar-header svelte-1oelwps\"><!></div> <div class=\"sidebar-content svelte-1oelwps\"><!></div></div>');\nconst wT = {\n hash: \"svelte-1oelwps\",\n code: `.sidebar.svelte-1oelwps {display:flex;flex-direction:column;height:100%;min-height:0;}.mobile-sheet-header.svelte-1oelwps,\n\t.sheet-grabber.svelte-1oelwps {display:none;}.sidebar-header.svelte-1oelwps {display:flex;align-items:center;justify-content:center;padding:1rem 1.25rem;border-bottom:1px solid var(--borderColor-default, #d0d7de);flex-shrink:0;height:auto;}.website-switcher.svelte-1oelwps {display:inline-flex;align-items:center;padding:0.125rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:0.5rem;background:var(--bgColor-muted, #f6f8fa);}.switcher-link.svelte-1oelwps {display:inline-flex;align-items:center;justify-content:center;min-height:2rem;padding:0.25rem 0.75rem;border-radius:0.375rem;color:var(--fgColor-muted, #656d76);font-size:0.875rem;font-weight:500;text-decoration:none;white-space:nowrap;transition:background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;}.switcher-link.svelte-1oelwps:hover {color:var(--fgColor-default, #24292f);}.switcher-link.active.svelte-1oelwps {background:var(--bgColor-default, #ffffff);box-shadow:0 1px 2px rgba(31, 35, 40, 0.08);color:var(--fgColor-default, #24292f);}.sidebar-content.svelte-1oelwps {flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;}\n\n\t@media (max-width: 900px) {.sidebar.svelte-1oelwps {--sidebar-sheet-header-height: 7.375rem;--sidebar-sheet-collapsed: 3.5rem;--sidebar-sheet-max-height: 75dvh;--sheet-drag-offset: 0px;position:absolute;left:0;right:0;bottom:0;z-index:5;flex:0 1 auto;height:var(--sidebar-sheet-max-height);border:1px solid var(--borderColor-default, #d0d7de);border-left:0;border-right:0;border-bottom:0;border-radius:1.25rem 1.25rem 0 0;box-shadow:0 -8px 32px rgba(31, 35, 40, 0.12);transform:translateY(max(0px, var(--sheet-drag-offset)));transition:transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),\n\t\t\t\tbox-shadow 180ms ease;will-change:transform;}.sidebar.sheet-collapsed.svelte-1oelwps {transform:translateY(calc(100% - var(--sidebar-sheet-collapsed) + min(0px, var(--sheet-drag-offset))));box-shadow:0 10px 28px rgba(31, 35, 40, 0.18);}.sidebar.sheet-collapsed.svelte-1oelwps .mobile-sheet-header:where(.svelte-1oelwps) {height:var(--sidebar-sheet-collapsed);padding:0.625rem 0.75rem 0;border-bottom:0;gap:0;}.sidebar.sheet-collapsed.svelte-1oelwps .mobile-website-switcher:where(.svelte-1oelwps) {display:none;}.sidebar.sheet-dragging.svelte-1oelwps {transition:none;}.mobile-sheet-header.svelte-1oelwps {display:flex;align-items:center;flex-direction:column;gap:0.75rem;flex-shrink:0;height:var(--sidebar-sheet-header-height);width:100%;padding:0.75rem 1rem 1.25rem;border-radius:1.25rem 1.25rem 0 0;background:var(--bgColor-default, #ffffff);border-bottom:1px solid var(--borderColor-default, #d0d7de);}.sheet-grabber.svelte-1oelwps {appearance:none;display:flex;align-items:center;flex-direction:column;gap:0.375rem;justify-content:center;width:100%;min-height:2.25rem;padding:0;border:0;background:transparent;cursor:grab;touch-action:none;}.sheet-grabber.svelte-1oelwps:active {cursor:grabbing;}.sheet-grabber-handle.svelte-1oelwps {width:2.5rem;height:0.3125rem;border-radius:999px;background:var(--borderColor-emphasis, #8c959f);opacity:0.72;}.sheet-grabber-title.svelte-1oelwps {max-width:calc(100% - 2rem);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--fgColor-default, #24292f);font-size:0.9375rem;font-weight:600;line-height:1.2;}.sidebar-header.svelte-1oelwps {display:none;}.mobile-website-switcher.svelte-1oelwps {width:100%;max-width:22rem;}.mobile-website-switcher.svelte-1oelwps .switcher-link:where(.svelte-1oelwps) {flex:1;}\n\t}`\n};\nfunction pv(r, e) {\n nt(e, !0), bt(r, wT);\n let t = ce(e, \"activeView\", 7), n = ce(e, \"route\", 7, \"\"), s = ce(e, \"projectId\", 7, \"\"), o = ce(e, \"contentHref\", 7, \"#website/content\");\n const i = sg() ? yn() : null, a = ie(() => i ? i.repoFiles.isLoading || i.repoFiles.isSyncing : !1);\n let l = W(!0), d = W(!1), u = W(0), f = 0, h = null;\n ka(y);\n function p(T) {\n window.matchMedia(\"(max-width: 900px)\").matches && (h = T.pointerId, f = T.clientY, k(u, 0), k(d, !0), T.currentTarget.setPointerCapture?.(T.pointerId), window.addEventListener(\"pointermove\", g), window.addEventListener(\"pointerup\", b), window.addEventListener(\"pointercancel\", b));\n }\n function g(T) {\n if (!c(d) || h !== null && T.pointerId !== h) return;\n const I = T.clientY - f, te = Math.max(180, window.innerHeight * 0.75);\n k(u, Math.max(-te, Math.min(te, I)), !0);\n }\n function b(T) {\n if (h !== null && T.pointerId !== h) return;\n const I = 42;\n Math.abs(c(u)) < 8 ? k(l, !c(l)) : c(u) > I ? k(l, !1) : c(u) < -I && k(l, !0), y();\n }\n function y() {\n window.removeEventListener(\"pointermove\", g), window.removeEventListener(\"pointerup\", b), window.removeEventListener(\"pointercancel\", b), k(d, !1), k(u, 0), h = null;\n }\n var C = {\n get activeView() {\n return t();\n },\n set activeView(T) {\n t(T), de();\n },\n get route() {\n return n();\n },\n set route(T = \"\") {\n n(T), de();\n },\n get projectId() {\n return s();\n },\n set projectId(T = \"\") {\n s(T), de();\n },\n get contentHref() {\n return o();\n },\n set contentHref(T = \"#website/content\") {\n o(T), de();\n }\n }, E = xT();\n let R, q;\n var O = v(E), M = v(O), P = x(M, 2);\n {\n var L = (T) => {\n var I = bT(), te = v(I);\n let A;\n var V = x(te, 2);\n let H;\n var ne = x(V, 2);\n let X;\n m(I), B(() => {\n A = Ne(te, 1, \"switcher-link svelte-1oelwps\", null, A, { active: t() === \"chat\" }), H = Ne(V, 1, \"switcher-link svelte-1oelwps\", null, H, { active: t() === \"content\" }), Ge(V, \"href\", o()), X = Ne(ne, 1, \"switcher-link svelte-1oelwps\", null, X, { active: t() === \"templates\" });\n }), w(T, I);\n };\n K(P, (T) => {\n c(a) || T(L);\n });\n }\n m(O);\n var $ = x(O, 2), J = v($);\n {\n var U = (T) => {\n var I = yT(), te = v(I);\n let A;\n var V = x(te, 2);\n let H;\n var ne = x(V, 2);\n let X;\n m(I), B(() => {\n A = Ne(te, 1, \"switcher-link svelte-1oelwps\", null, A, { active: t() === \"chat\" }), H = Ne(V, 1, \"switcher-link svelte-1oelwps\", null, H, { active: t() === \"content\" }), Ge(V, \"href\", o()), X = Ne(ne, 1, \"switcher-link svelte-1oelwps\", null, X, { active: t() === \"templates\" });\n }), w(T, I);\n };\n K(J, (T) => {\n c(a) || T(U);\n });\n }\n m($);\n var F = x($, 2), z = v(F);\n {\n var _ = (T) => {\n ug(T, {\n get projectId() {\n return s();\n }\n });\n }, N = (T) => {\n vd(T, {});\n }, Q = (T) => {\n fv(T, {\n get route() {\n return n();\n }\n });\n };\n K(z, (T) => {\n t() === \"chat\" ? T(_) : t() === \"templates\" ? T(N, 1) : T(Q, -1);\n });\n }\n return m(F), m(E), B(() => {\n R = Ne(E, 1, \"sidebar svelte-1oelwps\", null, R, {\n \"sheet-expanded\": c(l),\n \"sheet-collapsed\": !c(l),\n \"sheet-dragging\": c(d)\n }), q = Vs(E, \"\", q, { \"--sheet-drag-offset\": `${c(u) ?? \"\"}px` }), Ge(M, \"aria-label\", c(l) ? \"Hide website editor\" : \"Show website editor\"), Ge(M, \"aria-expanded\", c(l));\n }), fe(\"pointerdown\", M, p), w(r, E), st(C);\n}\nhr([\"pointerdown\"]);\nrt(pv, { activeView: {}, route: {}, projectId: {}, contentHref: {} }, [], [], { mode: \"open\" });\nvar kT = S('Save <div class=\"btn-notification\"> </div>', 1), CT = S('<div><span> </span> <button type=\"button\" class=\"notification-close svelte-tqa7on\">\u00D7</button></div>'), _T = S('<div class=\"notifications svelte-tqa7on\" aria-live=\"polite\"></div>'), ST = S('<div class=\"workspace-error svelte-tqa7on\"><h1 class=\"svelte-tqa7on\">Workspace failed to load</h1> <p class=\"svelte-tqa7on\"> </p></div>'), ET = S('<div class=\"workspace-loading svelte-tqa7on\"><div class=\"spinner svelte-tqa7on\"></div> <p class=\"svelte-tqa7on\">Loading site files...</p></div>'), TT = S('<div class=\"workspace-layout svelte-tqa7on\"><section class=\"preview-pane svelte-tqa7on\" aria-label=\"Website preview\"><!></section> <section class=\"right-pane svelte-tqa7on\" aria-label=\"Editor\"><!></section></div>'), MT = S('<div class=\"workspace-root svelte-tqa7on\"><!> <!> <!> <!></div>');\nconst AT = {\n hash: \"svelte-tqa7on\",\n code: `.workspace-root.svelte-tqa7on {position:relative;display:flex;flex-direction:column;width:100%;height:100vh;min-height:0;background:var(--bgColor-default, #ffffff);color:var(--fgColor-default, #24292f);font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;overflow:hidden;}.workspace-layout.svelte-tqa7on {display:grid;grid-template-columns:minmax(0, 1fr) minmax(380px, 520px);grid-template-rows:minmax(0, 1fr);width:100%;flex:1;min-width:0;min-height:0;overflow:hidden;}.workspace-layout[data-view='content'].svelte-tqa7on {grid-template-columns:minmax(0, 1fr) minmax(380px, 520px);}.preview-pane.svelte-tqa7on {min-width:0;min-height:0;overflow:hidden;border-top:none !important;}.right-pane.svelte-tqa7on {min-width:0;min-height:0;overflow:hidden;}.right-pane.svelte-tqa7on {display:flex;flex-direction:column;background:var(--bgColor-default, #ffffff);border-left:1px solid var(--borderColor-default, #d0d7de);}.workspace-loading.svelte-tqa7on,\n\t.workspace-error.svelte-tqa7on {width:100%;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;padding:2rem;text-align:center;}.workspace-error.svelte-tqa7on h1:where(.svelte-tqa7on) {font-size:1.25rem;margin:0;}.workspace-error.svelte-tqa7on p:where(.svelte-tqa7on),\n\t.workspace-loading.svelte-tqa7on p:where(.svelte-tqa7on) {margin:0;color:var(--fgColor-muted, #656d76);}.spinner.svelte-tqa7on {width:24px;height:24px;border:2px solid var(--borderColor-muted, #d8dee4);border-top-color:var(--fgColor-accent, #0969da);border-radius:999px;\n\t\tanimation: svelte-tqa7on-spin 0.8s linear infinite;}.notifications.svelte-tqa7on {position:absolute;top:1rem;right:1rem;z-index:1000;display:flex;flex-direction:column;gap:0.5rem;max-width:min(420px, calc(100vw - 2rem));}.notification.svelte-tqa7on {display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.75rem;border:1px solid var(--borderColor-default, #d0d7de);border-radius:0.5rem;background:var(--bgColor-default, #ffffff);box-shadow:0 8px 24px rgba(140, 149, 159, 0.2);font-size:0.875rem;}.notification.success.svelte-tqa7on {border-color:#1a7f37;}.notification.danger.svelte-tqa7on {border-color:#cf222e;}.notification.warning.svelte-tqa7on {border-color:#9a6700;}.notification-close.svelte-tqa7on {border:0;background:transparent;font:inherit;font-size:1.25rem;line-height:1;cursor:pointer;color:inherit;}.save-btn {position:relative;}.btn-notification {position:absolute;top:-0.5rem;right:-0.5rem;width:1.25rem;height:1.25rem;background-color:#cf352f;border-radius:50%;display:flex;justify-content:center;align-items:center;font-size:0.625rem;color:#fff;border:2px solid var(--bgColor-default, #ffffff);font-weight:900;}\n\n\t@keyframes svelte-tqa7on-spin {\n\t\tto { transform: rotate(360deg); }\n\t}\n\n\t@media (max-width: 900px) {.workspace-root.svelte-tqa7on {height:100dvh;}.workspace-layout.svelte-tqa7on {display:block;position:relative;}.preview-pane.svelte-tqa7on {height:100%;}\n\n\n\t}`\n};\nfunction hv(r, e) {\n nt(e, !0), bt(r, AT);\n let t = ce(e, \"currentView\", 7), n = ce(e, \"route\", 7, \"\"), s = ce(e, \"projectId\", 7), o = ce(e, \"availableModules\", 7), i = ce(e, \"repoInitialized\", 7), a = ce(e, \"repoInitError\", 7), l = ce(e, \"onSettings\", 7);\n const { repoFiles: d, notifications: u, cms: f } = yn();\n let h = W(!1);\n const p = ie(() => d.changeSets.length), g = ie(t), b = ie(() => mc(f.collections.config)), y = ie(() => n() ? `#website/content${n()}` : `#website/content${c(b)}`);\n var C = {\n get currentView() {\n return t();\n },\n set currentView(F) {\n t(F), de();\n },\n get route() {\n return n();\n },\n set route(F = \"\") {\n n(F), de();\n },\n get projectId() {\n return s();\n },\n set projectId(F) {\n s(F), de();\n },\n get availableModules() {\n return o();\n },\n set availableModules(F) {\n o(F), de();\n },\n get repoInitialized() {\n return i();\n },\n set repoInitialized(F) {\n i(F), de();\n },\n get repoInitError() {\n return a();\n },\n set repoInitError(F) {\n a(F), de();\n },\n get onSettings() {\n return l();\n },\n set onSettings(F) {\n l(F), de();\n }\n }, E = MT(), R = v(E);\n Oo(R, {\n get modules() {\n return o();\n },\n currentModule: \"website\",\n get onSettings() {\n return l();\n },\n children: (F, z) => {\n var _ = lt(), N = ke(_);\n {\n var Q = (T) => {\n Je(T, {\n variant: \"primary\",\n class: \"save-btn\",\n onclick: () => k(h, !0),\n children: (I, te) => {\n Pe();\n var A = kT(), V = x(ke(A)), H = v(V, !0);\n m(V), B(() => D(H, c(p))), w(I, A);\n },\n $$slots: { default: !0 }\n });\n };\n K(N, (T) => {\n c(p) > 0 && T(Q);\n });\n }\n w(F, _);\n },\n $$slots: { default: !0 }\n });\n var q = x(R, 2);\n {\n var O = (F) => {\n var z = _T();\n tt(z, 21, () => u.notifications, (_) => _.id, (_, N) => {\n var Q = CT(), T = v(Q), I = v(T, !0);\n m(T);\n var te = x(T, 2);\n m(Q), B(() => {\n Ne(Q, 1, `notification ${c(N).type ?? \"\"}`, \"svelte-tqa7on\"), D(I, c(N).message);\n }), fe(\"click\", te, () => u.removeNotification(c(N).id)), w(_, Q);\n }), m(z), w(F, z);\n };\n K(q, (F) => {\n u.notifications.length > 0 && F(O);\n });\n }\n var M = x(q, 2);\n {\n var P = (F) => {\n var z = ST(), _ = x(v(z), 2), N = v(_, !0);\n m(_), m(z), B(() => D(N, a())), w(F, z);\n }, L = (F) => {\n var z = ET();\n w(F, z);\n }, $ = (F) => {\n var z = TT(), _ = v(z), N = v(_);\n lv(N, {}), m(_);\n var Q = x(_, 2), T = v(Q);\n pv(T, {\n get activeView() {\n return c(g);\n },\n get route() {\n return n();\n },\n get projectId() {\n return s();\n },\n get contentHref() {\n return c(y);\n }\n }), m(Q), m(z), B(() => Ge(z, \"data-view\", c(g))), w(F, z);\n };\n K(M, (F) => {\n a() ? F(P) : i() ? F($, -1) : F(L, 1);\n });\n }\n var J = x(M, 2);\n {\n var U = (F) => {\n ni(F, {\n get open() {\n return c(h);\n },\n onClose: () => k(h, !1)\n });\n };\n K(J, (F) => {\n c(h) && F(U);\n });\n }\n return m(E), w(r, E), st(C);\n}\nhr([\"click\"]);\nrt(\n hv,\n {\n currentView: {},\n route: {},\n projectId: {},\n availableModules: {},\n repoInitialized: {},\n repoInitError: {},\n onSettings: {}\n },\n [],\n [],\n { mode: \"open\" }\n);\nvar PT = S('<!> <main class=\"svelte-2oie5q\"><div class=\"setup-gate svelte-2oie5q\"><!></div></main>', 1), NT = S('<p class=\"svelte-2oie5q\"> </p>'), OT = S('<a class=\"card svelte-2oie5q\"><h4 class=\"svelte-2oie5q\"> </h4> <!></a>'), $T = S('<!> <main class=\"svelte-2oie5q\"><div class=\"main-content svelte-2oie5q\"><h2 class=\"svelte-2oie5q\">Modules</h2> <div class=\"cards svelte-2oie5q\"></div></div></main>', 1), IT = S('<main class=\"svelte-2oie5q\"><div class=\"main-content svelte-2oie5q\"><p class=\"svelte-2oie5q\"> </p></div></main>'), zT = S('<main class=\"svelte-2oie5q\"><div class=\"main-content svelte-2oie5q\"><p class=\"svelte-2oie5q\">Loading site files...</p></div></main>'), RT = S('<main class=\"svelte-2oie5q\"><div class=\"main-content svelte-2oie5q\"><p class=\"svelte-2oie5q\"> </p></div></main>'), jT = S('<main class=\"svelte-2oie5q\"><div class=\"main-content svelte-2oie5q\"><p class=\"svelte-2oie5q\">Loading site files...</p></div></main>'), LT = S('<main class=\"svelte-2oie5q\"><div class=\"main-content svelte-2oie5q\"><p class=\"svelte-2oie5q\">Module not found</p> <p style=\"color: var(--fgColor-muted);\" class=\"svelte-2oie5q\">Current module: <code class=\"svelte-2oie5q\"> </code></p></div></main>'), DT = S('<div class=\"admin-root svelte-2oie5q\"><!> <!></div>');\nconst FT = {\n hash: \"svelte-2oie5q\",\n code: `\n\t/* Component root styles */.admin-root.svelte-2oie5q :where(.svelte-2oie5q),\n\t.admin-root.svelte-2oie5q :where(.svelte-2oie5q)::before,\n\t.admin-root.svelte-2oie5q :where(.svelte-2oie5q)::after {box-sizing:border-box;}.admin-root.svelte-2oie5q {font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;color:var(--fgColor-default);}main.svelte-2oie5q {min-width:0px;width:100%;overflow-x:hidden;background-color:var(--bgColor-default);min-height:100vh;}.main-content.svelte-2oie5q {padding:2rem;}.setup-gate.svelte-2oie5q {height:calc(100vh - 4rem);border-top:none;}h2.svelte-2oie5q {margin:1.5rem 0 1rem;scroll-margin-top:4rem;line-height:1.25;padding-bottom:0.5rem;font-size:1.5rem;border-bottom:1px solid var(--borderColor-default);font-weight:500;}.cards.svelte-2oie5q {display:grid;gap:2rem;grid-template-columns:1fr 1fr;}\n\t@media screen and (max-width: 768px) {.cards.svelte-2oie5q {grid-template-columns:1fr;}\n\t}.card.svelte-2oie5q {display:flex;flex-direction:column;width:100%;border-color:var(--borderColor-default);border-radius:0.375rem;border-style:solid;border-width:max(1px, 0.0625rem);position:relative;padding:1rem;}.card.svelte-2oie5q:hover {background-color:var(--bgColor-muted);}.card.svelte-2oie5q h4:where(.svelte-2oie5q) {margin:0;white-space:nowrap;font-weight:600;}.card.svelte-2oie5q p:where(.svelte-2oie5q) {color:var(--fgColor-muted);margin:0.5rem 0 0;}\n\n\t/* Global styles (main.css) */a,\n\ta:visited {color:var(--fgColor-default);text-decoration:none;}button {font-family:inherit;}.save-btn {position:relative;}.btn-notification {position:absolute;top:-0.5rem;right:-0.5rem;width:1.25rem;height:1.25rem;background-color:#cf352f;border-radius:50%;display:flex;justify-content:center;align-items:center;font-size:0.625rem;color:#fff;border:2px solid var(--bgColor-default, #ffffff);font-weight:900;}`\n};\nfunction BT(r, e) {\n nt(e, !0), bt(r, FT);\n let t = ce(e, \"config\", 23, () => ({ loginMethod: \"password\" }));\n const n = ie(() => () => {\n if (typeof t() == \"string\")\n try {\n return JSON.parse(t());\n } catch (_) {\n return console.error(\"[Admin] Failed to parse config string:\", _), { loginMethod: \"password\" };\n }\n return t();\n }), s = og(), o = Rg(s.repoFiles), i = gC(s.repoFiles);\n let a = W(!1), l = W(null);\n const d = \"deployed\";\n Ar(() => {\n (async () => {\n try {\n await s.repoFiles.init(d);\n try {\n const _ = c(q).some((N) => s.repoFiles.getFileContent(N.path) === null);\n s.repoFiles.srcFiles.length === 0 || _ ? await s.repoFiles.syncFromAPI() : await s.repoFiles.syncIfRemoteChanged();\n } catch (_) {\n const N = _ instanceof Error ? _.message : String(_);\n s.notifications.error(N);\n }\n await i.shop.initialize(), await o.emails.initialize(), k(a, !0);\n } catch (_) {\n k(l, _ instanceof Error ? _.message : String(_), !0), s.notifications.error(c(l));\n }\n })();\n });\n function u(_) {\n let N = null, Q = \"content\", T = \"\";\n if (!_ || _ === \"#/\")\n return {\n currentModule: N,\n websiteView: Q,\n moduleRoute: T\n };\n const I = _.substring(1), te = I.indexOf(\"/\");\n if (te === -1 ? (N = I, T = \"\") : (N = I.substring(0, te), T = I.substring(te)), N === \"settings\")\n N = null;\n else if (N === \"website\") {\n const A = T.split(\"/\").filter(Boolean), V = A[0];\n V === \"content\" ? (Q = \"content\", T = `/${A.slice(1).join(\"/\")}`, T === \"/\" && (T = \"\")) : V === \"templates\" ? (Q = \"templates\", T = \"\") : (Q = \"chat\", T = \"\");\n }\n return {\n currentModule: N,\n websiteView: Q,\n moduleRoute: T\n };\n }\n function f() {\n if (typeof window > \"u\")\n return { currentModule: null, websiteView: \"content\", moduleRoute: \"\" };\n try {\n return u(window.location.hash);\n } catch (_) {\n return console.error(\"[Admin] Error parsing initial hash:\", _), { currentModule: null, websiteView: \"content\", moduleRoute: \"\" };\n }\n }\n const h = f();\n let p = W(ft(h.currentModule)), g = W(ft(h.websiteView)), b = W(ft(h.moduleRoute)), y = W(ft(h.currentModule === \"website\" && h.websiteView === \"content\" && h.moduleRoute === \"\" && !(s.cms.collections.config && Object.keys(s.cms.collections.config).length > 0)));\n kr(() => {\n if (c(p) === \"website\" && c(g) === \"content\" && c(b) === \"\" && c(y)) {\n const _ = s.cms.collections.config;\n if (_ && Object.keys(_).length > 0) {\n const N = mc(_);\n N && (k(y, !1), window.location.hash = `#website/content${N}`);\n }\n }\n });\n let C = W(!1);\n function E() {\n try {\n const _ = u(window.location.hash);\n if (k(p, _.currentModule, !0), k(g, _.websiteView, !0), k(b, _.moduleRoute, !0), c(p) === \"website\" && c(g) === \"content\" && c(b) === \"\") {\n const N = s.cms.collections.config, Q = N && Object.keys(N).length > 0;\n k(y, !Q);\n } else\n k(y, !1);\n } catch (_) {\n console.error(\"[Admin] Error parsing hash:\", _), k(p, null), k(g, \"content\"), k(b, \"\"), k(y, !1);\n }\n }\n Ar(() => {\n if (!(typeof window > \"u\"))\n return E(), window.addEventListener(\"hashchange\", E), () => {\n window.removeEventListener(\"hashchange\", E);\n };\n });\n const R = ie(() => () => {\n const _ = mc(s.cms.collections.config);\n return [\n {\n id: \"website\",\n title: \"Website\",\n description: \"Edit the website with chat and manage content\",\n href: _ ? `#website/content${_}` : \"#website/templates\"\n },\n {\n id: \"emails\",\n title: \"Emails\",\n description: \"Manage contacts, campaigns, and email templates\",\n href: \"#emails\"\n },\n {\n id: \"shop\",\n title: \"Shop\",\n description: \"Manage products, orders, and customers\",\n href: \"#shop\"\n }\n ];\n }), q = ie(aC), O = ie(() => () => {\n const _ = s.repoFiles.getFileContent(Pi);\n if (_ === null) return !1;\n try {\n return !Sl(JSON.parse(_)).complete;\n } catch {\n return !0;\n }\n }), M = ie(() => c(a) && (c(q).some((_) => s.repoFiles.getFileContent(_.path) === null) || c(O)()));\n let P = W(!1);\n const L = ie(() => !!c(n)().canManageAdminUsers);\n Ar(() => {\n if (typeof window > \"u\") return;\n const _ = c(R)();\n (!window.location.hash || window.location.hash === \"#/\") && _.length === 1 && (window.location.hash = _[0].href), k(C, !0);\n });\n var $ = {\n get config() {\n return t();\n },\n set config(_ = { loginMethod: \"password\" }) {\n t(_), de();\n }\n }, J = DT(), U = v(J);\n {\n var F = (_) => {\n var N = lt(), Q = ke(N);\n {\n var T = (ne) => {\n var X = PT(), G = ke(X);\n Oo(G, { modules: [], currentModule: null, onSettings: void 0 });\n var Y = x(G, 2), se = v(Y), ue = v(se);\n vd(ue, {}), m(se), m(Y), w(ne, X);\n }, I = (ne) => {\n var X = $T(), G = ke(X);\n {\n let le = ie(() => c(R)()), re = ie(() => c(L) ? () => k(P, !0) : void 0);\n Oo(G, {\n get modules() {\n return c(le);\n },\n currentModule: null,\n get onSettings() {\n return c(re);\n }\n });\n }\n var Y = x(G, 2), se = v(Y), ue = x(v(se), 2);\n tt(ue, 21, () => c(R)(), pt, (le, re) => {\n var ae = OT(), ge = v(ae), Se = v(ge, !0);\n m(ge);\n var _e = x(ge, 2);\n {\n var Re = (Ie) => {\n var Fe = NT(), j = v(Fe, !0);\n m(Fe), B(() => D(j, c(re).description)), w(Ie, Fe);\n };\n K(_e, (Ie) => {\n c(re).description && Ie(Re);\n });\n }\n m(ae), B(() => {\n Ge(ae, \"href\", c(re).href), D(Se, c(re).title);\n }), w(le, ae);\n }), m(ue), m(se), m(Y), w(ne, X);\n }, te = (ne) => {\n {\n let X = ie(() => c(R)()), G = ie(() => c(L) ? () => k(P, !0) : void 0);\n hv(ne, {\n get currentView() {\n return c(g);\n },\n get route() {\n return c(b);\n },\n projectId: d,\n get availableModules() {\n return c(X);\n },\n get repoInitialized() {\n return c(a);\n },\n get repoInitError() {\n return c(l);\n },\n get onSettings() {\n return c(G);\n }\n });\n }\n }, A = (ne) => {\n var X = lt(), G = ke(X);\n {\n var Y = (le) => {\n var re = IT(), ae = v(re), ge = v(ae), Se = v(ge, !0);\n m(ge), m(ae), m(re), B(() => D(Se, c(l))), w(le, re);\n }, se = (le) => {\n var re = zT();\n w(le, re);\n }, ue = (le) => {\n {\n let re = ie(() => c(R)()), ae = ie(() => c(L) ? () => k(P, !0) : void 0);\n Pm(le, {\n get route() {\n return c(b);\n },\n get availableModules() {\n return c(re);\n },\n get onSettings() {\n return c(ae);\n }\n });\n }\n };\n K(G, (le) => {\n c(l) ? le(Y) : c(a) ? le(ue, -1) : le(se, 1);\n });\n }\n w(ne, X);\n }, V = (ne) => {\n var X = lt(), G = ke(X);\n {\n var Y = (le) => {\n var re = RT(), ae = v(re), ge = v(ae), Se = v(ge, !0);\n m(ge), m(ae), m(re), B(() => D(Se, c(l))), w(le, re);\n }, se = (le) => {\n var re = jT();\n w(le, re);\n }, ue = (le) => {\n {\n let re = ie(() => c(R)()), ae = ie(() => c(L) ? () => k(P, !0) : void 0);\n Rm(le, {\n get route() {\n return c(b);\n },\n get availableModules() {\n return c(re);\n },\n get onSettings() {\n return c(ae);\n }\n });\n }\n };\n K(G, (le) => {\n c(l) ? le(Y) : c(a) ? le(ue, -1) : le(se, 1);\n });\n }\n w(ne, X);\n }, H = (ne) => {\n var X = LT(), G = v(X), Y = x(v(G), 2), se = x(v(Y)), ue = v(se, !0);\n m(se), m(Y), m(G), m(X), B(() => D(ue, c(p) || \"none\")), w(ne, X);\n };\n K(Q, (ne) => {\n c(M) ? ne(T) : c(p) === null ? ne(I, 1) : c(p) === \"website\" ? ne(te, 2) : c(p) === \"emails\" ? ne(A, 3) : c(p) === \"shop\" ? ne(V, 4) : ne(H, -1);\n });\n }\n w(_, N);\n };\n K(U, (_) => {\n c(C) && _(F);\n });\n }\n var z = x(U, 2);\n return Sc(z, {\n get open() {\n return c(P);\n },\n title: \"Settings\",\n maxWidth: \"64rem\",\n onClose: () => {\n k(P, !1), typeof window < \"u\" && window.location.hash.startsWith(\"#settings\") && (window.location.hash = \"\");\n },\n children: (_, N) => {\n {\n let Q = ie(() => c(n)());\n Bm(_, {\n get config() {\n return c(Q);\n },\n get settingsFiles() {\n return c(q);\n }\n });\n }\n },\n $$slots: { default: !0 }\n }), m(J), w(r, J), st($);\n}\ncustomElements.define(\"hintergrund-admin\", rt(BT, { config: {} }, [], []));\nexport {\n BT as default\n};\n";
|
|
2
|
-
export declare const LOGIN_JS = "import { Y as W, Z as X, _ as $, am as ee, K as ae, P as s, a1 as i, a2 as l, a7 as y, a3 as te, ax as re, a0 as se, a5 as u, N as t, a8 as h, ay as oe, a9 as B, aa as ie, Q as v, ab as g, ao as le, af as k, ad as n, a4 as T, ag as O, ar as ne } from \"./global-DdaMTl90.js\";\ntypeof globalThis.process > \"u\" && (globalThis.process = { env: {}, platform: \"browser\", version: \"\", versions: {}, browser: !0, nextTick: function(w) {\n return Promise.resolve().then(w);\n} });\nvar de = g('<div class=\"flash flash-error\"><svg class=\"octicon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><path d=\"M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z\"></path></svg> </div>'), ue = g('<div class=\"flash flash-success\"><svg class=\"octicon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><path d=\"M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16Zm3.78-9.72a.751.751 0 0 0-.018-1.042.751.751 0 0 0-1.042-.018L6.75 9.19 5.28 7.72a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042l2 2a.75.75 0 0 0 1.06 0Z\"></path></svg> </div>'), ve = g('<div class=\"form-group\"><label for=\"password\">Password</label> <input type=\"password\" id=\"password\" name=\"password\" class=\"form-control form-control-lg\" required=\"\" placeholder=\"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\"/></div>'), ce = g('<div class=\"form-group\"><label for=\"otp\">Email code</label> <input type=\"text\" id=\"otp\" name=\"otp\" class=\"form-control form-control-lg\" required=\"\" inputmode=\"numeric\" autocomplete=\"one-time-code\" maxlength=\"6\" placeholder=\"123456\"/></div>'), fe = g('<main class=\"auth-wrapper svelte-uxwqu2\"><div class=\"auth-container svelte-uxwqu2\"><div class=\"auth-header svelte-uxwqu2\"><svg class=\"auth-logo svelte-uxwqu2\" viewBox=\"0 0 90 90\" width=\"48\" height=\"48\" fill=\"currentColor\"><rect x=\"12\" y=\"12\" width=\"66\" height=\"66\" fill=\"currentColor\"></rect></svg> <h1 class=\"svelte-uxwqu2\">Sign in to Hintergrund</h1></div> <!> <!> <div class=\"Box\"><div class=\"Box-body\"><form autocomplete=\"off\"><div class=\"form-group\"><label for=\"email\">Email</label> <input type=\"email\" id=\"email\" name=\"email\" class=\"form-control form-control-lg\" required=\"\" placeholder=\"you@example.com\"/></div> <!> <!></form></div></div></div></main>');\nconst me = {\n hash: \"svelte-uxwqu2\",\n code: \".auth-wrapper.svelte-uxwqu2 {min-height:100vh;display:flex;align-items:center;justify-content:center;background-color:var(--bgColor-muted);padding:var(--base-size-24);}.auth-container.svelte-uxwqu2 {width:100%;max-width:340px;}.auth-header.svelte-uxwqu2 {text-align:center;margin-bottom:var(--base-size-24);}.auth-logo.svelte-uxwqu2 {color:var(--fgColor-default);margin-bottom:var(--base-size-16);}.auth-header.svelte-uxwqu2 h1:where(.svelte-uxwqu2) {font-size:var(--text-title-size-medium);font-weight:var(--base-text-weight-light);color:var(--fgColor-default);margin:0;}\"\n};\nfunction pe(w, Z) {\n X(Z, !0), $(w, me);\n let A = ee(Z, \"config\", 7), x = v(!1), m = v(!1), q = v(\"\"), P = v(\"\"), _ = v(\"\"), f = v(\"\"), b = v(\"\"), c = v(!1);\n ae(() => {\n const e = new URLSearchParams(window.location.search).get(\"error\");\n e && (s(f, e, !0), window.history.replaceState({}, \"\", window.location.pathname));\n });\n async function U(a) {\n a.preventDefault(), s(f, \"\"), s(b, \"\"), s(c, !0);\n try {\n const e = {};\n t(_) && (e.email = t(_)), t(x) && (e.password = t(q)), t(m) && (e.otp = t(P));\n const o = await (await fetch(\"/api/admin/login\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(e)\n })).json();\n o.success ? o.requirePassword ? s(x, !0) : o.otpRequired ? (s(m, !0), s(b, o.message || \"Check your email for a six-digit sign-in code.\", !0)) : window.location.href = \"/admin\" : s(f, o.message ?? \"An error occurred. Please try again.\", !0);\n } catch {\n s(f, \"An error occurred. Please try again.\");\n } finally {\n s(c, !1);\n }\n }\n var D = {\n get config() {\n return A();\n },\n set config(a) {\n A(a), le();\n }\n }, C = fe(), E = l(C), j = i(l(E), 2);\n {\n var H = (a) => {\n var e = de(), r = i(l(e));\n n(e), h(() => O(r, ` ${t(f) ?? \"\"}`)), u(a, e);\n };\n y(j, (a) => {\n t(f) && a(H);\n });\n }\n var M = i(j, 2);\n {\n var K = (a) => {\n var e = ue(), r = i(l(e));\n n(e), h(() => O(r, ` ${t(b) ?? \"\"}`)), u(a, e);\n };\n y(M, (a) => {\n t(b) && a(K);\n });\n }\n var R = i(M, 2), J = l(R), L = l(J), S = l(L), z = i(l(S), 2);\n k(z), n(S);\n var N = i(S, 2);\n {\n var Q = (a) => {\n var e = ve(), r = i(l(e), 2);\n k(r), n(e), h(() => r.disabled = t(c)), B(r, () => t(q), (o) => s(q, o)), u(a, e);\n }, Y = (a) => {\n var e = ce(), r = i(l(e), 2);\n k(r), ne(r, \"pattern\", \"[0-9]6\"), n(e), h(() => r.disabled = t(c)), B(r, () => t(P), (o) => s(P, o)), u(a, e);\n };\n y(N, (a) => {\n t(x) ? a(Q) : t(m) && a(Y, 1);\n });\n }\n var F = i(N, 2);\n return te(F, {\n type: \"submit\",\n variant: \"primary\",\n size: \"large\",\n block: !0,\n get disabled() {\n return t(c);\n },\n children: (a, e) => {\n var r = re(), o = se(r);\n {\n var G = (d) => {\n var p = T(\"Please wait...\");\n u(d, p);\n }, I = (d) => {\n var p = T(\"Sign in\");\n u(d, p);\n }, V = (d) => {\n var p = T(\"Continue\");\n u(d, p);\n };\n y(o, (d) => {\n t(c) ? d(G) : t(m) ? d(I, 1) : d(V, -1);\n });\n }\n u(a, r);\n },\n $$slots: { default: !0 }\n }), n(L), n(J), n(R), n(E), n(C), h(() => z.disabled = t(c) || t(x) || t(m)), oe(\"submit\", L, U), B(z, () => t(_), (a) => s(_, a)), u(w, C), ie(D);\n}\ncustomElements.define(\"hintergrund-login\", W(pe, { config: {} }, [], []));\nexport {\n pe as default\n};\n";
|
|
3
|
-
export declare const BUILDER_JS = "import \"./global-DdaMTl90.js\";\nimport { B as i } from \"./Builder-BhGmzNTC.js\";\ntypeof globalThis.process > \"u\" && (globalThis.process = { env: {}, platform: \"browser\", version: \"\", versions: {}, browser: !0, nextTick: function(e) {\n return Promise.resolve().then(e);\n} });\nexport {\n i as default\n};\n";
|
|
4
|
-
export declare const SHARED_CSS = ":root{--base-size-4: .25rem;--base-size-6: .375rem;--base-size-8: .5rem;--base-size-12: .75rem;--base-size-16: 1rem;--base-size-20: 1.25rem;--base-size-24: 1.5rem;--base-size-32: 2rem;--base-size-40: 2.5rem;--base-size-48: 3rem;--base-size-64: 4rem;--base-size-80: 5rem;--base-size-96: 6rem;--base-size-112: 7rem;--base-size-128: 8rem;--base-size-150: 9.375rem;--base-size-192: 12rem;--base-size-200: 12.5rem;--base-size-400: 25rem;--base-size-500: 31.25rem;--base-size-600: 37.5rem;--base-size-800: 50rem;--base-text-weight-light: 300;--base-text-weight-normal: 400;--base-text-weight-medium: 500;--base-text-weight-semibold: 600;--text-body-size-small: .75rem;--text-body-size-medium: .875rem;--text-body-size-large: 1rem;--text-body-lineHeight-small: 1.6666;--text-body-lineHeight-medium: 1.4285;--text-body-lineHeight-large: 1.5;--text-title-size-small: .875rem;--text-title-size-medium: 1.25rem;--text-title-size-large: 2rem;--text-title-lineHeight-small: 1.5;--text-title-lineHeight-medium: 1.6;--text-title-lineHeight-large: 1.25;--brand-text-size-100: 1rem;--brand-text-size-200: 1.25rem;--brand-text-size-300: 1.5rem;--brand-text-size-400: 2rem;--brand-text-weight-400: 500;--brand-text-lineHeight-400: 1.25;--brand-text-letterSpacing-400: -.03125rem;--bgColor-default: #ffffff;--bgColor-muted: #f6f8fa;--bgColor-accent-muted: #ddf4ff;--bgColor-danger-muted: #ffebe9;--bgColor-success-muted: #dafbe1;--bgColor-success-emphasis: #1f883d;--bgColor-accent-emphasis: #0969da;--bgColor-danger-emphasis: #cf222e;--bgColor-attention-emphasis: #9a6700;--bgColor-attention-muted: #fff8c5;--bgColor-done-emphasis: #8250df;--bgColor-done-muted: #fbefff;--bgColor-emphasis: #25292e;--bgColor-inverse: #25292e;--bgColor-neutral-emphasis: #59636e;--bgColor-neutral-muted: #818b981f;--bgColor-disabled: #eff2f5;--bgColor-transparent: #ffffff00;--brand-color-text-default: #1f2328;--fgColor-default: #1f2328;--fgColor-muted: #59636e;--fgColor-accent: #0969da;--fgColor-danger: #d1242f;--fgColor-success: #1a7f37;--fgColor-onEmphasis: #ffffff;--fgColor-white: #ffffff;--fgColor-disabled: #818b9880;--borderWidth-thin: 1px;--borderWidth-thick: 2px;--borderRadius-small: .25rem;--borderRadius-medium: .375rem;--borderRadius-large: .75rem;--borderColor-default: #d1d9e0;--borderColor-muted: #d1d9e0b3;--borderColor-emphasis: #818b98;--borderColor-danger-emphasis: #cf222e;--borderColor-success-emphasis: #1f883d;--borderColor-accent-emphasis: #0969da;--borderColor-attention-emphasis: #9a6700;--borderColor-accent-muted: #54aeff66;--borderColor-attention-muted: #d4a72c66;--borderColor-danger-muted: #ff818266;--borderColor-success-muted: #4ac26b66;--borderColor-done-emphasis: #8250df;--borderColor-done-muted: #c297ff66;--borderColor-neutral-emphasis: #59636e;--borderColor-disabled: #818b981a;--button-default-bgColor-rest: var(--control-bgColor-rest);--button-default-bgColor-hover: var(--control-bgColor-hover);--button-default-bgColor-active: var(--control-bgColor-active);--button-default-bgColor-disabled: var(--control-bgColor-disabled);--button-default-bgColor-selected: var(--control-bgColor-active);--button-default-borderColor-rest: var(--control-borderColor-rest);--button-default-borderColor-hover: var(--button-default-borderColor-rest);--button-default-borderColor-active: var(--control-borderColor-rest);--button-default-borderColor-disabled: var(--control-borderColor-disabled);--button-default-fgColor-rest: var(--control-fgColor-rest);--button-default-shadow-resting: 0px 1px 0px 0px #1f23280a;--button-primary-bgColor-rest: var(--bgColor-success-emphasis);--button-primary-bgColor-hover: #1c8139;--button-primary-bgColor-active: #197935;--button-primary-bgColor-disabled: #95d8a6;--button-primary-borderColor-rest: #1f232826;--button-primary-borderColor-hover: var(--button-primary-borderColor-rest);--button-primary-borderColor-active: var(--button-primary-borderColor-rest);--button-primary-borderColor-disabled: var(--button-primary-bgColor-disabled);--button-primary-fgColor-rest: var(--fgColor-white);--button-primary-fgColor-disabled: #ffffffcc;--button-primary-iconColor-rest: #ffffffcc;--button-primary-shadow-selected: inset 0px 1px 0px 0px #002d114d;--button-danger-bgColor-rest: var(--control-bgColor-rest);--button-danger-bgColor-hover: #a40e26;--button-danger-bgColor-active: #8b0820;--button-danger-bgColor-disabled: var(--control-bgColor-disabled);--button-danger-borderColor-rest: var(--control-borderColor-rest);--button-danger-borderColor-hover: var(--button-primary-borderColor-rest);--button-danger-borderColor-active: var(--button-danger-borderColor-hover);--button-danger-fgColor-rest: var(--fgColor-danger);--button-danger-fgColor-hover: #ffffff;--button-danger-fgColor-active: #ffffff;--button-danger-fgColor-disabled: #d1242f80;--button-danger-iconColor-rest: var(--fgColor-danger);--button-danger-iconColor-hover: #ffffff;--button-danger-shadow-selected: inset 0px 1px 0px 0px #4c001433;--button-outline-bgColor-rest: var(--control-bgColor-rest);--button-outline-bgColor-hover: var(--bgColor-accent-emphasis);--button-outline-bgColor-active: #0757ba;--button-outline-bgColor-disabled: var(--control-bgColor-disabled);--button-outline-borderColor-hover: var(--button-primary-borderColor-hover);--button-outline-borderColor-active: var(--button-outline-borderColor-hover);--button-outline-fgColor-rest: var(--fgColor-accent);--button-outline-fgColor-hover: #ffffff;--button-outline-fgColor-active: #ffffff;--button-outline-fgColor-disabled: #0969da80;--button-outline-shadow-selected: inset 0px 1px 0px 0px #00215533;--button-invisible-bgColor-rest: var(--control-transparent-bgColor-rest);--button-invisible-bgColor-hover: var(--control-transparent-bgColor-hover);--button-invisible-bgColor-active: var(--control-transparent-bgColor-active);--button-invisible-bgColor-disabled: #ffffff00;--button-invisible-borderColor-rest: var(--control-transparent-borderColor-rest);--button-invisible-borderColor-hover: var(--control-transparent-borderColor-hover);--button-invisible-borderColor-disabled: #ffffff00;--button-invisible-fgColor-rest: var(--control-fgColor-rest);--button-invisible-fgColor-hover: var(--control-fgColor-rest);--button-invisible-fgColor-active: var(--control-fgColor-rest);--button-invisible-fgColor-disabled: var(--control-fgColor-disabled);--button-invisible-iconColor-rest: var(--fgColor-muted);--button-invisible-iconColor-hover: var(--fgColor-muted);--button-invisible-iconColor-disabled: var(--control-fgColor-disabled);--button-inactive-bgColor: #e6eaef;--button-inactive-fgColor: #59636e;--button-star-iconColor: #eac54f;--control-bgColor-rest: #f6f8fa;--control-bgColor-hover: #eff2f5;--control-bgColor-active: #e6eaef;--control-bgColor-disabled: var(--bgColor-disabled);--control-bgColor-selected: var(--control-bgColor-rest);--control-borderColor-rest: var(--borderColor-default);--control-borderColor-emphasis: var(--borderColor-emphasis);--control-borderColor-disabled: var(--borderColor-disabled);--control-borderColor-selected: var(--control-bgColor-selected);--control-borderColor-success: var(--borderColor-success-emphasis);--control-borderColor-danger: var(--borderColor-danger-emphasis);--control-borderColor-warning: var(--borderColor-attention-emphasis);--control-fgColor-rest: #25292e;--control-fgColor-placeholder: var(--fgColor-muted);--control-fgColor-disabled: var(--fgColor-disabled);--control-iconColor-rest: var(--fgColor-muted);--control-checked-bgColor-rest: var(--bgColor-accent-emphasis);--control-checked-bgColor-hover: #0860ca;--control-checked-bgColor-active: #0757ba;--control-checked-bgColor-disabled: var(--fgColor-disabled);--control-checked-borderColor-rest: var(--control-checked-bgColor-rest);--control-checked-borderColor-hover: var(--control-checked-bgColor-hover);--control-checked-borderColor-active: var(--control-checked-bgColor-active);--control-checked-borderColor-disabled: var(--control-checked-bgColor-disabled);--control-checked-fgColor-rest: var(--fgColor-onEmphasis);--control-checked-fgColor-disabled: var(--fgColor-onEmphasis);--control-transparent-bgColor-rest: #ffffff00;--control-transparent-bgColor-hover: #818b981a;--control-transparent-bgColor-active: #818b9826;--control-transparent-bgColor-disabled: var(--bgColor-disabled);--control-transparent-bgColor-selected: #818b9826;--control-transparent-borderColor-rest: #ffffff00;--control-transparent-borderColor-hover: #ffffff00;--control-transparent-borderColor-active: #ffffff00;--control-danger-bgColor-hover: var(--bgColor-danger-muted);--control-danger-bgColor-active: #ffebe966;--control-danger-fgColor-rest: var(--fgColor-danger);--control-danger-fgColor-hover: var(--fgColor-danger);--focus-outlineColor: var(--borderColor-accent-emphasis);--overlay-bgColor: #ffffff;--overlay-backdrop: #25292e66;--shadow-inset: inset 0px 1px 0px 0px #1f23280a;--shadow-floating-small: 0px 0px 0px 1px #d1d9e0;--shadow-floating-medium: 0px 0px 0px 1px #d1d9e0, 0px 8px 16px -4px #25292e14, 0px 4px 32px -4px #25292e14, 0px 24px 48px -12px #25292e14, 0px 48px 96px -24px #25292e14;--shadow-floating-large: 0px 0px 0px 1px #d1d9e0, 0px 40px 80px 0px #25292e3d;--tooltip-bgColor: var(--bgColor-emphasis);--tooltip-fgColor: var(--fgColor-onEmphasis);--stack-gap-normal: 1rem;--stack-gap-condensed: .5rem;--stack-gap-spacious: 1.5rem;--subitem-depth: 2rem;--fontStack-sansSerif: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Noto Sans\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\";--fontStack-monospace: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace}[data-color-mode=dark]{color-scheme:dark;--bgColor-default: #0d1117;--bgColor-muted: #161b22;--bgColor-accent-muted: #1c2d41;--bgColor-danger-muted: #490202;--bgColor-success-muted: #0f5323;--bgColor-success-emphasis: #238636;--bgColor-accent-emphasis: #1f6feb;--bgColor-danger-emphasis: #da3633;--bgColor-attention-emphasis: #9e6a03;--bgColor-attention-muted: #2e2a1b;--bgColor-done-emphasis: #8957e5;--bgColor-done-muted: #271344;--bgColor-emphasis: #e6edf3;--bgColor-inverse: #e6edf3;--bgColor-neutral-emphasis: #6e7681;--bgColor-neutral-muted: #6e76811a;--bgColor-disabled: #161b22;--bgColor-transparent: #00000000;--brand-color-text-default: #e6edf3;--fgColor-default: #e6edf3;--fgColor-muted: #7d8590;--fgColor-accent: #2f81f7;--fgColor-danger: #f85149;--fgColor-success: #3fb950;--fgColor-onEmphasis: #ffffff;--fgColor-white: #ffffff;--fgColor-disabled: #484f5880;--borderColor-default: #30363d;--borderColor-muted: #30363db3;--borderColor-emphasis: #6e7681;--borderColor-danger-emphasis: #da3633;--borderColor-success-emphasis: #238636;--borderColor-accent-emphasis: #1f6feb;--borderColor-attention-emphasis: #9e6a03;--borderColor-accent-muted: #388bfd66;--borderColor-attention-muted: #bb800966;--borderColor-danger-muted: #f8514966;--borderColor-success-muted: #2ea04366;--borderColor-done-emphasis: #8957e5;--borderColor-done-muted: #a371f766;--borderColor-neutral-emphasis: #6e7681;--borderColor-disabled: #6e76811a;--button-default-bgColor-rest: #21262d;--button-default-bgColor-hover: #30363d;--button-default-bgColor-active: #292e36;--button-default-bgColor-disabled: #161b22;--button-default-borderColor-rest: #30363db3;--button-default-borderColor-hover: #6e7681;--button-default-borderColor-active: #6e7681;--button-default-borderColor-disabled: #484f5880;--button-default-fgColor-rest: #e6edf3;--button-default-shadow-resting: 0px 0px rgba(0, 0, 0, 0);--button-default-shadow-inset: 0px 0px rgba(0, 0, 0, 0);--button-primary-bgColor-rest: #238636;--button-primary-bgColor-hover: #2ea043;--button-primary-bgColor-active: #298538;--button-primary-bgColor-disabled: #0d4118;--button-primary-borderColor-rest: #e6edf31a;--button-primary-borderColor-hover: #e6edf31a;--button-primary-borderColor-active: #e6edf31a;--button-primary-borderColor-disabled: #0d411880;--button-primary-fgColor-rest: #ffffff;--button-primary-fgColor-disabled: #ffffffcc;--button-primary-iconColor-rest: #ffffffcc;--button-primary-shadow-selected: inset 0px 1px 0px 0px #00330d4d;--button-danger-bgColor-rest: #21262d;--button-danger-bgColor-hover: #a40e26;--button-danger-bgColor-active: #8b0820;--button-danger-bgColor-disabled: #161b22;--button-danger-borderColor-rest: #30363db3;--button-danger-borderColor-hover: #e6edf31a;--button-danger-borderColor-active: #e6edf31a;--button-danger-fgColor-rest: #f85149;--button-danger-fgColor-hover: #ffffff;--button-danger-fgColor-active: #ffffff;--button-danger-fgColor-disabled: #f8514980;--button-danger-iconColor-rest: #f85149;--button-danger-iconColor-hover: #ffffff;--button-danger-shadow-selected: inset 0px 1px 0px 0px #67001433;--button-outline-bgColor-rest: #21262d;--button-outline-bgColor-hover: #1f6feb;--button-outline-bgColor-active: #1a5ecc;--button-outline-bgColor-disabled: #161b22;--button-outline-borderColor-hover: #e6edf31a;--button-outline-borderColor-active: #e6edf31a;--button-outline-fgColor-rest: #2f81f7;--button-outline-fgColor-hover: #ffffff;--button-outline-fgColor-active: #ffffff;--button-outline-fgColor-disabled: #2f81f780;--button-outline-shadow-selected: inset 0px 1px 0px 0px #00215533;--button-invisible-bgColor-rest: #00000000;--button-invisible-bgColor-hover: #6e76811a;--button-invisible-bgColor-active: #6e768126;--button-invisible-bgColor-disabled: #00000000;--button-invisible-borderColor-rest: #00000000;--button-invisible-borderColor-hover: #00000000;--button-invisible-borderColor-disabled: #00000000;--button-invisible-fgColor-rest: #e6edf3;--button-invisible-fgColor-hover: #e6edf3;--button-invisible-fgColor-active: #e6edf3;--button-invisible-fgColor-disabled: #484f5880;--button-invisible-iconColor-rest: #7d8590;--button-invisible-iconColor-hover: #7d8590;--button-invisible-iconColor-disabled: #484f5880;--button-inactive-bgColor: #292e36;--button-inactive-fgColor: #7d8590;--button-star-iconColor: #eac54f;--control-bgColor-rest: #010409;--control-bgColor-hover: #0d1117;--control-bgColor-active: #161b22;--control-bgColor-disabled: #161b22;--control-bgColor-selected: #010409;--control-borderColor-rest: #30363d;--control-borderColor-emphasis: #6e7681;--control-borderColor-disabled: #484f5880;--control-borderColor-selected: #010409;--control-borderColor-success: #238636;--control-borderColor-danger: #da3633;--control-borderColor-warning: #9e6a03;--control-fgColor-rest: #e6edf3;--control-fgColor-placeholder: #7d8590;--control-fgColor-disabled: #484f5880;--control-iconColor-rest: #7d8590;--control-checked-bgColor-rest: #1f6feb;--control-checked-bgColor-hover: #2f81f7;--control-checked-bgColor-active: #1a5ecc;--control-checked-bgColor-disabled: #484f5880;--control-checked-borderColor-rest: #1f6feb;--control-checked-borderColor-hover: #2f81f7;--control-checked-borderColor-active: #1a5ecc;--control-checked-borderColor-disabled: #484f5880;--control-checked-fgColor-rest: #ffffff;--control-checked-fgColor-disabled: #ffffff;--control-transparent-bgColor-rest: #00000000;--control-transparent-bgColor-hover: #6e76811a;--control-transparent-bgColor-active: #6e768126;--control-transparent-bgColor-disabled: #161b22;--control-transparent-bgColor-selected: #6e768126;--control-transparent-borderColor-rest: #00000000;--control-transparent-borderColor-hover: #00000000;--control-transparent-borderColor-active: #00000000;--control-danger-bgColor-hover: #490202;--control-danger-bgColor-active: #49020266;--control-danger-fgColor-rest: #f85149;--control-danger-fgColor-hover: #f85149;--focus-outlineColor: #1f6feb;--overlay-bgColor: #161b22;--overlay-backdrop: #e6edf366;--shadow-inset: inset 0px 1px 0px 0px #e6edf30a;--shadow-floating-small: 0px 0px 0px 1px #30363d;--shadow-floating-medium: 0px 0px 0px 1px #30363d, 0px 8px 16px -4px #e6edf314, 0px 4px 32px -4px #e6edf314, 0px 24px 48px -12px #e6edf314, 0px 48px 96px -24px #e6edf314;--shadow-floating-large: 0px 0px 0px 1px #30363d, 0px 40px 80px 0px #e6edf33d;--tooltip-bgColor: #e6edf3;--tooltip-fgColor: #0d1117}:root,[data-color-mode=light][data-light-theme*=light],[data-color-mode=dark][data-dark-theme*=light]{color-scheme:light}[data-color-mode]{color:var(--fgColor-default);background-color:var(--bgColor-default)}html{font-size:16px;font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}template,[hidden]{display:none!important}a{background-color:#0000}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace;font-size:1em}figure{margin:1em var(--base-size-40)}hr{box-sizing:content-box;height:0;overflow:visible}button,input,select,textarea{font:inherit;margin:0}optgroup{font-weight:var(--base-text-weight-semibold, 600)}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}*{box-sizing:border-box}input,select,textarea,button{font-family:inherit;font-size:inherit;line-height:inherit}body{font-family:var(--fontStack-sansSerif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Noto Sans\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\");font-size:var(--body-font-size, 14px);font-weight:var(--base-text-weight-normal, 400);line-height:1.5;color:var(--fgColor-default);background-color:var(--bgColor-default)}a{color:var(--fgColor-accent);text-decoration:none}a:hover{text-decoration:underline}b,strong{font-weight:var(--base-text-weight-semibold, 600)}fieldset{padding:0;margin:0;border:0}label{font-weight:var(--base-text-weight-semibold, 600)}::placeholder{color:var(--fgColor-muted);opacity:1}hr,.rule{height:0;margin:15px 0;overflow:hidden;background:#0000;border:0;border-bottom:1px solid var(--borderColor-muted)}hr:before,.rule:before{display:table;content:\"\"}hr:after,.rule:after{display:table;clear:both;content:\"\"}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}button{cursor:pointer;border-radius:0}[hidden][hidden]{display:none!important}details summary{cursor:pointer}a:focus,button:focus,[role=button]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}a:focus:not(:focus-visible),button:focus:not(:focus-visible),[role=button]:focus:not(:focus-visible),input[type=radio]:focus:not(:focus-visible),input[type=checkbox]:focus:not(:focus-visible){outline:solid 1px rgba(0,0,0,0)}a:focus-visible,button:focus-visible,[role=button]:focus-visible,input[type=radio]:focus-visible,input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}a:not([class]):focus,a:not([class]):focus-visible,input[type=radio]:focus,input[type=radio]:focus-visible,input[type=checkbox]:focus,input[type=checkbox]:focus-visible{outline-offset:0}.focus{border-color:var(--focus-outlineColor);outline:none;box-shadow:inset 0 0 0 1px var(--focus-outlineColor)}@media(forced-colors:active){*:focus,*:focus-visible{outline:solid 1px rgba(0,0,0,0)}input:not([type=radio],[type=checkbox]):focus,input:not([type=radio],[type=checkbox]):focus-visible,textarea:focus,textarea:focus-visible,select:focus,select:focus-visible{outline-offset:2px}}kbd{display:inline-block;padding:var(--base-size-4);font:11px var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);line-height:10px;color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);border-radius:6px;box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted)}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:0}h1{font-size:var(--h1-size, 32px);font-weight:var(--base-text-weight-semibold, 600)}h2{font-size:var(--h2-size, 24px);font-weight:var(--base-text-weight-semibold, 600)}h3{font-size:var(--h3-size, 20px);font-weight:var(--base-text-weight-semibold, 600)}h4{font-size:var(--h4-size, 16px);font-weight:var(--base-text-weight-semibold, 600)}h5{font-size:var(--h5-size, 14px);font-weight:var(--base-text-weight-semibold, 600)}h6{font-size:var(--h6-size, 12px);font-weight:var(--base-text-weight-semibold, 600)}p{margin-top:0;margin-bottom:10px}small{font-size:90%}blockquote{margin:0}ul,ol{padding-left:0;margin-top:0;margin-bottom:0}ol ol,ul ol{list-style-type:lower-roman}ul ul ol,ul ol ol,ol ul ol,ol ol ol{list-style-type:lower-alpha}dd{margin-left:0}tt,code,samp{font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}pre{margin-top:0;margin-bottom:0;font-family:var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.octicon{display:inline-block;overflow:visible!important;vertical-align:text-bottom;fill:currentColor}@media(forced-colors:active){body{--color-accent-emphasis: Highlight;--color-fg-on-emphasis: LinkText;--fgColor-onEmphasis: LinkText;--fgColor-accent: Highlight}}.Box{background-color:var(--bgColor-default);border:var(--borderWidth-thin) solid var(--borderColor-default);border-radius:var(--borderRadius-medium)}.Box-header{padding:var(--base-size-16);border-bottom:var(--borderWidth-thin) solid var(--borderColor-default)}.Box-header h2{margin:0;font-size:var(--text-body-size-large);font-weight:var(--base-text-weight-semibold)}.Box-header p{margin:var(--base-size-4) 0 0;font-size:var(--text-body-size-medium);line-height:var(--text-body-lineHeight-medium);color:var(--fgColor-muted)}.Box-body{padding:var(--base-size-16)}.form-group{margin-bottom:var(--base-size-16)}.form-group:last-child{margin-bottom:0}.form-group label{display:block;margin-bottom:var(--base-size-8);font-weight:var(--base-text-weight-semibold);font-size:var(--text-body-size-medium);color:var(--fgColor-default)}.form-control{display:block;width:100%;padding:var(--base-size-8) var(--base-size-12);font-family:inherit;font-size:var(--text-body-size-medium);line-height:1.5;color:var(--fgColor-default);background-color:var(--bgColor-default);border:var(--borderWidth-thin) solid var(--borderColor-default);border-radius:var(--borderRadius-medium);outline:none;box-shadow:var(--shadow-inset);transition:border-color .2s ease,box-shadow .2s ease}.form-control:focus{border-color:var(--borderColor-accent-emphasis);outline:var(--borderWidth-thick, 2px) solid var(--borderColor-accent-emphasis);outline-offset:-1px;box-shadow:none}.form-control::placeholder{color:var(--fgColor-muted)}.form-control:disabled{background-color:var(--control-bgColor-disabled, var(--bgColor-muted));cursor:not-allowed;opacity:.6}.form-control-lg{padding:var(--base-size-12);font-size:var(--text-body-size-large)}textarea.form-control{min-height:var(--base-size-80);resize:vertical}.flash{display:flex;align-items:flex-start;gap:var(--base-size-8);padding:var(--base-size-16);margin-bottom:var(--base-size-16);border:var(--borderWidth-thin) solid var(--borderColor-default);border-radius:var(--borderRadius-medium);font-size:var(--text-body-size-medium);line-height:var(--text-body-lineHeight-medium)}.flash .octicon{flex-shrink:0;margin-top:2px}.flash-error,.flash.danger{color:var(--fgColor-danger);background-color:var(--bgColor-danger-muted);border-color:var(--borderColor-danger-muted)}.flash-success,.flash.success{color:var(--fgColor-success);background-color:var(--bgColor-success-muted);border-color:var(--borderColor-success-muted)}\n";
|
|
5
|
-
//# sourceMappingURL=hintergrund-assets.d.ts.map
|