@bygga.dev/editor 0.1.0 → 0.3.1

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.
@@ -1,12 +1,12 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, H as s, I as c, J as l, K as u, L as d, M as f, O as p, Q as m, R as h, S as g, T as ee, X as _, Z as v, _ as y, b, c as te, f as x, g as S, h as C, j as w, l as T, m as ne, nt as E, p as D, r as O, u as k, v as A, w as j, x as re, z as ie } from "./vue.runtime.esm-bundler-f-r9JKaH.js";
2
- import { $ as ae, Bt as oe, G as se, H as ce, Ht as le, J as ue, K as de, Kt as fe, Q as pe, Vt as me, X as M, Y as he, Z as ge, _ as _e, at as N, b as ve, c as P, ct as F, dt as I, et as L, ft as ye, g as be, ht as R, it as xe, l as Se, lt as z, mt as B, n as V, nt as H, o as Ce, ot as U, p as we, pt as Te, q as Ee, qt as De, rt as Oe, st as ke, t as Ae, tt as je, u as Me, ut as W, v as Ne, zt as Pe } from "./urls-BUFldK09.js";
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, H as s, I as c, J as l, K as u, L as d, M as f, O as p, R as m, S as h, T as ee, X as g, Z as _, _ as v, b as y, c as te, et as b, f as x, g as S, h as C, j as w, l as T, m as ne, p as E, r as D, rt as O, u as k, v as A, w as j, x as re, z as ie } from "./vue.runtime.esm-bundler-C8OyVIE3.js";
2
+ import { $ as M, Bt as ae, Gt as oe, Ht as se, J as ce, K as le, Q as ue, Rt as de, U as fe, Ut as pe, Vt as me, Wt as he, X as ge, Y as _e, Yt as ve, Z as N, Zt as ye, _ as be, at as xe, b as Se, c as Ce, ct as P, dt as F, et as we, ft as I, gt as L, h as Te, ht as R, it as Ee, l as De, lt as z, m as Oe, mt as ke, n as Ae, nt as je, o as Me, ot as B, pt as Ne, q as Pe, rt as V, s as Fe, st as H, t as Ie, tt as Le, ut as U, x as Re, y as ze, zt as Be } from "./urls-CVvXdmlR.js";
3
3
  //#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
