@kedataindo/docflow-vue 0.0.39 → 0.0.41

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/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  var Hh = Object.defineProperty;
2
2
  var qh = (e, t, i) => t in e ? Hh(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
3
  var Ni = (e, t, i) => qh(e, typeof t != "symbol" ? t + "" : t, i);
4
- import { createEditor as jh, definePlugin as ft, FontSizeExtension as $h, setSearchQuery as Vh, clearSearch as Wh, getSearchState as Gh, searchNext as Kh, searchPrev as Xh, replaceCurrent as Jh, replaceAll as Zh, sanitizePastedHTML as Qh } from "@kedataindo/docflow-core";
4
+ import { createEditor as jh, definePlugin as dt, FontSizeExtension as $h, setSearchQuery as Vh, clearSearch as Wh, getSearchState as Gh, searchNext as Kh, searchPrev as Xh, replaceCurrent as Jh, replaceAll as Zh, sanitizePastedHTML as Qh } from "@kedataindo/docflow-core";
5
5
  import { httpKeyStorage as dM, localStorageKeyStorage as pM, memoryKeyStorage as mM, openaiCompatibleProvider as hM, toAIStreamFn as bM } from "@kedataindo/docflow-core";
6
- import { ref as G, shallowRef as Yh, computed as ce, onMounted as cn, onUnmounted as jt, watch as Ee, unref as S, nextTick as tr, inject as eb, provide as tb, defineComponent as at, openBlock as M, createElementBlock as I, Fragment as Oe, renderList as Ie, normalizeStyle as ot, createElementVNode as k, createCommentVNode as se, createBlock as Ke, Teleport as ib, toDisplayString as D, normalizeClass as ge, h as al, withDirectives as Ce, withKeys as fi, vModelText as Ne, createVNode as te, withModifiers as we, Transition as Da, withCtx as Sn, resolveDynamicComponent as ni, createTextVNode as Fe, renderSlot as Qn, vModelSelect as yd, toRaw as ko, normalizeProps as pc, guardReactiveProps as mc, vModelCheckbox as wo, vModelRadio as za } from "vue";
6
+ import { ref as G, shallowRef as Yh, computed as ce, onMounted as cn, onUnmounted as jt, watch as Ee, unref as S, nextTick as tr, inject as eb, provide as tb, defineComponent as at, openBlock as M, createElementBlock as I, Fragment as Oe, renderList as Ie, normalizeStyle as ot, createElementVNode as k, createCommentVNode as se, createBlock as Ke, Teleport as ib, toDisplayString as D, normalizeClass as ge, h as al, withDirectives as Ce, withKeys as fi, vModelText as Ne, createVNode as te, withModifiers as _e, Transition as Da, withCtx as Sn, resolveDynamicComponent as ni, createTextVNode as Fe, renderSlot as Qn, vModelSelect as yd, toRaw as ko, normalizeProps as pc, guardReactiveProps as mc, vModelCheckbox as wo, vModelRadio as za } from "vue";
7
7
  import { VirtualPageOverlay as nb, getPageSize as rb, PAGE_SIZES as _o } from "@kedataindo/docflow-layout-engine";
8
8
  function ab(e) {
9
9
  const t = G(null), i = Yh(null), n = G(!1), r = ce(() => {
@@ -3345,7 +3345,7 @@ const ci = ne("x", [
3345
3345
  k("button", {
3346
3346
  type: "button",
3347
3347
  class: ge(["flex items-center gap-0.5 rounded px-2 py-0.5 text-[13px] transition-colors", p.value === H ? "bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300" : "text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800"]),
3348
- onClick: we((V) => A(H), ["stop"]),
3348
+ onClick: _e((V) => A(H), ["stop"]),
3349
3349
  onMouseenter: (V) => U(H)
3350
3350
  }, D(T.value[H].label), 43, G0),
3351
3351
  te(Da, {
@@ -3389,7 +3389,7 @@ const ci = ne("x", [
3389
3389
  key: ue.action,
3390
3390
  type: "button",
3391
3391
  class: "flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",
3392
- onClick: we((le) => q(ue.action), ["stop"])
3392
+ onClick: _e((le) => q(ue.action), ["stop"])
3393
3393
  }, [
3394
3394
  k("span", tg, [
3395
3395
  ue.icon ? (M(), Ke(ni(ue.icon), {
@@ -3408,7 +3408,7 @@ const ci = ne("x", [
3408
3408
  key: 2,
3409
3409
  type: "button",
3410
3410
  class: "flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",
3411
- onClick: we((ue) => q(V.action), ["stop"])
3411
+ onClick: _e((ue) => q(V.action), ["stop"])
3412
3412
  }, [
3413
3413
  k("span", ag, [
3414
3414
  V.icon ? (M(), Ke(ni(V.icon), {
@@ -3469,7 +3469,7 @@ const ci = ne("x", [
3469
3469
  type: "button",
3470
3470
  class: "flex h-8 items-center gap-1.5 rounded-full py-0.5 pl-0.5 pr-1.5 transition-colors hover:bg-slate-100 dark:hover:bg-slate-800",
3471
3471
  title: e.userName,
3472
- onClick: we(X, ["stop"])
3472
+ onClick: _e(X, ["stop"])
3473
3473
  }, [
3474
3474
  e.userAvatar && !y.value ? (M(), I("img", {
3475
3475
  key: 0,
@@ -3508,7 +3508,7 @@ const ci = ne("x", [
3508
3508
  type: "button",
3509
3509
  class: "flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800",
3510
3510
  title: "More",
3511
- onClick: we(F, ["stop"])
3511
+ onClick: _e(F, ["stop"])
3512
3512
  }, [
3513
3513
  te(S(Td), { class: "h-[18px] w-[18px]" })
3514
3514
  ]),
@@ -3826,7 +3826,7 @@ const ci = ne("x", [
3826
3826
  if ((re = n.editor) != null && re.isActive("highlight")) return "#ffff00";
3827
3827
  });
3828
3828
  function b(Y, B) {
3829
- var Je, ut, dt;
3829
+ var Je, ut, pt;
3830
3830
  const re = n.actions[Y];
3831
3831
  if (typeof re == "function")
3832
3832
  re(B);
@@ -3834,16 +3834,16 @@ const ci = ne("x", [
3834
3834
  const Ai = (ut = (Je = n.editor) == null ? void 0 : Je.commands) == null ? void 0 : ut[Y];
3835
3835
  typeof Ai == "function" && Ai(B);
3836
3836
  }
3837
- (dt = n.editor) == null || dt.commands.focus(), R.value = null;
3837
+ (pt = n.editor) == null || pt.commands.focus(), R.value = null;
3838
3838
  }
3839
3839
  function h(Y) {
3840
- var re, Je, ut, dt;
3840
+ var re, Je, ut, pt;
3841
3841
  const B = (re = n.editor) == null ? void 0 : re.chain().focus();
3842
3842
  if (!B) {
3843
3843
  R.value = null;
3844
3844
  return;
3845
3845
  }
3846
- Y === "setTextColor" ? (Je = B.unsetColor) == null || Je.call(B).run() : Y === "setHighlight" && ((ut = B.unsetHighlight) == null || ut.call(B).run()), (dt = n.editor) == null || dt.commands.focus(), R.value = null;
3846
+ Y === "setTextColor" ? (Je = B.unsetColor) == null || Je.call(B).run() : Y === "setHighlight" && ((ut = B.unsetHighlight) == null || ut.call(B).run()), (pt = n.editor) == null || pt.commands.focus(), R.value = null;
3847
3847
  }
3848
3848
  const v = ["toggleHeading1", "toggleHeading2", "toggleHeading3", "toggleHeading4", "toggleHeading5", "toggleHeading6"], g = ["alignLeft", "alignCenter", "alignRight", "alignJustify"], x = ["toggleBulletList", "toggleOrderedList", "toggleTaskList"], y = ["setLink", "insertImage", "insertTable", "toggleBlockquote", "toggleCodeBlock", "insertFootnote", "insertPageBreak", "setPageBreak", "togglePageBreak", "addPageBreak"], w = ["setTextColor", "setHighlight"], C = ce(() => o.value.flatMap((Y) => Y.items)), T = ce(() => C.value.filter((Y) => g.includes(Y.action))), L = ce(() => C.value.filter((Y) => x.includes(Y.action))), _ = ce(() => C.value.filter((Y) => y.includes(Y.action))), A = ce(() => C.value.filter((Y) => w.includes(Y.action))), z = ce(() => A.value.find((Y) => Y.action === "setTextColor")), F = ce(() => A.value.find((Y) => Y.action === "setHighlight")), W = ce(
3849
3849
  () => C.value.filter(
@@ -3956,16 +3956,16 @@ const ci = ne("x", [
3956
3956
  if (re) {
3957
3957
  for (const ut of re)
3958
3958
  if (ut.type.name === "textStyle" && ut.attrs.fontSize) {
3959
- const dt = parseInt(ut.attrs.fontSize, 10);
3960
- if (!isNaN(dt)) return dt;
3959
+ const pt = parseInt(ut.attrs.fontSize, 10);
3960
+ if (!isNaN(pt)) return pt;
3961
3961
  }
3962
3962
  }
3963
3963
  if ((Je = Y.view) != null && Je.dom) {
3964
3964
  const ut = parseFloat(getComputedStyle(Y.view.dom).fontSize);
3965
3965
  if (!isNaN(ut)) {
3966
- const dt = Math.round(ut);
3966
+ const pt = Math.round(ut);
3967
3967
  return he.reduce(
3968
- (Pt, Ft) => Math.abs(Ft - dt) < Math.abs(Pt - dt) ? Ft : Pt
3968
+ (Pt, Ft) => Math.abs(Ft - pt) < Math.abs(Pt - pt) ? Ft : Pt
3969
3969
  );
3970
3970
  }
3971
3971
  }
@@ -3975,7 +3975,7 @@ const ci = ne("x", [
3975
3975
  if (!n.editor) return;
3976
3976
  const B = Ue.value, re = he.indexOf(B);
3977
3977
  let Je;
3978
- re >= 0 ? Je = he[Math.min(Math.max(re + Y, 0), he.length - 1)] : Y < 0 ? Je = [...he].reverse().find((dt) => dt < B) ?? he[0] : Je = he.find((dt) => dt > B) ?? B, n.editor.commands.setFontSize(`${Je}px`), n.editor.commands.focus();
3978
+ re >= 0 ? Je = he[Math.min(Math.max(re + Y, 0), he.length - 1)] : Y < 0 ? Je = [...he].reverse().find((pt) => pt < B) ?? he[0] : Je = he.find((pt) => pt > B) ?? B, n.editor.commands.setFontSize(`${Je}px`), n.editor.commands.focus();
3979
3979
  }
3980
3980
  const ye = G(null);
3981
3981
  function Le(Y) {
@@ -4008,7 +4008,7 @@ const ci = ne("x", [
4008
4008
  title: S(i)("toolbar.undo"),
4009
4009
  "aria-label": S(i)("toolbar.undo"),
4010
4010
  disabled: !e.editor,
4011
- onMousedown: B[0] || (B[0] = we(() => {
4011
+ onMousedown: B[0] || (B[0] = _e(() => {
4012
4012
  }, ["prevent"])),
4013
4013
  onClick: N
4014
4014
  }, [
@@ -4020,7 +4020,7 @@ const ci = ne("x", [
4020
4020
  title: S(i)("toolbar.redo"),
4021
4021
  "aria-label": S(i)("toolbar.redo"),
4022
4022
  disabled: !e.editor,
4023
- onMousedown: B[1] || (B[1] = we(() => {
4023
+ onMousedown: B[1] || (B[1] = _e(() => {
4024
4024
  }, ["prevent"])),
4025
4025
  onClick: H
4026
4026
  }, [
@@ -4032,7 +4032,7 @@ const ci = ne("x", [
4032
4032
  class: ge([Ht, "w-8"]),
4033
4033
  title: S(i)("toolbar.print"),
4034
4034
  "aria-label": S(i)("toolbar.print"),
4035
- onMousedown: B[2] || (B[2] = we(() => {
4035
+ onMousedown: B[2] || (B[2] = _e(() => {
4036
4036
  }, ["prevent"])),
4037
4037
  onClick: V
4038
4038
  }, [
@@ -4044,7 +4044,7 @@ const ci = ne("x", [
4044
4044
  title: S(i)("toolbar.spelling"),
4045
4045
  "aria-label": S(i)("toolbar.spelling"),
4046
4046
  disabled: !e.editor,
4047
- onMousedown: B[3] || (B[3] = we(() => {
4047
+ onMousedown: B[3] || (B[3] = _e(() => {
4048
4048
  }, ["prevent"]))
4049
4049
  }, [
4050
4050
  te(S(Pd), { class: "h-[18px] w-[18px]" })
@@ -4054,7 +4054,7 @@ const ci = ne("x", [
4054
4054
  class: ge([Ht, "px-2 text-xs"]),
4055
4055
  title: S(i)("toolbar.zoom"),
4056
4056
  "aria-label": S(i)("toolbar.zoom"),
4057
- onMousedown: B[4] || (B[4] = we(() => {
4057
+ onMousedown: B[4] || (B[4] = _e(() => {
4058
4058
  }, ["prevent"]))
4059
4059
  }, D(S(i)("toolbar.zoom")), 43, qg),
4060
4060
  B[40] || (B[40] = k("span", { class: "mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10" }, null, -1)),
@@ -4065,9 +4065,9 @@ const ci = ne("x", [
4065
4065
  title: S(i)("toolbar.paragraphStyle"),
4066
4066
  "aria-label": S(i)("toolbar.paragraphStyle"),
4067
4067
  disabled: !e.editor,
4068
- onMousedown: B[5] || (B[5] = we(() => {
4068
+ onMousedown: B[5] || (B[5] = _e(() => {
4069
4069
  }, ["prevent"])),
4070
- onClick: B[6] || (B[6] = we((re) => X("heading"), ["stop"]))
4070
+ onClick: B[6] || (B[6] = _e((re) => X("heading"), ["stop"]))
4071
4071
  }, [
4072
4072
  k("span", Vg, D(fe.value), 1),
4073
4073
  te(S(gi), { class: "h-3.5 w-3.5 flex-shrink-0 text-slate-400" })
@@ -4078,7 +4078,7 @@ const ci = ne("x", [
4078
4078
  type: "button",
4079
4079
  class: ge(["flex w-full items-center px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5", le.value === re.value ? "text-blue-600 dark:text-blue-300" : "text-slate-700 dark:text-slate-200"]),
4080
4080
  disabled: !e.editor,
4081
- onMousedown: B[7] || (B[7] = we(() => {
4081
+ onMousedown: B[7] || (B[7] = _e(() => {
4082
4082
  }, ["prevent"])),
4083
4083
  onClick: (Je) => ue(re.value)
4084
4084
  }, D(re.label), 43, Gg))), 128))
@@ -4091,9 +4091,9 @@ const ci = ne("x", [
4091
4091
  title: S(i)("toolbar.fontFamily"),
4092
4092
  "aria-label": S(i)("toolbar.fontFamily"),
4093
4093
  disabled: !e.editor,
4094
- onMousedown: B[8] || (B[8] = we(() => {
4094
+ onMousedown: B[8] || (B[8] = _e(() => {
4095
4095
  }, ["prevent"])),
4096
- onClick: B[9] || (B[9] = we((re) => X("font"), ["stop"]))
4096
+ onClick: B[9] || (B[9] = _e((re) => X("font"), ["stop"]))
4097
4097
  }, [
4098
4098
  k("span", Jg, D(J.value), 1),
4099
4099
  te(S(gi), { class: "h-3.5 w-3.5 flex-shrink-0 text-slate-400" })
@@ -4103,7 +4103,7 @@ const ci = ne("x", [
4103
4103
  key: re.value,
4104
4104
  type: "button",
4105
4105
  class: ge(["flex w-full items-center px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5", $.value === re.value ? "text-blue-600 dark:text-blue-300" : "text-slate-700 dark:text-slate-200"]),
4106
- onMousedown: B[10] || (B[10] = we(() => {
4106
+ onMousedown: B[10] || (B[10] = _e(() => {
4107
4107
  }, ["prevent"])),
4108
4108
  onClick: (Je) => de(re.value)
4109
4109
  }, D(re.label), 43, Qg)), 64))
@@ -4115,7 +4115,7 @@ const ci = ne("x", [
4115
4115
  title: S(i)("toolbar.decreaseFontSize"),
4116
4116
  "aria-label": S(i)("toolbar.decreaseFontSize"),
4117
4117
  disabled: !e.editor,
4118
- onMousedown: B[11] || (B[11] = we((re) => $e(-1), ["prevent"]))
4118
+ onMousedown: B[11] || (B[11] = _e((re) => $e(-1), ["prevent"]))
4119
4119
  }, [
4120
4120
  te(S(fl), { class: "h-3.5 w-3.5" })
4121
4121
  ], 42, Yg),
@@ -4130,8 +4130,8 @@ const ci = ne("x", [
4130
4130
  onFocus: Le,
4131
4131
  onInput: Q,
4132
4132
  onKeydown: [
4133
- B[12] || (B[12] = fi(we((re) => re.target.blur(), ["prevent"]), ["enter"])),
4134
- fi(we(ri, ["prevent"]), ["esc"])
4133
+ B[12] || (B[12] = fi(_e((re) => re.target.blur(), ["prevent"]), ["enter"])),
4134
+ fi(_e(ri, ["prevent"]), ["esc"])
4135
4135
  ],
4136
4136
  onBlur: Pe
4137
4137
  }, null, 40, ev),
@@ -4141,7 +4141,7 @@ const ci = ne("x", [
4141
4141
  title: S(i)("toolbar.increaseFontSize"),
4142
4142
  "aria-label": S(i)("toolbar.increaseFontSize"),
4143
4143
  disabled: !e.editor,
4144
- onMousedown: B[13] || (B[13] = we((re) => $e(1), ["prevent"]))
4144
+ onMousedown: B[13] || (B[13] = _e((re) => $e(1), ["prevent"]))
4145
4145
  }, [
4146
4146
  te(S(sn), { class: "h-3.5 w-3.5" })
4147
4147
  ], 42, tv),
@@ -4156,7 +4156,7 @@ const ci = ne("x", [
4156
4156
  f(re) ? Ov : Ev
4157
4157
  ]),
4158
4158
  disabled: !e.editor,
4159
- onMousedown: B[14] || (B[14] = we(() => {
4159
+ onMousedown: B[14] || (B[14] = _e(() => {
4160
4160
  }, ["prevent"])),
4161
4161
  onClick: (Je) => p(re)
4162
4162
  }, [
@@ -4173,9 +4173,9 @@ const ci = ne("x", [
4173
4173
  title: z.value.label ?? "Text color",
4174
4174
  "aria-label": z.value.label ?? "Text color",
4175
4175
  disabled: !e.editor,
4176
- onMousedown: B[15] || (B[15] = we(() => {
4176
+ onMousedown: B[15] || (B[15] = _e(() => {
4177
4177
  }, ["prevent"])),
4178
- onClick: B[16] || (B[16] = we((re) => X("textColor"), ["stop"]))
4178
+ onClick: B[16] || (B[16] = _e((re) => X("textColor"), ["stop"]))
4179
4179
  }, [
4180
4180
  te(S(wc), { class: "h-[18px] w-[18px]" })
4181
4181
  ], 42, sv),
@@ -4195,9 +4195,9 @@ const ci = ne("x", [
4195
4195
  title: F.value.label ?? "Highlight",
4196
4196
  "aria-label": F.value.label ?? "Highlight",
4197
4197
  disabled: !e.editor,
4198
- onMousedown: B[20] || (B[20] = we(() => {
4198
+ onMousedown: B[20] || (B[20] = _e(() => {
4199
4199
  }, ["prevent"])),
4200
- onClick: B[21] || (B[21] = we((re) => X("highlight"), ["stop"]))
4200
+ onClick: B[21] || (B[21] = _e((re) => X("highlight"), ["stop"]))
4201
4201
  }, [
4202
4202
  te(S(kc), { class: "h-[18px] w-[18px]" })
4203
4203
  ], 42, lv),
@@ -4218,9 +4218,9 @@ const ci = ne("x", [
4218
4218
  title: S(i)("toolbar.lists"),
4219
4219
  "aria-label": S(i)("toolbar.lists"),
4220
4220
  disabled: !e.editor,
4221
- onMousedown: B[25] || (B[25] = we(() => {
4221
+ onMousedown: B[25] || (B[25] = _e(() => {
4222
4222
  }, ["prevent"])),
4223
- onClick: B[26] || (B[26] = we((re) => X("lists"), ["stop"]))
4223
+ onClick: B[26] || (B[26] = _e((re) => X("lists"), ["stop"]))
4224
4224
  }, [
4225
4225
  te(S(en), { class: "h-[18px] w-[18px]" }),
4226
4226
  te(S(gi), { class: "h-3 w-3 text-slate-400" })
@@ -4231,7 +4231,7 @@ const ci = ne("x", [
4231
4231
  type: "button",
4232
4232
  class: ge(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5", f(re) ? "text-blue-600 dark:text-blue-300" : "text-slate-700 dark:text-slate-200"]),
4233
4233
  disabled: !e.editor,
4234
- onMousedown: B[27] || (B[27] = we(() => {
4234
+ onMousedown: B[27] || (B[27] = _e(() => {
4235
4235
  }, ["prevent"])),
4236
4236
  onClick: (Je) => q(re)
4237
4237
  }, [
@@ -4250,9 +4250,9 @@ const ci = ne("x", [
4250
4250
  title: S(i)("toolbar.alignment"),
4251
4251
  "aria-label": S(i)("toolbar.alignment"),
4252
4252
  disabled: !e.editor,
4253
- onMousedown: B[28] || (B[28] = we(() => {
4253
+ onMousedown: B[28] || (B[28] = _e(() => {
4254
4254
  }, ["prevent"])),
4255
- onClick: B[29] || (B[29] = we((re) => X("align"), ["stop"]))
4255
+ onClick: B[29] || (B[29] = _e((re) => X("align"), ["stop"]))
4256
4256
  }, [
4257
4257
  (M(), Ke(ni(j.value), { class: "h-[18px] w-[18px]" })),
4258
4258
  te(S(gi), { class: "h-3 w-3 text-slate-400" })
@@ -4263,7 +4263,7 @@ const ci = ne("x", [
4263
4263
  type: "button",
4264
4264
  class: ge(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5", f(re) ? "text-blue-600 dark:text-blue-300" : "text-slate-700 dark:text-slate-200"]),
4265
4265
  disabled: !e.editor,
4266
- onMousedown: B[30] || (B[30] = we(() => {
4266
+ onMousedown: B[30] || (B[30] = _e(() => {
4267
4267
  }, ["prevent"])),
4268
4268
  onClick: (Je) => q(re)
4269
4269
  }, [
@@ -4282,9 +4282,9 @@ const ci = ne("x", [
4282
4282
  title: S(i)("toolbar.insert"),
4283
4283
  "aria-label": S(i)("toolbar.insert"),
4284
4284
  disabled: !e.editor,
4285
- onMousedown: B[31] || (B[31] = we(() => {
4285
+ onMousedown: B[31] || (B[31] = _e(() => {
4286
4286
  }, ["prevent"])),
4287
- onClick: B[32] || (B[32] = we((re) => X("insert"), ["stop"]))
4287
+ onClick: B[32] || (B[32] = _e((re) => X("insert"), ["stop"]))
4288
4288
  }, [
4289
4289
  te(S(sn), { class: "h-4 w-4" }),
4290
4290
  k("span", yv, D(S(i)("toolbar.insert")), 1),
@@ -4296,7 +4296,7 @@ const ci = ne("x", [
4296
4296
  type: "button",
4297
4297
  class: ge(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5", f(re) ? "text-blue-600 dark:text-blue-300" : "text-slate-700 dark:text-slate-200"]),
4298
4298
  disabled: !e.editor,
4299
- onMousedown: B[33] || (B[33] = we(() => {
4299
+ onMousedown: B[33] || (B[33] = _e(() => {
4300
4300
  }, ["prevent"])),
4301
4301
  onClick: (Je) => q(re)
4302
4302
  }, [
@@ -4462,7 +4462,7 @@ const ci = ne("x", [
4462
4462
  "data-testid": "bubble-menu",
4463
4463
  class: "docs-editor-bubble-menu fixed z-50 flex gap-1 rounded-xl border border-slate-200 bg-white p-1.5 shadow-2xl dark:border-white/10 dark:bg-[#0c1329]",
4464
4464
  style: ot(m.value),
4465
- onMousedown: v[1] || (v[1] = we(() => {
4465
+ onMousedown: v[1] || (v[1] = _e(() => {
4466
4466
  }, ["prevent"]))
4467
4467
  }, [
4468
4468
  o.value ? (M(), I(Oe, { key: 0 }, [
@@ -5251,7 +5251,7 @@ const ci = ne("x", [
5251
5251
  k("div", Bx, [
5252
5252
  k("form", {
5253
5253
  class: "space-y-3.5",
5254
- onSubmit: we(K, ["prevent"])
5254
+ onSubmit: _e(K, ["prevent"])
5255
5255
  }, [
5256
5256
  k("div", null, [
5257
5257
  k("label", Ux, D(S(r)("sidebars.references.form.type")), 1),
@@ -8555,7 +8555,7 @@ class Ot {
8555
8555
  return To[t] = i, i.prototype.jsonID = t, i;
8556
8556
  }
8557
8557
  }
8558
- class ct {
8558
+ class ft {
8559
8559
  /**
8560
8560
  @internal
8561
8561
  */
@@ -8566,13 +8566,13 @@ class ct {
8566
8566
  Create a successful step result.
8567
8567
  */
8568
8568
  static ok(t) {
8569
- return new ct(t, null);
8569
+ return new ft(t, null);
8570
8570
  }
8571
8571
  /**
8572
8572
  Create a failed step result.
8573
8573
  */
8574
8574
  static fail(t) {
8575
- return new ct(null, t);
8575
+ return new ft(null, t);
8576
8576
  }
8577
8577
  /**
8578
8578
  Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given
@@ -8581,10 +8581,10 @@ class ct {
8581
8581
  */
8582
8582
  static fromReplace(t, i, n, r) {
8583
8583
  try {
8584
- return ct.ok(t.replace(i, n, r));
8584
+ return ft.ok(t.replace(i, n, r));
8585
8585
  } catch (a) {
8586
8586
  if (a instanceof Hr)
8587
- return ct.fail(a.message);
8587
+ return ft.fail(a.message);
8588
8588
  throw a;
8589
8589
  }
8590
8590
  }
@@ -8606,7 +8606,7 @@ class nn extends Ot {
8606
8606
  }
8607
8607
  apply(t) {
8608
8608
  let i = t.slice(this.from, this.to), n = t.resolve(this.from), r = n.node(n.sharedDepth(this.to)), a = new pe(lu(i.content, (s, o) => !s.isAtom || !o.type.allowsMarkType(this.mark.type) ? s : s.mark(this.mark.addToSet(s.marks)), r), i.openStart, i.openEnd);
8609
- return ct.fromReplace(t, this.from, this.to, a);
8609
+ return ft.fromReplace(t, this.from, this.to, a);
8610
8610
  }
8611
8611
  invert() {
8612
8612
  return new vi(this.from, this.to, this.mark);
@@ -8645,7 +8645,7 @@ class vi extends Ot {
8645
8645
  }
8646
8646
  apply(t) {
8647
8647
  let i = t.slice(this.from, this.to), n = new pe(lu(i.content, (r) => r.mark(this.mark.removeFromSet(r.marks)), t), i.openStart, i.openEnd);
8648
- return ct.fromReplace(t, this.from, this.to, n);
8648
+ return ft.fromReplace(t, this.from, this.to, n);
8649
8649
  }
8650
8650
  invert() {
8651
8651
  return new nn(this.from, this.to, this.mark);
@@ -8685,9 +8685,9 @@ class rn extends Ot {
8685
8685
  apply(t) {
8686
8686
  let i = t.nodeAt(this.pos);
8687
8687
  if (!i)
8688
- return ct.fail("No node at mark step's position");
8688
+ return ft.fail("No node at mark step's position");
8689
8689
  let n = i.type.create(i.attrs, null, this.mark.addToSet(i.marks));
8690
- return ct.fromReplace(t, this.pos, this.pos + 1, new pe(ie.from(n), 0, i.isLeaf ? 0 : 1));
8690
+ return ft.fromReplace(t, this.pos, this.pos + 1, new pe(ie.from(n), 0, i.isLeaf ? 0 : 1));
8691
8691
  }
8692
8692
  invert(t) {
8693
8693
  let i = t.nodeAt(this.pos);
@@ -8729,9 +8729,9 @@ class In extends Ot {
8729
8729
  apply(t) {
8730
8730
  let i = t.nodeAt(this.pos);
8731
8731
  if (!i)
8732
- return ct.fail("No node at mark step's position");
8732
+ return ft.fail("No node at mark step's position");
8733
8733
  let n = i.type.create(i.attrs, null, this.mark.removeFromSet(i.marks));
8734
- return ct.fromReplace(t, this.pos, this.pos + 1, new pe(ie.from(n), 0, i.isLeaf ? 0 : 1));
8734
+ return ft.fromReplace(t, this.pos, this.pos + 1, new pe(ie.from(n), 0, i.isLeaf ? 0 : 1));
8735
8735
  }
8736
8736
  invert(t) {
8737
8737
  let i = t.nodeAt(this.pos);
@@ -8768,7 +8768,7 @@ class st extends Ot {
8768
8768
  super(), this.from = t, this.to = i, this.slice = n, this.structure = r;
8769
8769
  }
8770
8770
  apply(t) {
8771
- return this.structure && wl(t, this.from, this.to) ? ct.fail("Structure replace would overwrite content") : ct.fromReplace(t, this.from, this.to, this.slice);
8771
+ return this.structure && wl(t, this.from, this.to) ? ft.fail("Structure replace would overwrite content") : ft.fromReplace(t, this.from, this.to, this.slice);
8772
8772
  }
8773
8773
  getMap() {
8774
8774
  return new Kt([this.from, this.to - this.from, this.slice.size]);
@@ -8807,7 +8807,7 @@ class st extends Ot {
8807
8807
  }
8808
8808
  st.MAP_BIAS = 1;
8809
8809
  Ot.jsonID("replace", st);
8810
- class pt extends Ot {
8810
+ class mt extends Ot {
8811
8811
  /**
8812
8812
  Create a replace-around step with the given range and gap.
8813
8813
  `insert` should be the point in the slice into which the content
@@ -8819,12 +8819,12 @@ class pt extends Ot {
8819
8819
  }
8820
8820
  apply(t) {
8821
8821
  if (this.structure && (wl(t, this.from, this.gapFrom) || wl(t, this.gapTo, this.to)))
8822
- return ct.fail("Structure gap-replace would overwrite content");
8822
+ return ft.fail("Structure gap-replace would overwrite content");
8823
8823
  let i = t.slice(this.gapFrom, this.gapTo);
8824
8824
  if (i.openStart || i.openEnd)
8825
- return ct.fail("Gap is not a flat range");
8825
+ return ft.fail("Gap is not a flat range");
8826
8826
  let n = this.slice.insertAt(this.insert, i.content);
8827
- return n ? ct.fromReplace(t, this.from, this.to, n) : ct.fail("Content does not fit in gap");
8827
+ return n ? ft.fromReplace(t, this.from, this.to, n) : ft.fail("Content does not fit in gap");
8828
8828
  }
8829
8829
  getMap() {
8830
8830
  return new Kt([
@@ -8838,11 +8838,11 @@ class pt extends Ot {
8838
8838
  }
8839
8839
  invert(t) {
8840
8840
  let i = this.gapTo - this.gapFrom;
8841
- return new pt(this.from, this.from + this.slice.size + i, this.from + this.insert, this.from + this.insert + i, t.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
8841
+ return new mt(this.from, this.from + this.slice.size + i, this.from + this.insert, this.from + this.insert + i, t.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
8842
8842
  }
8843
8843
  map(t) {
8844
8844
  let i = t.mapResult(this.from, 1), n = t.mapResult(this.to, -1), r = this.from == this.gapFrom ? i.pos : t.map(this.gapFrom, -1), a = this.to == this.gapTo ? n.pos : t.map(this.gapTo, 1);
8845
- return i.deletedAcross && n.deletedAcross || r < i.pos || a > n.pos ? null : new pt(i.pos, n.pos, r, a, this.slice, this.insert, this.structure);
8845
+ return i.deletedAcross && n.deletedAcross || r < i.pos || a > n.pos ? null : new mt(i.pos, n.pos, r, a, this.slice, this.insert, this.structure);
8846
8846
  }
8847
8847
  toJSON() {
8848
8848
  let t = {
@@ -8861,10 +8861,10 @@ class pt extends Ot {
8861
8861
  static fromJSON(t, i) {
8862
8862
  if (typeof i.from != "number" || typeof i.to != "number" || typeof i.gapFrom != "number" || typeof i.gapTo != "number" || typeof i.insert != "number")
8863
8863
  throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
8864
- return new pt(i.from, i.to, i.gapFrom, i.gapTo, pe.fromJSON(t, i.slice), i.insert, !!i.structure);
8864
+ return new mt(i.from, i.to, i.gapFrom, i.gapTo, pe.fromJSON(t, i.slice), i.insert, !!i.structure);
8865
8865
  }
8866
8866
  }
8867
- Ot.jsonID("replaceAround", pt);
8867
+ Ot.jsonID("replaceAround", mt);
8868
8868
  function wl(e, t, i) {
8869
8869
  let n = e.resolve(t), r = i - t, a = n.depth;
8870
8870
  for (; r > 0 && a > 0 && n.indexAfter(a) == n.node(a).childCount; )
@@ -8965,7 +8965,7 @@ function Py(e, t, i) {
8965
8965
  let d = ie.empty, m = 0;
8966
8966
  for (let b = a, h = !1; b > i; b--)
8967
8967
  h || r.after(b + 1) < r.end(b) ? (h = !0, d = ie.from(r.node(b).copy(d)), m++) : u++;
8968
- e.step(new pt(l, u, s, o, new pe(f.append(d), p, m), f.size - p, !0));
8968
+ e.step(new mt(l, u, s, o, new pe(f.append(d), p, m), f.size - p, !0));
8969
8969
  }
8970
8970
  function cu(e, t, i = null, n = e) {
8971
8971
  let r = Fy(e, t), a = r && By(n, t);
@@ -9001,7 +9001,7 @@ function Uy(e, t, i) {
9001
9001
  n = ie.from(i[s].type.create(i[s].attrs, n));
9002
9002
  }
9003
9003
  let r = t.start, a = t.end;
9004
- e.step(new pt(r, a, r, a, new pe(n, 0, 0), i.length, !0));
9004
+ e.step(new mt(r, a, r, a, new pe(n, 0, 0), i.length, !0));
9005
9005
  }
9006
9006
  function Hy(e, t, i, n, r) {
9007
9007
  if (!n.isTextblock)
@@ -9017,7 +9017,7 @@ function Hy(e, t, i, n, r) {
9017
9017
  }
9018
9018
  u === !1 && dp(e, s, o, a), uu(e, e.mapping.slice(a).map(o, 1), n, void 0, u === null);
9019
9019
  let f = e.mapping.slice(a), p = f.map(o, 1), d = f.map(o + s.nodeSize, 1);
9020
- return e.step(new pt(p, d, p + 1, d - 1, new pe(ie.from(n.create(l, null, s.marks)), 0, 0), 1, !0)), u === !0 && fp(e, s, o, a), !1;
9020
+ return e.step(new mt(p, d, p + 1, d - 1, new pe(ie.from(n.create(l, null, s.marks)), 0, 0), 1, !0)), u === !0 && fp(e, s, o, a), !1;
9021
9021
  }
9022
9022
  });
9023
9023
  }
@@ -9055,7 +9055,7 @@ function jy(e, t, i, n, r) {
9055
9055
  return e.replaceWith(t, t + a.nodeSize, s);
9056
9056
  if (!i.validContent(a.content))
9057
9057
  throw new RangeError("Invalid content for node type " + i.name);
9058
- e.step(new pt(t, t + a.nodeSize, t + 1, t + a.nodeSize - 1, new pe(ie.from(s), 0, 0), 1, !0));
9058
+ e.step(new mt(t, t + a.nodeSize, t + 1, t + a.nodeSize - 1, new pe(ie.from(s), 0, 0), 1, !0));
9059
9059
  }
9060
9060
  function Ui(e, t, i = 1, n) {
9061
9061
  let r = e.resolve(t), a = r.depth - i, s = n && n[n.length - 1] || r.parent;
@@ -9210,7 +9210,7 @@ class Xy {
9210
9210
  for (; s && o && a.childCount == 1; )
9211
9211
  a = a.firstChild.content, s--, o--;
9212
9212
  let l = new pe(a, s, o);
9213
- return t > -1 ? new pt(n.pos, t, this.$to.pos, this.$to.end(), l, i) : l.size || n.pos != this.$to.pos ? new st(n.pos, r.pos, l) : null;
9213
+ return t > -1 ? new mt(n.pos, t, this.$to.pos, this.$to.end(), l, i) : l.size || n.pos != this.$to.pos ? new st(n.pos, r.pos, l) : null;
9214
9214
  }
9215
9215
  // Find a position on the start spine of `this.unplaced` that has
9216
9216
  // content that can be moved somewhere on the frontier. Returns two
@@ -9476,13 +9476,13 @@ class Yn extends Ot {
9476
9476
  apply(t) {
9477
9477
  let i = t.nodeAt(this.pos);
9478
9478
  if (!i)
9479
- return ct.fail("No node at attribute step's position");
9479
+ return ft.fail("No node at attribute step's position");
9480
9480
  let n = /* @__PURE__ */ Object.create(null);
9481
9481
  for (let a in i.attrs)
9482
9482
  n[a] = i.attrs[a];
9483
9483
  n[this.attr] = this.value;
9484
9484
  let r = i.type.create(n, null, i.marks);
9485
- return ct.fromReplace(t, this.pos, this.pos + 1, new pe(ie.from(r), 0, i.isLeaf ? 0 : 1));
9485
+ return ft.fromReplace(t, this.pos, this.pos + 1, new pe(ie.from(r), 0, i.isLeaf ? 0 : 1));
9486
9486
  }
9487
9487
  getMap() {
9488
9488
  return Kt.empty;
@@ -9517,7 +9517,7 @@ class $r extends Ot {
9517
9517
  i[r] = t.attrs[r];
9518
9518
  i[this.attr] = this.value;
9519
9519
  let n = t.type.create(i, t.content, t.marks);
9520
- return ct.ok(n);
9520
+ return ft.ok(n);
9521
9521
  }
9522
9522
  getMap() {
9523
9523
  return Kt.empty;
@@ -10049,7 +10049,7 @@ class to {
10049
10049
  return Ae.between(t.resolve(this.anchor), t.resolve(this.head));
10050
10050
  }
10051
10051
  }
10052
- class _e extends Me {
10052
+ class Se extends Me {
10053
10053
  /**
10054
10054
  Create a node selection. Does not verify the validity of its
10055
10055
  argument.
@@ -10060,13 +10060,13 @@ class _e extends Me {
10060
10060
  }
10061
10061
  map(t, i) {
10062
10062
  let { deleted: n, pos: r } = i.mapResult(this.anchor), a = t.resolve(r);
10063
- return n ? Me.near(a) : new _e(a);
10063
+ return n ? Me.near(a) : new Se(a);
10064
10064
  }
10065
10065
  content() {
10066
10066
  return new pe(ie.from(this.node), 0, 0);
10067
10067
  }
10068
10068
  eq(t) {
10069
- return t instanceof _e && t.anchor == this.anchor;
10069
+ return t instanceof Se && t.anchor == this.anchor;
10070
10070
  }
10071
10071
  toJSON() {
10072
10072
  return { type: "node", anchor: this.anchor };
@@ -10080,13 +10080,13 @@ class _e extends Me {
10080
10080
  static fromJSON(t, i) {
10081
10081
  if (typeof i.anchor != "number")
10082
10082
  throw new RangeError("Invalid input for NodeSelection.fromJSON");
10083
- return new _e(t.resolve(i.anchor));
10083
+ return new Se(t.resolve(i.anchor));
10084
10084
  }
10085
10085
  /**
10086
10086
  Create a node selection from non-resolved positions.
10087
10087
  */
10088
10088
  static create(t, i) {
10089
- return new _e(t.resolve(i));
10089
+ return new Se(t.resolve(i));
10090
10090
  }
10091
10091
  /**
10092
10092
  Determines whether the given node may be selected as a node
@@ -10096,8 +10096,8 @@ class _e extends Me {
10096
10096
  return !t.isText && t.type.spec.selectable !== !1;
10097
10097
  }
10098
10098
  }
10099
- _e.prototype.visible = !1;
10100
- Me.jsonID("node", _e);
10099
+ Se.prototype.visible = !1;
10100
+ Me.jsonID("node", Se);
10101
10101
  class fu {
10102
10102
  constructor(t) {
10103
10103
  this.anchor = t;
@@ -10108,7 +10108,7 @@ class fu {
10108
10108
  }
10109
10109
  resolve(t) {
10110
10110
  let i = t.resolve(this.anchor), n = i.nodeAfter;
10111
- return n && _e.isSelectable(n) ? new _e(i) : Me.near(i);
10111
+ return n && Se.isSelectable(n) ? new Se(i) : Me.near(i);
10112
10112
  }
10113
10113
  }
10114
10114
  class Jt extends Me {
@@ -10160,8 +10160,8 @@ function Xn(e, t, i, n, r, a = !1) {
10160
10160
  for (let s = n - (r > 0 ? 0 : 1); r > 0 ? s < t.childCount : s >= 0; s += r) {
10161
10161
  let o = t.child(s);
10162
10162
  if (o.isAtom) {
10163
- if (!a && _e.isSelectable(o))
10164
- return _e.create(e, i - (r < 0 ? o.nodeSize : 0));
10163
+ if (!a && Se.isSelectable(o))
10164
+ return Se.create(e, i - (r < 0 ? o.nodeSize : 0));
10165
10165
  } else {
10166
10166
  let l = Xn(e, o, i + r, r < 0 ? o.childCount : 0, r, a);
10167
10167
  if (l)
@@ -10176,7 +10176,7 @@ function Wc(e, t, i) {
10176
10176
  if (n < t)
10177
10177
  return;
10178
10178
  let r = e.steps[n];
10179
- if (!(r instanceof st || r instanceof pt))
10179
+ if (!(r instanceof st || r instanceof mt))
10180
10180
  return;
10181
10181
  let a = e.mapping.maps[n], s;
10182
10182
  a.forEach((o, l, u, f) => {
@@ -10336,9 +10336,9 @@ function a2(e, t = null) {
10336
10336
  for (l = s; r && !r.node; )
10337
10337
  r = r.parent;
10338
10338
  let p = r.node;
10339
- if (r && p.isAtom && _e.isSelectable(p) && r.parent && !(p.isInline && n2(i.focusNode, i.focusOffset, r.dom))) {
10339
+ if (r && p.isAtom && Se.isSelectable(p) && r.parent && !(p.isInline && n2(i.focusNode, i.focusOffset, r.dom))) {
10340
10340
  let d = r.posBefore;
10341
- u = new _e(s == d ? o : n.resolve(d));
10341
+ u = new Se(s == d ? o : n.resolve(d));
10342
10342
  }
10343
10343
  } else {
10344
10344
  if (i instanceof e.dom.ownerDocument.defaultView.Selection && i.rangeCount > 1) {
@@ -10421,7 +10421,7 @@ function o2(e) {
10421
10421
  n ? t.collapse(i.parentNode, Pn(i) + 1) : t.collapse(i, 0), !n && !e.state.selection.visible && ta && Ap <= 11 && (i.disabled = !0, i.disabled = !1);
10422
10422
  }
10423
10423
  function l2(e, t) {
10424
- if (t instanceof _e) {
10424
+ if (t instanceof Se) {
10425
10425
  let i = e.docView.descAt(t.from);
10426
10426
  i != e.lastSelectedViewDesc && (Yc(e), i && i.selectNode(), e.lastSelectedViewDesc = i);
10427
10427
  } else
@@ -10462,17 +10462,17 @@ function ef(e, t, i) {
10462
10462
  } else if (n.empty) {
10463
10463
  if (e.endOfTextblock(t > 0 ? "forward" : "backward")) {
10464
10464
  let r = Al(e.state, t);
10465
- return r && r instanceof _e ? Ji(e, r) : !1;
10465
+ return r && r instanceof Se ? Ji(e, r) : !1;
10466
10466
  } else if (!(ii && i.indexOf("m") > -1)) {
10467
10467
  let r = n.$head, a = r.textOffset ? null : t < 0 ? r.nodeBefore : r.nodeAfter, s;
10468
10468
  if (!a || a.isText)
10469
10469
  return !1;
10470
10470
  let o = t < 0 ? r.pos - a.nodeSize : r.pos;
10471
- return a.isAtom || (s = e.docView.descAt(o)) && !s.contentDOM ? _e.isSelectable(a) ? Ji(e, new _e(t < 0 ? e.state.doc.resolve(r.pos - a.nodeSize) : r)) : mu ? Ji(e, new Ae(e.state.doc.resolve(t < 0 ? o : o + a.nodeSize))) : !1 : !1;
10471
+ return a.isAtom || (s = e.docView.descAt(o)) && !s.contentDOM ? Se.isSelectable(a) ? Ji(e, new Se(t < 0 ? e.state.doc.resolve(r.pos - a.nodeSize) : r)) : mu ? Ji(e, new Ae(e.state.doc.resolve(t < 0 ? o : o + a.nodeSize))) : !1 : !1;
10472
10472
  }
10473
10473
  } else return !1;
10474
10474
  else {
10475
- if (n instanceof _e && n.node.isInline)
10475
+ if (n instanceof Se && n.node.isInline)
10476
10476
  return Ji(e, new Ae(t > 0 ? n.$to : n.$from));
10477
10477
  {
10478
10478
  let r = Al(e.state, t);
@@ -10628,7 +10628,7 @@ function nf(e, t, i) {
10628
10628
  let { $from: r, $to: a } = n;
10629
10629
  if (!r.parent.inlineContent || e.endOfTextblock(t < 0 ? "up" : "down")) {
10630
10630
  let s = Al(e.state, t);
10631
- if (s && s instanceof _e)
10631
+ if (s && s instanceof Se)
10632
10632
  return Ji(e, s);
10633
10633
  }
10634
10634
  if (!r.parent.inlineContent) {
@@ -10942,22 +10942,22 @@ function S2(e, t) {
10942
10942
  if (t == -1)
10943
10943
  return !1;
10944
10944
  let i = e.state.doc.resolve(t), n = i.nodeAfter;
10945
- return n && n.isAtom && _e.isSelectable(n) ? (ra(e, new _e(i)), !0) : !1;
10945
+ return n && n.isAtom && Se.isSelectable(n) ? (ra(e, new Se(i)), !0) : !1;
10946
10946
  }
10947
10947
  function C2(e, t) {
10948
10948
  if (t == -1)
10949
10949
  return !1;
10950
10950
  let i = e.state.selection, n, r;
10951
- i instanceof _e && (n = i.node);
10951
+ i instanceof Se && (n = i.node);
10952
10952
  let a = e.state.doc.resolve(t);
10953
10953
  for (let s = a.depth + 1; s > 0; s--) {
10954
10954
  let o = s > a.depth ? a.nodeAfter : a.node(s);
10955
- if (_e.isSelectable(o)) {
10955
+ if (Se.isSelectable(o)) {
10956
10956
  n && i.$from.depth > 0 && s >= i.$from.depth && a.before(i.$from.depth + 1) == i.$from.pos ? r = a.before(i.$from.depth) : r = a.before(s);
10957
10957
  break;
10958
10958
  }
10959
10959
  }
10960
- return r != null ? (ra(e, _e.create(e.state.doc, r)), !0) : !1;
10960
+ return r != null ? (ra(e, Se.create(e.state.doc, r)), !0) : !1;
10961
10961
  }
10962
10962
  function A2(e, t, i, n, r) {
10963
10963
  return bu(e, "handleClickOn", t, i, n) || e.someProp("handleClick", (a) => a(e, t, n)) || (r ? C2(e, i) : S2(e, i));
@@ -10983,8 +10983,8 @@ function Bp(e, t, i) {
10983
10983
  let s = a > r.depth ? r.nodeAfter : r.node(a), o = r.before(a);
10984
10984
  if (s.inlineContent)
10985
10985
  return Ae.create(n, o + 1, o + 1 + s.content.size);
10986
- if (i && _e.isSelectable(s))
10987
- return _e.create(n, o);
10986
+ if (i && Se.isSelectable(s))
10987
+ return Se.create(n, o);
10988
10988
  }
10989
10989
  return null;
10990
10990
  }
@@ -11030,7 +11030,7 @@ class M2 extends Hp {
11030
11030
  const o = r ? null : n.target, l = o ? t.docView.nearestDesc(o, !0) : null;
11031
11031
  this.target = l && l.nodeDOM.nodeType == 1 ? l.nodeDOM : null;
11032
11032
  let { selection: u } = t.state;
11033
- n.button == 0 && (a.type.spec.draggable && a.type.spec.selectable !== !1 || u instanceof _e && u.from <= s && u.to > s) && (this.mightDrag = {
11033
+ n.button == 0 && (a.type.spec.draggable && a.type.spec.selectable !== !1 || u instanceof Se && u.from <= s && u.to > s) && (this.mightDrag = {
11034
11034
  node: a,
11035
11035
  pos: s,
11036
11036
  addAttr: !!(this.target && !this.target.draggable),
@@ -11217,12 +11217,12 @@ di.dragstart = (e, t) => {
11217
11217
  if (n && n.done(), !i.dataTransfer)
11218
11218
  return;
11219
11219
  let r = e.state.selection, a = r.empty ? null : e.posAtCoords(na(i)), s;
11220
- if (!(a && a.pos >= r.from && a.pos <= (r instanceof _e ? r.to - 1 : r.to))) {
11220
+ if (!(a && a.pos >= r.from && a.pos <= (r instanceof Se ? r.to - 1 : r.to))) {
11221
11221
  if (n && n.mightDrag)
11222
- s = _e.create(e.state.doc, n.mightDrag.pos);
11222
+ s = Se.create(e.state.doc, n.mightDrag.pos);
11223
11223
  else if (i.target && i.target.nodeType == 1) {
11224
11224
  let p = e.docView.nearestDesc(i.target, !0);
11225
- p && p.node.type.spec.draggable && p != e.docView && (s = _e.create(e.state.doc, p.posBefore));
11225
+ p && p.node.type.spec.draggable && p != e.docView && (s = Se.create(e.state.doc, p.posBefore));
11226
11226
  }
11227
11227
  }
11228
11228
  let o = (s || e.state.selection).content(), { dom: l, text: u, slice: f } = zp(e, o);
@@ -11271,8 +11271,8 @@ function U2(e, t, i) {
11271
11271
  if (f ? l.replaceRangeWith(u, u, a.content.firstChild) : l.replaceRange(u, u, a), l.doc.eq(p))
11272
11272
  return;
11273
11273
  let d = l.doc.resolve(u);
11274
- if (f && _e.isSelectable(a.content.firstChild) && d.nodeAfter && d.nodeAfter.sameMarkup(a.content.firstChild))
11275
- l.setSelection(new _e(d));
11274
+ if (f && Se.isSelectable(a.content.firstChild) && d.nodeAfter && d.nodeAfter.sameMarkup(a.content.firstChild))
11275
+ l.setSelection(new Se(d));
11276
11276
  else {
11277
11277
  let m = l.mapping.map(o);
11278
11278
  l.mapping.maps[l.mapping.maps.length - 1].forEach((b, h, v, g) => m = g), l.setSelection(Mp(e, d, l.doc.resolve(m)));
@@ -11961,13 +11961,13 @@ const Jp = (e, t, i) => {
11961
11961
  let a = r.nodeBefore;
11962
11962
  if (am(e, r, t, -1))
11963
11963
  return !0;
11964
- if (n.parent.content.size == 0 && (nr(a, "end") || _e.isSelectable(a)))
11964
+ if (n.parent.content.size == 0 && (nr(a, "end") || Se.isSelectable(a)))
11965
11965
  for (let s = n.depth; ; s--) {
11966
11966
  let o = eo(e.doc, n.before(s), n.after(s), pe.empty);
11967
11967
  if (o && o.slice.size < o.to - o.from) {
11968
11968
  if (t) {
11969
11969
  let l = e.tr.step(o);
11970
- l.setSelection(nr(a, "end") ? Me.findFrom(l.doc.resolve(l.mapping.map(r.pos, -1)), -1) : _e.create(l.doc, r.pos - a.nodeSize)), t(l.scrollIntoView());
11970
+ l.setSelection(nr(a, "end") ? Me.findFrom(l.doc.resolve(l.mapping.map(r.pos, -1)), -1) : Se.create(l.doc, r.pos - a.nodeSize)), t(l.scrollIntoView());
11971
11971
  }
11972
11972
  return !0;
11973
11973
  }
@@ -12035,7 +12035,7 @@ const Qp = (e, t, i) => {
12035
12035
  a = ku(n);
12036
12036
  }
12037
12037
  let s = a && a.nodeBefore;
12038
- return !s || !_e.isSelectable(s) ? !1 : (t && t(e.tr.setSelection(_e.create(e.doc, a.pos - s.nodeSize)).scrollIntoView()), !0);
12038
+ return !s || !Se.isSelectable(s) ? !1 : (t && t(e.tr.setSelection(Se.create(e.doc, a.pos - s.nodeSize)).scrollIntoView()), !0);
12039
12039
  };
12040
12040
  function ku(e) {
12041
12041
  if (!e.parent.type.spec.isolating)
@@ -12061,12 +12061,12 @@ const em = (e, t, i) => {
12061
12061
  let a = r.nodeAfter;
12062
12062
  if (am(e, r, t, 1))
12063
12063
  return !0;
12064
- if (n.parent.content.size == 0 && (nr(a, "start") || _e.isSelectable(a))) {
12064
+ if (n.parent.content.size == 0 && (nr(a, "start") || Se.isSelectable(a))) {
12065
12065
  let s = eo(e.doc, n.before(), n.after(), pe.empty);
12066
12066
  if (s && s.slice.size < s.to - s.from) {
12067
12067
  if (t) {
12068
12068
  let o = e.tr.step(s);
12069
- o.setSelection(nr(a, "start") ? Me.findFrom(o.doc.resolve(o.mapping.map(r.pos)), 1) : _e.create(o.doc, o.mapping.map(r.pos))), t(o.scrollIntoView());
12069
+ o.setSelection(nr(a, "start") ? Me.findFrom(o.doc.resolve(o.mapping.map(r.pos)), 1) : Se.create(o.doc, o.mapping.map(r.pos))), t(o.scrollIntoView());
12070
12070
  }
12071
12071
  return !0;
12072
12072
  }
@@ -12082,7 +12082,7 @@ const em = (e, t, i) => {
12082
12082
  a = wu(n);
12083
12083
  }
12084
12084
  let s = a && a.nodeAfter;
12085
- return !s || !_e.isSelectable(s) ? !1 : (t && t(e.tr.setSelection(_e.create(e.doc, a.pos)).scrollIntoView()), !0);
12085
+ return !s || !Se.isSelectable(s) ? !1 : (t && t(e.tr.setSelection(Se.create(e.doc, a.pos)).scrollIntoView()), !0);
12086
12086
  };
12087
12087
  function wu(e) {
12088
12088
  if (!e.parent.type.spec.isolating)
@@ -12096,7 +12096,7 @@ function wu(e) {
12096
12096
  return null;
12097
12097
  }
12098
12098
  const Y2 = (e, t) => {
12099
- let i = e.selection, n = i instanceof _e, r;
12099
+ let i = e.selection, n = i instanceof Se, r;
12100
12100
  if (n) {
12101
12101
  if (i.node.isTextblock || !fn(e.doc, i.from))
12102
12102
  return !1;
@@ -12105,12 +12105,12 @@ const Y2 = (e, t) => {
12105
12105
  return !1;
12106
12106
  if (t) {
12107
12107
  let a = e.tr.join(r);
12108
- n && a.setSelection(_e.create(a.doc, r - e.doc.resolve(r).nodeBefore.nodeSize)), t(a.scrollIntoView());
12108
+ n && a.setSelection(Se.create(a.doc, r - e.doc.resolve(r).nodeBefore.nodeSize)), t(a.scrollIntoView());
12109
12109
  }
12110
12110
  return !0;
12111
12111
  }, ek = (e, t) => {
12112
12112
  let i = e.selection, n;
12113
- if (i instanceof _e) {
12113
+ if (i instanceof Se) {
12114
12114
  if (i.node.isTextblock || !fn(e.doc, i.to))
12115
12115
  return !1;
12116
12116
  n = i.to;
@@ -12172,7 +12172,7 @@ const ik = (e, t) => {
12172
12172
  function nk(e) {
12173
12173
  return (t, i) => {
12174
12174
  let { $from: n, $to: r } = t.selection;
12175
- if (t.selection instanceof _e && t.selection.node.isBlock)
12175
+ if (t.selection instanceof Se && t.selection.node.isBlock)
12176
12176
  return !n.parentOffset || !Ui(t.doc, n.pos) ? !1 : (i && i(t.tr.split(n.pos).scrollIntoView()), !0);
12177
12177
  if (!n.depth)
12178
12178
  return !1;
@@ -12200,7 +12200,7 @@ function nk(e) {
12200
12200
  }
12201
12201
  const rk = nk(), ak = (e, t) => {
12202
12202
  let { $from: i, to: n } = e.selection, r, a = i.sharedDepth(n);
12203
- return a == 0 ? !1 : (r = i.before(a), t && t(e.tr.setSelection(_e.create(e.doc, r))), !0);
12203
+ return a == 0 ? !1 : (r = i.before(a), t && t(e.tr.setSelection(Se.create(e.doc, r))), !0);
12204
12204
  };
12205
12205
  function sk(e, t, i) {
12206
12206
  let n = t.nodeBefore, r = t.nodeAfter, a = t.index();
@@ -12217,7 +12217,7 @@ function am(e, t, i, n) {
12217
12217
  for (let g = s.length - 1; g >= 0; g--)
12218
12218
  b = ie.from(s[g].create(null, b));
12219
12219
  b = ie.from(r.copy(b));
12220
- let h = e.tr.step(new pt(t.pos - 1, m, t.pos, m, new pe(b, 1, 0), s.length, !0)), v = h.doc.resolve(m + 2 * s.length);
12220
+ let h = e.tr.step(new mt(t.pos - 1, m, t.pos, m, new pe(b, 1, 0), s.length, !0)), v = h.doc.resolve(m + 2 * s.length);
12221
12221
  v.nodeAfter && v.nodeAfter.type == r.type && fn(h.doc, v.pos) && h.join(v.pos), i(h.scrollIntoView());
12222
12222
  }
12223
12223
  return !0;
@@ -12237,7 +12237,7 @@ function am(e, t, i, n) {
12237
12237
  let g = ie.empty;
12238
12238
  for (let y = b.length - 1; y >= 0; y--)
12239
12239
  g = ie.from(b[y].copy(g));
12240
- let x = e.tr.step(new pt(t.pos - b.length, t.pos + a.nodeSize, t.pos + v, t.pos + a.nodeSize - v, new pe(g, b.length, 0), 0, !0));
12240
+ let x = e.tr.step(new mt(t.pos - b.length, t.pos + a.nodeSize, t.pos + v, t.pos + a.nodeSize - v, new pe(g, b.length, 0), 0, !0));
12241
12241
  i(x.scrollIntoView());
12242
12242
  }
12243
12243
  return !0;
@@ -12329,7 +12329,7 @@ function dk(e, t, i, n, r) {
12329
12329
  let a = ie.empty;
12330
12330
  for (let f = i.length - 1; f >= 0; f--)
12331
12331
  a = ie.from(i[f].type.create(i[f].attrs, a));
12332
- e.step(new pt(t.start - (n ? 2 : 0), t.end, t.start, t.end, new pe(a, 0, 0), i.length, !0));
12332
+ e.step(new mt(t.start - (n ? 2 : 0), t.end, t.start, t.end, new pe(a, 0, 0), i.length, !0));
12333
12333
  let s = 0;
12334
12334
  for (let f = 0; f < i.length; f++)
12335
12335
  i[f].type == r && (s = f + 1);
@@ -12346,7 +12346,7 @@ function pk(e) {
12346
12346
  }
12347
12347
  function mk(e, t, i, n) {
12348
12348
  let r = e.tr, a = n.end, s = n.$to.end(n.depth);
12349
- a < s && (r.step(new pt(a - 1, s, a, s, new pe(ie.from(i.create(null, n.parent.copy())), 1, 0), 1, !0)), n = new us(r.doc.resolve(n.$from.pos), r.doc.resolve(s), n.depth));
12349
+ a < s && (r.step(new mt(a - 1, s, a, s, new pe(ie.from(i.create(null, n.parent.copy())), 1, 0), 1, !0)), n = new us(r.doc.resolve(n.$from.pos), r.doc.resolve(s), n.depth));
12350
12350
  const o = ur(n);
12351
12351
  if (o == null)
12352
12352
  return !1;
@@ -12365,7 +12365,7 @@ function hk(e, t, i) {
12365
12365
  if (!u.canReplace(f + (o ? 0 : 1), f + 1, s.content.append(l ? ie.empty : ie.from(r))))
12366
12366
  return !1;
12367
12367
  let p = a.pos, d = p + s.nodeSize;
12368
- return n.step(new pt(p - (o ? 1 : 0), d + (l ? 1 : 0), p + 1, d - 1, new pe((o ? ie.empty : ie.from(r.copy(ie.empty))).append(l ? ie.empty : ie.from(r.copy(ie.empty))), o ? 0 : 1, l ? 0 : 1), o ? 0 : 1)), t(n.scrollIntoView()), !0;
12368
+ return n.step(new mt(p - (o ? 1 : 0), d + (l ? 1 : 0), p + 1, d - 1, new pe((o ? ie.empty : ie.from(r.copy(ie.empty))).append(l ? ie.empty : ie.from(r.copy(ie.empty))), o ? 0 : 1, l ? 0 : 1), o ? 0 : 1)), t(n.scrollIntoView()), !0;
12369
12369
  }
12370
12370
  function bk(e) {
12371
12371
  return function(t, i) {
@@ -12380,7 +12380,7 @@ function bk(e) {
12380
12380
  return !1;
12381
12381
  if (i) {
12382
12382
  let u = l.lastChild && l.lastChild.type == o.type, f = ie.from(u ? e.create() : null), p = new pe(ie.from(e.create(null, ie.from(o.type.create(null, f)))), u ? 3 : 1, 0), d = a.start, m = a.end;
12383
- i(t.tr.step(new pt(d - (u ? 3 : 1), m, d, m, p, 1, !0)).scrollIntoView());
12383
+ i(t.tr.step(new mt(d - (u ? 3 : 1), m, d, m, p, 1, !0)).scrollIntoView());
12384
12384
  }
12385
12385
  return !0;
12386
12386
  };
@@ -12520,7 +12520,7 @@ function Ye(...e) {
12520
12520
  function xk(e) {
12521
12521
  return typeof e == "function";
12522
12522
  }
12523
- function gt(e, t = void 0, ...i) {
12523
+ function vt(e, t = void 0, ...i) {
12524
12524
  return xk(e) ? t ? e.bind(t)(...i) : e(...i) : e;
12525
12525
  }
12526
12526
  function lm(e, t) {
@@ -12555,9 +12555,9 @@ class $t {
12555
12555
  }, this.config = {
12556
12556
  ...this.config,
12557
12557
  ...t
12558
- }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = gt(At(this, "addOptions", {
12558
+ }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = vt(At(this, "addOptions", {
12559
12559
  name: this.name
12560
- }))), this.storage = gt(At(this, "addStorage", {
12560
+ }))), this.storage = vt(At(this, "addStorage", {
12561
12561
  name: this.name,
12562
12562
  options: this.options
12563
12563
  })) || {};
@@ -12574,9 +12574,9 @@ class $t {
12574
12574
  }
12575
12575
  extend(t = {}) {
12576
12576
  const i = new $t(t);
12577
- return i.parent = this, this.child = i, i.name = t.name ? t.name : i.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${i.name}".`), i.options = gt(At(i, "addOptions", {
12577
+ return i.parent = this, this.child = i, i.name = t.name ? t.name : i.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${i.name}".`), i.options = vt(At(i, "addOptions", {
12578
12578
  name: i.name
12579
- })), i.storage = gt(At(i, "addStorage", {
12579
+ })), i.storage = vt(At(i, "addStorage", {
12580
12580
  name: i.name,
12581
12581
  options: i.options
12582
12582
  })), i;
@@ -12606,9 +12606,9 @@ class lt {
12606
12606
  }, this.config = {
12607
12607
  ...this.config,
12608
12608
  ...t
12609
- }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = gt(At(this, "addOptions", {
12609
+ }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = vt(At(this, "addOptions", {
12610
12610
  name: this.name
12611
- }))), this.storage = gt(At(this, "addStorage", {
12611
+ }))), this.storage = vt(At(this, "addStorage", {
12612
12612
  name: this.name,
12613
12613
  options: this.options
12614
12614
  })) || {};
@@ -12625,9 +12625,9 @@ class lt {
12625
12625
  }
12626
12626
  extend(t = {}) {
12627
12627
  const i = new lt({ ...this.config, ...t });
12628
- return i.parent = this, this.child = i, i.name = t.name ? t.name : i.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${i.name}".`), i.options = gt(At(i, "addOptions", {
12628
+ return i.parent = this, this.child = i, i.name = t.name ? t.name : i.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${i.name}".`), i.options = vt(At(i, "addOptions", {
12629
12629
  name: i.name
12630
- })), i.storage = gt(At(i, "addStorage", {
12630
+ })), i.storage = vt(At(i, "addStorage", {
12631
12631
  name: i.name,
12632
12632
  options: i.options
12633
12633
  })), i;
@@ -12904,7 +12904,7 @@ function Vk(e, t, i) {
12904
12904
  if (n < t)
12905
12905
  return;
12906
12906
  const r = e.steps[n];
12907
- if (!(r instanceof st || r instanceof pt))
12907
+ if (!(r instanceof st || r instanceof mt))
12908
12908
  return;
12909
12909
  const a = e.mapping.maps[n];
12910
12910
  let s = 0;
@@ -13252,7 +13252,7 @@ function pf(e, t) {
13252
13252
  name: n.name,
13253
13253
  options: n.options,
13254
13254
  storage: n.storage
13255
- }, a = gt(At(n, "group", r));
13255
+ }, a = vt(At(n, "group", r));
13256
13256
  return typeof a != "string" ? !1 : a.split(" ").includes("list");
13257
13257
  }
13258
13258
  function Du(e, { checkChildren: t = !0, ignoreWhitespace: i = !1 } = {}) {
@@ -13328,7 +13328,7 @@ const Ow = (e, t = {}) => ({ tr: i, state: n, dispatch: r }) => {
13328
13328
  return i.selection.$anchor.sameParent(i.selection.$head) && (s = i.selection.$anchor.parent.attrs), a.isTextblock ? r().command(({ commands: o }) => uf(a, { ...s, ...t })(i) ? !0 : o.clearNodes()).command(({ state: o }) => uf(a, { ...s, ...t })(o, n)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
13329
13329
  }, Dw = (e) => ({ tr: t, dispatch: i }) => {
13330
13330
  if (i) {
13331
- const { doc: n } = t, r = Cn(e, 0, n.content.size), a = _e.create(n, r);
13331
+ const { doc: n } = t, r = Cn(e, 0, n.content.size), a = Se.create(n, r);
13332
13332
  t.setSelection(a);
13333
13333
  }
13334
13334
  return !0;
@@ -13351,7 +13351,7 @@ function mf(e, t) {
13351
13351
  }
13352
13352
  const Iw = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: i, dispatch: n, editor: r }) => {
13353
13353
  const { selection: a, doc: s } = t, { $from: o, $to: l } = a, u = r.extensionManager.attributes, f = Ya(u, o.node().type.name, o.node().attrs);
13354
- if (a instanceof _e && a.node.isBlock)
13354
+ if (a instanceof Se && a.node.isBlock)
13355
13355
  return !o.parentOffset || !Ui(s, o.pos) ? !1 : (n && (e && mf(i, r.extensionManager.splittableMarks), t.split(o.pos).scrollIntoView()), !0);
13356
13356
  if (!o.parent.isBlock)
13357
13357
  return !1;
@@ -13798,7 +13798,7 @@ function t_(e) {
13798
13798
  return new Cu({
13799
13799
  find: e.find,
13800
13800
  handler: ({ state: t, range: i, match: n }) => {
13801
- const r = gt(e.getAttributes, void 0, n);
13801
+ const r = vt(e.getAttributes, void 0, n);
13802
13802
  if (r === !1 || r === null)
13803
13803
  return null;
13804
13804
  const { tr: a } = t, s = n[n.length - 1], o = n[0];
@@ -13817,7 +13817,7 @@ function i_(e) {
13817
13817
  return new Cu({
13818
13818
  find: e.find,
13819
13819
  handler: ({ state: t, range: i, match: n }) => {
13820
- const r = gt(e.getAttributes, void 0, n) || {}, { tr: a } = t, s = i.from;
13820
+ const r = vt(e.getAttributes, void 0, n) || {}, { tr: a } = t, s = i.from;
13821
13821
  let o = i.to;
13822
13822
  const l = e.type.create(r);
13823
13823
  if (n[1]) {
@@ -13838,7 +13838,7 @@ function n_(e) {
13838
13838
  return new Cu({
13839
13839
  find: e.find,
13840
13840
  handler: ({ state: t, range: i, match: n, chain: r }) => {
13841
- const a = gt(e.getAttributes, void 0, n) || {}, s = t.tr.delete(i.from, i.to), l = s.doc.resolve(i.from).blockRange(), u = l && cu(l, e.type, a);
13841
+ const a = vt(e.getAttributes, void 0, n) || {}, s = t.tr.delete(i.from, i.to), l = s.doc.resolve(i.from).blockRange(), u = l && cu(l, e.type, a);
13842
13842
  if (!u)
13843
13843
  return null;
13844
13844
  if (s.wrap(l, u), e.keepMarks && e.editor) {
@@ -13865,9 +13865,9 @@ let Be = class Ml {
13865
13865
  }, this.config = {
13866
13866
  ...this.config,
13867
13867
  ...t
13868
- }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = gt(At(this, "addOptions", {
13868
+ }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = vt(At(this, "addOptions", {
13869
13869
  name: this.name
13870
- }))), this.storage = gt(At(this, "addStorage", {
13870
+ }))), this.storage = vt(At(this, "addStorage", {
13871
13871
  name: this.name,
13872
13872
  options: this.options
13873
13873
  })) || {};
@@ -13884,9 +13884,9 @@ let Be = class Ml {
13884
13884
  }
13885
13885
  extend(t = {}) {
13886
13886
  const i = new Ml(t);
13887
- return i.parent = this, this.child = i, i.name = t.name ? t.name : i.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${i.name}".`), i.options = gt(At(i, "addOptions", {
13887
+ return i.parent = this, this.child = i, i.name = t.name ? t.name : i.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${i.name}".`), i.options = vt(At(i, "addOptions", {
13888
13888
  name: i.name
13889
- })), i.storage = gt(At(i, "addStorage", {
13889
+ })), i.storage = vt(At(i, "addStorage", {
13890
13890
  name: i.name,
13891
13891
  options: i.options
13892
13892
  })), i;
@@ -13896,7 +13896,7 @@ function bm(e) {
13896
13896
  return new wk({
13897
13897
  find: e.find,
13898
13898
  handler: ({ state: t, range: i, match: n, pasteEvent: r }) => {
13899
- const a = gt(e.getAttributes, void 0, n, r);
13899
+ const a = vt(e.getAttributes, void 0, n, r);
13900
13900
  if (a === !1 || a === null)
13901
13901
  return null;
13902
13902
  const { tr: s } = t, o = n[n.length - 1], l = n[0];
@@ -15560,7 +15560,7 @@ function K_({ $from: e, $to: t }) {
15560
15560
  function X_(e, t, i) {
15561
15561
  const n = (t || e).selection, r = (t || e).doc;
15562
15562
  let a, s;
15563
- if (n instanceof _e && (s = n.node.type.spec.tableRole)) {
15563
+ if (n instanceof Se && (s = n.node.type.spec.tableRole)) {
15564
15564
  if (s == "cell" || s == "header_cell") a = Qe.create(r, n.from);
15565
15565
  else if (s == "row") {
15566
15566
  const o = r.resolve(n.from + 1);
@@ -16740,7 +16740,7 @@ const Va = ({ editor: e }) => {
16740
16740
  storage: e.storage
16741
16741
  };
16742
16742
  return {
16743
- tableRole: gt(At(e, "tableRole", t))
16743
+ tableRole: vt(At(e, "tableRole", t))
16744
16744
  };
16745
16745
  }
16746
16746
  }), U3 = Be.create({
@@ -19990,8 +19990,8 @@ c.Engine.prototype.processCitationCluster = function(e, t, i, n) {
19990
19990
  if (B.position = g[1].position, B["first-reference-note-number"] = g[1]["first-reference-note-number"], B["first-container-reference-note-number"] = g[1]["first-container-reference-note-number"], B["near-note"] = g[1]["near-note"], g[1]["first-reference-note-number"] = 0, g[1]["first-container-reference-note-number"] = 0, g[1]["near-note"] = !1, this.registry.citationreg.citationsByItemId[Ue] && this.opt.xclass === "note" && this.opt.has_disambiguate) {
19991
19991
  var re = this.registry.registry[g[0].id]["citation-count"], Je = this.registry.citationreg.citationsByItemId[Ue].length;
19992
19992
  if (this.registry.registry[g[0].id]["citation-count"] = this.registry.citationreg.citationsByItemId[Ue].length, typeof re == "number") {
19993
- var ut = re < 2, dt = Je < 2;
19994
- if (ut !== dt)
19993
+ var ut = re < 2, pt = Je < 2;
19994
+ if (ut !== pt)
19995
19995
  for (var Y = 0, Ai = this.registry.citationreg.citationsByItemId[Ue].length; Y < Ai; Y++)
19996
19996
  X[this.registry.registry[g[0].id].ambig] = !0, this.tmp.taintedCitationIDs[this.registry.citationreg.citationsByItemId[Ue][Y].citationID] = !0;
19997
19997
  } else
@@ -20002,24 +20002,24 @@ c.Engine.prototype.processCitationCluster = function(e, t, i, n) {
20002
20002
  if (typeof J[ye] > "u" && he.properties.mode !== "author-only")
20003
20003
  $[$e] = he.properties.noteIndex, J[ye] = he.properties.noteIndex, de[ye] = he.properties.noteIndex, g[1].position = c.POSITION_FIRST;
20004
20004
  else {
20005
- var ai = !1, qi = !1, vt = null;
20005
+ var ai = !1, qi = !1, xt = null;
20006
20006
  if (u > 0)
20007
- var vt = ee[u - 1];
20007
+ var xt = ee[u - 1];
20008
20008
  var mn = ee[u];
20009
20009
  if (u > 0) {
20010
20010
  var fr = 1;
20011
- vt.properties.mode === "author-only" && u > 1 && (fr = 2);
20011
+ xt.properties.mode === "author-only" && u > 1 && (fr = 2);
20012
20012
  var dr = u - fr;
20013
- ee[dr].sortedItems.length && (Pt = ee[dr].sortedItems.slice(-1)[0][1].id, Ft = ee[u - fr].sortedItems.slice(-1)[0][1]["locator-extra"]), vt.sortedItems.length && vt.sortedItems[0].slice(-1)[0].legislation_id && (Pt = vt.sortedItems[0].slice(-1)[0].legislation_id);
20013
+ ee[dr].sortedItems.length && (Pt = ee[dr].sortedItems.slice(-1)[0][1].id, Ft = ee[u - fr].sortedItems.slice(-1)[0][1]["locator-extra"]), xt.sortedItems.length && xt.sortedItems[0].slice(-1)[0].legislation_id && (Pt = xt.sortedItems[0].slice(-1)[0].legislation_id);
20014
20014
  }
20015
- if (u > 0 && p === 0 && vt.properties.noteIndex !== mn.properties.noteIndex) {
20016
- var hn = !1, ji = vt.sortedItems[0][0].id;
20017
- if (vt.sortedItems[0][0].legislation_id && (ji = vt.sortedItems[0][0].legislation_id), ji == $e && vt.properties.noteIndex >= mn.properties.noteIndex - 1) {
20018
- var po = vt.sortedItems[0][1]["locator-extra"], Ti = mn.sortedItems[0][1]["locator-extra"];
20019
- (C[vt.properties.noteIndex] === 1 || vt.properties.noteIndex === 0) && po === Ti && (hn = !0);
20015
+ if (u > 0 && p === 0 && xt.properties.noteIndex !== mn.properties.noteIndex) {
20016
+ var hn = !1, ji = xt.sortedItems[0][0].id;
20017
+ if (xt.sortedItems[0][0].legislation_id && (ji = xt.sortedItems[0][0].legislation_id), ji == $e && xt.properties.noteIndex >= mn.properties.noteIndex - 1) {
20018
+ var po = xt.sortedItems[0][1]["locator-extra"], Ti = mn.sortedItems[0][1]["locator-extra"];
20019
+ (C[xt.properties.noteIndex] === 1 || xt.properties.noteIndex === 0) && po === Ti && (hn = !0);
20020
20020
  }
20021
20021
  hn ? ai = !0 : qi = !0;
20022
- } else p > 0 && Pe == $e && ri == Le || p === 0 && u > 0 && vt.properties.noteIndex == mn.properties.noteIndex && vt.sortedItems.length && Pt == $e && Ft == Le ? ai = !0 : qi = !0;
20022
+ } else p > 0 && Pe == $e && ri == Le || p === 0 && u > 0 && xt.properties.noteIndex == mn.properties.noteIndex && xt.sortedItems.length && Pt == $e && Ft == Le ? ai = !0 : qi = !0;
20023
20023
  var Bt, si, pr, oi, bn;
20024
20024
  ai && (p > 0 ? Bt = he.sortedItems[p - 1][1] : Bt = ee[u - 1].sortedItems[0][1], Bt.locator ? (Bt.label ? pr = Bt.label : pr = "", si = "" + Bt.locator + pr) : si = Bt.locator, Q ? (Gt ? bn = Gt : bn = "", oi = "" + Q + bn) : oi = Q), ai && si && !oi && (ai = !1, qi = !0), ai && (!si && oi ? g[1].position = c.POSITION_IBID_WITH_LOCATOR : !si && !oi || si && oi === si ? g[1].position = c.POSITION_IBID : si && oi && oi !== si ? g[1].position = c.POSITION_IBID_WITH_LOCATOR : (ai = !1, qi = !0)), qi && (g[1].position = c.POSITION_CONTAINER_SUBSEQUENT, typeof $[$e] > "u" ? $[$e] = he.properties.noteIndex : g[1].position = c.POSITION_SUBSEQUENT), (qi || ai) && (he.properties.mode === "author-only" && (g[1].position = c.POSITION_FIRST), de[ye] != he.properties.noteIndex && (g[1]["first-container-reference-note-number"] = de[ye], this.registry.registry[g[0].id] && (this.registry.registry[g[0].id]["first-container-reference-note-number"] = de[ye])), $[$e] != he.properties.noteIndex && (g[1]["first-reference-note-number"] = $[$e], this.registry.registry[g[0].id] && (this.registry.registry[g[0].id]["first-reference-note-number"] = $[$e])));
20025
20025
  }
@@ -26345,42 +26345,42 @@ function m4(e) {
26345
26345
  var t;
26346
26346
  return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : (t = d4.get(e)) !== null && t !== void 0 ? t : e;
26347
26347
  }
26348
- var bt;
26348
+ var gt;
26349
26349
  (function(e) {
26350
26350
  e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.LOWER_Z = 122] = "LOWER_Z", e[e.UPPER_A = 65] = "UPPER_A", e[e.UPPER_F = 70] = "UPPER_F", e[e.UPPER_Z = 90] = "UPPER_Z";
26351
- })(bt || (bt = {}));
26351
+ })(gt || (gt = {}));
26352
26352
  const h4 = 32;
26353
26353
  var an;
26354
26354
  (function(e) {
26355
26355
  e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
26356
26356
  })(an || (an = {}));
26357
26357
  function Vl(e) {
26358
- return e >= bt.ZERO && e <= bt.NINE;
26358
+ return e >= gt.ZERO && e <= gt.NINE;
26359
26359
  }
26360
26360
  function b4(e) {
26361
- return e >= bt.UPPER_A && e <= bt.UPPER_F || e >= bt.LOWER_A && e <= bt.LOWER_F;
26361
+ return e >= gt.UPPER_A && e <= gt.UPPER_F || e >= gt.LOWER_A && e <= gt.LOWER_F;
26362
26362
  }
26363
26363
  function g4(e) {
26364
- return e >= bt.UPPER_A && e <= bt.UPPER_Z || e >= bt.LOWER_A && e <= bt.LOWER_Z || Vl(e);
26364
+ return e >= gt.UPPER_A && e <= gt.UPPER_Z || e >= gt.LOWER_A && e <= gt.LOWER_Z || Vl(e);
26365
26365
  }
26366
26366
  function v4(e) {
26367
- return e === bt.EQUALS || g4(e);
26367
+ return e === gt.EQUALS || g4(e);
26368
26368
  }
26369
- var ht;
26369
+ var bt;
26370
26370
  (function(e) {
26371
26371
  e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
26372
- })(ht || (ht = {}));
26372
+ })(bt || (bt = {}));
26373
26373
  var Fi;
26374
26374
  (function(e) {
26375
26375
  e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
26376
26376
  })(Fi || (Fi = {}));
26377
26377
  class x4 {
26378
26378
  constructor(t, i, n) {
26379
- this.decodeTree = t, this.emitCodePoint = i, this.errors = n, this.state = ht.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = Fi.Strict;
26379
+ this.decodeTree = t, this.emitCodePoint = i, this.errors = n, this.state = bt.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = Fi.Strict;
26380
26380
  }
26381
26381
  /** Resets the instance to make it reusable. */
26382
26382
  startEntity(t) {
26383
- this.decodeMode = t, this.state = ht.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
26383
+ this.decodeMode = t, this.state = bt.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
26384
26384
  }
26385
26385
  /**
26386
26386
  * Write an entity to the decoder. This can be called multiple times with partial entities.
@@ -26395,15 +26395,15 @@ class x4 {
26395
26395
  */
26396
26396
  write(t, i) {
26397
26397
  switch (this.state) {
26398
- case ht.EntityStart:
26399
- return t.charCodeAt(i) === bt.NUM ? (this.state = ht.NumericStart, this.consumed += 1, this.stateNumericStart(t, i + 1)) : (this.state = ht.NamedEntity, this.stateNamedEntity(t, i));
26400
- case ht.NumericStart:
26398
+ case bt.EntityStart:
26399
+ return t.charCodeAt(i) === gt.NUM ? (this.state = bt.NumericStart, this.consumed += 1, this.stateNumericStart(t, i + 1)) : (this.state = bt.NamedEntity, this.stateNamedEntity(t, i));
26400
+ case bt.NumericStart:
26401
26401
  return this.stateNumericStart(t, i);
26402
- case ht.NumericDecimal:
26402
+ case bt.NumericDecimal:
26403
26403
  return this.stateNumericDecimal(t, i);
26404
- case ht.NumericHex:
26404
+ case bt.NumericHex:
26405
26405
  return this.stateNumericHex(t, i);
26406
- case ht.NamedEntity:
26406
+ case bt.NamedEntity:
26407
26407
  return this.stateNamedEntity(t, i);
26408
26408
  }
26409
26409
  }
@@ -26417,7 +26417,7 @@ class x4 {
26417
26417
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
26418
26418
  */
26419
26419
  stateNumericStart(t, i) {
26420
- return i >= t.length ? -1 : (t.charCodeAt(i) | h4) === bt.LOWER_X ? (this.state = ht.NumericHex, this.consumed += 1, this.stateNumericHex(t, i + 1)) : (this.state = ht.NumericDecimal, this.stateNumericDecimal(t, i));
26420
+ return i >= t.length ? -1 : (t.charCodeAt(i) | h4) === gt.LOWER_X ? (this.state = bt.NumericHex, this.consumed += 1, this.stateNumericHex(t, i + 1)) : (this.state = bt.NumericDecimal, this.stateNumericDecimal(t, i));
26421
26421
  }
26422
26422
  addToNumericResult(t, i, n, r) {
26423
26423
  if (i !== n) {
@@ -26482,11 +26482,11 @@ class x4 {
26482
26482
  var n;
26483
26483
  if (this.consumed <= i)
26484
26484
  return (n = this.errors) === null || n === void 0 || n.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
26485
- if (t === bt.SEMI)
26485
+ if (t === gt.SEMI)
26486
26486
  this.consumed += 1;
26487
26487
  else if (this.decodeMode === Fi.Strict)
26488
26488
  return 0;
26489
- return this.emitCodePoint(m4(this.result), this.consumed), this.errors && (t !== bt.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
26489
+ return this.emitCodePoint(m4(this.result), this.consumed), this.errors && (t !== gt.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
26490
26490
  }
26491
26491
  /**
26492
26492
  * Parses a named entity.
@@ -26508,7 +26508,7 @@ class x4 {
26508
26508
  (a === 0 || // And there should be no invalid characters.
26509
26509
  v4(s)) ? 0 : this.emitNotTerminatedNamedEntity();
26510
26510
  if (r = n[this.treeIndex], a = (r & an.VALUE_LENGTH) >> 14, a !== 0) {
26511
- if (s === bt.SEMI)
26511
+ if (s === gt.SEMI)
26512
26512
  return this.emitNamedEntityData(this.treeIndex, a, this.consumed + this.excess);
26513
26513
  this.decodeMode !== Fi.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
26514
26514
  }
@@ -26548,15 +26548,15 @@ class x4 {
26548
26548
  end() {
26549
26549
  var t;
26550
26550
  switch (this.state) {
26551
- case ht.NamedEntity:
26551
+ case bt.NamedEntity:
26552
26552
  return this.result !== 0 && (this.decodeMode !== Fi.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
26553
- case ht.NumericDecimal:
26553
+ case bt.NumericDecimal:
26554
26554
  return this.emitNumericEntity(0, 2);
26555
- case ht.NumericHex:
26555
+ case bt.NumericHex:
26556
26556
  return this.emitNumericEntity(0, 3);
26557
- case ht.NumericStart:
26557
+ case bt.NumericStart:
26558
26558
  return (t = this.errors) === null || t === void 0 || t.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
26559
- case ht.EntityStart:
26559
+ case bt.EntityStart:
26560
26560
  return 0;
26561
26561
  }
26562
26562
  }
@@ -30793,7 +30793,7 @@ const i6 = lt.create({
30793
30793
  })];
30794
30794
  }
30795
30795
  });
30796
- ft({
30796
+ dt({
30797
30797
  id: "formatting",
30798
30798
  tiptapExtensions: [r_],
30799
30799
  toolbar: [
@@ -30806,7 +30806,7 @@ ft({
30806
30806
  function Gn(e) {
30807
30807
  return (t) => t.commands.toggleHeading({ level: e });
30808
30808
  }
30809
- ft({
30809
+ dt({
30810
30810
  id: "headings",
30811
30811
  toolbar: [
30812
30812
  { id: "heading-1", label: "Heading 1", action: "toggleHeading1", iconComponent: "Heading1" },
@@ -30830,7 +30830,7 @@ ft({
30830
30830
  toggleHeading6: Gn(6)
30831
30831
  }
30832
30832
  });
30833
- ft({
30833
+ dt({
30834
30834
  id: "lists",
30835
30835
  tiptapExtensions: [a_, o_.configure({ nested: !0 })],
30836
30836
  toolbar: [
@@ -30847,7 +30847,7 @@ ft({
30847
30847
  function Ka(e) {
30848
30848
  return (t) => t.commands.setTextAlign(e);
30849
30849
  }
30850
- ft({
30850
+ dt({
30851
30851
  id: "alignment",
30852
30852
  tiptapExtensions: [
30853
30853
  l_.configure({ types: ["heading", "paragraph"] })
@@ -30865,7 +30865,7 @@ ft({
30865
30865
  alignJustify: Ka("justify")
30866
30866
  }
30867
30867
  });
30868
- ft({
30868
+ dt({
30869
30869
  id: "link",
30870
30870
  tiptapExtensions: [I_.configure({ openOnClick: !0 })],
30871
30871
  toolbar: [
@@ -30895,7 +30895,7 @@ function r6() {
30895
30895
  }, document.body.appendChild(t), t.click();
30896
30896
  });
30897
30897
  }
30898
- ft({
30898
+ dt({
30899
30899
  id: "image",
30900
30900
  tiptapExtensions: [L_],
30901
30901
  toolbar: [{ id: "insert-image", label: "Image", action: "insertImage", iconComponent: "Image" }],
@@ -31032,7 +31032,7 @@ var a6 = B3.extend({
31032
31032
  };
31033
31033
  }
31034
31034
  });
31035
- ft({
31035
+ dt({
31036
31036
  id: "table",
31037
31037
  tiptapExtensions: [
31038
31038
  a6.configure({ resizable: !1 }),
@@ -31045,18 +31045,18 @@ ft({
31045
31045
  ],
31046
31046
  slashCommands: [{ name: "Table", command: "insertTable" }]
31047
31047
  });
31048
- ft({
31048
+ dt({
31049
31049
  id: "blockquote",
31050
31050
  toolbar: [{ id: "blockquote", label: "Blockquote", action: "toggleBlockquote", iconComponent: "Quote" }],
31051
31051
  slashCommands: [{ name: "Blockquote", command: "toggleBlockquote" }]
31052
31052
  });
31053
- ft({
31053
+ dt({
31054
31054
  id: "code-block",
31055
31055
  toolbar: [{ id: "code-block", label: "Code Block", action: "toggleCodeBlock", iconComponent: "Code" }],
31056
31056
  slashCommands: [{ name: "Code Block", command: "toggleCodeBlock" }]
31057
31057
  });
31058
31058
  function l6(e = {}) {
31059
- return ft({
31059
+ return dt({
31060
31060
  id: "placeholder",
31061
31061
  tiptapExtensions: [
31062
31062
  j3.configure({
@@ -31101,7 +31101,7 @@ var u6 = Be.create({
31101
31101
  };
31102
31102
  }
31103
31103
  });
31104
- ft({
31104
+ dt({
31105
31105
  id: "pageBreak",
31106
31106
  tiptapExtensions: [u6],
31107
31107
  toolbar: [
@@ -31180,7 +31180,7 @@ var c6 = Be.create({
31180
31180
  };
31181
31181
  }
31182
31182
  });
31183
- ft({
31183
+ dt({
31184
31184
  id: "footnote",
31185
31185
  tiptapExtensions: [c6],
31186
31186
  toolbar: [
@@ -31381,7 +31381,7 @@ var m6 = lt.create({
31381
31381
  };
31382
31382
  }
31383
31383
  });
31384
- ft({
31384
+ dt({
31385
31385
  id: "toc",
31386
31386
  tiptapExtensions: [h6, b6, g6, m6],
31387
31387
  slashCommands: [{ name: "Table of contents", description: "Daftar isi", command: "insertToc" }],
@@ -31390,7 +31390,7 @@ ft({
31390
31390
  refreshToc: (e) => yh(e)
31391
31391
  }
31392
31392
  });
31393
- ft({
31393
+ dt({
31394
31394
  id: "font-size",
31395
31395
  tiptapExtensions: [$h],
31396
31396
  commands: {
@@ -31400,7 +31400,7 @@ ft({
31400
31400
  }
31401
31401
  }
31402
31402
  });
31403
- ft({
31403
+ dt({
31404
31404
  id: "text-color",
31405
31405
  tiptapExtensions: [V3],
31406
31406
  toolbar: [
@@ -31426,7 +31426,7 @@ var v6 = K3.extend({
31426
31426
  return ["mark", Ye(this.options.HTMLAttributes, e), 0];
31427
31427
  }
31428
31428
  });
31429
- ft({
31429
+ dt({
31430
31430
  id: "highlight",
31431
31431
  tiptapExtensions: [
31432
31432
  v6.configure({
@@ -46148,7 +46148,7 @@ var z6 = class {
46148
46148
  }
46149
46149
  };
46150
46150
  function ud(e) {
46151
- const t = e.storage.citation;
46151
+ const t = e.storage.citationEngine;
46152
46152
  return (t == null ? void 0 : t.engine) ?? null;
46153
46153
  }
46154
46154
  var N6 = Be.create({
@@ -46220,10 +46220,10 @@ function wh(e, t) {
46220
46220
  };
46221
46221
  }
46222
46222
  function or(e) {
46223
- return e.storage.citation ? e.storage.citation.engine ?? null : null;
46223
+ return e.storage.citationEngine ? e.storage.citationEngine.engine ?? null : null;
46224
46224
  }
46225
46225
  var I6 = lt.create({
46226
- name: "citation",
46226
+ name: "citationEngine",
46227
46227
  addStorage() {
46228
46228
  return {
46229
46229
  engine: null
@@ -46271,6 +46271,25 @@ var I6 = lt.create({
46271
46271
  const s = e.storage.editorContext;
46272
46272
  (a = (r = s == null ? void 0 : s.citation) == null ? void 0 : r.onSourcesChange) == null || a.call(r, t.getCitedSourceIds());
46273
46273
  }
46274
+ {
46275
+ const s = [];
46276
+ if (e.state.doc.descendants((o, l) => {
46277
+ if (o.type.name === "footnote" && o.attrs.sourceId) {
46278
+ const u = o.attrs.citationId;
46279
+ if (!u) return !0;
46280
+ const f = t.renderCluster(u);
46281
+ f && f !== o.attrs.content && s.push({ pos: l, content: f });
46282
+ }
46283
+ return !0;
46284
+ }), s.length > 0) {
46285
+ const o = e.state.tr;
46286
+ for (const { pos: l, content: u } of s) {
46287
+ const f = e.state.doc.nodeAt(l);
46288
+ f && o.setNodeMarkup(l, void 0, { ...f.attrs, content: u });
46289
+ }
46290
+ e.view.dispatch(o);
46291
+ }
46292
+ }
46274
46293
  }
46275
46294
  }), R6 = Be.create({
46276
46295
  name: "citation",
@@ -46359,7 +46378,7 @@ function cd(e, t, i) {
46359
46378
  const n = wh(t, i);
46360
46379
  return n.type === "footnote" && !e.schema.nodes.footnote ? !1 : e.chain().focus().insertContent({ type: n.type, attrs: n.attrs }).run();
46361
46380
  }
46362
- ft({
46381
+ dt({
46363
46382
  id: "citation",
46364
46383
  tiptapExtensions: [I6, R6, N6],
46365
46384
  toolbar: [{ id: "insert-citation", label: "Citation", action: "insertCitation", iconComponent: "Quote" }],
@@ -46403,10 +46422,10 @@ ft({
46403
46422
  const t = e.storage.editorContext, i = t == null ? void 0 : t.citation;
46404
46423
  if (!i) return;
46405
46424
  const n = typeof i.sources == "function" ? i.sources() : i.sources, r = new z6({ sources: n, style: i.style });
46406
- e.storage.citation.engine = r;
46425
+ e.storage.citationEngine.engine = r;
46407
46426
  },
46408
46427
  onDestroy(e) {
46409
- e.storage.citation.engine = null;
46428
+ e.storage.citationEngine.engine = null;
46410
46429
  }
46411
46430
  }
46412
46431
  });
@@ -46437,7 +46456,7 @@ function P6(e, t, i) {
46437
46456
  const n = e.steps.length - 1;
46438
46457
  if (n < t) return;
46439
46458
  const r = e.steps[n];
46440
- if (!(r instanceof st || r instanceof pt)) return;
46459
+ if (!(r instanceof st || r instanceof mt)) return;
46441
46460
  const a = e.mapping.maps[n];
46442
46461
  let s = 0;
46443
46462
  a.forEach((o, l, u, f) => {
@@ -46744,7 +46763,7 @@ var F6 = lt.create({
46744
46763
  (t = e.abort) == null || t.abort(), e.abort = null, e.preview = null;
46745
46764
  }
46746
46765
  });
46747
- ft({
46766
+ dt({
46748
46767
  id: "ai",
46749
46768
  // The `tiptap-markdown` `Markdown` extension is registered alongside AI so
46750
46769
  // that `editor.storage.markdown.parser` is available on every editor that
@@ -47079,7 +47098,7 @@ var U6 = Be.create({
47079
47098
  };
47080
47099
  }
47081
47100
  });
47082
- ft({
47101
+ dt({
47083
47102
  id: "smart-elements",
47084
47103
  tiptapExtensions: [
47085
47104
  U6,
@@ -47230,7 +47249,7 @@ var K6 = lt.create({
47230
47249
  ];
47231
47250
  }
47232
47251
  });
47233
- ft({
47252
+ dt({
47234
47253
  id: "slash-menu",
47235
47254
  tiptapExtensions: [K6],
47236
47255
  hooks: {
@@ -47548,7 +47567,7 @@ const Z6 = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
47548
47567
  k("div", bA, [
47549
47568
  k("form", {
47550
47569
  class: "space-y-2",
47551
- onSubmit: we(T, ["prevent"])
47570
+ onSubmit: _e(T, ["prevent"])
47552
47571
  }, [
47553
47572
  Ce(k("textarea", {
47554
47573
  "onUpdate:modelValue": Z[0] || (Z[0] = (U) => o.value = U),
@@ -47556,7 +47575,7 @@ const Z6 = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
47556
47575
  disabled: l.value,
47557
47576
  placeholder: h.value ? S(r)("sidebars.ai.draftPlaceholder") : S(r)("sidebars.ai.promptPlaceholder"),
47558
47577
  class: "w-full min-h-[55px] resize-none rounded-xl border border-slate-200 bg-white p-2.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none disabled:opacity-60 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30",
47559
- onKeydown: fi(we(T, ["exact", "prevent"]), ["enter"])
47578
+ onKeydown: fi(_e(T, ["exact", "prevent"]), ["enter"])
47560
47579
  }, null, 40, gA), [
47561
47580
  [Ne, o.value]
47562
47581
  ]),
@@ -47764,7 +47783,7 @@ const Z6 = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
47764
47783
  l.value === "active" ? (M(), I("div", YA, [
47765
47784
  k("form", {
47766
47785
  class: "space-y-2",
47767
- onSubmit: we(f, ["prevent"])
47786
+ onSubmit: _e(f, ["prevent"])
47768
47787
  }, [
47769
47788
  Ce(k("textarea", {
47770
47789
  "onUpdate:modelValue": v[2] || (v[2] = (g) => a.value = g),
@@ -47895,7 +47914,7 @@ const Z6 = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
47895
47914
  s.value ? (M(), I("form", {
47896
47915
  key: 0,
47897
47916
  class: "space-y-2 animate-fadeIn",
47898
- onSubmit: we(o, ["prevent"])
47917
+ onSubmit: _e(o, ["prevent"])
47899
47918
  }, [
47900
47919
  Ce(k("input", {
47901
47920
  "onUpdate:modelValue": f[2] || (f[2] = (p) => a.value = p),
@@ -47947,7 +47966,7 @@ const Z6 = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
47947
47966
  return (a, s) => e.isOpen ? (M(), I("div", {
47948
47967
  key: 0,
47949
47968
  class: "fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4 backdrop-blur-sm",
47950
- onClick: s[1] || (s[1] = we((o) => n("close"), ["self"]))
47969
+ onClick: s[1] || (s[1] = _e((o) => n("close"), ["self"]))
47951
47970
  }, [
47952
47971
  k("div", D8, [
47953
47972
  k("div", z8, [
@@ -48067,7 +48086,7 @@ const Z6 = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
48067
48086
  }), (g, x) => e.isOpen ? (M(), I("div", {
48068
48087
  key: 0,
48069
48088
  class: "fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4 backdrop-blur-sm",
48070
- onClick: x[10] || (x[10] = we((y) => r("close"), ["self"]))
48089
+ onClick: x[10] || (x[10] = _e((y) => r("close"), ["self"]))
48071
48090
  }, [
48072
48091
  k("div", mT, [
48073
48092
  k("div", hT, [
@@ -48266,7 +48285,7 @@ const Z6 = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
48266
48285
  type: "text",
48267
48286
  placeholder: S(i)("editor.findReplace.replacePlaceholder"),
48268
48287
  class: "min-w-0 flex-1 rounded-lg border border-slate-200 bg-transparent px-2.5 py-1.5 text-sm text-slate-800 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:text-slate-100",
48269
- onKeydown: fi(we(b, ["prevent"]), ["enter"])
48288
+ onKeydown: fi(_e(b, ["prevent"]), ["enter"])
48270
48289
  }, null, 40, UT), [
48271
48290
  [Ne, o.value]
48272
48291
  ]),
@@ -48339,7 +48358,7 @@ const Z6 = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
48339
48358
  return (b, h) => e.isOpen ? (M(), I("div", {
48340
48359
  key: 0,
48341
48360
  class: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
48342
- onClick: we(d, ["self"]),
48361
+ onClick: _e(d, ["self"]),
48343
48362
  onKeydown: m
48344
48363
  }, [
48345
48364
  k("div", $T, [
@@ -48650,7 +48669,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48650
48669
  }
48651
48670
  }), Y = () => {
48652
48671
  var O, E, P;
48653
- return ((P = (E = (O = Q.value) == null ? void 0 : O.storage) == null ? void 0 : E.citation) == null ? void 0 : P.engine) ?? null;
48672
+ return ((P = (E = (O = Q.value) == null ? void 0 : O.storage) == null ? void 0 : E.citationEngine) == null ? void 0 : P.engine) ?? null;
48654
48673
  }, B = () => {
48655
48674
  var O;
48656
48675
  (O = Y()) == null || O.updateSources($.value), n("citation-sources-change", $.value);
@@ -48660,7 +48679,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48660
48679
  $.value = $.value.map((E) => E.id === O.id ? O : E), B();
48661
48680
  }, ut = (O) => {
48662
48681
  $.value = $.value.filter((E) => E.id !== O), B();
48663
- }, dt = (O) => {
48682
+ }, pt = (O) => {
48664
48683
  var E;
48665
48684
  J.value = O, (E = Y()) == null || E.setStyle(O), n("update:citation-style", O);
48666
48685
  }, Ai = (O) => {
@@ -48693,7 +48712,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48693
48712
  Pt.value = !1;
48694
48713
  }
48695
48714
  }
48696
- }, vt = async (O) => {
48715
+ }, xt = async (O) => {
48697
48716
  const E = i.citation;
48698
48717
  if (!(!(E != null && E.onImportBibliography) || Pt.value)) {
48699
48718
  Pt.value = !0, Ft.value = "";
@@ -48724,10 +48743,10 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48724
48743
  const xe = 12, Re = 180, Ve = be.top - 48, qe = (be.left + be.right) / 2;
48725
48744
  if (typeof window > "u")
48726
48745
  return { top: Math.max(xe, Ve), left: qe };
48727
- const Se = Math.min(
48746
+ const we = Math.min(
48728
48747
  Re,
48729
48748
  Math.max(0, window.innerWidth / 2 - xe)
48730
- ), ke = xe + Se, ve = window.innerWidth - xe - Se, Te = Math.max(xe, window.innerHeight - 48);
48749
+ ), ke = xe + we, ve = window.innerWidth - xe - we, Te = Math.max(xe, window.innerHeight - 48);
48731
48750
  return {
48732
48751
  top: Math.min(Te, Math.max(xe, Ve)),
48733
48752
  left: Math.min(ve, Math.max(ke, qe))
@@ -48783,16 +48802,16 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48783
48802
  const { selection: P } = Q.value.state, be = Q.value.view.coordsAtPos(P.head);
48784
48803
  if (be && E) {
48785
48804
  const xe = Array.from(E.querySelectorAll(".rm-page-break")), Re = O.getBoundingClientRect(), Ve = be.top - Re.top + O.scrollTop;
48786
- let qe = 1, Se = !1;
48805
+ let qe = 1, we = !1;
48787
48806
  for (let ke = 0; ke < xe.length; ke++) {
48788
48807
  const ve = xe[ke].querySelector(".breaker");
48789
48808
  if (ve instanceof HTMLElement && Ve < ve.offsetTop) {
48790
- Bt.value = qe, Se = !0;
48809
+ Bt.value = qe, we = !0;
48791
48810
  break;
48792
48811
  }
48793
48812
  qe++;
48794
48813
  }
48795
- Se || (Bt.value = qe);
48814
+ we || (Bt.value = qe);
48796
48815
  } else
48797
48816
  Bt.value = 1;
48798
48817
  } catch {
@@ -48828,14 +48847,14 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48828
48847
  E.style.setProperty("--rm-header-margin-top", Ve), E.style.setProperty("--rm-footer-margin-bottom", qe), Q.value.view.dispatch(Q.value.state.tr), setTimeout(() => {
48829
48848
  requestAnimationFrame(() => {
48830
48849
  if (!Q.value || Q.value.view.dom !== E) return;
48831
- const Se = (Te, je) => {
48850
+ const we = (Te, je) => {
48832
48851
  let He = P, Ge = be;
48833
48852
  return je && li.value ? (He = Mt.value.replace(/{total}/g, O), Ge = Dt.value.replace(/{total}/g, O)) : Vi.value && Te % 2 === 0 && (He = Wi.value.replace(/{total}/g, O), Ge = la.value.replace(/{total}/g, O)), {
48834
48853
  left: He.replace(/{page}/g, ho(Te - 1)),
48835
48854
  right: Ge.replace(/{page}/g, ho(Te - 1))
48836
48855
  };
48837
48856
  }, ke = (Te, je, He) => {
48838
- const Ge = Se(je, He), We = Te.querySelector(".rm-page-header-left"), tt = Te.querySelector(".rm-page-header-right");
48857
+ const Ge = we(je, He), We = Te.querySelector(".rm-page-header-left"), tt = Te.querySelector(".rm-page-header-right");
48839
48858
  We && (We.innerHTML = Ge.left), tt && (tt.innerHTML = Ge.right);
48840
48859
  }, ve = E.querySelector(".rm-first-page-header");
48841
48860
  ve && ke(ve, 1, !0), Array.from(E.querySelectorAll(".rm-page-break .rm-page-header")).forEach((Te, je) => {
@@ -48860,8 +48879,8 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48860
48879
  const E = Q.value.storage.PaginationPlus;
48861
48880
  !E || !(E.pageHeight !== O.pageHeight || E.pageWidth !== O.pageWidth || E.marginTop !== O.marginTop || E.marginBottom !== O.marginBottom || E.marginLeft !== O.marginLeft || E.marginRight !== O.marginRight || E.pageGap !== O.pageGap || E.contentMarginTop !== O.contentMarginTop || E.contentMarginBottom !== O.contentMarginBottom || E.pageBreakBackground !== O.pageBreakBackground || E.enabled !== O.enabled) || (E.pageHeight = O.pageHeight, E.pageWidth = O.pageWidth, E.marginTop = O.marginTop, E.marginBottom = O.marginBottom, E.marginLeft = O.marginLeft, E.marginRight = O.marginRight, E.pageGap = O.pageGap, E.contentMarginTop = O.contentMarginTop, E.contentMarginBottom = O.contentMarginBottom, E.pageBreakBackground = O.pageBreakBackground, E.enabled = O.enabled, Q.value.view.dispatch(Q.value.state.tr));
48862
48881
  }, { deep: !0 }), Ee(Pe, (O) => {
48863
- var E, P, be, xe, Re, Ve, qe, Se;
48864
- O && Q.value && (!y.value && !w.value && !C.value && !T.value && (y.value = ((P = (E = Q.value.storage.PaginationPlus) == null ? void 0 : E.appliedConfig) == null ? void 0 : P.headerLeft) || "", w.value = ((xe = (be = Q.value.storage.PaginationPlus) == null ? void 0 : be.appliedConfig) == null ? void 0 : xe.headerRight) || "", C.value = ((Ve = (Re = Q.value.storage.PaginationPlus) == null ? void 0 : Re.appliedConfig) == null ? void 0 : Ve.footerLeft) || "", T.value = ((Se = (qe = Q.value.storage.PaginationPlus) == null ? void 0 : qe.appliedConfig) == null ? void 0 : Se.footerRight) || ""), ui(), ri.value && n("ready", ri.value), Q.value.on("selectionUpdate", () => {
48882
+ var E, P, be, xe, Re, Ve, qe, we;
48883
+ O && Q.value && (!y.value && !w.value && !C.value && !T.value && (y.value = ((P = (E = Q.value.storage.PaginationPlus) == null ? void 0 : E.appliedConfig) == null ? void 0 : P.headerLeft) || "", w.value = ((xe = (be = Q.value.storage.PaginationPlus) == null ? void 0 : be.appliedConfig) == null ? void 0 : xe.headerRight) || "", C.value = ((Ve = (Re = Q.value.storage.PaginationPlus) == null ? void 0 : Re.appliedConfig) == null ? void 0 : Ve.footerLeft) || "", T.value = ((we = (qe = Q.value.storage.PaginationPlus) == null ? void 0 : qe.appliedConfig) == null ? void 0 : we.footerRight) || ""), ui(), ri.value && n("ready", ri.value), Q.value.on("selectionUpdate", () => {
48865
48884
  dr(), Oi();
48866
48885
  }), Q.value.on("transaction", () => {
48867
48886
  Oi(), mn(), ue();
@@ -48885,8 +48904,8 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48885
48904
  if (He) {
48886
48905
  const Ge = He.getBoundingClientRect(), We = ve.clientY - Ge.top, tt = Ei.value * 37.795;
48887
48906
  if (We >= 0 && We <= Math.max(tt, 40) + 15) {
48888
- let xt = null;
48889
- He.classList.contains("rm-page-break") && (xt = He.querySelector(".rm-page-header")), xt || (xt = document.querySelector(".rm-page-header, .rm-first-page-header")), xt && Aa(ve);
48907
+ let ct = null;
48908
+ He.classList.contains("rm-page-break") && (ct = He.querySelector(".rm-page-header")), ct || (ct = document.querySelector(".rm-page-header, .rm-first-page-header")), ct && Aa(ve);
48890
48909
  }
48891
48910
  }
48892
48911
  }), Q.value.view.dom.addEventListener("dblclick", (ve) => {
@@ -48929,7 +48948,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48929
48948
  if (!Q.value) return;
48930
48949
  Q.value.chain().focus().unsetLink().run(), vr.value = !1;
48931
48950
  }
48932
- const Sa = G(f.value), gn = G(u.value), mt = G({
48951
+ const Sa = G(f.value), gn = G(u.value), ht = G({
48933
48952
  top: Gi(o.value.top),
48934
48953
  bottom: Gi(o.value.bottom),
48935
48954
  left: Gi(o.value.left),
@@ -48942,7 +48961,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48942
48961
  return Math.round(O * Sr);
48943
48962
  }
48944
48963
  const Ah = () => {
48945
- Sa.value = f.value, gn.value = u.value, mt.value = {
48964
+ Sa.value = f.value, gn.value = u.value, ht.value = {
48946
48965
  top: Gi(o.value.top),
48947
48966
  bottom: Gi(o.value.bottom),
48948
48967
  left: Gi(o.value.left),
@@ -48953,16 +48972,16 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48953
48972
  const P = typeof E == "number" ? E : Number(E);
48954
48973
  return Number.isFinite(P) ? Math.min(xr, Math.max(Kn, P)) : Kn;
48955
48974
  };
48956
- f.value = Sa.value, u.value = gn.value, mt.value = {
48957
- top: O(mt.value.top),
48958
- bottom: O(mt.value.bottom),
48959
- left: O(mt.value.left),
48960
- right: O(mt.value.right)
48975
+ f.value = Sa.value, u.value = gn.value, ht.value = {
48976
+ top: O(ht.value.top),
48977
+ bottom: O(ht.value.bottom),
48978
+ left: O(ht.value.left),
48979
+ right: O(ht.value.right)
48961
48980
  }, o.value = {
48962
- top: Ca(mt.value.top),
48963
- bottom: Ca(mt.value.bottom),
48964
- left: Ca(mt.value.left),
48965
- right: Ca(mt.value.right)
48981
+ top: Ca(ht.value.top),
48982
+ bottom: Ca(ht.value.bottom),
48983
+ left: Ca(ht.value.left),
48984
+ right: Ca(ht.value.right)
48966
48985
  }, n("update:pageSize", f.value), n("update:orientation", gn.value), n("update:margins", { ...o.value }), ya.value = !1;
48967
48986
  }, xo = G(!1), vn = { value: null }, Oh = () => {
48968
48987
  mr.value = Ei.value, hr.value = Mi.value, ca.value = li.value, fa.value = Vi.value, ua.value = !0;
@@ -48990,8 +49009,8 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
48990
49009
  document.removeEventListener("mousedown", E.onOutsideMouseDown), window.removeEventListener("resize", E.onResize), window.removeEventListener("scroll", E.onWindowScroll), (be = hn.value) == null || be.removeEventListener("scroll", E.onScroll), E.overlay.remove(), E.generatedContent && (E.generatedContent.style.visibility = ""), E.targetHeader.classList.remove("rm-header-active"), vn.value = null, xo.value = !1, O && (li.value && E.isFirstPage ? Mt.value = P : Vi.value && E.pageIndex % 2 === 0 ? Wi.value = P : y.value = P, ui(), ee());
48991
49010
  }, Qu = (O) => {
48992
49011
  if (!O.targetHeader.parentNode || !Q.value) return;
48993
- const E = Q.value.view.dom, P = O.targetHeader.getBoundingClientRect(), be = E.getBoundingClientRect(), xe = getComputedStyle(E), Re = parseFloat(xe.getPropertyValue("--rm-margin-left")) || 0, Ve = parseFloat(xe.getPropertyValue("--rm-margin-right")) || 0, qe = O.targetHeader.querySelector(".rm-page-header-content"), Se = (qe == null ? void 0 : qe.getBoundingClientRect()) ?? P, ke = O.isFirstPage ? P.left : P.left + Re, ve = O.isFirstPage ? P.right : P.right - Ve, Te = Math.max(0, ke - be.left), je = Math.max(0, be.right - ve);
48994
- O.overlay.style.left = `${ke}px`, O.overlay.style.top = `${Se.top}px`, O.overlay.style.width = `${Math.max(ve - ke, 1)}px`, O.overlay.style.height = `${Math.max(Se.height, 24)}px`, O.activeBar.style.setProperty("--rm-header-bar-left", `${-Te}px`), O.activeBar.style.setProperty("--rm-header-bar-width", `${be.width}px`), O.activeBar.style.setProperty("--rm-header-bar-padding-left", `${Te}px`), O.activeBar.style.setProperty("--rm-header-bar-padding-right", `${je}px`);
49012
+ const E = Q.value.view.dom, P = O.targetHeader.getBoundingClientRect(), be = E.getBoundingClientRect(), xe = getComputedStyle(E), Re = parseFloat(xe.getPropertyValue("--rm-margin-left")) || 0, Ve = parseFloat(xe.getPropertyValue("--rm-margin-right")) || 0, qe = O.targetHeader.querySelector(".rm-page-header-content"), we = (qe == null ? void 0 : qe.getBoundingClientRect()) ?? P, ke = O.isFirstPage ? P.left : P.left + Re, ve = O.isFirstPage ? P.right : P.right - Ve, Te = Math.max(0, ke - be.left), je = Math.max(0, be.right - ve);
49013
+ O.overlay.style.left = `${ke}px`, O.overlay.style.top = `${we.top}px`, O.overlay.style.width = `${Math.max(ve - ke, 1)}px`, O.overlay.style.height = `${Math.max(we.height, 24)}px`, O.activeBar.style.setProperty("--rm-header-bar-left", `${-Te}px`), O.activeBar.style.setProperty("--rm-header-bar-width", `${be.width}px`), O.activeBar.style.setProperty("--rm-header-bar-padding-left", `${Te}px`), O.activeBar.style.setProperty("--rm-header-bar-padding-right", `${je}px`);
48995
49014
  }, Aa = (O) => {
48996
49015
  var fc, dc;
48997
49016
  const E = vn.value;
@@ -49010,10 +49029,10 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49010
49029
  if (!xe && Ve < 2) return;
49011
49030
  const qe = P.querySelector(".rm-page-header-content");
49012
49031
  qe && (qe.style.visibility = "hidden");
49013
- const Se = document.createElement("div");
49014
- Se.className = "rm-header-edit-input", Se.contentEditable = "true", Se.setAttribute("role", "textbox"), Se.setAttribute("aria-label", s("editor.headerFooter.header") || "Header"), Se.dataset.placeholder = s("editor.headerFooter.headerPlaceholder") || "Header", Se.innerHTML = Nh(Ve);
49032
+ const we = document.createElement("div");
49033
+ we.className = "rm-header-edit-input", we.contentEditable = "true", we.setAttribute("role", "textbox"), we.setAttribute("aria-label", s("editor.headerFooter.header") || "Header"), we.dataset.placeholder = s("editor.headerFooter.headerPlaceholder") || "Header", we.innerHTML = Nh(Ve);
49015
49034
  const ke = document.createElement("div");
49016
- ke.className = "rm-header-edit-overlay", ke.appendChild(Se);
49035
+ ke.className = "rm-header-edit-overlay", ke.appendChild(we);
49017
49036
  const ve = document.createElement("div");
49018
49037
  ve.className = "rm-google-docs-header-bar", ve.innerHTML = `
49019
49038
  <span class="rm-header-label">${s("editor.headerFooter.header") || "Header"}</span>
@@ -49049,7 +49068,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49049
49068
  }, tt = {
49050
49069
  targetHeader: P,
49051
49070
  overlay: ke,
49052
- input: Se,
49071
+ input: we,
49053
49072
  activeBar: ve,
49054
49073
  generatedContent: qe,
49055
49074
  isFirstPage: xe,
@@ -49061,10 +49080,10 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49061
49080
  onWindowScroll: He
49062
49081
  };
49063
49082
  vn.value = tt, xo.value = !0;
49064
- const xt = ve.querySelector(".rm-diff-cb");
49065
- xt == null || xt.addEventListener("mousedown", (De) => {
49083
+ const ct = ve.querySelector(".rm-diff-cb");
49084
+ ct == null || ct.addEventListener("mousedown", (De) => {
49066
49085
  De.stopPropagation();
49067
- }), xt == null || xt.addEventListener("change", (De) => {
49086
+ }), ct == null || ct.addEventListener("change", (De) => {
49068
49087
  De.stopPropagation();
49069
49088
  const zi = De.target.checked;
49070
49089
  Ki(!0), zi && (Mt.value = "", Dt.value = ""), li.value = zi, ui();
@@ -49094,11 +49113,11 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49094
49113
  De.stopPropagation(), De.preventDefault();
49095
49114
  }), $n == null || $n.addEventListener("click", (De) => {
49096
49115
  De.stopPropagation(), Ki(!1), zh();
49097
- }), Se.addEventListener("blur", We), document.addEventListener("mousedown", Ge), window.addEventListener("resize", Te), window.addEventListener("scroll", He), (dc = hn.value) == null || dc.addEventListener("scroll", je), requestAnimationFrame(() => {
49116
+ }), we.addEventListener("blur", We), document.addEventListener("mousedown", Ge), window.addEventListener("resize", Te), window.addEventListener("scroll", He), (dc = hn.value) == null || dc.addEventListener("scroll", je), requestAnimationFrame(() => {
49098
49117
  vn.value === tt && Qu(tt);
49099
- }), Se.focus();
49118
+ }), we.focus();
49100
49119
  const Vn = window.getSelection(), yo = document.createRange();
49101
- yo.selectNodeContents(Se), yo.collapse(!1), Vn == null || Vn.removeAllRanges(), Vn == null || Vn.addRange(yo);
49120
+ yo.selectNodeContents(we), yo.collapse(!1), Vn == null || Vn.removeAllRanges(), Vn == null || Vn.addRange(yo);
49102
49121
  }, Ta = () => {
49103
49122
  var O, E, P, be;
49104
49123
  Q.value && (br.value = C.value || ((E = (O = Q.value.storage.PaginationPlus) == null ? void 0 : O.appliedConfig) == null ? void 0 : E.footerLeft) || "", gr.value = T.value || ((be = (P = Q.value.storage.PaginationPlus) == null ? void 0 : P.appliedConfig) == null ? void 0 : be.footerRight) || "", xa.value = !0);
@@ -49282,8 +49301,8 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49282
49301
  const xe = E.selection.head, Re = be.create({ content: "" }), Ve = E.tr.insert(xe, Re);
49283
49302
  P.dispatch(Ve), P.focus(), setTimeout(() => {
49284
49303
  Oa();
49285
- const qe = document.querySelectorAll(".docs-footnote-item-text"), Se = qe[qe.length - 1];
49286
- Se && (Se.scrollIntoView({ behavior: "smooth", block: "nearest" }), Se.focus());
49304
+ const qe = document.querySelectorAll(".docs-footnote-item-text"), we = qe[qe.length - 1];
49305
+ we && (we.scrollIntoView({ behavior: "smooth", block: "nearest" }), we.focus());
49287
49306
  }, 160);
49288
49307
  } else nc[O] ? nc[O]() : n("menu-click", O);
49289
49308
  }, yr = (O) => {
@@ -49303,29 +49322,35 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49303
49322
  if (!Q.value || !Pe.value) return;
49304
49323
  const O = Q.value.view.dom, E = O.querySelector("[data-rm-pagination]");
49305
49324
  if (!E) return;
49306
- const P = (Se) => {
49325
+ const P = (we) => {
49307
49326
  var Te, je, He;
49308
49327
  const ke = document.createElement("div");
49309
- if (ke.className = "docs-footnote-item-text", Se.hasAttribute("data-footnote-source-id")) {
49310
- const Ge = Se.getAttribute("data-citation-id") ?? "", We = (je = (Te = Q.value) == null ? void 0 : Te.storage) == null ? void 0 : je.citation, tt = ((He = We == null ? void 0 : We.engine) == null ? void 0 : He.renderCluster(Ge)) ?? "";
49311
- return ke.classList.add("docs-footnote-item-text--citation"), tt ? ke.innerHTML = tt : ke.setAttribute("data-empty", "true"), ke;
49328
+ if (ke.className = "docs-footnote-item-text", we.hasAttribute("data-footnote-source-id")) {
49329
+ const Ge = we.getAttribute("data-citation-id") ?? "", We = (je = (Te = Q.value) == null ? void 0 : Te.storage) == null ? void 0 : je.citationEngine, tt = ((He = We == null ? void 0 : We.engine) == null ? void 0 : He.renderCluster(Ge)) ?? "";
49330
+ if (ke.classList.add("docs-footnote-item-text--citation"), tt)
49331
+ ke.innerHTML = tt;
49332
+ else {
49333
+ const ct = we.getAttribute("data-footnote-content") ?? "";
49334
+ ct ? ke.innerHTML = ct : ke.setAttribute("data-empty", "true");
49335
+ }
49336
+ return ke;
49312
49337
  }
49313
- const ve = Se.getAttribute("data-footnote-content") ?? "";
49338
+ const ve = we.getAttribute("data-footnote-content") ?? "";
49314
49339
  return ke.contentEditable = "true", ke.textContent = ve, ve || ke.setAttribute("data-empty", "true"), ke.addEventListener("input", () => {
49315
49340
  ke.removeAttribute("data-empty"), ke.textContent || ke.setAttribute("data-empty", "true");
49316
49341
  }), ke.addEventListener("blur", () => {
49317
49342
  var We;
49318
49343
  const Ge = ((We = ke.textContent) == null ? void 0 : We.trim()) ?? "";
49319
- Uh(Se, Ge);
49344
+ Uh(we, Ge);
49320
49345
  }), ke;
49321
49346
  }, be = Array.from(E.querySelectorAll(".rm-page-break")), xe = Array.from(O.querySelectorAll(".docs-footnote-ref"));
49322
49347
  if (be.length === 0) {
49323
49348
  xe.forEach((je, He) => {
49324
49349
  je.textContent = String(He + 1);
49325
49350
  });
49326
- const Se = Le.value;
49327
- if (!Se || ((qe = Se.querySelector(".docs-pageless-footnotes")) == null || qe.remove(), xe.length === 0)) return;
49328
- const ke = Se.querySelector(".docs-pageless-footnotes");
49351
+ const we = Le.value;
49352
+ if (!we || ((qe = we.querySelector(".docs-pageless-footnotes")) == null || qe.remove(), xe.length === 0)) return;
49353
+ const ke = we.querySelector(".docs-pageless-footnotes");
49329
49354
  if (ke != null && ke.querySelector(".docs-footnote-item-text:focus")) return;
49330
49355
  const ve = document.createElement("div");
49331
49356
  ve.className = "docs-page-footnotes docs-pageless-footnotes";
@@ -49337,12 +49362,12 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49337
49362
  We.className = "docs-footnote-item-num", We.textContent = String(He + 1);
49338
49363
  const tt = P(je);
49339
49364
  je.dataset.footnoteItemId = `fn-pageless-${He}`, Ge.id = `fn-pageless-${He}`, Ge.appendChild(We), Ge.appendChild(tt), ve.appendChild(Ge);
49340
- }), Se.appendChild(ve);
49365
+ }), we.appendChild(ve);
49341
49366
  return;
49342
49367
  }
49343
49368
  const Re = /* @__PURE__ */ new Map();
49344
- be.forEach((Se, ke) => Re.set(ke, [])), xe.forEach((Se) => {
49345
- const ke = Se.getBoundingClientRect().top;
49369
+ be.forEach((we, ke) => Re.set(ke, [])), xe.forEach((we) => {
49370
+ const ke = we.getBoundingClientRect().top;
49346
49371
  let ve = be.length - 1;
49347
49372
  for (let Te = 0; Te < be.length - 1; Te++) {
49348
49373
  const je = be[Te].querySelector(".breaker");
@@ -49351,29 +49376,29 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49351
49376
  break;
49352
49377
  }
49353
49378
  }
49354
- Re.get(ve).push(Se);
49379
+ Re.get(ve).push(we);
49355
49380
  });
49356
49381
  let Ve = 1;
49357
- be.forEach((Se, ke) => {
49382
+ be.forEach((we, ke) => {
49358
49383
  const ve = Re.get(ke) ?? [], Te = Ve;
49359
- Ve += ve.length, ve.forEach((tt, xt) => {
49360
- tt.textContent = String(Te + xt);
49384
+ Ve += ve.length, ve.forEach((tt, ct) => {
49385
+ tt.textContent = String(Te + ct);
49361
49386
  });
49362
- const je = Se.querySelector(".docs-page-footnotes");
49387
+ const je = we.querySelector(".docs-page-footnotes");
49363
49388
  if (je != null && je.querySelector(".docs-footnote-item-text:focus") || (je == null || je.remove(), ve.length === 0)) return;
49364
49389
  const He = document.createElement("div");
49365
49390
  He.className = "docs-page-footnotes";
49366
49391
  const Ge = document.createElement("div");
49367
- Ge.className = "docs-footnotes-sep", He.appendChild(Ge), ve.forEach((tt, xt) => {
49392
+ Ge.className = "docs-footnotes-sep", He.appendChild(Ge), ve.forEach((tt, ct) => {
49368
49393
  const Yt = document.createElement("div");
49369
49394
  Yt.className = "docs-footnote-item";
49370
49395
  const xn = document.createElement("sup");
49371
- xn.className = "docs-footnote-item-num", xn.textContent = String(Te + xt);
49396
+ xn.className = "docs-footnote-item-num", xn.textContent = String(Te + ct);
49372
49397
  const Ma = P(tt);
49373
- tt.dataset.footnoteItemId = `fn-${ke}-${xt}`, Yt.id = `fn-${ke}-${xt}`, Yt.appendChild(xn), Yt.appendChild(Ma), He.appendChild(Yt);
49398
+ tt.dataset.footnoteItemId = `fn-${ke}-${ct}`, Yt.id = `fn-${ke}-${ct}`, Yt.appendChild(xn), Yt.appendChild(Ma), He.appendChild(Yt);
49374
49399
  });
49375
- const We = Se.querySelector(".breaker");
49376
- We ? We.insertBefore(He, We.firstChild) : Se.appendChild(He);
49400
+ const We = we.querySelector(".breaker");
49401
+ We ? We.insertBefore(He, We.firstChild) : we.appendChild(He);
49377
49402
  });
49378
49403
  };
49379
49404
  Ee(Pe, (O) => {
@@ -49411,7 +49436,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49411
49436
  }), Q.value.on("selectionUpdate", () => {
49412
49437
  Ea(100);
49413
49438
  });
49414
- const E = Q.value.storage.citation;
49439
+ const E = Q.value.storage.citationEngine;
49415
49440
  (P = E == null ? void 0 : E.engine) == null || P.onChange(() => {
49416
49441
  Ea(30);
49417
49442
  }), window.addEventListener("resize", ac);
@@ -49544,9 +49569,9 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49544
49569
  onCreate: re,
49545
49570
  onUpdate: Je,
49546
49571
  onRemove: ut,
49547
- "onUpdate:style": dt,
49572
+ "onUpdate:style": pt,
49548
49573
  onImportDoi: qi,
49549
- onImportBibliography: vt
49574
+ onImportBibliography: xt
49550
49575
  }, null, 8, ["sources", "active-style", "picker-mode", "can-import", "importing", "import-message"])) : se("", !0),
49551
49576
  j.value === "comments" ? (M(), Ke(r8, {
49552
49577
  key: 3,
@@ -49879,7 +49904,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49879
49904
  k("div", null, [
49880
49905
  k("label", cE, D(S(s)("editor.pageSetup.top")), 1),
49881
49906
  Ce(k("input", {
49882
- "onUpdate:modelValue": E[43] || (E[43] = (P) => mt.value.top = P),
49907
+ "onUpdate:modelValue": E[43] || (E[43] = (P) => ht.value.top = P),
49883
49908
  type: "number",
49884
49909
  min: Kn,
49885
49910
  max: S(xr),
@@ -49888,7 +49913,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49888
49913
  }, null, 8, fE), [
49889
49914
  [
49890
49915
  Ne,
49891
- mt.value.top,
49916
+ ht.value.top,
49892
49917
  void 0,
49893
49918
  { number: !0 }
49894
49919
  ]
@@ -49897,7 +49922,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49897
49922
  k("div", null, [
49898
49923
  k("label", dE, D(S(s)("editor.pageSetup.bottom")), 1),
49899
49924
  Ce(k("input", {
49900
- "onUpdate:modelValue": E[44] || (E[44] = (P) => mt.value.bottom = P),
49925
+ "onUpdate:modelValue": E[44] || (E[44] = (P) => ht.value.bottom = P),
49901
49926
  type: "number",
49902
49927
  min: Kn,
49903
49928
  max: S(xr),
@@ -49906,7 +49931,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49906
49931
  }, null, 8, pE), [
49907
49932
  [
49908
49933
  Ne,
49909
- mt.value.bottom,
49934
+ ht.value.bottom,
49910
49935
  void 0,
49911
49936
  { number: !0 }
49912
49937
  ]
@@ -49915,7 +49940,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49915
49940
  k("div", null, [
49916
49941
  k("label", mE, D(S(s)("editor.pageSetup.left")), 1),
49917
49942
  Ce(k("input", {
49918
- "onUpdate:modelValue": E[45] || (E[45] = (P) => mt.value.left = P),
49943
+ "onUpdate:modelValue": E[45] || (E[45] = (P) => ht.value.left = P),
49919
49944
  type: "number",
49920
49945
  min: Kn,
49921
49946
  max: S(xr),
@@ -49924,7 +49949,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49924
49949
  }, null, 8, hE), [
49925
49950
  [
49926
49951
  Ne,
49927
- mt.value.left,
49952
+ ht.value.left,
49928
49953
  void 0,
49929
49954
  { number: !0 }
49930
49955
  ]
@@ -49933,7 +49958,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49933
49958
  k("div", null, [
49934
49959
  k("label", bE, D(S(s)("editor.pageSetup.right")), 1),
49935
49960
  Ce(k("input", {
49936
- "onUpdate:modelValue": E[46] || (E[46] = (P) => mt.value.right = P),
49961
+ "onUpdate:modelValue": E[46] || (E[46] = (P) => ht.value.right = P),
49937
49962
  type: "number",
49938
49963
  min: Kn,
49939
49964
  max: S(xr),
@@ -49942,7 +49967,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49942
49967
  }, null, 8, gE), [
49943
49968
  [
49944
49969
  Ne,
49945
- mt.value.right,
49970
+ ht.value.right,
49946
49971
  void 0,
49947
49972
  { number: !0 }
49948
49973
  ]
@@ -49966,7 +49991,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
49966
49991
  ])) : se("", !0)
49967
49992
  ]));
49968
49993
  }
49969
- }), oM = /* @__PURE__ */ Yl(yE, [["__scopeId", "data-v-bf29fce6"]]), kE = { class: "docs-editor-pages flex flex-col items-center gap-10" }, wE = ["data-page-index"], _E = ["data-node-type", "data-from", "data-to"], SE = ["innerHTML"], CE = {
49994
+ }), oM = /* @__PURE__ */ Yl(yE, [["__scopeId", "data-v-f738cd05"]]), kE = { class: "docs-editor-pages flex flex-col items-center gap-10" }, wE = ["data-page-index"], _E = ["data-node-type", "data-from", "data-to"], SE = ["innerHTML"], CE = {
49970
49995
  key: 1,
49971
49996
  class: "docs-editor-page__block-fallback flex justify-between text-sm text-slate-700"
49972
49997
  }, AE = { class: "docs-editor-page__block-type font-medium" }, TE = { class: "docs-editor-page__block-range text-slate-500" }, lM = /* @__PURE__ */ at({
@@ -50224,7 +50249,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
50224
50249
  fi((C) => f(w.id), ["enter"]),
50225
50250
  fi(p, ["esc"])
50226
50251
  ],
50227
- onClick: y[3] || (y[3] = we(() => {
50252
+ onClick: y[3] || (y[3] = _e(() => {
50228
50253
  }, ["stop"]))
50229
50254
  }, null, 40, BE), [
50230
50255
  [Ne, l.value]
@@ -50235,7 +50260,7 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
50235
50260
  key: 0,
50236
50261
  type: "button",
50237
50262
  class: ge(["rounded-full p-1 text-slate-500 opacity-0 transition-opacity hover:bg-slate-200/70 group-hover:opacity-100 dark:hover:bg-slate-700/70", { "opacity-100": s.value === w.id }]),
50238
- onClick: we((C) => m(w.id), ["stop"])
50263
+ onClick: _e((C) => m(w.id), ["stop"])
50239
50264
  }, [
50240
50265
  te(S(Td), { class: "h-3.5 w-3.5" })
50241
50266
  ], 10, HE)) : se("", !0),
@@ -50243,13 +50268,13 @@ const nO = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
50243
50268
  k("button", {
50244
50269
  type: "button",
50245
50270
  class: "flex w-full items-center px-3 py-1.5 text-xs hover:bg-slate-50 dark:hover:bg-slate-700/50",
50246
- onClick: we((C) => u(w), ["stop"])
50271
+ onClick: _e((C) => u(w), ["stop"])
50247
50272
  }, D(S(i)("documentTabs.rename")), 9, jE),
50248
50273
  k("button", {
50249
50274
  type: "button",
50250
50275
  class: "flex w-full items-center px-3 py-1.5 text-xs text-red-600 dark:text-red-400 hover:bg-slate-50 dark:hover:bg-slate-700/50 disabled:opacity-40",
50251
50276
  disabled: e.tabs.length <= 1,
50252
- onClick: we((C) => d(w.id), ["stop"])
50277
+ onClick: _e((C) => d(w.id), ["stop"])
50253
50278
  }, D(S(i)("documentTabs.delete")), 9, $E)
50254
50279
  ])) : se("", !0)
50255
50280
  ])