@ryzeup/richtexteditor 1.0.28 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,182 +1,182 @@
1
- var pt = Object.defineProperty, vt = Object.defineProperties;
2
- var yt = Object.getOwnPropertyDescriptors;
3
- var ke = Object.getOwnPropertySymbols;
4
- var Et = Object.prototype.hasOwnProperty, wt = Object.prototype.propertyIsEnumerable;
5
- var ze = (r, s, u) => s in r ? pt(r, s, { enumerable: !0, configurable: !0, writable: !0, value: u }) : r[s] = u, ce = (r, s) => {
6
- for (var u in s || (s = {}))
7
- Et.call(s, u) && ze(r, u, s[u]);
8
- if (ke)
9
- for (var u of ke(s))
10
- wt.call(s, u) && ze(r, u, s[u]);
11
- return r;
12
- }, se = (r, s) => vt(r, yt(s));
13
- import * as Ct from "react";
14
- import i, { useRef as W, useState as D, useEffect as U } from "react";
15
- import { createPortal as bt } from "react-dom";
16
- window.React = Ct;
17
- var je = {
1
+ var Lt = Object.defineProperty, xt = Object.defineProperties;
2
+ var St = Object.getOwnPropertyDescriptors;
3
+ var Pe = Object.getOwnPropertySymbols;
4
+ var Rt = Object.prototype.hasOwnProperty, Nt = Object.prototype.propertyIsEnumerable;
5
+ var _e = (a, d, u) => d in a ? Lt(a, d, { enumerable: !0, configurable: !0, writable: !0, value: u }) : a[d] = u, re = (a, d) => {
6
+ for (var u in d || (d = {}))
7
+ Rt.call(d, u) && _e(a, u, d[u]);
8
+ if (Pe)
9
+ for (var u of Pe(d))
10
+ Nt.call(d, u) && _e(a, u, d[u]);
11
+ return a;
12
+ }, ae = (a, d) => xt(a, St(d));
13
+ import * as Mt from "react";
14
+ import r, { useRef as Z, useState as H, useEffect as U } from "react";
15
+ import { createPortal as At } from "react-dom";
16
+ window.React = Mt;
17
+ var Ue = {
18
18
  color: void 0,
19
19
  size: void 0,
20
20
  className: void 0,
21
21
  style: void 0,
22
22
  attr: void 0
23
- }, De = i.createContext && /* @__PURE__ */ i.createContext(je), Lt = ["attr", "size", "title"];
24
- function xt(r, s) {
25
- if (r == null) return {};
26
- var u = Rt(r, s), g, h;
23
+ }, je = r.createContext && /* @__PURE__ */ r.createContext(Ue), Tt = ["attr", "size", "title"];
24
+ function kt(a, d) {
25
+ if (a == null) return {};
26
+ var u = zt(a, d), h, v;
27
27
  if (Object.getOwnPropertySymbols) {
28
- var M = Object.getOwnPropertySymbols(r);
29
- for (h = 0; h < M.length; h++)
30
- g = M[h], !(s.indexOf(g) >= 0) && Object.prototype.propertyIsEnumerable.call(r, g) && (u[g] = r[g]);
28
+ var L = Object.getOwnPropertySymbols(a);
29
+ for (v = 0; v < L.length; v++)
30
+ h = L[v], !(d.indexOf(h) >= 0) && Object.prototype.propertyIsEnumerable.call(a, h) && (u[h] = a[h]);
31
31
  }
32
32
  return u;
33
33
  }
34
- function Rt(r, s) {
35
- if (r == null) return {};
34
+ function zt(a, d) {
35
+ if (a == null) return {};
36
36
  var u = {};
37
- for (var g in r)
38
- if (Object.prototype.hasOwnProperty.call(r, g)) {
39
- if (s.indexOf(g) >= 0) continue;
40
- u[g] = r[g];
37
+ for (var h in a)
38
+ if (Object.prototype.hasOwnProperty.call(a, h)) {
39
+ if (d.indexOf(h) >= 0) continue;
40
+ u[h] = a[h];
41
41
  }
42
42
  return u;
43
43
  }
44
- function ee() {
45
- return ee = Object.assign ? Object.assign.bind() : function(r) {
46
- for (var s = 1; s < arguments.length; s++) {
47
- var u = arguments[s];
48
- for (var g in u)
49
- Object.prototype.hasOwnProperty.call(u, g) && (r[g] = u[g]);
44
+ function ce() {
45
+ return ce = Object.assign ? Object.assign.bind() : function(a) {
46
+ for (var d = 1; d < arguments.length; d++) {
47
+ var u = arguments[d];
48
+ for (var h in u)
49
+ Object.prototype.hasOwnProperty.call(u, h) && (a[h] = u[h]);
50
50
  }
51
- return r;
52
- }, ee.apply(this, arguments);
51
+ return a;
52
+ }, ce.apply(this, arguments);
53
53
  }
54
- function He(r, s) {
55
- var u = Object.keys(r);
54
+ function Fe(a, d) {
55
+ var u = Object.keys(a);
56
56
  if (Object.getOwnPropertySymbols) {
57
- var g = Object.getOwnPropertySymbols(r);
58
- s && (g = g.filter(function(h) {
59
- return Object.getOwnPropertyDescriptor(r, h).enumerable;
60
- })), u.push.apply(u, g);
57
+ var h = Object.getOwnPropertySymbols(a);
58
+ d && (h = h.filter(function(v) {
59
+ return Object.getOwnPropertyDescriptor(a, v).enumerable;
60
+ })), u.push.apply(u, h);
61
61
  }
62
62
  return u;
63
63
  }
64
- function te(r) {
65
- for (var s = 1; s < arguments.length; s++) {
66
- var u = arguments[s] != null ? arguments[s] : {};
67
- s % 2 ? He(Object(u), !0).forEach(function(g) {
68
- St(r, g, u[g]);
69
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(u)) : He(Object(u)).forEach(function(g) {
70
- Object.defineProperty(r, g, Object.getOwnPropertyDescriptor(u, g));
64
+ function se(a) {
65
+ for (var d = 1; d < arguments.length; d++) {
66
+ var u = arguments[d] != null ? arguments[d] : {};
67
+ d % 2 ? Fe(Object(u), !0).forEach(function(h) {
68
+ Dt(a, h, u[h]);
69
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(u)) : Fe(Object(u)).forEach(function(h) {
70
+ Object.defineProperty(a, h, Object.getOwnPropertyDescriptor(u, h));
71
71
  });
72
72
  }
73
- return r;
73
+ return a;
74
74
  }
75
- function St(r, s, u) {
76
- return s = Mt(s), s in r ? Object.defineProperty(r, s, { value: u, enumerable: !0, configurable: !0, writable: !0 }) : r[s] = u, r;
75
+ function Dt(a, d, u) {
76
+ return d = Ht(d), d in a ? Object.defineProperty(a, d, { value: u, enumerable: !0, configurable: !0, writable: !0 }) : a[d] = u, a;
77
77
  }
78
- function Mt(r) {
79
- var s = Tt(r, "string");
80
- return typeof s == "symbol" ? s : s + "";
78
+ function Ht(a) {
79
+ var d = Ot(a, "string");
80
+ return typeof d == "symbol" ? d : d + "";
81
81
  }
82
- function Tt(r, s) {
83
- if (typeof r != "object" || !r) return r;
84
- var u = r[Symbol.toPrimitive];
82
+ function Ot(a, d) {
83
+ if (typeof a != "object" || !a) return a;
84
+ var u = a[Symbol.toPrimitive];
85
85
  if (u !== void 0) {
86
- var g = u.call(r, s);
87
- if (typeof g != "object") return g;
86
+ var h = u.call(a, d);
87
+ if (typeof h != "object") return h;
88
88
  throw new TypeError("@@toPrimitive must return a primitive value.");
89
89
  }
90
- return (s === "string" ? String : Number)(r);
90
+ return (d === "string" ? String : Number)(a);
91
91
  }
92
- function Fe(r) {
93
- return r && r.map((s, u) => /* @__PURE__ */ i.createElement(s.tag, te({
92
+ function $e(a) {
93
+ return a && a.map((d, u) => /* @__PURE__ */ r.createElement(d.tag, se({
94
94
  key: u
95
- }, s.attr), Fe(s.child)));
95
+ }, d.attr), $e(d.child)));
96
96
  }
97
- function k(r) {
98
- return (s) => /* @__PURE__ */ i.createElement(At, ee({
99
- attr: te({}, r.attr)
100
- }, s), Fe(r.child));
97
+ function k(a) {
98
+ return (d) => /* @__PURE__ */ r.createElement(Pt, ce({
99
+ attr: se({}, a.attr)
100
+ }, d), $e(a.child));
101
101
  }
102
- function At(r) {
103
- var s = (u) => {
102
+ function Pt(a) {
103
+ var d = (u) => {
104
104
  var {
105
- attr: g,
106
- size: h,
107
- title: M
108
- } = r, L = xt(r, Lt), T = h || u.size || "1em", y;
109
- return u.className && (y = u.className), r.className && (y = (y ? y + " " : "") + r.className), /* @__PURE__ */ i.createElement("svg", ee({
105
+ attr: h,
106
+ size: v,
107
+ title: L
108
+ } = a, P = kt(a, Tt), z = v || u.size || "1em", w;
109
+ return u.className && (w = u.className), a.className && (w = (w ? w + " " : "") + a.className), /* @__PURE__ */ r.createElement("svg", ce({
110
110
  stroke: "currentColor",
111
111
  fill: "currentColor",
112
112
  strokeWidth: "0"
113
- }, u.attr, g, L, {
114
- className: y,
115
- style: te(te({
116
- color: r.color || u.color
117
- }, u.style), r.style),
118
- height: T,
119
- width: T,
113
+ }, u.attr, h, P, {
114
+ className: w,
115
+ style: se(se({
116
+ color: a.color || u.color
117
+ }, u.style), a.style),
118
+ height: z,
119
+ width: z,
120
120
  xmlns: "http://www.w3.org/2000/svg"
121
- }), M && /* @__PURE__ */ i.createElement("title", null, M), r.children);
121
+ }), L && /* @__PURE__ */ r.createElement("title", null, L), a.children);
122
122
  };
123
- return De !== void 0 ? /* @__PURE__ */ i.createElement(De.Consumer, null, (u) => s(u)) : s(je);
123
+ return je !== void 0 ? /* @__PURE__ */ r.createElement(je.Consumer, null, (u) => d(u)) : d(Ue);
124
124
  }
125
- function Nt(r) {
126
- return k({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z" }, child: [] }] })(r);
125
+ function _t(a) {
126
+ return k({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z" }, child: [] }] })(a);
127
127
  }
128
- function kt(r) {
129
- return k({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z" }, child: [] }] })(r);
128
+ function jt(a) {
129
+ return k({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z" }, child: [] }] })(a);
130
130
  }
131
- function zt(r) {
132
- return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z" }, child: [] }] })(r);
131
+ function Ft(a) {
132
+ return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z" }, child: [] }] })(a);
133
133
  }
134
- function Dt(r) {
135
- return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z" }, child: [] }] })(r);
134
+ function It(a) {
135
+ return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z" }, child: [] }] })(a);
136
136
  }
137
- function Ht(r) {
138
- return k({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M12.83 352h262.34A12.82 12.82 0 0 0 288 339.17v-38.34A12.82 12.82 0 0 0 275.17 288H12.83A12.82 12.82 0 0 0 0 300.83v38.34A12.82 12.82 0 0 0 12.83 352zm0-256h262.34A12.82 12.82 0 0 0 288 83.17V44.83A12.82 12.82 0 0 0 275.17 32H12.83A12.82 12.82 0 0 0 0 44.83v38.34A12.82 12.82 0 0 0 12.83 96zM432 160H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(r);
137
+ function qt(a) {
138
+ return k({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M12.83 352h262.34A12.82 12.82 0 0 0 288 339.17v-38.34A12.82 12.82 0 0 0 275.17 288H12.83A12.82 12.82 0 0 0 0 300.83v38.34A12.82 12.82 0 0 0 12.83 352zm0-256h262.34A12.82 12.82 0 0 0 288 83.17V44.83A12.82 12.82 0 0 0 275.17 32H12.83A12.82 12.82 0 0 0 0 44.83v38.34A12.82 12.82 0 0 0 12.83 96zM432 160H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(a);
139
139
  }
140
- function Ot(r) {
141
- return k({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z" }, child: [] }] })(r);
140
+ function Bt(a) {
141
+ return k({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z" }, child: [] }] })(a);
142
142
  }
143
- function _t(r) {
144
- return k({ attr: { viewBox: "0 0 544 512" }, child: [{ tag: "path", attr: { d: "M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z" }, child: [] }] })(r);
143
+ function Vt(a) {
144
+ return k({ attr: { viewBox: "0 0 544 512" }, child: [{ tag: "path", attr: { d: "M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z" }, child: [] }] })(a);
145
145
  }
146
- function jt(r) {
147
- return k({ attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z" }, child: [] }] })(r);
146
+ function Ut(a) {
147
+ return k({ attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z" }, child: [] }] })(a);
148
148
  }
149
- function Ft(r) {
150
- return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" }, child: [] }] })(r);
149
+ function $t(a) {
150
+ return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" }, child: [] }] })(a);
151
151
  }
152
- function It(r) {
153
- return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(r);
152
+ function Wt(a) {
153
+ return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(a);
154
154
  }
155
- function Pt(r) {
156
- return k({ attr: { viewBox: "0 0 496 512" }, child: [{ tag: "path", attr: { d: "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" }, child: [] }] })(r);
155
+ function Xt(a) {
156
+ return k({ attr: { viewBox: "0 0 496 512" }, child: [{ tag: "path", attr: { d: "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" }, child: [] }] })(a);
157
157
  }
158
- function qt(r) {
159
- return k({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(r);
158
+ function Zt(a) {
159
+ return k({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(a);
160
160
  }
161
- function Bt(r) {
162
- return k({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM56.84,75.58a8,8,0,0,1,3.58-10.74l16-8A8,8,0,0,1,88,64v48a8,8,0,0,1-16,0V76.94l-4.42,2.22A8,8,0,0,1,56.84,75.58ZM92,180a8,8,0,0,1,0,16H68a8,8,0,0,1-6.4-12.8l21.67-28.89A3.92,3.92,0,0,0,84,152a4,4,0,0,0-7.77-1.33,8,8,0,0,1-15.09-5.34,20,20,0,1,1,35,18.53L84,180Zm100,4H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Zm0-48H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Zm0-48H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Z" }, child: [] }] })(r);
161
+ function Kt(a) {
162
+ return k({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM56.84,75.58a8,8,0,0,1,3.58-10.74l16-8A8,8,0,0,1,88,64v48a8,8,0,0,1-16,0V76.94l-4.42,2.22A8,8,0,0,1,56.84,75.58ZM92,180a8,8,0,0,1,0,16H68a8,8,0,0,1-6.4-12.8l21.67-28.89A3.92,3.92,0,0,0,84,152a4,4,0,0,0-7.77-1.33,8,8,0,0,1-15.09-5.34,20,20,0,1,1,35,18.53L84,180Zm100,4H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Zm0-48H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Zm0-48H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Z" }, child: [] }] })(a);
163
163
  }
164
- function Vt(r) {
165
- return k({ attr: { viewBox: "0 0 24 24", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M2 18H9V20H2V18ZM2 11H11V13H2V11ZM2 4H22V6H2V4ZM20.674 13.0251L21.8301 12.634L22.8301 14.366L21.914 15.1711C21.9704 15.4386 22 15.7158 22 16C22 16.2842 21.9704 16.5614 21.914 16.8289L22.8301 17.634L21.8301 19.366L20.674 18.9749C20.2635 19.3441 19.7763 19.6295 19.2391 19.8044L19 21H17L16.7609 19.8044C16.2237 19.6295 15.7365 19.3441 15.326 18.9749L14.1699 19.366L13.1699 17.634L14.086 16.8289C14.0296 16.5614 14 16.2842 14 16C14 15.7158 14.0296 15.4386 14.086 15.1711L13.1699 14.366L14.1699 12.634L15.326 13.0251C15.7365 12.6559 16.2237 12.3705 16.7609 12.1956L17 11H19L19.2391 12.1956C19.7763 12.3705 20.2635 12.6559 20.674 13.0251ZM18 17C18.5523 17 19 16.5523 19 16C19 15.4477 18.5523 15 18 15C17.4477 15 17 15.4477 17 16C17 16.5523 17.4477 17 18 17Z" }, child: [] }] })(r);
164
+ function Yt(a) {
165
+ return k({ attr: { viewBox: "0 0 24 24", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M2 18H9V20H2V18ZM2 11H11V13H2V11ZM2 4H22V6H2V4ZM20.674 13.0251L21.8301 12.634L22.8301 14.366L21.914 15.1711C21.9704 15.4386 22 15.7158 22 16C22 16.2842 21.9704 16.5614 21.914 16.8289L22.8301 17.634L21.8301 19.366L20.674 18.9749C20.2635 19.3441 19.7763 19.6295 19.2391 19.8044L19 21H17L16.7609 19.8044C16.2237 19.6295 15.7365 19.3441 15.326 18.9749L14.1699 19.366L13.1699 17.634L14.086 16.8289C14.0296 16.5614 14 16.2842 14 16C14 15.7158 14.0296 15.4386 14.086 15.1711L13.1699 14.366L14.1699 12.634L15.326 13.0251C15.7365 12.6559 16.2237 12.3705 16.7609 12.1956L17 11H19L19.2391 12.1956C19.7763 12.3705 20.2635 12.6559 20.674 13.0251ZM18 17C18.5523 17 19 16.5523 19 16C19 15.4477 18.5523 15 18 15C17.4477 15 17 15.4477 17 16C17 16.5523 17.4477 17 18 17Z" }, child: [] }] })(a);
166
166
  }
167
- function Ut(r) {
168
- return k({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M12 21h-7a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7" }, child: [] }, { tag: "path", attr: { d: "M3 10h18" }, child: [] }, { tag: "path", attr: { d: "M10 3v18" }, child: [] }, { tag: "path", attr: { d: "M19.001 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M19.001 15.5v1.5" }, child: [] }, { tag: "path", attr: { d: "M19.001 21v1.5" }, child: [] }, { tag: "path", attr: { d: "M22.032 17.25l-1.299 .75" }, child: [] }, { tag: "path", attr: { d: "M17.27 20l-1.3 .75" }, child: [] }, { tag: "path", attr: { d: "M15.97 17.25l1.3 .75" }, child: [] }, { tag: "path", attr: { d: "M20.733 20l1.3 .75" }, child: [] }] })(r);
167
+ function Qt(a) {
168
+ return k({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M12 21h-7a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7" }, child: [] }, { tag: "path", attr: { d: "M3 10h18" }, child: [] }, { tag: "path", attr: { d: "M10 3v18" }, child: [] }, { tag: "path", attr: { d: "M19.001 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M19.001 15.5v1.5" }, child: [] }, { tag: "path", attr: { d: "M19.001 21v1.5" }, child: [] }, { tag: "path", attr: { d: "M22.032 17.25l-1.299 .75" }, child: [] }, { tag: "path", attr: { d: "M17.27 20l-1.3 .75" }, child: [] }, { tag: "path", attr: { d: "M15.97 17.25l1.3 .75" }, child: [] }, { tag: "path", attr: { d: "M20.733 20l1.3 .75" }, child: [] }] })(a);
169
169
  }
170
- function $t(r) {
171
- return k({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" }, child: [] }, { tag: "path", attr: { d: "M3 10h18" }, child: [] }, { tag: "path", attr: { d: "M10 3v18" }, child: [] }] })(r);
170
+ function Gt(a) {
171
+ return k({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" }, child: [] }, { tag: "path", attr: { d: "M3 10h18" }, child: [] }, { tag: "path", attr: { d: "M10 3v18" }, child: [] }] })(a);
172
172
  }
173
- function Wt(r) {
174
- return k({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M2 20h20v4H2v-4zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5L5.49 17zm4.42-5.61 2.03-5.79h.12l2.03 5.79H9.91z" }, child: [] }] })(r);
173
+ function Jt(a) {
174
+ return k({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M2 20h20v4H2v-4zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5L5.49 17zm4.42-5.61 2.03-5.79h.12l2.03 5.79H9.91z" }, child: [] }] })(a);
175
175
  }
176
- function Zt(r) {
177
- return k({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z" }, child: [] }] })(r);
176
+ function en(a) {
177
+ return k({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z" }, child: [] }] })(a);
178
178
  }
179
- const Xt = [
179
+ const tn = [
180
180
  "😀",
181
181
  "😁",
182
182
  "😂",
@@ -288,37 +288,37 @@ const Xt = [
288
288
  "👏",
289
289
  "🫶",
290
290
  "👐"
291
- ], Kt = ({
292
- exec: r,
293
- saveSelection: s,
291
+ ], nn = ({
292
+ exec: a,
293
+ saveSelection: d,
294
294
  handleFileChange: u,
295
- handleFontSizeChange: g,
296
- handleFontFamilyChange: h,
295
+ handleFontSizeChange: h,
296
+ handleFontFamilyChange: v,
297
297
  // insertListBlock,
298
- insertEmoji: M,
299
- handleLink: L,
300
- removeFormatting: T,
301
- visibleActions: y,
298
+ insertEmoji: L,
299
+ handleLink: P,
300
+ removeFormatting: z,
301
+ visibleActions: w,
302
302
  className: S,
303
- style: w
303
+ style: R
304
304
  }) => {
305
- var X, B;
306
- const x = W(null), P = W(null), A = W(null), [O, _] = D(!1), [H, j] = D({
305
+ var q, Y;
306
+ const N = Z(null), $ = Z(null), b = Z(null), [A, _] = H(!1), [B, O] = H({
307
307
  x: 0,
308
308
  y: 0
309
309
  });
310
310
  U(() => {
311
- const f = (b) => {
312
- !b.target.closest(".rte-emoji-popup") && !b.target.closest("button[title='Emoji']") && _(!1);
311
+ const g = (y) => {
312
+ !y.target.closest(".rte-emoji-popup") && !y.target.closest("button[title='Emoji']") && _(!1);
313
313
  };
314
- return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
314
+ return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
315
315
  }, []);
316
- const z = (f) => {
317
- var V;
318
- f.preventDefault();
319
- const b = f.currentTarget.dataset.command;
320
- if (b)
321
- switch (b) {
316
+ const F = (g) => {
317
+ var X;
318
+ g.preventDefault();
319
+ const y = g.currentTarget.dataset.command;
320
+ if (y)
321
+ switch (y) {
322
322
  case "bold":
323
323
  case "italic":
324
324
  case "underline":
@@ -327,20 +327,20 @@ const Xt = [
327
327
  case "insertOrderedList":
328
328
  case "insertStaticOrderedList":
329
329
  case "removeFormat":
330
- r(b);
330
+ a(y);
331
331
  break;
332
332
  case "insertImage": {
333
- (V = x.current) == null || V.click();
333
+ (X = N.current) == null || X.click();
334
334
  break;
335
335
  }
336
336
  default:
337
- console.warn("Unknown command:", b);
337
+ console.warn("Unknown command:", y);
338
338
  }
339
- }, $ = (f) => {
340
- r("foreColor", f.target.value);
341
- }, Z = (f) => {
342
- r("backColor", f.target.value);
343
- }, [R, F] = D({
339
+ }, K = (g) => {
340
+ a("foreColor", g.target.value);
341
+ }, W = (g) => {
342
+ a("backColor", g.target.value);
343
+ }, [x, D] = H({
344
344
  bold: !1,
345
345
  italic: !1,
346
346
  underline: !1,
@@ -356,10 +356,24 @@ const Xt = [
356
356
  table: !1,
357
357
  color: !1,
358
358
  highlight: !1
359
- });
359
+ }), I = Z(null), j = Z(null);
360
360
  return U(() => {
361
- const f = () => {
362
- F({
361
+ const g = () => {
362
+ const y = window.getSelection();
363
+ if (!y || !y.anchorNode) return;
364
+ let X = y.anchorNode.nodeType === Node.ELEMENT_NODE ? y.anchorNode : y.anchorNode.parentElement;
365
+ if (!X) return;
366
+ const J = window.getComputedStyle(X), le = J.fontFamily.replace(/['"]/g, "").split(",")[0], de = parseInt(J.fontSize, 10);
367
+ if (I.current) {
368
+ const ee = Array.from(I.current.options).some((oe) => oe.value === le);
369
+ I.current.value = ee ? le : "";
370
+ }
371
+ j.current && (j.current.value = String(de));
372
+ };
373
+ return document.addEventListener("selectionchange", g), () => document.removeEventListener("selectionchange", g);
374
+ }, []), U(() => {
375
+ const g = () => {
376
+ D({
363
377
  bold: document.queryCommandState("bold"),
364
378
  italic: document.queryCommandState("italic"),
365
379
  underline: document.queryCommandState("underline"),
@@ -377,130 +391,130 @@ const Xt = [
377
391
  highlight: document.queryCommandState("backColor")
378
392
  });
379
393
  };
380
- return document.addEventListener("selectionchange", f), () => document.removeEventListener("selectionchange", f);
381
- }, []), /* @__PURE__ */ i.createElement("div", {
394
+ return document.addEventListener("selectionchange", g), () => document.removeEventListener("selectionchange", g);
395
+ }, []), /* @__PURE__ */ r.createElement("div", {
382
396
  className: `rte-toolbar ${S || ""}`,
383
- style: w
384
- }, y.bold && /* @__PURE__ */ i.createElement("button", {
397
+ style: R
398
+ }, w.bold && /* @__PURE__ */ r.createElement("button", {
385
399
  "data-command": "bold",
386
400
  title: "Bold",
387
- onMouseDown: z,
388
- className: R.bold ? "rte-active" : ""
389
- }, /* @__PURE__ */ i.createElement(Ot, null)), y.italic && /* @__PURE__ */ i.createElement("button", {
401
+ onMouseDown: F,
402
+ className: x.bold ? "rte-active" : ""
403
+ }, /* @__PURE__ */ r.createElement(Bt, null)), w.italic && /* @__PURE__ */ r.createElement("button", {
390
404
  "data-command": "italic",
391
405
  title: "Italic",
392
- onMouseDown: z,
393
- className: R.italic ? "rte-active" : ""
394
- }, /* @__PURE__ */ i.createElement(jt, null)), y.underline && /* @__PURE__ */ i.createElement("button", {
406
+ onMouseDown: F,
407
+ className: x.italic ? "rte-active" : ""
408
+ }, /* @__PURE__ */ r.createElement(Ut, null)), w.underline && /* @__PURE__ */ r.createElement("button", {
395
409
  "data-command": "underline",
396
410
  title: "Underline",
397
- onMouseDown: z,
398
- className: R.underline ? "rte-active" : ""
399
- }, /* @__PURE__ */ i.createElement(qt, null)), y.unorderedList && /* @__PURE__ */ i.createElement("button", {
411
+ onMouseDown: F,
412
+ className: x.underline ? "rte-active" : ""
413
+ }, /* @__PURE__ */ r.createElement(Zt, null)), w.unorderedList && /* @__PURE__ */ r.createElement("button", {
400
414
  "data-command": "insertUnorderedList",
401
- onMouseDown: z,
415
+ onMouseDown: F,
402
416
  title: "UnorderedList",
403
- className: R.unorderedList ? "rte-active" : ""
404
- }, /* @__PURE__ */ i.createElement(Vt, null)), y.staticUnorderedList && /* @__PURE__ */ i.createElement("button", {
417
+ className: x.unorderedList ? "rte-active" : ""
418
+ }, /* @__PURE__ */ r.createElement(Yt, null)), w.staticUnorderedList && /* @__PURE__ */ r.createElement("button", {
405
419
  "data-command": "insertStaticUnorderedList",
406
- onMouseDown: z,
420
+ onMouseDown: F,
407
421
  title: "StaticUnorderedList",
408
- className: R.unorderedList ? "rte-active" : ""
409
- }, /* @__PURE__ */ i.createElement(It, null)), y.orderedList && /* @__PURE__ */ i.createElement("button", {
422
+ className: x.unorderedList ? "rte-active" : ""
423
+ }, /* @__PURE__ */ r.createElement(Wt, null)), w.orderedList && /* @__PURE__ */ r.createElement("button", {
410
424
  "data-command": "insertOrderedList",
411
425
  title: "OrderedList",
412
- onMouseDown: z,
413
- className: R.orderedList ? "rte-active" : "",
426
+ onMouseDown: F,
427
+ className: x.orderedList ? "rte-active" : "",
414
428
  style: {
415
429
  fontSize: "medium"
416
430
  }
417
- }, /* @__PURE__ */ i.createElement(Bt, null)), y.staticOrderedList && /* @__PURE__ */ i.createElement("button", {
431
+ }, /* @__PURE__ */ r.createElement(Kt, null)), w.staticOrderedList && /* @__PURE__ */ r.createElement("button", {
418
432
  "data-command": "insertStaticOrderedList",
419
433
  title: "StaticOrderedList",
420
- onMouseDown: z,
421
- className: R.orderedList ? "rte-active" : ""
422
- }, /* @__PURE__ */ i.createElement(Dt, null)), y.link && /* @__PURE__ */ i.createElement("button", {
434
+ onMouseDown: F,
435
+ className: x.orderedList ? "rte-active" : ""
436
+ }, /* @__PURE__ */ r.createElement(It, null)), w.link && /* @__PURE__ */ r.createElement("button", {
423
437
  "data-command": "createLink",
424
438
  title: "Link",
425
- onClick: L,
426
- className: R.link ? "rte-active" : ""
427
- }, /* @__PURE__ */ i.createElement(Ft, null)), y.removeFormat && /* @__PURE__ */ i.createElement("button", {
439
+ onClick: P,
440
+ className: x.link ? "rte-active" : ""
441
+ }, /* @__PURE__ */ r.createElement($t, null)), w.removeFormat && /* @__PURE__ */ r.createElement("button", {
428
442
  "data-command": "Remove format",
429
443
  title: "removeFormat",
430
- onMouseDown: (f) => {
431
- f.preventDefault(), s(), T();
444
+ onMouseDown: (g) => {
445
+ g.preventDefault(), d(), z();
432
446
  },
433
- className: R.removeFormat ? "rte-active" : ""
434
- }, /* @__PURE__ */ i.createElement(Zt, null)), y.image && /* @__PURE__ */ i.createElement("button", {
447
+ className: x.removeFormat ? "rte-active" : ""
448
+ }, /* @__PURE__ */ r.createElement(en, null)), w.image && /* @__PURE__ */ r.createElement("button", {
435
449
  "data-command": "insertImage",
436
450
  title: "Image",
437
- onMouseDown: z,
438
- className: R.image ? "rte-active" : ""
439
- }, /* @__PURE__ */ i.createElement(zt, null)), /* @__PURE__ */ i.createElement("input", {
451
+ onMouseDown: F,
452
+ className: x.image ? "rte-active" : ""
453
+ }, /* @__PURE__ */ r.createElement(Ft, null)), /* @__PURE__ */ r.createElement("input", {
440
454
  type: "file",
441
455
  accept: "image/*",
442
- ref: x,
456
+ ref: N,
443
457
  style: {
444
458
  display: "none"
445
459
  },
446
460
  onChange: u
447
- }), y.emoji && /* @__PURE__ */ i.createElement("div", {
461
+ }), w.emoji && /* @__PURE__ */ r.createElement("div", {
448
462
  style: {
449
463
  position: "relative"
450
464
  }
451
- }, /* @__PURE__ */ i.createElement("button", {
465
+ }, /* @__PURE__ */ r.createElement("button", {
452
466
  title: "Emoji",
453
- onMouseDown: (f) => {
454
- f.preventDefault(), s();
455
- const b = f.currentTarget.getBoundingClientRect();
456
- j({
457
- x: b.left,
458
- y: b.bottom + 8
467
+ onMouseDown: (g) => {
468
+ g.preventDefault(), d();
469
+ const y = g.currentTarget.getBoundingClientRect();
470
+ O({
471
+ x: y.left,
472
+ y: y.bottom + 8
459
473
  // small spacing
460
- }), _((V) => !V);
474
+ }), _((X) => !X);
461
475
  },
462
- className: R.emoji ? "rte-active" : ""
463
- }, /* @__PURE__ */ i.createElement(Pt, null)), O && /* @__PURE__ */ bt(/* @__PURE__ */ i.createElement("div", {
476
+ className: x.emoji ? "rte-active" : ""
477
+ }, /* @__PURE__ */ r.createElement(Xt, null)), A && /* @__PURE__ */ At(/* @__PURE__ */ r.createElement("div", {
464
478
  className: "rte-emoji-popup",
465
479
  style: {
466
- top: H.y,
467
- left: H.x
480
+ top: B.y,
481
+ left: B.x
468
482
  }
469
- }, Xt.map((f, b) => /* @__PURE__ */ i.createElement("span", {
470
- key: b,
483
+ }, tn.map((g, y) => /* @__PURE__ */ r.createElement("span", {
484
+ key: y,
471
485
  style: {
472
486
  fontSize: "20px",
473
487
  cursor: "pointer",
474
488
  textAlign: "center"
475
489
  },
476
- onMouseDown: (V) => {
477
- V.preventDefault(), M(f), _(!1);
490
+ onMouseDown: (X) => {
491
+ X.preventDefault(), L(g), _(!1);
478
492
  }
479
- }, f))), document.body)), y.color && /* @__PURE__ */ i.createElement("div", {
493
+ }, g))), document.body)), w.color && /* @__PURE__ */ r.createElement("div", {
480
494
  style: {
481
495
  position: "relative"
482
496
  }
483
- }, /* @__PURE__ */ i.createElement("button", {
497
+ }, /* @__PURE__ */ r.createElement("button", {
484
498
  title: "Text Color",
485
- onMouseDown: (f) => {
486
- var b;
487
- f.preventDefault(), s(), (b = P.current) == null || b.click();
499
+ onMouseDown: (g) => {
500
+ var y;
501
+ g.preventDefault(), d(), (y = $.current) == null || y.click();
488
502
  },
489
503
  style: {
490
504
  display: "flex",
491
505
  alignItems: "center",
492
506
  justifyContent: "center",
493
- color: ((X = P.current) == null ? void 0 : X.value) || "#000",
507
+ color: ((q = $.current) == null ? void 0 : q.value) || "#000",
494
508
  fontSize: "18px"
495
509
  },
496
- className: R.color ? "rte-active" : ""
497
- }, /* @__PURE__ */ i.createElement(Wt, null)), /* @__PURE__ */ i.createElement("input", {
498
- ref: P,
510
+ className: x.color ? "rte-active" : ""
511
+ }, /* @__PURE__ */ r.createElement(Jt, null)), /* @__PURE__ */ r.createElement("input", {
512
+ ref: $,
499
513
  type: "color",
500
514
  defaultValue: "#000000",
501
- onChange: (f) => {
502
- var b;
503
- $(f), ((b = f.target.parentElement) == null ? void 0 : b.querySelector("button")).style.color = f.target.value;
515
+ onChange: (g) => {
516
+ var y;
517
+ K(g), ((y = g.target.parentElement) == null ? void 0 : y.querySelector("button")).style.color = g.target.value;
504
518
  },
505
519
  style: {
506
520
  position: "absolute",
@@ -509,30 +523,30 @@ const Xt = [
509
523
  height: 0,
510
524
  pointerEvents: "none"
511
525
  }
512
- })), y.highlight && /* @__PURE__ */ i.createElement("div", {
526
+ })), w.highlight && /* @__PURE__ */ r.createElement("div", {
513
527
  style: {
514
528
  position: "relative"
515
529
  }
516
- }, /* @__PURE__ */ i.createElement("button", {
530
+ }, /* @__PURE__ */ r.createElement("button", {
517
531
  title: "Highlight",
518
- onMouseDown: (f) => {
519
- var b;
520
- f.preventDefault(), s(), (b = A.current) == null || b.click();
532
+ onMouseDown: (g) => {
533
+ var y;
534
+ g.preventDefault(), d(), (y = b.current) == null || y.click();
521
535
  },
522
536
  style: {
523
537
  display: "flex",
524
538
  alignItems: "center",
525
539
  justifyContent: "center",
526
- color: ((B = A.current) == null ? void 0 : B.value) || "#000",
540
+ color: ((Y = b.current) == null ? void 0 : Y.value) || "#000",
527
541
  fontSize: "18px"
528
542
  },
529
- className: R.highlight ? "rte-active" : ""
530
- }, /* @__PURE__ */ i.createElement(_t, null)), /* @__PURE__ */ i.createElement("input", {
531
- ref: A,
543
+ className: x.highlight ? "rte-active" : ""
544
+ }, /* @__PURE__ */ r.createElement(Vt, null)), /* @__PURE__ */ r.createElement("input", {
545
+ ref: b,
532
546
  type: "color",
533
- onChange: (f) => {
534
- var b;
535
- Z(f), ((b = f.target.parentElement) == null ? void 0 : b.querySelector("button")).style.color = f.target.value;
547
+ onChange: (g) => {
548
+ var y;
549
+ W(g), ((y = g.target.parentElement) == null ? void 0 : y.querySelector("button")).style.color = g.target.value;
536
550
  },
537
551
  defaultValue: "#000000",
538
552
  style: {
@@ -542,320 +556,494 @@ const Xt = [
542
556
  height: 0,
543
557
  pointerEvents: "none"
544
558
  }
545
- })), y.align && /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("button", {
559
+ })), w.align && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("button", {
546
560
  title: "Align Left",
547
- onMouseDown: (f) => f.preventDefault(),
548
- onClick: () => r("justifyLeft"),
549
- className: R.alignLeft ? "rte-active" : ""
550
- }, /* @__PURE__ */ i.createElement(Ht, null)), /* @__PURE__ */ i.createElement("button", {
561
+ onMouseDown: (g) => g.preventDefault(),
562
+ onClick: () => a("justifyLeft"),
563
+ className: x.alignLeft ? "rte-active" : ""
564
+ }, /* @__PURE__ */ r.createElement(qt, null)), /* @__PURE__ */ r.createElement("button", {
551
565
  title: "Align Center",
552
- onMouseDown: (f) => f.preventDefault(),
553
- onClick: () => r("justifyCenter"),
554
- className: R.alignCenter ? "rte-active" : ""
555
- }, /* @__PURE__ */ i.createElement(Nt, null)), /* @__PURE__ */ i.createElement("button", {
566
+ onMouseDown: (g) => g.preventDefault(),
567
+ onClick: () => a("justifyCenter"),
568
+ className: x.alignCenter ? "rte-active" : ""
569
+ }, /* @__PURE__ */ r.createElement(_t, null)), /* @__PURE__ */ r.createElement("button", {
556
570
  title: "Align Right",
557
- onMouseDown: (f) => f.preventDefault(),
558
- onClick: () => r("justifyRight"),
559
- className: R.alignRight ? "rte-active" : ""
560
- }, /* @__PURE__ */ i.createElement(kt, null))), y.table && /* @__PURE__ */ i.createElement("button", {
571
+ onMouseDown: (g) => g.preventDefault(),
572
+ onClick: () => a("justifyRight"),
573
+ className: x.alignRight ? "rte-active" : ""
574
+ }, /* @__PURE__ */ r.createElement(jt, null))), w.table && /* @__PURE__ */ r.createElement("button", {
561
575
  title: "Insert Dynamic Table",
562
- onMouseDown: (f) => f.preventDefault(),
563
- onClick: () => r("insertTable"),
564
- className: R.table ? "rte-active" : "",
576
+ onMouseDown: (g) => g.preventDefault(),
577
+ onClick: () => a("insertTable"),
578
+ className: x.table ? "rte-active" : "",
565
579
  style: {
566
580
  fontSize: "medium"
567
581
  }
568
- }, /* @__PURE__ */ i.createElement(Ut, null)), y.table && /* @__PURE__ */ i.createElement("button", {
582
+ }, /* @__PURE__ */ r.createElement(Qt, null)), w.table && /* @__PURE__ */ r.createElement("button", {
569
583
  title: "Insert Static Table",
570
- onMouseDown: (f) => f.preventDefault(),
571
- onClick: () => r("insertStaticTable"),
572
- className: R.table ? "rte-active" : "",
584
+ onMouseDown: (g) => g.preventDefault(),
585
+ onClick: () => a("insertStaticTable"),
586
+ className: x.table ? "rte-active" : "",
573
587
  style: {
574
588
  fontSize: "medium"
575
589
  }
576
- }, /* @__PURE__ */ i.createElement($t, null)), y.fontFamily && /* @__PURE__ */ i.createElement("select", {
590
+ }, /* @__PURE__ */ r.createElement(Gt, null)), w.fontFamily && /* @__PURE__ */ r.createElement("select", {
591
+ ref: I,
577
592
  className: "rte-dropdown",
578
593
  defaultValue: "",
579
- onMouseDown: () => s(),
580
- onChange: h
581
- }, /* @__PURE__ */ i.createElement("option", {
594
+ onMouseDown: () => d(),
595
+ onChange: v
596
+ }, /* @__PURE__ */ r.createElement("option", {
582
597
  value: "",
583
598
  disabled: !0
584
- }, "Font Family"), /* @__PURE__ */ i.createElement("option", {
599
+ }, "Font Family"), /* @__PURE__ */ r.createElement("option", {
585
600
  value: "Arial"
586
- }, "Arial"), /* @__PURE__ */ i.createElement("option", {
601
+ }, "Arial"), /* @__PURE__ */ r.createElement("option", {
587
602
  value: "Georgia"
588
- }, "Georgia"), /* @__PURE__ */ i.createElement("option", {
603
+ }, "Georgia"), /* @__PURE__ */ r.createElement("option", {
589
604
  value: "Times New Roman"
590
- }, "Times New Roman"), /* @__PURE__ */ i.createElement("option", {
605
+ }, "Times New Roman"), /* @__PURE__ */ r.createElement("option", {
591
606
  value: "Courier New"
592
- }, "Courier New"), /* @__PURE__ */ i.createElement("option", {
607
+ }, "Courier New"), /* @__PURE__ */ r.createElement("option", {
593
608
  value: "Verdana"
594
- }, "Verdana")), y.fontSize && /* @__PURE__ */ i.createElement("select", {
609
+ }, "Verdana")), w.fontSize && /* @__PURE__ */ r.createElement("select", {
610
+ ref: j,
595
611
  className: "rte-dropdown rte-fontsize-dropdown",
596
612
  defaultValue: "",
597
- onMouseDown: () => s(),
598
- onChange: g
599
- }, /* @__PURE__ */ i.createElement("option", {
613
+ onMouseDown: () => d(),
614
+ onChange: h
615
+ }, /* @__PURE__ */ r.createElement("option", {
600
616
  value: "",
601
617
  disabled: !0
602
618
  }, "Font Size"), Array.from({
603
619
  length: 16
604
- }, (f, b) => 10 + b).map((f) => /* @__PURE__ */ i.createElement("option", {
605
- key: f,
606
- value: f
607
- }, f, "px"))));
608
- }, Yt = ({
609
- show: r,
610
- position: s,
620
+ }, (g, y) => 10 + y).map((g) => /* @__PURE__ */ r.createElement("option", {
621
+ key: g,
622
+ value: g
623
+ }, g, "px"))));
624
+ }, rn = ({
625
+ show: a,
626
+ position: d,
611
627
  filtered: u,
612
- insertMention: g,
613
- onClose: h,
614
- query: M
628
+ insertMention: h,
629
+ onClose: v,
630
+ query: L
615
631
  }) => {
616
- const L = W(null), [T, y] = D(0);
632
+ const P = Z(null), [z, w] = H(0);
617
633
  return U(() => {
618
- r && y(0);
619
- }, [r]), U(() => {
620
- const S = (w) => {
621
- L.current && !L.current.contains(w.target) && h();
634
+ a && w(0);
635
+ }, [a]), U(() => {
636
+ const S = (R) => {
637
+ P.current && !P.current.contains(R.target) && v();
622
638
  };
623
- return r && document.addEventListener("mousedown", S), () => {
639
+ return a && document.addEventListener("mousedown", S), () => {
624
640
  document.removeEventListener("mousedown", S);
625
641
  };
626
- }, [r, h]), U(() => {
627
- if (!r) return;
628
- const S = (w) => {
629
- if (!(!r || u.length === 0) && (w.key === "ArrowDown" && (w.preventDefault(), y((x) => Math.min(x + 1, u.length - 1))), w.key === "ArrowUp" && (w.preventDefault(), y((x) => Math.max(x - 1, 0))), w.key === "Enter")) {
630
- w.preventDefault();
631
- const x = u[T];
632
- x && g(x);
642
+ }, [a, v]), U(() => {
643
+ if (!a) return;
644
+ const S = (R) => {
645
+ if (!(!a || u.length === 0) && (R.key === "ArrowDown" && (R.preventDefault(), w((N) => Math.min(N + 1, u.length - 1))), R.key === "ArrowUp" && (R.preventDefault(), w((N) => Math.max(N - 1, 0))), R.key === "Enter")) {
646
+ R.preventDefault();
647
+ const N = u[z];
648
+ N && h(N);
633
649
  }
634
650
  };
635
651
  return window.addEventListener("keydown", S), () => window.removeEventListener("keydown", S);
636
- }, [r, u, T]), U(() => {
637
- if (!L.current) return;
638
- const w = L.current.querySelectorAll("li")[T];
639
- w && w.scrollIntoView({
652
+ }, [a, u, z]), U(() => {
653
+ if (!P.current) return;
654
+ const R = P.current.querySelectorAll("li")[z];
655
+ R && R.scrollIntoView({
640
656
  block: "nearest",
641
657
  behavior: "smooth"
642
658
  });
643
- }, [T]), r ? /* @__PURE__ */ i.createElement("ul", {
644
- ref: L,
659
+ }, [z]), a ? /* @__PURE__ */ r.createElement("ul", {
660
+ ref: P,
645
661
  className: "rte-popup",
646
662
  style: {
647
- top: s.y,
648
- left: s.x
663
+ top: d.y,
664
+ left: d.x
649
665
  }
650
666
  }, u.length > 0 ? u.map(({
651
667
  name: S,
652
- value: w
653
- }, x) => {
654
- const P = S.toLowerCase(), A = M.toLowerCase(), O = P.indexOf(A);
668
+ value: R
669
+ }, N) => {
670
+ const $ = S.toLowerCase(), b = L.toLowerCase(), A = $.indexOf(b);
655
671
  let _ = S;
656
- if (O !== -1 && M.length > 0) {
657
- const H = O + M.length;
658
- _ = S.substring(0, O) + `<span class="rte-highlight">${S.substring(O, H)}</span>` + S.substring(H);
672
+ if (A !== -1 && L.length > 0) {
673
+ const B = A + L.length;
674
+ _ = S.substring(0, A) + `<span class="rte-highlight">${S.substring(A, B)}</span>` + S.substring(B);
659
675
  }
660
- return /* @__PURE__ */ i.createElement("li", {
661
- key: w,
662
- onMouseDown: (H) => {
663
- H.preventDefault(), g({
676
+ return /* @__PURE__ */ r.createElement("li", {
677
+ key: R,
678
+ onMouseDown: (B) => {
679
+ B.preventDefault(), h({
664
680
  name: S,
665
- value: w
681
+ value: R
666
682
  });
667
683
  },
668
684
  style: {
669
685
  padding: "6px 12px",
670
686
  cursor: "pointer",
671
687
  fontSize: "14px",
672
- background: x === T ? "#dce8ff" : "white"
688
+ background: N === z ? "#dce8ff" : "white"
673
689
  },
674
690
  dangerouslySetInnerHTML: {
675
691
  __html: _
676
692
  },
677
- onMouseEnter: () => y(x)
693
+ onMouseEnter: () => w(N)
678
694
  });
679
- }) : /* @__PURE__ */ i.createElement("li", {
695
+ }) : /* @__PURE__ */ r.createElement("li", {
680
696
  style: {
681
697
  padding: "6px 12px",
682
698
  color: "#999"
683
699
  }
684
700
  }, "No matches")) : null;
685
701
  };
686
- function Oe(r) {
687
- return k({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Minus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,11.5h0a.5.5,0,0,1,0,1H9a.5.5,0,0,1,0-1Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.934A9.933,9.933,0,1,1,21.932,12,9.945,9.945,0,0,1,12,21.934ZM12,3.068A8.933,8.933,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.068Z" }, child: [] }] }] }] })(r);
702
+ function Ie(a) {
703
+ return k({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Minus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,11.5h0a.5.5,0,0,1,0,1H9a.5.5,0,0,1,0-1Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.934A9.933,9.933,0,1,1,21.932,12,9.945,9.945,0,0,1,12,21.934ZM12,3.068A8.933,8.933,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.068Z" }, child: [] }] }] }] })(a);
688
704
  }
689
- function G(r) {
690
- return k({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Plus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,12.5H12.5V15a.5.5,0,0,1-1,0V12.5H9a.5.5,0,0,1,0-1h2.5V9a.5.5,0,0,1,1,0v2.5H15A.5.5,0,0,1,15,12.5Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.932A9.934,9.934,0,1,1,21.932,12,9.944,9.944,0,0,1,12,21.932ZM12,3.065A8.934,8.934,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.065Z" }, child: [] }] }] }] })(r);
705
+ function ie(a) {
706
+ return k({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Plus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,12.5H12.5V15a.5.5,0,0,1-1,0V12.5H9a.5.5,0,0,1,0-1h2.5V9a.5.5,0,0,1,1,0v2.5H15A.5.5,0,0,1,15,12.5Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.932A9.934,9.934,0,1,1,21.932,12,9.944,9.944,0,0,1,12,21.932ZM12,3.065A8.934,8.934,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.065Z" }, child: [] }] }] }] })(a);
691
707
  }
692
- const Qt = ({
693
- visible: r,
694
- x: s,
708
+ const an = ({
709
+ visible: a,
710
+ x: d,
695
711
  y: u,
696
- onAction: g,
697
- onClose: h
712
+ onAction: h,
713
+ onClose: v
698
714
  }) => {
699
- if (!r) return null;
700
- const M = {
715
+ if (!a) return null;
716
+ const L = {
701
717
  top: u,
702
- left: s
718
+ left: d
703
719
  };
704
- return /* @__PURE__ */ i.createElement("div", {
705
- style: M,
720
+ return /* @__PURE__ */ r.createElement("div", {
721
+ style: L,
706
722
  className: "rte-table-menu",
707
- onMouseLeave: h
708
- }, /* @__PURE__ */ i.createElement("button", {
709
- onClick: () => g("insertRowAbove")
710
- }, /* @__PURE__ */ i.createElement(G, null), " Insert row above"), /* @__PURE__ */ i.createElement("button", {
711
- onClick: () => g("insertRowBelow")
712
- }, /* @__PURE__ */ i.createElement(G, null), " Insert row below"), /* @__PURE__ */ i.createElement("button", {
713
- onClick: () => g("insertColLeft")
714
- }, /* @__PURE__ */ i.createElement(G, null), " Insert col left"), /* @__PURE__ */ i.createElement("button", {
715
- onClick: () => g("insertColRight")
716
- }, /* @__PURE__ */ i.createElement(G, null), " Insert col right"), /* @__PURE__ */ i.createElement("button", {
717
- onClick: () => g("deleteRow")
718
- }, /* @__PURE__ */ i.createElement(Oe, null), " Delete row"), /* @__PURE__ */ i.createElement("button", {
719
- onClick: () => g("deleteCol")
720
- }, /* @__PURE__ */ i.createElement(Oe, null), " Delete column"));
721
- }, Jt = ({
722
- html: r,
723
- className: s,
724
- style: u
723
+ onMouseLeave: v
724
+ }, /* @__PURE__ */ r.createElement("button", {
725
+ onClick: () => h("insertRowAbove")
726
+ }, /* @__PURE__ */ r.createElement(ie, null), " Insert row above"), /* @__PURE__ */ r.createElement("button", {
727
+ onClick: () => h("insertRowBelow")
728
+ }, /* @__PURE__ */ r.createElement(ie, null), " Insert row below"), /* @__PURE__ */ r.createElement("button", {
729
+ onClick: () => h("insertColLeft")
730
+ }, /* @__PURE__ */ r.createElement(ie, null), " Insert col left"), /* @__PURE__ */ r.createElement("button", {
731
+ onClick: () => h("insertColRight")
732
+ }, /* @__PURE__ */ r.createElement(ie, null), " Insert col right"), /* @__PURE__ */ r.createElement("button", {
733
+ onClick: () => h("deleteRow")
734
+ }, /* @__PURE__ */ r.createElement(Ie, null), " Delete row"), /* @__PURE__ */ r.createElement("button", {
735
+ onClick: () => h("deleteCol")
736
+ }, /* @__PURE__ */ r.createElement(Ie, null), " Delete column"));
737
+ };
738
+ function qe(a) {
739
+ return k({ attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M885.9 490.3c3.6-12 5.4-24.4 5.4-37 0-28.3-9.3-55.5-26.1-77.7 3.6-12 5.4-24.4 5.4-37 0-28.3-9.3-55.5-26.1-77.7 3.6-12 5.4-24.4 5.4-37 0-51.6-30.7-98.1-78.3-118.4a66.1 66.1 0 0 0-26.5-5.4H144c-17.7 0-32 14.3-32 32v364c0 17.7 14.3 32 32 32h129.3l85.8 310.8C372.9 889 418.9 924 470.9 924c29.7 0 57.4-11.8 77.9-33.4 20.5-21.5 31-49.7 29.5-79.4l-6-122.9h239.9c12.1 0 23.9-3.2 34.3-9.3 40.4-23.5 65.5-66.1 65.5-111 0-28.3-9.3-55.5-26.1-77.7zM184 456V172h81v284h-81zm627.2 160.4H496.8l9.6 198.4c.6 11.9-4.7 23.1-14.6 30.5-6.1 4.5-13.6 6.8-21.1 6.7a44.28 44.28 0 0 1-42.2-32.3L329 459.2V172h415.4a56.85 56.85 0 0 1 33.6 51.8c0 9.7-2.3 18.9-6.9 27.3l-13.9 25.4 21.9 19a56.76 56.76 0 0 1 19.6 43c0 9.7-2.3 18.9-6.9 27.3l-13.9 25.4 21.9 19a56.76 56.76 0 0 1 19.6 43c0 9.7-2.3 18.9-6.9 27.3l-14 25.5 21.9 19a56.76 56.76 0 0 1 19.6 43c0 19.1-11 37.5-28.8 48.4z" }, child: [] }] })(a);
740
+ }
741
+ function Be(a) {
742
+ return k({ attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M885.9 533.7c16.8-22.2 26.1-49.4 26.1-77.7 0-44.9-25.1-87.4-65.5-111.1a67.67 67.67 0 0 0-34.3-9.3H572.4l6-122.9c1.4-29.7-9.1-57.9-29.5-79.4A106.62 106.62 0 0 0 471 99.9c-52 0-98 35-111.8 85.1l-85.9 311H144c-17.7 0-32 14.3-32 32v364c0 17.7 14.3 32 32 32h601.3c9.2 0 18.2-1.8 26.5-5.4 47.6-20.3 78.3-66.8 78.3-118.4 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7-.2-12.6-2-25.1-5.6-37.1zM184 852V568h81v284h-81zm636.4-353l-21.9 19 13.9 25.4a56.2 56.2 0 0 1 6.9 27.3c0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 0 1 6.9 27.3c0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 0 1 6.9 27.3c0 22.4-13.2 42.6-33.6 51.8H329V564.8l99.5-360.5a44.1 44.1 0 0 1 42.2-32.3c7.6 0 15.1 2.2 21.1 6.7 9.9 7.4 15.2 18.6 14.6 30.5l-9.6 198.4h314.4C829 418.5 840 436.9 840 456c0 16.5-7.2 32.1-19.6 43z" }, child: [] }] })(a);
743
+ }
744
+ const ln = ({
745
+ html: a,
746
+ className: d,
747
+ style: u,
748
+ attributes: h,
749
+ setAttributes: v
725
750
  }) => {
726
- const g = (L) => {
727
- const T = L.target;
728
- if (T.tagName === "A") {
729
- L.preventDefault();
730
- const y = T.href;
731
- y && window.open(y, "_blank", "noopener,noreferrer");
751
+ const [L, P] = H("web"), z = {
752
+ web: {
753
+ label: "Web",
754
+ width: "100%",
755
+ height: "100%"
756
+ },
757
+ galaxyS23: {
758
+ label: "Galaxy S23",
759
+ width: 360,
760
+ height: 780
761
+ },
762
+ iphoneSE: {
763
+ label: "iPhone SE (3rd Gen)",
764
+ width: 375,
765
+ height: 667
766
+ },
767
+ iphoneX: {
768
+ label: "iPhone X / XS",
769
+ width: 375,
770
+ height: 812
771
+ },
772
+ pixel7a: {
773
+ label: "Pixel 7a",
774
+ width: 390,
775
+ height: 844
776
+ },
777
+ iphone12: {
778
+ label: "iPhone 12 / 13 / 14",
779
+ width: 390,
780
+ height: 844
781
+ },
782
+ iphone14: {
783
+ label: "iPhone 14 Pro",
784
+ width: 393,
785
+ height: 852
786
+ },
787
+ pixel7: {
788
+ label: "Pixel 7",
789
+ width: 412,
790
+ height: 915
791
+ },
792
+ iphone11: {
793
+ label: "iPhone 11",
794
+ width: 414,
795
+ height: 896
796
+ },
797
+ iphone14ProMax: {
798
+ label: "iPhone 14 Pro Max",
799
+ width: 430,
800
+ height: 932
801
+ },
802
+ pixel8Pro: {
803
+ label: "Pixel 8 Pro",
804
+ width: 448,
805
+ height: 998
806
+ },
807
+ galaxyS24Ultra: {
808
+ label: "Galaxy S24 Ultra",
809
+ width: 480,
810
+ height: 1040
732
811
  }
733
- }, h = (L) => L === "rgb(0, 0, 0)" || L === "rgba(0, 0, 0, 1)" || L === "#000" || L === "#000000" || L === "black", M = (L) => {
734
- const T = document.createElement("div");
735
- T.innerHTML = L;
736
- const y = document.createTreeWalker(T, NodeFilter.SHOW_TEXT, null), S = [];
737
- for (; y.nextNode(); ) {
738
- const w = y.currentNode;
739
- w.nodeValue && /{{\s*[\s\S]*?\s*}}/.test(w.nodeValue) && S.push(w);
812
+ }, w = (b) => {
813
+ const A = b.target;
814
+ if (A.tagName === "A") {
815
+ b.preventDefault();
816
+ const _ = A.href;
817
+ _ && window.open(_, "_blank", "noopener,noreferrer");
740
818
  }
741
- return S.forEach((w) => {
819
+ }, S = (b) => b === "rgb(0, 0, 0)" || b === "rgba(0, 0, 0, 1)" || b === "#000" || b === "#000000" || b === "black", R = (b) => {
820
+ const A = document.createElement("div");
821
+ A.innerHTML = b;
822
+ const _ = document.createTreeWalker(A, NodeFilter.SHOW_TEXT, null), B = [];
823
+ for (; _.nextNode(); ) {
824
+ const O = _.currentNode;
825
+ O.nodeValue && /{{\s*[\s\S]*?\s*}}/.test(O.nodeValue) && B.push(O);
826
+ }
827
+ return B.forEach((O) => {
742
828
  var j;
743
- const x = w.nodeValue || "", P = w.parentElement;
744
- if (!P) return;
745
- let A = P, O = !1;
746
- for (; A; ) {
747
- if (A.tagName === "FONT" && A.getAttribute("color")) {
748
- O = !0;
829
+ const F = O.nodeValue || "", K = O.parentElement;
830
+ if (!K) return;
831
+ let W = K, x = !1;
832
+ for (; W; ) {
833
+ if (W.tagName === "FONT" && W.getAttribute("color")) {
834
+ x = !0;
749
835
  break;
750
836
  }
751
- const z = (j = A.style) == null ? void 0 : j.color;
752
- if (z && !h(z)) {
753
- O = !0;
837
+ const q = (j = W.style) == null ? void 0 : j.color;
838
+ if (q && !S(q)) {
839
+ x = !0;
754
840
  break;
755
841
  }
756
- const $ = window.getComputedStyle(A);
757
- if ($.color && !h($.color)) {
758
- O = !0;
842
+ const Y = window.getComputedStyle(W);
843
+ if (Y.color && !S(Y.color)) {
844
+ x = !0;
759
845
  break;
760
846
  }
761
- A = A.parentElement;
847
+ W = W.parentElement;
762
848
  }
763
- const _ = document.createDocumentFragment();
764
- let H = 0;
765
- x.replace(/{{\s*([\s\S]*?)\s*}}/g, (z, $, Z) => {
766
- if (Z > H && _.appendChild(document.createTextNode(x.slice(H, Z))), O)
767
- _.appendChild(document.createTextNode(z));
849
+ const D = document.createDocumentFragment();
850
+ let I = 0;
851
+ F.replace(/{{\s*([\s\S]*?)\s*}}/g, (q, Y, g) => {
852
+ if (g > I && D.appendChild(document.createTextNode(F.slice(I, g))), x)
853
+ D.appendChild(document.createTextNode(q));
768
854
  else {
769
- const R = document.createElement("span");
770
- R.style.color = "blue", R.textContent = z, _.appendChild(R);
855
+ const y = document.createElement("span");
856
+ y.style.color = "blue", y.textContent = q, D.appendChild(y);
771
857
  }
772
- return H = Z + z.length, z;
773
- }), H < x.length && _.appendChild(document.createTextNode(x.slice(H))), P.replaceChild(_, w);
774
- }), T.innerHTML = T.innerHTML.replace(/{{#arrayData}}/g, "").replace(/{{\/arrayData}}/g, ""), T.innerHTML;
775
- };
776
- return /* @__PURE__ */ i.createElement("div", {
777
- className: `rte-preview ${s || ""}`,
778
- style: u,
779
- onClick: g,
858
+ return I = g + q.length, q;
859
+ }), I < F.length && D.appendChild(document.createTextNode(F.slice(I))), K.replaceChild(D, O);
860
+ }), A.innerHTML = A.innerHTML.replace(/{{#arrayData}}/g, "").replace(/{{\/arrayData}}/g, ""), A.innerHTML;
861
+ }, N = () => (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
862
+ month: "short",
863
+ day: "2-digit",
864
+ year: "numeric"
865
+ }), $ = () => (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
866
+ month: "short",
867
+ day: "2-digit",
868
+ year: "numeric",
869
+ hour: "2-digit",
870
+ minute: "2-digit",
871
+ hour12: !0
872
+ });
873
+ return /* @__PURE__ */ r.createElement("div", {
874
+ className: `rte-preview ${d || ""}`,
875
+ style: ae(re({}, u), {
876
+ position: "relative"
877
+ }),
878
+ onClick: w
879
+ }, /* @__PURE__ */ r.createElement("div", {
880
+ className: "rte-preview-device-picker"
881
+ }, /* @__PURE__ */ r.createElement("select", {
882
+ value: L,
883
+ onChange: (b) => P(b.target.value)
884
+ }, Object.entries(z).map(([b, A]) => /* @__PURE__ */ r.createElement("option", {
885
+ key: b,
886
+ value: b
887
+ }, A.label)))), L === "web" && /* @__PURE__ */ r.createElement("div", {
888
+ className: "rte-preview-web-wrapper"
889
+ }, /* @__PURE__ */ r.createElement("div", {
890
+ className: "rte-preview-card"
891
+ }, /* @__PURE__ */ r.createElement("div", {
892
+ className: "rte-preview-content",
780
893
  dangerouslySetInnerHTML: {
781
- __html: M(r)
894
+ __html: R(a)
782
895
  }
783
- });
784
- }, Gt = ({
785
- visible: r,
786
- linkData: s,
896
+ }), /* @__PURE__ */ r.createElement("div", {
897
+ className: "rte-preview-meta"
898
+ }, "Data updated as on Dec 14, 2025"), /* @__PURE__ */ r.createElement("div", {
899
+ className: "rte-preview-footer"
900
+ }, /* @__PURE__ */ r.createElement("div", {
901
+ className: "rte-preview-actions"
902
+ }, /* @__PURE__ */ r.createElement(Be, {
903
+ className: "rte-preview-like"
904
+ }), /* @__PURE__ */ r.createElement(qe, {
905
+ className: "rte-preview-like"
906
+ })), /* @__PURE__ */ r.createElement("div", {
907
+ className: "rte-preview-time"
908
+ }, "Dec 26, 2025 5:57 PM")))), L !== "web" && /* @__PURE__ */ r.createElement("div", {
909
+ className: "rte-preview-mobile-overlay"
910
+ }, /* @__PURE__ */ r.createElement("div", {
911
+ className: "rte-preview-mobile-frame",
912
+ style: {
913
+ width: z[L].width,
914
+ height: z[L].height
915
+ }
916
+ }, /* @__PURE__ */ r.createElement("div", {
917
+ className: "rte-preview-mobile-header"
918
+ }, /* @__PURE__ */ r.createElement("div", {
919
+ className: "rte-preview-logo"
920
+ }, "A"), /* @__PURE__ */ r.createElement("div", {
921
+ className: "rte-preview-bell"
922
+ }, "🔔", /* @__PURE__ */ r.createElement("span", {
923
+ className: "rte-preview-badge"
924
+ }, "99+"))), /* @__PURE__ */ r.createElement("div", {
925
+ className: "rte-preview-tabs-wrapper"
926
+ }, /* @__PURE__ */ r.createElement("div", {
927
+ className: "rte-preview-tabs"
928
+ }, /* @__PURE__ */ r.createElement("div", {
929
+ className: "rte-preview-tab rte-preview-tab-active"
930
+ }, "My Alerts"), /* @__PURE__ */ r.createElement("div", {
931
+ className: "rte-preview-tab"
932
+ }, "Reportees Alerts"))), /* @__PURE__ */ r.createElement("div", {
933
+ className: "rte-preview-mobile-body"
934
+ }, /* @__PURE__ */ r.createElement("div", {
935
+ className: "rte-preview-card"
936
+ }, /* @__PURE__ */ r.createElement("div", {
937
+ className: "rte-preview-content",
938
+ dangerouslySetInnerHTML: {
939
+ __html: R(a)
940
+ }
941
+ }), /* @__PURE__ */ r.createElement("div", {
942
+ className: "rte-preview-meta"
943
+ }, "Data updated as on ", N()), /* @__PURE__ */ r.createElement("div", {
944
+ className: "rte-preview-footer"
945
+ }, /* @__PURE__ */ r.createElement("div", {
946
+ className: "rte-preview-actions"
947
+ }, /* @__PURE__ */ r.createElement(Be, {
948
+ className: "rte-preview-like"
949
+ }), /* @__PURE__ */ r.createElement(qe, {
950
+ className: "rte-preview-like"
951
+ })), /* @__PURE__ */ r.createElement("div", {
952
+ className: "rte-preview-time"
953
+ }, $())))))), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement("h3", {
954
+ style: {
955
+ marginBottom: 10
956
+ }
957
+ }, "Enter Attribute Values"), /* @__PURE__ */ r.createElement("div", {
958
+ className: "rte-attr-list"
959
+ }, Object.keys(h).map((b) => /* @__PURE__ */ r.createElement("div", {
960
+ key: b,
961
+ className: "rte-attr-row"
962
+ }, /* @__PURE__ */ r.createElement("div", {
963
+ className: "rte-attr-name"
964
+ }, `{{${b}}}`), /* @__PURE__ */ r.createElement("span", null, " : "), /* @__PURE__ */ r.createElement("input", {
965
+ className: "rte-attr-input",
966
+ value: h[b],
967
+ onChange: (A) => v((_) => ae(re({}, _), {
968
+ [b]: A.target.value
969
+ })),
970
+ placeholder: "Enter value"
971
+ }))))));
972
+ }, on = ({
973
+ visible: a,
974
+ linkData: d,
787
975
  onClose: u,
788
- onInsert: g
976
+ onInsert: h
789
977
  }) => {
790
- const [h, M] = D(""), [L, T] = D(""), [y, S] = D(""), [w, x] = D("_self");
978
+ const [v, L] = H(""), [P, z] = H(""), [w, S] = H(""), [R, N] = H("_self");
791
979
  if (U(() => {
792
- r ? (M(s.url || ""), T(s.text || ""), S(s.title || ""), x(s.target || "_self")) : (M(""), T(""), S(""), x("_self"));
793
- }, [r, s]), !r) return null;
794
- const P = () => {
795
- g({
796
- url: h,
797
- text: L,
798
- title: y,
799
- target: w
980
+ a ? (L(d.url || ""), z(d.text || ""), S(d.title || ""), N(d.target || "_self")) : (L(""), z(""), S(""), N("_self"));
981
+ }, [a, d]), !a) return null;
982
+ const $ = () => {
983
+ h({
984
+ url: v,
985
+ text: P,
986
+ title: w,
987
+ target: R
800
988
  });
801
989
  };
802
- return /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("div", {
990
+ return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", {
803
991
  className: "rte-link-modal-overlay",
804
992
  onClick: u
805
- }), /* @__PURE__ */ i.createElement("div", {
993
+ }), /* @__PURE__ */ r.createElement("div", {
806
994
  className: "rte-link-modal"
807
- }, /* @__PURE__ */ i.createElement("h4", {
995
+ }, /* @__PURE__ */ r.createElement("h4", {
808
996
  className: "rte-link-modal__title"
809
- }, h ? "Edit Link" : "Insert Link"), /* @__PURE__ */ i.createElement("input", {
997
+ }, v ? "Edit Link" : "Insert Link"), /* @__PURE__ */ r.createElement("input", {
810
998
  type: "text",
811
999
  className: "rte-link-modal__input",
812
1000
  placeholder: "URL",
813
- value: h,
814
- onChange: (A) => M(A.target.value)
815
- }), /* @__PURE__ */ i.createElement("input", {
1001
+ value: v,
1002
+ onChange: (b) => L(b.target.value)
1003
+ }), /* @__PURE__ */ r.createElement("input", {
816
1004
  type: "text",
817
1005
  className: "rte-link-modal__input",
818
1006
  placeholder: "Text to Display",
819
- value: L,
820
- onChange: (A) => T(A.target.value)
821
- }), /* @__PURE__ */ i.createElement("input", {
1007
+ value: P,
1008
+ onChange: (b) => z(b.target.value)
1009
+ }), /* @__PURE__ */ r.createElement("input", {
822
1010
  type: "text",
823
1011
  className: "rte-link-modal__input",
824
1012
  placeholder: "Title",
825
- value: y,
826
- onChange: (A) => S(A.target.value)
827
- }), /* @__PURE__ */ i.createElement("select", {
828
- className: "rte-link-modal__select",
829
1013
  value: w,
830
- onChange: (A) => x(A.target.value)
831
- }, /* @__PURE__ */ i.createElement("option", {
1014
+ onChange: (b) => S(b.target.value)
1015
+ }), /* @__PURE__ */ r.createElement("select", {
1016
+ className: "rte-link-modal__select",
1017
+ value: R,
1018
+ onChange: (b) => N(b.target.value)
1019
+ }, /* @__PURE__ */ r.createElement("option", {
832
1020
  value: "_self"
833
- }, "Same tab"), /* @__PURE__ */ i.createElement("option", {
1021
+ }, "Same tab"), /* @__PURE__ */ r.createElement("option", {
834
1022
  value: "_blank"
835
- }, "New tab")), /* @__PURE__ */ i.createElement("div", {
1023
+ }, "New tab")), /* @__PURE__ */ r.createElement("div", {
836
1024
  className: "rte-link-modal__actions"
837
- }, /* @__PURE__ */ i.createElement("button", {
1025
+ }, /* @__PURE__ */ r.createElement("button", {
838
1026
  className: "rte-link-modal__btn",
839
1027
  onClick: u
840
- }, "Cancel"), /* @__PURE__ */ i.createElement("button", {
1028
+ }, "Cancel"), /* @__PURE__ */ r.createElement("button", {
841
1029
  className: "rte-link-modal__btn rte-link-modal__btn--ok",
842
- onClick: P
1030
+ onClick: $
843
1031
  }, "OK"))));
844
1032
  };
845
- function _e(r) {
846
- const s = /* @__PURE__ */ new Map();
847
- return r.forEach((u) => {
848
- s.set(u.name, u.value);
849
- }), Array.from(s.entries()).map(([u, g]) => ({
1033
+ function Ve(a) {
1034
+ const d = /* @__PURE__ */ new Map();
1035
+ return a.forEach((u) => {
1036
+ d.set(u.name, u.value);
1037
+ }), Array.from(d.entries()).map(([u, h]) => ({
850
1038
  name: u,
851
- value: g
1039
+ value: h
852
1040
  }));
853
1041
  }
854
- const rn = ({
855
- atSuggestions: r = [],
856
- showOutput: s = !1,
1042
+ const un = ({
1043
+ atSuggestions: a = [],
1044
+ showOutput: d = !1,
857
1045
  showPreview: u = !1,
858
- toolbarConfig: g = {
1046
+ toolbarConfig: h = {
859
1047
  link: !1,
860
1048
  image: !1,
861
1049
  emoji: !1,
@@ -869,269 +1057,269 @@ const rn = ({
869
1057
  staticUnorderedList: !1,
870
1058
  staticOrderedList: !1
871
1059
  },
872
- classNames: h = {},
873
- styles: M = {},
874
- handleGetHtml: L = () => {
1060
+ classNames: v = {},
1061
+ styles: L = {},
1062
+ handleGetHtml: P = () => {
875
1063
  },
876
- onChange: T = () => {
1064
+ onChange: z = () => {
877
1065
  },
878
- value: y,
1066
+ value: w,
879
1067
  onMentionSelect: S = () => {
880
1068
  },
881
- handleAddAttributes: w = () => {
1069
+ handleAddAttributes: R = () => {
882
1070
  }
883
1071
  }) => {
884
- var Ee, we, Ce, be, Le, xe, Re, Se, Me, Te, Ae, Ne;
885
- const x = W(null), [P, A] = D(y != null && y.length ? y : " "), [O, _] = D(""), [H, j] = D(!1), [z, $] = D({
1072
+ var xe, Se, Re, Ne, Me, Ae, Te, ke, ze, De, He, Oe;
1073
+ const N = Z(null), [$, b] = H(w != null && w.length ? w : " "), [A, _] = H(""), [B, O] = H(!1), [F, K] = H({
886
1074
  x: 0,
887
1075
  y: 0
888
- }), [Z, R] = D([]), F = W(null), X = W(null), [B, f] = D({
1076
+ }), [W, x] = H([]), D = Z(null), I = Z(null), [j, q] = H({
889
1077
  visible: !1,
890
1078
  x: 0,
891
1079
  y: 0
892
- }), [b, V] = D(!1), J = W(null), [Ie, de] = D({
1080
+ }), [Y, g] = H(!1), y = Z(null), [X, J] = H({
893
1081
  url: "",
894
1082
  text: "",
895
1083
  title: "",
896
1084
  target: "_self"
897
- }), Pe = {
1085
+ }), le = {
898
1086
  bold: !0,
899
1087
  italic: !0,
900
1088
  underline: !0,
901
1089
  removeFormat: !0,
902
- unorderedList: (Ee = g.unorderedList) != null ? Ee : !0,
903
- orderedList: (we = g.orderedList) != null ? we : !0,
904
- staticUnorderedList: (Ce = g.staticUnorderedList) != null ? Ce : !0,
905
- staticOrderedList: (be = g.staticOrderedList) != null ? be : !0,
1090
+ unorderedList: (xe = h.unorderedList) != null ? xe : !0,
1091
+ orderedList: (Se = h.orderedList) != null ? Se : !0,
1092
+ staticUnorderedList: (Re = h.staticUnorderedList) != null ? Re : !0,
1093
+ staticOrderedList: (Ne = h.staticOrderedList) != null ? Ne : !0,
906
1094
  align: !0,
907
- link: (Le = g.link) != null ? Le : !1,
908
- image: (xe = g.image) != null ? xe : !1,
909
- emoji: (Re = g.emoji) != null ? Re : !1,
910
- table: (Se = g.table) != null ? Se : !1,
911
- color: (Me = g.color) != null ? Me : !1,
912
- fontFamily: (Te = g.fontFamily) != null ? Te : !1,
913
- fontSize: (Ae = g.fontSize) != null ? Ae : !1,
914
- highlight: (Ne = g.fontSize) != null ? Ne : !1
915
- }, [qe, ne] = D(""), [ue, re] = D([]), q = () => x.current, N = () => {
916
- const e = Be(), t = /^<div[^>]*style=["'][^"']*font-size\s*:\s*\d+px[^"']*["'][^>]*>/.test(e.trim());
1095
+ link: (Me = h.link) != null ? Me : !1,
1096
+ image: (Ae = h.image) != null ? Ae : !1,
1097
+ emoji: (Te = h.emoji) != null ? Te : !1,
1098
+ table: (ke = h.table) != null ? ke : !1,
1099
+ color: (ze = h.color) != null ? ze : !1,
1100
+ fontFamily: (De = h.fontFamily) != null ? De : !1,
1101
+ fontSize: (He = h.fontSize) != null ? He : !1,
1102
+ highlight: (Oe = h.fontSize) != null ? Oe : !1
1103
+ }, [de, ee] = H(""), [oe, ue] = H([]), [fe, pe] = H({}), V = () => N.current, M = () => {
1104
+ const e = We(), t = /^<div[^>]*style=["'][^"']*font-size\s*:\s*\d+px[^"']*["'][^>]*>/.test(e.trim());
917
1105
  let n = e;
918
- t || (n = `<div style="font-size:12px">${e}</div>`), n = n.replace(/<(ul|ol)([^>]*)>[\s\S]*?<\/\1>/g, (o, p, E) => {
919
- if (/list-type=["']static["']/.test(E) || o.includes("data-hidden-array-start") || o.includes("data-hidden-array-end")) return o;
920
- const m = `<${p}${E}>`, c = '<span data-hidden-array-start="true" style="display:none">{{#arrayData}}</span>', v = '<span data-hidden-array-end="true" style="display:none">{{/arrayData}}</span>', C = `</${p}>`, I = o.replace(new RegExp(`^${m}`), "").replace(new RegExp(`${C}$`), "");
921
- return `${m}${c}${I}${v}${C}`;
922
- }), _(n), L == null || L(n);
923
- const a = ct(e);
924
- T(a);
925
- const d = Ye(), l = _e(d);
926
- JSON.stringify(l) !== JSON.stringify(ue) && (re(l), S(l));
927
- }, Be = () => {
928
- const e = q();
929
- if (!e) return P;
1106
+ t || (n = `<div style="font-size:12px">${e}</div>`), n = n.replace(/<(ul|ol)([^>]*)>[\s\S]*?<\/\1>/g, (i, p, E) => {
1107
+ if (/list-type=["']static["']/.test(E) || i.includes("data-hidden-array-start") || i.includes("data-hidden-array-end")) return i;
1108
+ const m = `<${p}${E}>`, s = '<span data-hidden-array-start="true" style="display:none">{{#arrayData}}</span>', f = '<span data-hidden-array-end="true" style="display:none">{{/arrayData}}</span>', C = `</${p}>`, T = i.replace(new RegExp(`^${m}`), "").replace(new RegExp(`${C}$`), "");
1109
+ return `${m}${s}${T}${f}${C}`;
1110
+ }), _(n), P == null || P(n);
1111
+ const l = mt(e);
1112
+ z(l);
1113
+ const c = et(), o = Ve(c);
1114
+ JSON.stringify(o) !== JSON.stringify(oe) && (ue(o), S(o), bt(o));
1115
+ }, We = () => {
1116
+ const e = V();
1117
+ if (!e) return $;
930
1118
  const t = e.cloneNode(!0);
931
- t.querySelectorAll("table div").forEach((a) => a.remove()), t.querySelectorAll("table").forEach((a) => {
932
- a.removeAttribute("data-has-resize-handle");
933
- }), t.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight"));
1119
+ t.querySelectorAll("table div").forEach((l) => l.remove()), t.querySelectorAll("table").forEach((l) => {
1120
+ l.removeAttribute("data-has-resize-handle");
1121
+ }), t.querySelectorAll(".rte-cell-highlight").forEach((l) => l.classList.remove("rte-cell-highlight"));
934
1122
  let n = t.innerHTML;
935
- return n = Ve(n), n;
936
- }, Ve = (e) => {
1123
+ return n = Xe(n), n;
1124
+ }, Xe = (e) => {
937
1125
  const t = document.createElement("div");
938
1126
  return t.innerHTML = e, t.querySelectorAll("tbody").forEach((n) => {
939
1127
  n.getAttribute("table-type") === "static" || (n.innerHTML = `{{#arrayData}}${n.innerHTML}{{/arrayData}}`);
940
1128
  }), t.innerHTML;
941
- }, K = () => {
1129
+ }, Q = () => {
942
1130
  const e = window.getSelection();
943
1131
  if (!e || e.rangeCount === 0) return;
944
1132
  const t = document.getElementById("rte-editor-body");
945
1133
  if (!t) return;
946
1134
  const n = e.getRangeAt(0);
947
- t.contains(n.startContainer) && (F.current = n.cloneRange());
948
- }, Y = () => {
1135
+ t.contains(n.startContainer) && (D.current = n.cloneRange());
1136
+ }, G = () => {
949
1137
  const e = window.getSelection();
950
- !e || !F.current || (e.removeAllRanges(), e.addRange(F.current));
951
- }, me = (e, t) => {
1138
+ !e || !D.current || (e.removeAllRanges(), e.addRange(D.current));
1139
+ }, ve = (e, t) => {
952
1140
  const n = window.getSelection();
953
- n && n.rangeCount > 0 && (F.current = n.getRangeAt(0)), Y(), document.execCommand(e, !1, t), N();
1141
+ n && n.rangeCount > 0 && (D.current = n.getRangeAt(0)), G(), document.execCommand(e, !1, t), M();
954
1142
  };
955
1143
  U(() => {
956
- const e = q();
957
- if (!e || !y) return;
958
- const t = Ue(y);
959
- e.innerHTML = t, N();
1144
+ const e = V();
1145
+ if (!e || !w) return;
1146
+ const t = Ze(w);
1147
+ e.innerHTML = t, M();
960
1148
  }, []);
961
- const Ue = (e) => e.replace(/(<table[\s\S]*?>[\s\S]*?<\/table>)/g, (t) => t.replace(/{{#arrayData}}/g, "").replace(/{{\/arrayData}}/g, ""));
1149
+ const Ze = (e) => e.replace(/(<table[\s\S]*?>[\s\S]*?<\/table>)/g, (t) => t.replace(/{{#arrayData}}/g, "").replace(/{{\/arrayData}}/g, ""));
962
1150
  U(() => () => {
963
1151
  document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
964
1152
  }, []), U(() => {
965
- w && w((e) => {
966
- Ke(e);
1153
+ R && R((e) => {
1154
+ Je(e);
967
1155
  });
968
1156
  }, []), U(() => {
969
- const e = q();
1157
+ const e = V();
970
1158
  if (!e) return;
971
1159
  e.querySelectorAll("table").forEach((n) => {
972
- n.hasAttribute("data-has-resize-handle") || (le(n), n.querySelectorAll("th, td").forEach((d) => Q(d)));
1160
+ n.hasAttribute("data-has-resize-handle") || (ge(n), n.querySelectorAll("th, td").forEach((c) => te(c)));
973
1161
  });
974
1162
  }, []);
975
- const ge = (e) => {
1163
+ const Ee = (e) => {
976
1164
  for (; e && e.nodeName !== "LI"; )
977
1165
  e = e.parentNode;
978
1166
  return e;
979
- }, fe = (e, t) => {
1167
+ }, we = (e, t) => {
980
1168
  var m;
981
1169
  const n = window.getSelection();
982
1170
  if (!(n != null && n.rangeCount)) return;
983
- const a = n.getRangeAt(0), d = ge(a.startContainer);
984
- let l, o;
1171
+ const l = n.getRangeAt(0), c = Ee(l.startContainer);
1172
+ let o, i;
985
1173
  const p = t === "insertStaticUnorderedList" || t === "insertStaticOrderedList";
986
- if (d) {
987
- let c = d.querySelector(e);
988
- c || (c = document.createElement(e), c.style.margin = "0", c.style.paddingLeft = "20px", d.appendChild(c)), o = c, l = document.createElement("li"), l.textContent = "​", o.appendChild(l);
1174
+ if (c) {
1175
+ let s = c.querySelector(e);
1176
+ s || (s = document.createElement(e), s.style.margin = "0", s.style.paddingLeft = "20px", c.appendChild(s)), i = s, o = document.createElement("li"), o.textContent = "​", i.appendChild(o);
989
1177
  } else {
990
1178
  document.execCommand(e === "ul" ? "insertUnorderedList" : "insertOrderedList");
991
- const c = q();
992
- if (o = c == null ? void 0 : c.querySelector(`${e}:last-child`), !o) return;
993
- p && o.setAttribute("list-type", "static"), l = o.querySelector("li:last-child");
1179
+ const s = V();
1180
+ if (i = s == null ? void 0 : s.querySelector(`${e}:last-child`), !i) return;
1181
+ p && i.setAttribute("list-type", "static"), o = i.querySelector("li:last-child");
994
1182
  }
995
1183
  const E = document.createRange();
996
- E.setStart(l, 0), E.collapse(!0), n.removeAllRanges(), n.addRange(E), (m = q()) == null || m.focus(), N();
997
- }, ae = (e, t) => {
998
- e === "insertOrderedList" || e === "insertStaticOrderedList" ? fe("ol", e) : e === "insertUnorderedList" || e === "insertStaticUnorderedList" ? fe("ul", e) : e.startsWith("justify") ? dt(e) : me(e, t), e === "insertTable" && pe(), e === "insertStaticTable" && pe("insertStaticTable");
999
- }, $e = (e) => {
1184
+ E.setStart(o, 0), E.collapse(!0), n.removeAllRanges(), n.addRange(E), (m = V()) == null || m.focus(), M();
1185
+ }, me = (e, t) => {
1186
+ e === "insertOrderedList" || e === "insertStaticOrderedList" ? we("ol", e) : e === "insertUnorderedList" || e === "insertStaticUnorderedList" ? we("ul", e) : e.startsWith("justify") ? gt(e) : ve(e, t), e === "insertTable" && be(), e === "insertStaticTable" && be("insertStaticTable");
1187
+ }, Ke = (e) => {
1000
1188
  const t = document.createElement("span");
1001
1189
  t.textContent = "​", e.insertNode(t), e.setStartAfter(t), e.collapse(!0);
1002
1190
  const n = t.getBoundingClientRect();
1003
- t.remove(), $({
1191
+ t.remove(), K({
1004
1192
  x: n.left,
1005
1193
  y: n.bottom + window.scrollY
1006
- }), R(r || []), j(!0), X.current = e.cloneRange();
1007
- }, We = () => {
1194
+ }), x(a || []), O(!0), I.current = e.cloneRange();
1195
+ }, Ye = () => {
1008
1196
  const e = window.getSelection();
1009
1197
  if (!e || e.rangeCount === 0) return null;
1010
1198
  const t = e.anchorNode;
1011
1199
  let n = e.anchorOffset;
1012
1200
  if (!t) return null;
1013
- let a = t;
1014
- for (a.nodeType !== Node.TEXT_NODE && (a.childNodes && a.childNodes[n] ? a = a.childNodes[n] : a = t.previousSibling); a; ) {
1015
- if (a.nodeType === Node.TEXT_NODE) {
1016
- const d = a.textContent || "", l = a === t ? n : d.length, o = d.lastIndexOf("@", l - 1);
1017
- if (o !== -1) {
1201
+ let l = t;
1202
+ for (l.nodeType !== Node.TEXT_NODE && (l.childNodes && l.childNodes[n] ? l = l.childNodes[n] : l = t.previousSibling); l; ) {
1203
+ if (l.nodeType === Node.TEXT_NODE) {
1204
+ const c = l.textContent || "", o = l === t ? n : c.length, i = c.lastIndexOf("@", o - 1);
1205
+ if (i !== -1) {
1018
1206
  const p = document.createRange();
1019
- return p.setStart(a, o), p.setEnd(a, l), p;
1207
+ return p.setStart(l, i), p.setEnd(l, o), p;
1020
1208
  }
1021
1209
  }
1022
- a = a.previousSibling;
1210
+ l = l.previousSibling;
1023
1211
  }
1024
1212
  return null;
1025
- }, Ze = (e) => {
1026
- var l;
1213
+ }, Qe = (e) => {
1214
+ var o;
1027
1215
  const t = window.getSelection();
1028
1216
  if (!t) return;
1029
- const n = We();
1030
- n ? (t.removeAllRanges(), t.addRange(n)) : X.current && (t.removeAllRanges(), t.addRange(X.current));
1031
- const a = document.createElement("span");
1032
- a.textContent = `{{${e.name}}}`, a.style.display = "inline", a.setAttribute("data-mention", e.value || e.name || "");
1217
+ const n = Ye();
1218
+ n ? (t.removeAllRanges(), t.addRange(n)) : I.current && (t.removeAllRanges(), t.addRange(I.current));
1219
+ const l = document.createElement("span");
1220
+ l.textContent = `{{${e.name}}}`, l.style.display = "inline", l.setAttribute("data-mention", e.value || e.name || ""), l.title = `{{${e.name}}}`;
1033
1221
  try {
1034
- const o = t.rangeCount ? t.getRangeAt(0) : null;
1035
- if (o)
1036
- o.deleteContents(), o.insertNode(a);
1222
+ const i = t.rangeCount ? t.getRangeAt(0) : null;
1223
+ if (i)
1224
+ i.deleteContents(), i.insertNode(l);
1037
1225
  else {
1038
- const m = document.createRange(), c = q();
1039
- m.selectNodeContents(c), m.collapse(!1), m.insertNode(a);
1226
+ const m = document.createRange(), s = V();
1227
+ m.selectNodeContents(s), m.collapse(!1), m.insertNode(l);
1040
1228
  }
1041
1229
  const p = document.createTextNode("​");
1042
- a.after(p);
1230
+ l.after(p);
1043
1231
  const E = document.createRange();
1044
1232
  E.setStartAfter(p), E.collapse(!0), t.removeAllRanges(), t.addRange(E);
1045
- } catch (o) {
1046
- console.error("insertMention error:", o);
1233
+ } catch (i) {
1234
+ console.error("insertMention error:", i);
1047
1235
  }
1048
- let d = _e([...ue, e]);
1049
- re(d), S(d), j(!1), (l = q()) == null || l.focus(), N();
1050
- }, Xe = (e) => {
1051
- const t = q();
1236
+ let c = Ve([...oe, e]);
1237
+ ue(c), S(c), O(!1), (o = V()) == null || o.focus(), M();
1238
+ }, Ge = (e) => {
1239
+ const t = V();
1052
1240
  if (!t) return;
1053
1241
  let n = null;
1054
- F.current && t.contains(F.current.startContainer) ? n = F.current.cloneRange() : (n = document.createRange(), n.selectNodeContents(t), n.collapse(!1));
1055
- const a = window.getSelection();
1056
- if (!a) return;
1057
- a.removeAllRanges(), a.addRange(n);
1058
- const d = document.createElement("span");
1059
- d.textContent = `{{${e.name}}}`, d.style.display = "inline", d.setAttribute("data-mention", e.value || e.name), n.insertNode(d);
1060
- const l = document.createTextNode(" ");
1061
- d.after(l);
1062
- const o = document.createRange();
1063
- o.setStartAfter(l), o.collapse(!0), a.removeAllRanges(), a.addRange(o), F.current = o.cloneRange(), t.focus();
1064
- }, Ke = (e) => {
1065
- e.forEach((t) => Xe(t)), re((t) => {
1066
- const n = [...t, ...e], a = Array.from(new Map(n.map((d) => [d.name, d])).values());
1067
- return S(a), a;
1068
- }), N();
1069
- }, Ye = () => {
1070
- const e = q();
1242
+ D.current && t.contains(D.current.startContainer) ? n = D.current.cloneRange() : (n = document.createRange(), n.selectNodeContents(t), n.collapse(!1));
1243
+ const l = window.getSelection();
1244
+ if (!l) return;
1245
+ l.removeAllRanges(), l.addRange(n);
1246
+ const c = document.createElement("span");
1247
+ c.textContent = `{{${e.name}}}`, c.style.display = "inline", c.setAttribute("data-mention", e.value || e.name), c.title = `{{${e.name}}}`, n.insertNode(c);
1248
+ const o = document.createTextNode(" ");
1249
+ c.after(o);
1250
+ const i = document.createRange();
1251
+ i.setStartAfter(o), i.collapse(!0), l.removeAllRanges(), l.addRange(i), D.current = i.cloneRange(), t.focus();
1252
+ }, Je = (e) => {
1253
+ e.forEach((t) => Ge(t)), ue((t) => {
1254
+ const n = [...t, ...e], l = Array.from(new Map(n.map((c) => [c.name, c])).values());
1255
+ return S(l), l;
1256
+ }), M();
1257
+ }, et = () => {
1258
+ const e = V();
1071
1259
  if (!e) return [];
1072
1260
  const t = e.querySelectorAll("span[data-mention]"), n = [];
1073
- return t.forEach((a) => {
1074
- const d = a.getAttribute("data-mention") || "", o = (a.textContent || "").match(/{{(.+?)}}/);
1075
- o && n.push({
1076
- name: o[1],
1077
- value: d
1261
+ return t.forEach((l) => {
1262
+ const c = l.getAttribute("data-mention") || "", i = (l.textContent || "").match(/{{(.+?)}}/);
1263
+ i && n.push({
1264
+ name: i[1],
1265
+ value: c
1078
1266
  });
1079
1267
  }), n;
1080
- }, Qe = (e) => {
1081
- var n, a, d;
1268
+ }, tt = (e) => {
1269
+ var n, l, c;
1082
1270
  const t = e.key.toLowerCase();
1083
- if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(t) && (e.preventDefault(), ae(t === "b" ? "bold" : t === "i" ? "italic" : t === "u" ? "underline" : "")), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
1084
- const l = window.getSelection(), o = l != null && l.anchorNode ? ge(l.anchorNode) : null;
1085
- if (!o) return;
1086
- if (((n = o.textContent) == null ? void 0 : n.replace(/\u200B/g, "").trim()) === "") {
1271
+ if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(t) && (e.preventDefault(), me(t === "b" ? "bold" : t === "i" ? "italic" : t === "u" ? "underline" : "")), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
1272
+ const o = window.getSelection(), i = o != null && o.anchorNode ? Ee(o.anchorNode) : null;
1273
+ if (!i) return;
1274
+ if (((n = i.textContent) == null ? void 0 : n.replace(/\u200B/g, "").trim()) === "") {
1087
1275
  e.preventDefault();
1088
- const E = o.parentElement, m = E == null ? void 0 : E.closest("li");
1276
+ const E = i.parentElement, m = E == null ? void 0 : E.closest("li");
1089
1277
  if (m) {
1090
- E == null || E.removeChild(o);
1091
- const c = document.createElement("p");
1092
- c.innerHTML = "<br />", (a = m.parentElement) == null || a.insertBefore(c, m.nextSibling);
1093
- const v = document.createRange();
1094
- v.setStart(c, 0), v.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(v);
1278
+ E == null || E.removeChild(i);
1279
+ const s = document.createElement("p");
1280
+ s.innerHTML = "<br />", (l = m.parentElement) == null || l.insertBefore(s, m.nextSibling);
1281
+ const f = document.createRange();
1282
+ f.setStart(s, 0), f.collapse(!0), o == null || o.removeAllRanges(), o == null || o.addRange(f);
1095
1283
  } else {
1096
- const c = o.closest("ul, ol");
1097
- if (c) {
1098
- const v = document.createElement("p");
1099
- v.innerHTML = "<br />", (d = c.parentElement) == null || d.insertBefore(v, c.nextSibling), c.removeChild(o);
1284
+ const s = i.closest("ul, ol");
1285
+ if (s) {
1286
+ const f = document.createElement("p");
1287
+ f.innerHTML = "<br />", (c = s.parentElement) == null || c.insertBefore(f, s.nextSibling), s.removeChild(i);
1100
1288
  const C = document.createRange();
1101
- C.setStart(v, 0), C.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(C);
1289
+ C.setStart(f, 0), C.collapse(!0), o == null || o.removeAllRanges(), o == null || o.addRange(C);
1102
1290
  }
1103
1291
  }
1104
- N();
1292
+ M();
1105
1293
  }
1106
1294
  }
1107
1295
  if (t === "backspace" || t === "delete") {
1108
- const l = window.getSelection();
1109
- if (!l || l.rangeCount === 0) return;
1110
- const o = l.getRangeAt(0);
1111
- if (o.cloneContents().querySelector("table"))
1296
+ const o = window.getSelection();
1297
+ if (!o || o.rangeCount === 0) return;
1298
+ const i = o.getRangeAt(0);
1299
+ if (i.cloneContents().querySelector("table"))
1112
1300
  return;
1113
- if (o.cloneContents().querySelectorAll(".rte-resize-handle").length > 0) {
1301
+ if (i.cloneContents().querySelectorAll(".rte-resize-handle").length > 0) {
1114
1302
  e.preventDefault(), e.stopPropagation();
1115
1303
  return;
1116
1304
  }
1117
1305
  }
1118
- }, Je = (e) => {
1306
+ }, nt = (e) => {
1119
1307
  if (e.data === "@") {
1120
1308
  const n = window.getSelection();
1121
1309
  if (!(n != null && n.rangeCount)) return;
1122
- const a = n.anchorNode;
1123
- if (oe(a))
1310
+ const l = n.anchorNode;
1311
+ if (he(l))
1124
1312
  return;
1125
1313
  setTimeout(() => {
1126
- $e(n.getRangeAt(0)), ne(""), R(r), j(!0);
1314
+ Ke(n.getRangeAt(0)), ee(""), x(a), O(!0);
1127
1315
  }, 0);
1128
1316
  return;
1129
1317
  }
1130
- if (H) {
1131
- setTimeout(() => he(), 0);
1318
+ if (B) {
1319
+ setTimeout(() => ye(), 0);
1132
1320
  return;
1133
1321
  }
1134
- }, oe = (e) => {
1322
+ }, he = (e) => {
1135
1323
  if (!e) return !1;
1136
1324
  let t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
1137
1325
  for (; t; ) {
@@ -1139,89 +1327,89 @@ const rn = ({
1139
1327
  t = t.parentElement;
1140
1328
  }
1141
1329
  return !1;
1142
- }, he = () => {
1143
- N();
1330
+ }, ye = () => {
1331
+ M();
1144
1332
  const e = window.getSelection();
1145
1333
  if (!e || !e.anchorNode) return;
1146
- if (oe(e.anchorNode)) {
1147
- j(!1);
1334
+ if (he(e.anchorNode)) {
1335
+ O(!1);
1148
1336
  return;
1149
1337
  }
1150
1338
  let t = e.anchorNode.textContent || "";
1151
1339
  t = t.replace(/\u00A0/g, " ");
1152
1340
  const n = t.match(/@([^\n]*)$/);
1153
1341
  if (!n) {
1154
- j(!1);
1342
+ O(!1);
1155
1343
  return;
1156
1344
  }
1157
- const a = n[1].trim().toLowerCase();
1158
- ne(a);
1159
- const d = r.filter((l) => l.name.toLowerCase().includes(a));
1160
- d.length > 0 ? (R(d), j(!0)) : j(!1);
1161
- }, Ge = (e) => {
1162
- var a;
1163
- const t = (a = e.target.files) == null ? void 0 : a[0];
1345
+ const l = n[1].trim().toLowerCase();
1346
+ ee(l);
1347
+ const c = a.filter((o) => o.name.toLowerCase().includes(l));
1348
+ c.length > 0 ? (x(c), O(!0)) : O(!1);
1349
+ }, rt = (e) => {
1350
+ var l;
1351
+ const t = (l = e.target.files) == null ? void 0 : l[0];
1164
1352
  if (!t) return;
1165
1353
  const n = new FileReader();
1166
- n.onload = (d) => {
1354
+ n.onload = (c) => {
1167
1355
  var C;
1168
- const l = (C = d.target) == null ? void 0 : C.result;
1169
- Y();
1170
- const o = window.getSelection();
1171
- let p = o && o.rangeCount ? o.getRangeAt(0) : null;
1356
+ const o = (C = c.target) == null ? void 0 : C.result;
1357
+ G();
1358
+ const i = window.getSelection();
1359
+ let p = i && i.rangeCount ? i.getRangeAt(0) : null;
1172
1360
  const E = document.createElement("img");
1173
- E.src = l, E.alt = t.name || "image", E.className = "rte-inserted-image", E.contentEditable = "true";
1174
- const m = q();
1361
+ E.src = o, E.alt = t.name || "image", E.className = "rte-inserted-image", E.contentEditable = "true";
1362
+ const m = V();
1175
1363
  if (!p || !m) {
1176
1364
  m == null || m.appendChild(E);
1177
- const I = document.createTextNode(" ");
1178
- m == null || m.appendChild(I);
1179
- const ie = document.createRange();
1180
- ie.setStartAfter(I), ie.collapse(!0), o == null || o.removeAllRanges(), o == null || o.addRange(ie), m == null || m.focus(), N(), e.target.value = "";
1365
+ const T = document.createTextNode(" ");
1366
+ m == null || m.appendChild(T);
1367
+ const ne = document.createRange();
1368
+ ne.setStartAfter(T), ne.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(ne), m == null || m.focus(), M(), e.target.value = "";
1181
1369
  return;
1182
1370
  }
1183
1371
  p.deleteContents(), p.insertNode(E);
1184
- const c = document.createTextNode(" ");
1185
- E.after(c);
1186
- const v = document.createRange();
1187
- v.setStartAfter(c), v.collapse(!0), o.removeAllRanges(), o.addRange(v), m.focus(), N(), e.target.value = "";
1372
+ const s = document.createTextNode(" ");
1373
+ E.after(s);
1374
+ const f = document.createRange();
1375
+ f.setStartAfter(s), f.collapse(!0), i.removeAllRanges(), i.addRange(f), m.focus(), M(), e.target.value = "";
1188
1376
  }, n.readAsDataURL(t);
1189
- }, et = (e) => {
1190
- var d;
1191
- Y();
1377
+ }, at = (e) => {
1378
+ var c;
1379
+ G();
1192
1380
  const t = window.getSelection();
1193
1381
  if (!(t != null && t.rangeCount)) return;
1194
- const n = t.getRangeAt(0), a = document.createTextNode(e);
1195
- n.insertNode(a), n.setStartAfter(a), n.collapse(!0), t.removeAllRanges(), t.addRange(n), (d = q()) == null || d.focus(), N();
1196
- }, pe = (e) => {
1197
- var c;
1198
- ft(), Y();
1382
+ const n = t.getRangeAt(0), l = document.createTextNode(e);
1383
+ n.insertNode(l), n.setStartAfter(l), n.collapse(!0), t.removeAllRanges(), t.addRange(n), (c = V()) == null || c.focus(), M();
1384
+ }, be = (e) => {
1385
+ var s;
1386
+ wt(), G();
1199
1387
  const t = document.createElement("table");
1200
- t.style.borderCollapse = "collapse", t.style.width = "100%", t.style.border = "1px solid #ccc", t.style.margin = "8px 0", t.style.position = "relative", t.style.textAlign = "center", h.table && t.classList.add(h.table);
1388
+ t.style.borderCollapse = "collapse", t.style.width = "310px", t.style.border = "1px solid #ccc", t.style.margin = "8px 0", t.style.position = "relative", t.style.textAlign = "center", v.table && t.classList.add(v.table);
1201
1389
  const n = document.createElement("thead");
1202
- h.thead && n.classList.add(h.thead);
1203
- const a = document.createElement("tbody");
1204
- h.tbody && a.classList.add(h.tbody), e === "insertStaticTable" && a.setAttribute("table-type", "static");
1205
- const d = document.createElement("tr");
1206
- h.tr && d.classList.add(h.tr);
1207
- const l = document.createElement("tr");
1208
- h.tr && l.classList.add(h.tr);
1209
- for (let v = 0; v < 2; v++) {
1390
+ v.thead && n.classList.add(v.thead);
1391
+ const l = document.createElement("tbody");
1392
+ v.tbody && l.classList.add(v.tbody), e === "insertStaticTable" && l.setAttribute("table-type", "static");
1393
+ const c = document.createElement("tr");
1394
+ v.tr && c.classList.add(v.tr);
1395
+ const o = document.createElement("tr");
1396
+ v.tr && o.classList.add(v.tr);
1397
+ for (let f = 0; f < 2; f++) {
1210
1398
  const C = document.createElement("th");
1211
- C.textContent = "", C.style.border = "1px solid #999", C.style.padding = "4px", C.style.position = "relative", C.style.backgroundColor = "lightgray", C.style.height = "20px", h.th && C.classList.add(h.th);
1212
- const I = document.createElement("td");
1213
- I.textContent = "", I.style.border = "1px solid #999", I.style.padding = "4px", I.style.position = "relative", I.style.backgroundColor = "#fff", I.style.height = "20px", h.td && I.classList.add(h.td), Q(C), Q(I), d.appendChild(C), l.appendChild(I);
1399
+ C.textContent = "", C.style.border = "1px solid #999", C.style.padding = "4px", C.style.position = "relative", C.style.backgroundColor = "lightgray", C.style.height = "20px", v.th && C.classList.add(v.th);
1400
+ const T = document.createElement("td");
1401
+ T.textContent = "", T.style.border = "1px solid #999", T.style.padding = "4px", T.style.position = "relative", T.style.backgroundColor = "#fff", T.style.minHeight = "20px", T.style.height = "20px", T.style.whiteSpace = "normal", T.style.wordBreak = "break-word", T.style.overflowWrap = "anywhere", T.style.lineHeight = "20px", T.style.minWidth = "20px", v.td && T.classList.add(v.td), te(C), te(T), c.appendChild(C), o.appendChild(T);
1214
1402
  }
1215
- n.appendChild(d), a.appendChild(l), t.appendChild(n), t.appendChild(a), le(t);
1216
- const o = window.getSelection();
1217
- if (!(o != null && o.rangeCount)) return;
1218
- const p = o.getRangeAt(0);
1403
+ n.appendChild(c), l.appendChild(o), t.appendChild(n), t.appendChild(l), ge(t);
1404
+ const i = window.getSelection();
1405
+ if (!(i != null && i.rangeCount)) return;
1406
+ const p = i.getRangeAt(0);
1219
1407
  p.collapse(!1), p.insertNode(t);
1220
1408
  const E = document.createElement("p");
1221
1409
  E.innerHTML = "<br/>", t.after(E);
1222
1410
  const m = document.createRange();
1223
- m.setStart(E, 0), m.collapse(!0), o.removeAllRanges(), o.addRange(m), (c = q()) == null || c.focus(), N();
1224
- }, le = (e) => {
1411
+ m.setStart(E, 0), m.collapse(!0), i.removeAllRanges(), i.addRange(m), (s = V()) == null || s.focus(), M();
1412
+ }, ge = (e) => {
1225
1413
  if (e.dataset.hasResizeHandle === "true") return;
1226
1414
  const t = document.createElement("div");
1227
1415
  Object.assign(t.style, {
@@ -1235,20 +1423,20 @@ const rn = ({
1235
1423
  zIndex: "20",
1236
1424
  borderRadius: "2px"
1237
1425
  }), t.contentEditable = "false", t.dataset.hasResizeHandle = "true", t.classList.add("rte-resize-handle");
1238
- let n = 0, a = 0, d = 0, l = 0;
1239
- t.addEventListener("mousedown", (o) => {
1240
- o.preventDefault(), n = o.clientX, a = o.clientY;
1426
+ let n = 0, l = 0, c = 0, o = 0;
1427
+ t.addEventListener("mousedown", (i) => {
1428
+ i.preventDefault(), n = i.clientX, l = i.clientY;
1241
1429
  const p = e.getBoundingClientRect();
1242
- d = p.width, l = p.height;
1243
- const E = (c) => {
1244
- const v = Math.max(100, d + (c.clientX - n)), C = Math.max(20, l + (c.clientY - a));
1245
- e.style.width = `${v}px`, e.style.height = `${C}px`, N();
1430
+ c = p.width, o = p.height;
1431
+ const E = (s) => {
1432
+ const f = Math.max(100, c + (s.clientX - n)), C = Math.max(20, o + (s.clientY - l));
1433
+ e.style.width = `${f}px`, e.style.height = `${C}px`, M();
1246
1434
  }, m = () => {
1247
- document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", m), N();
1435
+ document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", m), M();
1248
1436
  };
1249
1437
  document.addEventListener("mousemove", E), document.addEventListener("mouseup", m);
1250
1438
  }), e.appendChild(t);
1251
- }, Q = (e) => {
1439
+ }, te = (e) => {
1252
1440
  const t = document.createElement("div"), n = document.createElement("div");
1253
1441
  Object.assign(t.style, {
1254
1442
  position: "absolute",
@@ -1274,102 +1462,102 @@ const rn = ({
1274
1462
  MozUserSelect: "none",
1275
1463
  msUserSelect: "none",
1276
1464
  pointerEvents: "auto"
1277
- }), n.contentEditable = "false", n.classList.add("rte-resize-handle"), tt(e, t, n), e.appendChild(t), e.appendChild(n);
1278
- }, tt = (e, t, n) => {
1279
- let a = 0, d = 0, l = 0, o = 0;
1280
- t.addEventListener("mousedown", (c) => {
1281
- c.preventDefault(), a = c.clientX, l = e.offsetWidth, document.addEventListener("mousemove", p), document.addEventListener("mouseup", m);
1282
- }), n.addEventListener("mousedown", (c) => {
1283
- c.preventDefault(), d = c.clientY, o = e.offsetHeight, document.addEventListener("mousemove", E), document.addEventListener("mouseup", m);
1465
+ }), n.contentEditable = "false", n.classList.add("rte-resize-handle"), lt(e, t, n), e.appendChild(t), e.appendChild(n);
1466
+ }, lt = (e, t, n) => {
1467
+ let l = 0, c = 0, o = 0, i = 0;
1468
+ t.addEventListener("mousedown", (s) => {
1469
+ s.preventDefault(), l = s.clientX, o = e.offsetWidth, document.addEventListener("mousemove", p), document.addEventListener("mouseup", m);
1470
+ }), n.addEventListener("mousedown", (s) => {
1471
+ s.preventDefault(), c = s.clientY, i = e.offsetHeight, document.addEventListener("mousemove", E), document.addEventListener("mouseup", m);
1284
1472
  });
1285
- const p = (c) => {
1286
- const v = l + (c.clientX - a);
1287
- e.style.width = `${Math.max(30, v)}px`, N();
1288
- }, E = (c) => {
1289
- const v = o + (c.clientY - d);
1290
- e.style.height = `${Math.max(20, v)}px`, N();
1473
+ const p = (s) => {
1474
+ const f = o + (s.clientX - l);
1475
+ e.style.width = `${Math.max(30, f)}px`, M();
1476
+ }, E = (s) => {
1477
+ const f = i + (s.clientY - c);
1478
+ e.style.height = `${Math.max(20, f)}px`, M();
1291
1479
  }, m = () => {
1292
- document.removeEventListener("mousemove", p), document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", m), N();
1480
+ document.removeEventListener("mousemove", p), document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", m), M();
1293
1481
  };
1294
- }, nt = (e) => {
1482
+ }, ot = (e) => {
1295
1483
  const n = e.target.closest("td, th");
1296
- n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight")), n.classList.add("rte-cell-highlight"), f({
1484
+ n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((l) => l.classList.remove("rte-cell-highlight")), n.classList.add("rte-cell-highlight"), q({
1297
1485
  visible: !0,
1298
1486
  x: e.clientX,
1299
1487
  y: e.clientY,
1300
1488
  cell: n
1301
1489
  }));
1302
- }, ve = () => {
1490
+ }, Ce = () => {
1303
1491
  document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
1304
- }, rt = (e) => {
1305
- if (!B.cell) return;
1306
- const t = B.cell.closest("table"), n = B.cell.cellIndex, a = B.cell.parentElement.rowIndex, d = (l) => {
1307
- const o = l.tagName.toLowerCase(), p = document.createElement(o);
1308
- return p.textContent = "", p.style.cssText = l.style.cssText, Q(p), p;
1492
+ }, it = (e) => {
1493
+ if (!j.cell) return;
1494
+ const t = j.cell.closest("table"), n = j.cell.cellIndex, l = j.cell.parentElement.rowIndex, c = (o) => {
1495
+ const i = o.tagName.toLowerCase(), p = document.createElement(i);
1496
+ return p.textContent = "", p.style.cssText = o.style.cssText, te(p), p;
1309
1497
  };
1310
1498
  switch (e) {
1311
1499
  case "insertRowAbove": {
1312
- const l = t.rows[a], o = t.insertRow(a);
1313
- Array.from(l.cells).forEach((p) => {
1314
- o.appendChild(d(p));
1500
+ const o = t.rows[l], i = t.insertRow(l);
1501
+ Array.from(o.cells).forEach((p) => {
1502
+ i.appendChild(c(p));
1315
1503
  });
1316
1504
  break;
1317
1505
  }
1318
1506
  case "insertRowBelow": {
1319
- const l = t.rows[a], o = t.insertRow(a + 1);
1320
- Array.from(l.cells).forEach((p) => {
1321
- o.appendChild(d(p));
1507
+ const o = t.rows[l], i = t.insertRow(l + 1);
1508
+ Array.from(o.cells).forEach((p) => {
1509
+ i.appendChild(c(p));
1322
1510
  });
1323
1511
  break;
1324
1512
  }
1325
1513
  case "insertColLeft": {
1326
- Array.from(t.rows).forEach((l) => {
1327
- const o = l.cells[n];
1328
- l.insertBefore(d(o), o);
1514
+ Array.from(t.rows).forEach((o) => {
1515
+ const i = o.cells[n];
1516
+ o.insertBefore(c(i), i);
1329
1517
  });
1330
1518
  break;
1331
1519
  }
1332
1520
  case "insertColRight": {
1333
- Array.from(t.rows).forEach((l) => {
1334
- const o = l.cells[n];
1335
- l.insertBefore(d(o), o.nextSibling);
1521
+ Array.from(t.rows).forEach((o) => {
1522
+ const i = o.cells[n];
1523
+ o.insertBefore(c(i), i.nextSibling);
1336
1524
  });
1337
1525
  break;
1338
1526
  }
1339
1527
  case "deleteRow":
1340
- t.rows.length > 1 && t.deleteRow(a);
1528
+ t.rows.length > 1 && t.deleteRow(l);
1341
1529
  break;
1342
1530
  case "deleteCol":
1343
- Array.from(t.rows).forEach((l) => {
1344
- l.cells[n] && l.deleteCell(n);
1531
+ Array.from(t.rows).forEach((o) => {
1532
+ o.cells[n] && o.deleteCell(n);
1345
1533
  });
1346
1534
  break;
1347
1535
  }
1348
- N(), f(se(ce({}, B), {
1536
+ M(), q(ae(re({}, j), {
1349
1537
  visible: !1
1350
- })), ve();
1351
- }, at = () => {
1352
- K(), J.current = F.current, de({
1538
+ })), Ce();
1539
+ }, ct = () => {
1540
+ Q(), y.current = D.current, J({
1353
1541
  url: "",
1354
1542
  text: "",
1355
1543
  title: "",
1356
1544
  target: "_self"
1357
- }), V(!0);
1358
- }, ot = (e) => {
1545
+ }), g(!0);
1546
+ }, st = (e) => {
1359
1547
  const t = window.getSelection();
1360
- if (!t || !J.current) return;
1361
- t.removeAllRanges(), t.addRange(J.current);
1548
+ if (!t || !y.current) return;
1549
+ t.removeAllRanges(), t.addRange(y.current);
1362
1550
  let n = e.url.trim();
1363
1551
  /^https?:\/\//i.test(n) || (n = "https://" + n);
1364
- const a = document.createElement("a");
1365
- a.href = n, a.style.cursor = "pointer", a.style.outline = "none", a.textContent = e.text || n, a.title = e.title, a.target = e.target, a.contentEditable = "true";
1366
- const d = t.getRangeAt(0);
1367
- d.deleteContents(), d.insertNode(a);
1368
- const l = document.createTextNode(" ");
1369
- a.after(l);
1370
- const o = document.createRange();
1371
- o.setStartAfter(l), o.collapse(!0), t.removeAllRanges(), t.addRange(o), V(!1), N();
1372
- }, lt = (e) => {
1552
+ const l = document.createElement("a");
1553
+ l.href = n, l.style.cursor = "pointer", l.style.outline = "none", l.textContent = e.text || n, l.title = e.title, l.target = e.target, l.contentEditable = "true";
1554
+ const c = t.getRangeAt(0);
1555
+ c.deleteContents(), c.insertNode(l);
1556
+ const o = document.createTextNode(" ");
1557
+ l.after(o);
1558
+ const i = document.createRange();
1559
+ i.setStartAfter(o), i.collapse(!0), t.removeAllRanges(), t.addRange(i), g(!1), M();
1560
+ }, dt = (e) => {
1373
1561
  const t = e.target;
1374
1562
  if (t.tagName === "A") {
1375
1563
  const n = t;
@@ -1378,263 +1566,300 @@ const rn = ({
1378
1566
  return;
1379
1567
  }
1380
1568
  e.preventDefault();
1381
- const a = document.createRange();
1382
- a.selectNode(n), J.current = a, de({
1569
+ const l = document.createRange();
1570
+ l.selectNode(n), y.current = l, J({
1383
1571
  url: n.href,
1384
1572
  text: n.textContent || n.href,
1385
1573
  title: n.title,
1386
1574
  target: n.target
1387
- }), V(!0);
1575
+ }), g(!0);
1388
1576
  }
1389
- }, it = () => {
1390
- const e = q();
1577
+ }, ut = () => {
1578
+ const e = V();
1391
1579
  if (!e) return;
1392
1580
  const t = window.getSelection();
1393
- if ((!t || t.rangeCount === 0) && F.current) {
1394
- const c = window.getSelection();
1395
- c == null || c.removeAllRanges(), c == null || c.addRange(F.current);
1581
+ if ((!t || t.rangeCount === 0) && D.current) {
1582
+ const s = window.getSelection();
1583
+ s == null || s.removeAllRanges(), s == null || s.addRange(D.current);
1396
1584
  }
1397
1585
  const n = window.getSelection();
1398
1586
  if (!n || n.rangeCount === 0) return;
1399
- const a = n.getRangeAt(0);
1400
- Y(), document.execCommand("removeFormat", !1);
1401
- const d = a.cloneContents(), l = document.createElement("div");
1402
- l.appendChild(d);
1403
- const o = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, null), p = [];
1404
- for (; o.nextNode(); ) {
1405
- const c = o.currentNode, v = c.tagName.toUpperCase(), C = c.getAttribute && c.getAttribute("data-mention") !== null;
1406
- v !== "A" && !C && p.push(c);
1587
+ const l = n.getRangeAt(0);
1588
+ G(), document.execCommand("removeFormat", !1);
1589
+ const c = l.cloneContents(), o = document.createElement("div");
1590
+ o.appendChild(c);
1591
+ const i = document.createTreeWalker(o, NodeFilter.SHOW_ELEMENT, null), p = [];
1592
+ for (; i.nextNode(); ) {
1593
+ const s = i.currentNode, f = s.tagName.toUpperCase(), C = s.getAttribute && s.getAttribute("data-mention") !== null;
1594
+ f !== "A" && !C && p.push(s);
1407
1595
  }
1408
- for (let c = p.length - 1; c >= 0; c--) {
1409
- const v = p[c], C = v.parentNode;
1596
+ for (let s = p.length - 1; s >= 0; s--) {
1597
+ const f = p[s], C = f.parentNode;
1410
1598
  if (C) {
1411
- for (; v.firstChild; ) C.insertBefore(v.firstChild, v);
1412
- C.removeChild(v);
1599
+ for (; f.firstChild; ) C.insertBefore(f.firstChild, f);
1600
+ C.removeChild(f);
1413
1601
  }
1414
1602
  }
1415
- l.querySelectorAll("[style]").forEach((c) => c.removeAttribute("style")), a.deleteContents();
1603
+ o.querySelectorAll("[style]").forEach((s) => s.removeAttribute("style")), l.deleteContents();
1416
1604
  const E = document.createDocumentFragment();
1417
- for (; l.firstChild; ) E.appendChild(l.firstChild);
1418
- a.insertNode(E);
1605
+ for (; o.firstChild; ) E.appendChild(o.firstChild);
1606
+ l.insertNode(E);
1419
1607
  const m = document.createRange();
1420
- m.setStartAfter(a.endContainer.nodeType === Node.TEXT_NODE ? a.endContainer : a.startContainer), m.collapse(!0), n.removeAllRanges(), n.addRange(m), e.normalize(), N();
1421
- }, ct = (e) => {
1422
- var a;
1608
+ m.setStartAfter(l.endContainer.nodeType === Node.TEXT_NODE ? l.endContainer : l.startContainer), m.collapse(!0), n.removeAllRanges(), n.addRange(m), e.normalize(), M();
1609
+ }, mt = (e) => {
1610
+ var l;
1423
1611
  let t = e;
1424
1612
  t = t.replace(/{{#arrayData\d*}}/g, ""), t = t.replace(/{{\/arrayData\d*}}/g, "");
1425
1613
  const n = document.createElement("div");
1426
- return n.innerHTML = t, n.querySelectorAll("br").forEach((d) => {
1427
- d.replaceWith(`
1614
+ return n.innerHTML = t, n.querySelectorAll("br").forEach((c) => {
1615
+ c.replaceWith(`
1428
1616
  `);
1429
- }), n.querySelectorAll("p, div, tr").forEach((d) => {
1430
- d.insertAdjacentText("afterend", `
1617
+ }), n.querySelectorAll("p, div, tr").forEach((c) => {
1618
+ c.insertAdjacentText("afterend", `
1431
1619
  `);
1432
- }), n.querySelectorAll("table").forEach((d) => {
1433
- d.insertAdjacentText("afterend", `
1620
+ }), n.querySelectorAll("table").forEach((c) => {
1621
+ c.insertAdjacentText("afterend", `
1434
1622
  `);
1435
- }), ((a = n.textContent) == null ? void 0 : a.replace(/\n{3,}/g, `
1623
+ }), ((l = n.textContent) == null ? void 0 : l.replace(/\n{3,}/g, `
1436
1624
 
1437
1625
  `).trim()) || "";
1438
1626
  };
1439
- function st() {
1627
+ function ht() {
1440
1628
  const e = window.getSelection();
1441
1629
  if (!e || e.rangeCount === 0) return [];
1442
1630
  const t = e.getRangeAt(0);
1443
1631
  if (t.collapsed) {
1444
- let l = t.startContainer, o = l.nodeType === Node.ELEMENT_NODE ? l : l.parentElement;
1445
- const p = o == null ? void 0 : o.closest("td, th");
1632
+ let o = t.startContainer, i = o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement;
1633
+ const p = i == null ? void 0 : i.closest("td, th");
1446
1634
  return p ? [p] : [];
1447
1635
  }
1448
- const n = t.commonAncestorContainer, a = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement;
1449
- return Array.from(a.querySelectorAll("td, th")).filter((l) => {
1450
- const o = document.createRange();
1451
- return o.selectNodeContents(l), t.compareBoundaryPoints(Range.END_TO_START, o) < 0 && t.compareBoundaryPoints(Range.START_TO_END, o) > 0;
1636
+ const n = t.commonAncestorContainer, l = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement;
1637
+ return Array.from(l.querySelectorAll("td, th")).filter((o) => {
1638
+ const i = document.createRange();
1639
+ return i.selectNodeContents(o), t.compareBoundaryPoints(Range.END_TO_START, i) < 0 && t.compareBoundaryPoints(Range.START_TO_END, i) > 0;
1452
1640
  });
1453
1641
  }
1454
- function dt(e) {
1455
- const t = st();
1642
+ function gt(e) {
1643
+ const t = ht();
1456
1644
  if (t.length === 0) {
1457
- me(e);
1645
+ ve(e);
1458
1646
  return;
1459
1647
  }
1460
1648
  let n = "left";
1461
- e === "justifyCenter" && (n = "center"), e === "justifyRight" && (n = "right"), t.forEach((a) => {
1462
- a.style.textAlign = n;
1463
- }), N();
1649
+ e === "justifyCenter" && (n = "center"), e === "justifyRight" && (n = "right"), t.forEach((l) => {
1650
+ l.style.textAlign = n;
1651
+ }), M();
1464
1652
  }
1465
- const ut = (e) => {
1466
- e.preventDefault();
1467
- const t = e.clipboardData.items;
1468
- for (let m = 0; m < t.length; m++) {
1469
- const c = t[m];
1470
- if (c.kind === "file" && c.type.startsWith("image/"))
1471
- return;
1472
- c.kind === "string" && c.getAsString((v) => {
1473
- /<img\s/i.test(v);
1474
- });
1653
+ const ft = () => {
1654
+ const e = window.getSelection();
1655
+ if (!e || !e.anchorNode) return !1;
1656
+ let t = e.anchorNode.nodeType === Node.ELEMENT_NODE ? e.anchorNode : e.anchorNode.parentElement;
1657
+ for (; t; ) {
1658
+ if (t.tagName === "TABLE") return !0;
1659
+ t = t.parentElement;
1475
1660
  }
1476
- const n = e.clipboardData.getData("text/html") || "";
1477
- if (!n) return;
1478
- const a = document.createElement("div");
1479
- a.innerHTML = n;
1480
- const d = (m) => {
1481
- m.style.borderCollapse = "collapse", m.style.width = "100%", m.style.border = "1px solid #ccc", m.style.margin = "8px 0", m.style.position = "relative", m.style.textAlign = "center", m.querySelectorAll("th").forEach((c) => {
1482
- const v = c;
1483
- v.style.border = "1px solid #999", v.style.padding = "4px", v.style.position = "relative", v.style.backgroundColor = "lightgray", v.style.height = "20px";
1484
- }), m.querySelectorAll("td").forEach((c) => {
1485
- const v = c;
1486
- v.style.border = "1px solid #999", v.style.padding = "4px", v.style.position = "relative", v.style.backgroundColor = "#fff", v.style.height = "20px";
1487
- });
1661
+ return !1;
1662
+ }, pt = (e) => {
1663
+ if (ft()) {
1664
+ e.preventDefault();
1665
+ const m = e.clipboardData.getData("text/plain");
1666
+ if (!m) return;
1667
+ const s = window.getSelection();
1668
+ if (!s || !s.rangeCount) return;
1669
+ const f = s.getRangeAt(0);
1670
+ f.deleteContents();
1671
+ const C = m.split(/\r?\n/);
1672
+ C.forEach((T, ne) => {
1673
+ f.insertNode(document.createTextNode(T)), ne < C.length - 1 && f.insertNode(document.createElement("br"));
1674
+ }), f.collapse(!1), s.removeAllRanges(), s.addRange(f), M();
1675
+ return;
1676
+ }
1677
+ const t = e.clipboardData.getData("text/html") || "";
1678
+ if (!t) return;
1679
+ const n = document.createElement("div");
1680
+ if (n.innerHTML = t, n.querySelector("img")) {
1681
+ e.preventDefault();
1682
+ return;
1683
+ }
1684
+ e.preventDefault();
1685
+ const l = document.createElement("div");
1686
+ l.innerHTML = t;
1687
+ const c = (m) => {
1688
+ m.hasAttribute("data-has-resize-handle") || (m.style.borderCollapse = "collapse", m.style.width = "100%", m.style.border = "1px solid #ccc", m.style.margin = "8px 0", m.style.position = "relative", m.style.textAlign = "center", m.querySelectorAll("th").forEach((s) => {
1689
+ const f = s;
1690
+ f.style.border = "1px solid #999", f.style.padding = "4px", f.style.position = "relative", f.style.backgroundColor = "lightgray", f.style.height = "20px";
1691
+ }), m.querySelectorAll("td").forEach((s) => {
1692
+ const f = s;
1693
+ f.style.border = "1px solid #999", f.style.padding = "4px", f.style.position = "relative", f.style.backgroundColor = "#fff", f.style.height = "20px";
1694
+ }));
1488
1695
  };
1489
- a.querySelectorAll("table").forEach((m) => d(m));
1490
- const l = window.getSelection();
1491
- if (!l || !l.rangeCount) return;
1492
- const o = l.getRangeAt(0);
1493
- o.deleteContents();
1696
+ l.querySelectorAll("table").forEach((m) => c(m));
1697
+ const o = window.getSelection();
1698
+ if (!o || !o.rangeCount) return;
1699
+ const i = o.getRangeAt(0);
1700
+ i.deleteContents();
1494
1701
  const p = document.createDocumentFragment();
1495
- for (; a.firstChild; ) p.appendChild(a.firstChild);
1496
- o.insertNode(p), o.collapse(!1), l.removeAllRanges(), l.addRange(o);
1497
- const E = x.current;
1702
+ for (; l.firstChild; ) p.appendChild(l.firstChild);
1703
+ i.insertNode(p), i.collapse(!1), o.removeAllRanges(), o.addRange(i);
1704
+ const E = N.current;
1498
1705
  E && (E.querySelectorAll("table").forEach((m) => {
1499
- const c = m;
1500
- c.hasAttribute("data-has-resize-handle") || (le(c), c.querySelectorAll("th, td").forEach((v) => {
1501
- const C = v;
1502
- C.dataset.hasResizeHandles || Q(C);
1706
+ const s = m;
1707
+ s.hasAttribute("data-has-resize-handle") || (ge(s), s.querySelectorAll("th, td").forEach((f) => {
1708
+ const C = f;
1709
+ C.dataset.hasResizeHandles || te(C);
1503
1710
  }));
1504
- }), N());
1505
- }, mt = (e) => {
1506
- Y();
1711
+ }), M());
1712
+ }, vt = (e) => {
1713
+ G();
1507
1714
  const t = window.getSelection();
1508
1715
  if (!t || !t.rangeCount) return;
1509
- const n = t.getRangeAt(0), a = document.createElement("span");
1510
- a.style.fontSize = `${e}px`, a.appendChild(n.extractContents()), n.insertNode(a);
1511
- const d = document.createRange();
1512
- d.setStartAfter(a), d.collapse(!0), t.removeAllRanges(), t.addRange(d), N();
1513
- }, gt = () => {
1716
+ const n = t.getRangeAt(0), l = document.createElement("span");
1717
+ l.style.fontSize = `${e}px`, l.appendChild(n.extractContents()), n.insertNode(l);
1718
+ const c = document.createRange();
1719
+ c.setStartAfter(l), c.collapse(!0), t.removeAllRanges(), t.addRange(c), M();
1720
+ }, Et = () => {
1514
1721
  const e = window.getSelection();
1515
1722
  if (!e || !e.anchorNode) return null;
1516
1723
  const t = e.anchorNode;
1517
- if (oe(t) || t.nodeType !== Node.TEXT_NODE) return null;
1518
- const n = t.textContent || "", a = e.anchorOffset, d = n.lastIndexOf("@", a - 1);
1519
- if (d === -1) return null;
1520
- const l = n.substring(d + 1, a);
1521
- if (l.includes(" ") || l.includes(" ")) return null;
1522
- const o = document.createRange();
1523
- return o.setStart(t, d), o.setEnd(t, a), {
1524
- range: o,
1525
- query: l
1724
+ if (he(t) || t.nodeType !== Node.TEXT_NODE) return null;
1725
+ const n = t.textContent || "", l = e.anchorOffset, c = n.lastIndexOf("@", l - 1);
1726
+ if (c === -1) return null;
1727
+ const o = n.substring(c + 1, l);
1728
+ if (o.includes(" ") || o.includes(" ")) return null;
1729
+ const i = document.createRange();
1730
+ return i.setStart(t, c), i.setEnd(t, l), {
1731
+ range: i,
1732
+ query: o
1526
1733
  };
1527
- }, ye = () => {
1528
- const e = gt();
1734
+ }, Le = () => {
1735
+ const e = Et();
1529
1736
  if (!e) return;
1530
1737
  const {
1531
1738
  range: t,
1532
1739
  query: n
1533
- } = e, a = document.createElement("span");
1534
- a.textContent = "​", t.insertNode(a);
1535
- const d = a.getBoundingClientRect();
1536
- a.remove(), $({
1537
- x: d.left,
1538
- y: d.bottom + window.scrollY
1539
- }), ne(n.toLowerCase());
1540
- const l = r.filter((o) => o.name.toLowerCase().includes(n.toLowerCase()));
1541
- R(l), j(!0), X.current = t.cloneRange();
1740
+ } = e, l = document.createElement("span");
1741
+ l.textContent = "​", t.insertNode(l);
1742
+ const c = l.getBoundingClientRect();
1743
+ l.remove(), K({
1744
+ x: c.left,
1745
+ y: c.bottom + window.scrollY
1746
+ }), ee(n.toLowerCase());
1747
+ const o = a.filter((i) => i.name.toLowerCase().includes(n.toLowerCase()));
1748
+ x(o), O(!0), I.current = t.cloneRange();
1542
1749
  };
1543
- function ft() {
1544
- const e = x.current;
1750
+ function wt() {
1751
+ const e = N.current;
1545
1752
  if (!e) return;
1546
1753
  const t = window.getSelection();
1547
1754
  if (!t || t.rangeCount > 0 && e.contains(t.anchorNode))
1548
1755
  return;
1549
1756
  const n = document.createRange();
1550
- n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n), F.current = n.cloneRange();
1757
+ n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n), D.current = n.cloneRange();
1551
1758
  }
1552
- const ht = (e) => {
1759
+ const yt = (e) => {
1553
1760
  const t = e.target;
1554
- if (!t || !(t.textContent || "").match(/{{([\s\S]+?)}}/) || !x.current) return;
1555
- let l = t.firstChild;
1556
- if ((!l || l.nodeType !== Node.TEXT_NODE) && (l = t.childNodes[0]), !l || l.nodeType !== Node.TEXT_NODE) return;
1557
- const o = l.textContent || "", p = o.indexOf("{{"), E = o.indexOf("}}");
1761
+ if (!t || !(t.textContent || "").match(/{{([\s\S]+?)}}/) || !N.current) return;
1762
+ let o = t.firstChild;
1763
+ if ((!o || o.nodeType !== Node.TEXT_NODE) && (o = t.childNodes[0]), !o || o.nodeType !== Node.TEXT_NODE) return;
1764
+ const i = o.textContent || "", p = i.indexOf("{{"), E = i.indexOf("}}");
1558
1765
  if (p === -1 || E === -1) return;
1559
1766
  const m = window.getSelection();
1560
1767
  if (!m) return;
1561
- const c = document.createRange();
1562
- c.setStart(l, p), c.setEnd(l, E + 2), m.removeAllRanges(), m.addRange(c);
1768
+ const s = document.createRange();
1769
+ s.setStart(o, p), s.setEnd(o, E + 2), m.removeAllRanges(), m.addRange(s);
1770
+ }, bt = (e) => {
1771
+ pe((t) => {
1772
+ const n = {};
1773
+ return e.forEach((l) => {
1774
+ var c;
1775
+ n[l.name] = (c = t[l.name]) != null ? c : "";
1776
+ }), n;
1777
+ });
1778
+ }, Ct = () => {
1779
+ let e = A;
1780
+ return Object.entries(fe).forEach(([t, n]) => {
1781
+ if (n.trim()) {
1782
+ const l = new RegExp(`{{\\s*${t}\\s*}}`, "g");
1783
+ e = e.replace(l, n);
1784
+ }
1785
+ }), e;
1563
1786
  };
1564
- return /* @__PURE__ */ i.createElement("div", {
1565
- className: `rte-wrapper ${(h == null ? void 0 : h.wrapper) || ""}`,
1566
- style: M.wrapper
1567
- }, /* @__PURE__ */ i.createElement("div", {
1787
+ return /* @__PURE__ */ r.createElement("div", {
1788
+ className: `rte-wrapper ${(v == null ? void 0 : v.wrapper) || ""}`,
1789
+ style: L.wrapper
1790
+ }, /* @__PURE__ */ r.createElement("div", {
1568
1791
  style: {
1569
1792
  flex: 1
1570
1793
  }
1571
- }, /* @__PURE__ */ i.createElement(Kt, {
1572
- exec: ae,
1573
- saveSelection: K,
1574
- handleFileChange: Ge,
1575
- handleFontSizeChange: (e) => mt(e.target.value),
1576
- handleFontFamilyChange: (e) => ae("fontName", e.target.value),
1577
- insertEmoji: et,
1578
- handleLink: at,
1579
- removeFormatting: it,
1580
- visibleActions: Pe,
1581
- className: h.toolbar,
1582
- style: M.toolbar
1583
- }), /* @__PURE__ */ i.createElement("div", {
1584
- ref: x,
1794
+ }, /* @__PURE__ */ r.createElement(nn, {
1795
+ exec: me,
1796
+ saveSelection: Q,
1797
+ handleFileChange: rt,
1798
+ handleFontSizeChange: (e) => vt(e.target.value),
1799
+ handleFontFamilyChange: (e) => me("fontName", e.target.value),
1800
+ insertEmoji: at,
1801
+ handleLink: ct,
1802
+ removeFormatting: ut,
1803
+ visibleActions: le,
1804
+ className: v.toolbar,
1805
+ style: L.toolbar
1806
+ }), /* @__PURE__ */ r.createElement("div", {
1807
+ ref: N,
1585
1808
  id: "rte-editor-body",
1586
- className: `rte-editor ${(h == null ? void 0 : h.editor) || ""}`,
1587
- style: M.editor,
1809
+ className: `rte-editor ${(v == null ? void 0 : v.editor) || ""}`,
1810
+ style: L.editor,
1588
1811
  contentEditable: !0,
1589
1812
  suppressContentEditableWarning: !0,
1590
- onPaste: ut,
1813
+ onPaste: pt,
1591
1814
  onKeyUp: () => {
1592
- K(), ye();
1815
+ Q(), Le();
1593
1816
  },
1594
- onMouseUp: K,
1817
+ onMouseUp: Q,
1595
1818
  onInput: () => {
1596
- he(), K();
1819
+ ye(), Q();
1597
1820
  },
1598
- onKeyDown: Qe,
1599
- onBeforeInput: Je,
1600
- onContextMenu: nt,
1821
+ onKeyDown: tt,
1822
+ onBeforeInput: nt,
1823
+ onContextMenu: ot,
1601
1824
  onClick: (e) => {
1602
- lt(e), K(), ye();
1825
+ dt(e), Q(), Le();
1603
1826
  },
1604
- onDoubleClick: ht
1605
- }), /* @__PURE__ */ i.createElement(Yt, {
1606
- show: H,
1607
- position: z,
1608
- filtered: Z,
1609
- insertMention: Ze,
1610
- onClose: () => j(!1),
1611
- query: qe
1612
- }), s && /* @__PURE__ */ i.createElement("div", {
1613
- className: `rte-output ${(h == null ? void 0 : h.output) || ""}`,
1614
- style: M.output
1615
- }, /* @__PURE__ */ i.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ i.createElement("p", null, O)), /* @__PURE__ */ i.createElement(Qt, {
1616
- visible: B.visible,
1617
- x: B.x,
1618
- y: B.y,
1619
- onAction: rt,
1827
+ onDoubleClick: yt
1828
+ }), /* @__PURE__ */ r.createElement(rn, {
1829
+ show: B,
1830
+ position: F,
1831
+ filtered: W,
1832
+ insertMention: Qe,
1833
+ onClose: () => O(!1),
1834
+ query: de
1835
+ }), d && /* @__PURE__ */ r.createElement("div", {
1836
+ className: `rte-output ${(v == null ? void 0 : v.output) || ""}`,
1837
+ style: L.output
1838
+ }, /* @__PURE__ */ r.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ r.createElement("p", null, A)), /* @__PURE__ */ r.createElement(an, {
1839
+ visible: j.visible,
1840
+ x: j.x,
1841
+ y: j.y,
1842
+ onAction: it,
1620
1843
  onClose: () => {
1621
- f(se(ce({}, B), {
1844
+ q(ae(re({}, j), {
1622
1845
  visible: !1
1623
- })), ve();
1846
+ })), Ce();
1624
1847
  }
1625
- }), /* @__PURE__ */ i.createElement(Gt, {
1626
- visible: b,
1627
- linkData: Ie,
1628
- onClose: () => V(!1),
1629
- onInsert: ot
1630
- })), u ? /* @__PURE__ */ i.createElement(Jt, {
1631
- className: h.preview,
1632
- style: M.preview,
1633
- html: O
1848
+ }), /* @__PURE__ */ r.createElement(on, {
1849
+ visible: Y,
1850
+ linkData: X,
1851
+ onClose: () => g(!1),
1852
+ onInsert: st
1853
+ })), u ? /* @__PURE__ */ r.createElement(ln, {
1854
+ className: v.preview,
1855
+ style: L.preview,
1856
+ html: Ct(),
1857
+ attributes: fe,
1858
+ setAttributes: pe
1634
1859
  }) : null);
1635
1860
  };
1636
1861
  export {
1637
- rn as RichTextEditor,
1638
- Jt as RtePreview,
1639
- Kt as RteToolbar
1862
+ un as RichTextEditor,
1863
+ ln as RtePreview,
1864
+ nn as RteToolbar
1640
1865
  };