4
- function Fe(e = {}) {
5
- return new F({ view(t) {
6
- return new Ie(t, e);
4
+ function Ve(e = {}) {
5
+ return new z({ view(t) {
6
+ return new He(t, e);
7
7
  } });
8
8
  }
9
- var Ie = class {
9
+ var He = class {
10
10
  constructor(e, t) {
11
11
  this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = [
12
12
  "dragover",
@@ -82,7 +82,7 @@ var Ie = class {
82
82
  if (t && !i) {
83
83
  let e = t.pos;
84
84
  if (this.editorView.dragging && this.editorView.dragging.slice) {
85
- let t = Te(this.editorView.state.doc, e, this.editorView.dragging.slice);
85
+ let t = ke(this.editorView.state.doc, e, this.editorView.dragging.slice);
86
86
  t != null && (e = t);
87
87
  }
88
88
  this.setCursor(e), this.scheduleRemoval(5e3);
@@ -97,16 +97,16 @@ var Ie = class {
97
97
  dragleave(e) {
98
98
  this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
99
99
  }
100
- }, G = class e extends W {
100
+ }, W = class e extends F {
101
101
  constructor(e) {
102
102
  super(e, e);
103
103
  }
104
104
  map(t, n) {
105
105
  let r = t.resolve(n.map(this.head));
106
- return e.valid(r) ? new e(r) : W.near(r);
106
+ return e.valid(r) ? new e(r) : F.near(r);
107
107
  }
108
108
  content() {
109
- return R.empty;
109
+ return L.empty;
110
110
  }
111
111
  eq(t) {
112
112
  return t instanceof e && t.head == this.head;
@@ -122,11 +122,11 @@ var Ie = class {
122
122
  return new e(t.resolve(n.pos));
123
123
  }
124
124
  getBookmark() {
125
- return new Le(this.anchor);
125
+ return new Ue(this.anchor);
126
126
  }
127
127
  static valid(e) {
128
128
  let t = e.parent;
129
- if (t.inlineContent || !ze(e) || !Be(e)) return !1;
129
+ if (t.inlineContent || !Ge(e) || !Ke(e)) return !1;
130
130
  let n = t.type.spec.allowGapCursor;
131
131
  if (n != null) return n;
132
132
  let r = t.contentMatchAt(e.index()).defaultType;
@@ -149,7 +149,7 @@ var Ie = class {
149
149
  for (;;) {
150
150
  let o = n > 0 ? a.firstChild : a.lastChild;
151
151
  if (!o) {
152
- if (a.isAtom && !a.isText && !ke.isSelectable(a)) {
152
+ if (a.isAtom && !a.isText && !P.isSelectable(a)) {
153
153
  t = t.doc.resolve(i + a.nodeSize * n), r = !1;
154
154
  continue search;
155
155
  }
@@ -163,8 +163,8 @@ var Ie = class {
163
163
  }
164
164
  }
165
165
  };
166
- G.prototype.visible = !1, G.findFrom = G.findGapCursorFrom, W.jsonID("gapcursor", G);
167
- var Le = class e {
166
+ W.prototype.visible = !1, W.findFrom = W.findGapCursorFrom, F.jsonID("gapcursor", W);
167
+ var Ue = class e {
168
168
  constructor(e) {
169
169
  this.pos = e;
170
170
  }
@@ -173,13 +173,13 @@ var Le = class e {
173
173
  }
174
174
  resolve(e) {
175
175
  let t = e.resolve(this.pos);
176
- return G.valid(t) ? new G(t) : W.near(t);
176
+ return W.valid(t) ? new W(t) : F.near(t);
177
177
  }
178
178
  };
179
- function Re(e) {
179
+ function We(e) {
180
180
  return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
181
181
  }
182
- function ze(e) {
182
+ function Ge(e) {
183
183
  for (let t = e.depth; t >= 0; t--) {
184
184
  let n = e.index(t), r = e.node(t);
185
185
  if (n == 0) {
@@ -187,13 +187,13 @@ function ze(e) {
187
187
  continue;
188
188
  }
189
189
  for (let e = r.child(n - 1);; e = e.lastChild) {
190
- if (e.childCount == 0 && !e.inlineContent || Re(e.type)) return !0;
190
+ if (e.childCount == 0 && !e.inlineContent || We(e.type)) return !0;
191
191
  if (e.inlineContent) return !1;
192
192
  }
193
193
  }
194
194
  return !0;
195
195
  }
196
- function Be(e) {
196
+ function Ke(e) {
197
197
  for (let t = e.depth; t >= 0; t--) {
198
198
  let n = e.indexAfter(t), r = e.node(t);
199
199
  if (n == r.childCount) {
@@ -201,30 +201,30 @@ function Be(e) {
201
201
  continue;
202
202
  }
203
203
  for (let e = r.child(n);; e = e.firstChild) {
204
- if (e.childCount == 0 && !e.inlineContent || Re(e.type)) return !0;
204
+ if (e.childCount == 0 && !e.inlineContent || We(e.type)) return !0;
205
205
  if (e.inlineContent) return !1;
206
206
  }
207
207
  }
208
208
  return !0;
209
209
  }
210
- function Ve() {
211
- return new F({ props: {
212
- decorations: Ge,
210
+ function qe() {
211
+ return new z({ props: {
212
+ decorations: Ze,
213
213
  createSelectionBetween(e, t, n) {
214
- return t.pos == n.pos && G.valid(n) ? new G(n) : null;
214
+ return t.pos == n.pos && W.valid(n) ? new W(n) : null;
215
215
  },
216
- handleClick: Ue,
217
- handleKeyDown: He,
218
- handleDOMEvents: { beforeinput: We }
216
+ handleClick: Ye,
217
+ handleKeyDown: Je,
218
+ handleDOMEvents: { beforeinput: Xe }
219
219
  } });
220
220
  }
221
- var He = xe({
222
- ArrowLeft: K("horiz", -1),
223
- ArrowRight: K("horiz", 1),
224
- ArrowUp: K("vert", -1),
225
- ArrowDown: K("vert", 1)
221
+ var Je = xe({
222
+ ArrowLeft: G("horiz", -1),
223
+ ArrowRight: G("horiz", 1),
224
+ ArrowUp: G("vert", -1),
225
+ ArrowDown: G("vert", 1)
226
226
  });
227
- function K(e, t) {
227
+ function G(e, t) {
228
228
  let n = e == "vert" ? t > 0 ? "down" : "up" : t > 0 ? "right" : "left";
229
229
  return function(e, r, i) {
230
230
  let a = e.selection, o = t > 0 ? a.$to : a.$from, s = a.empty;
@@ -232,59 +232,59 @@ function K(e, t) {
232
232
  if (!i.endOfTextblock(n) || o.depth == 0) return !1;
233
233
  s = !1, o = e.doc.resolve(t > 0 ? o.after() : o.before());
234
234
  }
235
- let c = G.findGapCursorFrom(o, t, s);
236
- return c ? (r && r(e.tr.setSelection(new G(c))), !0) : !1;
235
+ let c = W.findGapCursorFrom(o, t, s);
236
+ return c ? (r && r(e.tr.setSelection(new W(c))), !0) : !1;
237
237
  };
238
238
  }
239
- function Ue(e, t, n) {
239
+ function Ye(e, t, n) {
240
240
  if (!e || !e.editable) return !1;
241
241
  let r = e.state.doc.resolve(t);
242
- if (!G.valid(r)) return !1;
242
+ if (!W.valid(r)) return !1;
243
243
  let i = e.posAtCoords({
244
244
  left: n.clientX,
245
245
  top: n.clientY
246
246
  });
247
- return i && i.inside > -1 && ke.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new G(r))), !0);
247
+ return i && i.inside > -1 && P.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new W(r))), !0);
248
248
  }
249
- function We(e, t) {
250
- if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof G)) return !1;
249
+ function Xe(e, t) {
250
+ if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof W)) return !1;
251
251
  let { $from: n } = e.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);
252
252
  if (!r) return !1;
253
- let i = B.empty;
254
- for (let e = r.length - 1; e >= 0; e--) i = B.from(r[e].createAndFill(null, i));
255
- let a = e.state.tr.replace(n.pos, n.pos, new R(i, 0, 0));
253
+ let i = R.empty;
254
+ for (let e = r.length - 1; e >= 0; e--) i = R.from(r[e].createAndFill(null, i));
255
+ let a = e.state.tr.replace(n.pos, n.pos, new L(i, 0, 0));
256
256
  return a.setSelection(I.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
257
257
  }
258
- function Ge(e) {
259
- if (!(e.selection instanceof G)) return null;
258
+ function Ze(e) {
259
+ if (!(e.selection instanceof W)) return null;
260
260
  let t = document.createElement("div");
261
- return t.className = "ProseMirror-gapcursor", U.create(e.doc, [N.widget(e.selection.head, t, { key: "gapcursor" })]);
261
+ return t.className = "ProseMirror-gapcursor", H.create(e.doc, [B.widget(e.selection.head, t, { key: "gapcursor" })]);
262
262
  }
263
263
  //#endregion
264
264
  //#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
265
- var q = 200, J = function() {};
266
- J.prototype.append = function(e) {
267
- return e.length ? (e = J.from(e), !this.length && e || e.length < q && this.leafAppend(e) || this.length < q && e.leafPrepend(this) || this.appendInner(e)) : this;
268
- }, J.prototype.prepend = function(e) {
269
- return e.length ? J.from(e).append(this) : this;
270
- }, J.prototype.appendInner = function(e) {
271
- return new qe(this, e);
272
- }, J.prototype.slice = function(e, t) {
273
- return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? J.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
274
- }, J.prototype.get = function(e) {
265
+ var K = 200, q = function() {};
266
+ q.prototype.append = function(e) {
267
+ return e.length ? (e = q.from(e), !this.length && e || e.length < K && this.leafAppend(e) || this.length < K && e.leafPrepend(this) || this.appendInner(e)) : this;
268
+ }, q.prototype.prepend = function(e) {
269
+ return e.length ? q.from(e).append(this) : this;
270
+ }, q.prototype.appendInner = function(e) {
271
+ return new $e(this, e);
272
+ }, q.prototype.slice = function(e, t) {
273
+ return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? q.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
274
+ }, q.prototype.get = function(e) {
275
275
  if (!(e < 0 || e >= this.length)) return this.getInner(e);
276
- }, J.prototype.forEach = function(e, t, n) {
276
+ }, q.prototype.forEach = function(e, t, n) {
277
277
  t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
278
- }, J.prototype.map = function(e, t, n) {
278
+ }, q.prototype.map = function(e, t, n) {
279
279
  t === void 0 && (t = 0), n === void 0 && (n = this.length);
280
280
  var r = [];
281
281
  return this.forEach(function(t, n) {
282
282
  return r.push(e(t, n));
283
283
  }, t, n), r;
284
- }, J.from = function(e) {
285
- return e instanceof J ? e : e && e.length ? new Ke(e) : J.empty;
284
+ }, q.from = function(e) {
285
+ return e instanceof q ? e : e && e.length ? new Qe(e) : q.empty;
286
286
  };
287
- var Ke = /* @__PURE__ */ function(e) {
287
+ var Qe = /* @__PURE__ */ function(e) {
288
288
  function t(t) {
289
289
  e.call(this), this.values = t;
290
290
  }
@@ -304,17 +304,17 @@ var Ke = /* @__PURE__ */ function(e) {
304
304
  }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
305
305
  for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
306
306
  }, t.prototype.leafAppend = function(e) {
307
- if (this.length + e.length <= q) return new t(this.values.concat(e.flatten()));
307
+ if (this.length + e.length <= K) return new t(this.values.concat(e.flatten()));
308
308
  }, t.prototype.leafPrepend = function(e) {
309
- if (this.length + e.length <= q) return new t(e.flatten().concat(this.values));
309
+ if (this.length + e.length <= K) return new t(e.flatten().concat(this.values));
310
310
  }, n.length.get = function() {
311
311
  return this.values.length;
312
312
  }, n.depth.get = function() {
313
313
  return 0;
314
314
  }, Object.defineProperties(t.prototype, n), t;
315
- }(J);
316
- J.empty = new Ke([]);
317
- var qe = /* @__PURE__ */ function(e) {
315
+ }(q);
316
+ q.empty = new Qe([]);
317
+ var $e = /* @__PURE__ */ function(e) {
318
318
  function t(t, n) {
319
319
  e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
320
320
  }
@@ -341,7 +341,7 @@ var qe = /* @__PURE__ */ function(e) {
341
341
  }, t.prototype.appendInner = function(e) {
342
342
  return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
343
343
  }, t;
344
- }(J), Je = 500, Y = class e {
344
+ }(q), et = 500, J = class e {
345
345
  constructor(e, t) {
346
346
  this.items = e, this.eventCount = t;
347
347
  }
@@ -361,9 +361,9 @@ var qe = /* @__PURE__ */ function(e) {
361
361
  return;
362
362
  }
363
363
  if (i) {
364
- u.push(new X(t.map));
364
+ u.push(new Y(t.map));
365
365
  let e = t.step.map(i.slice(a)), n;
366
- e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new X(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
366
+ e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new Y(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
367
367
  } else o.maybeStep(t.step);
368
368
  if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
369
369
  }, this.items.length, 0), {
@@ -375,21 +375,21 @@ var qe = /* @__PURE__ */ function(e) {
375
375
  addTransform(t, n, r, i) {
376
376
  let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
377
377
  for (let e = 0; e < t.steps.length; e++) {
378
- let r = t.steps[e].invert(t.docs[e]), l = new X(t.mapping.maps[e], r, n), u;
378
+ let r = t.steps[e].invert(t.docs[e]), l = new Y(t.mapping.maps[e], r, n), u;
379
379
  (u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
380
380
  }
381
381
  let l = o - r.depth;
382
- return l > Xe && (s = Ye(s, l), o -= l), new e(s.append(a), o);
382
+ return l > nt && (s = tt(s, l), o -= l), new e(s.append(a), o);
383
383
  }
384
384
  remapping(e, t) {
385
- let n = new ye();
385
+ let n = new Ne();
386
386
  return this.items.forEach((t, r) => {
387
387
  let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
388
388
  n.appendMap(t.map, i);
389
389
  }, e, t), n;
390
390
  }
391
391
  addMaps(t) {
392
- return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new X(e))), this.eventCount);
392
+ return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new Y(e))), this.eventCount);
393
393
  }
394
394
  rebased(t, n) {
395
395
  if (!this.eventCount) return this;
@@ -405,13 +405,13 @@ var qe = /* @__PURE__ */ function(e) {
405
405
  let i = a.maps[n];
406
406
  if (e.step) {
407
407
  let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
408
- l && s++, r.push(new X(i, o, l));
409
- } else r.push(new X(i));
408
+ l && s++, r.push(new Y(i, o, l));
409
+ } else r.push(new Y(i));
410
410
  }, i);
411
411
  let l = [];
412
- for (let e = n; e < o; e++) l.push(new X(a.maps[e]));
412
+ for (let e = n; e < o; e++) l.push(new Y(a.maps[e]));
413
413
  let u = new e(this.items.slice(0, i).append(l).append(r), s);
414
- return u.emptyItemCount() > Je && (u = u.compress(this.items.length - r.length)), u;
414
+ return u.emptyItemCount() > et && (u = u.compress(this.items.length - r.length)), u;
415
415
  }
416
416
  emptyItemCount() {
417
417
  let e = 0;
@@ -428,21 +428,21 @@ var qe = /* @__PURE__ */ function(e) {
428
428
  if (r--, o && n.appendMap(o, r), t) {
429
429
  let s = e.selection && e.selection.map(n.slice(r));
430
430
  s && a++;
431
- let c = new X(o.invert(), t, s), l, u = i.length - 1;
431
+ let c = new Y(o.invert(), t, s), l, u = i.length - 1;
432
432
  (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
433
433
  }
434
434
  } else e.map && r--;
435
- }, this.items.length, 0), new e(J.from(i.reverse()), a);
435
+ }, this.items.length, 0), new e(q.from(i.reverse()), a);
436
436
  }
437
437
  };
438
- Y.empty = new Y(J.empty, 0);
439
- function Ye(e, t) {
438
+ J.empty = new J(q.empty, 0);
439
+ function tt(e, t) {
440
440
  let n;
441
441
  return e.forEach((e, r) => {
442
442
  if (e.selection && t-- == 0) return n = r, !1;
443
443
  }), e.slice(n);
444
444
  }
445
- var X = class e {
445
+ var Y = class e {
446
446
  constructor(e, t, n, r) {
447
447
  this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
448
448
  }
@@ -452,25 +452,25 @@ var X = class e {
452
452
  if (n) return new e(n.getMap().invert(), n, this.selection);
453
453
  }
454
454
  }
455
- }, Z = class {
455
+ }, X = class {
456
456
  constructor(e, t, n, r, i) {
457
457
  this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
458
458
  }
459
- }, Xe = 20;
460
- function Ze(e, t, n, r) {
459
+ }, nt = 20;
460
+ function rt(e, t, n, r) {
461
461
  let i = n.getMeta(Q), a;
462
462
  if (i) return i.historyState;
463
- n.getMeta(at) && (e = new Z(e.done, e.undone, null, 0, -1));
463
+ n.getMeta(ut) && (e = new X(e.done, e.undone, null, 0, -1));
464
464
  let o = n.getMeta("appendedTransaction");
465
465
  if (n.steps.length == 0) return e;
466
- if (o && o.getMeta(Q)) return o.getMeta(Q).redo ? new Z(e.done.addTransform(n, void 0, r, it(t)), e.undone, $e(n.mapping.maps), e.prevTime, e.prevComposition) : new Z(e.done, e.undone.addTransform(n, void 0, r, it(t)), null, e.prevTime, e.prevComposition);
466
+ if (o && o.getMeta(Q)) return o.getMeta(Q).redo ? new X(e.done.addTransform(n, void 0, r, Z(t)), e.undone, at(n.mapping.maps), e.prevTime, e.prevComposition) : new X(e.done, e.undone.addTransform(n, void 0, r, Z(t)), null, e.prevTime, e.prevComposition);
467
467
  if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
468
- let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Qe(n, e.prevRanges)), s = o ? et(e.prevRanges, n.mapping) : $e(n.mapping.maps);
469
- return new Z(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, it(t)), Y.empty, s, n.time, i ?? e.prevComposition);
470
- } else if (a = n.getMeta("rebased")) return new Z(e.done.rebased(n, a), e.undone.rebased(n, a), et(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
471
- else return new Z(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), et(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
468
+ let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !it(n, e.prevRanges)), s = o ? ot(e.prevRanges, n.mapping) : at(n.mapping.maps);
469
+ return new X(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Z(t)), J.empty, s, n.time, i ?? e.prevComposition);
470
+ } else if (a = n.getMeta("rebased")) return new X(e.done.rebased(n, a), e.undone.rebased(n, a), ot(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
471
+ else return new X(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), ot(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
472
472
  }
473
- function Qe(e, t) {
473
+ function it(e, t) {
474
474
  if (!t) return !1;
475
475
  if (!e.docChanged) return !0;
476
476
  let n = !1;
@@ -478,12 +478,12 @@ function Qe(e, t) {
478
478
  for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
479
479
  }), n;
480
480
  }
481
- function $e(e) {
481
+ function at(e) {
482
482
  let t = [];
483
483
  for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
484
484
  return t;
485
485
  }
486
- function et(e, t) {
486
+ function ot(e, t) {
487
487
  if (!e) return null;
488
488
  let n = [];
489
489
  for (let r = 0; r < e.length; r += 2) {
@@ -492,62 +492,62 @@ function et(e, t) {
492
492
  }
493
493
  return n;
494
494
  }
495
- function tt(e, t, n) {
496
- let r = it(t), i = Q.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
495
+ function st(e, t, n) {
496
+ let r = Z(t), i = Q.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
497
497
  if (!a) return null;
498
- let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new Z(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
498
+ let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new X(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
499
499
  return a.transform.setSelection(o).setMeta(Q, {
500
500
  redo: n,
501
501
  historyState: c
502
502
  });
503
503
  }
504
- var nt = !1, rt = null;
505
- function it(e) {
504
+ var ct = !1, lt = null;
505
+ function Z(e) {
506
506
  let t = e.plugins;
507
- if (rt != t) {
508
- nt = !1, rt = t;
507
+ if (lt != t) {
508
+ ct = !1, lt = t;
509
509
  for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
510
- nt = !0;
510
+ ct = !0;
511
511
  break;
512
512
  }
513
513
  }
514
- return nt;
514
+ return ct;
515
515
  }
516
- var Q = new z("history"), at = new z("closeHistory");
517
- function ot(e = {}) {
516
+ var Q = new U("history"), ut = new U("closeHistory");
517
+ function dt(e = {}) {
518
518
  return e = {
519
519
  depth: e.depth || 100,
520
520
  newGroupDelay: e.newGroupDelay || 500
521
- }, new F({
521
+ }, new z({
522
522
  key: Q,
523
523
  state: {
524
524
  init() {
525
- return new Z(Y.empty, Y.empty, null, 0, -1);
525
+ return new X(J.empty, J.empty, null, 0, -1);
526
526
  },
527
527
  apply(t, n, r) {
528
- return Ze(n, r, t, e);
528
+ return rt(n, r, t, e);
529
529
  }
530
530
  },
531
531
  config: e,
532
532
  props: { handleDOMEvents: { beforeinput(e, t) {
533
- let n = t.inputType, r = n == "historyUndo" ? ct : n == "historyRedo" ? lt : null;
533
+ let n = t.inputType, r = n == "historyUndo" ? pt : n == "historyRedo" ? mt : null;
534
534
  return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
535
535
  } } }
536
536
  });
537
537
  }
538
- function st(e, t) {
538
+ function ft(e, t) {
539
539
  return (n, r) => {
540
540
  let i = Q.getState(n);
541
541
  if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
542
542
  if (r) {
543
- let a = tt(i, n, e);
543
+ let a = st(i, n, e);
544
544
  a && r(t ? a.scrollIntoView() : a);
545
545
  }
546
546
  return !0;
547
547
  };
548
548
  }
549
- var ct = st(!1, !0), lt = st(!0, !0);
550
- M.create({
549
+ var pt = ft(!1, !0), mt = ft(!0, !0);
550
+ N.create({
551
551
  name: "characterCount",
552
552
  addOptions() {
553
553
  return {
@@ -579,8 +579,8 @@ M.create({
579
579
  },
580
580
  addProseMirrorPlugins() {
581
581
  let e = !1;
582
- return [new F({
583
- key: new z("characterCount"),
582
+ return [new z({
583
+ key: new U("characterCount"),
584
584
  appendTransaction: (t, n, r) => {
585
585
  if (e) return;
586
586
  let i = this.options.limit, a = this.options.autoTrim;
@@ -608,7 +608,7 @@ M.create({
608
608
  }
609
609
  })];
610
610
  }
611
- }), M.create({
611
+ }), N.create({
612
612
  name: "dropCursor",
613
613
  addOptions() {
614
614
  return {
@@ -618,9 +618,9 @@ M.create({
618
618
  };
619
619
  },
620
620
  addProseMirrorPlugins() {
621
- return [Fe(this.options)];
621
+ return [Ve(this.options)];
622
622
  }
623
- }), M.create({
623
+ }), N.create({
624
624
  name: "focus",
625
625
  addOptions() {
626
626
  return {
@@ -629,11 +629,11 @@ M.create({
629
629
  };
630
630
  },
631
631
  addProseMirrorPlugins() {
632
- return [new F({
633
- key: new z("focus"),
632
+ return [new z({
633
+ key: new U("focus"),
634
634
  props: { decorations: ({ doc: e, selection: t }) => {
635
635
  let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
636
- if (!n || !r) return U.create(e, []);
636
+ if (!n || !r) return H.create(e, []);
637
637
  let o = 0;
638
638
  this.options.mode === "deepest" && e.descendants((e, t) => {
639
639
  if (!e.isText) {
@@ -645,28 +645,28 @@ M.create({
645
645
  return e.descendants((e, t) => {
646
646
  if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
647
647
  if (s += 1, this.options.mode === "deepest" && o - s > 0 || this.options.mode === "shallowest" && s > 1) return this.options.mode === "deepest";
648
- a.push(N.node(t, t + e.nodeSize, { class: this.options.className }));
649
- }), U.create(e, a);
648
+ a.push(B.node(t, t + e.nodeSize, { class: this.options.className }));
649
+ }), H.create(e, a);
650
650
  } }
651
651
  })];
652
652
  }
653
- }), M.create({
653
+ }), N.create({
654
654
  name: "gapCursor",
655
655
  addProseMirrorPlugins() {
656
- return [Ve()];
656
+ return [qe()];
657
657
  },
658
658
  extendNodeSchema(e) {
659
- return { allowGapCursor: pe(L(e, "allowGapCursor", {
659
+ return { allowGapCursor: M(Le(e, "allowGapCursor", {
660
660
  name: e.name,
661
661
  options: e.options,
662
662
  storage: e.storage
663
663
  })) ?? null };
664
664
  }
665
665
  });
666
- var ut = "placeholder", $ = new z("tiptap__placeholder"), dt = 200;
667
- function ft(e) {
666
+ var ht = "placeholder", $ = new U("tiptap__placeholder"), gt = 200;
667
+ function _t(e) {
668
668
  let { editor: t, placeholder: n, dataAttribute: r, pos: i, node: a, isEmptyDoc: o, hasAnchor: s, classes: { emptyNode: c, emptyEditor: l } } = e, u = [c];
669
- return o && u.push(l), N.node(i, i + a.nodeSize, {
669
+ return o && u.push(l), B.node(i, i + a.nodeSize, {
670
670
  class: u.join(" "),
671
671
  [r]: typeof n == "function" ? n({
672
672
  editor: t,
@@ -676,17 +676,17 @@ function ft(e) {
676
676
  }) : n
677
677
  });
678
678
  }
679
- function pt(e, t) {
679
+ function vt(e, t) {
680
680
  return typeof e == "function" ? e(t) : e;
681
681
  }
682
- function mt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
682
+ function yt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
683
683
  if (!(e.isEditable || !t.showOnlyWhenEditable)) return null;
684
684
  let { anchor: a } = i, o = [], s = e.isEmpty;
685
685
  if (t.showOnlyCurrent && !t.includeChildren) {
686
686
  let i = r.resolve(a), c = i.depth > 0 ? i.node(1) : i.nodeAfter, l = i.depth > 0 ? i.before(1) : a;
687
687
  if (c && c.type.isTextblock && je(c)) {
688
688
  let r = a >= l && a <= l + c.nodeSize;
689
- o.push(ft({
689
+ o.push(_t({
690
690
  editor: e,
691
691
  isEmptyDoc: s,
692
692
  dataAttribute: n,
@@ -694,7 +694,7 @@ function mt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
694
694
  placeholder: t.placeholder,
695
695
  classes: {
696
696
  emptyEditor: t.emptyEditorClass,
697
- emptyNode: pt(t.emptyNodeClass, {
697
+ emptyNode: vt(t.emptyNodeClass, {
698
698
  editor: e,
699
699
  node: c,
700
700
  pos: l,
@@ -709,7 +709,7 @@ function mt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
709
709
  let i = $.getState(e.state), c = i?.topPos ?? 0, l = i?.bottomPos ?? r.content.size;
710
710
  r.nodesBetween(c, l, (r, i) => {
711
711
  let c = a >= i && a <= i + r.nodeSize, l = !r.isLeaf && je(r);
712
- return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(ft({
712
+ return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(_t({
713
713
  editor: e,
714
714
  isEmptyDoc: s,
715
715
  dataAttribute: n,
@@ -717,7 +717,7 @@ function mt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
717
717
  placeholder: t.placeholder,
718
718
  classes: {
719
719
  emptyEditor: t.emptyEditorClass,
720
- emptyNode: pt(t.emptyNodeClass, {
720
+ emptyNode: vt(t.emptyNodeClass, {
721
721
  editor: e,
722
722
  node: r,
723
723
  pos: i,
@@ -729,19 +729,19 @@ function mt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
729
729
  })), t.includeChildren;
730
730
  });
731
731
  }
732
- return U.create(r, o);
732
+ return H.create(r, o);
733
733
  }
734
- function ht(e) {
734
+ function bt(e) {
735
735
  return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
736
736
  }
737
- function gt(e) {
737
+ function xt(e) {
738
738
  let t = getComputedStyle(e), n = `${t.overflow} ${t.overflowY} ${t.overflowX}`;
739
739
  return /auto|scroll|overlay/.test(n);
740
740
  }
741
- function _t(e) {
741
+ function St(e) {
742
742
  let t = e;
743
743
  for (; t;) {
744
- if (gt(t)) return t;
744
+ if (xt(t)) return t;
745
745
  let e = t.parentElement;
746
746
  if (!e) {
747
747
  let e = t.getRootNode();
@@ -755,19 +755,19 @@ function _t(e) {
755
755
  }
756
756
  return window;
757
757
  }
758
- function vt(e) {
758
+ function Ct(e) {
759
759
  return e === window ? {
760
760
  top: 0,
761
761
  bottom: window.innerHeight
762
762
  } : e.getBoundingClientRect();
763
763
  }
764
- function yt({ view: e, scrollContainer: t }) {
764
+ function wt({ view: e, scrollContainer: t }) {
765
765
  let n = e.dom.getBoundingClientRect();
766
766
  if (n.width <= 0 || n.height <= 0) return null;
767
- let r = t ? vt(t) : {
767
+ let r = t ? Ct(t) : {
768
768
  top: 0,
769
769
  bottom: window.innerHeight
770
- }, i = Math.max(n.top, r.top) - dt, a = Math.min(n.bottom, r.bottom) + dt;
770
+ }, i = Math.max(n.top, r.top) - gt, a = Math.min(n.bottom, r.bottom) + gt;
771
771
  if (i >= a) return null;
772
772
  let o = n.left + 1, s = n.right - 1;
773
773
  if (o > s) return null;
@@ -785,7 +785,7 @@ function yt({ view: e, scrollContainer: t }) {
785
785
  bottom: p.pos
786
786
  };
787
787
  }
788
- var bt = {
788
+ var Tt = {
789
789
  init() {
790
790
  return {
791
791
  topPos: null,
@@ -803,9 +803,9 @@ var bt = {
803
803
  } : t;
804
804
  }
805
805
  };
806
- function xt(e) {
807
- let t = _t(e.dom), n = () => {
808
- let n = yt({
806
+ function Et(e) {
807
+ let t = St(e.dom), n = () => {
808
+ let n = wt({
809
809
  view: e,
810
810
  scrollContainer: t
811
811
  });
@@ -834,13 +834,13 @@ function xt(e) {
834
834
  }
835
835
  };
836
836
  }
837
- function St({ editor: e, options: t }) {
838
- let n = t.dataAttribute ? `data-${ht(t.dataAttribute)}` : `data-${ut}`;
839
- return new F({
837
+ function Dt({ editor: e, options: t }) {
838
+ let n = t.dataAttribute ? `data-${bt(t.dataAttribute)}` : `data-${ht}`;
839
+ return new z({
840
840
  key: $,
841
- state: bt,
842
- view: xt,
843
- props: { decorations: ({ doc: r, selection: i }) => mt({
841
+ state: Tt,
842
+ view: Et,
843
+ props: { decorations: ({ doc: r, selection: i }) => yt({
844
844
  editor: e,
845
845
  options: t,
846
846
  dataAttribute: n,
@@ -849,13 +849,13 @@ function St({ editor: e, options: t }) {
849
849
  }) }
850
850
  });
851
851
  }
852
- var Ct = M.create({
852
+ var Ot = N.create({
853
853
  name: "placeholder",
854
854
  addOptions() {
855
855
  return {
856
856
  emptyEditorClass: "is-editor-empty",
857
857
  emptyNodeClass: "is-empty",
858
- dataAttribute: ut,
858
+ dataAttribute: ht,
859
859
  placeholder: "Write something …",
860
860
  showOnlyWhenEditable: !0,
861
861
  showOnlyCurrent: !0,
@@ -863,31 +863,31 @@ var Ct = M.create({
863
863
  };
864
864
  },
865
865
  addProseMirrorPlugins() {
866
- return [St({
866
+ return [Dt({
867
867
  editor: this.editor,
868
868
  options: this.options
869
869
  })];
870
870
  }
871
- }), wt = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
872
- M.create({
871
+ }), kt = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
872
+ N.create({
873
873
  name: "selection",
874
874
  addOptions() {
875
875
  return { className: "selection" };
876
876
  },
877
877
  addProseMirrorPlugins() {
878
878
  let { editor: e, options: t } = this;
879
- return e.options.injectCSS && typeof document < "u" && ae(wt, e.options.injectNonce, "selection"), [new F({
880
- key: new z("selection"),
879
+ return e.options.injectCSS && typeof document < "u" && we(kt, e.options.injectNonce, "selection"), [new z({
880
+ key: new U("selection"),
881
881
  props: { decorations(n) {
882
- return n.selection.empty || e.isFocused || !e.isEditable || H(n.selection) || e.view.dragging ? null : U.create(n.doc, [N.inline(n.selection.from, n.selection.to, { class: t.className })]);
882
+ return n.selection.empty || e.isFocused || !e.isEditable || V(n.selection) || e.view.dragging ? null : H.create(n.doc, [B.inline(n.selection.from, n.selection.to, { class: t.className })]);
883
883
  } }
884
884
  })];
885
885
  }
886
886
  });
887
- function Tt({ types: e, node: t }) {
887
+ function At({ types: e, node: t }) {
888
888
  return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
889
889
  }
890
- M.create({
890
+ N.create({
891
891
  name: "trailingNode",
892
892
  addOptions() {
893
893
  return {
@@ -896,8 +896,8 @@ M.create({
896
896
  };
897
897
  },
898
898
  addProseMirrorPlugins() {
899
- let e = new z(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
900
- return [new F({
899
+ let e = new U(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
900
+ return [new z({
901
901
  key: e,
902
902
  appendTransaction: (n, r, i) => {
903
903
  let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
@@ -906,7 +906,7 @@ M.create({
906
906
  state: {
907
907
  init: (e, t) => {
908
908
  let r = t.tr.doc.lastChild;
909
- return !Tt({
909
+ return !At({
910
910
  node: r,
911
911
  types: n
912
912
  });
@@ -914,7 +914,7 @@ M.create({
914
914
  apply: (e, t) => {
915
915
  if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
916
916
  let r = e.doc.lastChild;
917
- return !Tt({
917
+ return !At({
918
918
  node: r,
919
919
  types: n
920
920
  });
@@ -923,7 +923,7 @@ M.create({
923
923
  })];
924
924
  }
925
925
  });
926
- var Et = M.create({
926
+ var jt = N.create({
927
927
  name: "undoRedo",
928
928
  addOptions() {
929
929
  return {
@@ -933,12 +933,12 @@ var Et = M.create({
933
933
  },
934
934
  addCommands() {
935
935
  return {
936
- undo: () => ({ state: e, dispatch: t }) => ct(e, t),
937
- redo: () => ({ state: e, dispatch: t }) => lt(e, t)
936
+ undo: () => ({ state: e, dispatch: t }) => pt(e, t),
937
+ redo: () => ({ state: e, dispatch: t }) => mt(e, t)
938
938
  };
939
939
  },
940
940
  addProseMirrorPlugins() {
941
- return [ot(this.options)];
941
+ return [dt(this.options)];
942
942
  },
943
943
  addKeyboardShortcuts() {
944
944
  return {
@@ -952,7 +952,7 @@ var Et = M.create({
952
952
  });
953
953
  //#endregion
954
954
  //#region ../../node_modules/.pnpm/@tiptap+vue-3@3.27.1_@floating-ui+dom@1.7.6_@tiptap+core@3.27.1_@tiptap+pm@3.27.1__@tip_533afe27a0e41f53f3674ff5bfd0331c/node_modules/@tiptap/vue-3/dist/index.js
955
- function Dt(e) {
955
+ function Mt(e) {
956
956
  return s((t, n) => ({
957
957
  get() {
958
958
  return t(), e;
@@ -966,9 +966,9 @@ function Dt(e) {
966
966
  }
967
967
  }));
968
968
  }
969
- var Ot = class extends he {
969
+ var Nt = class extends ge {
970
970
  constructor(e = {}) {
971
- return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = Dt(this.view.state), this.reactiveExtensionStorage = Dt(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
971
+ return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = Mt(this.view.state), this.reactiveExtensionStorage = Mt(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
972
972
  this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
973
973
  }), u(this);
974
974
  }
@@ -986,36 +986,36 @@ var Ot = class extends he {
986
986
  let t = super.unregisterPlugin(e);
987
987
  return this.reactiveState && t && (this.reactiveState.value = t), t;
988
988
  }
989
- }, kt = b({
989
+ }, Pt = y({
990
990
  name: "EditorContent",
991
991
  props: { editor: {
992
992
  default: null,
993
993
  type: Object
994
994
  } },
995
- setup(e) {
996
- let t = _(), n = re();
995
+ setup(t) {
996
+ let n = g(), r = re();
997
997
  return ie(() => {
998
- let r = e.editor;
999
- r && r.options.element && t.value && a(() => {
1000
- if (!t.value || !r.view.dom?.parentNode) return;
1001
- let e = m(t.value);
1002
- t.value.append(...r.view.dom.parentNode.childNodes), r.contentComponent = n.ctx._, n && (r.appContext = {
1003
- ...n.appContext,
1004
- provides: n.provides
1005
- }), r.setOptions({ element: e }), r.createNodeViews();
998
+ let i = t.editor;
999
+ i && i.options.element && n.value && a(() => {
1000
+ if (!n.value || !i.view.dom?.parentNode) return;
1001
+ let t = e(n.value);
1002
+ n.value.append(...i.view.dom.parentNode.childNodes), i.contentComponent = r.ctx._, r && (i.appContext = {
1003
+ ...r.appContext,
1004
+ provides: r.provides
1005
+ }), i.setOptions({ element: t }), i.createNodeViews();
1006
1006
  });
1007
1007
  }), i(() => {
1008
- let t = e.editor;
1009
- t && (t.contentComponent = null, t.appContext = null);
1010
- }), { rootEl: t };
1008
+ let e = t.editor;
1009
+ e && (e.contentComponent = null, e.appContext = null);
1010
+ }), { rootEl: n };
1011
1011
  },
1012
1012
  render() {
1013
- return g("div", { ref: (e) => {
1013
+ return h("div", { ref: (e) => {
1014
1014
  this.rootEl = e;
1015
1015
  } });
1016
1016
  }
1017
1017
  });
1018
- b({
1018
+ y({
1019
1019
  name: "NodeViewContent",
1020
1020
  props: { as: {
1021
1021
  type: String,
@@ -1031,13 +1031,13 @@ b({
1031
1031
  e && e(null);
1032
1032
  },
1033
1033
  render() {
1034
- return g(this.as, {
1034
+ return h(this.as, {
1035
1035
  style: { whiteSpace: "pre-wrap" },
1036
1036
  "data-node-view-content": ""
1037
1037
  });
1038
1038
  }
1039
1039
  });
1040
- var At = b({
1040
+ var Ft = y({
1041
1041
  name: "NodeViewWrapper",
1042
1042
  props: { as: {
1043
1043
  type: String,
@@ -1046,22 +1046,22 @@ var At = b({
1046
1046
  inject: ["onDragStart", "decorationClasses"],
1047
1047
  render() {
1048
1048
  var e;
1049
- return g(this.as, {
1049
+ return h(this.as, {
1050
1050
  class: this.decorationClasses,
1051
1051
  style: { whiteSpace: "normal" },
1052
1052
  "data-node-view-wrapper": "",
1053
1053
  onDragstart: this.onDragStart
1054
1054
  }, (e = this.$slots).default?.call(e));
1055
1055
  }
1056
- }), jt = (e = {}) => {
1057
- let t = v();
1056
+ }), It = (e = {}) => {
1057
+ let t = _();
1058
1058
  return p(() => {
1059
- t.value = new Ot(e);
1059
+ t.value = new Nt(e);
1060
1060
  }), i(() => {
1061
1061
  var e;
1062
1062
  (e = t.value) == null || e.destroy();
1063
1063
  }), t;
1064
- }, Mt = class {
1064
+ }, Lt = class {
1065
1065
  constructor(e, { props: t = {}, editor: n }) {
1066
1066
  this.destroyed = !1, this.editor = n, this.component = u(e), this.el = document.createElement("div"), this.props = l(t), this.renderedComponent = this.renderComponent();
1067
1067
  }
@@ -1073,11 +1073,11 @@ var At = b({
1073
1073
  }
1074
1074
  renderComponent() {
1075
1075
  if (this.destroyed) return this.renderedComponent;
1076
- let e = g(this.component, this.props);
1077
- return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && O(e, this.el), {
1076
+ let e = h(this.component, this.props);
1077
+ return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && D(e, this.el), {
1078
1078
  vNode: e,
1079
1079
  destroy: () => {
1080
- this.el && O(null, this.el), this.el = null, e = null;
1080
+ this.el && D(null, this.el), this.el = null, e = null;
1081
1081
  },
1082
1082
  el: this.el ? this.el.firstElementChild : null
1083
1083
  };
@@ -1091,20 +1091,20 @@ var At = b({
1091
1091
  this.destroyed || (this.destroyed = !0, this.renderedComponent.destroy());
1092
1092
  }
1093
1093
  };
1094
- b({
1094
+ y({
1095
1095
  name: "MarkViewContent",
1096
1096
  props: { as: {
1097
1097
  type: String,
1098
1098
  default: "span"
1099
1099
  } },
1100
1100
  render() {
1101
- return g(this.as, {
1101
+ return h(this.as, {
1102
1102
  style: { whiteSpace: "inherit" },
1103
1103
  "data-mark-view-content": ""
1104
1104
  });
1105
1105
  }
1106
1106
  });
1107
- var Nt = {
1107
+ var Rt = {
1108
1108
  editor: {
1109
1109
  type: Object,
1110
1110
  required: !0
@@ -1149,7 +1149,7 @@ var Nt = {
1149
1149
  type: Object,
1150
1150
  required: !0
1151
1151
  }
1152
- }, Pt = class extends ge {
1152
+ }, zt = class extends ue {
1153
1153
  constructor(e, t, n) {
1154
1154
  super(e, t, n), this.cachedExtensionWithSyncedStorage = null, this.handlePositionUpdate = () => {
1155
1155
  let e = this.getPos();
@@ -1179,8 +1179,8 @@ var Nt = {
1179
1179
  updateAttributes: (e = {}) => this.updateAttributes(e),
1180
1180
  deleteNode: () => this.deleteNode()
1181
1181
  }, t = e, n = this.onDragStart.bind(this);
1182
- this.decorationClasses = _(this.getDecorationClasses());
1183
- let r = b({
1182
+ this.decorationClasses = g(this.getDecorationClasses());
1183
+ let r = y({
1184
1184
  extends: { ...this.component },
1185
1185
  props: Object.keys(e),
1186
1186
  template: this.component.template,
@@ -1195,7 +1195,7 @@ var Nt = {
1195
1195
  __name: this.component.__name,
1196
1196
  __file: this.component.__file
1197
1197
  });
1198
- this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.currentPos = this.getPos(), this.node.isLeaf || (this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement.style.whiteSpace = "inherit", this.contentDOMElement.dataset.nodeViewContentVue = ""), this.renderer = new Mt(r, {
1198
+ this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.currentPos = this.getPos(), this.node.isLeaf || (this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement.style.whiteSpace = "inherit", this.contentDOMElement.dataset.nodeViewContentVue = ""), this.renderer = new Lt(r, {
1199
1199
  editor: this.editor,
1200
1200
  props: t
1201
1201
  });
@@ -1209,7 +1209,7 @@ var Nt = {
1209
1209
  }
1210
1210
  handleSelectionUpdate() {
1211
1211
  let e = this.getPos();
1212
- if (typeof e == "number") if (Oe({
1212
+ if (typeof e == "number") if (Ee({
1213
1213
  selection: this.editor.state.selection,
1214
1214
  pos: e,
1215
1215
  nodeSize: this.node.nodeSize,
@@ -1267,112 +1267,112 @@ var Nt = {
1267
1267
  this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.options.trackNodeViewPosition && this.editor.off("update", this.handlePositionUpdate), this.contentDOMElement = null;
1268
1268
  }
1269
1269
  };
1270
- function Ft(e, t) {
1271
- return (n) => n.editor.contentComponent ? new Pt(typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e, n, t) : {};
1270
+ function Bt(e, t) {
1271
+ return (n) => n.editor.contentComponent ? new zt(typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e, n, t) : {};
1272
1272
  }
1273
1273
  //#endregion
1274
1274
  //#region src/components/MergeTagPicker.vue?vue&type=script&setup=true&lang.ts
1275
- var It = [
1275
+ var Vt = [
1276
1276
  "title",
1277
1277
  "aria-label",
1278
1278
  "popovertarget",
1279
1279
  "aria-expanded"
1280
- ], Lt = ["id", "aria-label"], Rt = {
1280
+ ], Ht = ["id", "aria-label"], Ut = {
1281
1281
  key: 0,
1282
1282
  class: "merge-tag-list"
1283
- }, zt = ["onClick"], Bt = { class: "merge-tag-option-label" }, Vt = { class: "merge-tag-option-id" }, Ht = {
1283
+ }, Wt = ["onClick"], Gt = { class: "merge-tag-option-label" }, Kt = { class: "merge-tag-option-id" }, qt = {
1284
1284
  key: 1,
1285
1285
  class: "merge-tag-empty"
1286
- }, Ut = /*#__PURE__*/ Ne(/* @__PURE__ */ b({
1286
+ }, Jt = /*#__PURE__*/ Re(/* @__PURE__ */ y({
1287
1287
  __name: "MergeTagPicker",
1288
1288
  emits: ["select"],
1289
1289
  setup(n, { emit: i }) {
1290
- let s = i, { t: c, locale: l } = be(), u = r(P, x(() => ({}))), p = x(() => Object.keys(u.value).map((e) => ({
1290
+ let s = i, { t: c, locale: l } = ze(), u = r(Oe, x(() => ({}))), p = x(() => Object.keys(u.value).map((e) => ({
1291
1291
  id: e,
1292
- label: V(u.value, e, l.value)
1293
- }))), h = _(""), g = x(() => {
1294
- let e = h.value.trim().toLowerCase();
1292
+ label: Ae(u.value, e, l.value)
1293
+ }))), m = g(""), h = x(() => {
1294
+ let e = m.value.trim().toLowerCase();
1295
1295
  return e ? p.value.filter((t) => t.label.toLowerCase().includes(e) || t.id.toLowerCase().includes(e)) : p.value;
1296
- }), ee = o(), v = x(() => b.value?.matches(":popover-open") ?? !1), y = d("trigger"), b = d("popover"), te = d("filterInput");
1296
+ }), ee = o(), _ = x(() => y.value?.matches(":popover-open") ?? !1), v = d("trigger"), y = d("popover"), te = d("filterInput");
1297
1297
  function w(e) {
1298
1298
  if (e.newState !== "open") return;
1299
- h.value = "";
1300
- let t = b.value, n = y.value?.getBoundingClientRect();
1299
+ m.value = "";
1300
+ let t = y.value, n = v.value?.getBoundingClientRect();
1301
1301
  t && n && (t.style.left = `${n.left}px`, t.style.top = `${n.bottom + 4}px`);
1302
1302
  }
1303
1303
  function ne(e) {
1304
1304
  e.newState === "open" && a(() => te.value?.focus());
1305
1305
  }
1306
- function O(e) {
1307
- let t = e.relatedTarget, n = b.value;
1306
+ function D(e) {
1307
+ let t = e.relatedTarget, n = y.value;
1308
1308
  t instanceof Node && n?.contains(t) || n?.matches(":popover-open") && n.hidePopover();
1309
1309
  }
1310
1310
  function j(e) {
1311
- s("select", e), b.value?.hidePopover();
1311
+ s("select", e), y.value?.hidePopover();
1312
1312
  }
1313
1313
  return (n, r) => (t(), S(k, null, [p.value.length ? (t(), S("button", {
1314
1314
  key: 0,
1315
1315
  ref_key: "trigger",
1316
- ref: y,
1316
+ ref: v,
1317
1317
  type: "button",
1318
- class: e(["merge-tag-trigger", { active: v.value }]),
1319
- title: m(c)("blocks.text.mergeTag"),
1320
- "aria-label": m(c)("blocks.text.mergeTag"),
1321
- popovertarget: m(ee),
1318
+ class: b(["merge-tag-trigger", { active: _.value }]),
1319
+ title: e(c)("blocks.text.mergeTag"),
1320
+ "aria-label": e(c)("blocks.text.mergeTag"),
1321
+ popovertarget: e(ee),
1322
1322
  "aria-haspopup": "dialog",
1323
- "aria-expanded": v.value,
1323
+ "aria-expanded": _.value,
1324
1324
  onMousedown: r[0] ||= T(() => {}, ["prevent"])
1325
- }, [A(_e, {
1325
+ }, [A(Se, {
1326
1326
  name: "braces",
1327
1327
  size: 16
1328
- })], 42, It)) : C("", !0), p.value.length ? (t(), S("div", {
1328
+ })], 42, Vt)) : C("", !0), p.value.length ? (t(), S("div", {
1329
1329
  key: 1,
1330
- id: m(ee),
1330
+ id: e(ee),
1331
1331
  ref_key: "popover",
1332
- ref: b,
1332
+ ref: y,
1333
1333
  class: "merge-tag-popover",
1334
1334
  popover: "",
1335
1335
  role: "dialog",
1336
- "aria-label": m(c)("blocks.text.mergeTag"),
1336
+ "aria-label": e(c)("blocks.text.mergeTag"),
1337
1337
  onBeforetoggle: w,
1338
1338
  onToggle: ne,
1339
- onFocusout: O
1340
- }, [A(Me, {
1339
+ onFocusout: D
1340
+ }, [A(De, {
1341
1341
  ref_key: "filterInput",
1342
1342
  ref: te,
1343
- modelValue: h.value,
1344
- "onUpdate:modelValue": r[1] ||= (e) => h.value = e,
1343
+ modelValue: m.value,
1344
+ "onUpdate:modelValue": r[1] ||= (e) => m.value = e,
1345
1345
  autocomplete: "off",
1346
- placeholder: m(c)("blocks.text.mergeTagSearch"),
1347
- "aria-label": m(c)("blocks.text.mergeTagSearch"),
1346
+ placeholder: e(c)("blocks.text.mergeTagSearch"),
1347
+ "aria-label": e(c)("blocks.text.mergeTagSearch"),
1348
1348
  size: "compact",
1349
1349
  spellcheck: "false"
1350
1350
  }, null, 8, [
1351
1351
  "modelValue",
1352
1352
  "placeholder",
1353
1353
  "aria-label"
1354
- ]), g.value.length ? (t(), S("ul", Rt, [(t(!0), S(k, null, f(g.value, (e) => (t(), S("li", { key: e.id }, [D("button", {
1354
+ ]), h.value.length ? (t(), S("ul", Ut, [(t(!0), S(k, null, f(h.value, (e) => (t(), S("li", { key: e.id }, [E("button", {
1355
1355
  type: "button",
1356
1356
  class: "merge-tag-option",
1357
1357
  onClick: (t) => j(e.id),
1358
1358
  onMousedown: r[2] ||= T(() => {}, ["prevent"])
1359
- }, [D("span", Bt, E(e.label), 1), D("span", Vt, E(e.id), 1)], 40, zt)]))), 128))])) : (t(), S("p", Ht, E(m(c)("blocks.text.mergeTagEmpty")), 1))], 40, Lt)) : C("", !0)], 64));
1359
+ }, [E("span", Gt, O(e.label), 1), E("span", Kt, O(e.id), 1)], 40, Wt)]))), 128))])) : (t(), S("p", qt, O(e(c)("blocks.text.mergeTagEmpty")), 1))], 40, Ht)) : C("", !0)], 64));
1360
1360
  }
1361
- }), [["styles", [".merge-tag-trigger[data-v-847c7f49]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;min-width:1.8em;height:1.8em;padding:0;display:inline-flex}.merge-tag-trigger[data-v-847c7f49]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}.merge-tag-trigger.active[data-v-847c7f49]{background:var(--bygga-color-selected,var(--bygga-color-track));color:var(--bygga-color-selected-text,var(--bygga-color-accent));forced-color-adjust:none}.merge-tag-popover[data-v-847c7f49]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);box-sizing:border-box;flex-direction:column;gap:.35em;width:15em;margin:0;padding:.4em;position:fixed;inset:auto}.merge-tag-popover[data-v-847c7f49]:popover-open{display:flex}.merge-tag-list[data-v-847c7f49]{flex-direction:column;gap:.15em;max-height:14em;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.merge-tag-option[data-v-847c7f49]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text);cursor:pointer;text-align:start;background:0 0;border:none;justify-content:space-between;align-items:baseline;gap:.5em;width:100%;padding:.35em .5em;display:flex}.merge-tag-option[data-v-847c7f49]:hover,.merge-tag-option[data-v-847c7f49]:focus-visible{background:var(--bygga-color-track);color:var(--bygga-color-accent);outline:none}.merge-tag-option-id[data-v-847c7f49]{color:var(--bygga-color-text-muted);font-variant-numeric:tabular-nums;font-size:.85em}.merge-tag-empty[data-v-847c7f49]{color:var(--bygga-color-text-muted);margin:0;padding:.35em .5em}"]], ["__scopeId", "data-v-847c7f49"]]), Wt = /* @__PURE__ */ b({
1361
+ }), [["styles", [".merge-tag-trigger[data-v-847c7f49]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;min-width:1.8em;height:1.8em;padding:0;display:inline-flex}.merge-tag-trigger[data-v-847c7f49]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}.merge-tag-trigger.active[data-v-847c7f49]{background:var(--bygga-color-selected,var(--bygga-color-track));color:var(--bygga-color-selected-text,var(--bygga-color-accent));forced-color-adjust:none}.merge-tag-popover[data-v-847c7f49]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);box-sizing:border-box;flex-direction:column;gap:.35em;width:15em;margin:0;padding:.4em;position:fixed;inset:auto}.merge-tag-popover[data-v-847c7f49]:popover-open{display:flex}.merge-tag-list[data-v-847c7f49]{flex-direction:column;gap:.15em;max-height:14em;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.merge-tag-option[data-v-847c7f49]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text);cursor:pointer;text-align:start;background:0 0;border:none;justify-content:space-between;align-items:baseline;gap:.5em;width:100%;padding:.35em .5em;display:flex}.merge-tag-option[data-v-847c7f49]:hover,.merge-tag-option[data-v-847c7f49]:focus-visible{background:var(--bygga-color-track);color:var(--bygga-color-accent);outline:none}.merge-tag-option-id[data-v-847c7f49]{color:var(--bygga-color-text-muted);font-variant-numeric:tabular-nums;font-size:.85em}.merge-tag-empty[data-v-847c7f49]{color:var(--bygga-color-text-muted);margin:0;padding:.35em .5em}"]], ["__scopeId", "data-v-847c7f49"]]), Yt = /* @__PURE__ */ y({
1362
1362
  __name: "MergeTagView",
1363
- props: Nt,
1363
+ props: Rt,
1364
1364
  setup(i) {
1365
- let a = i, { t: o, locale: s } = be(), c = r(P, x(() => ({}))), l = x(() => String(a.node.attrs.id ?? "")), u = x(() => c.value[l.value] !== void 0), d = x(() => V(c.value, l.value, s.value)), f = x(() => o("blocks.text.mergeTagChip", { name: d.value }));
1366
- return (r, i) => (t(), ne(m(At), {
1365
+ let a = i, { t: o, locale: s } = ze(), c = r(Oe, x(() => ({}))), l = x(() => String(a.node.attrs.id ?? "")), u = x(() => c.value[l.value] !== void 0), d = x(() => Ae(c.value, l.value, s.value)), f = x(() => o("blocks.text.mergeTagChip", { name: d.value }));
1366
+ return (r, i) => (t(), ne(e(Ft), {
1367
1367
  as: "span",
1368
- class: e(["merge-tag", { "is-unknown": !u.value }]),
1368
+ class: b(["merge-tag", { "is-unknown": !u.value }]),
1369
1369
  "data-merge-tag": l.value,
1370
1370
  contenteditable: "false",
1371
1371
  role: "img",
1372
1372
  "aria-label": f.value,
1373
1373
  title: f.value
1374
1374
  }, {
1375
- default: n(() => [y(E(d.value), 1)]),
1375
+ default: n(() => [v(O(d.value), 1)]),
1376
1376
  _: 1
1377
1377
  }, 8, [
1378
1378
  "class",
@@ -1381,74 +1381,71 @@ var It = [
1381
1381
  "title"
1382
1382
  ]));
1383
1383
  }
1384
- }), Gt = "textStyle";
1385
- function Kt(e) {
1386
- return e.replace(/["']/g, "").replace(/\s+/g, " ").trim().toLowerCase();
1384
+ }), Xt = "textStyle";
1385
+ function Zt(e) {
1386
+ let t = se(e);
1387
+ return !t || t.key === "verdana" ? null : t.stack;
1387
1388
  }
1388
- var qt = /* @__PURE__ */ new Map([[Kt(ve), ve]]);
1389
- function Jt(e) {
1390
- if (e.type.name !== Gt) return e;
1389
+ function Qt(e) {
1390
+ if (e.type.name !== Xt) return e;
1391
1391
  let { fontFamily: t } = e.attrs;
1392
- if (t === null) return e;
1393
- let n = qt.get(Kt(t));
1394
- if (n !== void 0) return n === t ? e : e.type.create({
1395
- ...e.attrs,
1396
- fontFamily: n
1397
- });
1392
+ if (typeof t != "string") return e;
1393
+ let n = Zt(t);
1394
+ if (n === t) return e;
1398
1395
  let r = {
1399
1396
  ...e.attrs,
1400
- fontFamily: null
1397
+ fontFamily: n
1401
1398
  };
1402
- return Object.entries(r).some(([e, t]) => e !== "fontFamily" && t !== null) ? e.type.create(r) : void 0;
1399
+ return n === null ? Object.entries(r).some(([e, t]) => e !== "fontFamily" && t !== null) ? e.type.create(r) : void 0 : e.type.create(r);
1403
1400
  }
1404
- function Yt(e) {
1401
+ function $t(e) {
1405
1402
  return e.flatMap((e) => {
1406
- let t = Jt(e);
1403
+ let t = Qt(e);
1407
1404
  return t ? [t] : [];
1408
1405
  });
1409
1406
  }
1410
- function Xt(e) {
1411
- return e.isText ? e.mark(Yt(e.marks)) : e.copy(Zt(e.content)).mark(Yt(e.marks));
1407
+ function en(e) {
1408
+ return e.isText ? e.mark($t(e.marks)) : e.copy(tn(e.content)).mark($t(e.marks));
1412
1409
  }
1413
- function Zt(e) {
1410
+ function tn(e) {
1414
1411
  let t = [];
1415
- for (let n = 0; n < e.childCount; n++) t.push(Xt(e.child(n)));
1416
- return B.fromArray(t);
1412
+ for (let n = 0; n < e.childCount; n++) t.push(en(e.child(n)));
1413
+ return R.fromArray(t);
1417
1414
  }
1418
- function Qt(e) {
1419
- return new R(Zt(e.content), e.openStart, e.openEnd);
1415
+ function nn(e) {
1416
+ return new L(tn(e.content), e.openStart, e.openEnd);
1420
1417
  }
1421
1418
  //#endregion
1422
1419
  //#region src/panels/contentPanel/components/blocks/TextEditor.vue?vue&type=script&setup=true&lang.ts
1423
- var $t = ["aria-label", "value"], en = { value: "paragraph" }, tn = ["value"], nn = ["aria-label", "value"], rn = {
1420
+ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], sn = ["aria-label", "value"], cn = {
1424
1421
  value: "mixed",
1425
1422
  disabled: "",
1426
1423
  hidden: ""
1427
- }, an = { value: "sans" }, on = { value: "serif" }, sn = ["title", "aria-label"], cn = ["title", "aria-label"], ln = ["title", "aria-label"], un = [
1424
+ }, ln = ["value"], un = ["title", "aria-label"], dn = ["title", "aria-label"], fn = ["title", "aria-label"], pn = [
1428
1425
  "title",
1429
1426
  "popovertarget",
1430
1427
  "aria-expanded"
1431
- ], dn = ["id", "aria-label"], fn = { class: "link-field" }, pn = {
1428
+ ], mn = ["id", "aria-label"], hn = { class: "link-field" }, gn = {
1432
1429
  key: 0,
1433
1430
  class: "link-anchor"
1434
- }, mn = {
1431
+ }, _n = {
1435
1432
  key: 0,
1436
1433
  value: ""
1437
- }, hn = {
1434
+ }, vn = {
1438
1435
  key: 1,
1439
1436
  value: "",
1440
1437
  disabled: "",
1441
1438
  hidden: ""
1442
- }, gn = ["value"], _n = ["title", "aria-label"], vn = ["title", "onClick"], yn = {
1439
+ }, yn = ["value"], bn = ["title", "aria-label"], xn = ["title", "onClick"], Sn = {
1443
1440
  "aria-hidden": "true",
1444
1441
  height: "16",
1445
1442
  viewBox: "0 0 16 16",
1446
1443
  width: "16"
1447
- }, bn = [
1444
+ }, Cn = [
1448
1445
  "width",
1449
1446
  "x",
1450
1447
  "y"
1451
- ], xn = /*#__PURE__*/ Ne(/* @__PURE__ */ b({
1448
+ ], wn = /*#__PURE__*/ Re(/* @__PURE__ */ y({
1452
1449
  __name: "TextEditor",
1453
1450
  props: /*@__PURE__*/ j({
1454
1451
  editable: {
@@ -1467,51 +1464,51 @@ var $t = ["aria-label", "value"], en = { value: "paragraph" }, tn = ["value"], n
1467
1464
  }),
1468
1465
  emits: ["update:text"],
1469
1466
  setup(i) {
1470
- let s = c(i, "text"), l = i, { t: u } = be(), p = [
1467
+ let s = c(i, "text"), l = i, { t: u } = ze(), p = [
1471
1468
  "left",
1472
1469
  "center",
1473
1470
  "right",
1474
1471
  "justify"
1475
- ], g = x(() => u("blocks.text.label")), v = jt({
1476
- ...de,
1472
+ ], h = x(() => u("blocks.text.label")), _ = It({
1473
+ ...Pe,
1477
1474
  editorProps: {
1478
1475
  attributes: {
1479
- "aria-label": g.value,
1476
+ "aria-label": h.value,
1480
1477
  "aria-multiline": "true",
1481
1478
  role: "textbox"
1482
1479
  },
1483
- transformPasted: (e) => Qt(e)
1480
+ transformPasted: (e) => nn(e)
1484
1481
  },
1485
- content: me(s.value),
1482
+ content: ae(s.value),
1486
1483
  editable: l.editable,
1487
1484
  extensions: [
1488
- ...Ee.map((e) => e.name === "mergeTag" ? e.extend({ addNodeView: () => Ft(Wt) }) : e),
1489
- Et,
1490
- Ct.configure({ placeholder: () => u("blocks.text.placeholder") })
1485
+ ...ce.map((e) => e.name === "mergeTag" ? e.extend({ addNodeView: () => Bt(Yt) }) : e),
1486
+ jt,
1487
+ Ot.configure({ placeholder: () => u("blocks.text.placeholder") })
1491
1488
  ],
1492
1489
  onUpdate({ editor: e }) {
1493
- s.value = Pe(e.getJSON()), j();
1490
+ s.value = de(e.getJSON()), j();
1494
1491
  },
1495
1492
  onSelectionUpdate() {
1496
1493
  j();
1497
1494
  }
1498
1495
  });
1499
- h(g, (e) => {
1500
- v.value?.setOptions({ editorProps: { attributes: { "aria-label": e } } });
1501
- }), h(s, (e) => {
1502
- let t = v.value;
1503
- !t || oe(e, Pe(t.getJSON())) || t.commands.setContent(me(e), { emitUpdate: !1 });
1504
- }), h(() => l.editable, (e) => v.value?.setEditable(e));
1505
- let y = d("root"), b = d("toolbar");
1496
+ m(h, (e) => {
1497
+ _.value?.setOptions({ editorProps: { attributes: { "aria-label": e } } });
1498
+ }), m(s, (e) => {
1499
+ let t = _.value;
1500
+ !t || Be(e, de(t.getJSON())) || t.commands.setContent(ae(e), { emitUpdate: !1 });
1501
+ }), m(() => l.editable, (e) => _.value?.setEditable(e));
1502
+ let v = d("root"), y = d("toolbar");
1506
1503
  function w() {
1507
- let e = b.value;
1504
+ let e = y.value;
1508
1505
  !e || e.matches(":popover-open") || (e.showPopover(), j());
1509
1506
  }
1510
1507
  function ne(e) {
1511
1508
  let t = e.relatedTarget;
1512
- t instanceof Node && y.value?.contains(t) || b.value?.matches(":popover-open") && b.value.hidePopover();
1509
+ t instanceof Node && v.value?.contains(t) || y.value?.matches(":popover-open") && y.value.hidePopover();
1513
1510
  }
1514
- function O(e) {
1511
+ function D(e) {
1515
1512
  let t = e.ownerDocument, n = e.getRootNode();
1516
1513
  if (!(n instanceof ShadowRoot)) {
1517
1514
  let e = t.getSelection();
@@ -1525,9 +1522,9 @@ var $t = ["aria-label", "value"], en = { value: "paragraph" }, tn = ["value"], n
1525
1522
  return a.setStart(i.startContainer, i.startOffset), a.setEnd(i.endContainer, i.endOffset), a;
1526
1523
  }
1527
1524
  function j() {
1528
- let e = v.value?.view, t = b.value, n = y.value;
1525
+ let e = _.value?.view, t = y.value, n = v.value;
1529
1526
  if (!(e && t && n && t.matches(":popover-open"))) return;
1530
- let r = n.getBoundingClientRect(), i = O(n)?.getBoundingClientRect();
1527
+ let r = n.getBoundingClientRect(), i = D(n)?.getBoundingClientRect();
1531
1528
  if (!i || i.left === 0 && i.right === 0) {
1532
1529
  let t = e.coordsAtPos(e.state.selection.from);
1533
1530
  i = {
@@ -1540,53 +1537,64 @@ var $t = ["aria-label", "value"], en = { value: "paragraph" }, tn = ["value"], n
1540
1537
  t.style.left = `${Math.min(Math.max(o, r.left + a), r.right - a)}px`, t.style.top = `${i.top}px`;
1541
1538
  }
1542
1539
  function re() {
1543
- let e = v.value;
1540
+ let e = _.value;
1544
1541
  if (!e) return "paragraph";
1545
- let t = se.find((t) => e.isActive("heading", { level: t }));
1542
+ let t = le.find((t) => e.isActive("heading", { level: t }));
1546
1543
  return t ? `h${t}` : "paragraph";
1547
1544
  }
1548
1545
  function ie(e) {
1549
1546
  let { target: t } = e;
1550
1547
  if (!(t instanceof HTMLSelectElement)) return;
1551
- let n = v.value?.chain().focus();
1548
+ let n = _.value?.chain().focus();
1552
1549
  if (!n) return;
1553
- let r = se.find((e) => `h${e}` === t.value);
1550
+ let r = le.find((e) => `h${e}` === t.value);
1554
1551
  r ? n.setHeading({ level: r }).run() : n.setParagraph().run();
1555
1552
  }
1556
- function ae() {
1557
- let e = v.value;
1558
- if (!e) return "sans";
1553
+ let M = r(be, x(() => me));
1554
+ function ue(e) {
1555
+ return typeof e == "string" ? se(e)?.key ?? M.value : M.value;
1556
+ }
1557
+ function ge() {
1558
+ let e = _.value;
1559
+ if (!e) return M.value;
1559
1560
  let { from: t, to: n, empty: r } = e.state.selection;
1560
- if (r) return e.getAttributes("textStyle").fontFamily === "'Times New Roman', serif" ? "serif" : "sans";
1561
- let i = !1, a = !1;
1562
- return e.state.doc.nodesBetween(t, n, (e) => {
1563
- e.isText && (e.marks.find((e) => e.type.name === "textStyle")?.attrs.fontFamily === "'Times New Roman', serif" ? i = !0 : a = !0);
1564
- }), i && a ? "mixed" : i ? "serif" : "sans";
1561
+ if (r) return ue(e.getAttributes("textStyle").fontFamily);
1562
+ let i = /* @__PURE__ */ new Set();
1563
+ e.state.doc.nodesBetween(t, n, (e) => {
1564
+ if (!e.isText) return;
1565
+ let t = e.marks.find((e) => e.type.name === "textStyle");
1566
+ i.add(ue(t?.attrs.fontFamily));
1567
+ });
1568
+ let a = Array.from(i);
1569
+ return a.length > 1 ? "mixed" : a[0] ?? M.value;
1565
1570
  }
1566
- function pe(e) {
1571
+ function N(e) {
1567
1572
  let { target: t } = e;
1568
1573
  if (!(t instanceof HTMLSelectElement)) return;
1569
- let n = v.value?.chain().focus();
1570
- n && (t.value === "serif" ? n.setFontFamily(ve).run() : n.unsetFontFamily().run());
1574
+ let n = t.value, r = _.value?.chain().focus();
1575
+ r && he(n) && (n === M.value ? r.unsetFontFamily().run() : r.setFontFamily(pe(n)).run());
1571
1576
  }
1572
- let M = x({
1577
+ let xe = Me(() => {
1578
+ let e = ge();
1579
+ return e === "mixed" ? void 0 : e;
1580
+ }), P = x({
1573
1581
  get: () => {
1574
- let e = v.value?.getAttributes("textStyle").color, t = typeof e == "string" ? fe(e) : void 0;
1582
+ let e = _.value?.getAttributes("textStyle").color, t = typeof e == "string" ? ve(e) : void 0;
1575
1583
  return t ? {
1576
1584
  type: "color",
1577
1585
  ...t
1578
- } : le;
1586
+ } : oe;
1579
1587
  },
1580
1588
  set: (e) => {
1581
- e.type !== "transparent" && v.value?.chain().setColor(De(e)).run();
1589
+ e.type !== "transparent" && _.value?.chain().setColor(ye(e)).run();
1582
1590
  }
1583
- }), he = {
1591
+ }), F = {
1584
1592
  left: "blocks.text.alignLeft",
1585
1593
  center: "blocks.text.alignCenter",
1586
1594
  right: "blocks.text.alignRight",
1587
1595
  justify: "blocks.text.alignJustify"
1588
1596
  };
1589
- function ge(e) {
1597
+ function we(e) {
1590
1598
  return (e === "justify" ? [
1591
1599
  14,
1592
1600
  14,
@@ -1606,212 +1614,211 @@ var $t = ["aria-label", "value"], en = { value: "paragraph" }, tn = ["value"], n
1606
1614
  };
1607
1615
  });
1608
1616
  }
1609
- let N = o(), P = d("linkPopover"), F = d("linkInput"), I = d("linkTrigger"), L = _(""), ye = _(!1), R = _(!1);
1610
- function xe(e) {
1617
+ let I = o(), L = d("linkPopover"), R = d("linkInput"), Ee = d("linkTrigger"), z = g(""), Oe = g(!1), ke = g(!1);
1618
+ function Ae(e) {
1611
1619
  if (e.newState !== "open") return;
1612
- let t = v.value?.getAttributes("link")?.href;
1613
- L.value = typeof t == "string" ? t : "", R.value = L.value !== "";
1614
- let n = P.value, r = I.value?.getBoundingClientRect();
1620
+ let t = _.value?.getAttributes("link")?.href;
1621
+ z.value = typeof t == "string" ? t : "", ke.value = z.value !== "";
1622
+ let n = L.value, r = Ee.value?.getBoundingClientRect();
1615
1623
  n && r && (n.style.left = `${r.left}px`, n.style.top = `${r.bottom + 4}px`);
1616
1624
  }
1617
- function z(e) {
1618
- if (ye.value = e.newState === "open", e.newState !== "open") return;
1619
- let t = P.value;
1625
+ function je(e) {
1626
+ if (Oe.value = e.newState === "open", e.newState !== "open") return;
1627
+ let t = L.value;
1620
1628
  if (t) {
1621
1629
  let e = window.innerWidth - t.offsetWidth - 8;
1622
1630
  Number.parseFloat(t.style.left) > e && (t.style.left = `${Math.max(8, e)}px`);
1623
1631
  }
1624
1632
  a(() => {
1625
- F.value?.focus(), F.value?.select();
1633
+ R.value?.focus(), R.value?.select();
1626
1634
  });
1627
1635
  }
1628
1636
  function B(e) {
1629
- let t = e.relatedTarget, n = P.value;
1637
+ let t = e.relatedTarget, n = L.value;
1630
1638
  t instanceof Node && n?.contains(t) || n?.hidePopover();
1631
1639
  }
1632
- function V() {
1633
- let e = v.value?.chain().focus();
1640
+ function Ne() {
1641
+ let e = _.value?.chain().focus();
1634
1642
  if (!e) return;
1635
- let t = Ae(L.value);
1643
+ let t = Ie(z.value);
1636
1644
  t === "" ? e.unsetLink().run() : e.setLink({
1637
1645
  href: t,
1638
1646
  target: t.startsWith("#") ? null : "_blank"
1639
- }).run(), P.value?.hidePopover();
1647
+ }).run(), L.value?.hidePopover();
1640
1648
  }
1641
- let H = r(we, x(() => [])), U = x(() => L.value.startsWith("#") && H.value.includes(L.value.slice(1)) ? L.value.slice(1) : "");
1642
- function Te(e) {
1643
- e === "" ? L.value.startsWith("#") && (L.value = "") : L.value = `#${e}`;
1649
+ let V = r(Te, x(() => [])), H = x(() => z.value.startsWith("#") && V.value.includes(z.value.slice(1)) ? z.value.slice(1) : "");
1650
+ function Le(e) {
1651
+ e === "" ? z.value.startsWith("#") && (z.value = "") : z.value = `#${e}`;
1644
1652
  }
1645
- function Oe() {
1646
- v.value?.chain().focus().unsetLink().run(), P.value?.hidePopover();
1653
+ function U() {
1654
+ _.value?.chain().focus().unsetLink().run(), L.value?.hidePopover();
1647
1655
  }
1648
- function ke(e) {
1649
- v.value?.chain().focus().insertContent({
1650
- type: ue,
1656
+ function Re(e) {
1657
+ _.value?.chain().focus().insertContent({
1658
+ type: _e,
1651
1659
  attrs: { id: e }
1652
1660
  }).run();
1653
1661
  }
1654
1662
  return (r, i) => (t(), S("div", {
1655
1663
  ref_key: "root",
1656
- ref: y,
1664
+ ref: v,
1657
1665
  style: {
1658
1666
  position: "relative",
1659
1667
  width: "100%"
1660
1668
  },
1661
1669
  onFocusin: w,
1662
1670
  onFocusout: ne
1663
- }, [A(m(kt), ee(l.editable ? { class: "text-input" } : {}, {
1664
- editor: m(v),
1665
- style: m(ce)(l)
1671
+ }, [A(e(Pt), ee(l.editable ? { class: "text-input" } : {}, {
1672
+ editor: e(_),
1673
+ style: e(fe)(l)
1666
1674
  }), null, 16, ["editor", "style"]), l.editable ? (t(), S("div", {
1667
1675
  key: 0,
1668
1676
  ref_key: "toolbar",
1669
- ref: b,
1677
+ ref: y,
1670
1678
  popover: "manual",
1671
1679
  class: "toolbar"
1672
1680
  }, [
1673
- D("select", {
1674
- "aria-label": m(u)("blocks.text.styleLabel"),
1681
+ E("select", {
1682
+ "aria-label": e(u)("blocks.text.styleLabel"),
1675
1683
  class: "style",
1676
1684
  value: re(),
1677
1685
  onChange: ie,
1678
1686
  onMousedown: i[0] ||= T(() => {}, ["stop"])
1679
- }, [D("option", en, E(m(u)("blocks.text.styleNormal")), 1), (t(!0), S(k, null, f(m(se), (e) => (t(), S("option", {
1680
- key: e,
1681
- value: `h${e}`
1682
- }, E(m(u)("blocks.text.styleHeading", { level: e })), 9, tn))), 128))], 40, $t),
1683
- i[19] ||= D("span", { class: "divider" }, null, -1),
1684
- D("select", {
1685
- "aria-label": m(u)("blocks.text.font"),
1687
+ }, [E("option", an, O(e(u)("blocks.text.styleNormal")), 1), (t(!0), S(k, null, f(e(le), (n) => (t(), S("option", {
1688
+ key: n,
1689
+ value: `h${n}`
1690
+ }, O(e(u)("blocks.text.styleHeading", { level: n })), 9, on))), 128))], 40, rn),
1691
+ i[19] ||= E("span", { class: "divider" }, null, -1),
1692
+ E("select", {
1693
+ "aria-label": e(u)("blocks.text.font"),
1686
1694
  class: "font",
1687
- value: ae(),
1688
- onChange: pe,
1695
+ value: ge(),
1696
+ onChange: N,
1689
1697
  onMousedown: i[1] ||= T(() => {}, ["stop"])
1690
- }, [
1691
- D("option", rn, E(m(u)("blocks.text.fontMixed")), 1),
1692
- D("option", an, E(m(u)("blocks.text.fontSansSerif")), 1),
1693
- D("option", on, E(m(u)("blocks.text.fontSerif")), 1)
1694
- ], 40, nn),
1695
- A(Se, {
1696
- modelValue: M.value,
1697
- "onUpdate:modelValue": i[2] ||= (e) => M.value = e,
1698
+ }, [E("option", cn, O(e(u)("blocks.text.fontMixed")), 1), (t(!0), S(k, null, f(e(xe), (e) => (t(), S("option", {
1699
+ key: e.key,
1700
+ value: e.key
1701
+ }, O(e.name), 9, ln))), 128))], 40, sn),
1702
+ A(Ce, {
1703
+ modelValue: P.value,
1704
+ "onUpdate:modelValue": i[2] ||= (e) => P.value = e,
1698
1705
  "allow-transparent": !1,
1699
1706
  compact: "",
1700
- label: m(u)("blocks.text.textColor"),
1707
+ label: e(u)("blocks.text.textColor"),
1701
1708
  onMousedown: i[3] ||= T(() => {}, ["stop"])
1702
1709
  }, null, 8, ["modelValue", "label"]),
1703
- i[20] ||= D("span", { class: "divider" }, null, -1),
1704
- D("button", {
1705
- class: e({ active: m(v)?.isActive("bold") }),
1710
+ i[20] ||= E("span", { class: "divider" }, null, -1),
1711
+ E("button", {
1712
+ class: b({ active: e(_)?.isActive("bold") }),
1706
1713
  type: "button",
1707
- title: m(u)("blocks.text.bold"),
1708
- "aria-label": m(u)("blocks.text.bold"),
1709
- onClick: i[4] ||= (e) => m(v)?.chain().focus().toggleBold().run(),
1714
+ title: e(u)("blocks.text.bold"),
1715
+ "aria-label": e(u)("blocks.text.bold"),
1716
+ onClick: i[4] ||= (t) => e(_)?.chain().focus().toggleBold().run(),
1710
1717
  onMousedown: i[5] ||= T(() => {}, ["prevent"])
1711
- }, [...i[16] ||= [D("b", null, "B", -1)]], 42, sn),
1712
- D("button", {
1713
- class: e({ active: m(v)?.isActive("italic") }),
1718
+ }, [...i[16] ||= [E("b", null, "B", -1)]], 42, un),
1719
+ E("button", {
1720
+ class: b({ active: e(_)?.isActive("italic") }),
1714
1721
  type: "button",
1715
- title: m(u)("blocks.text.italic"),
1716
- "aria-label": m(u)("blocks.text.italic"),
1717
- onClick: i[6] ||= (e) => m(v)?.chain().focus().toggleItalic().run(),
1722
+ title: e(u)("blocks.text.italic"),
1723
+ "aria-label": e(u)("blocks.text.italic"),
1724
+ onClick: i[6] ||= (t) => e(_)?.chain().focus().toggleItalic().run(),
1718
1725
  onMousedown: i[7] ||= T(() => {}, ["prevent"])
1719
- }, [...i[17] ||= [D("i", null, "I", -1)]], 42, cn),
1720
- D("button", {
1721
- class: e({ active: m(v)?.isActive("underline") }),
1726
+ }, [...i[17] ||= [E("i", null, "I", -1)]], 42, dn),
1727
+ E("button", {
1728
+ class: b({ active: e(_)?.isActive("underline") }),
1722
1729
  type: "button",
1723
- title: m(u)("blocks.text.underline"),
1724
- "aria-label": m(u)("blocks.text.underline"),
1725
- onClick: i[8] ||= (e) => m(v)?.chain().focus().toggleUnderline().run(),
1730
+ title: e(u)("blocks.text.underline"),
1731
+ "aria-label": e(u)("blocks.text.underline"),
1732
+ onClick: i[8] ||= (t) => e(_)?.chain().focus().toggleUnderline().run(),
1726
1733
  onMousedown: i[9] ||= T(() => {}, ["prevent"])
1727
- }, [...i[18] ||= [D("u", null, "U", -1)]], 42, ln),
1728
- D("button", {
1734
+ }, [...i[18] ||= [E("u", null, "U", -1)]], 42, fn),
1735
+ E("button", {
1729
1736
  ref_key: "linkTrigger",
1730
- ref: I,
1731
- class: e({ active: m(v)?.isActive("link") }),
1737
+ ref: Ee,
1738
+ class: b({ active: e(_)?.isActive("link") }),
1732
1739
  type: "button",
1733
- title: m(u)("blocks.text.link"),
1734
- popovertarget: m(N),
1740
+ title: e(u)("blocks.text.link"),
1741
+ popovertarget: e(I),
1735
1742
  "aria-haspopup": "dialog",
1736
- "aria-expanded": ye.value,
1743
+ "aria-expanded": Oe.value,
1737
1744
  onMousedown: i[10] ||= T(() => {}, ["prevent"])
1738
- }, [A(_e, {
1745
+ }, [A(Se, {
1739
1746
  name: "link",
1740
1747
  size: 16
1741
- })], 42, un),
1748
+ })], 42, pn),
1742
1749
  l.editable ? (t(), S("div", {
1743
1750
  key: 0,
1744
- id: m(N),
1751
+ id: e(I),
1745
1752
  ref_key: "linkPopover",
1746
- ref: P,
1753
+ ref: L,
1747
1754
  class: "link-popover",
1748
1755
  popover: "",
1749
1756
  role: "dialog",
1750
- "aria-label": m(u)("blocks.text.link"),
1751
- onBeforetoggle: xe,
1752
- onToggle: z,
1757
+ "aria-label": e(u)("blocks.text.link"),
1758
+ onBeforetoggle: Ae,
1759
+ onToggle: je,
1753
1760
  onFocusout: B
1754
1761
  }, [
1755
- D("span", fn, [A(Me, {
1762
+ E("span", hn, [A(De, {
1756
1763
  ref_key: "linkInput",
1757
- ref: F,
1758
- modelValue: L.value,
1759
- "onUpdate:modelValue": i[11] ||= (e) => L.value = e,
1764
+ ref: R,
1765
+ modelValue: z.value,
1766
+ "onUpdate:modelValue": i[11] ||= (e) => z.value = e,
1760
1767
  size: "compact",
1761
1768
  inputmode: "url",
1762
1769
  spellcheck: "false",
1763
1770
  autocomplete: "off",
1764
- placeholder: m(u)("blocks.text.linkPlaceholder"),
1765
- "aria-label": m(u)("blocks.text.linkPrompt"),
1766
- onKeydown: te(T(V, ["prevent"]), ["enter"])
1771
+ placeholder: e(u)("blocks.text.linkPlaceholder"),
1772
+ "aria-label": e(u)("blocks.text.linkPrompt"),
1773
+ onKeydown: te(T(Ne, ["prevent"]), ["enter"])
1767
1774
  }, null, 8, [
1768
1775
  "modelValue",
1769
1776
  "placeholder",
1770
1777
  "aria-label",
1771
1778
  "onKeydown"
1772
1779
  ])]),
1773
- m(H).length ? (t(), S("span", pn, [A(Ce, {
1780
+ e(V).length ? (t(), S("span", gn, [A(Fe, {
1774
1781
  size: "compact",
1775
- "aria-label": m(u)("blocks.common.anchorLink.label"),
1776
- "model-value": U.value,
1777
- "onUpdate:modelValue": Te,
1782
+ "aria-label": e(u)("blocks.common.anchorLink.label"),
1783
+ "model-value": H.value,
1784
+ "onUpdate:modelValue": Le,
1778
1785
  onMousedown: i[12] ||= T(() => {}, ["stop"])
1779
1786
  }, {
1780
- default: n(() => [U.value ? (t(), S("option", mn, E(m(u)("blocks.common.anchorLink.none")), 1)) : (t(), S("option", hn, E(m(u)("blocks.common.anchorLink.placeholder")), 1)), (t(!0), S(k, null, f(m(H), (e) => (t(), S("option", {
1787
+ default: n(() => [H.value ? (t(), S("option", _n, O(e(u)("blocks.common.anchorLink.none")), 1)) : (t(), S("option", vn, O(e(u)("blocks.common.anchorLink.placeholder")), 1)), (t(!0), S(k, null, f(e(V), (e) => (t(), S("option", {
1781
1788
  key: e,
1782
1789
  value: e
1783
- }, " #" + E(e), 9, gn))), 128))]),
1790
+ }, " #" + O(e), 9, yn))), 128))]),
1784
1791
  _: 1
1785
1792
  }, 8, ["aria-label", "model-value"])])) : C("", !0),
1786
- D("button", {
1793
+ E("button", {
1787
1794
  class: "link-apply",
1788
1795
  type: "button",
1789
- onClick: V,
1796
+ onClick: Ne,
1790
1797
  onMousedown: i[13] ||= T(() => {}, ["prevent"])
1791
- }, E(m(u)("blocks.text.linkApply")), 33),
1792
- R.value ? (t(), S("button", {
1798
+ }, O(e(u)("blocks.text.linkApply")), 33),
1799
+ ke.value ? (t(), S("button", {
1793
1800
  key: 1,
1794
1801
  class: "link-remove",
1795
1802
  type: "button",
1796
- title: m(u)("blocks.text.linkRemove"),
1797
- "aria-label": m(u)("blocks.text.linkRemove"),
1798
- onClick: Oe,
1803
+ title: e(u)("blocks.text.linkRemove"),
1804
+ "aria-label": e(u)("blocks.text.linkRemove"),
1805
+ onClick: U,
1799
1806
  onMousedown: i[14] ||= T(() => {}, ["prevent"])
1800
- }, [A(_e, {
1807
+ }, [A(Se, {
1801
1808
  name: "trash",
1802
1809
  size: 16
1803
- })], 40, _n)) : C("", !0)
1804
- ], 40, dn)) : C("", !0),
1805
- A(Ut, { onSelect: ke }),
1806
- i[21] ||= D("span", { class: "divider" }, null, -1),
1807
- (t(), S(k, null, f(p, (n) => D("button", {
1810
+ })], 40, bn)) : C("", !0)
1811
+ ], 40, mn)) : C("", !0),
1812
+ A(Jt, { onSelect: Re }),
1813
+ i[21] ||= E("span", { class: "divider" }, null, -1),
1814
+ (t(), S(k, null, f(p, (n) => E("button", {
1808
1815
  key: n,
1809
- class: e({ active: m(v)?.isActive({ textAlign: n }) }),
1810
- title: m(u)(he[n]),
1816
+ class: b({ active: e(_)?.isActive({ textAlign: n }) }),
1817
+ title: e(u)(F[n]),
1811
1818
  type: "button",
1812
- onClick: (e) => m(v)?.chain().focus().setTextAlign(n).run(),
1819
+ onClick: (t) => e(_)?.chain().focus().setTextAlign(n).run(),
1813
1820
  onMousedown: i[15] ||= T(() => {}, ["prevent"])
1814
- }, [(t(), S("svg", yn, [(t(!0), S(k, null, f(ge(n), (e, n) => (t(), S("rect", {
1821
+ }, [(t(), S("svg", Sn, [(t(!0), S(k, null, f(we(n), (e, n) => (t(), S("rect", {
1815
1822
  key: n,
1816
1823
  fill: "currentColor",
1817
1824
  height: "1.5",
@@ -1819,9 +1826,9 @@ var $t = ["aria-label", "value"], en = { value: "paragraph" }, tn = ["value"], n
1819
1826
  width: e.w,
1820
1827
  x: e.x,
1821
1828
  y: e.y
1822
- }, null, 8, bn))), 128))]))], 42, vn)), 64))
1829
+ }, null, 8, Cn))), 128))]))], 42, xn)), 64))
1823
1830
  ], 512)) : C("", !0)], 544));
1824
1831
  }
1825
- }), [["styles", [".tiptap{font-feature-settings:\"liga\" 0;font-variant-ligatures:none;overflow-wrap:break-word;white-space:pre-wrap;position:relative}.text-input .tiptap .is-editor-empty:first-child{position:relative}.text-input .tiptap .is-editor-empty:first-child:before{color:var(--bygga-color-text-muted);content:attr(data-placeholder);pointer-events:none;text-overflow:ellipsis;inset-inline:0;white-space:nowrap;position:absolute;top:0;overflow:hidden}.merge-tag{background:var(--bygga-color-track);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-accent);cursor:default;white-space:nowrap;-webkit-user-select:all;user-select:all;padding:0 .3em;font-size:.9em}.merge-tag.is-unknown{color:var(--bygga-color-text-muted);border-style:dashed}.merge-tag.ProseMirror-selectednode{outline:2px solid var(--bygga-color-accent);outline-offset:1px}", ".toolbar[data-v-2aa085af]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);white-space:nowrap;font-family:var(--bygga-font-family);align-items:center;gap:.25em;margin:0;padding:.25em;position:fixed;inset:auto;transform:translate(-50%,calc(-100% - .4em))}.toolbar[data-v-2aa085af]:popover-open{display:flex}.toolbar>button[data-v-2aa085af]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;min-width:1.8em;height:1.8em;padding:0;display:inline-flex}.toolbar>button[data-v-2aa085af]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}.toolbar>button.active[data-v-2aa085af]{background:var(--bygga-color-selected,var(--bygga-color-track));color:var(--bygga-color-selected-text,var(--bygga-color-accent));forced-color-adjust:none}.toolbar .style[data-v-2aa085af],.toolbar .font[data-v-2aa085af]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;height:1.8em}.toolbar .divider[data-v-2aa085af]{background:var(--bygga-color-border);width:1px;height:1.4em}.link-popover[data-v-2aa085af]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);align-items:center;gap:.25em;margin:0;padding:.25em;position:fixed;inset:auto}.link-popover[data-v-2aa085af]:popover-open{display:flex}.link-field[data-v-2aa085af]{width:18em}.link-anchor[data-v-2aa085af]{width:10em}.link-apply[data-v-2aa085af]{background:var(--bygga-color-accent);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-surface);cursor:pointer;border:none;padding:.4em .8em}.link-remove[data-v-2aa085af]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;min-width:1.8em;height:1.8em;padding:0;display:inline-flex}.link-remove[data-v-2aa085af]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}"]], ["__scopeId", "data-v-2aa085af"]]);
1832
+ }), [["styles", [".tiptap{font-feature-settings:\"liga\" 0;font-variant-ligatures:none;overflow-wrap:break-word;white-space:pre-wrap;position:relative}.text-input .tiptap .is-editor-empty:first-child{position:relative}.text-input .tiptap .is-editor-empty:first-child:before{color:var(--bygga-color-text-muted);content:attr(data-placeholder);pointer-events:none;text-overflow:ellipsis;inset-inline:0;white-space:nowrap;position:absolute;top:0;overflow:hidden}.merge-tag{background:var(--bygga-color-track);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-accent);cursor:default;white-space:nowrap;-webkit-user-select:all;user-select:all;padding:0 .3em;font-size:.9em}.merge-tag.is-unknown{color:var(--bygga-color-text-muted);border-style:dashed}.merge-tag.ProseMirror-selectednode{outline:2px solid var(--bygga-color-accent);outline-offset:1px}", ".toolbar[data-v-f337d1e6]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);white-space:nowrap;font-family:var(--bygga-font-family);align-items:center;gap:.25em;margin:0;padding:.25em;position:fixed;inset:auto;transform:translate(-50%,calc(-100% - .4em))}.toolbar[data-v-f337d1e6]:popover-open{display:flex}.toolbar>button[data-v-f337d1e6]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;min-width:1.8em;height:1.8em;padding:0;display:inline-flex}.toolbar>button[data-v-f337d1e6]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}.toolbar>button.active[data-v-f337d1e6]{background:var(--bygga-color-selected,var(--bygga-color-track));color:var(--bygga-color-selected-text,var(--bygga-color-accent));forced-color-adjust:none}.toolbar .style[data-v-f337d1e6],.toolbar .font[data-v-f337d1e6]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;height:1.8em}.toolbar .divider[data-v-f337d1e6]{background:var(--bygga-color-border);width:1px;height:1.4em}.link-popover[data-v-f337d1e6]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);align-items:center;gap:.25em;margin:0;padding:.25em;position:fixed;inset:auto}.link-popover[data-v-f337d1e6]:popover-open{display:flex}.link-field[data-v-f337d1e6]{width:18em}.link-anchor[data-v-f337d1e6]{width:10em}.link-apply[data-v-f337d1e6]{background:var(--bygga-color-accent);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-surface);cursor:pointer;border:none;padding:.4em .8em}.link-remove[data-v-f337d1e6]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;min-width:1.8em;height:1.8em;padding:0;display:inline-flex}.link-remove[data-v-f337d1e6]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}"]], ["__scopeId", "data-v-f337d1e6"]]);
1826
1833
  //#endregion
1827
- export { xn as default };
1834
+ export { wn as default };