@vonage/vivid 5.20.0 → 5.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/alert/index.cjs +1 -1
  2. package/alert/index.js +1 -1
  3. package/banner/index.cjs +1 -1
  4. package/banner/index.js +1 -1
  5. package/bundled/definition18.cjs +1 -1
  6. package/bundled/definition18.js +1 -1
  7. package/bundled/definition6.cjs +1 -1
  8. package/bundled/definition6.js +1 -1
  9. package/bundled/vivid-element.cjs +1 -1
  10. package/bundled/vivid-element.js +1 -1
  11. package/combobox/index.cjs +1 -1
  12. package/combobox/index.js +1 -1
  13. package/custom-elements.json +2635 -2626
  14. package/file-picker/index.cjs +1 -1
  15. package/file-picker/index.js +1 -1
  16. package/lib/rich-text-editor/rte/features/base.d.ts +1 -0
  17. package/lib/rich-text-editor/rte/features/internal/history.d.ts +6 -0
  18. package/lib/rich-text-editor/rte/utils/ui.d.ts +2 -0
  19. package/locales/de-DE.cjs +178 -4
  20. package/locales/de-DE.js +179 -2
  21. package/locales/en-GB.cjs +9 -4
  22. package/locales/en-GB.js +10 -2
  23. package/locales/en-US.cjs +2 -270
  24. package/locales/en-US.js +1 -267
  25. package/locales/ja-JP.cjs +171 -4
  26. package/locales/ja-JP.js +172 -2
  27. package/locales/zh-CN.cjs +172 -4
  28. package/locales/zh-CN.js +173 -2
  29. package/package.json +6 -5
  30. package/rich-text-editor/index.cjs +12 -12
  31. package/rich-text-editor/index.js +935 -916
  32. package/searchable-select/index.cjs +1 -1
  33. package/searchable-select/index.js +1 -1
  34. package/switch/index.cjs +1 -1
  35. package/switch/index.js +1 -1
  36. package/tabs/index.cjs +1 -1
  37. package/tabs/index.js +1 -1
  38. package/unbundled/chunk.cjs +15 -0
  39. package/unbundled/chunk.js +13 -0
  40. package/unbundled/definition17.cjs +1 -1
  41. package/unbundled/definition17.js +1 -1
  42. package/unbundled/definition30.cjs +1 -1
  43. package/unbundled/definition30.js +1 -1
  44. package/unbundled/definition43.cjs +1 -1
  45. package/unbundled/definition43.js +1 -1
  46. package/unbundled/definition60.cjs +801 -767
  47. package/unbundled/definition60.js +801 -767
  48. package/unbundled/definition61.cjs +1 -1
  49. package/unbundled/definition61.js +1 -1
  50. package/unbundled/definition63.cjs +1 -1
  51. package/unbundled/definition63.js +1 -1
  52. package/unbundled/definition69.cjs +1 -1
  53. package/unbundled/definition69.js +1 -1
  54. package/unbundled/definition7.cjs +1 -1
  55. package/unbundled/definition7.js +1 -1
  56. package/unbundled/definition73.cjs +1 -1
  57. package/unbundled/definition73.js +1 -1
  58. package/unbundled/definition9.cjs +1 -1
  59. package/unbundled/definition9.js +1 -1
  60. package/unbundled/en-US.cjs +449 -0
  61. package/unbundled/en-US.js +445 -0
  62. package/unbundled/localized.cjs +2 -2
  63. package/unbundled/localized.js +1 -1
  64. package/unbundled/vivid-element.cjs +1 -1
  65. package/unbundled/vivid-element.js +1 -1
@@ -5710,527 +5710,7 @@ var Os = "[data-class=ui-select]{min-inline-size:120px;margin-block:-4px}.ui-div
5710
5710
  setValue(e, t) {
5711
5711
  e.dispatchTransaction(e.tr.setMeta(this.plugin, t));
5712
5712
  }
5713
- }, As = ".ProseMirror{box-sizing:border-box;padding:var(--editor-padding-block) var(--editor-padding-inline);outline:none;flex:1 0 0}.ProseMirror-selectednode{--focus-stroke-gap-color:transparent;--focus-border-radius:2px;outline:none;position:relative}.ProseMirror-selectednode:after{box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));border-radius:var(--focus-border-radius,inherit);block-size:calc(100% + var(--focus-block-size-addition,4px));content:\"\";inline-size:calc(100% + var(--focus-block-size-addition,4px));display:block;position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}.editor--disabled .ProseMirror{color:var(--vvd-color-neutral-300);cursor:not-allowed}", js = 200, G = function() {};
5714
- G.prototype.append = function(e) {
5715
- return e.length ? (e = G.from(e), !this.length && e || e.length < js && this.leafAppend(e) || this.length < js && e.leafPrepend(this) || this.appendInner(e)) : this;
5716
- }, G.prototype.prepend = function(e) {
5717
- return e.length ? G.from(e).append(this) : this;
5718
- }, G.prototype.appendInner = function(e) {
5719
- return new Ns(this, e);
5720
- }, G.prototype.slice = function(e, t) {
5721
- return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? G.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
5722
- }, G.prototype.get = function(e) {
5723
- if (!(e < 0 || e >= this.length)) return this.getInner(e);
5724
- }, G.prototype.forEach = function(e, t, n) {
5725
- 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);
5726
- }, G.prototype.map = function(e, t, n) {
5727
- t === void 0 && (t = 0), n === void 0 && (n = this.length);
5728
- var r = [];
5729
- return this.forEach(function(t, n) {
5730
- return r.push(e(t, n));
5731
- }, t, n), r;
5732
- }, G.from = function(e) {
5733
- return e instanceof G ? e : e && e.length ? new Ms(e) : G.empty;
5734
- };
5735
- var Ms = /* @__PURE__ */ function(e) {
5736
- function t(t) {
5737
- e.call(this), this.values = t;
5738
- }
5739
- e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
5740
- var n = {
5741
- length: { configurable: !0 },
5742
- depth: { configurable: !0 }
5743
- };
5744
- return t.prototype.flatten = function() {
5745
- return this.values;
5746
- }, t.prototype.sliceInner = function(e, n) {
5747
- return e == 0 && n == this.length ? this : new t(this.values.slice(e, n));
5748
- }, t.prototype.getInner = function(e) {
5749
- return this.values[e];
5750
- }, t.prototype.forEachInner = function(e, t, n, r) {
5751
- for (var i = t; i < n; i++) if (e(this.values[i], r + i) === !1) return !1;
5752
- }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
5753
- for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
5754
- }, t.prototype.leafAppend = function(e) {
5755
- if (this.length + e.length <= js) return new t(this.values.concat(e.flatten()));
5756
- }, t.prototype.leafPrepend = function(e) {
5757
- if (this.length + e.length <= js) return new t(e.flatten().concat(this.values));
5758
- }, n.length.get = function() {
5759
- return this.values.length;
5760
- }, n.depth.get = function() {
5761
- return 0;
5762
- }, Object.defineProperties(t.prototype, n), t;
5763
- }(G);
5764
- G.empty = new Ms([]);
5765
- var Ns = /* @__PURE__ */ function(e) {
5766
- function t(t, n) {
5767
- e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
5768
- }
5769
- return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.flatten = function() {
5770
- return this.left.flatten().concat(this.right.flatten());
5771
- }, t.prototype.getInner = function(e) {
5772
- return e < this.left.length ? this.left.get(e) : this.right.get(e - this.left.length);
5773
- }, t.prototype.forEachInner = function(e, t, n, r) {
5774
- var i = this.left.length;
5775
- if (t < i && this.left.forEachInner(e, t, Math.min(n, i), r) === !1 || n > i && this.right.forEachInner(e, Math.max(t - i, 0), Math.min(this.length, n) - i, r + i) === !1) return !1;
5776
- }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
5777
- var i = this.left.length;
5778
- if (t > i && this.right.forEachInvertedInner(e, t - i, Math.max(n, i) - i, r + i) === !1 || n < i && this.left.forEachInvertedInner(e, Math.min(t, i), n, r) === !1) return !1;
5779
- }, t.prototype.sliceInner = function(e, t) {
5780
- if (e == 0 && t == this.length) return this;
5781
- var n = this.left.length;
5782
- return t <= n ? this.left.slice(e, t) : e >= n ? this.right.slice(e - n, t - n) : this.left.slice(e, n).append(this.right.slice(0, t - n));
5783
- }, t.prototype.leafAppend = function(e) {
5784
- var n = this.right.leafAppend(e);
5785
- if (n) return new t(this.left, n);
5786
- }, t.prototype.leafPrepend = function(e) {
5787
- var n = this.left.leafPrepend(e);
5788
- if (n) return new t(n, this.right);
5789
- }, t.prototype.appendInner = function(e) {
5790
- 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);
5791
- }, t;
5792
- }(G), Ps = 500, Fs = class e {
5793
- constructor(e, t) {
5794
- this.items = e, this.eventCount = t;
5795
- }
5796
- popEvent(t, n) {
5797
- if (this.eventCount == 0) return null;
5798
- let r = this.items.length;
5799
- for (;; r--) if (this.items.get(r - 1).selection) {
5800
- --r;
5801
- break;
5802
- }
5803
- let i, a;
5804
- n && (i = this.remapping(r, this.items.length), a = i.maps.length);
5805
- let o = t.tr, s, c, l = [], u = [];
5806
- return this.items.forEach((t, n) => {
5807
- if (!t.step) {
5808
- i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(t);
5809
- return;
5810
- }
5811
- if (i) {
5812
- u.push(new Ls(t.map));
5813
- let e = t.step.map(i.slice(a)), n;
5814
- e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new Ls(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
5815
- } else o.maybeStep(t.step);
5816
- 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;
5817
- }, this.items.length, 0), {
5818
- remaining: c,
5819
- transform: o,
5820
- selection: s
5821
- };
5822
- }
5823
- addTransform(t, n, r, i) {
5824
- let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
5825
- for (let e = 0; e < t.steps.length; e++) {
5826
- let r = t.steps[e].invert(t.docs[e]), l = new Ls(t.mapping.maps[e], r, n), u;
5827
- (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);
5828
- }
5829
- let l = o - r.depth;
5830
- return l > zs && (s = Is(s, l), o -= l), new e(s.append(a), o);
5831
- }
5832
- remapping(e, t) {
5833
- let n = new Ve();
5834
- return this.items.forEach((t, r) => {
5835
- let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
5836
- n.appendMap(t.map, i);
5837
- }, e, t), n;
5838
- }
5839
- addMaps(t) {
5840
- return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new Ls(e))), this.eventCount);
5841
- }
5842
- rebased(t, n) {
5843
- if (!this.eventCount) return this;
5844
- let r = [], i = Math.max(0, this.items.length - n), a = t.mapping, o = t.steps.length, s = this.eventCount;
5845
- this.items.forEach((e) => {
5846
- e.selection && s--;
5847
- }, i);
5848
- let c = n;
5849
- this.items.forEach((e) => {
5850
- let n = a.getMirror(--c);
5851
- if (n == null) return;
5852
- o = Math.min(o, n);
5853
- let i = a.maps[n];
5854
- if (e.step) {
5855
- let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
5856
- l && s++, r.push(new Ls(i, o, l));
5857
- } else r.push(new Ls(i));
5858
- }, i);
5859
- let l = [];
5860
- for (let e = n; e < o; e++) l.push(new Ls(a.maps[e]));
5861
- let u = new e(this.items.slice(0, i).append(l).append(r), s);
5862
- return u.emptyItemCount() > Ps && (u = u.compress(this.items.length - r.length)), u;
5863
- }
5864
- emptyItemCount() {
5865
- let e = 0;
5866
- return this.items.forEach((t) => {
5867
- t.step || e++;
5868
- }), e;
5869
- }
5870
- compress(t = this.items.length) {
5871
- let n = this.remapping(0, t), r = n.maps.length, i = [], a = 0;
5872
- return this.items.forEach((e, o) => {
5873
- if (o >= t) i.push(e), e.selection && a++;
5874
- else if (e.step) {
5875
- let t = e.step.map(n.slice(r)), o = t && t.getMap();
5876
- if (r--, o && n.appendMap(o, r), t) {
5877
- let s = e.selection && e.selection.map(n.slice(r));
5878
- s && a++;
5879
- let c = new Ls(o.invert(), t, s), l, u = i.length - 1;
5880
- (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
5881
- }
5882
- } else e.map && r--;
5883
- }, this.items.length, 0), new e(G.from(i.reverse()), a);
5884
- }
5885
- };
5886
- Fs.empty = new Fs(G.empty, 0);
5887
- function Is(e, t) {
5888
- let n;
5889
- return e.forEach((e, r) => {
5890
- if (e.selection && t-- == 0) return n = r, !1;
5891
- }), e.slice(n);
5892
- }
5893
- var Ls = class e {
5894
- constructor(e, t, n, r) {
5895
- this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
5896
- }
5897
- merge(t) {
5898
- if (this.step && t.step && !t.selection) {
5899
- let n = t.step.merge(this.step);
5900
- if (n) return new e(n.getMap().invert(), n, this.selection);
5901
- }
5902
- }
5903
- }, Rs = class {
5904
- constructor(e, t, n, r, i) {
5905
- this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
5906
- }
5907
- }, zs = 20;
5908
- function Bs(e, t, n, r) {
5909
- let i = n.getMeta(Ys), a;
5910
- if (i) return i.historyState;
5911
- n.getMeta(Xs) && (e = new Rs(e.done, e.undone, null, 0, -1));
5912
- let o = n.getMeta("appendedTransaction");
5913
- if (n.steps.length == 0) return e;
5914
- if (o && o.getMeta(Ys)) return o.getMeta(Ys).redo ? new Rs(e.done.addTransform(n, void 0, r, qs(t)), e.undone, Hs(n.mapping.maps), e.prevTime, e.prevComposition) : new Rs(e.done, e.undone.addTransform(n, void 0, r, qs(t)), null, e.prevTime, e.prevComposition);
5915
- if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
5916
- let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Vs(n, e.prevRanges)), s = o ? Us(e.prevRanges, n.mapping) : Hs(n.mapping.maps);
5917
- return new Rs(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, qs(t)), Fs.empty, s, n.time, i ?? e.prevComposition);
5918
- } else if (a = n.getMeta("rebased")) return new Rs(e.done.rebased(n, a), e.undone.rebased(n, a), Us(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
5919
- else return new Rs(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), Us(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
5920
- }
5921
- function Vs(e, t) {
5922
- if (!t) return !1;
5923
- if (!e.docChanged) return !0;
5924
- let n = !1;
5925
- return e.mapping.maps[0].forEach((e, r) => {
5926
- for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
5927
- }), n;
5928
- }
5929
- function Hs(e) {
5930
- let t = [];
5931
- for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
5932
- return t;
5933
- }
5934
- function Us(e, t) {
5935
- if (!e) return null;
5936
- let n = [];
5937
- for (let r = 0; r < e.length; r += 2) {
5938
- let i = t.map(e[r], 1), a = t.map(e[r + 1], -1);
5939
- i <= a && n.push(i, a);
5940
- }
5941
- return n;
5942
- }
5943
- function Ws(e, t, n) {
5944
- let r = qs(t), i = Ys.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
5945
- if (!a) return null;
5946
- let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new Rs(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
5947
- return a.transform.setSelection(o).setMeta(Ys, {
5948
- redo: n,
5949
- historyState: c
5950
- });
5951
- }
5952
- var Gs = !1, Ks = null;
5953
- function qs(e) {
5954
- let t = e.plugins;
5955
- if (Ks != t) {
5956
- Gs = !1, Ks = t;
5957
- for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
5958
- Gs = !0;
5959
- break;
5960
- }
5961
- }
5962
- return Gs;
5963
- }
5964
- function Js(e) {
5965
- return e.setMeta(Xs, !0);
5966
- }
5967
- var Ys = new rn("history"), Xs = new rn("closeHistory");
5968
- function Zs(e = {}) {
5969
- return e = {
5970
- depth: e.depth || 100,
5971
- newGroupDelay: e.newGroupDelay || 500
5972
- }, new N({
5973
- key: Ys,
5974
- state: {
5975
- init() {
5976
- return new Rs(Fs.empty, Fs.empty, null, 0, -1);
5977
- },
5978
- apply(t, n, r) {
5979
- return Bs(n, r, t, e);
5980
- }
5981
- },
5982
- config: e,
5983
- props: { handleDOMEvents: { beforeinput(e, t) {
5984
- let n = t.inputType, r = n == "historyUndo" ? $s : n == "historyRedo" ? ec : null;
5985
- return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
5986
- } } }
5987
- });
5988
- }
5989
- function Qs(e, t) {
5990
- return (n, r) => {
5991
- let i = Ys.getState(n);
5992
- if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
5993
- if (r) {
5994
- let a = Ws(i, n, e);
5995
- a && r(t ? a.scrollIntoView() : a);
5996
- }
5997
- return !0;
5998
- };
5999
- }
6000
- var $s = Qs(!1, !0), ec = Qs(!0, !0), tc = (e) => typeof e == "function", nc = (e, t, n) => [
6001
- e,
6002
- t,
6003
- n
6004
- ], rc = class {
6005
- constructor(e, t, n) {
6006
- this.view = e, this.rte = t, this.props = n, this.bindings = [];
6007
- }
6008
- evalProp(e) {
6009
- return tc(e) ? e(this) : e;
6010
- }
6011
- bindProp(e, t) {
6012
- if (e !== void 0) if (tc(e)) {
6013
- let n = () => t(e(this));
6014
- this.bindings.push(n), n();
6015
- } else t(e);
6016
- }
6017
- updateBindings() {
6018
- for (let e of this.bindings) e();
6019
- }
6020
- bindToEl(e, t = {}, n = [], r = []) {
6021
- for (let n in t) this.bindProp(t[n], (t) => {
6022
- e[n] = t;
6023
- });
6024
- for (let [t, r, i] of n) r && e.addEventListener(t, i(r));
6025
- for (let t of r) e.appendChild(t);
6026
- }
6027
- }, ic = (e, t) => {
6028
- let n = document.createElement("div");
6029
- return e.bindToEl(n, {
6030
- className: t.className,
6031
- slot: t.slot
6032
- }, [], t.children), n;
6033
- }, ac = (e, t) => {
6034
- let n = document.createElement("a");
6035
- return e.bindToEl(n, {
6036
- href: t.href,
6037
- target: t.target,
6038
- rel: t.rel,
6039
- className: t.className
6040
- }, [], t.children), n;
6041
- }, oc = /* @__PURE__ */ new WeakMap(), sc = (e, t) => {
6042
- let n = e.rte.createComponent(te);
6043
- n.setAttribute("exportparts", "vvd-theme-alternate"), e.bindToEl(n, {
6044
- className: "ui-tooltip",
6045
- text: t.label,
6046
- placement: e.props.popupPlacement
6047
- }), e.bindProp(t.enabled, (e) => {
6048
- e || (n.open = !1), n.anchor = e ? t.anchor : void 0;
6049
- });
6050
- let r = ic(e, {
6051
- className: "ui-tooltip-wrapper",
6052
- slot: t.slot,
6053
- children: [t.anchor, n]
6054
- });
6055
- return oc.set(r, t.anchor), r;
6056
- }, K = (e, t) => {
6057
- let n = () => e.evalProp(t.variant) ?? "toolbar", r = () => n() === "toolbar" ? "super-condensed" : "condensed", i = () => n() === "popover-primary" ? "outlined" : "ghost-light", a = () => n() === "toolbar-menu" || n() === "popover" ? "filled" : i(), o = () => e.evalProp(t.active) ? a() : i(), s = () => e.evalProp(t.connotation) ?? (n() === "toolbar-menu" && e.evalProp(t.active) ? "cta" : void 0), c = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), l = e.rte.createComponent(f);
6058
- return e.bindToEl(l, {
6059
- size: r,
6060
- appearance: o,
6061
- disabled: c,
6062
- icon: t.icon,
6063
- autofocus: t.autofocus,
6064
- connotation: s,
6065
- [t.icon ? "ariaLabel" : "label"]: t.label,
6066
- pressed: () => !!e.evalProp(t.active),
6067
- ariaPressed: t.active === void 0 ? void 0 : () => e.evalProp(t.active) ? "true" : "false"
6068
- }, [nc("click", t.onClick, (t) => () => {
6069
- t() || e.view.focus();
6070
- })]), sc(e, {
6071
- enabled: () => !!(e.evalProp(t.icon) && !e.evalProp(t.noTooltip) && !c()),
6072
- label: t.label,
6073
- anchor: l,
6074
- slot: t.slot
6075
- });
6076
- }, cc = (e, t) => {
6077
- let n = e.rte.createComponent(Se);
6078
- e.bindToEl(n, {
6079
- className: "ui-menu",
6080
- autoDismiss: !0,
6081
- ariaLabel: t.label,
6082
- anchor: oc.get(t.trigger) ?? t.trigger,
6083
- placement: e.props.popupPlacement,
6084
- offset: () => e.evalProp(e.props.menuOffset) ?? null
6085
- }, [], t.children);
6086
- let r = document.createDocumentFragment();
6087
- return r.appendChild(t.trigger), r.appendChild(n), r;
6088
- }, lc = (e, t) => {
6089
- let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(be);
6090
- return e.bindToEl(r, {
6091
- text: t.text,
6092
- checked: t.checked,
6093
- disabled: n,
6094
- controlType: "radio",
6095
- checkedAppearance: "tick-only"
6096
- }, [nc("change", t.onSelect, (n) => () => {
6097
- r.checked && !r.disabled && e.evalProp(t.checked) !== r.checked && (n(), e.view.focus());
6098
- })]), r;
6099
- }, uc = (e, t) => ic(e, {
6100
- slot: t.slot,
6101
- className: "ui-button-group",
6102
- children: t.children
6103
- });
6104
- function dc(e, t) {
6105
- let { from: n, $from: r, to: i, empty: a } = e.selection;
6106
- return a ? !!t.isInSet(e.storedMarks || r.marks()) : e.doc.rangeHasMark(n, i, t);
6107
- }
6108
- var fc = (e, t) => K(e, {
6109
- label: t.label,
6110
- icon: t.icon,
6111
- active: () => dc(e.view.state, t.markType),
6112
- disabled: () => !is(t.markType)(e.view.state),
6113
- onClick: () => {
6114
- is(t.markType)(e.view.state, e.view.dispatch);
6115
- }
6116
- }), pc = (e, t) => {
6117
- let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(ie);
6118
- return e.bindToEl(r, {
6119
- value: t.value,
6120
- text: t.text,
6121
- disabled: n
6122
- }), r;
6123
- }, mc = (e, t) => {
6124
- let n = () => !!e.evalProp(e.props.disabled), r = e.rte.createComponent(se);
6125
- r.setAttribute("data-class", "ui-select"), e.bindToEl(r, {
6126
- placeholder: " ",
6127
- ariaLabel: t.label,
6128
- appearance: "ghost",
6129
- disabled: n
6130
- }, [nc("change", t.onSelect, (t) => () => {
6131
- let n = r.value;
6132
- n && (t(n), e.view.focus());
6133
- })], t.children), queueMicrotask(() => {
6134
- e.bindProp(t.value, (e) => r.value = e);
6135
- });
6136
- let i = !1;
6137
- return r.addEventListener("vwc-popup:open", () => {
6138
- i = !0, e.updateBindings();
6139
- }), r.addEventListener("vwc-popup:close", () => {
6140
- i = !1, e.updateBindings();
6141
- }), sc(e, {
6142
- enabled: () => !i && !n(),
6143
- label: t.label,
6144
- anchor: r
6145
- });
6146
- }, hc = (e) => {
6147
- let t = e.rte.createComponent(v);
6148
- return e.bindToEl(t, {
6149
- className: "ui-divider",
6150
- orientation: "vertical"
6151
- }), t;
6152
- }, gc = (e, t) => {
6153
- let n = e.rte.createComponent(re);
6154
- return e.bindToEl(n, {
6155
- label: t.label,
6156
- value: t.value,
6157
- placeholder: t.placeholder,
6158
- slot: t.slot,
6159
- autofocus: t.autofocus,
6160
- type: t.type,
6161
- helperText: t.helperText
6162
- }, [nc("input", t.onInput, (e) => () => {
6163
- e(n.value);
6164
- })]), n;
6165
- }, _c = (e, t) => {
6166
- let n = document.createTextNode("");
6167
- return e.bindToEl(n, { textContent: t.text }), n;
6168
- }, vc = (e, t) => {
6169
- let n = document.createElement("slot");
6170
- n.name = t.name;
6171
- let r = null, i = [];
6172
- function a() {
6173
- for (let { el: e, type: t, handler: n } of i) e.removeEventListener(t, n);
6174
- i.length = 0, r = null;
6175
- }
6176
- for (let [n, i] of Object.entries(t.assignedProps)) e.bindProp(i, (e) => {
6177
- r && (r[n] = e);
6178
- });
6179
- function o(n) {
6180
- for (let [r, i] of Object.entries(t.assignedProps)) n[r] = e.evalProp(i);
6181
- for (let [r, a] of Object.entries(t.assignedEvents)) {
6182
- let t = (t) => {
6183
- a(t), e.view.focus();
6184
- };
6185
- n.addEventListener(r, t), i.push({
6186
- el: n,
6187
- type: r,
6188
- handler: t
6189
- });
6190
- }
6191
- }
6192
- let s = () => {
6193
- let e = n.assignedElements({ flatten: !0 })[0];
6194
- e !== r && (a(), e && (r = e, o(e)));
6195
- };
6196
- return n.addEventListener("slotchange", s), queueMicrotask(s), n;
6197
- }, yc = class extends w {
6198
- constructor(...e) {
6199
- super(...e), this.name = "RteHistoryFeature";
6200
- }
6201
- getPlugins() {
6202
- return [this.contribution(Zs()), this.contribution(U({
6203
- "Mod-z": $s,
6204
- "Ctrl-y": ec,
6205
- "Cmd-Z": ec
6206
- }))];
6207
- }
6208
- getToolbarItems() {
6209
- return [this.contribution({
6210
- section: "history",
6211
- render: (e) => K(e, {
6212
- label: (e) => e.rte.getLocale().richTextEditor.undo,
6213
- icon: "undo-line",
6214
- disabled: (e) => !$s(e.view.state),
6215
- onClick: () => {
6216
- let { state: t, dispatch: n } = e.view;
6217
- $s(t, n);
6218
- }
6219
- })
6220
- }, 1), this.contribution({
6221
- section: "history",
6222
- render: (e) => K(e, {
6223
- label: (e) => e.rte.getLocale().richTextEditor.redo,
6224
- icon: "redo-line",
6225
- disabled: (e) => !ec(e.view.state),
6226
- onClick: () => {
6227
- let { state: t, dispatch: n } = e.view;
6228
- ec(t, n);
6229
- }
6230
- })
6231
- }, 2)];
6232
- }
6233
- }, bc = class extends w {
5713
+ }, As = ".ProseMirror{box-sizing:border-box;padding:var(--editor-padding-block) var(--editor-padding-inline);outline:none;flex:1 0 0}.ProseMirror-selectednode{--focus-stroke-gap-color:transparent;--focus-border-radius:2px;outline:none;position:relative}.ProseMirror-selectednode:after{box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));border-radius:var(--focus-border-radius,inherit);block-size:calc(100% + var(--focus-block-size-addition,4px));content:\"\";inline-size:calc(100% + var(--focus-block-size-addition,4px));display:block;position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}.editor--disabled .ProseMirror{color:var(--vvd-color-neutral-300);cursor:not-allowed}", js = class extends w {
6234
5714
  constructor(...e) {
6235
5715
  super(...e), this.name = "RteForeignHtmlFeature";
6236
5716
  }
@@ -6241,16 +5721,16 @@ var fc = (e, t) => K(e, {
6241
5721
  clipboardSerializer: e.foreignHtmlSerializer[b].serializer
6242
5722
  } }))];
