@yungu-fed/rich-text-editor 0.1.11 → 0.1.13

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.mjs CHANGED
@@ -13436,86 +13436,166 @@ function ly(e) {
13436
13436
  };
13437
13437
  }
13438
13438
  //#endregion
13439
+ //#region src/rich-text-editor/primitives/slateValueSync.ts
13440
+ var uy = /* @__PURE__ */ new WeakMap();
13441
+ function dy(e) {
13442
+ return JSON.stringify(e, (e, t) => !t || typeof t != "object" || Array.isArray(t) ? t : Object.entries(t).sort(([e], [t]) => e.localeCompare(t)).reduce((e, [t, n]) => R(R({}, e), {}, { [t]: n }), {}));
13443
+ }
13444
+ function fy(e) {
13445
+ let t = uy.get(e);
13446
+ return t || (t = py(e), uy.set(e, t)), t;
13447
+ }
13448
+ function py(e) {
13449
+ let t = 0, n = 0, r = 0, i = 0, a = "", o, s, c = !1, l = 0, u, d = e.apply;
13450
+ e.apply = (e) => {
13451
+ n += 1;
13452
+ try {
13453
+ d(e);
13454
+ } finally {
13455
+ --n;
13456
+ }
13457
+ t === 0 && n === 0 && e.type !== "set_selection" && (r += 1);
13458
+ };
13459
+ let f = (n) => {
13460
+ t += 1;
13461
+ try {
13462
+ ka.withoutSaving(e, n);
13463
+ } finally {
13464
+ --t;
13465
+ }
13466
+ }, p = (t) => {
13467
+ dy(e.children) !== dy(t) && (i = r, f(() => {
13468
+ W.withoutNormalizing(e, () => {
13469
+ J.deselect(e);
13470
+ for (let t = e.children.length - 1; t >= 0; --t) J.removeNodes(e, { at: [t] });
13471
+ J.insertNodes(e, Ql(t), { at: [0] });
13472
+ }), W.normalize(e, { force: !0 });
13473
+ }), e.history.undos = [], e.history.redos = [], a = dy(e.children));
13474
+ };
13475
+ return {
13476
+ beginComposition: () => {
13477
+ c = !0, l += 1;
13478
+ },
13479
+ endComposition: () => {
13480
+ let e = l;
13481
+ return Promise.resolve().then(() => {
13482
+ if (e === l && (c = !1, u)) {
13483
+ let e = u;
13484
+ u = void 0, p(e);
13485
+ }
13486
+ });
13487
+ },
13488
+ initialize: () => {
13489
+ f(() => W.normalize(e, { force: !0 })), a = dy(e.children);
13490
+ },
13491
+ publish: (t) => {
13492
+ if (r === i) return;
13493
+ i = r;
13494
+ let n = $l(e.children), o = dy(n);
13495
+ o !== a && (a = o, s = o, t(n));
13496
+ },
13497
+ synchronize: (e, t) => {
13498
+ if (!e) {
13499
+ o = void 0;
13500
+ return;
13501
+ }
13502
+ let n = dy(e);
13503
+ if (n === o) return;
13504
+ o = n;
13505
+ let r = t(e);
13506
+ if (dy(r) === s) {
13507
+ s = void 0, u = void 0;
13508
+ return;
13509
+ }
13510
+ if (s = void 0, c) {
13511
+ u = r;
13512
+ return;
13513
+ }
13514
+ p(r);
13515
+ }
13516
+ };
13517
+ }
13518
+ //#endregion
13439
13519
  //#region src/rich-text-editor/primitives/slateRuntime.tsx
13440
- function uy(e) {
13520
+ function my(e) {
13441
13521
  let t = g(() => Kp(e), [e]);
13442
13522
  return {
13443
- editor: g(() => dy(Aa(Ul(Ta())), t), [t]),
13523
+ editor: g(() => hy(Aa(Ul(Ta())), t), [t]),
13444
13524
  registry: t
13445
13525
  };
13446
13526
  }
13447
- function dy(e, t) {
13527
+ function hy(e, t) {
13448
13528
  let { addMark: n, deleteBackward: r, deleteForward: i, deleteFragment: a, insertBreak: o, insertData: s, insertText: c, isInline: l, isVoid: u, markableVoid: d, normalizeNode: f, removeMark: p } = e;
13449
13529
  return e.isInline = (e) => {
13450
13530
  var n;
13451
- return (n = fy(t, e, "inline")) == null ? l(e) : n;
13531
+ return (n = gy(t, e, "inline")) == null ? l(e) : n;
13452
13532
  }, e.isVoid = (e) => {
13453
13533
  var n;
13454
- return (n = fy(t, e, "void")) == null ? u(e) : n;
13534
+ return (n = gy(t, e, "void")) == null ? u(e) : n;
13455
13535
  }, e.markableVoid = (e) => {
13456
13536
  var n;
13457
- return (n = fy(t, e, "markableVoid")) == null ? d(e) : n;
13537
+ return (n = gy(t, e, "markableVoid")) == null ? d(e) : n;
13458
13538
  }, e.normalizeNode = (n) => {
13459
- my(e, t, n) || f(n);
13539
+ vy(e, t, n) || f(n);
13460
13540
  }, e.insertText = (n) => {
13461
- gy(e, t, (e) => {
13541
+ by(e, t, (e) => {
13462
13542
  var t, r;
13463
13543
  return (t = e.definition.behavior) == null || (r = t.onBeforeInputText) == null ? void 0 : r.call(t, R(R({}, e.action), {}, { text: n }));
13464
13544
  }) || c(n);
13465
13545
  }, e.insertData = (n) => {
13466
- gy(e, t, (e) => {
13546
+ by(e, t, (e) => {
13467
13547
  var t, r;
13468
13548
  return (t = e.definition.behavior) == null || (r = t.onInsertData) == null ? void 0 : r.call(t, R(R({}, e.action), {}, { data: n }));
13469
13549
  }) || s(n);
13470
13550
  }, e.insertBreak = () => {
13471
- gy(e, t, (e) => {
13551
+ by(e, t, (e) => {
13472
13552
  var t, n;
13473
13553
  return (t = e.definition.behavior) == null || (n = t.onBreak) == null ? void 0 : n.call(t, e.action);
13474
13554
  }) || o();
13475
13555
  }, e.deleteBackward = (n) => {
13476
- _y(e, t, n, "backward") || r(n);
13556
+ xy(e, t, n, "backward") || r(n);
13477
13557
  }, e.deleteForward = (n) => {
13478
- _y(e, t, n, "forward") || i(n);
13558
+ xy(e, t, n, "forward") || i(n);
13479
13559
  }, e.deleteFragment = () => {
13480
- let n = Sy(e, t);
13481
- if (vy(e, t)) {
13482
- Cy(e, t, n);
13560
+ let n = Ey(e, t);
13561
+ if (Sy(e, t)) {
13562
+ Dy(e, t, n);
13483
13563
  return;
13484
13564
  }
13485
- a(), Cy(e, t, n);
13565
+ a(), Dy(e, t, n);
13486
13566
  }, e.addMark = (r, i) => {
13487
- by(e, t, r, i) || n(r, i);
13567
+ wy(e, t, r, i) || n(r, i);
13488
13568
  }, e.removeMark = (n) => {
13489
- by(e, t, n, void 0) || p(n);
13569
+ wy(e, t, n, void 0) || p(n);
13490
13570
  }, e;
13491
13571
  }
13492
- function fy(e, t, n) {
13572
+ function gy(e, t, n) {
13493
13573
  var r;
13494
13574
  if (!X(t)) return;
13495
13575
  let i = (r = e.get(t.type)) == null ? void 0 : r.schema;
13496
- return i ? n === "inline" ? i.inline : n === "markableVoid" ? i.markableVoid : i.void : py(e, t, n);
13576
+ return i ? n === "inline" ? i.inline : n === "markableVoid" ? i.markableVoid : i.void : _y(e, t, n);
13497
13577
  }
13498
- function py(e, t, n) {
13578
+ function _y(e, t, n) {
13499
13579
  var r;
13500
13580
  if (!X(t)) return;
13501
13581
  let i = (r = e.get(t.type)) == null ? void 0 : r.object;
13502
13582
  if (i) return n === "inline" ? i.inline : n === "markableVoid" ? i.markable : !0;
13503
13583
  }
13504
- function my(e, t, n) {
13584
+ function vy(e, t, n) {
13505
13585
  var r, i, a;
13506
13586
  let [o, s] = n;
13507
- return X(o) ? hy(e, t, o, s) ? !0 : (r = (i = t.get(o.type)) == null || (a = i.normalize) == null ? void 0 : a.call(i, {
13587
+ return X(o) ? yy(e, t, o, s) ? !0 : (r = (i = t.get(o.type)) == null || (a = i.normalize) == null ? void 0 : a.call(i, {
13508
13588
  editor: e,
13509
13589
  element: o,
13510
13590
  elementPath: s
13511
13591
  })) == null ? !1 : r : !1;
13512
13592
  }
13513
- function hy(e, t, n, r) {
13593
+ function yy(e, t, n, r) {
13514
13594
  var i;
13515
13595
  return !((i = t.get(n.type)) != null && i.object) || n.children.length === 1 && K.isText(n.children[0]) && n.children[0].text === "" ? !1 : (J.setNodes(e, { children: [{ text: "" }] }, { at: r }), !0);
13516
13596
  }
13517
- function gy(e, t, n) {
13518
- let r = xy(e);
13597
+ function by(e, t, n) {
13598
+ let r = Ty(e);
13519
13599
  if (r.length === 0) return !1;
13520
13600
  for (let [i, a] of r) {
13521
13601
  let r = t.get(i.type);
@@ -13530,27 +13610,27 @@ function gy(e, t, n) {
13530
13610
  }
13531
13611
  return !1;
13532
13612
  }
13533
- function _y(e, t, n, r) {
13534
- return gy(e, t, (e) => {
13613
+ function xy(e, t, n, r) {
13614
+ return by(e, t, (e) => {
13535
13615
  var t, i, a, o;
13536
13616
  let s = R(R({}, e.action), {}, { unit: n });
13537
13617
  return r === "backward" ? (t = e.definition.behavior) == null || (i = t.onDeleteBackward) == null ? void 0 : i.call(t, s) : (a = e.definition.behavior) == null || (o = a.onDeleteForward) == null ? void 0 : o.call(a, s);
13538
13618
  });
13539
13619
  }
13540
- function vy(e, t) {
13541
- return gy(e, t, (e) => {
13620
+ function Sy(e, t) {
13621
+ return by(e, t, (e) => {
13542
13622
  var t, n;
13543
13623
  return (t = e.definition.behavior) == null || (n = t.onDeleteFragment) == null ? void 0 : n.call(t, e.action);
13544
13624
  });
13545
13625
  }
13546
- function yy(e, t, n) {
13547
- return gy(e, t, (e) => {
13626
+ function Cy(e, t, n) {
13627
+ return by(e, t, (e) => {
13548
13628
  var t, r;
13549
13629
  return (t = e.definition.behavior) == null || (r = t.onDeleteSelection) == null ? void 0 : r.call(t, R(R({}, e.action), {}, { key: n }));
13550
13630
  });
13551
13631
  }
13552
- function by(e, t, n, r) {
13553
- return gy(e, t, (e) => {
13632
+ function wy(e, t, n, r) {
13633
+ return by(e, t, (e) => {
13554
13634
  var t, i;
13555
13635
  return (t = e.definition.behavior) == null || (i = t.onMark) == null ? void 0 : i.call(t, R(R({}, e.action), {}, {
13556
13636
  key: n,
@@ -13558,7 +13638,7 @@ function by(e, t, n, r) {
13558
13638
  }));
13559
13639
  });
13560
13640
  }
13561
- function xy(e) {
13641
+ function Ty(e) {
13562
13642
  return e.selection ? Array.from(W.nodes(e, {
13563
13643
  at: W.unhangRange(e, e.selection),
13564
13644
  match: (e) => X(e),
@@ -13566,58 +13646,58 @@ function xy(e) {
13566
13646
  voids: !0
13567
13647
  })).filter((e) => X(e[0])).reverse() : [];
13568
13648
  }
13569
- function Sy(e, t) {
13649
+ function Ey(e, t) {
13570
13650
  return t.clearOnSelectionDeleteMarkKeys.length > 0 && !!(e.selection && !B.isCollapsed(e.selection));
13571
13651
  }
13572
- function Cy(e, t, n) {
13652
+ function Dy(e, t, n) {
13573
13653
  n && t.clearOnSelectionDeleteMarkKeys.forEach((t) => {
13574
13654
  e.removeMark(t);
13575
13655
  });
13576
13656
  }
13577
- function wy({ apiRef: e, ariaLabel: t, children: n, className: r, editor: i, initialValue: a, isFocused: o, onBlurEditor: s, onChange: c, onCommandTargetActivate: l, onFocusEditor: u, onPasteHtml: f, onPasteImageFiles: h, onPasteImageSources: _, onToolbarStateChange: v, placeholder: y, registry: b, value: C }) {
13578
- let w = (e) => {
13579
- if (mu(e.target) || fu(i, e) || !Ty(e.key)) return;
13580
- let t = Sy(i, b);
13581
- yy(i, b, e.key) && (e.preventDefault(), Cy(i, b, t), c($l(i.children)));
13582
- }, T = g(() => cy(b), [b]), E = g(() => ly(b), [b]), D = g(() => Ql(a), [a]), O = d((e) => {
13583
- e.defaultPrevented || (l(), !Ry(i) && !Iy(i, e) && Fy(i), v());
13657
+ function Oy({ apiRef: e, ariaLabel: t, children: n, className: r, editor: i, initialValue: a, isFocused: o, onBlurEditor: s, onChange: c, onCommandTargetActivate: l, onFocusEditor: u, onPasteHtml: f, onPasteImageFiles: p, onPasteImageSources: _, onToolbarStateChange: v, placeholder: y, registry: b, value: C }) {
13658
+ let w = g(() => fy(i), [i]), T = (e) => {
13659
+ if (mu(e.target) || fu(i, e) || !Ay(e.key)) return;
13660
+ let t = Ey(i, b);
13661
+ Cy(i, b, e.key) && (e.preventDefault(), Dy(i, b, t));
13662
+ }, E = g(() => cy(b), [b]), D = g(() => ly(b), [b]), O = g(() => Ql(a), [a]), k = d((e) => {
13663
+ e.defaultPrevented || (l(), !Uy(i) && !Vy(i, e) && By(i), v());
13584
13664
  }, [
13585
13665
  i,
13586
13666
  l,
13587
13667
  v
13588
- ]), k = d((e) => {
13589
- e.defaultPrevented || (u(), Fy(i));
13590
- }, [i, u]), A = d((e) => {
13668
+ ]), A = d((e) => {
13669
+ e.defaultPrevented || (u(), By(i));
13670
+ }, [i, u]), j = d((e) => {
13591
13671
  e.defaultPrevented || l();
13592
- }, [l]), j = d((e) => {
13593
- e.defaultPrevented || Ly(i) && v();
13594
- }, [i, v]), M = d((e) => {
13595
- mu(e.target) || e.defaultPrevented || Ey({
13672
+ }, [l]), M = d((e) => {
13673
+ e.defaultPrevented || Hy(i) && v();
13674
+ }, [i, v]), N = d((e) => {
13675
+ e.relatedTarget instanceof globalThis.Node && e.currentTarget.contains(e.relatedTarget) || Y.findDocumentOrShadowRoot(i).activeElement !== e.currentTarget && Y.blur(i);
13676
+ }, [i]), P = d((e) => {
13677
+ mu(e.target) || e.defaultPrevented || jy({
13596
13678
  editor: i,
13597
13679
  event: e,
13598
- onChange: c,
13599
13680
  onPasteHtml: f,
13600
- onPasteImageFiles: h,
13681
+ onPasteImageFiles: p,
13601
13682
  onPasteImageSources: _,
13602
13683
  registry: b
13603
13684
  });
13604
13685
  }, [
13605
13686
  i,
13606
- c,
13607
13687
  f,
13608
- h,
13688
+ p,
13609
13689
  _,
13610
13690
  b
13611
13691
  ]);
13612
- return p(() => {
13613
- W.normalize(i, { force: !0 });
13614
- }, [i]), p(() => {
13615
- !C || JSON.stringify(i.children) === JSON.stringify(C) || (W.withoutNormalizing(i, () => {
13616
- J.deselect(i);
13617
- for (let e = i.children.length - 1; e >= 0; --e) J.removeNodes(i, { at: [e] });
13618
- J.insertNodes(i, Ql(C), { at: [0] });
13619
- }), W.normalize(i, { force: !0 }));
13620
- }, [i, C]), m(e, () => ({
13692
+ return h(() => {
13693
+ w.initialize();
13694
+ }, [w]), h(() => {
13695
+ w.synchronize(C, (e) => ky(e, b));
13696
+ }, [
13697
+ b,
13698
+ C,
13699
+ w
13700
+ ]), m(e, () => ({
13621
13701
  blur: () => {
13622
13702
  Y.blur(i), s();
13623
13703
  },
@@ -13627,11 +13707,11 @@ function wy({ apiRef: e, ariaLabel: t, children: n, className: r, editor: i, ini
13627
13707
  getValue: () => $l(i.children),
13628
13708
  isFocused: o,
13629
13709
  insertNode: (e, t) => {
13630
- Y.focus(i), u(), Fy(i), Py(i, b, Rd(e, t));
13710
+ Y.focus(i), u(), By(i), zy(i, b, Rd(e, t));
13631
13711
  },
13632
13712
  runCommand: (e) => {
13633
- let t = Ly(i);
13634
- Y.focus(i), u(), t || Fy(i), Py(i, b, e);
13713
+ let t = Hy(i);
13714
+ Y.focus(i), u(), t || By(i), zy(i, b, e);
13635
13715
  }
13636
13716
  }), [
13637
13717
  i,
@@ -13641,75 +13721,86 @@ function wy({ apiRef: e, ariaLabel: t, children: n, className: r, editor: i, ini
13641
13721
  b
13642
13722
  ]), /* @__PURE__ */ S(Ll, {
13643
13723
  editor: i,
13644
- initialValue: D,
13645
- onChange: () => c($l(i.children)),
13724
+ initialValue: O,
13725
+ onChange: () => {
13726
+ w.publish(c), v();
13727
+ },
13646
13728
  children: [n, /* @__PURE__ */ x(Tl, {
13647
13729
  "aria-label": t == null ? y : t,
13648
13730
  className: r,
13649
- onClick: O,
13650
- onFocus: k,
13651
- onKeyDownCapture: w,
13652
- onMouseDown: A,
13653
- onMouseUp: j,
13654
- onPasteCapture: M,
13731
+ onBlurCapture: N,
13732
+ onClick: k,
13733
+ onCompositionStart: () => w.beginComposition(),
13734
+ onCompositionUpdate: () => w.beginComposition(),
13735
+ onCompositionEnd: () => {
13736
+ w.endComposition();
13737
+ },
13738
+ onFocus: A,
13739
+ onKeyDownCapture: T,
13740
+ onMouseDown: j,
13741
+ onMouseUp: M,
13742
+ onPasteCapture: P,
13655
13743
  onPaste: (e) => e.isDefaultPrevented(),
13656
13744
  placeholder: y,
13657
13745
  decorate: Eu,
13658
- renderElement: T,
13659
- renderLeaf: E,
13746
+ renderElement: E,
13747
+ renderLeaf: D,
13660
13748
  style: { minHeight: "var(--rte-content-min-height, 8rem)" }
13661
13749
  })]
13662
13750
  });
13663
13751
  }
13664
- function Ty(e) {
13752
+ function ky(e, t) {
13753
+ let n = hy(Aa(Ul(Ta())), t);
13754
+ return n.children = e.length ? Ql(e) : [t.createDefaultElement()], W.normalize(n, { force: !0 }), $l(n.children);
13755
+ }
13756
+ function Ay(e) {
13665
13757
  return e === "Backspace" || e === "Delete";
13666
13758
  }
13667
- function Ey({ editor: e, event: t, onChange: n, onPasteHtml: r, onPasteImageFiles: i, onPasteImageSources: a, registry: o }) {
13759
+ function jy({ editor: e, event: t, onPasteHtml: n, onPasteImageFiles: r, onPasteImageSources: i, registry: a }) {
13668
13760
  if (lu(e)) {
13669
13761
  t.preventDefault(), e.insertText(t.clipboardData.getData("text/plain"));
13670
13762
  return;
13671
13763
  }
13672
- let s = jy(t.clipboardData);
13673
- if (s.length > 0) {
13674
- if (!i && !a && !r) return;
13675
- t.preventDefault(), i == null || i(s);
13764
+ let o = Iy(t.clipboardData);
13765
+ if (o.length > 0) {
13766
+ if (!r && !i && !n) return;
13767
+ t.preventDefault(), r == null || r(o);
13676
13768
  return;
13677
13769
  }
13678
- let c = Dy(t.clipboardData);
13679
- Oy({
13770
+ let s = My(t.clipboardData);
13771
+ Ny({
13680
13772
  editor: e,
13681
13773
  event: t,
13682
- html: c,
13683
- onChange: n,
13684
- onPasteHtml: r,
13685
- registry: o
13686
- }) || ky(t, c, a);
13774
+ html: s,
13775
+ onPasteHtml: n,
13776
+ registry: a
13777
+ }) || Py(t, s, i);
13687
13778
  }
13688
- function Dy(e) {
13779
+ function My(e) {
13689
13780
  var t;
13690
13781
  let n = e.getData("text/html");
13691
- return n.trim() || Ay(e) ? n : (t = ay(e.getData("text/plain"))) == null ? "" : t;
13782
+ return n.trim() || Fy(e) ? n : (t = ay(e.getData("text/plain"))) == null ? "" : t;
13692
13783
  }
13693
- function Oy({ editor: e, event: t, html: n, onChange: r, onPasteHtml: i, registry: a }) {
13694
- if (!n.trim() || Ay(t.clipboardData) || !i && t.clipboardData.getData("text/html").trim()) return !1;
13784
+ function Ny({ editor: e, event: t, html: n, onPasteHtml: r, registry: i }) {
13785
+ if (!n.trim() || Fy(t.clipboardData) || !r && t.clipboardData.getData("text/html").trim()) return !1;
13695
13786
  t.preventDefault();
13696
- let o = e.selection ? W.rangeRef(e, e.selection) : null, s = t.clipboardData.getData("text/html").trim() ? ay(t.clipboardData.getData("text/plain")) : null;
13697
- return Promise.resolve(i ? i(n, { markdownHtml: s }) : n).then((t) => {
13698
- let n = o == null ? void 0 : o.unref();
13699
- t != null && t.trim() && (n && J.select(e, n), J.insertFragment(e, mm(t, a)), Y.focus(e), r($l(e.children)));
13787
+ let a = e.selection ? W.rangeRef(e, e.selection) : null, o = t.clipboardData.getData("text/html").trim() ? ay(t.clipboardData.getData("text/plain")) : null;
13788
+ return Promise.resolve(r ? r(n, { markdownHtml: o }) : n).then((t) => {
13789
+ let n = a == null ? void 0 : a.unref();
13790
+ t != null && t.trim() && (n && J.select(e, n), J.insertFragment(e, mm(t, i)), Y.focus(e));
13700
13791
  }).catch(() => {
13701
- o == null || o.unref();
13792
+ a == null || a.unref();
13702
13793
  }), !0;
13703
13794
  }
13704
- function ky(e, t, n) {
13705
- let r = My(t);
13795
+ function Py(e, t, n) {
13796
+ let r = Ly(t);
13706
13797
  r.length > 0 && (e.preventDefault(), n == null || n(r));
13707
13798
  }
13708
- function Ay(e) {
13799
+ function Fy(e) {
13709
13800
  var t;
13710
13801
  return Array.from((t = e.types) == null ? [] : t).includes("application/x-slate-fragment") || e.getData("application/x-slate-fragment").length > 0 || e.getData("text/html").includes("data-slate-fragment");
13711
13802
  }
13712
- function jy(e) {
13803
+ function Iy(e) {
13713
13804
  var t;
13714
13805
  let n = [], r = /* @__PURE__ */ new Set(), i = (e) => {
13715
13806
  if (!(e != null && e.type.startsWith("image/"))) return;
@@ -13724,7 +13815,7 @@ function jy(e) {
13724
13815
  }
13725
13816
  return n;
13726
13817
  }
13727
- function My(e) {
13818
+ function Ly(e) {
13728
13819
  if (!e.trim() || typeof DOMParser > "u") return [];
13729
13820
  let t = new DOMParser().parseFromString(`<!doctype html><body>${e}</body>`, "text/html");
13730
13821
  return Array.from(t.body.querySelectorAll("img")).map((e) => {
@@ -13732,18 +13823,18 @@ function My(e) {
13732
13823
  return (t = (n = e.getAttribute("src")) == null ? void 0 : n.trim()) == null ? "" : t;
13733
13824
  }).filter((e) => e.length > 0);
13734
13825
  }
13735
- function Ny(e, t) {
13826
+ function Ry(e, t) {
13736
13827
  return {
13737
13828
  editor: e,
13738
- getToolbarState: () => Uy(e, t),
13829
+ getToolbarState: () => Jy(e, t),
13739
13830
  getValue: () => $l(e.children),
13740
13831
  runCommand: (n) => {
13741
- let r = Ly(e);
13742
- Y.focus(e), r || Fy(e), Py(e, t, n);
13832
+ let r = Hy(e);
13833
+ Y.focus(e), r || By(e), zy(e, t, n);
13743
13834
  }
13744
13835
  };
13745
13836
  }
13746
- function Py(e, t, n) {
13837
+ function zy(e, t, n) {
13747
13838
  let r = t.getCommand(n.command);
13748
13839
  r && r.run({
13749
13840
  command: n,
@@ -13751,26 +13842,26 @@ function Py(e, t, n) {
13751
13842
  registry: t
13752
13843
  });
13753
13844
  }
13754
- function Fy(e) {
13845
+ function By(e) {
13755
13846
  e.selection || J.select(e, W.end(e, []));
13756
13847
  }
13757
- function Iy(e, t) {
13848
+ function Vy(e, t) {
13758
13849
  try {
13759
13850
  let n = Y.findEventRange(e, t.nativeEvent);
13760
13851
  return e.selection && B.equals(e.selection, n) || J.select(e, n), !0;
13761
13852
  } catch (t) {
13762
- return Ly(e);
13853
+ return Hy(e);
13763
13854
  }
13764
13855
  }
13765
- function Ly(e) {
13766
- let t = By(e);
13767
- return t ? zy(e, t) : !1;
13856
+ function Hy(e) {
13857
+ let t = Gy(e);
13858
+ return t ? Wy(e, t) : !1;
13768
13859
  }
13769
- function Ry(e) {
13770
- let t = By(e);
13771
- return !t || t.isCollapsed ? !1 : zy(e, t);
13860
+ function Uy(e) {
13861
+ let t = Gy(e);
13862
+ return !t || t.isCollapsed ? !1 : Wy(e, t);
13772
13863
  }
13773
- function zy(e, t) {
13864
+ function Wy(e, t) {
13774
13865
  try {
13775
13866
  let n = Y.toSlateRange(e, t, {
13776
13867
  exactMatch: !1,
@@ -13781,25 +13872,25 @@ function zy(e, t) {
13781
13872
  return !1;
13782
13873
  }
13783
13874
  }
13784
- function By(e) {
13875
+ function Gy(e) {
13785
13876
  let t = Y.findDocumentOrShadowRoot(e), n = t instanceof Document ? t.getSelection() : t.ownerDocument.getSelection();
13786
- return !n || n.rangeCount === 0 ? null : Vy(e, n) ? n : null;
13877
+ return !n || n.rangeCount === 0 ? null : Ky(e, n) ? n : null;
13787
13878
  }
13788
- function Vy(e, t) {
13879
+ function Ky(e, t) {
13789
13880
  let n = Y.toDOMNode(e, e);
13790
- return Hy(n, t.anchorNode) && Hy(n, t.focusNode);
13881
+ return qy(n, t.anchorNode) && qy(n, t.focusNode);
13791
13882
  }
13792
- function Hy(e, t) {
13883
+ function qy(e, t) {
13793
13884
  return !!(t && (t === e || e.contains(t)));
13794
13885
  }
13795
- function Uy(e, t) {
13886
+ function Jy(e, t) {
13796
13887
  return Oe(t.toolbarStateReaders.reduce((t, n) => [...t, ...n({ editor: e })], []));
13797
13888
  }
13798
13889
  //#endregion
13799
13890
  //#region src/rich-text-editor/primitives/Editor.tsx
13800
- function Wy({ "aria-label": e, apiRef: t, className: n, editorId: r, initialValue: i, onChange: a, onObjectInteraction: o, onPasteHtml: s, onPasteImageFiles: c, onPasteImageSources: l, placeholder: u, toolbar: f, value: m }) {
13891
+ function Yy({ "aria-label": e, apiRef: t, className: n, editorId: r, initialValue: i, onChange: a, onObjectInteraction: o, onPasteHtml: s, onPasteImageFiles: c, onPasteImageSources: l, placeholder: u, toolbar: f, value: m }) {
13801
13892
  var h;
13802
- let g = nt(), [_] = y(() => r == null ? `rte-editor-${g}` : r), { activeEditorId: v, clearEditorFocus: b, focusEditor: S, isEditorFocused: C, plugins: w, refreshToolbarState: T, registerEditor: E, setCommandTargetEditor: D } = Ie(), { editor: O, registry: k } = uy(w), [A] = y(() => Ny(O, k));
13893
+ let g = nt(), [_] = y(() => r == null ? `rte-editor-${g}` : r), { activeEditorId: v, clearEditorFocus: b, focusEditor: S, isEditorFocused: C, plugins: w, refreshToolbarState: T, registerEditor: E, setCommandTargetEditor: D } = Ie(), { editor: O, registry: k } = my(w), [A] = y(() => Ry(O, k));
13803
13894
  p(() => E(_, A, f), [
13804
13895
  E,
13805
13896
  A,
@@ -13835,7 +13926,7 @@ function Wy({ "aria-label": e, apiRef: t, className: n, editorId: r, initialValu
13835
13926
  "data-active": v === _ ? "true" : void 0,
13836
13927
  "data-editor-id": _,
13837
13928
  [rt]: _,
13838
- children: /* @__PURE__ */ x(wy, {
13929
+ children: /* @__PURE__ */ x(Oy, {
13839
13930
  apiRef: t,
13840
13931
  className: Ee(ut.content, n),
13841
13932
  editor: A.editor,
@@ -13859,9 +13950,9 @@ function Wy({ "aria-label": e, apiRef: t, className: n, editorId: r, initialValu
13859
13950
  }
13860
13951
  //#endregion
13861
13952
  //#region src/rich-text-editor/primitives/InsertNodeButton.tsx
13862
- var Gy = ["nodeType", "payload"];
13863
- function Ky(e) {
13864
- let { nodeType: t, payload: n } = e, r = F(e, Gy);
13953
+ var Xy = ["nodeType", "payload"];
13954
+ function Zy(e) {
13955
+ let { nodeType: t, payload: n } = e, r = F(e, Xy);
13865
13956
  return /* @__PURE__ */ x(Ke, R({
13866
13957
  action: {
13867
13958
  command: Sd,
@@ -13874,21 +13965,21 @@ function Ky(e) {
13874
13965
  }
13875
13966
  //#endregion
13876
13967
  //#region src/rich-text-editor/primitives/Root.tsx
13877
- function qy({ children: e, className: t, defaultActiveEditorId: n, id: r, onCommand: i, onEditorFocusChange: a, plugins: o }) {
13968
+ function Qy({ children: e, className: t, defaultActiveEditorId: n, id: r, onCommand: i, onEditorFocusChange: a, plugins: o }) {
13878
13969
  return /* @__PURE__ */ x(Fe, {
13879
13970
  defaultActiveEditorId: n,
13880
13971
  onCommand: i,
13881
13972
  onEditorFocusChange: a,
13882
13973
  plugins: o,
13883
13974
  rootId: r,
13884
- children: /* @__PURE__ */ x(Jy, {
13975
+ children: /* @__PURE__ */ x($y, {
13885
13976
  className: t,
13886
13977
  rootId: r,
13887
13978
  children: e
13888
13979
  })
13889
13980
  });
13890
13981
  }
13891
- function Jy({ children: e, className: t, rootId: n }) {
13982
+ function $y({ children: e, className: t, rootId: n }) {
13892
13983
  let { clearEditorFocus: r, focusEditor: i } = Ie();
13893
13984
  return /* @__PURE__ */ x("div", {
13894
13985
  className: Ee(ut.scope, t),
@@ -13912,10 +14003,10 @@ function Jy({ children: e, className: t, rootId: n }) {
13912
14003
  }
13913
14004
  //#endregion
13914
14005
  //#region src/rich-text-editor/primitives/Toolbar.tsx
13915
- function Yy({ "aria-label": e, children: t, className: n, defaultContent: r, visibleWhen: i = "always" }) {
14006
+ function eb({ "aria-label": e, children: t, className: n, defaultContent: r, visibleWhen: i = "always" }) {
13916
14007
  let { activeToolbar: a, focusedEditorId: o, registerToolbar: s } = Ie(), c = i === "editor-focus" && !o;
13917
14008
  p(() => s(), [s]);
13918
- let l = eb({
14009
+ let l = ab({
13919
14010
  activeToolbar: a,
13920
14011
  children: t,
13921
14012
  defaultContent: r
@@ -13924,7 +14015,7 @@ function Yy({ "aria-label": e, children: t, className: n, defaultContent: r, vis
13924
14015
  "aria-label": e,
13925
14016
  hidden: c,
13926
14017
  onMouseDownCapture: (e) => {
13927
- e.defaultPrevented || Xy(e.target) || e.preventDefault();
14018
+ e.defaultPrevented || tb(e.target) || e.preventDefault();
13928
14019
  },
13929
14020
  [it]: "true",
13930
14021
  role: "toolbar",
@@ -13934,34 +14025,34 @@ function Yy({ "aria-label": e, children: t, className: n, defaultContent: r, vis
13934
14025
  })
13935
14026
  });
13936
14027
  }
13937
- function Xy(e) {
14028
+ function tb(e) {
13938
14029
  return e instanceof Element && !!e.closest("input, select, textarea");
13939
14030
  }
13940
- function Zy({ children: e }) {
14031
+ function nb({ children: e }) {
13941
14032
  return /* @__PURE__ */ x(b, { children: e });
13942
14033
  }
13943
- function Qy({ children: e }) {
14034
+ function rb({ children: e }) {
13944
14035
  return /* @__PURE__ */ x(b, { children: e });
13945
14036
  }
13946
- function $y({ children: e }) {
14037
+ function ib({ children: e }) {
13947
14038
  return /* @__PURE__ */ x(b, { children: e });
13948
14039
  }
13949
- function eb({ activeToolbar: e, children: t, defaultContent: n }) {
14040
+ function ab({ activeToolbar: e, children: t, defaultContent: n }) {
13950
14041
  var r, i, a, o;
13951
- let s = nb(t, Zy);
13952
- return /* @__PURE__ */ x(b, { children: s ? (r = (i = (a = tb(s.props.children, e)) == null ? void 0 : a.props.children) == null ? (o = nb(s.props.children, $y)) == null ? void 0 : o.props.children : i) == null ? n : r : t == null ? n : t });
14042
+ let s = sb(t, nb);
14043
+ return /* @__PURE__ */ x(b, { children: s ? (r = (i = (a = ob(s.props.children, e)) == null ? void 0 : a.props.children) == null ? (o = sb(s.props.children, ib)) == null ? void 0 : o.props.children : i) == null ? n : r : t == null ? n : t });
13953
14044
  }
13954
- function tb(e, t) {
14045
+ function ob(e, t) {
13955
14046
  var n;
13956
- return t ? (n = r.toArray(e).find((e) => l(e) && e.type === Qy && e.props.value === t)) == null ? null : n : null;
14047
+ return t ? (n = r.toArray(e).find((e) => l(e) && e.type === rb && e.props.value === t)) == null ? null : n : null;
13957
14048
  }
13958
- function nb(e, t) {
14049
+ function sb(e, t) {
13959
14050
  var n;
13960
14051
  return (n = r.toArray(e).find((e) => l(e) && e.type === t)) == null ? null : n;
13961
14052
  }
13962
14053
  //#endregion
13963
14054
  //#region src/rich-text-editor/primitives/ToolbarSection.tsx
13964
- function rb({ "aria-label": e, children: t, className: n }) {
14055
+ function cb({ "aria-label": e, children: t, className: n }) {
13965
14056
  return /* @__PURE__ */ x("div", {
13966
14057
  "aria-label": e,
13967
14058
  className: Ee(Re["toolbar-section"], n),
@@ -13971,7 +14062,7 @@ function rb({ "aria-label": e, children: t, className: n }) {
13971
14062
  }
13972
14063
  //#endregion
13973
14064
  //#region src/rich-text-editor/primitives/ToolbarSeparator.tsx
13974
- function ib(e) {
14065
+ function lb(e) {
13975
14066
  let { className: t } = e;
13976
14067
  return /* @__PURE__ */ x("span", {
13977
14068
  "aria-orientation": "vertical",
@@ -13981,43 +14072,43 @@ function ib(e) {
13981
14072
  }
13982
14073
  //#endregion
13983
14074
  //#region src/rich-text-editor/primitives/index.ts
13984
- var ab = Kp(), ob = Object.assign(Yy, {
13985
- AlignCenterButton: qe(sb("alignCenter")),
13986
- AlignLeftButton: qe(sb("alignLeft")),
13987
- AlignRightButton: qe(sb("alignRight")),
13988
- BoldToggle: qe(sb("bold")),
13989
- BulletedListToggle: qe(sb("bulletedList")),
13990
- CodeBlockButton: cb(sb("codeBlock"), "code-block"),
13991
- CodeToggle: qe(sb("code")),
13992
- ColorSelect: Ge(sb("color")),
13993
- Case: Qy,
13994
- Default: $y,
13995
- DividerButton: cb(sb("divider"), "divider"),
13996
- FontSizeSelect: Ge(sb("fontSize")),
13997
- FormulaButton: cb(sb("formula"), "formula"),
13998
- Heading1Button: qe(sb("heading1")),
13999
- Heading2Button: qe(sb("heading2")),
14000
- Heading3Button: qe(sb("heading3")),
14001
- ImageButton: cb(sb("image"), "image"),
14002
- InsertNodeButton: Ky,
14003
- ItalicToggle: qe(sb("italic")),
14004
- NumberedListToggle: qe(sb("numberedList")),
14005
- RedoButton: qe(sb("redo")),
14006
- Section: rb,
14007
- Separator: ib,
14008
- StrikeToggle: qe(sb("strike")),
14009
- Switch: Zy,
14010
- TableButton: cb(sb("table"), "table"),
14011
- UnderlineToggle: qe(sb("underline")),
14012
- UndoButton: qe(sb("undo"))
14075
+ var ub = Kp(), db = Object.assign(eb, {
14076
+ AlignCenterButton: qe(fb("alignCenter")),
14077
+ AlignLeftButton: qe(fb("alignLeft")),
14078
+ AlignRightButton: qe(fb("alignRight")),
14079
+ BoldToggle: qe(fb("bold")),
14080
+ BulletedListToggle: qe(fb("bulletedList")),
14081
+ CodeBlockButton: pb(fb("codeBlock"), "code-block"),
14082
+ CodeToggle: qe(fb("code")),
14083
+ ColorSelect: Ge(fb("color")),
14084
+ Case: rb,
14085
+ Default: ib,
14086
+ DividerButton: pb(fb("divider"), "divider"),
14087
+ FontSizeSelect: Ge(fb("fontSize")),
14088
+ FormulaButton: pb(fb("formula"), "formula"),
14089
+ Heading1Button: qe(fb("heading1")),
14090
+ Heading2Button: qe(fb("heading2")),
14091
+ Heading3Button: qe(fb("heading3")),
14092
+ ImageButton: pb(fb("image"), "image"),
14093
+ InsertNodeButton: Zy,
14094
+ ItalicToggle: qe(fb("italic")),
14095
+ NumberedListToggle: qe(fb("numberedList")),
14096
+ RedoButton: qe(fb("redo")),
14097
+ Section: cb,
14098
+ Separator: lb,
14099
+ StrikeToggle: qe(fb("strike")),
14100
+ Switch: nb,
14101
+ TableButton: pb(fb("table"), "table"),
14102
+ UnderlineToggle: qe(fb("underline")),
14103
+ UndoButton: qe(fb("undo"))
14013
14104
  });
14014
- function sb(e) {
14105
+ function fb(e) {
14015
14106
  var t;
14016
- let n = (t = ab.getToolbarAction(e)) == null ? void 0 : t.action;
14107
+ let n = (t = ub.getToolbarAction(e)) == null ? void 0 : t.action;
14017
14108
  if (!n) throw Error(`Missing RichTextEditor toolbar action: ${e}.`);
14018
14109
  return n;
14019
14110
  }
14020
- function cb(e, t) {
14111
+ function pb(e, t) {
14021
14112
  return function(n) {
14022
14113
  var r, i;
14023
14114
  return s(Ke, R(R({ action: e }, n), {}, {
@@ -14027,26 +14118,26 @@ function cb(e, t) {
14027
14118
  };
14028
14119
  }
14029
14120
  var $ = {
14030
- Editor: Wy,
14031
- Root: qy,
14032
- Toolbar: ob
14033
- }, lb = {
14121
+ Editor: Yy,
14122
+ Root: Qy,
14123
+ Toolbar: db
14124
+ }, mb = {
14034
14125
  button: "_button_1v6qc_1",
14035
14126
  icon: "_icon_1v6qc_21"
14036
- }, ub = ["className"];
14037
- function db(e, t) {
14127
+ }, hb = ["className"];
14128
+ function gb(e, t) {
14038
14129
  return function(n) {
14039
14130
  var r;
14040
- let { className: i } = n, a = F(n, ub), { messages: o } = gd(), s = (r = a["aria-label"]) == null ? _d(o, t) : r;
14131
+ let { className: i } = n, a = F(n, hb), { messages: o } = gd(), s = (r = a["aria-label"]) == null ? _d(o, t) : r;
14041
14132
  return /* @__PURE__ */ x(e, R(R({}, a), {}, {
14042
14133
  "aria-label": s,
14043
- className: Ee(lb.button, i)
14134
+ className: Ee(mb.button, i)
14044
14135
  }));
14045
14136
  };
14046
14137
  }
14047
14138
  //#endregion
14048
14139
  //#region src/rich-text-editor/styled/mediaCommands.ts
14049
- function fb() {
14140
+ function _b() {
14050
14141
  let e = Ie();
14051
14142
  return (t, n = "") => {
14052
14143
  e.dispatchCommand(Rd("image", {
@@ -14055,38 +14146,38 @@ function fb() {
14055
14146
  }));
14056
14147
  };
14057
14148
  }
14058
- function pb() {
14149
+ function vb() {
14059
14150
  let e = Ie();
14060
14151
  return (t) => {
14061
14152
  e.dispatchCommand(Rd("formula", t));
14062
14153
  };
14063
14154
  }
14064
- function mb(e, t) {
14155
+ function yb(e, t) {
14065
14156
  let n = encodeURIComponent(e);
14066
14157
  if (typeof t == "function") return t(e);
14067
14158
  if (typeof t == "string" && t.includes("{latex}")) return t.split("{latex}").join(n);
14068
- let r = t || hb();
14159
+ let r = t || bb();
14069
14160
  return `${r}${r.includes("?") ? "&" : "?"}display=inline&mathUrl=${n}`;
14070
14161
  }
14071
- function hb() {
14162
+ function bb() {
14072
14163
  return typeof window < "u" && window.location.hostname.includes("yungu.org") ? "https://ai.yungu.org/center/api/custom-services/document-render/api/math-svg" : "https://ai.daily.yungu-inc.org/center/api/custom-services/document-render/api/math-svg";
14073
14164
  }
14074
14165
  //#endregion
14075
14166
  //#region src/rich-text-editor/styled/mediaContext.tsx
14076
- var gb = o(null);
14077
- function _b({ children: e, formulaRenderUrl: t, onOpenFormula: n, onOpenImageUpload: r, runtime: i, uploadImage: a }) {
14078
- let o = vb({
14167
+ var xb = o(null);
14168
+ function Sb({ children: e, formulaRenderUrl: t, onOpenFormula: n, onOpenImageUpload: r, runtime: i, uploadImage: a }) {
14169
+ let o = Cb({
14079
14170
  formulaRenderUrl: t,
14080
14171
  onOpenFormula: n,
14081
14172
  onOpenImageUpload: r,
14082
14173
  uploadImage: a
14083
14174
  });
14084
- return /* @__PURE__ */ x(gb.Provider, {
14175
+ return /* @__PURE__ */ x(xb.Provider, {
14085
14176
  value: i == null ? o : i,
14086
14177
  children: e
14087
14178
  });
14088
14179
  }
14089
- function vb({ formulaRenderUrl: e, onOpenFormula: t, onOpenImageUpload: n, uploadImage: r }) {
14180
+ function Cb({ formulaRenderUrl: e, onOpenFormula: t, onOpenImageUpload: n, uploadImage: r }) {
14090
14181
  let [i, a] = y({
14091
14182
  initialLatex: "",
14092
14183
  open: !1,
@@ -14115,19 +14206,19 @@ function vb({ formulaRenderUrl: e, onOpenFormula: t, onOpenImageUpload: n, uploa
14115
14206
  r
14116
14207
  ]);
14117
14208
  }
14118
- function yb() {
14119
- let e = f(gb);
14209
+ function wb() {
14210
+ let e = f(xb);
14120
14211
  if (!e) throw Error("RichTextEditor media controls must be rendered inside RichTextEditor.Root.");
14121
14212
  return e;
14122
14213
  }
14123
- var bb = {
14214
+ var Tb = {
14124
14215
  root: "_root_1dv0n_1",
14125
14216
  toolbar: "_toolbar_1dv0n_18",
14126
14217
  "toolbar-section": "_toolbar-section_1dv0n_25",
14127
14218
  "toolbar-separator": "_toolbar-separator_1dv0n_29",
14128
14219
  "content-root": "_content-root_1dv0n_35",
14129
14220
  content: "_content_1dv0n_35"
14130
- }, xb = {
14221
+ }, Eb = {
14131
14222
  dialog: "_dialog_1dv6z_1",
14132
14223
  title: "_title_1dv6z_19",
14133
14224
  description: "_description_1dv6z_26",
@@ -14139,7 +14230,7 @@ var bb = {
14139
14230
  };
14140
14231
  //#endregion
14141
14232
  //#region src/rich-text-editor/styled/usePasteFormatChoice.tsx
14142
- function Sb() {
14233
+ function Db() {
14143
14234
  let [e, t] = y(null), n = v(null), r = d((e, r) => new Promise((i) => {
14144
14235
  var a;
14145
14236
  (a = n.current) == null || a.resolve(null), n.current = {
@@ -14153,7 +14244,7 @@ function Sb() {
14153
14244
  return (e = n.current) == null ? void 0 : e.resolve(null);
14154
14245
  }, []), {
14155
14246
  chooseFormat: r,
14156
- dialog: e ? /* @__PURE__ */ x(Cb, {
14247
+ dialog: e ? /* @__PURE__ */ x(Ob, {
14157
14248
  onChoose: (e) => {
14158
14249
  var r;
14159
14250
  (r = n.current) == null || r.resolve(e), n.current = null, t(null);
@@ -14162,7 +14253,7 @@ function Sb() {
14162
14253
  }) : null
14163
14254
  };
14164
14255
  }
14165
- function Cb({ onChoose: e, pending: t }) {
14256
+ function Ob({ onChoose: e, pending: t }) {
14166
14257
  let { messages: n } = gd(), r = v(null);
14167
14258
  return p(() => {
14168
14259
  let e = r.current;
@@ -14172,25 +14263,25 @@ function Cb({ onChoose: e, pending: t }) {
14172
14263
  };
14173
14264
  }, []), /* @__PURE__ */ S("dialog", {
14174
14265
  "aria-label": n.pasteFormatLabel,
14175
- className: xb.dialog,
14266
+ className: Eb.dialog,
14176
14267
  onCancel: (t) => {
14177
14268
  t.preventDefault(), e(null);
14178
14269
  },
14179
14270
  ref: r,
14180
14271
  children: [
14181
14272
  /* @__PURE__ */ x("h2", {
14182
- className: xb.title,
14273
+ className: Eb.title,
14183
14274
  children: n.pasteFormatLabel
14184
14275
  }),
14185
14276
  /* @__PURE__ */ x("p", {
14186
- className: xb.description,
14277
+ className: Eb.description,
14187
14278
  children: n.pasteFormatDescription
14188
14279
  }),
14189
14280
  /* @__PURE__ */ S("div", {
14190
- className: xb.options,
14281
+ className: Eb.options,
14191
14282
  children: [/* @__PURE__ */ S("button", {
14192
14283
  "aria-label": n.pasteKeepOriginal,
14193
- className: xb.option,
14284
+ className: Eb.option,
14194
14285
  onClick: () => e(t.html),
14195
14286
  type: "button",
14196
14287
  children: [/* @__PURE__ */ x(cd, {
@@ -14199,7 +14290,7 @@ function Cb({ onChoose: e, pending: t }) {
14199
14290
  }), n.pasteKeepOriginal]
14200
14291
  }), /* @__PURE__ */ S("button", {
14201
14292
  "aria-label": n.pasteConvertMarkdown,
14202
- className: `${xb.option} ${xb.markdown}`,
14293
+ className: `${Eb.option} ${Eb.markdown}`,
14203
14294
  onClick: () => e(t.markdownHtml),
14204
14295
  type: "button",
14205
14296
  children: [/* @__PURE__ */ x(Gu, {
@@ -14209,9 +14300,9 @@ function Cb({ onChoose: e, pending: t }) {
14209
14300
  })]
14210
14301
  }),
14211
14302
  /* @__PURE__ */ x("footer", {
14212
- className: xb.footer,
14303
+ className: Eb.footer,
14213
14304
  children: /* @__PURE__ */ x("button", {
14214
- className: xb.cancel,
14305
+ className: Eb.cancel,
14215
14306
  onClick: () => e(null),
14216
14307
  type: "button",
14217
14308
  children: n.pasteCancel
@@ -14222,33 +14313,33 @@ function Cb({ onChoose: e, pending: t }) {
14222
14313
  }
14223
14314
  //#endregion
14224
14315
  //#region src/rich-text-editor/styled/Editor.tsx
14225
- var wb = [
14316
+ var kb = [
14226
14317
  "className",
14227
14318
  "onPasteImageFiles",
14228
14319
  "onPasteImageSources",
14229
14320
  "onObjectInteraction",
14230
14321
  "placeholder"
14231
14322
  ];
14232
- function Tb(t) {
14233
- let { className: n, onPasteImageFiles: r, onPasteImageSources: i, onObjectInteraction: a, placeholder: o } = t, s = F(t, wb), { messages: c } = gd(), l = yb(), u = fb(), { chooseFormat: d, dialog: f } = Sb(), p = (e) => {
14323
+ function Ab(t) {
14324
+ let { className: n, onPasteImageFiles: r, onPasteImageSources: i, onObjectInteraction: a, placeholder: o } = t, s = F(t, kb), { messages: c } = gd(), l = wb(), u = _b(), { chooseFormat: d, dialog: f } = Db(), p = (e) => {
14234
14325
  a == null || a(e), e.action === "formula.edit" && l.openFormulaDialog(typeof e.element.latex == "string" ? e.element.latex : "", e.updateElement);
14235
14326
  }, m = (e) => {
14236
- r == null || r(e), l.uploadImage && Ab(e, l.uploadImage, u);
14327
+ r == null || r(e), l.uploadImage && Fb(e, l.uploadImage, u);
14237
14328
  }, h = (e) => {
14238
- i == null || i(e), l.uploadImage && Promise.all(e.map((e, t) => jb(e, t))).then((e) => Ab(e.filter((e) => !!e), l.uploadImage, u));
14329
+ i == null || i(e), l.uploadImage && Promise.all(e.map((e, t) => Ib(e, t))).then((e) => Fb(e.filter((e) => !!e), l.uploadImage, u));
14239
14330
  }, g = function() {
14240
14331
  var t = e(function* (e, t) {
14241
14332
  let n = t != null && t.markdownHtml ? yield d(e, t.markdownHtml) : e;
14242
- return n === null ? null : l.uploadImage ? yield Db(Eb(n, l.formulaRenderUrl), l.uploadImage) : Eb(n, l.formulaRenderUrl);
14333
+ return n === null ? null : l.uploadImage ? yield Mb(jb(n, l.formulaRenderUrl), l.uploadImage) : jb(n, l.formulaRenderUrl);
14243
14334
  });
14244
14335
  return function(e, n) {
14245
14336
  return t.apply(this, arguments);
14246
14337
  };
14247
14338
  }();
14248
14339
  return /* @__PURE__ */ S("div", {
14249
- className: bb["content-root"],
14340
+ className: Tb["content-root"],
14250
14341
  children: [f, /* @__PURE__ */ x($.Editor, R(R({}, s), {}, {
14251
- className: Ee(bb.content, n),
14342
+ className: Ee(Tb.content, n),
14252
14343
  onObjectInteraction: p,
14253
14344
  onPasteHtml: g,
14254
14345
  onPasteImageFiles: m,
@@ -14257,27 +14348,27 @@ function Tb(t) {
14257
14348
  }))]
14258
14349
  });
14259
14350
  }
14260
- function Eb(e, t) {
14351
+ function jb(e, t) {
14261
14352
  let n = new DOMParser().parseFromString(e, "text/html");
14262
14353
  for (let e of n.querySelectorAll("[data-rte-node=\"formula\"][data-latex]")) if (!e.dataset.src && !e.getAttribute("src")) {
14263
14354
  var r;
14264
- e.dataset.src = mb((r = e.dataset.latex) == null ? "" : r, t);
14355
+ e.dataset.src = yb((r = e.dataset.latex) == null ? "" : r, t);
14265
14356
  }
14266
14357
  return n.body.innerHTML;
14267
14358
  }
14268
- function Db(e, t) {
14269
- return Ob.apply(this, arguments);
14359
+ function Mb(e, t) {
14360
+ return Nb.apply(this, arguments);
14270
14361
  }
14271
- function Ob() {
14272
- return Ob = e(function* (t, n) {
14362
+ function Nb() {
14363
+ return Nb = e(function* (t, n) {
14273
14364
  if (!t.trim() || typeof DOMParser > "u") return t;
14274
14365
  let r = new DOMParser().parseFromString(`<!doctype html><body>${t}</body>`, "text/html");
14275
- kb(r.body);
14366
+ Pb(r.body);
14276
14367
  let i = Array.from(r.body.querySelectorAll("img"));
14277
14368
  return yield Promise.all(i.map(function() {
14278
14369
  var t = e(function* (e, t) {
14279
14370
  var r;
14280
- let i = yield jb((r = e.getAttribute("src")) == null ? "" : r, t);
14371
+ let i = yield Ib((r = e.getAttribute("src")) == null ? "" : r, t);
14281
14372
  if (!i) {
14282
14373
  e.remove();
14283
14374
  return;
@@ -14293,25 +14384,25 @@ function Ob() {
14293
14384
  return t.apply(this, arguments);
14294
14385
  };
14295
14386
  }())), r.body.innerHTML;
14296
- }), Ob.apply(this, arguments);
14387
+ }), Nb.apply(this, arguments);
14297
14388
  }
14298
- function kb(e) {
14389
+ function Pb(e) {
14299
14390
  e.querySelectorAll("head,link,meta,script,style,title,xml").forEach((e) => e.remove());
14300
14391
  }
14301
- function Ab(e, t, n) {
14392
+ function Fb(e, t, n) {
14302
14393
  t && e.forEach((e) => {
14303
14394
  Promise.resolve(t(e)).then((t) => {
14304
14395
  t && n(t, e.name);
14305
14396
  });
14306
14397
  });
14307
14398
  }
14308
- function jb(e, t) {
14309
- return Mb.apply(this, arguments);
14399
+ function Ib(e, t) {
14400
+ return Lb.apply(this, arguments);
14310
14401
  }
14311
- function Mb() {
14312
- return Mb = e(function* (e, t) {
14313
- let n = Nb(e);
14314
- if (!Pb(n) || typeof fetch != "function") return null;
14402
+ function Lb() {
14403
+ return Lb = e(function* (e, t) {
14404
+ let n = Rb(e);
14405
+ if (!zb(n) || typeof fetch != "function") return null;
14315
14406
  try {
14316
14407
  let e = yield fetch(n);
14317
14408
  if (!e.ok) return null;
@@ -14320,56 +14411,56 @@ function Mb() {
14320
14411
  } catch (e) {
14321
14412
  return null;
14322
14413
  }
14323
- }), Mb.apply(this, arguments);
14414
+ }), Lb.apply(this, arguments);
14324
14415
  }
14325
- function Nb(e) {
14416
+ function Rb(e) {
14326
14417
  return e.startsWith("//") && typeof window < "u" && window.location ? `${window.location.protocol}${e}` : e;
14327
14418
  }
14328
- function Pb(e) {
14419
+ function zb(e) {
14329
14420
  return e.startsWith("data:image/") || e.startsWith("blob:") || /^https?:\/\//i.test(e);
14330
14421
  }
14331
14422
  //#endregion
14332
14423
  //#region src/vendor/mathlive.ts
14333
- var Fb = null;
14334
- function Ib() {
14424
+ var Bb = null;
14425
+ function Vb() {
14335
14426
  var e;
14336
14427
  return !!(typeof window < "u" && (e = window.customElements) != null && e.get("math-field"));
14337
14428
  }
14338
- function Lb(t) {
14339
- return Fb || (Fb = import("./mathlive.min-DU_tngF6.mjs").then((e) => {
14340
- if (!Ib()) throw Error("MathLive did not register math-field.");
14341
- Bb(e, t);
14342
- })), Fb.then(e(function* () {
14343
- Bb(yield import("./mathlive.min-DU_tngF6.mjs"), t);
14429
+ function Hb(t) {
14430
+ return Bb || (Bb = import("./mathlive.min-DU_tngF6.mjs").then((e) => {
14431
+ if (!Vb()) throw Error("MathLive did not register math-field.");
14432
+ Gb(e, t);
14433
+ })), Bb.then(e(function* () {
14434
+ Gb(yield import("./mathlive.min-DU_tngF6.mjs"), t);
14344
14435
  }));
14345
14436
  }
14346
- function Rb() {
14347
- Hb();
14348
- let e = Vb();
14349
- e != null && e.hide && e.hide(), Ub();
14437
+ function Ub() {
14438
+ qb();
14439
+ let e = Kb();
14440
+ e != null && e.hide && e.hide(), Jb();
14350
14441
  }
14351
- function zb() {
14352
- let e = Vb();
14442
+ function Wb() {
14443
+ let e = Kb();
14353
14444
  e != null && e.show && e.show();
14354
14445
  }
14355
- function Bb(e, t) {
14446
+ function Gb(e, t) {
14356
14447
  e.MathfieldElement.locale = t, e.setKeyboardLayoutLocale(t);
14357
14448
  }
14358
- function Vb() {
14449
+ function Kb() {
14359
14450
  var e;
14360
14451
  return typeof window > "u" || (e = window.mathVirtualKeyboard) == null ? null : e;
14361
14452
  }
14362
- function Hb() {
14453
+ function qb() {
14363
14454
  if (typeof document > "u") return;
14364
14455
  let e = document.activeElement;
14365
14456
  e instanceof HTMLElement && e.blur();
14366
14457
  }
14367
- function Ub() {
14458
+ function Jb() {
14368
14459
  typeof document > "u" || document.querySelectorAll("#mathlive-suggestion-popover, #mathlive-environment-popover").forEach((e) => {
14369
14460
  e.classList.remove("is-visible"), e.setAttribute("aria-hidden", "true");
14370
14461
  });
14371
14462
  }
14372
- var Wb = {
14463
+ var Yb = {
14373
14464
  "dialog-backdrop": "_dialog-backdrop_u3zy8_1",
14374
14465
  dialog: "_dialog_u3zy8_1",
14375
14466
  "dialog-textarea": "_dialog-textarea_u3zy8_29",
@@ -14382,13 +14473,13 @@ var Wb = {
14382
14473
  };
14383
14474
  //#endregion
14384
14475
  //#region src/rich-text-editor/styled/MathFieldInput.tsx
14385
- function Gb({ autoFocus: e, onChange: t, value: n }) {
14476
+ function Xb({ autoFocus: e, onChange: t, value: n }) {
14386
14477
  let { locale: r, messages: i } = gd(), [a, o] = y(null), [c, l] = y(!1), [u, f] = y(!1), m = d((e) => {
14387
14478
  o(e);
14388
14479
  }, []);
14389
14480
  return p(() => {
14390
14481
  let e = !0;
14391
- return Lb(r).then(() => {
14482
+ return Hb(r).then(() => {
14392
14483
  e && l(!0);
14393
14484
  }).catch(() => {
14394
14485
  e && f(!0);
@@ -14398,22 +14489,22 @@ function Gb({ autoFocus: e, onChange: t, value: n }) {
14398
14489
  }, [r]), p(() => {
14399
14490
  if (!c || !a) return;
14400
14491
  let e = () => {
14401
- t(Kb(a));
14492
+ t(Zb(a));
14402
14493
  }, n = () => {
14403
- zb();
14494
+ Wb();
14404
14495
  }, r = () => {
14405
- Rb();
14496
+ Ub();
14406
14497
  };
14407
14498
  return a.addEventListener("input", e), a.addEventListener("focusin", n), a.addEventListener("focusout", r), () => {
14408
- a.removeEventListener("input", e), a.removeEventListener("focusin", n), a.removeEventListener("focusout", r), Rb();
14499
+ a.removeEventListener("input", e), a.removeEventListener("focusin", n), a.removeEventListener("focusout", r), Ub();
14409
14500
  };
14410
14501
  }, [
14411
14502
  a,
14412
14503
  t,
14413
14504
  c
14414
- ]), p(() => () => Rb(), []), p(() => {
14505
+ ]), p(() => () => Ub(), []), p(() => {
14415
14506
  var e;
14416
- !c || !a || Kb(a) === n || (e = a.setValue) == null || e.call(a, n, { silenceNotifications: !0 });
14507
+ !c || !a || Zb(a) === n || (e = a.setValue) == null || e.call(a, n, { silenceNotifications: !0 });
14417
14508
  }, [
14418
14509
  a,
14419
14510
  c,
@@ -14425,29 +14516,29 @@ function Gb({ autoFocus: e, onChange: t, value: n }) {
14425
14516
  a,
14426
14517
  c
14427
14518
  ]), u ? /* @__PURE__ */ x("div", {
14428
- className: Wb["math-field-status"],
14519
+ className: Yb["math-field-status"],
14429
14520
  children: i.formulaEditorFailed
14430
14521
  }) : c ? s("math-field", {
14431
- class: Wb["math-field"],
14522
+ class: Yb["math-field"],
14432
14523
  "math-virtual-keyboard-policy": "sandboxed",
14433
14524
  ref: m,
14434
14525
  "smart-fence": ""
14435
14526
  }) : /* @__PURE__ */ x("div", {
14436
- className: Wb["math-field-status"],
14527
+ className: Yb["math-field-status"],
14437
14528
  children: i.formulaEditorLoading
14438
14529
  });
14439
14530
  }
14440
- function Kb(e) {
14531
+ function Zb(e) {
14441
14532
  var t;
14442
14533
  return e.getValue ? e.getValue("latex") : (t = e.value) == null ? "" : t;
14443
14534
  }
14444
14535
  //#endregion
14445
14536
  //#region src/rich-text-editor/styled/FormulaDialogContent.tsx
14446
- function qb() {
14447
- let { messages: e } = gd(), t = yb(), n = pb(), [r, i] = y(t.formulaDialog.initialLatex), a = r.trim(), o = a ? mb(a, t.formulaRenderUrl) : "", s = d(() => {
14448
- Rb(), t.closeFormulaDialog();
14537
+ function Qb() {
14538
+ let { messages: e } = gd(), t = wb(), n = vb(), [r, i] = y(t.formulaDialog.initialLatex), a = r.trim(), o = a ? yb(a, t.formulaRenderUrl) : "", s = d(() => {
14539
+ Ub(), t.closeFormulaDialog();
14449
14540
  }, [t]);
14450
- p(() => () => Rb(), []);
14541
+ p(() => () => Ub(), []);
14451
14542
  let c = () => {
14452
14543
  if (!a) {
14453
14544
  s();
@@ -14455,46 +14546,46 @@ function qb() {
14455
14546
  }
14456
14547
  let e = {
14457
14548
  latex: a,
14458
- src: mb(a, t.formulaRenderUrl)
14549
+ src: yb(a, t.formulaRenderUrl)
14459
14550
  };
14460
14551
  t.formulaDialog.updateFormula ? t.formulaDialog.updateFormula(e) : n(e), s();
14461
14552
  };
14462
14553
  return /* @__PURE__ */ x("div", {
14463
- className: Wb["dialog-backdrop"],
14554
+ className: Yb["dialog-backdrop"],
14464
14555
  role: "presentation",
14465
14556
  children: /* @__PURE__ */ S("section", {
14466
14557
  "aria-label": e.formulaDialogLabel,
14467
- className: Wb.dialog,
14558
+ className: Yb.dialog,
14468
14559
  role: "dialog",
14469
14560
  "aria-modal": "true",
14470
14561
  onKeyDown: (e) => {
14471
14562
  e.key === "Escape" && (e.stopPropagation(), s());
14472
14563
  },
14473
14564
  children: [
14474
- /* @__PURE__ */ x(Gb, {
14565
+ /* @__PURE__ */ x(Xb, {
14475
14566
  autoFocus: !0,
14476
14567
  onChange: i,
14477
14568
  value: r
14478
14569
  }),
14479
14570
  /* @__PURE__ */ x("textarea", {
14480
14571
  "aria-label": e.formulaLatexInput,
14481
- className: Wb["dialog-textarea"],
14572
+ className: Yb["dialog-textarea"],
14482
14573
  onChange: (e) => i(e.target.value),
14483
14574
  value: r
14484
14575
  }),
14485
14576
  /* @__PURE__ */ x("div", {
14486
- className: Wb["formula-preview"],
14577
+ className: Yb["formula-preview"],
14487
14578
  children: o ? /* @__PURE__ */ x("img", {
14488
14579
  alt: a,
14489
- className: Wb["formula-preview-image"],
14580
+ className: Yb["formula-preview-image"],
14490
14581
  src: o
14491
14582
  }) : e.formulaPreviewEmpty
14492
14583
  }),
14493
14584
  /* @__PURE__ */ S("div", {
14494
- className: Wb["dialog-actions"],
14585
+ className: Yb["dialog-actions"],
14495
14586
  children: [/* @__PURE__ */ x("button", {
14496
14587
  "aria-label": e.formulaDialogCancel,
14497
- className: Wb["dialog-button"],
14588
+ className: Yb["dialog-button"],
14498
14589
  onMouseDown: (e) => {
14499
14590
  e.preventDefault(), s();
14500
14591
  },
@@ -14503,7 +14594,7 @@ function qb() {
14503
14594
  children: e.formulaDialogCancel
14504
14595
  }), /* @__PURE__ */ x("button", {
14505
14596
  "aria-label": e.formulaDialogInsert,
14506
- className: Wb["dialog-button"],
14597
+ className: Yb["dialog-button"],
14507
14598
  onMouseDown: (e) => {
14508
14599
  e.preventDefault(), c();
14509
14600
  },
@@ -14518,63 +14609,63 @@ function qb() {
14518
14609
  }
14519
14610
  //#endregion
14520
14611
  //#region src/rich-text-editor/styled/FormulaDialog.tsx
14521
- function Jb() {
14522
- let e = yb();
14523
- return e.formulaDialog.open ? /* @__PURE__ */ x(qb, {}, e.formulaDialog.initialLatex) : null;
14612
+ function $b() {
14613
+ let e = wb();
14614
+ return e.formulaDialog.open ? /* @__PURE__ */ x(Qb, {}, e.formulaDialog.initialLatex) : null;
14524
14615
  }
14525
14616
  //#endregion
14526
14617
  //#region src/rich-text-editor/styled/Root.tsx
14527
- function Yb({ children: e, className: t, defaultActiveEditorId: n, formulaRenderUrl: r, id: i, locale: a, messages: o, onCommand: s, onEditorFocusChange: c, onOpenFormula: l, onOpenImageUpload: u, plugins: d, uploadImage: f }) {
14618
+ function ex({ children: e, className: t, defaultActiveEditorId: n, formulaRenderUrl: r, id: i, locale: a, messages: o, onCommand: s, onEditorFocusChange: c, onOpenFormula: l, onOpenImageUpload: u, plugins: d, uploadImage: f }) {
14528
14619
  return /* @__PURE__ */ x(hd, {
14529
14620
  locale: a,
14530
14621
  messages: o,
14531
- children: /* @__PURE__ */ x(_b, {
14622
+ children: /* @__PURE__ */ x(Sb, {
14532
14623
  formulaRenderUrl: r,
14533
14624
  onOpenFormula: l,
14534
14625
  onOpenImageUpload: u,
14535
14626
  uploadImage: f,
14536
14627
  children: /* @__PURE__ */ S($.Root, {
14537
- className: Ee(bb.root, t),
14628
+ className: Ee(Tb.root, t),
14538
14629
  defaultActiveEditorId: n,
14539
14630
  id: i,
14540
14631
  onCommand: s,
14541
14632
  onEditorFocusChange: c,
14542
14633
  plugins: d,
14543
- children: [e, /* @__PURE__ */ x(Jb, {})]
14634
+ children: [e, /* @__PURE__ */ x($b, {})]
14544
14635
  })
14545
14636
  })
14546
14637
  });
14547
14638
  }
14548
14639
  //#endregion
14549
14640
  //#region src/rich-text-editor/styled/DefaultToolbarSection.tsx
14550
- var Xb = ["children"];
14551
- function Zb(e) {
14552
- let { children: t } = e, n = F(e, Xb);
14553
- return /* @__PURE__ */ x(ob.Section, {
14641
+ var tx = ["children"];
14642
+ function nx(e) {
14643
+ let { children: t } = e, n = F(e, tx);
14644
+ return /* @__PURE__ */ x(db.Section, {
14554
14645
  "aria-label": n["aria-label"],
14555
- className: bb["toolbar-section"],
14646
+ className: Tb["toolbar-section"],
14556
14647
  children: t
14557
14648
  });
14558
14649
  }
14559
14650
  //#endregion
14560
14651
  //#region src/rich-text-editor/styled/DefaultToolbarSeparator.tsx
14561
- function Qb() {
14562
- return /* @__PURE__ */ x(ob.Separator, { className: bb["toolbar-separator"] });
14652
+ function rx() {
14653
+ return /* @__PURE__ */ x(db.Separator, { className: Tb["toolbar-separator"] });
14563
14654
  }
14564
14655
  //#endregion
14565
14656
  //#region src/rich-text-editor/styled/createStyledSelectButton.tsx
14566
- var $b = [
14657
+ var ix = [
14567
14658
  "children",
14568
14659
  "className",
14569
14660
  "payload"
14570
14661
  ];
14571
- function ex(e, t, n) {
14662
+ function ax(e, t, n) {
14572
14663
  return function(r) {
14573
14664
  var i, a;
14574
- let { children: o, className: s, payload: c } = r, l = F(r, $b), { messages: u } = gd(), d = (i = l["aria-label"]) == null ? _d(u, n) : i, f = c == null ? l.asChild || !((a = l.options) != null && a.length) ? t : void 0 : c;
14665
+ let { children: o, className: s, payload: c } = r, l = F(r, ix), { messages: u } = gd(), d = (i = l["aria-label"]) == null ? _d(u, n) : i, f = c == null ? l.asChild || !((a = l.options) != null && a.length) ? t : void 0 : c;
14575
14666
  return /* @__PURE__ */ x(e, R(R({}, l), {}, {
14576
14667
  "aria-label": d,
14577
- className: Ee(lb.button, s),
14668
+ className: Ee(mb.button, s),
14578
14669
  payload: f,
14579
14670
  children: o
14580
14671
  }));
@@ -14582,40 +14673,40 @@ function ex(e, t, n) {
14582
14673
  }
14583
14674
  //#endregion
14584
14675
  //#region src/rich-text-editor/styled/createStyledToolbarButton.tsx
14585
- var tx = ["children", "className"];
14586
- function nx(e, t) {
14676
+ var ox = ["children", "className"];
14677
+ function sx(e, t) {
14587
14678
  return function(n) {
14588
14679
  var r;
14589
- let { children: i, className: a } = n, o = F(n, tx), { messages: s } = gd(), c = (r = o["aria-label"]) == null ? _d(s, t) : r;
14680
+ let { children: i, className: a } = n, o = F(n, ox), { messages: s } = gd(), c = (r = o["aria-label"]) == null ? _d(s, t) : r;
14590
14681
  return /* @__PURE__ */ x(e, R(R({}, o), {}, {
14591
14682
  "aria-label": c,
14592
- className: Ee(lb.button, a),
14683
+ className: Ee(mb.button, a),
14593
14684
  children: i
14594
14685
  }));
14595
14686
  };
14596
14687
  }
14597
14688
  //#endregion
14598
14689
  //#region src/rich-text-editor/styled/StyledToolbarIconButton.tsx
14599
- function rx({ className: e, disabled: t = !1, icon: n, label: r, onPress: i }) {
14690
+ function cx({ className: e, disabled: t = !1, icon: n, label: r, onPress: i }) {
14600
14691
  return /* @__PURE__ */ x("button", {
14601
14692
  "aria-label": r,
14602
- className: Ee(lb.button, e),
14693
+ className: Ee(mb.button, e),
14603
14694
  "data-disabled": t ? "true" : void 0,
14604
14695
  disabled: t,
14605
14696
  onClick: i,
14606
14697
  type: "button",
14607
14698
  children: /* @__PURE__ */ x(n, {
14608
14699
  "aria-hidden": "true",
14609
- className: lb.icon
14700
+ className: mb.icon
14610
14701
  })
14611
14702
  });
14612
14703
  }
14613
14704
  //#endregion
14614
14705
  //#region src/rich-text-editor/styled/FormulaButton.tsx
14615
- function ix(e) {
14706
+ function lx(e) {
14616
14707
  var t;
14617
- let { messages: n } = gd(), r = yb();
14618
- return /* @__PURE__ */ x(rx, {
14708
+ let { messages: n } = gd(), r = wb();
14709
+ return /* @__PURE__ */ x(cx, {
14619
14710
  className: e.className,
14620
14711
  disabled: e.disabled,
14621
14712
  icon: nd,
@@ -14633,9 +14724,9 @@ function ix(e) {
14633
14724
  }
14634
14725
  //#endregion
14635
14726
  //#region src/rich-text-editor/styled/ImageButton.tsx
14636
- function ax(t) {
14727
+ function ux(t) {
14637
14728
  var n;
14638
- let { messages: r } = gd(), i = v(null), a = yb(), o = fb(), s = t.disabled || !a.onOpenImageUpload && !a.uploadImage, c = () => {
14729
+ let { messages: r } = gd(), i = v(null), a = wb(), o = _b(), s = t.disabled || !a.onOpenImageUpload && !a.uploadImage, c = () => {
14639
14730
  var e;
14640
14731
  if (!s) {
14641
14732
  if (a.onOpenImageUpload) {
@@ -14654,7 +14745,7 @@ function ax(t) {
14654
14745
  return t.apply(this, arguments);
14655
14746
  };
14656
14747
  }();
14657
- return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(rx, {
14748
+ return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(cx, {
14658
14749
  className: t.className,
14659
14750
  disabled: s,
14660
14751
  icon: Xu,
@@ -14676,118 +14767,118 @@ function ax(t) {
14676
14767
  }
14677
14768
  //#endregion
14678
14769
  //#region src/rich-text-editor/styled/toolbarDescriptors.tsx
14679
- var ox = [
14770
+ var dx = [
14680
14771
  {
14681
- Component: nx($.Toolbar.AlignCenterButton, "toolbarAlignCenter"),
14772
+ Component: sx($.Toolbar.AlignCenterButton, "toolbarAlignCenter"),
14682
14773
  actionKey: "alignCenter",
14683
14774
  messageKey: "toolbarAlignCenter"
14684
14775
  },
14685
14776
  {
14686
- Component: nx($.Toolbar.AlignLeftButton, "toolbarAlignLeft"),
14777
+ Component: sx($.Toolbar.AlignLeftButton, "toolbarAlignLeft"),
14687
14778
  actionKey: "alignLeft",
14688
14779
  messageKey: "toolbarAlignLeft"
14689
14780
  },
14690
14781
  {
14691
- Component: nx($.Toolbar.AlignRightButton, "toolbarAlignRight"),
14782
+ Component: sx($.Toolbar.AlignRightButton, "toolbarAlignRight"),
14692
14783
  actionKey: "alignRight",
14693
14784
  messageKey: "toolbarAlignRight"
14694
14785
  },
14695
14786
  {
14696
- Component: nx($.Toolbar.BoldToggle, "toolbarBold"),
14787
+ Component: sx($.Toolbar.BoldToggle, "toolbarBold"),
14697
14788
  actionKey: "bold",
14698
14789
  messageKey: "toolbarBold"
14699
14790
  },
14700
14791
  {
14701
- Component: nx($.Toolbar.BulletedListToggle, "toolbarBulletedList"),
14792
+ Component: sx($.Toolbar.BulletedListToggle, "toolbarBulletedList"),
14702
14793
  actionKey: "bulletedList",
14703
14794
  messageKey: "toolbarBulletedList"
14704
14795
  },
14705
14796
  {
14706
- Component: nx($.Toolbar.CodeBlockButton, "codeBlockButton"),
14797
+ Component: sx($.Toolbar.CodeBlockButton, "codeBlockButton"),
14707
14798
  actionKey: "codeBlock",
14708
14799
  messageKey: "codeBlockButton"
14709
14800
  },
14710
14801
  {
14711
- Component: nx($.Toolbar.CodeToggle, "toolbarCode"),
14802
+ Component: sx($.Toolbar.CodeToggle, "toolbarCode"),
14712
14803
  actionKey: "code",
14713
14804
  messageKey: "toolbarCode"
14714
14805
  },
14715
14806
  {
14716
- Component: ex($.Toolbar.ColorSelect, "#0445FC", "toolbarTextColor"),
14807
+ Component: ax($.Toolbar.ColorSelect, "#0445FC", "toolbarTextColor"),
14717
14808
  actionKey: "color",
14718
14809
  messageKey: "toolbarTextColor"
14719
14810
  },
14720
14811
  {
14721
- Component: nx($.Toolbar.DividerButton, "toolbarDivider"),
14812
+ Component: sx($.Toolbar.DividerButton, "toolbarDivider"),
14722
14813
  actionKey: "divider",
14723
14814
  messageKey: "toolbarDivider"
14724
14815
  },
14725
14816
  {
14726
- Component: ex($.Toolbar.FontSizeSelect, "16px", "toolbarFontSize"),
14817
+ Component: ax($.Toolbar.FontSizeSelect, "16px", "toolbarFontSize"),
14727
14818
  actionKey: "fontSize",
14728
14819
  messageKey: "toolbarFontSize"
14729
14820
  },
14730
14821
  {
14731
- Component: ix,
14822
+ Component: lx,
14732
14823
  actionKey: "formula",
14733
14824
  messageKey: "toolbarFormula"
14734
14825
  },
14735
14826
  {
14736
- Component: nx($.Toolbar.Heading1Button, "toolbarHeading1"),
14827
+ Component: sx($.Toolbar.Heading1Button, "toolbarHeading1"),
14737
14828
  actionKey: "heading1",
14738
14829
  messageKey: "toolbarHeading1"
14739
14830
  },
14740
14831
  {
14741
- Component: nx($.Toolbar.Heading2Button, "toolbarHeading2"),
14832
+ Component: sx($.Toolbar.Heading2Button, "toolbarHeading2"),
14742
14833
  actionKey: "heading2",
14743
14834
  messageKey: "toolbarHeading2"
14744
14835
  },
14745
14836
  {
14746
- Component: nx($.Toolbar.Heading3Button, "toolbarHeading3"),
14837
+ Component: sx($.Toolbar.Heading3Button, "toolbarHeading3"),
14747
14838
  actionKey: "heading3",
14748
14839
  messageKey: "toolbarHeading3"
14749
14840
  },
14750
14841
  {
14751
- Component: ax,
14842
+ Component: ux,
14752
14843
  actionKey: "image",
14753
14844
  messageKey: "toolbarImage"
14754
14845
  },
14755
14846
  {
14756
- Component: nx($.Toolbar.ItalicToggle, "toolbarItalic"),
14847
+ Component: sx($.Toolbar.ItalicToggle, "toolbarItalic"),
14757
14848
  actionKey: "italic",
14758
14849
  messageKey: "toolbarItalic"
14759
14850
  },
14760
14851
  {
14761
- Component: nx($.Toolbar.NumberedListToggle, "toolbarNumberedList"),
14852
+ Component: sx($.Toolbar.NumberedListToggle, "toolbarNumberedList"),
14762
14853
  actionKey: "numberedList",
14763
14854
  messageKey: "toolbarNumberedList"
14764
14855
  },
14765
14856
  {
14766
- Component: nx($.Toolbar.RedoButton, "toolbarRedo"),
14857
+ Component: sx($.Toolbar.RedoButton, "toolbarRedo"),
14767
14858
  actionKey: "redo",
14768
14859
  messageKey: "toolbarRedo"
14769
14860
  },
14770
14861
  {
14771
- Component: nx($.Toolbar.StrikeToggle, "toolbarStrike"),
14862
+ Component: sx($.Toolbar.StrikeToggle, "toolbarStrike"),
14772
14863
  actionKey: "strike",
14773
14864
  messageKey: "toolbarStrike"
14774
14865
  },
14775
14866
  {
14776
- Component: nx($.Toolbar.TableButton, "toolbarTable"),
14867
+ Component: sx($.Toolbar.TableButton, "toolbarTable"),
14777
14868
  actionKey: "table",
14778
14869
  messageKey: "toolbarTable"
14779
14870
  },
14780
14871
  {
14781
- Component: nx($.Toolbar.UnderlineToggle, "toolbarUnderline"),
14872
+ Component: sx($.Toolbar.UnderlineToggle, "toolbarUnderline"),
14782
14873
  actionKey: "underline",
14783
14874
  messageKey: "toolbarUnderline"
14784
14875
  },
14785
14876
  {
14786
- Component: nx($.Toolbar.UndoButton, "toolbarUndo"),
14877
+ Component: sx($.Toolbar.UndoButton, "toolbarUndo"),
14787
14878
  actionKey: "undo",
14788
14879
  messageKey: "toolbarUndo"
14789
14880
  }
14790
- ], sx = new Map(ox.map((e) => [e.actionKey, e])), cx = new Map([
14881
+ ], fx = new Map(dx.map((e) => [e.actionKey, e])), px = new Map([
14791
14882
  ["Heading", "toolbarGroupHeading"],
14792
14883
  ["History", "toolbarGroupHistory"],
14793
14884
  ["Insert", "toolbarGroupInsert"],
@@ -14795,44 +14886,44 @@ var ox = [
14795
14886
  ["Table", "toolbarGroupTable"],
14796
14887
  ["Text style", "toolbarGroupTextStyle"]
14797
14888
  ]);
14798
- function lx(e) {
14799
- let t = sx.get(e);
14889
+ function mx(e) {
14890
+ let t = fx.get(e);
14800
14891
  if (!t) throw Error(`Missing RichTextEditor styled toolbar action: ${e}.`);
14801
14892
  return t;
14802
14893
  }
14803
- function ux(e) {
14804
- return lx(e).Component;
14894
+ function hx(e) {
14895
+ return mx(e).Component;
14805
14896
  }
14806
- function dx(e) {
14807
- return lx(e).messageKey;
14897
+ function gx(e) {
14898
+ return mx(e).messageKey;
14808
14899
  }
14809
- function fx(e) {
14810
- return cx.get(e);
14900
+ function _x(e) {
14901
+ return px.get(e);
14811
14902
  }
14812
14903
  //#endregion
14813
14904
  //#region src/rich-text-editor/styled/defaultToolbar.tsx
14814
- function px() {
14905
+ function vx() {
14815
14906
  let { messages: e } = gd();
14816
- return /* @__PURE__ */ x(b, { children: _x().map((t, n) => /* @__PURE__ */ S(a, { children: [mx(n), hx(t, e)] }, t.groupKey)) });
14907
+ return /* @__PURE__ */ x(b, { children: Sx().map((t, n) => /* @__PURE__ */ S(a, { children: [yx(n), bx(t, e)] }, t.groupKey)) });
14817
14908
  }
14818
- function mx(e) {
14819
- return e > 0 ? /* @__PURE__ */ x(Qb, {}) : null;
14909
+ function yx(e) {
14910
+ return e > 0 ? /* @__PURE__ */ x(rx, {}) : null;
14820
14911
  }
14821
- function hx(e, t) {
14822
- return /* @__PURE__ */ x(Zb, {
14823
- "aria-label": vx(e, t),
14824
- children: e.actions.map((e) => gx(e, t))
14912
+ function bx(e, t) {
14913
+ return /* @__PURE__ */ x(nx, {
14914
+ "aria-label": Cx(e, t),
14915
+ children: e.actions.map((e) => xx(e, t))
14825
14916
  });
14826
14917
  }
14827
- function gx({ Action: e, actionKey: t, payload: n }, r) {
14828
- let i = yx(t, r);
14918
+ function xx({ Action: e, actionKey: t, payload: n }, r) {
14919
+ let i = wx(t, r);
14829
14920
  return /* @__PURE__ */ x(e, {
14830
14921
  "aria-label": i,
14831
- className: lb.button,
14922
+ className: mb.button,
14832
14923
  payload: n
14833
14924
  }, i);
14834
14925
  }
14835
- function _x() {
14926
+ function Sx() {
14836
14927
  let e = Kp();
14837
14928
  return e.toolbarGroups.map((t) => ({
14838
14929
  actions: t.actionKeys.map((t) => {
@@ -14840,7 +14931,7 @@ function _x() {
14840
14931
  let r = (n = e.getToolbarAction(t)) == null ? void 0 : n.action;
14841
14932
  if (!r) throw Error(`Missing RichTextEditor toolbar action: ${t}.`);
14842
14933
  return {
14843
- Action: bx(t),
14934
+ Action: Tx(t),
14844
14935
  actionKey: t,
14845
14936
  payload: r.payload
14846
14937
  };
@@ -14848,79 +14939,79 @@ function _x() {
14848
14939
  groupKey: t.label
14849
14940
  }));
14850
14941
  }
14851
- function vx(e, t) {
14942
+ function Cx(e, t) {
14852
14943
  var n;
14853
- return (n = _d(t, fx(e.groupKey))) == null ? t.toolbarLabel : n;
14944
+ return (n = _d(t, _x(e.groupKey))) == null ? t.toolbarLabel : n;
14854
14945
  }
14855
- function yx(e, t) {
14946
+ function wx(e, t) {
14856
14947
  var n;
14857
- return (n = _d(t, dx(e))) == null ? t.toolbarLabel : n;
14948
+ return (n = _d(t, gx(e))) == null ? t.toolbarLabel : n;
14858
14949
  }
14859
- function bx(e) {
14860
- return ux(e);
14950
+ function Tx(e) {
14951
+ return hx(e);
14861
14952
  }
14862
14953
  //#endregion
14863
14954
  //#region src/rich-text-editor/styled/Toolbar.tsx
14864
- function xx({ "aria-label": e, children: t, className: n, visibleWhen: r }) {
14955
+ function Ex({ "aria-label": e, children: t, className: n, visibleWhen: r }) {
14865
14956
  let { messages: i } = gd();
14866
14957
  return /* @__PURE__ */ x($.Toolbar, {
14867
14958
  "aria-label": e == null ? i.toolbarLabel : e,
14868
- className: Ee(bb.toolbar, n),
14869
- defaultContent: /* @__PURE__ */ x(px, {}),
14959
+ className: Ee(Tb.toolbar, n),
14960
+ defaultContent: /* @__PURE__ */ x(vx, {}),
14870
14961
  visibleWhen: r,
14871
14962
  children: t
14872
14963
  });
14873
14964
  }
14874
14965
  //#endregion
14875
14966
  //#region src/rich-text-editor/styled/ToolbarSection.tsx
14876
- function Sx({ "aria-label": e, children: t, className: n }) {
14967
+ function Dx({ "aria-label": e, children: t, className: n }) {
14877
14968
  return /* @__PURE__ */ x($.Toolbar.Section, {
14878
14969
  "aria-label": e,
14879
- className: Ee(bb["toolbar-section"], n),
14970
+ className: Ee(Tb["toolbar-section"], n),
14880
14971
  children: t
14881
14972
  });
14882
14973
  }
14883
14974
  //#endregion
14884
14975
  //#region src/rich-text-editor/styled/ToolbarSeparator.tsx
14885
- function Cx(e) {
14976
+ function Ox(e) {
14886
14977
  let { className: t } = e;
14887
- return /* @__PURE__ */ x($.Toolbar.Separator, { className: Ee(bb["toolbar-separator"], t) });
14978
+ return /* @__PURE__ */ x($.Toolbar.Separator, { className: Ee(Tb["toolbar-separator"], t) });
14888
14979
  }
14889
14980
  //#endregion
14890
14981
  //#region src/rich-text-editor/index.ts
14891
- var wx = {
14892
- Editor: Tb,
14893
- Root: Yb,
14894
- Toolbar: Object.assign(xx, {
14895
- AlignCenterButton: ux("alignCenter"),
14896
- AlignLeftButton: ux("alignLeft"),
14897
- AlignRightButton: ux("alignRight"),
14898
- BoldToggle: ux("bold"),
14899
- BulletedListToggle: ux("bulletedList"),
14900
- CodeBlockButton: ux("codeBlock"),
14901
- CodeToggle: ux("code"),
14902
- ColorSelect: ux("color"),
14982
+ var kx = {
14983
+ Editor: Ab,
14984
+ Root: ex,
14985
+ Toolbar: Object.assign(Ex, {
14986
+ AlignCenterButton: hx("alignCenter"),
14987
+ AlignLeftButton: hx("alignLeft"),
14988
+ AlignRightButton: hx("alignRight"),
14989
+ BoldToggle: hx("bold"),
14990
+ BulletedListToggle: hx("bulletedList"),
14991
+ CodeBlockButton: hx("codeBlock"),
14992
+ CodeToggle: hx("code"),
14993
+ ColorSelect: hx("color"),
14903
14994
  Case: $.Toolbar.Case,
14904
14995
  Default: $.Toolbar.Default,
14905
- DividerButton: ux("divider"),
14906
- FontSizeSelect: ux("fontSize"),
14907
- FormulaButton: ux("formula"),
14908
- Heading1Button: ux("heading1"),
14909
- Heading2Button: ux("heading2"),
14910
- Heading3Button: ux("heading3"),
14911
- ImageButton: ux("image"),
14912
- InsertNodeButton: db($.Toolbar.InsertNodeButton),
14913
- ItalicToggle: ux("italic"),
14914
- NumberedListToggle: ux("numberedList"),
14915
- RedoButton: ux("redo"),
14916
- Section: Sx,
14917
- Separator: Cx,
14918
- StrikeToggle: ux("strike"),
14996
+ DividerButton: hx("divider"),
14997
+ FontSizeSelect: hx("fontSize"),
14998
+ FormulaButton: hx("formula"),
14999
+ Heading1Button: hx("heading1"),
15000
+ Heading2Button: hx("heading2"),
15001
+ Heading3Button: hx("heading3"),
15002
+ ImageButton: hx("image"),
15003
+ InsertNodeButton: gb($.Toolbar.InsertNodeButton),
15004
+ ItalicToggle: hx("italic"),
15005
+ NumberedListToggle: hx("numberedList"),
15006
+ RedoButton: hx("redo"),
15007
+ Section: Dx,
15008
+ Separator: Ox,
15009
+ StrikeToggle: hx("strike"),
14919
15010
  Switch: $.Toolbar.Switch,
14920
- TableButton: ux("table"),
14921
- UnderlineToggle: ux("underline"),
14922
- UndoButton: ux("undo")
15011
+ TableButton: hx("table"),
15012
+ UnderlineToggle: hx("underline"),
15013
+ UndoButton: hx("undo")
14923
15014
  })
14924
15015
  };
14925
15016
  //#endregion
14926
- export { wx as RichTextEditor, pm as deserializeRichTextEditorHtml, gm as deserializeRichTextEditorJson, hm as serializeRichTextEditorHtml, _m as serializeRichTextEditorJson };
15017
+ export { kx as RichTextEditor, pm as deserializeRichTextEditorHtml, gm as deserializeRichTextEditorJson, hm as serializeRichTextEditorHtml, _m as serializeRichTextEditorJson };