6243
5723
  }
6244
- }, xc = (e) => {
5724
+ }, Ms = (e) => {
6245
5725
  if (e.parentOffset !== e.parent.content.size) return null;
6246
5726
  let t = e.nodeBefore;
6247
5727
  return t && t.isInline && t.isAtom && !t.isText ? {} : null;
6248
- }, Sc = class extends w {
5728
+ }, Ns = class extends w {
6249
5729
  constructor(...e) {
6250
5730
  super(...e), this.name = "RteCursorFix";
6251
5731
  }
6252
5732
  getPlugins(e) {
6253
- let t = [xc];
5733
+ let t = [Ms];
6254
5734
  for (let n of Object.values(e.schema.marks)) {
6255
5735
  let e = n.spec;
6256
5736
  e.cursorFix && t.push(e.cursorFix);
@@ -6272,17 +5752,17 @@ var fc = (e, t) => K(e, {
6272
5752
  } } }))];
6273
5753
  }
6274
5754
  };
6275
- y(Sc);
5755
+ y(Ns);
6276
5756
  //#endregion
6277
5757
  //#region src/lib/rich-text-editor/rte/features/internal/core.ts
6278
- var Cc = new N({ state: {
5758
+ var Ps = new N({ state: {
6279
5759
  init() {
6280
5760
  return null;
6281
5761
  },
6282
5762
  apply(e, t) {
6283
- return e.getMeta(Cc) || t;
5763
+ return e.getMeta(Ps) || t;
6284
5764
  }
6285
- } }), wc = class extends w {
5765
+ } }), Fs = class extends w {
6286
5766
  constructor(...e) {
6287
5767
  super(...e), this.name = "RteCore", this.disabled = new ks(!1);
6288
5768
  }
@@ -6325,111 +5805,110 @@ var Cc = new N({ state: {
6325
5805
  })),
6326
5806
  this.contribution(hs()),
6327
5807
  this.contribution(xs()),
6328
- this.contribution(Cc)
5808
+ this.contribution(Ps)
6329
5809
  ];
6330
5810
  }
6331
5811
  getFeatures() {
6332
5812
  return [
6333
5813
  this,
6334
- new yc(),
6335
- new bc(),
6336
- new Sc()
5814
+ new js(),
5815
+ new Ns()
6337
5816
  ];
6338
5817
  }
6339
5818
  };
6340
- y(wc);
5819
+ y(Fs);
6341
5820
  //#endregion
6342
5821
  //#region ../../node_modules/.pnpm/dompurify@3.4.2/node_modules/dompurify/dist/purify.es.mjs
6343
- var { entries: Tc, setPrototypeOf: Ec, isFrozen: Dc, getPrototypeOf: Oc, getOwnPropertyDescriptor: kc } = Object, { freeze: q, seal: Ac, create: jc } = Object, { apply: Mc, construct: Nc } = typeof Reflect < "u" && Reflect;
6344
- q ||= function(e) {
5822
+ var { entries: Is, setPrototypeOf: Ls, isFrozen: Rs, getPrototypeOf: zs, getOwnPropertyDescriptor: Bs } = Object, { freeze: G, seal: Vs, create: Hs } = Object, { apply: Us, construct: Ws } = typeof Reflect < "u" && Reflect;
5823
+ G ||= function(e) {
6345
5824
  return e;
6346
- }, Ac ||= function(e) {
5825
+ }, Vs ||= function(e) {
6347
5826
  return e;
6348
- }, Mc ||= function(e, t) {
5827
+ }, Us ||= function(e, t) {
6349
5828
  var n = [...arguments].slice(2);
6350
5829
  return e.apply(t, n);
6351
- }, Nc ||= function(e) {
5830
+ }, Ws ||= function(e) {
6352
5831
  return new e(...[...arguments].slice(1));
6353
5832
  };
6354
- var Pc = Z(Array.prototype.forEach), Fc = Z(Array.prototype.lastIndexOf), Ic = Z(Array.prototype.pop), Lc = Z(Array.prototype.push), Rc = Z(Array.prototype.splice), J = Array.isArray, zc = Z(String.prototype.toLowerCase), Bc = Z(String.prototype.toString), Vc = Z(String.prototype.match), Hc = Z(String.prototype.replace), Uc = Z(String.prototype.indexOf), Wc = Z(String.prototype.trim), Gc = Z(Number.prototype.toString), Kc = Z(Boolean.prototype.toString), qc = typeof BigInt > "u" ? null : Z(BigInt.prototype.toString), Jc = typeof Symbol > "u" ? null : Z(Symbol.prototype.toString), Y = Z(Object.prototype.hasOwnProperty), Yc = Z(Object.prototype.toString), X = Z(RegExp.prototype.test), Xc = Zc(TypeError);
6355
- function Z(e) {
5833
+ var Gs = Y(Array.prototype.forEach), Ks = Y(Array.prototype.lastIndexOf), qs = Y(Array.prototype.pop), Js = Y(Array.prototype.push), Ys = Y(Array.prototype.splice), K = Array.isArray, Xs = Y(String.prototype.toLowerCase), Zs = Y(String.prototype.toString), Qs = Y(String.prototype.match), $s = Y(String.prototype.replace), ec = Y(String.prototype.indexOf), tc = Y(String.prototype.trim), nc = Y(Number.prototype.toString), rc = Y(Boolean.prototype.toString), ic = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), ac = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), oc = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), sc = cc(TypeError);
5834
+ function Y(e) {
6356
5835
  return function(t) {
6357
5836
  t instanceof RegExp && (t.lastIndex = 0);
6358
5837
  var n = [...arguments].slice(1);
6359
- return Mc(e, t, n);
5838
+ return Us(e, t, n);
6360
5839
  };
6361
5840
  }
6362
- function Zc(e) {
5841
+ function cc(e) {
6363
5842
  return function() {
6364
- return Nc(e, [...arguments]);
5843
+ return Ws(e, [...arguments]);
6365
5844
  };
6366
5845
  }
6367
- function Q(e, t) {
6368
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : zc;
6369
- if (Ec && Ec(e, null), !J(t)) return e;
5846
+ function X(e, t) {
5847
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Xs;
5848
+ if (Ls && Ls(e, null), !K(t)) return e;
6370
5849
  let r = t.length;
6371
5850
  for (; r--;) {
6372
5851
  let i = t[r];
6373
5852
  if (typeof i == "string") {
6374
5853
  let e = n(i);
6375
- e !== i && (Dc(t) || (t[r] = e), i = e);
5854
+ e !== i && (Rs(t) || (t[r] = e), i = e);
6376
5855
  }
6377
5856
  e[i] = !0;
6378
5857
  }
6379
5858
  return e;
6380
5859
  }
6381
- function Qc(e) {
6382
- for (let t = 0; t < e.length; t++) Y(e, t) || (e[t] = null);
5860
+ function lc(e) {
5861
+ for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
6383
5862
  return e;
6384
5863
  }
6385
- function $(e) {
6386
- let t = jc(null);
6387
- for (let [n, r] of Tc(e)) Y(e, n) && (J(r) ? t[n] = Qc(r) : r && typeof r == "object" && r.constructor === Object ? t[n] = $(r) : t[n] = r);
5864
+ function Z(e) {
5865
+ let t = Hs(null);
5866
+ for (let [n, r] of Is(e)) q(e, n) && (K(r) ? t[n] = lc(r) : r && typeof r == "object" && r.constructor === Object ? t[n] = Z(r) : t[n] = r);
6388
5867
  return t;
6389
5868
  }
6390
- function $c(e) {
5869
+ function uc(e) {
6391
5870
  switch (typeof e) {
6392
5871
  case "string": return e;
6393
- case "number": return Gc(e);
6394
- case "boolean": return Kc(e);
6395
- case "bigint": return qc ? qc(e) : "0";
6396
- case "symbol": return Jc ? Jc(e) : "Symbol()";
6397
- case "undefined": return Yc(e);
5872
+ case "number": return nc(e);
5873
+ case "boolean": return rc(e);
5874
+ case "bigint": return ic ? ic(e) : "0";
5875
+ case "symbol": return ac ? ac(e) : "Symbol()";
5876
+ case "undefined": return oc(e);
6398
5877
  case "function":
6399
5878
  case "object": {
6400
- if (e === null) return Yc(e);
6401
- let t = e, n = el(t, "toString");
5879
+ if (e === null) return oc(e);
5880
+ let t = e, n = dc(t, "toString");
6402
5881
  if (typeof n == "function") {
6403
5882
  let e = n(t);
6404
- return typeof e == "string" ? e : Yc(e);
5883
+ return typeof e == "string" ? e : oc(e);
6405
5884
  }
6406
- return Yc(e);
5885
+ return oc(e);
6407
5886
  }
6408
- default: return Yc(e);
5887
+ default: return oc(e);
6409
5888
  }
6410
5889
  }
6411
- function el(e, t) {
5890
+ function dc(e, t) {
6412
5891
  for (; e !== null;) {
6413
- let n = kc(e, t);
5892
+ let n = Bs(e, t);
6414
5893
  if (n) {
6415
- if (n.get) return Z(n.get);
6416
- if (typeof n.value == "function") return Z(n.value);
5894
+ if (n.get) return Y(n.get);
5895
+ if (typeof n.value == "function") return Y(n.value);
6417
5896
  }
6418
- e = Oc(e);
5897
+ e = zs(e);
6419
5898
  }
6420
5899
  function n() {
6421
5900
  return null;
6422
5901
  }
6423
5902
  return n;
6424
5903
  }
6425
- function tl(e) {
5904
+ function fc(e) {
6426
5905
  try {
6427
- return X(e, ""), !0;
5906
+ return J(e, ""), !0;
6428
5907
  } catch {
6429
5908
  return !1;
6430
5909
  }
6431
5910
  }
6432
- var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), rl = q(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), il = q([
5911
+ var pc = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), mc = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), hc = G([
6433
5912
  "feBlend",
6434
5913
  "feColorMatrix",
6435
5914
  "feComponentTransfer",
@@ -6455,7 +5934,7 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6455
5934
  "feSpotLight",
6456
5935
  "feTile",
6457
5936
  "feTurbulence"
6458
- ]), al = q([
5937
+ ]), gc = G([
6459
5938
  "animate",
6460
5939
  "color-profile",
6461
5940
  "cursor",
@@ -6478,7 +5957,7 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6478
5957
  "solidcolor",
6479
5958
  "unknown",
6480
5959
  "use"
6481
- ]), ol = q(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), sl = q([
5960
+ ]), _c = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), vc = G([
6482
5961
  "maction",
6483
5962
  "maligngroup",
6484
5963
  "malignmark",
@@ -6494,33 +5973,33 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6494
5973
  "annotation-xml",
6495
5974
  "mprescripts",
6496
5975
  "none"
6497
- ]), cl = q(["#text"]), ll = q(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), ul = q(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), dl = q(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), fl = q([
5976
+ ]), yc = G(["#text"]), bc = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), xc = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Sc = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Cc = G([
6498
5977
  "xlink:href",
6499
5978
  "xml:id",
6500
5979
  "xlink:title",
6501
5980
  "xml:space",
6502
5981
  "xmlns:xlink"
6503
- ]), pl = Ac(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ml = Ac(/<%[\w\W]*|[\w\W]*%>/gm), hl = Ac(/\$\{[\w\W]*/gm), gl = Ac(/^data-[\-\w.\u00B7-\uFFFF]+$/), _l = Ac(/^aria-[\-\w]+$/), vl = Ac(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), yl = Ac(/^(?:\w+script|data):/i), bl = Ac(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), xl = Ac(/^html$/i), Sl = Ac(/^[a-z][.\w]*(-[.\w]+)+$/i), Cl = /* @__PURE__ */ Object.freeze({
5982
+ ]), wc = Vs(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Tc = Vs(/<%[\w\W]*|[\w\W]*%>/gm), Ec = Vs(/\$\{[\w\W]*/gm), Dc = Vs(/^data-[\-\w.\u00B7-\uFFFF]+$/), Oc = Vs(/^aria-[\-\w]+$/), kc = Vs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Ac = Vs(/^(?:\w+script|data):/i), jc = Vs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Mc = Vs(/^html$/i), Nc = Vs(/^[a-z][.\w]*(-[.\w]+)+$/i), Pc = /* @__PURE__ */ Object.freeze({
6504
5983
  __proto__: null,
6505
- ARIA_ATTR: _l,
6506
- ATTR_WHITESPACE: bl,
6507
- CUSTOM_ELEMENT: Sl,
6508
- DATA_ATTR: gl,
6509
- DOCTYPE_NAME: xl,
6510
- ERB_EXPR: ml,
6511
- IS_ALLOWED_URI: vl,
6512
- IS_SCRIPT_OR_DATA: yl,
6513
- MUSTACHE_EXPR: pl,
6514
- TMPLIT_EXPR: hl
6515
- }), wl = {
5984
+ ARIA_ATTR: Oc,
5985
+ ATTR_WHITESPACE: jc,
5986
+ CUSTOM_ELEMENT: Nc,
5987
+ DATA_ATTR: Dc,
5988
+ DOCTYPE_NAME: Mc,
5989
+ ERB_EXPR: Tc,
5990
+ IS_ALLOWED_URI: kc,
5991
+ IS_SCRIPT_OR_DATA: Ac,
5992
+ MUSTACHE_EXPR: wc,
5993
+ TMPLIT_EXPR: Ec
5994
+ }), Fc = {
6516
5995
  element: 1,
6517
5996
  text: 3,
6518
5997
  progressingInstruction: 7,
6519
5998
  comment: 8,
6520
5999
  document: 9
6521
- }, Tl = function() {
6000
+ }, Ic = function() {
6522
6001
  return typeof window > "u" ? null : window;
6523
- }, El = function(e, t) {
6002
+ }, Lc = function(e, t) {
6524
6003
  if (typeof e != "object" || typeof e.createPolicy != "function") return null;
6525
6004
  let n = null, r = "data-tt-policy-suffix";
6526
6005
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
@@ -6537,7 +6016,7 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6537
6016
  } catch {
6538
6017
  return console.warn("TrustedTypes policy " + i + " could not be created."), null;
6539
6018
  }
6540
- }, Dl = function() {
6019
+ }, Rc = function() {
6541
6020
  return {
6542
6021
  afterSanitizeAttributes: [],
6543
6022
  afterSanitizeElements: [],
@@ -6550,28 +6029,28 @@ var nl = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
6550
6029
  uponSanitizeShadowNode: []
6551
6030
  };
6552
6031
  };
6553
- function Ol() {
6554
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Tl(), t = (e) => Ol(e);
6555
- if (t.version = "3.4.2", t.removed = [], !e || !e.document || e.document.nodeType !== wl.document || !e.Element) return t.isSupported = !1, t;
6556
- let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: d, DOMParser: f, trustedTypes: p } = e, m = c.prototype, h = el(m, "cloneNode"), g = el(m, "remove"), ee = el(m, "nextSibling"), te = el(m, "childNodes"), ne = el(m, "parentNode");
6032
+ function zc() {
6033
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ic(), t = (e) => zc(e);
6034
+ if (t.version = "3.4.2", t.removed = [], !e || !e.document || e.document.nodeType !== Fc.document || !e.Element) return t.isSupported = !1, t;
6035
+ let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: d, DOMParser: f, trustedTypes: p } = e, m = c.prototype, h = dc(m, "cloneNode"), g = dc(m, "remove"), ee = dc(m, "nextSibling"), te = dc(m, "childNodes"), ne = dc(m, "parentNode");
6557
6036
  if (typeof o == "function") {
6558
6037
  let e = n.createElement("template");
6559
6038
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
6560
6039
  }
6561
- let _, re = "", { implementation: ie, createNodeIterator: ae, createDocumentFragment: oe, getElementsByTagName: se } = n, { importNode: ce } = r, v = Dl();
6562
- t.isSupported = typeof Tc == "function" && typeof ne == "function" && ie && ie.createHTMLDocument !== void 0;
6563
- let { MUSTACHE_EXPR: le, ERB_EXPR: y, TMPLIT_EXPR: b, DATA_ATTR: x, ARIA_ATTR: ue, IS_SCRIPT_OR_DATA: de, ATTR_WHITESPACE: fe, CUSTOM_ELEMENT: pe } = Cl, { IS_ALLOWED_URI: me } = Cl, S = null, he = Q({}, [
6564
- ...nl,
6565
- ...rl,
6566
- ...il,
6567
- ...ol,
6568
- ...cl
6569
- ]), C = null, ge = Q({}, [
6570
- ...ll,
6571
- ...ul,
6572
- ...dl,
6573
- ...fl
6574
- ]), w = Object.seal(jc(null, {
6040
+ let _, re = "", { implementation: ie, createNodeIterator: ae, createDocumentFragment: oe, getElementsByTagName: se } = n, { importNode: ce } = r, v = Rc();
6041
+ t.isSupported = typeof Is == "function" && typeof ne == "function" && ie && ie.createHTMLDocument !== void 0;
6042
+ let { MUSTACHE_EXPR: le, ERB_EXPR: y, TMPLIT_EXPR: b, DATA_ATTR: x, ARIA_ATTR: ue, IS_SCRIPT_OR_DATA: de, ATTR_WHITESPACE: fe, CUSTOM_ELEMENT: pe } = Pc, { IS_ALLOWED_URI: me } = Pc, S = null, he = X({}, [
6043
+ ...pc,
6044
+ ...mc,
6045
+ ...hc,
6046
+ ..._c,
6047
+ ...yc
6048
+ ]), C = null, ge = X({}, [
6049
+ ...bc,
6050
+ ...xc,
6051
+ ...Sc,
6052
+ ...Cc
6053
+ ]), w = Object.seal(Hs(null, {
6575
6054
  tagNameCheck: {
6576
6055
  writable: !0,
6577
6056
  configurable: !1,
@@ -6590,7 +6069,7 @@ function Ol() {
6590
6069
  enumerable: !0,
6591
6070
  value: !1
6592
6071
  }
6593
- })), _e = null, ve = null, ye = Object.seal(jc(null, {
6072
+ })), _e = null, ve = null, ye = Object.seal(Hs(null, {
6594
6073
  tagCheck: {
6595
6074
  writable: !0,
6596
6075
  configurable: !1,
@@ -6603,7 +6082,7 @@ function Ol() {
6603
6082
  enumerable: !0,
6604
6083
  value: null
6605
6084
  }
6606
- })), T = !0, be = !0, xe = !1, Se = !0, Ce = !1, we = !0, Te = !1, Ee = !1, De = !1, Oe = !1, E = !1, ke = !1, Ae = !0, je = !1, Me = "user-content-", Ne = !0, Pe = !1, Fe = {}, Ie = null, Le = Q({}, [
6085
+ })), T = !0, be = !0, xe = !1, Se = !0, Ce = !1, we = !0, Te = !1, Ee = !1, De = !1, Oe = !1, E = !1, ke = !1, Ae = !0, je = !1, Me = "user-content-", Ne = !0, Pe = !1, Fe = {}, Ie = null, Le = X({}, [
6607
6086
  "annotation-xml",
6608
6087
  "audio",
6609
6088
  "colgroup",
@@ -6629,14 +6108,14 @@ function Ol() {
6629
6108
  "title",
6630
6109
  "video",
6631
6110
  "xmp"
6632
- ]), Re = null, ze = Q({}, [
6111
+ ]), Re = null, ze = X({}, [
6633
6112
  "audio",
6634
6113
  "video",
6635
6114
  "img",
6636
6115
  "source",
6637
6116
  "image",
6638
6117
  "track"
6639
- ]), Be = null, Ve = Q({}, [
6118
+ ]), Be = null, Ve = X({}, [
6640
6119
  "alt",
6641
6120
  "class",
6642
6121
  "for",
@@ -6651,17 +6130,17 @@ function Ol() {
6651
6130
  "value",
6652
6131
  "style",
6653
6132
  "xmlns"
6654
- ]), He = "http://www.w3.org/1998/Math/MathML", D = "http://www.w3.org/2000/svg", O = "http://www.w3.org/1999/xhtml", Ue = O, We = !1, Ge = null, Ke = Q({}, [
6133
+ ]), He = "http://www.w3.org/1998/Math/MathML", D = "http://www.w3.org/2000/svg", O = "http://www.w3.org/1999/xhtml", Ue = O, We = !1, Ge = null, Ke = X({}, [
6655
6134
  He,
6656
6135
  D,
6657
6136
  O
6658
- ], Bc), qe = Q({}, [
6137
+ ], Zs), qe = X({}, [
6659
6138
  "mi",
6660
6139
  "mo",
6661
6140
  "mn",
6662
6141
  "ms",
6663
6142
  "mtext"
6664
- ]), Je = Q({}, ["annotation-xml"]), Ye = Q({}, [
6143
+ ]), Je = X({}, ["annotation-xml"]), Ye = X({}, [
6665
6144
  "title",
6666
6145
  "style",
6667
6146
  "font",
@@ -6672,38 +6151,38 @@ function Ol() {
6672
6151
  }, tt = function() {
6673
6152
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
6674
6153
  if (Qe && Qe === e) return;
6675
- (!e || typeof e != "object") && (e = {}), e = $(e), Xe = Ze.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, k = Xe === "application/xhtml+xml" ? Bc : zc, S = Y(e, "ALLOWED_TAGS") && J(e.ALLOWED_TAGS) ? Q({}, e.ALLOWED_TAGS, k) : he, C = Y(e, "ALLOWED_ATTR") && J(e.ALLOWED_ATTR) ? Q({}, e.ALLOWED_ATTR, k) : ge, Ge = Y(e, "ALLOWED_NAMESPACES") && J(e.ALLOWED_NAMESPACES) ? Q({}, e.ALLOWED_NAMESPACES, Bc) : Ke, Be = Y(e, "ADD_URI_SAFE_ATTR") && J(e.ADD_URI_SAFE_ATTR) ? Q($(Ve), e.ADD_URI_SAFE_ATTR, k) : Ve, Re = Y(e, "ADD_DATA_URI_TAGS") && J(e.ADD_DATA_URI_TAGS) ? Q($(ze), e.ADD_DATA_URI_TAGS, k) : ze, Ie = Y(e, "FORBID_CONTENTS") && J(e.FORBID_CONTENTS) ? Q({}, e.FORBID_CONTENTS, k) : Le, _e = Y(e, "FORBID_TAGS") && J(e.FORBID_TAGS) ? Q({}, e.FORBID_TAGS, k) : $({}), ve = Y(e, "FORBID_ATTR") && J(e.FORBID_ATTR) ? Q({}, e.FORBID_ATTR, k) : $({}), Fe = Y(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? $(e.USE_PROFILES) : e.USE_PROFILES : !1, T = e.ALLOW_ARIA_ATTR !== !1, be = e.ALLOW_DATA_ATTR !== !1, xe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Se = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ce = e.SAFE_FOR_TEMPLATES || !1, we = e.SAFE_FOR_XML !== !1, Te = e.WHOLE_DOCUMENT || !1, Oe = e.RETURN_DOM || !1, E = e.RETURN_DOM_FRAGMENT || !1, ke = e.RETURN_TRUSTED_TYPE || !1, De = e.FORCE_BODY || !1, Ae = e.SANITIZE_DOM !== !1, je = e.SANITIZE_NAMED_PROPS || !1, Ne = e.KEEP_CONTENT !== !1, Pe = e.IN_PLACE || !1, me = tl(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : vl, Ue = typeof e.NAMESPACE == "string" ? e.NAMESPACE : O, qe = Y(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? $(e.MATHML_TEXT_INTEGRATION_POINTS) : Q({}, [
6154
+ (!e || typeof e != "object") && (e = {}), e = Z(e), Xe = Ze.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, k = Xe === "application/xhtml+xml" ? Zs : Xs, S = q(e, "ALLOWED_TAGS") && K(e.ALLOWED_TAGS) ? X({}, e.ALLOWED_TAGS, k) : he, C = q(e, "ALLOWED_ATTR") && K(e.ALLOWED_ATTR) ? X({}, e.ALLOWED_ATTR, k) : ge, Ge = q(e, "ALLOWED_NAMESPACES") && K(e.ALLOWED_NAMESPACES) ? X({}, e.ALLOWED_NAMESPACES, Zs) : Ke, Be = q(e, "ADD_URI_SAFE_ATTR") && K(e.ADD_URI_SAFE_ATTR) ? X(Z(Ve), e.ADD_URI_SAFE_ATTR, k) : Ve, Re = q(e, "ADD_DATA_URI_TAGS") && K(e.ADD_DATA_URI_TAGS) ? X(Z(ze), e.ADD_DATA_URI_TAGS, k) : ze, Ie = q(e, "FORBID_CONTENTS") && K(e.FORBID_CONTENTS) ? X({}, e.FORBID_CONTENTS, k) : Le, _e = q(e, "FORBID_TAGS") && K(e.FORBID_TAGS) ? X({}, e.FORBID_TAGS, k) : Z({}), ve = q(e, "FORBID_ATTR") && K(e.FORBID_ATTR) ? X({}, e.FORBID_ATTR, k) : Z({}), Fe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, T = e.ALLOW_ARIA_ATTR !== !1, be = e.ALLOW_DATA_ATTR !== !1, xe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Se = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ce = e.SAFE_FOR_TEMPLATES || !1, we = e.SAFE_FOR_XML !== !1, Te = e.WHOLE_DOCUMENT || !1, Oe = e.RETURN_DOM || !1, E = e.RETURN_DOM_FRAGMENT || !1, ke = e.RETURN_TRUSTED_TYPE || !1, De = e.FORCE_BODY || !1, Ae = e.SANITIZE_DOM !== !1, je = e.SANITIZE_NAMED_PROPS || !1, Ne = e.KEEP_CONTENT !== !1, Pe = e.IN_PLACE || !1, me = fc(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : kc, Ue = typeof e.NAMESPACE == "string" ? e.NAMESPACE : O, qe = q(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Z(e.MATHML_TEXT_INTEGRATION_POINTS) : X({}, [
6676
6155
  "mi",
6677
6156
  "mo",
6678
6157
  "mn",
6679
6158
  "ms",
6680
6159
  "mtext"
6681
- ]), Je = Y(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? $(e.HTML_INTEGRATION_POINTS) : Q({}, ["annotation-xml"]);
6682
- let t = Y(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? $(e.CUSTOM_ELEMENT_HANDLING) : jc(null);
6683
- if (w = jc(null), Y(t, "tagNameCheck") && et(t.tagNameCheck) && (w.tagNameCheck = t.tagNameCheck), Y(t, "attributeNameCheck") && et(t.attributeNameCheck) && (w.attributeNameCheck = t.attributeNameCheck), Y(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), Ce && (be = !1), E && (Oe = !0), Fe && (S = Q({}, cl), C = jc(null), Fe.html === !0 && (Q(S, nl), Q(C, ll)), Fe.svg === !0 && (Q(S, rl), Q(C, ul), Q(C, fl)), Fe.svgFilters === !0 && (Q(S, il), Q(C, ul), Q(C, fl)), Fe.mathMl === !0 && (Q(S, ol), Q(C, dl), Q(C, fl))), ye.tagCheck = null, ye.attributeCheck = null, Y(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ye.tagCheck = e.ADD_TAGS : J(e.ADD_TAGS) && (S === he && (S = $(S)), Q(S, e.ADD_TAGS, k))), Y(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ye.attributeCheck = e.ADD_ATTR : J(e.ADD_ATTR) && (C === ge && (C = $(C)), Q(C, e.ADD_ATTR, k))), Y(e, "ADD_URI_SAFE_ATTR") && J(e.ADD_URI_SAFE_ATTR) && Q(Be, e.ADD_URI_SAFE_ATTR, k), Y(e, "FORBID_CONTENTS") && J(e.FORBID_CONTENTS) && (Ie === Le && (Ie = $(Ie)), Q(Ie, e.FORBID_CONTENTS, k)), Y(e, "ADD_FORBID_CONTENTS") && J(e.ADD_FORBID_CONTENTS) && (Ie === Le && (Ie = $(Ie)), Q(Ie, e.ADD_FORBID_CONTENTS, k)), Ne && (S["#text"] = !0), Te && Q(S, [
6160
+ ]), Je = q(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Z(e.HTML_INTEGRATION_POINTS) : X({}, ["annotation-xml"]);
6161
+ let t = q(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Z(e.CUSTOM_ELEMENT_HANDLING) : Hs(null);
6162
+ if (w = Hs(null), q(t, "tagNameCheck") && et(t.tagNameCheck) && (w.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && et(t.attributeNameCheck) && (w.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), Ce && (be = !1), E && (Oe = !0), Fe && (S = X({}, yc), C = Hs(null), Fe.html === !0 && (X(S, pc), X(C, bc)), Fe.svg === !0 && (X(S, mc), X(C, xc), X(C, Cc)), Fe.svgFilters === !0 && (X(S, hc), X(C, xc), X(C, Cc)), Fe.mathMl === !0 && (X(S, _c), X(C, Sc), X(C, Cc))), ye.tagCheck = null, ye.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ye.tagCheck = e.ADD_TAGS : K(e.ADD_TAGS) && (S === he && (S = Z(S)), X(S, e.ADD_TAGS, k))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ye.attributeCheck = e.ADD_ATTR : K(e.ADD_ATTR) && (C === ge && (C = Z(C)), X(C, e.ADD_ATTR, k))), q(e, "ADD_URI_SAFE_ATTR") && K(e.ADD_URI_SAFE_ATTR) && X(Be, e.ADD_URI_SAFE_ATTR, k), q(e, "FORBID_CONTENTS") && K(e.FORBID_CONTENTS) && (Ie === Le && (Ie = Z(Ie)), X(Ie, e.FORBID_CONTENTS, k)), q(e, "ADD_FORBID_CONTENTS") && K(e.ADD_FORBID_CONTENTS) && (Ie === Le && (Ie = Z(Ie)), X(Ie, e.ADD_FORBID_CONTENTS, k)), Ne && (S["#text"] = !0), Te && X(S, [
6684
6163
  "html",
6685
6164
  "head",
6686
6165
  "body"
6687
- ]), S.table && (Q(S, ["tbody"]), delete _e.tbody), e.TRUSTED_TYPES_POLICY) {
6688
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Xc("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
6689
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Xc("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
6166
+ ]), S.table && (X(S, ["tbody"]), delete _e.tbody), e.TRUSTED_TYPES_POLICY) {
6167
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw sc("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
6168
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw sc("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
6690
6169
  _ = e.TRUSTED_TYPES_POLICY, re = _.createHTML("");
6691
- } else _ === void 0 && (_ = El(p, i)), _ !== null && typeof re == "string" && (re = _.createHTML(""));
6692
- q && q(e), Qe = e;
6693
- }, nt = Q({}, [
6694
- ...rl,
6695
- ...il,
6696
- ...al
6697
- ]), rt = Q({}, [...ol, ...sl]), it = function(e) {
6170
+ } else _ === void 0 && (_ = Lc(p, i)), _ !== null && typeof re == "string" && (re = _.createHTML(""));
6171
+ G && G(e), Qe = e;
6172
+ }, nt = X({}, [
6173
+ ...mc,
6174
+ ...hc,
6175
+ ...gc
6176
+ ]), rt = X({}, [..._c, ...vc]), it = function(e) {
6698
6177
  let t = ne(e);
6699
6178
  (!t || !t.tagName) && (t = {
6700
6179
  namespaceURI: Ue,
6701
6180
  tagName: "template"
6702
6181
  });
6703
- let n = zc(e.tagName), r = zc(t.tagName);
6182
+ let n = Xs(e.tagName), r = Xs(t.tagName);
6704
6183
  return Ge[e.namespaceURI] ? e.namespaceURI === D ? t.namespaceURI === O ? n === "svg" : t.namespaceURI === He ? n === "svg" && (r === "annotation-xml" || qe[r]) : !!nt[n] : e.namespaceURI === He ? t.namespaceURI === O ? n === "math" : t.namespaceURI === D ? n === "math" && Je[r] : !!rt[n] : e.namespaceURI === O ? t.namespaceURI === D && !Je[r] || t.namespaceURI === He && !qe[r] ? !1 : !rt[n] && (Ye[n] || !nt[n]) : !!(Xe === "application/xhtml+xml" && Ge[e.namespaceURI]) : !1;
6705
6184
  }, at = function(e) {
6706
- Lc(t.removed, { element: e });
6185
+ Js(t.removed, { element: e });
6707
6186
  try {
6708
6187
  ne(e).removeChild(e);
6709
6188
  } catch {
@@ -6711,12 +6190,12 @@ function Ol() {
6711
6190
  }
6712
6191
  }, ot = function(e, n) {
6713
6192
  try {
6714
- Lc(t.removed, {
6193
+ Js(t.removed, {
6715
6194
  attribute: n.getAttributeNode(e),
6716
6195
  from: n
6717
6196
  });
6718
6197
  } catch {
6719
- Lc(t.removed, {
6198
+ Js(t.removed, {
6720
6199
  attribute: null,
6721
6200
  from: n
6722
6201
  });
@@ -6731,7 +6210,7 @@ function Ol() {
6731
6210
  let t = null, r = null;
6732
6211
  if (De) e = "<remove></remove>" + e;
6733
6212
  else {
6734
- let t = Vc(e, /^[\r\n\t ]+/);
6213
+ let t = Qs(e, /^[\r\n\t ]+/);
6735
6214
  r = t && t[0];
6736
6215
  }
6737
6216
  Xe === "application/xhtml+xml" && Ue === O && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
@@ -6755,7 +6234,7 @@ function Ol() {
6755
6234
  return typeof s == "function" && e instanceof s;
6756
6235
  };
6757
6236
  function dt(e, n, r) {
6758
- Pc(e, (e) => {
6237
+ Gs(e, (e) => {
6759
6238
  e.call(t, n, r, Qe);
6760
6239
  });
6761
6240
  }
@@ -6766,9 +6245,9 @@ function Ol() {
6766
6245
  if (dt(v.uponSanitizeElement, e, {
6767
6246
  tagName: r,
6768
6247
  allowedTags: S
6769
- }), we && e.hasChildNodes() && !ut(e.firstElementChild) && X(/<[/\w!]/g, e.innerHTML) && X(/<[/\w!]/g, e.textContent) || we && e.namespaceURI === O && r === "style" && ut(e.firstElementChild) || e.nodeType === wl.progressingInstruction || we && e.nodeType === wl.comment && X(/<[/\w]/g, e.data)) return at(e), !0;
6248
+ }), we && e.hasChildNodes() && !ut(e.firstElementChild) && J(/<[/\w!]/g, e.innerHTML) && J(/<[/\w!]/g, e.textContent) || we && e.namespaceURI === O && r === "style" && ut(e.firstElementChild) || e.nodeType === Fc.progressingInstruction || we && e.nodeType === Fc.comment && J(/<[/\w]/g, e.data)) return at(e), !0;
6770
6249
  if (_e[r] || !(ye.tagCheck instanceof Function && ye.tagCheck(r)) && !S[r]) {
6771
- if (!_e[r] && ht(r) && (w.tagNameCheck instanceof RegExp && X(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r))) return !1;
6250
+ if (!_e[r] && ht(r) && (w.tagNameCheck instanceof RegExp && J(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r))) return !1;
6772
6251
  if (Ne && !Ie[r]) {
6773
6252
  let t = ne(e) || e.parentNode, n = te(e) || e.childNodes;
6774
6253
  if (n && t) {
@@ -6781,23 +6260,23 @@ function Ol() {
6781
6260
  }
6782
6261
  return at(e), !0;
6783
6262
  }
6784
- return e instanceof c && !it(e) || (r === "noscript" || r === "noembed" || r === "noframes") && X(/<\/no(script|embed|frames)/i, e.innerHTML) ? (at(e), !0) : (Ce && e.nodeType === wl.text && (n = e.textContent, Pc([
6263
+ return e instanceof c && !it(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(/<\/no(script|embed|frames)/i, e.innerHTML) ? (at(e), !0) : (Ce && e.nodeType === Fc.text && (n = e.textContent, Gs([
6785
6264
  le,
6786
6265
  y,
6787
6266
  b
6788
6267
  ], (e) => {
6789
- n = Hc(n, e, " ");
6790
- }), e.textContent !== n && (Lc(t.removed, { element: e.cloneNode() }), e.textContent = n)), dt(v.afterSanitizeElements, e, null), !1);
6268
+ n = $s(n, e, " ");
6269
+ }), e.textContent !== n && (Js(t.removed, { element: e.cloneNode() }), e.textContent = n)), dt(v.afterSanitizeElements, e, null), !1);
6791
6270
  }, pt = function(e, t, r) {
6792
6271
  if (ve[t] || Ae && (t === "id" || t === "name") && (r in n || r in $e)) return !1;
6793
6272
  let i = C[t] || ye.attributeCheck instanceof Function && ye.attributeCheck(t, e);
6794
- if (!(be && !ve[t] && X(x, t)) && !(T && X(ue, t))) {
6273
+ if (!(be && !ve[t] && J(x, t)) && !(T && J(ue, t))) {
6795
6274
  if (!i || ve[t]) {
6796
- if (!(ht(e) && (w.tagNameCheck instanceof RegExp && X(w.tagNameCheck, e) || w.tagNameCheck instanceof Function && w.tagNameCheck(e)) && (w.attributeNameCheck instanceof RegExp && X(w.attributeNameCheck, t) || w.attributeNameCheck instanceof Function && w.attributeNameCheck(t, e)) || t === "is" && w.allowCustomizedBuiltInElements && (w.tagNameCheck instanceof RegExp && X(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r)))) return !1;
6797
- } else if (!Be[t] && !X(me, Hc(r, fe, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Uc(r, "data:") === 0 && Re[e]) && !(xe && !X(de, Hc(r, fe, ""))) && r) return !1;
6275
+ if (!(ht(e) && (w.tagNameCheck instanceof RegExp && J(w.tagNameCheck, e) || w.tagNameCheck instanceof Function && w.tagNameCheck(e)) && (w.attributeNameCheck instanceof RegExp && J(w.attributeNameCheck, t) || w.attributeNameCheck instanceof Function && w.attributeNameCheck(t, e)) || t === "is" && w.allowCustomizedBuiltInElements && (w.tagNameCheck instanceof RegExp && J(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r)))) return !1;
6276
+ } else if (!Be[t] && !J(me, $s(r, fe, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && ec(r, "data:") === 0 && Re[e]) && !(xe && !J(de, $s(r, fe, ""))) && r) return !1;
6798
6277
  }
6799
6278
  return !0;
6800
- }, mt = Q({}, [
6279
+ }, mt = X({}, [
6801
6280
  "annotation-xml",
6802
6281
  "color-profile",
6803
6282
  "font-face",
@@ -6807,7 +6286,7 @@ function Ol() {
6807
6286
  "font-face-uri",
6808
6287
  "missing-glyph"
6809
6288
  ]), ht = function(e) {
6810
- return !mt[zc(e)] && X(pe, e);
6289
+ return !mt[Xs(e)] && J(pe, e);
6811
6290
  }, gt = function(e) {
6812
6291
  dt(v.beforeSanitizeAttributes, e, null);
6813
6292
  let { attributes: n } = e;
@@ -6820,12 +6299,12 @@ function Ol() {
6820
6299
  forceKeepAttr: void 0
6821
6300
  }, i = n.length;
6822
6301
  for (; i--;) {
6823
- let { name: a, namespaceURI: o, value: s } = n[i], c = k(a), l = s, u = a === "value" ? l : Wc(l);
6824
- if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, dt(v.uponSanitizeAttribute, e, r), u = r.attrValue, je && (c === "id" || c === "name") && Uc(u, Me) !== 0 && (ot(a, e), u = Me + u), we && X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, u)) {
6302
+ let { name: a, namespaceURI: o, value: s } = n[i], c = k(a), l = s, u = a === "value" ? l : tc(l);
6303
+ if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, dt(v.uponSanitizeAttribute, e, r), u = r.attrValue, je && (c === "id" || c === "name") && ec(u, Me) !== 0 && (ot(a, e), u = Me + u), we && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, u)) {
6825
6304
  ot(a, e);
6826
6305
  continue;
6827
6306
  }
6828
- if (c === "attributename" && Vc(u, "href")) {
6307
+ if (c === "attributename" && Qs(u, "href")) {
6829
6308
  ot(a, e);
6830
6309
  continue;
6831
6310
  }
@@ -6834,16 +6313,16 @@ function Ol() {
6834
6313
  ot(a, e);
6835
6314
  continue;
6836
6315
  }
6837
- if (!Se && X(/\/>/i, u)) {
6316
+ if (!Se && J(/\/>/i, u)) {
6838
6317
  ot(a, e);
6839
6318
  continue;
6840
6319
  }
6841
- Ce && Pc([
6320
+ Ce && Gs([
6842
6321
  le,
6843
6322
  y,
6844
6323
  b
6845
6324
  ], (e) => {
6846
- u = Hc(u, e, " ");
6325
+ u = $s(u, e, " ");
6847
6326
  });
6848
6327
  let d = k(e.nodeName);
6849
6328
  if (!pt(d, c, u)) {
@@ -6859,7 +6338,7 @@ function Ol() {
6859
6338
  break;
6860
6339
  }
6861
6340
  if (u !== l) try {
6862
- o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), lt(e) ? at(e) : Ic(t.removed);
6341
+ o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), lt(e) ? at(e) : qs(t.removed);
6863
6342
  } catch {
6864
6343
  ot(a, e);
6865
6344
  }
@@ -6872,15 +6351,15 @@ function Ol() {
6872
6351
  };
6873
6352
  return t.sanitize = function(e) {
6874
6353
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
6875
- if (We = !e, We && (e = "<!-->"), typeof e != "string" && !ut(e) && (e = $c(e), typeof e != "string")) throw Xc("dirty is not a string, aborting");
6354
+ if (We = !e, We && (e = "<!-->"), typeof e != "string" && !ut(e) && (e = uc(e), typeof e != "string")) throw sc("dirty is not a string, aborting");
6876
6355
  if (!t.isSupported) return e;
6877
6356
  if (Ee || tt(n), t.removed = [], typeof e == "string" && (Pe = !1), Pe) {
6878
6357
  let t = e.nodeName;
6879
6358
  if (typeof t == "string") {
6880
6359
  let e = k(t);
6881
- if (!S[e] || _e[e]) throw Xc("root node is forbidden and cannot be sanitized in-place");
6360
+ if (!S[e] || _e[e]) throw sc("root node is forbidden and cannot be sanitized in-place");
6882
6361
  }
6883
- } else if (e instanceof s) i = st("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === wl.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
6362
+ } else if (e instanceof s) i = st("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === Fc.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
6884
6363
  else {
6885
6364
  if (!Oe && !Ce && !Te && e.indexOf("<") === -1) return _ && ke ? _.createHTML(e) : e;
6886
6365
  if (i = st(e), !i) return Oe ? null : ke ? re : "";
@@ -6893,12 +6372,12 @@ function Ol() {
6893
6372
  if (Ce) {
6894
6373
  i.normalize();
6895
6374
  let e = i.innerHTML;
6896
- Pc([
6375
+ Gs([
6897
6376
  le,
6898
6377
  y,
6899
6378
  b
6900
6379
  ], (t) => {
6901
- e = Hc(e, t, " ");
6380
+ e = $s(e, t, " ");
6902
6381
  }), i.innerHTML = e;
6903
6382
  }
6904
6383
  if (E) for (l = oe.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
@@ -6906,12 +6385,12 @@ function Ol() {
6906
6385
  return (C.shadowroot || C.shadowrootmode) && (l = ce.call(r, l, !0)), l;
6907
6386
  }
6908
6387
  let d = Te ? i.outerHTML : i.innerHTML;
6909
- return Te && S["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && X(xl, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), Ce && Pc([
6388
+ return Te && S["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(Mc, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), Ce && Gs([
6910
6389
  le,
6911
6390
  y,
6912
6391
  b
6913
6392
  ], (e) => {
6914
- d = Hc(d, e, " ");
6393
+ d = $s(d, e, " ");
6915
6394
  }), _ && ke ? _.createHTML(d) : d;
6916
6395
  }, t.setConfig = function() {
6917
6396
  tt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), Ee = !0;
@@ -6920,39 +6399,39 @@ function Ol() {
6920
6399
  }, t.isValidAttribute = function(e, t, n) {
6921
6400
  return Qe || tt({}), pt(k(e), k(t), n);
6922
6401
  }, t.addHook = function(e, t) {
6923
- typeof t == "function" && Lc(v[e], t);
6402
+ typeof t == "function" && Js(v[e], t);
6924
6403
  }, t.removeHook = function(e, t) {
6925
6404
  if (t !== void 0) {
6926
- let n = Fc(v[e], t);
6927
- return n === -1 ? void 0 : Rc(v[e], n, 1)[0];
6405
+ let n = Ks(v[e], t);
6406
+ return n === -1 ? void 0 : Ys(v[e], n, 1)[0];
6928
6407
  }
6929
- return Ic(v[e]);
6408
+ return qs(v[e]);
6930
6409
  }, t.removeHooks = function(e) {
6931
6410
  v[e] = [];
6932
6411
  }, t.removeAllHooks = function() {
6933
- v = Dl();
6412
+ v = Rc();
6934
6413
  }, t;
6935
6414
  }
6936
- var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, jl = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, Ml = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g, Nl = { ALLOWED_URI_REGEXP: jl }, Pl = (e) => {
6937
- if (!Al.test(e.replace(Ml, ""))) return "";
6415
+ var Bc = zc(), Vc = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, Hc = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i, Uc = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g, Wc = { ALLOWED_URI_REGEXP: Hc }, Gc = (e) => {
6416
+ if (!Vc.test(e.replace(Uc, ""))) return "";
6938
6417
  let t = document.createElement("a");
6939
6418
  /* v8 ignore next -- since href is already validated it's probably always present @preserve */
6940
- return t.setAttribute("href", e), kl.sanitize(t, {
6419
+ return t.setAttribute("href", e), Bc.sanitize(t, {
6941
6420
  RETURN_DOM: !0,
6942
- ...Nl
6421
+ ...Wc
6943
6422
  }).querySelector("a").getAttribute("href") ?? "";
6944
- }, Fl = (e) => {
6423
+ }, Kc = (e) => {
6945
6424
  let t = document.createElement("img");
6946
- return t.setAttribute("src", e), kl.sanitize(t, {
6425
+ return t.setAttribute("src", e), Bc.sanitize(t, {
6947
6426
  RETURN_DOM: !0,
6948
- ...Nl
6427
+ ...Wc
6949
6428
  }).querySelector("img").getAttribute("src") ?? "";
6950
- }, Il = (e) => e.replace(/[;!].*/, ""), Ll = (e) => ({ ...e }), Rl = (e) => ({
6951
- nodes: Object.fromEntries(Object.keys(e.nodes).map((t) => [t, (e.nodes[t].spec.parseDOM ?? []).map(Ll)])),
6952
- marks: Object.fromEntries(Object.keys(e.marks).map((t) => [t, (e.marks[t].spec.parseDOM ?? []).map(Ll)]))
6953
- }), zl = class {
6429
+ }, qc = (e) => e.replace(/[;!].*/, ""), Jc = (e) => ({ ...e }), Yc = (e) => ({
6430
+ nodes: Object.fromEntries(Object.keys(e.nodes).map((t) => [t, (e.nodes[t].spec.parseDOM ?? []).map(Jc)])),
6431
+ marks: Object.fromEntries(Object.keys(e.marks).map((t) => [t, (e.marks[t].spec.parseDOM ?? []).map(Jc)]))
6432
+ }), Xc = class {
6954
6433
  constructor(e, t) {
6955
- this[b] = new Bl(e[b], t);
6434
+ this[b] = new Zc(e[b], t);
6956
6435
  }
6957
6436
  parseDocument(e, t) {
6958
6437
  return this[b].parser.parse(this.parseHtml(e, t), { preserveWhitespace: !0 }).toJSON();
@@ -6961,21 +6440,21 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
6961
6440
  return this[b].parser.parseSlice(this.parseHtml(e, t), { preserveWhitespace: !0 }).content.toJSON() ?? [];
6962
6441
  }
6963
6442
  parseHtml(e, t) {
6964
- let n = kl.sanitize(e, {
6443
+ let n = Bc.sanitize(e, {
6965
6444
  RETURN_DOM: !0,
6966
- ...Nl
6445
+ ...Wc
6967
6446
  }), r = document.createDocumentFragment();
6968
6447
  return r.appendChild(n), t?.modifyDom?.(r), r;
6969
6448
  }
6970
- }, Bl = class {
6449
+ }, Zc = class {
6971
6450
  constructor(e, t) {
6972
- let n = Rl(e.schema);
6973
- t?.modifyParseRules?.(n), this.parser = Vl(e.schema, n);
6451
+ let n = Yc(e.schema);
6452
+ t?.modifyParseRules?.(n), this.parser = Qc(e.schema, n);
6974
6453
  }
6975
6454
  transform(e) {
6976
- return kl.sanitize(e);
6455
+ return Bc.sanitize(e);
6977
6456
  }
6978
- }, Vl = (e, { marks: t, nodes: n }) => {
6457
+ }, Qc = (e, { marks: t, nodes: n }) => {
6979
6458
  let r = [], i = (e) => e.priority ?? 50;
6980
6459
  function a(e) {
6981
6460
  let t = 0;
@@ -6986,18 +6465,18 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
6986
6465
  r.splice(t, 0, e);
6987
6466
  }
6988
6467
  for (let e in t) t[e]?.forEach((t) => {
6989
- a(t = Ll(t)), t.mark || t.ignore || t.clearMark || (t.mark = e);
6468
+ a(t = Jc(t)), t.mark || t.ignore || t.clearMark || (t.mark = e);
6990
6469
  });
6991
6470
  for (let e in n) n[e]?.forEach((t) => {
6992
- a(t = Ll(t)), t.node || t.ignore || t.mark || (t.node = e);
6471
+ a(t = Jc(t)), t.node || t.ignore || t.mark || (t.node = e);
6993
6472
  });
6994
6473
  return r.push({
6995
6474
  tag: "br",
6996
6475
  closeParent: !0
6997
6476
  }), new me(e, r);
6998
- }, Hl = class {
6477
+ }, $c = class {
6999
6478
  constructor(e, t) {
7000
- this[b] = new Ul(e[b], t);
6479
+ this[b] = new el(e[b], t);
7001
6480
  }
7002
6481
  serializeDocument(e, t) {
7003
6482
  return this[b].serializeFragment(e.content, t);
@@ -7005,7 +6484,7 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
7005
6484
  serializeFragment(e, t) {
7006
6485
  return this[b].serializeFragment(e, t);
7007
6486
  }
7008
- }, Ul = class e {
6487
+ }, el = class e {
7009
6488
  constructor(t, n) {
7010
6489
  this.config = t;
7011
6490
  let r = e.domSerializersFromSchema(t.schema);
@@ -7032,13 +6511,13 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
7032
6511
  let a = document.createElement("div");
7033
6512
  return a.appendChild(i), a.innerHTML;
7034
6513
  }
7035
- }, Wl = (e, t) => {
6514
+ }, tl = (e, t) => {
7036
6515
  let n = e.topNodeType.createAndFill(null, t ? x.fromJSON(e, t.content) : null);
7037
6516
  if (!n) throw Error("Document could not be parsed");
7038
6517
  return n.check(), n;
7039
- }, Gl = class {
6518
+ }, nl = class {
7040
6519
  constructor(e, t) {
7041
- this.options = t, this.feature = (e, t) => this[b].getPublicInterface(e, t), this[b] = new Kl(this, e, t);
6520
+ this.options = t, this.feature = (e, t) => this[b].getPublicInterface(e, t), this[b] = new rl(this, e, t);
7042
6521
  }
7043
6522
  getDocument() {
7044
6523
  return this[b].state.doc.toJSON();
@@ -7052,191 +6531,714 @@ var kl = Ol(), Al = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]
7052
6531
  let o = r.doc.resolve(r.mapping.map(n.selection.from)), s = r.doc.resolve(r.selection.to), [c, l] = t?.cursorPlacement === "start" ? [o, s] : [s, o];
7053
6532
  t?.selectContent ? r.setSelection(n.selection instanceof Vt ? new Vt(r.doc) : j.between(l, c)) : r.setSelection(j.between(c, c)), a(r);
7054
6533
  }
7055
- replaceDocument(e, t) {
7056
- let { state: n, tr: r, schema: i, dispatchTransaction: a } = this[b];
7057
- r.replaceWith(0, n.doc.content.size, Wl(i, e)), t?.selectContent ? r.setSelection(new Vt(r.doc)) : t?.cursorPlacement === "end" ? r.setSelection(j.atEnd(r.doc)) : r.setSelection(j.atStart(r.doc)), a(r);
6534
+ replaceDocument(e, t) {
6535
+ let { state: n, tr: r, schema: i, dispatchTransaction: a } = this[b];
6536
+ r.replaceWith(0, n.doc.content.size, tl(i, e)), t?.selectContent ? r.setSelection(new Vt(r.doc)) : t?.cursorPlacement === "end" ? r.setSelection(j.atEnd(r.doc)) : r.setSelection(j.atStart(r.doc)), a(r);
6537
+ }
6538
+ }, rl = class {
6539
+ getFeature(e) {
6540
+ let t = this.config.featureMap.get(e);
6541
+ if (!t) throw Error(`Feature not found: ${e}`);
6542
+ return t;
6543
+ }
6544
+ getPublicInterface(e, t) {
6545
+ let n = this.config.featureFacadesMap.get(e);
6546
+ if (!n || n.length === 0) throw Error("Feature not found");
6547
+ if (n[0].featureId !== void 0) {
6548
+ if (t === void 0) throw Error("No featureId provided for multi-instance feature.");
6549
+ let e = n.find((e) => e.featureId === t);
6550
+ if (!e) throw Error(`Feature with id "${t}" not found`);
6551
+ return e.getPublicInterface(this);
6552
+ }
6553
+ if (t !== void 0) throw Error("Feature does not support featureId");
6554
+ return n[0].getPublicInterface(this);
6555
+ }
6556
+ constructor(e, t, n) {
6557
+ this.options = n, this.view = null, this.dispatchTransaction = (e) => {
6558
+ let t = this.state;
6559
+ return this.state = this.state.apply(e), this.view?.updateState(this.state), t.doc !== this.state.doc && this.options?.onChange?.(), this.state;
6560
+ }, this.facade = e;
6561
+ let r = t[b];
6562
+ this.config = r, this.schema = r.schema, this.textblockAttrs = r.textblockAttrs, this.features = r.features, this.foreignHtmlParser = n?.foreignHtmlParser ?? new Xc(t), this.foreignHtmlSerializer = n?.foreignHtmlSerializer ?? new $c(t), this.styles = new s(_e(r.features.flatMap((e) => e.getStyles()))), this.initState(n?.initialDocument);
6563
+ }
6564
+ initState(e) {
6565
+ this.state = $t.create({
6566
+ doc: tl(this.schema, e),
6567
+ schema: this.config.schema,
6568
+ plugins: _e(this.config.features.flatMap((e) => e.getPlugins(this)))
6569
+ });
6570
+ }
6571
+ reset(e) {
6572
+ let t = Ps.getState(this.state);
6573
+ this.initState(e), this.updateHostState(t), this.view?.updateState(this.state);
6574
+ }
6575
+ createView(e) {
6576
+ this.view = new po((t) => {
6577
+ t.part = "editor", e.appendChild(t);
6578
+ }, {
6579
+ state: this.state,
6580
+ dispatchTransaction: this.dispatchTransaction
6581
+ });
6582
+ }
6583
+ destroyViewIfNeeded() {
6584
+ this.view &&= (this.view.destroy(), null);
6585
+ }
6586
+ createComponent(e) {
6587
+ return document.createElement(this.hostState().ctx.tagFor(e, !0));
6588
+ }
6589
+ getLocale() {
6590
+ return this.hostState().locale;
6591
+ }
6592
+ get tr() {
6593
+ return this.state.tr;
6594
+ }
6595
+ hostState() {
6596
+ let e = Ps.getState(this.state);
6597
+ if (!e) throw Error("No host state available");
6598
+ return e;
6599
+ }
6600
+ updateHostState(e) {
6601
+ this.dispatchTransaction(this.tr.setMeta(Ps, e));
6602
+ }
6603
+ }, il = class {
6604
+ constructor(e) {
6605
+ this.specs = e, this.attrs = {};
6606
+ for (let t of e) this.attrs[t.name] = { default: t.default };
6607
+ }
6608
+ fromDOM(e) {
6609
+ return Object.assign({}, ...this.specs.map((t) => ({ [t.name]: t.fromDOM(e) })));
6610
+ }
6611
+ getStyle(e) {
6612
+ return this.specs.flatMap((t) => t.toStyles(e)).join("; ");
6613
+ }
6614
+ getDOMAttrsProperties(e) {
6615
+ return this.specs.length ? { style: this.getStyle(e) } : {};
6616
+ }
6617
+ getDOMAttrs(e) {
6618
+ return this.specs.length ? [this.getDOMAttrsProperties(e)] : [];
6619
+ }
6620
+ extractFromNode(e) {
6621
+ return Object.assign({}, ...Object.keys(this.attrs).map((t) => ({ [t]: e.attrs[t] })));
6622
+ }
6623
+ }, al = class {
6624
+ constructor(e) {
6625
+ this.specs = e;
6626
+ }
6627
+ getAllowedMarksForNode(e) {
6628
+ return this.specs.filter((t) => !t.onNodeName || t.onNodeName === e).map((e) => e.markName);
6629
+ }
6630
+ getReferencedNodeNames() {
6631
+ return new Set(this.specs.map((e) => e.onNodeName).filter(Boolean));
6632
+ }
6633
+ }, ol = (e, t) => {
6634
+ let n = t.config[b].schema, r = (e) => n.marks[e.type].rank, i = (e, t) => {
6635
+ if (e.type !== t.type) return !1;
6636
+ let n = e.attrs, r = t.attrs;
6637
+ if (n === r) return !0;
6638
+ /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
6639
+ if (!n || !r) return !1;
6640
+ let i = Object.keys(n), a = Object.keys(r);
6641
+ /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
6642
+ if (i.length !== a.length) return !1;
6643
+ for (let e of i) if (n[e] !== r[e]) return !1;
6644
+ return !0;
6645
+ }, a = (e) => {
6646
+ let n = [], o = [], s = [n];
6647
+ for (let n of e) {
6648
+ let e = [...n.marks ?? []].sort((e, t) => r(e) - r(t)), c = 0, l = 0;
6649
+ for (; c < o.length && l < e.length && i(o[c], e[l]);) c++, l++;
6650
+ for (; o.length > c;) o.pop(), s.pop();
6651
+ for (; l < e.length;) {
6652
+ let n = e[l], r = [];
6653
+ s[s.length - 1].push({
6654
+ type: "mark",
6655
+ mark: n,
6656
+ children: {
6657
+ type: "fragment",
6658
+ content: r,
6659
+ [b]: t
6660
+ },
6661
+ [b]: t
6662
+ }), o.push(n), s.push(r), l++;
6663
+ }
6664
+ s[s.length - 1].push({
6665
+ type: "node",
6666
+ node: n,
6667
+ children: a(n.content ?? []),
6668
+ [b]: t
6669
+ });
6670
+ }
6671
+ return {
6672
+ type: "fragment",
6673
+ content: n,
6674
+ [b]: t
6675
+ };
6676
+ };
6677
+ return {
6678
+ type: "node",
6679
+ node: e,
6680
+ children: a(e.content),
6681
+ [b]: t
6682
+ };
6683
+ }, sl = class {
6684
+ constructor(e) {
6685
+ this[b] = new cl(e);
6686
+ }
6687
+ instantiateEditor(e) {
6688
+ return new nl(this, e);
6689
+ }
6690
+ instantiateView(e, t) {
6691
+ return ol(e, {
6692
+ config: this,
6693
+ options: { ...t }
6694
+ });
6695
+ }
6696
+ }, cl = class {
6697
+ constructor(e) {
6698
+ let t = (e) => e.flatMap((e) => e.getFeatures().flatMap((n) => n === e ? e : t([n])));
6699
+ this.features = t(e.map(C)), this.featureMap = /* @__PURE__ */ new Map();
6700
+ for (let e of this.features) {
6701
+ if (this.featureMap.has(e.name)) throw Error(`Duplicate feature: ${e.name}`);
6702
+ this.featureMap.set(e.name, e);
6703
+ }
6704
+ this.featureFacadesMap = /* @__PURE__ */ new Map();
6705
+ for (let t of e) {
6706
+ let e = t.constructor, n = C(t), r = this.featureFacadesMap.get(e);
6707
+ r ? r.push(n) : this.featureFacadesMap.set(e, [n]);
6708
+ }
6709
+ if (!this.featureMap.has("RteBase")) throw Error("RteBase feature is required");
6710
+ if (this.featureMap.has("RteLinkFeature") && !this.featureMap.has("RteToolbarFeature")) throw Error("RteToolbarFeature is required for RteLinkFeature");
6711
+ this.textblockAttrs = new il(_e(this.features.flatMap((e) => e.getTextblockAttrs()))), this.textblockMarks = new al(_e(this.features.flatMap((e) => e.getTextblockMarks())));
6712
+ let n = _e(this.features.flatMap((e) => e.getSchema(this.textblockAttrs, this.textblockMarks))), r = {
6713
+ nodes: {},
6714
+ marks: {}
6715
+ };
6716
+ for (let e of n) Object.assign(r.nodes, e.nodes ?? {}), Object.assign(r.marks, e.marks ?? {});
6717
+ for (let e of this.textblockMarks.getReferencedNodeNames()) if (!(e in r.nodes)) throw Error(`Unknown node "${e}"`);
6718
+ this.schema = new le(r);
6719
+ }
6720
+ }, ll = 200, Q = function() {};
6721
+ Q.prototype.append = function(e) {
6722
+ return e.length ? (e = Q.from(e), !this.length && e || e.length < ll && this.leafAppend(e) || this.length < ll && e.leafPrepend(this) || this.appendInner(e)) : this;
6723
+ }, Q.prototype.prepend = function(e) {
6724
+ return e.length ? Q.from(e).append(this) : this;
6725
+ }, Q.prototype.appendInner = function(e) {
6726
+ return new dl(this, e);
6727
+ }, Q.prototype.slice = function(e, t) {
6728
+ 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));
6729
+ }, Q.prototype.get = function(e) {
6730
+ if (!(e < 0 || e >= this.length)) return this.getInner(e);
6731
+ }, Q.prototype.forEach = function(e, t, n) {
6732
+ 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);
6733
+ }, Q.prototype.map = function(e, t, n) {
6734
+ t === void 0 && (t = 0), n === void 0 && (n = this.length);
6735
+ var r = [];
6736
+ return this.forEach(function(t, n) {
6737
+ return r.push(e(t, n));
6738
+ }, t, n), r;
6739
+ }, Q.from = function(e) {
6740
+ return e instanceof Q ? e : e && e.length ? new ul(e) : Q.empty;
6741
+ };
6742
+ var ul = /* @__PURE__ */ function(e) {
6743
+ function t(t) {
6744
+ e.call(this), this.values = t;
6745
+ }
6746
+ e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
6747
+ var n = {
6748
+ length: { configurable: !0 },
6749
+ depth: { configurable: !0 }
6750
+ };
6751
+ return t.prototype.flatten = function() {
6752
+ return this.values;
6753
+ }, t.prototype.sliceInner = function(e, n) {
6754
+ return e == 0 && n == this.length ? this : new t(this.values.slice(e, n));
6755
+ }, t.prototype.getInner = function(e) {
6756
+ return this.values[e];
6757
+ }, t.prototype.forEachInner = function(e, t, n, r) {
6758
+ for (var i = t; i < n; i++) if (e(this.values[i], r + i) === !1) return !1;
6759
+ }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
6760
+ for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
6761
+ }, t.prototype.leafAppend = function(e) {
6762
+ if (this.length + e.length <= ll) return new t(this.values.concat(e.flatten()));
6763
+ }, t.prototype.leafPrepend = function(e) {
6764
+ if (this.length + e.length <= ll) return new t(e.flatten().concat(this.values));
6765
+ }, n.length.get = function() {
6766
+ return this.values.length;
6767
+ }, n.depth.get = function() {
6768
+ return 0;
6769
+ }, Object.defineProperties(t.prototype, n), t;
6770
+ }(Q);
6771
+ Q.empty = new ul([]);
6772
+ var dl = /* @__PURE__ */ function(e) {
6773
+ function t(t, n) {
6774
+ e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
7058
6775
  }
7059
- }, Kl = class {
7060
- getFeature(e) {
7061
- let t = this.config.featureMap.get(e);
7062
- if (!t) throw Error(`Feature not found: ${e}`);
7063
- return t;
6776
+ return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.flatten = function() {
6777
+ return this.left.flatten().concat(this.right.flatten());
6778
+ }, t.prototype.getInner = function(e) {
6779
+ return e < this.left.length ? this.left.get(e) : this.right.get(e - this.left.length);
6780
+ }, t.prototype.forEachInner = function(e, t, n, r) {
6781
+ var i = this.left.length;
6782
+ if (t < i && this.left.forEachInner(e, t, Math.min(n, i), r) === !1 || n > i && this.right.forEachInner(e, Math.max(t - i, 0), Math.min(this.length, n) - i, r + i) === !1) return !1;
6783
+ }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
6784
+ var i = this.left.length;
6785
+ if (t > i && this.right.forEachInvertedInner(e, t - i, Math.max(n, i) - i, r + i) === !1 || n < i && this.left.forEachInvertedInner(e, Math.min(t, i), n, r) === !1) return !1;
6786
+ }, t.prototype.sliceInner = function(e, t) {
6787
+ if (e == 0 && t == this.length) return this;
6788
+ var n = this.left.length;
6789
+ return t <= n ? this.left.slice(e, t) : e >= n ? this.right.slice(e - n, t - n) : this.left.slice(e, n).append(this.right.slice(0, t - n));
6790
+ }, t.prototype.leafAppend = function(e) {
6791
+ var n = this.right.leafAppend(e);
6792
+ if (n) return new t(this.left, n);
6793
+ }, t.prototype.leafPrepend = function(e) {
6794
+ var n = this.left.leafPrepend(e);
6795
+ if (n) return new t(n, this.right);
6796
+ }, t.prototype.appendInner = function(e) {
6797
+ 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);
6798
+ }, t;
6799
+ }(Q), fl = 500, pl = class e {
6800
+ constructor(e, t) {
6801
+ this.items = e, this.eventCount = t;
7064
6802
  }
7065
- getPublicInterface(e, t) {
7066
- let n = this.config.featureFacadesMap.get(e);
7067
- if (!n || n.length === 0) throw Error("Feature not found");
7068
- if (n[0].featureId !== void 0) {
7069
- if (t === void 0) throw Error("No featureId provided for multi-instance feature.");
7070
- let e = n.find((e) => e.featureId === t);
7071
- if (!e) throw Error(`Feature with id "${t}" not found`);
7072
- return e.getPublicInterface(this);
6803
+ popEvent(t, n) {
6804
+ if (this.eventCount == 0) return null;
6805
+ let r = this.items.length;
6806
+ for (;; r--) if (this.items.get(r - 1).selection) {
6807
+ --r;
6808
+ break;
7073
6809
  }
7074
- if (t !== void 0) throw Error("Feature does not support featureId");
7075
- return n[0].getPublicInterface(this);
7076
- }
7077
- constructor(e, t, n) {
7078
- this.options = n, this.view = null, this.dispatchTransaction = (e) => {
7079
- let t = this.state;
7080
- return this.state = this.state.apply(e), this.view?.updateState(this.state), t.doc !== this.state.doc && this.options?.onChange?.(), this.state;
7081
- }, this.facade = e;
7082
- let r = t[b];
7083
- this.config = r, this.schema = r.schema, this.textblockAttrs = r.textblockAttrs, this.features = r.features, this.foreignHtmlParser = n?.foreignHtmlParser ?? new zl(t), this.foreignHtmlSerializer = n?.foreignHtmlSerializer ?? new Hl(t), this.styles = new s(_e(r.features.flatMap((e) => e.getStyles()))), this.initState(n?.initialDocument);
6810
+ let i, a;
6811
+ n && (i = this.remapping(r, this.items.length), a = i.maps.length);
6812
+ let o = t.tr, s, c, l = [], u = [];
6813
+ return this.items.forEach((t, n) => {
6814
+ if (!t.step) {
6815
+ i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(t);
6816
+ return;
6817
+ }
6818
+ if (i) {
6819
+ u.push(new hl(t.map));
6820
+ let e = t.step.map(i.slice(a)), n;
6821
+ e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new hl(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
6822
+ } else o.maybeStep(t.step);
6823
+ 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;
6824
+ }, this.items.length, 0), {
6825
+ remaining: c,
6826
+ transform: o,
6827
+ selection: s
6828
+ };
7084
6829
  }
7085
- initState(e) {
7086
- this.state = $t.create({
7087
- doc: Wl(this.schema, e),
7088
- schema: this.config.schema,
7089
- plugins: _e(this.config.features.flatMap((e) => e.getPlugins(this)))
7090
- });
6830
+ addTransform(t, n, r, i) {
6831
+ let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
6832
+ for (let e = 0; e < t.steps.length; e++) {
6833
+ let r = t.steps[e].invert(t.docs[e]), l = new hl(t.mapping.maps[e], r, n), u;
6834
+ (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);
6835
+ }
6836
+ let l = o - r.depth;
6837
+ return l > _l && (s = ml(s, l), o -= l), new e(s.append(a), o);
7091
6838
  }
7092
- reset(e) {
7093
- let t = Cc.getState(this.state);
7094
- this.initState(e), this.updateHostState(t), this.view?.updateState(this.state);
6839
+ remapping(e, t) {
6840
+ let n = new Ve();
6841
+ return this.items.forEach((t, r) => {
6842
+ let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
6843
+ n.appendMap(t.map, i);
6844
+ }, e, t), n;
7095
6845
  }
7096
- createView(e) {
7097
- this.view = new po((t) => {
7098
- t.part = "editor", e.appendChild(t);
7099
- }, {
7100
- state: this.state,
7101
- dispatchTransaction: this.dispatchTransaction
7102
- });
6846
+ addMaps(t) {
6847
+ return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new hl(e))), this.eventCount);
7103
6848
  }
7104
- destroyViewIfNeeded() {
7105
- this.view &&= (this.view.destroy(), null);
6849
+ rebased(t, n) {
6850
+ if (!this.eventCount) return this;
6851
+ let r = [], i = Math.max(0, this.items.length - n), a = t.mapping, o = t.steps.length, s = this.eventCount;
6852
+ this.items.forEach((e) => {
6853
+ e.selection && s--;
6854
+ }, i);
6855
+ let c = n;
6856
+ this.items.forEach((e) => {
6857
+ let n = a.getMirror(--c);
6858
+ if (n == null) return;
6859
+ o = Math.min(o, n);
6860
+ let i = a.maps[n];
6861
+ if (e.step) {
6862
+ let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
6863
+ l && s++, r.push(new hl(i, o, l));
6864
+ } else r.push(new hl(i));
6865
+ }, i);
6866
+ let l = [];
6867
+ for (let e = n; e < o; e++) l.push(new hl(a.maps[e]));
6868
+ let u = new e(this.items.slice(0, i).append(l).append(r), s);
6869
+ return u.emptyItemCount() > fl && (u = u.compress(this.items.length - r.length)), u;
7106
6870
  }
7107
- createComponent(e) {
7108
- return document.createElement(this.hostState().ctx.tagFor(e, !0));
6871
+ emptyItemCount() {
6872
+ let e = 0;
6873
+ return this.items.forEach((t) => {
6874
+ t.step || e++;
6875
+ }), e;
7109
6876
  }
7110
- getLocale() {
7111
- return this.hostState().locale;
6877
+ compress(t = this.items.length) {
6878
+ let n = this.remapping(0, t), r = n.maps.length, i = [], a = 0;
6879
+ return this.items.forEach((e, o) => {
6880
+ if (o >= t) i.push(e), e.selection && a++;
6881
+ else if (e.step) {
6882
+ let t = e.step.map(n.slice(r)), o = t && t.getMap();
6883
+ if (r--, o && n.appendMap(o, r), t) {
6884
+ let s = e.selection && e.selection.map(n.slice(r));
6885
+ s && a++;
6886
+ let c = new hl(o.invert(), t, s), l, u = i.length - 1;
6887
+ (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
6888
+ }
6889
+ } else e.map && r--;
6890
+ }, this.items.length, 0), new e(Q.from(i.reverse()), a);
7112
6891
  }
7113
- get tr() {
7114
- return this.state.tr;
6892
+ };
6893
+ pl.empty = new pl(Q.empty, 0);
6894
+ function ml(e, t) {
6895
+ let n;
6896
+ return e.forEach((e, r) => {
6897
+ if (e.selection && t-- == 0) return n = r, !1;
6898
+ }), e.slice(n);
6899
+ }
6900
+ var hl = class e {
6901
+ constructor(e, t, n, r) {
6902
+ this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
7115
6903
  }
7116
- hostState() {
7117
- let e = Cc.getState(this.state);
7118
- if (!e) throw Error("No host state available");
7119
- return e;
6904
+ merge(t) {
6905
+ if (this.step && t.step && !t.selection) {
6906
+ let n = t.step.merge(this.step);
6907
+ if (n) return new e(n.getMap().invert(), n, this.selection);
6908
+ }
7120
6909
  }
7121
- updateHostState(e) {
7122
- this.dispatchTransaction(this.tr.setMeta(Cc, e));
6910
+ }, gl = class {
6911
+ constructor(e, t, n, r, i) {
6912
+ this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
7123
6913
  }
7124
- }, ql = class {
7125
- constructor(e) {
7126
- this.specs = e, this.attrs = {};
7127
- for (let t of e) this.attrs[t.name] = { default: t.default };
6914
+ }, _l = 20;
6915
+ function vl(e, t, n, r) {
6916
+ let i = n.getMeta(Dl), a;
6917
+ if (i) return i.historyState;
6918
+ n.getMeta(Ol) && (e = new gl(e.done, e.undone, null, 0, -1));
6919
+ let o = n.getMeta("appendedTransaction");
6920
+ if (n.steps.length == 0) return e;
6921
+ if (o && o.getMeta(Dl)) return o.getMeta(Dl).redo ? new gl(e.done.addTransform(n, void 0, r, Tl(t)), e.undone, bl(n.mapping.maps), e.prevTime, e.prevComposition) : new gl(e.done, e.undone.addTransform(n, void 0, r, Tl(t)), null, e.prevTime, e.prevComposition);
6922
+ if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
6923
+ let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !yl(n, e.prevRanges)), s = o ? xl(e.prevRanges, n.mapping) : bl(n.mapping.maps);
6924
+ return new gl(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Tl(t)), pl.empty, s, n.time, i ?? e.prevComposition);
6925
+ } else if (a = n.getMeta("rebased")) return new gl(e.done.rebased(n, a), e.undone.rebased(n, a), xl(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
6926
+ else return new gl(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), xl(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
6927
+ }
6928
+ function yl(e, t) {
6929
+ if (!t) return !1;
6930
+ if (!e.docChanged) return !0;
6931
+ let n = !1;
6932
+ return e.mapping.maps[0].forEach((e, r) => {
6933
+ for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
6934
+ }), n;
6935
+ }
6936
+ function bl(e) {
6937
+ let t = [];
6938
+ for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
6939
+ return t;
6940
+ }
6941
+ function xl(e, t) {
6942
+ if (!e) return null;
6943
+ let n = [];
6944
+ for (let r = 0; r < e.length; r += 2) {
6945
+ let i = t.map(e[r], 1), a = t.map(e[r + 1], -1);
6946
+ i <= a && n.push(i, a);
7128
6947
  }
7129
- fromDOM(e) {
7130
- return Object.assign({}, ...this.specs.map((t) => ({ [t.name]: t.fromDOM(e) })));
6948
+ return n;
6949
+ }
6950
+ function Sl(e, t, n) {
6951
+ let r = Tl(t), i = Dl.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
6952
+ if (!a) return null;
6953
+ let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new gl(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
6954
+ return a.transform.setSelection(o).setMeta(Dl, {
6955
+ redo: n,
6956
+ historyState: c
6957
+ });
6958
+ }
6959
+ var Cl = !1, wl = null;
6960
+ function Tl(e) {
6961
+ let t = e.plugins;
6962
+ if (wl != t) {
6963
+ Cl = !1, wl = t;
6964
+ for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
6965
+ Cl = !0;
6966
+ break;
6967
+ }
7131
6968
  }
7132
- getStyle(e) {
7133
- return this.specs.flatMap((t) => t.toStyles(e)).join("; ");
6969
+ return Cl;
6970
+ }
6971
+ function El(e) {
6972
+ return e.setMeta(Ol, !0);
6973
+ }
6974
+ var Dl = new rn("history"), Ol = new rn("closeHistory");
6975
+ function kl(e = {}) {
6976
+ return e = {
6977
+ depth: e.depth || 100,
6978
+ newGroupDelay: e.newGroupDelay || 500
6979
+ }, new N({
6980
+ key: Dl,
6981
+ state: {
6982
+ init() {
6983
+ return new gl(pl.empty, pl.empty, null, 0, -1);
6984
+ },
6985
+ apply(t, n, r) {
6986
+ return vl(n, r, t, e);
6987
+ }
6988
+ },
6989
+ config: e,
6990
+ props: { handleDOMEvents: { beforeinput(e, t) {
6991
+ let n = t.inputType, r = n == "historyUndo" ? jl : n == "historyRedo" ? Ml : null;
6992
+ return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
6993
+ } } }
6994
+ });
6995
+ }
6996
+ function Al(e, t) {
6997
+ return (n, r) => {
6998
+ let i = Dl.getState(n);
6999
+ if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
7000
+ if (r) {
7001
+ let a = Sl(i, n, e);
7002
+ a && r(t ? a.scrollIntoView() : a);
7003
+ }
7004
+ return !0;
7005
+ };
7006
+ }
7007
+ var jl = Al(!1, !0), Ml = Al(!0, !0), Nl = (e) => typeof e == "function", Pl = (e, t, n) => [
7008
+ e,
7009
+ t,
7010
+ n
7011
+ ], Fl = class {
7012
+ constructor(e, t, n) {
7013
+ this.view = e, this.rte = t, this.props = n, this.bindings = [];
7134
7014
  }
7135
- getDOMAttrsProperties(e) {
7136
- return this.specs.length ? { style: this.getStyle(e) } : {};
7015
+ evalProp(e) {
7016
+ return Nl(e) ? e(this) : e;
7137
7017
  }
7138
- getDOMAttrs(e) {
7139
- return this.specs.length ? [this.getDOMAttrsProperties(e)] : [];
7018
+ bindProp(e, t) {
7019
+ if (e !== void 0) if (Nl(e)) {
7020
+ let n = () => t(e(this));
7021
+ this.bindings.push(n), n();
7022
+ } else t(e);
7140
7023
  }
7141
- extractFromNode(e) {
7142
- return Object.assign({}, ...Object.keys(this.attrs).map((t) => ({ [t]: e.attrs[t] })));
7024
+ updateBindings() {
7025
+ for (let e of this.bindings) e();
7143
7026
  }
7144
- }, Jl = class {
7145
- constructor(e) {
7146
- this.specs = e;
7027
+ shouldReturnFocusToEditor() {
7028
+ return this.evalProp(this.props.shouldReturnFocusToEditor);
7147
7029
  }
7148
- getAllowedMarksForNode(e) {
7149
- return this.specs.filter((t) => !t.onNodeName || t.onNodeName === e).map((e) => e.markName);
7030
+ bindToEl(e, t = {}, n = [], r = []) {
7031
+ for (let n in t) this.bindProp(t[n], (t) => {
7032
+ e[n] = t;
7033
+ });
7034
+ for (let [t, r, i] of n) r && e.addEventListener(t, i(r));
7035
+ for (let t of r) e.appendChild(t);
7150
7036
  }
7151
- getReferencedNodeNames() {
7152
- return new Set(this.specs.map((e) => e.onNodeName).filter(Boolean));
7037
+ }, Il = (e, t) => {
7038
+ let n = document.createElement("div");
7039
+ return e.bindToEl(n, {
7040
+ className: t.className,
7041
+ slot: t.slot
7042
+ }, [], t.children), n;
7043
+ }, Ll = (e, t) => {
7044
+ let n = document.createElement("a");
7045
+ return e.bindToEl(n, {
7046
+ href: t.href,
7047
+ target: t.target,
7048
+ rel: t.rel,
7049
+ className: t.className
7050
+ }, [], t.children), n;
7051
+ }, Rl = /* @__PURE__ */ new WeakMap(), zl = (e, t) => {
7052
+ let n = e.rte.createComponent(te);
7053
+ n.setAttribute("exportparts", "vvd-theme-alternate"), e.bindToEl(n, {
7054
+ className: "ui-tooltip",
7055
+ text: t.label,
7056
+ placement: e.props.popupPlacement
7057
+ }), e.bindProp(t.enabled, (e) => {
7058
+ e || (n.open = !1), n.anchor = e ? t.anchor : void 0;
7059
+ });
7060
+ let r = Il(e, {
7061
+ className: "ui-tooltip-wrapper",
7062
+ slot: t.slot,
7063
+ children: [t.anchor, n]
7064
+ });
7065
+ return Rl.set(r, t.anchor), r;
7066
+ }, $ = (e, t) => {
7067
+ let n = () => e.evalProp(t.variant) ?? "toolbar", r = () => n() === "toolbar" ? "super-condensed" : "condensed", i = () => n() === "popover-primary" ? "outlined" : "ghost-light", a = () => n() === "toolbar-menu" || n() === "popover" ? "filled" : i(), o = () => e.evalProp(t.active) ? a() : i(), s = () => e.evalProp(t.connotation) ?? (n() === "toolbar-menu" && e.evalProp(t.active) ? "cta" : void 0), c = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), l = e.rte.createComponent(f);
7068
+ return e.bindToEl(l, {
7069
+ size: r,
7070
+ appearance: o,
7071
+ disabled: c,
7072
+ icon: t.icon,
7073
+ autofocus: t.autofocus,
7074
+ connotation: s,
7075
+ [t.icon ? "ariaLabel" : "label"]: t.label,
7076
+ pressed: () => !!e.evalProp(t.active),
7077
+ ariaPressed: t.active === void 0 ? void 0 : () => e.evalProp(t.active) ? "true" : "false"
7078
+ }, [Pl("click", t.onClick, (t) => () => {
7079
+ !t() && e.shouldReturnFocusToEditor() && e.view.focus();
7080
+ })]), zl(e, {
7081
+ enabled: () => !!(e.evalProp(t.icon) && !e.evalProp(t.noTooltip) && !c()),
7082
+ label: t.label,
7083
+ anchor: l,
7084
+ slot: t.slot
7085
+ });
7086
+ }, Bl = (e, t) => {
7087
+ let n = e.rte.createComponent(Se);
7088
+ e.bindToEl(n, {
7089
+ className: "ui-menu",
7090
+ autoDismiss: !0,
7091
+ ariaLabel: t.label,
7092
+ anchor: Rl.get(t.trigger) ?? t.trigger,
7093
+ placement: e.props.popupPlacement,
7094
+ offset: () => e.evalProp(e.props.menuOffset) ?? null
7095
+ }, [], t.children);
7096
+ let r = document.createDocumentFragment();
7097
+ return r.appendChild(t.trigger), r.appendChild(n), r;
7098
+ }, Vl = (e, t) => {
7099
+ let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(be);
7100
+ return e.bindToEl(r, {
7101
+ text: t.text,
7102
+ checked: t.checked,
7103
+ disabled: n,
7104
+ controlType: "radio",
7105
+ checkedAppearance: "tick-only"
7106
+ }, [Pl("change", t.onSelect, (n) => () => {
7107
+ r.checked && !r.disabled && e.evalProp(t.checked) !== r.checked && (n(), e.shouldReturnFocusToEditor() && e.view.focus());
7108
+ })]), r;
7109
+ }, Hl = (e, t) => Il(e, {
7110
+ slot: t.slot,
7111
+ className: "ui-button-group",
7112
+ children: t.children
7113
+ });
7114
+ function Ul(e, t) {
7115
+ let { from: n, $from: r, to: i, empty: a } = e.selection;
7116
+ return a ? !!t.isInSet(e.storedMarks || r.marks()) : e.doc.rangeHasMark(n, i, t);
7117
+ }
7118
+ var Wl = (e, t) => $(e, {
7119
+ label: t.label,
7120
+ icon: t.icon,
7121
+ active: () => Ul(e.view.state, t.markType),
7122
+ disabled: () => !is(t.markType)(e.view.state),
7123
+ onClick: () => {
7124
+ is(t.markType)(e.view.state, e.view.dispatch);
7153
7125
  }
7126
+ }), Gl = (e, t) => {
7127
+ let n = () => !!(e.evalProp(e.props.disabled) || e.evalProp(t.disabled)), r = e.rte.createComponent(ie);
7128
+ return e.bindToEl(r, {
7129
+ value: t.value,
7130
+ text: t.text,
7131
+ disabled: n
7132
+ }), r;
7133
+ }, Kl = (e, t) => {
7134
+ let n = () => !!e.evalProp(e.props.disabled), r = e.rte.createComponent(se);
7135
+ r.setAttribute("data-class", "ui-select"), e.bindToEl(r, {
7136
+ placeholder: " ",
7137
+ ariaLabel: t.label,
7138
+ appearance: "ghost",
7139
+ disabled: n
7140
+ }, [Pl("change", t.onSelect, (t) => () => {
7141
+ let n = r.value;
7142
+ n && (t(n), e.shouldReturnFocusToEditor() && e.view.focus());
7143
+ })], t.children), queueMicrotask(() => {
7144
+ e.bindProp(t.value, (e) => r.value = e);
7145
+ });
7146
+ let i = !1;
7147
+ return r.addEventListener("vwc-popup:open", () => {
7148
+ i = !0, e.updateBindings();
7149
+ }), r.addEventListener("vwc-popup:close", () => {
7150
+ i = !1, e.updateBindings();
7151
+ }), zl(e, {
7152
+ enabled: () => !i && !n(),
7153
+ label: t.label,
7154
+ anchor: r
7155
+ });
7156
+ }, ql = (e) => {
7157
+ let t = e.rte.createComponent(v);
7158
+ return e.bindToEl(t, {
7159
+ className: "ui-divider",
7160
+ orientation: "vertical"
7161
+ }), t;
7162
+ }, Jl = (e, t) => {
7163
+ let n = e.rte.createComponent(re);
7164
+ return e.bindToEl(n, {
7165
+ label: t.label,
7166
+ value: t.value,
7167
+ placeholder: t.placeholder,
7168
+ slot: t.slot,
7169
+ autofocus: t.autofocus,
7170
+ type: t.type,
7171
+ helperText: t.helperText
7172
+ }, [Pl("input", t.onInput, (e) => () => {
7173
+ e(n.value);
7174
+ })]), n;
7154
7175
  }, Yl = (e, t) => {
7155
- let n = t.config[b].schema, r = (e) => n.marks[e.type].rank, i = (e, t) => {
7156
- if (e.type !== t.type) return !1;
7157
- let n = e.attrs, r = t.attrs;
7158
- if (n === r) return !0;
7159
- /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
7160
- if (!n || !r) return !1;
7161
- let i = Object.keys(n), a = Object.keys(r);
7162
- /* v8 ignore next -- not currently reachable since all attrs are required @preserve */
7163
- if (i.length !== a.length) return !1;
7164
- for (let e of i) if (n[e] !== r[e]) return !1;
7165
- return !0;
7166
- }, a = (e) => {
7167
- let n = [], o = [], s = [n];
7168
- for (let n of e) {
7169
- let e = [...n.marks ?? []].sort((e, t) => r(e) - r(t)), c = 0, l = 0;
7170
- for (; c < o.length && l < e.length && i(o[c], e[l]);) c++, l++;
7171
- for (; o.length > c;) o.pop(), s.pop();
7172
- for (; l < e.length;) {
7173
- let n = e[l], r = [];
7174
- s[s.length - 1].push({
7175
- type: "mark",
7176
- mark: n,
7177
- children: {
7178
- type: "fragment",
7179
- content: r,
7180
- [b]: t
7181
- },
7182
- [b]: t
7183
- }), o.push(n), s.push(r), l++;
7184
- }
7185
- s[s.length - 1].push({
7186
- type: "node",
7187
- node: n,
7188
- children: a(n.content ?? []),
7189
- [b]: t
7176
+ let n = document.createTextNode("");
7177
+ return e.bindToEl(n, { textContent: t.text }), n;
7178
+ }, Xl = (e, t) => {
7179
+ let n = document.createElement("slot");
7180
+ n.name = t.name;
7181
+ let r = null, i = [];
7182
+ function a() {
7183
+ for (let { el: e, type: t, handler: n } of i) e.removeEventListener(t, n);
7184
+ i.length = 0, r = null;
7185
+ }
7186
+ for (let [n, i] of Object.entries(t.assignedProps)) e.bindProp(i, (e) => {
7187
+ r && (r[n] = e);
7188
+ });
7189
+ function o(n) {
7190
+ for (let [r, i] of Object.entries(t.assignedProps)) n[r] = e.evalProp(i);
7191
+ for (let [r, a] of Object.entries(t.assignedEvents)) {
7192
+ let t = (t) => {
7193
+ a(t), e.shouldReturnFocusToEditor() && e.view.focus();
7194
+ };
7195
+ n.addEventListener(r, t), i.push({
7196
+ el: n,
7197
+ type: r,
7198
+ handler: t
7190
7199
  });
7191
7200
  }
7192
- return {
7193
- type: "fragment",
7194
- content: n,
7195
- [b]: t
7196
- };
7197
- };
7198
- return {
7199
- type: "node",
7200
- node: e,
7201
- children: a(e.content),
7202
- [b]: t
7201
+ }
7202
+ let s = () => {
7203
+ let e = n.assignedElements({ flatten: !0 })[0];
7204
+ e !== r && (a(), e && (r = e, o(e)));
7203
7205
  };
7204
- }, Xl = class {
7206
+ return n.addEventListener("slotchange", s), queueMicrotask(s), n;
7207
+ }, Zl = class extends w {
7205
7208
  constructor(e) {
7206
- this[b] = new Zl(e);
7209
+ super(), this.config = e, this.name = "RteHistoryFeature";
7207
7210
  }
7208
- instantiateEditor(e) {
7209
- return new Gl(this, e);
7210
- }
7211
- instantiateView(e, t) {
7212
- return Yl(e, {
7213
- config: this,
7214
- options: { ...t }
7215
- });
7211
+ getPlugins() {
7212
+ return [this.contribution(kl()), this.contribution(U({
7213
+ "Mod-z": jl,
7214
+ "Ctrl-y": Ml,
7215
+ "Cmd-Z": Ml
7216
+ }))];
7216
7217
  }
7217
- }, Zl = class {
7218
- constructor(e) {
7219
- let t = (e) => e.flatMap((e) => e.getFeatures().flatMap((n) => n === e ? e : t([n])));
7220
- this.features = t(e.map(C)), this.featureMap = /* @__PURE__ */ new Map();
7221
- for (let e of this.features) {
7222
- if (this.featureMap.has(e.name)) throw Error(`Duplicate feature: ${e.name}`);
7223
- this.featureMap.set(e.name, e);
7224
- }
7225
- this.featureFacadesMap = /* @__PURE__ */ new Map();
7226
- for (let t of e) {
7227
- let e = t.constructor, n = C(t), r = this.featureFacadesMap.get(e);
7228
- r ? r.push(n) : this.featureFacadesMap.set(e, [n]);
7229
- }
7230
- if (!this.featureMap.has("RteBase")) throw Error("RteBase feature is required");
7231
- if (this.featureMap.has("RteLinkFeature") && !this.featureMap.has("RteToolbarFeature")) throw Error("RteToolbarFeature is required for RteLinkFeature");
7232
- this.textblockAttrs = new ql(_e(this.features.flatMap((e) => e.getTextblockAttrs()))), this.textblockMarks = new Jl(_e(this.features.flatMap((e) => e.getTextblockMarks())));
7233
- let n = _e(this.features.flatMap((e) => e.getSchema(this.textblockAttrs, this.textblockMarks))), r = {
7234
- nodes: {},
7235
- marks: {}
7236
- };
7237
- for (let e of n) Object.assign(r.nodes, e.nodes ?? {}), Object.assign(r.marks, e.marks ?? {});
7238
- for (let e of this.textblockMarks.getReferencedNodeNames()) if (!(e in r.nodes)) throw Error(`Unknown node "${e}"`);
7239
- this.schema = new le(r);
7218
+ getToolbarItems() {
7219
+ return this.config.showToolbarButtons ? [this.contribution({
7220
+ section: "history",
7221
+ render: (e) => $(e, {
7222
+ label: (e) => e.rte.getLocale().richTextEditor.undo,
7223
+ icon: "undo-line",
7224
+ disabled: (e) => !jl(e.view.state),
7225
+ onClick: () => {
7226
+ let { state: t, dispatch: n } = e.view;
7227
+ jl(t, n);
7228
+ }
7229
+ })
7230
+ }, 1), this.contribution({
7231
+ section: "history",
7232
+ render: (e) => $(e, {
7233
+ label: (e) => e.rte.getLocale().richTextEditor.redo,
7234
+ icon: "redo-line",
7235
+ disabled: (e) => !Ml(e.view.state),
7236
+ onClick: () => {
7237
+ let { state: t, dispatch: n } = e.view;
7238
+ Ml(t, n);
7239
+ }
7240
+ })
7241
+ }, 2)] : [];
7240
7242
  }
7241
7243
  }, Ql = "h1,h2,h3,p{all:unset;display:block}h1:first-child,h2:first-child,h3:first-child,p:first-child{margin-block-start:0}h1:last-child,h2:last-child,h3:last-child,p:last-child{margin-block-end:0}p{font:var(--vvd-typography-base);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:16px;line-height:20px}.heading-step-1{font:var(--vvd-typography-heading-4);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:24px 12px;line-height:28px}.heading-step-2{font:var(--vvd-typography-heading-3);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:24px 12px;line-height:36px}.heading-step-3{font:var(--vvd-typography-heading-2);font-variant-ligatures:unset;font-feature-settings:unset;margin-block:32px 16px;line-height:42px}", $l = class extends w {
7242
7244
  constructor(e) {
@@ -7469,7 +7471,8 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7469
7471
  getFeatures() {
7470
7472
  return [
7471
7473
  this,
7472
- new wc(),
7474
+ new Fs(),
7475
+ new Zl({ showToolbarButtons: this.config?.historyToolbarButtons ?? !0 }),
7473
7476
  new $l({
7474
7477
  heading1: this.config?.heading1 ?? !1,
7475
7478
  heading2: this.config?.heading2 ?? !1,
@@ -7498,14 +7501,14 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7498
7501
  let t = e.getFeature("RteBasicTextBlocks");
7499
7502
  return [this.contribution({
7500
7503
  section: "font",
7501
- render: (n) => mc(n, {
7504
+ render: (n) => Kl(n, {
7502
7505
  label: () => n.rte.getLocale().richTextEditor.paragraphStyles,
7503
7506
  value: (e) => t.getCurrentBlockType(e.view.state) ?? "",
7504
7507
  onSelect: (r) => {
7505
7508
  let { state: i, dispatch: a } = n.view;
7506
7509
  t.setBlockType(e, r)(i, a);
7507
7510
  },
7508
- children: this.config.options.map((r) => pc(n, {
7511
+ children: this.config.options.map((r) => Gl(n, {
7509
7512
  text: r.label,
7510
7513
  value: r.node,
7511
7514
  disabled: () => !t.setBlockType(e, r.node)(n.view.state)
@@ -7531,26 +7534,33 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7531
7534
  for (let t of _e(e.features.flatMap((t) => t.getToolbarItems(e)))) n.get(t.section).push(t);
7532
7535
  let r = e.getFeature("RteCore");
7533
7536
  return [this.contribution(this.hidden.plugin), this.contribution(new N({ view: (i) => {
7534
- let a = new rc(i, e, {
7537
+ let a = !1, o = new Fl(i, e, {
7535
7538
  popupPlacement: this.config?.popupDirection === "outward" ? "bottom" : "top",
7536
7539
  menuOffset: 8,
7537
- disabled: () => r.disabled.getValue(e)
7538
- }), o = i.dom.getRootNode().querySelector(".toolbar");
7539
- a.bindProp(() => this.hidden.getValue(e), (e) => {
7540
- o.classList.toggle("toolbar--hidden", e);
7540
+ disabled: () => r.disabled.getValue(e),
7541
+ shouldReturnFocusToEditor: () => a
7542
+ }), s = i.dom.getRootNode().querySelector(".toolbar"), c = -Infinity, l = () => {
7543
+ i.hasFocus() && (a = !0), c = Date.now();
7544
+ }, u = () => {
7545
+ Date.now() - c > 250 && (a = !1);
7546
+ }, d = (e) => {
7547
+ s.contains(e.relatedTarget) || (a = !1);
7548
+ };
7549
+ s.addEventListener("mousedown", l, { capture: !0 }), s.addEventListener("focusin", u), s.addEventListener("focusout", d), o.bindProp(() => this.hidden.getValue(e), (e) => {
7550
+ s.classList.toggle("toolbar--hidden", e);
7541
7551
  });
7542
- let s = !1;
7552
+ let f = !1;
7543
7553
  for (let e of t) {
7544
7554
  let t = n.get(e);
7545
- t.length && s && (o.appendChild(hc(a)), s = !1);
7546
- for (let e of t) o.appendChild(e.render(a)), s = !0;
7555
+ t.length && f && (s.appendChild(ql(o)), f = !1);
7556
+ for (let e of t) s.appendChild(e.render(o)), f = !0;
7547
7557
  }
7548
7558
  return {
7549
7559
  update() {
7550
- a.updateBindings();
7560
+ o.updateBindings();
7551
7561
  },
7552
7562
  destroy() {
7553
- o.innerHTML = "";
7563
+ s.innerHTML = "", s.removeEventListener("mousedown", l, { capture: !0 }), s.removeEventListener("focusin", u), s.removeEventListener("focusout", d), a = !1;
7554
7564
  }
7555
7565
  };
7556
7566
  } }))];
@@ -7629,7 +7639,7 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7629
7639
  }],
7630
7640
  toDOM: (e) => [
7631
7641
  "span",
7632
- { style: `font-size: ${Il(e.attrs.size)};` },
7642
+ { style: `font-size: ${qc(e.attrs.size)};` },
7633
7643
  0
7634
7644
  ],
7635
7645
  cursorFix: (e, t) => {
@@ -7654,13 +7664,13 @@ var ou = (e) => e.parent.textBetween(0, e.parentOffset, void 0, ""), su = cla
7654
7664
  getToolbarItems(e) {
7655
7665
  return [this.contribution({
7656
7666
  section: "font",
7657
- render: (t) => cc(t, {
7667
+ render: (t) => Bl(t, {
7658
7668
  label: () => e.getLocale().richTextEditor.textSize,
7659
- trigger: K(t, {
7669
+ trigger: $(t, {
7660
7670
  label: () => e.getLocale().richTextEditor.textSize,
7661
7671
  icon: "text-size-line"
7662
7672
  }),
7663
- children: this.fontSizes.map((e) => lc(t, {
7673
+ children: this.fontSizes.map((e) => Vl(t, {
7664
7674
  text: e.label,
7665
7675
  checked: () => this.getFontSizeFromSelection(t.view.state) === e.size,
7666
7676
  disabled: () => !this.setFontSize(e.size)(t.view.state),
@@ -7931,7 +7941,7 @@ var Du = class extends w {
7931
7941
  getToolbarItems(e) {
7932
7942
  return [this.contribution({
7933
7943
  section: "text-style",
7934
- render: (t) => fc(t, {
7944
+ render: (t) => Wl(t, {
7935
7945
  label: () => t.rte.getLocale().richTextEditor.bold,
7936
7946
  icon: "bold-line",
7937
7947
  markType: e.schema.marks.bold
@@ -7951,7 +7961,7 @@ var Du = class extends w {
7951
7961
  getToolbarItems(e) {
7952
7962
  return [this.contribution({
7953
7963
  section: "text-style",
7954
- render: (t) => fc(t, {
7964
+ render: (t) => Wl(t, {
7955
7965
  label: () => t.rte.getLocale().richTextEditor.italic,
7956
7966
  icon: "italic-line",
7957
7967
  markType: e.schema.marks.italic
@@ -7976,7 +7986,7 @@ var Du = class extends w {
7976
7986
  getToolbarItems(e) {
7977
7987
  return [this.contribution({
7978
7988
  section: "text-style",
7979
- render: (t) => fc(t, {
7989
+ render: (t) => Wl(t, {
7980
7990
  label: () => t.rte.getLocale().richTextEditor.underline,
7981
7991
  icon: "underline-line",
7982
7992
  markType: e.schema.marks.underline
@@ -8004,7 +8014,7 @@ var Du = class extends w {
8004
8014
  getToolbarItems(e) {
8005
8015
  return [this.contribution({
8006
8016
  section: "text-style",
8007
- render: (t) => fc(t, {
8017
+ render: (t) => Wl(t, {
8008
8018
  label: () => t.rte.getLocale().richTextEditor.strikethrough,
8009
8019
  icon: "strikethrough-line",
8010
8020
  markType: e.schema.marks.strikethrough
@@ -8032,7 +8042,7 @@ var Du = class extends w {
8032
8042
  getToolbarItems(e) {
8033
8043
  return [this.contribution({
8034
8044
  section: "text-style",
8035
- render: (t) => fc(t, {
8045
+ render: (t) => Wl(t, {
8036
8046
  label: () => t.rte.getLocale().richTextEditor.monospace,
8037
8047
  icon: "monospace-line",
8038
8048
  markType: e.schema.marks.monospace
@@ -8077,7 +8087,7 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8077
8087
  return [
8078
8088
  "span",
8079
8089
  {
8080
- style: `color: ${Il(t)};`,
8090
+ style: `color: ${qc(t)};`,
8081
8091
  "data-text-color": t
8082
8092
  },
8083
8093
  0
@@ -8090,12 +8100,12 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8090
8100
  return [this.contribution({
8091
8101
  section: "text-style",
8092
8102
  render: (e) => {
8093
- let t = K(e, {
8103
+ let t = $(e, {
8094
8104
  label: () => e.rte.getLocale().richTextEditor.textColor,
8095
8105
  disabled: () => !this.setColor("any")(e.view.state),
8096
8106
  icon: "textcolor-line"
8097
8107
  }), n = t.firstElementChild;
8098
- return ic(e, { children: [t, vc(e, {
8108
+ return Il(e, { children: [t, Xl(e, {
8099
8109
  name: "text-color-picker",
8100
8110
  assignedProps: {
8101
8111
  anchor: n,
@@ -8261,7 +8271,7 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8261
8271
  let t = [];
8262
8272
  return this.config.bulletList && t.push(this.contribution({
8263
8273
  section: "textblock",
8264
- render: (t) => K(t, {
8274
+ render: (t) => $(t, {
8265
8275
  label: () => t.rte.getLocale().richTextEditor.bulletList,
8266
8276
  icon: "bullet-list-2-line",
8267
8277
  active: () => this.isSelectionInList(e.schema.nodes.bulletList, t.rte.state),
@@ -8272,7 +8282,7 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8272
8282
  })
8273
8283
  }, 1)), this.config.numberedList && t.push(this.contribution({
8274
8284
  section: "textblock",
8275
- render: (t) => K(t, {
8285
+ render: (t) => $(t, {
8276
8286
  label: () => t.rte.getLocale().richTextEditor.numberedList,
8277
8287
  icon: "list-numbered-line",
8278
8288
  active: () => this.isSelectionInList(e.schema.nodes.numberedList, t.rte.state),
@@ -8356,18 +8366,18 @@ var Fu = Symbol("mixedColor"), Iu = y(class extends w {
8356
8366
  getToolbarItems() {
8357
8367
  return [this.contribution({
8358
8368
  section: "textblock",
8359
- render: (e) => cc(e, {
8369
+ render: (e) => Bl(e, {
8360
8370
  label: () => e.rte.getLocale().richTextEditor.alignment,
8361
- trigger: K(e, {
8371
+ trigger: $(e, {
8362
8372
  label: () => e.rte.getLocale().richTextEditor.alignment,
8363
8373
  icon: () => {
8364
8374
  let t = this.getAlignmentFromSelection(e.view.state);
8365
8375
  return od.find((e) => e.value === t)?.icon ?? "align-left-line";
8366
8376
  }
8367
8377
  }),
8368
- children: [uc(e, {
8378
+ children: [Hl(e, {
8369
8379
  slot: "header",
8370
- children: od.map((t, n) => K(e, {
8380
+ children: od.map((t, n) => $(e, {
8371
8381
  icon: t.icon,
8372
8382
  label: () => e.rte.getLocale().richTextEditor.alignments[t.label],
8373
8383
  noTooltip: !0,
@@ -8434,7 +8444,7 @@ var fd = y(class extends w {
8434
8444
  let { href: t } = e.attrs;
8435
8445
  return [
8436
8446
  "a",
8437
- { href: Pl(t) },
8447
+ { href: Gc(t) },
8438
8448
  0
8439
8449
  ];
8440
8450
  }
@@ -8465,16 +8475,19 @@ var fd = y(class extends w {
8465
8475
  return null;
8466
8476
  } },
8467
8477
  view: (t) => {
8468
- let r = new rc(t, e, { popupPlacement: "bottom" });
8478
+ let r = new Fl(t, e, {
8479
+ popupPlacement: "bottom",
8480
+ shouldReturnFocusToEditor: !0
8481
+ });
8469
8482
  n = e.createComponent(E), n.anchorId = "current-link";
8470
- let i = ic(r, {
8483
+ let i = Il(r, {
8471
8484
  className: "link-popover",
8472
- children: [ic(r, {
8485
+ children: [Il(r, {
8473
8486
  className: "link-popover-header",
8474
- children: [ic(r, {
8487
+ children: [Il(r, {
8475
8488
  className: "link-popover-label",
8476
- children: [_c(r, { text: () => this.getCurrentLink(r.view.state)?.text || "" })]
8477
- }), K(r, {
8489
+ children: [Yl(r, { text: () => this.getCurrentLink(r.view.state)?.text || "" })]
8490
+ }), $(r, {
8478
8491
  icon: "close-line",
8479
8492
  label: () => r.rte.getLocale().richTextEditor.close,
8480
8493
  noTooltip: !0,
@@ -8482,17 +8495,17 @@ var fd = y(class extends w {
8482
8495
  n.dismiss();
8483
8496
  }
8484
8497
  })]
8485
- }), ic(r, {
8498
+ }), Il(r, {
8486
8499
  className: "link-popover-content",
8487
- children: [ac(r, {
8500
+ children: [Ll(r, {
8488
8501
  className: "link",
8489
8502
  href: () => this.getCurrentLink(r.view.state)?.href || "",
8490
8503
  target: "_blank",
8491
8504
  rel: "noopener",
8492
- children: [_c(r, { text: () => this.getCurrentLink(r.view.state)?.href || "" })]
8493
- }), ic(r, {
8505
+ children: [Yl(r, { text: () => this.getCurrentLink(r.view.state)?.href || "" })]
8506
+ }), Il(r, {
8494
8507
  className: "link-action-bar",
8495
- children: [K(r, {
8508
+ children: [$(r, {
8496
8509
  icon: "delete-line",
8497
8510
  label: () => r.rte.getLocale().richTextEditor.delete,
8498
8511
  connotation: "alert",
@@ -8502,7 +8515,7 @@ var fd = y(class extends w {
8502
8515
  let { state: e, dispatch: t } = r.view;
8503
8516
  this.removeLink(e, t);
8504
8517
  }
8505
- }), K(r, {
8518
+ }), $(r, {
8506
8519
  icon: "edit-line",
8507
8520
  label: () => r.rte.getLocale().richTextEditor.edit,
8508
8521
  variant: "popover",
@@ -8543,7 +8556,7 @@ var fd = y(class extends w {
8543
8556
  return [this.contribution({
8544
8557
  section: "insert",
8545
8558
  render: (r) => {
8546
- let i = gc(r, {
8559
+ let i = Jl(r, {
8547
8560
  label: () => r.rte.getLocale().richTextEditor.linkText,
8548
8561
  placeholder: () => r.rte.getLocale().richTextEditor.linkTextPlaceholder,
8549
8562
  slot: "header",
@@ -8552,7 +8565,7 @@ var fd = y(class extends w {
8552
8565
  onInput: () => {
8553
8566
  s();
8554
8567
  }
8555
- }), a = gc(r, {
8568
+ }), a = Jl(r, {
8556
8569
  label: () => r.rte.getLocale().richTextEditor.linkUrl,
8557
8570
  type: "url",
8558
8571
  placeholder: () => r.rte.getLocale().richTextEditor.linkUrlPlaceholder,
@@ -8562,7 +8575,7 @@ var fd = y(class extends w {
8562
8575
  onInput: () => {
8563
8576
  s();
8564
8577
  }
8565
- }), o = K(r, {
8578
+ }), o = $(r, {
8566
8579
  label: () => r.rte.getLocale().richTextEditor.apply,
8567
8580
  variant: "popover-primary",
8568
8581
  disabled: () => {
@@ -8571,26 +8584,26 @@ var fd = y(class extends w {
8571
8584
  },
8572
8585
  onClick: () => {
8573
8586
  let { state: t, dispatch: n } = r.view;
8574
- this.insertLink(e, a.value, i.value)(t, n);
8587
+ this.insertLink(e, a.value, i.value)(t, n), this.toolbarMenu.open = !1;
8575
8588
  }
8576
8589
  }), s = () => {
8577
8590
  o.querySelector("[data-vvd-component=\"button\"]").disabled = !(i.value.length && n(a.value));
8578
- }, c = cc(r, {
8591
+ }, c = Bl(r, {
8579
8592
  label: () => r.rte.getLocale().richTextEditor.hyperlink,
8580
- trigger: K(r, {
8593
+ trigger: $(r, {
8581
8594
  label: () => r.rte.getLocale().richTextEditor.hyperlink,
8582
8595
  icon: "link-line"
8583
8596
  }),
8584
- children: [ic(r, {
8597
+ children: [Il(r, {
8585
8598
  className: "link-toolbar-menu",
8586
8599
  slot: "header",
8587
8600
  children: [
8588
8601
  i,
8589
8602
  a,
8590
- ic(r, {
8603
+ Il(r, {
8591
8604
  className: "link-action-bar",
8592
8605
  slot: "header",
8593
- children: [K(r, {
8606
+ children: [$(r, {
8594
8607
  label: () => r.rte.getLocale().richTextEditor.cancel,
8595
8608
  variant: "popover",
8596
8609
  onClick: () => {
@@ -8671,7 +8684,7 @@ var fd = y(class extends w {
8671
8684
  });
8672
8685
  }
8673
8686
  renderImg(e) {
8674
- this.img.src = Fl(e), this.setContent(this.img, { allowPopover: !0 });
8687
+ this.img.src = Kc(e), this.setContent(this.img, { allowPopover: !0 });
8675
8688
  }
8676
8689
  update(e) {
8677
8690
  return this.img.alt = e.attrs.alt, this.img.width = e.attrs.naturalWidth, this.img.height = e.attrs.naturalHeight, this.img.style.maxWidth = e.attrs.size, !0;
@@ -8731,11 +8744,11 @@ var fd = y(class extends w {
8731
8744
  let { imageUrl: t, alt: n, size: r, naturalWidth: i, naturalHeight: a } = e.attrs, o = this.config.serializeUrlToHtml ? this.config.serializeUrlToHtml(t) : t;
8732
8745
  if (o === null) return document.createTextNode("");
8733
8746
  let s = {
8734
- src: Fl(o),
8747
+ src: Kc(o),
8735
8748
  "data-src": o,
8736
8749
  alt: n
8737
8750
  };
8738
- return r && (s.style = `max-width: ${Il(r)}; height: auto;`), i && (s.width = i), a && (s.height = a), ["img", s];
8751
+ return r && (s.style = `max-width: ${qc(r)}; height: auto;`), i && (s.width = i), a && (s.height = a), ["img", s];
8739
8752
  }
8740
8753
  } } })];
8741
8754
  }
@@ -8744,12 +8757,15 @@ var fd = y(class extends w {
8744
8757
  return [this.contribution(new N({
8745
8758
  props: { nodeViews: { inlineImage: (e, t, n) => new _d(e, t, n, this.config) } },
8746
8759
  view: (n) => {
8747
- let r = new rc(n, e, { popupPlacement: "bottom" });
8760
+ let r = new Fl(n, e, {
8761
+ popupPlacement: "bottom",
8762
+ shouldReturnFocusToEditor: !0
8763
+ });
8748
8764
  t = e.createComponent(E), t.offset = 4;
8749
- let i = ic(r, {
8765
+ let i = Il(r, {
8750
8766
  className: "inline-image-popover",
8751
8767
  children: [
8752
- K(r, {
8768
+ $(r, {
8753
8769
  label: () => r.rte.getLocale().richTextEditor.imageSizes.small,
8754
8770
  variant: "popover",
8755
8771
  active: () => this.getSelectedImageSize(r.view.state) === "small",
@@ -8757,8 +8773,8 @@ var fd = y(class extends w {
8757
8773
  this.setSelectedImageSize("small")(r.view.state, r.view.dispatch);
8758
8774
  }
8759
8775
  }),
8760
- hc(r),
8761
- K(r, {
8776
+ ql(r),
8777
+ $(r, {
8762
8778
  label: () => r.rte.getLocale().richTextEditor.imageSizes.fit,
8763
8779
  variant: "popover",
8764
8780
  active: () => this.getSelectedImageSize(r.view.state) === "fit",
@@ -8766,8 +8782,8 @@ var fd = y(class extends w {
8766
8782
  this.setSelectedImageSize("fit")(r.view.state, r.view.dispatch);
8767
8783
  }
8768
8784
  }),
8769
- hc(r),
8770
- K(r, {
8785
+ ql(r),
8786
+ $(r, {
8771
8787
  label: () => r.rte.getLocale().richTextEditor.imageSizes.original,
8772
8788
  variant: "popover",
8773
8789
  active: () => this.getSelectedImageSize(r.view.state) === "original",
@@ -8952,7 +8968,7 @@ var fd = y(class extends w {
8952
8968
  getToolbarItems() {
8953
8969
  return [this.contribution({
8954
8970
  section: "insert",
8955
- render: (e) => K(e, {
8971
+ render: (e) => $(e, {
8956
8972
  label: this.options.label,
8957
8973
  icon: this.options.icon,
8958
8974
  onClick: () => {
@@ -9041,7 +9057,7 @@ var fd = y(class extends w {
9041
9057
  //#endregion
9042
9058
  //#region src/lib/rich-text-editor/rte/features/keyboard-shortcuts.ts
9043
9059
  function Dd(e, t) {
9044
- return e.length === 0 ? (t, n) => e() : (n, r) => e(t);
9060
+ return (n, r) => e(t);
9045
9061
  }
9046
9062
  var Od = y(class extends w {
9047
9063
  constructor(e, t) {
@@ -9068,7 +9084,7 @@ function Md(e, t) {
9068
9084
  }
9069
9085
  var Nd = (e, t, n) => {
9070
9086
  let { state: r } = e;
9071
- e.dispatch(Js(r.tr));
9087
+ e.dispatch(El(r.tr));
9072
9088
  let i = e.state.tr;
9073
9089
  i.replaceWith(t.start, t.end, x.fromJSON(e.state.schema, n));
9074
9090
  let a = i.mapping.map(t.end);
@@ -9167,9 +9183,12 @@ var Nd = (e, t, n) => {
9167
9183
  return t ? t.loadingDecoration.add(e.doc, [ja.inline(t.match.start, t.match.end, { id: `suggest-anchor-${this.featureId}` })]) : null;
9168
9184
  } },
9169
9185
  view: (t) => {
9170
- let n = new rc(t, e, { popupPlacement: "bottom" }), r = e.createComponent(E);
9186
+ let n = new Fl(t, e, {
9187
+ popupPlacement: "bottom",
9188
+ shouldReturnFocusToEditor: !0
9189
+ }), r = e.createComponent(E);
9171
9190
  r.anchorId = `suggest-anchor-${this.featureId}`, r.kind = "autocomplete", r.offset = 4;
9172
- let i = ic(n, {
9191
+ let i = Il(n, {
9173
9192
  className: "suggest-popover",
9174
9193
  children: []
9175
9194
  });
@@ -9181,7 +9200,7 @@ var Nd = (e, t, n) => {
9181
9200
  let o = r.suggestions, s = o.items.length === 0;
9182
9201
  if (c(s), s) {
9183
9202
  let t = document.createElement("slot");
9184
- t.name = a, t.textContent = e.getLocale().richTextEditor.suggestNoResults, i.appendChild(ic(n, {
9203
+ t.name = a, t.textContent = e.getLocale().richTextEditor.suggestNoResults, i.appendChild(Il(n, {
9185
9204
  className: "suggest-empty-message",
9186
9205
  children: [t]
9187
9206
  }));
@@ -9272,4 +9291,4 @@ n(o("rich-text-editor", Te, Ee, [
9272
9291
  shadowOptions: { delegatesFocus: !0 }
9273
9292
  }))();
9274
9293
  //#endregion
9275
- export { cd as RteAlignmentFeature, Td as RteAtomFeature, cu as RteBase, Ou as RteBoldFeature, Id as RteCharacterCountFeature, Xl as RteConfig, xd as RteDropHandlerFeature, bd as RteFileHandlerFeature, gu as RteFontSizePickerFeature, mu as RteHardBreakFeature, zl as RteHtmlParser, Hl as RteHtmlSerializer, vd as RteInlineImageFeature, Ed as RteInputRuleFeature, ku as RteItalicFeature, Od as RteKeyboardShortcutsFeature, fd as RteLinkFeature, ad as RteListFeature, Nu as RteMonospaceFeature, pu as RtePlaceholderFeature, ju as RteStrikethroughFeature, Pd as RteSuggestFeature, lu as RteTextBlockPickerFeature, Iu as RteTextColorPickerFeature, Sd as RteToolbarButtonFeature, du as RteToolbarFeature, Au as RteUnderlineFeature };
9294
+ export { cd as RteAlignmentFeature, Td as RteAtomFeature, cu as RteBase, Ou as RteBoldFeature, Id as RteCharacterCountFeature, sl as RteConfig, xd as RteDropHandlerFeature, bd as RteFileHandlerFeature, gu as RteFontSizePickerFeature, mu as RteHardBreakFeature, Xc as RteHtmlParser, $c as RteHtmlSerializer, vd as RteInlineImageFeature, Ed as RteInputRuleFeature, ku as RteItalicFeature, Od as RteKeyboardShortcutsFeature, fd as RteLinkFeature, ad as RteListFeature, Nu as RteMonospaceFeature, pu as RtePlaceholderFeature, ju as RteStrikethroughFeature, Pd as RteSuggestFeature, lu as RteTextBlockPickerFeature, Iu as RteTextColorPickerFeature, Sd as RteToolbarButtonFeature, du as RteToolbarFeature, Au as RteUnderlineFeature };